Commit d47e94fb authored by unknown's avatar unknown

Preparing to support character set in error messages

parent 894e4340
......@@ -24,11 +24,13 @@
#define MAXLENGTH 1000
#define MAX_ROWS 1000
#define MAX_FILES 10
#define MAX_CHARSET_NAME 64
int row_count;
uint file_pos[MAX_ROWS],file_row_pos[MAX_FILES];
my_string saved_row[MAX_ROWS];
uchar file_head[]= { 254,254,2,1 };
char charset_name[MAX_CHARSET_NAME];
static void get_options(int *argc,char **argv[]);
static int count_rows(FILE *from,pchar c, pchar c2);
......@@ -61,6 +63,13 @@ int main(int argc,char *argv[])
}
VOID(count_rows(from,'"','}')); /* Calculate start-info */
if (!charset_name[0])
{
fprintf(stderr,"Character set is not specified in '%s'\n",*argv);
fclose(from);
goto end;
}
if (remember_rows(from,'}') < 0) /* Remember rows */
{
fprintf(stderr,"Can't find textrows in '%s'\n",*argv);
......@@ -134,6 +143,11 @@ static void get_options(register int *argc,register char **argv[])
case 'V':
printf("%s (Compile errormessage) Ver 1.3\n",progname);
break;
case 'C':
printf("pos=%s\n", pos+1);
charsets_dir= pos+1;
*(pos--)= '\0';
break;
case 'I':
case '?':
printf(" %s (Compile errormessage) Ver 1.3\n",progname);
......@@ -168,8 +182,19 @@ static int count_rows(FILE *from, pchar c, pchar c2)
DBUG_ENTER("count_rows");
pos=ftell(from); count=0;
charset_name[0]= '\0';
while (fgets(rad,MAXLENGTH,from) != NULL)
{
if (!strncmp(rad,"character-set=",14))
{
char *b= rad+14, *e;
for (e=b ; e[0] && e-b < MAX_CHARSET_NAME &&
e[0] != ' ' && e[0] != '\r' &&
e[0] != '\n' && e[0] != '\t' ; e++);
e[0]= '\0';
strcpy(charset_name, b);
}
if (rad[0] == c || rad[0] == c2)
break;
count++;
......
......@@ -10,6 +10,8 @@
Thu Nov 30 14:02:52 MET 2000 podle 3.23.28
*/
character-set=latin2
"hashchk",
"isamchk",
"NE",
......
......@@ -4,6 +4,8 @@
/* Knud Riishøjgård knudriis@post.tele.dk 99 &&
Carsten H. Pedersen, carsten.pedersen@bitbybit.dk oct. 1999 / aug. 2001. */
character-set=latin1
"hashchk",
"isamchk",
"NEJ",
......
......@@ -12,6 +12,8 @@
Translated new error messages.
*/
character-set=latin1
"hashchk",
"isamchk",
"NEE",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
character-set=latin1
"hashchk",
"isamchk",
"NO",
......
......@@ -6,6 +6,8 @@
*/
character-set=latin7
"hashchk",
"isamchk",
"EI",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
character-set=latin1
"hashchk",
"isamchk",
"NON",
......
......@@ -10,6 +10,8 @@
2002-12-11
*/
character-set=latin1
"hashchk",
"isamchk",
"Nein",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
character-set=greek
"hashchk",
"isamchk",
"",
......
......@@ -3,6 +3,8 @@
Updated May, 2000
This file is public domain and comes with NO WARRANTY of any kind */
character-set=latin2
"hashchk",
"isamchk",
"NEM",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
character-set=latin1
"hashchk",
"isamchk",
"NO",
......
......@@ -3,6 +3,8 @@
3.22.10-beta euc-japanese (ujis) text
*/
character-set=ujis
"hashchk",
"isamchk",
"NO",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This 화일 is public domain and comes with NO WARRANTY of any kind */
character-set=euckr
"hashchk",
"isamchk",
"아니오",
......
......@@ -3,6 +3,8 @@
/* Roy-Magne Mo rmo@www.hivolda.no 97 */
character-set=latin1
"hashchk",
"isamchk",
"NEI",
......
......@@ -3,6 +3,8 @@
/* Roy-Magne Mo rmo@www.hivolda.no 97 */
character-set=latin1
"hashchk",
"isamchk",
"NEI",
......
......@@ -5,6 +5,8 @@
Charset ISO-8859-2
*/
character-set=latin2
"hashchk",
"isamchk",
"NIE",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
/* Updated by Thiago Delgado Pinto - thiagodp@ieg.com.br - 06.07.2002 */
character-set=latin1
"hashchk",
"isamchk",
"NÃO",
......
......@@ -5,6 +5,8 @@
e-mail: tzoompy@cs.washington.edu
*/
character-set=latin2
"hashchk",
"isamchk",
"NU",
......
......@@ -3,6 +3,8 @@
This file is public domain and comes with NO WARRANTY of any kind */
/* charset: KOI8-R */
character-set=koi8r
"hashchk",
"isamchk",
"",
......
......@@ -7,6 +7,8 @@
Charset: cp1250
*/
character-set=cp1250
"hashchk",
"isamchk",
"NE",
......
......@@ -9,6 +9,8 @@
Date: Streda 11. November 1998 20:58:15
*/
character-set=latin2
"hashchk",
"isamchk",
"NIE",
......
......@@ -2,6 +2,9 @@
This file is public domain and comes with NO WARRANTY of any kind
Traduccion por Miguel Angel Fernandez Roiz -- LoboCom Sistemas, s.l.
From June 28, 2001 translated by Miguel Solorzano miguel@mysql.com */
character-set=latin1
"hashchk",
"isamchk",
"NO",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
character-set=latin1
"hashchk",
"isamchk",
"NO",
......
......@@ -6,6 +6,8 @@
* Version: 13/09/2001 mysql-3.23.41
*/
character-set=koi8u
"hashchk",
"isamchk",
"",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment