hide internal functions

This commit is contained in:
Dave Murphy
2011-01-20 10:35:49 +00:00
parent 9470aae8f3
commit 788879146e
2 changed files with 316 additions and 374 deletions

View File

@@ -70,7 +70,7 @@ diff -Nbaur newlib-1.19.0/libgloss/configure.in newlib-1.19.0-arm/libgloss/confi
LIB_AC_PROG_CC
AS=${AS-as}
diff -Nbaur newlib-1.19.0/libgloss/libsysbase/Makefile.in newlib-1.19.0-arm/libgloss/libsysbase/Makefile.in
--- newlib-1.19.0/libgloss/libsysbase/Makefile.in 1970-01-01 01:00:00.000000000 +0100
--- newlib-1.19.0/libgloss/libsysbase/Makefile.in 1970-01-01 01:00:00.000000000 +0100
+++ newlib-1.19.0-arm/libgloss/libsysbase/Makefile.in 2011-01-19 20:38:50.000000000 +0000
@@ -0,0 +1,148 @@
+# Copyright (c) 1998 Cygnus Support
@@ -142,7 +142,7 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/Makefile.in newlib-1.19.0-arm/libg
+# object files needed
+OBJS = abort.o iosupport.o close.o environ.o execve.o fork.o fstat.o getpid.o gettod.o \
+ isatty.o kill.o link.o lseek.o open.o read.o sbrk.o stat.o times.o \
+ unlink.o wait.o write.o _exit.o malloc_vars.o \
+ unlink.o wait.o write.o _exit.o malloc_vars.o \
+ chdir.o mkdir.o rename.o build_argv.o statvfs.o \
+ flock.o syscall_support.o handle_manager.o truncate.o ftruncate.o dirent.o fsync.o \
+ fchmod.o chmod.o
@@ -4723,18 +4723,18 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/configure.in newlib-1.19.0-arm/lib
+)
+AC_OUTPUT
+
+
diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dir.c newlib-1.19.0-arm/libgloss/libsysbase/dir.c
--- newlib-1.19.0/libgloss/libsysbase/dir.c 1970-01-01 01:00:00.000000000 +0100
+++ newlib-1.19.0-arm/libgloss/libsysbase/dir.c 2010-12-18 15:27:28.000000000 +0000
@@ -0,0 +1,93 @@
+
diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dirent.c newlib-1.19.0-arm/libgloss/libsysbase/dirent.c
--- newlib-1.19.0/libgloss/libsysbase/dirent.c 1970-01-01 01:00:00.000000000 +0100
+++ newlib-1.19.0-arm/libgloss/libsysbase/dirent.c 2011-01-19 22:13:21.000000000 +0000
@@ -0,0 +1,246 @@
+#include <sys/dirent.h>
+#include <sys/iosupport.h>
+#include <sys/iosupport.h>
+#include <malloc.h>
+#include <malloc.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+
+
+static DIR_ITER * __diropen (const char *path) {
+ struct _reent *r = _REENT;
+ DIR_ITER *handle = NULL;
@@ -4767,7 +4767,7 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dir.c newlib-1.19.0-arm/libgloss/l
+
+ return handle;
+}
+
+
+static int __dirreset (DIR_ITER *dirState) {
+ struct _reent *r = _REENT;
+ int ret = -1;
@@ -4784,7 +4784,7 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dir.c newlib-1.19.0-arm/libgloss/l
+ }
+ return ret;
+}
+
+
+static int __dirnext (DIR_ITER *dirState, char *filename, struct stat *filestat) {
+ struct _reent *r = _REENT;
+ int ret = -1;
@@ -4801,7 +4801,7 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dir.c newlib-1.19.0-arm/libgloss/l
+ }
+ return ret;
+}
+
+
+static int __dirclose (DIR_ITER *dirState) {
+ struct _reent *r = _REENT;
+ int ret = -1;
@@ -4820,16 +4820,8 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dir.c newlib-1.19.0-arm/libgloss/l
+ }
+ return ret;
+}
+
diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dirent.c newlib-1.19.0-arm/libgloss/libsysbase/dirent.c
--- newlib-1.19.0/libgloss/libsysbase/dirent.c 1970-01-01 01:00:00.000000000 +0100
+++ newlib-1.19.0-arm/libgloss/libsysbase/dirent.c 2010-12-18 15:27:50.000000000 +0000
@@ -0,0 +1,157 @@
+#include <sys/dirent.h>
+#include <sys/iosupport.h>
+#include <malloc.h>
+#include <errno.h>
+#include <string.h>
+
+
+
+
+DIR* opendir (const char *dirname) {
@@ -4838,7 +4830,7 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dirent.c newlib-1.19.0-arm/libglos
+ errno = ENOMEM;
+ return NULL;
+ }
+
+
+ dirp->dirData = __diropen (dirname);
+ if (!dirp->dirData) {
+ free (dirp);
@@ -4860,7 +4852,7 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dirent.c newlib-1.19.0-arm/libglos
+ errno = EBADF;
+ return -1;
+ }
+
+
+ res = __dirclose (dirp->dirData);
+ free (dirp);
+ return res;
@@ -4877,7 +4869,7 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dirent.c newlib-1.19.0-arm/libglos
+ errno = EBADF;
+ return NULL;
+ }
+
+
+ res = __dirnext (dirp->dirData, filename, &st);
+
+ if (res < 0) {
@@ -4912,7 +4904,7 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dirent.c newlib-1.19.0-arm/libglos
+ if (!dirp) {
+ return EBADF;
+ }
+
+
+ res = __dirnext (dirp->dirData, filename, &st);
+
+ if (res < 0) {
@@ -4946,7 +4938,7 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dirent.c newlib-1.19.0-arm/libglos
+ if (!dirp) {
+ return;
+ }
+
+
+ __dirreset (dirp->dirData);
+ dirp->position = 0;
+}
@@ -4961,13 +4953,13 @@ diff -Nbaur newlib-1.19.0/libgloss/libsysbase/dirent.c newlib-1.19.0-arm/libglos
+
+ if (dirp->position > loc) {
+ // The entry we want is before the one we have,
+ // so we have to start again from the begining
+ // so we have to start again from the begining
+ __dirreset (dirp->dirData);
+ dirp->position = 0;
+ }
+
+ // Keep reading entries until we reach the one we want
+ while ((dirp->position < loc) &&
+ while ((dirp->position < loc) &&
+ (__dirnext (dirp->dirData, filename, NULL) >= 0))
+ {
+ dirp->position += 1;
@@ -6702,8 +6694,8 @@ diff -Nbaur newlib-1.19.0/newlib/libc/include/sys/dirent.h newlib-1.19.0-arm/new
+#endif // _dirent_h_
\ No newline at end of file
diff -Nbaur newlib-1.19.0/newlib/libc/include/sys/iosupport.h newlib-1.19.0-arm/newlib/libc/include/sys/iosupport.h
--- newlib-1.19.0/newlib/libc/include/sys/iosupport.h 1970-01-01 01:00:00.000000000 +0100
+++ newlib-1.19.0-arm/newlib/libc/include/sys/iosupport.h 2010-12-18 16:49:59.000000000 +0000
--- newlib-1.19.0/newlib/libc/include/sys/iosupport.h 1970-01-01 01:00:00.000000000 +0100
+++ newlib-1.19.0-arm/newlib/libc/include/sys/iosupport.h 2011-01-19 20:42:05.000000000 +0000
@@ -0,0 +1,88 @@
+//---------------------------------------------------------------------------------
+#ifndef __iosupp_h__
@@ -6784,11 +6776,6 @@ diff -Nbaur newlib-1.19.0/newlib/libc/include/sys/iosupport.h newlib-1.19.0-arm/
+int FindDevice(const char* name);
+int RemoveDevice(const char* name);
+void setDefaultDevice( int device );
+const devoptab_t* GetDeviceOpTab (const char *name);
+
+DIR_ITER* diropen (const char *path);
+int dirreset (DIR_ITER *dirState);
+int dirnext (DIR_ITER *dirState, char *filename, struct stat *filestat);
+const devoptab_t* GetDeviceOpTab (const char *name);
+
+#ifdef __cplusplus

File diff suppressed because it is too large Load Diff