ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
session.h File Reference

Go to the source code of this file.

Data Structures

struct  participant_t
 Participant in a session. More...
 
struct  host_lost_candidate_t
 Host migration state for collecting HOST_LOST packets. More...
 
struct  session_entry
 Session entry data structure. More...
 

Macros

#define MAX_PARTICIPANTS   16
 Maximum participants per session.
 

Typedefs

typedef struct session_entry session_entry_t
 Session entry data structure.
 

Functions

void session_entry_destroy (session_entry_t *entry)
 Free a session entry and all its resources.
 

Macro Definition Documentation

◆ MAX_PARTICIPANTS

#define MAX_PARTICIPANTS   16

Maximum participants per session.

Definition at line 20 of file include/ascii-chat/discovery/session.h.

Typedef Documentation

◆ session_entry_t

Session entry data structure.

Contains all session metadata. Stored in SQLite database.

Function Documentation

◆ session_entry_destroy()

void session_entry_destroy ( session_entry_t *  entry)

Free a session entry and all its resources.

Parameters
entrySession entry to free

Definition at line 15 of file lib/discovery/session.c.

15 {
16 if (!entry) {
17 return;
18 }
19
20 // Free all participants
21 for (size_t i = 0; i < MAX_PARTICIPANTS; i++) {
22 if (entry->participants[i]) {
23 SAFE_FREE(entry->participants[i]);
24 }
25 }
26
27 // Free the entry itself
28 SAFE_FREE(entry);
29}
#define SAFE_FREE(ptr)
Definition common.h:376
#define MAX_PARTICIPANTS
participant_t * participants[16]
Participant array (in-memory only)

References MAX_PARTICIPANTS, session_entry::participants, and SAFE_FREE.

Referenced by database_session_join(), signaling_broadcast(), signaling_relay_ice(), signaling_relay_network_quality(), and signaling_relay_sdp().