util.h (907B)
1 #include <stdio.h> /* FILE */ 2 #include <X11/Intrinsic.h> /* Boolean */ 3 4 #include "data.h" /* struct bitmap, struct avl */ 5 6 #define ROUNDUP(x,y) (((x)+(y)-1)/(y)) 7 8 #define one(fp) ((unsigned char) getc(fp)) 9 #define sone(fp) ((long) one(fp)) 10 #define two(fp) num (fp, 2) 11 #define stwo(fp) snum(fp, 2) 12 #define four(fp) num (fp, 4) 13 #define sfour(fp) snum(fp, 4) 14 15 16 struct url { 17 const char *orig_url; 18 char *hostname; 19 char *port; 20 char *document; 21 }; 22 23 void alloc_bitmap(struct bitmap *); 24 struct avl *avladd(const char *, size_t, struct avl **, size_t); 25 26 void expandline(size_t); 27 const struct passwd *ff_getpw(const char **, const char *); 28 29 FILE *xfopen(const char *, const char *); 30 void *xmalloc(size_t); 31 void *xrealloc(void *, size_t); 32 char *xstrdup(const char *); 33 char *xmemdup(const char *, size_t); 34 35 struct url *parse_url(const char[]); 36 37 unsigned long num(FILE *, int); 38 long snum(FILE *, int);