home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 5 / RISCWORLD_VOL5.iso / SOFTWARE / Issue1 / PD / SFX / Source / SpecialFX / h / header < prev    next >
Encoding:
Text File  |  2004-04-09  |  5.1 KB  |  144 lines

  1. /*
  2.  * Created by cmhg vsn 5.42 [01 Mar 2002]
  3.  */
  4.  
  5. #ifndef __cmhg_header_h
  6. #define __cmhg_header_h
  7.  
  8. #ifndef __kernel_h
  9. #include "kernel.h"
  10. #endif
  11.  
  12. #define CMHG_VERSION 542
  13.  
  14. #define Module_Title                     "SpecialFX"
  15. #define Module_Help                      "SpecialFX"
  16. #define Module_VersionString             "1.04"
  17. #define Module_VersionNumber             104
  18. #ifndef Module_Date
  19. #define Module_Date                      "09 Apr 2004"
  20. #endif
  21.  
  22.  
  23. /*
  24.  * Initialisation code
  25.  * ===================
  26.  *
  27.  * Return NULL if your initialisation succeeds; otherwise return a pointer
  28.  * to an error block. cmd_tail points to the string of arguments with which
  29.  * the module is invoked (may be "", and is control-terminated, not zero
  30.  * terminated).
  31.  * podule_base is 0 unless the code has been invoked from a podule.
  32.  * pw is the 'R12' value established by module initialisation. You may
  33.  * assume nothing about its value (in fact it points to some RMA space
  34.  * claimed and used by the module veneers). All you may do is pass it back
  35.  * for your module veneers via an intermediary such as SWI OS_CallEvery
  36.  * (use _swix() to issue the SWI call).
  37.  */
  38. _kernel_oserror *SpecialFXInitialise(const char *cmd_tail, int podule_base, void *pw);
  39.  
  40.  
  41. /*
  42.  * Finalisation code
  43.  * =================
  44.  *
  45.  * Return NULL if your finalisation succeeds. Otherwise return a pointer to
  46.  * an error block if your finalisation handler does not wish to die (e.g.
  47.  * toolbox modules return a 'Task(s) active' error).
  48.  * fatal, podule and pw are the values of R10, R11 and R12 (respectively)
  49.  * on entry to the finalisation code.
  50.  */
  51. _kernel_oserror *SpecialFXFinalise(int fatal, int podule, void *pw);
  52.  
  53.  
  54. /*
  55.  * Service call handler
  56.  * ====================
  57.  *
  58.  * Return values should be poked directly into r->r[n]; the right
  59.  * value/register to use depends on the service number (see the relevant
  60.  * RISC OS Programmer's Reference Manual section for details).
  61.  * pw is the private word (the 'R12' value).
  62.  */
  63. void SpecialFXService(int service_number, _kernel_swi_regs *r, void *pw);
  64.  
  65.  
  66. /*
  67.  * Command handler
  68.  * ===============
  69.  *
  70.  * If cmd_no identifies a command, then arg_string gives the command tail
  71.  * (which you may not overwrite), and argc is the number of parameters.
  72.  * NB. arg_string is control terminated so it may not be a C string.
  73.  * Return NULL if the command has been successfully handled; otherwise
  74.  * return a pointer to an error block describing the failure (in this
  75.  * case, the veneer code will set the 'V' bit).
  76.  *
  77.  * If cmd_no identifies a *Help entry, then arg_string denotes a buffer
  78.  * that you can assemble your output into. cmd_handler must return
  79.  * NULL, an error pointer or help_PRINT_BUFFER (if help_PRINT_BUFFER)
  80.  * is returned, the zero-terminated buffer will be printed).
  81.  *
  82.  * If cmd_no identifies a *Configure option, then arg_string gives the
  83.  * command tail, and argc the number of parameters. Return NULL, an error
  84.  * pointer, or one of the four special values defined below. If arg_string
  85.  * is set to arg_CONFIGURE_SYNTAX, the user has typed *Configure with no
  86.  * parameter; simply print your syntax string. If arg_string is set to
  87.  * arg_STATUS, print your current configured status. Otherwise use
  88.  * arg_string and argc to set the *Configure option.
  89.  *
  90.  * pw is the private word pointer ('R12') value passed into the entry
  91.  * veneer
  92.  */
  93. #define help_PRINT_BUFFER         ((_kernel_oserror *) arg_string)
  94. #define arg_CONFIGURE_SYNTAX      ((char *) 0)
  95. #define arg_STATUS                ((char *) 1)
  96. #define configure_BAD_OPTION      ((_kernel_oserror *) -1)
  97. #define configure_NUMBER_NEEDED   ((_kernel_oserror *) 1)
  98. #define configure_TOO_LARGE       ((_kernel_oserror *) 2)
  99. #define configure_TOO_MANY_PARAMS ((_kernel_oserror *) 3)
  100.  
  101. #define CMD_SpecialFX                   0
  102. #define CMD_SpecialFXRemove             1
  103. #define CMD_SpecialFXTasks              2
  104. #define CMD_SpecialFXFilters            3
  105.  
  106. _kernel_oserror *SpecialFXCommand(const char *arg_string, int argc, int cmd_no, void *pw);
  107.  
  108.  
  109. /*
  110.  * Generic veneers
  111.  * ===============
  112.  *
  113.  * These are the names of the generic entry veneers compiled by CMHG.
  114.  * Use these names as an argument to, for example, SWI OS_CallEvery
  115.  * or OS_AddCallBack.
  116.  *
  117.  * These veneers ensure that your handlers preserve R0-R11
  118.  * and the processor flags (unless you return an error pointer.
  119.  * The veneer can be entered in either IRQ or SVC mode. R12 and
  120.  * R14 are corrupted.
  121.  */
  122. extern void prefilter_entry(void);
  123. extern void postfilter_entry(void);
  124.  
  125. /*
  126.  * These are the handler functions that the veneers declared above
  127.  * call.
  128.  *
  129.  * For a standard exit, return NULL. For handlers that can return an
  130.  * error, return an error block pointer, and the veneer will set the
  131.  * 'V' bit, and set R0 to the error pointer.
  132.  *
  133.  * 'r' points to a vector of words containing the values of R0-R9 on
  134.  * entry to the veneer. If r is updated, the updated values will be
  135.  * loaded into R0-R9 on return from the handler.
  136.  *
  137.  * pw is the private word pointer ('R12') value with which the
  138.  * entry veneer is called.
  139.  */
  140. _kernel_oserror *prefilter_handler(_kernel_swi_regs *r, void *pw);
  141. _kernel_oserror *postfilter_handler(_kernel_swi_regs *r, void *pw);
  142.  
  143. #endif
  144.