]> andersk Git - moira.git/blame_incremental - include/moira.h
AIX portability change: AIX has a built in send_file() function, so
[moira.git] / include / moira.h
... / ...
CommitLineData
1/* $Id$
2 *
3 * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
4 *
5 */
6
7#ifndef _moira_h_
8#define _moira_h_
9
10#ifdef _WIN32
11#include <windows.h>
12#ifndef strcasecmp
13#define strcasecmp stricmp
14#endif
15#ifndef snprintf
16#define snprintf _snprintf
17#endif
18#endif /*_WIN32 */
19
20/* return values from queries (and error codes) */
21#include <sys/types.h>
22#include <com_err.h>
23#include "mr_et.h"
24#include "krb_et.h"
25#include "ureg_err.h"
26
27#define MR_SUCCESS 0 /* Query was successful */
28
29#define MR_VERSION_1 1 /* Version in use from 7/87 to 4/88 */
30#define MR_VERSION_2 2 /* After 4/88, new query lib */
31
32/* return values for Moira server calls, used by clients */
33
34#define MR_CONT 0 /* Everything okay, continue sending values. */
35#define MR_ABORT -1 /* Something went wrong don't send anymore
36 values. */
37
38#define MOIRA_SNAME "moira" /* Kerberos service key to use */
39
40/* Protocol operations */
41#define MR_NOOP 0
42#define MR_AUTH 1
43#define MR_SHUTDOWN 2
44#define MR_QUERY 3
45#define MR_ACCESS 4
46#define MR_DO_UPDATE 5
47#define MR_MOTD 6
48#define MR_PROXY 7
49#define MR_SETVERSION 8
50#define MR_MAX_PROC 8
51
52/* values used in NFS physical flags */
53#define MR_FS_STUDENT 0x0001
54#define MR_FS_FACULTY 0x0002
55#define MR_FS_STAFF 0x0004
56#define MR_FS_MISC 0x0008
57#define MR_FS_GROUPQUOTA 0x0010
58
59/* magic values to pass for list and user queries */
60#define UNIQUE_GID "create unique GID"
61#define UNIQUE_UID "create unique UID"
62#define UNIQUE_LOGIN "create unique login ID"
63
64/* Structure used by Save Queue routines (for temporary storage of data) */
65struct save_queue
66{
67 struct save_queue *q_next;
68 struct save_queue *q_prev;
69 struct save_queue *q_lastget;
70 void *q_data;
71};
72
73/* Hash table declarations */
74struct bucket {
75 struct bucket *next;
76 int key;
77 void *data;
78};
79struct hash {
80 int size;
81 struct bucket **data;
82};
83
84/* prototypes from critical.c */
85void critical_alert(char *instance, char *msg, ...);
86void send_zgram(char *inst, char *msg);
87
88/* prototypes from fixhost.c */
89char *canonicalize_hostname(char *s);
90
91/* prototypes from fixname.c */
92void FixName(char *ilnm, char *ifnm, char *last, char *first, char *middle);
93void FixCase(char *p);
94void LookForJrAndIII(char *nm, int *pends_jr, int *pends_sr,
95 int *pends_ii, int *pends_iii,
96 int *pends_iv, int *pends_v);
97void LookForSt(char *nm);
98void LookForO(char *nm);
99void TrimTrailingSpace(char *ip);
100void GetMidInit(char *nm, char *mi);
101void RemoveHyphens(char *str);
102
103/* prototypes from hash.c */
104struct hash *create_hash(int size);
105void *hash_lookup(struct hash *h, int key);
106int hash_update(struct hash *h, int key, void *value);
107int hash_store(struct hash *h, int key, void *value);
108void hash_search(struct hash *h, void *value, void (*callback)(int));
109void hash_step(struct hash *h, void (*callback)(int, void *, void *),
110 void *hint);
111void hash_destroy(struct hash *h);
112
113/* prototypes from kname_unparse.c */
114char *kname_unparse(char *p, char *i, char *r);
115
116/* prototypes from nfsparttype.c */
117char *parse_filesys_type(char *fs_type_name);
118char *format_filesys_type(char *fs_status);
119
120/* prototypes from sq.c */
121struct save_queue *sq_create(void);
122int sq_save_data(struct save_queue *sq, void *data);
123int sq_save_args(int argc, char *argv[], struct save_queue *sq);
124int sq_save_unique_data(struct save_queue *sq, void *data);
125int sq_save_unique_string(struct save_queue *sq, char *data);
126/* in sq_get_data and sq_remove_data, the `data' arg should be a
127 pointer to a pointer */
128int sq_get_data(struct save_queue *sq, void *data);
129int sq_remove_data(struct save_queue *sq, void *data);
130void sq_remove_last_data(struct save_queue *sq);
131int sq_empty(struct save_queue *sq);
132void sq_destroy(struct save_queue *sq);
133
134/* prototypes from strs.c */
135char *strtrim(char *s);
136char *uppercase(char *s);
137char *lowercase(char *s);
138
139#ifndef HAVE_STRLCPY
140size_t strlcpy(char *dst, const char *src, size_t size);
141#endif
142#ifndef HAVE_STRLCAT
143size_t strlcat(char *dst, const char *src, size_t size);
144#endif
145
146/* mr_ functions */
147int mr_access(char *handle, int argc, char **argv);
148int mr_auth(char *prog);
149int mr_connect(char *server);
150int mr_disconnect(void);
151int mr_do_update(void);
152int mr_host(char *host, int size);
153int mr_motd(char **motd);
154int mr_noop(void);
155int mr_proxy(char *principal, char *orig_authtype);
156int mr_query(char *handle, int argc, char **argv,
157 int (*callback)(int, char **, void *), void *callarg);
158int mr_version(int version);
159
160/* error-name backward compatibility */
161#define MR_INGRES_ERR MR_DBMS_ERR
162#define MR_INGRES_SOFTFAIL MR_DBMS_SOFTFAIL
163
164
165#ifdef __GNUC__
166#if __GNUC_MINOR__ < 7
167#define __attribute__(x)
168#endif
169#else /* ! __GNUC __ */
170#define __attribute__(x)
171#endif
172
173#define RCSID(id) static char *rcsid __attribute__ ((__unused__)) = id
174
175#endif /* _moira_h_ */ /* Do Not Add Anything after this line. */
This page took 0.034445 seconds and 5 git commands to generate.