summaryrefslogtreecommitdiff
path: root/apps/plugins/chessbox/chessbox_pgn.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/chessbox/chessbox_pgn.c')
-rw-r--r--apps/plugins/chessbox/chessbox_pgn.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c
index 846ea41847..8b2cb1b2f2 100644
--- a/apps/plugins/chessbox/chessbox_pgn.c
+++ b/apps/plugins/chessbox/chessbox_pgn.c
@@ -37,7 +37,7 @@ size_t bufleft;
37/* simple function to "allocate" memory in pluginbuffer. 37/* simple function to "allocate" memory in pluginbuffer.
38 * (borrowed from dict.c) 38 * (borrowed from dict.c)
39 */ 39 */
40void *pl_malloc(size_t size) 40static void *pl_malloc(size_t size)
41{ 41{
42 void *ptr; 42 void *ptr;
43 ptr = bufptr; 43 ptr = bufptr;
@@ -55,12 +55,12 @@ void *pl_malloc(size_t size)
55} 55}
56 56
57/* init function for pl_malloc() */ 57/* init function for pl_malloc() */
58void pl_malloc_init(void) 58static void pl_malloc_init(void)
59{ 59{
60 bufptr = rb->plugin_get_buffer(&bufleft); 60 bufptr = rb->plugin_get_buffer(&bufleft);
61} 61}
62 62
63void process_tag(struct pgn_game_node* game, char* buffer){ 63static void process_tag(struct pgn_game_node* game, char* buffer){
64 char tag_type[20]; 64 char tag_type[20];
65 char tag_value[255]; 65 char tag_value[255];
66 short pos=0, pos2=0; 66 short pos=0, pos2=0;
@@ -95,7 +95,7 @@ void process_tag(struct pgn_game_node* game, char* buffer){
95 } 95 }
96} 96}
97 97
98unsigned short get_next_token(const char* line_buffer, unsigned short initial_pos, 98static unsigned short get_next_token(const char* line_buffer, unsigned short initial_pos,
99 char* token_buffer){ 99 char* token_buffer){
100 unsigned short pos, token_pos=0; 100 unsigned short pos, token_pos=0;
101 for (pos = initial_pos;line_buffer[pos] == ' ' || line_buffer[pos] == '.';pos++); 101 for (pos = initial_pos;line_buffer[pos] == ' ' || line_buffer[pos] == '.';pos++);
@@ -112,7 +112,7 @@ unsigned short get_next_token(const char* line_buffer, unsigned short initial_po
112 return pos; 112 return pos;
113} 113}
114 114
115unsigned short piece_from_pgn(char pgn_piece){ 115static unsigned short piece_from_pgn(char pgn_piece){
116 switch (pgn_piece){ 116 switch (pgn_piece){
117 case 'R': 117 case 'R':
118 return rook; 118 return rook;
@@ -128,7 +128,7 @@ unsigned short piece_from_pgn(char pgn_piece){
128 return no_piece; 128 return no_piece;
129} 129}
130 130
131char pgn_from_piece(unsigned short piece, unsigned short color){ 131static char pgn_from_piece(unsigned short piece, unsigned short color){
132 char pgn_piece = ' '; 132 char pgn_piece = ' ';
133 switch (piece){ 133 switch (piece){
134 case pawn: 134 case pawn:
@@ -159,7 +159,7 @@ char pgn_from_piece(unsigned short piece, unsigned short color){
159 return pgn_piece; 159 return pgn_piece;
160} 160}
161 161
162void pgn_to_coords(struct pgn_ply_node* ply){ 162static void pgn_to_coords(struct pgn_ply_node* ply){
163 unsigned short str_length = rb->strlen(ply->pgn_text); 163 unsigned short str_length = rb->strlen(ply->pgn_text);
164 char str[10]; 164 char str[10];
165 rb->strcpy(str,ply->pgn_text); 165 rb->strcpy(str,ply->pgn_text);
@@ -354,7 +354,7 @@ void pgn_to_coords(struct pgn_ply_node* ply){
354 color[locn[ply->row_from][ply->column_from]] = neutral; 354 color[locn[ply->row_from][ply->column_from]] = neutral;
355} 355}
356 356
357void coords_to_pgn(struct pgn_ply_node* ply){ 357static void coords_to_pgn(struct pgn_ply_node* ply){
358 int pos = 0,i,j; 358 int pos = 0,i,j;
359 unsigned short moving_piece = board[locn[ply->row_from][ply->column_from]]; 359 unsigned short moving_piece = board[locn[ply->row_from][ply->column_from]];
360 char unambiguous_position; 360 char unambiguous_position;
@@ -545,7 +545,7 @@ static const char* get_game_text(int selected_item, void *data,
545 return buffer; 545 return buffer;
546} 546}
547 547
548void write_pgn_token(int fhandler, char *buffer, size_t *line_length){ 548static void write_pgn_token(int fhandler, char *buffer, size_t *line_length){
549 if (*line_length + rb->strlen(buffer) + 1 > 80){ 549 if (*line_length + rb->strlen(buffer) + 1 > 80){
550 rb->fdprintf(fhandler,"\n"); 550 rb->fdprintf(fhandler,"\n");
551 *line_length = 0; 551 *line_length = 0;