using different header location
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Sun, 19 Jun 2005 16:30:02 +0000 (16:30 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Sun, 19 Jun 2005 16:30:02 +0000 (16:30 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@357 9efc2488-bf62-4759-914b-345cdb29e865

src/libjson/arraylist.c
src/libjson/debug.c
src/libjson/json_object.c
src/libjson/json_tokener.c
src/libjson/json_util.c
src/libjson/linkhash.c
src/libjson/oilsMessage.c
src/libjson/oils_method.c
src/libjson/printbuf.c
src/libjson/test1.c
src/libjson/test2.c

index e1593d5..6b42046 100644 (file)
@@ -20,8 +20,8 @@
 #include <string.h>
 #include <strings.h>
 
-#include "libjson/bits.h"
-#include "libjson/arraylist.h"
+#include "bits.h"
+#include "arraylist.h"
 
 
 struct array_list*
index 4bbc893..6212857 100644 (file)
@@ -24,7 +24,7 @@
 #include <unistd.h>
 #include <sys/param.h>
 
-#include "libjson/debug.h"
+#include "debug.h"
 
 
 static int _syslog = 0;
index 5c205db..0694fa4 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#include "libjson/debug.h"
-#include "libjson/printbuf.h"
-#include "libjson/linkhash.h"
-#include "libjson/arraylist.h"
-#include "libjson/json_object.h"
-#include "libjson/ossupport.h"
-#include "libjson/json_object_private.h"
+#include "debug.h"
+#include "printbuf.h"
+#include "linkhash.h"
+#include "arraylist.h"
+#include "json_object.h"
+#include "ossupport.h"
+#include "json_object_private.h"
 
 
 /* #define REFCOUNT_DEBUG */
@@ -88,33 +88,41 @@ static int json_escape_str(struct printbuf *pb, char *str)
   do {
     c = str[pos];
     switch(c) {
-    case '\b':
-    case '\n':
-    case '\r':
-    case '\t':
-    case '"':
-      if(pos - start_offset > 0)
-       printbuf_memappend(pb, str + start_offset, pos - start_offset);
-      if(c == '\b') printbuf_memappend(pb, "\\b", 2);
-      else if(c == '\n') printbuf_memappend(pb, "\\n", 2);
-      else if(c == '\r') printbuf_memappend(pb, "\\r", 2);
-      else if(c == '\t') printbuf_memappend(pb, "\\t", 2);
-      else if(c == '"') printbuf_memappend(pb, "\\\"", 2);
+               case '\b':
+               case '\n':
+               case '\r':
+               case '\t':
+               case '"':
+
+                       if(pos - start_offset > 0)
+                               printbuf_memappend(pb, str + start_offset, pos - start_offset);
+
+                       if(c == '\b')                   printbuf_memappend(pb, "\\b", 2);
+                       else if(c == '\n')      printbuf_memappend(pb, "\\n", 2);
+                       else if(c == '\r')      printbuf_memappend(pb, "\\r", 2);
+                       else if(c == '\t')      printbuf_memappend(pb, "\\t", 2);
+                       else if(c == '"')               printbuf_memappend(pb, "\\\"", 2);
+
       start_offset = ++pos;
       break;
+
     default:
       if(c && c < ' ') {
-       if(pos - start_offset > 0)
-         printbuf_memappend(pb, str + start_offset, pos - start_offset);
-       sprintbuf(pb, "\\u00%c%c",
-                 json_hex_chars[c >> 4],
-                 json_hex_chars[c & 0xf]);
-       start_offset = ++pos;
+                       if(pos - start_offset > 0)
+                               printbuf_memappend(pb, str + start_offset, pos - start_offset);
+
+                       sprintbuf(pb, "\\u00%c%c",
+                               json_hex_chars[c >> 4], json_hex_chars[c & 0xf]);
+
+                       start_offset = ++pos;
+
       } else if(c) pos++;
     }
   } while(c);
+
   if(pos - start_offset > 0)
     printbuf_memappend(pb, str + start_offset, pos - start_offset);
+
   return 0;
 }
 
index 70a0147..277c88f 100644 (file)
 #include <ctype.h>
 #include <string.h>
 
-#include "libjson/json_tokener.h"
-#include "libjson/bits.h"
-#include "libjson/debug.h"
-#include "libjson/printbuf.h"
-#include "libjson/linkhash.h"
-#include "libjson/arraylist.h"
-#include "libjson/json_object.h"
-#include "libjson/ossupport.h"
-#include "libjson/json_object_private.h"
+#include "json_tokener.h"
+#include "bits.h"
+#include "debug.h"
+#include "printbuf.h"
+#include "linkhash.h"
+#include "arraylist.h"
+#include "json_object.h"
+#include "ossupport.h"
+#include "json_object_private.h"
 
 
 
@@ -231,37 +231,40 @@ static struct json_object* json_tokener_do_parse(struct json_tokener *this)
       }
       break;
 
-    case json_tokener_state_escape_unicode:
-      if(strchr(json_hex_chars, c)) {
-       this->pos++;
-       if(this->pos - start_offset == 4) {
-         unsigned char utf_out[3];
-         unsigned int ucs_char =
-           (hexdigit(*(this->source + start_offset)) << 12) +
-           (hexdigit(*(this->source + start_offset + 1)) << 8) +
-           (hexdigit(*(this->source + start_offset + 2)) << 4) +
-           hexdigit(*(this->source + start_offset + 3));
-         if (ucs_char < 0x80) {
-           utf_out[0] = ucs_char;
-           printbuf_memappend(this->pb, utf_out, 1);
-         } else if (ucs_char < 0x800) {
-           utf_out[0] = 0xc0 | (ucs_char >> 6);
-           utf_out[1] = 0x80 | (ucs_char & 0x3f);
-           printbuf_memappend(this->pb, utf_out, 2);
-         } else {
-           utf_out[0] = 0xe0 | (ucs_char >> 12);
-           utf_out[1] = 0x80 | ((ucs_char >> 6) & 0x3f);
-           utf_out[2] = 0x80 | (ucs_char & 0x3f);
-           printbuf_memappend(this->pb, utf_out, 3);
-         }
-         start_offset = this->pos;
-         state = saved_state;
+       case json_tokener_state_escape_unicode:
+
+               if(strchr(json_hex_chars, c)) {
+                       this->pos++;
+
+                       if(this->pos - start_offset == 4) {
+                               unsigned char utf_out[3];
+                               unsigned int ucs_char =
+                                       (hexdigit(*(this->source + start_offset)) << 12) +
+                                       (hexdigit(*(this->source + start_offset + 1)) << 8) +
+                                       (hexdigit(*(this->source + start_offset + 2)) << 4) +
+                                       hexdigit(*(this->source + start_offset + 3));
+
+                               if (ucs_char < 0x80) {
+                                       utf_out[0] = ucs_char;
+                                       printbuf_memappend(this->pb, utf_out, 1);
+                               } else if (ucs_char < 0x800) {
+                                       utf_out[0] = 0xc0 | (ucs_char >> 6);
+                                       utf_out[1] = 0x80 | (ucs_char & 0x3f);
+                                       printbuf_memappend(this->pb, utf_out, 2);
+                               } else {
+                                       utf_out[0] = 0xe0 | (ucs_char >> 12);
+                                       utf_out[1] = 0x80 | ((ucs_char >> 6) & 0x3f);
+                                       utf_out[2] = 0x80 | (ucs_char & 0x3f);
+                                       printbuf_memappend(this->pb, utf_out, 3);
+                               }
+                               start_offset = this->pos;
+                               state = saved_state;
+                               }
+                       } else {
+                               err = json_tokener_error_parse_string;
+                               goto out;
        }
-      } else {
-       err = json_tokener_error_parse_string;
-       goto out;
-      }
-      break;
+       break;
 
     case json_tokener_state_boolean:
       if(strncasecmp("true", this->source + start_offset,
index 7cd4eb3..f014b7a 100644 (file)
@@ -7,16 +7,16 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#include "libjson/json_util.h"
-#include "libjson/json_tokener.h"
-#include "libjson/bits.h"
-#include "libjson/debug.h"
-#include "libjson/printbuf.h"
-#include "libjson/linkhash.h"
-#include "libjson/arraylist.h"
-#include "libjson/json_object.h"
-#include "libjson/ossupport.h"
-#include "libjson/json_object_private.h"
+#include "json_util.h"
+#include "json_tokener.h"
+#include "bits.h"
+#include "debug.h"
+#include "printbuf.h"
+#include "linkhash.h"
+#include "arraylist.h"
+#include "json_object.h"
+#include "ossupport.h"
+#include "json_object_private.h"
 
 
 
index 3066ec5..64f15a0 100644 (file)
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 
-#include "libjson/linkhash.h"
+#include "linkhash.h"
 
 
 void lh_abort(const char *msg, ...)
index 4af7ee3..cddb05b 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdio.h>
 #include <string.h>
-#include "libjson/json.h"
+#include "json.h"
 
 
 struct oils_method_struct {
index ffd2b8b..6a95dc4 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "libjson/json.h"
+#include "json.h"
 
 
 int main(int argc, char **argv)
index 1dfbccd..68c425c 100644 (file)
@@ -21,9 +21,9 @@
 #include <stdarg.h>
 #include <string.h>
 
-#include "libjson/bits.h"
-#include "libjson/debug.h"
-#include "libjson/printbuf.h"
+#include "bits.h"
+#include "debug.h"
+#include "printbuf.h"
 
 
 struct printbuf* printbuf_new()
index f4fecf9..b65a7cd 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "libjson/json.h"
+#include "json.h"
 
 
 int main(int argc, char **argv)
index 93ca0fb..b7bdf62 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "libjson/json.h"
+#include "json.h"
 
 
 int main(int argc, char **argv)