FireBirdLib - Topfield TMS PVR TAP Programming Library
ReplaceInvalidFileNameChars.c
Go to the documentation of this file.
1
#include <string.h>
2
#include "
FBLib_string.h
"
3
4
void
ReplaceInvalidFileNameChars
(
char
*strName)
5
{
6
TRACEENTER
();
7
8
unsigned
char
*s, *d;
9
10
s =
SkipCharTableBytes
(strName);
11
d = s;
12
13
while
(*s)
14
{
15
if
(
isLegalChar
(s,
InvalidFileNameChars
))
16
{
17
*d = *s;
18
}
19
else
20
{
21
switch
(*s)
22
{
23
// These characters are not allowed in Windows.
24
case
'*'
: *d =
'x'
;
break
;
25
case
'"'
: *d =
'\''
;
break
;
26
27
default
:
28
*d =
'-'
;
29
break
;
30
}
31
}
32
d++;
33
s++;
34
}
35
*d =
'\0'
;
36
37
TRACEEXIT
();
38
}
FBLib_string.h
isLegalChar
bool isLegalChar(const byte *, eRemoveChars)
Definition:
isLegalChar.c:3
ReplaceInvalidFileNameChars
void ReplaceInvalidFileNameChars(char *strName)
Definition:
ReplaceInvalidFileNameChars.c:4
InvalidFileNameChars
@ InvalidFileNameChars
Definition:
libFireBird.h:2506
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
SkipCharTableBytes
byte * SkipCharTableBytes(const byte *p)
Definition:
SkipCharTableBytes.c:3
string
ReplaceInvalidFileNameChars.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3