svn commit: samba r19770 - in
branches/SAMBA_3_0_24/source/iniparser/src: .
jerry at samba.org
jerry at samba.org
Sat Nov 18 16:38:34 GMT 2006
Author: jerry
Date: 2006-11-18 16:38:33 +0000 (Sat, 18 Nov 2006)
New Revision: 19770
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19770
Log:
go ahead and merge the iniparser changes from SAMBA_3_0
Modified:
branches/SAMBA_3_0_24/source/iniparser/src/dictionary.c
branches/SAMBA_3_0_24/source/iniparser/src/iniparser.c
branches/SAMBA_3_0_24/source/iniparser/src/iniparser.h
branches/SAMBA_3_0_24/source/iniparser/src/strlib.c
branches/SAMBA_3_0_24/source/iniparser/src/strlib.h
Changeset:
Modified: branches/SAMBA_3_0_24/source/iniparser/src/dictionary.c
===================================================================
--- branches/SAMBA_3_0_24/source/iniparser/src/dictionary.c 2006-11-18 16:37:43 UTC (rev 19769)
+++ branches/SAMBA_3_0_24/source/iniparser/src/dictionary.c 2006-11-18 16:38:33 UTC (rev 19770)
@@ -114,11 +114,11 @@
/* If no size was specified, allocate space for DICTMINSZ */
if (size<DICTMINSZ) size=DICTMINSZ ;
- d = calloc(1, sizeof(dictionary));
+ d = (dictionary *)calloc(1, sizeof(dictionary));
d->size = size ;
- d->val = calloc(size, sizeof(char*));
- d->key = calloc(size, sizeof(char*));
- d->hash = calloc(size, sizeof(unsigned));
+ d->val = (char **)calloc(size, sizeof(char*));
+ d->key = (char **)calloc(size, sizeof(char*));
+ d->hash = (unsigned int *)calloc(size, sizeof(unsigned));
return d ;
}
@@ -316,9 +316,9 @@
if (d->n==d->size) {
/* Reached maximum size: reallocate blackboard */
- d->val = mem_double(d->val, d->size * sizeof(char*)) ;
- d->key = mem_double(d->key, d->size * sizeof(char*)) ;
- d->hash = mem_double(d->hash, d->size * sizeof(unsigned)) ;
+ d->val = (char **)mem_double(d->val, d->size * sizeof(char*)) ;
+ d->key = (char **)mem_double(d->key, d->size * sizeof(char*)) ;
+ d->hash = (unsigned int *)mem_double(d->hash, d->size * sizeof(unsigned)) ;
/* Double size */
d->size *= 2 ;
Modified: branches/SAMBA_3_0_24/source/iniparser/src/iniparser.c
===================================================================
--- branches/SAMBA_3_0_24/source/iniparser/src/iniparser.c 2006-11-18 16:37:43 UTC (rev 19769)
+++ branches/SAMBA_3_0_24/source/iniparser/src/iniparser.c 2006-11-18 16:38:33 UTC (rev 19770)
@@ -230,7 +230,7 @@
iniparser_getstring() instead.
*/
/*--------------------------------------------------------------------------*/
-char * iniparser_getstr(dictionary * d, char * key)
+char * iniparser_getstr(dictionary * d, const char * key)
{
return iniparser_getstring(d, key, NULL);
}
@@ -251,7 +251,7 @@
the dictionary, do not free or modify it.
*/
/*--------------------------------------------------------------------------*/
-char * iniparser_getstring(dictionary * d, char * key, char * def)
+char * iniparser_getstring(dictionary * d, const char * key, char * def)
{
char * lc_key ;
char * sval ;
@@ -280,7 +280,7 @@
the notfound value is returned.
*/
/*--------------------------------------------------------------------------*/
-int iniparser_getint(dictionary * d, char * key, int notfound)
+int iniparser_getint(dictionary * d, const char * key, int notfound)
{
char * str ;
@@ -346,7 +346,7 @@
necessarily have to be 0 or 1.
*/
/*--------------------------------------------------------------------------*/
-int iniparser_getboolean(dictionary * d, char * key, int notfound)
+int iniparser_getboolean(dictionary * d, const char * key, int notfound)
{
char * c ;
int ret ;
@@ -442,7 +442,7 @@
*/
/*--------------------------------------------------------------------------*/
-dictionary * iniparser_load(char * ininame)
+dictionary * iniparser_load(const char * ininame)
{
dictionary * d ;
char lin[ASCIILINESZ+1];
Modified: branches/SAMBA_3_0_24/source/iniparser/src/iniparser.h
===================================================================
--- branches/SAMBA_3_0_24/source/iniparser/src/iniparser.h 2006-11-18 16:37:43 UTC (rev 19769)
+++ branches/SAMBA_3_0_24/source/iniparser/src/iniparser.h 2006-11-18 16:38:33 UTC (rev 19770)
@@ -123,7 +123,7 @@
iniparser_getstring() instead.
*/
/*--------------------------------------------------------------------------*/
-char * iniparser_getstr(dictionary * d, char * key);
+char * iniparser_getstr(dictionary * d, const char * key);
/*-------------------------------------------------------------------------*/
@@ -141,7 +141,7 @@
the dictionary, do not free or modify it.
*/
/*--------------------------------------------------------------------------*/
-char * iniparser_getstring(dictionary * d, char * key, char * def);
+char * iniparser_getstring(dictionary * d, const char * key, char * def);
/*-------------------------------------------------------------------------*/
/**
@@ -156,7 +156,7 @@
the notfound value is returned.
*/
/*--------------------------------------------------------------------------*/
-int iniparser_getint(dictionary * d, char * key, int notfound);
+int iniparser_getint(dictionary * d, const char * key, int notfound);
/*-------------------------------------------------------------------------*/
/**
@@ -205,7 +205,7 @@
necessarily have to be 0 or 1.
*/
/*--------------------------------------------------------------------------*/
-int iniparser_getboolean(dictionary * d, char * key, int notfound);
+int iniparser_getboolean(dictionary * d, const char * key, int notfound);
/*-------------------------------------------------------------------------*/
@@ -264,7 +264,7 @@
The returned dictionary must be freed using iniparser_freedict().
*/
/*--------------------------------------------------------------------------*/
-dictionary * iniparser_load(char * ininame);
+dictionary * iniparser_load(const char * ininame);
/*-------------------------------------------------------------------------*/
/**
Modified: branches/SAMBA_3_0_24/source/iniparser/src/strlib.c
===================================================================
--- branches/SAMBA_3_0_24/source/iniparser/src/strlib.c 2006-11-18 16:37:43 UTC (rev 19769)
+++ branches/SAMBA_3_0_24/source/iniparser/src/strlib.c 2006-11-18 16:38:33 UTC (rev 19770)
@@ -51,7 +51,7 @@
*/
/*--------------------------------------------------------------------------*/
-char * strlwc(char * s)
+char * strlwc(const char * s)
{
static char l[ASCIILINESZ+1];
int i ;
Modified: branches/SAMBA_3_0_24/source/iniparser/src/strlib.h
===================================================================
--- branches/SAMBA_3_0_24/source/iniparser/src/strlib.h 2006-11-18 16:37:43 UTC (rev 19769)
+++ branches/SAMBA_3_0_24/source/iniparser/src/strlib.h 2006-11-18 16:38:33 UTC (rev 19770)
@@ -45,7 +45,7 @@
allocated, it will be modified at each function call (not re-entrant).
*/
/*--------------------------------------------------------------------------*/
-char * strlwc(char * s);
+char * strlwc(const char * s);
/*-------------------------------------------------------------------------*/
/**
More information about the samba-cvs
mailing list