Move headers from server/include to include/maxscale
- Headers now to be included as <maxscale/xyz.h> - First step, no cleanup of headers has been made. Only moving from one place to another + necessary modifications.
This commit is contained in:
@ -1,82 +0,0 @@
|
||||
#ifndef _MAXSCALE_ALLOC_H
|
||||
#define _MAXSCALE_ALLOC_H
|
||||
/*
|
||||
* Copyright (c) 2016 MariaDB Corporation Ab
|
||||
*
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
* Public License.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <skygw_debug.h>
|
||||
|
||||
EXTERN_C_BLOCK_BEGIN
|
||||
|
||||
/*
|
||||
* NOTE: Do not use these functions directly, use the macros below.
|
||||
*/
|
||||
|
||||
// "caller" arg temporarily disabled so that existing code
|
||||
// using the previous version of mxs_alloc etc. will continue
|
||||
// to compile.
|
||||
void *mxs_malloc(size_t size/*, const char *caller*/);
|
||||
void *mxs_calloc(size_t nmemb, size_t size/*, const char *caller*/);
|
||||
void *mxs_realloc(void *ptr, size_t size/*, const char *caller*/);
|
||||
void mxs_free(void *ptr/*, const char *caller*/);
|
||||
|
||||
char *mxs_strdup(const char *s/*, const char *caller*/);
|
||||
char *mxs_strndup(const char *s, size_t n/*, const char *caller*/);
|
||||
|
||||
char *mxs_strdup_a(const char *s/*, const char *caller*/);
|
||||
char *mxs_strndup_a(const char *s, size_t n/*, const char *caller*/);
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: USE these macros instead of the functions above.
|
||||
*/
|
||||
#define MXS_MALLOC(size) mxs_malloc(size/*, __func__*/)
|
||||
#define MXS_CALLOC(nmemb, size) mxs_calloc(nmemb, size/*, __func__*/)
|
||||
#define MXS_REALLOC(ptr, size) mxs_realloc(ptr, size/*, __func__*/)
|
||||
#define MXS_FREE(ptr) mxs_free(ptr/*, __func__*/)
|
||||
|
||||
#define MXS_STRDUP(s) mxs_strdup(s/*, __func__*/)
|
||||
#define MXS_STRNDUP(s, n) mxs_strndup(s, n/*, __func__*/)
|
||||
|
||||
#define MXS_STRDUP_A(s) mxs_strdup_a(s/*, __func__*/)
|
||||
#define MXS_STRNDUP_A(s, n) mxs_strndup_a(s, n/*, __func__*/)
|
||||
|
||||
|
||||
/**
|
||||
* @brief Abort the process if the pointer is NULL.
|
||||
*
|
||||
* To be used in circumstances where a memory allocation failure
|
||||
* cannot - currently - be dealt with properly.
|
||||
*/
|
||||
#define MXS_ABORT_IF_NULL(p) do { if (!p) { abort(); } } while (false)
|
||||
|
||||
/**
|
||||
* @brief Abort the process if the provided value is non-zero.
|
||||
*
|
||||
* To be used in circumstances where a memory allocation or other
|
||||
* fatal error cannot - currently - be dealt with properly.
|
||||
*/
|
||||
#define MXS_ABORT_IF_TRUE(b) do { if (b) { abort(); } } while (false)
|
||||
|
||||
/**
|
||||
* @brief Abort the process if the provided value is zero.
|
||||
*
|
||||
* To be used in circumstances where a memory allocation or other
|
||||
* fatal error cannot - currently - be dealt with properly.
|
||||
*/
|
||||
#define MXS_ABORT_IF_FALSE(b) do { if (!b) { abort(); } } while (false)
|
||||
|
||||
EXTERN_C_BLOCK_END
|
||||
|
||||
#endif
|
@ -1,24 +0,0 @@
|
||||
#ifndef _MAXSCALE_LIMITS_H
|
||||
#define _MAXSCALE_LIMITS_H
|
||||
/*
|
||||
* Copyright (c) 2016 MariaDB Corporation Ab
|
||||
*
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
* Public License.
|
||||
*/
|
||||
|
||||
// This file defines hard limits of MaxScale.
|
||||
|
||||
// Thread information is stored in a bitmask whose size must be a
|
||||
// multiple of 8. The bitmask is indexed using the thread id that start
|
||||
// from 1. Hence, the hard maximum number of threads must be a
|
||||
// multiple of 8 minus 1.
|
||||
#define MXS_MAX_THREADS 255
|
||||
|
||||
#endif
|
@ -1,70 +0,0 @@
|
||||
#ifndef _POLL_H
|
||||
#define _POLL_H
|
||||
/*
|
||||
* Copyright (c) 2016 MariaDB Corporation Ab
|
||||
*
|
||||
* Use of this software is governed by the Business Source License included
|
||||
* in the LICENSE.TXT file and at www.mariadb.com/bsl.
|
||||
*
|
||||
* Change Date: 2019-07-01
|
||||
*
|
||||
* On the date above, in accordance with the Business Source License, use
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
* Public License.
|
||||
*/
|
||||
#include <dcb.h>
|
||||
#include <gwbitmask.h>
|
||||
#include <resultset.h>
|
||||
#include <sys/epoll.h>
|
||||
|
||||
/**
|
||||
* @file poll.h The poll related functionality
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 19/06/13 Mark Riddoch Initial implementation
|
||||
* 17/10/15 Martin Brampton Declare fake event functions
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
#define MAX_EVENTS 1000
|
||||
|
||||
/**
|
||||
* A statistic identifier that can be returned by poll_get_stat
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
POLL_STAT_READ,
|
||||
POLL_STAT_WRITE,
|
||||
POLL_STAT_ERROR,
|
||||
POLL_STAT_HANGUP,
|
||||
POLL_STAT_ACCEPT,
|
||||
POLL_STAT_EVQ_LEN,
|
||||
POLL_STAT_EVQ_PENDING,
|
||||
POLL_STAT_EVQ_MAX,
|
||||
POLL_STAT_MAX_QTIME,
|
||||
POLL_STAT_MAX_EXECTIME
|
||||
} POLL_STAT;
|
||||
|
||||
extern void poll_init();
|
||||
extern int poll_add_dcb(DCB *);
|
||||
extern int poll_remove_dcb(DCB *);
|
||||
extern void poll_waitevents(void *);
|
||||
extern void poll_shutdown();
|
||||
extern GWBITMASK *poll_bitmask();
|
||||
extern void poll_set_maxwait(unsigned int);
|
||||
extern void poll_set_nonblocking_polls(unsigned int);
|
||||
extern void dprintPollStats(DCB *);
|
||||
extern void dShowThreads(DCB *dcb);
|
||||
extern void poll_add_epollin_event_to_dcb(DCB* dcb, GWBUF* buf);
|
||||
extern void dShowEventQ(DCB *dcb);
|
||||
extern void dShowEventStats(DCB *dcb);
|
||||
extern int poll_get_stat(POLL_STAT stat);
|
||||
extern RESULTSET *eventTimesGetList();
|
||||
extern void poll_fake_event(DCB *dcb, enum EPOLL_EVENTS ev);
|
||||
extern void poll_fake_hangup_event(DCB *dcb);
|
||||
extern void poll_fake_write_event(DCB *dcb);
|
||||
extern void poll_fake_read_event(DCB *dcb);
|
||||
#endif
|
Reference in New Issue
Block a user