ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
http_range.h File Reference

Shared single-range Range: bytes=... parser (RFC 7233), used by static file serving and the edge cache (PROTOCORE_ENABLE_RANGE). More...

#include "protocore_config.h"

Go to the source code of this file.

Classes

struct  HttpRangeNs
 Dispatch table. Addressed by offset, so the layout is asserted below. More...
 

Functions

 PROTOCORE_NS_LAYOUT (HttpRangeNs, http_parse_byte_range)
 
int protocore_http_range_http_parse_byte_range (uint8_t *work, const char *hdr, size_t size, size_t *out_start, size_t *out_end)
 Parse a single-range Range: bytes=... header value against a .
 

Variables

PROTOCORE_NS HttpRangeNs HttpRange PROTOCORE_UNUSED
 Module namespace.
 

Detailed Description

Shared single-range Range: bytes=... parser (RFC 7233), used by static file serving and the edge cache (PROTOCORE_ENABLE_RANGE).

One owner for the range math, shared by the filesystem file server and the CDN edge cache. Pure and size/string-driven - no PC or fs:: dependency.

work is bytes the CALLER holds. This module reads none of them: it carries nothing between calls, so there is no state to keep and nothing to wipe. The parameter is there so a caller drives every namespace the same way.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file http_range.h.

Function Documentation

◆ PROTOCORE_NS_LAYOUT()

PROTOCORE_NS_LAYOUT ( HttpRangeNs  ,
http_parse_byte_range   
)

◆ protocore_http_range_http_parse_byte_range()

int protocore_http_range_http_parse_byte_range ( uint8_t *  work,
const char *  hdr,
size_t  size,
size_t *  out_start,
size_t *  out_end 
)

Parse a single-range Range: bytes=... header value against a .

Parameters
workPROTOCORE_HTTP_RANGE_BORROW bytes the caller took. Not held past the call.
hdrHdr
sizeSize
out_startOut start
out_endOut end
Returns
The int.

Variable Documentation

◆ PROTOCORE_UNUSED

PROTOCORE_NS HttpRangeNs HttpRange PROTOCORE_UNUSED
Initial value:
= {.http_parse_byte_range =
int protocore_http_range_http_parse_byte_range(uint8_t *work, const char *hdr, size_t size, size_t *out_start, size_t *out_end)
Parse a single-range Range: bytes=... header value against a .

Module namespace.

Definition at line 51 of file http_range.h.