Commit af6c5795 authored by rswindell's avatar rswindell
Browse files

#define ROOT_SECTION NULL

parent f5d35a1e
......@@ -445,7 +445,7 @@ static jsval get_value(JSContext *cx, char* value)
static JSBool
js_iniGetValue(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
char* section=NULL;
char* section=ROOT_SECTION;
char* key;
char** list;
char buf[INI_MAX_VALUE_LEN];
......@@ -511,7 +511,7 @@ js_iniGetValue(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
static JSBool
js_iniSetValue(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
char* section=NULL;
char* section=ROOT_SECTION;
char* key;
char* result=NULL;
int32 i;
......@@ -607,7 +607,7 @@ js_iniGetSections(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
static JSBool
js_iniGetKeys(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
char* section=NULL;
char* section=ROOT_SECTION;
char** list;
jsint i;
jsval val;
......@@ -641,7 +641,7 @@ js_iniGetKeys(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
static JSBool
js_iniGetObject(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
char* section=NULL;
char* section=ROOT_SECTION;
jsint i;
JSObject* object;
private_t* p;
......
......@@ -86,7 +86,7 @@ static BOOL find_section(FILE* fp, const char* section)
rewind(fp);
if(section==NULL)
if(section==ROOT_SECTION)
return(TRUE);
while(!feof(fp)) {
......@@ -106,7 +106,7 @@ static size_t find_section_index(str_list_t list, const char* section)
char str[INI_MAX_VALUE_LEN];
size_t i;
if(section==NULL)
if(section==ROOT_SECTION)
return(0);
for(i=0; list[i]!=NULL; i++) {
......@@ -198,7 +198,7 @@ size_t iniAddSection(str_list_t* list, const char* section
char str[INI_MAX_LINE_LEN];
size_t i;
if(section==NULL)
if(section==ROOT_SECTION)
return(0);
i=find_section_index(*list, section);
......
......@@ -42,6 +42,7 @@
#include "str_list.h" /* strList_t */
#define INI_MAX_VALUE_LEN 1024 /* Maximum value length, includes '\0' */
#define ROOT_SECTION NULL
typedef struct {
ulong bit;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment