qt.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include "qt/copyright.h"
  2. #include "qt/qt.h"
  3. #ifdef QT_VARGS_DEFAULT
  4. /* If the stack grows down, `vargs' is a pointer to the lowest
  5. address in the block of arguments. If the stack grows up, it is a
  6. pointer to the highest address in the block. */
  7. qt_t *
  8. qt_vargs (qt_t *sp, int nbytes, void *vargs,
  9. void *pt, qt_startup_t *startup,
  10. qt_vuserf_t *vuserf, qt_cleanup_t *cleanup)
  11. {
  12. int i;
  13. sp = QT_VARGS_MD0 (sp, nbytes);
  14. #ifdef QT_GROW_UP
  15. for (i=nbytes/sizeof(qt_word_t); i>0; --i) {
  16. QT_SPUT (QT_VARGS_ADJUST(sp), i, ((qt_word_t *)vargs)[-i]);
  17. }
  18. #else
  19. for (i=nbytes/sizeof(qt_word_t); i>0; --i) {
  20. QT_SPUT (QT_VARGS_ADJUST(sp), i-1, ((qt_word_t *)vargs)[i-1]);
  21. }
  22. #endif
  23. QT_VARGS_MD1 (QT_VADJ(sp));
  24. QT_SPUT (QT_VADJ(sp), QT_VARGT_INDEX, pt);
  25. QT_SPUT (QT_VADJ(sp), QT_VSTARTUP_INDEX, startup);
  26. QT_SPUT (QT_VADJ(sp), QT_VUSERF_INDEX, vuserf);
  27. QT_SPUT (QT_VADJ(sp), QT_VCLEANUP_INDEX, cleanup);
  28. return ((qt_t *)QT_VADJ(sp));
  29. }
  30. #endif /* def QT_VARGS_DEFAULT */
  31. void
  32. qt_null (void)
  33. {
  34. }
  35. void
  36. qt_error (void)
  37. {
  38. extern void abort(void);
  39. abort();
  40. }