Uncrustify maxscale
See script directory for method. The script to run in the top level MaxScale directory is called maxscale-uncrustify.sh, which uses another script, list-src, from the same directory (so you need to set your PATH). The uncrustify version was 0.66.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
* Public License.
|
||||
*/
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @file modutil.h A set of useful routines for module writers
|
||||
@ -24,34 +24,34 @@
|
||||
|
||||
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)
|
||||
#define PTR_IS_ERR(b) (b[4] == 0xff)
|
||||
#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)
|
||||
#define PTR_IS_ERR(b) (b[4] == 0xff)
|
||||
#define PTR_IS_LOCAL_INFILE(b) (b[4] == 0xfb)
|
||||
#define IS_FULL_RESPONSE(buf) (modutil_count_signal_packets(buf,0,0) == 2)
|
||||
#define IS_FULL_RESPONSE(buf) (modutil_count_signal_packets(buf, 0, 0) == 2)
|
||||
|
||||
extern int modutil_is_SQL(GWBUF *);
|
||||
extern int modutil_is_SQL_prepare(GWBUF *);
|
||||
extern int modutil_extract_SQL(GWBUF *, char **, int *);
|
||||
extern int modutil_MySQL_Query(GWBUF *, char **, int *, int *);
|
||||
extern char* modutil_get_SQL(GWBUF *);
|
||||
extern GWBUF* modutil_replace_SQL(GWBUF *, char *);
|
||||
extern char* modutil_get_query(GWBUF* buf);
|
||||
extern int modutil_send_mysql_err_packet(DCB *, int, int, int, const char *, const char *);
|
||||
GWBUF* modutil_get_next_MySQL_packet(GWBUF** p_readbuf);
|
||||
GWBUF* modutil_get_complete_packets(GWBUF** p_readbuf);
|
||||
int modutil_MySQL_query_len(GWBUF* buf, int* nbytes_missing);
|
||||
void modutil_reply_parse_error(DCB* backend_dcb, char* errstr, uint32_t flags);
|
||||
void modutil_reply_auth_error(DCB* backend_dcb, char* errstr, uint32_t flags);
|
||||
int modutil_count_statements(GWBUF* buffer);
|
||||
int modutil_count_packets(GWBUF* buffer);
|
||||
GWBUF* modutil_create_query(const char* query);
|
||||
GWBUF* modutil_create_mysql_err_msg(int packet_number,
|
||||
int affected_rows,
|
||||
int merrno,
|
||||
const char *statemsg,
|
||||
const char *msg);
|
||||
extern int modutil_is_SQL(GWBUF*);
|
||||
extern int modutil_is_SQL_prepare(GWBUF*);
|
||||
extern int modutil_extract_SQL(GWBUF*, char**, int*);
|
||||
extern int modutil_MySQL_Query(GWBUF*, char**, int*, int*);
|
||||
extern char* modutil_get_SQL(GWBUF*);
|
||||
extern GWBUF* modutil_replace_SQL(GWBUF*, char*);
|
||||
extern char* modutil_get_query(GWBUF* buf);
|
||||
extern int modutil_send_mysql_err_packet(DCB*, int, int, int, const char*, const char*);
|
||||
GWBUF* modutil_get_next_MySQL_packet(GWBUF** p_readbuf);
|
||||
GWBUF* modutil_get_complete_packets(GWBUF** p_readbuf);
|
||||
int modutil_MySQL_query_len(GWBUF* buf, int* nbytes_missing);
|
||||
void modutil_reply_parse_error(DCB* backend_dcb, char* errstr, uint32_t flags);
|
||||
void modutil_reply_auth_error(DCB* backend_dcb, char* errstr, uint32_t flags);
|
||||
int modutil_count_statements(GWBUF* buffer);
|
||||
int modutil_count_packets(GWBUF* buffer);
|
||||
GWBUF* modutil_create_query(const char* query);
|
||||
GWBUF* modutil_create_mysql_err_msg(int packet_number,
|
||||
int affected_rows,
|
||||
int merrno,
|
||||
const char* statemsg,
|
||||
const char* msg);
|
||||
|
||||
/** Struct used for tracking the state inside the modutil functions */
|
||||
typedef struct
|
||||
@ -82,7 +82,7 @@ typedef struct
|
||||
*
|
||||
* @return Total number of EOF and ERR packets including the ones already found
|
||||
*/
|
||||
int modutil_count_signal_packets(GWBUF *reply, int n_found, bool* more, modutil_state* state);
|
||||
int modutil_count_signal_packets(GWBUF* reply, int n_found, bool* more, modutil_state* state);
|
||||
|
||||
mxs_pcre2_result_t modutil_mysql_wildcard_match(const char* pattern, const char* string);
|
||||
|
||||
@ -111,13 +111,13 @@ char* modutil_MySQL_bypass_whitespace(char* sql, size_t len);
|
||||
* @param dcb The backend DCB where the COM_PING is written
|
||||
* @return True if command was successfully sent
|
||||
*/
|
||||
bool modutil_ignorable_ping(DCB *dcb);
|
||||
bool modutil_ignorable_ping(DCB* dcb);
|
||||
|
||||
/** Character and token searching functions */
|
||||
char* strnchr_esc(char* ptr, char c, int len);
|
||||
char* strnchr_esc_mysql(char* ptr, char c, int len);
|
||||
bool is_mysql_statement_end(const char* start, int len);
|
||||
bool is_mysql_sp_end(const char* start, int len);
|
||||
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);
|
||||
|
||||
// TODO: Move modutil out of the core
|
||||
|
Reference in New Issue
Block a user