Cheat Sheet


extern JRB make_jrb();   
extern JRB jrb_insert_str(JRB tree, char *key, Jval val);
extern JRB jrb_insert_int(JRB tree, int ikey, Jval val);
extern JRB jrb_insert_dbl(JRB tree, double dkey, Jval val);
extern JRB jrb_insert_gen(JRB tree, Jval key, Jval val, int (*func)(Jval,Jval));
extern JRB jrb_find_str(JRB root, char *key);
extern JRB jrb_find_int(JRB root, int ikey);
extern JRB jrb_find_dbl(JRB root, double dkey);
extern JRB jrb_find_gen(JRB root, Jval, int (*func)(Jval, Jval));
extern void jrb_delete_node(JRB node);  
extern void jrb_free_tree(JRB root);  
#define jrb_traverse(ptr, lst) \
  for(ptr = lst->flink; ptr != lst; ptr = ptr->flink))

extern Dllist new_dllist();
extern dll_append(Dllist, Jval);
extern dll_prepend(Dllist, Jval);
extern dll_insert_b(Dllist, Jval);
extern dll_insert_a(Dllist, Jval);
extern dll_delete_node(Dllist);
extern free_dllist(Dllist);
#define dll_traverse(ptr, lst) \
  for(ptr = lst->flink; ptr != lst; ptr = ptr->flink))

char *strchr(const char *s, int c);           /* Return NULL if not found */
char *strstr(const char *s1, const char *s2); /* Return NULL if not found */

int lstat(const char *restrict path, struct stat *restrict buf);
int stat(const char *restrict path, struct stat *restrict buf);

DIR * opendir(const char *dirname);
int closedir(DIR *dirp);
struct dirent *readdir(DIR *dirp);

     struct stat { 
         dev_t    st_dev;    /* device inode resides on */
         ino_t    st_ino;    /* inode's number */
         mode_t   st_mode;   /* inode protection mode */
         nlink_t  st_nlink;  /* number or hard links to the file */
         uid_t    st_uid;    /* user-id of owner */
         gid_t    st_gid;    /* group-id of owner */
         dev_t    st_rdev;   /* device type, for special file inode */
         off_t    st_size;   /* file size, in bytes */
     };

int chmod(const char *path, mode_t mode);
mode_t umask(mode_t cmask);
int system(const char *command);
int open(const char *path, int oflag, ...);