MCPcopy Create free account

hub / github.com/KaisenAmin/c_std / functions

Functions2,651 in github.com/KaisenAmin/c_std

Functiontime_sleep_ms
* @brief Suspend the calling thread for a number of milliseconds. * * Millisecond-precision counterpart to `time_sleep`, for retry backoff, polling
time/std_time.c:812
Functiontime_to_iso_string
* @brief Format a Time as an ISO 8601 extended local time string. * * Produces "HH:MM:SS.mmm" (always 12 characters, zero-padded). This is the * pa
time/std_time.c:941
Functiontime_to_seconds_of_day
* @brief Total seconds since midnight, including the fractional millisecond * component, as a double. * * The return is in [0.0, 86400.0). U
time/std_time.c:1067
Functiontime_to_string
* @brief This function converts a Time object to a human-readable string in the format "(hh:mm:ss:ms)". * * @param t Pointer to the Time object to
time/std_time.c:445
Functiontuple_forward_as_tuple
* @brief This function takes a variable number of arguments and stores them in a newly created tuple. * The pointers to the original arguments are s
tuple/tuple.c:309
Functiontuple_get
* @brief This function returns a pointer to the data stored at the given index in the tuple. * It also provides the size of the data through the `out
tuple/tuple.c:157
Functiontuple_is_empty
* @brief Checks if the tuple is empty. * * This function checks whether a given tuple contains any elements. A tuple is considered empty * if its
tuple/tuple.c:548
Functiontuple_is_greater
* @brief This function compares two tuples element by element. It returns `true` if the first tuple * is lexicographically greater than the second t
tuple/tuple.c:433
Functiontuple_is_greater_or_equal
* @brief This function compares two tuples element by element. It returns `true` if the first tuple * is greater than or equal to the second tuple a
tuple/tuple.c:491
Functiontuple_is_less
* @brief This function compares two tuples element by element. It returns `true` if the first tuple * is lexicographically less than the second tupl
tuple/tuple.c:403
Functiontuple_is_less_or_equal
* @brief This function compares two tuples element by element. It returns `true` if the first tuple * is less than or equal to the second tuple acco
tuple/tuple.c:520
Functiontuple_is_not_equal
* @brief This function compares two tuples element by element. It returns `true` if the tuples are * not equal, i.e., if they differ in size or cont
tuple/tuple.c:462
Functiontuple_make_tuple
* @brief This function creates a new tuple with the specified number of elements. * Each element in the tuple is set using the provided data and its
tuple/tuple.c:190
Functiontuple_swap
* @brief This function exchanges the contents of the two provided tuples. * After the swap, the first tuple will contain the elements of the second
tuple/tuple.c:271
Functiontuple_tie
* @brief This function takes a variable number of pointers and stores them in a newly created tuple. * Each element in the tuple is a pointer to the
tuple/tuple.c:232
Functionturtle_backward
* @brief Move the turtle in the opposite of its current heading. * * Equivalent to `turtle_forward(state, -distance)` semantically, but * implement
turtle/turtle.c:1190
Functionturtle_begin_drawing
* @brief Begins a drawing operation. * * This function begins a new drawing operation, preparing the canvas for rendering shapes or lines. */
turtle/turtle.c:713
Functionturtle_begin_fill
* @brief Starts the fill operation for the turtle. * * This function enables the turtle's filling mode and begins tracking the points to be filled.
turtle/turtle.c:613
Functionturtle_circle
* @brief Draws a circle or an arc based on the given radius and extent. * * This function draws a circle or an arc with the specified radius, exten
turtle/turtle.c:953
Functionturtle_clear
* @brief Drop every drawn line / stamp without touching the turtle's * position, heading, color, or pen state. * * Useful for "redraw" scena
turtle/turtle.c:1346
Functionturtle_clear_background
* @brief Clears the screen with the specified background color. * * This function fills the background with the specified color. * * @param colo
turtle/turtle.c:726
Functionturtle_clear_stamp
* @brief Clears a specific stamp by its ID. * * This function removes a stamp with the given ID from the screen. * * @param state A pointer to t
turtle/turtle.c:1048
Functionturtle_clear_stamps
* @brief Remove every stamp from the canvas. * * The companion to `turtle_clear_stamp` (which removes a single stamp by id): * this clears them all
turtle/turtle.c:1563
Functionturtle_color
* @brief Sets the turtle's pen and fill colors using hexadecimal color strings. * * This function sets both the pen and fill colors using hexadecim
turtle/turtle.c:552
Functionturtle_color_rgb
* @brief Sets the turtle's pen and fill colors using RGB values. * * This function sets the pen color and the fill color using RGB values. * * @
turtle/turtle.c:576
Functionturtle_create
* @brief Creates a new turtle state. * * This function allocates memory for a new Turtle instance, including its associated state, such as * posit
turtle/turtle.c:38
Functionturtle_deallocate
* @brief Deallocates the turtle and its associated resources. * * This function frees all memory allocated for the turtle state, including the turt
turtle/turtle.c:124
Functionturtle_degrees
* @brief Sets the turtle's movement mode to use degrees. * * This function sets the full circle degrees for turtle movements. The default is 360 de
turtle/turtle.c:1118
Functionturtle_distance
* @brief Calculates the distance from the turtle's current position to a specified point. * * This function returns the Euclidean distance between
turtle/turtle.c:1076
Functionturtle_distance_turtle
* @brief Calculates the distance between two turtles. * * This function returns the Euclidean distance between the turtle's current position and th
turtle/turtle.c:1100
Functionturtle_done
* @brief Runs the main drawing loop for the turtle and allows for user-defined drawing. * * This function enters a loop that continues until the wi
turtle/turtle.c:752
Functionturtle_dot
* @brief Draws a dot at the turtle's current position. * * This function draws a dot of the specified size and color at the turtle's current positi
turtle/turtle.c:1001
Functionturtle_draw
* @brief Renders the current state of the turtle and its drawings. * * This function draws the turtle, the lines it has drawn, and any filled shape
turtle/turtle.c:672
Functionturtle_end_drawing
* @brief Ends a drawing operation. * * This function concludes the current drawing operation, finalizing the rendering process. */
turtle/turtle.c:737
Functionturtle_end_fill
* @brief Ends the fill operation for the turtle. * * This function completes the fill operation and draws a filled shape using the points collected
turtle/turtle.c:634
Functionturtle_export_svg
* @brief Export the drawing to a standalone SVG file (headless, no window). * * Serializes every recorded line segment to an SVG `<line>`, on top of
turtle/turtle.c:1637
Functionturtle_face_towards
* @brief Convenience: rotate the turtle so it faces (x, y). * * Equivalent to `turtle_set_heading(state, turtle_towards(state, x, y))`. */
turtle/turtle.c:1413
Functionturtle_filling
* @brief Checks if the turtle is currently filling a shape. * * This function returns a boolean value indicating whether the turtle is currently in
turtle/turtle.c:596
Functionturtle_get_background_color
* @brief Read back the current background color into 4 out-pointers. */
turtle/turtle.c:1285
Functionturtle_get_fill_color
* @brief Read back the current fill color into 4 out-pointers. */
turtle/turtle.c:1273
Functionturtle_get_line
* @brief Read back one recorded line segment by index. * * The turtle accumulates every line it draws (via forward/backward/circle/ * set_position
turtle/turtle.c:1608
Functionturtle_get_line_count
* @brief Number of line segments currently in the turtle's draw * buffer. */
turtle/turtle.c:1427
Functionturtle_get_pen_color
* @brief Read back the current pen color into 4 out-pointers. * * Any of the out-pointers may be NULL if the caller only cares about * some channel
turtle/turtle.c:1261
Functionturtle_get_pen_size
* @brief Retrieves the current thickness of the turtle's pen. * * This function returns the current pen size (thickness) used by the turtle for dra
turtle/turtle.c:229
Functionturtle_get_speed
* @brief Read back the turtle's current speed (as set by * `turtle_set_speed`). */
turtle/turtle.c:1230
Functionturtle_get_stamp_count
* @brief Number of stamps currently in the turtle's draw buffer. */
turtle/turtle.c:1435
Functionturtle_get_x
* @brief Read back the turtle's current x coordinate. * @return The x value, or 0 if @p state is NULL. */
turtle/turtle.c:1206
Functionturtle_get_y
* @brief Read back the turtle's current y coordinate. * @return The y value, or 0 if @p state is NULL. */
turtle/turtle.c:1218
Functionturtle_heading
* @brief Retrieves the turtle's current heading in degrees. * * This function returns the turtle's current heading, normalized to the full circle d
turtle/turtle.c:1145
Functionturtle_home
* @brief Moves the turtle to the home position (0, 0) and resets its heading. * * This function moves the turtle to the origin (0, 0) from its curr
turtle/turtle.c:923
Functionturtle_init_window
* @brief Initializes a window for turtle graphics. * * This function opens a window with the specified width, height, and title for rendering turtl
turtle/turtle.c:163
Functionturtle_is_down
* @brief Checks if the turtle's pen is currently down. * * This function checks the pen state of the turtle and returns true if the pen is down (dr
turtle/turtle.c:249
Functionturtle_pen_down
* @brief Lowers the turtle's pen down, allowing it to draw. * * This function lowers the pen, allowing the turtle to draw lines while moving. *
turtle/turtle.c:514
Functionturtle_pen_size
* @brief Sets the thickness of the turtle's pen. * * This function adjusts the thickness of the pen used by the turtle to draw lines. * * @param
turtle/turtle.c:211
Functionturtle_pen_up
* @brief Lifts the turtle's pen up, preventing it from drawing. * * This function lifts the pen, preventing the turtle from drawing lines while mov
turtle/turtle.c:498
Functionturtle_position
* @brief Retrieves the current position of the turtle. * * This function returns the current x and y coordinates of the turtle's position. * * @
turtle/turtle.c:420
Functionturtle_radians
* @brief Sets the turtle's movement mode to use radians. * * This function sets the turtle to use radians for its angular movements (i.e., 2 * PI r
turtle/turtle.c:1131
Functionturtle_reset
* @brief Restore the turtle to its initial state. * * Clears every drawn line, every stamp, and every fill point; resets * position to (400, 300),
turtle/turtle.c:1302
Functionturtle_right
* @brief Turns the turtle to the right by a specified angle. * * This function turns the turtle to the right (clockwise) by decreasing the turtle's
turtle/turtle.c:465
Functionturtle_save_image
* @brief Save the current window contents to a PNG file. * * Thin wrapper over raylib's `TakeScreenshot`, so callers don't need to * include `rayli
turtle/turtle.c:1544
Functionturtle_screen_size
* @brief Query the current drawing window size, in pixels. * * Wraps raylib's `GetScreenWidth` / `GetScreenHeight`, so you can center or * scale dr
turtle/turtle.c:1581
Functionturtle_set_background_color
* @brief Sets the background color for the drawing area. * * This function sets the background color of the drawing window to the specified RGBA va
turtle/turtle.c:1171
Functionturtle_set_color
* @brief Sets the turtle's pen color using RGBA values. * * This function sets the pen color to the specified RGBA values. * * @param state A po
turtle/turtle.c:534
Functionturtle_set_fps
* @brief Sets the frames per second (FPS) for the turtle window. * * This function defines the target FPS at which the window will render updates,
turtle/turtle.c:177
Functionturtle_set_pen_color_rgb
* @brief Pen-color-only setter using explicit RGBA. * * `turtle_set_color` does the same thing but its name is ambiguous * (turtle "color" usually
turtle/turtle.c:1447
Functionturtle_set_position
* @brief Sets the turtle's position to the specified coordinates. * * This function moves the turtle to the specified (x, y) position. If the pen i
turtle/turtle.c:803
Functionturtle_set_speed
* @brief Sets the movement speed of the turtle. * * This function adjusts the turtle's movement speed and recalculates the step size, * affecting
turtle/turtle.c:192
Functionturtle_set_x
* @brief Sets the turtle's X-coordinate. * * This function changes the turtle's X-coordinate while keeping the Y-coordinate the same. If the pen is
turtle/turtle.c:837
Functionturtle_set_y
* @brief Sets the turtle's Y-coordinate. * * This function changes the turtle's Y-coordinate while keeping the X-coordinate the same. If the pen is
turtle/turtle.c:872
Functionturtle_stamp
* @brief Stamps the turtle's current position and color. * * This function stamps the turtle's current position and pencolor onto the screen. Each
turtle/turtle.c:1025
Functionturtle_turn
* @brief Turns the turtle by a specified angle. * * This function adjusts the turtle's heading by the specified angle in degrees. * * @param sta
turtle/turtle.c:448
Functionturtle_undo
* @brief Remove the most recently drawn line. * * Logo's classic `undo` undoes one move at a time. The implementation * here pops the last segment
turtle/turtle.c:1371
Functionturtle_write
* @brief Draw a text label at the turtle's current position. * * The label is recorded (like a line) and re-rendered every frame, so it * persists
turtle/turtle.c:1500
Functionturtle_write_at
* @brief Draw a text label at an explicit (x, y) position. * * Like `turtle_write`, but the label is placed at the given screen * coordinates inste
turtle/turtle.c:1523
Functionudp_bind
* @brief Bind a UDP socket to a local address and port. * * Pass `host = NULL` or an empty string to bind to the wildcard address * (accept datagra
network/udp.c:251
Functionudp_bytes_available
* @brief Report how many bytes are immediately available to read. * * Queries the socket via `FIONREAD`. On a datagram socket this is at least the
network/udp.c:1234
Functionudp_cleanup
* @brief Tear down one reference to the UDP subsystem. * * Pairs with `udp_init`; the final unmatched cleanup call invokes `WSACleanup` * on Window
network/udp.c:173
Functionudp_close
* @brief Close a UDP socket. * * @param socket Socket to release. * @return `UDP_SUCCESS` or `UDP_ERR_CLOSE`. */
network/udp.c:289
Functionudp_connect
* @brief Pin a UDP socket to a fixed remote peer. * * Calling `connect()` on a UDP socket doesn't open a connection (UDP is * connectionless) — ins
network/udp.c:941
Functionudp_endpoint_to_string
* @brief Printable host (and port) for an endpoint. host/port may be NULL. * * Renders the numeric address via inet_ntop. Both outputs are optional,
network/udp.c:1450
Functionudp_get_last_error
* @brief Retrieve the most recent UDP error for the calling thread. * * Errors are stored per-thread (using `__thread` / `__declspec(thread)`), so
network/udp.c:62
Functionudp_get_local_address
* @brief Retrieve the local address a UDP socket is bound to. * * Wraps `getsockname()` and converts the result to a printable host * string (`inet
network/udp.c:882
Functionudp_get_peer_address
* @brief Get the remote peer address of a connected UDP socket. * * The counterpart of `udp_get_local_address`: it reports the peer set by a * prio
network/udp.c:1104
Functionudp_init
* @brief Initialize the UDP subsystem. * * On Windows this performs a reference-counted `WSAStartup`; on POSIX it's * a no-op aside from the intern
network/udp.c:132
Functionudp_is_valid_address
* @brief Check whether `address` is a valid IPv4 or IPv6 numeric address. * * Does NOT perform DNS resolution — only parses dotted/colon-notation fo
network/udp.c:78
Functionudp_join_multicast_group
* @brief Join a multicast group (IPv4 or IPv6). * @param socket UDP socket * @param group_addr Multicast group address (e.g., "224.0.0.1" or "ff02::
network/udp.c:649
Functionudp_leave_multicast_group
* @brief Leave a multicast group (IPv4 or IPv6). * @param socket UDP socket * @param group_addr Multicast group address * @param iface_addr Local i
network/udp.c:716
Functionudp_recv
* @brief Receive on a UDP socket previously pinned with `udp_connect`. * * Equivalent to `recv()` — only datagrams from the connected peer are * de
network/udp.c:1013
Functionudp_recvfrom
* @brief Receive a single UDP datagram, optionally capturing the source. * * Reads up to `len` bytes into `buf`. If `src_host` is non-NULL and * `s
network/udp.c:384
Functionudp_request_reply
* @brief Request/response with timeout and retries (the UDP reliability pattern). * * Sends the request, waits up to `timeout_ms` for a reply, and r
network/udp.c:1529
Functionudp_resolve_endpoint
* @brief Resolve host:port into a reusable UdpEndpoint (one getaddrinfo). * * Unlike udp_sendto (which resolves on every call), resolve once here an
network/udp.c:1336
Functionudp_resolve_hostname
* @brief Resolve a hostname to its first IP address (IPv4 or IPv6). * * Uses `getaddrinfo` with `AF_UNSPEC` and writes the resulting address in * p
network/udp.c:602
Functionudp_send
* @brief Send on a UDP socket previously pinned with `udp_connect`. * * Equivalent to `send()` — the kernel knows the destination thanks to * the p
network/udp.c:978
Functionudp_sendto
* @brief Send a single UDP datagram to a destination host:port. * * Resolves `dest_host` (numeric or DNS) and sends the entire buffer as one * data
network/udp.c:322
Functionudp_set_broadcast
* @brief Enable or disable broadcast sends on a UDP socket. * * Required before sending to a broadcast address such as `255.255.255.255`. * * @par
network/udp.c:525
Functionudp_set_buffer_size
* @brief Set the kernel send and/or receive buffer sizes on a UDP socket. * * Tunes `SO_SNDBUF` and `SO_RCVBUF`. Pass `0` for either argument to *
network/udp.c:844
Functionudp_set_multicast_loopback
* @brief Enable or disable local loopback of outgoing multicast datagrams. * * Controls `IP_MULTICAST_LOOP` / `IPV6_MULTICAST_LOOP`. When enabled (t
network/udp.c:1198
Functionudp_set_multicast_ttl
* @brief Set multicast TTL (IPv4 or IPv6). * @param socket UDP socket * @param ttl Time-to-live value * @return UDP_SUCCESS or error */
network/udp.c:780
Functionudp_set_non_blocking
* @brief Toggle non-blocking I/O on a UDP socket. * * When enabled, `udp_recvfrom` returns `UDP_ERR_NO_DATA` instead of * blocking when there's not
network/udp.c:477
Functionudp_set_reuse_addr
* @brief Enable or disable address reuse (`SO_REUSEADDR`) on a UDP socket. * * Lets you re-bind to the same port immediately after a previous bind i
network/udp.c:815
← previousnext →2,401–2,500 of 2,651, ranked by callers