home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / kn / elate / exec / findself.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-05-12  |  460 b   |  34 lines

  1.  
  2. #include <stdio.h>
  3. #include "tek/kn/elate/exec.h"
  4.  
  5.  
  6. /* 
  7. **    TEKlib
  8. **    (C) 2001 TEK neoscientists
  9. **    all rights reserved.
  10. **
  11. **    TAPTR kn_findself(TVOID)
  12. **
  13. **    find context data.
  14. **
  15. */
  16.  
  17. TAPTR kn_findself(TVOID)
  18. {
  19.     char buffer[16];
  20.     struct elatethread *t;
  21.     
  22.     sprintf(buffer, "tektask%08x", kn_proc_pid_get());
  23.     t = kn_nda_find(buffer);
  24.     if (t)
  25.     {
  26.         return t->data;
  27.     }
  28.     else
  29.     {
  30.         dbkprintf(20,"*** TEKLIB kernel: cannot find self context\n");
  31.         return TNULL;
  32.     }
  33. }
  34.