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
41 /* values used in NFS physical flags */
42 #define MR_FS_STUDENT 0x0001
43 #define MR_FS_FACULTY 0x0002
44 #define MR_FS_STAFF 0x0004
45 #define MR_FS_MISC 0x0008
46 #define MR_FS_GROUPQUOTA 0x0010
48 /* magic values to pass for list and user queries */
49 #define UNIQUE_GID "create unique GID"
50 #define UNIQUE_UID "create unique UID"
51 #define UNIQUE_LOGIN "create unique login ID"
53 /* Structure used by Save Queue routines (for temporary storage of data) */
56 struct save_queue *q_next;
57 struct save_queue *q_prev;
58 struct save_queue *q_lastget;
62 /* Hash table declarations */
73 /* prototypes from critical.c */
74 void critical_alert(char *instance, char *msg, ...);
75 void send_zgram(char *inst, char *msg);
77 /* prototypes from fixhost.c */
78 char *canonicalize_hostname(char *s);
80 /* prototypes from fixname.c */
81 void FixName(char *ilnm, char *ifnm, char *last, char *first, char *middle);
82 void FixCase(char *p);
83 void LookForJrAndIII(char *nm, int *pends_jr, int *pends_sr,
84 int *pends_ii, int *pends_iii,
85 int *pends_iv, int *pends_v);
86 void LookForSt(char *nm);
87 void LookForO(char *nm);
88 void TrimTrailingSpace(char *ip);
89 void GetMidInit(char *nm, char *mi);
90 void RemoveHyphens(char *str);
92 /* prototypes from gdss_convert.c */
93 int gdss2et(int code);
95 /* prototypes from hash.c */
96 struct hash *create_hash(int size);
97 void *hash_lookup(struct hash *h, int key);
98 int hash_update(struct hash *h, int key, void *value);
99 int hash_store(struct hash *h, int key, void *value);
100 void hash_search(struct hash *h, void *value, void (*callback)(int));
101 void hash_step(struct hash *h, void (*callback)(int, void *, void *),
103 void hash_destroy(struct hash *h);
105 /* prototypes from kname_unparse.c */
106 char *kname_unparse(char *p, char *i, char *r);
108 /* prototypes from nfsparttype.c */
109 char *parse_filesys_type(char *fs_type_name);
110 char *format_filesys_type(char *fs_status);
112 /* prototypes from sq.c */
113 struct save_queue *sq_create(void);
114 int sq_save_data(struct save_queue *sq, void *data);
115 int sq_save_args(int argc, char *argv[], struct save_queue *sq);
116 int sq_save_unique_data(struct save_queue *sq, void *data);
117 int sq_save_unique_string(struct save_queue *sq, char *data);
118 /* in sq_get_data and sq_remove_data, the `data' arg should be a
119 pointer to a pointer */
120 int sq_get_data(struct save_queue *sq, void *data);
121 int sq_remove_data(struct save_queue *sq, void *data);
122 void sq_remove_last_data(struct save_queue *sq);
123 int sq_empty(struct save_queue *sq);
124 void sq_destroy(struct save_queue *sq);
126 /* prototypes from strs.c */
127 char *strtrim(char *s);
128 char *uppercase(char *s);
129 char *lowercase(char *s);
132 int mr_access(char *handle, int argc, char **argv);
133 int mr_auth(char *prog);
134 int mr_proxy(char *principal, char *orig_authtype);
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. */