strports.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* classes: h_files */
  2. #ifndef SCM_STRPORTS_H
  3. #define SCM_STRPORTS_H
  4. /* Copyright (C) 1995,1996,2000,2001,2002, 2006, 2008, 2010, 2011 Free Software Foundation, Inc.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public License
  8. * as published by the Free Software Foundation; either version 3 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. */
  21. #include "libguile/__scm.h"
  22. #define SCM_STRPORTP(x) (SCM_HAS_TYP16 (x, scm_tc16_strport))
  23. #define SCM_OPSTRPORTP(x) (SCM_STRPORTP (x) && \
  24. (SCM_CELL_WORD_0 (x) & SCM_OPN))
  25. #define SCM_OPINSTRPORTP(x) (SCM_OPSTRPORTP (x) && \
  26. (SCM_CELL_WORD_0 (x) & SCM_RDNG))
  27. #define SCM_OPOUTSTRPORTP(x) (SCM_OPSTRPORTP (x) && \
  28. (SCM_CELL_WORD_0 (x) & SCM_WRTNG))
  29. SCM_API scm_t_bits scm_tc16_strport;
  30. SCM_API SCM scm_mkstrport (SCM pos, SCM str, long modes, const char * caller);
  31. SCM_API SCM scm_strport_to_string (SCM port);
  32. SCM_API SCM scm_object_to_string (SCM obj, SCM printer);
  33. SCM_API SCM scm_call_with_output_string (SCM proc);
  34. SCM_API SCM scm_call_with_input_string (SCM str, SCM proc);
  35. SCM_API SCM scm_open_input_string (SCM str);
  36. SCM_API SCM scm_open_output_string (void);
  37. SCM_API SCM scm_get_output_string (SCM port);
  38. SCM_API SCM scm_c_read_string (const char *expr);
  39. SCM_API SCM scm_c_eval_string (const char *expr);
  40. SCM_API SCM scm_c_eval_string_in_module (const char *expr, SCM module);
  41. SCM_API SCM scm_eval_string (SCM string);
  42. SCM_API SCM scm_eval_string_in_module (SCM string, SCM module);
  43. SCM_INTERNAL void scm_init_strports (void);
  44. #endif /* SCM_STRPORTS_H */
  45. /*
  46. Local Variables:
  47. c-file-style: "gnu"
  48. End:
  49. */