#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "../core/gui_lang.h"
gehe zum Quellcode dieser Datei
char * is_conditional |
( |
int |
id) | |
|
void lang_load_from_mem |
( |
char * |
buf) | |
|
Definiert in Zeile 138 der Datei makelang.c.
150 while (*p && (*p==
'\r' || *p==
'\n')) ++p;
166 while (*p && *p!=
'\"') ++p;
169 while (*p && (*p!=
'\"' || *(p-1)==
'\\')) ++p;
void load_conditions |
( |
char * |
file) | |
|
Definiert in Zeile 223 der Datei makelang.c.
245 if (
strncmp(p,
"#define", 7) == 0)
254 if (p && (
strcmp(cond,
"//CONDITIONAL:") == 0))
char* load_from_file |
( |
const char * |
filename) | |
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definiert in Zeile 29 der Datei makelang.c.
35 printf(
"#error No arguments for language file parser. lang_str.h creation was failed\n");
54 printf(
"#error No strings found by language file parser. lang_str.h creation was failed\n");
68 char* lng_filename = (argc>2 && file2) ? argv[2] : argv[1];
70 int num_empty_lines=0;
73 printf(
"//Auto generated file. Do not edit the contents of this file.\n//Update the CHDK/LANG/*.lng files to make changes.\n//Generated from %s\n\n",lng_filename);
77 if (s == 0) s = lng_filename;
else s++;
82 printf(
"static char* gui_lang_default = \n");
88 printf(
"/*%3d*/ \"\\0\"\n", i);
101 if (*from==
'\\' && from[1]!=
'"' && from[1]!=
'n')
110 if (iscond[0] ==
'!')
111 printf(
"#ifndef %s\n/*%3d*/ \"%s\"\n#endif\n \"\\0\"\n", iscond+1, i, buf);
113 printf(
"#ifdef %s\n/*%3d*/ \"%s\"\n#endif\n \"\\0\"\n", iscond, i, buf);
117 printf(
"/*%3d*/ \"%s\\0\"\n",i,buf);
124 if ( num_empty_lines > 50 )
125 printf(
"#warning Too many empty lines are detected. Please ensure that .lng files have serial numbers\n\n");
127 printf(
"//Sanity check of GUI_LANG_ITEMS\n");
129 printf(
"#error GUI_LANG_ITEMS value have to be %d. Please fix at gui_lang.h\n",
num_lines);
char* next_token |
( |
char * |
p, |
|
|
char * |
buf |
|
) |
| |
Definiert in Zeile 213 der Datei makelang.c.
217 if ((*p ==
'\r') || (*p ==
'\n'))
return 0;
218 while (*p && (*p !=
' ') && (*p !=
'\t') && (*p !=
'\r') && (*p !=
'\n')) *
buf++ = *p++;
char* skip_space |
( |
char * |
p) | |
|
Definiert in Zeile 207 der Datei makelang.c.
209 while (*p && ((*p ==
' ') || (*p ==
'\t'))) p++;