gvio.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*************************************************************************
  2. * Copyright (c) 2011 AT&T Intellectual Property
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * https://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors: Details at https://graphviz.org
  9. *************************************************************************/
  10. #pragma once
  11. #include "gvcjob.h"
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #ifdef GVDLL
  16. #ifdef GVC_EXPORTS
  17. #define GVIO_API __declspec(dllexport)
  18. #else
  19. #define GVIO_API __declspec(dllimport)
  20. #endif
  21. #endif
  22. #ifndef GVIO_API
  23. #define GVIO_API /* nothing */
  24. #endif
  25. GVIO_API size_t gvwrite (GVJ_t * job, const char *s, size_t len);
  26. GVIO_API int gvferror (FILE *stream);
  27. GVIO_API int gvputc(GVJ_t * job, int c);
  28. GVIO_API int gvputs(GVJ_t * job, const char *s);
  29. // `gvputs`, but XML-escape the input string
  30. GVIO_API int gvputs_xml(GVJ_t* job, const char *s);
  31. // `gvputs`, C-escaping '\' and non-ASCII bytes
  32. GVIO_API void gvputs_nonascii(GVJ_t* job, const char *s);
  33. GVIO_API int gvflush (GVJ_t * job);
  34. // support for extra API misuse warnings if available
  35. #ifdef __GNUC__
  36. #define GV_PRINTF_LIKE(index, first) __attribute__((format(printf, index, first)))
  37. #else
  38. #define GV_PRINTF_LIKE(index, first) /* nothing */
  39. #endif
  40. GVIO_API GV_PRINTF_LIKE(2, 3) void gvprintf(GVJ_t * job, const char *format, ...);
  41. #undef GV_PRINTF_LIKE
  42. GVIO_API void gvprintdouble(GVJ_t * job, double num);
  43. GVIO_API void gvprintpointf(GVJ_t * job, pointf p);
  44. GVIO_API void gvprintpointflist(GVJ_t *job, pointf *p, size_t n);
  45. #undef GVIO_API
  46. #ifdef __cplusplus
  47. }
  48. #endif