dtcm: Resolve CID 87822
[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 #if defined(CSRG_BASED)
45 #define _DtCMS_DEFAULT_DIR      "/var/spool/calendar"
46 #else
47 #define _DtCMS_DEFAULT_DIR      "/usr/spool/calendar"
48 #endif
49 #define _DtCMS_DEFAULT_MODE     (S_IRUSR|S_IRGRP|S_IWGRP)
50
51 typedef enum {
52         _DtCmsLogAdd, _DtCmsLogRemove
53 } _DtCmsLogOps; 
54
55 extern CSA_return_code  _DtCmsAppendAppt4ByFN P((char*, Appt_4*, _DtCmsLogOps));
56 extern CSA_return_code  _DtCmsAppendAppt4ByFD P((int, Appt_4*, _DtCmsLogOps));
57
58 extern CSA_return_code  _DtCmsAppendCalAttrsByFN P((char *file,
59                                                   int size,
60                                                   cms_attribute * attrs));
61 extern CSA_return_code  _DtCmsAppendCalAttrsByFD P((int f,
62                                                   int size,
63                                                   cms_attribute * attrs));
64
65 extern CSA_return_code  _DtCmsAppendEntryByFN P((char *,
66                                                 cms_entry *,
67                                                 _DtCmsLogOps));
68 extern CSA_return_code  _DtCmsAppendEntryByFD P((int,
69                                                 cms_entry *,
70                                                 _DtCmsLogOps));
71
72 extern CSA_return_code _DtCmsAppendHTableByFN P((char *file,
73                                                 uint size,
74                                                 char **names,
75                                                 int *types));
76
77 extern CSA_return_code _DtCmsAppendHTableByFD P((int fd,
78                                                 uint size,
79                                                 char **names,
80                                                 int *types));
81
82 extern CSA_return_code  _DtCmsAppendAccessByFN P((char*,
83                                                 int,
84                                                 Access_Entry_4 *));
85 extern CSA_return_code  _DtCmsAppendAccessByFD P((int, int, Access_Entry_4 *));
86
87 extern CSA_return_code  _DtCmsCreateLogV1 P((char*, char *));
88
89 extern CSA_return_code  _DtCmsCreateLogV2 P((char *owner, char *file));
90
91 extern CSA_return_code _DtCmsWriteVersionString P((char *file, int version));
92
93 extern int _DtCmsSetFileMode P((char *file,
94                                 uid_t uid,
95                                 gid_t gid,
96                                 mode_t mode,
97                                 boolean_t changeeuid,
98                                 boolean_t printerr));
99
100 extern CSA_return_code  _DtCmsRemoveLog P((char *calendar, char *user));
101
102 extern char     *_DtCmsGetBakFN         P((char*));
103 extern char     *_DtCmsGetLogFN         P((char*));
104 extern char     *_DtCmsGetTmpFN         P((char*));
105 extern char     *_DtCmsGetDelFN         P((char*));
106
107 extern boolean_t _DtCmsPrintAppt4       P((caddr_t data));
108 extern void     _DtCmsPrintExceptions   P((int len, int *exceptions));
109
110 extern CSA_return_code  _DtCmsGetFileSize P((char *calendar, int *size));
111
112 extern void     _DtCmsTruncateFile      P((char *calendar, int size));
113
114 #endif