/* autogenerated - do not edit */
#include <jim.h>
int Jim_jsonencodeInit(Jim_Interp *interp)
{
	if (Jim_PackageProvide(interp, "jsonencode", "1.0", JIM_ERRMSG)) return JIM_ERR;
	return Jim_EvalSource(interp, "jsonencode.tcl", 1, "\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"proc json::encode {value {schema str}} {\n"
"	json::subencode [lindex $schema 0] $value [lrange $schema 1 end]\n"
"}\n"
"\n"
"\n"
"proc json::subencode {type value {schema {}}} {\n"
"	switch -exact -- $type {\n"
"		str - \"\" {\n"
"\n"
"\n"
"			return \\\"[string map [list \\\\ \\\\\\\\ \\\" \\\\\" \\f \\\\f \\n \\\\n / \\\\/ \\b \\\\b \\r \\\\r \\t \\\\t] $value]\\\"\n"
"		}\n"
"		num {\n"
"			if {$value in {Inf -Inf}} {\n"
"				append value inity\n"
"			}\n"
"			return $value\n"
"		}\n"
"		bool {\n"
"			if {$value} {\n"
"				return true\n"
"			}\n"
"			return false\n"
"		}\n"
"		obj {\n"
"			set result \"\\{\"\n"
"			set sep \" \"\n"
"			foreach k [lsort [dict keys $value]] {\n"
"				if {[dict exists $schema $k]} {\n"
"					set subtype [dict get $schema $k]\n"
"				} elseif {[dict exists $schema *]} {\n"
"					set subtype [dict get $schema *]\n"
"				} else {\n"
"					set subtype str\n"
"				}\n"
"				append result $sep\\\"$k\\\":\n"
"\n"
"				append result [json::subencode [lindex $subtype 0] [dict get $value $k] [lrange $subtype 1 end]]\n"
"				set sep \", \"\n"
"			}\n"
"			append result \" \\}\"\n"
"			return $result\n"
"		}\n"
"		list {\n"
"			set result \"\\[\"\n"
"			set sep \" \"\n"
"			foreach l $value {\n"
"				append result $sep\n"
"				append result [json::subencode [lindex $schema 0] $l [lrange $schema 1 end]]\n"
"				set sep \", \"\n"
"			}\n"
"			append result \" \\]\"\n"
"			return $result\n"
"		}\n"
"		mixed {\n"
"			set result \"\\[\"\n"
"			set sep \" \"\n"
"			foreach l $value subtype $schema {\n"
"				append result $sep\n"
"				append result [json::subencode [lindex $subtype 0] $l [lrange $subtype 1 end]]\n"
"				set sep \", \"\n"
"			}\n"
"			append result \" \\]\"\n"
"		}\n"
"		default {\n"
"			error \"bad type $type\"\n"
"		}\n"
"	}\n"
"}\n"
"\n"
"\n");
}
