Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / libadmin / test / common.h
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
9
10 #ifndef OPENAFS_LIBADMIN_TEST_COMMON_H_
11 #define OPENAFS_LIBADMIN_TEST_COMMON_H_
12
13 #define ERR_EXT(string) \
14 fprintf(stderr, "%s\n", string);\
15 exit(1);
16
17 #define ERR_ST_EXT(string, st) \
18 { \
19 const char *errstr = "unknown error"; \
20 util_AdminErrorCodeTranslate(st, 0, &errstr, (afs_status_p) 0); \
21 fprintf(stderr, "%s (%s - %d)\n", string, errstr, st);\
22 exit(1); \
23 }
24
25 /*
26 * Convenience enum for indexing to common parameters
27 */
28
29 typedef enum {
30 USER_PARAM = 12,
31 PASSWORD_PARAM,
32 AUTHCELL_PARAM,
33 EXECCELL_PARAM,
34 NOAUTH_PARAM,
35 USEEXISTTOKENS_PARAM
36 } CommonParm_t;
37
38 extern void
39 SetupCommonCmdArgs(struct cmd_syndesc *as);
40
41 extern void *cellHandle;
42 extern void *tokenHandle;
43
44 #endif /* OPENAFS_LIBADMIN_TEST_COMMON_H_ */