gsparams.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* Copyright (C) 1998 Aladdin Enterprises. All rights reserved.
  2. This software is provided AS-IS with no warranty, either express or
  3. implied.
  4. This software is distributed under license and may not be copied,
  5. modified or distributed except as expressly authorized under the terms
  6. of the license contained in the file LICENSE in this distribution.
  7. For more information about licensing, please refer to
  8. http://www.ghostscript.com/licensing/. For information on
  9. commercial licensing, go to http://www.artifex.com/licensing/ or
  10. contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  12. */
  13. /* $Id: gsparams.h,v 1.5 2002/06/16 08:45:42 lpd Exp $ */
  14. /* Serializer/expander for gs_parm_list's */
  15. #ifndef gsparams_INCLUDED
  16. # define gsparams_INCLUDED
  17. /* Initial version 2/1/98 by John Desrosiers (soho@crl.com) */
  18. /* 8/8/98 L. Peter Deutsch (ghost@aladdin.com) Completely redesigned
  19. to use stream rather than buffer API (but retained former API for
  20. compatibility as well). */
  21. #include "stream.h"
  22. #include "gsparam.h"
  23. #if 0 /****************/
  24. /* ------ Future interface, implemented in gsparam2.c ------ */
  25. /*
  26. * Serialize the contents of a gs_param_list, including sub-collections,
  27. * onto a stream. The list must be in READ mode.
  28. */
  29. int gs_param_list_puts(stream *dest, gs_param_list *list);
  30. /*
  31. * Unserialize a parameter list, including sub-collections, from a stream.
  32. * The list must be in WRITE mode.
  33. */
  34. int gs_param_list_gets(stream *src, gs_param_list *list, gs_memory_t *mem);
  35. #else /****************/
  36. /* ------ Present interface, implemented in gsparams.c ------ */
  37. /*
  38. * Serialize a parameter list into a buffer. Return the actual number
  39. * of bytes required to store the list, or a negative error code.
  40. * The list was stored successfully iff the return value is positive and
  41. * less than or equal to the buffer size. Note that the buffer may be
  42. * NULL, in which case nothing is stored (but the size is still returned).
  43. */
  44. int gs_param_list_serialize(gs_param_list *list, byte *buf, int buf_size);
  45. /*
  46. * Unserialize a parameter list from a buffer. Return the actual number
  47. * of bytes occupied by the list, or a negative error code. The buffer
  48. * must be void * aligned.
  49. */
  50. int gs_param_list_unserialize(gs_param_list *list, const byte *buf);
  51. #endif /****************/
  52. #endif /* gsparams_INCLUDED */