3 * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
10 /* return values from queries (and error codes) */
17 #define MR_SUCCESS 0 /* Query was successful */
19 #define MR_VERSION_1 1 /* Version in use from 7/87 to 4/88 */
20 #define MR_VERSION_2 2 /* After 4/88, new query lib */
22 /* return values for Moira server calls, used by clients */
24 #define MR_CONT 0 /* Everything okay, continue sending values. */
25 #define MR_ABORT -1 /* Something went wrong don't send anymore
28 #define MOIRA_SNAME "moira" /* Kerberos service key to use */
30 /* Protocol operations */
36 #define MR_DO_UPDATE 5
40 /* values used in NFS physical flags */
41 #define MR_FS_STUDENT 0x0001
42 #define MR_FS_FACULTY 0x0002
43 #define MR_FS_STAFF 0x0004
44 #define MR_FS_MISC 0x0008
45 #define MR_FS_GROUPQUOTA 0x0010
47 /* magic values to pass for list and user queries */
48 #define UNIQUE_GID "create unique GID"
49 #define UNIQUE_UID "create unique UID"
50 #define UNIQUE_LOGIN "create unique login ID"
52 /* Structure used by Save Queue routines (for temporary storage of data) */
55 struct save_queue *q_next;
56 struct save_queue *q_prev;
57 struct save_queue *q_lastget;
61 /* Hash table declarations */
72 /* prototypes from critical.c */
73 void critical_alert(char *instance, char *msg, ...);
74 void send_zgram(char *inst, char *msg);
76 /* prototypes from fixhost.c */
77 char *canonicalize_hostname(char *s);
79 /* prototypes from fixname.c */
80 void FixName(char *ilnm, char *ifnm, char *last, char *first, char *middle);
81 void FixCase(char *p);
82 void LookForJrAndIII(char *nm, int *pends_jr, int *pends_sr,
83 int *pends_ii, int *pends_iii,
84 int *pends_iv, int *pends_v);
85 void LookForSt(char *nm);
86 void LookForO(char *nm);
87 void TrimTrailingSpace(char *ip);
88 void GetMidInit(char *nm, char *mi);
90 /* prototypes from gdss_convert.c */
91 int gdss2et(int code);
93 /* prototypes from hash.c */
94 struct hash *create_hash(int size);
95 void *hash_lookup(struct hash *h, int key);
96 int hash_update(struct hash *h, int key, void *value);
97 int hash_store(struct hash *h, int key, void *value);
98 void hash_search(struct hash *h, void *value, void (*callback)(int));
99 void hash_step(struct hash *h, void (*callback)(int, void *, void *),
101 void hash_destroy(struct hash *h);
103 /* prototypes from idno.c */
104 void RemoveHyphens(char *str);
105 void EncryptID(char *sbuf, char *idnumber, char *first, char *last);
107 /* prototypes from kname_unparse.c */
108 char *kname_unparse(char *p, char *i, char *r);
110 /* prototypes from nfsparttype.c */
111 char *parse_filesys_type(char *fs_type_name);
112 char *format_filesys_type(char *fs_status);
114 /* prototypes from sq.c */
115 struct save_queue *sq_create(void);
116 int sq_save_data(struct save_queue *sq, void *data);
117 int sq_save_args(int argc, char *argv[], struct save_queue *sq);
118 int sq_save_unique_data(struct save_queue *sq, void *data);
119 int sq_save_unique_string(struct save_queue *sq, char *data);
120 /* in sq_get_data and sq_remove_data, the `data' arg should be a
121 pointer to a pointer */
122 int sq_get_data(struct save_queue *sq, void *data);
123 int sq_remove_data(struct save_queue *sq, void *data);
124 int sq_empty(struct save_queue *sq);
125 void sq_destroy(struct save_queue *sq);
127 /* prototypes from strs.c */
128 char *strtrim(char *s);
129 char *uppercase(char *s);
130 char *lowercase(char *s);
133 int mr_access(char *handle, int argc, char **argv);
134 int mr_auth(char *prog);
135 int mr_connect(char *server);
136 int mr_disconnect(void);
137 int mr_do_update(void);
138 int mr_host(char *host, int size);
139 int mr_motd(char **motd);
141 int mr_query(char *handle, int argc, char **argv,
142 int (*callback)(int, char **, void *), void *callarg);
144 /* error-name backward compatibility */
145 #define MR_INGRES_ERR MR_DBMS_ERR
146 #define MR_INGRES_SOFTFAIL MR_DBMS_SOFTFAIL
150 #if __GNUC_MINOR__ < 7
151 #define __attribute__(x)
153 #else /* ! __GNUC __ */
154 #define __attribute__(x)
157 #define RCSID(id) static char *rcsid __attribute__ ((__unused__)) = id
159 #endif /* _moira_h_ */ /* Do Not Add Anything after this line. */