diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-03-02 12:09:26 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-03-02 12:09:26 -0500 |
| commit | 479579f2234cf20c158c505e288e318d79baefa9 (patch) | |
| tree | 5a13988dd3480ce7fba3ae76422cda6602608c78 /src | |
| parent | bf1a4a5a88fbbb21dec716896eff8319f2997ce7 (diff) | |
update documentation
Diffstat (limited to 'src')
| -rw-r--r-- | src/stdarg/va_arg.c | 17 | ||||
| -rw-r--r-- | src/stdarg/va_copy.c | 10 | ||||
| -rw-r--r-- | src/stdarg/va_end.c | 11 | ||||
| -rw-r--r-- | src/stdarg/va_list.c | 4 | ||||
| -rw-r--r-- | src/stdarg/va_start.c | 15 |
5 files changed, 34 insertions, 23 deletions
diff --git a/src/stdarg/va_arg.c b/src/stdarg/va_arg.c index 37353882..0367c7b1 100644 --- a/src/stdarg/va_arg.c +++ b/src/stdarg/va_arg.c @@ -1,22 +1,23 @@ #include <stdarg.h> -#define va_arg(ap, type) __builtin_va_arg(ap, type) /** get an unnamed parameter **/ +#define va_arg(ap, type) __builtin_va_arg(ap, type) + /*** -retrieves the next unnamed parameter for use. The -ARGUMENT(ap) parameter must be first initialized with a call to FUNCTION(va_start). -Each successive call to FUNCTION(va_arg) evaluates the next argument as an -object of type ARGUMENT(type) and returns that value, modifying ARGUMENT(ap) for use in -the next call to FUNCTION(va_arg). +retrieves the next unnamed parameter for use. The ARGUMENT(ap) parameter must +be first initialized with a call to FUNCTION(va_start). Each successive call to +FUNCTION(va_arg) evaluates the next argument as an object of type ARGUMENT(type) +and returns that value, modifying ARGUMENT(ap) for use in the next call to +FUNCTION(va_arg). ***/ /* PROTOTYPE(TYPE(VAR(type)) va_arg(va_list ap, TYPE(VAR(type)));) + UNDEFINED(There is no next argument) UNDEFINED(The next argument is not compatible with TYPE(ARGUMENT(type))) RETURN_SUCCESS(an object of TYPE(ARGUMENT(type)) which is the next unnamed function parameter) -*/ -/* + STDC(1) */ diff --git a/src/stdarg/va_copy.c b/src/stdarg/va_copy.c index 27c13dc8..d9222ff4 100644 --- a/src/stdarg/va_copy.c +++ b/src/stdarg/va_copy.c @@ -1,6 +1,16 @@ #include <stdarg.h> + +/** copy a va_list **/ + #define va_copy(dest, src) __builtin_va_copy(dest, src) +/*** +copies the TYPE(va_list) ARGUMENT(src) to ARGUMENT(dest), including the current +state of the list. +***/ + /* +PROTOTYPE(void va_copy(va_list dest, va_list src);) + STDC(199901) */ diff --git a/src/stdarg/va_end.c b/src/stdarg/va_end.c index 00588526..2934e600 100644 --- a/src/stdarg/va_end.c +++ b/src/stdarg/va_end.c @@ -1,19 +1,18 @@ #include <stdarg.h> -#define va_end(ap) __builtin_va_end(ap) /** end processing unnamed arguments **/ +#define va_end(ap) __builtin_va_end(ap) + /*** -stops processing unnamed arguments that were -previously begun with a call to FUNCTION(va_start) so that the enclosing function -may return normally. +stops processing unnamed arguments that were previously begun with a call to +FUNCTION(va_start) so that the enclosing function may return normally. ***/ /* PROTOTYPE(void va_end(va_list ap);) UNDEFINED(ARGUMENT(ap) was not initialized by FUNCTION(va_start)) UNDEFINED(THIS() is not called in the same function as FUNCTION(va_start)) -*/ -/* + STDC(1) */ diff --git a/src/stdarg/va_list.c b/src/stdarg/va_list.c index 21b1329b..4e571669 100644 --- a/src/stdarg/va_list.c +++ b/src/stdarg/va_list.c @@ -1,12 +1,14 @@ #include <stdarg.h> -typedef __builtin_va_list va_list; /** variable length argument list **/ +typedef __builtin_va_list va_list; + /*** holds the information necessary for making calls to FUNCTION(va_start), FUNCTION(va_copy), FUNCTION(va_arg), and FUNCTION(va_end). ***/ + /* STDC(1) */ diff --git a/src/stdarg/va_start.c b/src/stdarg/va_start.c index 6151fb15..82a0ea3f 100644 --- a/src/stdarg/va_start.c +++ b/src/stdarg/va_start.c @@ -1,24 +1,23 @@ #include <stdarg.h> -#define va_start(ap, parmN) __builtin_va_start(ap, parmN) /** begin processing unnamed arguments **/ +#define va_start(ap, parmN) __builtin_va_start(ap, parmN) + /*** -prepares unnamed arguments for use. It initializes -ARGUMENT(ap) with the the first argument after the argument named by ARGUMENT(parmN). The -argument named by ARGUMENT(parmN) must be the final named argument to function (i.e. -the argument just prior to LITERAL(`, ...')). +prepares unnamed arguments for use. It initializes ARGUMENT(ap) with the the +first argument after the argument named by ARGUMENT(parmN). The argument named +by ARGUMENT(parmN) must be the final named argument to function (i.e. the +argument just prior to LITERAL(`, ...')). ***/ /* PROTOTYPE(void va_start(va_list ap, VAR(parmN));) -/* UNDEFINED(ARGUMENT(parmN) is declared TYPE(register)) UNDEFINED(ARGUMENT(parmN) is a function pointer) UNDEFINED(ARGUMENT(parmN) is an array type) UNDEFINED(ARGUMENT(parmN) is a type not compatible with default argument promotions) -*/ -/* + STDC(1) */ |
