home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume4 / rolodex / part2 / datadef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  1.9 KB  |  80 lines

  1. #define ABORTSTRING "\\"
  2. #define ABORTCHAR '\\'
  3.  
  4. #define MAXMATCHES 17
  5.  
  6. #define N_BASIC_FIELDS 8
  7. #define OTHER -1
  8.  
  9. typedef enum Basic_Field {
  10.  
  11.     R_NAME = 0, R_WORK_PHONE, R_HOME_PHONE, R_COMPANY, R_WORK_ADDRESS,
  12.     R_HOME_ADDRESS, R_REMARKS, R_UPDATED
  13.  
  14.   };    
  15.     
  16. extern char *Field_Names[];  
  17.   
  18. /* A Rolodex entry */
  19.  
  20. typedef struct {
  21.  
  22.     char *basicfields[N_BASIC_FIELDS];
  23.     int n_others;
  24.     char **other_fields;
  25.  
  26.   } Rolo_Entry, *Ptr_Rolo_Entry;
  27.  
  28.   
  29. #define get_basic_rolo_field(n,x) (((x) -> basicfields)[(n)])
  30. #define get_n_others(x) ((x) -> n_others)  
  31. #define get_other_field(n,x) (((x) -> other_fields)[n])
  32.   
  33. #define set_basic_rolo_field(n,x,s) (((x) -> basicfields[(n)]) = (s))
  34. #define set_n_others(x,n) (((x) -> n_others) = (n))
  35. #define incr_n_others(x) (((x) -> n_others)++)
  36. #define set_other_field(n,x,s) ((((x) -> other_fields)[n]) = (s))
  37.  
  38. typedef struct link {
  39.  
  40.     Ptr_Rolo_Entry entry;
  41.     int matched;
  42.     struct link *prev;
  43.     struct link *next;
  44.  
  45.   } Rolo_List, *Ptr_Rolo_List;
  46.  
  47.  
  48. #define get_next_link(x) ((x) -> next)
  49. #define get_prev_link(x) ((x) -> prev)
  50. #define get_entry(x)     ((x) -> entry)
  51. #define get_matched(x) ((x) -> matched)
  52.  
  53. #define set_next_link(x,y) (((x) -> next) = (y))
  54. #define set_prev_link(x,y) (((x) -> prev) = (y))
  55. #define set_entry(x,y) (((x) -> entry) = (y))
  56. #define set_matched(x) (((x) -> matched) = 1)
  57. #define unset_matched(x) (((x) -> matched) = 0);
  58.  
  59. extern Ptr_Rolo_List Begin_Rlist;
  60. extern Ptr_Rolo_List End_Rlist;
  61.  
  62. #define MAXLINELEN 80
  63. #define DIRPATHLEN 100
  64.  
  65. extern int changed;
  66. extern int reorder_file;
  67. extern int rololocked;
  68.  
  69. extern char *rolo_emalloc();
  70. extern char *malloc();
  71. extern Ptr_Rolo_List new_link_with_entry();
  72. extern char *copystr();
  73. extern int compare_links();
  74. extern char *timestring();
  75. extern char *homedir(), *libdir();
  76. extern char *getenv();
  77. extern char *ctime();
  78. extern char *select_search_string();
  79. extern int in_search_mode;
  80.