xstrings.h revision 5104ee6e
15104ee6eSmrg/* $XTermId: xstrings.h,v 1.31 2024/12/01 20:27:00 tom Exp $ */
2d522f475Smrg
30bd37d32Smrg/*
45104ee6eSmrg * Copyright 2000-2016,2024 by Thomas E. Dickey
50bd37d32Smrg *
60bd37d32Smrg *                         All Rights Reserved
70bd37d32Smrg *
80bd37d32Smrg * Permission is hereby granted, free of charge, to any person obtaining a
90bd37d32Smrg * copy of this software and associated documentation files (the
100bd37d32Smrg * "Software"), to deal in the Software without restriction, including
110bd37d32Smrg * without limitation the rights to use, copy, modify, merge, publish,
120bd37d32Smrg * distribute, sublicense, and/or sell copies of the Software, and to
130bd37d32Smrg * permit persons to whom the Software is furnished to do so, subject to
140bd37d32Smrg * the following conditions:
150bd37d32Smrg *
160bd37d32Smrg * The above copyright notice and this permission notice shall be included
170bd37d32Smrg * in all copies or substantial portions of the Software.
180bd37d32Smrg *
190bd37d32Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
200bd37d32Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
210bd37d32Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
220bd37d32Smrg * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
230bd37d32Smrg * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
240bd37d32Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
250bd37d32Smrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
260bd37d32Smrg *
270bd37d32Smrg * Except as contained in this notice, the name(s) of the above copyright
280bd37d32Smrg * holders shall not be used in advertising or otherwise to promote the
290bd37d32Smrg * sale, use or other dealings in this Software without prior written
300bd37d32Smrg * authorization.
310bd37d32Smrg */
32d522f475Smrg
33d522f475Smrg#ifndef included_xstrings_h
34d522f475Smrg#define included_xstrings_h 1
350bd37d32Smrg/* *INDENT-OFF* */
36d522f475Smrg
3720d2c4d2Smrg#include <X11/Intrinsic.h>
380bd37d32Smrg#include <pwd.h>
3920d2c4d2Smrg
405104ee6eSmrg#define OkPasswd(p) ((p)->pw_name != NULL && (p)->pw_name[0] != 0)
410bd37d32Smrg
420bd37d32Smrgextern Boolean x_getpwnam(const char * /* name */, struct passwd * /* result */);
430bd37d32Smrgextern Boolean x_getpwuid(uid_t /* uid */, struct passwd * /* result */);
4420d2c4d2Smrgextern String x_nonempty(String /* s */);
4520d2c4d2Smrgextern String x_skip_blanks(String /* s */);
4620d2c4d2Smrgextern String x_skip_nonblanks(String /* s */);
470bd37d32Smrgextern char **x_splitargs(const char * /* command */);
48d522f475Smrgextern char *x_basename(char * /* name */);
4920d2c4d2Smrgextern char *x_decode_hex(const char * /* source */, const char ** /* next */);
5020d2c4d2Smrgextern char *x_encode_hex(const char * /* source */);
51d522f475Smrgextern char *x_getenv(const char * /* name */);
520bd37d32Smrgextern char *x_getlogin(uid_t /* uid */, struct passwd * /* in_out */);
53d522f475Smrgextern char *x_strdup(const char * /* s */);
5420d2c4d2Smrgextern char *x_strindex(char * /* s1 */, const char * /* s2 */);
5520d2c4d2Smrgextern char *x_strtrim(const char * /* s */);
562e4f8982Smrgextern char *x_strrtrim(const char * /* s */);
572eaa94a1Schristosextern char x_toupper(int /* ch */);
5820d2c4d2Smrgextern int x_hex2int(int /* ch */);
59d522f475Smrgextern int x_strcasecmp(const char * /* s1 */, const char * /* s2 */);
60d522f475Smrgextern int x_strncasecmp(const char * /* s1 */, const char * /* s2 */, unsigned  /* n */);
61913cc679Smrgextern int x_wildstrcmp(const char * /* pattern */, const char * /* actual */);
620bd37d32Smrgextern unsigned x_countargv(char ** /* argv */);
630bd37d32Smrgextern void x_appendargv(char ** /* target */, char ** /* source */);
640bd37d32Smrgextern void x_freeargs(char ** /* argv */);
650bd37d32Smrg
660bd37d32Smrg/* *INDENT-ON* */
67d522f475Smrg
68d522f475Smrg#endif /* included_xstrings_h */
69