libscid snapshot+0cce79d72e38
Chess applications made easy.
Source on GitHub License GPL v2
Loading...
Searching...
No Matches
eco.h
1#ifndef SCID_ECO_H
2#define SCID_ECO_H
3
4#include "scid/_platform.h"
5#include "scid/position.h"
6
7#ifdef __cplusplus
8extern "C"
9{
10#endif
11
12 typedef unsigned short scid_eco_code;
13
14 enum
15 {
16 SCID_ECO_NONE = 0,
17 SCID_ECO_STRING_CAPACITY = 6
18 };
19
20 typedef int scid_eco_format;
21
22 enum
23 {
24 SCID_ECO_FORMAT_BASIC = 0,
25 SCID_ECO_FORMAT_EXTENDED = 1
26 };
27
28 typedef struct scid_eco_book scid_eco_book;
29
30
31 SCID_API scid_error
32 scid_eco_code_from_string(
33 const char* text,
34 scid_eco_code* out_code);
35
36
37 SCID_API scid_error
38 scid_eco_code_to_string(
39 scid_eco_code code,
40 scid_eco_format format,
41 char* out_text,
42 size_t out_text_capacity,
43 size_t* out_text_size);
44
45
46 SCID_API scid_error
47 scid_eco_book_load(
48 const char* path,
49 scid_eco_book** out_book);
50
51
52 SCID_API void
53 scid_eco_book_free(scid_eco_book* book);
54
55
56 SCID_API scid_error
57 scid_eco_book_code_find(
58 const scid_eco_book* book,
59 const scid_position* position,
60 scid_eco_code* out_code);
61
62
63 SCID_API scid_error
64 scid_eco_book_name_find(
65 const scid_eco_book* book,
66 const scid_position* position,
67 char* out_text,
68 size_t out_text_capacity,
69 size_t* out_text_size);
70
71#ifdef __cplusplus
72}
73#endif
74
75#endif