home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / internet-tools / connect-line / cl / devkit / c / include / cl_prefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-12  |  8.7 KB  |  257 lines

  1. #ifndef INCLUDE_CL_PREFS_H
  2. #define INCLUDE_CL_PREFS_H
  3.  
  4. /*
  5.  *   Connectline 5.x cl_prefs.library definitions
  6.  *
  7.  *   $VER: 23.0
  8.  *
  9.  */
  10.  
  11.  
  12. #ifndef EXEC_TYPES_H
  13. #include <exec/types.h>
  14. #endif
  15.  
  16. #ifndef _CL_CL_USER_H
  17. #include <cl/cl_user.h>
  18. #endif
  19.  
  20. /* Obsolete, use clutil.library/CLU_OpenLibraryCode()! */
  21. #define CLP_VERSION 22
  22. #define CLP_NAME "CONNECTLINE:Libs/cl_prefs.library"
  23.  
  24. /*
  25.  *
  26.  * CLPrefsNotify
  27.  *
  28.  * Such a Message is send to your port every
  29.  * time any changes to the selected PrefsID
  30.  * happen
  31.  *
  32.  */
  33.  
  34. typedef struct CLMsg {
  35.     struct Message m;
  36.     ULONG id;
  37. } CLMsg;
  38.  
  39. #define MSG_PREFSNOTIFY 1
  40. #define MSGTYPE_PREFSNOTIFY MSG_PREFSNOTIFY
  41.  
  42. typedef struct CLPrefsNotifyMsg {
  43.     struct CLMsg clpnm_msg;        /* Standard CL Exec Message; DO NEVER EVER ReplyMsg() THIS, USE CLP_ReplyNotify() instead! */
  44.     ULONG clpnm_msgid;            /* set to CLPNM_ID_ */
  45.     ULONG clpnm_prefsID;        /* Prefs ID of changed node */
  46.     ULONG clpnm_subID;            /* SubID of changed node or TAGT_INVALID */
  47.     /* following fields are private! */
  48.  
  49. } CLPrefsNotifyMsg;
  50.  
  51. #define CLMessage CLMsg
  52. #define CLPrefsNotifyMessage CLPrefsNotifyMsg
  53.  
  54. /*
  55.  *  CLPrefsNotifyMsg Message IDs
  56.  */
  57.  
  58. #define CLPNM_ID_WRITE 0xb1acaf05    /* Item changed */
  59. #define CLPNM_ID_DELETE 0xb1acac61    /* Item deleted */
  60.  
  61. /*
  62.  *  Prototypes
  63.  */
  64.  
  65. #ifndef _NO_PROTO
  66. ULONG      CLP_GetPrefsSize( ULONG, ULONG );
  67. ULONG      CLP_GetPrefs( ULONG, ULONG, APTR, ULONG, APTR );
  68. ULONG      CLP_SetPrefs( ULONG, ULONG, APTR, ULONG, APTR );
  69. void      CLP_DeletePrefs( ULONG, ULONG );
  70. void      CLP_DeletePrefsID( ULONG );
  71. APTR      CLP_AddNotify( ULONG , struct MsgPort * );
  72. void      CLP_RemNotify( APTR );
  73. void      CLP_ReplyNotify( struct CLPrefsNotifyMsg * );
  74. ULONG      CLP_NextSubID( ULONG, ULONG );
  75. ULONG      CLP_PrevSubID( ULONG, ULONG );
  76. ULONG      CLP_MaxSubID( ULONG );
  77. STRPTR    CLP_GetSystemName( void );
  78. STRPTR    CLP_GetSystemAddress( void );
  79. void    CLP_MakeTempFileName( STRPTR namebuffer, LONG estimated_size );
  80. LONG    CLP_GetUser( STRPTR username, User *userstruct, UserProfile *profilestruct );
  81. LONG    CLP_SetUser( User *userstruct, UserProfile *profilestruct );
  82. LONG    CLP_GetUserByIndex( ULONG index, User *userstruct, UserProfile *profilestruct );
  83. void    CLP_AllocateUserlist( ULONG readwriteflg );
  84. void    CLP_FreeUserlist( void );
  85. LONG    CLP_NextUser( User *userstruct, UserProfile *profilestruct );
  86. LONG    CLP_DelUser( STRPTR username, ULONG delpathflg );
  87. ULONG    CLP_NumUsers( void );
  88. void    CLP_RequestMailerSem( struct Message *replymsg );
  89. void    CLP_FreeMailerSem( void );
  90. void    CLP_RemoveMailerSem( struct Message *replymsg );
  91. ULONG    CLP_PK_FindByStamp( APTR stamp, STRPTR idstore );
  92. ULONG    CLP_PK_Unpack( STRPTR packerid, STRPTR arcname, STRPTR destdir );
  93. ULONG    CLP_PK_PackA( STRPTR packerid, STRPTR arcname, STRPTR *files );
  94. ULONG    CLP_PK_Pack( STRPTR packerid, STRPTR arcname, ... );
  95. void    CLP_MakeSpoolName( STRPTR dest, STRPTR sysname, ULONG prespool );
  96. int        CLP_RenameToSpool( STRPTR prespoolname );
  97. void    CLP_MakeTrashName( STRPTR dest, STRPTR sysname, STRPTR oldfilename );
  98. void    CLP_PK_AllocSem( void );
  99. void    CLP_PK_FreeSem( void );
  100. STRPTR    CLP_GetSystemNameLowerCase( void );
  101. ULONG    CLP_PK_AttemptSem( void );
  102. int        CLP_RenameToSpoolSysname( STRPTR prespoolname, STRPTR newsysname );
  103. struct CLDBInfo * CLP_GetDBInfo( void );
  104. void     CLP_SaveDBInfo( void );
  105. LONG    CLP_GetNumNewUsers( void );
  106. STRPTR    CLP_GetGroupName( ULONG groupnum );
  107. ULONG    CLP_SetGroup( APTR grouparray, ULONG groupnum );
  108. ULONG    CLP_ClrGroup( APTR grouparray, ULONG groupnum );
  109. ULONG    CLP_GetGroup( APTR grouparray, ULONG groupnum );
  110. void    CLP_SaveGroupNames( void );
  111. struct PortInfo *CLP_GetPort( ULONG portnum );
  112. void    CLP_SavePorts( ULONG numports );
  113. ULONG    CLP_GetNumPorts( void );
  114. void    CLP_RegisterDBViewer( struct Task *sigtask, ULONG sigmask );
  115. void    CLP_PK_RereadPacker( void );
  116. STRPTR *CLP_PK_GetPackerList( void );
  117. int        CLP_CallEditor( STRPTR filename );
  118. ULONG   CLP_IsPasswordSet( struct User *user );
  119. ULONG   CLP_TestPassword( struct User *user, char *passwordtotest );
  120. void    CLP_SetPassword( struct User *user, char *newpassword );
  121. #endif
  122.  
  123. /*
  124.  *  SAS/C specific pragmas
  125.  */
  126.  
  127. #ifndef _NO_PRAG
  128. extern struct Library *CLPrefsBase;
  129. #pragma libcall CLPrefsBase CLP_GetPrefs 1e 9281005
  130. #pragma libcall CLPrefsBase CLP_SetPrefs 24 9281005
  131. #pragma libcall CLPrefsBase CLP_GetPrefsSize 2a 1002
  132. #pragma libcall CLPrefsBase CLP_DeletePrefs 30 1002
  133. #pragma libcall CLPrefsBase CLP_DeletePrefsID 36 001
  134. #pragma libcall CLPrefsBase CLP_AddNotify 3c 8002
  135. #pragma libcall CLPrefsBase CLP_RemNotify 42 801
  136. #pragma libcall CLPrefsBase CLP_ReplyNotify 48 801
  137. #pragma libcall CLPrefsBase CLP_NextSubID 4e 0802
  138. #pragma libcall CLPrefsBase CLP_PrevSubID 54 0802
  139. #pragma libcall CLPrefsBase CLP_MaxSubID 5a 001
  140. #pragma libcall CLPrefsBase CLP_GetSystemName 60 0
  141. #pragma libcall CLPrefsBase CLP_GetSystemAddress 66 0
  142. #pragma libcall CLPrefsBase CLP_MakeTempFileName 6c 0802
  143. #pragma libcall CLPrefsBase CLP_GetUser 72 A9803
  144. #pragma libcall CLPrefsBase CLP_GetUserByIndex 78 98003
  145. #pragma libcall CLPrefsBase CLP_SetUser 7e 9802
  146. #pragma libcall CLPrefsBase CLP_DelUser 84 0802
  147. #pragma libcall CLPrefsBase CLP_NextUser 8a 9802
  148. #pragma libcall CLPrefsBase CLP_NumUsers 90 0
  149. #pragma libcall CLPrefsBase CLP_AllocateUserlist 96 001
  150. #pragma libcall CLPrefsBase CLP_FreeUserlist 9c 0
  151. #pragma libcall CLPrefsBase CLP_RequestMailerSem a2 801
  152. #pragma libcall CLPrefsBase CLP_FreeMailerSem a8 0
  153. #pragma libcall CLPrefsBase CLP_RemoveMailerSem ae 801
  154. #pragma libcall CLPrefsBase CLP_PK_FindByStamp b4 9802
  155. #pragma libcall CLPrefsBase CLP_PK_Unpack ba A9803
  156. #pragma libcall CLPrefsBase CLP_PK_PackA c0 A9803
  157. #pragma tagcall CLPrefsBase CLP_PK_Pack c0 A9803
  158. #pragma libcall CLPrefsBase CLP_MakeSpoolName c6 09803
  159. #pragma libcall CLPrefsBase CLP_RenameToSpool cc 801
  160. #pragma libcall CLPrefsBase CLP_MakeTrashName d2 A9803
  161. #pragma libcall CLPrefsBase CLP_PK_AllocSem d8 0
  162. #pragma libcall CLPrefsBase CLP_PK_FreeSem de 0
  163. #pragma libcall CLPrefsBase CLP_GetSystemNameLowerCase e4 0
  164. #pragma libcall CLPrefsBase CLP_PK_AttemptSem ea 0
  165. #pragma libcall CLPrefsBase CLP_RenameToSpoolSysname f0 9802
  166. #pragma libcall CLPrefsBase CLP_GetDBInfo f6 0
  167. #pragma libcall CLPrefsBase CLP_SaveDBInfo fc 0
  168. #pragma libcall CLPrefsBase CLP_GetNumNewUsers 102 0
  169. #pragma libcall CLPrefsBase CLP_GetGroupName 108 001
  170. #pragma libcall CLPrefsBase CLP_SetGroup 10e 0802
  171. #pragma libcall CLPrefsBase CLP_ClrGroup 114 0802
  172. #pragma libcall CLPrefsBase CLP_GetGroup 11a 0802
  173. #pragma libcall CLPrefsBase CLP_SaveGroupNames 120 0
  174. #pragma libcall CLPrefsBase CLP_GetPort 126 001
  175. #pragma libcall CLPrefsBase CLP_SavePorts 12c 001
  176. #pragma libcall CLPrefsBase CLP_GetNumPorts 132 0
  177. #pragma libcall CLPrefsBase CLP_RegisterDBViewer 138 0802
  178. #pragma libcall CLPrefsBase CLP_PK_RereadPacker 13e 0
  179. #pragma libcall CLPrefsBase CLP_PK_GetPackerList 144 0
  180. #pragma libcall CLPrefsBase CLP_CallEditor 14a 801
  181. #pragma libcall CLPrefsBase CLP_IsPasswordSet 156 801
  182. #pragma libcall CLPrefsBase CLP_TestPassword 15c 9802
  183. #pragma libcall CLPrefsBase CLP_SetPassword 162 9802
  184. #endif
  185.  
  186. /*
  187.  * Tags for supported datatypes
  188.  */
  189.  
  190. #define TAGT_STANDARD            0                /* Vanilla structure */
  191. #define TAGT_STRING                (1L<<31)        /* ZTS */
  192. #define TAGT_LONG                (1L<<30)        /* Long */
  193. #define TAGT_NOL                (1L<<29)        /* Pointer to Named object list */
  194.  
  195. #define TAGT_USERMASK            0x1fffffff        /* SubID-Mask */
  196.  
  197. /*
  198.  *  Used by NextSubID(), PrevSubID(), MaxSubID() or in
  199.  *  CLPrefsNotifyMsgs
  200.  */
  201.  
  202. #define TAGT_INVALID            ((ULONG)~0)        /* Invalid ID */
  203.  
  204. /*
  205.  *        Return codes from CLP_PK_Unpack()
  206.  *
  207.  */
  208.  
  209. #define CLP_UNPK_OK 0
  210. #define CLP_UNPK_PACKERNOTFOUND 1        /* Packer unknown */
  211. #define CLP_UNPK_CANTOPENARC 2            /* Can't open archive file */
  212. #define CLP_UNPK_RUNPACKER 3            /* Running packer executable failed */
  213. #define CLP_UNPK_PACKERFAILED 4            /* Packer runs ok, but failed (probably archive corrupt) */
  214. #define CLP_UNPK_NOCLUE 5                /* Can't recognize packer type */
  215. #define CLP_UNPK_INVALIDDEST 6            /* Dest dir is invalid */
  216. #define CLP_UNPK_NOTSUPPORTED 7            /* Unpack not supported */
  217.  
  218. #define CLP_PACK_OK 0
  219. #define CLP_PACK_PACKERNOTFOUND 1        /* Packer unknown */
  220. #define CLP_PACK_CANTOPENARC 2            /* Can't open archive file */
  221. #define CLP_PACK_RUNPACKER 3            /* Running packer executable failed */
  222. #define CLP_PACK_PACKERFAILED 4            /* Packer runs ok, but failed */
  223. #define CLP_PACK_NOTSUPPORTED 5            /* pack not supported */
  224. #define CLP_PACK_SINGLEFILE 6            /* Not an Archiver  */
  225.  
  226. /*
  227.  *
  228.  *        CLDBInfo - Informational structure about
  229.  *      Msgs and System calls. Saved as Prefs/cldbinfo.clprefs
  230.  *
  231.  */
  232.  
  233. struct CLDBInfo {
  234.     ULONG    today;                // Aktuelles Datum
  235.  
  236.     ULONG    msg_board;            // Board Mails
  237.     ULONG    msg_priv;            // Private Mails
  238.     ULONG    msg_error;            // Error Mails
  239.     ULONG    msg_censored;        // Censored Mails
  240.     ULONG    msg_dupes;            // Killed Dupes
  241.     ULONG    msg_old;            // Killed old mails
  242.  
  243.     ULONG    calls;
  244.     ULONG    calls_noconnect;
  245.     ULONG    calls_nologin;
  246.     ULONG    calls_netcall;
  247.  
  248.     ULONG    calls_today;
  249.     ULONG    calls_today_noconnect;
  250.     ULONG    calls_today_nologin;
  251.     ULONG    calls_today_netcall;
  252.  
  253.     ULONG    calls_telnet, calls_today_telnet;
  254. };
  255.  
  256. #endif
  257.