Permalink
Browse files

Comply with C99 inline semantics

  • Loading branch information...
pp3345 committed Apr 14, 2017
1 parent ac06b1f commit 5da34b8f918363943927731e5cb599ded6058982
@@ -128,7 +128,7 @@ PANCAKE_API void PancakeAuthenticationRegisterBackend(PancakeAuthenticationBacke
HASH_ADD_KEYPTR(hh, PancakeAuthenticationBackends, backend->name.value, backend->name.length, backend);
}
PANCAKE_API inline UByte PancakeAuthenticate(PancakeAuthenticationConfiguration *config, void *data) {
PANCAKE_API extern inline UByte PancakeAuthenticate(PancakeAuthenticationConfiguration *config, void *data) {
return config->backend->authenticate(config, data);
}
@@ -40,6 +40,6 @@ extern PancakeAuthenticationConfiguration *PancakeAuthenticationActiveConfigurat
extern PancakeModule PancakeAuthenticationModule;
PANCAKE_API void PancakeAuthenticationRegisterBackend(PancakeAuthenticationBackend *backend);
PANCAKE_API inline UByte PancakeAuthenticate(PancakeAuthenticationConfiguration *config, void *data);
PANCAKE_API UByte PancakeAuthenticate(PancakeAuthenticationConfiguration *config, void *data);
#endif
View
@@ -537,6 +537,8 @@ static PancakeHTTPParserHook *parserHooks = NULL;
/* Forward declarations */
STATIC void PancakeHTTPInitializeConnection(PancakeSocket *sock);
STATIC void PancakeHTTPReadHeaderData(PancakeSocket *sock);
STATIC void PancakeHTTPInitializeRequestStructure(PancakeHTTPRequest *request);
STATIC void PancakeHTTPCleanRequestData(PancakeHTTPRequest *request);
PANCAKE_API void PancakeHTTPRegisterContentServeBackend(PancakeHTTPContentServeBackend *backend) {
LL_APPEND(contentBackends, backend);
@@ -1423,7 +1425,7 @@ PANCAKE_API void PancakeHTTPException(PancakeSocket *sock, UInt16 code) {
sock->onWrite = PancakeHTTPFullWriteBuffer;
}
PANCAKE_API inline UByte PancakeHTTPServeContent(PancakeSocket *sock, UByte ignoreException) {
PANCAKE_API extern inline UByte PancakeHTTPServeContent(PancakeSocket *sock, UByte ignoreException) {
UInt16 i;
PancakeHTTPRequest *request = (PancakeHTTPRequest*) sock->data;
@@ -1436,11 +1438,11 @@ PANCAKE_API inline UByte PancakeHTTPServeContent(PancakeSocket *sock, UByte igno
return 0;
}
PANCAKE_API inline void PancakeHTTPFreeContentEncoding(PancakeHTTPRequest *request) {
PANCAKE_API extern inline void PancakeHTTPFreeContentEncoding(PancakeHTTPRequest *request) {
PancakeFree(request->contentEncoding);
}
PANCAKE_API inline void PancakeHTTPOnRemoteHangup(PancakeSocket *sock) {
PANCAKE_API extern inline void PancakeHTTPOnRemoteHangup(PancakeSocket *sock) {
PancakeHTTPRequest *request = (PancakeHTTPRequest*) sock->data;
if(request != NULL) {
@@ -1461,31 +1463,31 @@ STATIC void PancakeHTTPOnKeepAliveRemoteHangup(PancakeSocket *sock) {
PancakeNetworkClose(sock);
}
PANCAKE_API inline void PancakeHTTPFullWriteBuffer(PancakeSocket *sock) {
PANCAKE_API extern inline void PancakeHTTPFullWriteBuffer(PancakeSocket *sock) {
PancakeNetworkWrite(sock);
if(!sock->writeBuffer.length) {
PancakeHTTPOnRequestEnd(sock);
}
}
PANCAKE_API inline void PancakeHTTPOnWrite(PancakeSocket *sock) {
PANCAKE_API extern inline void PancakeHTTPOnWrite(PancakeSocket *sock) {
PancakeNetworkWrite(sock);
if(!sock->writeBuffer.length) {
PancakeNetworkSetSocket(sock);
}
}
PANCAKE_API inline void PancakeHTTPRemoveQueryString(PancakeHTTPRequest *request) {
PANCAKE_API extern inline void PancakeHTTPRemoveQueryString(PancakeHTTPRequest *request) {
UByte *offset = memchr(request->path.value, '?', request->path.length);
if(offset) {
request->path.length = offset - request->path.value;
}
}
PANCAKE_API inline void PancakeHTTPExtractQueryString(PancakeHTTPRequest *request, String *queryString) {
PANCAKE_API extern inline void PancakeHTTPExtractQueryString(PancakeHTTPRequest *request, String *queryString) {
UByte *offset = memchr(request->path.value, '?', request->path.length);
if(offset) {
@@ -1649,7 +1651,7 @@ PANCAKE_API void PancakeHTTPSendChunk(PancakeSocket *sock, String *chunk) {
sock->writeBuffer.length = offset + 2 - sock->writeBuffer.value;
}
PANCAKE_API inline void PancakeHTTPSendLastChunk(PancakeSocket *sock) {
PANCAKE_API extern inline void PancakeHTTPSendLastChunk(PancakeSocket *sock) {
UByte *offset;
if(sock->writeBuffer.size < sock->writeBuffer.length + sizeof("0\r\n\r\n") - 1) {
@@ -1963,7 +1965,7 @@ PANCAKE_API void PancakeHTTPBuildAnswerHeaders(PancakeSocket *sock) {
PancakeFree(log.value);
}
PANCAKE_API inline void PancakeHTTPOnRequestEnd(PancakeSocket *sock) {
PANCAKE_API extern inline void PancakeHTTPOnRequestEnd(PancakeSocket *sock) {
PancakeHTTPRequest *request = (PancakeHTTPRequest*) sock->data;
if(request->onOutputEnd) {
View
@@ -154,19 +154,19 @@ PANCAKE_API void PancakeHTTPRegisterContentServeBackend(PancakeHTTPContentServeB
PANCAKE_API void PancakeHTTPRegisterOutputFilter(PancakeHTTPOutputFilter *filter);
PANCAKE_API void PancakeHTTPRegisterParserHook(PancakeHTTPParserHook *hook);
PANCAKE_API UByte PancakeHTTPRunAccessChecks(PancakeSocket *sock);
PANCAKE_API inline UByte PancakeHTTPServeContent(PancakeSocket *sock, UByte ignoreException);
PANCAKE_API UByte PancakeHTTPServeContent(PancakeSocket *sock, UByte ignoreException);
PANCAKE_API void PancakeHTTPException(PancakeSocket *sock, UInt16 code);
PANCAKE_API inline void PancakeHTTPOnRemoteHangup(PancakeSocket *sock);
PANCAKE_API inline void PancakeHTTPFullWriteBuffer(PancakeSocket *sock);
PANCAKE_API void PancakeHTTPOnRemoteHangup(PancakeSocket *sock);
PANCAKE_API void PancakeHTTPFullWriteBuffer(PancakeSocket *sock);
PANCAKE_API void PancakeHTTPOutput(PancakeSocket *sock, String *output);
PANCAKE_API void PancakeHTTPOutputChunk(PancakeSocket *sock, String *output);
PANCAKE_API void PancakeHTTPSendChunk(PancakeSocket *sock, String *chunk);
PANCAKE_API inline void PancakeHTTPSendLastChunk(PancakeSocket *sock);
PANCAKE_API void PancakeHTTPSendLastChunk(PancakeSocket *sock);
PANCAKE_API void PancakeHTTPBuildAnswerHeaders(PancakeSocket *sock);
PANCAKE_API inline void PancakeHTTPOnRequestEnd(PancakeSocket *sock);
PANCAKE_API inline void PancakeHTTPOnWrite(PancakeSocket *sock);
PANCAKE_API inline void PancakeHTTPRemoveQueryString(PancakeHTTPRequest *request);
PANCAKE_API inline void PancakeHTTPExtractQueryString(PancakeHTTPRequest *request, String *queryString);
PANCAKE_API inline void PancakeHTTPFreeContentEncoding(PancakeHTTPRequest *request);
PANCAKE_API void PancakeHTTPOnRequestEnd(PancakeSocket *sock);
PANCAKE_API void PancakeHTTPOnWrite(PancakeSocket *sock);
PANCAKE_API void PancakeHTTPRemoveQueryString(PancakeHTTPRequest *request);
PANCAKE_API void PancakeHTTPExtractQueryString(PancakeHTTPRequest *request, String *queryString);
PANCAKE_API void PancakeHTTPFreeContentEncoding(PancakeHTTPRequest *request);
#endif
@@ -12,6 +12,8 @@ STATIC UByte PancakeHTTPFastCGIServe();
STATIC void PancakeHTTPFastCGIOnRemoteHangup(PancakeSocket *sock);
STATIC void PancakeHTTPFastCGIOnRead(PancakeSocket *sock);
STATIC void PancakeHTTPFastCGIOnWrite(PancakeSocket *sock);
STATIC void FastCGIEncodeParameter(PancakeSocket *sock, String *name, String *value);
STATIC UByte FastCGIDecodeParameter(PancakeSocket *sock, UInt32 *noffset, String *name, String *value);
PancakeModule PancakeHTTPFastCGIModule = {
"HTTPFastCGI",
@@ -6,6 +6,7 @@
/* Forward declarations */
STATIC UByte PancakeHTTPServeStatic(PancakeSocket *sock);
STATIC UByte PancakeHTTPStaticInitialize();
STATIC void PancakeHTTPStaticOnRequestEnd(PancakeHTTPRequest *request);
PancakeModule PancakeHTTPStatic = {
"HTTPStatic",
@@ -11,19 +11,19 @@ STATIC UByte PancakeLinuxPollInitialize();
STATIC UByte PancakeLinuxPollShutdown();
STATIC UByte PancakeLinuxPollServerInitialize();
STATIC void PancakeLinuxPollWait();
STATIC inline void PancakeLinuxPollAddReadSocket(PancakeSocket *socket);
STATIC inline void PancakeLinuxPollAddWriteSocket(PancakeSocket *socket);
STATIC inline void PancakeLinuxPollAddReadWriteSocket(PancakeSocket *socket);
STATIC void PancakeLinuxPollAddReadSocket(PancakeSocket *socket);
STATIC void PancakeLinuxPollAddWriteSocket(PancakeSocket *socket);
STATIC void PancakeLinuxPollAddReadWriteSocket(PancakeSocket *socket);
STATIC inline void PancakeLinuxPollRemoveSocket(PancakeSocket *socket);
STATIC inline void PancakeLinuxPollRemoveReadSocket(PancakeSocket *socket);
STATIC inline void PancakeLinuxPollRemoveWriteSocket(PancakeSocket *socket);
STATIC void PancakeLinuxPollRemoveSocket(PancakeSocket *socket);
STATIC void PancakeLinuxPollRemoveReadSocket(PancakeSocket *socket);
STATIC void PancakeLinuxPollRemoveWriteSocket(PancakeSocket *socket);
STATIC inline void PancakeLinuxPollSetReadSocket(PancakeSocket *socket);
STATIC inline void PancakeLinuxPollSetWriteSocket(PancakeSocket *socket);
STATIC inline void PancakeLinuxPollSetSocket(PancakeSocket *socket);
STATIC void PancakeLinuxPollSetReadSocket(PancakeSocket *socket);
STATIC void PancakeLinuxPollSetWriteSocket(PancakeSocket *socket);
STATIC void PancakeLinuxPollSetSocket(PancakeSocket *socket);
STATIC inline void PancakeLinuxPollOnSocketClose(PancakeSocket *socket);
STATIC void PancakeLinuxPollOnSocketClose(PancakeSocket *socket);
static PancakeSocket *currentSocket = NULL;
View
@@ -462,7 +462,7 @@ PANCAKE_API PancakeConfigurationScope *PancakeConfigurationAddScope() {
return scope;
}
PANCAKE_API inline void PancakeConfigurationActivateScope(PancakeConfigurationScope *scope) {
PANCAKE_API extern inline void PancakeConfigurationActivateScope(PancakeConfigurationScope *scope) {
PancakeConfigurationScopeValue *value;
// Copy scope values into configuration structures
@@ -473,7 +473,7 @@ PANCAKE_API inline void PancakeConfigurationActivateScope(PancakeConfigurationSc
}
}
PANCAKE_API inline void PancakeConfigurationUnscope() {
PANCAKE_API extern inline void PancakeConfigurationUnscope() {
PancakeConfigurationScopeValue *value;
// Reset configuration by setting values from root scope
@@ -496,26 +496,26 @@ PANCAKE_API void PancakeConfigurationDestroyScope(PancakeConfigurationScope *sco
PancakeFree(scope);
}
PANCAKE_API inline void PancakeConfigurationInitializeScopeGroup(PancakeConfigurationScopeGroup *group) {
PANCAKE_API extern inline void PancakeConfigurationInitializeScopeGroup(PancakeConfigurationScopeGroup *group) {
group->scopes = NULL;
group->numScopes = 0;
}
PANCAKE_API inline void PancakeConfigurationScopeGroupAddScope(PancakeConfigurationScopeGroup *group, PancakeConfigurationScope *scope) {
PANCAKE_API extern inline void PancakeConfigurationScopeGroupAddScope(PancakeConfigurationScopeGroup *group, PancakeConfigurationScope *scope) {
group->numScopes++;
group->scopes = PancakeReallocate(group->scopes, sizeof(PancakeConfigurationScope*) * group->numScopes);
group->scopes[group->numScopes - 1] = scope;
}
PANCAKE_API inline void PancakeConfigurationActivateScopeGroup(PancakeConfigurationScopeGroup *group) {
PANCAKE_API extern inline void PancakeConfigurationActivateScopeGroup(PancakeConfigurationScopeGroup *group) {
UInt16 i;
for(i = 0; i < group->numScopes; i++) {
PancakeConfigurationActivateScope(group->scopes[i]);
}
}
PANCAKE_API inline void PancakeConfigurationDestroyScopeGroup(PancakeConfigurationScopeGroup *group) {
PANCAKE_API extern inline void PancakeConfigurationDestroyScopeGroup(PancakeConfigurationScopeGroup *group) {
if(group->scopes) {
PancakeFree(group->scopes);
}
View
@@ -98,14 +98,14 @@ PANCAKE_API PancakeConfigurationSetting *PancakeConfigurationLookupSetting(Panca
/* Configuration scoping API */
PANCAKE_API PancakeConfigurationScope *PancakeConfigurationAddScope();
PANCAKE_API inline void PancakeConfigurationActivateScope(PancakeConfigurationScope *scope);
PANCAKE_API inline void PancakeConfigurationUnscope();
PANCAKE_API void PancakeConfigurationActivateScope(PancakeConfigurationScope *scope);
PANCAKE_API void PancakeConfigurationUnscope();
PANCAKE_API void PancakeConfigurationDestroyScope(PancakeConfigurationScope *scope);
PANCAKE_API inline void PancakeConfigurationInitializeScopeGroup(PancakeConfigurationScopeGroup *group);
PANCAKE_API inline void PancakeConfigurationScopeGroupAddScope(PancakeConfigurationScopeGroup *group, PancakeConfigurationScope *scope);
PANCAKE_API inline void PancakeConfigurationActivateScopeGroup(PancakeConfigurationScopeGroup *group);
PANCAKE_API inline void PancakeConfigurationDestroyScopeGroup(PancakeConfigurationScopeGroup *group);
PANCAKE_API void PancakeConfigurationInitializeScopeGroup(PancakeConfigurationScopeGroup *group);
PANCAKE_API void PancakeConfigurationScopeGroupAddScope(PancakeConfigurationScopeGroup *group, PancakeConfigurationScope *scope);
PANCAKE_API void PancakeConfigurationActivateScopeGroup(PancakeConfigurationScopeGroup *group);
PANCAKE_API void PancakeConfigurationDestroyScopeGroup(PancakeConfigurationScopeGroup *group);
/* Initialization functions */
void PancakeConfigurationInitialize();
View
@@ -604,15 +604,15 @@ PANCAKE_API inline PancakeSocket *PancakeNetworkAcceptConnection(PancakeSocket *
return client;
}
PANCAKE_API inline void PancakeNetworkCacheConnection(PancakeNetworkConnectionCache **cache, PancakeSocket *socket) {
PANCAKE_API extern inline void PancakeNetworkCacheConnection(PancakeNetworkConnectionCache **cache, PancakeSocket *socket) {
PancakeNetworkConnectionCache *connection = PancakeAllocate(sizeof(PancakeNetworkConnectionCache));
connection->socket = socket;
// Prepend to prevent iteration through long cache lists
LL_PREPEND((*cache), connection);
}
PANCAKE_API inline void PancakeNetworkUncacheConnection(PancakeNetworkConnectionCache **cache, PancakeSocket *sock) {
PANCAKE_API extern inline void PancakeNetworkUncacheConnection(PancakeNetworkConnectionCache **cache, PancakeSocket *sock) {
PancakeNetworkConnectionCache *connection = NULL;
LL_SEARCH_SCALAR(*cache, connection, socket, sock);
@@ -623,7 +623,7 @@ PANCAKE_API inline void PancakeNetworkUncacheConnection(PancakeNetworkConnection
}
}
PANCAKE_API inline PancakeSocket *PancakeNetworkConnect(struct sockaddr *addr, PancakeNetworkConnectionCache **cache, UByte cachePolicy) {
PANCAKE_API extern inline PancakeSocket *PancakeNetworkConnect(struct sockaddr *addr, PancakeNetworkConnectionCache **cache, UByte cachePolicy) {
Int32 fd, flags, structSize;
PancakeSocket *remote;
@@ -693,7 +693,7 @@ PANCAKE_API inline PancakeSocket *PancakeNetworkConnect(struct sockaddr *addr, P
return remote;
}
PANCAKE_API inline Int32 PancakeNetworkRead(PancakeSocket *sock, UInt32 maxLength) {
PANCAKE_API extern inline Int32 PancakeNetworkRead(PancakeSocket *sock, UInt32 maxLength) {
UByte buf[maxLength];
Int32 length;
@@ -738,7 +738,7 @@ PANCAKE_API inline Int32 PancakeNetworkRead(PancakeSocket *sock, UInt32 maxLengt
return length;
}
PANCAKE_API inline Int32 PancakeNetworkWrite(PancakeSocket *sock) {
PANCAKE_API extern inline Int32 PancakeNetworkWrite(PancakeSocket *sock) {
Int32 length;
if(sock->layer && EXPECTED(sock->layer->write != NULL)) {
@@ -781,7 +781,7 @@ PANCAKE_API inline Int32 PancakeNetworkWrite(PancakeSocket *sock) {
return length;
}
PANCAKE_API inline void PancakeNetworkClose(PancakeSocket *sock) {
PANCAKE_API extern inline void PancakeNetworkClose(PancakeSocket *sock) {
// Tell server architecture we're closing the socket
PancakeMainConfiguration.serverArchitecture->onSocketClose(sock);
View
@@ -107,15 +107,15 @@ PANCAKE_API void PancakeNetworkClientInterfaceConfiguration(PancakeNetworkClient
PANCAKE_API Byte *PancakeNetworkGetInterfaceName(struct sockaddr *addr);
PANCAKE_API void PancakeNetworkReplaceListenSocket(PancakeSocket *previous, PancakeSocket *new);
PANCAKE_API inline PancakeSocket *PancakeNetworkAcceptConnection(PancakeSocket *sock);
PANCAKE_API inline PancakeSocket *PancakeNetworkConnect(struct sockaddr *addr, PancakeNetworkConnectionCache **cache, UByte cachePolicy);
PANCAKE_API inline Int32 PancakeNetworkRead(PancakeSocket *sock, UInt32 maxLength);
PANCAKE_API inline Int32 PancakeNetworkWrite(PancakeSocket *sock);
PANCAKE_API inline void PancakeNetworkClose(PancakeSocket *sock);
PANCAKE_API PancakeSocket *PancakeNetworkAcceptConnection(PancakeSocket *sock);
PANCAKE_API PancakeSocket *PancakeNetworkConnect(struct sockaddr *addr, PancakeNetworkConnectionCache **cache, UByte cachePolicy);
PANCAKE_API Int32 PancakeNetworkRead(PancakeSocket *sock, UInt32 maxLength);
PANCAKE_API Int32 PancakeNetworkWrite(PancakeSocket *sock);
PANCAKE_API void PancakeNetworkClose(PancakeSocket *sock);
PANCAKE_API void PancakeNetworkActivateListenSockets();
PANCAKE_API inline void PancakeNetworkCacheConnection(PancakeNetworkConnectionCache **cache, PancakeSocket *socket);
PANCAKE_API inline void PancakeNetworkUncacheConnection(PancakeNetworkConnectionCache **cache, PancakeSocket *sock);
PANCAKE_API void PancakeNetworkCacheConnection(PancakeNetworkConnectionCache **cache, PancakeSocket *socket);
PANCAKE_API void PancakeNetworkUncacheConnection(PancakeNetworkConnectionCache **cache, PancakeSocket *sock);
PANCAKE_API void PancakeNetworkRegisterNetworkLayer(PancakeNetworkLayer *layer);
View
@@ -66,20 +66,20 @@ PANCAKE_API PancakeSchedulerEvent *PancakeSchedule(UNative time, PancakeSchedule
return event;
}
PANCAKE_API inline void PancakeUnschedule(PancakeSchedulerEvent *event) {
PANCAKE_API extern inline void PancakeUnschedule(PancakeSchedulerEvent *event) {
CDL_DELETE(events, event);
CDL_PREPEND(unusedEvents, event);
}
PANCAKE_API inline UNative PancakeSchedulerGetNextExecutionTime() {
PANCAKE_API extern inline UNative PancakeSchedulerGetNextExecutionTime() {
if(!events) {
return time(NULL) + 86400;
}
return events->time < time(NULL) ? time(NULL) : events->time;
}
PANCAKE_API inline UNative PancakeSchedulerGetNextExecutionTimeOffset() {
PANCAKE_API extern inline UNative PancakeSchedulerGetNextExecutionTimeOffset() {
UNative now;
if(!events) {
@@ -91,7 +91,7 @@ PANCAKE_API inline UNative PancakeSchedulerGetNextExecutionTimeOffset() {
return events->time < now ? 0 : events->time - now;
}
PANCAKE_API inline UNative PancakeSchedulerGetNextScheduledTime() {
PANCAKE_API extern inline UNative PancakeSchedulerGetNextScheduledTime() {
if(!events) {
return 0;
}
View
@@ -15,10 +15,10 @@ typedef struct _PancakeSchedulerEvent {
} PancakeSchedulerEvent;
PANCAKE_API PancakeSchedulerEvent *PancakeSchedule(UNative time, PancakeSchedulerEventCallback callback, void *arg);
PANCAKE_API inline void PancakeUnschedule(PancakeSchedulerEvent *event);
PANCAKE_API inline UNative PancakeSchedulerGetNextExecutionTime(); /* returns >= time() */
PANCAKE_API inline UNative PancakeSchedulerGetNextExecutionTimeOffset(); /* return >= 0 */
PANCAKE_API inline UNative PancakeSchedulerGetNextScheduledTime(); /* returns actual scheduled time (can be < time()) */
PANCAKE_API void PancakeUnschedule(PancakeSchedulerEvent *event);
PANCAKE_API UNative PancakeSchedulerGetNextExecutionTime(); /* returns >= time() */
PANCAKE_API UNative PancakeSchedulerGetNextExecutionTimeOffset(); /* return >= 0 */
PANCAKE_API UNative PancakeSchedulerGetNextScheduledTime(); /* returns actual scheduled time (can be < time()) */
PANCAKE_API void PancakeSchedulerRun();
void PancakeSchedulerShutdown();

0 comments on commit 5da34b8

Please sign in to comment.