[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-cvs] CVS: paragui/src/physfs/platform beos.cpp,1.1.2.4,1.1.2.5
From: |
Alexander Pipelka <address@hidden> |
Subject: |
[paragui-cvs] CVS: paragui/src/physfs/platform beos.cpp,1.1.2.4,1.1.2.5 macclassic.c,1.1.2.4,1.1.2.5 posix.c,1.1.2.3,1.1.2.4 unix.c,1.1.1.1.6.5,1.1.1.1.6.6 win32.c,1.1.1.1.6.12,1.1.1.1.6.13 |
Date: |
Thu, 25 Jul 2002 03:27:40 -0400 |
Update of /cvsroot/paragui/paragui/src/physfs/platform
In directory subversions:/tmp/cvs-serv13618/src/physfs/platform
Modified Files:
Tag: devel-1-0
beos.cpp macclassic.c posix.c unix.c win32.c
Log Message:
updated PhysicsFS
Index: beos.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/platform/beos.cpp,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** beos.cpp 11 Jul 2002 08:59:29 -0000 1.1.2.4
--- beos.cpp 25 Jul 2002 07:27:38 -0000 1.1.2.5
***************
*** 229,233 ****
BPath normalized(str, leaf, true); /* force normalization of path. */
const char *resolved_path = normalized.Path();
! BAIL_IF_MACRO(resolved_path == NULL, ERR_FILE_NOT_FOUND, NULL);
char *retval = (char *) malloc(strlen(resolved_path) + 1);
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
--- 229,233 ----
BPath normalized(str, leaf, true); /* force normalization of path. */
const char *resolved_path = normalized.Path();
! BAIL_IF_MACRO(resolved_path == NULL, ERR_NO_SUCH_FILE, NULL);
char *retval = (char *) malloc(strlen(resolved_path) + 1);
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
Index: macclassic.c
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/platform/macclassic.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** macclassic.c 15 Jul 2002 08:15:37 -0000 1.1.2.4
--- macclassic.c 25 Jul 2002 07:27:38 -0000 1.1.2.5
***************
*** 304,310 ****
strcpy(path, fname);
ptr = strchr(path, ':');
! BAIL_IF_MACRO(!ptr, ERR_FILE_NOT_FOUND, err); /* just in case */
ptr = strchr(ptr + 1, ':');
! BAIL_IF_MACRO(!ptr, ERR_FILE_NOT_FOUND, err); /* just in case */
*ptr = '\0';
err = fnameToFSSpecNoAlias(path, spec); /* get first dir. */
--- 304,310 ----
strcpy(path, fname);
ptr = strchr(path, ':');
! BAIL_IF_MACRO(!ptr, ERR_NO_SUCH_FILE, err); /* just in case */
ptr = strchr(ptr + 1, ':');
! BAIL_IF_MACRO(!ptr, ERR_NO_SUCH_FILE, err); /* just in case */
*ptr = '\0';
err = fnameToFSSpecNoAlias(path, spec); /* get first dir. */
***************
*** 459,465 ****
int omitSymLinks)
{
! LinkedStringList *retval = NULL;
! LinkedStringList *l = NULL;
! LinkedStringList *prev = NULL;
UInt16 i;
UInt16 max;
--- 459,463 ----
int omitSymLinks)
{
! LinkedStringList *ret = NULL, *p = NULL;
UInt16 i;
UInt16 max;
***************
*** 510,538 ****
/* still here? Add it to the list. */
!
! l = (LinkedStringList *) malloc(sizeof (LinkedStringList));
! if (l == NULL)
! break;
!
! l->str = (char *) malloc(str255[0] + 1);
! if (l->str == NULL)
! {
! free(l);
! break;
! } /* if */
!
! memcpy(l->str, &str255[1], str255[0]);
! l->str[str255[0]] = '\0';
!
! if (retval == NULL)
! retval = l;
! else
! prev->next = l;
!
! prev = l;
! l->next = NULL;
} /* for */
! return(retval);
} /* __PHYSFS_platformEnumerateFiles */
--- 508,515 ----
/* still here? Add it to the list. */
! ret = __PHYSFS_addToLinkedStringList(ret, &p, &str255[1], str255[0]);
} /* for */
! return(ret);
} /* __PHYSFS_platformEnumerateFiles */
***************
*** 589,593 ****
if (err == fnfErr)
{
! BAIL_IF_MACRO(!createIfMissing, ERR_FILE_NOT_FOUND, NULL);
err = HCreate(spec.vRefNum, spec.parID, spec.name,
procInfo.processSignature, 'BINA');
--- 566,570 ----
if (err == fnfErr)
{
! BAIL_IF_MACRO(!createIfMissing, ERR_NO_SUCH_FILE, NULL);
err = HCreate(spec.vRefNum, spec.parID, spec.name,
procInfo.processSignature, 'BINA');
Index: posix.c
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/platform/posix.c,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** posix.c 1 Jul 2002 17:15:22 -0000 1.1.2.3
--- posix.c 25 Jul 2002 07:27:38 -0000 1.1.2.4
***************
*** 219,225 ****
int omitSymLinks)
{
! LinkedStringList *retval = NULL;
! LinkedStringList *l = NULL;
! LinkedStringList *prev = NULL;
DIR *dir;
struct dirent *ent;
--- 219,223 ----
int omitSymLinks)
{
! LinkedStringList *retval = NULL, *p = NULL;
DIR *dir;
struct dirent *ent;
***************
*** 251,260 ****
} /* if */
! while (1)
{
- ent = readdir(dir);
- if (ent == NULL) /* we're done. */
- break;
-
if (strcmp(ent->d_name, ".") == 0)
continue;
--- 249,254 ----
} /* if */
! while ((ent = readdir(dir)) != NULL)
{
if (strcmp(ent->d_name, ".") == 0)
continue;
***************
*** 281,304 ****
} /* if */
! l = (LinkedStringList *) malloc(sizeof (LinkedStringList));
! if (l == NULL)
! break;
!
! l->str = (char *) malloc(strlen(ent->d_name) + 1);
! if (l->str == NULL)
! {
! free(l);
! break;
! } /* if */
!
! strcpy(l->str, ent->d_name);
!
! if (retval == NULL)
! retval = l;
! else
! prev->next = l;
!
! prev = l;
! l->next = NULL;
} /* while */
--- 275,279 ----
} /* if */
! retval = __PHYSFS_addToLinkedStringList(retval, &p, ent->d_name, -1);
} /* while */
Index: unix.c
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/platform/unix.c,v
retrieving revision 1.1.1.1.6.5
retrieving revision 1.1.1.1.6.6
diff -C2 -r1.1.1.1.6.5 -r1.1.1.1.6.6
*** unix.c 18 Jul 2002 07:24:14 -0000 1.1.1.1.6.5
--- unix.c 25 Jul 2002 07:27:38 -0000 1.1.1.1.6.6
***************
*** 14,29 ****
#if ((!defined __BEOS__) && (!defined WIN32))
- #ifdef __FreeBSD__
- # if (!defined __BSD__)
- # define __BSD__
- # endif
- #endif
-
- #if ((defined __APPLE__) && (defined __MACH__))
- # if (!defined __BSD__)
- # define __BSD__
- # endif
- #endif
-
#include <stdio.h>
#include <stdlib.h>
--- 14,17 ----
***************
*** 39,51 ****
#include <time.h>
#include <errno.h>
! #if (defined __BSD__)
! #include <sys/ucred.h>
! #else
! #include <mntent.h>
#endif
! #include <sys/mount.h>
!
#define __PHYSICSFS_INTERNAL__
--- 27,42 ----
#include <time.h>
#include <errno.h>
+ #include <sys/mount.h>
! #ifdef PHYSFS_HAVE_SYS_UCRED_H
! # ifdef PHYSFS_HAVE_MNTENT_H
! # undef PHYSFS_HAVE_MNTENT_H /* don't do both... */
! # endif
! # include <sys/ucred.h>
#endif
! #ifdef PHYSFS_HAVE_MNTENT_H
! #include <mntent.h>
! #endif
#define __PHYSICSFS_INTERNAL__
***************
*** 68,73 ****
! #if (defined __BSD__)
char **__PHYSFS_platformDetectAvailableCDs(void)
--- 59,77 ----
+ #ifdef PHYSFS_NO_CDROM_SUPPORT
! /* Stub version for platforms without CD-ROM support. */
! char **__PHYSFS_platformDetectAvailableCDs(void)
! {
! char **retval = (char **) malloc(sizeof (char *));
! BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
! *retval = NULL;
! return(retval);
! } /* __PHYSFS_platformDetectAvailableCDs */
!
! #else
!
!
! #ifdef PHYSFS_HAVE_SYS_UCRED_H
char **__PHYSFS_platformDetectAvailableCDs(void)
***************
*** 75,92 ****
char **retval = (char **) malloc(sizeof (char *));
int cd_count = 1; /* We count the NULL entry. */
! struct statfs* mntbufp = NULL;
int mounts;
! int ii;
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
! mounts = getmntinfo( &mntbufp, MNT_WAIT );
! for ( ii=0; ii < mounts; ++ii ) {
int add_it = 0;
! if ( strcmp( mntbufp[ii].f_fstypename, "iso9660") == 0 )
add_it = 1;
! else if ( strcmp( mntbufp[ii].f_fstypename, "cd9660") == 0 )
add_it = 1;
--- 79,97 ----
char **retval = (char **) malloc(sizeof (char *));
int cd_count = 1; /* We count the NULL entry. */
! struct statfs *mntbufp = NULL;
int mounts;
! int i;
BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
! mounts = getmntinfo(&mntbufp, MNT_WAIT);
! for (i = 0; i < mounts; i++)
! {
int add_it = 0;
! if (strcmp(mntbufp[i].f_fstypename, "iso9660") == 0)
add_it = 1;
! else if (strcmp( mntbufp[i].f_fstypename, "cd9660") == 0)
add_it = 1;
***************
*** 100,112 ****
retval = tmp;
retval[cd_count - 1] = (char *)
! malloc(strlen(mntbufp[ii].f_mntonname) + 1);
if (retval[cd_count - 1])
{
! strcpy(retval[cd_count - 1], mntbufp[ii].f_mntonname);
cd_count++;
} /* if */
} /* if */
} /* if */
! }
retval[cd_count - 1] = NULL;
--- 105,117 ----
retval = tmp;
retval[cd_count - 1] = (char *)
! malloc(strlen(mntbufp[i].f_mntonname) + 1);
if (retval[cd_count - 1])
{
! strcpy(retval[cd_count - 1], mntbufp[i].f_mntonname);
cd_count++;
} /* if */
} /* if */
} /* if */
! } /* for */
retval[cd_count - 1] = NULL;
***************
*** 114,120 ****
} /* __PHYSFS_platformDetectAvailableCDs */
- #else /* non-Darwin implementation... */
char **__PHYSFS_platformDetectAvailableCDs(void)
--- 119,126 ----
} /* __PHYSFS_platformDetectAvailableCDs */
+ #endif
+ #ifdef PHYSFS_HAVE_MNTENT_H
char **__PHYSFS_platformDetectAvailableCDs(void)
***************
*** 163,166 ****
--- 169,174 ----
#endif
+ #endif /* !PHYSFS_NO_CDROM_SUPPORT */
+
/* this is in posix.c ... */
***************
*** 251,255 ****
PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
{
! return((PHYSFS_uint64) ((PHYSFS_uint32) pthread_self()));
} /* __PHYSFS_platformGetThreadID */
--- 259,263 ----
PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
{
! return((PHYSFS_uint64) pthread_self());
} /* __PHYSFS_platformGetThreadID */
Index: win32.c
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/platform/win32.c,v
retrieving revision 1.1.1.1.6.12
retrieving revision 1.1.1.1.6.13
diff -C2 -r1.1.1.1.6.12 -r1.1.1.1.6.13
*** win32.c 15 Jul 2002 08:15:37 -0000 1.1.1.1.6.12
--- win32.c 25 Jul 2002 07:27:38 -0000 1.1.1.1.6.13
***************
*** 425,431 ****
int omitSymLinks)
{
! LinkedStringList *retval = NULL;
! LinkedStringList *l = NULL;
! LinkedStringList *prev = NULL;
HANDLE dir;
WIN32_FIND_DATA ent;
--- 425,429 ----
int omitSymLinks)
{
! LinkedStringList *retval = NULL, *p = NULL;
HANDLE dir;
WIN32_FIND_DATA ent;
***************
*** 461,484 ****
continue;
! l = (LinkedStringList *) malloc(sizeof (LinkedStringList));
! if (l == NULL)
! break;
!
! l->str = (char *) malloc(strlen(ent.cFileName) + 1);
! if (l->str == NULL)
! {
! free(l);
! break;
! } /* if */
!
! strcpy(l->str, ent.cFileName);
!
! if (retval == NULL)
! retval = l;
! else
! prev->next = l;
!
! prev = l;
! l->next = NULL;
} while (FindNextFile(dir, &ent) != 0);
--- 459,463 ----
continue;
! retval = __PHYSFS_addToLinkedStringList(retval, &p, ent.cFileName,
-1);
} while (FindNextFile(dir, &ent) != 0);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paragui-cvs] CVS: paragui/src/physfs/platform beos.cpp,1.1.2.4,1.1.2.5 macclassic.c,1.1.2.4,1.1.2.5 posix.c,1.1.2.3,1.1.2.4 unix.c,1.1.1.1.6.5,1.1.1.1.6.6 win32.c,1.1.1.1.6.12,1.1.1.1.6.13,
Alexander Pipelka <address@hidden> <=
- Prev by Date:
[paragui-cvs] CVS: paragui/src/physfs/test test_physfs.c,1.1.2.3,1.1.2.4
- Next by Date:
[paragui-cvs] CVS: paragui/src/widgets pgscrollbar.cpp,1.3,1.3.6.1 pgthemewidget.cpp,1.3.6.4,1.3.6.5
- Previous by thread:
[paragui-cvs] CVS: paragui/src/physfs/test test_physfs.c,1.1.2.3,1.1.2.4
- Next by thread:
[paragui-cvs] CVS: paragui/src/widgets pgscrollbar.cpp,1.3,1.3.6.1 pgthemewidget.cpp,1.3.6.4,1.3.6.5
- Index(es):