You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-05 00:28:52 +02:00
Add FN_INLINE_ALWAYS macro.
Eliminate a lot of useless repetition for a commonly used pattern.
This commit is contained in:
@ -218,7 +218,7 @@ typedef struct ListPub
|
||||
} ListPub;
|
||||
|
||||
// List size
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
lstSize(const List *const this)
|
||||
{
|
||||
return THIS_PUB(List)->listSize;
|
||||
|
@ -91,14 +91,14 @@ typedef struct MyObjPub // First letter upper case
|
||||
|
||||
// Declare getters and setters inline for the publicly visible variables
|
||||
// Only setters require "Set" appended to the name
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
myObjMyData(const MyObj *const this)
|
||||
{
|
||||
return THIS_PUB(MyObj)->myData; // Use the built-in THIS_PUB macro
|
||||
}
|
||||
|
||||
// Destructor
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
myObjFree(MyObj *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -300,7 +300,7 @@ typedef struct ListPub
|
||||
} ListPub;
|
||||
|
||||
// List size
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
lstSize(const List *const this)
|
||||
{
|
||||
return THIS_PUB(List)->listSize;
|
||||
|
@ -197,14 +197,14 @@ typedef struct MyObjPub // First letter upper case
|
||||
|
||||
// Declare getters and setters inline for the publicly visible variables
|
||||
// Only setters require "Set" appended to the name
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
myObjMyData(const MyObj *const this)
|
||||
{
|
||||
return THIS_PUB(MyObj)->myData; // Use the built-in THIS_PUB macro
|
||||
}
|
||||
|
||||
// Destructor
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
myObjFree(MyObj *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -120,6 +120,18 @@
|
||||
|
||||
<p>Do not allow <code>CATCH()</code> to catch a fatal error.</p>
|
||||
</release-item>
|
||||
|
||||
<release-item>
|
||||
<github-pull-request id="1861"/>
|
||||
|
||||
<release-item-contributor-list>
|
||||
<release-item-ideator id="john.morris"/>
|
||||
<release-item-contributor id="david.steele"/>
|
||||
<release-item-reviewer id="stephen.frost"/>
|
||||
</release-item-contributor-list>
|
||||
|
||||
<p>Add <code>FN_INLINE_ALWAYS</code> macro.</p>
|
||||
</release-item>
|
||||
</release-development-list>
|
||||
</release-core-list>
|
||||
|
||||
|
@ -178,6 +178,12 @@ configuration.set_quoted('CFGOPTDEF_CONFIG_PATH', get_option('configdir'), descr
|
||||
# Set FN_NO_RETURN macro
|
||||
configuration.set('FN_NO_RETURN', '__attribute__((__noreturn__))', description: 'Indicate that a function does not return')
|
||||
|
||||
# Set FN_INLINE_ALWAYS macro
|
||||
configuration.set(
|
||||
'FN_INLINE_ALWAYS', '__attribute__((always_inline)) static inline',
|
||||
description: 'Indicate that a function should always be inlined'
|
||||
)
|
||||
|
||||
####################################################################################################################################
|
||||
# Include subdirs
|
||||
####################################################################################################################################
|
||||
|
@ -28,3 +28,6 @@ Build Flags Generated by Configure
|
||||
|
||||
// Indicate that a function does not return
|
||||
#define FN_NO_RETURN __attribute__((__noreturn__))
|
||||
|
||||
// Indicate that a function should always be inlined
|
||||
#define FN_INLINE_ALWAYS __attribute__((always_inline)) static inline
|
||||
|
@ -28,7 +28,7 @@ Block comments
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Format a #define with the value aligned at column 69
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
bldDefineRender(const String *const define, const String *const value)
|
||||
{
|
||||
return strNewFmt("#define %s%*s%s", strZ(define), (int)(60 - strSize(define)), "", strZ(value));
|
||||
@ -38,7 +38,7 @@ bldDefineRender(const String *const define, const String *const value)
|
||||
String *bldEnum(const char *const prefix, const String *const value);
|
||||
|
||||
// Format file header
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
bldHeader(const char *const module, const char *const description)
|
||||
{
|
||||
return strCatFmt(
|
||||
@ -52,7 +52,7 @@ bldHeader(const char *const module, const char *const description)
|
||||
}
|
||||
|
||||
// Put the file if it is different than the existing file
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
bldPut(const Storage *const storage, const char *const file, const Buffer *const contentNew)
|
||||
{
|
||||
const Buffer *const contentOld = storageGetP(storageNewReadP(storage, STR(file), .ignoreMissing = true));
|
||||
|
@ -66,7 +66,7 @@ YamlEvent yamlEventCheck(YamlEvent event, YamlEventType type);
|
||||
YamlEvent yamlEventPeek(Yaml *this);
|
||||
|
||||
// Get next scalar
|
||||
__attribute__((always_inline)) static inline YamlEvent
|
||||
FN_INLINE_ALWAYS YamlEvent
|
||||
yamlScalarNext(Yaml *const this)
|
||||
{
|
||||
return yamlEventNextCheck(this, yamlEventTypeScalar);
|
||||
@ -75,7 +75,7 @@ yamlScalarNext(Yaml *const this)
|
||||
// Check scalar
|
||||
void yamlScalarCheck(YamlEvent event, const String *value);
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
yamlScalarCheckZ(const YamlEvent event, const char *const value)
|
||||
{
|
||||
yamlScalarCheck(event, STR(value));
|
||||
@ -83,7 +83,7 @@ yamlScalarCheckZ(const YamlEvent event, const char *const value)
|
||||
|
||||
void yamlScalarNextCheck(Yaml *this, const String *value);
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
yamlScalarNextCheckZ(Yaml *const this, const char *const value)
|
||||
{
|
||||
yamlScalarNextCheck(this, STR(value));
|
||||
@ -95,7 +95,7 @@ bool yamlBoolParse(YamlEvent event);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
yamlFree(Yaml *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -34,21 +34,21 @@ typedef struct ExecPub
|
||||
} ExecPub;
|
||||
|
||||
// Read interface
|
||||
__attribute__((always_inline)) static inline IoRead *
|
||||
FN_INLINE_ALWAYS IoRead *
|
||||
execIoRead(Exec *const this)
|
||||
{
|
||||
return THIS_PUB(Exec)->ioReadExec;
|
||||
}
|
||||
|
||||
// Write interface
|
||||
__attribute__((always_inline)) static inline IoWrite *
|
||||
FN_INLINE_ALWAYS IoWrite *
|
||||
execIoWrite(Exec *const this)
|
||||
{
|
||||
return THIS_PUB(Exec)->ioWriteExec;
|
||||
}
|
||||
|
||||
// Exec MemContext
|
||||
__attribute__((always_inline)) static inline MemContext *
|
||||
FN_INLINE_ALWAYS MemContext *
|
||||
execMemContext(Exec *const this)
|
||||
{
|
||||
return objMemContext(this);
|
||||
@ -63,7 +63,7 @@ void execOpen(Exec *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
execFree(Exec *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -23,7 +23,7 @@ Ini *iniNew(void);
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline Ini *
|
||||
FN_INLINE_ALWAYS Ini *
|
||||
iniMove(Ini *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -60,7 +60,7 @@ StringList *iniSectionList(const Ini *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
iniFree(Ini *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -14,7 +14,7 @@ Constructors
|
||||
IoRead *ioBufferReadNew(const Buffer *buffer);
|
||||
|
||||
// Construct and open buffer read
|
||||
__attribute__((always_inline)) static inline IoRead *
|
||||
FN_INLINE_ALWAYS IoRead *
|
||||
ioBufferReadNewOpen(const Buffer *const buffer)
|
||||
{
|
||||
IoRead *const result = ioBufferReadNew(buffer);
|
||||
|
@ -14,7 +14,7 @@ Constructors
|
||||
IoWrite *ioBufferWriteNew(Buffer *buffer);
|
||||
|
||||
// Construct and open buffer write
|
||||
__attribute__((always_inline)) static inline IoWrite *
|
||||
FN_INLINE_ALWAYS IoWrite *
|
||||
ioBufferWriteNewOpen(Buffer *const buffer)
|
||||
{
|
||||
IoWrite *const result = ioBufferWriteNew(buffer);
|
||||
|
@ -27,7 +27,7 @@ typedef struct IoClientPub
|
||||
} IoClientPub;
|
||||
|
||||
// Name that identifies the client
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
ioClientName(const IoClient *const this)
|
||||
{
|
||||
return THIS_PUB(IoClient)->interface->name(THIS_PUB(IoClient)->driver);
|
||||
@ -37,14 +37,14 @@ ioClientName(const IoClient *const this)
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline IoClient *
|
||||
FN_INLINE_ALWAYS IoClient *
|
||||
ioClientMove(IoClient *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMoveContext(this, parentNew);
|
||||
}
|
||||
|
||||
// Open session
|
||||
__attribute__((always_inline)) static inline IoSession *
|
||||
FN_INLINE_ALWAYS IoSession *
|
||||
ioClientOpen(IoClient *const this)
|
||||
{
|
||||
return THIS_PUB(IoClient)->interface->open(THIS_PUB(IoClient)->driver);
|
||||
@ -53,7 +53,7 @@ ioClientOpen(IoClient *const this)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
ioClientFree(IoClient *const this)
|
||||
{
|
||||
objFreeContext(this);
|
||||
|
@ -13,14 +13,14 @@ Functions
|
||||
bool fdReady(int fd, bool read, bool write, TimeMSec timeout);
|
||||
|
||||
// Wait until the file descriptor is ready to read or timeout
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
fdReadyRead(const int fd, const TimeMSec timeout)
|
||||
{
|
||||
return fdReady(fd, true, false, timeout);
|
||||
}
|
||||
|
||||
// Wait until the file descriptor is ready to write or timeout
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
fdReadyWrite(const int fd, const TimeMSec timeout)
|
||||
{
|
||||
return fdReady(fd, false, true, timeout);
|
||||
|
@ -15,7 +15,7 @@ Constructors
|
||||
IoRead *ioFdReadNew(const String *name, int fd, TimeMSec timeout);
|
||||
|
||||
// Construct and open read fd
|
||||
__attribute__((always_inline)) static inline IoRead *
|
||||
FN_INLINE_ALWAYS IoRead *
|
||||
ioFdReadNewOpen(const String *const name, const int fd, const TimeMSec timeout)
|
||||
{
|
||||
IoRead *const result = ioFdReadNew(name, fd, timeout);
|
||||
|
@ -15,7 +15,7 @@ Constructors
|
||||
IoWrite *ioFdWriteNew(const String *name, int fd, TimeMSec timeout);
|
||||
|
||||
// Construct and open write fd
|
||||
__attribute__((always_inline)) static inline IoWrite *
|
||||
FN_INLINE_ALWAYS IoWrite *
|
||||
ioFdWriteNewOpen(const String *const name, const int fd, const TimeMSec timeout)
|
||||
{
|
||||
IoWrite *const result = ioFdWriteNew(name, fd, timeout);
|
||||
|
@ -27,7 +27,7 @@ Getters/Setters
|
||||
Pack *ioFilterResult(const IoFilter *this);
|
||||
|
||||
// Identifies the filter and is used when pulling results from the filter group
|
||||
__attribute__((always_inline)) static inline StringId
|
||||
FN_INLINE_ALWAYS StringId
|
||||
ioFilterType(const IoFilter *const this)
|
||||
{
|
||||
return THIS_PUB(IoFilter)->type;
|
||||
@ -36,7 +36,7 @@ ioFilterType(const IoFilter *const this)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
ioFilterFree(IoFilter *const this)
|
||||
{
|
||||
objFreeContext(this);
|
||||
|
@ -72,7 +72,7 @@ typedef struct IoFilterPub
|
||||
bool ioFilterDone(const IoFilter *this);
|
||||
|
||||
// Driver for the filter
|
||||
__attribute__((always_inline)) static inline void *
|
||||
FN_INLINE_ALWAYS void *
|
||||
ioFilterDriver(IoFilter *const this)
|
||||
{
|
||||
return THIS_PUB(IoFilter)->driver;
|
||||
@ -83,21 +83,21 @@ ioFilterDriver(IoFilter *const this)
|
||||
bool ioFilterInputSame(const IoFilter *this);
|
||||
|
||||
// Interface for the filter
|
||||
__attribute__((always_inline)) static inline const IoFilterInterface *
|
||||
FN_INLINE_ALWAYS const IoFilterInterface *
|
||||
ioFilterInterface(const IoFilter *const this)
|
||||
{
|
||||
return &THIS_PUB(IoFilter)->interface;
|
||||
}
|
||||
|
||||
// Does filter produce output? All In filters produce output.
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
ioFilterOutput(const IoFilter *const this)
|
||||
{
|
||||
return THIS_PUB(IoFilter)->interface.inOut != NULL;
|
||||
}
|
||||
|
||||
// List of filter parameters
|
||||
__attribute__((always_inline)) static inline const Pack *
|
||||
FN_INLINE_ALWAYS const Pack *
|
||||
ioFilterParamList(const IoFilter *const this)
|
||||
{
|
||||
return THIS_PUB(IoFilter)->paramList;
|
||||
@ -113,7 +113,7 @@ void ioFilterProcessIn(IoFilter *this, const Buffer *input);
|
||||
void ioFilterProcessInOut(IoFilter *this, const Buffer *input, Buffer *output);
|
||||
|
||||
// Move filter to a new parent mem context
|
||||
__attribute__((always_inline)) static inline IoFilter *
|
||||
FN_INLINE_ALWAYS IoFilter *
|
||||
ioFilterMove(IoFilter *this, MemContext *parentNew)
|
||||
{
|
||||
return objMoveContext(this, parentNew);
|
||||
|
@ -42,7 +42,7 @@ typedef struct IoFilterGroupPub
|
||||
} IoFilterGroupPub;
|
||||
|
||||
// Is the filter group done processing?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
ioFilterGroupDone(const IoFilterGroup *const this)
|
||||
{
|
||||
ASSERT_INLINE(THIS_PUB(IoFilterGroup)->opened && !THIS_PUB(IoFilterGroup)->closed);
|
||||
@ -51,7 +51,7 @@ ioFilterGroupDone(const IoFilterGroup *const this)
|
||||
|
||||
// Should the same input be passed again? A buffer of input can produce multiple buffers of output, e.g. when a file containing all
|
||||
// zeroes is being decompressed.
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
ioFilterGroupInputSame(const IoFilterGroup *const this)
|
||||
{
|
||||
ASSERT_INLINE(THIS_PUB(IoFilterGroup)->opened && !THIS_PUB(IoFilterGroup)->closed);
|
||||
@ -83,7 +83,7 @@ Pack *ioFilterGroupResultAll(const IoFilterGroup *this);
|
||||
void ioFilterGroupResultAllSet(IoFilterGroup *this, const Pack *filterResult);
|
||||
|
||||
// Return total number of filters
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
ioFilterGroupSize(const IoFilterGroup *const this)
|
||||
{
|
||||
return lstSize(THIS_PUB(IoFilterGroup)->filterList);
|
||||
@ -113,7 +113,7 @@ void ioFilterGroupClose(IoFilterGroup *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
ioFilterGroupFree(IoFilterGroup *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -52,7 +52,7 @@ typedef struct HttpClientPub
|
||||
TimeMSec timeout; // Request timeout
|
||||
} HttpClientPub;
|
||||
|
||||
__attribute__((always_inline)) static inline TimeMSec
|
||||
FN_INLINE_ALWAYS TimeMSec
|
||||
httpClientTimeout(const HttpClient *const this)
|
||||
{
|
||||
return THIS_PUB(HttpClient)->timeout;
|
||||
|
@ -33,7 +33,7 @@ const String *httpHeaderGet(const HttpHeader *this, const String *key);
|
||||
StringList *httpHeaderList(const HttpHeader *this);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline HttpHeader *
|
||||
FN_INLINE_ALWAYS HttpHeader *
|
||||
httpHeaderMove(HttpHeader *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -51,7 +51,7 @@ bool httpHeaderRedact(const HttpHeader *this, const String *key);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
httpHeaderFree(HttpHeader *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -59,7 +59,7 @@ StringList *httpQueryList(const HttpQuery *this);
|
||||
HttpQuery *httpQueryMerge(HttpQuery *this, const HttpQuery *query);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline HttpQuery *
|
||||
FN_INLINE_ALWAYS HttpQuery *
|
||||
httpQueryMove(HttpQuery *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -86,7 +86,7 @@ String *httpQueryRender(const HttpQuery *this, HttpQueryRenderParam param);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
httpQueryFree(HttpQuery *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -94,28 +94,28 @@ typedef struct HttpRequestPub
|
||||
} HttpRequestPub;
|
||||
|
||||
// Request path
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
httpRequestPath(const HttpRequest *const this)
|
||||
{
|
||||
return THIS_PUB(HttpRequest)->path;
|
||||
}
|
||||
|
||||
// Request query
|
||||
__attribute__((always_inline)) static inline const HttpQuery *
|
||||
FN_INLINE_ALWAYS const HttpQuery *
|
||||
httpRequestQuery(const HttpRequest *const this)
|
||||
{
|
||||
return THIS_PUB(HttpRequest)->query;
|
||||
}
|
||||
|
||||
// Request headers
|
||||
__attribute__((always_inline)) static inline const HttpHeader *
|
||||
FN_INLINE_ALWAYS const HttpHeader *
|
||||
httpRequestHeader(const HttpRequest *const this)
|
||||
{
|
||||
return THIS_PUB(HttpRequest)->header;
|
||||
}
|
||||
|
||||
// Request verb
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
httpRequestVerb(const HttpRequest *const this)
|
||||
{
|
||||
return THIS_PUB(HttpRequest)->verb;
|
||||
@ -131,7 +131,7 @@ HttpResponse *httpRequestResponse(HttpRequest *this, bool contentCache);
|
||||
FN_NO_RETURN void httpRequestError(const HttpRequest *this, HttpResponse *response);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline HttpRequest *
|
||||
FN_INLINE_ALWAYS HttpRequest *
|
||||
httpRequestMove(HttpRequest *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -140,7 +140,7 @@ httpRequestMove(HttpRequest *const this, MemContext *const parentNew)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
httpRequestFree(HttpRequest *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -42,28 +42,28 @@ typedef struct HttpResponsePub
|
||||
|
||||
// Read interface used to get the response content. This is intended for reading content that may be very large and will not be held
|
||||
// in memory all at once. If the content must be loaded completely for processing (e.g. XML) then httpResponseContent() is simpler.
|
||||
__attribute__((always_inline)) static inline IoRead *
|
||||
FN_INLINE_ALWAYS IoRead *
|
||||
httpResponseIoRead(HttpResponse *const this)
|
||||
{
|
||||
return THIS_PUB(HttpResponse)->contentRead;
|
||||
}
|
||||
|
||||
// Response code
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
httpResponseCode(const HttpResponse *const this)
|
||||
{
|
||||
return THIS_PUB(HttpResponse)->code;
|
||||
}
|
||||
|
||||
// Response headers
|
||||
__attribute__((always_inline)) static inline const HttpHeader *
|
||||
FN_INLINE_ALWAYS const HttpHeader *
|
||||
httpResponseHeader(const HttpResponse *const this)
|
||||
{
|
||||
return THIS_PUB(HttpResponse)->header;
|
||||
}
|
||||
|
||||
// Response reason
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
httpResponseReason(const HttpResponse *const this)
|
||||
{
|
||||
return THIS_PUB(HttpResponse)->reason;
|
||||
@ -73,7 +73,7 @@ httpResponseReason(const HttpResponse *const this)
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Is this response code OK, i.e. 2XX?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
httpResponseCodeOk(const HttpResponse *const this)
|
||||
{
|
||||
return httpResponseCode(this) / 100 == 2;
|
||||
@ -83,7 +83,7 @@ httpResponseCodeOk(const HttpResponse *const this)
|
||||
const Buffer *httpResponseContent(HttpResponse *this);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline HttpResponse *
|
||||
FN_INLINE_ALWAYS HttpResponse *
|
||||
httpResponseMove(HttpResponse *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -92,7 +92,7 @@ httpResponseMove(HttpResponse *const this, MemContext *const parentNew)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
httpResponseFree(HttpResponse *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -26,7 +26,7 @@ HttpSession *httpSessionNew(HttpClient *client, IoSession *session);
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline HttpSession *
|
||||
FN_INLINE_ALWAYS HttpSession *
|
||||
httpSessionMove(HttpSession *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -56,7 +56,7 @@ IoWrite *httpSessionIoWrite(HttpSession *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
httpSessionFree(HttpSession *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -52,35 +52,35 @@ typedef struct HttpUrlPub
|
||||
} HttpUrlPub;
|
||||
|
||||
// Protocol type
|
||||
__attribute__((always_inline)) static inline HttpProtocolType
|
||||
FN_INLINE_ALWAYS HttpProtocolType
|
||||
httpUrlProtocolType(const HttpUrl *const this)
|
||||
{
|
||||
return THIS_PUB(HttpUrl)->type;
|
||||
}
|
||||
|
||||
// Host
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
httpUrlHost(const HttpUrl *const this)
|
||||
{
|
||||
return THIS_PUB(HttpUrl)->host;
|
||||
}
|
||||
|
||||
// Path
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
httpUrlPath(const HttpUrl *const this)
|
||||
{
|
||||
return THIS_PUB(HttpUrl)->path;
|
||||
}
|
||||
|
||||
// Port
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
httpUrlPort(const HttpUrl *const this)
|
||||
{
|
||||
return THIS_PUB(HttpUrl)->port;
|
||||
}
|
||||
|
||||
// URL (exactly as originally passed)
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
httpUrl(const HttpUrl *const this)
|
||||
{
|
||||
return THIS_PUB(HttpUrl)->url;
|
||||
@ -89,7 +89,7 @@ httpUrl(const HttpUrl *const this)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
httpUrlFree(HttpUrl *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -23,14 +23,14 @@ typedef struct IoRead IoRead;
|
||||
Getters/Setters
|
||||
***********************************************************************************************************************************/
|
||||
// Do reads block when more bytes are requested than are available to read?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
ioReadBlock(const IoRead *const this)
|
||||
{
|
||||
return THIS_PUB(IoRead)->interface.block;
|
||||
}
|
||||
|
||||
// Is IO at EOF? All driver reads are complete and all data has been flushed from the filters (if any).
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
ioReadEof(const IoRead *const this)
|
||||
{
|
||||
ASSERT_INLINE(THIS_PUB(IoRead)->opened && !THIS_PUB(IoRead)->closed);
|
||||
@ -38,7 +38,7 @@ ioReadEof(const IoRead *const this)
|
||||
}
|
||||
|
||||
// Get filter group if filters need to be added
|
||||
__attribute__((always_inline)) static inline IoFilterGroup *
|
||||
FN_INLINE_ALWAYS IoFilterGroup *
|
||||
ioReadFilterGroup(IoRead *const this)
|
||||
{
|
||||
return THIS_PUB(IoRead)->filterGroup;
|
||||
@ -63,7 +63,7 @@ size_t ioReadSmall(IoRead *this, Buffer *buffer);
|
||||
String *ioReadLineParam(IoRead *this, bool allowEof);
|
||||
|
||||
// Read linefeed-terminated string
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
ioReadLine(IoRead *const this)
|
||||
{
|
||||
return ioReadLineParam(this, false);
|
||||
@ -88,7 +88,7 @@ void ioReadClose(IoRead *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
ioReadFree(IoRead *const this)
|
||||
{
|
||||
objFreeContext(this);
|
||||
|
@ -50,14 +50,14 @@ typedef struct IoReadPub
|
||||
} IoReadPub;
|
||||
|
||||
// Driver for the read object
|
||||
__attribute__((always_inline)) static inline void *
|
||||
FN_INLINE_ALWAYS void *
|
||||
ioReadDriver(IoRead *const this)
|
||||
{
|
||||
return THIS_PUB(IoRead)->driver;
|
||||
}
|
||||
|
||||
// Interface for the read object
|
||||
__attribute__((always_inline)) static inline const IoReadInterface *
|
||||
FN_INLINE_ALWAYS const IoReadInterface *
|
||||
ioReadInterface(const IoRead *const this)
|
||||
{
|
||||
return &THIS_PUB(IoRead)->interface;
|
||||
|
@ -27,7 +27,7 @@ typedef struct IoServerPub
|
||||
} IoServerPub;
|
||||
|
||||
// Name that identifies the server
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
ioServerName(const IoServer *const this)
|
||||
{
|
||||
return THIS_PUB(IoServer)->interface->name(THIS_PUB(IoServer)->driver);
|
||||
@ -37,14 +37,14 @@ ioServerName(const IoServer *const this)
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline IoServer *
|
||||
FN_INLINE_ALWAYS IoServer *
|
||||
ioServerMove(IoServer *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMoveContext(this, parentNew);
|
||||
}
|
||||
|
||||
// Open session
|
||||
__attribute__((always_inline)) static inline IoSession *
|
||||
FN_INLINE_ALWAYS IoSession *
|
||||
ioServerAccept(IoServer *const this, IoSession *const session)
|
||||
{
|
||||
return THIS_PUB(IoServer)->interface->accept(THIS_PUB(IoServer)->driver, session);
|
||||
@ -53,7 +53,7 @@ ioServerAccept(IoServer *const this, IoSession *const session)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
ioServerFree(IoServer *const this)
|
||||
{
|
||||
objFreeContext(this);
|
||||
|
@ -41,7 +41,7 @@ typedef struct IoSessionPub
|
||||
} IoSessionPub;
|
||||
|
||||
// Is the session authenticated? The exact meaning of "authenticated" will vary by driver type.
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
ioSessionAuthenticated(const IoSession *const this)
|
||||
{
|
||||
return THIS_PUB(IoSession)->authenticated;
|
||||
@ -60,14 +60,14 @@ typedef struct IoSessionIoReadParam
|
||||
#define ioSessionIoReadP(this, ...) \
|
||||
ioSessionIoRead(this, (IoSessionIoReadParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
__attribute__((always_inline)) static inline IoRead *
|
||||
FN_INLINE_ALWAYS IoRead *
|
||||
ioSessionIoRead(IoSession *const this, const IoSessionIoReadParam param)
|
||||
{
|
||||
return THIS_PUB(IoSession)->interface->ioRead(THIS_PUB(IoSession)->driver, param.ignoreUnexpectedEof);
|
||||
}
|
||||
|
||||
// Write interface
|
||||
__attribute__((always_inline)) static inline IoWrite *
|
||||
FN_INLINE_ALWAYS IoWrite *
|
||||
ioSessionIoWrite(IoSession *const this)
|
||||
{
|
||||
return THIS_PUB(IoSession)->interface->ioWrite(THIS_PUB(IoSession)->driver);
|
||||
@ -75,14 +75,14 @@ ioSessionIoWrite(IoSession *const this)
|
||||
|
||||
// The peer name, if any. The exact meaning will vary by driver type, for example the peer name will be the client CN for the
|
||||
// TlsSession driver.
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
ioSessionPeerName(const IoSession *const this)
|
||||
{
|
||||
return THIS_PUB(IoSession)->peerName;
|
||||
}
|
||||
|
||||
// Session role
|
||||
__attribute__((always_inline)) static inline IoSessionRole
|
||||
FN_INLINE_ALWAYS IoSessionRole
|
||||
ioSessionRole(const IoSession *const this)
|
||||
{
|
||||
return THIS_PUB(IoSession)->interface->role(THIS_PUB(IoSession)->driver);
|
||||
@ -92,14 +92,14 @@ ioSessionRole(const IoSession *const this)
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Close the session
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
ioSessionClose(IoSession *const this)
|
||||
{
|
||||
return THIS_PUB(IoSession)->interface->close(THIS_PUB(IoSession)->driver);
|
||||
}
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline IoSession *
|
||||
FN_INLINE_ALWAYS IoSession *
|
||||
ioSessionMove(IoSession *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMoveContext(this, parentNew);
|
||||
@ -108,7 +108,7 @@ ioSessionMove(IoSession *const this, MemContext *const parentNew)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
ioSessionFree(IoSession *const this)
|
||||
{
|
||||
objFreeContext(this);
|
||||
|
@ -28,7 +28,7 @@ typedef struct IoWritePub
|
||||
} IoWritePub;
|
||||
|
||||
// Filter group. Filters must be set before open and cannot be reset
|
||||
__attribute__((always_inline)) static inline IoFilterGroup *
|
||||
FN_INLINE_ALWAYS IoFilterGroup *
|
||||
ioWriteFilterGroup(IoWrite *const this)
|
||||
{
|
||||
return THIS_PUB(IoWrite)->filterGroup;
|
||||
@ -76,7 +76,7 @@ void ioWriteClose(IoWrite *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
ioWriteFree(IoWrite *const this)
|
||||
{
|
||||
objFreeContext(this);
|
||||
|
@ -49,7 +49,7 @@ String *regExpPrefix(const String *expression);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
regExpFree(RegExp *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -41,7 +41,7 @@ const void *blbAdd(Blob *this, const void *data, size_t size);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
strBlbFree(Blob *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -41,70 +41,70 @@ typedef struct BufferPub
|
||||
|
||||
// Amount of the buffer actually used. This will be updated automatically when possible but if the buffer is modified by using
|
||||
// bufPtr() then the user is responsible for updating used.
|
||||
__attribute__((always_inline)) static inline size_t
|
||||
FN_INLINE_ALWAYS size_t
|
||||
bufUsed(const Buffer *const this)
|
||||
{
|
||||
return THIS_PUB(Buffer)->used;
|
||||
}
|
||||
|
||||
// Is the buffer empty?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
bufEmpty(const Buffer *const this)
|
||||
{
|
||||
return bufUsed(this) == 0;
|
||||
}
|
||||
|
||||
// Buffer size
|
||||
__attribute__((always_inline)) static inline size_t
|
||||
FN_INLINE_ALWAYS size_t
|
||||
bufSize(const Buffer *const this)
|
||||
{
|
||||
return THIS_PUB(Buffer)->size;
|
||||
}
|
||||
|
||||
// Is the buffer full?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
bufFull(const Buffer *const this)
|
||||
{
|
||||
return bufUsed(this) == bufSize(this);
|
||||
}
|
||||
|
||||
// Buffer pointer
|
||||
__attribute__((always_inline)) static inline unsigned char *
|
||||
FN_INLINE_ALWAYS unsigned char *
|
||||
bufPtr(Buffer *const this)
|
||||
{
|
||||
return THIS_PUB(Buffer)->buffer;
|
||||
}
|
||||
|
||||
// Const buffer pointer
|
||||
__attribute__((always_inline)) static inline const unsigned char *
|
||||
FN_INLINE_ALWAYS const unsigned char *
|
||||
bufPtrConst(const Buffer *const this)
|
||||
{
|
||||
return THIS_PUB(Buffer)->buffer;
|
||||
}
|
||||
|
||||
// Remaining space in the buffer
|
||||
__attribute__((always_inline)) static inline size_t
|
||||
FN_INLINE_ALWAYS size_t
|
||||
bufRemains(const Buffer *const this)
|
||||
{
|
||||
return bufSize(this) - bufUsed(this);
|
||||
}
|
||||
|
||||
// Pointer to remaining buffer space (after used space)
|
||||
__attribute__((always_inline)) static inline unsigned char *
|
||||
FN_INLINE_ALWAYS unsigned char *
|
||||
bufRemainsPtr(Buffer *const this)
|
||||
{
|
||||
return bufPtr(this) + bufUsed(this);
|
||||
}
|
||||
|
||||
// Allocated buffer size. This may be different from bufSize() if a limit has been set.
|
||||
__attribute__((always_inline)) static inline size_t
|
||||
FN_INLINE_ALWAYS size_t
|
||||
bufSizeAlloc(const Buffer *const this)
|
||||
{
|
||||
return THIS_PUB(Buffer)->sizeAlloc;
|
||||
}
|
||||
|
||||
// Is the size limited to make the buffer appear smaller?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
bufSizeLimit(const Buffer *const this)
|
||||
{
|
||||
return THIS_PUB(Buffer)->sizeLimit;
|
||||
@ -129,7 +129,7 @@ bool bufEq(const Buffer *this, const Buffer *compare);
|
||||
String *bufHex(const Buffer *this);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline Buffer *
|
||||
FN_INLINE_ALWAYS Buffer *
|
||||
bufMove(Buffer *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -149,7 +149,7 @@ void bufUsedZero(Buffer *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
bufFree(Buffer *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -33,7 +33,7 @@ int cvtZToInt(const char *value);
|
||||
int cvtZToIntBase(const char *value, int base);
|
||||
int cvtZSubNToIntBase(const char *value, size_t offset, size_t size, int base);
|
||||
|
||||
__attribute__((always_inline)) static inline int
|
||||
FN_INLINE_ALWAYS int
|
||||
cvtZSubNToInt(const char *const value, const size_t offset, const size_t size)
|
||||
{
|
||||
return cvtZSubNToIntBase(value, offset, size, 10);
|
||||
@ -45,7 +45,7 @@ int64_t cvtZToInt64(const char *value);
|
||||
int64_t cvtZToInt64Base(const char *value, int base);
|
||||
int64_t cvtZSubNToInt64Base(const char *value, size_t offset, size_t size, int base);
|
||||
|
||||
__attribute__((always_inline)) static inline int64_t
|
||||
FN_INLINE_ALWAYS int64_t
|
||||
cvtZSubNToInt64(const char *const value, const size_t offset, const size_t size)
|
||||
{
|
||||
return cvtZSubNToInt64Base(value, offset, size, 10);
|
||||
@ -56,25 +56,25 @@ cvtZSubNToInt64(const char *const value, const size_t offset, const size_t size)
|
||||
// so that signed and unsigned values alternate, e.g. 0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6, etc. This moves as many
|
||||
// bits as possible into the low order bits which is good for other types of encoding, e.g. base-128. See
|
||||
// http://neurocline.github.io/dev/2015/09/17/zig-zag-encoding.html for details.
|
||||
__attribute__((always_inline)) static inline uint32_t
|
||||
FN_INLINE_ALWAYS uint32_t
|
||||
cvtInt32ToZigZag(const int32_t value)
|
||||
{
|
||||
return ((uint32_t)value << 1) ^ (uint32_t)(value >> 31);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline int32_t
|
||||
FN_INLINE_ALWAYS int32_t
|
||||
cvtInt32FromZigZag(const uint32_t value)
|
||||
{
|
||||
return (int32_t)((value >> 1) ^ (~(value & 1) + 1));
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint64_t
|
||||
FN_INLINE_ALWAYS uint64_t
|
||||
cvtInt64ToZigZag(const int64_t value)
|
||||
{
|
||||
return ((uint64_t)value << 1) ^ (uint64_t)(value >> 63);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline int64_t
|
||||
FN_INLINE_ALWAYS int64_t
|
||||
cvtInt64FromZigZag(const uint64_t value)
|
||||
{
|
||||
return (int64_t)((value >> 1) ^ (~(value & 1) + 1));
|
||||
@ -97,7 +97,7 @@ unsigned int cvtZToUInt(const char *value);
|
||||
unsigned int cvtZToUIntBase(const char *value, int base);
|
||||
unsigned int cvtZSubNToUIntBase(const char *value, size_t offset, size_t size, int base);
|
||||
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
cvtZSubNToUInt(const char *const value, const size_t offset, const size_t size)
|
||||
{
|
||||
return cvtZSubNToUIntBase(value, offset, size, 10);
|
||||
@ -109,7 +109,7 @@ uint64_t cvtZToUInt64(const char *value);
|
||||
uint64_t cvtZToUInt64Base(const char *value, int base);
|
||||
uint64_t cvtZSubNToUInt64Base(const char* value, size_t offset, size_t size, int base);
|
||||
|
||||
__attribute__((always_inline)) static inline uint64_t
|
||||
FN_INLINE_ALWAYS uint64_t
|
||||
cvtZSubNToUInt64(const char *const value, const size_t offset, const size_t size)
|
||||
{
|
||||
return cvtZSubNToUInt64Base(value, offset, size, 10);
|
||||
|
@ -97,7 +97,7 @@ void jsonValidate(const String *json);
|
||||
/***********************************************************************************************************************************
|
||||
Read Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
jsonReadFree(JsonRead *const this)
|
||||
{
|
||||
objFree(this);
|
||||
@ -167,7 +167,7 @@ const String *jsonWriteResult(JsonWrite *this);
|
||||
/***********************************************************************************************************************************
|
||||
Write Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
jsonWriteFree(JsonWrite *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -32,7 +32,7 @@ typedef struct KeyValuePub
|
||||
} KeyValuePub;
|
||||
|
||||
// List of keys
|
||||
__attribute__((always_inline)) static inline const VariantList *
|
||||
FN_INLINE_ALWAYS const VariantList *
|
||||
kvKeyList(const KeyValue *const this)
|
||||
{
|
||||
return THIS_PUB(KeyValue)->keyList;
|
||||
@ -48,7 +48,7 @@ Functions
|
||||
KeyValue *kvAdd(KeyValue *this, const Variant *key, const Variant *value);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline KeyValue *
|
||||
FN_INLINE_ALWAYS KeyValue *
|
||||
kvMove(KeyValue *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -71,7 +71,7 @@ const Variant *kvGetDefault(const KeyValue *this, const Variant *key, const Vari
|
||||
unsigned int kvGetIdx(const KeyValue *this, const Variant *key);
|
||||
|
||||
// Does the key exist (even if the value is NULL)
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
kvKeyExists(const KeyValue *const this, const Variant *const key)
|
||||
{
|
||||
return kvGetIdx(this, key) != KEY_NOT_FOUND;
|
||||
@ -86,7 +86,7 @@ KeyValue *kvRemove(KeyValue *this, const Variant *key);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
kvFree(KeyValue *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -76,21 +76,21 @@ typedef struct ListPub
|
||||
List *lstComparatorSet(List *this, ListComparator *comparator);
|
||||
|
||||
// Memory context for this list
|
||||
__attribute__((always_inline)) static inline MemContext *
|
||||
FN_INLINE_ALWAYS MemContext *
|
||||
lstMemContext(List *const this)
|
||||
{
|
||||
return objMemContext(this);
|
||||
}
|
||||
|
||||
// List size
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
lstSize(const List *const this)
|
||||
{
|
||||
return THIS_PUB(List)->listSize;
|
||||
}
|
||||
|
||||
// Is the list empty?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
lstEmpty(const List *const this)
|
||||
{
|
||||
return lstSize(this) == 0;
|
||||
@ -112,7 +112,7 @@ void *lstFindDefault(const List *this, const void *item, void *itemDefault);
|
||||
unsigned int lstFindIdx(const List *this, const void *item);
|
||||
|
||||
// Does an item exist in the list?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
lstExists(const List *const this, const void *const item)
|
||||
{
|
||||
return lstFind(this, item) != NULL;
|
||||
@ -125,14 +125,14 @@ unsigned int lstIdx(const List *this, const void *item);
|
||||
void *lstInsert(List *this, unsigned int listIdx, const void *item);
|
||||
|
||||
// Add an item to the end of the list
|
||||
__attribute__((always_inline)) static inline void *
|
||||
FN_INLINE_ALWAYS void *
|
||||
lstAdd(List *const this, const void *const item)
|
||||
{
|
||||
return lstInsert(this, lstSize(this), item);
|
||||
}
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline List *
|
||||
FN_INLINE_ALWAYS List *
|
||||
lstMove(List *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -149,7 +149,7 @@ List *lstSort(List *this, SortOrder sortOrder);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
lstFree(List *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -59,7 +59,7 @@ Create a local "this" variable of the correct type from a THIS_VOID parameter
|
||||
Cast this private struct, e.g. List, to the associated public struct, e.g. ListPub. Note that the public struct must be the first
|
||||
member of the private struct. For example:
|
||||
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
lstSize(const List *const this)
|
||||
{
|
||||
return THIS_PUB(List)->listSize;
|
||||
@ -69,7 +69,7 @@ The macro also ensures that this != NULL so there is no need to do that in the c
|
||||
***********************************************************************************************************************************/
|
||||
#define THIS_PUB(type) ((type##Pub *)thisNotNull(this))
|
||||
|
||||
__attribute__((always_inline)) static inline const void *
|
||||
FN_INLINE_ALWAYS const void *
|
||||
thisNotNull(const void *const this)
|
||||
{
|
||||
ASSERT_INLINE(this != NULL);
|
||||
@ -87,14 +87,14 @@ Functions
|
||||
|
||||
To ensure proper type checking, these functions are meant to be called from inline functions created specifically for each object:
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
storageFree(Storage *this)
|
||||
{
|
||||
objFree(this);
|
||||
}
|
||||
***********************************************************************************************************************************/
|
||||
// Get the object mem context
|
||||
__attribute__((always_inline)) static inline MemContext *
|
||||
FN_INLINE_ALWAYS MemContext *
|
||||
objMemContext(void *const this)
|
||||
{
|
||||
return memContextFromAllocExtra(this);
|
||||
|
@ -135,28 +135,28 @@ typedef enum
|
||||
Pack Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Duplicate pack
|
||||
__attribute__((always_inline)) static inline Pack *
|
||||
FN_INLINE_ALWAYS Pack *
|
||||
pckDup(const Pack *const this)
|
||||
{
|
||||
return (Pack *)bufDup((const Buffer *)this);
|
||||
}
|
||||
|
||||
// Cast Buffer to Pack
|
||||
__attribute__((always_inline)) static inline const Pack *
|
||||
FN_INLINE_ALWAYS const Pack *
|
||||
pckFromBuf(const Buffer *const buffer)
|
||||
{
|
||||
return (const Pack *)buffer;
|
||||
}
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline Pack *
|
||||
FN_INLINE_ALWAYS Pack *
|
||||
pckMove(Pack *const this, MemContext *const parentNew)
|
||||
{
|
||||
return (Pack *)bufMove((Buffer *)this, parentNew);
|
||||
}
|
||||
|
||||
// Cast Pack to Buffer
|
||||
__attribute__((always_inline)) static inline const Buffer *
|
||||
FN_INLINE_ALWAYS const Buffer *
|
||||
pckToBuf(const Pack *const pack)
|
||||
{
|
||||
return (const Buffer *)pack;
|
||||
@ -283,7 +283,7 @@ typedef struct PckReadModeParam
|
||||
mode_t pckReadMode(PackRead *this, PckReadModeParam param);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline PackRead *
|
||||
FN_INLINE_ALWAYS PackRead *
|
||||
pckReadMove(PackRead *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -423,7 +423,7 @@ void pckReadEnd(PackRead *this);
|
||||
/***********************************************************************************************************************************
|
||||
Read Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
pckReadFree(PackRead *const this)
|
||||
{
|
||||
objFree(this);
|
||||
@ -528,7 +528,7 @@ typedef struct PckWriteModeParam
|
||||
PackWrite *pckWriteMode(PackWrite *this, mode_t value, PckWriteModeParam param);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline PackWrite *
|
||||
FN_INLINE_ALWAYS PackWrite *
|
||||
pckWriteMove(PackWrite *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -675,7 +675,7 @@ Pack *pckWriteResult(PackWrite *this);
|
||||
/***********************************************************************************************************************************
|
||||
Write Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
pckWriteFree(PackWrite *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -87,14 +87,14 @@ typedef struct StringPub
|
||||
} StringPub;
|
||||
|
||||
// String size minus null-terminator, i.e. the same value that strlen() would return
|
||||
__attribute__((always_inline)) static inline size_t
|
||||
FN_INLINE_ALWAYS size_t
|
||||
strSize(const String *this)
|
||||
{
|
||||
return THIS_PUB(String)->size;
|
||||
}
|
||||
|
||||
// Pointer to zero-terminated string. strZNull() returns NULL when the String is NULL.
|
||||
__attribute__((always_inline)) static inline const char *
|
||||
FN_INLINE_ALWAYS const char *
|
||||
strZ(const String *this)
|
||||
{
|
||||
return THIS_PUB(String)->buffer;
|
||||
@ -134,7 +134,7 @@ String *strCatFmt(String *this, const char *format, ...) __attribute__((format(p
|
||||
// N is <= the end of the string being concatenated.
|
||||
String *strCatZN(String *this, const char *cat, size_t size);
|
||||
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
strCatN(String *this, const String *const cat, const size_t size)
|
||||
{
|
||||
ASSERT_INLINE(cat != NULL);
|
||||
@ -203,7 +203,7 @@ String *strTrim(String *this);
|
||||
String *strTruncIdx(String *this, int idx);
|
||||
|
||||
// Truncate the string to zero size
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
strTrunc(String *const this)
|
||||
{
|
||||
return strTruncIdx(this, 0);
|
||||
@ -212,7 +212,7 @@ strTrunc(String *const this)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
strFree(String *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -66,14 +66,14 @@ Functions
|
||||
StringId strIdFromZN(const char *buffer, size_t size, bool error);
|
||||
|
||||
// Convert String to StringId using strIdFromZN()
|
||||
__attribute__((always_inline)) static inline StringId
|
||||
FN_INLINE_ALWAYS StringId
|
||||
strIdFromStr(const String *const str)
|
||||
{
|
||||
return strIdFromZN(strZ(str), strSize(str), true);
|
||||
}
|
||||
|
||||
// Convert zero-terminated string to StringId using strIdFromZN()
|
||||
__attribute__((always_inline)) static inline StringId
|
||||
FN_INLINE_ALWAYS StringId
|
||||
strIdFromZ(const char *const str)
|
||||
{
|
||||
return strIdFromZN(str, strlen(str), true);
|
||||
|
@ -15,7 +15,7 @@ String List Handler
|
||||
/***********************************************************************************************************************************
|
||||
Internal add -- the string must have been created in the list's mem context before being passed
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
strLstAddInternal(StringList *const this, String *const string)
|
||||
{
|
||||
return *(String **)lstAdd((List *)this, &string);
|
||||
@ -24,7 +24,7 @@ strLstAddInternal(StringList *const this, String *const string)
|
||||
/***********************************************************************************************************************************
|
||||
Internal insert -- the string must have been created in the list's mem context before being passed
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
strLstInsertInternal(StringList *const this, const unsigned int listIdx, String *const string)
|
||||
{
|
||||
return *(String **)lstInsert((List *)this, listIdx, &string);
|
||||
|
@ -18,7 +18,7 @@ typedef struct StringList StringList;
|
||||
Constructors
|
||||
***********************************************************************************************************************************/
|
||||
// Create empty StringList
|
||||
__attribute__((always_inline)) static inline StringList *
|
||||
FN_INLINE_ALWAYS StringList *
|
||||
strLstNew(void)
|
||||
{
|
||||
return (StringList *)lstNewP(sizeof(String *), .comparator = lstComparatorStr);
|
||||
@ -27,7 +27,7 @@ strLstNew(void)
|
||||
// Split a string into a string list based on a delimiter
|
||||
StringList *strLstNewSplitZ(const String *string, const char *delimiter);
|
||||
|
||||
__attribute__((always_inline)) static inline StringList *
|
||||
FN_INLINE_ALWAYS StringList *
|
||||
strLstNewSplit(const String *const string, const String *const delimiter)
|
||||
{
|
||||
return strLstNewSplitZ(string, strZ(delimiter));
|
||||
@ -43,21 +43,21 @@ StringList *strLstDup(const StringList *sourceList);
|
||||
Getters/Setters
|
||||
***********************************************************************************************************************************/
|
||||
// Set a new comparator
|
||||
__attribute__((always_inline)) static inline StringList *
|
||||
FN_INLINE_ALWAYS StringList *
|
||||
strLstComparatorSet(StringList *const this, ListComparator *const comparator)
|
||||
{
|
||||
return (StringList *)lstComparatorSet((List *)this, comparator);
|
||||
}
|
||||
|
||||
// List size
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
strLstSize(const StringList *const this)
|
||||
{
|
||||
return lstSize((List *)this);
|
||||
}
|
||||
|
||||
// Is the list empty?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
strLstEmpty(const StringList *const this)
|
||||
{
|
||||
return strLstSize(this) == 0;
|
||||
@ -70,7 +70,7 @@ Functions
|
||||
String *strLstAdd(StringList *this, const String *string);
|
||||
String *strLstAddSubN(StringList *this, const String *string, size_t offset, size_t size);
|
||||
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
strLstAddSub(StringList *const this, const String *const string, const size_t size)
|
||||
{
|
||||
return strLstAddSubN(this, string, 0, size);
|
||||
@ -80,7 +80,7 @@ String *strLstAddFmt(StringList *this, const char *format, ...) __attribute__((f
|
||||
String *strLstAddZ(StringList *this, const char *string);
|
||||
String *strLstAddZSubN(StringList *this, const char *string, size_t offset, size_t size);
|
||||
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
strLstAddZSub(StringList *const this, const char *const string, const size_t size)
|
||||
{
|
||||
return strLstAddZSubN(this, string, 0, size);
|
||||
@ -89,7 +89,7 @@ strLstAddZSub(StringList *const this, const char *const string, const size_t siz
|
||||
String *strLstAddIfMissing(StringList *this, const String *string);
|
||||
|
||||
// Does the specified string exist in the list?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
strLstExists(const StringList *const this, const String *const string)
|
||||
{
|
||||
return lstExists((List *)this, &string);
|
||||
@ -99,7 +99,7 @@ strLstExists(const StringList *const this, const String *const string)
|
||||
String *strLstInsert(StringList *this, unsigned int listIdx, const String *string);
|
||||
|
||||
// Get a string by index
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
strLstGet(const StringList *const this, const unsigned int listIdx)
|
||||
{
|
||||
return *(String **)lstGet((List *)this, listIdx);
|
||||
@ -109,7 +109,7 @@ strLstGet(const StringList *const this, const unsigned int listIdx)
|
||||
String *strLstJoinQuote(const StringList *this, const char *separator, const char *quote);
|
||||
|
||||
// Join a list of strings into a single string using the specified separator
|
||||
__attribute__((always_inline)) static inline String *
|
||||
FN_INLINE_ALWAYS String *
|
||||
strLstJoin(const StringList *const this, const char *const separator)
|
||||
{
|
||||
return strLstJoinQuote(this, separator, "");
|
||||
@ -120,7 +120,7 @@ strLstJoin(const StringList *const this, const char *const separator)
|
||||
StringList *strLstMergeAnti(const StringList *this, const StringList *anti);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline StringList *
|
||||
FN_INLINE_ALWAYS StringList *
|
||||
strLstMove(StringList *const this, MemContext *const parentNew)
|
||||
{
|
||||
return (StringList *)lstMove((List *)this, parentNew);
|
||||
@ -131,20 +131,20 @@ strLstMove(StringList *const this, MemContext *const parentNew)
|
||||
const char **strLstPtr(const StringList *this);
|
||||
|
||||
// Remove an item from the list
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
strLstRemove(StringList *const this, const String *const item)
|
||||
{
|
||||
return lstRemove((List *)this, &item);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline StringList *
|
||||
FN_INLINE_ALWAYS StringList *
|
||||
strLstRemoveIdx(StringList *const this, const unsigned int listIdx)
|
||||
{
|
||||
return (StringList *)lstRemoveIdx((List *)this, listIdx);
|
||||
}
|
||||
|
||||
// List sort
|
||||
__attribute__((always_inline)) static inline StringList *
|
||||
FN_INLINE_ALWAYS StringList *
|
||||
strLstSort(StringList *const this, const SortOrder sortOrder)
|
||||
{
|
||||
return (StringList *)lstSort((List *)this, sortOrder);
|
||||
@ -153,7 +153,7 @@ strLstSort(StringList *const this, const SortOrder sortOrder)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
strLstFree(StringList *const this)
|
||||
{
|
||||
lstFree((List *)this);
|
||||
|
@ -136,7 +136,7 @@ uint64_t varUInt64Force(const Variant *this);
|
||||
VariantList *varVarLst(const Variant *this);
|
||||
|
||||
// Variant type
|
||||
__attribute__((always_inline)) static inline VariantType
|
||||
FN_INLINE_ALWAYS VariantType
|
||||
varType(const Variant *const this)
|
||||
{
|
||||
return THIS_PUB(Variant)->type;
|
||||
@ -151,7 +151,7 @@ bool varEq(const Variant *this1, const Variant *this2);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
varFree(Variant *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -16,7 +16,7 @@ typedef struct VariantList VariantList;
|
||||
Constructors
|
||||
***********************************************************************************************************************************/
|
||||
// Create empty VariantList
|
||||
__attribute__((always_inline)) static inline VariantList *
|
||||
FN_INLINE_ALWAYS VariantList *
|
||||
varLstNew(void)
|
||||
{
|
||||
return (VariantList *)lstNewP(sizeof(Variant *));
|
||||
@ -32,14 +32,14 @@ VariantList *varLstDup(const VariantList *source);
|
||||
Getters/Setters
|
||||
***********************************************************************************************************************************/
|
||||
// List size
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
varLstSize(const VariantList *const this)
|
||||
{
|
||||
return lstSize((List *)this);
|
||||
}
|
||||
|
||||
// Is the list empty?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
varLstEmpty(const VariantList *const this)
|
||||
{
|
||||
return varLstSize(this) == 0;
|
||||
@ -49,7 +49,7 @@ varLstEmpty(const VariantList *const this)
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Add to list
|
||||
__attribute__((always_inline)) static inline VariantList *
|
||||
FN_INLINE_ALWAYS VariantList *
|
||||
varLstAdd(VariantList *const this, Variant *const data)
|
||||
{
|
||||
lstAdd((List *)this, &data);
|
||||
@ -57,14 +57,14 @@ varLstAdd(VariantList *const this, Variant *const data)
|
||||
}
|
||||
|
||||
// Get by index
|
||||
__attribute__((always_inline)) static inline Variant *
|
||||
FN_INLINE_ALWAYS Variant *
|
||||
varLstGet(const VariantList *const this, const unsigned int listIdx)
|
||||
{
|
||||
return *(Variant **)lstGet((List *)this, listIdx);
|
||||
}
|
||||
|
||||
// Move to new parent mem context
|
||||
__attribute__((always_inline)) static inline VariantList *
|
||||
FN_INLINE_ALWAYS VariantList *
|
||||
varLstMove(VariantList *const this, MemContext *const parentNew)
|
||||
{
|
||||
return (VariantList *)lstMove((List *)this, parentNew);
|
||||
@ -73,7 +73,7 @@ varLstMove(VariantList *const this, MemContext *const parentNew)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
varLstFree(VariantList *const this)
|
||||
{
|
||||
lstFree((List *)this);
|
||||
|
@ -41,7 +41,7 @@ typedef struct XmlDocumentPub
|
||||
Buffer *xmlDocumentBuf(const XmlDocument *this);
|
||||
|
||||
// Root node
|
||||
__attribute__((always_inline)) static inline XmlNode *
|
||||
FN_INLINE_ALWAYS XmlNode *
|
||||
xmlDocumentRoot(const XmlDocument *const this)
|
||||
{
|
||||
return ((XmlDocumentPub *const)this)->root;
|
||||
@ -50,7 +50,7 @@ xmlDocumentRoot(const XmlDocument *const this)
|
||||
/***********************************************************************************************************************************
|
||||
Document Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
xmlDocumentFree(XmlDocument *const this)
|
||||
{
|
||||
objFree(this);
|
||||
@ -71,7 +71,7 @@ String *xmlNodeAttribute(const XmlNode *this, const String *name);
|
||||
// Node child (by name or index)
|
||||
XmlNode *xmlNodeChildN(const XmlNode *this, const String *name, unsigned int index, bool errorOnMissing);
|
||||
|
||||
__attribute__((always_inline)) static inline XmlNode *
|
||||
FN_INLINE_ALWAYS XmlNode *
|
||||
xmlNodeChild(const XmlNode *const this, const String *const name, const bool errorOnMissing)
|
||||
{
|
||||
return xmlNodeChildN(this, name, 0, errorOnMissing);
|
||||
@ -96,14 +96,14 @@ void xmlNodeFree(XmlNode *this);
|
||||
Node List Getters
|
||||
***********************************************************************************************************************************/
|
||||
// Get a node from the list
|
||||
__attribute__((always_inline)) static inline XmlNode *
|
||||
FN_INLINE_ALWAYS XmlNode *
|
||||
xmlNodeLstGet(const XmlNodeList *const this, const unsigned int listIdx)
|
||||
{
|
||||
return *(XmlNode **)lstGet((List *const)this, listIdx);
|
||||
}
|
||||
|
||||
// Node list size
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
xmlNodeLstSize(const XmlNodeList *const this)
|
||||
{
|
||||
return lstSize((List *const)this);
|
||||
@ -112,7 +112,7 @@ xmlNodeLstSize(const XmlNodeList *const this)
|
||||
/***********************************************************************************************************************************
|
||||
Node List Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
xmlNodeLstFree(XmlNodeList *const this)
|
||||
{
|
||||
lstFree((List *const)this);
|
||||
|
@ -26,7 +26,7 @@ typedef struct WaitPub
|
||||
} WaitPub;
|
||||
|
||||
// How much time is remaining? Recalculated each time waitMore() is called.
|
||||
__attribute__((always_inline)) static inline TimeMSec
|
||||
FN_INLINE_ALWAYS TimeMSec
|
||||
waitRemaining(const Wait *const this)
|
||||
{
|
||||
return THIS_PUB(Wait)->remainTime;
|
||||
@ -41,7 +41,7 @@ bool waitMore(Wait *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
waitFree(Wait *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -109,7 +109,7 @@ unsigned int cfgOptionIdxDefault(ConfigOption optionId);
|
||||
// Get boolean config option
|
||||
bool cfgOptionIdxBool(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
cfgOptionBool(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxBool(optionId, cfgOptionIdxDefault(optionId));
|
||||
@ -118,7 +118,7 @@ cfgOptionBool(const ConfigOption optionId)
|
||||
// Get int config option
|
||||
int cfgOptionIdxInt(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline int
|
||||
FN_INLINE_ALWAYS int
|
||||
cfgOptionInt(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxInt(optionId, cfgOptionIdxDefault(optionId));
|
||||
@ -127,7 +127,7 @@ cfgOptionInt(const ConfigOption optionId)
|
||||
// Get int64 config option
|
||||
int64_t cfgOptionIdxInt64(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline int64_t
|
||||
FN_INLINE_ALWAYS int64_t
|
||||
cfgOptionInt64(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxInt64(optionId, cfgOptionIdxDefault(optionId));
|
||||
@ -136,7 +136,7 @@ cfgOptionInt64(const ConfigOption optionId)
|
||||
// Get kv config option
|
||||
const KeyValue *cfgOptionIdxKv(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline const KeyValue *
|
||||
FN_INLINE_ALWAYS const KeyValue *
|
||||
cfgOptionKv(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxKv(optionId, cfgOptionIdxDefault(optionId));
|
||||
@ -144,7 +144,7 @@ cfgOptionKv(const ConfigOption optionId)
|
||||
|
||||
const KeyValue *cfgOptionIdxKvNull(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline const KeyValue *
|
||||
FN_INLINE_ALWAYS const KeyValue *
|
||||
cfgOptionKvNull(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxKvNull(optionId, cfgOptionIdxDefault(optionId));
|
||||
@ -153,7 +153,7 @@ cfgOptionKvNull(const ConfigOption optionId)
|
||||
// Get list config option
|
||||
const VariantList *cfgOptionIdxLst(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline const VariantList *
|
||||
FN_INLINE_ALWAYS const VariantList *
|
||||
cfgOptionLst(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxLst(optionId, cfgOptionIdxDefault(optionId));
|
||||
@ -162,7 +162,7 @@ cfgOptionLst(const ConfigOption optionId)
|
||||
// Get String config option
|
||||
const String *cfgOptionIdxStr(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
cfgOptionStr(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxStr(optionId, cfgOptionIdxDefault(optionId));
|
||||
@ -170,7 +170,7 @@ cfgOptionStr(const ConfigOption optionId)
|
||||
|
||||
const String *cfgOptionIdxStrNull(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
cfgOptionStrNull(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxStrNull(optionId, cfgOptionIdxDefault(optionId));
|
||||
@ -179,7 +179,7 @@ cfgOptionStrNull(const ConfigOption optionId)
|
||||
// Get StringId config option
|
||||
StringId cfgOptionIdxStrId(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline StringId
|
||||
FN_INLINE_ALWAYS StringId
|
||||
cfgOptionStrId(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxStrId(optionId, cfgOptionIdxDefault(optionId));
|
||||
@ -188,7 +188,7 @@ cfgOptionStrId(const ConfigOption optionId)
|
||||
// Get uint config option
|
||||
unsigned int cfgOptionIdxUInt(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
cfgOptionUInt(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxUInt(optionId, cfgOptionIdxDefault(optionId));
|
||||
@ -197,7 +197,7 @@ cfgOptionUInt(const ConfigOption optionId)
|
||||
// Get uint64 config option
|
||||
uint64_t cfgOptionIdxUInt64(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline uint64_t
|
||||
FN_INLINE_ALWAYS uint64_t
|
||||
cfgOptionUInt64(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxUInt64(optionId, cfgOptionIdxDefault(optionId));
|
||||
|
@ -123,7 +123,7 @@ unsigned int cfgOptionIdxTotal(ConfigOption optionId);
|
||||
// Get config option as a Variant
|
||||
Variant *cfgOptionIdxVar(ConfigOption optionId, unsigned int optionIdx);
|
||||
|
||||
__attribute__((always_inline)) static inline Variant *
|
||||
FN_INLINE_ALWAYS Variant *
|
||||
cfgOptionVar(const ConfigOption optionId)
|
||||
{
|
||||
return cfgOptionIdxVar(optionId, cfgOptionIdxDefault(optionId));
|
||||
|
20
src/db/db.h
20
src/db/db.h
@ -40,56 +40,56 @@ typedef struct DbPub
|
||||
} DbPub;
|
||||
|
||||
// Archive mode loaded from the archive_mode GUC
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
dbArchiveMode(const Db *const this)
|
||||
{
|
||||
return THIS_PUB(Db)->archiveMode;
|
||||
}
|
||||
|
||||
// Archive command loaded from the archive_command GUC
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
dbArchiveCommand(const Db *const this)
|
||||
{
|
||||
return THIS_PUB(Db)->archiveCommand;
|
||||
}
|
||||
|
||||
// Control data
|
||||
__attribute__((always_inline)) static inline PgControl
|
||||
FN_INLINE_ALWAYS PgControl
|
||||
dbPgControl(const Db *const this)
|
||||
{
|
||||
return THIS_PUB(Db)->pgControl;
|
||||
}
|
||||
|
||||
// Data path loaded from the data_directory GUC
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
dbPgDataPath(const Db *const this)
|
||||
{
|
||||
return THIS_PUB(Db)->pgDataPath;
|
||||
}
|
||||
|
||||
// Is the cluster a standby?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
dbIsStandby(const Db *const this)
|
||||
{
|
||||
return THIS_PUB(Db)->standby;
|
||||
}
|
||||
|
||||
// Version loaded from the server_version_num GUC
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
dbPgVersion(const Db *const this)
|
||||
{
|
||||
return THIS_PUB(Db)->pgVersion;
|
||||
}
|
||||
|
||||
// Checkpoint timeout loaded from the checkpoint_timeout GUC
|
||||
__attribute__((always_inline)) static inline TimeMSec
|
||||
FN_INLINE_ALWAYS TimeMSec
|
||||
dbCheckpointTimeout(const Db *const this)
|
||||
{
|
||||
return THIS_PUB(Db)->checkpointTimeout;
|
||||
}
|
||||
|
||||
// Database timeout from main/remote process
|
||||
__attribute__((always_inline)) static inline TimeMSec
|
||||
FN_INLINE_ALWAYS TimeMSec
|
||||
dbDbTimeout(const Db *const this)
|
||||
{
|
||||
return THIS_PUB(Db)->dbTimeout;
|
||||
@ -142,7 +142,7 @@ String *dbWalSwitch(Db *this);
|
||||
void dbClose(Db *this);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline Db *
|
||||
FN_INLINE_ALWAYS Db *
|
||||
dbMove(Db *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -151,7 +151,7 @@ dbMove(Db *const this, MemContext *const parentNew)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
dbFree(Db *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -50,7 +50,7 @@ typedef struct InfoPub
|
||||
} InfoPub;
|
||||
|
||||
// Cipher passphrase if set
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
infoCipherPass(const Info *const this)
|
||||
{
|
||||
return THIS_PUB(Info)->cipherPass;
|
||||
@ -59,7 +59,7 @@ infoCipherPass(const Info *const this)
|
||||
void infoCipherPassSet(Info *this, const String *cipherPass);
|
||||
|
||||
// pgBackRest version
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
infoBackrestVersion(const Info *const this)
|
||||
{
|
||||
return THIS_PUB(Info)->backrestVersion;
|
||||
|
@ -44,7 +44,7 @@ typedef struct InfoArchivePub
|
||||
} InfoArchivePub;
|
||||
|
||||
// PostgreSQL info
|
||||
__attribute__((always_inline)) static inline InfoPg *
|
||||
FN_INLINE_ALWAYS InfoPg *
|
||||
infoArchivePg(const InfoArchive *const this)
|
||||
{
|
||||
return THIS_PUB(InfoArchive)->infoPg;
|
||||
@ -53,14 +53,14 @@ infoArchivePg(const InfoArchive *const this)
|
||||
InfoArchive *infoArchivePgSet(InfoArchive *this, unsigned int pgVersion, uint64_t pgSystemId);
|
||||
|
||||
// Current archive id
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
infoArchiveId(const InfoArchive *const this)
|
||||
{
|
||||
return infoPgArchiveId(infoArchivePg(this), infoPgDataCurrentId(infoArchivePg(this)));
|
||||
}
|
||||
|
||||
// Cipher passphrase
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
infoArchiveCipherPass(const InfoArchive *const this)
|
||||
{
|
||||
return infoPgCipherPass(infoArchivePg(this));
|
||||
@ -74,7 +74,7 @@ const String *infoArchiveIdHistoryMatch(
|
||||
const InfoArchive *this, const unsigned int historyId, const unsigned int pgVersion, const uint64_t pgSystemId);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline InfoArchive *
|
||||
FN_INLINE_ALWAYS InfoArchive *
|
||||
infoArchiveMove(InfoArchive *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -83,7 +83,7 @@ infoArchiveMove(InfoArchive *const this, MemContext *const parentNew)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
infoArchiveFree(InfoArchive *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -90,7 +90,7 @@ typedef struct InfoBackupPub
|
||||
} InfoBackupPub;
|
||||
|
||||
// PostgreSQL info
|
||||
__attribute__((always_inline)) static inline InfoPg *
|
||||
FN_INLINE_ALWAYS InfoPg *
|
||||
infoBackupPg(const InfoBackup *const this)
|
||||
{
|
||||
return THIS_PUB(InfoBackup)->infoPg;
|
||||
@ -99,7 +99,7 @@ infoBackupPg(const InfoBackup *const this)
|
||||
InfoBackup *infoBackupPgSet(InfoBackup *this, unsigned int pgVersion, uint64_t pgSystemId, unsigned int pgCatalogVersion);
|
||||
|
||||
// Cipher passphrase
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
infoBackupCipherPass(const InfoBackup *const this)
|
||||
{
|
||||
return infoPgCipherPass(infoBackupPg(this));
|
||||
@ -109,7 +109,7 @@ infoBackupCipherPass(const InfoBackup *const this)
|
||||
InfoBackupData infoBackupData(const InfoBackup *this, unsigned int backupDataIdx);
|
||||
|
||||
// Does the specified backup label exist?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
infoBackupLabelExists(const InfoBackup *const this, const String *const backupLabel)
|
||||
{
|
||||
ASSERT_INLINE(backupLabel != NULL);
|
||||
@ -117,7 +117,7 @@ infoBackupLabelExists(const InfoBackup *const this, const String *const backupLa
|
||||
}
|
||||
|
||||
// Return a pointer to a structure from the current backup data given a label, else NULL
|
||||
__attribute__((always_inline)) static inline InfoBackupData *
|
||||
FN_INLINE_ALWAYS InfoBackupData *
|
||||
infoBackupDataByLabel(const InfoBackup *const this, const String *const backupLabel)
|
||||
{
|
||||
ASSERT_INLINE(infoBackupLabelExists(this, backupLabel));
|
||||
@ -125,7 +125,7 @@ infoBackupDataByLabel(const InfoBackup *const this, const String *const backupLa
|
||||
}
|
||||
|
||||
// Get total current backups
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
infoBackupDataTotal(const InfoBackup *const this)
|
||||
{
|
||||
return lstSize(THIS_PUB(InfoBackup)->backup);
|
||||
@ -150,7 +150,7 @@ StringList *infoBackupDataDependentList(const InfoBackup *this, const String *ba
|
||||
StringList *infoBackupDataLabelList(const InfoBackup *this, const String *expression);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline InfoBackup *
|
||||
FN_INLINE_ALWAYS InfoBackup *
|
||||
infoBackupMove(InfoBackup *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -159,7 +159,7 @@ infoBackupMove(InfoBackup *const this, MemContext *const parentNew)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
infoBackupFree(InfoBackup *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -62,14 +62,14 @@ typedef struct InfoPgPub
|
||||
String *infoPgArchiveId(const InfoPg *this, unsigned int pgDataIdx);
|
||||
|
||||
// Base info
|
||||
__attribute__((always_inline)) static inline Info *
|
||||
FN_INLINE_ALWAYS Info *
|
||||
infoPgInfo(const InfoPg *const this)
|
||||
{
|
||||
return THIS_PUB(InfoPg)->info;
|
||||
}
|
||||
|
||||
// Return the cipher passphrase
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
infoPgCipherPass(const InfoPg *const this)
|
||||
{
|
||||
return infoCipherPass(infoPgInfo(this));
|
||||
@ -88,7 +88,7 @@ InfoPgData infoPgDataCurrent(const InfoPg *this);
|
||||
unsigned int infoPgDataCurrentId(const InfoPg *this);
|
||||
|
||||
// Total PostgreSQL data in the history
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
infoPgDataTotal(const InfoPg *const this)
|
||||
{
|
||||
return lstSize(THIS_PUB(InfoPg)->history);
|
||||
|
@ -182,20 +182,20 @@ typedef struct ManifestPub
|
||||
} ManifestPub;
|
||||
|
||||
// Get/set the cipher subpassphrase
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
manifestCipherSubPass(const Manifest *const this)
|
||||
{
|
||||
return infoCipherPass(THIS_PUB(Manifest)->info);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
manifestCipherSubPassSet(Manifest *const this, const String *const cipherSubPass)
|
||||
{
|
||||
infoCipherPassSet(THIS_PUB(Manifest)->info, cipherSubPass);
|
||||
}
|
||||
|
||||
// Get manifest configuration and options
|
||||
__attribute__((always_inline)) static inline const ManifestData *
|
||||
FN_INLINE_ALWAYS const ManifestData *
|
||||
manifestData(const Manifest *const this)
|
||||
{
|
||||
return &(THIS_PUB(Manifest)->data);
|
||||
@ -228,7 +228,7 @@ Functions
|
||||
void manifestLinkCheck(const Manifest *this);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline Manifest *
|
||||
FN_INLINE_ALWAYS Manifest *
|
||||
manifestMove(Manifest *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -243,7 +243,7 @@ void manifestValidate(Manifest *this, bool strict);
|
||||
/***********************************************************************************************************************************
|
||||
Db functions and getters/setters
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline const ManifestDb *
|
||||
FN_INLINE_ALWAYS const ManifestDb *
|
||||
manifestDb(const Manifest *const this, const unsigned int dbIdx)
|
||||
{
|
||||
return lstGet(THIS_PUB(Manifest)->dbList, dbIdx);
|
||||
@ -252,14 +252,14 @@ manifestDb(const Manifest *const this, const unsigned int dbIdx)
|
||||
const ManifestDb *manifestDbFind(const Manifest *this, const String *name);
|
||||
|
||||
// If the database requested is not found in the list, return the default passed rather than throw an error
|
||||
__attribute__((always_inline)) static inline const ManifestDb *
|
||||
FN_INLINE_ALWAYS const ManifestDb *
|
||||
manifestDbFindDefault(const Manifest *const this, const String *const name, const ManifestDb *const dbDefault)
|
||||
{
|
||||
ASSERT_INLINE(name != NULL);
|
||||
return lstFindDefault(THIS_PUB(Manifest)->dbList, &name, (void *)dbDefault);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
manifestDbTotal(const Manifest *const this)
|
||||
{
|
||||
return lstSize(THIS_PUB(Manifest)->dbList);
|
||||
@ -274,21 +274,21 @@ typedef struct ManifestFilePack ManifestFilePack;
|
||||
ManifestFile manifestFileUnpack(const Manifest *manifest, const ManifestFilePack *filePack);
|
||||
|
||||
// Get file in pack format by index
|
||||
__attribute__((always_inline)) static inline const ManifestFilePack *
|
||||
FN_INLINE_ALWAYS const ManifestFilePack *
|
||||
manifestFilePackGet(const Manifest *const this, const unsigned int fileIdx)
|
||||
{
|
||||
return *(ManifestFilePack **)lstGet(THIS_PUB(Manifest)->fileList, fileIdx);
|
||||
}
|
||||
|
||||
// Get file name
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
manifestFileNameGet(const Manifest *const this, const unsigned int fileIdx)
|
||||
{
|
||||
return (const String *)manifestFilePackGet(this, fileIdx);
|
||||
}
|
||||
|
||||
// Get file by index
|
||||
__attribute__((always_inline)) static inline ManifestFile
|
||||
FN_INLINE_ALWAYS ManifestFile
|
||||
manifestFile(const Manifest *const this, const unsigned int fileIdx)
|
||||
{
|
||||
return manifestFileUnpack(this, manifestFilePackGet(this, fileIdx));
|
||||
@ -301,7 +301,7 @@ void manifestFileAdd(Manifest *this, ManifestFile *file);
|
||||
const ManifestFilePack *manifestFilePackFind(const Manifest *this, const String *name);
|
||||
|
||||
// Find file by name
|
||||
__attribute__((always_inline)) static inline ManifestFile
|
||||
FN_INLINE_ALWAYS ManifestFile
|
||||
manifestFileFind(const Manifest *const this, const String *const name)
|
||||
{
|
||||
ASSERT_INLINE(name != NULL);
|
||||
@ -309,7 +309,7 @@ manifestFileFind(const Manifest *const this, const String *const name)
|
||||
}
|
||||
|
||||
// Does the file exist?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
manifestFileExists(const Manifest *const this, const String *const name)
|
||||
{
|
||||
ASSERT_INLINE(name != NULL);
|
||||
@ -318,7 +318,7 @@ manifestFileExists(const Manifest *const this, const String *const name)
|
||||
|
||||
void manifestFileRemove(const Manifest *this, const String *name);
|
||||
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
manifestFileTotal(const Manifest *const this)
|
||||
{
|
||||
return lstSize(THIS_PUB(Manifest)->fileList);
|
||||
@ -332,7 +332,7 @@ void manifestFileUpdate(
|
||||
/***********************************************************************************************************************************
|
||||
Link functions and getters/setters
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline const ManifestLink *
|
||||
FN_INLINE_ALWAYS const ManifestLink *
|
||||
manifestLink(const Manifest *const this, const unsigned int linkIdx)
|
||||
{
|
||||
return lstGet(THIS_PUB(Manifest)->linkList, linkIdx);
|
||||
@ -342,7 +342,7 @@ void manifestLinkAdd(Manifest *this, const ManifestLink *link);
|
||||
const ManifestLink *manifestLinkFind(const Manifest *this, const String *name);
|
||||
|
||||
// If the link requested is not found in the list, return the default passed rather than throw an error
|
||||
__attribute__((always_inline)) static inline const ManifestLink *
|
||||
FN_INLINE_ALWAYS const ManifestLink *
|
||||
manifestLinkFindDefault(const Manifest *const this, const String *const name, const ManifestLink *const linkDefault)
|
||||
{
|
||||
ASSERT_INLINE(name != NULL);
|
||||
@ -351,7 +351,7 @@ manifestLinkFindDefault(const Manifest *const this, const String *const name, co
|
||||
|
||||
void manifestLinkRemove(const Manifest *this, const String *name);
|
||||
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
manifestLinkTotal(const Manifest *const this)
|
||||
{
|
||||
return lstSize(THIS_PUB(Manifest)->linkList);
|
||||
@ -362,7 +362,7 @@ void manifestLinkUpdate(const Manifest *this, const String *name, const String *
|
||||
/***********************************************************************************************************************************
|
||||
Path functions and getters/setters
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline const ManifestPath *
|
||||
FN_INLINE_ALWAYS const ManifestPath *
|
||||
manifestPath(const Manifest *const this, const unsigned int pathIdx)
|
||||
{
|
||||
return lstGet(THIS_PUB(Manifest)->pathList, pathIdx);
|
||||
@ -371,7 +371,7 @@ manifestPath(const Manifest *const this, const unsigned int pathIdx)
|
||||
const ManifestPath *manifestPathFind(const Manifest *this, const String *name);
|
||||
|
||||
// If the path requested is not found in the list, return the default passed rather than throw an error
|
||||
__attribute__((always_inline)) static inline const ManifestPath *
|
||||
FN_INLINE_ALWAYS const ManifestPath *
|
||||
manifestPathFindDefault(const Manifest *const this, const String *const name, const ManifestPath *const pathDefault)
|
||||
{
|
||||
ASSERT_INLINE(name != NULL);
|
||||
@ -381,7 +381,7 @@ manifestPathFindDefault(const Manifest *const this, const String *const name, co
|
||||
// Data directory relative path for any manifest file/link/path/target name
|
||||
String *manifestPathPg(const String *manifestPath);
|
||||
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
manifestPathTotal(const Manifest *const this)
|
||||
{
|
||||
return lstSize(THIS_PUB(Manifest)->pathList);
|
||||
@ -390,7 +390,7 @@ manifestPathTotal(const Manifest *const this)
|
||||
/***********************************************************************************************************************************
|
||||
Target functions and getters/setters
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline const ManifestTarget *
|
||||
FN_INLINE_ALWAYS const ManifestTarget *
|
||||
manifestTarget(const Manifest *const this, const unsigned int targetIdx)
|
||||
{
|
||||
return lstGet(THIS_PUB(Manifest)->targetList, targetIdx);
|
||||
@ -400,7 +400,7 @@ void manifestTargetAdd(Manifest *this, const ManifestTarget *target);
|
||||
const ManifestTarget *manifestTargetFind(const Manifest *this, const String *name);
|
||||
|
||||
// If the target requested is not found in the list, return the default passed rather than throw an error
|
||||
__attribute__((always_inline)) static inline const ManifestTarget *
|
||||
FN_INLINE_ALWAYS const ManifestTarget *
|
||||
manifestTargetFindDefault(const Manifest *const this, const String *const name, const ManifestTarget *const targetDefault)
|
||||
{
|
||||
ASSERT_INLINE(name != NULL);
|
||||
@ -408,7 +408,7 @@ manifestTargetFindDefault(const Manifest *const this, const String *const name,
|
||||
}
|
||||
|
||||
// Base target, i.e. the target that is the data directory
|
||||
__attribute__((always_inline)) static inline const ManifestTarget *
|
||||
FN_INLINE_ALWAYS const ManifestTarget *
|
||||
manifestTargetBase(const Manifest *const this)
|
||||
{
|
||||
return manifestTargetFind(this, MANIFEST_TARGET_PGDATA_STR);
|
||||
@ -419,7 +419,7 @@ String *manifestTargetPath(const Manifest *this, const ManifestTarget *target);
|
||||
|
||||
void manifestTargetRemove(const Manifest *this, const String *name);
|
||||
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
manifestTargetTotal(const Manifest *const this)
|
||||
{
|
||||
return lstSize(THIS_PUB(Manifest)->targetList);
|
||||
@ -430,7 +430,7 @@ void manifestTargetUpdate(const Manifest *this, const String *name, const String
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
manifestFree(Manifest *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -48,35 +48,35 @@ typedef struct PgClientPub
|
||||
} PgClientPub;
|
||||
|
||||
// Pg host
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
pgClientHost(const PgClient *const this)
|
||||
{
|
||||
return THIS_PUB(PgClient)->host;
|
||||
}
|
||||
|
||||
// Pg port
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
pgClientPort(const PgClient *const this)
|
||||
{
|
||||
return THIS_PUB(PgClient)->port;
|
||||
}
|
||||
|
||||
// Pg database
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
pgClientDatabase(const PgClient *const this)
|
||||
{
|
||||
return THIS_PUB(PgClient)->database;
|
||||
}
|
||||
|
||||
// Pg user
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
pgClientUser(const PgClient *const this)
|
||||
{
|
||||
return THIS_PUB(PgClient)->user;
|
||||
}
|
||||
|
||||
// Timeout for statements/queries
|
||||
__attribute__((always_inline)) static inline TimeMSec
|
||||
FN_INLINE_ALWAYS TimeMSec
|
||||
pgClientTimeout(const PgClient *const this)
|
||||
{
|
||||
return THIS_PUB(PgClient)->timeout;
|
||||
@ -89,7 +89,7 @@ Functions
|
||||
PgClient *pgClientOpen(PgClient *this);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline PgClient *
|
||||
FN_INLINE_ALWAYS PgClient *
|
||||
pgClientMove(PgClient *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -104,7 +104,7 @@ void pgClientClose(PgClient *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
pgClientFree(PgClient *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -50,7 +50,7 @@ be added to the expected binary size to account for overhead.
|
||||
#define PROTOCOL_PACK_DEFAULT_SIZE 1024
|
||||
|
||||
// Pack large enough for standard data. Note that the buffer will automatically resize when required.
|
||||
__attribute__((always_inline)) static inline PackWrite *
|
||||
FN_INLINE_ALWAYS PackWrite *
|
||||
protocolPackNew(void)
|
||||
{
|
||||
return pckWriteNewP(.size = PROTOCOL_PACK_DEFAULT_SIZE);
|
||||
@ -70,7 +70,7 @@ typedef struct ProtocolClientPub
|
||||
} ProtocolClientPub;
|
||||
|
||||
// Read file descriptor
|
||||
__attribute__((always_inline)) static inline int
|
||||
FN_INLINE_ALWAYS int
|
||||
protocolClientIoReadFd(ProtocolClient *const this)
|
||||
{
|
||||
return ioReadFd(THIS_PUB(ProtocolClient)->read);
|
||||
@ -83,14 +83,14 @@ Functions
|
||||
PackRead *protocolClientExecute(ProtocolClient *this, ProtocolCommand *command, bool resultRequired);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline ProtocolClient *
|
||||
FN_INLINE_ALWAYS ProtocolClient *
|
||||
protocolClientMove(ProtocolClient *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
}
|
||||
|
||||
// Do not send exit command to the server when the client is freed
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
protocolClientNoExit(ProtocolClient *const this)
|
||||
{
|
||||
memContextCallbackClear(objMemContext(this));
|
||||
@ -112,7 +112,7 @@ void protocolClientDataPut(ProtocolClient *this, PackWrite *data);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
protocolClientFree(ProtocolClient *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -22,7 +22,7 @@ Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Move to a new parent mem context
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline ProtocolCommand *
|
||||
FN_INLINE_ALWAYS ProtocolCommand *
|
||||
protocolCommandMove(ProtocolCommand *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -37,7 +37,7 @@ void protocolCommandPut(ProtocolCommand *this, IoWrite *write);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
protocolCommandFree(ProtocolCommand *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -48,7 +48,7 @@ unsigned int protocolParallelProcess(ProtocolParallel *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
protocolParallelFree(ProtocolParallel *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -46,20 +46,20 @@ typedef struct ProtocolParallelJobPub
|
||||
} ProtocolParallelJobPub;
|
||||
|
||||
// Job command
|
||||
__attribute__((always_inline)) static inline ProtocolCommand *
|
||||
FN_INLINE_ALWAYS ProtocolCommand *
|
||||
protocolParallelJobCommand(const ProtocolParallelJob *const this)
|
||||
{
|
||||
return THIS_PUB(ProtocolParallelJob)->command;
|
||||
}
|
||||
|
||||
// Job error
|
||||
__attribute__((always_inline)) static inline int
|
||||
FN_INLINE_ALWAYS int
|
||||
protocolParallelJobErrorCode(const ProtocolParallelJob *const this)
|
||||
{
|
||||
return THIS_PUB(ProtocolParallelJob)->code;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
protocolParallelJobErrorMessage(const ProtocolParallelJob *const this)
|
||||
{
|
||||
return THIS_PUB(ProtocolParallelJob)->message;
|
||||
@ -68,14 +68,14 @@ protocolParallelJobErrorMessage(const ProtocolParallelJob *const this)
|
||||
void protocolParallelJobErrorSet(ProtocolParallelJob *this, int code, const String *message);
|
||||
|
||||
// Job key
|
||||
__attribute__((always_inline)) static inline const Variant *
|
||||
FN_INLINE_ALWAYS const Variant *
|
||||
protocolParallelJobKey(const ProtocolParallelJob *const this)
|
||||
{
|
||||
return THIS_PUB(ProtocolParallelJob)->key;
|
||||
}
|
||||
|
||||
// Process Id
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
protocolParallelJobProcessId(const ProtocolParallelJob *const this)
|
||||
{
|
||||
return THIS_PUB(ProtocolParallelJob)->processId;
|
||||
@ -84,7 +84,7 @@ protocolParallelJobProcessId(const ProtocolParallelJob *const this)
|
||||
void protocolParallelJobProcessIdSet(ProtocolParallelJob *this, unsigned int processId);
|
||||
|
||||
// Job result
|
||||
__attribute__((always_inline)) static inline PackRead *
|
||||
FN_INLINE_ALWAYS PackRead *
|
||||
protocolParallelJobResult(const ProtocolParallelJob *const this)
|
||||
{
|
||||
return THIS_PUB(ProtocolParallelJob)->result;
|
||||
@ -93,7 +93,7 @@ protocolParallelJobResult(const ProtocolParallelJob *const this)
|
||||
void protocolParallelJobResultSet(ProtocolParallelJob *const this, PackRead *const result);
|
||||
|
||||
// Job state
|
||||
__attribute__((always_inline)) static inline ProtocolParallelJobState
|
||||
FN_INLINE_ALWAYS ProtocolParallelJobState
|
||||
protocolParallelJobState(const ProtocolParallelJob *const this)
|
||||
{
|
||||
return THIS_PUB(ProtocolParallelJob)->state;
|
||||
@ -105,7 +105,7 @@ void protocolParallelJobStateSet(ProtocolParallelJob *this, ProtocolParallelJobS
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Move to new parent mem context
|
||||
__attribute__((always_inline)) static inline ProtocolParallelJob *
|
||||
FN_INLINE_ALWAYS ProtocolParallelJob *
|
||||
protocolParallelJobMove(ProtocolParallelJob *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -114,7 +114,7 @@ protocolParallelJobMove(ProtocolParallelJob *const this, MemContext *const paren
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
protocolParallelJobFree(ProtocolParallelJob *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -66,7 +66,7 @@ void protocolServerProcess(
|
||||
const unsigned int handlerListSize);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline ProtocolServer *
|
||||
FN_INLINE_ALWAYS ProtocolServer *
|
||||
protocolServerMove(ProtocolServer *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -75,7 +75,7 @@ protocolServerMove(ProtocolServer *const this, MemContext *const parentNew)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
protocolServerFree(ProtocolServer *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -26,7 +26,7 @@ Functions
|
||||
bool storageItrMore(StorageIterator *this);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline StorageIterator *
|
||||
FN_INLINE_ALWAYS StorageIterator *
|
||||
storageItrMove(StorageIterator *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -39,7 +39,7 @@ StorageInfo storageItrNext(StorageIterator *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
storageItrFree(StorageIterator *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -27,28 +27,28 @@ typedef struct StorageListPub
|
||||
} StorageListPub;
|
||||
|
||||
// Empty?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
storageLstEmpty(const StorageList *const this)
|
||||
{
|
||||
return lstEmpty(THIS_PUB(StorageList)->list);
|
||||
}
|
||||
|
||||
// Storage info level
|
||||
__attribute__((always_inline)) static inline StorageInfoLevel
|
||||
FN_INLINE_ALWAYS StorageInfoLevel
|
||||
storageLstLevel(const StorageList *const this)
|
||||
{
|
||||
return THIS_PUB(StorageList)->level;
|
||||
}
|
||||
|
||||
// List size
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
storageLstSize(const StorageList *const this)
|
||||
{
|
||||
return lstSize(THIS_PUB(StorageList)->list);
|
||||
}
|
||||
|
||||
// List size
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
storageLstSort(StorageList *const this, const SortOrder sortOrder)
|
||||
{
|
||||
lstSort(THIS_PUB(StorageList)->list, sortOrder);
|
||||
@ -61,7 +61,7 @@ Functions
|
||||
void storageLstInsert(StorageList *this, unsigned int idx, const StorageInfo *info);
|
||||
|
||||
// Add info
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
storageLstAdd(StorageList *const this, const StorageInfo *const info)
|
||||
{
|
||||
storageLstInsert(this, storageLstSize(this), info);
|
||||
@ -71,7 +71,7 @@ storageLstAdd(StorageList *const this, const StorageInfo *const info)
|
||||
StorageInfo storageLstGet(StorageList *this, unsigned int idx);
|
||||
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline StorageList *
|
||||
FN_INLINE_ALWAYS StorageList *
|
||||
storageLstMove(StorageList *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMove(this, parentNew);
|
||||
@ -80,7 +80,7 @@ storageLstMove(StorageList *const this, MemContext *const parentNew)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
storageLstFree(StorageList *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -17,7 +17,7 @@ typedef struct StorageRead StorageRead;
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline StorageRead *
|
||||
FN_INLINE_ALWAYS StorageRead *
|
||||
storageReadMove(StorageRead *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMoveContext(this, parentNew);
|
||||
@ -34,42 +34,42 @@ typedef struct StorageReadPub
|
||||
} StorageReadPub;
|
||||
|
||||
// Should a missing file be ignored?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
storageReadIgnoreMissing(const StorageRead *const this)
|
||||
{
|
||||
return THIS_PUB(StorageRead)->interface->ignoreMissing;
|
||||
}
|
||||
|
||||
// Read interface
|
||||
__attribute__((always_inline)) static inline IoRead *
|
||||
FN_INLINE_ALWAYS IoRead *
|
||||
storageReadIo(const StorageRead *const this)
|
||||
{
|
||||
return THIS_PUB(StorageRead)->io;
|
||||
}
|
||||
|
||||
// Is there a read limit? NULL for no limit.
|
||||
__attribute__((always_inline)) static inline const Variant *
|
||||
FN_INLINE_ALWAYS const Variant *
|
||||
storageReadLimit(const StorageRead *const this)
|
||||
{
|
||||
return THIS_PUB(StorageRead)->interface->limit;
|
||||
}
|
||||
|
||||
// File name
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
storageReadName(const StorageRead *const this)
|
||||
{
|
||||
return THIS_PUB(StorageRead)->interface->name;
|
||||
}
|
||||
|
||||
// Is there a read limit? NULL for no limit.
|
||||
__attribute__((always_inline)) static inline uint64_t
|
||||
FN_INLINE_ALWAYS uint64_t
|
||||
storageReadOffset(const StorageRead *const this)
|
||||
{
|
||||
return THIS_PUB(StorageRead)->interface->offset;
|
||||
}
|
||||
|
||||
// Get file type
|
||||
__attribute__((always_inline)) static inline StringId
|
||||
FN_INLINE_ALWAYS StringId
|
||||
storageReadType(const StorageRead *const this)
|
||||
{
|
||||
return THIS_PUB(StorageRead)->interface->type;
|
||||
@ -78,7 +78,7 @@ storageReadType(const StorageRead *const this)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
storageReadFree(StorageRead *const this)
|
||||
{
|
||||
objFreeContext(this);
|
||||
|
@ -245,14 +245,14 @@ void storageRemove(const Storage *this, const String *fileExp, StorageRemovePara
|
||||
Getters/Setters
|
||||
***********************************************************************************************************************************/
|
||||
// Is the feature supported by this storage?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
storageFeature(const Storage *const this, const StorageFeature feature)
|
||||
{
|
||||
return THIS_PUB(Storage)->interface.feature >> feature & 1;
|
||||
}
|
||||
|
||||
// Storage type (posix, cifs, etc.)
|
||||
__attribute__((always_inline)) static inline StringId
|
||||
FN_INLINE_ALWAYS StringId
|
||||
storageType(const Storage *const this)
|
||||
{
|
||||
return THIS_PUB(Storage)->type;
|
||||
|
@ -314,14 +314,14 @@ typedef struct StoragePub
|
||||
} StoragePub;
|
||||
|
||||
// Storage driver
|
||||
__attribute__((always_inline)) static inline void *
|
||||
FN_INLINE_ALWAYS void *
|
||||
storageDriver(const Storage *const this)
|
||||
{
|
||||
return THIS_PUB(Storage)->driver;
|
||||
}
|
||||
|
||||
// Storage interface
|
||||
__attribute__((always_inline)) static inline StorageInterface
|
||||
FN_INLINE_ALWAYS StorageInterface
|
||||
storageInterface(const Storage *const this)
|
||||
{
|
||||
return THIS_PUB(Storage)->interface;
|
||||
|
@ -20,7 +20,7 @@ typedef struct StorageWrite StorageWrite;
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
// Move to a new parent mem context
|
||||
__attribute__((always_inline)) static inline StorageWrite *
|
||||
FN_INLINE_ALWAYS StorageWrite *
|
||||
storageWriteMove(StorageWrite *const this, MemContext *const parentNew)
|
||||
{
|
||||
return objMoveContext(this, parentNew);
|
||||
@ -38,63 +38,63 @@ typedef struct StorageWritePub
|
||||
|
||||
// Will the file be written atomically? Atomic writes means the file will be complete or be missing. Filesystems have different ways
|
||||
// to accomplish this.
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
storageWriteAtomic(const StorageWrite *const this)
|
||||
{
|
||||
return THIS_PUB(StorageWrite)->interface->atomic;
|
||||
}
|
||||
|
||||
// Will the path be created if required?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
storageWriteCreatePath(const StorageWrite *const this)
|
||||
{
|
||||
return THIS_PUB(StorageWrite)->interface->createPath;
|
||||
}
|
||||
|
||||
// Write interface
|
||||
__attribute__((always_inline)) static inline IoWrite *
|
||||
FN_INLINE_ALWAYS IoWrite *
|
||||
storageWriteIo(const StorageWrite *const this)
|
||||
{
|
||||
return THIS_PUB(StorageWrite)->io;
|
||||
}
|
||||
|
||||
// File mode
|
||||
__attribute__((always_inline)) static inline mode_t
|
||||
FN_INLINE_ALWAYS mode_t
|
||||
storageWriteModeFile(const StorageWrite *const this)
|
||||
{
|
||||
return THIS_PUB(StorageWrite)->interface->modeFile;
|
||||
}
|
||||
|
||||
// Path mode (if the destination path needs to be create)
|
||||
__attribute__((always_inline)) static inline mode_t
|
||||
FN_INLINE_ALWAYS mode_t
|
||||
storageWriteModePath(const StorageWrite *const this)
|
||||
{
|
||||
return THIS_PUB(StorageWrite)->interface->modePath;
|
||||
}
|
||||
|
||||
// File name
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
storageWriteName(const StorageWrite *const this)
|
||||
{
|
||||
return THIS_PUB(StorageWrite)->interface->name;
|
||||
}
|
||||
|
||||
// Will the file be synced before it is closed?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
storageWriteSyncFile(const StorageWrite *const this)
|
||||
{
|
||||
return THIS_PUB(StorageWrite)->interface->syncFile;
|
||||
}
|
||||
|
||||
// Will the path be synced after the file is closed?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
storageWriteSyncPath(const StorageWrite *const this)
|
||||
{
|
||||
return THIS_PUB(StorageWrite)->interface->syncPath;
|
||||
}
|
||||
|
||||
// File type
|
||||
__attribute__((always_inline)) static inline StringId
|
||||
FN_INLINE_ALWAYS StringId
|
||||
storageWriteType(const StorageWrite *const this)
|
||||
{
|
||||
return THIS_PUB(StorageWrite)->interface->type;
|
||||
@ -103,7 +103,7 @@ storageWriteType(const StorageWrite *const this)
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
storageWriteFree(StorageWrite *const this)
|
||||
{
|
||||
objFreeContext(this);
|
||||
|
@ -47,42 +47,42 @@ typedef struct TestBuildPub
|
||||
} TestBuildPub;
|
||||
|
||||
// Repository path
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
testBldPathRepo(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->pathRepo;
|
||||
}
|
||||
|
||||
// Test path
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
testBldPathTest(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->pathTest;
|
||||
}
|
||||
|
||||
// Repository storage
|
||||
__attribute__((always_inline)) static inline const Storage *
|
||||
FN_INLINE_ALWAYS const Storage *
|
||||
testBldStorageRepo(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->storageRepo;
|
||||
}
|
||||
|
||||
// Test storage
|
||||
__attribute__((always_inline)) static inline const Storage *
|
||||
FN_INLINE_ALWAYS const Storage *
|
||||
testBldStorageTest(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->storageTest;
|
||||
}
|
||||
|
||||
// Vm
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
testBldVm(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->vm;
|
||||
}
|
||||
|
||||
// Vm id
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
testBldVmId(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->vmId;
|
||||
@ -90,63 +90,63 @@ testBldVmId(const TestBuild *const this)
|
||||
|
||||
|
||||
// Test Definition
|
||||
__attribute__((always_inline)) static inline const TestDefModule *
|
||||
FN_INLINE_ALWAYS const TestDefModule *
|
||||
testBldModule(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->module;
|
||||
}
|
||||
|
||||
// Specific test to run
|
||||
__attribute__((always_inline)) static inline unsigned int
|
||||
FN_INLINE_ALWAYS unsigned int
|
||||
testBldTest(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->test;
|
||||
}
|
||||
|
||||
// Log level
|
||||
__attribute__((always_inline)) static inline LogLevel
|
||||
FN_INLINE_ALWAYS LogLevel
|
||||
testBldLogLevel(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->logLevel;
|
||||
}
|
||||
|
||||
// Log time/timestamps
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
testBldLogTime(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->logTime;
|
||||
}
|
||||
|
||||
// Test in timezone
|
||||
__attribute__((always_inline)) static inline const String *
|
||||
FN_INLINE_ALWAYS const String *
|
||||
testBldTimeZone(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->timeZone;
|
||||
}
|
||||
|
||||
// Generate coverage?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
testBldCoverage(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->coverage;
|
||||
}
|
||||
|
||||
// Generate profile repo?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
testBldProfile(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->profile;
|
||||
}
|
||||
|
||||
// Optimize code?
|
||||
__attribute__((always_inline)) static inline bool
|
||||
FN_INLINE_ALWAYS bool
|
||||
testBldOptimize(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->optimize;
|
||||
}
|
||||
|
||||
// Scale
|
||||
__attribute__((always_inline)) static inline uint64_t
|
||||
FN_INLINE_ALWAYS uint64_t
|
||||
testBldScale(const TestBuild *const this)
|
||||
{
|
||||
return THIS_PUB(TestBuild)->scale;
|
||||
@ -160,7 +160,7 @@ void testBldUnit(TestBuild *this);
|
||||
/***********************************************************************************************************************************
|
||||
Destructor
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline void
|
||||
FN_INLINE_ALWAYS void
|
||||
testBuildFree(TestBuild *const this)
|
||||
{
|
||||
objFree(this);
|
||||
|
@ -199,7 +199,7 @@ hrnCfgArgKeyRawReset(StringList *argList, ConfigOption optionId, unsigned option
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline const char *
|
||||
FN_INLINE_ALWAYS const char *
|
||||
hrnCfgEnvName(const ConfigOption optionId, const unsigned optionKey)
|
||||
{
|
||||
return strZ(
|
||||
|
@ -67,7 +67,7 @@ unsigned int hrnPgCatalogVersion(unsigned int pgVersion);
|
||||
Buffer *hrnPgControlToBuffer(PgControl pgControl);
|
||||
|
||||
// Get system id by version
|
||||
__attribute__((always_inline)) static inline uint64_t
|
||||
FN_INLINE_ALWAYS uint64_t
|
||||
hrnPgSystemId(const unsigned int pgVersion)
|
||||
{
|
||||
return 10000000000000000000ULL + (uint64_t)pgVersion;
|
||||
|
Reference in New Issue
Block a user