1 /*
2   dirwalk.h
3 
4   Copyright (c) 2009
5   http://www.tuxpaint.org/
6 
7   This program is free software; you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation; either version 2 of the License, or
10   (at your option) any later version.
11 
12   This program is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   GNU General Public License for more details.
16 
17   You should have received a copy of the GNU General Public License
18   along with this program; if not, write to the Free Software
19   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20   (See COPYING.txt)
21 
22   $Id$
23 */
24 
25 #ifndef DIRWALK_H
26 #define DIRWALK_H
27 
28 #include "SDL.h"
29 
30 #include "compiler.h"
31 
32 /////////////////////////////// directory tree walking /////////////////////
33 
34 #define TP_FTW_UNKNOWN 1
35 #define TP_FTW_DIRECTORY 2
36 #define TP_FTW_NORMAL 0
37 
38 #define TP_FTW_PATHSIZE 400
39 
40 typedef struct tp_ftw_str
41 {
42   char *str;
43   unsigned char len;
44 //  unsigned char is_rsrc;
45 } tp_ftw_str;
46 
47 
48 void loadfont_callback(SDL_Surface * screen, const char *restrict const dir,
49                        unsigned dirlen, tp_ftw_str * files, unsigned i, const char *restrict const locale);
50 int compare_ftw_str(const void *v1, const void *v2);
51 void tp_ftw(SDL_Surface * screen, char *restrict const dir, unsigned dirlen,
52             int rsrc, void (*fn) (SDL_Surface * screen,
53                                   const char *restrict const dir,
54                                   unsigned dirlen, tp_ftw_str * files,
55                                   unsigned count, const char *restrict const locale),
56             const char *restrict const locale);
57 
58 #endif
59