Lines Matching refs:arg
321 str2u32(char *arg, uint32_t *val)
327 t = strtoul(arg, &err, 0);
328 if (errno || (err==arg) || ((err != NULL) && *err)) {
338 str2u16(char *arg, uint16_t *val)
344 t = strtoul(arg, &err, 0);
345 if (errno || (err==arg) || ((err != NULL) && *err) || (t >= 0x10000)) {
735 parse_arg(char *arg, char *buf, char *argv[])
743 if ((arg == NULL)) {
748 argl = strlen(arg);
760 memcpy(buf, arg, argl);
782 required_arg(char c, char *arg)
784 if ((optarg != NULL) && (*arg == '-')){
794 is_empty_arg(char *arg)
797 if (arg != NULL) {
798 if (*arg) ret = 0;
805 parse_opt_flags(char ch, char *arg)
807 if (required_arg(ch, arg)) {
811 if (str2u32(arg, &fw_header.flags) != 0) {
812 errmsg(0,"invalid firmware flags: %s", arg);
826 parse_opt_size(char ch, char *arg)
828 if (required_arg(ch, arg)) {
832 if (str2u32(arg, &flash_size) != 0) {
833 errmsg(0,"invalid flash size: %s", arg);
847 parse_opt_id(char ch, char *arg)
854 if (required_arg(ch, arg)) {
858 argc = parse_arg(arg, buf, argv);
863 errmsg(0,"vendor id is missing from -%c %s",ch, arg);
875 errmsg(0,"device id is missing from -%c %s",ch, arg);
910 } else if (str2u32(arg, &fw_header.rev) != 0) {
925 parse_opt_block(char ch, char *arg)
933 if (required_arg(ch, arg)) {
942 argc = parse_arg(arg, buf, argv);
943 dbgmsg(1,"processing block option %s, count %d", arg, argc);
950 errmsg(0,"no block address specified in %s", arg);
960 errmsg(0,"no block length specified in %s", arg);
968 dbgmsg(1,"empty block %s", arg);
990 errmsg(0,"file name missing in %s", arg);
1010 parse_opt_partition(char ch, char *arg)
1019 if (required_arg(ch, arg)) {
1031 argc = parse_arg(arg, buf, argv);
1036 errmsg(0,"partition address missing in -%c %s",ch, arg);
1046 errmsg(0,"partition size missing in -%c %s",ch, arg);
1127 parse_opt_board(char ch, char *arg)
1129 if (required_arg(ch, arg)) {
1133 board = find_board(arg);
1135 errmsg(0,"invalid/unknown board specified: %s", arg);
1154 parse_opt_rev(char ch, char *arg)
1156 if (required_arg(ch, arg)) {
1160 if (str2u32(arg, &fw_header.rev) != 0) {
1161 errmsg(0,"invalid revision number: %s", arg);