]> andersk Git - moira.git/blobdiff - include/moira.h
made clname & entity buffers instead of pointers;
[moira.git] / include / moira.h
index 8ba51be341c35851be62d22be823fe4f86f2c448..0e66d72c3e28e8786a58e2d54aeb51a46ee891ac 100644 (file)
@@ -5,31 +5,65 @@
  *
  *     Copyright (C) 1987 by the Massachusetts Institute of Technology
  *
- *     $Log$
- *     Revision 1.5  1987-08-02 21:50:25  wesommer
- *     Added function prototypes.
- *
- * Revision 1.4  87/06/23  16:13:36  wesommer
- * Added new request.
- * 
- * Revision 1.3  87/06/04  01:31:16  wesommer
- * Renamed retrieve to query.
- * 
- * Revision 1.2  87/06/01  03:33:32  wesommer
- * Added new procedure numbers.
- * 
  */
 
+#ifndef _sms_h_
+#define _sms_h_
+
+/* return values from queries (and error codes) */
+
 #include "sms_et.h"
+#define SMS_SUCCESS 0          /* Query was successful */
+
+#define SMS_VERSION_1 1                /* Version in use from 7/87 to 4/88 */
+#define SMS_VERSION_2 2                /* After 4/88, new query lib */
+
+/* return values for sms server calls, used by clients */
 
-#define SMS_VERSION_1 1
+#define SMS_CONT 0             /* Everything okay, continue sending values. */
+#define SMS_ABORT -1           /* Something went wrong don't send anymore
+                                  values. */
 
+/* Protocol operations */
 #define SMS_NOOP 0
 #define SMS_AUTH 1
 #define SMS_SHUTDOWN 2
 #define SMS_QUERY 3
 #define SMS_ACCESS 4
-#define SMS_MAX_PROC 4
+#define SMS_DO_UPDATE 5
+#define SMS_MOTD 6
+#define SMS_MAX_PROC 6
+
+/* values used in NFS physical flags */
+#define SMS_FS_STUDENT 0x0001
+#define        SMS_FS_FACULTY  0x0002
+#define SMS_FS_STAFF   0x0004
+#define SMS_FS_MISC    0x0008
+
+/* magic values to pass for list and user queries */
+#define UNIQUE_GID     "create unique GID"
+#define UNIQUE_UID     "create unique UID"
+#define UNIQUE_LOGIN   "create unique login ID"
+
+/* Structure used by Save Queue routines (for temporary storage of data) */
+struct save_queue
+{
+    struct save_queue *q_next;
+    struct save_queue *q_prev;
+    struct save_queue *q_lastget;
+    char *q_data;
+};
+
+/* Hash table declarations */
+struct bucket {
+    struct bucket *next;
+    int        key;
+    char *data;
+};
+struct hash {
+    int        size;
+    struct bucket **data;
+};
 
 #ifdef __STDC__
 int sms_connect();
@@ -43,6 +77,12 @@ int sms_query_internal(int argc, char **argv,
                       int (*callback)(), char *callarg);
 int sms_noop();
 int sms_shutdown(char *reason);
+struct save_queue *sq_create();
+struct hash *create_hash(int size);
+char *hash_lookup(struct hash *h, int key);
+char *strsave(char *s);
+char *strtrim(char *s);
+char *canonicalize_hostname(char *s);
 #else !__STDC__
 int sms_connect();
 int sms_disconnect();
@@ -51,4 +91,12 @@ int sms_access();
 int sms_query();
 int sms_noop();
 int sms_shutdown();
+struct save_queue *sq_create();
+struct hash *create_hash();
+char *hash_lookup();
+char *strsave();
+char *strtrim();
+char *canonicalize_hostname();
 #endif __STDC__
+
+#endif _sms_h_                 /* Do Not Add Anything after this line. */
This page took 0.037577 seconds and 4 git commands to generate.