<commit_before>/**
 * Copyright 2012, <NAME>
 * <EMAIL>
 * BSD License - see COPYING.txt for details
 *
 * (setq-default indent-tabs-mode nil)
 * (setq c-default-style "k&r"
 *     c-basic-offset 4)
 *  indent -kr -nut
 */
#ifndef _SQLPARSE_PRIVATE_H
#define _SQLPARSE_PRIVATE_H

#include "sqlparse.h"

/***
 * The stdlib function 'strspn' assumes input to null-delimited.
 * This allows us to specifying and input length and allows
 * embedded nulls
 */
size_t strlenspn(const char *s, size_t len, const char *accept);

int streq(const char *a, const char *b);

void st_clear(stoken_t * st);
void st_assign_char(stoken_t * st, const char stype, const char value);
void st_set_type(stoken_t * st, const char stype);
void st_assign(stoken_t * st, const char stype, const char *value,
               size_t len);
void st_assign_cstr(stoken_t * st, const char stype, const char *value);
void st_copy(stoken_t * dest, const stoken_t * src);

int st_equals_cstr(const stoken_t * src, const char stype,
                    const char *value);

int st_is_empty(const stoken_t * st);
int st_is_arith_op(const stoken_t * st);
int st_is_unary_op(const stoken_t * st);
int st_is_english_op(const stoken_t * st);
int st_is_logical_op(const stoken_t * st);
int st_is_multiword_start(const stoken_t * st);

typedef struct {
    const char *word;
    char type;
} keyword_t;

char bsearch_keyword_type(const char *key, const keyword_t keywords[],
                          size_t len);

int is_operator2(const char *key);

int is_sqli_pattern(const char *key);

size_t parse_none(sfilter * sf);
size_t parse_money(sfilter * sf);
size_t parse_other(sfilter * sf);
size_t parse_white(sfilter * sf);
size_t parse_operator1(sfilter *sf);
size_t parse_char(sfilter *sf);
size_t parse_eol_comment(sfilter *sf);
size_t parse_dash(sfilter *sf);
size_t is_mysql_comment(const char *cs, const size_t len, size_t pos);
size_t parse_slash(sfilter *sf);
size_t parse_backslash(sfilter * sf);
size_t parse_operator2(sfilter *sf);
size_t parse_string_core(const char *cs, const size_t len, size_t pos,
                         stoken_t * st, char delim, size_t offset);<commit_msg>test of removing functions from private include<commit_after>/**
 * Copyright 2012, <NAME>
 * <EMAIL>
 * BSD License - see COPYING.txt for details
 *
 * (setq-default indent-tabs-mode nil)
 * (setq c-default-style "k&r"
 *     c-basic-offset 4)
 *  indent -kr -nut
 */
#ifndef _SQLPARSE_PRIVATE_H
#define _SQLPARSE_PRIVATE_H

#include "sqlparse.h"

typedef struct {
    const char *word;
    char type;
} keyword_t;

char bsearch_keyword_type(const char *key, const keyword_t keywords[],
                          size_t len);

int is_operator2(const char *key);

int is_sqli_pattern(const char *key);

size_t parse_none(sfilter * sf);
size_t parse_money(sfilter * sf);
size_t parse_other(sfilter * sf);
size_t parse_white(sfilter * sf);
size_t parse_operator1(sfilter *sf);
size_t parse_char(sfilter *sf);
size_t parse_eol_comment(sfilter *sf);
size_t parse_dash(sfilter *sf);
size_t is_mysql_comment(const char *cs, const size_t len, size_t pos);
size_t parse_slash(sfilter *sf);
size_t parse_backslash(sfilter * sf);
size_t parse_operator2(sfilter *sf);
size_t parse_string_core(const char *cs, const size_t len, size_t pos,
                         stoken_t * st, char delim, size_t offset);
{'fraction_non_alphanumeric': 0.10370591751344889, 'fraction_numerical': 0.004781829049611476, 'mean_word_length': 4.329617834394904, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6571170', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1202, 'n_words': 339}