qse/ase/stx/object.h

62 lines
1.5 KiB
C
Raw Normal View History

2005-05-06 17:18:29 +00:00
/*
2005-05-22 04:11:54 +00:00
* $Id: object.h,v 1.14 2005-05-22 04:11:54 bacon Exp $
2005-05-06 17:18:29 +00:00
*/
#ifndef _XP_STX_OBJECT_H_
#define _XP_STX_OBJECT_H_
2005-05-08 07:39:51 +00:00
#include <xp/stx/stx.h>
2005-05-06 17:18:29 +00:00
#define XP_STX_IS_SMALLINT(x) (((x) & 0x01) == 0x01)
2005-05-10 15:15:58 +00:00
#define XP_STX_TO_SMALLINT(x) (((x) << 1) | 0x01)
2005-05-06 17:18:29 +00:00
#define XP_STX_FROM_SMALLINT(x) ((x) >> 1)
2005-05-10 15:15:57 +00:00
/* definitions for common objects */
2005-05-18 04:01:51 +00:00
#define XP_STX_CLASS_SIZE 8
2005-05-10 15:15:57 +00:00
#define XP_STX_CLASS_NAME 0
2005-05-18 04:01:51 +00:00
#define XP_STX_CLASS_SPEC 1
2005-05-10 15:15:57 +00:00
#define XP_STX_CLASS_METHODS 2
#define XP_STX_CLASS_SUPERCLASS 3
#define XP_STX_CLASS_VARIABLES 4
#define XP_STX_CLASS_CLASSVARS 5
#define XP_STX_CLASS_POOLDICT 6
#define XP_STX_CLASS_CATEGORY 7
2005-05-22 04:11:54 +00:00
struct xp_stx_class_t
{
xp_stx_objhdr_t header;
xp_stx_word_t name;
xp_stx_word_t spec;
xp_stx_word_t methods;
xp_stx_word_t superclass;
xp_stx_word_t variables;
xp_stx_word_t classvars;
xp_stx_word_t pooldict;
xp_stx_word_t category;
};
typedef struct xp_stx_class_t xp_stx_class_t;
2005-05-08 07:39:51 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2005-05-08 11:16:07 +00:00
xp_stx_word_t xp_stx_alloc_object (xp_stx_t* stx, xp_stx_word_t n);
xp_stx_word_t xp_stx_alloc_byte_object (xp_stx_t* stx, xp_stx_word_t n);
2005-05-21 15:55:50 +00:00
xp_stx_word_t xp_stx_alloc_char_object (
2005-05-10 08:21:10 +00:00
xp_stx_t* stx, const xp_stx_char_t* str);
2005-05-21 15:55:50 +00:00
xp_stx_word_t xp_stx_allocn_char_object (xp_stx_t* stx, ...);
2005-05-10 08:21:10 +00:00
2005-05-21 15:55:50 +00:00
xp_stx_word_t xp_stx_hash_char_object (xp_stx_t* stx, xp_stx_word_t idx);
2005-05-10 16:20:53 +00:00
xp_stx_word_t xp_stx_new_class (
xp_stx_t* stx, const xp_stx_char_t* name);
2005-05-10 12:00:43 +00:00
2005-05-15 18:37:00 +00:00
int xp_stx_lookup_global (
xp_stx_t* stx, xp_stx_word_t key, xp_stx_word_t* value);
2005-05-08 07:39:51 +00:00
#ifdef __cplusplus
}
#endif
2005-05-06 17:18:29 +00:00
#endif