2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 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 2003 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * Private method declarations 2N/A}
/* fileutil_free_string_array */ 2N/A * Caller must free the space allocated to return_array by calling 2N/A * fileutil_free_string_array. 2N/A}
/* fileutil_get_first_column_data */ 2N/A * Convenience function for retrieving the default fstype from /etc/fstypes. 2N/A while (
isspace(*s) || *s !=
'\0')
/* skip leading whitespace */ 2N/A if (*s !=
'#') {
/* not a comment */ 2N/A while (!
isspace(*t) && *t !=
'\0')
/* get the token */ 2N/A *t =
'\0';
/* ignore rest of line */ 2N/A return (
NULL);
/* that's all, folks! */ 2N/A}
/* fileutil_getfs */ 2N/A}
/* fileutil_getline */ 2N/A * fileutil_get_cmd_from_string - retieves the command string minus any 2N/A * comments from the original string. 2N/A * char *input_string - the original string. 2N/A * Comments begin with '#'. Strip them off. 2N/A * NOTE: the caller of this function is responsible for freeing any 2N/A * memory allocated by calling fileutil_free_string_array() 2N/A * fileutil_add_string_to_array - adds one line to the file image 2N/A * char ***string_array - reference to the string array 2N/A * char *line - the line to be added to the temporary dfstab 2N/A * int *count - the number of elements in the string array 2N/A * int *err - error pointer for returning any errors encountered 2N/A * B_TRUE on success, B_FALSE on failure. 2N/A}
/* fileutil_add_string_to_array */ 2N/A}
/* get_first_column_data */ 2N/A}
/* retrieve_string */ 2N/A * trim_trailing_whitespace - helper function to remove trailing 2N/A * whitespace from a line 2N/A * char *input_stringp - the line to be trimed 2N/A * Truncates the last character which will always be '\0'