File: sod.h

package info (click to toggle)
multitee 3.0-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 144 kB
  • ctags: 243
  • sloc: ansic: 1,670; makefile: 32; sh: 15
file content (17 lines) | stat: -rw-r--r-- 508 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef SOD_H
#define SOD_H

/* a half-hearted attempt at a generic stack library */

#define SODdecl(foostack,foo) \
typedef struct foostack { struct foostack *next; foo data; } *foostack
  /* note that user must supply semicolon */

#define SODnext(x) ((x)->next)
#define SODdata(x) ((x)->data)
#define SODalloc(t,x,ralloc) ((t) ((ralloc)(sizeof(*x))))
#define SODpush(x,y) ((y)->next = (x),(x) = (y))
#define SODpop(x,y) ((y) = (x),(x) = (x)->next)
#define SODfree(u,rfree) ((rfree)((char *)(u)))

#endif