geomyidae

A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log | Files | Refs | README | LICENSE

ind.h (1358B)


      1 /*
      2  * Copy me if you can.
      3  * by 20h
      4  */
      5 
      6 #ifndef IND_H
      7 #define IND_H
      8 
      9 #include <stdio.h>
     10 
     11 extern int glfd;
     12 
     13 typedef struct filetype filetype;
     14 struct filetype {
     15         char *end;
     16         char *type;
     17         void (* f)(int, char *, char *, char *, char *, char *, char *,
     18 		char *, char *, int, char *, char *);
     19 };
     20 
     21 filetype *gettype(char *filename);
     22 
     23 typedef struct gphelem gphelem;
     24 struct gphelem {
     25 	char **e;
     26 	int num;
     27 };
     28 
     29 typedef struct gphindex gphindex;
     30 struct gphindex {
     31 	gphelem **n;
     32 	int num;
     33 };
     34 
     35 gphindex *gph_scanfile(char *fname);
     36 gphelem *gph_getadv(char *str);
     37 int gph_printelem(int fd, gphelem *el, char *file, char *base, char *addr, char *port);
     38 void gph_addindex(gphindex *idx, gphelem *el);
     39 void gph_addelem(gphelem *e, char *s);
     40 void gph_freeindex(gphindex *i);
     41 void gph_freeelem(gphelem *e);
     42 
     43 void *xcalloc(size_t, size_t);
     44 void *xmalloc(size_t);
     45 void *xrealloc(void *, size_t);
     46 char *xstrdup(const char *str);
     47 int xsendfile(int, int);
     48 int pendingbytes(int sock);
     49 void waitforpendingbytes(int sock);
     50 char *smprintf(char *fmt, ...);
     51 char *reverselookup(char *host);
     52 void setcgienviron(char *file, char *path, char *port, char *base,
     53 		char *args, char *sear, char *ohost, char *chost,
     54 		char *bhost, int istls, char *sel, char *traverse);
     55 char *humansize(off_t n);
     56 char *humantime(const time_t *clock);
     57 void lingersock(int sock);
     58 
     59 #endif
     60