MCPcopy Create free account

hub / github.com/KaisenAmin/c_std / functions

Functions2,651 in github.com/KaisenAmin/c_std

Functionhttp_content_length
* @brief Returns the request's `Content-Length` as a non-negative byte count. * * Looks the header up case-insensitively and parses it strictly as R
network/http.c:2291
Functionhttp_content_type
* @brief Convenience accessor for the request's `Content-Type` header. * * Equivalent to `http_get_header_ci(req, "Content-Type")`. The value may *
network/http.c:2275
Functionhttp_delete
* @brief Convenience wrapper: issue a DELETE request with default options. * * @param url Absolute http/https URL. Must not be NULL. * @return Newl
network/http.c:3391
Functionhttp_get
* @brief Convenience wrapper: issue a GET request with default options. * * @param url Absolute http/https URL. Must not be NULL. * @return Newly-a
network/http.c:3330
Functionhttp_get_cookie
* @brief Look up a single cookie value on a parsed request. * * Reads the request's `Cookie` header and walks the * `name1=value1; name2=value2` li
network/http.c:2065
Functionhttp_get_query_param
* @brief Find a query-string parameter on a parsed request by name. * * @param req Request to search. NULL → NULL. * @param name Parameter name (c
network/http.c:1686
Functionhttp_handle_request
* @brief Read, dispatch, and answer a single request on an accepted socket. * * Public entry point that blocks indefinitely on the client (no idle t
network/http.c:1646
Functionhttp_method_from_string
* @brief Parse a bare HTTP method token into an `HttpMethod`. * * Recognises the canonical, uppercase verbs `GET`, `POST`, `PUT`, `DELETE`, * `OPTI
network/http.c:2325
Functionhttp_parse_request
* @brief Back-compat wrapper: parse a NUL-terminated raw request string. * * Equivalent to `http_parse_request_ex(request, strlen(request))`. Use th
network/http.c:639
Functionhttp_post
* @brief Convenience wrapper: issue a POST request with a body. * * @param url Absolute http/https URL. Must not be NULL. * @param content
network/http.c:3344
Functionhttp_put
* @brief Convenience wrapper: issue a PUT request with a body. * * @param url Absolute http/https URL. Must not be NULL. * @param content_
network/http.c:3369
Functionhttp_read_full_request
* @brief Read a complete HTTP request from a connected socket (blocking). * * Public, back-compatible entry point that blocks indefinitely (no idle
network/http.c:1562
Functionhttp_redirect
* @brief Emit a redirect response in one call. * * Sets the status code (default 302 if `code` is not a 3xx redirect * code), appends a `Location:`
network/http.c:2120
Functionhttp_register_route
* @brief Register a handler for a given path + method. * * Paths may contain a single `{name}` placeholder that the framework * parses as an intege
network/http.c:1017
Functionhttp_response_remove_header
* @brief Remove every response header with the given name. * * Frees the matching `name`/`value` strings, shifts the remaining * headers down to ke
network/http.c:2187
Functionhttp_serialize_response
* @brief Serialize a response to a NUL-terminated HTTP/1.1 wire buffer. * * Back-compat wrapper over @ref http_serialize_response_ex with `head_only
network/http.c:965
Functionhttp_server_get_port
* @brief Actual port the server is currently listening on (useful after binding * to port 0), or 0 if no server is listening. * * @return Th
network/http.c:1317
Functionhttp_server_set_client_timeout
* @brief Set the per-connection recv/send timeout in milliseconds (slow-loris * defense and shutdown-drain bound). timeout_ms <= 0 disables ti
network/http.c:1303
Functionhttp_server_set_worker_count
* @brief Set the worker-thread pool size used by the next http_start_server*. * n <= 0 selects automatic sizing (hardware concurrency). Call b
network/http.c:1287
Functionhttp_set_cookie
* @brief Append a `Set-Cookie` header with optional attributes. * * Builds the cookie string in the form * `name=value[; Path=...][; Max-Age=N][; H
network/http.c:2012
Functionhttp_set_json_body
* @brief Attach a JSON document as the response body. * * Takes ownership of `json` — frees any previously-attached body or JSON * tree, serializes
network/http.c:718
Functionhttp_start_server
* @brief Back-compatible void wrapper around http_start_server_ex. * @param port TCP port to listen on. */
network/http.c:1241
Functionhttp_status_class
* @brief Returns the class (leading digit) of an HTTP status code. * * Maps a status code to its category: 1 (1xx informational), 2 (2xx success),
network/http.c:2358
Functionhttp_stop_server
* @brief Stop the running server and wake its blocked accept(). * * Flips the internal run flag and then opens a throwaway loopback connection so *
network/http.c:1254
Functionhttp_url_decode
* @brief Percent-decode a URL-encoded byte string. * * Translates `+` to space, `%XX` to the corresponding byte, and copies * every other byte verb
network/http.c:1889
Functionhttp_url_encode
* @brief Percent-encode a NUL-terminated string for use in URLs. * * Unreserved characters (`A-Z`, `a-z`, `0-9`, `-`, `_`, `.`, `~`) pass * through
network/http.c:1942
Functioniterator_decrement
* @brief Decrements the position of the iterator. * * This function moves the iterator one position backward in the deque. If the iterator * is a r
deque/deque.c:1259
Functioniterator_equals
* @brief Compares two iterators for equality. * * This function checks if two iterators point to the same position in the deque. * It also handles
deque/deque.c:1308
Functioniterator_get
* @brief Retrieves the value pointed to by the iterator. * * This function returns the value at the current position of the iterator. It handles *
deque/deque.c:1340
Functioniterator_increment
* @brief Moves the iterator to the previous position for reverse iteration. * * For reverse iterators, this function decrements the iterator's posit
deque/deque.c:1207
Functionjson_clone
json/json.c:2719
Functionjson_compare
* @brief Compares two JSON elements for equality. * * @param element1 The first JSON element to compare. * @param element2 The second JSON element
json/json.c:1770
Functionjson_convert
* @brief Converts a JSON element to a specified JSON type. * * @param element The JSON element to be converted. Must not be NULL. * @param type Th
json/json.c:2202
Functionjson_create_bool
* @brief Create a JSON boolean value in one call. * * @param value The boolean to store. * @return A new `JSON_BOOL` element (free with `json_deall
json/json.c:3025
Functionjson_create_null
* @brief Create a JSON null value. * * @return A new `JSON_NULL` element (free with `json_deallocate`), or NULL on * allocation failure. *
json/json.c:3014
Functionjson_create_number
* @brief Create a JSON number value in one call. * * JSON numbers are stored as `double`; pass an integer and it is widened. * * @param value The
json/json.c:3042
Functionjson_create_string
* @brief Create a JSON string value in one call. * * The string is deep-copied, so the caller may free or reuse @p value * immediately. A NULL @p v
json/json.c:3060
Functionjson_filter
* @brief Filters elements of a JSON array based on a predicate function and returns a new JSON array with elements that satisfy the predicate. * *
json/json.c:2509
Functionjson_find
* @brief Finds an element within a JSON object or array that matches a given predicate. * * @param element The JSON object or array to search. Must
json/json.c:1988
Functionjson_format
* @brief Formats a JSON element into a human-readable string. * * @param element The JSON element to format. * @return A dynamically allocated str
json/json.c:2623
Functionjson_generate_schema
json_generate_schema: produces a minimal type-only JSON-Schema-ish object */
json/json.c:2674
Functionjson_get_bool
* @brief Read a boolean from a JSON element with a fallback default. * * Same lookup rules as `json_get_int`. Returns @p default_value unless the *
json/json.c:3134
Functionjson_get_double
* @brief Read a double from a JSON element with a fallback default. * * Same lookup rules as `json_get_int`, but returns the full-precision `double`
json/json.c:3118
Functionjson_get_int
* @brief Read an integer from a JSON element with a fallback default. * * Resolves @p key_or_index (a key in an object, a numeric index in an array,
json/json.c:3103
Functionjson_get_keys
* @brief Retrieves all the keys from a JSON object. * * @param object The JSON object from which to retrieve the keys. Must be of type JSON_OBJECT.
json/json.c:2750
Functionjson_get_string
* @brief Read a string from a JSON element with a fallback default. * * Same lookup rules as `json_get_int`. Returns a BORROWED pointer to the * el
json/json.c:3151
Functionjson_last_error
* @brief Retrieves the last error that occurred during JSON operations. * * @return A JsonError struct containing the error code and message of the
json/json.c:2033
Functionjson_map
* @brief Applies a transformation function to each element of a JSON array and returns a new JSON array with the transformed elements. * * @param a
json/json.c:2438
Functionjson_merge
* @brief Merges two JSON objects into a new JSON object. * * @param element1 The first JSON object to merge. Must be of type JSON_OBJECT. * @param
json/json.c:2053
Functionjson_object_size
* @brief Returns the size of a JSON object. * * @param object The JSON element representing an object. * @return The number of key-value pairs in
json/json.c:1539
Functionjson_parse_with_options
json/json.c:2668
Functionjson_print
* @brief Prints a JSON element and its children to the standard output in a formatted manner. * * @param element The JSON element to be printed. *
json/json.c:1437
Functionjson_query
* @brief Queries a JSON element using a dot-separated path. * * @param element The JSON element to query. Must not be NULL. * @param query The que
json/json.c:2928
Functionjson_read_from_file
* @brief Reads a JSON file and returns the corresponding JSON element tree. * * @param filename The path to the JSON file to be read. * @return A
json/json.c:1376
Functionjson_reduce
* @brief Applies a reduction function across all elements of a JSON array. * * @param array The JSON array to reduce. Must be of type JSON_ARRAY.
json/json.c:2578
Functionjson_set_element
* @brief Sets a value in a JSON object or array at a specified key or index. * * @param element The JSON object or array in which to set the value.
json/json.c:1854
Functionjson_to_string_array
* @brief Converts a JSON array of strings into a C-style array of strings. * * @param array The JSON array to convert. Must be of type JSON_ARRAY a
json/json.c:2137
Functionjson_validate
json_validate: checks that element's top-level type matches what * schema_json describes (a minimal validator matching json_generate_schema). */
json/json.c:2695
Functionjson_write_to_file
* @brief Writes a JSON element to a file in serialized JSON format. * * @param element The JSON element to serialize and write to a file. * @param
json/json.c:1682
Functionjsonp_element_deallocator
* @brief Deallocates a JSON element, including its nested elements if applicable. * @param data A pointer to the JSON element to be deallocated. */
json/json.c:323
Functionjwt_create
* @brief Allocate a new JwtToken and seed its JOSE header. * * Sets `typ = "JWT"` and `alg = <name(alg)>` on the header object. The * payload objec
jwt/jwt.c:1173
Functionjwt_decode_and_verify
* @brief Decode and verify in one call. * * On success the parsed token is returned via *out and the caller owns * it (release with `jwt_deallocate
jwt/jwt.c:2200
Functionjwt_decode_and_verify_with_keyset
* @brief Decode + verify using a `JwtKeySet`, picking the right key by `kid`. * * If the token's header carries a `kid`, the matching keyset entry i
jwt/jwt.c:2361
Functionjwt_encode
* @brief Encode the token to the compact serialization "h.p.s". * * Serializes header and payload JSON, base64url-encodes both, joins * with `.`, s
jwt/jwt.c:1722
Functionjwt_get_algorithm
@brief Return the algorithm declared in the token's header. */
jwt/jwt.c:2400
Functionjwt_get_audience_at
* @brief The `index`-th audience string, or NULL if out of range. * * Works whether `aud` is a single string (only `index == 0` is valid) or an * a
jwt/jwt.c:2483
Functionjwt_get_audience_count
* @brief Number of audiences in the `aud` claim. * * RFC 7519 §4.1.3 permits `aud` to be either a single string or an array of * strings; this pres
jwt/jwt.c:2464
Functionjwt_get_claim_bool
* @brief Fetch a custom boolean claim by name. * @return true on present-and-bool, false otherwise. */
jwt/jwt.c:2532
Functionjwt_get_claim_double
* @brief Fetch a custom floating-point claim by name. * @return true on present-and-numeric, false otherwise. */
jwt/jwt.c:2520
Functionjwt_get_claim_int
* @brief Fetch a custom integer claim by name. * @return true if the claim is present and numeric; false otherwise. */
jwt/jwt.c:2508
Functionjwt_get_claim_string
@brief Fetch a custom string claim by name. Returns NULL if absent. */
jwt/jwt.c:2500
Functionjwt_get_expiration
@brief Return the `exp` claim (Unix seconds). *present is set true/false. */
jwt/jwt.c:2439
Functionjwt_get_header
@brief Return the raw header JSON tree (read-only; owned by token). */
jwt/jwt.c:2541
Functionjwt_get_issued_at
@brief Return the `iat` claim (Unix seconds). *present is set true/false. */
jwt/jwt.c:2449
Functionjwt_get_issuer
@brief Return the `iss` claim string, or NULL if absent. */
jwt/jwt.c:2413
Functionjwt_get_jwt_id
@brief Return the `jti` claim string, or NULL if absent. */
jwt/jwt.c:2421
Functionjwt_get_not_before
@brief Return the `nbf` claim (Unix seconds). *present is set true/false. */
jwt/jwt.c:2444
Functionjwt_get_payload
@brief Return the raw payload JSON tree (read-only; owned by token). */
jwt/jwt.c:2545
Functionjwt_get_subject
@brief Return the `sub` claim string, or NULL if absent. */
jwt/jwt.c:2417
Functionjwt_key_ec_private_file
* @brief Convenience: load an EC private key from a PEM file on disk. * @param path Filesystem path to a PEM file. * @return Newly-allocated key, or
jwt/jwt.c:703
Functionjwt_key_ec_public_file
* @brief Convenience: load an EC public key from a PEM file on disk. * @param path Filesystem path to a PEM file. * @return Newly-allocated key, or
jwt/jwt.c:717
Functionjwt_key_rsa_private_file
* @brief Convenience: load an RSA private key from a PEM file on disk. * * Slurps the entire file, then delegates to `jwt_key_rsa_private_pem`. *
jwt/jwt.c:586
Functionjwt_key_rsa_public_file
* @brief Convenience: load an RSA public key from a PEM file on disk. * * Slurps the entire file, then delegates to `jwt_key_rsa_public_pem`. * *
jwt/jwt.c:609
Functionjwt_keyset_alg_at
@brief `alg` of the entry at index `i`, or NULL if missing / out of range. */
jwt/jwt.c:1137
Functionjwt_keyset_at
@brief Borrowed key at index `i`, or NULL if out of range. */
jwt/jwt.c:1127
Functionjwt_keyset_from_file
* @brief Slurp a JWKS file from disk and parse it. * * Thin wrapper over `jwt_keyset_from_json`. * * @param path Filesystem path to a JWKS JSON do
jwt/jwt.c:1087
Functionjwt_keyset_kid_at
@brief `kid` of the entry at index `i`, or NULL if missing / out of range. */
jwt/jwt.c:1132
Functionjwt_keyset_size
@brief Number of keys successfully parsed. */
jwt/jwt.c:1122
Functionjwt_set_audience
* @brief Set the `aud` (audience) standard claim as a single string. * * For multiple audiences use `jwt_set_audiences`, which writes a JSON * arra
jwt/jwt.c:1272
Functionjwt_set_audiences
* @brief Set the `aud` claim as a JSON array of strings. * * @param t Token to modify. * @param auds Array of audience names. * @param n Numbe
jwt/jwt.c:1284
Functionjwt_set_claim_bool
* @brief Set a custom boolean claim. Stored as a JSON bool. */
jwt/jwt.c:1389
Functionjwt_set_claim_double
* @brief Set a custom floating-point claim. Stored as a JSON number. */
jwt/jwt.c:1381
Functionjwt_set_claim_int
* @brief Set a custom integer claim. Stored as a JSON number. */
jwt/jwt.c:1373
Functionjwt_set_claim_json
* @brief Set a custom claim with an arbitrary JSON value (array, object, …). * * Takes ownership of `value` on success. On failure (NULL inputs / OO
jwt/jwt.c:1400
Functionjwt_set_claim_string
* @brief Set a custom string-valued claim in the payload. * @return true on success, false on NULL inputs / OOM. */
jwt/jwt.c:1365
Functionjwt_set_expiration
* @brief Set the `exp` (expiration) claim. Unix seconds. */
jwt/jwt.c:1305
Functionjwt_set_expires_in
* @brief Set `exp` to `seconds_from_now` seconds after the current time. * * Convenience wrapper over `jwt_set_expiration` that computes the absolut
jwt/jwt.c:1344
Functionjwt_set_header_string
* @brief Set a custom header parameter (e.g. `kid`). * * The standard `typ` and `alg` headers are already populated by * `jwt_create`; this is for
jwt/jwt.c:1414
Functionjwt_set_issued_at
* @brief Set the `iat` (issued-at) claim. Unix seconds. */
jwt/jwt.c:1321
Functionjwt_set_issued_now
* @brief Set the `iat` (issued-at) claim to the current time. * * Convenience wrapper over `jwt_set_issued_at` using `time(NULL)`. * * @param t To
jwt/jwt.c:1356
← previousnext →1,401–1,500 of 2,651, ranked by callers