home *** CD-ROM | disk | FTP | other *** search
- #ifndef replicant_h
- #define replicant_h
- /* replicant.h -- Emerald replicant definitions -- 4/28/88 cjeffery */
- /* the replicant structure replaces the logfile entry header */
-
- #define REPSIGNATURE 0x42424242
-
- typedef struct {
- long rep_Signature, size, all, ptr;
- OID nextOID;
- char *image;
- } replicant, *replicantPtr;
-
- /* read replicant r data into buffer b */
- #define replicant_read(r,b,s) { \
- if((r)->ptr+(*(s)) > (r)->size) \
- (*(s)) = (r)->size - (r)->ptr; \
- (void)bcopy((r)->image+(r)->ptr,(char *)(b),(*(s)));\
- (r)->ptr += (*(s));\
- }
-
- #define MINREPLICANTSIZE 512
-
- #define replicant_create(rp) {\
- (rp) = emalloc(sizeof(replicant));\
- rp->image = emalloc(MINREPLICANTSIZE);\
- rp->rep_Signature = REPSIGNATURE; \
- rp->size = rp->ptr = 0;\
- rp->all = MINREPLICANTSIZE;\
- }
-
- #define replicant_destroy(rp){\
- emfree((rp)->image);\
- emfree(rp);\
- }
-
- extern CP_InitReplicant();
- extern replicantPtr replicant_diskread();
- extern long replicant_diskwrite();
- extern replicant_write();
- extern replicant_seek();
- extern replicantPtr CP_replicant;
- #endif
-