scanf.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Clayton Collie <clcollie@mindspring.com> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #ifndef SCANF_H
  20. #define SCANF_H
  21. #define SCAN_MAX_ARGS 0xFF /* Maximum number of variable which can be */
  22. /* passed to (f|s)scanf. This is an artificial */
  23. /* upper limit to keep resources in check and */
  24. /* minimize the possibility of exploits */
  25. #define SCAN_SUCCESS SUCCESS
  26. #define SCAN_ERROR_EOF -1 /* indicates premature termination of scan */
  27. /* can be caused by bad parameters or format*/
  28. /* string. */
  29. #define SCAN_ERROR_INVALID_FORMAT (SCAN_ERROR_EOF - 1)
  30. #define SCAN_ERROR_VAR_PASSED_BYVAL (SCAN_ERROR_INVALID_FORMAT - 1)
  31. #define SCAN_ERROR_WRONG_PARAM_COUNT (SCAN_ERROR_VAR_PASSED_BYVAL - 1)
  32. #define SCAN_ERROR_INTERNAL (SCAN_ERROR_WRONG_PARAM_COUNT - 1)
  33. /*
  34. * The following are here solely for the benefit of the scanf type functions
  35. * e.g. fscanf
  36. */
  37. PHPAPI int ValidateFormat(char *format, int numVars, int *totalVars);
  38. PHPAPI int php_sscanf_internal(char *string,char *format,int argCount,zval ***args,
  39. int varStart, zval **return_value TSRMLS_DC);
  40. #endif /* SCANF_H */