home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / c / xacclib / xacc_ext.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  1.3 KB  |  60 lines

  1. /* für die XACC-Bibliothek benötigte Funktionen
  2.  
  3.     (c) 1993 Harald Sommerfeldt @ KI
  4.     E-Mail:  Harald_Sommerfeldt@ki.maus.de
  5. */
  6.  
  7. #include <stddef.h>
  8. #ifdef __PUREC__
  9. #include <tos.h>
  10. #endif
  11. #ifdef __GNUC__
  12. #include <osbind.h>
  13. #include <gemext.h>
  14. #endif
  15.  
  16. /* benötigte allgemeine Definitionen */
  17. typedef enum { FALSE, TRUE } bool;
  18.  
  19.  
  20. /* Wert eines Cookies holen, zurückgegeben wird TRUE bei Erfolg */
  21.  
  22. typedef struct {
  23.     long    cookie, value;
  24. } cookiejar;
  25.  
  26. int    getcookie( long cookie, long *value )
  27. {
  28.     cookiejar *_p_cookies;
  29.     void    *sp;
  30.  
  31.     sp = (void *)Super( NULL );
  32.     _p_cookies = *(void **)0x5A0;        /* Zeiger auf Cookiejar holen */
  33.     Super( sp );
  34.     if ( _p_cookies != NULL ) {        /* wenn Cookiejar installiert ... */
  35.                                                 /* ... dann Cookies abklappern ... */
  36.         for (; _p_cookies->cookie != 0L; _p_cookies++ ) {
  37.             if ( _p_cookies->cookie == cookie ) {
  38.                                                 /* ... bis der gewünschte Eintrag ist */
  39.                 if ( value != NULL ) *value = _p_cookies->value;
  40.                 return TRUE;
  41.             }
  42.         }
  43.     }
  44.     return FALSE;
  45. }
  46.  
  47. #ifdef __GNUC__
  48. int    appl_search( int ap_smode, char *ap_sname, int *ap_stype, int *ap_sid )
  49. {
  50.     int    retval;
  51.     
  52.     _int_in[0] = ap_smode;
  53.     _addrin[0] = ap_sname;
  54.     retval = __aes__(AES_CONTROL_ENCODE(18, 1, 3, 1));
  55.     *ap_stype = _int_out[1];
  56.     *ap_sid = _int_out[2];
  57.     return retval;
  58. }
  59. #endif
  60.