lib: Fixup json code to use struct cmd_token

This commit is contained in:
Donald Sharp 2016-09-20 23:20:02 -04:00
parent f68cec764a
commit 8a2d6083d6
2 changed files with 4 additions and 3 deletions

View File

@ -21,6 +21,7 @@
#include <zebra.h>
#include "command.h"
#include "lib/json.h"
/*
@ -29,12 +30,12 @@
* what.
*/
int
use_json (const int argc, const char *argv[])
use_json (const int argc, const struct cmd_token *argv[])
{
if (argc == 0)
return 0;
if (argv[argc-1] && strcmp(argv[argc-1], "json") == 0)
if (argv[argc-1]->arg && strcmp(argv[argc-1]->arg, "json") == 0)
return 1;
return 0;

View File

@ -28,7 +28,7 @@
#include <json/json.h>
#endif
extern int use_json(const int argc, const char *argv[]);
extern int use_json(const int argc, const struct cmd_token *argv[]);
extern void json_object_string_add(struct json_object* obj, const char *key,
const char *s);
extern void json_object_int_add(struct json_object* obj, const char *key,