ReactOS  0.4.13-dev-39-g8b6696f
match.c File Reference
#include <schily/standard.h>
#include <schily/patmatch.h>
#include <schily/wchar.h>
#include <schily/wctype.h>
Include dependency graph for match.c:

Go to the source code of this file.

Classes

struct  args
 

Macros

#define POSIX_CLASS   /* Support [[:alpha:]] by default */
 
#define DID_UCHAR_TYPE
 
#define CHAR   Uchar
 
#define PCHAR   Uchar
 
#define ENDSTATE   (-1)
 
#define CL_SIZE   32 /* Max size for '[: :]' */
 
#define put(ret, state, sp, n)
 
#define CHK_POSIX_CLASS
 
#define in_class(found, pat, c)
 
#define rch(ap)
 
#define pch(ap)
 

Typedefs

typedef unsigned char Uchar
 
typedef struct args arg_t
 

Functions

EXPORT CHARopatmatch (PCHAR *pat, const int *aux, const CHAR *str, int soff, int slen, int alt) const
 
EXPORT CHARpatmatch (PCHAR *pat, const int *aux, const CHAR *str, int soff, int slen, int alt, state) const
 
LOCAL void nextitem __PR ((arg_t *))
 
LOCAL int expr __PR ((arg_t *, int *))
 
LOCAL void setexits __PR ((int *, int, int))
 
LOCAL void nextitem (arg_t *ap)
 
LOCAL int prim (arg_t *ap)
 
LOCAL int expr (arg_t *ap, int *altp)
 
LOCAL void setexits (int *aux, int list, int val)
 
LOCAL int join (int *aux, int a, int b)
 
EXPORT int patcompile (PCHAR *pat, int len, int *aux) const
 

Macro Definition Documentation

◆ CHAR

static CHAR   Uchar

Definition at line 83 of file match.c.

◆ CHK_POSIX_CLASS

#define CHK_POSIX_CLASS

Definition at line 132 of file match.c.

◆ CL_SIZE

#define CL_SIZE   32 /* Max size for '[: :]' */

Definition at line 95 of file match.c.

◆ DID_UCHAR_TYPE

#define DID_UCHAR_TYPE

Definition at line 82 of file match.c.

◆ ENDSTATE

#define ENDSTATE   (-1)

Definition at line 93 of file match.c.

◆ in_class

#define in_class (   found,
  pat,
  c 
)

Definition at line 168 of file match.c.

◆ pch

#define pch (   ap)
Value:
((((ap)->patp + 1) >= (ap)->length) ? \
0 \
: \
(ap)->pattern[(ap)->patp+1]) \
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
GLubyte * pattern
Definition: glext.h:7787

Definition at line 418 of file match.c.

◆ PCHAR

typedef PCHAR   Uchar

Definition at line 90 of file match.c.

Referenced by __RtlImageNtHeader(), _Requires_lock_held_(), _Success_(), AddGenericHeaderIPv4(), AhciAllocateResourceForAdapter(), AtapiInterrupt__(), AtapiSendCommand(), BaseCheckVDM(), CcCopyRead(), CcPinRead(), CcpMapData(), CdRomDeviceControlCompletion(), CdUpdateDirentName(), CmpCopyName(), CmpGetNameControlBlock(), co_IntCallHookProc(), co_UserCreateWindowEx(), CompareCharTable(), ConDrvReadInput(), ConDrvWriteOutput(), ConInString(), ConWrite(), CopyBufferChainToBuffer(), CopyBufferToBufferChain(), CreateProcessInternalW(), CSR_API(), CsrLoadServerDll(), DbgCommandString(), DbgPrompt(), DLDpFindCurrentThread(), Dns_PtrArrayToOffsetArray(), DnsQuery_W(), DosCopyEnvironmentBlock(), DosInt21h(), DosReadFile(), DumpTraceData(), EtfspCheckEtfs(), EtfspFileMatch(), ExpLoadInitialProcess(), Ext2IterateAllEa(), Ext2QueryEa(), Ext2SetEa(), FatPinEaRange(), FatSearchBufferForLabel(), FatSetFsLabelInfo(), FatSetRenameInfo(), FATXAddEntry(), FATXGetNextDirEntry(), FilterConnectCommunicationPort(), FindImportDescriptor(), FindMatchingCreateItem(), FixList(), FltGetVolumeProperties(), FltRegisterFilter(), FormatOutput(), FrLdrGetKernelBase(), FrLdrMapModule(), FrLdrStartup(), GetCurrentHwProfileA(), GetDIBPixel(), GetDmiString(), gethostbyname(), getsockopt(), GetSubkeyNames(), GspWriteMem(), GspWriteMemSafeGetContent(), HalpAcpiGetTableFromBios(), HandleLoadUnloadIoctl(), Hostent_Init(), InfoTdiQueryGetInterfaceMIB(), IntWideCharToMultiByteCP(), IoBuildPartialMdl(), IofCompleteRequest(), IopLogWorker(), IsBadReadPtr(), IsBadStringPtrA(), IsBadWritePtr(), IsValidPnpIdString(), KdpCheckLowMemory(), KdpFillMemory(), KdpGetBusData(), KdpGetContext(), KdpGetContextEx(), KdpGetVersion(), KdpNotSupported(), KdpPrintString(), KdpPrompt(), KdpPromptString(), KdpQueryMemory(), KdpReadControlSpace(), KdpReadIoSpace(), KdpReadIoSpaceExtended(), KdpReadMachineSpecificRegister(), KdpReadPhysicalmemory(), KdpReadVirtualMemory(), KdpReportCommandStringStateChange(), KdpReportExceptionStateChange(), KdpReportLoadSymbolsStateChange(), KdpRestoreBreakpoint(), KdpRestoreBreakPointEx(), KdpScreenPrint(), KdpSearchMemory(), KdpSendWaitContinue(), KdpSerialDebugPrint(), KdpSetBusData(), KdpSetContext(), KdpSetContextEx(), KdpWriteBreakpoint(), KdpWriteBreakPointEx(), KdpWriteControlSpace(), KdpWriteCustomBreakpoint(), KdpWriteIoSpace(), KdpWriteIoSpaceExtended(), KdpWriteMachineSpecificRegister(), KdpWritePhysicalmemory(), KdpWriteVirtualMemory(), KeBugCheckWithTf(), KeGetBugMessageText(), KiInitMachineDependent(), LanEnumAdapters(), LauncherRoutine2(), LdrpCheckForKnownDll(), LdrPEFixupImports(), LdrpFetchAddressOfSecurityCookie(), main(), marshall_unicode_as_utf8(), MiBuildNonPagedPool(), MiInitializeSessionSpaceLayout(), MiQueryMemoryBasicInformation(), MiResolveImageReferences(), MiSnapThunk(), MmCreatePeb(), MsgiKMToUMMessage(), MyReallocPool__(), nfs41_ExtractNetRootName(), NmiClearFlag(), NSP_GetServiceByNameHeapAllocW(), NtfsReadFile(), NtGdiFlushUserBatch(), NtUserQueryWindow(), PackParam(), ParseFonFile(), ParseSMBiosTables(), PciIdPrintfAppend(), PrepareICMPPacket(), PrintDiskData(), ProbeMemory(), ProtocolTransferDataComplete(), RamdiskGetPartitionInfo(), ReadVolumeLabel(), ReportDetectedPnpDevice(), RosSymCreateFromFile(), RosSymCreateFromMem(), RosSymCreateFromRaw(), RosSymGetAddressInformation(), RtlCompareMemoryUlong(), RtlCreateHeap(), RtlInitAnsiString(), RtlInitAnsiStringEx(), RtlIsDosDeviceName_Ustr(), RtlpCallQueryRegistryRoutine(), RtlReAllocateHeap(), RtlSplayTreeTest(), RtlUnicodeToCustomCPN(), RtlUpcaseUnicodeToCustomCPN(), SaBlob_CreateHostent(), SatisfyPreAccept(), ScsiClassFindUnclaimedDevices(), ScsiClassSplitRequest(), ScsiPortGetPhysicalAddress(), send(), CHttpClient::SendFile(), SendFragments(), sendto(), SetPaletteEntryRGB(), SkipToOffset(), SpiAdapterControl(), SpiParseDeviceInfo(), SURFACE_AllocSurface(), TextOutA(), UDFCommonDeviceControl(), UDFCompleteMount(), UDFPrepareForWriteOperation(), UniataEnumBusMasterController__(), UnpackHostEnt(), UnpackServEnt(), USBSTOR_HandleQueryProperty(), VfatReadDiskPartial(), vfatRenameEntry(), VfatWriteDiskPartial(), VfdDeviceControl(), VfdOpenImage(), VidBiosVideoService(), WCacheAllocAsyncEntry(), WCacheDirect__(), WCacheFlushBlocksRAM(), WCachePreReadPacket__(), WCacheReadBlocks__(), WCacheUpdatePacket(), WCacheWriteBlocks__(), WinLdrpBindImportName(), WriteConsoleOutputCharacterA(), WriteConsoleOutputCharacterW(), WSAAsyncGetServByName(), and WSAAsyncGetServByPort().

◆ POSIX_CLASS

#define POSIX_CLASS   /* Support [[:alpha:]] by default */

Definition at line 4 of file match.c.

◆ put

#define put (   ret,
  state,
  sp,
  n 
)
Value:
{ \
register int *lstate = state; \
register int *lsp = sp; \
register int ln = n; \
while (lstate < lsp) { \
if (*lstate++ == ln) { \
ret = lsp; \
lsp = 0; \
break; \
} \
} \
if (lsp) { \
*lstate++ = ln; \
ret = lstate; \
} \
}
GLdouble n
Definition: glext.h:7729
while(1)
Definition: macro.lex.yy.c:740
static int state
Definition: maze.c:121
static const WCHAR sp[]
Definition: suminfo.c:288

Definition at line 105 of file match.c.

◆ rch

#define rch (   ap)
Value:
{ \
if (++(ap)->patp >= (ap)->length) \
(ap)->Ch = 0; \
else \
(ap)->Ch = (ap)->pattern[(ap)->patp]; \
}
#define Ch(x, y, z)
Definition: sha2.c:141
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32

Definition at line 407 of file match.c.

Typedef Documentation

◆ arg_t

typedef struct args arg_t

◆ Uchar

typedef unsigned char Uchar

Definition at line 81 of file match.c.

Function Documentation

◆ __PR() [1/3]

LOCAL void nextitem __PR ( (arg_t *)  )

◆ __PR() [2/3]

LOCAL int expr __PR ( (arg_t *, int *)  )

◆ __PR() [3/3]

LOCAL void setexits __PR ( (int *, int, int )

◆ expr()

LOCAL int expr ( arg_t ap,
int altp 
)

Definition at line 512 of file match.c.

515 {
516  int exits = ENDSTATE;
517  int a;
518  int *aux = ap->aux;
519  PCHAR Ch;
520 
521  for (;;) {
522  a = prim(ap);
523  if (a == ENDSTATE)
524  return (ENDSTATE);
525  Ch = ap->Ch;
526  if (Ch == ALT || Ch == RBRACK || Ch == '\0') {
527  exits = join(aux, exits, a);
528  if (Ch != ALT)
529  return (exits);
530  *altp = ap->patp;
531  altp = &aux[ap->patp];
532  nextitem(ap);
533  } else
534  setexits(aux, a, ap->patp);
535  }
536 }
LOCAL void nextitem(arg_t *ap)
Definition: match.c:428
signed char * PCHAR
Definition: retypes.h:7
#define ENDSTATE
Definition: match.c:93
#define Ch(x, y, z)
Definition: sha2.c:141
#define a
Definition: ke_i.h:78
#define RBRACK
Definition: patmatch.h:58
LOCAL int join(int *aux, int a, int b)
Definition: match.c:560
#define ALT
Definition: patmatch.h:51
LOCAL int prim(arg_t *ap)
Definition: match.c:440
static const WCHAR aux[]
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
LOCAL void setexits(int *aux, int list, int val)
Definition: match.c:542
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by __Extract_locale_name(), add_typeinfo_block(), Dispatch_Invoke(), execute_cfa_instructions(), hlsl_add(), hlsl_div(), hlsl_eq(), hlsl_ge(), hlsl_gt(), hlsl_le(), hlsl_lt(), hlsl_mod(), hlsl_mul(), hlsl_ne(), hlsl_sub(), HTMLWindow2_setInterval(), init_library(), make_assignment(), make_expr1(), make_exprt(), new_argument(), new_array_element(), new_binary_expression(), new_bool_expression(), new_call_statement(), new_case_clausule(), new_const_decl(), new_double_expression(), new_elseif_decl(), new_expr(), new_expression(), new_expression_statement(), new_for_statement(), new_forin_statement(), new_if_statement(), new_long_expression(), new_member_expression(), new_new_expression(), new_return_statement(), new_select_statement(), new_string_expression(), new_switch_statement(), new_throw_statement(), new_unary_expression(), new_variable_declaration(), new_while_statement(), new_with_statement(), output_typelib_regscript(), patcompile(), prim(), test_EM_SCROLL(), test_timeout(), visit_function_expression(), write_args(), write_conf_or_var_desc(), xsltAttrTemplateValueProcessNode(), xsltEvalAttrValueTemplate(), xsltEvalStaticAttrValueTemplate(), xsltReverseCompMatch(), xsltSwapTopCompMatch(), and yyparse().

◆ join()

LOCAL int join ( int aux,
int  a,
int  b 
)

Definition at line 560 of file match.c.

564 {
565  int t;
566 
567  if (a == ENDSTATE)
568  return (b);
569  t = a;
570  while (aux[t] != ENDSTATE)
571  t = aux[t];
572  aux[t] = b;
573  return (a);
574 }
GLdouble GLdouble t
Definition: gl.h:2047
#define ENDSTATE
Definition: match.c:93
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
static const WCHAR aux[]
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by AddPenLinesBounds(), expr(), gdip_to_gdi_join(), GdipSetCustomLineCapStrokeJoin(), GdipSetPenLineJoin(), test_boundsrect(), test_create_adjustable_cap(), and test_linejoin().

◆ nextitem()

LOCAL void nextitem ( arg_t ap)

Definition at line 428 of file match.c.

430 {
431  if (ap->Ch == QUOTE)
432  rch(ap);
433  rch(ap);
434 }
#define rch(ap)
Definition: match.c:407
#define QUOTE
Definition: kbdpo.c:223
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32

Referenced by do_write_file(), expr(), prim(), and read_file().

◆ opatmatch()

EXPORT CHAR* opatmatch ( PCHAR pat,
const int aux,
const CHAR str,
int  soff,
int  slen,
int  alt 
) const

Definition at line 209 of file match.c.

216 {
217  int state[MAXPAT];
218 
219  return (patmatch(pat, aux, str, soff, slen, alt, state));
220 }
EXPORT CHAR * patmatch(PCHAR *pat, const int *aux, const CHAR *str, int soff, int slen, int alt, state) const
Definition: match.c:230
const WCHAR * str
#define MAXPAT
Definition: patmatch.h:79
static int state
Definition: maze.c:121
static const WCHAR aux[]

◆ patcompile()

EXPORT int patcompile ( PCHAR pat,
int  len,
int aux 
) const

Definition at line 584 of file match.c.

588 {
589  arg_t a;
590  int alt = ENDSTATE;
591  int i;
592 
593  a.pattern = pat;
594  a.length = len;
595  a.aux = aux;
596  a.patp = -1;
597 
598  for (i = 0; i < len; i++)
599  aux[i] = ENDSTATE;
600  rch(&a);
601  i = expr(&a, &alt);
602  if (i == ENDSTATE)
603  return (0);
604  setexits(aux, i, ENDSTATE);
605  return (alt);
606 }
LOCAL int expr(arg_t *ap, int *altp)
Definition: match.c:512
#define rch(ap)
Definition: match.c:407
#define ENDSTATE
Definition: match.c:93
Definition: match.c:390
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define a
Definition: ke_i.h:78
GLenum GLsizei len
Definition: glext.h:6722
static const WCHAR aux[]
LOCAL void setexits(int *aux, int list, int val)
Definition: match.c:542
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by parse_errctl().

◆ patmatch()

EXPORT CHAR* patmatch ( PCHAR pat,
const int aux,
const CHAR str,
int  soff,
int  slen,
int  alt,
state   
) const

Definition at line 230 of file match.c.

238 {
239  register int *sp;
240  register int *n;
241  register int *i;
242  register int p;
243  register int q, s, k;
244 #ifdef __MB_CHAR
245  wchar_t c;
246  int mlen = 1;
247 #else
248  int c;
249 #endif
250  const CHAR *lastp = (CHAR *)NULL;
251 
252 #ifdef __LINE_MATCH
253 for (; soff <= slen; soff++) {
254 #endif
255 
256  sp = state;
257  put(sp, state, state, 0);
258  if (alt != ENDSTATE)
259  put(sp, state, sp, alt);
260 
261 #ifdef __MB_CHAR
262  mbtowc(NULL, NULL, 0);
263  for (s = soff; ; s += mlen) {
264 #else
265  for (s = soff; ; s++) {
266 #endif
267  /*
268  * next char from input string
269  */
270  if (s >= slen) {
271  c = 0;
272  } else {
273 #ifdef __MB_CHAR
274  mlen = mbtowc(&c, (char *)str, slen - s);
275  if (mlen < 0) {
276  mbtowc(NULL, NULL, 0);
277  c = str[s];
278  mlen = 1;
279  }
280 #else
281  c = str[s];
282 #endif
283  }
284  /*
285  * first complete the closure
286  */
287  for (n = state; n < sp; ) {
288  p = *n++; /* next state number */
289  if (p == ENDSTATE)
290  continue;
291  q = aux[p]; /* get next state for pat */
292  k = pat[p]; /* get next char from pat */
293  switch (k) {
294 
295  case REP:
296  put(sp, state, sp, p+1);
297  /* FALLTHRU */
298  case NIL: /* NIL matches always */
299  case STAR:
300  put(sp, state, sp, q);
301  break;
302  case LBRACK: /* alternations */
303  case ALT:
304  put(sp, state, sp, p+1);
305  if (q != ENDSTATE)
306  put(sp, state, sp, q);
307  break;
308  case START:
309  if (s == 0)
310  put(sp, state, sp, q);
311  break;
312  case END:
313  if (c == '\0')
314  put(sp, state, sp, q);
315  break;
316  }
317  }
318 
319  for (i = state; i < sp; ) {
320  if (*i++ == ENDSTATE) {
321  lastp = &str[s];
322  break;
323  }
324  }
325  if (c == 0)
326  return ((CHAR *)lastp);
327 
328  /*
329  * now try to match next character
330  */
331  n = sp;
332  sp = state;
333  for (i = sp; i < n; ) {
334  p = *i++; /* next active state number */
335  if (p == ENDSTATE)
336  continue;
337  k = pat[p];
338  switch (k) {
339 
340  case ALT:
341  case REP:
342  case NIL:
343  case LBRACK:
344  case START:
345  case END:
346  continue;
347  case LCLASS:
348  in_class(q, &pat[p+1], c);
349  if (!q)
350  continue;
351  break;
352  case STAR:
353  put(sp, state, sp, p);
354  continue;
355  case QUOTE:
356  k = pat[p+1];
357  default:
358  if (k != c)
359  continue;
360  /* FALLTHRU */
361  case ANY:
362  break;
363  }
364  put(sp, state, sp, aux[p]);
365  }
366  if (sp == state) { /* if no new states return */
367 #ifdef __LINE_MATCH
368 
369  if (lastp || (soff == slen - 1))
370  return ((CHAR *)lastp);
371  else
372  break;
373 #else
374  return ((CHAR *)lastp);
375 #endif
376  }
377  }
378 #ifdef __LINE_MATCH
379 }
380 return ((CHAR *)lastp);
381 #endif
382 }
#define QUOTE
Definition: kbdpo.c:223
char CHAR
Definition: xmlstorage.h:175
GLdouble n
Definition: glext.h:7729
#define ENDSTATE
Definition: match.c:93
#define in_class(found, pat, c)
Definition: match.c:168
#define put(ret, state, sp, n)
Definition: match.c:105
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define REP
Definition: patmatch.h:52
const WCHAR * str
struct star STAR
smooth NULL
Definition: ftsmooth.c:416
Definition: infcodes.c:25
#define ALT
Definition: patmatch.h:51
const GLubyte * c
Definition: glext.h:8905
#define mbtowc(wp, cp, len)
Definition: wchar.h:155
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
#define LCLASS
Definition: patmatch.h:59
static int state
Definition: maze.c:121
GLdouble s
Definition: gl.h:2039
Definition: infcodes.c:17
#define ANY
Definition: patmatch.h:55
#define NIL
Definition: trio.c:109
static const WCHAR aux[]
#define c
Definition: ke_i.h:80
static const WCHAR sp[]
Definition: suminfo.c:288
GLfloat GLfloat p
Definition: glext.h:8902
int k
Definition: mpi.c:3369
#define LBRACK
Definition: patmatch.h:57

Referenced by _errptr(), and opatmatch().

◆ prim()

LOCAL int prim ( arg_t ap)

Definition at line 440 of file match.c.

442 {
443  int a = ap->patp;
444  int op = ap->Ch;
445  int t;
446 
447  nextitem(ap);
448  switch (op) {
449 
450  case '\0':
451  case ALT:
452  case RBRACK:
453  return (ENDSTATE);
454  case LCLASS:
455  while (ap->Ch != RCLASS && ap->Ch != '\0') {
456 #ifdef POSIX_CLASS
457  if (ap->Ch == LCLASS) {
458  if (pch(ap) == ':') { /* [:alpha:] */
459  char class[CL_SIZE+1];
460  char *pc = class;
461 
462  nextitem(ap);
463  nextitem(ap);
464  while (ap->Ch != ':' &&
465  ap->Ch != '\0') {
466  if (pc > &class[CL_SIZE])
467  return (ENDSTATE);
468  *pc = ap->Ch;
469  if (*pc++ != ap->Ch)
470  return (ENDSTATE);
471  nextitem(ap);
472  }
473  if (pc == class)
474  return (ENDSTATE);
475  *pc = '\0';
476  if (ap->Ch == '\0')
477  return (ENDSTATE);
478  if (wctype(class) == 0)
479  return (ENDSTATE);
480  nextitem(ap);
481  }
482  if (ap->Ch != RCLASS)
483  return (ENDSTATE);
484  }
485 #endif
486  nextitem(ap);
487  }
488  if (ap->Ch == '\0')
489  return (ENDSTATE);
490  nextitem(ap);
491  break;
492  case REP:
493  t = prim(ap);
494  if (t == ENDSTATE)
495  return (ENDSTATE);
496  setexits(ap->aux, t, a);
497  break;
498  case LBRACK:
499  a = expr(ap, &ap->aux[a]);
500  if (a == ENDSTATE || ap->Ch != RBRACK)
501  return (ENDSTATE);
502  nextitem(ap);
503  break;
504  }
505  return (a);
506 }
LOCAL void nextitem(arg_t *ap)
Definition: match.c:428
LOCAL int expr(arg_t *ap, int *altp)
Definition: match.c:512
GLdouble GLdouble t
Definition: gl.h:2047
#define ENDSTATE
Definition: match.c:93
#define pch(ap)
Definition: match.c:418
#define RCLASS
Definition: patmatch.h:60
#define REP
Definition: patmatch.h:52
#define RBRACK
Definition: patmatch.h:58
#define ALT
Definition: patmatch.h:51
#define LCLASS
Definition: patmatch.h:59
#define CL_SIZE
Definition: match.c:95
wctype_t __cdecl wctype(const char *)
LOCAL int prim(arg_t *ap)
Definition: match.c:440
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
LOCAL void setexits(int *aux, int list, int val)
Definition: match.c:542
UINT op
Definition: effect.c:223
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define LBRACK
Definition: patmatch.h:57

Referenced by DateConstr_value(), equal_values(), expr(), gl_EvalMesh1(), to_number(), to_primitive(), and to_string().

◆ setexits()

LOCAL void setexits ( int aux,
int  list,
int  val 
)

Definition at line 542 of file match.c.

546 {
547  int a;
548 
549  while (list != ENDSTATE) {
550  a = aux[list];
551  aux[list] = val;
552  list = a;
553  }
554 }
#define ENDSTATE
Definition: match.c:93
#define a
Definition: ke_i.h:78
GLuint GLfloat * val
Definition: glext.h:7180
Definition: _list.h:228
#define list
Definition: rosglue.h:35
static const WCHAR aux[]
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by expr(), patcompile(), and prim().