home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /****************************************************************************
- getconfig()
- by: David B. Ligon
- 7/10/89
-
- Getconfig recieves a parameter and passes back TRUE or FALSE, depending on
- whether the the option is installed in your Personal IRIS. Currently the
- options that are supported include:
-
- TURBO returns TRUE if the turbo graphics option is installed
- RE2 returns TRUE if the RE2 graphics processor is installed
- ZBUFFER returns TRUE if the hardware zbuffer option is installed
- BITPLANES returns TRUE if the 24 (8+16) bitplanes option is installed
- SMALLSONY returns TRUE if the 1024x768 monitor is installed
- MIPS20 returns TRUE if the 20MHz R3000 option is installed
- MEMORY returns the amount of user memory installed in bytes
-
- See getconfig.h for the defines for these parameters or copy the following:
-
- #define TURBO 1
- #define RE2 2
- #define ZBUFFER 3
- #define BITPLANES 4
- #define SMALLSONY 5
- #define MIPS20 8
- #define MEMORY 9
- #define PI 10
- #define R2300 11
-
- *****************************************************************************/
-
- #include "invent.h"
- #include "getconfig.h"
-
- #define GRAPHICS_MASK 7
-
- /* fix until alpha 21 where IP10 will show up in include/sys/invent.h */
- #ifndef INV_IP10BOARD
- #define INV_IP10BOARD 7
- #endif
-
- #ifndef TRUE
- #define TRUE 1
- #endif
-
- #ifndef FALSE
- #define FALSE 0
- #endif
-
- #ifndef NULL
- #define NULL 0
- #endif
-
- /* searches inventory list for graphics or cpu options for the Personal IRIS */
- long getconfig(int feature)
- {
- inventory_t *irec;
-
- setinvent();
-
- while ((irec = getinvent()) != NULL) {
- if (feature & GRAPHICS_MASK && irec->class == INV_GRAPHICS) {
- switch (feature) {
- case TURBO:
- if (irec->state & INV_GR1TURBO)
- return(TRUE);
- break;
- case RE2:
- if (irec->state & INV_GR1RE2)
- return(TRUE);
- break;
- case ZBUFFER:
- if (irec->state & INV_GR1ZBUF24)
- return(TRUE);
- break;
- case BITPLANES:
- if (irec->state & INV_GR1BIT24)
- return(TRUE);
- break;
- case SMALLSONY:
- if (irec->state & INV_GR1SMALLMON)
- return(TRUE);
- break;
- default:
- break;
- }
- }
-
- if (feature == MIPS20 && irec->class == INV_PROCESSOR &&
- irec->class == INV_CPUCHIP && irec->type == INV_IP10BOARD) {
- return(TRUE);
- }
-
- if (feature == MEMORY && irec->class == INV_MEMORY &&
- irec->type == INV_MAIN) {
- return(irec->state);
- }
-
- if (feature == PI && irec->class == INV_PROCESSOR && irec->type ==
- INV_CPUBOARD && (irec->state == INV_IP6BOARD ||
- irec->state == INV_IP10BOARD)) {
- return(TRUE);
- }
-
- if (feature == R2300 && irec->class == INV_PROCESSOR && irec->type ==
- INV_CPUBOARD && irec->state == INV_R2300BOARD) {
- return(TRUE);
- }
-
- }
- return (FALSE);
- }
-
-