#include <stdio.h>
#include <stdlib.h>
static spBool printDir(
char *dirname)
{
DIR *dirp;
struct dirent *direntp;
fprintf(stderr, "Can't open directory: %s\n", dirname);
}
printf("reading directory: %s\n", dirname);
while ((direntp =
spReadDir(dirp)) != NULL) {
printf("%s\n", direntp->d_name);
}
}
int spMain(int argc, char *argv[])
{
#if defined(MACOS9)
static char dirname[] = ":";
#else
static char dirname[] = ".";
#endif
char *name;
printDir(dirname);
printf("home directory: %s\n", name);
printDir(name);
}
printf("current directory: %s\n", name);
}
printf("temporary directory: %s\n", name);
}
printf("~/hoge --> %s\n", name);
}
printf("~ftp/hoge --> %s\n", name);
}
{
const char *name2;
#if 0
printf("application directory (before set application ID): %s (version depend: %d)\n",
name2, version_depend);
#endif
#if 1
#elif 0
#endif
if (1) {
printf("create application directory: %s (id depend: %d, version depend: %d)\n",
name2, id_depend, version_depend);
}
printf("application directory: %s (version depend: %d)\n", name2, version_depend);
printf("application directory: %s (version depend: %d)\n", name2, version_depend);
}
printf("application temp directory: %s\n", name2);
printf("document directory: %s\n", name);
}
printf("picture directory: %s\n", name);
}
printf("sound directory: %s\n", name);
}
printf("music directory: %s\n", name);
printDir(name);
}
printf("movie directory: %s\n", name);
}
printf("archive directory: %s\n", name);
}
printf("spExecBrowser for '../README.txt': status = %d\n",
printf("spExecBrowser for 'http://www.google.com/intl/en/about/index.html': status = %d\n",
}
return 0;
}
char * xspGetTempDir(void)
const char * spCreateApplicationDir(spBool *id_depend, spBool *version_depend)
void spSetDebugLevel(int level)
const char * spGetApplicationTempDir(void)
spBool spSetApplicationId(const char *id)
char * xspGetCurrentDir(void)
long spGetProcessId(void)
spBool spExecBrowser(const char *base_url, const char *sub_url, spBool local_path)
const char * spGetApplicationDir(spBool *version_depend)
char * xspGetDocumentDir(spFileKind file_kind)
char * xspGetHomeDir(void)
char * xspGetExactName(const char *name)
@ SP_FILE_KIND_MOVIE
Definition spBase.h:33
@ SP_FILE_KIND_SOUND
Definition spBase.h:32
@ SP_FILE_KIND_DOCUMENT
Definition spBase.h:25
@ SP_FILE_KIND_PICTURE
Definition spBase.h:29
@ SP_FILE_KIND_MUSIC
Definition spBase.h:31
@ SP_FILE_KIND_ARCHIVE
Definition spBase.h:36
int spBool
Definition spDefs.h:248
#define SP_TRUE
Definition spDefs.h:250
#define SP_FALSE
Definition spDefs.h:251
DIR * spOpenDir(const char *path)
struct dirent * spReadDir(DIR *dirp)
int spCloseDir(DIR *dirp)
#define xspFree(p)
Definition spMemory.h:82