source: npl/mailserver/dspam/dspam-3.10.2/src/pref.h @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/* $Id: pref.h,v 1.20 2011/06/28 00:13:48 sbajic Exp $ */
2
3/*
4 DSPAM
5 COPYRIGHT (C) 2002-2012 DSPAM PROJECT
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Affero General Public License as
9 published by the Free Software Foundation, either version 3 of the
10 License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU Affero General Public License for more details.
16
17 You should have received a copy of the GNU Affero General Public License
18 along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20*/
21
22#ifndef _PREF_H
23#  define _PREF_H
24
25#include <sys/types.h>
26#ifndef _WIN32
27#include <pwd.h>
28#endif
29
30#ifdef HAVE_CONFIG_H
31#include <auto-config.h>
32#endif
33
34#include "config_shared.h"
35
36#define PREF_MAX        32
37
38/* a single preference attribute */
39
40typedef struct _ds_agent_attribute {
41  char *attribute;
42  char *value;
43} *agent_attrib_t;
44
45typedef agent_attrib_t *agent_pref_t;
46
47/* preference utilities */
48
49const char *    _ds_pref_val (agent_pref_t PTX, const char *attrib);
50int             _ds_pref_free (agent_pref_t PTX);
51agent_pref_t    _ds_pref_aggregate (agent_pref_t, agent_pref_t);
52agent_attrib_t  _ds_pref_new (const char *attribute, const char *value);
53
54agent_pref_t  _ds_ff_pref_load(
55  config_t config,
56  const char *user,
57  const char *home,
58  void *ignore);
59int _ds_ff_pref_set(
60  config_t config,
61  const char *user,
62  const char *home,
63  const char *preference,
64  const char *value,
65  void *ignore);
66int _ds_ff_pref_del(
67  config_t config,
68  const char *user,
69  const char *home,
70  const char *preference,
71  void *ignore);
72FILE *_ds_ff_pref_prepare_file(
73  const char *filename,
74  const char *omission,
75  int *nlines);
76int _ds_ff_pref_commit (
77  const char *filename,
78  FILE *out_file);
79
80#endif /* _PREF_H */
Note: See TracBrowser for help on using the repository browser.