1
#ifndef __FILENAME_SCAPER__
2
#define __FILENAME_SCAPER__
5
* @file filename_scape.h
6
* @author Adenilson Cavalcanti <savagobr@yahoo.com>
7
* @date Tue Oct 21 15:31:10 2008
9
* @brief An auxiliary module to scape invalid characters from filename.
11
* This code is free software; you can redistribute it and/or
12
* modify it under the terms of the GNU Lesser General Public
13
* License as published by the Free Software Foundation; either
14
* version 2.1 of the License, or (at your option) any later version.
16
* This library is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
* Lesser General Public License for more details.
21
* You should have received a copy of the GNU Lesser General Public
22
* License along with this library; if not, write to the Free Software
23
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
static const char reserved_chars[] = { '/', '!', '?', ':', '*', '\\', '>', '<', '@' };
28
static const int reserved_count = 9;
29
static const char scaper = '_';
31
static void filename_scape_characters(char *input)
37
for (i = 0; i < reserved_count; ++i)
38
if (*input == reserved_chars[i]) {