diff options
Diffstat (limited to 'apps/plugins/pdbox/PDa/src/s_path.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/src/s_path.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/apps/plugins/pdbox/PDa/src/s_path.c b/apps/plugins/pdbox/PDa/src/s_path.c index f40f1f6e49..da4fc94782 100644 --- a/apps/plugins/pdbox/PDa/src/s_path.c +++ b/apps/plugins/pdbox/PDa/src/s_path.c | |||
@@ -14,6 +14,26 @@ | |||
14 | #define DEBUG(x) | 14 | #define DEBUG(x) |
15 | void readsf_banana( void); /* debugging */ | 15 | void readsf_banana( void); /* debugging */ |
16 | 16 | ||
17 | #ifdef ROCKBOX | ||
18 | |||
19 | #include "plugin.h" | ||
20 | #include "pdbox.h" | ||
21 | |||
22 | #include "m_pd.h" | ||
23 | #include "m_imp.h" | ||
24 | #include "s_stuff.h" | ||
25 | |||
26 | #define open rb->open | ||
27 | #define close rb->close | ||
28 | #define strcpy rb->strcpy | ||
29 | #define strcat rb->strcat | ||
30 | #define strlen rb->strlen | ||
31 | #define strcmp rb->strcmp | ||
32 | #define strncpy rb->strncpy | ||
33 | #define strrchr rb->strrchr | ||
34 | #define strncat rb_strncat | ||
35 | |||
36 | #else /* ROCKBOX */ | ||
17 | #include <stdlib.h> | 37 | #include <stdlib.h> |
18 | #ifdef UNIX | 38 | #ifdef UNIX |
19 | #include <unistd.h> | 39 | #include <unistd.h> |
@@ -29,6 +49,7 @@ void readsf_banana( void); /* debugging */ | |||
29 | #include "s_stuff.h" | 49 | #include "s_stuff.h" |
30 | #include <stdio.h> | 50 | #include <stdio.h> |
31 | #include <fcntl.h> | 51 | #include <fcntl.h> |
52 | #endif /* ROCKBOX */ | ||
32 | 53 | ||
33 | static t_namelist *pd_path, *pd_helppath; | 54 | static t_namelist *pd_path, *pd_helppath; |
34 | 55 | ||
@@ -85,6 +106,10 @@ t_namelist *namelist_append(t_namelist *listwas, const char *s) | |||
85 | char temp[MAXPDSTRING]; | 106 | char temp[MAXPDSTRING]; |
86 | t_namelist *nl = listwas, *rtn = listwas; | 107 | t_namelist *nl = listwas, *rtn = listwas; |
87 | 108 | ||
109 | #ifdef ROCKBOX | ||
110 | (void) rtn; | ||
111 | #endif | ||
112 | |||
88 | npos = s; | 113 | npos = s; |
89 | do | 114 | do |
90 | { | 115 | { |
@@ -138,6 +163,10 @@ int open_via_path(const char *dir, const char *name, const char* ext, | |||
138 | int fd = -1; | 163 | int fd = -1; |
139 | char listbuf[MAXPDSTRING]; | 164 | char listbuf[MAXPDSTRING]; |
140 | 165 | ||
166 | #ifdef ROCKBOX | ||
167 | (void) bin; | ||
168 | #endif | ||
169 | |||
141 | if (name[0] == '/' | 170 | if (name[0] == '/' |
142 | #ifdef MSW | 171 | #ifdef MSW |
143 | || (name[1] == ':' && name[2] == '/') | 172 | || (name[1] == ':' && name[2] == '/') |
@@ -191,6 +220,7 @@ int open_via_path(const char *dir, const char *name, const char* ext, | |||
191 | char *slash; | 220 | char *slash; |
192 | if (sys_verbose) post("tried %s and succeeded", dirresult); | 221 | if (sys_verbose) post("tried %s and succeeded", dirresult); |
193 | sys_unbashfilename(dirresult, dirresult); | 222 | sys_unbashfilename(dirresult, dirresult); |
223 | |||
194 | slash = strrchr(dirresult, '/'); | 224 | slash = strrchr(dirresult, '/'); |
195 | if (slash) | 225 | if (slash) |
196 | { | 226 | { |
@@ -199,7 +229,7 @@ int open_via_path(const char *dir, const char *name, const char* ext, | |||
199 | } | 229 | } |
200 | else *nameresult = dirresult; | 230 | else *nameresult = dirresult; |
201 | 231 | ||
202 | return (fd); | 232 | return (fd); |
203 | } | 233 | } |
204 | } | 234 | } |
205 | else | 235 | else |
@@ -245,7 +275,9 @@ static int do_open_via_helppath(const char *realname, t_namelist *listp) | |||
245 | else | 275 | else |
246 | #endif | 276 | #endif |
247 | { | 277 | { |
278 | #ifndef ROCKBOX | ||
248 | char *slash; | 279 | char *slash; |
280 | #endif | ||
249 | if (sys_verbose) post("tried %s and succeeded", dirresult); | 281 | if (sys_verbose) post("tried %s and succeeded", dirresult); |
250 | sys_unbashfilename(dirresult, dirresult); | 282 | sys_unbashfilename(dirresult, dirresult); |
251 | close (fd); | 283 | close (fd); |
@@ -266,8 +298,12 @@ static int do_open_via_helppath(const char *realname, t_namelist *listp) | |||
266 | search attempts. */ | 298 | search attempts. */ |
267 | void open_via_helppath(const char *name, const char *dir) | 299 | void open_via_helppath(const char *name, const char *dir) |
268 | { | 300 | { |
301 | #ifdef ROCKBOX | ||
302 | t_namelist thislist, *listp; | ||
303 | #else /*ROCKBOX */ | ||
269 | t_namelist *nl, thislist, *listp; | 304 | t_namelist *nl, thislist, *listp; |
270 | int fd = -1; | 305 | int fd = -1; |
306 | #endif /* ROCKBOX */ | ||
271 | char dirbuf2[MAXPDSTRING], realname[MAXPDSTRING]; | 307 | char dirbuf2[MAXPDSTRING], realname[MAXPDSTRING]; |
272 | 308 | ||
273 | /* if directory is supplied, put it at head of search list. */ | 309 | /* if directory is supplied, put it at head of search list. */ |
@@ -380,6 +416,10 @@ int sys_rcfile(void) | |||
380 | /* start an audio settings dialog window */ | 416 | /* start an audio settings dialog window */ |
381 | void glob_start_path_dialog(t_pd *dummy, t_floatarg flongform) | 417 | void glob_start_path_dialog(t_pd *dummy, t_floatarg flongform) |
382 | { | 418 | { |
419 | #ifdef ROCKBOX | ||
420 | (void) dummy; | ||
421 | (void) flongform; | ||
422 | #else /* ROCKBOX */ | ||
383 | char buf[MAXPDSTRING]; | 423 | char buf[MAXPDSTRING]; |
384 | int i; | 424 | int i; |
385 | t_namelist *nl; | 425 | t_namelist *nl; |
@@ -391,12 +431,19 @@ void glob_start_path_dialog(t_pd *dummy, t_floatarg flongform) | |||
391 | 431 | ||
392 | sprintf(buf, "pdtk_path_dialog %%s\n"); | 432 | sprintf(buf, "pdtk_path_dialog %%s\n"); |
393 | gfxstub_new(&glob_pdobject, glob_start_path_dialog, buf); | 433 | gfxstub_new(&glob_pdobject, glob_start_path_dialog, buf); |
434 | #endif /* ROCKBOX */ | ||
394 | } | 435 | } |
395 | 436 | ||
396 | /* new values from dialog window */ | 437 | /* new values from dialog window */ |
397 | void glob_path_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) | 438 | void glob_path_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) |
398 | { | 439 | { |
399 | int i; | 440 | int i; |
441 | |||
442 | #ifdef ROCKBOX | ||
443 | (void) dummy; | ||
444 | (void) s; | ||
445 | #endif /* ROCKBOX */ | ||
446 | |||
400 | namelist_free(pd_path); | 447 | namelist_free(pd_path); |
401 | pd_path = 0; | 448 | pd_path = 0; |
402 | for (i = 0; i < argc; i++) | 449 | for (i = 0; i < argc; i++) |