Lines Matching refs:inp

57 static bool		 bhnd_nvram_ident_octet_string(const char *inp,
59 static bool bhnd_nvram_ident_num_string(const char *inp,
63 const bhnd_nvram_val_fmt **fmt, const void *inp,
70 const bhnd_nvram_val_fmt **fmt, const void *inp,
73 bhnd_nvram_val *value, const void *inp,
81 const bhnd_nvram_val_fmt **fmt, const void *inp,
87 bhnd_nvram_val *value, const void *inp,
91 bhnd_nvram_val *value, const void *inp,
96 const bhnd_nvram_val_fmt **fmt, const void *inp,
99 bhnd_nvram_val *value, const void *inp,
107 const bhnd_nvram_val_fmt **fmt, const void *inp,
233 bhnd_nvram_val_bcm_int_filter(const bhnd_nvram_val_fmt **fmt, const void *inp,
278 bhnd_nvram_val_bcm_hex_encode_elem(bhnd_nvram_val *value, const void *inp,
290 return (bhnd_nvram_val_generic_encode_elem(value, inp, ilen,
304 error = bhnd_nvram_value_coerce(inp, ilen, itype, &sval, &slen,
323 return (bhnd_nvram_value_printf("0x%0*I64X", inp, ilen, itype,
331 bhnd_nvram_val_bcm_decimal_encode_elem(bhnd_nvram_val *value, const void *inp,
342 return (bhnd_nvram_val_generic_encode_elem(value, inp, ilen,
346 return (bhnd_nvram_value_printf(sfmt, inp, ilen, itype, outp, olen));
354 const void *inp, size_t ilen, bhnd_nvram_type itype)
366 p = inp;
384 bhnd_nvram_val_bcm_leddc_encode_elem(bhnd_nvram_val *value, const void *inp,
434 return (bhnd_nvram_value_coerce(inp, ilen, itype, outp, olen,
446 p = inp;
457 /* Point inp and itype to either our parsed 32-bit or 16-bit
459 inp = &strval;
472 led16 = *(const uint16_t *)inp;
485 led32 = *(const uint32_t *)inp;
569 const void *inp;
574 inp = bhnd_nvram_val_bytes(value, &ilen, &itype);
581 return (bhnd_nvram_value_coerce(inp, ilen, itype, outp, olen,
587 inp = bhnd_nvram_val_bytes(value, &ilen, &itype);
588 if (bhnd_nvram_ident_octet_string(inp, ilen, NULL, NULL))
594 error = bhnd_nvram_val_init(&array, array_fmt, inp, ilen, itype,
617 const void *inp, size_t ilen, bhnd_nvram_type itype)
636 const char *inp;
642 inp = bhnd_nvram_val_bytes(value, &ilen, &itype);
653 next = inp;
661 if ((size_t)(next - inp) >= ilen)
667 remain = ilen - (size_t)(next - inp);
681 return (bhnd_nvram_value_array_next(inp, ilen, itype, prev,
693 const void *inp, size_t ilen, bhnd_nvram_type itype)
714 const void *inp;
728 inp = bhnd_nvram_val_bytes(value, &ilen, &itype);
729 return (bhnd_nvram_value_coerce(inp, ilen, itype, outp, olen, otype));}
736 const void *inp, size_t ilen, bhnd_nvram_type itype)
742 if (!bhnd_nvram_ident_octet_string(inp, ilen, NULL, NULL))
756 const void *inp, size_t ilen, void *outp, size_t *olen,
765 error = bhnd_nvram_parse_int(inp, ilen, 16, &nparsed, outp,
777 return (bhnd_nvram_value_coerce(inp, ilen,
840 * Determine whether @p inp is in octet string format, consisting of a
846 * @param inp The string to be parsed.
847 * @param ilen The length of @p inp, in bytes.
856 * @retval true if @p inp is a valid octet string
857 * @retval false if @p inp is not a valid octet string.
860 bhnd_nvram_ident_octet_string(const char *inp, size_t ilen, char *delim,
885 if ((loc = memchr(inp, *d, ilen)) == NULL)
901 for (const char *p = inp; (size_t)(p - inp) < ilen; p++) {
945 * Determine whether @p inp is in hexadecimal, octal, or decimal string
955 * @param inp The string to be parsed.
956 * @param ilen The length of @p inp, in bytes.
962 * @retval true if @p inp is a valid number string
963 * @retval false if @p inp is not a valid number string.
967 bhnd_nvram_ident_num_string(const char *inp, size_t ilen, u_int base,
979 if (inp[nbytes] == '-' || inp[nbytes] == '+')
989 if (ilen - nbytes >= 2 && inp[nbytes] == '0' &&
990 (inp[nbytes+1] == 'x' || inp[nbytes+1] == 'X'))
1003 if (inp[nbytes] == '0') {
1016 c = inp[nbytes];