home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / PROCWRKB.ZIP / BENCH1.ZIP / HDR / DLLIST.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-16  |  2.8 KB  |  62 lines

  1. /***( dllist.h )****************************************************************
  2. *                                                                              *
  3. *  Contains header info for generic doubly-linked list functions.              *
  4. *                                                                              *
  5. ********************************************************************************
  6. *                                                                              *
  7. *  Written: Dec  7, 1989 - SBF                                                 *
  8. *  Updated: MMM DD, YYYY - XXX (                                            )  *
  9. *                                                                              *
  10. *******************************************************************************/
  11.  
  12. #define MAXNUMDLL   64                        /* Maximum number of open lists */
  13.  
  14. #define SEL_SINGLE   0              /* Single selection mode for dll_scroll() */
  15. #define SEL_MULTI   1             /* Multiple selection mode for dll_scroll() */
  16.  
  17. #define ADD_SORT   0      /* Add entry in sorted order using compare function */
  18. #define ADD_NOSORT   1    /* Add entry with no sorting using compare function */
  19.  
  20. # if defined (UNIX)
  21. typedef char generic;                              /* Generic pointer type */
  22. # else
  23. typedef void generic;                                /* Generic pointer type */
  24. # endif
  25.  
  26. struct dll_entry                                    /* Generic list structure */
  27. {
  28.     struct dll_entry *dll_next;                  /* Pointer to next list entry */
  29.     struct dll_entry *dll_prev;              /* Pointer to previous list entry */
  30.     generic *dll_ptr;                                       /* Pointer to data */
  31. };
  32.  
  33. struct dll_cb      /* Control block structure to keep track of multiple lists */
  34. {
  35.     struct dll_entry *dll_head;                     /* Pointer to head of list */
  36.     struct dll_entry *dll_curr;               /* Pointer to current list entry */
  37.     PROTO (int (*dll_cmp), (generic *, generic *)); /* Ptr to comparison fn */
  38.     int dll_size;                                         /* Size of list data */
  39. };
  40.  
  41. struct sel_entry
  42. {
  43.     generic *sel_data;
  44. };
  45.  
  46. PROTO (int dll_add, (int, generic *, int));
  47. PROTO (int dll_close, (int));
  48. PROTO (generic *dll_curr, (int));
  49. PROTO (int dll_del, (int));
  50. PROTO (generic *dll_find, (int, generic *));
  51. PROTO (struct dll_entry *dll_getpos, (int));
  52. PROTO (generic *dll_next, (int));
  53. PROTO (int dll_open, (int (*)(), int));
  54. PROTO (generic *dll_prev, (int));
  55. PROTO (int dll_rebuild, (int, int (*)()));
  56. PROTO (generic *dll_seek, (int, int, int));
  57. PROTO (int dll_setpos, (int, struct dll_entry *));
  58.  
  59. PROTO (int dll_scroll, (int, int, int, int, int *, int, char *(*)(), int, int, int, int, int, ...));
  60. PROTO (int dll_scroll_close, (int *));
  61.  
  62.