|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
#include "ab3job.h"Data Structures | |
| struct | out |
Macros | |
| #define | MODE_DETECT 0 |
| #define | MODE_BB2 1 |
| #define | MODE_AB3 2 |
Typedefs | |
| typedef char | ab3args_warnings_complete[sizeof ab3args_warnings/sizeof ab3args_warnings[0]==AB3JOB_W_COUNT+1 ? 1 :-1] |
Functions | |
| static int | eq (const char *a, const char *b) |
| static void | put (struct out *o, const char *s) |
| static int | fail (struct out *o, int result, const char *a, const char *b, const char *c) |
| static int | eqn (const char *s, const char *e, const char *n) |
| static int | warnlist (struct out *o, const char *opt, const char *v, uint32_t *keep, uint32_t *add) |
| static int | setname (char *dst, const char *src) |
| int | ab3args_parse (int argc, char *const argv[], struct ab3job *job, char *msg, size_t cap) |
| Parse the command line of blitz2-ab3. | |
| int | ab3args_rc (int result) |
| The return code that goes with a result of ab3args_parse. | |
Variables | |
| const char | ab3args_usage [] |
| The usage (several lines, each ending in LF). | |
| const char *const | ab3args_warnings [] |
| The names of the warnings by number (-w, -werr and the console line), AB3JOB_W_COUNT entries and a NULL. | |
| static const char *const | unsupported [] |
| #define MODE_AB3 2 |
| #define MODE_BB2 1 |
| #define MODE_DETECT 0 |
| typedef char ab3args_warnings_complete[ sizeof ab3args_warnings/sizeof ab3args_warnings[0]==AB3JOB_W_COUNT+1 ? 1 :-1] |
| int ab3args_parse | ( | int | argc, |
| char *const | argv[], | ||
| struct ab3job * | job, | ||
| char * | msg, | ||
| size_t | cap ) |
Parse the command line of blitz2-ab3.
argv[1..argc) as libnix (or a shell) splits them. Without an argument that starts with '-' the result is AB3ARGS_EDITOR (blitz2's start with at most a project name). Options, in any case, AmiBlitz3's spelling: -s/-source FILE, -e/-exe FILE, -r/-release, -mode ab3|bb2 and -w/-werr LIST (this repository's), -h/-help. A LIST is comma-separated items all, none, NAME, -NAME (ab3args_warnings), applied left to right; several -w (-werr) are applied in order. The other options of AmiBlitz3's CLI mode (-d/-debug, -run, -dump, -setcom, -setdbg, -strbufsize, -stacksize, -maxerrors, -1/-1pass, -dform, -PED, -save, -v/-verbose) are refused. The first problem decides; -h before it gives AB3ARGS_HELP. Given twice, the last value counts (the lists: both are applied). An unknown warning name or an empty item is AB3ARGS_FAIL.
| argc | the number of arguments with the program's name |
| argv | the arguments; argv[0] is the program's name |
| job | the job: initialised (magic, defaults) and filled |
| msg | the message for AB3ARGS_UNSUPPORTED and AB3ARGS_FAIL (one line without LF; "" otherwise) |
| cap | the size of msg in bytes (> 0) |
| int ab3args_rc | ( | int | result | ) |
The return code that goes with a result of ab3args_parse.
| result | an enum ab3args_result |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| const char ab3args_usage[] |
The usage (several lines, each ending in LF).
| const char* const ab3args_warnings[] |
The names of the warnings by number (-w, -werr and the console line), AB3JOB_W_COUNT entries and a NULL.
|
static |