mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 19:58:30 +00:00
Auto-generate some documentation
This commit is contained in:
parent
117d0111ab
commit
13437dd19b
97 changed files with 2033 additions and 661 deletions
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns nonzero if c is lower, alpha, or digit.
|
||||
*/
|
||||
int isalnum(int c) {
|
||||
return ('0' <= c && c <= '9') || ('A' <= c && c <= 'Z') ||
|
||||
('a' <= c && c <= 'z');
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns nonzero if c is upper or lower.
|
||||
*/
|
||||
int isalpha(int c) {
|
||||
return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
|
||||
}
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns nonzero if c is ascii.
|
||||
*/
|
||||
int isascii(int c) {
|
||||
return 0x00 <= c && c <= 0x7F;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns nonzero if c is space or tab.
|
||||
*/
|
||||
int isblank(int c) {
|
||||
return c == ' ' || c == '\t';
|
||||
}
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns nonzero if c is C0 ASCII control code or DEL.
|
||||
*/
|
||||
int iscntrl(int c) {
|
||||
return (0x00 <= c && c <= 0x1F) || c == 0x7F;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns nonzero if c is decimal digit.
|
||||
*/
|
||||
int isdigit(int c) {
|
||||
return '0' <= c && c <= '9';
|
||||
}
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns nonzero if c is lowercase alpha ascii character.
|
||||
*/
|
||||
int islower(int c) {
|
||||
return 'a' <= c && c <= 'z';
|
||||
}
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns true if c is space, \t, \r, \n, \f, or \v.
|
||||
*/
|
||||
int isspace(int c) {
|
||||
return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f' ||
|
||||
c == '\v';
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns nonzero if c is uppercase alpha ascii character.
|
||||
*/
|
||||
int isupper(int c) {
|
||||
return 'A' <= c && c <= 'Z';
|
||||
}
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns nonzero if wc is C0 or C1 control code.
|
||||
*/
|
||||
int iswcntrl(wint_t wc) {
|
||||
return (0x00 <= wc && wc <= 0x1F) || (0x7F <= wc && wc <= 0x9F);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/**
|
||||
* Returns true if c is hexadecimal digit.
|
||||
*/
|
||||
int isxdigit(int c) {
|
||||
return ('0' <= c && c <= '9') || ('A' <= c && c <= 'F') ||
|
||||
('a' <= c && c <= 'f');
|
||||
|
|
|
@ -28,17 +28,17 @@
|
|||
*
|
||||
* For example, strictly:
|
||||
*
|
||||
* char buf[16];
|
||||
* CHECK_NOTNULL(memccpy(buf, s, '\0', sizeof(buf)));
|
||||
* char buf[16];
|
||||
* CHECK_NOTNULL(memccpy(buf, s, '\0', sizeof(buf)));
|
||||
*
|
||||
* Or unstrictly:
|
||||
*
|
||||
* if (!memccpy(buf, s, '\0', sizeof(buf))) strcpy(buf, "?");
|
||||
* if (!memccpy(buf, s, '\0', sizeof(buf))) strcpy(buf, "?");
|
||||
*
|
||||
* Are usually more sensible than the following:
|
||||
*
|
||||
* char cstrbuf[16];
|
||||
* snprintf(cstrbuf, sizeof(cstrbuf), "%s", CSTR);
|
||||
* char cstrbuf[16];
|
||||
* snprintf(cstrbuf, sizeof(cstrbuf), "%s", CSTR);
|
||||
*
|
||||
* @return 𝑑 + idx(𝑐) + 1, or NULL if 𝑐 ∉ 𝑠₀․․ₙ₋₁
|
||||
* @note 𝑑 and 𝑠 can't overlap
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
* Prepares static search buffer.
|
||||
*
|
||||
* 1. If SRC is too long, it's truncated and *not* NUL-terminated.
|
||||
*
|
||||
* 2. If SRC is too short, the remainder is zero-filled.
|
||||
*
|
||||
* Please note this function isn't designed to prevent untrustworthy
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
* Prepares static search buffer.
|
||||
*
|
||||
* 1. If SRC is too long, it's truncated and *not* NUL-terminated.
|
||||
*
|
||||
* 2. If SRC is too short, the remainder is zero-filled.
|
||||
*
|
||||
* Please note this function isn't designed to prevent untrustworthy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue