source: trunk/third/moira/gen/util.h @ 23095

Revision 23095, 1.4 KB checked in by ghudson, 16 years ago (diff)
Import the moira package from SIPB Debathena.
RevLine 
[23095]1#include <moira_schema.h>
2
3/* for MAXPATHLEN */
4#include <sys/param.h>
5
6#include <stdio.h>
7
8void fix_file(char *targetfile);
9char *dequote(char *s);
10void db_error(int code);
11
12time_t unixtime(char *timestring);
13#define UNIXTIME_FMT "J HH24 MI SS"
14
15struct tarheader {
16  char name[100];
17  char mode[8];
18  char uid[8];
19  char gid[8];
20  char size[12];
21  char mtime[12];
22  char chksum[8];
23  char typeflag[1];
24  char linkname[100];
25  char magic[6];
26  char version[2];
27  char uname[32];
28  char gname[32];
29  char devmajor[8];
30  char devminor[8];
31  char prefix[155];
32  char pad[12];
33};
34
35typedef struct _tarfile {
36  FILE *fp;
37  struct tarheader th;
38  long offset;
39} TARFILE;
40
41TARFILE *tarfile_open(char *file);
42void tarfile_close(TARFILE *tf);
43FILE *tarfile_start(TARFILE *tf, char *name, mode_t mode, uid_t uid, gid_t gid,
44                    char *user, char *group, time_t mtime);
45void tarfile_end(TARFILE *tf);
46void tarfile_mkdir(TARFILE *tf, char *name, mode_t mode, uid_t uid, gid_t gid,
47                   char *user, char *group, time_t mtime);
48
49struct imember {
50  char type;
51  char *name, *tag;
52};
53void freeimember(struct imember *m);
54
55void init_acls(void);
56void canon_krb(struct imember *m, int vers, char *buf, int len);
57struct save_queue *get_acl(char *type, int id,
58                           char *(merge_func)(char *, char *));
59void dump_krb_acl(FILE *out, char *type, int id, int vers);
60void dump_user_list(FILE *out, char *type, int id);
61char *user_lookup(int users_id);
62char *string_lookup(int string_id);
Note: See TracBrowser for help on using the repository browser.