home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / sillies / silly1 / !Rippler / c / oldrip next >
Text File  |  1990-03-05  |  1KB  |  56 lines

  1. /* > c.ripple
  2.  
  3.  * How to make strange things happen to your screen
  4.  
  5.  */
  6.  
  7. #include "kernel.h"
  8. #include <stdio.h>
  9.  
  10. #define  UNUSED(x)              (x = x)
  11.  
  12. _kernel_oserror *cmd(char *arg_string, int argc, int cmd_no, void *pw)
  13. {
  14.     return NULL;
  15. }
  16.  
  17. void tm_service(int service_number, _kernel_swi_regs *r, void *private_word)
  18. {
  19.     UNUSED(r);
  20.     UNUSED(private_word);
  21. /*
  22.  *  In general, it is a Bad Thing to use printf inside an arbitrary
  23.  *  service call handler (e.g. in one that catches errors - call 6 -
  24.  *  as this one does. Therefore we merely count what's happening and
  25.  * print it out when the TestCModule's SWI is called.
  26.  */
  27.     if (service_number == UNKNOWN_CMD_SERVICE)
  28.         ++unknown_cmd_count;
  29.     else
  30.         ++other_service_call_count;
  31. }
  32.  
  33. int tm_initialise(char *cmd_tail, int podule_base, void *private_word)
  34. {
  35.     UNUSED(cmd_tail);
  36.     UNUSED(podule_base);
  37.     UNUSED(private_word);
  38.     unknown_cmd_count = other_service_call_count = 0;
  39.     return 0;
  40. }
  41.  
  42. int main(int argc, char *argv[])
  43. {
  44.     int i;
  45.  
  46.     printf("%s: run code entered - ", TM);
  47.     if (argc == 0)
  48.         printf("no args\n");
  49.     else
  50.     {
  51.         for (i = 0; i < argc; i++) printf(" %s", argv[i]);
  52.         printf("\n");
  53.     }
  54.     return 0;
  55. }
  56.