|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | ab3job |
| The job of a command line run. More... | |
Macros | |
| #define | AB3JOB_MAGIC "AB3JOB1" |
| The job's first bytes: what ab3cli checks before it trusts a0. | |
| #define | AB3JOB_PATHLEN 256 |
| Bytes of a file name in the job (with its 0). | |
| #define | AB3JOB_W_ALL ((uint32_t)((1UL << AB3JOB_W_COUNT) - 1)) |
| The set of all warnings. | |
Enumerations | |
| enum | ab3job_rc { AB3JOB_RC_OK = 0 , AB3JOB_RC_WARN = 5 , AB3JOB_RC_ERROR = 10 , AB3JOB_RC_FAIL = 20 } |
| The return codes of a command line run (design D6): those of the NDK's dos/dos.h (ab3cli checks that they agree; the host has no dos/dos.h). More... | |
| enum | ab3job_warning { AB3JOB_W_RESCLASH , AB3JOB_W_COUNT } |
| The compiler's warnings (change compiler-warnings, design D1): their numbers, bit n of a warning set. The compiler core has the same numbers in parse.h (W_*); ab3main.c checks that they agree. More... | |
| enum | ab3args_result { AB3ARGS_EDITOR , AB3ARGS_COMPILE , AB3ARGS_HELP , AB3ARGS_UNSUPPORTED , AB3ARGS_FAIL } |
| What ab3args_parse found. More... | |
Functions | |
| static int | ab3job_rc (const struct ab3job *job, int setuperrs, int compileerr, int written) |
| The return code at the end of a compile (design D6 of the change compiler-warnings), what ab3cli leaves in the job. | |
| 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 *const | ab3args_warnings [] |
| The names of the warnings by number (-w, -werr and the console line), AB3JOB_W_COUNT entries and a NULL. | |
| const char | ab3args_usage [] |
| The usage (several lines, each ending in LF). | |
| #define AB3JOB_MAGIC "AB3JOB1" |
The job's first bytes: what ab3cli checks before it trusts a0.
| #define AB3JOB_PATHLEN 256 |
Bytes of a file name in the job (with its 0).
| #define AB3JOB_W_ALL ((uint32_t)((1UL << AB3JOB_W_COUNT) - 1)) |
The set of all warnings.
| enum ab3args_result |
| enum ab3job_rc |
| enum ab3job_warning |
| 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 |
|
inlinestatic |
The return code at the end of a compile (design D6 of the change compiler-warnings), what ab3cli leaves in the job.
A set-up error (outside the compile: loading libraries or residents) gives AB3JOB_RC_FAIL, unless all of them were warnings that are errors (AB3JOB_RC_ERROR); a compile error AB3JOB_RC_ERROR; no executable written AB3JOB_RC_FAIL; otherwise AB3JOB_RC_WARN after a warning, else AB3JOB_RC_OK.
| job | the job (warnerrs, warnings) |
| setuperrs | the set-up errors (0: the compile ran) |
| compileerr | nonzero: the compile ended with an error |
| written | nonzero: the executable was written |
|
extern |
The usage (several lines, each ending in LF).
|
extern |
The names of the warnings by number (-w, -werr and the console line), AB3JOB_W_COUNT entries and a NULL.