Hi for all...

This code below, is useful for anyone in harbour code?

/* items hold at the virtual machine stack */
typedef struct _HB_ITEM
{
  HB_TYPE type;
  union
  {
     char                           *ptr;  /* for dynamic writing */
     struct hb_struArray     asArray;
     struct hb_struBlock     asBlock;
     struct hb_struDate      asDate;
     struct hb_struDouble    asDouble;
     struct hb_struInteger   asInteger;
     struct hb_struLogical   asLogical;
     struct hb_struLong      asLong;
     struct hb_struPointer   asPointer;
     struct hb_struHash      asHash;
     struct hb_struMemvar    asMemvar;
     struct hb_struRefer     asRefer;
     struct hb_struEnum      asEnum;
     struct hb_struExtRef    asExtRef;
     struct hb_struString    asString;
     struct hb_struSymbol    asSymbol;
     struct hb_struRecover   asRecover;
  } item;
} HB_ITEM, * PHB_ITEM, * HB_ITEM_value;


void hb_item_write( HB_TYPE type, PHB_ITEM *pItem, char *ptr)
{
   pItem->type = type;
   pItem->item->ptr = ptr;
}

/* Macros */
#define hb_item_write_array(item, ptr) hb_item_write(HB_IT_ARRAY, item, ptr) #define hb_item_write_block(item, ptr) hb_item_write(HB_IT_BLOCK, item, ptr) #define hb_item_write_date(item, ptr) hb_item_write(HB_IT_DATE, item, ptr) #define hb_item_write_double(item, ptr) hb_item_write(HB_IT_DOUBLE, item, ptr) #define hb_item_write_integer(item, ptr) hb_item_write(HB_IT_INTEGER, item, ptr) #define hb_item_write_logical(item, ptr) hb_item_write(HB_IT_LOGICAL, item, ptr) #define hb_item_write_long(item, ptr) hb_item_write(HB_IT_LONG, item, ptr) #define hb_item_write_pointer(item, ptr) hb_item_write(HB_IT_POINTER, item, ptr) #define hb_item_write_hash(item, ptr) hb_item_write(HB_IT_HASH, item, ptr) #define hb_item_write_memvar(item, ptr) hb_item_write(HB_IT_MEMVAR, item, ptr) #define hb_item_write_refer(item, ptr) hb_item_write(HB_IT_BYREF, item, ptr) // HB_IT_BYREF ??? #define hb_item_write_enum(item, ptr) hb_item_write(HB_IT_ENUM, item, ptr) #define hb_item_write_extef(item, ptr) hb_item_extef(HB_IT_EXTREF, item, ptr) #define hb_item_write_string(item, ptr) hb_item_extef(HB_IT_STRING, item, ptr) #define hb_item_write_symbol(item, ptr) hb_item_symbol(HB_IT_SYMBOL, item, ptr) //#define hb_item_write_recover(item, ptr) hb_item_recover(HB_IT_SYMBOL, item, ptr) RECOVER???

Thanks.

Ranier Vilela
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to