Merge branch 'linux1'
[oweals/cde.git] / cde / programs / dtcm / server / log.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: log.h /main/5 1996/10/03 10:26:46 drk $ */
24 /*
25  *  (c) Copyright 1993, 1994 Hewlett-Packard Company
26  *  (c) Copyright 1993, 1994 International Business Machines Corp.
27  *  (c) Copyright 1993, 1994 Novell, Inc.
28  *  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
29  */
30
31 #ifndef _LOG_H
32 #define _LOG_H
33
34 #include "ansi_c.h"
35 #include "cm.h"
36 #include "rtable4.h"
37
38 #define _DtCMS_VERSION1 1
39 #define _DtCMS_VERSION4 4
40 #define _DtCMS_DEFAULT_LOG      "callog"
41 #define _DtCMS_DEFAULT_BAK      ".calbak"
42 #define _DtCMS_DEFAULT_TMP      ".caltmp"
43 #define _DtCMS_DEFAULT_DEL      ".caldel"
44 #define _DtCMS_DEFAULT_DIR      "/usr/spool/calendar"
45 #define _DtCMS_DEFAULT_MODE     (S_IRUSR|S_IRGRP|S_IWGRP)
46
47 typedef enum {
48         _DtCmsLogAdd, _DtCmsLogRemove
49 } _DtCmsLogOps; 
50
51 extern CSA_return_code  _DtCmsAppendAppt4ByFN P((char*, Appt_4*, _DtCmsLogOps));
52 extern CSA_return_code  _DtCmsAppendAppt4ByFD P((int, Appt_4*, _DtCmsLogOps));
53
54 extern CSA_return_code  _DtCmsAppendCalAttrsByFN P((char *file,
55                                                   int size,
56                                                   cms_attribute * attrs));
57 extern CSA_return_code  _DtCmsAppendCalAttrsByFD P((int f,
58                                                   int size,
59                                                   cms_attribute * attrs));
60
61 extern CSA_return_code  _DtCmsAppendEntryByFN P((char *,
62                                                 cms_entry *,
63                                                 _DtCmsLogOps));
64 extern CSA_return_code  _DtCmsAppendEntryByFD P((int,
65                                                 cms_entry *,
66                                                 _DtCmsLogOps));
67
68 extern CSA_return_code _DtCmsAppendHTableByFN P((char *file,
69                                                 uint size,
70                                                 char **names,
71                                                 int *types));
72
73 extern CSA_return_code _DtCmsAppendHTableByFD P((int fd,
74                                                 uint size,
75                                                 char **names,
76                                                 int *types));
77
78 extern CSA_return_code  _DtCmsAppendAccessByFN P((char*,
79                                                 int,
80                                                 Access_Entry_4 *));
81 extern CSA_return_code  _DtCmsAppendAccessByFD P((int, int, Access_Entry_4 *));
82
83 extern CSA_return_code  _DtCmsCreateLogV1 P((char*, char *));
84
85 extern CSA_return_code  _DtCmsCreateLogV2 P((char *owner, char *file));
86
87 extern CSA_return_code _DtCmsWriteVersionString P((char *file, int version));
88
89 extern int _DtCmsSetFileMode P((char *file,
90                                 uid_t uid,
91                                 gid_t gid,
92                                 mode_t mode,
93                                 boolean_t changeeuid,
94                                 boolean_t printerr));
95
96 extern CSA_return_code  _DtCmsRemoveLog P((char *calendar, char *user));
97
98 extern char     *_DtCmsGetBakFN         P((char*));
99 extern char     *_DtCmsGetLogFN         P((char*));
100 extern char     *_DtCmsGetTmpFN         P((char*));
101 extern char     *_DtCmsGetDelFN         P((char*));
102
103 extern boolean_t _DtCmsPrintAppt4       P((caddr_t data));
104 extern void     _DtCmsPrintExceptions   P((int len, int *exceptions));
105
106 extern CSA_return_code  _DtCmsGetFileSize P((char *calendar, int *size));
107
108 extern void     _DtCmsTruncateFile      P((char *calendar, int size));
109
110 #endif