Home Libraries Author Links

match.h File Reference


Detailed Description

Specification of data types and functions for pattern matching in strings by means of regular expressions.

Version:
1.11-r317
Date:
2007-11-12 19:44:01 (Tom)
Author:
Tom Michaelis
SysToMath
Wittelsbacherstr. 7
D-80469 Munich
Contact:
http://www.SysToMath.com
mailto:Tom.Michaelis@SysToMath.com
This C header file contains declarations of data types and functions specifying pattern matching in strings by means of regular expressions. They are implemented in the C inline file _match.h and the C program file match.c belonging to the SysToMath Base C Library stmbase.

Definition in file match.h.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  StmMtcFctCmd
 StmMtcFctCmd is a type used to control actions for regular and qualified regular expression matches. More...

StmReCtrl Error Handling

#define StmMtcErrors
 Definition of StmReCtrl error numbers and messages.
#define StmMtcErr(nr, txt)   nr
 Definition of the StmReCtrl error number nr for error text txt.
enum  StmReCtrlErrnos
 Definition of all possible StmReCtrl error numbers. More...
int stmReCtrlSetErrorEnv (StmReCtrl reCtrl, jmp_buf *penvbuf)
 Set the error environment address of the StmReCtrl object reCtrl.
int stmReCtrlGetErrno (StmReCtrl reCtrl)
 Return the current StmReCtrl error number.
const char * stmReCtrlGetErrorMsg (StmReCtrl reCtrl)
 Return the current StmReCtrl error message.
const char * stmReCtrlGetDebugMsg (StmReCtrl reCtrl)
 Return the current StmReCtrl debug message.

StmReCtrl Action Handling

enum  StmMtcFctResult {
  StmMtcFctError = -1,
  StmMtcFctOk = 0,
  StmMtcFctFail = 1,
  StmMtcFctReduce = 2
}
 Result values of regular or qualified regular expression action functions. More...
int stmQreActDef (StmReCtrl reCtrl, const char *qreactname, int(*qreFct)(StmMtcFctCmd cmd, StmQreMtc qreMtc))
 Definition of an action function for qualified regular expressions.

StmReCtrl Creation and Destruction

StmReCtrl stmReCtrlCreate (FILE *debug, jmp_buf *penvbuf, const char *xlatetab, const char *const *errtxt)
 Creation of a new StmReCtrl object.
void stmReCtrlDestroy (StmReCtrl reCtrl)
 Destruction of the StmReCtrl object reCtrl.

StmRe Creation and Destruction

StmRe stmReCreate (volatile StmReCtrl reCtrl, const char *reName, const char *reStr, int(*reFct)(StmMtcFctCmd cmd, StmReMtc reMtc))
 Creation of a new StmRe object.
int stmReDestroy (StmRe re)
 Destruction of the StmRe object re.

StmRe Method Functions

StmRe stmReGet (StmReCtrl reCtrl, const char *reName)
 Return the StmRe object defined for reCtrl with name reName.
StmBool stmReTest (StmReCtrl reCtrl, const char *reName)
 Determination of a regular expression's existence.
StmBool stmReMatch (StmRe re, const char *str, void *env, void *data)
 Perform a match for a string an return its result.
StmBool stmReMatchSub (StmRe re, const char *str, int len, void *env, void *data)
 Perform a match for a substring an return its result.
int stmReGetErrno (StmRe re)
 Return the current StmRe error number.
const char * stmReGetErrorMsg (StmRe re)
 Return the current StmRe error message.
const char * stmReGetDebugMsg (StmRe re)
 Return the current StmRe debug message.
const char * stmReGetReStr (StmRe re)
 Return the defining reStr.

Functions

const char * stmReMtcReName (StmReMtc reMtc)
 Return the name of a match's regular expression.
StmBool stmReMtcReNested (StmReMtc reMtc)
 Return if a match's regular expression is unnamed.
const char * stmReMtcReContextName (StmReMtc reMtc)
 Return the context name of a match's regular expression.
const char * stmReMtcReStr (StmReMtc reMtc)
 Return a pointer to the string representation of a match's regular expression.
int stmReMtcReStrLen (StmReMtc reMtc)
 Return the length of the string representation of a match's regular expression.
void * stmReMtcEnv (StmReMtc reMtc)
 Return a pointer to the global environment of a regular expression match.
void * stmReMtcData (StmReMtc reMtc)
 Return a pointer to the match data of a regular expression match.
void stmReMtcSetData (StmReMtc reMtc, void *data)
 Set a regular expression match's match data address.
const char * stmReMtcStr (StmReMtc reMtc)
 Return the matching string held by a regular expression match.
int stmReMtcLen (StmReMtc reMtc)
 Return the length of the matching string held by a regular expression match.
int stmReMtcQreMtcCount (StmReMtc reMtc)
 Return the qualifRe count of a regular expression match.
StmQreMtc stmReMtcNthQreMtc (StmReMtc reMtc, unsigned nth)
 Return the StmQreMtc object describing the match of the nth qualifRe factor of a regular expression match.
const char * stmReMtcNthQreMtcStr (StmReMtc reMtc, unsigned nth)
 Return the matching string of the nth qualifRe factor of a regular expression match.
int stmReMtcNthQreMtcLen (StmReMtc reMtc, unsigned nth)
 Return the length of the matching string of the nth qualifRe factor of a regular expression match.
void * stmReMtcNthQreMtcData (StmReMtc reMtc, unsigned nth)
 Return a pointer to the match data of the StmQreMtc object describing the match of the nth qualifRe factor of a regular expression match.
int stmReMtcNthSimpleReMtcCount (StmReMtc reMtc, unsigned nth)
 Return the simpleRe match count of the StmQreMtc object describing the match of the nth qualifRe factor of a regular expression match.
StmReMtc stmReMtcNthMthSimpleReMtc (StmReMtc reMtc, unsigned nth, unsigned mth)
 Return the StmReMtc object describing the mth simpleRe match of the nth qualifRe factor of a regular expression match.
const char * stmReMtcNthMthSimpleReMtcStr (StmReMtc reMtc, unsigned nth, unsigned mth)
 Return the matching string of the mth simpleRe match of the nth qualifRe factor of a regular expression match.
int stmReMtcNthMthSimpleReMtcLen (StmReMtc reMtc, unsigned nth, unsigned mth)
 Return the length of the matching string of the mth simpleRe match of the nth qualifRe factor of a regular expression match.
void * stmReMtcNthMthSimpleReMtcData (StmReMtc reMtc, unsigned nth, unsigned mth)
 Return a pointer to the match data of the StmReMtc object describing the match of the mth simpleRe of the nth qualifRe factor of a regular expression match.
int stmReMtcMtermNr (StmReMtc reMtc)
 Return the matching term number of a regular expression match.
StmQreMtc stmReMtcSuperQreMtc (StmReMtc reMtc)
 Return the StmQreMtc object describing the match of the superior qualified regular expression of a regular expression match.
void * stmReMtcSuperQreMtcData (StmReMtc reMtc)
 Return a pointer to the match data of the StmQreMtc object describing the match of the superior qualified regular expression of a regular expression match.
StmReMtc stmReMtcNthSuperReMtc (StmReMtc reMtc, unsigned nth)
 Return the StmReMtc object describing the match of the nth superior matching term of a regular expression match.
void * stmReMtcNthSuperReMtcData (StmReMtc reMtc, unsigned nth)
 Return a pointer to the match data of the StmReMtc object describing the match of the nth superior matching term of a regular expression match.
int stmReMtcSimpleReMtcNr (StmReMtc reMtc)
 Return the simpleRe match number of a regular expression match.
void * stmQreMtcEnv (StmQreMtc qreMtc)
 Return a pointer to the global environment of a qualified regular expression match.
void * stmQreMtcData (StmQreMtc qreMtc)
 Return a pointer to the match data of a qualified regular expression match.
void stmQreMtcSetData (StmQreMtc qreMtc, void *data)
 Set a qualified regular expression match's match data.
const char * stmQreMtcStr (StmQreMtc qreMtc)
 Return the matching string held by a qualified regular expression match.
int stmQreMtcLen (StmQreMtc qreMtc)
 Return the length of the matching string held by a qualified regular expression match.
int stmQreMtcSimpleReMtcCount (StmQreMtc qreMtc)
 Return the simpleRe match count of a qualified regular expression match.
StmReMtc stmQreMtcNthSimpleReMtc (StmQreMtc qreMtc, unsigned nth)
 Return the StmReMtc object describing the nth match of the simpleRe of a qualified regular expression match.
const char * stmQreMtcNthSimpleReMtcStr (StmQreMtc qreMtc, unsigned nth)
 Return the matching string of the nth SimpleRe of a qualified regular expression match.
int stmQreMtcNthSimpleReMtcLen (StmQreMtc qreMtc, unsigned nth)
 Return the length of the matching string of the nth simpleRe of a qualified regular expression match.
void * stmQreMtcNthSimpleReMtcData (StmQreMtc qreMtc, unsigned nth)
 Return a pointer to the match data of the StmReMtc object describing the match of the nth simpleRe of a qualified regular expression match.
StmReMtc stmQreMtcSuperReMtc (StmQreMtc qreMtc)
 Return the StmReMtc object describing the match of the superior matching term of a qualified regular expression match.
void * stmQreMtcSuperReMtcData (StmQreMtc qreMtc)
 Return a pointer to the match data of the StmReMtc object describing the match of the superior matching term of a qualified regular expression match.
StmReMtc stmQreMtcNthSuperReMtc (StmQreMtc qreMtc, unsigned nth)
 Return the StmReMtc object describing the match of the nth superior matching term of a qualified regular expression match.
void * stmQreMtcNthSuperReMtcData (StmQreMtc qreMtc, unsigned nth)
 Return a pointer to the match data of the StmReMtc object describing the match of the nth superior matching term of a qualified regular expression match.
int stmQreMtcQualifReNr (StmQreMtc qreMtc)
 Return the qualifRe number of a qualified regular expression match.


© Copyright Tom Michaelis 2002-2007

Distributed under the SysToMath Software License (See the accompanying file license.txt or a copy at www.SysToMath.com).