home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2001 January / LCD_01_2001.iso / develop / cookies / ldg / cook_ldg.h
Encoding:
C/C++ Source or Header  |  2000-05-03  |  3.4 KB  |  92 lines

  1. /* Filename                    : Cook_ldg.h - Definition for the cookie shared library (LDG)
  2.  * Number of functions    : 5
  3.  * Version                    : 1.01
  4.  * Author                    : Nicolas Richeton ( nicolas.richeton@free.fr )
  5.  * Last update                : 20/04/2000
  6.  * Statut                    : Freeware
  7.  * Downloaded from        : http://nicosoft.free.atari.fr
  8.  * Comments                    : Based on the work of Thomas Much
  9.  * History                    : 20/04/2000 - Added LDG version
  10.  *                        16/02/2000 - First version
  11.  */
  12.  
  13. #include <ldg.h>
  14. #include <mgx_dos.h>
  15. #include    <portab.h>
  16.  
  17. LDG *Cookie_lib;
  18.  
  19. /* Functions */
  20.  
  21. COOKIE*    cdecl    ( *Cookie_GetCookieJar )( VOID );
  22. /* Name                : Get Cookie Jar - Get the 1st cookie of the cookie jar
  23.  * Definition        : COOKIE*    cdecl    ( *Cookie_GetCookieJar )( VOID );
  24.  * Prototype in    : cook_ldg.h
  25.  * Parameters        : None
  26.  * Answer            : Pointer on a COOKIE struct
  27.  * Author            : Nicolas Richeton ( nicolas.richeton@free.fr )
  28.  * Version            : 1.00
  29.  * Last update        : 20/04/2000
  30.  * Comments            : Based on the work of Thomas Much
  31.  * History            : 20/04/2000 - Converted to LDG
  32.  *                  16/02/2000 - First version
  33.  */
  34.  
  35. ULONG    cdecl    ( *Cookie_GetCookie )( ULONG id, ULONG *value );
  36. /* Name                : Get Cookie - Get the value of a cookie
  37.  * Definition        : ULONG    cdecl    ( *Cookie_GetCookie )( ULONG id, ULONG *value );
  38.  * Prototype in    : cook_ldg.h
  39.  * Parameters        : id - Id of the cookie
  40.  *                          *value - pointer on a long where the value will be written
  41.  * Answer            : (ULONG)1 - Ok
  42.  *                        : (ULONG)0 - Error (no such cookie or no cookie jar)
  43.  * Author            : Nicolas Richeton ( nicolas.richeton@free.fr )
  44.  * Version            : 1.00
  45.  * Last update        : 20/04/2000
  46.  * Comments            : Based on the work of Thomas Much
  47.  * History            : 20/04/2000 - Converted to LDG
  48.  *                  16/02/2000 - First version
  49.  */
  50.  
  51. ULONG    cdecl    ( *Cookie_NewCookie )( ULONG id, ULONG value );
  52. /* Name                : New Cookie - Create a new cookie 
  53.  * Definition        : ULONG    cdecl    ( *Cookie_NewCookie )( ULONG id, ULONG value );
  54.  * Prototype in    : cook_ldg.h
  55.  * Parameters        : id - Id of the cookie
  56.  *                          value - Value of the cookie
  57.  * Answer            : (ULONG)1 - Ok
  58.  *                        : (ULONG)0 - Error (not enough room or no cookie jar)
  59.  * Author            : Nicolas Richeton ( nicolas.richeton@free.fr )
  60.  * Version            : 1.00
  61.  * Last update        : 20/04/2000
  62.  * Comments            : Based on the work of Thomas Much
  63.  * History            : 20/04/2000 - Converted to LDG
  64.  *                  16/02/2000 - First version
  65.  */
  66.  
  67. ULONG    cdecl    ( *Cookie_RemoveCookie )( ULONG id );
  68. /* Name                : Remove Cookie - Remove a cookie from the cookie jar
  69.  * Definition        : ULONG    cdecl    ( *Cookie_RemoveCookie )( ULONG id );
  70.  * Prototype in    : cook_ldg.h
  71.  * Parameters        : id - Id of the cookie
  72.  * Answer            : (int)1 - Ok
  73.  *                        : (int)0 - Error (no such cookie or no cookie jar)
  74.  * Author            : Nicolas Richeton ( nicolas.richeton@free.fr )
  75.  * Version            : 1.00
  76.  * Last update        : 20/04/2000
  77.  * Comments            : Based on the work of Thomas Much
  78.  * History            : 20/04/2000 - Converted to LDG
  79.  *                  16/02/2000 - First version
  80.  */
  81.  
  82. VOID Cookie_Init( VOID    );
  83.  
  84. VOID Cookie_Init( VOID    )  /* Init library. Use it only after a successfull ldg_exec */
  85. {
  86.     Cookie_GetCookieJar    = ldg_find( "Cookie_GetCookieJar", Cookie_lib );
  87.     Cookie_GetCookie        = ldg_find( "Cookie_GetCookie", Cookie_lib );
  88.     Cookie_NewCookie        = ldg_find( "Cookie_NewCookie", Cookie_lib );         
  89.     Cookie_RemoveCookie    = ldg_find( "Cookie_RemoveCookie", Cookie_lib );         
  90. }
  91.  
  92.