diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-03-02 11:48:33 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-03-02 11:48:33 -0500 |
commit | 4d6a7c78e82718b77d647f6c048b4438bcf1cf65 (patch) | |
tree | 21bf423ded9a651d212dfbe809edaf57f8189c37 | |
parent | 31fa349ea7fdeb053934450bef080e735dbb2a5d (diff) |
clean up documentation
-rw-r--r-- | src/setjmp/jmp_buf.c | 5 | ||||
-rw-r--r-- | src/setjmp/longjmp.c | 9 | ||||
-rw-r--r-- | src/setjmp/setjmp.c | 23 |
3 files changed, 18 insertions, 19 deletions
diff --git a/src/setjmp/jmp_buf.c b/src/setjmp/jmp_buf.c index 6ea7efff..09786eea 100644 --- a/src/setjmp/jmp_buf.c +++ b/src/setjmp/jmp_buf.c @@ -1,8 +1,9 @@ #include <setjmp.h> -typedef unsigned long int jmp_buf[32]; /** program environment **/ +typedef unsigned long int jmp_buf[32]; + /*** is used to hold all the information needed to restore a a calling environment. @@ -10,7 +11,5 @@ environment. /* TYPEDEF(an array type) -*/ -/* STDC(1) */ diff --git a/src/setjmp/longjmp.c b/src/setjmp/longjmp.c index bcb97410..c8ed34af 100644 --- a/src/setjmp/longjmp.c +++ b/src/setjmp/longjmp.c @@ -1,6 +1,7 @@ #include <setjmp.h> /** restore calling environment **/ + _Noreturn void longjmp(jmp_buf env, int val) { (void)env; @@ -13,7 +14,7 @@ _Noreturn void longjmp(jmp_buf env, int val) } /*** -THIS() restores the environment of a previous call to FUNCTION(setjmp) +restores the environment of a previous call to FUNCTION(setjmp) and continues execution at the location of the call to FUNCTION(setjmp). All objects previously accessible at the time of the call to FUNCTION(setjmp) @@ -21,15 +22,13 @@ have the same values. Non-TYPE(volatile) objects of automatic storage duration that have changed since the call to FUNCTION(setjmp) have intederminate values. When execution resumes at the point of the original call to FUNCTION(setjmp), -the value specified by ARGUMENT(val) is returned. If 0 is specified, then the return -value is 1. +the value specified by ARGUMENT(val) is returned. If 0 is specified, then the +return value is 1. ***/ /* UNDEFINED(There was no previous call to FUNCTION(setjmp)) UNDEFINED(The function containing the previous call to FUNCTION(setjmp) is no longer executing) UNDEFINED(THIS() is called from a nested signal handler) -*/ -/* STDC(1) */ diff --git a/src/setjmp/setjmp.c b/src/setjmp/setjmp.c index c578d2a9..a297dd6f 100644 --- a/src/setjmp/setjmp.c +++ b/src/setjmp/setjmp.c @@ -1,32 +1,33 @@ #include <setjmp.h> +/** save program state **/ + int setjmp(jmp_buf env) { - extern int __setjmp(jmp_buf); + (void)env; + /* extern int setjmp(jmp_buf); */ /* RETURN(0, the environment has been saved by THIS()) RETURN(NONZERO, the environment has been restored by FUNCTION(longjmp)) */ - return __setjmp(env); + return 0; /* setjmp(env); */ } -/** save program state **/ - /*** saves the current state of the calling environment in the TYPEDEF(jmp_buf) ARGUMENT(env). ***/ -/* CONSTRAINT: entire controlling expression of a selection or iteration statement */ -/* CONSTRAINT: one operand of a relational or equality operator which is the entire controlling expression of a selction or iteration statement */ -/* CONSTRAINT: the operand of a unary ! as the entire controlling expression of a selection or iteration statement */ -/* CONSTRAINT: an entire expression statement */ - /* +CONSTRAINT: entire controlling expression of a selection or iteration statement +CONSTRAINT: one operand of a relational or equality operator which is the entire controlling expression of a selction or iteration statement +CONSTRAINT: the operand of a unary ! as the entire controlling expression of a selection or iteration statement +CONSTRAINT: an entire expression statement + UNSPECIFIED(Whether THIS() is a macro or identifier with external linkage) + UNDEFINED(A macro definition of THIS() is suppressed in order to access an actual function) UNDEFINED(A program defines an external identifier named LITERAL(setjmp)) -*/ -/* + STDC(1) */ |