ReactOS
0.4.16-dev-732-g2d1144a
makepath.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS CRT library
3
* LICENSE: See COPYING in the top level directory
4
* FILE: lib/sdk/crt/stdlib/makepath.c
5
* PURPOSE: Creates a path
6
* PROGRAMMERS: Wine team
7
* Copyright 1996,1998 Marcus Meissner
8
* Copyright 1996 Jukka Iivonen
9
* Copyright 1997,2000 Uwe Bonnes
10
* Copyright 2000 Jon Griffiths
11
*
12
*/
13
14
#include <precomp.h>
15
#include <stdlib.h>
16
#include <string.h>
17
18
/*
19
* @implemented
20
*/
21
void
_makepath
(
char
*
path
,
const
char
*
drive
,
const
char
*
dir
,
const
char
* fname,
const
char
*
ext
)
22
{
23
char
*
p
=
path
;
24
25
if
( !
path
)
26
return
;
27
28
if
(
drive
&&
drive
[0])
29
{
30
*
p
++ =
drive
[0];
31
*
p
++ =
':'
;
32
}
33
if
(
dir
&&
dir
[0])
34
{
35
size_t
len
=
strlen
(
dir
);
36
memmove
(
p
,
dir
,
len
);
37
p
+=
len
;
38
if
(
p
[-1] !=
'/'
&&
p
[-1] !=
'\\'
)
39
*
p
++ =
'\\'
;
40
}
41
if
(fname && fname[0])
42
{
43
size_t
len
=
strlen
(fname);
44
memmove
(
p
, fname,
len
);
45
p
+=
len
;
46
}
47
if
(
ext
&&
ext
[0])
48
{
49
if
(
ext
[0] !=
'.'
)
50
*
p
++ =
'.'
;
51
strcpy
(
p
,
ext
);
52
}
53
else
54
*
p
=
'\0'
;
55
}
strlen
ACPI_SIZE strlen(const char *String)
Definition:
utclib.c:269
dir
unsigned int dir
Definition:
maze.c:112
ext
static const WCHAR *const ext[]
Definition:
module.c:53
p
GLfloat GLfloat p
Definition:
glext.h:8902
len
GLenum GLsizei len
Definition:
glext.h:6722
_makepath
_makepath
Definition:
stdlib.h:1096
memmove
#define memmove(s1, s2, n)
Definition:
mkisofs.h:881
strcpy
strcpy
Definition:
string.h:131
drive
Definition:
filesystem.c:103
path
Definition:
wbemprox_private.h:188
sdk
lib
crt
stdlib
makepath.c
Generated on Sat Feb 8 2025 06:14:00 for ReactOS by
1.9.6