home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 240.lha / PickPacket_v1.0 / Sources / stlock.c < prev    next >
C/C++ Source or Header  |  1989-05-04  |  3KB  |  82 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
  2. * |_o_o|\\ Copyright (c) 1989 The Software Distillery.                    *
  3. * |. o.| ||          All Rights Reserved                                  *
  4. * | .  | ||          Written by John Toebes and Doug Walker               *
  5. * | o  | ||          The Software Distillery                              *
  6. * |  . |//           235 Trillingham Lane                                 *
  7. * ======             Cary, NC 27513                                       *
  8. *                    BBS:(919)-471-6436                                   *
  9. \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  10. #include "pickpack.h"
  11. #include "struct.h"
  12. #include "lockgen.h"
  13.  
  14. static struct IntuiText IText =
  15. {
  16.    1,0,JAM2,   /* front and back text pens, drawmode and fill byte */
  17.    0,0,        /* XY origin relative to container TopLeft */
  18.    &TOPAZ80,   /* font pointer or NULL for default */
  19.    NULL,       /* pointer to text */
  20.    NULL        /* next IntuiText structure */
  21. };
  22.  
  23. static struct IntuiText NameText = {
  24.    3,0,JAM2,   /* front and back text pens, drawmode and fill byte */
  25.    0,0,        /* XY origin relative to container TopLeft */
  26.    &TOPAZ80,   /* font pointer or NULL for default */
  27.    NULL,       /* pointer to text */
  28.    NULL        /* next IntuiText structure */
  29. };
  30.  
  31. void stlocknew(nw, it, stnode)
  32. struct NewWindow **nw;
  33. struct IntuiText **it;
  34. struct STNODE *stnode;
  35. {
  36.    *nw = &NewWindowStructure1;
  37.    *it = NULL;
  38.    return;
  39. }
  40.  
  41. /* Display the struct */
  42. int stlockdisp(n)
  43. struct STNODE *n;
  44. {
  45.    char data[100];
  46.    struct FileLock *lock;
  47.    char *p;
  48.  
  49.    INITTEXT(14)
  50.    BUG(1,("stlockdisp: Entry, stnode 0x%08x window 0x%08x\n", n, n->w))
  51.    NameText.IText = (UBYTE *)data;
  52.  
  53.    lock = n->d.lock;
  54.  
  55.    sprintf(data, " Basename: %s", n->oname);
  56.    SHOWNAME
  57.  
  58.    sprintf(data, "  fl_Link: %08lx (Next Lock)",       lock->fl_Link);
  59.    SHOWTEXT
  60.  
  61.    sprintf(data, "   fl_Key: %08lx (Disk Block)",      lock->fl_Key);
  62.    SHOWTEXT
  63.  
  64.    switch(lock->fl_Access)
  65.       {
  66.       case SHARED_LOCK:    p = "(SHARED_LOCK/READ)    "; break;
  67.       case EXCLUSIVE_LOCK: p = "(EXCLUSIVE_LOCK/WRITE)"; break;
  68.       default:             p = "(Unknown Access)      "; break;
  69.       }
  70.    sprintf(data, "fl_Access: %08lx %s",                lock->fl_Access, p);
  71.    SHOWTEXT
  72.  
  73.    sprintf(data, "  fl_Task: %08lx (Handler Process)", lock->fl_Task);
  74.    SHOWTEXT
  75.  
  76.    sprintf(data, "fl_Volume: %08lx (Volume entry)",    lock->fl_Volume);
  77.    SHOWTEXT
  78.  
  79.    BUG(1, ("stlockdisp: Exit\n"))
  80.    return(RC_OK);
  81. }
  82.