home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / printing / ghostscrip / source / _gs / c / utrace < prev    next >
Encoding:
Text File  |  1991-10-27  |  2.4 KB  |  104 lines

  1. /* Copyright (C) 1989, 1990 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. /* utrace.c */
  21. /* Dummy tracing package for Unix C */
  22. #include <stdio.h>
  23. #include <setjmp.h>
  24. #include "std.h"
  25. #include "cframe_.h"
  26.  
  27. /* This file replaces trace.c for Unix and VMS. */
  28. /* It has only the stack parsing functionality of trace.c -- */
  29. /* the tracing procedures are stubs. */
  30.  
  31. char *
  32. strupr(char *str)
  33. {    return str;
  34. }
  35.  
  36. /* Open the map file */
  37. FILE *
  38. trace_open_map(char *mapname, long *preloc)
  39. {    return NULL;
  40. }
  41.  
  42. /* Enumerate a symbol file */
  43. char *
  44. trace_next_symbol(char **paddr, FILE *mapf)
  45. {    return NULL;
  46. }
  47.  
  48.  
  49. /* Look up a symbol in a file */
  50. char *
  51. trace_find_symbol(char *name, FILE *mapf)
  52. {    return NULL;
  53. }
  54.  
  55. int trace_flush_flag;
  56.  
  57. /* Trace a named procedure */
  58. int
  59. trace_name(char *name, FILE *mapf, char *arg_format, int retsize)
  60. {    return -1;
  61. }
  62.  
  63. /* Trace a procedure */
  64. int
  65. trace(void (*proc)(), char *name, char *arg_format, int retsize)
  66. {    return -1;
  67. }
  68.  
  69. /* ------ Stack parsing ------ */
  70.  
  71. /* Forward declarations */
  72. char *stack_next_frame(P1(char *));
  73.  
  74. /* Get the address of the caller's frame */
  75. char *
  76. stack_top_frame()
  77. #ifdef ARC
  78. { return NULL; }
  79. #else
  80. {    jmp_buf buf;
  81.     setjmp(buf);            /* acquire registers */
  82.     return stack_next_frame(cstack_top_frame(buf));
  83. }
  84. #endif
  85.  
  86. /* Get the return address of a frame. */
  87. unsigned long
  88. stack_return(char *bp)
  89. {    return *(unsigned long *)(bp + 16);
  90. }
  91.  
  92. /* Get the address of the next higher frame, */
  93. /* or 0 if there is none. */
  94. char *
  95. stack_next_frame(char *bp)
  96. #ifdef ARC
  97. { return NULL; }
  98. #else
  99. {    char *nbp = cstack_next_frame(bp);
  100.     if ( nbp < bp ) return 0;
  101.     return nbp;
  102. }
  103. #endif
  104.