unix.c
author Ryan C. Gordon <icculus@icculus.org>
Fri, 06 Jul 2001 21:29:37 +0000
changeset 12 a4041c91d715
parent 11 677e01f5109e
child 15 418eacc97ac8
permissions -rw-r--r--
Redesign of enumerateFiles code. More efficient and clean, less memory hungry. Some tiny snafus, though, for future maintanence (*shrug*).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
/*
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
 * Unix support routines for PhysicsFS.
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
 *
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
 * Please see the file LICENSE in the source's root directory.
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
 *
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
 *  This file written by Ryan C. Gordon.
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
 */
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
#include <stdio.h>
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
#include <stdlib.h>
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
#include <pthread.h>
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
10
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    13
#define __PHYSICSFS_INTERNAL__
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    14
#include "physfs_internal.h"
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    15
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    16
4
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
const char *__PHYSFS_PlatformDirSeparator = "/";
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
char **__PHYSFS_platformDetectAvailableCDs(void)
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
{
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
} /* __PHYSFS_detectAvailableCDs */
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
char *__PHYSFS_platformCalcBaseDir(char *argv0)
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
{
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
    return(NULL);
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
} /* __PHYSFS_platformCalcBaseDir */
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
int __PHYSFS_platformGetThreadID(void)
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
{
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
    return((int) pthread_self());
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
} /* __PHYSFS_platformGetThreadID */
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
10
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    35
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    36
int __PHYSFS_platformStricmp(const char *str1, const char *str2)
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    37
{
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    38
    return(strcasecmp(str1, str2));
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    39
} /* __PHYSFS_platformStricmp */
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    40
11
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    41
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    42
int __PHYSFS_platformIsSymlink(const char *fname)
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    43
{
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    44
} /* __PHYSFS_platformIsSymlink */
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    45
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    46
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    47
char *__PHYSFS_platformGetUserName(void)
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    48
{
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    49
} /* __PHYSFS_platformGetUserName */
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    50
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    51
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    52
char *__PHYSFS_platformGetUserDir(void);
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    53
{
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    54
} /* __PHYSFS_platformGetUserDir */
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    55
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    56
4
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    57
/* end of unix.c ... */
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    58