UFO: Alien Invasion
stringhunk.cpp File Reference

String hunk management. More...

#include "stringhunk.h"
#include "../common/common.h"
Include dependency graph for stringhunk.cpp:

Go to the source code of this file.

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)
 
int STRHUNK_Size (const stringHunk_t *hunk)
 
size_t STRHUNK_GetFreeSpace (const stringHunk_t *hunk)
 
stringHunk_tSTRHUNK_Create (size_t size)
 
void STRHUNK_Delete (stringHunk_t **hunk)
 

Detailed Description

String hunk management.

Definition in file stringhunk.cpp.

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().