#ifndef COOKIE_H

#define COOKIE_H

#include <stdio.h>

#define NULL_COOKIE 0l

typedef struct cookie_entry {
   union {
      unsigned long name_long;
      char name_array[4];
   } name;
   unsigned long value;
} CookieEntry;

#define CookieGetValue(x) (x)->value
#define CookieGetNameL(x) (x)->name.name_long
#define CookieGetNameS(x) (x)->name.name_array

void CookieSetL(CookieEntry *Cookie,long Name,long Value);
void CookieSetS(CookieEntry *Cookie,char *Name,long Value);
void CookiePrint(CookieEntry *Cookie);
void CookieInput(CookieEntry *Cookie);
int CookieIsNullCookie(CookieEntry *Cookie);
int CookieIsCookie(CookieEntry *Cookie,long Name);
int CookieRead(CookieEntry *Cookie,FILE *stream);
int CookieWrite(CookieEntry *Cookie,FILE *stream);

#endif
