PageRenderTime 39ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/platform-model/libc_glibc-2.3.5/src/regex.c

http://github.com/dsw/oink-stack
C | 88 lines | 37 code | 18 blank | 33 comment | 0 complexity | 9e3d9b44a09e36c971764eb58f80c361 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0, LGPL-2.1
  1. #include <glibc-fs/prelude.h>
  2. #include <regex.h>
  3. // reg_syntax_t re_syntax_options;
  4. // struct re_pattern_buffer
  5. // {
  6. // unsigned char *buffer;
  7. // unsigned long int allocated;
  8. // unsigned long int used;
  9. // reg_syntax_t syntax;
  10. // char *fastmap;
  11. // RE_TRANSLATE_TYPE translate;
  12. // size_t re_nsub;
  13. // unsigned can_be_null : 1;
  14. // unsigned regs_allocated : 2;
  15. // unsigned fastmap_accurate : 1;
  16. // unsigned no_sub : 1;
  17. // unsigned not_bol : 1;
  18. // unsigned not_eol : 1;
  19. // unsigned newline_anchor : 1;
  20. // };
  21. // typedef struct re_pattern_buffer regex_t;
  22. // typedef int regoff_t;
  23. // struct re_registers
  24. // {
  25. // unsigned num_regs;
  26. // regoff_t *start;
  27. // regoff_t *end;
  28. // };
  29. // typedef struct
  30. // {
  31. // regoff_t rm_so;
  32. // regoff_t rm_eo;
  33. // } regmatch_t;
  34. static inline void __taint_re_pattern_buffer(struct re_pattern_buffer* p)
  35. {/*T:H*/
  36. __DO_TAINT(p->buffer);
  37. __DO_TAINT(p->fastmap);
  38. __DO_TAINT(p->translate);
  39. }
  40. reg_syntax_t re_set_syntax (reg_syntax_t syntax) {}
  41. const char $_1 * re_compile_pattern (const char $_1 * pattern, size_t length,
  42. struct re_pattern_buffer *buffer)
  43. { __taint_re_pattern_buffer(buffer); }
  44. int re_compile_fastmap (struct re_pattern_buffer *buffer)
  45. { __taint_re_pattern_buffer(buffer); }
  46. int re_search (struct re_pattern_buffer *buffer, const char $_2 *string,
  47. int length, int start, int range, struct re_registers *regs) {}
  48. int re_search_2 (struct re_pattern_buffer *buffer, const char *string1,
  49. int length1, const char *string2, int length2,
  50. int start, int range, struct re_registers *regs, int stop) {}
  51. int re_match (struct re_pattern_buffer *buffer, const char *string,
  52. int length, int start, struct re_registers *regs) {}
  53. int re_match_2 (struct re_pattern_buffer *buffer, const char *string1,
  54. int length1, const char *string2, int length2,
  55. int start, struct re_registers *regs, int stop) {}
  56. void re_set_registers (struct re_pattern_buffer *buffer, struct re_registers *regs,
  57. unsigned num_regs, regoff_t *starts, regoff_t *ends) {}
  58. // non-re-entrant BSD versions.
  59. // return value is an error message or NULL
  60. char $tainted * re_comp (const char * p) {}
  61. int re_exec (const char * p) {}
  62. int regcomp (regex_t * preg, const char * pattern, int cflags)
  63. {
  64. __taint_re_pattern_buffer(preg);
  65. }
  66. int regexec (const regex_t * preg, const char * string, size_t nmatch,
  67. regmatch_t pmatch[], int eflags) {}
  68. size_t regerror (int errcode, const regex_t *preg,
  69. char $tainted *errbuf, size_t errbuf_size) {}
  70. void regfree (regex_t *preg) {}