
Gw.h contained a fair amount of obsolete function declarations, duplicate declarations of functions declared in utils.h and declarations of functions that conceptually are similar to those in utils.h. The obsolete and duplicate ones were removed and all but one of the remaining moved to utils.h. Correspondingly the implementation was moved from gw_utils.c to utils.c. The one remaining function - gw_daemonize() - is not really worthy of a file of its own, so that is to be moved to gateway.c after which gw_utils.c can be removed. Gw.h still contains defines that are duplicated in maxscale/protocol/mysql.h. The ones in gw.h are to be removed. It appears that the entire gw.h will disappear.
78 lines
1.9 KiB
C
78 lines
1.9 KiB
C
#pragma once
|
|
#ifndef _MAXSCALE_CDEFS_H
|
|
#define _MAXSCALE_CDEFS_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.
|
|
*/
|
|
|
|
/**
|
|
* @file cdefs.h
|
|
*
|
|
* This file has several purposes.
|
|
*
|
|
* - Its purpose is the same as that of x86_64-linux-gnu/sys/cdefs.h, that is,
|
|
* it defines things that are dependent upon the compilation environment.
|
|
* - Since this *must* be included as the very first header by all other MaxScale
|
|
* headers, it allows you to redfine things globally, should that be necessary,
|
|
* for instance, when debugging something.
|
|
* - Global constants applicable across the line can be defined here.
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
# define MXS_BEGIN_DECLS extern "C" {
|
|
# define MXS_END_DECLS }
|
|
#else
|
|
# define MXS_BEGIN_DECLS
|
|
# define MXS_END_DECLS
|
|
#endif
|
|
|
|
/**
|
|
* Define intended for use with strerror.
|
|
*
|
|
* char errbuf[MXS_STRERROR_BUFLEN];
|
|
* strerror_r(errno, errbuf, sizeof(errbuf))
|
|
*/
|
|
#define MXS_STRERROR_BUFLEN 512
|
|
|
|
/**
|
|
* Returns the smaller of two items.
|
|
*
|
|
* @param a A value.
|
|
* @param b Another value.
|
|
*
|
|
* @return a if a is smaller than b, b otherwise.
|
|
*
|
|
* @note This a macro, so the arguments will be evaluated more than once.
|
|
*/
|
|
#define MXS_MIN(a,b) ((a)<(b) ? (a) : (b))
|
|
|
|
/**
|
|
* Returns the larger of two items.
|
|
*
|
|
* @param a A value.
|
|
* @param b Another value.
|
|
*
|
|
* @return a if a is larger than b, b otherwise.
|
|
*
|
|
* @note This a macro, so the arguments will be evaluated more than once.
|
|
*/
|
|
#define MXS_MAX(a,b) ((a)>(b) ? (a) : (b))
|
|
|
|
/**
|
|
* COMMON INCLUDE FILES
|
|
*/
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#endif
|