UFO: Alien Invasion
stringhunk.h File Reference

Header for string hunk management. More...

#include "ufotypes.h"
Include dependency graph for stringhunk.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stringHunk_t
 

Typedefs

typedef void(* stringHunkVisitor_t) (const char *string)
 

Functions

bool STRHUNK_Add (stringHunk_t *hunk, const char *string)
 
void STRHUNK_Reset (stringHunk_t *hunk)
 
void STRHUNK_Visit (stringHunk_t *hunk, stringHunkVisitor_t visitor)
 
stringHunk_tSTRHUNK_Create (size_t size)
 
void STRHUNK_Delete (stringHunk_t **hunk)
 
int STRHUNK_Size (const stringHunk_t *hunk)
 
size_t STRHUNK_GetFreeSpace (const stringHunk_t *hunk)
 

Detailed Description

Header for string hunk management.

Definition in file stringhunk.h.

Typedef Documentation

◆ stringHunkVisitor_t

typedef void(* stringHunkVisitor_t) (const char *string)

Definition at line 36 of file stringhunk.h.

Function Documentation

◆ STRHUNK_Add()

bool STRHUNK_Add ( stringHunk_t hunk,
const char *  string 
)
Returns
true if the add was successful, false if there was an overflow and the string was cut.

Definition at line 32 of file stringhunk.cpp.

References stringHunk_t::entries, stringHunk_t::hunk, stringHunk_t::pos, Q_strncpyz(), and stringHunk_t::size.

Referenced by SV_LogAdd(), and TEST_F().

◆ STRHUNK_Create()

stringHunk_t * STRHUNK_Create ( size_t  size)

Definition at line 88 of file stringhunk.cpp.

References stringHunk_t::hunk, Mem_AllocType, Mem_AllocTypeN, stringHunk_t::pos, and stringHunk_t::size.

Referenced by SV_LogInit(), and TEST_F().

◆ STRHUNK_Delete()

void STRHUNK_Delete ( stringHunk_t **  hunk)

Definition at line 97 of file stringhunk.cpp.

References Mem_Free.

Referenced by SV_LogShutdown(), and TEST_F().

◆ STRHUNK_GetFreeSpace()

size_t STRHUNK_GetFreeSpace ( const stringHunk_t hunk)

Definition at line 83 of file stringhunk.cpp.

References stringHunk_t::hunk, stringHunk_t::pos, and stringHunk_t::size.

Referenced by TEST_F().

◆ STRHUNK_Reset()

void STRHUNK_Reset ( stringHunk_t hunk)

Definition at line 55 of file stringhunk.cpp.

References stringHunk_t::entries, stringHunk_t::hunk, and stringHunk_t::pos.

Referenced by SV_LogHandleOutput(), and TEST_F().

◆ STRHUNK_Size()

int STRHUNK_Size ( const stringHunk_t hunk)

Definition at line 78 of file stringhunk.cpp.

References stringHunk_t::entries.

Referenced by TEST_F().

◆ STRHUNK_Visit()

void STRHUNK_Visit ( stringHunk_t hunk,
stringHunkVisitor_t  visitor 
)

Definition at line 62 of file stringhunk.cpp.

References stringHunk_t::entries, and stringHunk_t::hunk.

Referenced by SV_LogHandleOutput(), and TEST_F().