scanf.h 2.0 KB

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