strports.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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) \
  23. (SCM_PORTP (x) && SCM_PORT_TYPE (x) == scm_string_port_type)
  24. #define SCM_OPSTRPORTP(x) (SCM_STRPORTP (x) && \
  25. (SCM_CELL_WORD_0 (x) & SCM_OPN))
  26. #define SCM_OPINSTRPORTP(x) (SCM_OPSTRPORTP (x) && \
  27. (SCM_CELL_WORD_0 (x) & SCM_RDNG))
  28. #define SCM_OPOUTSTRPORTP(x) (SCM_OPSTRPORTP (x) && \
  29. (SCM_CELL_WORD_0 (x) & SCM_WRTNG))
  30. SCM_API scm_t_port_type *scm_string_port_type;
  31. SCM_API SCM scm_mkstrport (SCM pos, SCM str, long modes, const char * caller);
  32. SCM_API SCM scm_strport_to_string (SCM port);
  33. SCM_API SCM scm_object_to_string (SCM obj, SCM printer);
  34. SCM_API SCM scm_call_with_output_string (SCM proc);
  35. SCM_API SCM scm_call_with_input_string (SCM str, SCM proc);
  36. SCM_API SCM scm_open_input_string (SCM str);
  37. SCM_API SCM scm_open_output_string (void);
  38. SCM_API SCM scm_get_output_string (SCM port);
  39. SCM_API SCM scm_c_read_string (const char *expr);
  40. SCM_API SCM scm_c_eval_string (const char *expr);
  41. SCM_API SCM scm_c_eval_string_in_module (const char *expr, SCM module);
  42. SCM_API SCM scm_eval_string (SCM string);
  43. SCM_API SCM scm_eval_string_in_module (SCM string, SCM module);
  44. SCM_INTERNAL void scm_init_strports (void);
  45. #endif /* SCM_STRPORTS_H */
  46. /*
  47. Local Variables:
  48. c-file-style: "gnu"
  49. End:
  50. */