Clone of mesa.
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.

glcpp.h 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright © 2010 Intel Corporation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. * DEALINGS IN THE SOFTWARE.
  22. */
  23. #ifndef GLCPP_H
  24. #define GLCPP_H
  25. #include "hash_table.h"
  26. #define yyscan_t void*
  27. /* Some data types used for parser value. */
  28. typedef struct node {
  29. const char *str;
  30. struct node *next;
  31. } node_t;
  32. typedef struct list {
  33. node_t *head;
  34. node_t *tail;
  35. } list_t;
  36. typedef struct glcpp_parser glcpp_parser_t;
  37. glcpp_parser_t *
  38. glcpp_parser_create (void);
  39. int
  40. glcpp_parser_parse (glcpp_parser_t *parser);
  41. void
  42. glcpp_parser_destroy (glcpp_parser_t *parser);
  43. int
  44. glcpp_parser_macro_defined (glcpp_parser_t *parser,
  45. const char *identifier);
  46. /* Generated by glcpp-lex.l to glcpp-lex.c */
  47. int
  48. yylex_init_extra (glcpp_parser_t *parser, yyscan_t* scanner);
  49. int
  50. yylex (yyscan_t scanner);
  51. int
  52. yylex_destroy (yyscan_t scanner);
  53. /* Generated by glcpp-parse.y to glcpp-parse.c */
  54. int
  55. yyparse (glcpp_parser_t *parser);
  56. /* xtalloc - wrappers around talloc to check for out-of-memory */
  57. #define xtalloc(ctx, type) (type *)xtalloc_named_const(ctx, sizeof(type), #type)
  58. void *
  59. xtalloc_named_const (const void *context, size_t size, const char *name);
  60. char *
  61. xtalloc_strdup (const void *t, const char *p);
  62. #endif