sacc

sacc - sacc(omys), simple console gopher client (config)
git clone git://git.codemadness.org/sacc
Log | Files | Refs | LICENSE

common.h (954B)


      1 #define clear(p)	do { void **_p = (void **)(p); free(*_p); *_p = NULL; } while (0);
      2 
      3 typedef struct item Item;
      4 typedef struct dir Dir;
      5 
      6 struct item {
      7 	char type;
      8 	char redtype;
      9 	char *username;
     10 	char *selector;
     11 	char *host;
     12 	char *port;
     13 	char *raw;
     14 	char *tag;
     15 	void *dat;
     16 	Item *entry;
     17 };
     18 
     19 struct dir {
     20 	Item *items;
     21 	size_t nitems;
     22 	size_t printoff;
     23 	size_t curline;
     24 };
     25 
     26 extern int interactive;
     27 
     28 extern void (*diag)(char *, ...);
     29 
     30 extern void die(const char *, ...);
     31 extern size_t mbsprint(const char *, size_t);
     32 #ifdef NEED_STRCASESTR
     33 extern char *strcasestr(const char *, const char *);
     34 #endif /* NEED_STRCASESTR */
     35 extern const char *typedisplay(char);
     36 extern int itemuri(Item *, char *, size_t);
     37 extern void yankitem(Item *);
     38 extern void uicleanup(void);
     39 extern void uidisplay(Item *);
     40 extern char *uiprompt(char *, ...);
     41 extern Item *uiselectitem(Item *);
     42 extern void uisetup(void);
     43 extern void uisigwinch(int);
     44 extern void uistatus(char *, ...);