diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-02-22 15:32:32 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-02-22 15:32:32 +0000 |
commit | f8f99f66c996abe7543ac1f2e4c24df78fa2e57f (patch) | |
tree | d413fca9b2fc7c5337f0b3ae0c72a9caf7c74184 /libgphoto2_port/libgphoto2_port | |
parent | 7ec1887efe627fcb7b27c00f2d2294dbaa3296f4 (diff) | |
download | libgphoto2-f8f99f66c996abe7543ac1f2e4c24df78fa2e57f.tar.gz |
revert, was wrong
lowercase GP_SYSTEM_STUFF
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14760 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2_port/libgphoto2_port')
-rw-r--r-- | libgphoto2_port/libgphoto2_port/Makefile.am | 1 | ||||
-rw-r--r-- | libgphoto2_port/libgphoto2_port/gphoto2-port-portability.c | 8 | ||||
-rw-r--r-- | libgphoto2_port/libgphoto2_port/gphoto2-port-portability.h | 90 |
3 files changed, 4 insertions, 95 deletions
diff --git a/libgphoto2_port/libgphoto2_port/Makefile.am b/libgphoto2_port/libgphoto2_port/Makefile.am index 123d658d6..862aa7e10 100644 --- a/libgphoto2_port/libgphoto2_port/Makefile.am +++ b/libgphoto2_port/libgphoto2_port/Makefile.am @@ -43,7 +43,6 @@ libgphoto2_port_la_SOURCES = \ gphoto2-port-log.c \ gphoto2-port-version.c \ gphoto2-port.c \ - gphoto2-port-portability.h \ gphoto2-port-portability.c \ gphoto2-port-result.c diff --git a/libgphoto2_port/libgphoto2_port/gphoto2-port-portability.c b/libgphoto2_port/libgphoto2_port/gphoto2-port-portability.c index fad65e6be..596993081 100644 --- a/libgphoto2_port/libgphoto2_port/gphoto2-port-portability.c +++ b/libgphoto2_port/libgphoto2_port/gphoto2-port-portability.c @@ -62,7 +62,7 @@ int gp_system_mkdir (const char *dirname) { return (GP_OK); } -GP_SYSTEM_DIR gp_system_opendir (const char *dirname) { +gp_system_dir gp_system_opendir (const char *dirname) { GPPORTWINDIR *d; DWORD dr; @@ -87,7 +87,7 @@ GP_SYSTEM_DIR gp_system_opendir (const char *dirname) { return (d); } -GP_SYSTEM_DIRENT gp_system_readdir (GP_SYSTEM_DIR d) { +gp_system_dirent gp_system_readdir (gp_system_dir d) { char dirn[1024]; @@ -122,12 +122,12 @@ GP_SYSTEM_DIRENT gp_system_readdir (GP_SYSTEM_DIR d) { return (&(d->search)); } -const char *gp_system_filename (GP_SYSTEM_DIRENT de) { +const char *gp_system_filename (gp_system_dirent de) { return (de->cFileName); } -int gp_system_closedir (GP_SYSTEM_DIR d) { +int gp_system_closedir (gp_system_dir d) { FindClose(d->handle); free(d); return (1); diff --git a/libgphoto2_port/libgphoto2_port/gphoto2-port-portability.h b/libgphoto2_port/libgphoto2_port/gphoto2-port-portability.h deleted file mode 100644 index 109af0a42..000000000 --- a/libgphoto2_port/libgphoto2_port/gphoto2-port-portability.h +++ /dev/null @@ -1,90 +0,0 @@ - -/* Windows Portability - ------------------------------------------------------------------ */ - -#ifdef WIN32 - -#include <windows.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <string.h> -#include <stdio.h> -#include <direct.h> - -#define IOLIBS "." -#define strcasecmp _stricmp -#define snprintf _snprintf - -/* Work-around for readdir() */ -typedef struct { - HANDLE handle; - int got_first; - WIN32_FIND_DATA search; - char dir[1024]; - char drive[32][2]; - int drive_count; - int drive_index; -} GPPORTWINDIR; - -/* Sleep functionality */ -#define GP_SYSTEM_SLEEP(_ms) Sleep(_ms) - -/* Dynamic library functions */ -#define GP_SYSTEM_DLOPEN(_filename) LoadLibrary(_filename) -#define GP_SYSTEM_DLSYM(_handle, _funcname) GetProcAddress(_handle, _funcname) -#define GP_SYSTEM_DLCLOSE(_handle) FreeLibrary(_handle) -#define GP_SYSTEM_DLERROR() "Windows Error" - -/* Directory-oriented functions */ -#define GP_SYSTEM_DIR GPPORTWINDIR * -#define GP_SYSTEM_DIRENT WIN32_FIND_DATA * -#define GP_SYSTEM_DIR_DELIM '\\' - - -#else - -/* POSIX Portability - ------------------------------------------------------------------ */ - -/* yummy. :) */ - -#include <sys/types.h> -#include <dirent.h> -#include <dlfcn.h> -#include <sys/param.h> -#include <sys/stat.h> -#include <unistd.h> - -/* Sleep functionality */ -#define GP_SYSTEM_SLEEP(_ms) usleep((_ms)*1000) - -/* Dynamic library functions */ -#define GP_SYSTEM_DLOPEN(_filename) dlopen(_filename, RTLD_LAZY) -#if defined(__APPLE__) || defined(__OpenBSD__) - /* Darwin and OpenBSD prepend underscores to symbols */ -#define GP_SYSTEM_DLSYM(_handle, _funcname) dlsym(_handle, "_" _funcname) -#else -#define GP_SYSTEM_DLSYM(_handle, _funcname) dlsym(_handle, _funcname) -#endif -#define GP_SYSTEM_DLCLOSE(_handle) dlclose(_handle) -#define GP_SYSTEM_DLERROR() dlerror() - -/* Directory-oriented functions */ -#define GP_SYSTEM_DIR DIR * -#define GP_SYSTEM_DIRENT struct dirent * -#ifdef OS2 -#define GP_SYSTEM_DIR_DELIM '\\' -#else -#define GP_SYSTEM_DIR_DELIM '/' -#endif /* OS2 */ - -#endif /* else */ - -int GP_SYSTEM_MKDIR (const char *dirname); -int GP_SYSTEM_RMDIR (const char *dirname); -GP_SYSTEM_DIR GP_SYSTEM_OPENDIR (const char *dirname); -GP_SYSTEM_DIRENT GP_SYSTEM_READDIR (GP_SYSTEM_DIR d); -const char* GP_SYSTEM_FILENAME (GP_SYSTEM_DIRENT de); -int GP_SYSTEM_CLOSEDIR (GP_SYSTEM_DIR dir); -int GP_SYSTEM_IS_FILE (const char *filename); -int GP_SYSTEM_IS_DIR (const char *dirname); |