Issue #15: add a way to set a JSON_TOKENER_STRICT flag to forbid commas at the end of arrays and objects.
diff --git a/json_tokener.h b/json_tokener.h
index 3da520a..08e5ff7 100644
--- a/json_tokener.h
+++ b/json_tokener.h
@@ -58,7 +58,9 @@
   json_tokener_state_object_field_end,
   json_tokener_state_object_value,
   json_tokener_state_object_value_add,
-  json_tokener_state_object_sep
+  json_tokener_state_object_sep,
+  json_tokener_state_array_after_sep,
+  json_tokener_state_object_field_start_after_sep
 };
 
 struct json_tokener_srec
@@ -80,9 +82,22 @@
   unsigned int ucs_char;
   char quote_char;
   struct json_tokener_srec *stack;
+  int flags;
 };
 
 /**
+ * Be strict when parsing JSON input.  Use caution with
+ * this flag as what is considered valid may become more
+ * restrictive from one release to the next, causing your
+ * code to fail on previously working input.
+ *
+ * This flag is not set by default.
+ *
+ * @see json_tokener_set_flags()
+ */
+#define JSON_TOKENER_STRICT  0x01
+
+/**
  * Given an error previously returned by json_tokener_get_error(),
  * return a human readable description of the error.
  *
@@ -116,6 +131,11 @@
 extern struct json_object* json_tokener_parse(const char *str);
 extern struct json_object* json_tokener_parse_verbose(const char *str, enum json_tokener_error *error);
 
+/**
+ * Set flags that control how parsing will be done.
+ */
+extern void json_tokener_set_flags(struct json_tokener *tok, int flags);
+
 /** 
  * Parse a string and return a non-NULL json_object if a valid JSON value
  * is found.  The string does not need to be a JSON object or array;