1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
23 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#ifndef	_MDB_STRING_H
28#define	_MDB_STRING_H
29
30#include <sys/types.h>
31#include <strings.h>
32
33#ifdef	__cplusplus
34extern "C" {
35#endif
36
37#define	NTOS_UPCASE	0x1	/* Use upper-case hexadecimal digits */
38#define	NTOS_UNSIGNED	0x2	/* Value is meant to be unsigned */
39#define	NTOS_SIGNPOS	0x4	/* Prefix positive values with sign '+' */
40#define	NTOS_SHOWBASE	0x8	/* Show base under appropriate circumstances */
41
42extern const char *numtostr(uintmax_t, int, uint_t);
43extern uintmax_t mdb_strtonum(const char *, int);
44extern ulong_t strntoul(const char *, size_t, int);
45extern int strisnum(const char *);
46extern int strisbasenum(const char *);
47extern int strtoi(const char *);
48
49extern char *strdup(const char *);
50extern char *strndup(const char *, size_t);
51extern void strfree(char *);
52
53extern size_t stresc2chr(char *);
54extern char *strchr2esc(const char *, size_t);
55extern char *strchr2adb(const char *, size_t);
56
57extern char *strnchr(const char *, int, size_t);
58
59extern char *strsplit(char *, char);
60extern char *strrsplit(char *, char);
61extern const char *strnpbrk(const char *, const char *, size_t);
62extern char *strabbr(char *, size_t);
63
64extern const char *strbasename(const char *);
65extern char *strdirname(char *);
66
67extern const char *strbadid(const char *);
68extern int strisprint(const char *);
69
70extern char *mdb_inet_ntop(int, const void *, char *, size_t);
71
72#ifdef	__cplusplus
73}
74#endif
75
76#endif	/* _MDB_STRING_H */
77