Site: desklet upgrade, pacmansentry 0.0.1 => 0.0.2
[adesklets.git] / src / cfgfile.h
blob644646a7c023f50ea110b03b4eb666c75795d638
1 /*--- cfgfile.h ----------------------------------------------------------------
2 Copyright (C) 2004, 2005, 2006 Sylvain Fourmanoit <syfou@users.sourceforge.net>
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to
6 deal in the Software without restriction, including without limitation the
7 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 sell copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in
12 all copies of the Software and its documentation and acknowledgment shall be
13 given in the documentation and software packages that this Software was
14 used.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 ------------------------------------------------------------------------------*/
23 /* Management routines for adesklets configuration file
26 /*----------------------------------------------------------------------------*/
27 #ifndef HAVE_CFGFILE_H
28 #define HAVE_CFGFILE_H
30 #ifndef HAVE_CONFIG_H
31 #error Autogenerated config.h should be used.
32 #endif
34 /*----------------------------------------------------------------------------*/
35 #include "config.h" /* Autoconf header */
37 #ifdef HAVE_STDLIB_H /* setenv function */
38 #include <stdlib.h>
39 #endif
41 #ifdef HAVE_STDIO_H
42 #include <stdio.h> /* Standard IO routines */
43 #endif
45 #ifdef HAVE_STRING_H /* Strncat, strncpy functions */
46 #include <string.h>
47 #endif
49 #ifdef HAVE_UNISTD_H /* File locking routines, */
50 /* fork(), execve() functions */
51 #include <unistd.h>
52 #endif
54 #ifdef HAVE_FCNTL_H
55 #include <fcntl.h>
56 #endif
58 #ifdef HAVE_SYS_TYPES_H /* /etc/passwd management, ftruncate */
59 #include <sys/types.h>
60 #endif
62 #ifdef HAVE_SIGNAL_H /* kill() */
63 #include <signal.h>
64 #endif
66 #ifdef HAVE_PWD_H
67 #include <pwd.h>
68 #endif
70 #ifdef HAVE_LIBGEN_H /* dirname() */
71 #include <libgen.h>
72 #endif
74 #ifdef HAVE_DIRENT_H /* opendir(), readdir(), closedir() */
75 #include <dirent.h>
76 #endif
78 #include "types.h" /* Various typedef */
79 #include "error.h" /* Error wrapper */
81 #include "vector.h" /* Vector API */
83 /*----------------------------------------------------------------------------*/
84 #define CFGFILE_NAME "/.adesklets" /* Name of the config. file */
85 #define CFGFILE_NAME_SIZE 256 /* Max lenght of filename, including
86 the path. WARNING: manual modifs.
87 have to be done in cfg_parser.y
88 and cfg_scanner.l if changed. Sorry!
91 /*----------------------------------------------------------------------------*/
92 typedef struct s_cfgfile_item {
93 char applet[CFGFILE_NAME_SIZE];
94 uint id;
95 int scr;
96 uint x, y;
97 int no_update;
98 } cfgfile_item;
100 /*----------------------------------------------------------------------------*/
101 /* Get an applet caracteristics from configuration file
103 cfgfile_item * cfgfile_getinfo(char *, uint);
105 /* Add or modify a desklet description into the configuration file
107 int cfgfile_update(cfgfile_item *);
109 /* Just 'exexve' in sequence all desklets in the configuration file
111 int cfgfile_loadall(void);
113 /*----------------------------------------------------------------------------*/
114 #endif