home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / devmgmt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  3.4 KB  |  148 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ident    "@(#)/usr/include/devmgmt.h.sl 1.1 4.0 12/08/90 9461 AT&T-USL"
  11. /*
  12.  * Contents:
  13.  *    -    Device Management definitions,
  14.  *    -    getvol() definitions
  15.  */
  16.  
  17. /*
  18.  * Device management definitions
  19.  *    - Default pathnames (relative to installation point)
  20.  *     - Environment variable namess
  21.  *     - Standard field names in the device table
  22.  *    - Flags
  23.  *    - Miscellaneous definitions
  24.  */
  25.  
  26.  
  27. /*
  28.  * Default pathnames (relative to the package installation
  29.  * point) to the files used by Device Management:
  30.  *
  31.  *    DTAB_PATH    Device table
  32.  *    DGRP_PATH    Device group table
  33.  *    DVLK_PATH    Device reservation table
  34.  */
  35.  
  36. #define    DTAB_PATH            "/etc/device.tab"
  37. #define    DGRP_PATH            "/etc/dgroup.tab"
  38. #define    DVLK_PATH            "/etc/devlkfile"
  39.  
  40.  
  41. /*
  42.  * Names of environment variables
  43.  *
  44.  *    OAM_DEVTAB    Name of variable that defines the pathname to
  45.  *            the device-table file
  46.  *    OAM_DGROUP    Name of variable that defines the pathname to
  47.  *            the device-group table file
  48.  *    OAM_DEVLKTAB    Name of variable that defines the pathname to
  49.  *            the device-reservation table file
  50.  */
  51.  
  52. #define    OAM_DEVTAB            "OAM_DEVTAB"
  53. #define    OAM_DGROUP            "OAM_DGROUP"
  54. #define    OAM_DEVLKTAB            "OAM_DEVLKTAB"
  55.  
  56.  
  57. /*
  58.  * Standard field names in the device table
  59.  */
  60.  
  61. #define    DTAB_ALIAS            "alias"
  62. #define    DTAB_CDEVICE            "cdevice"
  63. #define    DTAB_BDEVICE            "bdevice"
  64. #define    DTAB_PATHNAME            "pathname"
  65.  
  66.  
  67. /* 
  68.  * Flags:
  69.  *    For getdev() and getdgrp():
  70.  *        DTAB_ANDCRITERIA    Devices must meet all criteria
  71.  *                    instead of any of the criteria
  72.  *        DTAB_EXCLUDEFLAG    The list of devices or device groups
  73.  *                    is the list that is to be excluded,
  74.  *                    not those to select from.
  75.  *        DTAB_LISTALL        List all device groups, even those that
  76.  *                    have no valid members (getdgrp() only).
  77.  */
  78.  
  79. #define    DTAB_ANDCRITERIA        0x01
  80. #define    DTAB_EXCLUDEFLAG        0x02
  81. #define    DTAB_LISTALL            0x04
  82.  
  83.  
  84. /*
  85.  * Miscellaneous Definitions
  86.  *
  87.  *    DTAB_MXALIASLN    Maximum alias length
  88.  */
  89.  
  90. #define    DTAB_MXALIASLN            14
  91.  
  92. /*
  93.  * Device Management Structure definitions
  94.  *    reservdev    Reserved device description
  95.  */
  96.  
  97.  
  98. /*
  99.  * struct reservdev
  100.  *
  101.  *    Structure describes a reserved device.
  102.  *
  103.  *  Elements:
  104.  *    char   *devname        Alias of the reserved device
  105.  *    pid_t    key        Key used to reserve the device
  106.  */
  107.  
  108. struct reservdev{
  109.     char   *devname;
  110.     pid_t    key;
  111. };
  112.  
  113. /*
  114.  * Device Management Functions:
  115.  *
  116.  *    devattr()    Returns a device's attribute
  117.  *    devreserv()    Reserves a device
  118.  *    devfree()    Frees a reserved device
  119.  *    reservdev()    Return list of reserved devices
  120.  *    getdev()    Get devices that match criteria
  121.  *    getdgrp()    Get device-groups containing devices 
  122.  *            that match criteria
  123.  *    listdev()    List attributes defined for a device
  124.  *    listdgrp()    List members of a device-group
  125.  */
  126.  
  127.     char               *devattr();
  128.     int            devfree();
  129.     char              **devreserv();
  130.     char              **getdev();
  131.     char              **getdgrp();
  132.     char              **listdev();
  133.     char              **listdgrp();
  134.     struct reservdev      **reservdev();
  135.  
  136. /*
  137.  * getvol() definitions
  138.  */
  139.  
  140. #define    DM_BATCH    0x0001
  141. #define DM_ELABEL    0x0002
  142. #define DM_FORMAT    0x0004
  143. #define DM_FORMFS    0x0008
  144. #define DM_WLABEL    0x0010
  145. #define DM_OLABEL    0x0020
  146.  
  147.     int            getvol();    
  148.