home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / g / gs252src.zip / GS252 / IUTIL.H < prev    next >
C/C++ Source or Header  |  1992-05-14  |  3KB  |  74 lines

  1. /* Copyright (C) 1991, 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* iutil.h */
  21. /* Prototypes for procedures in iutil.c */
  22.  
  23. /* ------ Object utilities ------ */
  24.  
  25. /* Copy refs from one place to another. */
  26. /* (If we are copying to the stack, we can just use memcpy.) */
  27. extern void refcpy_to_new(P3(ref *to, const ref *from, uint size));
  28. extern void refcpy_to_old(P4(ref *to, const ref *from, uint size, const char *client_name));
  29.  
  30. /* Fill an array with nulls. */
  31. extern void refset_null(P2(ref *to, uint size));
  32.  
  33. /* Compare two objects for equality.  Return 1 if equal, 0 if not. */
  34. extern int obj_eq(P2(const ref *, const ref *));
  35.  
  36. /* Create a printable representation of an object, a la cvs. */
  37. /* Return 0 if OK, <0 if the destination wasn't large enough. */
  38. extern int obj_cvs(P4(const ref *, byte *, uint, uint *));
  39.  
  40. /* Get an element from an array (packed or not). */
  41. extern int array_get(P3(const ref *, long, ref *));
  42.  
  43. /* ------ String utilities ------ */
  44.  
  45. /* Convert a C string to a Ghostscript string */
  46. extern int string_to_ref(P3(const char *, ref *, const char *));
  47.  
  48. /* Convert a Ghostscript string to a C string. */
  49. /* Return 0 iff the buffer can't be allocated. */
  50. extern char *ref_to_string(P2(const ref *, const char *));
  51.  
  52. /* ------ Operand utilities ------ */
  53.  
  54. /* Get N numeric operands from the stack. */
  55. /* Note that the first argument must be ref * rather than os_ptr, */
  56. /* because num_params is sometimes used elsewhere than */
  57. /* on the operand stack. */
  58. extern int num_params(P3(const ref *, int, float *));
  59.  
  60. /* Get a real parameter. */
  61. extern int real_param(P2(const ref *, float *));
  62.  
  63. /* Define the gs_matrix type if necessary. */
  64. #ifndef gs_matrix_DEFINED
  65. #  define gs_matrix_DEFINED
  66. typedef struct gs_matrix_s gs_matrix;
  67. #endif
  68.  
  69. /* Check for a matrix operand with read access. */
  70. extern int read_matrix(P2(const ref *, gs_matrix *));
  71.  
  72. /* Check for a matrix operand with write access. */
  73. extern int write_matrix(P1(ref *));
  74.