From 79d65188b1c1578a36403c0e5756c81dcc93d816 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Mon, 14 Apr 2008 21:54:00 -0400 Subject: Remove svn files --- libconfig/.svn/README.txt | 2 - libconfig/.svn/empty-file | 0 libconfig/.svn/entries | 202 ----------------- libconfig/.svn/format | 1 - libconfig/.svn/prop-base/.cvsignore.svn-base | 1 - libconfig/.svn/prop-base/.pure.svn-base | 1 - libconfig/.svn/prop-base/ArrayData.h.svn-base | 1 - libconfig/.svn/prop-base/ArrayData.m.svn-base | 1 - libconfig/.svn/prop-base/BuffIO.h.svn-base | 1 - libconfig/.svn/prop-base/BuffIO.m.svn-base | 1 - libconfig/.svn/prop-base/COPYRIGHT.svn-base | 1 - libconfig/.svn/prop-base/Data.h.svn-base | 1 - libconfig/.svn/prop-base/Data.m.svn-base | 1 - libconfig/.svn/prop-base/DictData.h.svn-base | 1 - libconfig/.svn/prop-base/DictData.m.svn-base | 1 - libconfig/.svn/prop-base/Makefile.svn-base | 1 - libconfig/.svn/prop-base/NumData.h.svn-base | 1 - libconfig/.svn/prop-base/NumData.m.svn-base | 1 - libconfig/.svn/prop-base/Parser.h.svn-base | 1 - libconfig/.svn/prop-base/Parser.m.svn-base | 1 - libconfig/.svn/prop-base/String.h.svn-base | 1 - libconfig/.svn/prop-base/String.m.svn-base | 1 - libconfig/.svn/prop-base/StringData.h.svn-base | 1 - libconfig/.svn/prop-base/StringData.m.svn-base | 1 - libconfig/.svn/prop-base/config.m.svn-base | 1 - libconfig/.svn/props/.cvsignore.svn-work | 1 - libconfig/.svn/props/.pure.svn-work | 1 - libconfig/.svn/props/ArrayData.h.svn-work | 1 - libconfig/.svn/props/ArrayData.m.svn-work | 1 - libconfig/.svn/props/BuffIO.h.svn-work | 1 - libconfig/.svn/props/BuffIO.m.svn-work | 1 - libconfig/.svn/props/COPYRIGHT.svn-work | 1 - libconfig/.svn/props/Data.h.svn-work | 1 - libconfig/.svn/props/Data.m.svn-work | 1 - libconfig/.svn/props/DictData.h.svn-work | 1 - libconfig/.svn/props/DictData.m.svn-work | 1 - libconfig/.svn/props/Makefile.svn-work | 1 - libconfig/.svn/props/NumData.h.svn-work | 1 - libconfig/.svn/props/NumData.m.svn-work | 1 - libconfig/.svn/props/Parser.h.svn-work | 1 - libconfig/.svn/props/Parser.m.svn-work | 1 - libconfig/.svn/props/String.h.svn-work | 1 - libconfig/.svn/props/String.m.svn-work | 1 - libconfig/.svn/props/StringData.h.svn-work | 1 - libconfig/.svn/props/StringData.m.svn-work | 1 - libconfig/.svn/props/config.m.svn-work | 1 - libconfig/.svn/text-base/.cvsignore.svn-base | 15 -- libconfig/.svn/text-base/.pure.svn-base | 0 libconfig/.svn/text-base/ArrayData.h.svn-base | 44 ---- libconfig/.svn/text-base/ArrayData.m.svn-base | 161 -------------- libconfig/.svn/text-base/BuffIO.h.svn-base | 49 ----- libconfig/.svn/text-base/BuffIO.m.svn-base | 96 --------- libconfig/.svn/text-base/COPYRIGHT.svn-base | 27 --- libconfig/.svn/text-base/Data.h.svn-base | 62 ------ libconfig/.svn/text-base/Data.m.svn-base | 92 -------- libconfig/.svn/text-base/DictData.h.svn-base | 47 ---- libconfig/.svn/text-base/DictData.m.svn-base | 210 ------------------ libconfig/.svn/text-base/Makefile.svn-base | 11 - libconfig/.svn/text-base/NumData.h.svn-base | 39 ---- libconfig/.svn/text-base/NumData.m.svn-base | 74 ------- libconfig/.svn/text-base/Parser.h.svn-base | 42 ---- libconfig/.svn/text-base/Parser.m.svn-base | 95 -------- libconfig/.svn/text-base/String.h.svn-base | 46 ---- libconfig/.svn/text-base/String.m.svn-base | 82 ------- libconfig/.svn/text-base/StringData.h.svn-base | 41 ---- libconfig/.svn/text-base/StringData.m.svn-base | 117 ---------- libconfig/.svn/text-base/config.m.svn-base | 287 ------------------------- 67 files changed, 1884 deletions(-) delete mode 100644 libconfig/.svn/README.txt delete mode 100644 libconfig/.svn/empty-file delete mode 100644 libconfig/.svn/entries delete mode 100644 libconfig/.svn/format delete mode 100644 libconfig/.svn/prop-base/.cvsignore.svn-base delete mode 100644 libconfig/.svn/prop-base/.pure.svn-base delete mode 100644 libconfig/.svn/prop-base/ArrayData.h.svn-base delete mode 100644 libconfig/.svn/prop-base/ArrayData.m.svn-base delete mode 100644 libconfig/.svn/prop-base/BuffIO.h.svn-base delete mode 100644 libconfig/.svn/prop-base/BuffIO.m.svn-base delete mode 100644 libconfig/.svn/prop-base/COPYRIGHT.svn-base delete mode 100644 libconfig/.svn/prop-base/Data.h.svn-base delete mode 100644 libconfig/.svn/prop-base/Data.m.svn-base delete mode 100644 libconfig/.svn/prop-base/DictData.h.svn-base delete mode 100644 libconfig/.svn/prop-base/DictData.m.svn-base delete mode 100644 libconfig/.svn/prop-base/Makefile.svn-base delete mode 100644 libconfig/.svn/prop-base/NumData.h.svn-base delete mode 100644 libconfig/.svn/prop-base/NumData.m.svn-base delete mode 100644 libconfig/.svn/prop-base/Parser.h.svn-base delete mode 100644 libconfig/.svn/prop-base/Parser.m.svn-base delete mode 100644 libconfig/.svn/prop-base/String.h.svn-base delete mode 100644 libconfig/.svn/prop-base/String.m.svn-base delete mode 100644 libconfig/.svn/prop-base/StringData.h.svn-base delete mode 100644 libconfig/.svn/prop-base/StringData.m.svn-base delete mode 100644 libconfig/.svn/prop-base/config.m.svn-base delete mode 100644 libconfig/.svn/props/.cvsignore.svn-work delete mode 100644 libconfig/.svn/props/.pure.svn-work delete mode 100644 libconfig/.svn/props/ArrayData.h.svn-work delete mode 100644 libconfig/.svn/props/ArrayData.m.svn-work delete mode 100644 libconfig/.svn/props/BuffIO.h.svn-work delete mode 100644 libconfig/.svn/props/BuffIO.m.svn-work delete mode 100644 libconfig/.svn/props/COPYRIGHT.svn-work delete mode 100644 libconfig/.svn/props/Data.h.svn-work delete mode 100644 libconfig/.svn/props/Data.m.svn-work delete mode 100644 libconfig/.svn/props/DictData.h.svn-work delete mode 100644 libconfig/.svn/props/DictData.m.svn-work delete mode 100644 libconfig/.svn/props/Makefile.svn-work delete mode 100644 libconfig/.svn/props/NumData.h.svn-work delete mode 100644 libconfig/.svn/props/NumData.m.svn-work delete mode 100644 libconfig/.svn/props/Parser.h.svn-work delete mode 100644 libconfig/.svn/props/Parser.m.svn-work delete mode 100644 libconfig/.svn/props/String.h.svn-work delete mode 100644 libconfig/.svn/props/String.m.svn-work delete mode 100644 libconfig/.svn/props/StringData.h.svn-work delete mode 100644 libconfig/.svn/props/StringData.m.svn-work delete mode 100644 libconfig/.svn/props/config.m.svn-work delete mode 100644 libconfig/.svn/text-base/.cvsignore.svn-base delete mode 100644 libconfig/.svn/text-base/.pure.svn-base delete mode 100644 libconfig/.svn/text-base/ArrayData.h.svn-base delete mode 100644 libconfig/.svn/text-base/ArrayData.m.svn-base delete mode 100644 libconfig/.svn/text-base/BuffIO.h.svn-base delete mode 100644 libconfig/.svn/text-base/BuffIO.m.svn-base delete mode 100644 libconfig/.svn/text-base/COPYRIGHT.svn-base delete mode 100644 libconfig/.svn/text-base/Data.h.svn-base delete mode 100644 libconfig/.svn/text-base/Data.m.svn-base delete mode 100644 libconfig/.svn/text-base/DictData.h.svn-base delete mode 100644 libconfig/.svn/text-base/DictData.m.svn-base delete mode 100644 libconfig/.svn/text-base/Makefile.svn-base delete mode 100644 libconfig/.svn/text-base/NumData.h.svn-base delete mode 100644 libconfig/.svn/text-base/NumData.m.svn-base delete mode 100644 libconfig/.svn/text-base/Parser.h.svn-base delete mode 100644 libconfig/.svn/text-base/Parser.m.svn-base delete mode 100644 libconfig/.svn/text-base/String.h.svn-base delete mode 100644 libconfig/.svn/text-base/String.m.svn-base delete mode 100644 libconfig/.svn/text-base/StringData.h.svn-base delete mode 100644 libconfig/.svn/text-base/StringData.m.svn-base delete mode 100644 libconfig/.svn/text-base/config.m.svn-base (limited to 'libconfig/.svn') diff --git a/libconfig/.svn/README.txt b/libconfig/.svn/README.txt deleted file mode 100644 index 271a8ce..0000000 --- a/libconfig/.svn/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a Subversion working copy administrative directory. -Visit http://subversion.tigris.org/ for more information. diff --git a/libconfig/.svn/empty-file b/libconfig/.svn/empty-file deleted file mode 100644 index e69de29..0000000 diff --git a/libconfig/.svn/entries b/libconfig/.svn/entries deleted file mode 100644 index 8a68b21..0000000 --- a/libconfig/.svn/entries +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libconfig/.svn/format b/libconfig/.svn/format deleted file mode 100644 index b8626c4..0000000 --- a/libconfig/.svn/format +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/libconfig/.svn/prop-base/.cvsignore.svn-base b/libconfig/.svn/prop-base/.cvsignore.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/.cvsignore.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/.pure.svn-base b/libconfig/.svn/prop-base/.pure.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/.pure.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/ArrayData.h.svn-base b/libconfig/.svn/prop-base/ArrayData.h.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/ArrayData.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/ArrayData.m.svn-base b/libconfig/.svn/prop-base/ArrayData.m.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/ArrayData.m.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/BuffIO.h.svn-base b/libconfig/.svn/prop-base/BuffIO.h.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/BuffIO.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/BuffIO.m.svn-base b/libconfig/.svn/prop-base/BuffIO.m.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/BuffIO.m.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/COPYRIGHT.svn-base b/libconfig/.svn/prop-base/COPYRIGHT.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/COPYRIGHT.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/Data.h.svn-base b/libconfig/.svn/prop-base/Data.h.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/Data.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/Data.m.svn-base b/libconfig/.svn/prop-base/Data.m.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/Data.m.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/DictData.h.svn-base b/libconfig/.svn/prop-base/DictData.h.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/DictData.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/DictData.m.svn-base b/libconfig/.svn/prop-base/DictData.m.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/DictData.m.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/Makefile.svn-base b/libconfig/.svn/prop-base/Makefile.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/Makefile.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/NumData.h.svn-base b/libconfig/.svn/prop-base/NumData.h.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/NumData.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/NumData.m.svn-base b/libconfig/.svn/prop-base/NumData.m.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/NumData.m.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/Parser.h.svn-base b/libconfig/.svn/prop-base/Parser.h.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/Parser.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/Parser.m.svn-base b/libconfig/.svn/prop-base/Parser.m.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/Parser.m.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/String.h.svn-base b/libconfig/.svn/prop-base/String.h.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/String.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/String.m.svn-base b/libconfig/.svn/prop-base/String.m.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/String.m.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/StringData.h.svn-base b/libconfig/.svn/prop-base/StringData.h.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/StringData.h.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/StringData.m.svn-base b/libconfig/.svn/prop-base/StringData.m.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/StringData.m.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/prop-base/config.m.svn-base b/libconfig/.svn/prop-base/config.m.svn-base deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/prop-base/config.m.svn-base +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/.cvsignore.svn-work b/libconfig/.svn/props/.cvsignore.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/.cvsignore.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/.pure.svn-work b/libconfig/.svn/props/.pure.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/.pure.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/ArrayData.h.svn-work b/libconfig/.svn/props/ArrayData.h.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/ArrayData.h.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/ArrayData.m.svn-work b/libconfig/.svn/props/ArrayData.m.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/ArrayData.m.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/BuffIO.h.svn-work b/libconfig/.svn/props/BuffIO.h.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/BuffIO.h.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/BuffIO.m.svn-work b/libconfig/.svn/props/BuffIO.m.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/BuffIO.m.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/COPYRIGHT.svn-work b/libconfig/.svn/props/COPYRIGHT.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/COPYRIGHT.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/Data.h.svn-work b/libconfig/.svn/props/Data.h.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/Data.h.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/Data.m.svn-work b/libconfig/.svn/props/Data.m.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/Data.m.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/DictData.h.svn-work b/libconfig/.svn/props/DictData.h.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/DictData.h.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/DictData.m.svn-work b/libconfig/.svn/props/DictData.m.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/DictData.m.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/Makefile.svn-work b/libconfig/.svn/props/Makefile.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/Makefile.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/NumData.h.svn-work b/libconfig/.svn/props/NumData.h.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/NumData.h.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/NumData.m.svn-work b/libconfig/.svn/props/NumData.m.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/NumData.m.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/Parser.h.svn-work b/libconfig/.svn/props/Parser.h.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/Parser.h.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/Parser.m.svn-work b/libconfig/.svn/props/Parser.m.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/Parser.m.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/String.h.svn-work b/libconfig/.svn/props/String.h.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/String.h.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/String.m.svn-work b/libconfig/.svn/props/String.m.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/String.m.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/StringData.h.svn-work b/libconfig/.svn/props/StringData.h.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/StringData.h.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/StringData.m.svn-work b/libconfig/.svn/props/StringData.m.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/StringData.m.svn-work +++ /dev/null @@ -1 +0,0 @@ -END diff --git a/libconfig/.svn/props/config.m.svn-work b/libconfig/.svn/props/config.m.svn-work deleted file mode 100644 index dce2c1d..0000000 --- a/libconfig/.svn/props/config.m.svn-work +++ /dev/null @@ -1 +0,0 @@ -END 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 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 - * - * 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 - * - * 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 -#include -#include -#include -#include -#include -#include - -@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 - * - * 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 - -#include - -@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 - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include - -@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 - * - * 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 - * - * 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 - -#include - -#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 - * - * 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 -#include -#include -#include -#include -#include -#include - -@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 - * - * 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 - * - * 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 -#include -#include -#include -#include -#include -#include - -@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 - * - * 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 - * - * 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 -#include -#include -#include -#include -#include -#include - -@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 - * - * 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 - -@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 -#include -#include -#include - -@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 - * - * 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 - -@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 - * - * 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 -#include -#include - -@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 - * - * 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 - * - * 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 -#include -#include -#include -#include -#include -#include - -#if NEED_STRINGS -#include -#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 -#include - -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; -} -- cgit v1.2.3