This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
LEFTONE/util/parsarg/parsarg.h

43 lines
491 B
C
Raw Permalink Normal View History

#pragma once
#include <stdbool.h>
#include <stddef.h>
typedef struct {
int argc;
char** argv;
char* value;
bool after_option;
} parsarg_t;
void
parsarg_initialize(
parsarg_t* pa,
int argc,
char** argv
);
void
parsarg_deinitialize(
parsarg_t* pa
);
char* /* NULLABLE */
parsarg_pop_name(
parsarg_t* pa,
size_t* len
);
bool
parsarg_pop_value(
parsarg_t* pa,
char** str
);
bool
parsarg_finished(
const parsarg_t* pa
);