home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / LLS_BLOB.H < prev    next >
C/C++ Source or Header  |  1997-07-05  |  3KB  |  60 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /* =======================================================================
  4.     LLS_BLOB.h      Generic Singly Linked List for Binary Large OBjects.
  5.                     Linked Lists for variable size data-items.
  6.  
  7.                     v1.00  94-08-11
  8.  
  9.                     - Based on the LLS module for fixed size data-items.
  10.                     - Use the functions in the LLS module for operations
  11.                       not specific to Blobs. You can use LLSnodePtr() to
  12.                       obtain a pointer to the stored Blob.
  13.                     - Note that From and To suffixes to function names are
  14.                       implied in the Blob data related functions.
  15.  
  16.  _____              This version is Public Domain.
  17.  /_|__|             A.Reitsma, Delft, The Netherlands.
  18. /  | \  --------------------------------------------------------------- */
  19.  
  20. #ifndef LLS_BLOB__H
  21. #define LLS_BLOB__H
  22.  
  23. /* ---- LL blob system management and maintenance --------------------- */
  24.  
  25. int  LLSblobCreate( void );
  26.                         /* returns list number to use or -1 on failure. */
  27.                         /* MUST be called before using a list of blobs. */
  28.  
  29. /* ---- Node management --------------------------------------------------
  30.    Functions changing current node pointer to the new node.
  31.    A return value of -1 indicates a memory allocation problem.
  32. */
  33. int  LLSblobInsert( int List, void * Source, unsigned Size );
  34.                                           /* insert BEFORE current node */
  35. int  LLSblobAdd( int List, void * Source, unsigned Size );
  36.                                           /* insert AFTER current node  */
  37.  
  38. /* Functions NOT changing the current node pointer.
  39.    Especially intended for implementation of Queue's and Stacks.
  40. */
  41. int  LLSblobPrepend( int List, void * Source, unsigned Size );
  42.                                                 /* insert as first node */
  43. int  LLSblobAppend( int List, void * Source, unsigned Size );
  44.                                                 /* insert as last node  */
  45.  
  46. void LLSblobDelete( int List );
  47.         /* remove current node and free() the data.                     */
  48.         /* current node ptr moved to next node. UNLESS the deleted node */
  49.         /* was the last node: then current ptr moved to previous node   */
  50.  
  51. /* ---- stored data management -------------------------------------------
  52.    'return' typeless data. The return value is the size of the data.
  53.    The data is transferred to Destination.
  54.    If 'Destination' is NULL, the only action is returning the size.
  55. */
  56. unsigned LLSblobData( int List, void * Destination );
  57.  
  58. #endif /* LLS_BLOB__H */
  59. /* ==== LLS_BLOB.h  end =============================================== */
  60.