/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <ctype.h>
#include <thread.h>
#include <synch.h>
#include "libfsmgt.h"
/*
* Private method declarations
*/
static char *get_first_column_data(char *line);
static char *trim_trailing_whitespace(char *line);
/*
* Public methods
*/
void
{
int i = 0;
}
}
} /* fileutil_free_string_array */
char **
{
char *returned_string;
*errp = 0;
*num_elements = 0;
while ((returned_string =
char **tmp_array;
*num_elements = 0;
return (NULL);
}
*num_elements = 0;
return (NULL);
}
}
/*
* Caller must free the space allocated to return_array by calling
* fileutil_free_string_array.
*/
return (return_array);
} /* fileutil_get_first_column_data */
/*
*/
char *
{
char *s;
++s;
if (*s != '#') { /* not a comment */
char *t = s;
++t;
*t = '\0'; /* ignore rest of line */
return (s);
}
}
return (NULL); /* that's all, folks! */
} /* fileutil_getfs */
char *
{
*p = '\0';
return (share_cmd);
}
return (NULL);
} /* fileutil_getline */
/*
* fileutil_get_cmd_from_string - retieves the command string minus any
* comments from the original string.
*
* Parameters:
* char *input_string - the original string.
*/
char *
{
/*
* Comments begin with '#'. Strip them off.
*/
char *returned_stringp;
char *start_of_commentp;
char *current_string;
return (NULL);
}
if (current_string == NULL) {
return (NULL);
}
if (start_of_commentp != NULL) {
*start_of_commentp = '\0';
}
return (returned_stringp);
}
/*
* NOTE: the caller of this function is responsible for freeing any
* memory allocated by calling fileutil_free_string_array()
*
* fileutil_add_string_to_array - adds one line to the file image
* string array
* Parameters:
* char ***string_array - reference to the string array
* char *line - the line to be added to the temporary dfstab
* int *count - the number of elements in the string array
* int *err - error pointer for returning any errors encountered
*
* Returns:
* B_TRUE on success, B_FALSE on failure.
*/
int *err)
{
int i;
for (i = 0; i < *count; i ++) {
ret_val[i] = temp_array[i];
}
(*count)++;
if (temp_array != NULL) {
}
*string_array = ret_val;
} else {
return (B_FALSE);
}
} else {
return (B_FALSE);
}
return (B_TRUE);
} /* fileutil_add_string_to_array */
/*
* Private methods
*/
static char *
{
} /* get_first_column_data */
static char *
{
char *data;
char *returned_string;
while ((returned_string =
return (data);
}
return (NULL);
} /* retrieve_string */
/*
* trim_trailing_whitespace - helper function to remove trailing
* whitespace from a line
*
* Parameters:
* char *input_stringp - the line to be trimed
*/
static char *
{
char *last_nonspace;
char *return_string;
int string_length;
if (input_string == NULL) {
return (NULL);
}
return (NULL);
}
if (return_string == NULL) {
return (NULL);
}
/*
* Truncates the last character which will always be '\0'
*/
while (isspace(*last_nonspace)) {
}
return (return_string);
}