1*2775Sraf /* 2*2775Sraf * CDDL HEADER START 3*2775Sraf * 4*2775Sraf * The contents of this file are subject to the terms of the 5*2775Sraf * Common Development and Distribution License, Version 1.0 only 6*2775Sraf * (the "License"). You may not use this file except in compliance 7*2775Sraf * with the License. 8*2775Sraf * 9*2775Sraf * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*2775Sraf * or http://www.opensolaris.org/os/licensing. 11*2775Sraf * See the License for the specific language governing permissions 12*2775Sraf * and limitations under the License. 13*2775Sraf * 14*2775Sraf * When distributing Covered Code, include this CDDL HEADER in each 15*2775Sraf * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*2775Sraf * If applicable, add the following below this CDDL HEADER, with the 17*2775Sraf * fields enclosed by brackets "[]" replaced with your own identifying 18*2775Sraf * information: Portions Copyright [yyyy] [name of copyright owner] 19*2775Sraf * 20*2775Sraf * CDDL HEADER END 21*2775Sraf */ 22*2775Sraf /* 23*2775Sraf * Copyright (c) 1997-1999 by Sun Microsystems, Inc. 24*2775Sraf * All rights reserved. 25*2775Sraf */ 26*2775Sraf 27*2775Sraf #ifndef _UTIL_H 28*2775Sraf #define _UTIL_H 29*2775Sraf 30*2775Sraf #pragma ident "%Z%%M% %I% %E% SMI" 31*2775Sraf 32*2775Sraf 33*2775Sraf #ifdef __cplusplus 34*2775Sraf extern "C" { 35*2775Sraf #endif 36*2775Sraf 37*2775Sraf /* String tables */ 38*2775Sraf typedef struct table_head_t { 39*2775Sraf int nelem; 40*2775Sraf int used; 41*2775Sraf char *elements[1]; /* Actually elements[nelem] */ 42*2775Sraf } table_t; 43*2775Sraf 44*2775Sraf 45*2775Sraf /* Debugging information */ 46*2775Sraf extern void print_metainfo(const Meta_info *); 47*2775Sraf extern void print_translatorinfo(const Translator_info *); 48*2775Sraf 49*2775Sraf extern char *get_string_table(table_t *, int); 50*2775Sraf extern table_t *add_string_table(table_t *, char *); 51*2775Sraf extern table_t *create_string_table(int); 52*2775Sraf extern table_t *free_string_table(table_t *); 53*2775Sraf extern int in_string_table(table_t *, char *); 54*2775Sraf extern int in_string_set(char *, char *); 55*2775Sraf extern void print_string_table(table_t *); 56*2775Sraf extern void sort_string_table(table_t *); 57*2775Sraf 58*2775Sraf /* Generic parsing of strings */ 59*2775Sraf extern char *strnormalize(char *); 60*2775Sraf extern char *strtrim(char *); 61*2775Sraf extern char *strlower(char *); 62*2775Sraf extern char *strset(char *, char *); 63*2775Sraf extern char *strend(char *); 64*2775Sraf extern char *lastspace(char *); 65*2775Sraf extern char *skipb(char *); 66*2775Sraf extern char *nextb(char *); 67*2775Sraf extern char *skipsep(char *); 68*2775Sraf extern char *nextsep(char *); 69*2775Sraf extern char *nextsep2(char *); 70*2775Sraf extern char *objectname(char *); 71*2775Sraf 72*2775Sraf #ifdef __cplusplus 73*2775Sraf } 74*2775Sraf #endif 75*2775Sraf 76*2775Sraf #endif /* _UTIL_H */ 77