Cleanup header files

- All now include maxscale/cdefs.h as the very first file.
- MXS_[BEGIN|END]_DECLS added to all C-headers.
  Strictly speaking not necessary for private headers, but
  does not hurt either.
- Include guards moved to the very top of the file.
- #pragma once added.
This commit is contained in:
Johan Wikman
2016-10-14 11:51:44 +03:00
parent dc1f599b49
commit 1a978be6b6
86 changed files with 647 additions and 206 deletions

View File

@ -1,5 +1,6 @@
#ifndef _MODUTIL_H
#define _MODUTIL_H
#pragma once
#ifndef _MAXSCALE_MODUTIL_H
#define _MAXSCALE_MODUTIL_H
/*
* Copyright (c) 2016 MariaDB Corporation Ab
*
@ -26,11 +27,15 @@
*
* @endverbatim
*/
#include <maxscale/cdefs.h>
#include <maxscale/buffer.h>
#include <maxscale/dcb.h>
#include <string.h>
#include <maxscale/pcre2.h>
MXS_BEGIN_DECLS
#define PTR_IS_RESULTSET(b) (b[0] == 0x01 && b[1] == 0x0 && b[2] == 0x0 && b[3] == 0x01)
#define PTR_IS_EOF(b) (b[0] == 0x05 && b[1] == 0x0 && b[2] == 0x0 && b[4] == 0xfe)
#define PTR_IS_OK(b) (b[4] == 0x00)
@ -70,4 +75,6 @@ bool is_mysql_statement_end(const char* start, int len);
bool is_mysql_sp_end(const char* start, int len);
char* modutil_get_canonical(GWBUF* querybuf);
MXS_END_DECLS
#endif