summaryrefslogtreecommitdiff
path: root/epglv/src/epglv.h
blob: 39554b821815998c7ca0c60556835e462b15047a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*

EPG2VDR Levenshtein Distance UDF for MySQL
Supports UTF-8 throught iconv.

Copyright (C) 2013 Jörg Wendel

*/

#ifndef __EPGLV_H
#define __EPGLV_H

#ifdef STANDARD
# include <string.h>
#else
# include <my_global.h>
# include <my_sys.h>
#endif

#include <mysql.h>
#include <m_ctype.h>
#include <m_string.h>

#include <locale.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#include <stdlib.h>
#include <stdarg.h>
#include <iconv.h>
#include <errno.h>
#include <stdint.h>
#include <assert.h>

#define LENGTH_MAX 1000

#define debug_print(fmt, ...) \
    do { if (DEBUG_MYSQL) fprintf(stderr, "%s():%d> " fmt "\n", \
         __func__, __LINE__, __VA_ARGS__); fflush(stderr); } while (0)

#define print(fmt, ...) \
    do { fprintf(stderr, "%s():%d> " fmt "\n", \
         __func__, __LINE__, __VA_ARGS__); fflush(stderr); } while (0)

#define MIN(a,b) (((a)<(b))?(a):(b))

#endif //  __EPGLV_H

my_bool base_epglv_init(UDF_INIT* init, UDF_ARGS* args, char* message);
void base_epglv_deinit(UDF_INIT* init);
long long base_epglv(UDF_INIT* init, UDF_ARGS* args, char* is_null, 
                     char* error, long long* l1, long long* l2);