Skip to content

Commit

Permalink
Changed the dll file to a new version
Browse files Browse the repository at this point in the history
The regex2.dll is from http://gnuwin32.sourceforge.net
  • Loading branch information
brynne8 committed Jul 31, 2014
1 parent be28e9c commit f787ba9
Showing 1 changed file with 28 additions and 31 deletions.
59 changes: 28 additions & 31 deletions include/regexp.h
Expand Up @@ -7,7 +7,7 @@
#define __REGEXP_H

#ifndef __unix__
#pragma dlink rx.dll
#pragma dlink regex2.dll
#else
#pragma dlink libc.so.6
#endif
Expand All @@ -19,9 +19,10 @@ typedef unsigned int size_t;

// really aren't interested in all the other fields...
struct regex_t {
long p1,p2;
unsigned long int allocated;
unsigned long int used;
size_t re_nsub;
char rest[300];
char rest[20];
};

/* Type for byte offsets within the string. POSIX mandates this. */
Expand All @@ -30,11 +31,7 @@ typedef int regoff_t;
struct regmatch_t
{
regoff_t rm_so; // Byte offset from string's start to substring's start.
regoff_t rm_eo; // Byte offset from string's start to substring's end.
// *fix 1.2.2 The GLIB implementation is slightly different....
#ifndef __unix__
regoff_t final_tag; // data from the cut operator (only pmatch[0])
#endif
regoff_t rm_eo; // Byte offset from string's start to substring's end.
};

// POSIX `cflags' bits (i.e., information for `regcomp').
Expand All @@ -43,31 +40,31 @@ const int REG_EXTENDED = 1, REG_ICASE = 1 << 1, REG_NEWLINE = 1 << 2, REG_NOSUB
// POSIX 'eflags' biits (for regexec)
const int REG_NOTBOL = 1, REG_NOTEOL = 1 << 1, REG_ALLOC_REGS = 1 << 2;

#define REG_NOERROR 0 /* Success. */
#define REG_NOMATCH 1 /* Didn't find a match (for regexec). */
typedef enum
{
REG_NOERROR = 0, /* Success. */
REG_NOMATCH, /* Didn't find a match (for regexec). */

// this stuff comes directly from inst-rxposix.h
/* POSIX regcomp return error codes.
* (In the order listed in the standard.)
*/
#define REG_BADPAT 2 /* Invalid pattern. */
#define REG_ECOLLATE 3 /* Not implemented. */
#define REG_ECTYPE 4 /* Invalid character class name. */
#define REG_EESCAPE 5 /* Trailing backslash. */
#define REG_ESUBREG 6 /* Invalid back reference. */
#define REG_EBRACK 7 /* Unmatched left bracket. */
#define REG_EPAREN 8 /* Parenthesis imbalance. */
#define REG_EBRACE 9 /* Unmatched \{. */
#define REG_BADBR 10 /* Invalid contents of \{\}. */
#define REG_ERANGE 11 /* Invalid range end. */
#define REG_ESPACE 12 /* Ran out of memory. */
#define REG_BADRPT 13 /* No preceding re for repetition op. */
/* POSIX regcomp return error codes. (In the order listed in the
standard.) */
REG_BADPAT, /* Invalid pattern. */
REG_ECOLLATE, /* Inalid collating element. */
REG_ECTYPE, /* Invalid character class name. */
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
REG_ESPACE, /* Ran out of memory. */
REG_BADRPT, /* No preceding re for repetition op. */

/* Error codes we've added.
*/
#define REG_EEND 14 /* Premature end. */
#define REG_ESIZE 15 /* Compiled pattern bigger than 2^16 bytes. */
#define REG_ERPAREN 16 /* Unmatched ) or \); not returned from regcomp. */
/* Error codes we've added. */
REG_EEND, /* Premature end. */
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
} reg_errcode_t;

extern "C" {
int regcomp (regex_t * preg, const char * pattern, int cflags);
Expand Down

0 comments on commit f787ba9

Please sign in to comment.