unix.c
author Ryan C. Gordon <icculus@icculus.org>
Sat, 07 Jul 2001 03:52:43 +0000
changeset 15 418eacc97ac8
parent 11 677e01f5109e
permissions -rw-r--r--
Tons of updates. Mostly implemented. Mostly compiling.
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
15
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    17
const char *__PHYSFS_platformDirSeparator = "/";
4
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
15
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    30
char *__PHYSFS_platformGetUserName(void)
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    31
{
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    32
} /* __PHYSFS_platformGetUserName */
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    33
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    34
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    35
char *__PHYSFS_platformGetUserDir(void)
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    36
{
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    37
} /* __PHYSFS_platformGetUserDir */
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    38
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    39
4
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
int __PHYSFS_platformGetThreadID(void)
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
{
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    42
    return((int) pthread_self());
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
} /* __PHYSFS_platformGetThreadID */
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
10
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    45
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    46
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
    47
{
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    48
    return(strcasecmp(str1, str2));
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    49
} /* __PHYSFS_platformStricmp */
45bd486c0224 Added stricmp stuff and included physfs_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents: 4
diff changeset
    50
11
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
int __PHYSFS_platformIsSymlink(const char *fname)
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_platformIsSymlink */
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
15
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    57
int __PHYSFS_platformIsDirectory(const char *fname)
11
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    58
{
15
418eacc97ac8 Tons of updates. Mostly implemented. Mostly compiling.
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
    59
} /* __PHYSFS_platformIsDirectory */
11
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    60
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 10
diff changeset
    61
4
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    62
/* end of unix.c ... */
b8107374195a Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    63