libcommon.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* This file is part of the GNU plotutils package. Copyright (C) 1995,
  2. 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc.
  3. The GNU plotutils package is free software. You may redistribute it
  4. and/or modify it under the terms of the GNU General Public License as
  5. published by the Free Software foundation; either version 2, or (at your
  6. option) any later version.
  7. The GNU plotutils package is distributed in the hope that it will be
  8. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. General Public License for more details.
  11. You should have received a copy of the GNU General Public License along
  12. with the GNU plotutils package; see the file COPYING. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
  14. Boston, MA 02110-1301, USA. */
  15. /* libcommon.h: header file for libcommon, a library of miscellaneous
  16. support functions which is statically linked with several of the package
  17. executables. It is built in ../lib. */
  18. #include "sys-defines.h" /* for bool, size_t, HAVE_STRERROR */
  19. /*------------prototypes for libcommon functions----------------------------*/
  20. /* Support C++. This file could be #included by a C++ compiler rather than
  21. a C compiler, in which case it needs to know that libcommon functions
  22. have C linkage, not C++ linkage. This is accomplished by wrapping all
  23. function declarations in __BEGIN_DECLS ... __END_DECLS. */
  24. #ifdef ___BEGIN_DECLS
  25. #undef ___BEGIN_DECLS
  26. #endif
  27. #ifdef ___END_DECLS
  28. #undef ___END_DECLS
  29. #endif
  30. #ifdef __cplusplus
  31. # define ___BEGIN_DECLS extern "C" {
  32. # define ___END_DECLS }
  33. #else
  34. # define ___BEGIN_DECLS /* empty */
  35. # define ___END_DECLS /* empty */
  36. #endif
  37. ___BEGIN_DECLS
  38. extern char * xstrdup (const char *s);
  39. extern int display_fonts (const char *output_format, const char *progname);
  40. extern int list_fonts (const char *output_format, const char *progname);
  41. extern void display_usage (const char *progname, const int *omit_vals, const char *appendage, int info);
  42. extern void display_version (const char *progname, const char *written, const char *copyright);
  43. extern void * xmalloc (size_t length);
  44. extern void * xrealloc (void *p, size_t length);
  45. #ifndef HAVE_STRERROR
  46. extern char *strerror (int errnum);
  47. #endif
  48. ___END_DECLS