qse/ase/stx/class.h

82 lines
2.1 KiB
C
Raw Normal View History

2005-05-22 15:03:20 +00:00
/*
2005-09-11 15:15:35 +00:00
* $Id: class.h,v 1.14 2005-09-11 15:15:35 bacon Exp $
2005-05-22 15:03:20 +00:00
*/
#ifndef _XP_STX_CLASS_H_
#define _XP_STX_CLASS_H_
2005-08-18 15:28:18 +00:00
#include <xp/stx/stx.h>
2005-05-22 15:03:20 +00:00
/* definitions for common objects */
2005-05-26 15:39:32 +00:00
#define XP_STX_CLASS_SIZE 8
2005-05-25 16:44:05 +00:00
#define XP_STX_CLASS_SPEC 0
#define XP_STX_CLASS_METHODS 1
#define XP_STX_CLASS_SUPERCLASS 2
2005-05-26 15:39:32 +00:00
#define XP_STX_CLASS_SUBCLASSES 3
#define XP_STX_CLASS_NAME 4
#define XP_STX_CLASS_VARIABLES 5
#define XP_STX_CLASS_CLASS_VARIABLES 6
#define XP_STX_CLASS_POOL_DICTIONARIES 7
2005-05-25 16:44:05 +00:00
2005-05-26 15:39:32 +00:00
#define XP_STX_METACLASS_SIZE 5
2005-05-25 16:44:05 +00:00
#define XP_STX_METACLASS_SPEC 0
#define XP_STX_METACLASS_METHODS 1
#define XP_STX_METACLASS_SUPERCLASS 2
2005-05-26 15:39:32 +00:00
#define XP_STX_METACLASS_SUBCLASSES 3
#define XP_STX_METACLASS_INSTANCE_CLASS 4
2005-05-24 03:28:31 +00:00
2005-07-05 04:29:31 +00:00
#define XP_STX_SPEC_INDEXABLE_BITS 2
#define XP_STX_SPEC_INDEXABLE_MASK 3
2005-07-04 16:23:13 +00:00
#define XP_STX_SPEC_NOT_INDEXABLE 0
#define XP_STX_SPEC_WORD_INDEXABLE 1
#define XP_STX_SPEC_BYTE_INDEXABLE 2
#define XP_STX_SPEC_CHAR_INDEXABLE 3
2005-05-22 15:03:20 +00:00
struct xp_stx_class_t
{
xp_stx_objhdr_t header;
2005-07-04 16:23:13 +00:00
xp_word_t spec; /* indexable: 2, nfields: the rest */
2005-06-08 16:00:51 +00:00
xp_word_t methods;
xp_word_t superclass;
xp_word_t subclasses;
xp_word_t name;
xp_word_t variables;
xp_word_t class_variables;
xp_word_t pool_dictonaries;
2005-05-22 15:03:20 +00:00
};
2005-05-24 03:28:31 +00:00
struct xp_stx_metaclass_t
{
xp_stx_objhdr_t header;
2005-06-08 16:00:51 +00:00
xp_word_t spec;
xp_word_t methods;
xp_word_t superclass;
xp_word_t subclasses;
xp_word_t instance_class;
2005-05-24 03:28:31 +00:00
};
2005-05-22 15:03:20 +00:00
typedef struct xp_stx_class_t xp_stx_class_t;
2005-05-24 03:28:31 +00:00
typedef struct xp_stx_metaclass_t xp_stx_metaclass_t;
2005-05-22 15:03:20 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2005-06-08 16:00:51 +00:00
xp_word_t xp_stx_new_class (xp_stx_t* stx, const xp_char_t* name);
xp_word_t xp_stx_lookup_class (xp_stx_t* stx, const xp_char_t* name);
2005-05-22 15:03:20 +00:00
2005-06-29 16:01:32 +00:00
int xp_stx_get_instance_variable_index (
xp_stx_t* stx, xp_word_t class_index,
const xp_char_t* name, xp_word_t* index);
2005-07-03 16:37:01 +00:00
xp_word_t xp_stx_lookup_class_variable (
xp_stx_t* stx, xp_word_t class_index, const xp_char_t* name);
2005-09-11 15:15:35 +00:00
xp_word_t xp_stx_lookup_method (
xp_stx_t* stx, xp_word_t class_index, const xp_char_t* name);
2005-06-29 16:01:32 +00:00
2005-05-22 15:03:20 +00:00
#ifdef __cplusplus
}
#endif
#endif