Update of /cvsroot/opengtoolkit/serial/c_source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26500/c_source Modified Files: plist.h Added Files: chartables.c config.h dftables.c dftables.exe dftables.vcproj get.c internal.h listports.c listports.h lvserial.ico lvserial.ncb lvserial.rc lvserial.sln lvserial.suo lvserial.vcproj maketables.c pcre.c pcre.h pcreposix.c pcreposix.h resource.h study.c ucp.c ucp.h ucpinternal.h ucptable.c ucptypetable.c Log Message: --- NEW FILE: ucp.c --- /************************************************* * libucp - Unicode Property Table handler * *************************************************/ /* This function provides a fast way of obtaining the basic Unicode properties of a character, using a compact binary tree that occupies less than 100K bytes. Copyright (c) 2004 University of Cambridge ------------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of Cambridge nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- */ #include "ucp.h" /* Exported interface */ #include "ucpinternal.h" /* Internal table details */ #include "ucptable.c" /* The table itself */ /************************************************* * Search table and return data * *************************************************/ /* Two values are returned: the category is ucp_C, ucp_L, etc. The detailed character type is ucp_Lu, ucp_Nd, etc. Arguments: c the character value type_ptr the detailed character type is returned here case_ptr for letters, the opposite case is returned here, if there is one, else zero Returns: the character type category or -1 if not found */ static int ucp_findchar(const int c, int *type_ptr, int *case_ptr) { cnode *node = ucp_table; register int cc = c; int case_offset; for (;;) { register int d = node->f1 | ((node->f0 & f0_chhmask) << 16); if (cc == d) break; if (cc < d) { if ((node->f0 & f0_leftexists) == 0) return -1; node ++; } else { register int roffset = (node->f2 & f2_rightmask) >> f2_rightshift; if (roffset == 0) return -1; node += 1 << (roffset - 1); } } switch ((*type_ptr = ((node->f0 & f0_typemask) >> f0_typeshift))) { case ucp_Cc: case ucp_Cf: case ucp_Cn: case ucp_Co: case ucp_Cs: return ucp_C; break; case ucp_Ll: case ucp_Lu: case_offset = node->f2 & f2_casemask; if ((case_offset & 0x0100) != 0) case_offset |= 0xfffff000; *case_ptr = (case_offset == 0)? 0 : cc + case_offset; return ucp_L; case ucp_Lm: case ucp_Lo: case ucp_Lt: *case_ptr = 0; return ucp_L; break; case ucp_Mc: case ucp_Me: case ucp_Mn: return ucp_M; break; case ucp_Nd: case ucp_Nl: case ucp_No: return ucp_N; break; case ucp_Pc: case ucp_Pd: case ucp_Pe: case ucp_Pf: case ucp_Pi: case ucp_Ps: case ucp_Po: return ucp_P; break; case ucp_Sc: case ucp_Sk: case ucp_Sm: case ucp_So: return ucp_S; break; case ucp_Zl: case ucp_Zp: case ucp_Zs: return ucp_Z; break; default: /* "Should never happen" */ return -1; break; } } /* End of ucp.c */ --- NEW FILE: lvserial.sln --- Microsoft Visual Studio Solution File, Format Version 7.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lvserial", "lvserial.vcproj", "{1CD853E4-2CCB-499E-B9BF-9E653D6D3B54}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dftables", "dftables.vcproj", "{0E49C1D0-1D2F-46C3-932F-6C8D08DA2FA0}" EndProject Global GlobalSection(SolutionConfiguration) = preSolution ConfigName.0 = Debug ConfigName.1 = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {1CD853E4-2CCB-499E-B9BF-9E653D6D3B54}.Debug.ActiveCfg = Debug|Win32 {1CD853E4-2CCB-499E-B9BF-9E653D6D3B54}.Debug.Build.0 = Debug|Win32 {1CD853E4-2CCB-499E-B9BF-9E653D6D3B54}.Release.ActiveCfg = Release|Win32 {1CD853E4-2CCB-499E-B9BF-9E653D6D3B54}.Release.Build.0 = Release|Win32 {0E49C1D0-1D2F-46C3-932F-6C8D08DA2FA0}.Debug.ActiveCfg = Debug|Win32 {0E49C1D0-1D2F-46C3-932F-6C8D08DA2FA0}.Debug.Build.0 = Debug|Win32 {0E49C1D0-1D2F-46C3-932F-6C8D08DA2FA0}.Release.ActiveCfg = Release|Win32 {0E49C1D0-1D2F-46C3-932F-6C8D08DA2FA0}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal --- NEW FILE: listports.c --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ucp.h --- /************************************************* * libucp - Unicode Property Table handler * *************************************************/ /* These are the character categories that are returned by ucp_findchar */ enum { ucp_C, /* Other */ ucp_L, /* Letter */ ucp_M, /* Mark */ ucp_N, /* Number */ ucp_P, /* Punctuation */ ucp_S, /* Symbol */ ucp_Z /* Separator */ }; /* These are the detailed character types that are returned by ucp_findchar */ enum { ucp_Cc, /* Control */ ucp_Cf, /* Format */ ucp_Cn, /* Unassigned */ ucp_Co, /* Private use */ ucp_Cs, /* Surrogate */ ucp_Ll, /* Lower case letter */ ucp_Lm, /* Modifier letter */ ucp_Lo, /* Other letter */ ucp_Lt, /* Title case letter */ ucp_Lu, /* Upper case letter */ ucp_Mc, /* Spacing mark */ ucp_Me, /* Enclosing mark */ ucp_Mn, /* Non-spacing mark */ ucp_Nd, /* Decimal number */ ucp_Nl, /* Letter number */ ucp_No, /* Other number */ ucp_Pc, /* Connector punctuation */ ucp_Pd, /* Dash punctuation */ ucp_Pe, /* Close punctuation */ ucp_Pf, /* Final punctuation */ ucp_Pi, /* Initial punctuation */ ucp_Po, /* Other punctuation */ ucp_Ps, /* Open punctuation */ ucp_Sc, /* Currency symbol */ ucp_Sk, /* Modifier symbol */ ucp_Sm, /* Mathematical symbol */ ucp_So, /* Other symbol */ ucp_Zl, /* Line separator */ ucp_Zp, /* Paragraph separator */ ucp_Zs /* Space separator */ }; /* For use in PCRE we make this function static so that there is no conflict if PCRE is linked with an application that makes use of an external version - assuming an external version is ever released... */ static int ucp_findchar(const int, int *, int *); /* End of ucp.h */ --- NEW FILE: ucpinternal.h --- /************************************************* * libucp - Unicode Property Table handler * *************************************************/ /* Internal header file defining the layout of compact nodes in the tree. */ typedef struct cnode { unsigned short int f0; unsigned short int f1; unsigned short int f2; } cnode; /* Things for the f0 field */ #define f0_leftexists 0x8000 /* Left child exists */ #define f0_typemask 0x3f00 /* Type bits */ #define f0_typeshift 8 /* Type shift */ #define f0_chhmask 0x00ff /* Character high bits */ /* Things for the f2 field */ #define f2_rightmask 0xf000 /* Mask for right offset bits */ #define f2_rightshift 12 /* Shift for right offset */ #define f2_casemask 0x0fff /* Mask for case offset */ /* The tree consists of a vector of structures of type cnode, with the root node as the first element. The three short ints (16-bits) are used as follows: (f0) (1) The 0x8000 bit of f0 is set if a left child exists. The child's node is the next node in the vector. (2) The 0x4000 bits of f0 is spare. (3) The 0x3f00 bits of f0 contain the character type; this is a number defined by the enumeration in ucp.h (e.g. ucp_Lu). (4) The bottom 8 bits of f0 contain the most significant byte of the character's 24-bit codepoint. (f1) (1) The f1 field contains the two least significant bytes of the codepoint. (f2) (1) The 0xf000 bits of f2 contain zero if there is no right child of this node. Otherwise, they contain one plus the exponent of the power of two of the offset to the right node (e.g. a value of 3 means 8). The units of the offset are node items. (2) The 0x0fff bits of f2 contain the signed offset from this character to its alternate cased value. They are zero if there is no such character. ----------------------------------------------------------------------------- ||.|.| type (6) | ms char (8) || ls char (16) ||....| case offset (12) || ----------------------------------------------------------------------------- | | | | |-> spare | | exponent of right |-> left child exists child offset The upper/lower casing information is set only for characters that come in pairs. There are (at present) four non-one-to-one mappings in the Unicode data. These are ignored. They are: 1FBE Greek Prosgegrammeni (lower, with upper -> capital iota) 2126 Ohm 212A Kelvin 212B Angstrom Certainly for the last three, having an alternate case would seem to be a mistake. I don't know any Greek, so cannot comment on the first one. When searching the tree, proceed as follows: (1) Start at the first node. (2) Extract the character value from f1 and the bottom 8 bits of f0; (3) Compare with the character being sought. If equal, we are done. (4) If the test character is smaller, inspect the f0_leftexists flag. If it is not set, the character is not in the tree. If it is set, move to the next node, and go to (2). (5) If the test character is bigger, extract the f2_rightmask bits from f2, and shift them right by f2_rightshift. If the result is zero, the character is not in the tree. Otherwise, calculate the number of nodes to skip by shifting the value 1 left by this number minus one. Go to (2). */ /* End of internal.h */ --- NEW FILE: listports.h --- /* A small library that lists serial ports available on the system, both on * 9x/ME and NT4.0/2000 platforms. * Infrared serial ports are listed as well. * * LEGAL: * * (C) 2001 Joaquín Mª López Muñoz (jo...@ti...). All rights reserved. * * Permission is granted to use, distribute and modify this code provided that: * · this copyright notice remain unchanged, * · you submit all changes to the copyright holder and properly mark the * changes so they can be told from the original code, * · credits are given to the copyright holder in the documentation of any * software using this code with the following line: * "Portions copyright 2001 Joaquín Mª López Muñoz (jo...@ti...)" * * The author welcomes any suggestions on the code or reportings of actual * use of the code. Please send your comments to jo...@ti.... * * The author makes NO WARRANTY or representation, either express or implied, * with respect to this code, its quality, accuracy, merchantability, or * fitness for a particular purpose. This software is provided "AS IS", and * you, its user, assume the entire risk as to its quality and accuracy. * * Last modified: July 16th, 2001 */ #ifndef LISTPORTS_H #define LISTPORTS_H #define VERSION_LISTPORTS 0x00010000 #if defined(__cplusplus) || defined(__cplusplus__) extern "C" { #endif #include <windows.h> typedef struct { LPCTSTR lpPortName; /* "COM1", etc. */ LPCTSTR lpFriendlyName; /* Suitable to describe the port, as for */ /* instance "Infrared serial port (COM4)" */ }LISTPORTS_PORTINFO; typedef BOOL (CALLBACK* LISTPORTS_CALLBACK)(LPVOID lpCallbackValue, LISTPORTS_PORTINFO* lpPortInfo); /* User provided callback funtion that receives the information on each * serial port available. * The strings provided on the LISTPORTS_INFO are not to be referenced after * the callback returns; instead make copies of them for later use. * If the callback returns FALSE, port enumeration is aborted. */ BOOL ListPorts(LISTPORTS_CALLBACK lpCallback,LPVOID lpCallbackValue); /* Lists serial ports available on the system, passing the information on * each port on succesive calls to lpCallback. * lpCallbackValue, treated opaquely by ListPorts(), is intended to carry * information internal to the callback routine. * Returns TRUE if succesful, otherwise error code can be retrieved via * GetLastError(). */ #if defined(__cplusplus) || defined(__cplusplus__) } #endif #elif VERSION_LISTPORTS!=0x00010000 #error You have included two LISTPORTS.H with different version numbers #endif --- NEW FILE: chartables.c --- /************************************************* * Perl-Compatible Regular Expressions * *************************************************/ /* This file is automatically written by the dftables auxiliary program. If you edit it by hand, you might like to edit the Makefile to prevent its ever being regenerated. This file is #included in the compilation of pcre.c to build the default character tables which are used when no tables are passed to the compile function. */ static unsigned char pcre_default_tables[] = { /* This table is a lower casing table. */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99,100,101,102,103, 104,105,106,107,108,109,110,111, 112,113,114,115,116,117,118,119, 120,121,122, 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103, 104,105,106,107,108,109,110,111, 112,113,114,115,116,117,118,119, 120,121,122,123,124,125,126,127, 128,129,130,131,132,133,134,135, 136,137,138,139,140,141,142,143, 144,145,146,147,148,149,150,151, 152,153,154,155,156,157,158,159, 160,161,162,163,164,165,166,167, 168,169,170,171,172,173,174,175, 176,177,178,179,180,181,182,183, 184,185,186,187,188,189,190,191, 192,193,194,195,196,197,198,199, 200,201,202,203,204,205,206,207, 208,209,210,211,212,213,214,215, 216,217,218,219,220,221,222,223, 224,225,226,227,228,229,230,231, 232,233,234,235,236,237,238,239, 240,241,242,243,244,245,246,247, 248,249,250,251,252,253,254,255, /* This table is a case flipping table. */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99,100,101,102,103, 104,105,106,107,108,109,110,111, 112,113,114,115,116,117,118,119, 120,121,122, 91, 92, 93, 94, 95, 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, 128,129,130,131,132,133,134,135, 136,137,138,139,140,141,142,143, 144,145,146,147,148,149,150,151, 152,153,154,155,156,157,158,159, 160,161,162,163,164,165,166,167, 168,169,170,171,172,173,174,175, 176,177,178,179,180,181,182,183, 184,185,186,187,188,189,190,191, 192,193,194,195,196,197,198,199, 200,201,202,203,204,205,206,207, 208,209,210,211,212,213,214,215, 216,217,218,219,220,221,222,223, 224,225,226,227,228,229,230,231, 232,233,234,235,236,237,238,239, 240,241,242,243,244,245,246,247, 248,249,250,251,252,253,254,255, /* This table contains bit maps for various character classes. Each map is 32 bytes long and the bits run from the least significant end of each byte. The classes that have their own maps are: space, xdigit, digit, upper, lower, word, graph print, punct, and cntrl. Other classes are built from combinations. */ 0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, 0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, 0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc, 0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* This table identifies various classes of character by individual bits: 0x01 white space character 0x02 letter 0x04 decimal digit 0x08 hexadecimal digit 0x10 alphanumeric or '_' 0x80 regular expression metacharacter or binary zero */ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ 0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ 0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */ 0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */ 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */ 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */ 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */ 0x12,0x12,0x12,0x80,0x00,0x00,0x80,0x10, /* X - _ */ 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */ 0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /* x -127 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */ /* End of chartables.c */ --- NEW FILE: lvserial.vcproj --- <?xml version="1.0" encoding = "Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.00" Name="lvserial" ProjectGUID="{1CD853E4-2CCB-499E-B9BF-9E653D6D3B54}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="2" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LVSERIAL_EXPORTS" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="1" BufferSecurityCheck="FALSE" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalOptions="/NODEFAULTLIB:msvcrt.lib" OutputFile="$(OutDir)/lvserial.dll" LinkIncremental="2" ModuleDefinitionFile="lvserial.def" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/lvserial.pdb" SubSystem="2" ImportLibrary="$(OutDir)/lvserial.lib" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="2" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="TRUE" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LVSERIAL_EXPORTS" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalOptions="/NODEFAULTLIB:libcmt.lib" OutputFile="$(OutDir)/lvserial.dll" LinkIncremental="1" ModuleDefinitionFile="lvserial.def" GenerateDebugInformation="TRUE" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" ImportLibrary="$(OutDir)/lvserial.lib" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> </Configurations> <Files> <Filter Name="Quelldateien" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> <File RelativePath="dftables.exe"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="dftables chartables.c" Outputs="chartables.c"/> </FileConfiguration> </File> <File RelativePath="get.c"> </File> <File RelativePath="listports.c"> </File> <File RelativePath="lv_error.cpp"> </File> <File RelativePath="lvserial.cpp"> </File> <File RelativePath="lvserial.def"> </File> <File RelativePath="maketables.c"> </File> <File RelativePath="pcre.c"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" Detect64BitPortabilityProblems="FALSE"/> </FileConfiguration> </File> <File RelativePath="pcreposix.c"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" Detect64BitPortabilityProblems="FALSE"/> </FileConfiguration> </File> <File RelativePath="plist.cpp"> </File> <File RelativePath="study.c"> </File> </Filter> <Filter Name="Headerdateien" Filter="h;hpp;hxx;hm;inl;inc"> <File RelativePath="config.h"> </File> <File RelativePath="internal.h"> </File> <File RelativePath="listports.h"> </File> <File RelativePath="lv_error.h"> </File> <File RelativePath="lvserial.h"> </File> <File RelativePath="lvserialrc.h"> </File> <File RelativePath="pcre.h"> </File> <File RelativePath="pcreposix.h"> </File> <File RelativePath="plist.h"> </File> <File RelativePath="resource.h"> </File> <File RelativePath="ucp.c"> <FileConfiguration Name="Debug|Win32" ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> </File> <File RelativePath="ucp.h"> </File> <File RelativePath="ucpinternal.h"> </File> <File RelativePath="ucptable.c"> <FileConfiguration Name="Debug|Win32" ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> </File> <File RelativePath="ucptypetable.c"> <FileConfiguration Name="Debug|Win32" ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> </File> </Filter> <Filter Name="Ressourcendateien" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> <File RelativePath="lvserial.ico"> </File> <File RelativePath="lvserial.rc"> </File> </Filter> <Filter Name="Libraries" Filter=""> <File RelativePath="C:\Programme\National Instruments\LabVIEW 6.1\cintools\labview.lib"> </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: study.c --- /************************************************* * Perl-Compatible Regular Expressions * *************************************************/ /* This is a library of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language. See the file Tech.Notes for some information on the internals. Written by: Philip Hazel <ph...@ca...> Copyright (c) 1997-2004 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of Cambridge nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ /* Include the internals header, which itself includes Standard C headers plus the external pcre header. */ #include "internal.h" /************************************************* * Set a bit and maybe its alternate case * *************************************************/ /* Given a character, set its bit in the table, and also the bit for the other version of a letter if we are caseless. Arguments: start_bits points to the bit map c is the character caseless the caseless flag cd the block with char table pointers Returns: nothing */ static void set_bit(uschar *start_bits, unsigned int c, BOOL caseless, compile_data *cd) { start_bits[c/8] |= (1 << (c&7)); if (caseless && (cd->ctypes[c] & ctype_letter) != 0) start_bits[cd->fcc[c]/8] |= (1 << (cd->fcc[c]&7)); } /************************************************* * Create bitmap of starting chars * *************************************************/ /* This function scans a compiled unanchored expression and attempts to build a bitmap of the set of initial characters. If it can't, it returns FALSE. As time goes by, we may be able to get more clever at doing this. Arguments: code points to an expression start_bits points to a 32-byte table, initialized to 0 caseless the current state of the caseless flag utf8 TRUE if in UTF-8 mode cd the block with char table pointers Returns: TRUE if table built, FALSE otherwise */ static BOOL set_start_bits(const uschar *code, uschar *start_bits, BOOL caseless, BOOL utf8, compile_data *cd) { register int c; /* This next statement and the later reference to dummy are here in order to trick the optimizer of the IBM C compiler for OS/2 into generating correct code. Apparently IBM isn't going to fix the problem, and we would rather not disable optimization (in this module it actually makes a big difference, and the pcre module can use all the optimization it can get). */ volatile int dummy; do { const uschar *tcode = code + 1 + LINK_SIZE; BOOL try_next = TRUE; while (try_next) { /* If a branch starts with a bracket or a positive lookahead assertion, recurse to set bits from within them. That's all for this branch. */ if ((int)*tcode >= OP_BRA || *tcode == OP_ASSERT) { if (!set_start_bits(tcode, start_bits, caseless, utf8, cd)) return FALSE; try_next = FALSE; } else switch(*tcode) { default: return FALSE; /* Skip over callout */ case OP_CALLOUT: tcode += 2 + 2*LINK_SIZE; break; /* Skip over extended extraction bracket number */ case OP_BRANUMBER: tcode += 3; break; /* Skip over lookbehind and negative lookahead assertions */ case OP_ASSERT_NOT: case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: do tcode += GET(tcode, 1); while (*tcode == OP_ALT); tcode += 1+LINK_SIZE; break; /* Skip over an option setting, changing the caseless flag */ case OP_OPT: caseless = (tcode[1] & PCRE_CASELESS) != 0; tcode += 2; break; /* BRAZERO does the bracket, but carries on. */ case OP_BRAZERO: case OP_BRAMINZERO: if (!set_start_bits(++tcode, start_bits, caseless, utf8, cd)) return FALSE; dummy = 1; do tcode += GET(tcode,1); while (*tcode == OP_ALT); tcode += 1+LINK_SIZE; break; /* Single-char * or ? sets the bit and tries the next item */ case OP_STAR: case OP_MINSTAR: case OP_QUERY: case OP_MINQUERY: set_bit(start_bits, tcode[1], caseless, cd); tcode += 2; #ifdef SUPPORT_UTF8 if (utf8) while ((*tcode & 0xc0) == 0x80) tcode++; #endif break; /* Single-char upto sets the bit and tries the next */ case OP_UPTO: case OP_MINUPTO: set_bit(start_bits, tcode[3], caseless, cd); tcode += 4; #ifdef SUPPORT_UTF8 if (utf8) while ((*tcode & 0xc0) == 0x80) tcode++; #endif break; /* At least one single char sets the bit and stops */ case OP_EXACT: /* Fall through */ tcode += 2; case OP_CHAR: case OP_CHARNC: case OP_PLUS: case OP_MINPLUS: set_bit(start_bits, tcode[1], caseless, cd); try_next = FALSE; break; /* Single character type sets the bits and stops */ case OP_NOT_DIGIT: for (c = 0; c < 32; c++) start_bits[c] |= ~cd->cbits[c+cbit_digit]; try_next = FALSE; break; case OP_DIGIT: for (c = 0; c < 32; c++) start_bits[c] |= cd->cbits[c+cbit_digit]; try_next = FALSE; break; case OP_NOT_WHITESPACE: for (c = 0; c < 32; c++) start_bits[c] |= ~cd->cbits[c+cbit_space]; try_next = FALSE; break; case OP_WHITESPACE: for (c = 0; c < 32; c++) start_bits[c] |= cd->cbits[c+cbit_space]; try_next = FALSE; break; case OP_NOT_WORDCHAR: for (c = 0; c < 32; c++) start_bits[c] |= ~cd->cbits[c+cbit_word]; try_next = FALSE; break; case OP_WORDCHAR: for (c = 0; c < 32; c++) start_bits[c] |= cd->cbits[c+cbit_word]; try_next = FALSE; break; /* One or more character type fudges the pointer and restarts, knowing it will hit a single character type and stop there. */ case OP_TYPEPLUS: case OP_TYPEMINPLUS: tcode++; break; case OP_TYPEEXACT: tcode += 3; break; /* Zero or more repeats of character types set the bits and then try again. */ case OP_TYPEUPTO: case OP_TYPEMINUPTO: tcode += 2; /* Fall through */ case OP_TYPESTAR: case OP_TYPEMINSTAR: case OP_TYPEQUERY: case OP_TYPEMINQUERY: switch(tcode[1]) { case OP_ANY: return FALSE; case OP_NOT_DIGIT: for (c = 0; c < 32; c++) start_bits[c] |= ~cd->cbits[c+cbit_digit]; break; case OP_DIGIT: for (c = 0; c < 32; c++) start_bits[c] |= cd->cbits[c+cbit_digit]; break; case OP_NOT_WHITESPACE: for (c = 0; c < 32; c++) start_bits[c] |= ~cd->cbits[c+cbit_space]; break; case OP_WHITESPACE: for (c = 0; c < 32; c++) start_bits[c] |= cd->cbits[c+cbit_space]; break; case OP_NOT_WORDCHAR: for (c = 0; c < 32; c++) start_bits[c] |= ~cd->cbits[c+cbit_word]; break; case OP_WORDCHAR: for (c = 0; c < 32; c++) start_bits[c] |= cd->cbits[c+cbit_word]; break; } tcode += 2; break; /* Character class where all the information is in a bit map: set the bits and either carry on or not, according to the repeat count. If it was a negative class, and we are operating with UTF-8 characters, any byte with a value >= 0xc4 is a potentially valid starter because it starts a character with a value > 255. */ case OP_NCLASS: if (utf8) { start_bits[24] |= 0xf0; /* Bits for 0xc4 - 0xc8 */ memset(start_bits+25, 0xff, 7); /* Bits for 0xc9 - 0xff */ } /* Fall through */ case OP_CLASS: { tcode++; /* In UTF-8 mode, the bits in a bit map correspond to character values, not to byte values. However, the bit map we are constructing is for byte values. So we have to do a conversion for characters whose value is > 127. In fact, there are only two possible starting bytes for characters in the range 128 - 255. */ if (utf8) { for (c = 0; c < 16; c++) start_bits[c] |= tcode[c]; for (c = 128; c < 256; c++) { if ((tcode[c/8] && (1 << (c&7))) != 0) { int d = (c >> 6) | 0xc0; /* Set bit for this starter */ start_bits[d/8] |= (1 << (d&7)); /* and then skip on to the */ c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */ } } } /* In non-UTF-8 mode, the two bit maps are completely compatible. */ else { for (c = 0; c < 32; c++) start_bits[c] |= tcode[c]; } /* Advance past the bit map, and act on what follows */ tcode += 32; switch (*tcode) { case OP_CRSTAR: case OP_CRMINSTAR: case OP_CRQUERY: case OP_CRMINQUERY: tcode++; break; case OP_CRRANGE: case OP_CRMINRANGE: if (((tcode[1] << 8) + tcode[2]) == 0) tcode += 5; else try_next = FALSE; break; default: try_next = FALSE; break; } } break; /* End of bitmap class handling */ } /* End of switch */ } /* End of try_next loop */ code += GET(code, 1); /* Advance to next branch */ } while (*code == OP_ALT); return TRUE; } /************************************************* * Study a compiled expression * *************************************************/ /* This function is handed a compiled expression that it must study to produce information that will speed up the matching. It returns a pcre_extra block which then gets handed back to pcre_exec(). Arguments: re points to the compiled expression options contains option bits errorptr points to where to place error messages; set NULL unless error Returns: pointer to a pcre_extra block, with study_data filled in and the appropriate flag set; NULL on error or if no optimization possible */ EXPORT pcre_extra * pcre_study(const pcre *external_re, int options, const char **errorptr) { uschar start_bits[32]; pcre_extra *extra; pcre_study_data *study; const uschar *tables; const real_pcre *re = (const real_pcre *)external_re; uschar *code = (uschar *)re + re->name_table_offset + (re->name_count * re->name_entry_size); compile_data compile_block; *errorptr = NULL; if (re == NULL || re->magic_number != MAGIC_NUMBER) { *errorptr = "argument is not a compiled regular expression"; return NULL; } if ((options & ~PUBLIC_STUDY_OPTIONS) != 0) { *errorptr = "unknown or incorrect option bit(s) set"; return NULL; } /* For an anchored pattern, or an unanchored pattern that has a first char, or a multiline pattern that matches only at "line starts", no further processing at present. */ if ((re->options & (PCRE_ANCHORED|PCRE_FIRSTSET|PCRE_STARTLINE)) != 0) return NULL; /* Set the character tables in the block that is passed around */ tables = re->tables; if (tables == NULL) (void)pcre_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES, &tables); compile_block.lcc = tables + lcc_offset; compile_block.fcc = tables + fcc_offset; compile_block.cbits = tables + cbits_offset; compile_block.ctypes = tables + ctypes_offset; /* See if we can find a fixed set of initial characters for the pattern. */ memset(start_bits, 0, 32 * sizeof(uschar)); if (!set_start_bits(code, start_bits, (re->options & PCRE_CASELESS) != 0, (re->options & PCRE_UTF8) != 0, &compile_block)) return NULL; /* Get a pcre_extra block and a pcre_study_data block. The study data is put in the latter, which is pointed to by the former, which may also get additional data set later by the calling program. At the moment, the size of pcre_study_data is fixed. We nevertheless save it in a field for returning via the pcre_fullinfo() function so that if it becomes variable in the future, we don't have to change that code. */ extra = (pcre_extra *)(pcre_malloc) (sizeof(pcre_extra) + sizeof(pcre_study_data)); if (extra == NULL) { *errorptr = "failed to get memory"; return NULL; } study = (pcre_study_data *)((char *)extra + sizeof(pcre_extra)); extra->flags = PCRE_EXTRA_STUDY_DATA; extra->study_data = study; study->size = sizeof(pcre_study_data); study->options = PCRE_STUDY_MAPPED; memcpy(study->start_bits, start_bits, sizeof(start_bits)); return extra; } /* End of study.c */ --- NEW FILE: ucptable.c --- /* This source module is automatically generated from the Unicode property table. See internal.h for a description of the layout. */ static cnode ucp_table[] = { { 0x9a00, 0x2f1f, 0xe000 }, { 0x8700, 0x1558, 0xd000 }, { 0x8700, 0x0a99, 0xc000 }, { 0x8500, 0x0435, 0xbfe0 }, { 0x8500, 0x01ff, 0xafff }, { 0x8500, 0x00ff, 0x9079 }, { 0x8000, 0x007f, 0x8000 }, { 0x9500, 0x003f, 0x7000 }, { 0x8000, 0x001f, 0x6000 }, { 0x8000, 0x000f, 0x5000 }, { 0x8000, 0x0007, 0x4000 }, { 0x8000, 0x0003, 0x3000 }, { 0x8000, 0x0001, 0x2000 }, { 0x0000, 0x0000, 0x0000 }, { 0x0000, 0x0002, 0x0000 }, [...15066 lines suppressed...] { 0x8c0e, 0x01e3, 0x3000 }, { 0x8c0e, 0x01e1, 0x2000 }, { 0x0c0e, 0x01e0, 0x0000 }, { 0x0c0e, 0x01e2, 0x0000 }, { 0x8c0e, 0x01e5, 0x2000 }, { 0x0c0e, 0x01e4, 0x0000 }, { 0x0c0e, 0x01e6, 0x0000 }, { 0x8c0e, 0x01ef, 0x4000 }, { 0x8c0e, 0x01eb, 0x3000 }, { 0x8c0e, 0x01e9, 0x2000 }, { 0x0c0e, 0x01e8, 0x0000 }, { 0x0c0e, 0x01ea, 0x0000 }, { 0x8c0e, 0x01ed, 0x2000 }, { 0x0c0e, 0x01ec, 0x0000 }, { 0x0c0e, 0x01ee, 0x0000 }, { 0x830f, 0xfffd, 0x2000 }, { 0x030f, 0x0000, 0x0000 }, { 0x0310, 0x0000, 0x1000 }, { 0x0310, 0xfffd, 0x0000 }, }; --- NEW FILE: lvserial.ico --- (This appears to be a binary file; contents omitted.) --- NEW FILE: maketables.c --- /************************************************* * Perl-Compatible Regular Expressions * *************************************************/ /* PCRE is a library of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language. Written by: Philip Hazel <ph...@ca...> Copyright (c) 1997-2003 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of Cambridge nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ /* This file is compiled on its own as part of the PCRE library. However, it is also included in the compilation of dftables.c, in which case the macro DFTABLES is defined. */ #ifndef DFTABLES #include "internal.h" #endif /************************************************* * Create PCRE character tables * *************************************************/ /* This function builds a set of character tables for use by PCRE and returns a pointer to them. They are build using the ctype functions, and consequently their contents will depend upon the current locale setting. When compiled as part of the library, the store is obtained via pcre_malloc(), but when compiled inside dftables, use malloc(). Arguments: none Returns: pointer to the contiguous block of data */ const unsigned char * pcre_maketables(void) { unsigned char *yield, *p; int i; #ifndef DFTABLES yield = (unsigned char*)(pcre_malloc)(tables_length); #else yield = (unsigned char*)malloc(tables_length); #endif if (yield == NULL) return NULL; p = yield; /* First comes the lower casing table */ for (i = 0; i < 256; i++) *p++ = tolower(i); /* Next the case-flipping table */ for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i); /* Then the character class tables. Don't try to be clever and save effort on exclusive ones - in some locales things may be different. Note that the table for "space" includes everything "isspace" gives, including VT in the default locale. This makes it work for the POSIX class [:space:]. */ memset(p, 0, cbit_length); for (i = 0; i < 256; i++) { if (isdigit(i)) { p[cbit_digit + i/8] |= 1 << (i&7); p[cbit_word + i/8] |= 1 << (i&7); } if (isupper(i)) { p[cbit_upper + i/8] |= 1 << (i&7); p[cbit_word + i/8] |= 1 << (i&7); } if (islower(i)) { p[cbit_lower + i/8] |= 1 << (i&7); p[cbit_word + i/8] |= 1 << (i&7); } if (i == '_') p[cbit_word + i/8] |= 1 << (i&7); if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7); if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7); if (isgraph(i)) p[cbit_graph + i/8] |= 1 << (i&7); if (isprint(i)) p[cbit_print + i/8] |= 1 << (i&7); if (ispunct(i)) p[cbit_punct + i/8] |= 1 << (i&7); if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1 << (i&7); } p += cbit_length; /* Finally, the character type table. In this, we exclude VT from the white space chars, because Perl doesn't recognize it as such for \s and for comments within regexes. */ for (i = 0; i < 256; i++) { int x = 0; if (i != 0x0b && isspace(i)) x += ctype_space; if (isalpha(i)) x += ctype_letter; if (isdigit(i)) x += ctype_digit; if (isxdigit(i)) x += ctype_xdigit; if (isalnum(i) || i == '_') x += ctype_word; /* Note: strchr includes the terminating zero in the characters it considers. In this instance, that is ok because we want binary zero to be flagged as a meta-character, which in this sense is any character that terminates a run of data characters. */ if (strchr("*+?{^.$|()[", i) != 0) x += ctype_meta; *p++ = x; } return yield; } /* End of maketables.c */ --- NEW FILE: resource.h --- //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by lvserial.rc // #define VER_DEBUG 0 #define VER_PATCHED 0 #define VER_PRIVATEBUILD 0 #define VER_PRERELEASE 0 #define FINAL 1 #define IDI_ICON1 102 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 103 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif Index: plist.h =================================================================== RCS file: /cvsroot/opengtoolkit/serial/c_source/plist.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** plist.h 20 Jan 2005 16:49:45 -0000 1.1 --- plist.h 18 Mar 2005 23:23:06 -0000 1.2 *************** *** 33,37 **** } LIST; ! typedef _LIST *PLIST; #pragma pack() --- 33,37 ---- } LIST; ! typedef struct _LIST *PLIST; #pragma pack() --- NEW FILE: dftables.vcproj --- <?xml version="1.0" encoding = "Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.00" Name="dftables" ProjectGUID="{0E49C1D0-1D2F-46C3-932F-6C8D08DA2FA0}" SccProjectName="" SccLocalPath=""> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="." IntermediateDirectory=".\Debug" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="_WIN32,_DEBUG,_CONSOLE" RuntimeLibrary="3" PrecompiledHeaderFile=".\Debug/dftables.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName="Debug\dftables" WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" OutputFile="./dftables.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" GenerateDebugInformation="TRUE" ProgramDatabaseFile="Debug\dftables.pdb" SubSystem="1"/> <Tool Name="VCMIDLTool" TypeLibraryName="./dftables.tlb"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="2057"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="." IntermediateDirectory=".\Release" ConfigurationType="1" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2"> <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" PreprocessorDefinitions="_WIN32,NDEBUG,_CONSOLE" StringPooling="TRUE" RuntimeLibrary="2" EnableFunctionLevelLinking="TRUE" PrecompiledHeaderFile=".\Release/dftables.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName="Release\dftables" WarningLevel="3" SuppressStartupBanner="TRUE"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" OutputFile="./dftables.exe" LinkIncremental="1" SuppressStartupBanner="TRUE" ProgramDatabaseFile="Release\dftables.pdb" SubSystem="1" OptimizeReferences="2"/> <Tool Name="VCMIDLTool" TypeLibraryName="./dftables.tlb"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="2057"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> </Configuration> </Configurations> <Files> <Filter Name="Source Files" Filter=""> <File RelativePath=".\dftables.c"> </File> </Filter> <Filter Name="Header Files" Filter="h;hw"> <File RelativePath="config.h"> </File> <File RelativePath=".\internal.h"> </File> <File RelativePath=".\maketables.c"> <FileConfiguration Name="Debug|Win32" ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> <FileConfiguration Name="Release|Win32" ExcludedFromBuild="TRUE"> <Tool Name="VCCLCompilerTool"/> </FileConfiguration> </File> <File RelativePath="pcre.h"> </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: ucptypetable.c --- /************************************************* * Perl-Compatible Regular Expressions * *************************************************/ /* This is a library of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language. See the file Tech.Notes for some information on the internals. Written by: Philip Hazel <ph...@ca...> Copyright (c) 1997-2004 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of Cambridge nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ /* This module contains a table for translating Unicode property names into code values for the ucp_findchar function. It is in a separate module so that it can be included both in the main pcre library, and into pcretest (for printing out internals). */ typedef struct { const char *name; int value; } ucp_type_table; static ucp_type_table utt[] = { { "C", 128 + ucp_C }, { "Cc", ucp_Cc }, { "Cf", ucp_Cf }, { "Cn", ucp_Cn }, { "Co", ucp_Co }, { "Cs", ucp_Cs }, { "L", 128 + ucp_L }, { "Ll", ucp_Ll }, { "Lm", ucp_Lm }, { "Lo", ucp_Lo }, { "Lt", ucp_Lt }, { "Lu", ucp_Lu }, { "M", 128 + ucp_M }, { "Mc", ucp_Mc }, { "Me", ucp_Me }, { "Mn", ucp_Mn }, { "N", 128 + ucp_N }, { "Nd", ucp_Nd }, { "Nl", ucp_Nl }, { "No", ucp_No }, { "P", 128 + ucp_P }, { "Pc", ucp_Pc }, { "Pd", ucp_Pd }, { "Pe", ucp_Pe }, { "Pf", ucp_Pf }, { "Pi", ucp_Pi }, { "Po", ucp_Po }, { "Ps", ucp_Ps }, { "S", 128 + ucp_S }, { "Sc", ucp_Sc }, { "Sk", ucp_Sk }, { "Sm", ucp_Sm }, { "So", ucp_So }, { "Z", 128 + ucp_Z }, { "Zl", ucp_Zl }, { "Zp", ucp_Zp }, { "Zs", ucp_Zs } }; /* End of ucptypetable.c */ --- NEW FILE: config.h --- /* config.h. Generated by configure. */ /* On Unix systems config.in is converted by configure into config.h. PCRE is written in Standard C, but there are a few non-standard things it can cope with, allowing it to run on SunOS4 and other "close to standard" systems. On a non-Unix system you should just copy this file into config.h, and set up the macros the way you need them. You should normally change the definitions of HAVE_STRERROR and HAVE_MEMMOVE to 1. Unfortunately, because of the way autoconf works, these cannot be made the defaults. If your system has bcopy() and not memmove(), change the definition of HAVE_BCOPY instead of HAVE_MEMMOVE. If your system has neither bcopy() nor memmove(), leave them both as 0; an emulation function will be used. */ /* If you are compiling for a system that uses EBCDIC instead of ASCII character codes, define this macro as 1. On systems that can use "configure", this can be done via --enable-ebcdic. */ #ifndef EBCDIC #define EBCDIC 0 #endif /* If you are compiling for a system that needs some magic to be inserted before the definition of an exported function, define this macro to contain the relevant magic. It apears at the start of every exported function. */ #define EXPORT /* Define to empty if the "const" keyword does not work. */ /* #undef const */ /* Define to "unsigned" if <stddef.h> doesn't define size_t. */ /* #undef size_t */ /* The following two definitions are mainly for the benefit of SunOS4, which doesn't have the strerror() or memmove() functions that should be present in all Standard C libraries. The macros HAVE_STRERROR and HAVE_MEMMOVE should normally be defined with the value 1 for other systems, but unfortunately we can't make this the default because "configure" files generated by autoconf will only change 0 to 1; they won't change 1 to 0 if the functions are not found. */ #define HAVE_STRERROR 1 #define HAVE_MEMMOVE 1 /* There are some non-Unix systems that don't even have bcopy(). If this macro is false, an emulation is used. If HAVE_MEMMOVE is set to 1, the value of HAVE_BCOPY is not relevant. */ #define HAVE_BCOPY 0 /* The value of NEWLINE determines the newline character. The default is to leave it up to the compiler, but some sites want to force a particular value. On Unix systems, "configure" can be used to override this default. */ #ifndef NEWLINE #define NEWLINE '\n' #endif /* The value of LINK_SIZE determines the number of bytes used to store links as offsets within the compiled regex. The default is 2, which allows for compiled patterns up to 64K long. This covers the vast majority of cases. However, PCRE can also be compiled to use 3 or 4 bytes instead. This allows for longer patterns in extreme cases. On Unix systems, "configure" can be used to override this default. */ #ifndef LINK_SIZE #define LINK_SIZE 2 #endif /* The value of MATCH_LIMIT determines the default number of times the match() function can be called during a single execution of pcre_exec(). (There is a runtime method of setting a different limit.) The limit exists in order to catch runaway regular expressions that take for ever to determine that they do not match. The default is set very large so that it does not accidentally catch legitimate cases. On Unix systems, "configure" can be used to override this default default. */ #ifndef MATCH_LIMIT #define MATCH_LIMIT 10000000 #endif /* When calling PCRE via the POSIX interface, additional working storage is required for holding the pointers to capturing substrings because PCRE requires three integers per substring, whereas the POSIX interface provides only two. If the number of expected substrings is small, the wrapper function uses space on the stack, because this is faster than using malloc() for each call. The threshold above which the stack is no longer use is defined by POSIX_MALLOC_ THRESHOLD. On Unix systems, "configure" can be used to override this default. */ #ifndef POSIX_MALLOC_THRESHOLD #define POSIX_MALLOC_THRESHOLD 10 #endif /* PCRE uses recursive function calls to handle backtracking while matching. This can sometimes be a problem on systems that have stacks of limited size. Define NO_RECURSE to get a version that doesn't use recursion in the match() function; instead it creates its own stack by steam using pcre_recurse_malloc to get memory. For more detail, see comments and other stuff just above the match() function. On Unix systems, "configure" can ... [truncated message content] |