NCDConfigTokenizer.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @file NCDConfigTokenizer.h
  3. * @author Ambroz Bizjak <ambrop7@gmail.com>
  4. *
  5. * @section LICENSE
  6. *
  7. * This file is part of BadVPN.
  8. *
  9. * BadVPN is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2
  11. * as published by the Free Software Foundation.
  12. *
  13. * BadVPN is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. */
  22. #ifndef BADVPN_NCDCONFIG_NCDCONFIGTOKENIZER_H
  23. #define BADVPN_NCDCONFIG_NCDCONFIGTOKENIZER_H
  24. #include <stdlib.h>
  25. #define NCD_ERROR -1
  26. #define NCD_EOF 0
  27. #define NCD_TOKEN_CURLY_OPEN 1
  28. #define NCD_TOKEN_CURLY_CLOSE 2
  29. #define NCD_TOKEN_ROUND_OPEN 3
  30. #define NCD_TOKEN_ROUND_CLOSE 4
  31. #define NCD_TOKEN_SEMICOLON 5
  32. #define NCD_TOKEN_DOT 6
  33. #define NCD_TOKEN_COMMA 7
  34. #define NCD_TOKEN_PROCESS 8
  35. #define NCD_TOKEN_NAME 9
  36. #define NCD_TOKEN_STRING 10
  37. #define NCD_TOKEN_ARROW 11
  38. #define NCD_TOKEN_TEMPLATE 12
  39. typedef int (*NCDConfigTokenizer_output) (void *user, int token, char *value, size_t line, size_t line_char);
  40. void NCDConfigTokenizer_Tokenize (char *str, size_t str_len, NCDConfigTokenizer_output output, void *user);
  41. #endif