summaryrefslogtreecommitdiffstats
path: root/libconfig/.svn/text-base
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2008-04-14 21:54:00 -0400
committerBrian Cully <github.20.shmit@spamgourmet.com>2008-04-14 21:54:00 -0400
commit79d65188b1c1578a36403c0e5756c81dcc93d816 (patch)
tree2903ed400cd0ebd13350397d402c1d9d5b9f869d /libconfig/.svn/text-base
parent6ba98a9f9f48e13738d9736cba9c45b5e94f42f2 (diff)
downloadnastd-79d65188b1c1578a36403c0e5756c81dcc93d816.tar.gz
nastd-79d65188b1c1578a36403c0e5756c81dcc93d816.zip
Remove svn files
Diffstat (limited to 'libconfig/.svn/text-base')
-rw-r--r--libconfig/.svn/text-base/.cvsignore.svn-base15
-rw-r--r--libconfig/.svn/text-base/.pure.svn-base0
-rw-r--r--libconfig/.svn/text-base/ArrayData.h.svn-base44
-rw-r--r--libconfig/.svn/text-base/ArrayData.m.svn-base161
-rw-r--r--libconfig/.svn/text-base/BuffIO.h.svn-base49
-rw-r--r--libconfig/.svn/text-base/BuffIO.m.svn-base96
-rw-r--r--libconfig/.svn/text-base/COPYRIGHT.svn-base27
-rw-r--r--libconfig/.svn/text-base/Data.h.svn-base62
-rw-r--r--libconfig/.svn/text-base/Data.m.svn-base92
-rw-r--r--libconfig/.svn/text-base/DictData.h.svn-base47
-rw-r--r--libconfig/.svn/text-base/DictData.m.svn-base210
-rw-r--r--libconfig/.svn/text-base/Makefile.svn-base11
-rw-r--r--libconfig/.svn/text-base/NumData.h.svn-base39
-rw-r--r--libconfig/.svn/text-base/NumData.m.svn-base74
-rw-r--r--libconfig/.svn/text-base/Parser.h.svn-base42
-rw-r--r--libconfig/.svn/text-base/Parser.m.svn-base95
-rw-r--r--libconfig/.svn/text-base/String.h.svn-base46
-rw-r--r--libconfig/.svn/text-base/String.m.svn-base82
-rw-r--r--libconfig/.svn/text-base/StringData.h.svn-base41
-rw-r--r--libconfig/.svn/text-base/StringData.m.svn-base117
-rw-r--r--libconfig/.svn/text-base/config.m.svn-base287
21 files changed, 0 insertions, 1637 deletions
diff --git a/libconfig/.svn/text-base/.cvsignore.svn-base b/libconfig/.svn/text-base/.cvsignore.svn-base
deleted file mode 100644
index afcbfe8..0000000
--- a/libconfig/.svn/text-base/.cvsignore.svn-base
+++ /dev/null
@@ -1,15 +0,0 @@
-radiusd
-radctl
-radpass
-radpwtst
-radacct
-radterminate
-radiusd.pid
-radiusd.core
-Makefiles/os/target
-*.o
-*.so
-*.a
-*.core
-*.gmon
-tags
diff --git a/libconfig/.svn/text-base/.pure.svn-base b/libconfig/.svn/text-base/.pure.svn-base
deleted file mode 100644
index e69de29..0000000
--- a/libconfig/.svn/text-base/.pure.svn-base
+++ /dev/null
diff --git a/libconfig/.svn/text-base/ArrayData.h.svn-base b/libconfig/.svn/text-base/ArrayData.h.svn-base
deleted file mode 100644
index 246803e..0000000
--- a/libconfig/.svn/text-base/ArrayData.h.svn-base
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef ARRAYDATA_H
-# define ARRAYDATA_H
-
-#include "Data.h"
-
-@interface ArrayData: DataObject
-{
- id *data;
- int numChildren;
- int curObj;
-}
--free;
--(int)numObjects;
--addChild: child;
--objectAt: (int)index;
-@end
-#endif
diff --git a/libconfig/.svn/text-base/ArrayData.m.svn-base b/libconfig/.svn/text-base/ArrayData.m.svn-base
deleted file mode 100644
index dfee1e7..0000000
--- a/libconfig/.svn/text-base/ArrayData.m.svn-base
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "ArrayData.h"
-#include "Parser.h"
-#include "String.h"
-
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-
-@implementation ArrayData
--init
-{
- self = [super init];
-
- numChildren = 0;
- curObj = 0;
- data = malloc(MALLOC_GRANULARITY * sizeof(DictEntry *));
- if (!data) {
- fprintf(stderr, "ERROR: couldn't allocate memory: %s.\n",
- strerror(errno));
- return nil;
- }
-
- return self;
-}
-
--free
-{
- int i;
-
- fprintf(stderr, "DEBUG: freeing array\n");
- for (i = 0; i < numChildren; i++)
- [data[i] free];
- free(data);
- [super free];
-
- return nil;
-}
-
--addChild: child
-{
- /* Allocate additional space for children pointers, if required. */
- if (numChildren % MALLOC_GRANULARITY == 0) {
- /* TODO: fail gracefully. */
- data = realloc(data, (numChildren+MALLOC_GRANULARITY) *
- sizeof(DataObject *));
- if (!data) {
- fprintf(stderr,
- "ERROR: couldn't allocate memory: %s.\n",
- strerror(errno));
- return nil;
- }
- }
-
- data[numChildren] = child;
-
- numChildren++;
- return self;
-}
-
--setFromBuffer: (const char *)buffer withLength: (int)len
-{
- Parser *parser;
- String *string;
- const char *offset;
-
- self = [super init];
- parser = [Parser new];
- string = [[String new] init];
- if (parser == nil || string == nil)
- return nil;
-
- if (buffer[len] == '\0')
- len--;
-
- /* Skip any leading white space. */
- for (offset = buffer; offset <= buffer+len && isspace((int)*offset);
- offset++);
- /* Kill any ending white space. */
- for (; len >= 0 && isspace((int)buffer[len]); len--);
-
- /* If there's a leading brace, kill it and the ending one. */
- if (offset[0] == '[') {
- if (buffer[len] != ']') {
- fprintf(stderr, "ERROR: Unbalanced braces.\n");
- [parser free]; [string free];
- return nil;
- }
- offset++; len--;
-
- /* Do the whitespace shuffle again. */
- for (; len >= 0 && isspace((int)buffer[len]); len--);
- }
-
- while (offset < buffer+len) {
- DataObject *dataObj;
- int strLen;
-
- /* Do the whitespace shuffle. */
- for (; offset <= buffer+len && isspace((int)*offset); offset++);
-
- strLen = [parser getLineLenFrom: offset to: buffer+len];
- [string setStr: offset withLength: strLen];
- offset += strLen + 1;
-
- /* Parse the data element, then add it to our list. */
- dataObj = [parser getDataFrom: string];
- if (dataObj == nil) {
- [parser free]; [string free];
- return nil;
- }
- [self addChild: dataObj];
- }
-
- [parser free]; [string free];
- return self;
-}
-
--(int)
-numObjects
-{
- return numChildren;
-}
-
--objectAt: (int)index
-{
- if (index >= numChildren)
- return nil;
- return data[index];
-}
-@end
diff --git a/libconfig/.svn/text-base/BuffIO.h.svn-base b/libconfig/.svn/text-base/BuffIO.h.svn-base
deleted file mode 100644
index d58a0a3..0000000
--- a/libconfig/.svn/text-base/BuffIO.h.svn-base
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef BUFFIO_H
-# define BUFFIO_H
-
-#include <Object.h>
-
-#include <sys/types.h>
-
-@interface BuffIO: Object
-{
- char *file;
- char *curOff;
- off_t fileLen;
- char EOL;
-}
-
--init: (const char *)fileName;
--free;
--(char *)getCurOff;
--(off_t)getLength;
--setEOL: (char)delim;
-@end
-#endif
diff --git a/libconfig/.svn/text-base/BuffIO.m.svn-base b/libconfig/.svn/text-base/BuffIO.m.svn-base
deleted file mode 100644
index f7a5408..0000000
--- a/libconfig/.svn/text-base/BuffIO.m.svn-base
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "BuffIO.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-@implementation BuffIO
--init: (const char *)fileName
-{
- struct stat sb;
- int confFd;
-
- confFd = open(fileName, O_RDONLY, 0);
- if (confFd == -1) {
- fprintf(stderr, "ERROR: couldn't open config file %s: %s.\n",
- fileName, strerror(errno));
- return nil;
- }
- if (fstat(confFd, &sb) == -1) {
- fprintf(stderr, "ERROR: couldn't stat config file %s: %s.\n",
- fileName, strerror(errno));
- return nil;
- }
- fileLen = sb.st_size;
- file = mmap(NULL, fileLen, PROT_READ, MAP_PRIVATE, confFd, 0);
- if (file == MAP_FAILED) {
- fprintf(stderr, "ERROR: couldn't mmap config file %s: %s.\n",
- fileName, strerror(errno));
- return nil;
- }
- close(confFd);
-
- curOff = file;
- EOL = '\n';
-
- return self;
-}
-
--free
-{
- munmap(file, fileLen);
- return [super free];
-}
-
--(char *)
-getCurOff
-{
- return curOff;
-}
-
--(off_t)
-getLength
-{
- return fileLen;
-}
-
--setEOL: (char)delim
-{
- EOL = delim;
- return self;
-}
-@end
diff --git a/libconfig/.svn/text-base/COPYRIGHT.svn-base b/libconfig/.svn/text-base/COPYRIGHT.svn-base
deleted file mode 100644
index a61dc39..0000000
--- a/libconfig/.svn/text-base/COPYRIGHT.svn-base
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
diff --git a/libconfig/.svn/text-base/Data.h.svn-base b/libconfig/.svn/text-base/Data.h.svn-base
deleted file mode 100644
index 966310f..0000000
--- a/libconfig/.svn/text-base/Data.h.svn-base
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef DATA_H
-# define DATA_H
-
-#include "String.h"
-
-#include <Object.h>
-
-#include <sys/types.h>
-
-#define MALLOC_GRANULARITY 10 /* Malloc for every 10 entries. */
-
-/*
- * Generic Entry and Data objects.
- */
-@interface DataObject: Object
--dealloc;
--(char *)createCStr;
--(String *)createStr;
--setFromBuffer: (const char *)buffer withLength: (int)len;
-@end
-
-@interface DictEntry: Object
-{
- String *key;
- DataObject *data;
- DictEntry *super;
-}
-
--init;
--setKey: keyName;
--setData: dataPtr;
--getKey;
--getData;
-@end
-#endif
diff --git a/libconfig/.svn/text-base/Data.m.svn-base b/libconfig/.svn/text-base/Data.m.svn-base
deleted file mode 100644
index 3b48c7a..0000000
--- a/libconfig/.svn/text-base/Data.m.svn-base
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "Data.h"
-#include "Parser.h"
-#include "String.h"
-
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-
-@implementation DataObject
--dealloc
-{
- free(self);
- return nil;
-}
-
--(char *)createCStr
-{
- return NULL;
-}
-
--(String *)createStr
-{
- return nil;
-}
-
--setFromBuffer: (const char *)buffer withLength: (int)len
-{
- return self;
-}
-@end
-
-@implementation DictEntry
--init
-{
- self = [super init];
- key = NULL; data = NULL;
- return self;
-}
-
--setKey: (String *)keyStr
-{
- key = keyStr;
- return self;
-}
-
--setData: (DataObject *)dataPtr
-{
- data = dataPtr;
- return self;
-}
-
--getKey
-{
- return key;
-}
-
--getData
-{
- return data;
-}
-@end
diff --git a/libconfig/.svn/text-base/DictData.h.svn-base b/libconfig/.svn/text-base/DictData.h.svn-base
deleted file mode 100644
index 52dfc0d..0000000
--- a/libconfig/.svn/text-base/DictData.h.svn-base
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef DICTDATA_H
-# define DICTDATA_H
-
-#include "Data.h"
-
-@interface DictData: DataObject
-{
- id *data;
- int numChildren;
- int curObj;
-}
-
--free;
--addChild: child;
--delChild: (const char *)keyName;
--findChild: (const char *)keyName;
--firstObject;
--nextObject;
-@end
-#endif
diff --git a/libconfig/.svn/text-base/DictData.m.svn-base b/libconfig/.svn/text-base/DictData.m.svn-base
deleted file mode 100644
index 8620d7c..0000000
--- a/libconfig/.svn/text-base/DictData.m.svn-base
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "DictData.h"
-#include "Parser.h"
-#include "String.h"
-
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-
-@implementation DictData
--init
-{
- self = [super init];
-
- numChildren = 0;
- curObj = 0;
- data = malloc(MALLOC_GRANULARITY * sizeof(DataObject *));
- if (!data) {
- fprintf(stderr, "ERROR: couldn't allocate memory: %s.\n",
- strerror(errno));
- return nil;
- }
-
- return self;
-}
-
--free
-{
- int i;
-
- fprintf(stderr, "DEBUG: freeing dict\n");
- for (i = 0; i < numChildren; i++)
- [data[i] free];
- free(data);
- [super free];
-
- return nil;
-}
-
--addChild: child
-{
- /* Allocate additional space for children pointers, if required. */
- if (numChildren % MALLOC_GRANULARITY == 0) {
- /* TODO: fail gracefully. */
- data = realloc(data, (numChildren+MALLOC_GRANULARITY) *
- sizeof(DictEntry *));
- if (!data) {
- fprintf(stderr,
- "ERROR: couldn't allocate memory: %s.\n",
- strerror(errno));
- return nil;
- }
- }
-
- data[numChildren] = child;
-
- numChildren++;
- return self;
-}
-
--setFromBuffer: (const char *)buffer withLength: (int)len
-{
- Parser *parser;
- String *string;
- const char *offset;
-
- self = [super init];
- parser = [Parser new];
- string = [[String new] init];
- if (parser == nil || string == nil)
- return nil;
-
- if (buffer[len] == '\0')
- len--;
-
- /* Skip any leading white space. */
- for (offset = buffer; offset <= buffer+len && isspace((int)*offset);
- offset++);
- /* Kill any ending white space. */
- for (; len >= 0 && isspace((int)buffer[len]); len--);
-
- /* If there's a leading brace, kill it and the ending one. */
- if (offset[0] == '{') {
- if (buffer[len] != '}') {
- fprintf(stderr, "ERROR: Unbalanced braces.\n");
- [parser free]; [string free];
- return nil;
- }
- offset++; len--;
-
- /* Do the whitespace shuffle again. */
- for (; len >= 0 && isspace((int)buffer[len]); len--);
- }
-
- while (offset < buffer+len) {
- DataObject *dataObj;
- DictEntry *dictEntry;
- String *key;
- char *sep;
- int strLen;
-
- /* Do the whitespace shuffle. */
- for (; offset <= buffer+len && isspace((int)*offset); offset++);
-
- /* Get the key element. */
- sep = strchr(offset, '=');
- if (!sep) {
- fprintf(stderr, "ERROR: No equals sign!\n");
- return nil;
- }
- for (sep--; sep > offset && isspace((int)*sep); sep--);
- key = [[[String new] init] setStr: offset
- withLength: (sep-offset+1)];
-
- /* Get the data element. */
- offset = strchr(offset, '=');
- for(offset++; offset < buffer+len && isspace((int)*offset);
- offset++);
- strLen = [parser getLineLenFrom: offset to: buffer+len];
- [string setStr: offset withLength: strLen];
- offset += strLen + 1;
-
- /* Parse the data element, then add it to our list. */
- dataObj = [parser getDataFrom: string];
- if (dataObj == nil) {
- fprintf(stderr,
- "ERROR: Couldn't parse data for node `%s'.\n",
- [key getStr]);
- [parser free]; [string free];
- return nil;
- }
-
- dictEntry = [[DictEntry new] setKey: key];
- if (dictEntry == nil) {
- fprintf(stderr,
- "ERROR: Couldn't create node `%s'.\n",
- [key getStr]);
- [parser free]; [string free];
- return nil;
- }
- [dictEntry setData: dataObj];
- [self addChild: dictEntry];
- }
-
- [parser free]; [string free];
- return self;
-}
-
--delChild: (const char *)keyName
-{
- return self;
-}
-
--findChild: (const char *)keyName
-{
- int i;
-
- for (i = 0; i < numChildren; i++)
- if (!strcmp([[data[i] getKey] getStr], keyName))
- return data[i];
- return nil;
-}
-
--firstObject
-{
- curObj = 0;
- return [self nextObject];
-}
-
--nextObject
-{
- DictEntry *obj;
-
- if (curObj >= numChildren)
- return nil;
- obj = data[curObj];
- curObj++;
- return obj;
-}
-@end
diff --git a/libconfig/.svn/text-base/Makefile.svn-base b/libconfig/.svn/text-base/Makefile.svn-base
deleted file mode 100644
index 9fca5ac..0000000
--- a/libconfig/.svn/text-base/Makefile.svn-base
+++ /dev/null
@@ -1,11 +0,0 @@
-# $Id: Makefile,v 1.1 2001/10/04 23:57:55 shmit Exp $
-
-CONFIGOBJS= ArrayData.o BuffIO.o Data.o DictData.o NumData.o Parser.o \
- String.o StringData.o config.o
-
-libconfig.a: ${CONFIGOBJS}
- ar r $@ ${CONFIGOBJS}
- ranlib $@
-
-MKDIR= ../Makefiles
-include ${MKDIR}/build
diff --git a/libconfig/.svn/text-base/NumData.h.svn-base b/libconfig/.svn/text-base/NumData.h.svn-base
deleted file mode 100644
index a8c2810..0000000
--- a/libconfig/.svn/text-base/NumData.h.svn-base
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef NUMDATA_H
-# define NUMDATA_H
-
-#include "Data.h"
-
-@interface NumData: DataObject
-{
- long data;
-}
--(long)getNum;
-@end
-#endif
diff --git a/libconfig/.svn/text-base/NumData.m.svn-base b/libconfig/.svn/text-base/NumData.m.svn-base
deleted file mode 100644
index 68f6bfa..0000000
--- a/libconfig/.svn/text-base/NumData.m.svn-base
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "NumData.h"
-#include "Parser.h"
-#include "String.h"
-
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-
-@implementation NumData
--init
-{
- self = [super init];
- return self;
-}
-
--(String *)
-createStr
-{
- char buffer[1024];
-
- snprintf(buffer, sizeof(buffer), "%ld", data);
- return [[String new] setStr: buffer];
-}
-
--setFromBuffer: (const char *)buffer withLength: (int)len
-{
- char *endPtr;
-
- data = strtol(buffer, &endPtr, 0);
- if (*endPtr) {
- fprintf(stderr, "ERROR: `%s' is not a number.\n", buffer);
- return nil;
- }
-
- return self;
-}
-
--(long)
-getNum
-{
- return data;
-}
-@end
diff --git a/libconfig/.svn/text-base/Parser.h.svn-base b/libconfig/.svn/text-base/Parser.h.svn-base
deleted file mode 100644
index 963a78a..0000000
--- a/libconfig/.svn/text-base/Parser.h.svn-base
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef PARSER_H
-# define PARSER_H
-
-#include "Data.h"
-#include "String.h"
-
-#include <Object.h>
-
-@interface Parser: Object
--free;
--init;
--(DataObject *)getDataFrom: (String *)line;
--(int)getLineLenFrom: (const char *)startAddr to: (const char *)endAddr;
-@end
-#endif
diff --git a/libconfig/.svn/text-base/Parser.m.svn-base b/libconfig/.svn/text-base/Parser.m.svn-base
deleted file mode 100644
index f95cb3d..0000000
--- a/libconfig/.svn/text-base/Parser.m.svn-base
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "Parser.h"
-#include "ArrayData.h"
-#include "DictData.h"
-#include "NumData.h"
-#include "StringData.h"
-#include "String.h"
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-@implementation Parser
--(int)
-getLineLenFrom: (const char *)startAddr to: (const char *)endAddr
-{
- int len;
- char quote = '\0';
- int frenchBraces = 0, squareBraces = 0;
-
- for (len = 0; startAddr+len < endAddr; len++) {
- if (!quote && !frenchBraces && !squareBraces &&
- *(startAddr+len) == ';')
- break;
-
- switch (*(startAddr+len)) {
- case '{':
- frenchBraces++;
- break;
- case '}':
- if (!frenchBraces)
- fprintf(stderr,
- "WARNING: found `}' without `{'.\n");
- else
- frenchBraces--;
- break;
- case '[':
- squareBraces++;
- break;
- case ']':
- if (!squareBraces)
- fprintf(stderr,
- "WARNING: found ']' without '['.\n");
- else
- squareBraces--;
- break;
- case '"':
- if (!quote)
- quote = *(startAddr+len);
- else
- quote = '\0';
- break;
- }
- }
-
- return len;
-}
-
--init
-{
- return self;
-}
-
--free
-{
- return [super free];
-}
-
--(DataObject *)
-getDataFrom: (String *)dataStr
-{
- const char *dataBuff;
- id dataElem;
-
- dataBuff = [dataStr getStr];
-
- /* Figure out what type of node to allocate. */
- switch (dataBuff[0]) {
- case '{':
- dataElem = [[DictData new] init];
- break;
- case '[':
- dataElem = [[ArrayData new] init];
- break;
- case '"':
- dataElem = [[StringData new] init];
- break;
- default:
- dataElem = [[NumData new] init];
- break;
- }
-
- return [dataElem setFromBuffer: dataBuff withLength: [dataStr getLen]];
-}
-@end
diff --git a/libconfig/.svn/text-base/String.h.svn-base b/libconfig/.svn/text-base/String.h.svn-base
deleted file mode 100644
index ab0aaad..0000000
--- a/libconfig/.svn/text-base/String.h.svn-base
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef STRING_H
-# define STRING_H
-
-#include <Object.h>
-
-@interface String: Object
-{
- char *data;
- int len;
-}
-
--init;
--free;
--setStr: (const char *)stringData withLength: (int)length;
--setStr: (const char *)stringData;
--(int)getLen;
--(char *)getStr;
-@end
-#endif
diff --git a/libconfig/.svn/text-base/String.m.svn-base b/libconfig/.svn/text-base/String.m.svn-base
deleted file mode 100644
index 9a0bc5a..0000000
--- a/libconfig/.svn/text-base/String.m.svn-base
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "String.h"
-
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
-@implementation String
--init
-{
- self = [super init];
- data = NULL;
- return self;
-}
-
--free
-{
- free(data);
- return [super free];
-}
-
--setStr: (const char *)stringData withLength: (int)length
-{
- if (data)
- free(data);
-
- data = malloc((length+1)*sizeof(char));
- if (!data) {
- fprintf(stderr, "ERROR: Couldn't allocate memory: %s.\n",
- strerror(errno));
- return nil;
- }
-
- memcpy(data, stringData, length);
- data[length] = '\0';
- len = length;
- return self;
-}
-
--setStr: (const char *)stringData
-{
- return [self setStr: stringData withLength: strlen(stringData)];
-}
-
--(int)
-getLen
-{
- return len;
-}
-
--(char *)
-getStr
-{
- return data;
-}
-@end
diff --git a/libconfig/.svn/text-base/StringData.h.svn-base b/libconfig/.svn/text-base/StringData.h.svn-base
deleted file mode 100644
index 80c4d26..0000000
--- a/libconfig/.svn/text-base/StringData.h.svn-base
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef STRINGDATA_H
-# define STRINGDATA_H
-
-#include "Data.h"
-#include "String.h"
-
-@interface StringData: DataObject
-{
- String *data;
-}
-
--free;
-@end
-#endif
diff --git a/libconfig/.svn/text-base/StringData.m.svn-base b/libconfig/.svn/text-base/StringData.m.svn-base
deleted file mode 100644
index 1c02ac5..0000000
--- a/libconfig/.svn/text-base/StringData.m.svn-base
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 1998, Brian Cully <shmit@kublai.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of contributers to this software may not be used to endorse
- * or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "conf.h"
-
-#include "StringData.h"
-#include "Parser.h"
-#include "String.h"
-
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-
-#if NEED_STRINGS
-#include <strings.h>
-#endif
-
-@implementation StringData
--init
-{
- self = [super init];
- data = [[String new] init];
- return self;
-}
-
--free
-{
- [data free];
- [super free];
- return self;
-}
-
--(char *)
-createCStr
-{
- char *buffer;
-
- buffer = malloc(([data getLen]+1) * sizeof(char));
- if (!buffer) {
- fprintf(stderr, "ERROR: Couldn't allocate buffer: %s.\n",
- strerror(errno));
- return NULL;
- }
-
- strcpy(buffer, [data getStr]);
- return buffer;
-}
-
--(String *)
-createStr
-{
- String *str;
- char *buffer;
-
- buffer = [self createCStr];
- if (buffer == NULL)
- return nil;
-
- str = [[[String new] init] setStr: buffer];
- free(buffer);
-
- return str;
-}
-
--setFromBuffer: (const char *)buffer withLength: (int)len
-{
- const char *startPtr, *endPtr;
-
- startPtr = index(buffer, '"');
- if (!startPtr) {
- fprintf(stderr, "ERROR: No opening quote for string.\n");
- return nil;
- }
- startPtr++;
-
- for (endPtr = buffer+len; endPtr > startPtr; endPtr--)
- if (*endPtr == '"')
- break;
-
- if (endPtr == startPtr) {
- fprintf(stderr, "ERROR: No ending quote for string.\n");
- return nil;
- }
- endPtr--;
-
- [data setStr: startPtr withLength: endPtr-startPtr+1];
- return self;
-}
-@end
diff --git a/libconfig/.svn/text-base/config.m.svn-base b/libconfig/.svn/text-base/config.m.svn-base
deleted file mode 100644
index b0d13a9..0000000
--- a/libconfig/.svn/text-base/config.m.svn-base
+++ /dev/null
@@ -1,287 +0,0 @@
-#include "conf.h"
-#include "config.h"
-#include "nastipc.h"
-#include "thread.h"
-
-#include "BuffIO.h"
-#include "ArrayData.h"
-#include "DictData.h"
-#include "NumData.h"
-#include "StringData.h"
-
-#include <netdb.h>
-#include <stdlib.h>
-
-RCSID("$Id: config.m,v 1.5 2001/11/09 15:54:38 shmit Exp $");
-
-/*
- * Global variables.
- */
-static DictData *root;
-char config_filen[MAXPATHLEN];
-struct nast_config config;
-
-static int
-config_read(const char *filename)
-{
- BuffIO *confFile;
-
- confFile = [[[BuffIO new] init: filename] setEOL: ';'];
- if (confFile == nil) {
- fprintf(stderr, "ERROR: Couldn't load config file.");
- return -1;
- }
-
- root = [[DictData new] setFromBuffer: [confFile getCurOff]
- withLength: [confFile getLength]];
-
- /* We've duplicated all the data in here into private storage. */
- [confFile free];
-
- if (root == nil) {
- fprintf(stderr, "ERROR: Couldn't parse config file.");
- return -1;
- }
- return 0;
-}
-
-static int
-get_val(const char *name, void *dst, enum data_type type)
-{
- id node;
-
- node = [[root findChild: name] getData];
- if (node == nil)
- return 0;
-
- switch (type) {
- case NUMBER:
- if (![node isKindOf: [NumData class]]) {
- fprintf(stderr, "Node `%s' in `%s' should be a number.",
- name, config_filen);
- return -1;
- }
- *(int *)dst = [node getNum];
- break;
- case STRING:
- if (![node isKindOf: [StringData class]]) {
- fprintf(stderr, "Node `%s' in `%s' should be a string.",
- name, config_filen);
- return -1;
- }
- *(char **)dst = [node createCStr];
- break;
- case ARRAY:
- fprintf(stderr, "ERROR: Can't load array into C yet.");
- return -1;
- case DICTIONARY:
- fprintf(stderr, "ERROR: Can't load dictionary into C yet.");
- return -1;
- default:
- fprintf(stderr, "ERROR: Don't know what to do with type `%d'.",
- type);
- return -1;
- }
-
- return 0;
-}
-
-/*
- * Sets configuration variables to defaults, in case they're not set
- * elsewhere.
- */
-void
-config_setdefaults()
-{
- /* Set the defaults. */
- config.description = "Description not set in config file.";
- config.nast_dir = DATADIR;
- config.nast_sock = NASTHOLE;
- config.nast_cdb_file = "nast.cdb";
- config.mysql_host = DBHOST;
- config.mysql_user = DBUSER;
- config.mysql_pass = DBPASS;
- config.nofork_flag = 0;
- config.null_cache_timeout = 60;
- config.tcp_port = 31337;
-
- return;
-}
-
-/*
- * Initializes configuration variables from config file.
- */
-int
-config_init()
-{
- snprintf(config_filen, sizeof(config_filen),
- "%s/nastd.conf", config.nast_dir);
- if (config_read(config_filen) == -1)
- return -1;
-
- /*
- * Now grab all the top-level config information.
- */
- if (get_val("description", &config.description, STRING) == -1)
- return -1;
-
- if (get_val("nast_dir", &config.nast_dir, STRING) == -1)
- return -1;
-
- if (get_val("nast_sock", &config.nast_sock, STRING) == -1)
- return -1;
-
- if (get_val("nast_cdb_file", &config.nast_cdb_file, STRING) == -1)
- return -1;
-
- if (get_val("mysql_host", &config.mysql_host, STRING) == -1)
- return -1;
-
- if (get_val("mysql_user", &config.mysql_user, STRING) == -1)
- return -1;
-
- if (get_val("mysql_pass", &config.mysql_pass, STRING) == -1)
- return -1;
-
- if (get_val("null_cache_timeout", &config.null_cache_timeout,
- NUMBER) == -1)
- return -1;
-
- if (get_val("tcp_port", &config.tcp_port, NUMBER) == -1)
- return -1;
-
- return 0;
-}
-
-void
-config_delete()
-{
- [root free];
-}
-
-static enum data_type
-getctype(id node)
-{
- if ([node isKindOf: [StringData class]])
- return STRING;
- else if ([node isKindOf: [NumData class]])
- return NUMBER;
- else if ([node isKindOf: [ArrayData class]])
- return ARRAY;
- else if ([node isKindOf: [DictData class]])
- return DICTIONARY;
- else {
- return -1;
- }
-}
-
-void *
-config_find(void *root_node, const char *name, enum data_type *type)
-{
- id rootNode, dstNode;
-
- if (root_node == NULL)
- root_node = root;
-
- rootNode = (id)root_node;
- if ([rootNode isKindOf: [DictData class]] == NO) {
- fprintf(stderr, "Trying to find `%s' in non-dictionary.", name);
- return NULL;
- }
-
- dstNode = [[rootNode findChild: name] getData];
- if (dstNode == nil)
- return NULL;
- *type = getctype(dstNode);
- return dstNode;
-}
-
-void *
-config_arrayitemat(void *array, int index, enum data_type *type)
-{
- id arrayNode, dstNode;
-
- if (array == NULL)
- return NULL;
-
- arrayNode = (id)array;
- if ([arrayNode isKindOf: [ArrayData class]] == NO) {
- fprintf(stderr, "Trying to index in non-array.");
- return NULL;
- }
-
- if (index >= [arrayNode numObjects])
- return NULL;
-
- dstNode = [arrayNode objectAt: index];
- if (dstNode == nil)
- return NULL;
- *type = getctype(dstNode);
- return dstNode;
-}
-
-void *
-config_dictitemat(void *dict, const char *name, enum data_type *type)
-{
- id dictNode, dstNode;
-
- if (dict == NULL)
- return NULL;
-
- dictNode = (id)dict;
- if ([dictNode isKindOf: [DictData class]] == NO) {
- fprintf(stderr, "Trying to find `%s' in non-dictionary.", name);
- return NULL;
- }
-
- dstNode = [[dictNode findChild: name] getData];
- if (dstNode == nil)
- return NULL;
- *type = getctype(dstNode);
- return dstNode;
-}
-
-void *
-getdata(void *itemref, void *dst, enum data_type want_type)
-{
- id item;
-
- if (itemref == NULL)
- return NULL;
-
- item = (id)itemref;
- if ([item isKindOf: [DataObject class]] == NO) {
- fprintf(stderr, "Can only deref DataObject types "
- "or sub-classes.");
- return NULL;
- }
-
- switch (want_type) {
- case NUMBER:
- if ([item isKindOf: [NumData class]] == NO)
- return NULL;
- *(int *)dst = [item getNum];
- break;
- case STRING:
- if ([item isKindOf: [StringData class]] == NO)
- return NULL;
- *(char **)dst = [item createCStr];
- break;
- case ARRAY:
- if ([item isKindOf: [ArrayData class]] == NO)
- return NULL;
- dst = [item getData];
- break;
- case DICTIONARY:
- if ([item isKindOf: [DictData class]] == NO)
- return NULL;
- dst = [item getData];
- break;
- default:
- fprintf(stderr,
- "Can't deref type `%d': unknown type.", want_type);
- return NULL;
- }
-
- return dst;
-}