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
falsycat 84c3a02b9a [RELEASE] u22-v03
This version is submitted to U22 breau.
2020-09-14 00:00:00 +00:00

43 lines
491 B
C

#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
);