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 2006 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 2N/A/* All Rights Reserved */ 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * generate a vector of pointers (arps) to the 2N/A * substrings in string "s". 2N/A * Each substring is separated by blanks and/or tabs. 2N/A * s -> string to analyze -- s GETS MODIFIED 2N/A * arps -> array of pointers -- count + 1 pointers 2N/A * count -> max number of fields 2N/A * i -> # of subfields 2N/A while (*s ==
' ' || *s ==
'\t')
2N/A while (*s !=
'\0' && *s !=
' ' && *s !=
'\t' && *s !=
'\n')
2N/A * bsfix(args) - remove backslashes from args 2N/A * \123 style strings are collapsed into a single character 2N/A * \000 gets mapped into \N for further processing downline. 2N/A * \ at end of string is removed 2N/A * \t gets replaced by a tab 2N/A * \n gets replaced by a newline 2N/A * \r gets replaced by a carriage return 2N/A * \b gets replaced by a backspace 2N/A * \s gets replaced by a blank 2N/A * any other unknown \ sequence is left intact for further processing