cvs
2011-07-03 11:09:05 UTC
Hi group!
I am having problems writing working definition modules for a C
library (for use with gm2). Could someone share some experiences?
My questions are:
1. What to do with all the preprocessor definitions? I know some can
just be translated to constants but how do you translate something
like (0x20?):
#define GDBM_SYNC 0x20
2. What is the correct way to translate types like this one:
typedef struct {
char *dptr;
int dsize;
} datum;
3. Lines like this one:
extern GDBM_FILE gdbm_open __P((char *, int, int, int, void (*)()));
are really confusing. What does the __P do in C? How can this be
written in a definition module?
Thanks in advance
Christoph
I am having problems writing working definition modules for a C
library (for use with gm2). Could someone share some experiences?
My questions are:
1. What to do with all the preprocessor definitions? I know some can
just be translated to constants but how do you translate something
like (0x20?):
#define GDBM_SYNC 0x20
2. What is the correct way to translate types like this one:
typedef struct {
char *dptr;
int dsize;
} datum;
3. Lines like this one:
extern GDBM_FILE gdbm_open __P((char *, int, int, int, void (*)()));
are really confusing. What does the __P do in C? How can this be
written in a definition module?
Thanks in advance
Christoph