Skip to content

docs(sse): add API reference page for sse.h (issue #271) - #305

Merged
gg582 merged 1 commit into
c4punks:devfrom
Bhumika-1432006:docs/sse-api-reference
Oct 4, 2026
Merged

gg582 merged 1 commit into
c4punks:devfrom
Bhumika-1432006:docs/sse-api-reference

Conversation

@Bhumika-1432006

Copy link
Copy Markdown
Contributor

Fixes #271

Problem

include/cwist/net/http/sse.h exposes nine public functions, but there is
no reference page under docs/api/ and docs/API.md does not list SSE.

Fix

Add docs/api/sse.md in the same format as docs/api/query.md: a header
line, one section per function with its signature and a short
description, the cwist_sse_event_t type, the convenience macros, and a
short example for each of response mode and stream mode. Link it from
the module list in docs/API.md.

Verification

  • make test_sse: "All SSE tests passed."
  • Both code examples in the page compile with -Wall and were run. Output
    matches the page: the response-mode handler produces
    "id:1 / event:message / data:..." frames, and the stream-mode handler
    writes the 200 OK headers followed by "event:tick / data:1" and the
    ":heartbeat" comment over a socketpair.
  • retry_ms of -2 returns err_i16 == -1, and retry_ms of 0 is emitted as
    "retry:0".
  • ASCII check on the new file: clean.

Scope

  • No changes to sse.h, sse.c or any test.
  • The page describes the code as it is today. It does not describe
    planned work.

Add docs/api/sse.md covering the nine public functions, the
cwist_sse_event_t type and the convenience macros in
include/cwist/net/http/sse.h, and link it from the module list in
docs/API.md.

The page describes the code as it is in src/net/http/sse.c. No source or
header changes.
@gg582

gg582 commented Oct 4, 2026

Copy link
Copy Markdown
Member

nice catch!

@gg582
gg582 merged commit 60c7bf2 into c4punks:dev Oct 4, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants