FIDO-Raw

 view release on metacpan or  search on metacpan

deps/libcbor/src/cbor/streaming.c  view on Meta::CPAN


#include "streaming.h"
#include "internal/loaders.h"

bool static _cbor_claim_bytes(size_t required, size_t provided,
                              struct cbor_decoder_result *result) {
  if (required > (provided - result->read)) {
    /* We need to keep all the metadata if parsing is to be resumed */
    result->read = 0;
    result->status = CBOR_DECODER_NEDATA;
    result->required = required;
    return false;
  } else {
    result->read += required;
    result->required = 0;
    return true;
  }
}

struct cbor_decoder_result cbor_stream_decode(
    cbor_data source, size_t source_size,
    const struct cbor_callbacks *callbacks, void *context) {
  /* If we have no data, we cannot read even the MTB */
  if (source_size < 1) {

deps/libfido2/openbsd-compat/getopt_long.c  view on Meta::CPAN

				     current_argv);
			/*
			 * XXX: GNU sets optopt to val regardless of flag
			 */
			if (long_options[match].flag == NULL)
				optopt = long_options[match].val;
			else
				optopt = 0;
			return (BADARG);
		}
		if (long_options[match].has_arg == required_argument ||
		    long_options[match].has_arg == optional_argument) {
			if (has_equal)
				optarg = has_equal;
			else if (long_options[match].has_arg ==
			    required_argument) {
				/*
				 * optional argument doesn't use next nargv
				 */
				optarg = nargv[optind++];
			}
		}
		if ((long_options[match].has_arg == required_argument)
		    && (optarg == NULL)) {
			/*
			 * Missing argument; leading ':' indicates no error
			 * should be generated.
			 */
			if (PRINT_ERROR)
				warnx(recargstring,
				    current_argv);
			/*
			 * XXX: GNU sets optopt to val regardless of flag



( run in 0.316 second using v1.01-cache-2.11-cpan-0d8aa00de5b )