]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/doscmd/cwd.h
This commit was generated by cvs2svn to compensate for changes in r76238,
[FreeBSD/FreeBSD.git] / usr.bin / doscmd / cwd.h
1 /*
2  * Copyright (c) 1992, 1993, 1996
3  *      Berkeley Software Design, Inc.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
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
16  *      Design, Inc.
17  *
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
28  * SUCH DAMAGE.
29  *
30  *      BSDI cwd.h,v 2.2 1996/04/08 19:32:26 bostic Exp
31  *
32  * $FreeBSD$
33  */
34
35 static inline u_char *
36 ustrcpy(u_char *s1, u_char *s2)
37 {
38     return((u_char *)strcpy((char *)s1, (char *)s2));
39 }
40
41 static inline u_char *
42 ustrcat(u_char *s1, u_char *s2)
43 {
44     return((u_char *)strcat((char *)s1, (char *)s2));
45 }
46
47 static inline u_char *
48 ustrncpy(u_char *s1, u_char *s2, unsigned n)
49 {
50     return((u_char *)strncpy((char *)s1, (char *)s2, n));
51 }
52
53 static inline int
54 ustrcmp(u_char *s1, u_char *s2)
55 {
56     return(strcmp((char *)s1, (char *)s2));
57 }
58
59 static inline int
60 ustrncmp(u_char *s1, u_char *s2, unsigned n)
61 {
62     return(strncmp((char *)s1, (char *)s2, n));
63 }
64
65 static inline int
66 ustrlen(u_char *s)
67 {
68     return(strlen((char *)s));
69 }
70
71 static inline u_char *
72 ustrrchr(u_char *s, u_char c)
73 {
74     return((u_char *)strrchr((char *)s, c));
75 }
76
77 static inline u_char *
78 ustrdup(u_char *s)
79 {
80     return((u_char *)strdup((char *)s));
81 }
82
83 static inline int
84 ustat(u_char *s, struct stat *sb)
85 {
86     return(stat((char *)s, sb));
87 }
88
89 static inline int
90 uaccess(u_char *s, int mode)
91 {
92     return(access((char *)s, mode));
93 }
94
95 extern void   init_path(int drive, u_char *base, u_char *where);
96 extern void   dos_makereadonly(int drive);
97 extern int    dos_readonly(int drive);
98 extern u_char *dos_getcwd(int drive);
99 extern u_char *dos_getpath(int drive);
100 extern int    dos_makepath(u_char *where, u_char *newpath);
101 extern int    dos_setcwd(u_char *where);
102 extern int    dos_to_real_path(u_char *dospath, u_char *realpath, int *);
103 extern void   real_to_dos(u_char *real, u_char *dos);
104 extern void   dos_to_real(u_char *dos, u_char *real);
105 extern u_char **get_entries(u_char *path);
106 extern int    get_space(int drive, fsstat_t *fs);
107 extern int    find_first(u_char *path, int attr,
108                          dosdir_t *dir, find_block_t *dta);
109 extern int    find_next(dosdir_t *dir, find_block_t *dta);