home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff258.lzh / Suplib / doc / misc.doc < prev    next >
Text File  |  1989-10-18  |  5KB  |  164 lines

  1.  
  2.                   MISC.DOC
  3.              (SUP32.LIB and DRES.LIBRARY)
  4.  
  5.  
  6. WildCmp                             WildCmp
  7.  
  8.     CBOOL  = WildCmp(wildcard, filename)
  9.     char *wildcard;
  10.     char *filename;
  11.  
  12.     The wildcard characters supported are * and ?.  The wildcard is
  13.     compared against the filename and (1) returned on success, (0) on
  14.     failure.
  15.  
  16.  
  17. WaitMsg                             WaitMsg
  18.  
  19.     msg    = WaitMsg(msg)
  20.     EXECMSG *msg;
  21.  
  22.     This routines Waits for a message to be returned just like WaitIO()
  23.     waits for an io request to complete.  The message is REMOVED from the
  24.     reply port after it has returned.
  25.  
  26.     the message must have a valid mn_ReplyPort() and must have been queued
  27.     with PutMsg(), which sets the ln_Type to NT_MESSAGE, and replied with
  28.     ReplyMsg(), which sets the ln_Type to NT_REPLYMSG.
  29.  
  30.  
  31. CheckMsg                            CheckMsg
  32.  
  33.     msg/NULL = CheckMsg(msg)
  34.     EXECMSG *msg;
  35.  
  36.     This routine checks to see if the message has been returned.  The
  37.     same restrictions apply as for WaitMsg().  the message is NOT removed.
  38.     The message is returned if it has been returned (not removed), or
  39.     NULL otherwise.
  40.  
  41.  
  42. CheckPort                            CheckPort
  43.  
  44.     msg/NULL = CheckPort(port)
  45.     EXECMSG *msg;
  46.     PORT *port;
  47.  
  48.     This routine works like WaitPort(), but (1) does not block, and
  49.     (2) does not remove the message.  If the port is not empty the first
  50.     message is returned (not removed), else NULL is returned if the port
  51.     is empty.
  52.  
  53.  
  54. LockAddr                            LockAddr
  55.  
  56.     (void) LockAddr(&lock)
  57.     long lock[2];
  58.  
  59.     The lock structure (8 bytes) MUST initially be 0.  This routine obtains
  60.     an exclusive lock on the structure and blocks until that lock can be
  61.     obtained.  The structure must be word-aligned.
  62.  
  63.     Unless it is forced to block, this subroutine is extremely fast.  This
  64.     routine does not allocate any signals, but uses the reserved EXEC
  65.     semaphore signal.
  66.  
  67.  
  68. LockAddrB                            LockAddrB
  69.  
  70.     (void) LockAddr(bitno, &lock)
  71.     long bitno;
  72.     long lock[2];
  73.  
  74.     The lock structure actually supports up to 8 independant exclusive
  75.     locks.  LockAddr() is a special case which uses bit # 0.  This call
  76.     works as in LockAddr() but you may specify the bit you wish to lock
  77.     (0 to 7).  If you specify 0, this call is equivalent to LockAddr().
  78.  
  79.  
  80. UnLockAddr                            UnLockAddr
  81.  
  82.     (void) UnLockAddr(&lock)
  83.     long lock[2];
  84.  
  85.     Remove an exclusive lock you had previously obtained.  If other tasks
  86.     are waiting for this lock, ALL are awakened even though only one will
  87.     get the lock next.    This ensures that the highest priority task will
  88.     get the lock next.
  89.  
  90.     This routine is extremely fast if nobody else is waiting for the lock,
  91.     else it has to Signal() them.  You MUST have previously obtained the
  92.     lock.
  93.  
  94.  
  95. UnLockAddrB                            UnLockAddrB
  96.  
  97.     (void) UnLockAddrB(bitno, &lock)
  98.     long bitno;
  99.     long lock[2];
  100.  
  101.     Again, this routine works the same as UnLockAddr() with the exception
  102.     that you may specify one of the 8 bits to unlock (0 to 7).
  103.  
  104.  
  105. DoSyncMsg                            DoSyncMsg
  106.  
  107.     (void) DoSyncMsg(port, msg)
  108.     PORT *port;
  109.     EXECMSG *msg;
  110.  
  111.     This routine PutMsg()s a message and waits for it to be returned.  This
  112.     routine creates its own reply port on the stack and stuffs it into
  113.     mn_ReplyPort for you.  Thus, virtually no setup is required to use
  114.     this routine.
  115.  
  116.  
  117. FindName2                            FindName2
  118.  
  119.     node/NULL = FindName2(list, name)
  120.  
  121.     This routine is identical to the EXEC FindName() call with the exception
  122.     that it ignores nodes whos ln_Name fields are NULL.  ln_Name fields in
  123.     the list nodes must contain either NULL or a valid string pointer.
  124.  
  125.  
  126. GetTaskData                            GetTaskData
  127.  
  128.     ptr = GetTaskData(name, bytes)
  129.     APTR ptr;
  130.     char *name;
  131.     long bytes;
  132.  
  133.     This routine retrieves/allocates task-private named storage.  For a
  134.     specific name, the first GetTaskData() call will allocate the specified
  135.     # of bytes and zero them.  Space to hold the name itself is also
  136.     allocated (i.e. you can use a temporary buffer to hold 'name' when you
  137.     make this call).  Future calls return the pointer to the already
  138.     allocated storage without modifying it.
  139.  
  140.     The storage is automatically freed if the TASK is removed... note that
  141.     the task is not normally removed when a C program exits back into a
  142.     CLI enviroment... it uses the CLI's task to run the program.  The
  143.     task's memory list is used to implement this function.
  144.  
  145.     If 0 bytes are specified, the routine fails (returns NULL) if the named
  146.     buffer does not already exist.
  147.  
  148.  
  149. FreeTaskData                            FreeTaskData
  150.  
  151.     (void) FreeTaskData(name)
  152.     char *name;
  153.  
  154.     If the task-private name exists, the storage associated with it is
  155.     freed.  This works with memlist entries allocated with GetTaskData()
  156.     or by the user, assuming the ln_Name field points to a valid string.
  157.  
  158.     (note:  FreeEntry() is used after the associated MemList structure is
  159.      unlinked frlom the list.  ln_Name is not specifically freed but the
  160.      way GetTaskData() works, the second entry is actually the storage
  161.      associated with the ln_Name)
  162.  
  163.  
  164.