Browse Source

another change on class definition macro

master
Georg Hopp 14 years ago
parent
commit
2132f4fd90
  1. 6
      include/token/cclass.h
  2. 6
      include/token/crypt.h
  3. 5
      include/token/dyntype.h
  4. 5
      include/token/dyntype/hash.h
  5. 5
      include/token/packet.h
  6. 5
      tests/mock/class.h

6
include/token/cclass.h

@ -27,8 +27,10 @@
#define CCLASS_MAGIC 0xFEFE
#define CLASS(_class) \
typedef struct _##_class { \
const _CCLASS const class;
struct _##_class; \
typedef struct _##_class * _class; \
extern const _CCLASS const __##_class; \
struct _##_class
#define ENDC(_class) } * _class; \
extern const _CCLASS const __##_class;

6
include/token/crypt.h

@ -23,15 +23,15 @@
#include "token/cclass.h"
CLASS(CRYPT)
CLASS(CRYPT) {
const _CCLASS const class;
const char * algorithm;
const char * mode;
MCRYPT mcrypt;
size_t ivsize;
size_t keysize;
void * iv;
ENDC(CRYPT)
};
void * crypt_encrypt(
CRYPT _this,

5
include/token/dyntype.h

@ -37,7 +37,8 @@ enum DYNTYPE_TYPES {
};
CLASS(DYNTYPE)
CLASS(DYNTYPE) {
const _CCLASS const class;
enum DYNTYPE_TYPES type;
size_t size;
union _data {
@ -48,7 +49,7 @@ CLASS(DYNTYPE)
struct _DYNTYPE ** _array;
DYNTYPE_HASH _hash;
} data;
ENDC(DYNTYPE)
};
#include "token/dyntype/hash.h"

5
include/token/dyntype/hash.h

@ -30,12 +30,13 @@ struct _DYNTYPE_HASH;
#undef DYNTYPE_HASH
#define __DYNTYPE_HASH_H__
CLASS(DYNTYPE_HASH)
CLASS(DYNTYPE_HASH) {
const _CCLASS const class;
char ** keys;
DYNTYPE * values;
size_t size;
size_t used;
ENDC(DYNTYPE_HASH)
};
void dyntype_hash_set(DYNTYPE_HASH _this, const char * key, struct _DYNTYPE * value);

5
include/token/packet.h

@ -28,9 +28,10 @@ enum PACKET_CONTENT_KEYS {
};
CLASS(PACKET)
CLASS(PACKET) {
const _CCLASS const class;
DYNTYPE content[2];
ENDC(PACKET)
};
DYNTYPE packet_getHeader(PACKET _this);

5
tests/mock/class.h

@ -16,9 +16,10 @@ _reset()
#endif//_RESET
CLASS(MOCK_CLASS)
CLASS(MOCK_CLASS) {
const _CCLASS const class;
int value;
ENDC(MOCK_CLASS)
};
extern const _CCLASS const __MOCK_CLASS;

Loading…
Cancel
Save