]> andersk Git - moira.git/blame_incremental - include/moira.h
added save_queue and hash_table definitions
[moira.git] / include / moira.h
... / ...
CommitLineData
1/*
2 * $Source$
3 * $Author$
4 * $Header$
5 *
6 * Copyright (C) 1987 by the Massachusetts Institute of Technology
7 *
8 */
9
10#ifndef _sms_h_
11#define _sms_h_
12
13/* return values from queries (and error codes) */
14
15#include "sms_et.h"
16#define SMS_SUCCESS 0 /* Query was successful */
17
18#define SMS_VERSION_1 1 /* Version in use from 7/87 to 4/88 */
19#define SMS_VERSION_2 2 /* After 4/88, new query lib */
20
21/* return values for sms server calls, used by clients */
22
23#define SMS_CONT 0 /* Everything okay, continue sending values. */
24#define SMS_ABORT -1 /* Something went wrong don't send anymore
25 values. */
26
27/* Protocol operations */
28#define SMS_NOOP 0
29#define SMS_AUTH 1
30#define SMS_SHUTDOWN 2
31#define SMS_QUERY 3
32#define SMS_ACCESS 4
33#define SMS_DO_UPDATE 5
34#define SMS_MAX_PROC 5
35
36/* values used in NFS physical flags */
37#define SMS_FS_STUDENT 0x0001
38#define SMS_FS_FACULTY 0x0002
39#define SMS_FS_STAFF 0x0004
40#define SMS_FS_MISC 0x0008
41
42/* magic values to pass for list and user queries */
43#define UNIQUE_GID "create unique GID"
44#define UNIQUE_UID "create unique UID"
45#define UNIQUE_LOGIN "create unique login ID"
46
47/* Structure used by Save Queue routines (for temporary storage of data) */
48struct save_queue
49{
50 struct save_queue *q_next;
51 struct save_queue *q_prev;
52 struct save_queue *q_lastget;
53 char *q_data;
54};
55
56/* Hash table declarations */
57struct bucket {
58 struct bucket *next;
59 int key;
60 char *data;
61};
62struct hash {
63 int size;
64 struct bucket **data;
65};
66
67#ifdef __STDC__
68int sms_connect();
69int sms_disconnect();
70int sms_auth();
71int sms_access(char *handle, int argc, char **argv);
72int sms_access_internal(int argc, char **argv);
73int sms_query(char *handle, int argc, char **argv,
74 int (*callback)(), char *callarg);
75int sms_query_internal(int argc, char **argv,
76 int (*callback)(), char *callarg);
77int sms_noop();
78int sms_shutdown(char *reason);
79struct save_queue *sq_create();
80struct hash *create_hash(int size);
81char *hash_lookup(struct hash *h, int key);
82char *strsave(char *s);
83char *strtrim(char *s);
84#else !__STDC__
85int sms_connect();
86int sms_disconnect();
87int sms_auth();
88int sms_access();
89int sms_query();
90int sms_noop();
91int sms_shutdown();
92struct save_queue *sq_create();
93struct hash *create_hash();
94char *hash_lookup();
95char *strsave();
96char *strtrim();
97#endif __STDC__
98
99#endif _sms_h_ /* Do Not Add Anything after this line. */
This page took 0.038302 seconds and 5 git commands to generate.