From: Klas Lindfors Date: Tue, 16 Apr 2013 13:23:04 +0000 (+0200) Subject: change json to ycfg X-Git-Tag: v1.13.0~24^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c50c5023890b10becf13bb499551fcade90b7214;p=yubikey-personalization change json to ycfg --- diff --git a/ykpers-args.c b/ykpers-args.c index 98e7db1..7ed0a49 100644 --- a/ykpers-args.c +++ b/ykpers-args.c @@ -65,8 +65,7 @@ const char *usage = " (if FILE is -, send to stdout)\n" "-iFILE read configuration from FILE.\n" " (if FILE is -, read from stdin)\n" -"-fformat set the data format for -s and -i (and for standard write to console\n" -" valid values are json or legacy.\n" +"-fformat set the data format for -s and -i valid values are ycfg or legacy.\n" "-aXXX.. The AES secret key as a 32 (or 40 for OATH-HOTP/HMAC CHAL-RESP)\n" " char hex value (not modhex)\n" "-cXXX.. A 12 char hex value (not modhex) to use as access code for programming\n" @@ -374,12 +373,12 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk, *outfname = optarg; break; case 'f': - if(strcmp(optarg, "json") == 0) { - *data_format = YKP_FORMAT_JSON; + if(strcmp(optarg, "ycfg") == 0) { + *data_format = YKP_FORMAT_YCFG; } else if(strcmp(optarg, "legacy") == 0) { *data_format = YKP_FORMAT_LEGACY; } else { - fprintf(stderr, "The only valid formats to -f is json and legacy.\n"); + fprintf(stderr, "The only valid formats to -f is ycfg and legacy.\n"); *exit_code = 1; return 0; } diff --git a/ykpers.c b/ykpers.c index 6b83c18..510dbef 100644 --- a/ykpers.c +++ b/ykpers.c @@ -996,7 +996,7 @@ static int ykp_legacy_export_config(const YKP_CONFIG *cfg, char *buf, size_t len int ykp_export_config(const YKP_CONFIG *cfg, char *buf, size_t len, int format) { - if(format == YKP_FORMAT_JSON) { + if(format == YKP_FORMAT_YCFG) { return ykp_json_export_cfg(cfg, buf, len); } else if(format == YKP_FORMAT_LEGACY) { return ykp_legacy_export_config(cfg, buf, len); @@ -1008,7 +1008,7 @@ int ykp_export_config(const YKP_CONFIG *cfg, char *buf, size_t len, int ykp_import_config(const char *buf, size_t len, YKP_CONFIG *cfg, int format) { - if(format == YKP_FORMAT_JSON) { + if(format == YKP_FORMAT_YCFG) { return ykp_json_import_cfg(buf, len, cfg); } else if(format == YKP_FORMAT_LEGACY) { ykp_errno = YKP_ENOTYETIMPL; diff --git a/ykpers.h b/ykpers.h index 5a81707..8369703 100644 --- a/ykpers.h +++ b/ykpers.h @@ -141,7 +141,7 @@ int ykp_export_config(const YKP_CONFIG *cfg, char *buf, size_t len, int format); int ykp_import_config(const char *buf, size_t len, YKP_CONFIG *cfg, int format); #define YKP_FORMAT_LEGACY 0x01 -#define YKP_FORMAT_JSON 0x02 +#define YKP_FORMAT_YCFG 0x02 extern int * _ykp_errno_location(void); #define ykp_errno (*_ykp_errno_location())