Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 259715 | Differences between
and this patch

Collapse All | Expand All

(-)libcompizconfig-0.8.2.orig/config.h.in (+3 lines)
Lines 30-35 Link Here
30
/* Define if your <locale.h> file defines LC_MESSAGES. */
30
/* Define if your <locale.h> file defines LC_MESSAGES. */
31
#undef HAVE_LC_MESSAGES
31
#undef HAVE_LC_MESSAGES
32
32
33
/* Define to 1 if you have the `iniparser' library (-liniparser). */
34
#undef HAVE_LIBINIPARSER
35
33
/* Define to 1 if you have the `protobuf' library (-lprotobuf). */
36
/* Define to 1 if you have the `protobuf' library (-lprotobuf). */
34
#undef HAVE_LIBPROTOBUF
37
#undef HAVE_LIBPROTOBUF
35
38
(-)libcompizconfig-0.8.2.orig/configure.ac (+10 lines)
Lines 116-121 Link Here
116
fi
116
fi
117
AM_CONDITIONAL([USE_PROTOBUF], [test "x$use_protobuf" = "xyes"])
117
AM_CONDITIONAL([USE_PROTOBUF], [test "x$use_protobuf" = "xyes"])
118
118
119
AC_ARG_WITH(internal-iniparser,
120
  [AS_HELP_STRING([--without-internal-iniparser],[Don't use bundled iniparser lib])],
121
  [], [with_internal_iniparser=yes])
122
123
if test "x$with_internal_iniparser" = "xno"; then
124
  AC_CHECK_LIB([iniparser], [iniparser_getnsec], [],
125
    [AC_MSG_ERROR([Error! You need to have libiniparser])])
126
fi
127
AM_CONDITIONAL([WITH_INTERNAL_INIPARSER], [test "x$with_internal_iniparser" = "xyes"])
128
119
AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes], [have_inotify=no])
129
AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes], [have_inotify=no])
120
130
121
AC_ARG_ENABLE(debug,
131
AC_ARG_ENABLE(debug,
(-)libcompizconfig-0.8.2.orig/include/ccs.h (-13 / +3 lines)
Lines 695-713 Link Here
695
695
696
/* INI file stuff */
696
/* INI file stuff */
697
697
698
typedef struct _dictionary_
698
#include <iniparser.h>
699
{
699
700
    /** Number of entries in dictionary */
700
typedef dictionary IniDictionary;
701
    int n;
702
    /** Storage size */
703
    int size;
704
    /** List of string values */
705
    char **val;
706
    /** List of string keys */
707
    char **key ;
708
    /** List of hash values for keys */
709
    unsigned *hash;
710
} IniDictionary;
711
701
712
IniDictionary* ccsIniNew (void);
702
IniDictionary* ccsIniNew (void);
713
IniDictionary* ccsIniOpen (const char *fileName);
703
IniDictionary* ccsIniOpen (const char *fileName);
(-)libcompizconfig-0.8.2.orig/src/Makefile.am (-3 / +6 lines)
Lines 39-52 Link Here
39
	lists.c 	\
39
	lists.c 	\
40
	compiz.cpp 	\
40
	compiz.cpp 	\
41
	config.c 	\
41
	config.c 	\
42
	iniparser.c 	\
43
	ini.c 		\
42
	ini.c 		\
44
	bindings.c 	\
43
	bindings.c 	\
45
	filewatch.c 	\
44
	filewatch.c 	\
46
	ccs-private.h	\
45
	ccs-private.h
47
	iniparser.h
48
46
49
libcompizconfig_la_LIBADD = @LIBXML2_LIBS@ @LIBX11_LIBS@ $(PROTOBUF_LIB)
47
libcompizconfig_la_LIBADD = @LIBXML2_LIBS@ @LIBX11_LIBS@ $(PROTOBUF_LIB)
50
48
51
lib_LTLIBRARIES=libcompizconfig.la
49
lib_LTLIBRARIES=libcompizconfig.la
52
50
51
if WITH_INTERNAL_INIPARSER
52
53
  libcompizconfig_la_SOURCES += iniparser.h iniparser.c
54
55
endif
(-)libcompizconfig-0.8.2.orig/src/ini.c (-7 / +13 lines)
Lines 23-31 Link Here
23
#include <sys/stat.h>
23
#include <sys/stat.h>
24
#include <sys/types.h>
24
#include <sys/types.h>
25
#include <errno.h>
25
#include <errno.h>
26
#include <ctype.h>
26
27
27
#include <ccs.h>
28
#include <ccs.h>
28
#include "iniparser.h"
29
#include <iniparser.h>
29
30
30
/** 
31
/** 
31
 * Creates the parent directory for @fileName, recursively creating a directory
32
 * Creates the parent directory for @fileName, recursively creating a directory
Lines 77-83 Link Here
77
    if (file)
78
    if (file)
78
	fclose (file);
79
	fclose (file);
79
80
80
    return iniparser_new ((char*) fileName);
81
    return iniparser_load ((char*) fileName);
81
}
82
}
82
83
83
IniDictionary*
84
IniDictionary*
Lines 89-105 Link Here
89
void
90
void
90
ccsIniClose (IniDictionary *dictionary)
91
ccsIniClose (IniDictionary *dictionary)
91
{
92
{
92
    iniparser_free (dictionary);
93
    iniparser_freedict (dictionary);
93
}
94
}
94
95
95
void
96
void
96
ccsIniSave (IniDictionary *dictionary,
97
ccsIniSave (IniDictionary *dictionary,
97
	    const char    *fileName)
98
	    const char    *fileName)
98
{
99
{
100
    FILE *f;
99
    if (!ccsCreateDirFor (fileName))
101
    if (!ccsCreateDirFor (fileName))
100
	return;
102
	return;
101
103
102
    iniparser_dump_ini (dictionary, fileName);
104
    f = fopen(fileName, "w");
105
    if(!f)
106
        return;
107
    iniparser_dump_ini (dictionary, f);
108
    fclose(f);
103
}
109
}
104
110
105
static char*
111
static char*
Lines 127-137 Link Here
127
    char *sectionName;
133
    char *sectionName;
128
134
129
    asprintf (&sectionName, "%s:%s", section, entry);
135
    asprintf (&sectionName, "%s:%s", section, entry);
130
136
/*
131
    if (!iniparser_find_entry (dictionary, (char*) section))
137
    if (!iniparser_find_entry (dictionary, (char*) section))
132
	iniparser_add_entry (dictionary, (char*) section, NULL, NULL);
138
	iniparser_add_entry (dictionary, (char*) section, NULL, NULL);
133
139
*/
134
    iniparser_setstr (dictionary, sectionName, (char*) value);
140
    iniparser_set (dictionary, sectionName, (char*) value);
135
141
136
    free (sectionName);
142
    free (sectionName);
137
}
143
}
(-)libcompizconfig-0.8.2.orig/src/iniparser.h (-65 lines)
Lines 1-65 Link Here
1
/*
2
 Based upon libiniparser, by Nicolas Devillard
3
 Hacked into 1 file (m-iniparser) by Freek/2005
4
 Original terms following:
5
6
 -- -
7
8
 Copyright (c) 2000 by Nicolas Devillard (ndevilla AT free DOT fr).
9
10
 Written by Nicolas Devillard. Not derived from licensed software.
11
12
 Permission is granted to anyone to use this software for any
13
 purpose on any computer system, and to redistribute it freely,
14
 subject to the following restrictions:
15
16
 1. The author is not responsible for the consequences of use of
17
 this software, no matter how awful, even if they arise
18
 from defects in it.
19
20
 2. The origin of this software must not be misrepresented, either
21
 by explicit claim or by omission.
22
23
 3. Altered versions must be plainly marked as such, and must not
24
 be misrepresented as being the original software.
25
26
 4. This notice may not be removed or altered.
27
28
 */
29
30
31
#ifndef _INIPARSER_H_
32
#define _INIPARSER_H_
33
#include <stdio.h>
34
#include <stdlib.h>
35
#include <string.h>
36
#include <unistd.h>
37
#include <ctype.h>
38
39
#include <ccs.h>
40
41
typedef IniDictionary dictionary;
42
43
typedef struct _FileLock
44
{
45
	int fd;
46
} FileLock;
47
48
/* generated by genproto */
49
50
dictionary * iniparser_new(char *ininame);
51
dictionary * dictionary_new(int size);
52
void iniparser_free(dictionary * d);
53
54
55
int iniparser_getnsec(dictionary * d);
56
char * iniparser_getsecname(dictionary * d, int n);
57
void iniparser_dump_ini(dictionary * d, const char * file_name);
58
char * iniparser_getstring(dictionary * d, char * key, char * def);
59
void iniparser_add_entry(dictionary * d, char * sec, char * key, char * val);
60
int iniparser_find_entry(dictionary  *   ini, char        *   entry);
61
int iniparser_setstr(dictionary * ini, char * entry, char * val);
62
void iniparser_unset(dictionary * ini, char * entry);
63
64
#endif
65
(-)libcompizconfig-0.8.2.orig/src/main.c (-2 / +2 lines)
Lines 34-42 Link Here
34
#include <math.h>
34
#include <math.h>
35
35
36
#include <ccs.h>
36
#include <ccs.h>
37
#include <iniparser.h>
37
38
38
#include "ccs-private.h"
39
#include "ccs-private.h"
39
#include "iniparser.h"
40
40
41
Bool basicMetadata = FALSE;
41
Bool basicMetadata = FALSE;
42
42
Lines 2577-2583 Link Here
2577
	return FALSE;
2577
	return FALSE;
2578
    fclose (fp);
2578
    fclose (fp);
2579
2579
2580
    importFile = iniparser_new ((char *) fileName);
2580
    importFile = iniparser_load ((char *) fileName);
2581
    if (!importFile)
2581
    if (!importFile)
2582
	return FALSE;
2582
	return FALSE;
2583
2583

Return to bug 259715