Remove skygw_types.h

Some stuff moved to maxscale/utils.h. Further cleanup still needed.
This commit is contained in:
Johan Wikman 2016-10-14 14:21:09 +03:00
parent 0800bf4a59
commit bff2cfb7e5
23 changed files with 27 additions and 71 deletions

View File

@ -1,52 +0,0 @@
#pragma once
#ifndef _MAXSCALE_SKYGW_TYPES_H
#define _MAXSCALE_SKYGW_TYPES_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 <maxscale/cdefs.h>
#include <math.h>
#include <stdbool.h>
#include <ctype.h>
MXS_BEGIN_DECLS
#define SECOND_USEC (1024*1024L)
#define MSEC_USEC (1024L)
#define KILOBYTE_BYTE (1024L)
#define MEGABYTE_BYTE (1024*1024L)
#define GIGABYTE_BYTE (1024*1024*1024L)
#define KB KILOBYTE_BYTE
#define MB MEGABYTE_BYTE
#define GB GIGABYTE_BYTE
#define CALCLEN(i) ((size_t)(floor(log10(abs(i))) + 1))
#define UINTLEN(i) (i<10 ? 1 : (i<100 ? 2 : (i<1000 ? 3 : CALCLEN(i))))
#if !defined(PATH_MAX)
# if defined(__USE_POSIX)
# define PATH_MAX _POSIX_PATH_MAX
# else
# define PATH_MAX 256
# endif
#endif
#define MAX_ERROR_MSG PATH_MAX
#define array_nelems(a) ((uint)(sizeof(a)/sizeof(a[0])))
MXS_END_DECLS
#endif /* SKYGW_TYPES_H */

View File

@ -33,7 +33,6 @@ MXS_BEGIN_DECLS
#endif
#define FSYNCLIMIT 10
#include <maxscale/skygw_types.h>
#include <maxscale/debug.h>
#define DISKWRITE_LATENCY (5*MSEC_USEC)

View File

@ -27,9 +27,16 @@
*/
#include <maxscale/cdefs.h>
#include <math.h>
#include <stdlib.h>
MXS_BEGIN_DECLS
#define CALCLEN(i) ((size_t)(floor(log10(abs(i))) + 1))
#define UINTLEN(i) (i<10 ? 1 : (i<100 ? 2 : (i<1000 ? 3 : CALCLEN(i))))
#define MXS_ARRAY_NELEMS(array) ((size_t)(sizeof(array)/sizeof(array[0])))
int setnonblocking(int fd);
char *gw_strend(register const char *s);
static char gw_randomchar();

View File

@ -55,7 +55,6 @@
#include <strfunc.h>
#include <item_func.h>
#include <maxscale/skygw_types.h>
#include <maxscale/debug.h>
#include <maxscale/log_manager.h>
#include <maxscale/query_classifier.h>

View File

@ -12,6 +12,7 @@
*/
#include <maxscale/externcmd.h>
#include <ctype.h>
#include <maxscale/alloc.h>
/**

View File

@ -29,9 +29,9 @@
#include <maxscale/mlist.h>
#include <maxscale/spinlock.h>
#include <maxscale/debug.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/alloc.h>
#include <maxscale/utils.h>
#define MAX_PREFIXLEN 250
#define MAX_SUFFIXLEN 250

View File

@ -67,6 +67,7 @@
#include <maxscale/version.h>
#include <maxscale/queuemanager.h>
#include <maxscale/alloc.h>
#include <maxscale/utils.h>
/** To be used with configuration type checks */
typedef struct typelib_st
@ -78,13 +79,13 @@ typedef struct typelib_st
/** Set of subsequent false,true pairs */
static const char* bool_strings[11] = {"FALSE", "TRUE", "OFF", "ON", "N", "Y", "0", "1", "NO", "YES", 0};
typelib_t bool_type = {array_nelems(bool_strings) - 1, "bool_type", bool_strings};
typelib_t bool_type = {MXS_ARRAY_NELEMS(bool_strings) - 1, "bool_type", bool_strings};
/** List of valid values */
static const char* sqlvar_target_strings[4] = {"MASTER", "ALL", 0};
typelib_t sqlvar_target_type =
{
array_nelems(sqlvar_target_strings) - 1,
MXS_ARRAY_NELEMS(sqlvar_target_strings) - 1,
"sqlvar_target_type",
sqlvar_target_strings
};

View File

@ -15,6 +15,8 @@
#define PCRE2_CODE_UNIT_WIDTH 8
#endif
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
@ -24,13 +26,22 @@
#include <stddef.h>
#include <regex.h>
#include <maxscale/debug.h>
#include <maxscale/skygw_types.h>
#include <sys/time.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/atomic.h>
#include <maxscale/random_jkiss.h>
#include <pcre2.h>
#if !defined(PATH_MAX)
# if defined(__USE_POSIX)
# define PATH_MAX _POSIX_PATH_MAX
# else
# define PATH_MAX 256
# endif
#endif
#define MAX_ERROR_MSG PATH_MAX
static void simple_mutex_free_memory(simple_mutex_t* sm);
static void thread_free_memory(skygw_thread_t* th, char* name);
/** End of static function declarations */

View File

@ -70,7 +70,6 @@
#include <maxscale/query_classifier.h>
#include <maxscale/protocol/mysql.h>
#include <maxscale/spinlock.h>
#include <maxscale/skygw_types.h>
#include <time.h>
#include <assert.h>
#include <regex.h>

View File

@ -36,7 +36,6 @@
* or diagnostic being made for the session script.
*/
#include <maxscale/skygw_types.h>
#include <maxscale/spinlock.h>
#include <maxscale/debug.h>
#include <maxscale/log_manager.h>

View File

@ -39,6 +39,7 @@
* @endverbatim
*/
#include <ctype.h>
#include <stdio.h>
#include <fcntl.h>
#include <maxscale/filter.h>

View File

@ -12,7 +12,6 @@
*/
#include <maxscale/protocol/mysql.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>
#include <maxscale/modutil.h>

View File

@ -46,7 +46,6 @@
#include <maxscale/utils.h>
#include <maxscale/protocol/mysql.h>
#include <maxscale/alloc.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>
#include <netinet/tcp.h>

View File

@ -39,7 +39,6 @@
#include <maxscale/housekeeper.h>
#include <time.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>

View File

@ -35,7 +35,6 @@
#include <maxscale/spinlock.h>
#include <maxscale/dcb.h>
#include <maxscale/spinlock.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>
#include <maxscale/version.h>

View File

@ -71,7 +71,6 @@
#include <maxscale/housekeeper.h>
#include <time.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>

View File

@ -43,7 +43,6 @@
#include <maxscale/dcb.h>
#include <maxscale/spinlock.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>

View File

@ -56,7 +56,6 @@
#include <maxscale/dcb.h>
#include <maxscale/spinlock.h>
#include <maxscale/gwdirs.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>
#include <maxscale/alloc.h>

View File

@ -69,7 +69,6 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>

View File

@ -79,7 +79,6 @@
#include <maxscale/spinlock.h>
#include <maxscale/housekeeper.h>
#include <sys/stat.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>
#include <maxscale/version.h>

View File

@ -36,7 +36,6 @@
#include <maxscale/spinlock.h>
#include <maxscale/housekeeper.h>
#include <time.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>
#include <maxscale/gwdirs.h>

View File

@ -23,6 +23,8 @@
*
* @endverbatim
*/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -84,7 +84,6 @@
#include <maxscale/spinlock.h>
#include <maxscale/modinfo.h>
#include <maxscale/skygw_types.h>
#include <maxscale/skygw_utils.h>
#include <maxscale/log_manager.h>