summaryrefslogtreecommitdiff
path: root/gallery-utils.h
blob: 1547c90e09ebd1d929a9ab0f28ba4a3865d27b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*   Cataract - Static web photo gallery generator
 *   Copyright (C) 2008 Tomas Bzatek <tbzatek@users.sourceforge.net>
 *   
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation; either version 2
 *   of the License, or any later version.
 *   
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *   
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
#include <glib.h>

#define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '~')
#define IS_EQUAL_SIGN(ch) ((ch) == '=')


/*
 *   str_replace: replace substring 'search' with a 'replace' string
 *                - only one occurence of the string is replaced
 * 				  - reallocates the original string  
 */ 
void str_replace (char **dst, const char *search, const char *replace);

/*
 *   copy_file: copy file from src to dst  
 */ 
gboolean copy_file (const char *src, const char *dst);

/*
 *   make_string: make string of 'substr' substrings   
 *                - returns newly allocated string    
 */ 
char *make_string (const char* substr, const int count);