diff options
| author | Paul Eggert | 2011-04-28 15:02:15 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-28 15:02:15 -0700 |
| commit | f40b429dbf87a57345849472224ac222e805e9e3 (patch) | |
| tree | 9fcd2fa993a5ee0a6928996bf38ae6c5c08afc87 /src | |
| parent | fc96fbabd3aa421c8f5f4436a0093190707c0963 (diff) | |
| download | emacs-f40b429dbf87a57345849472224ac222e805e9e3.tar.gz emacs-f40b429dbf87a57345849472224ac222e805e9e3.zip | |
Document doprnt's behavior a bit better.
Diffstat (limited to 'src')
| -rw-r--r-- | src/doprnt.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/doprnt.c b/src/doprnt.c index 838581f7acd..e9a68f9d219 100644 --- a/src/doprnt.c +++ b/src/doprnt.c | |||
| @@ -70,7 +70,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 70 | %<flags><width><precision><length>character | 70 | %<flags><width><precision><length>character |
| 71 | 71 | ||
| 72 | where flags is [+ -0], width is [0-9]+, precision is .[0-9]+, and length | 72 | where flags is [+ -0], width is [0-9]+, precision is .[0-9]+, and length |
| 73 | is empty or l or ll. | 73 | is empty or l or ll. Also, %% in a format stands for a single % in the |
| 74 | output. A % that does not introduce a valid %-sequence causes | ||
| 75 | undefined behavior. | ||
| 74 | 76 | ||
| 75 | The + flag character inserts a + before any positive number, while a space | 77 | The + flag character inserts a + before any positive number, while a space |
| 76 | inserts a space before any positive number; these flags only affect %d, %o, | 78 | inserts a space before any positive number; these flags only affect %d, %o, |
| @@ -129,8 +131,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 129 | 131 | ||
| 130 | /* Generate output from a format-spec FORMAT, | 132 | /* Generate output from a format-spec FORMAT, |
| 131 | terminated at position FORMAT_END. | 133 | terminated at position FORMAT_END. |
| 134 | (*FORMAT_END is not part of the format, but must exist and be readable.) | ||
| 132 | Output goes in BUFFER, which has room for BUFSIZE chars. | 135 | Output goes in BUFFER, which has room for BUFSIZE chars. |
| 133 | If the output does not fit, truncate it to fit. | 136 | BUFSIZE must be positive. If the output does not fit, truncate it |
| 137 | to fit and return BUFSIZE - 1; if this truncates a multibyte | ||
| 138 | sequence, store '\0' into the sequence's first byte. | ||
| 134 | Returns the number of bytes stored into BUFFER, excluding | 139 | Returns the number of bytes stored into BUFFER, excluding |
| 135 | the terminating null byte. Output is always null-terminated. | 140 | the terminating null byte. Output is always null-terminated. |
| 136 | String arguments are passed as C strings. | 141 | String arguments are passed as C strings. |