Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.5 KiB

  1. /*
  2. * History:
  3. *
  4. * ??-???-???? ?? Created
  5. * 15-Sep-1988 bw Added REM_*, changed REMatch parameters.
  6. */
  7. #define MAXPATARG 10 /* 0 is entire 1-9 are valid */
  8. /* Return codes from REMatch */
  9. #define REM_MATCH 0 /* A match was found */
  10. #define REM_NOMATCH 1 /* No match was found */
  11. #define REM_UNDEF 2 /* An undefined Op-code was encountered */
  12. #define REM_STKOVR 3 /* The stack overflowed */
  13. #define REM_INVALID 4 /* A parameter was invalid */
  14. typedef unsigned char RE_OPCODE;
  15. /* structure of compiled pattern */
  16. struct patType {
  17. flagType fCase; /* TRUE => case is significant */
  18. flagType fUnix; /* TRUE => use unix replacement */
  19. char *pArgBeg[MAXPATARG]; /* beginning of tagged strings */
  20. char *pArgEnd[MAXPATARG]; /* end of tagged strings */
  21. RE_OPCODE code[1]; /* pseudo-code instructions */
  22. };
  23. /* if RECompile fails and RESize == -1, then the input pattern had a syntax
  24. * error. If RESize != -1, then we were not able to allocate enough memory
  25. * to contain the pattern pcode
  26. */
  27. int RESize; /* estimated size of pattern */
  28. int REMatch(struct patType *,char *,char *,RE_OPCODE *[], unsigned, flagType );
  29. struct patType *RECompile(char *, flagType, flagType);
  30. char REGetArg(struct patType *,int ,char *);
  31. char RETranslate(struct patType *,char *,char *);
  32. int RELength(struct patType *,int );
  33. char *REStart(struct patType *);