diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-07-07 15:04:54 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-07-07 15:04:54 +0000 |
commit | f8c0611295a680d000a73fd31fe26580fa4b4a75 (patch) | |
tree | e4b7c328bb59fbbd203bdb3ec68d849b0036f345 /roff.3 | |
parent | 4c444b6d0742002389376d67d51070f1b5aedadf (diff) | |
download | mandoc-f8c0611295a680d000a73fd31fe26580fa4b4a75.tar.gz |
Re-constitution of `ds' symbol processing. First, push the
roff_getstr() family of functions into roff.c with the "first_string"
directly in struct roff. Second, pre-process each line for reserved
words in libroff, splicing and re-running a line if it has one (this
allows defined symbols to be macros). Remove term.c's invocation of the
roff_getstrn() function. Removed function documentation in roff.3 and
added roff.7 `ds' documentation.
Diffstat (limited to 'roff.3')
-rw-r--r-- | roff.3 | 56 |
1 files changed, 0 insertions, 56 deletions
@@ -28,7 +28,6 @@ .Nd roff macro compiler library .Sh SYNOPSIS .In mandoc.h -.In regs.h .In roff.h .Ft "struct roff *" .Fo roff_alloc @@ -51,15 +50,6 @@ .Fc .Ft void .Fn roff_reset "struct roff *roff" -.In regs.h -.Ft "char *" -.Fn roff_setstr "const char *name" "const char *string" -.Ft "char *" -.Fn roff_getstr "const char *name" -.Ft "char *" -.Fn roff_getstrn "const char *name" "size_t len" -.Ft void -.Fn roff_freestr void .Sh DESCRIPTION The .Nm @@ -155,52 +145,6 @@ Returns 0 on failure, 1 on success. Signals that the parse is complete. Returns 0 on failure, 1 on success. .El -.Sh USER-DEFINED STRINGS -Strings defined by the -.Xr roff 7 -.Sx \&ds -instruction are saved using the -.Fn roff_setstr -function and retrieved using the -.Fn roff_getstr -and -.Fn roff_getstrn -functions. -.Pp -These functions take the name of the string to be accessed -as their first argument. -While -.Fn roff_getstr -requires the name to be null-terminated, -.Fn roff_getstrn -accepts non-terminated strings, but requires the length of the name -to be specified. -.Pp -The second argument to -.Fn roff_setstr -is the new value of the string. -It will be copied to internal storage, so both pointers to constant -strings and pointers to volatile storage are acceptable. -.Pp -All of these functions return a pointer to the new value of the string -in internal storage, which should be considered read-only, so use -.Xr strdup 3 -on it as appropriate. -The read functions return NULL when a string of the specified name -is not available or empty, and -.Fn roff_setstr -returns NULL when memory allocation fails. -In the latter case, the string will remain unset. -.Pp -The function -.Fn roff_freestr -clears all user-defined strings. -It always succeeds. -Both -.Fn roff_reset -and -.Fn roff_free -call it. .Sh EXAMPLES See .Pa main.c |