getdaent.c revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 1988, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A * trims off leading and trailing white space from input string. 2N/A * The leading white space is skipped by moving the pointer forward. 2N/A * The trailing white space is removed by nulling the white space 2N/A * returns pointer to non-white string, else returns NULL if input string 2N/A * is null or if the resulting string has zero length. 2N/A * trims off multiple occurrences of white space from input string. 2N/A * returns the number of spaces retained 2N/A * bytes. Continued lines from stream are concatenated into one line in 2N/A * buff. Comments are removed from buff. 2N/A * returns the number of characters in buff, else returns 0 if no 2N/A * characters are read or an error occurred. 2N/A * allocates common buffers and structures. 2N/A * returns pointer to the new structure, else returns NULL on error. 2N/A * gets individual fields separated by skip in ptr. 2N/A /* check for a continuing search */ 2N/A /* check for source end */ 2N/A /* find terminator */ 2N/A /* terminate and set continuation pointer */ 2N/A * trim off any surrounding white space, return what's left 2N/A * rewinds the device_allocate file to the begining. 2N/A * closes device_allocate file. 2N/A * changes the default device_allocate file to the one specified. 2N/A * It does not close the previous file. If this is desired, enddaent 2N/A * should be called prior to setdafile. 2N/A * checks if device_allocate has string DEVICE_ALLOCATION=ON or 2N/A * DEVICE_ALLOCATION=OFF string in it. 2N/A * returns 1 if the string is DEVICE_ALLOCATION=ON, 0 if it is 2N/A * DEVICE_ALLOCATION=OFF, -1 if neither string present. 2N/A * When first called, returns a pointer to the first devalloc_t 2N/A * structure in device_allocate; thereafter, it returns a pointer to the 2N/A * next devalloc_t structure in the file. Thus, successive calls can be 2N/A * used to search the entire file. 2N/A * call to getdaent should be bracketed by setdaent and enddaent. 2N/A * returns NULL on error. 2N/A * searches from the beginning of device_allocate for the device specified 2N/A * call to getdanam should be bracketed by setdaent and enddaent. 2N/A * returns pointer to devalloc_t for the device if it is found, else 2N/A * returns NULL if device not found or in case of error. 2N/A * searches from the beginning of device_allocate for the device specified 2N/A * call to getdatype should be bracketed by setdaent and enddaent. 2N/A * returns pointer to devalloc_t for the device if it is found, else 2N/A * returns NULL if device not found or in case of error. 2N/A * checks if the specified devalloc_t is for the device specified. 2N/A * returns 1 if it is, else returns 0. 2N/A * checks if the specified devalloc_t is for the device type specified. 2N/A * returns 1 if match found, else, returns 0. 2N/A * calls da_matchname or da_matchdev as appropriate. 2N/A * parses val and initializes pointers in devalloc_t. 2N/A * returns pointer to parsed devalloc_t entry, else returns NULL on error. 2N/A /* remove any extraneous whitespace in the options */ 2N/A /* if label range is not defined, use the default range. */ 2N/A * label range provided; we don't need to construct