diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2009-03-25 21:16:04 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2009-03-25 21:16:04 +0000 |
commit | 3ed024dcb2f874e9a6a1eac6142a0864eac33460 (patch) | |
tree | 861efbd4efded906ee5ee780facc55957ac90b09 /newlib/doc/makedoc.c | |
parent | 139f923bb4564fb021dce2b7ae460a3d8e3bb87d (diff) | |
download | cygnal-3ed024dcb2f874e9a6a1eac6142a0864eac33460.tar.gz cygnal-3ed024dcb2f874e9a6a1eac6142a0864eac33460.tar.bz2 cygnal-3ed024dcb2f874e9a6a1eac6142a0864eac33460.zip |
2009-03-25 Craig Howland <howland@LGSInnovations.com>
* libc/include/math.h: (llround, llroundf): Declare.
* libm/common/s_llround.c: New file, implementing llround().
* libm/common/sf_llround.c: New file, implementing llroundf().
* libm/common/sf_lround.c: Remove spurious cast in _DOUBLE_IS_32BITS
version of function.
* libm/common/sf_lrint.c: Ditto.
* libm/common/sf_logb.c: Corrected return for subnormal argument
by replacing existing function with a version created from sf_ilogb.c.
* libm/common/s_logb.c: Ditto, except starting point s_ilogb.c. Also
added documentation for logb() and logbf().
* libm/common/s_signbit.c: Add signbit() documentation.
* libm/common/s_log2.c: Update return values to match what w_log2.c has,
since log2 uses log(); add note about being derived instead of direct.
* libm/common/sf_fma.c: Add casts to attempt to get correct results,
as well as comments pointing out problems with the implementation.
* libm/common/s_fma.c: Add fma() and fmaf() documentation.
* libm/common/sf_remquo.c: Incorrect quotient returns for large values
corrected by discarding existing function and replacing with Sun
verion, with some enhancements.
* libm/common/s_remquo.c: Ditto. Add remquo() and remquof()
documentation.
* libm/common/s_fmax.c: Add fmax() and fmaxf() documentation.
* libm/common/s_fmin.c: Add fmin() and fminf() documentation.
* libm/common/s_fdim.c: Return NAN for NAN arg, add fdim() and fdimf()
documentation.
* libm/common/sf_fdim.c: Return NAN for NAN arg, HUGE_VALF for inf arg.
* libm/common/s_trunc.c: Add trunc() and truncf() documentation.
* libm/common/s_rint.c: Add rint() and rintf() documentation.
* libm/common/s_round.c: Add round() and roundf() documentation.
* libm/common/s_scalbn.c: Add scalbln() and scalblnf() documentation.
* libm/common/s_infinity.c: Add infinity() and infinityf()
documentation.
* libm/common/s_lround.c: Add lround(), lroundf(), llround(), and
llroundf() documentation.
* libm/common/s_lrint.c: Add lrint(), lrintf(), llrint(), and llrintf()
documentation.
* libm/common/isgreater.c: New file for documenting math.h function-like
macros isgreater(), isgreaterequal(), isless(), islessequal(),
islessgreater(), and isunordered().
* libm/common/s_isnan.c: Add documentation for function-like macros
fpclassify(), isfinite(), isinf(), isnan(), and isnormal().
* libm/common/s_nearbyint.c: Add nearbyint() and nearbyintf()
documentation.
* libm/common/Makefile.am: Add s_llround.c (src); sf_llround.c (fsrc);
s_fdim.def, s_fma.def, s_fmax.def, s_fmin.def,
s_logb.def, s_lrint.def, s_lround.def, s_nearbyint.def, s_remquo.def,
s_rint.def, s_round.def, s_signbit.def, s_trunc.def, and
isgreater.def (chobj);
re-name all existing chew files (chobj) to match source file base
names (put in underscores), delete all special targets for chew files
(leaving all to be generated by rule).
* libm/common/Makefile.in: regenerate.
* libm/math/w_exp2.c: Add "base 2" to documentation description (and
delete TRAD_SYNOPSIS).
* libm/math/w_gamma.c: Add tgamma() and tgammaf() documentation, along
with some history behind the function names.
* libm/math/math.tex: Add includes for newly-added documentation (see
.def additions to common/Makefile.am and math/Makefile.am in this
ChangeLog list), adjusted existing .def file names to match source file
base names (added underscores); add mention of HUGE_VALF; rename
"Version of library" section to "Error Handling" and add some text
about floating-point exception; added section "Standards Compliance And
Portability".
* libm/math/Makefile.am: Add w_exp2.def (chobj);
re-name all existing chew files (chobj) to match source file base
names, delete all special targets for chew files (leaving all to be
generated by rule).
* libm/math/Makefile.in: regenerated
* doc/makedoc.c: Change silent ignoring of commands < 5 characters
to a failure when reading macro file for commands < 4 characters;
add -v (verbose) option for printing some debugging information;
get rid of spurious translation of "@*" to "*" (no source files used @*,
so no existing doc pages were affected); clean up some compiler
warnings.
* doc/doc.str: add BUGS and SEEALSO sections (to match texi2pod.pl
which has them); Remove ITEM command (redundant with makedoc built-in
"o", not used in any present source file so nothing is lost, anyway).
* HOWTO: New file to hold information for maintainers regarding how
to do things. Initial sections on documentation and ELIX levels.
Diffstat (limited to 'newlib/doc/makedoc.c')
-rw-r--r-- | newlib/doc/makedoc.c | 76 |
1 files changed, 42 insertions, 34 deletions
diff --git a/newlib/doc/makedoc.c b/newlib/doc/makedoc.c index 00ff75c42..0bbffb66b 100644 --- a/newlib/doc/makedoc.c +++ b/newlib/doc/makedoc.c @@ -39,12 +39,15 @@ There is no #include <stdio.h> #include <stdlib.h> #include <ctype.h> +#include <string.h> #define DEF_SIZE 5000 #define STACK 50 +#define MIN_CMDLEN 4 /* Minimum length of a command */ int internal_wanted; int internal_mode; +int Verbose=0; @@ -212,7 +215,7 @@ string_type *tos; unsigned int idx = 0; /* Pos in input buffer */ string_type *ptr; /* and the buffer */ -typedef void (*stinst_type)(); +typedef void (*stinst_type)(NOARGS); stinst_type *pc; stinst_type sstack[STACK]; stinst_type *ssp = &sstack[0]; @@ -234,7 +237,7 @@ struct dict_struct }; typedef struct dict_struct dict_type; -#define WORD(x) static void x() +#define WORD(x) static void x(NOARGS) static void DEFUN(exec,(word), dict_type *word) @@ -451,7 +454,6 @@ WORD(translatecomments) WORD(quickref) { string_type *nos = tos-1; - unsigned int scan=0; unsigned int nosscan = 0; unsigned int idx = 0; @@ -487,6 +489,7 @@ WORD(quickref) } +#if 0 /* turn everything not starting with a . into a comment */ WORD(manglecomments) @@ -520,6 +523,7 @@ WORD(manglecomments) pc++; } +#endif /* Mod tos so that only lines with leading dots remain */ static void @@ -640,12 +644,15 @@ WORD(courierize) } /* +bulletize: look for bullet item commands at start of line + Bullet list: O+ emit @itemize @bullet - OO emit @item + o emit @item [note lowercase] O- emit @end itemize + Variable label list: o+ emit @table @code - oo @item + o emit @item o- emit @end table */ @@ -653,19 +660,10 @@ WORD(courierize) WORD(bulletize) { unsigned int idx = 0; - int on = 0; string_type out; init_string(&out); while (at(tos, idx)) { - if (at(tos, idx) == '@' && - at(tos, idx+1) == '*') - { - cattext(&out,"*"); - idx+=2; - } - - else if (at(tos, idx) == '\n' && at(tos, idx+1) == 'o') { if (at(tos,idx+2) == '+') { @@ -787,7 +785,10 @@ DEFUN( iscommand,(ptr, idx), } else if(at(ptr,idx) == '\n') { - if (len >4) return 1; + /* The length check will never fail on a real command + * because the commands are screened as the definitions file + * is read. */ + if (len >= MIN_CMDLEN) return 1; return 0; } else return 0; @@ -797,6 +798,7 @@ DEFUN( iscommand,(ptr, idx), } +unsigned int DEFUN(copy_past_newline,(ptr, idx, dst), string_type *ptr AND unsigned int idx AND @@ -833,7 +835,6 @@ WORD(kill_bogus_lines) { int sl ; - int nl = 0; int idx = 0; int c; int dot = 0 ; @@ -1162,9 +1163,6 @@ static void DEFUN_VOID(perform) /* It's worth looking through the command list */ if (iscommand(ptr, idx)) { - unsigned int i; - int found = 0; - char *next; dict_type *word ; @@ -1178,6 +1176,7 @@ static void DEFUN_VOID(perform) if (word) { + if(Verbose) fprintf(stderr, "CMD '%s'\n", word->word); exec(word); } else @@ -1234,19 +1233,13 @@ return entry->code_end++; void DEFUN(add_intrinsic,(name, func), char *name AND - void (*func)()) + void (*func)(NOARGS)) { dict_type *new = newentry(name); add_to_definition(new, func); add_to_definition(new, 0); } -WORD(push_addr) -{ - - -} - void DEFUN(add_var,(name), char *name) @@ -1261,13 +1254,12 @@ DEFUN(add_var,(name), -void +int DEFUN(compile, (string), char *string) { - int jstack[STACK]; - int *jptr = jstack; + int ret=0; /* add words to the dictionary */ char *word; string = nextword(string, &word); @@ -1275,18 +1267,24 @@ DEFUN(compile, (string), { if (strcmp(word,"var")==0) { - string=nextword(string, &word); + string=nextword(string, &word); add_var(word); - string=nextword(string, &word); + string=nextword(string, &word); } -else + else if (word[0] == ':') { dict_type *ptr; /* Compile a word and add to dictionary */ string = nextword(string, &word); + if(Verbose) fprintf(stderr, "Found command '%s'\n", word); + if(strlen(word) < MIN_CMDLEN) { + fprintf(stderr, "ERROR: Command '%s' is too short ", word); + fprintf(stderr, "(MIN_CMDLEN is %d)\n", MIN_CMDLEN); + ret++; + } ptr = newentry(word); string = nextword(string, &word); @@ -1330,9 +1328,11 @@ else else { fprintf(stderr,"syntax error at %s\n",string-1); + ret++; } } +return(ret); } @@ -1378,11 +1378,13 @@ static void DEFUN(read_in, (str, file), } +#if 0 static void DEFUN_VOID(usage) { - fprintf(stderr,"usage: -[d|i|g] <file >file\n"); + fprintf(stderr,"usage: -[i|v] -f macrofile <file >file\n"); exit(33); } +#endif int DEFUN(main,(ac,av), int ac AND @@ -1446,16 +1448,22 @@ char *av[]) fprintf(stderr,"Can't open the input file %s\n",av[i+1]); return 33; } + if(Verbose) fprintf(stderr, "Reading -f '%s'\n", av[i+1]); read_in(&b, f); - compile(b.ptr); + if( compile(b.ptr) ) { fclose(f); exit(1); } perform(); + fclose(f); } else if (av[i][1] == 'i') { internal_wanted = 1; } + else if (av[i][1] == 'v') + { + Verbose++; + } } } |