/usr.bin/dc/extern.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 63 lines · 36 code · 6 blank · 21 comment · 0 complexity · d7896bf19e7f2bc7f46051b753d49420 MD5 · raw file

  1. /* $FreeBSD$ */
  2. /* $OpenBSD: extern.h,v 1.3 2006/01/16 08:09:25 otto Exp $ */
  3. /*
  4. * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
  5. *
  6. * Permission to use, copy, modify, and distribute this software for any
  7. * purpose with or without fee is hereby granted, provided that the above
  8. * copyright notice and this permission notice appear in all copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  11. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  13. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #include <stdbool.h>
  19. #include "bcode.h"
  20. /* inout.c */
  21. void src_setstream(struct source *, FILE *);
  22. void src_setstring(struct source *, char *);
  23. struct number *readnumber(struct source *, u_int);
  24. void printnumber(FILE *, const struct number *, u_int);
  25. char *read_string(struct source *);
  26. void print_value(FILE *, const struct value *, const char *, u_int);
  27. void print_ascii(FILE *, const struct number *);
  28. /* mem.c */
  29. struct number *new_number(void);
  30. void free_number(struct number *);
  31. struct number *dup_number(const struct number *);
  32. void *bmalloc(size_t);
  33. void *brealloc(void *, size_t);
  34. char *bstrdup(const char *p);
  35. void bn_check(int);
  36. void bn_checkp(const void *);
  37. /* stack.c */
  38. void stack_init(struct stack *);
  39. void stack_free_value(struct value *);
  40. struct value *stack_dup_value(const struct value *, struct value *);
  41. void stack_swap(struct stack *);
  42. size_t stack_size(const struct stack *);
  43. void stack_dup(struct stack *);
  44. void stack_pushnumber(struct stack *, struct number *);
  45. void stack_pushstring(struct stack *stack, char *);
  46. void stack_push(struct stack *, struct value *);
  47. void stack_set_tos(struct stack *, struct value *);
  48. struct value *stack_tos(const struct stack *);
  49. struct value *stack_pop(struct stack *);
  50. struct number *stack_popnumber(struct stack *);
  51. char *stack_popstring(struct stack *);
  52. void stack_clear(struct stack *);
  53. void stack_print(FILE *, const struct stack *, const char *,
  54. u_int base);
  55. void frame_assign(struct stack *, size_t, const struct value *);
  56. struct value *frame_retrieve(const struct stack *, size_t);
  57. /* void frame_free(struct stack *); */