2 * Copyright (c) 1992, 1993, 1996
3 * Berkeley Software Design, Inc. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by Berkeley Software
18 * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * BSDI cwd.h,v 2.2 1996/04/08 19:32:26 bostic Exp
32 * $FreeBSD: src/usr.bin/doscmd/cwd.h,v 1.2.2.2 2002/04/25 11:04:50 tg Exp $
35 static inline u_char *
36 ustrcpy(u_char *s1, u_char *s2)
38 return((u_char *)strcpy((char *)s1, (char *)s2));
41 static inline u_char *
42 ustrcat(u_char *s1, u_char *s2)
44 return((u_char *)strcat((char *)s1, (char *)s2));
47 static inline u_char *
48 ustrncat(u_char *s1, const u_char *s2, size_t n)
50 return((u_char *)strncat((char *)s1, (const char *)s2, n));
53 static inline u_char *
54 ustrncpy(u_char *s1, u_char *s2, size_t n)
56 return((u_char *)strncpy((char *)s1, (char *)s2, n));
60 ustrcmp(u_char *s1, u_char *s2)
62 return(strcmp((char *)s1, (char *)s2));
66 ustrncmp(const u_char *s1, const u_char *s2, size_t n)
68 return(strncmp((const char *)s1, (const char *)s2, n));
72 ustrlen(const u_char *s)
74 return(strlen((const char *)s));
77 static inline u_char *
78 ustrrchr(u_char *s, u_char c)
80 return((u_char *)strrchr((char *)s, c));
83 static inline u_char *
84 ustrdup(const u_char *s)
86 return((u_char *)strdup((const char *)s));
90 ustat(u_char *s, struct stat *sb)
92 return(stat((char *)s, sb));
96 uaccess(u_char *s, int mode)
98 return(access((char *)s, mode));
101 extern void init_path(int, const u_char *, const u_char *);
102 extern void dos_makereadonly(int);
103 extern int dos_readonly(int);
104 extern u_char *dos_getcwd(int);
105 extern u_char *dos_getpath(int);
106 extern int dos_makepath(u_char *, u_char *);
107 extern int dos_match(u_char *, u_char *);
108 extern int dos_setcwd(u_char *);
109 extern int dos_to_real_path(u_char *, u_char *, int *);
110 extern void real_to_dos(u_char *, u_char *);
111 extern void dos_to_real(u_char *, u_char *);
112 extern u_char **get_entries(u_char *);
113 extern int get_space(int, fsstat_t *);
114 extern int find_first(u_char *, int, dosdir_t *, find_block_t *);
115 extern int find_next(dosdir_t *, find_block_t *);