| 2 |
* Perl-Compatible Regular Expressions * |
* Perl-Compatible Regular Expressions * |
| 3 |
*************************************************/ |
*************************************************/ |
| 4 |
|
|
| 5 |
/* |
/* PCRE is a library of functions to support regular expressions whose syntax |
|
PCRE is a library of functions to support regular expressions whose syntax |
|
| 6 |
and semantics are as close as possible to those of the Perl 5 language. |
and semantics are as close as possible to those of the Perl 5 language. |
| 7 |
|
|
| 8 |
Written by: Philip Hazel <ph10@cam.ac.uk> |
Written by Philip Hazel |
| 9 |
|
Copyright (c) 1997-2005 University of Cambridge |
|
Copyright (c) 1997-2004 University of Cambridge |
|
| 10 |
|
|
| 11 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 12 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 38 |
*/ |
*/ |
| 39 |
|
|
| 40 |
|
|
| 41 |
/* This is a support program to generate the file chartables.c, containing |
/* This is a freestanding support program to generate a file containing default |
| 42 |
character tables of various kinds. They are built according to the default C |
character tables for PCRE. The tables are built according to the default C |
| 43 |
locale and used as the default tables by PCRE. Now that pcre_maketables is |
locale. Now that pcre_maketables is a function visible to the outside world, we |
| 44 |
a function visible to the outside world, we make use of its code from here in |
make use of its code from here in order to be consistent. */ |
|
order to be consistent. */ |
|
| 45 |
|
|
| 46 |
#include <ctype.h> |
#include <ctype.h> |
| 47 |
#include <stdio.h> |
#include <stdio.h> |
| 48 |
#include <string.h> |
#include <string.h> |
| 49 |
|
|
| 50 |
#include "internal.h" |
#include "pcre_internal.h" |
| 51 |
|
|
| 52 |
#define DFTABLES /* maketables.c notices this */ |
#define DFTABLES /* pcre_maketables.c notices this */ |
| 53 |
#include "maketables.c" |
#include "pcre_maketables.c" |
| 54 |
|
|
| 55 |
|
|
| 56 |
int main(int argc, char **argv) |
int main(int argc, char **argv) |
| 58 |
int i; |
int i; |
| 59 |
FILE *f; |
FILE *f; |
| 60 |
const unsigned char *tables = pcre_maketables(); |
const unsigned char *tables = pcre_maketables(); |
| 61 |
|
const unsigned char *base_of_tables = tables; |
| 62 |
|
|
| 63 |
if (argc != 2) |
if (argc != 2) |
| 64 |
{ |
{ |
| 84 |
"program. If you edit it by hand, you might like to edit the Makefile to \n" |
"program. If you edit it by hand, you might like to edit the Makefile to \n" |
| 85 |
"prevent its ever being regenerated.\n\n"); |
"prevent its ever being regenerated.\n\n"); |
| 86 |
fprintf(f, |
fprintf(f, |
| 87 |
"This file is #included in the compilation of pcre.c to build the default\n" |
"This file contains the default tables for characters with codes less than\n" |
| 88 |
"character tables which are used when no tables are passed to the compile\n" |
"128 (ASCII characters). These tables are used when no external tables are\n" |
| 89 |
"function. */\n\n" |
"passed to PCRE. */\n\n" |
| 90 |
"static unsigned char pcre_default_tables[] = {\n\n" |
"const unsigned char _pcre_default_tables[] = {\n\n" |
| 91 |
"/* This table is a lower casing table. */\n\n"); |
"/* This table is a lower casing table. */\n\n"); |
| 92 |
|
|
| 93 |
fprintf(f, " "); |
fprintf(f, " "); |
| 165 |
fprintf(f, " */\n\n/* End of chartables.c */\n"); |
fprintf(f, " */\n\n/* End of chartables.c */\n"); |
| 166 |
|
|
| 167 |
fclose(f); |
fclose(f); |
| 168 |
|
free((void *)base_of_tables); |
| 169 |
return 0; |
return 0; |
| 170 |
} |
} |
| 171 |
|
|