├── .gitignore ├── LibStruct2Json ├── LibStruct2Json.vcxproj ├── LibStruct2Json.vcxproj.filters ├── cJSON.c ├── cJSON.h ├── s2j.c ├── s2j.h └── s2jdef.h ├── README.md └── WechatHookDemo1.sln /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | # ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true 235 | **/wwwroot/lib/ 236 | 237 | # RIA/Silverlight projects 238 | Generated_Code/ 239 | 240 | # Backup & report files from converting an old project file 241 | # to a newer Visual Studio version. Backup files are not needed, 242 | # because we have git ;-) 243 | _UpgradeReport_Files/ 244 | Backup*/ 245 | UpgradeLog*.XML 246 | UpgradeLog*.htm 247 | ServiceFabricBackup/ 248 | *.rptproj.bak 249 | 250 | # SQL Server files 251 | *.mdf 252 | *.ldf 253 | *.ndf 254 | 255 | # Business Intelligence projects 256 | *.rdl.data 257 | *.bim.layout 258 | *.bim_*.settings 259 | *.rptproj.rsuser 260 | 261 | # Microsoft Fakes 262 | FakesAssemblies/ 263 | 264 | # GhostDoc plugin setting file 265 | *.GhostDoc.xml 266 | 267 | # Node.js Tools for Visual Studio 268 | .ntvs_analysis.dat 269 | node_modules/ 270 | 271 | # Visual Studio 6 build log 272 | *.plg 273 | 274 | # Visual Studio 6 workspace options file 275 | *.opt 276 | 277 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 278 | *.vbw 279 | 280 | # Visual Studio LightSwitch build output 281 | **/*.HTMLClient/GeneratedArtifacts 282 | **/*.DesktopClient/GeneratedArtifacts 283 | **/*.DesktopClient/ModelManifest.xml 284 | **/*.Server/GeneratedArtifacts 285 | **/*.Server/ModelManifest.xml 286 | _Pvt_Extensions 287 | 288 | # Paket dependency manager 289 | .paket/paket.exe 290 | paket-files/ 291 | 292 | # FAKE - F# Make 293 | .fake/ 294 | 295 | # JetBrains Rider 296 | .idea/ 297 | *.sln.iml 298 | 299 | # CodeRush personal settings 300 | .cr/personal 301 | 302 | # Python Tools for Visual Studio (PTVS) 303 | __pycache__/ 304 | *.pyc 305 | 306 | # Cake - Uncomment if you are using it 307 | # tools/** 308 | # !tools/packages.config 309 | 310 | # Tabs Studio 311 | *.tss 312 | 313 | # Telerik's JustMock configuration file 314 | *.jmconfig 315 | 316 | # BizTalk build output 317 | *.btp.cs 318 | *.btm.cs 319 | *.odx.cs 320 | *.xsd.cs 321 | 322 | # OpenCover UI analysis results 323 | OpenCover/ 324 | 325 | # Azure Stream Analytics local run output 326 | ASALocalRun/ 327 | 328 | # MSBuild Binary and Structured Log 329 | *.binlog 330 | 331 | # NVidia Nsight GPU debugger configuration file 332 | *.nvuser 333 | 334 | # MFractors (Xamarin productivity tool) working folder 335 | .mfractor/ 336 | 337 | # Local History for Visual Studio 338 | .localhistory/ 339 | 340 | # BeatPulse healthcheck temp database 341 | healthchecksdb -------------------------------------------------------------------------------- /LibStruct2Json/LibStruct2Json.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 15.0 29 | {80572112-5FB2-476C-B453-01D86726F49B} 30 | LibStruct2Json 31 | 10.0.17763.0 32 | 33 | 34 | 35 | StaticLibrary 36 | true 37 | v141 38 | MultiByte 39 | 40 | 41 | Application 42 | false 43 | v141 44 | true 45 | MultiByte 46 | 47 | 48 | Application 49 | true 50 | v141 51 | MultiByte 52 | 53 | 54 | Application 55 | false 56 | v141 57 | true 58 | MultiByte 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | Level3 82 | Disabled 83 | true 84 | true 85 | _MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS 86 | 87 | 88 | 89 | 90 | Level3 91 | Disabled 92 | true 93 | true 94 | 95 | 96 | 97 | 98 | Level3 99 | MaxSpeed 100 | true 101 | true 102 | true 103 | true 104 | 105 | 106 | true 107 | true 108 | 109 | 110 | 111 | 112 | Level3 113 | MaxSpeed 114 | true 115 | true 116 | true 117 | true 118 | 119 | 120 | true 121 | true 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /LibStruct2Json/LibStruct2Json.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 23 | 24 | 源文件 25 | 26 | 27 | -------------------------------------------------------------------------------- /LibStruct2Json/cJSON.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Dave Gamble 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | /* cJSON */ 24 | /* JSON parser in C. */ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "cJSON.h" 34 | 35 | static const char *ep; 36 | 37 | const char *cJSON_GetErrorPtr(void) { return ep; } 38 | 39 | static int cJSON_strcasecmp(const char *s1, const char *s2) 40 | { 41 | if (!s1) return (s1 == s2) ? 0 : 1; if (!s2) return 1; 42 | for (; tolower(*s1) == tolower(*s2); ++s1, ++s2) if (*s1 == 0) return 0; 43 | return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2); 44 | } 45 | 46 | static void *(*cJSON_malloc)(size_t sz) = malloc; 47 | static void(*cJSON_free)(void *ptr) = free; 48 | 49 | static char* cJSON_strdup(const char* str) 50 | { 51 | size_t len; 52 | char* copy; 53 | 54 | len = strlen(str) + 1; 55 | if (!(copy = (char*)cJSON_malloc(len))) return 0; 56 | memcpy(copy, str, len); 57 | return copy; 58 | } 59 | 60 | void cJSON_InitHooks(cJSON_Hooks* hooks) 61 | { 62 | if (!hooks) { /* Reset hooks */ 63 | cJSON_malloc = malloc; 64 | cJSON_free = free; 65 | return; 66 | } 67 | 68 | cJSON_malloc = (hooks->malloc_fn) ? hooks->malloc_fn : malloc; 69 | cJSON_free = (hooks->free_fn) ? hooks->free_fn : free; 70 | } 71 | 72 | /* Internal constructor. */ 73 | static cJSON *cJSON_New_Item(void) 74 | { 75 | cJSON* node = (cJSON*)cJSON_malloc(sizeof(cJSON)); 76 | if (node) memset(node, 0, sizeof(cJSON)); 77 | return node; 78 | } 79 | 80 | /* Delete a cJSON structure. */ 81 | void cJSON_Delete(cJSON *c) 82 | { 83 | cJSON *next; 84 | while (c) 85 | { 86 | next = c->next; 87 | if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child); 88 | if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring); 89 | if (!(c->type&cJSON_StringIsConst) && c->string) cJSON_free(c->string); 90 | cJSON_free(c); 91 | c = next; 92 | } 93 | } 94 | 95 | /* Parse the input text to generate a number, and populate the result into item. */ 96 | static const char *parse_number(cJSON *item, const char *num) 97 | { 98 | double n = 0, sign = 1, scale = 0; int subscale = 0, signsubscale = 1; 99 | 100 | if (*num == '-') sign = -1, num++; /* Has sign? */ 101 | if (*num == '0') num++; /* is zero */ 102 | if (*num >= '1' && *num <= '9') do n = (n*10.0) + (*num++ - '0'); while (*num >= '0' && *num <= '9'); /* Number? */ 103 | if (*num == '.' && num[1] >= '0' && num[1] <= '9') { num++; do n = (n*10.0) + (*num++ - '0'), scale--; while (*num >= '0' && *num <= '9'); } /* Fractional part? */ 104 | if (*num == 'e' || *num == 'E') /* Exponent? */ 105 | { 106 | num++; if (*num == '+') num++; else if (*num == '-') signsubscale = -1, num++; /* With sign? */ 107 | while (*num >= '0' && *num <= '9') subscale = (subscale * 10) + (*num++ - '0'); /* Number? */ 108 | } 109 | 110 | n = sign * n*pow(10.0, (scale + subscale * signsubscale)); /* number = +/- number.fraction * 10^+/- exponent */ 111 | 112 | item->valuedouble = n; 113 | item->valueint = (int)n; 114 | item->type = cJSON_Number; 115 | return num; 116 | } 117 | 118 | static int pow2gt(int x) { --x; x |= x >> 1; x |= x >> 2; x |= x >> 4; x |= x >> 8; x |= x >> 16; return x + 1; } 119 | 120 | typedef struct { char *buffer; int length; int offset; } printbuffer; 121 | 122 | static char* ensure(printbuffer *p, int needed) 123 | { 124 | char *newbuffer; int newsize; 125 | if (!p || !p->buffer) return 0; 126 | needed += p->offset; 127 | if (needed <= p->length) return p->buffer + p->offset; 128 | 129 | newsize = pow2gt(needed); 130 | newbuffer = (char*)cJSON_malloc(newsize); 131 | if (!newbuffer) { cJSON_free(p->buffer); p->length = 0, p->buffer = 0; return 0; } 132 | if (newbuffer) memcpy(newbuffer, p->buffer, p->length); 133 | cJSON_free(p->buffer); 134 | p->length = newsize; 135 | p->buffer = newbuffer; 136 | return newbuffer + p->offset; 137 | } 138 | 139 | static int update(printbuffer *p) 140 | { 141 | char *str; 142 | if (!p || !p->buffer) return 0; 143 | str = p->buffer + p->offset; 144 | return p->offset + strlen(str); 145 | } 146 | 147 | /* Render the number nicely from the given item into a string. */ 148 | static char *print_number(cJSON *item, printbuffer *p) 149 | { 150 | char *str = 0; 151 | double d = item->valuedouble; 152 | if (d == 0) 153 | { 154 | if (p) str = ensure(p, 2); 155 | else str = (char*)cJSON_malloc(2); /* special case for 0. */ 156 | if (str) strcpy(str, "0"); 157 | } 158 | else if (fabs(((double)item->valueint) - d) <= DBL_EPSILON && d <= INT_MAX && d >= INT_MIN) 159 | { 160 | if (p) str = ensure(p, 21); 161 | else str = (char*)cJSON_malloc(21); /* 2^64+1 can be represented in 21 chars. */ 162 | if (str) sprintf(str, "%d", item->valueint); 163 | } 164 | else 165 | { 166 | if (p) str = ensure(p, 64); 167 | else str = (char*)cJSON_malloc(64); /* This is a nice tradeoff. */ 168 | if (str) 169 | { 170 | if (fpclassify(d) != FP_ZERO && !isnormal(d)) sprintf(str, "null"); 171 | else if (fabs(floor(d) - d) <= DBL_EPSILON && fabs(d) < 1.0e60) sprintf(str, "%.0f", d); 172 | else if (fabs(d) < 1.0e-6 || fabs(d) > 1.0e9) sprintf(str, "%e", d); 173 | else sprintf(str, "%f", d); 174 | } 175 | } 176 | return str; 177 | } 178 | 179 | static unsigned parse_hex4(const char *str) 180 | { 181 | unsigned h = 0; 182 | if (*str >= '0' && *str <= '9') h += (*str) - '0'; else if (*str >= 'A' && *str <= 'F') h += 10 + (*str) - 'A'; else if (*str >= 'a' && *str <= 'f') h += 10 + (*str) - 'a'; else return 0; 183 | h = h << 4; str++; 184 | if (*str >= '0' && *str <= '9') h += (*str) - '0'; else if (*str >= 'A' && *str <= 'F') h += 10 + (*str) - 'A'; else if (*str >= 'a' && *str <= 'f') h += 10 + (*str) - 'a'; else return 0; 185 | h = h << 4; str++; 186 | if (*str >= '0' && *str <= '9') h += (*str) - '0'; else if (*str >= 'A' && *str <= 'F') h += 10 + (*str) - 'A'; else if (*str >= 'a' && *str <= 'f') h += 10 + (*str) - 'a'; else return 0; 187 | h = h << 4; str++; 188 | if (*str >= '0' && *str <= '9') h += (*str) - '0'; else if (*str >= 'A' && *str <= 'F') h += 10 + (*str) - 'A'; else if (*str >= 'a' && *str <= 'f') h += 10 + (*str) - 'a'; else return 0; 189 | return h; 190 | } 191 | 192 | /* Parse the input text into an unescaped cstring, and populate item. */ 193 | static const unsigned char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; 194 | static const char *parse_string(cJSON *item, const char *str) 195 | { 196 | const char *ptr = str + 1; char *ptr2; char *out; int len = 0; unsigned uc, uc2; 197 | if (*str != '\"') { ep = str; return 0; } /* not a string! */ 198 | 199 | while (*ptr != '\"' && *ptr && ++len) if (*ptr++ == '\\') ptr++; /* Skip escaped quotes. */ 200 | 201 | out = (char*)cJSON_malloc(len + 1); /* This is how long we need for the string, roughly. */ 202 | if (!out) return 0; 203 | 204 | ptr = str + 1; ptr2 = out; 205 | while (*ptr != '\"' && *ptr) 206 | { 207 | if (*ptr != '\\') *ptr2++ = *ptr++; 208 | else 209 | { 210 | ptr++; 211 | switch (*ptr) 212 | { 213 | case 'b': *ptr2++ = '\b'; break; 214 | case 'f': *ptr2++ = '\f'; break; 215 | case 'n': *ptr2++ = '\n'; break; 216 | case 'r': *ptr2++ = '\r'; break; 217 | case 't': *ptr2++ = '\t'; break; 218 | case 'u': /* transcode utf16 to utf8. */ 219 | uc = parse_hex4(ptr + 1); ptr += 4; /* get the unicode char. */ 220 | 221 | if ((uc >= 0xDC00 && uc <= 0xDFFF) || uc == 0) break; /* check for invalid. */ 222 | 223 | if (uc >= 0xD800 && uc <= 0xDBFF) /* UTF16 surrogate pairs. */ 224 | { 225 | if (ptr[1] != '\\' || ptr[2] != 'u') break; /* missing second-half of surrogate. */ 226 | uc2 = parse_hex4(ptr + 3); ptr += 6; 227 | if (uc2 < 0xDC00 || uc2>0xDFFF) break; /* invalid second-half of surrogate. */ 228 | uc = 0x10000 + (((uc & 0x3FF) << 10) | (uc2 & 0x3FF)); 229 | } 230 | 231 | len = 4; if (uc < 0x80) len = 1; else if (uc < 0x800) len = 2; else if (uc < 0x10000) len = 3; ptr2 += len; 232 | 233 | switch (len) { 234 | case 4: *--ptr2 = ((uc | 0x80) & 0xBF); uc >>= 6; 235 | case 3: *--ptr2 = ((uc | 0x80) & 0xBF); uc >>= 6; 236 | case 2: *--ptr2 = ((uc | 0x80) & 0xBF); uc >>= 6; 237 | case 1: *--ptr2 = (uc | firstByteMark[len]); 238 | } 239 | ptr2 += len; 240 | break; 241 | default: *ptr2++ = *ptr; break; 242 | } 243 | ptr++; 244 | } 245 | } 246 | *ptr2 = 0; 247 | if (*ptr == '\"') ptr++; 248 | item->valuestring = out; 249 | item->type = cJSON_String; 250 | return ptr; 251 | } 252 | 253 | /* Render the cstring provided to an escaped version that can be printed. */ 254 | static char *print_string_ptr(const char *str, printbuffer *p) 255 | { 256 | const char *ptr; char *ptr2, *out; int len = 0, flag = 0; unsigned char token; 257 | 258 | for (ptr = str; *ptr; ptr++) flag |= ((*ptr > 0 && *ptr < 32) || (*ptr == '\"') || (*ptr == '\\')) ? 1 : 0; 259 | if (!flag) 260 | { 261 | len = ptr - str; 262 | if (p) out = ensure(p, len + 3); 263 | else out = (char*)cJSON_malloc(len + 3); 264 | if (!out) return 0; 265 | ptr2 = out; *ptr2++ = '\"'; 266 | strcpy(ptr2, str); 267 | ptr2[len] = '\"'; 268 | ptr2[len + 1] = 0; 269 | return out; 270 | } 271 | 272 | if (!str) 273 | { 274 | if (p) out = ensure(p, 3); 275 | else out = (char*)cJSON_malloc(3); 276 | if (!out) return 0; 277 | strcpy(out, "\"\""); 278 | return out; 279 | } 280 | ptr = str; while ((token = *ptr) && ++len) { if (strchr("\"\\\b\f\n\r\t", token)) len++; else if (token < 32) len += 5; ptr++; } 281 | 282 | if (p) out = ensure(p, len + 3); 283 | else out = (char*)cJSON_malloc(len + 3); 284 | if (!out) return 0; 285 | 286 | ptr2 = out; ptr = str; 287 | *ptr2++ = '\"'; 288 | while (*ptr) 289 | { 290 | if ((unsigned char)*ptr > 31 && *ptr != '\"' && *ptr != '\\') *ptr2++ = *ptr++; 291 | else 292 | { 293 | *ptr2++ = '\\'; 294 | switch (token = *ptr++) 295 | { 296 | case '\\': *ptr2++ = '\\'; break; 297 | case '\"': *ptr2++ = '\"'; break; 298 | case '\b': *ptr2++ = 'b'; break; 299 | case '\f': *ptr2++ = 'f'; break; 300 | case '\n': *ptr2++ = 'n'; break; 301 | case '\r': *ptr2++ = 'r'; break; 302 | case '\t': *ptr2++ = 't'; break; 303 | default: sprintf(ptr2, "u%04x", token); ptr2 += 5; break; /* escape and print */ 304 | } 305 | } 306 | } 307 | *ptr2++ = '\"'; *ptr2++ = 0; 308 | return out; 309 | } 310 | /* Invote print_string_ptr (which is useful) on an item. */ 311 | static char *print_string(cJSON *item, printbuffer *p) { return print_string_ptr(item->valuestring, p); } 312 | 313 | /* Predeclare these prototypes. */ 314 | static const char *parse_value(cJSON *item, const char *value); 315 | static char *print_value(cJSON *item, int depth, int fmt, printbuffer *p); 316 | static const char *parse_array(cJSON *item, const char *value); 317 | static char *print_array(cJSON *item, int depth, int fmt, printbuffer *p); 318 | static const char *parse_object(cJSON *item, const char *value); 319 | static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p); 320 | 321 | /* Utility to jump whitespace and cr/lf */ 322 | static const char *skip(const char *in) { while (in && *in && (unsigned char)*in <= 32) in++; return in; } 323 | 324 | /* Parse an object - create a new root, and populate. */ 325 | cJSON *cJSON_ParseWithOpts(const char *value, const char **return_parse_end, int require_null_terminated) 326 | { 327 | const char *end = 0; 328 | cJSON *c = cJSON_New_Item(); 329 | ep = 0; 330 | if (!c) return 0; /* memory fail */ 331 | 332 | end = parse_value(c, skip(value)); 333 | if (!end) { cJSON_Delete(c); return 0; } /* parse failure. ep is set. */ 334 | 335 | /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ 336 | if (require_null_terminated) { end = skip(end); if (*end) { cJSON_Delete(c); ep = end; return 0; } } 337 | if (return_parse_end) *return_parse_end = end; 338 | return c; 339 | } 340 | /* Default options for cJSON_Parse */ 341 | cJSON *cJSON_Parse(const char *value) { return cJSON_ParseWithOpts(value, 0, 0); } 342 | 343 | /* Render a cJSON item/entity/structure to text. */ 344 | char *cJSON_Print(cJSON *item) { return print_value(item, 0, 1, 0); } 345 | char *cJSON_PrintUnformatted(cJSON *item) { return print_value(item, 0, 0, 0); } 346 | 347 | char *cJSON_PrintBuffered(cJSON *item, int prebuffer, int fmt) 348 | { 349 | printbuffer p; 350 | p.buffer = (char*)cJSON_malloc(prebuffer); 351 | p.length = prebuffer; 352 | p.offset = 0; 353 | return print_value(item, 0, fmt, &p); 354 | return p.buffer; 355 | } 356 | 357 | 358 | /* Parser core - when encountering text, process appropriately. */ 359 | static const char *parse_value(cJSON *item, const char *value) 360 | { 361 | if (!value) return 0; /* Fail on null. */ 362 | if (!strncmp(value, "null", 4)) { item->type = cJSON_NULL; return value + 4; } 363 | if (!strncmp(value, "false", 5)) { item->type = cJSON_False; return value + 5; } 364 | if (!strncmp(value, "true", 4)) { item->type = cJSON_True; item->valueint = 1; return value + 4; } 365 | if (*value == '\"') { return parse_string(item, value); } 366 | if (*value == '-' || (*value >= '0' && *value <= '9')) { return parse_number(item, value); } 367 | if (*value == '[') { return parse_array(item, value); } 368 | if (*value == '{') { return parse_object(item, value); } 369 | 370 | ep = value; return 0; /* failure. */ 371 | } 372 | 373 | /* Render a value to text. */ 374 | static char *print_value(cJSON *item, int depth, int fmt, printbuffer *p) 375 | { 376 | char *out = 0; 377 | if (!item) return 0; 378 | if (p) 379 | { 380 | switch ((item->type) & 255) 381 | { 382 | case cJSON_NULL: {out = ensure(p, 5); if (out) strcpy(out, "null"); break; } 383 | case cJSON_False: {out = ensure(p, 6); if (out) strcpy(out, "false"); break; } 384 | case cJSON_True: {out = ensure(p, 5); if (out) strcpy(out, "true"); break; } 385 | case cJSON_Number: out = print_number(item, p); break; 386 | case cJSON_String: out = print_string(item, p); break; 387 | case cJSON_Array: out = print_array(item, depth, fmt, p); break; 388 | case cJSON_Object: out = print_object(item, depth, fmt, p); break; 389 | } 390 | } 391 | else 392 | { 393 | switch ((item->type) & 255) 394 | { 395 | case cJSON_NULL: out = cJSON_strdup("null"); break; 396 | case cJSON_False: out = cJSON_strdup("false"); break; 397 | case cJSON_True: out = cJSON_strdup("true"); break; 398 | case cJSON_Number: out = print_number(item, 0); break; 399 | case cJSON_String: out = print_string(item, 0); break; 400 | case cJSON_Array: out = print_array(item, depth, fmt, 0); break; 401 | case cJSON_Object: out = print_object(item, depth, fmt, 0); break; 402 | } 403 | } 404 | return out; 405 | } 406 | 407 | /* Build an array from input text. */ 408 | static const char *parse_array(cJSON *item, const char *value) 409 | { 410 | cJSON *child; 411 | if (*value != '[') { ep = value; return 0; } /* not an array! */ 412 | 413 | item->type = cJSON_Array; 414 | value = skip(value + 1); 415 | if (*value == ']') return value + 1; /* empty array. */ 416 | 417 | item->child = child = cJSON_New_Item(); 418 | if (!item->child) return 0; /* memory fail */ 419 | value = skip(parse_value(child, skip(value))); /* skip any spacing, get the value. */ 420 | if (!value) return 0; 421 | 422 | while (*value == ',') 423 | { 424 | cJSON *new_item; 425 | if (!(new_item = cJSON_New_Item())) return 0; /* memory fail */ 426 | child->next = new_item; new_item->prev = child; child = new_item; 427 | value = skip(parse_value(child, skip(value + 1))); 428 | if (!value) return 0; /* memory fail */ 429 | } 430 | 431 | if (*value == ']') return value + 1; /* end of array */ 432 | ep = value; return 0; /* malformed. */ 433 | } 434 | 435 | /* Render an array to text */ 436 | static char *print_array(cJSON *item, int depth, int fmt, printbuffer *p) 437 | { 438 | char **entries; 439 | char *out = 0, *ptr, *ret; int len = 5; 440 | cJSON *child = item->child; 441 | int numentries = 0, i = 0, fail = 0; 442 | size_t tmplen = 0; 443 | 444 | /* How many entries in the array? */ 445 | while (child) numentries++, child = child->next; 446 | /* Explicitly handle numentries==0 */ 447 | if (!numentries) 448 | { 449 | if (p) out = ensure(p, 3); 450 | else out = (char*)cJSON_malloc(3); 451 | if (out) strcpy(out, "[]"); 452 | return out; 453 | } 454 | 455 | if (p) 456 | { 457 | /* Compose the output array. */ 458 | i = p->offset; 459 | ptr = ensure(p, 1); if (!ptr) return 0; *ptr = '['; p->offset++; 460 | child = item->child; 461 | while (child && !fail) 462 | { 463 | print_value(child, depth + 1, fmt, p); 464 | p->offset = update(p); 465 | if (child->next) { len = fmt ? 2 : 1; ptr = ensure(p, len + 1); if (!ptr) return 0; *ptr++ = ','; if (fmt)*ptr++ = ' '; *ptr = 0; p->offset += len; } 466 | child = child->next; 467 | } 468 | ptr = ensure(p, 2); if (!ptr) return 0; *ptr++ = ']'; *ptr = 0; 469 | out = (p->buffer) + i; 470 | } 471 | else 472 | { 473 | /* Allocate an array to hold the values for each */ 474 | entries = (char**)cJSON_malloc(numentries * sizeof(char*)); 475 | if (!entries) return 0; 476 | memset(entries, 0, numentries * sizeof(char*)); 477 | /* Retrieve all the results: */ 478 | child = item->child; 479 | while (child && !fail) 480 | { 481 | ret = print_value(child, depth + 1, fmt, 0); 482 | entries[i++] = ret; 483 | if (ret) len += strlen(ret) + 2 + (fmt ? 1 : 0); else fail = 1; 484 | child = child->next; 485 | } 486 | 487 | /* If we didn't fail, try to malloc the output string */ 488 | if (!fail) out = (char*)cJSON_malloc(len); 489 | /* If that fails, we fail. */ 490 | if (!out) fail = 1; 491 | 492 | /* Handle failure. */ 493 | if (fail) 494 | { 495 | for (i = 0; i < numentries; i++) if (entries[i]) cJSON_free(entries[i]); 496 | cJSON_free(entries); 497 | return 0; 498 | } 499 | 500 | /* Compose the output array. */ 501 | *out = '['; 502 | ptr = out + 1; *ptr = 0; 503 | for (i = 0; i < numentries; i++) 504 | { 505 | tmplen = strlen(entries[i]); memcpy(ptr, entries[i], tmplen); ptr += tmplen; 506 | if (i != numentries - 1) { *ptr++ = ','; if (fmt)*ptr++ = ' '; *ptr = 0; } 507 | cJSON_free(entries[i]); 508 | } 509 | cJSON_free(entries); 510 | *ptr++ = ']'; *ptr++ = 0; 511 | } 512 | return out; 513 | } 514 | 515 | /* Build an object from the text. */ 516 | static const char *parse_object(cJSON *item, const char *value) 517 | { 518 | cJSON *child; 519 | if (*value != '{') { ep = value; return 0; } /* not an object! */ 520 | 521 | item->type = cJSON_Object; 522 | value = skip(value + 1); 523 | if (*value == '}') return value + 1; /* empty array. */ 524 | 525 | item->child = child = cJSON_New_Item(); 526 | if (!item->child) return 0; 527 | value = skip(parse_string(child, skip(value))); 528 | if (!value) return 0; 529 | child->string = child->valuestring; child->valuestring = 0; 530 | if (*value != ':') { ep = value; return 0; } /* fail! */ 531 | value = skip(parse_value(child, skip(value + 1))); /* skip any spacing, get the value. */ 532 | if (!value) return 0; 533 | 534 | while (*value == ',') 535 | { 536 | cJSON *new_item; 537 | if (!(new_item = cJSON_New_Item())) return 0; /* memory fail */ 538 | child->next = new_item; new_item->prev = child; child = new_item; 539 | value = skip(parse_string(child, skip(value + 1))); 540 | if (!value) return 0; 541 | child->string = child->valuestring; child->valuestring = 0; 542 | if (*value != ':') { ep = value; return 0; } /* fail! */ 543 | value = skip(parse_value(child, skip(value + 1))); /* skip any spacing, get the value. */ 544 | if (!value) return 0; 545 | } 546 | 547 | if (*value == '}') return value + 1; /* end of array */ 548 | ep = value; return 0; /* malformed. */ 549 | } 550 | 551 | /* Render an object to text. */ 552 | static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) 553 | { 554 | char **entries = 0, **names = 0; 555 | char *out = 0, *ptr, *ret, *str; int len = 7, i = 0, j; 556 | cJSON *child = item->child; 557 | int numentries = 0, fail = 0; 558 | size_t tmplen = 0; 559 | /* Count the number of entries. */ 560 | while (child) numentries++, child = child->next; 561 | /* Explicitly handle empty object case */ 562 | if (!numentries) 563 | { 564 | if (p) out = ensure(p, fmt ? depth + 4 : 3); 565 | else out = (char*)cJSON_malloc(fmt ? depth + 4 : 3); 566 | if (!out) return 0; 567 | ptr = out; *ptr++ = '{'; 568 | if (fmt) { *ptr++ = '\n'; for (i = 0; i < depth - 1; i++) *ptr++ = '\t'; } 569 | *ptr++ = '}'; *ptr++ = 0; 570 | return out; 571 | } 572 | if (p) 573 | { 574 | /* Compose the output: */ 575 | i = p->offset; 576 | len = fmt ? 2 : 1; ptr = ensure(p, len + 1); if (!ptr) return 0; 577 | *ptr++ = '{'; if (fmt) *ptr++ = '\n'; *ptr = 0; p->offset += len; 578 | child = item->child; depth++; 579 | while (child) 580 | { 581 | if (fmt) 582 | { 583 | ptr = ensure(p, depth); if (!ptr) return 0; 584 | for (j = 0; j < depth; j++) *ptr++ = '\t'; 585 | p->offset += depth; 586 | } 587 | print_string_ptr(child->string, p); 588 | p->offset = update(p); 589 | 590 | len = fmt ? 2 : 1; 591 | ptr = ensure(p, len); if (!ptr) return 0; 592 | *ptr++ = ':'; if (fmt) *ptr++ = '\t'; 593 | p->offset += len; 594 | 595 | print_value(child, depth, fmt, p); 596 | p->offset = update(p); 597 | 598 | len = (fmt ? 1 : 0) + (child->next ? 1 : 0); 599 | ptr = ensure(p, len + 1); if (!ptr) return 0; 600 | if (child->next) *ptr++ = ','; 601 | if (fmt) *ptr++ = '\n'; *ptr = 0; 602 | p->offset += len; 603 | child = child->next; 604 | } 605 | ptr = ensure(p, fmt ? (depth + 1) : 2); if (!ptr) return 0; 606 | if (fmt) for (i = 0; i < depth - 1; i++) *ptr++ = '\t'; 607 | *ptr++ = '}'; *ptr = 0; 608 | out = (p->buffer) + i; 609 | } 610 | else 611 | { 612 | /* Allocate space for the names and the objects */ 613 | entries = (char**)cJSON_malloc(numentries * sizeof(char*)); 614 | if (!entries) return 0; 615 | names = (char**)cJSON_malloc(numentries * sizeof(char*)); 616 | if (!names) { cJSON_free(entries); return 0; } 617 | memset(entries, 0, sizeof(char*)*numentries); 618 | memset(names, 0, sizeof(char*)*numentries); 619 | 620 | /* Collect all the results into our arrays: */ 621 | child = item->child; depth++; if (fmt) len += depth; 622 | while (child && !fail) 623 | { 624 | names[i] = str = print_string_ptr(child->string, 0); 625 | entries[i++] = ret = print_value(child, depth, fmt, 0); 626 | if (str && ret) len += strlen(ret) + strlen(str) + 2 + (fmt ? 2 + depth : 0); else fail = 1; 627 | child = child->next; 628 | } 629 | 630 | /* Try to allocate the output string */ 631 | if (!fail) out = (char*)cJSON_malloc(len); 632 | if (!out) fail = 1; 633 | 634 | /* Handle failure */ 635 | if (fail) 636 | { 637 | for (i = 0; i < numentries; i++) { if (names[i]) cJSON_free(names[i]); if (entries[i]) cJSON_free(entries[i]); } 638 | cJSON_free(names); cJSON_free(entries); 639 | return 0; 640 | } 641 | 642 | /* Compose the output: */ 643 | *out = '{'; ptr = out + 1; if (fmt)*ptr++ = '\n'; *ptr = 0; 644 | for (i = 0; i < numentries; i++) 645 | { 646 | if (fmt) for (j = 0; j < depth; j++) *ptr++ = '\t'; 647 | tmplen = strlen(names[i]); memcpy(ptr, names[i], tmplen); ptr += tmplen; 648 | *ptr++ = ':'; if (fmt) *ptr++ = '\t'; 649 | strcpy(ptr, entries[i]); ptr += strlen(entries[i]); 650 | if (i != numentries - 1) *ptr++ = ','; 651 | if (fmt) *ptr++ = '\n'; *ptr = 0; 652 | cJSON_free(names[i]); cJSON_free(entries[i]); 653 | } 654 | 655 | cJSON_free(names); cJSON_free(entries); 656 | if (fmt) for (i = 0; i < depth - 1; i++) *ptr++ = '\t'; 657 | *ptr++ = '}'; *ptr++ = 0; 658 | } 659 | return out; 660 | } 661 | 662 | /* Get Array size/item / object item. */ 663 | int cJSON_GetArraySize(cJSON *array) { cJSON *c = array->child; int i = 0; while (c)i++, c = c->next; return i; } 664 | cJSON *cJSON_GetArrayItem(cJSON *array, int item) { cJSON *c = array->child; while (c && item > 0) item--, c = c->next; return c; } 665 | cJSON *cJSON_GetObjectItem(cJSON *object, const char *string) { cJSON *c = object->child; while (c && cJSON_strcasecmp(c->string, string)) c = c->next; return c; } 666 | int cJSON_HasObjectItem(cJSON *object, const char *string) { 667 | cJSON *c = object->child; 668 | while (c) 669 | { 670 | if (cJSON_strcasecmp(c->string, string) == 0) { 671 | return 1; 672 | } 673 | c = c->next; 674 | } 675 | return 0; 676 | } 677 | 678 | /* Utility for array list handling. */ 679 | static void suffix_object(cJSON *prev, cJSON *item) { prev->next = item; item->prev = prev; } 680 | /* Utility for handling references. */ 681 | static cJSON *create_reference(cJSON *item) { cJSON *ref = cJSON_New_Item(); if (!ref) return 0; memcpy(ref, item, sizeof(cJSON)); ref->string = 0; ref->type |= cJSON_IsReference; ref->next = ref->prev = 0; return ref; } 682 | 683 | /* Add item to array/object. */ 684 | void cJSON_AddItemToArray(cJSON *array, cJSON *item) { cJSON *c = array->child; if (!item) return; if (!c) { array->child = item; } else { while (c && c->next) c = c->next; suffix_object(c, item); } } 685 | void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) { if (!item) return; if (item->string) cJSON_free(item->string); item->string = cJSON_strdup(string); cJSON_AddItemToArray(object, item); } 686 | void cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) { if (!item) return; if (!(item->type&cJSON_StringIsConst) && item->string) cJSON_free(item->string); item->string = (char*)string; item->type |= cJSON_StringIsConst; cJSON_AddItemToArray(object, item); } 687 | void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) { cJSON_AddItemToArray(array, create_reference(item)); } 688 | void cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) { cJSON_AddItemToObject(object, string, create_reference(item)); } 689 | 690 | cJSON *cJSON_DetachItemFromArray(cJSON *array, int which) { 691 | cJSON *c = array->child; while (c && which > 0) c = c->next, which--; if (!c) return 0; 692 | if (c->prev) c->prev->next = c->next; if (c->next) c->next->prev = c->prev; if (c == array->child) array->child = c->next; c->prev = c->next = 0; return c; 693 | } 694 | void cJSON_DeleteItemFromArray(cJSON *array, int which) { cJSON_Delete(cJSON_DetachItemFromArray(array, which)); } 695 | cJSON *cJSON_DetachItemFromObject(cJSON *object, const char *string) { int i = 0; cJSON *c = object->child; while (c && cJSON_strcasecmp(c->string, string)) i++, c = c->next; if (c) return cJSON_DetachItemFromArray(object, i); return 0; } 696 | void cJSON_DeleteItemFromObject(cJSON *object, const char *string) { cJSON_Delete(cJSON_DetachItemFromObject(object, string)); } 697 | 698 | /* Replace array/object items with new ones. */ 699 | void cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) { 700 | cJSON *c = array->child; while (c && which > 0) c = c->next, which--; if (!c) { cJSON_AddItemToArray(array, newitem); return; } 701 | newitem->next = c; newitem->prev = c->prev; c->prev = newitem; if (c == array->child) array->child = newitem; else newitem->prev->next = newitem; 702 | } 703 | void cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) { 704 | cJSON *c = array->child; while (c && which > 0) c = c->next, which--; if (!c) return; 705 | newitem->next = c->next; newitem->prev = c->prev; if (newitem->next) newitem->next->prev = newitem; 706 | if (c == array->child) array->child = newitem; else newitem->prev->next = newitem; c->next = c->prev = 0; cJSON_Delete(c); 707 | } 708 | void cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) { int i = 0; cJSON *c = object->child; while (c && cJSON_strcasecmp(c->string, string))i++, c = c->next; if (c) { newitem->string = cJSON_strdup(string); cJSON_ReplaceItemInArray(object, i, newitem); } } 709 | 710 | /* Create basic types: */ 711 | cJSON *cJSON_CreateNull(void) { cJSON *item = cJSON_New_Item(); if (item)item->type = cJSON_NULL; return item; } 712 | cJSON *cJSON_CreateTrue(void) { cJSON *item = cJSON_New_Item(); if (item)item->type = cJSON_True; return item; } 713 | cJSON *cJSON_CreateFalse(void) { cJSON *item = cJSON_New_Item(); if (item)item->type = cJSON_False; return item; } 714 | cJSON *cJSON_CreateBool(int b) { cJSON *item = cJSON_New_Item(); if (item)item->type = b ? cJSON_True : cJSON_False; return item; } 715 | cJSON *cJSON_CreateNumber(double num) { cJSON *item = cJSON_New_Item(); if (item) { item->type = cJSON_Number; item->valuedouble = num; item->valueint = (int)num; }return item; } 716 | cJSON *cJSON_CreateString(const char *string) { cJSON *item = cJSON_New_Item(); if (item) { item->type = cJSON_String; item->valuestring = cJSON_strdup(string); }return item; } 717 | cJSON *cJSON_CreateArray(void) { cJSON *item = cJSON_New_Item(); if (item)item->type = cJSON_Array; return item; } 718 | cJSON *cJSON_CreateObject(void) { cJSON *item = cJSON_New_Item(); if (item)item->type = cJSON_Object; return item; } 719 | 720 | /* Create Arrays: */ 721 | cJSON *cJSON_CreateIntArray(const int *numbers, int count) { int i; cJSON *n = 0, *p = 0, *a = cJSON_CreateArray(); for (i = 0; a && i < count; i++) { n = cJSON_CreateNumber(numbers[i]); if (!i)a->child = n; else suffix_object(p, n); p = n; }return a; } 722 | cJSON *cJSON_CreateFloatArray(const float *numbers, int count) { int i; cJSON *n = 0, *p = 0, *a = cJSON_CreateArray(); for (i = 0; a && i < count; i++) { n = cJSON_CreateNumber(numbers[i]); if (!i)a->child = n; else suffix_object(p, n); p = n; }return a; } 723 | cJSON *cJSON_CreateDoubleArray(const double *numbers, int count) { int i; cJSON *n = 0, *p = 0, *a = cJSON_CreateArray(); for (i = 0; a && i < count; i++) { n = cJSON_CreateNumber(numbers[i]); if (!i)a->child = n; else suffix_object(p, n); p = n; }return a; } 724 | cJSON *cJSON_CreateStringArray(const char **strings, int count) { int i; cJSON *n = 0, *p = 0, *a = cJSON_CreateArray(); for (i = 0; a && i < count; i++) { n = cJSON_CreateString(strings[i]); if (!i)a->child = n; else suffix_object(p, n); p = n; }return a; } 725 | 726 | /* Duplication */ 727 | cJSON *cJSON_Duplicate(cJSON *item, int recurse) 728 | { 729 | cJSON *newitem, *cptr, *nptr = 0, *newchild; 730 | /* Bail on bad ptr */ 731 | if (!item) return 0; 732 | /* Create new item */ 733 | newitem = cJSON_New_Item(); 734 | if (!newitem) return 0; 735 | /* Copy over all vars */ 736 | newitem->type = item->type&(~cJSON_IsReference), newitem->valueint = item->valueint, newitem->valuedouble = item->valuedouble; 737 | if (item->valuestring) { newitem->valuestring = cJSON_strdup(item->valuestring); if (!newitem->valuestring) { cJSON_Delete(newitem); return 0; } } 738 | if (item->string) { newitem->string = cJSON_strdup(item->string); if (!newitem->string) { cJSON_Delete(newitem); return 0; } } 739 | /* If non-recursive, then we're done! */ 740 | if (!recurse) return newitem; 741 | /* Walk the ->next chain for the child. */ 742 | cptr = item->child; 743 | while (cptr) 744 | { 745 | newchild = cJSON_Duplicate(cptr, 1); /* Duplicate (with recurse) each item in the ->next chain */ 746 | if (!newchild) { cJSON_Delete(newitem); return 0; } 747 | if (nptr) { nptr->next = newchild, newchild->prev = nptr; nptr = newchild; } /* If newitem->child already set, then crosswire ->prev and ->next and move on */ 748 | else { newitem->child = newchild; nptr = newchild; } /* Set newitem->child and move to it */ 749 | cptr = cptr->next; 750 | } 751 | return newitem; 752 | } 753 | 754 | void cJSON_Minify(char *json) 755 | { 756 | char *into = json; 757 | while (*json) 758 | { 759 | if (*json == ' ') json++; 760 | else if (*json == '\t') json++; /* Whitespace characters. */ 761 | else if (*json == '\r') json++; 762 | else if (*json == '\n') json++; 763 | else if (*json == '/' && json[1] == '/') while (*json && *json != '\n') json++; /* double-slash comments, to end of line. */ 764 | else if (*json == '/' && json[1] == '*') { while (*json && !(*json == '*' && json[1] == '/')) json++; json += 2; } /* multiline comments. */ 765 | else if (*json == '\"') { *into++ = *json++; while (*json && *json != '\"') { if (*json == '\\') *into++ = *json++; *into++ = *json++; }*into++ = *json++; } /* string literals, which are \" sensitive. */ 766 | else *into++ = *json++; /* All other characters. */ 767 | } 768 | *into = 0; /* and null-terminate. */ 769 | } 770 | -------------------------------------------------------------------------------- /LibStruct2Json/cJSON.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Dave Gamble 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef cJSON__h 24 | #define cJSON__h 25 | 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" 30 | { 31 | #endif 32 | 33 | /* cJSON Types: */ 34 | #define cJSON_False 0 35 | #define cJSON_True 1 36 | #define cJSON_NULL 2 37 | #define cJSON_Number 3 38 | #define cJSON_String 4 39 | #define cJSON_Array 5 40 | #define cJSON_Object 6 41 | 42 | #define cJSON_IsReference 256 43 | #define cJSON_StringIsConst 512 44 | 45 | /* The cJSON structure: */ 46 | typedef struct cJSON { 47 | struct cJSON *next, *prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ 48 | struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ 49 | 50 | int type; /* The type of the item, as above. */ 51 | 52 | char *valuestring; /* The item's string, if type==cJSON_String */ 53 | int valueint; /* The item's number, if type==cJSON_Number */ 54 | double valuedouble; /* The item's number, if type==cJSON_Number */ 55 | 56 | char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ 57 | } cJSON; 58 | 59 | typedef struct cJSON_Hooks { 60 | void *(*malloc_fn)(size_t sz); 61 | void(*free_fn)(void *ptr); 62 | } cJSON_Hooks; 63 | 64 | /* Supply malloc, realloc and free functions to cJSON */ 65 | extern void cJSON_InitHooks(cJSON_Hooks* hooks); 66 | 67 | 68 | /* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */ 69 | extern cJSON *cJSON_Parse(const char *value); 70 | /* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */ 71 | extern char *cJSON_Print(cJSON *item); 72 | /* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */ 73 | extern char *cJSON_PrintUnformatted(cJSON *item); 74 | /* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ 75 | extern char *cJSON_PrintBuffered(cJSON *item, int prebuffer, int fmt); 76 | /* Delete a cJSON entity and all subentities. */ 77 | extern void cJSON_Delete(cJSON *c); 78 | 79 | /* Returns the number of items in an array (or object). */ 80 | extern int cJSON_GetArraySize(cJSON *array); 81 | /* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */ 82 | extern cJSON *cJSON_GetArrayItem(cJSON *array, int item); 83 | /* Get item "string" from object. Case insensitive. */ 84 | extern cJSON *cJSON_GetObjectItem(cJSON *object, const char *string); 85 | extern int cJSON_HasObjectItem(cJSON *object, const char *string); 86 | /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ 87 | extern const char *cJSON_GetErrorPtr(void); 88 | 89 | /* These calls create a cJSON item of the appropriate type. */ 90 | extern cJSON *cJSON_CreateNull(void); 91 | extern cJSON *cJSON_CreateTrue(void); 92 | extern cJSON *cJSON_CreateFalse(void); 93 | extern cJSON *cJSON_CreateBool(int b); 94 | extern cJSON *cJSON_CreateNumber(double num); 95 | extern cJSON *cJSON_CreateString(const char *string); 96 | extern cJSON *cJSON_CreateArray(void); 97 | extern cJSON *cJSON_CreateObject(void); 98 | 99 | /* These utilities create an Array of count items. */ 100 | extern cJSON *cJSON_CreateIntArray(const int *numbers, int count); 101 | extern cJSON *cJSON_CreateFloatArray(const float *numbers, int count); 102 | extern cJSON *cJSON_CreateDoubleArray(const double *numbers, int count); 103 | extern cJSON *cJSON_CreateStringArray(const char **strings, int count); 104 | 105 | /* Append item to the specified array/object. */ 106 | extern void cJSON_AddItemToArray(cJSON *array, cJSON *item); 107 | extern void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item); 108 | extern void cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item); /* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object */ 109 | /* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ 110 | extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); 111 | extern void cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); 112 | 113 | /* Remove/Detatch items from Arrays/Objects. */ 114 | extern cJSON *cJSON_DetachItemFromArray(cJSON *array, int which); 115 | extern void cJSON_DeleteItemFromArray(cJSON *array, int which); 116 | extern cJSON *cJSON_DetachItemFromObject(cJSON *object, const char *string); 117 | extern void cJSON_DeleteItemFromObject(cJSON *object, const char *string); 118 | 119 | /* Update array items. */ 120 | extern void cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */ 121 | extern void cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); 122 | extern void cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem); 123 | 124 | /* Duplicate a cJSON item */ 125 | extern cJSON *cJSON_Duplicate(cJSON *item, int recurse); 126 | /* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will 127 | need to be released. With recurse!=0, it will duplicate any children connected to the item. 128 | The item->next and ->prev pointers are always zero on return from Duplicate. */ 129 | 130 | /* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ 131 | extern cJSON *cJSON_ParseWithOpts(const char *value, const char **return_parse_end, int require_null_terminated); 132 | 133 | extern void cJSON_Minify(char *json); 134 | 135 | /* Macros for creating things quickly. */ 136 | #define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull()) 137 | #define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue()) 138 | #define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse()) 139 | #define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b)) 140 | #define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n)) 141 | #define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s)) 142 | 143 | /* When assigning an integer value, it needs to be propagated to valuedouble too. */ 144 | #define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) 145 | #define cJSON_SetNumberValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) 146 | 147 | /* Macro for iterating over an array */ 148 | #define cJSON_ArrayForEach(pos, head) for(pos = (head)->child; pos != NULL; pos = pos->next) 149 | 150 | #ifdef __cplusplus 151 | } 152 | #endif 153 | 154 | #endif 155 | -------------------------------------------------------------------------------- /LibStruct2Json/s2j.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the struct2json Library. 3 | * 4 | * Copyright (c) 2015, Armink, 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * 'Software'), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | * 25 | * Function: Initialize interface for this library. 26 | * Created on: 2015-10-14 27 | */ 28 | 29 | #include "s2j.h" 30 | #include 31 | 32 | S2jHook s2jHook = { 33 | .malloc_fn = malloc, 34 | .free_fn = free, 35 | }; 36 | 37 | /** 38 | * struct2json library initialize 39 | * @note It will initialize cJSON library hooks. 40 | */ 41 | void s2j_init(S2jHook *hook) { 42 | /* initialize cJSON library */ 43 | cJSON_InitHooks((cJSON_Hooks *)hook); 44 | /* initialize hooks */ 45 | if (hook) { 46 | s2jHook.malloc_fn = (hook->malloc_fn) ? hook->malloc_fn : malloc; 47 | s2jHook.free_fn = (hook->free_fn) ? hook->free_fn : free; 48 | } 49 | else { 50 | s2jHook.malloc_fn = malloc; 51 | s2jHook.free_fn = free; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /LibStruct2Json/s2j.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the struct2json Library. 3 | * 4 | * Copyright (c) 2015, Armink, 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * 'Software'), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | * 25 | * Function: It is an head file for this library. You can see all be called functions. 26 | * Created on: 2015-10-14 27 | */ 28 | 29 | #ifndef __S2J_H__ 30 | #define __S2J_H__ 31 | 32 | #include "cJSON.h" 33 | #include 34 | #include "s2jdef.h" 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /* struct2json software version number */ 41 | #define S2J_SW_VERSION "1.0.3" 42 | 43 | /* Create JSON object */ 44 | #define s2j_create_json_obj(json_obj) \ 45 | S2J_CREATE_JSON_OBJECT(json_obj) 46 | 47 | /* Delete JSON object */ 48 | #define s2j_delete_json_obj(json_obj) \ 49 | S2J_DELETE_JSON_OBJECT(json_obj) 50 | 51 | /* Set basic type element for JSON object */ 52 | #define s2j_json_set_basic_element(to_json, from_struct, type, element) \ 53 | S2J_JSON_SET_BASIC_ELEMENT(to_json, from_struct, type, element) 54 | 55 | /* Set array type element for JSON object */ 56 | #define s2j_json_set_array_element(to_json, from_struct, type, element, size) \ 57 | S2J_JSON_SET_ARRAY_ELEMENT(to_json, from_struct, type, element, size) 58 | 59 | /* Set child structure type element for JSON object */ 60 | #define s2j_json_set_struct_element(child_json, to_json, child_struct, from_struct, type, element) \ 61 | S2J_JSON_SET_STRUCT_ELEMENT(child_json, to_json, child_struct, from_struct, type, element) 62 | 63 | /* Create structure object */ 64 | #define s2j_create_struct_obj(struct_obj, type) \ 65 | S2J_CREATE_STRUCT_OBJECT(struct_obj, type) 66 | 67 | /* Delete structure object */ 68 | #define s2j_delete_struct_obj(struct_obj) \ 69 | S2J_DELETE_STRUCT_OBJECT(struct_obj) 70 | 71 | /* Get basic type element for structure object */ 72 | #define s2j_struct_get_basic_element(to_struct, from_json, type, element) \ 73 | S2J_STRUCT_GET_BASIC_ELEMENT(to_struct, from_json, type, element) 74 | 75 | /* Get array type element for structure object */ 76 | #define s2j_struct_get_array_element(to_struct, from_json, type, element) \ 77 | S2J_STRUCT_GET_ARRAY_ELEMENT(to_struct, from_json, type, element) 78 | 79 | /* Get child structure type element for structure object */ 80 | #define s2j_struct_get_struct_element(child_struct, to_struct, child_json, from_json, type, element) \ 81 | S2J_STRUCT_GET_STRUCT_ELEMENT(child_struct, to_struct, child_json, from_json, type, element) 82 | 83 | /* s2j.c */ 84 | extern S2jHook s2jHook; 85 | void s2j_init(S2jHook *hook); 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif /* __S2J_H__ */ 92 | -------------------------------------------------------------------------------- /LibStruct2Json/s2jdef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the struct2json Library. 3 | * 4 | * Copyright (c) 2015, Armink, 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * 'Software'), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | * 25 | * Function: It is an head file for this library. 26 | * Created on: 2015-10-14 27 | */ 28 | 29 | #ifndef __S2JDEF_H__ 30 | #define __S2JDEF_H__ 31 | 32 | #include "cJSON.h" 33 | #include 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | typedef struct { 40 | void *(*malloc_fn)(size_t sz); 41 | void (*free_fn)(void *ptr); 42 | } S2jHook, *S2jHook_t; 43 | 44 | #define S2J_STRUCT_GET_int_ELEMENT(to_struct, from_json, _element) \ 45 | json_temp = cJSON_GetObjectItem(from_json, #_element); \ 46 | if (json_temp) (to_struct)->_element = json_temp->valueint; 47 | 48 | #define S2J_STRUCT_GET_string_ELEMENT(to_struct, from_json, _element) \ 49 | json_temp = cJSON_GetObjectItem(from_json, #_element); \ 50 | if (json_temp) strcpy((to_struct)->_element, json_temp->valuestring); 51 | 52 | #define S2J_STRUCT_GET_double_ELEMENT(to_struct, from_json, _element) \ 53 | json_temp = cJSON_GetObjectItem(from_json, #_element); \ 54 | if (json_temp) (to_struct)->_element = json_temp->valuedouble; 55 | 56 | #define S2J_STRUCT_ARRAY_GET_int_ELEMENT(to_struct, from_json, _element, index) \ 57 | (to_struct)->_element[index] = from_json->valueint; 58 | 59 | #define S2J_STRUCT_ARRAY_GET_string_ELEMENT(to_struct, from_json, _element, index) \ 60 | strcpy((to_struct)->_element[index], from_json->valuestring); 61 | 62 | #define S2J_STRUCT_ARRAY_GET_double_ELEMENT(to_struct, from_json, _element, index) \ 63 | (to_struct)->_element[index] = from_json->valuedouble; 64 | 65 | #define S2J_STRUCT_ARRAY_GET_ELEMENT(to_struct, from_json, type, _element, index) \ 66 | S2J_STRUCT_ARRAY_GET_##type##_ELEMENT(to_struct, from_json, _element, index) 67 | 68 | #define S2J_JSON_SET_int_ELEMENT(to_json, from_struct, _element) \ 69 | cJSON_AddNumberToObject(to_json, #_element, (from_struct)->_element); 70 | 71 | #define S2J_JSON_SET_double_ELEMENT(to_json, from_struct, _element) \ 72 | cJSON_AddNumberToObject(to_json, #_element, (from_struct)->_element); 73 | 74 | #define S2J_JSON_SET_string_ELEMENT(to_json, from_struct, _element) \ 75 | cJSON_AddStringToObject(to_json, #_element, (from_struct)->_element); 76 | 77 | #define S2J_JSON_ARRAY_SET_int_ELEMENT(to_json, from_struct, _element, index) \ 78 | cJSON_AddItemToArray(to_json, cJSON_CreateNumber((from_struct)->_element[index])); 79 | 80 | #define S2J_JSON_ARRAY_SET_double_ELEMENT(to_json, from_struct, _element, index) \ 81 | cJSON_AddItemToArray(to_json, cJSON_CreateNumber((from_struct)->_element[index])); 82 | 83 | #define S2J_JSON_ARRAY_SET_string_ELEMENT(to_json, from_struct, _element, index) \ 84 | cJSON_AddItemToArray(to_json, cJSON_CreateString((from_struct)->_element[index])); 85 | 86 | #define S2J_JSON_ARRAY_SET_ELEMENT(to_json, from_struct, type, _element, index) \ 87 | S2J_JSON_ARRAY_SET_##type##_ELEMENT(to_json, from_struct, _element, index) 88 | 89 | 90 | #define S2J_CREATE_JSON_OBJECT(json_obj) \ 91 | cJSON *json_obj = cJSON_CreateObject(); 92 | 93 | #define S2J_DELETE_JSON_OBJECT(json_obj) \ 94 | cJSON_Delete(json_obj); 95 | 96 | #define S2J_JSON_SET_BASIC_ELEMENT(to_json, from_struct, type, _element) \ 97 | S2J_JSON_SET_##type##_ELEMENT(to_json, from_struct, _element) 98 | 99 | #define S2J_JSON_SET_ARRAY_ELEMENT(to_json, from_struct, type, _element, size) \ 100 | { \ 101 | cJSON *array; \ 102 | size_t index = 0; \ 103 | array = cJSON_CreateArray(); \ 104 | if (array) { \ 105 | while (index < size) { \ 106 | S2J_JSON_ARRAY_SET_ELEMENT(array, from_struct, type, _element, index++); \ 107 | } \ 108 | cJSON_AddItemToObject(to_json, #_element, array); \ 109 | } \ 110 | } 111 | 112 | #define S2J_JSON_SET_STRUCT_ELEMENT(child_json, to_json, child_struct, from_struct, type, _element) \ 113 | type *child_struct = &((from_struct)->_element); \ 114 | cJSON *child_json = cJSON_CreateObject(); \ 115 | if (child_json) cJSON_AddItemToObject(to_json, #_element, child_json); 116 | 117 | #define S2J_CREATE_STRUCT_OBJECT(struct_obj, type) \ 118 | cJSON *json_temp; \ 119 | type *struct_obj = s2jHook.malloc_fn(sizeof(type)); \ 120 | if (struct_obj) memset(struct_obj, 0, sizeof(type)); 121 | 122 | #define S2J_DELETE_STRUCT_OBJECT(struct_obj) \ 123 | s2jHook.free_fn(struct_obj); 124 | 125 | #define S2J_STRUCT_GET_BASIC_ELEMENT(to_struct, from_json, type, _element) \ 126 | S2J_STRUCT_GET_##type##_ELEMENT(to_struct, from_json, _element) 127 | 128 | #define S2J_STRUCT_GET_ARRAY_ELEMENT(to_struct, from_json, type, _element) \ 129 | { \ 130 | cJSON *array, *array_element; \ 131 | size_t index = 0, size = 0; \ 132 | array = cJSON_GetObjectItem(from_json, #_element); \ 133 | if (array) { \ 134 | size = cJSON_GetArraySize(array); \ 135 | while (index < size) { \ 136 | array_element = cJSON_GetArrayItem(array, index); \ 137 | if (array_element) S2J_STRUCT_ARRAY_GET_ELEMENT(to_struct, array_element, type, _element, index++); \ 138 | } \ 139 | } \ 140 | } 141 | 142 | #define S2J_STRUCT_GET_STRUCT_ELEMENT(child_struct, to_struct, child_json, from_json, type, _element) \ 143 | type *child_struct = &((to_struct)->_element); \ 144 | cJSON *child_json = cJSON_GetObjectItem(from_json, #_element); 145 | 146 | #ifdef __cplusplus 147 | } 148 | #endif 149 | 150 | #endif /* __S2JDEF_H__ */ 151 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 删除项目 2 | 3 | 由于各种原因,删除项目 4 | 5 | 6 | 7 | ## WeChatHooker 8 | 9 | 10 | - [x] 自动检测登录 11 | - [x] 二维码生成捕获 12 | - [x] 用户信息memory读取 13 | - [x] 发送个人消息 14 | - [x] 发送微信文件助手 15 | - [x] 发送群聊消息 16 | - [x] 发送群聊消息 带@人 17 | - [x] 接受消息和解析消息 18 | - [x] 获取好友列表 19 | - [x] 获取指定群成员列表 20 | - [ ] 自动收款 21 | 22 | ## 依赖 23 | 24 | cJson 25 | 26 | 27 | websocketpp 28 | 29 | 30 | websocket.io.cpp 31 | 32 | 33 | ## 服务 34 | 35 | 可以定制微信PC端大部分需求服务,其中包括机器人,收款等。可以定制支付平台,转账模式等,支付宝微信都可以。联系邮箱:zhaojunlike@qq.com 36 | 37 | 38 | ## 功能 39 | 40 | 目前项目功能是注入一个DLL,拦截一些hook和读取内存,dll注入后会注册一个socket client,所以只需要提供socket-server后,你便可以随心所欲控制客户端做任何事情了。DLL 不提供源码,提供typescript写的服务端,提供api文档 41 | -------------------------------------------------------------------------------- /WechatHookDemo1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.168 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GetWxInfo", "GetWxInfo\GetWxInfo.vcxproj", "{7F539BB5-3E2D-4901-B84F-0317D0D4F87B}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GodtoyWeChatHookHelper", "GodtoyWeChatHookHelper\GodtoyWeChatHookHelper.vcxproj", "{F93599CD-B2B7-4990-9AEE-3458E465F35F}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TeachDemo", "TeachDemo\TeachDemo.vcxproj", "{D4891C0E-B611-431C-8C5B-A04C422F8EB4}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InjectByCSharp", "InjectByCSharp\InjectByCSharp.csproj", "{AD623187-CC70-4C52-906A-84E83C90AB61}" 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RecvMessage", "RecvMessage\RecvMessage.vcxproj", "{45CA6BED-2065-4769-A2DC-2647E81148F6}" 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookQrCode", "HookQrCode\HookQrCode.vcxproj", "{BBABAE89-2243-468A-8CA2-677ACF1D2C83}" 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sioclient", "D:\workspace\cpp-libs\demo3\sioclient.vcxproj", "{F5A40D55-728F-3109-8F42-07632887A18E}" 19 | EndProject 20 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibStruct2Json", "LibStruct2Json\LibStruct2Json.vcxproj", "{80572112-5FB2-476C-B453-01D86726F49B}" 21 | EndProject 22 | Global 23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 24 | Debug|Any CPU = Debug|Any CPU 25 | Debug|x64 = Debug|x64 26 | Debug|x86 = Debug|x86 27 | MinSizeRel|Any CPU = MinSizeRel|Any CPU 28 | MinSizeRel|x64 = MinSizeRel|x64 29 | MinSizeRel|x86 = MinSizeRel|x86 30 | Release|Any CPU = Release|Any CPU 31 | Release|x64 = Release|x64 32 | Release|x86 = Release|x86 33 | RelWithDebInfo|Any CPU = RelWithDebInfo|Any CPU 34 | RelWithDebInfo|x64 = RelWithDebInfo|x64 35 | RelWithDebInfo|x86 = RelWithDebInfo|x86 36 | EndGlobalSection 37 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 38 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.Debug|Any CPU.ActiveCfg = Debug|Win32 39 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.Debug|x64.ActiveCfg = Debug|x64 40 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.Debug|x64.Build.0 = Debug|x64 41 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.Debug|x86.ActiveCfg = Debug|Win32 42 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.Debug|x86.Build.0 = Debug|Win32 43 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.MinSizeRel|Any CPU.ActiveCfg = Release|x64 44 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.MinSizeRel|Any CPU.Build.0 = Release|x64 45 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.MinSizeRel|x64.ActiveCfg = Release|x64 46 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.MinSizeRel|x64.Build.0 = Release|x64 47 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.MinSizeRel|x86.ActiveCfg = Release|Win32 48 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.MinSizeRel|x86.Build.0 = Release|Win32 49 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.Release|Any CPU.ActiveCfg = Release|Win32 50 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.Release|x64.ActiveCfg = Release|x64 51 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.Release|x64.Build.0 = Release|x64 52 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.Release|x86.ActiveCfg = Release|Win32 53 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.Release|x86.Build.0 = Release|Win32 54 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.RelWithDebInfo|Any CPU.ActiveCfg = Release|x64 55 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.RelWithDebInfo|Any CPU.Build.0 = Release|x64 56 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.RelWithDebInfo|x64.ActiveCfg = Release|x64 57 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.RelWithDebInfo|x64.Build.0 = Release|x64 58 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 59 | {7F539BB5-3E2D-4901-B84F-0317D0D4F87B}.RelWithDebInfo|x86.Build.0 = Release|Win32 60 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.Debug|Any CPU.ActiveCfg = Debug|Win32 61 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.Debug|x64.ActiveCfg = Debug|x64 62 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.Debug|x64.Build.0 = Debug|x64 63 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.Debug|x86.ActiveCfg = Debug|Win32 64 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.Debug|x86.Build.0 = Debug|Win32 65 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.MinSizeRel|Any CPU.ActiveCfg = Release|x64 66 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.MinSizeRel|Any CPU.Build.0 = Release|x64 67 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.MinSizeRel|x64.ActiveCfg = Release|x64 68 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.MinSizeRel|x64.Build.0 = Release|x64 69 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.MinSizeRel|x86.ActiveCfg = Release|Win32 70 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.MinSizeRel|x86.Build.0 = Release|Win32 71 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.Release|Any CPU.ActiveCfg = Release|Win32 72 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.Release|x64.ActiveCfg = Release|x64 73 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.Release|x64.Build.0 = Release|x64 74 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.Release|x86.ActiveCfg = Release|Win32 75 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.Release|x86.Build.0 = Release|Win32 76 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.RelWithDebInfo|Any CPU.ActiveCfg = Release|x64 77 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.RelWithDebInfo|Any CPU.Build.0 = Release|x64 78 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.RelWithDebInfo|x64.ActiveCfg = Release|x64 79 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.RelWithDebInfo|x64.Build.0 = Release|x64 80 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 81 | {F93599CD-B2B7-4990-9AEE-3458E465F35F}.RelWithDebInfo|x86.Build.0 = Release|Win32 82 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.Debug|Any CPU.ActiveCfg = Debug|Win32 83 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.Debug|x64.ActiveCfg = Debug|x64 84 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.Debug|x64.Build.0 = Debug|x64 85 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.Debug|x86.ActiveCfg = Debug|Win32 86 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.Debug|x86.Build.0 = Debug|Win32 87 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.MinSizeRel|Any CPU.ActiveCfg = Release|x64 88 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.MinSizeRel|Any CPU.Build.0 = Release|x64 89 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.MinSizeRel|x64.ActiveCfg = Release|x64 90 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.MinSizeRel|x64.Build.0 = Release|x64 91 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.MinSizeRel|x86.ActiveCfg = Release|Win32 92 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.MinSizeRel|x86.Build.0 = Release|Win32 93 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.Release|Any CPU.ActiveCfg = Release|Win32 94 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.Release|x64.ActiveCfg = Release|x64 95 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.Release|x64.Build.0 = Release|x64 96 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.Release|x86.ActiveCfg = Release|Win32 97 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.Release|x86.Build.0 = Release|Win32 98 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.RelWithDebInfo|Any CPU.ActiveCfg = Release|x64 99 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.RelWithDebInfo|Any CPU.Build.0 = Release|x64 100 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.RelWithDebInfo|x64.ActiveCfg = Release|x64 101 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.RelWithDebInfo|x64.Build.0 = Release|x64 102 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 103 | {D4891C0E-B611-431C-8C5B-A04C422F8EB4}.RelWithDebInfo|x86.Build.0 = Release|Win32 104 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 105 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Debug|Any CPU.Build.0 = Debug|Any CPU 106 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Debug|x64.ActiveCfg = Debug|Any CPU 107 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Debug|x64.Build.0 = Debug|Any CPU 108 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Debug|x86.ActiveCfg = Debug|Any CPU 109 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Debug|x86.Build.0 = Debug|Any CPU 110 | {AD623187-CC70-4C52-906A-84E83C90AB61}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU 111 | {AD623187-CC70-4C52-906A-84E83C90AB61}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU 112 | {AD623187-CC70-4C52-906A-84E83C90AB61}.MinSizeRel|x64.ActiveCfg = Release|Any CPU 113 | {AD623187-CC70-4C52-906A-84E83C90AB61}.MinSizeRel|x64.Build.0 = Release|Any CPU 114 | {AD623187-CC70-4C52-906A-84E83C90AB61}.MinSizeRel|x86.ActiveCfg = Release|Any CPU 115 | {AD623187-CC70-4C52-906A-84E83C90AB61}.MinSizeRel|x86.Build.0 = Release|Any CPU 116 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Release|Any CPU.ActiveCfg = Release|Any CPU 117 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Release|Any CPU.Build.0 = Release|Any CPU 118 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Release|x64.ActiveCfg = Release|Any CPU 119 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Release|x64.Build.0 = Release|Any CPU 120 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Release|x86.ActiveCfg = Release|Any CPU 121 | {AD623187-CC70-4C52-906A-84E83C90AB61}.Release|x86.Build.0 = Release|Any CPU 122 | {AD623187-CC70-4C52-906A-84E83C90AB61}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU 123 | {AD623187-CC70-4C52-906A-84E83C90AB61}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU 124 | {AD623187-CC70-4C52-906A-84E83C90AB61}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU 125 | {AD623187-CC70-4C52-906A-84E83C90AB61}.RelWithDebInfo|x64.Build.0 = Release|Any CPU 126 | {AD623187-CC70-4C52-906A-84E83C90AB61}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU 127 | {AD623187-CC70-4C52-906A-84E83C90AB61}.RelWithDebInfo|x86.Build.0 = Release|Any CPU 128 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.Debug|Any CPU.ActiveCfg = Debug|Win32 129 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.Debug|x64.ActiveCfg = Debug|x64 130 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.Debug|x64.Build.0 = Debug|x64 131 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.Debug|x86.ActiveCfg = Debug|Win32 132 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.Debug|x86.Build.0 = Debug|Win32 133 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.MinSizeRel|Any CPU.ActiveCfg = Release|x64 134 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.MinSizeRel|Any CPU.Build.0 = Release|x64 135 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.MinSizeRel|x64.ActiveCfg = Release|x64 136 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.MinSizeRel|x64.Build.0 = Release|x64 137 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.MinSizeRel|x86.ActiveCfg = Release|Win32 138 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.MinSizeRel|x86.Build.0 = Release|Win32 139 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.Release|Any CPU.ActiveCfg = Release|Win32 140 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.Release|x64.ActiveCfg = Release|x64 141 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.Release|x64.Build.0 = Release|x64 142 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.Release|x86.ActiveCfg = Release|Win32 143 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.Release|x86.Build.0 = Release|Win32 144 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.RelWithDebInfo|Any CPU.ActiveCfg = Release|x64 145 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.RelWithDebInfo|Any CPU.Build.0 = Release|x64 146 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.RelWithDebInfo|x64.ActiveCfg = Release|x64 147 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.RelWithDebInfo|x64.Build.0 = Release|x64 148 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 149 | {45CA6BED-2065-4769-A2DC-2647E81148F6}.RelWithDebInfo|x86.Build.0 = Release|Win32 150 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.Debug|Any CPU.ActiveCfg = Debug|Win32 151 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.Debug|x64.ActiveCfg = Debug|x64 152 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.Debug|x64.Build.0 = Debug|x64 153 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.Debug|x86.ActiveCfg = Debug|Win32 154 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.Debug|x86.Build.0 = Debug|Win32 155 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.MinSizeRel|Any CPU.ActiveCfg = Release|x64 156 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.MinSizeRel|Any CPU.Build.0 = Release|x64 157 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.MinSizeRel|x64.ActiveCfg = Release|x64 158 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.MinSizeRel|x64.Build.0 = Release|x64 159 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.MinSizeRel|x86.ActiveCfg = Release|Win32 160 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.MinSizeRel|x86.Build.0 = Release|Win32 161 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.Release|Any CPU.ActiveCfg = Release|Win32 162 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.Release|x64.ActiveCfg = Release|x64 163 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.Release|x64.Build.0 = Release|x64 164 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.Release|x86.ActiveCfg = Release|Win32 165 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.Release|x86.Build.0 = Release|Win32 166 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.RelWithDebInfo|Any CPU.ActiveCfg = Release|x64 167 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.RelWithDebInfo|Any CPU.Build.0 = Release|x64 168 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.RelWithDebInfo|x64.ActiveCfg = Release|x64 169 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.RelWithDebInfo|x64.Build.0 = Release|x64 170 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 171 | {BBABAE89-2243-468A-8CA2-677ACF1D2C83}.RelWithDebInfo|x86.Build.0 = Release|Win32 172 | {F5A40D55-728F-3109-8F42-07632887A18E}.Debug|Any CPU.ActiveCfg = Debug|Win32 173 | {F5A40D55-728F-3109-8F42-07632887A18E}.Debug|x64.ActiveCfg = Debug|Win32 174 | {F5A40D55-728F-3109-8F42-07632887A18E}.Debug|x86.ActiveCfg = Debug|Win32 175 | {F5A40D55-728F-3109-8F42-07632887A18E}.Debug|x86.Build.0 = Debug|Win32 176 | {F5A40D55-728F-3109-8F42-07632887A18E}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Win32 177 | {F5A40D55-728F-3109-8F42-07632887A18E}.MinSizeRel|x64.ActiveCfg = MinSizeRel|Win32 178 | {F5A40D55-728F-3109-8F42-07632887A18E}.MinSizeRel|x86.ActiveCfg = MinSizeRel|Win32 179 | {F5A40D55-728F-3109-8F42-07632887A18E}.MinSizeRel|x86.Build.0 = MinSizeRel|Win32 180 | {F5A40D55-728F-3109-8F42-07632887A18E}.Release|Any CPU.ActiveCfg = Release|Win32 181 | {F5A40D55-728F-3109-8F42-07632887A18E}.Release|x64.ActiveCfg = Release|Win32 182 | {F5A40D55-728F-3109-8F42-07632887A18E}.Release|x86.ActiveCfg = Release|Win32 183 | {F5A40D55-728F-3109-8F42-07632887A18E}.Release|x86.Build.0 = Release|Win32 184 | {F5A40D55-728F-3109-8F42-07632887A18E}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Win32 185 | {F5A40D55-728F-3109-8F42-07632887A18E}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|Win32 186 | {F5A40D55-728F-3109-8F42-07632887A18E}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Win32 187 | {F5A40D55-728F-3109-8F42-07632887A18E}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Win32 188 | {80572112-5FB2-476C-B453-01D86726F49B}.Debug|Any CPU.ActiveCfg = Debug|Win32 189 | {80572112-5FB2-476C-B453-01D86726F49B}.Debug|x64.ActiveCfg = Debug|x64 190 | {80572112-5FB2-476C-B453-01D86726F49B}.Debug|x64.Build.0 = Debug|x64 191 | {80572112-5FB2-476C-B453-01D86726F49B}.Debug|x86.ActiveCfg = Debug|Win32 192 | {80572112-5FB2-476C-B453-01D86726F49B}.Debug|x86.Build.0 = Debug|Win32 193 | {80572112-5FB2-476C-B453-01D86726F49B}.MinSizeRel|Any CPU.ActiveCfg = Release|x64 194 | {80572112-5FB2-476C-B453-01D86726F49B}.MinSizeRel|Any CPU.Build.0 = Release|x64 195 | {80572112-5FB2-476C-B453-01D86726F49B}.MinSizeRel|x64.ActiveCfg = Release|x64 196 | {80572112-5FB2-476C-B453-01D86726F49B}.MinSizeRel|x64.Build.0 = Release|x64 197 | {80572112-5FB2-476C-B453-01D86726F49B}.MinSizeRel|x86.ActiveCfg = Release|Win32 198 | {80572112-5FB2-476C-B453-01D86726F49B}.MinSizeRel|x86.Build.0 = Release|Win32 199 | {80572112-5FB2-476C-B453-01D86726F49B}.Release|Any CPU.ActiveCfg = Release|Win32 200 | {80572112-5FB2-476C-B453-01D86726F49B}.Release|x64.ActiveCfg = Release|x64 201 | {80572112-5FB2-476C-B453-01D86726F49B}.Release|x64.Build.0 = Release|x64 202 | {80572112-5FB2-476C-B453-01D86726F49B}.Release|x86.ActiveCfg = Release|Win32 203 | {80572112-5FB2-476C-B453-01D86726F49B}.Release|x86.Build.0 = Release|Win32 204 | {80572112-5FB2-476C-B453-01D86726F49B}.RelWithDebInfo|Any CPU.ActiveCfg = Release|x64 205 | {80572112-5FB2-476C-B453-01D86726F49B}.RelWithDebInfo|Any CPU.Build.0 = Release|x64 206 | {80572112-5FB2-476C-B453-01D86726F49B}.RelWithDebInfo|x64.ActiveCfg = Release|x64 207 | {80572112-5FB2-476C-B453-01D86726F49B}.RelWithDebInfo|x64.Build.0 = Release|x64 208 | {80572112-5FB2-476C-B453-01D86726F49B}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 209 | {80572112-5FB2-476C-B453-01D86726F49B}.RelWithDebInfo|x86.Build.0 = Release|Win32 210 | EndGlobalSection 211 | GlobalSection(SolutionProperties) = preSolution 212 | HideSolutionNode = FALSE 213 | EndGlobalSection 214 | GlobalSection(ExtensibilityGlobals) = postSolution 215 | SolutionGuid = {6CBC6996-A646-4288-A810-A484F085E3DC} 216 | EndGlobalSection 217 | EndGlobal 218 | --------------------------------------------------------------------------------