1replace_extension(3)            Allegro manual            replace_extension(3)
2
3
4

NAME

6       replace_extension  -  Replaces  filename+extension with a new extension
7       tail. Allegro game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       char *replace_extension(char *dest, const char  *filename,  const  char
14       *ext, int size);
15

DESCRIPTION

17       Replaces  the  specified  filename+extension with a new extension tail,
18       storing at most `size' bytes into the `dest' buffer.  If  the  filename
19       doesn't have any extension at all, `ext' will be appended to it, adding
20       a dot character if needed. You can use the same buffer  both  as  input
21       and  output  because  Allegro  internally  works on a copy of the input
22       before touching `dest'. Example:
23
24          replace_extension(buf, "C:\\game\\prog.exe",
25                            "dat", sizeof(buf));
26

RETURN VALUE

28       Returns a copy of the `dest' parameter.
29
30

SEE ALSO

32       get_extension(3), replace_filename(3)
33
34
35
36Allegro                          version 4.2.2            replace_extension(3)
Impressum