OLD | NEW |
---|---|
1 /* Handle Native Client manifest files. | 1 /* Handle Native Client manifest files. |
2 | 2 |
3 Copyright (C) 2011 Free Software Foundation, Inc. | 3 Copyright (C) 2011 Free Software Foundation, Inc. |
4 | 4 |
5 This file is part of GDB. | 5 This file is part of GDB. |
6 | 6 |
7 This program is free software; you can redistribute it and/or modify | 7 This program is free software; you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 nacl_program_filename_32 = NULL; | 122 nacl_program_filename_32 = NULL; |
123 nacl_program_filename_64 = NULL; | 123 nacl_program_filename_64 = NULL; |
124 } | 124 } |
125 | 125 |
126 /* Very dumb parser for JSON subset used in Native Client manifest files. | 126 /* Very dumb parser for JSON subset used in Native Client manifest files. |
127 This is a SAX-style parser that runs callbacks on JSON events. */ | 127 This is a SAX-style parser that runs callbacks on JSON events. */ |
128 | 128 |
129 struct json_manifest_reader | 129 struct json_manifest_reader |
130 { | 130 { |
131 /* Manifest file. */ | 131 /* Manifest file. */ |
132 FILE* file; | 132 FILE *file; |
133 | 133 |
134 /* Stack of members being parsed. */ | 134 /* Stack of members being parsed. */ |
135 const char *members[MANIFEST_MAX_NESTING]; | 135 const char *members[MANIFEST_MAX_NESTING]; |
136 | 136 |
137 /* Members stack size. */ | 137 /* Members stack size. */ |
138 int nesting; | 138 int nesting; |
139 | 139 |
140 /* Manifest file directory without slash at the end. */ | 140 /* Manifest file directory without slash at the end. */ |
141 char* dirname; | 141 char* dirname; |
Mark Seaborn
2012/05/30 15:30:21
Try grepping the whole file for inconsistent style
halyavin
2012/05/30 15:41:11
Done.
| |
142 }; | 142 }; |
143 | 143 |
144 static void | 144 static void |
145 json_on_member (struct json_manifest_reader *r, const char *member) | 145 json_on_member (struct json_manifest_reader *r, const char *member) |
146 { | 146 { |
147 if (r->nesting == MANIFEST_MAX_NESTING) | 147 if (r->nesting == MANIFEST_MAX_NESTING) |
148 error (_("Invalid manifest file.")); | 148 error (_("Invalid manifest file.")); |
149 | 149 |
150 r->members[r->nesting] = member; | 150 r->members[r->nesting] = member; |
151 ++r->nesting; | 151 ++r->nesting; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
366 | 366 |
367 c = add_com ("nacl-irt", class_files, nacl_irt_command, | 367 c = add_com ("nacl-irt", class_files, nacl_irt_command, |
368 _("Use FILE as Native Client IRT to be debugged.")); | 368 _("Use FILE as Native Client IRT to be debugged.")); |
369 set_cmd_completer (c, filename_completer); | 369 set_cmd_completer (c, filename_completer); |
370 | 370 |
371 c = add_com ("nacl-manifest", class_files, nacl_manifest_command, | 371 c = add_com ("nacl-manifest", class_files, nacl_manifest_command, |
372 _("Use FILE as Native Client manifest for the program" | 372 _("Use FILE as Native Client manifest for the program" |
373 " to be debugged.")); | 373 " to be debugged.")); |
374 set_cmd_completer (c, filename_completer); | 374 set_cmd_completer (c, filename_completer); |
375 } | 375 } |
OLD | NEW |