libport.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (c) 2009 Frank Warmerdam
  3. *
  4. * Permission to use, copy, modify, distribute, and sell this software and
  5. * its documentation for any purpose is hereby granted without fee, provided
  6. * that (i) the above copyright notices and this permission notice appear in
  7. * all copies of the software and related documentation, and (ii) the names of
  8. * Sam Leffler and Silicon Graphics may not be used in any advertising or
  9. * publicity relating to the software without the specific, prior written
  10. * permission of Sam Leffler and Silicon Graphics.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
  13. * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
  14. * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
  17. * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  18. * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  19. * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
  20. * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  21. * OF THIS SOFTWARE.
  22. */
  23. #ifndef _LIBPORT_
  24. #define _LIBPORT_
  25. #if defined(HAVE_CONFIG_H)
  26. # include <tif_config.h>
  27. #endif
  28. int getopt(int argc, char * const argv[], const char *optstring);
  29. extern char *optarg;
  30. extern int opterr;
  31. extern int optind;
  32. extern int optopt;
  33. int strcasecmp(const char *s1, const char *s2);
  34. #ifndef HAVE_GETOPT
  35. # define HAVE_GETOPT 1
  36. #endif
  37. #if !defined(HAVE_STRTOL)
  38. long strtol(const char *nptr, char **endptr, int base);
  39. #endif
  40. #if !defined(HAVE_STRTOLL)
  41. long long strtoll(const char *nptr, char **endptr, int base);
  42. #endif
  43. #if !defined(HAVE_STRTOUL)
  44. unsigned long strtoul(const char *nptr, char **endptr, int base);
  45. #endif
  46. #if !defined(HAVE_STRTOULL)
  47. unsigned long long strtoull(const char *nptr, char **endptr, int base);
  48. #endif
  49. #if 0
  50. void *
  51. lfind(const void *key, const void *base, size_t *nmemb, size_t size,
  52. int(*compar)(const void *, const void *));
  53. #endif
  54. #if !defined(HAVE_SNPRINTF)
  55. #undef vsnprintf
  56. #define vsnprintf _TIFF_vsnprintf_f
  57. #undef snprintf
  58. #define snprintf _TIFF_snprintf_f
  59. int snprintf(char* str, size_t size, const char* format, ...);
  60. #endif
  61. #endif /* ndef _LIBPORT_ */