Skip to content

Commit

Permalink
all: Remove internal symbol renaming, only leaving INT123_strerror().
Browse files Browse the repository at this point in the history
git-svn-id: svn://scm.orgis.org/mpg123/trunk@5319 35dc7657-300d-0410-a2e5-dc2837fedb53
  • Loading branch information
thor committed Sep 6, 2023
1 parent 295849f commit d0fbbe5
Show file tree
Hide file tree
Showing 167 changed files with 1,930 additions and 2,405 deletions.
6 changes: 4 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
non-interruptible drain after P 3, and dropping buffer on QUIT.
-- Uppercase some generic control replies for consinstency: SILENCE, PROGRESS,
MUTE, UNMUTE
- libmpg123, libout123, libsyn123: bumped API version for version query
functions
- libmpg123, libout123, libsyn123:
-- Bumped API version for version query functions.
-- Replaced nearly all symbol renames with explicit INT123_ prefix declarations
(intsym.h close to empty now).
- libout123:
-- Add sleep builtin output module (silent, but proper timing).
- libsyn123:
Expand Down
127 changes: 0 additions & 127 deletions scripts/intsym.pl

This file was deleted.

62 changes: 31 additions & 31 deletions src/compat/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@

#ifndef WINDOWS_UWP

char *compat_getenv(const char* name)
char *INT123_compat_getenv(const char* name)
{
char *ret = NULL;
#ifdef WANT_WIN32_UNICODE
wchar_t *env;
wchar_t *wname = NULL;
if(win32_utf8_wide(name, &wname, NULL) > 0)
if(INT123_win32_utf8_wide(name, &wname, NULL) > 0)
{
env = _wgetenv(wname);
free(wname);
if(env)
win32_wide_utf8(env, &ret, NULL);
INT123_win32_wide_utf8(env, &ret, NULL);
}
#else
ret = getenv(name);
if(ret)
ret = compat_strdup(ret);
ret = INT123_compat_strdup(ret);
#endif
return ret;
}
Expand All @@ -69,7 +69,7 @@ char *compat_getenv(const char* name)
#include "wpathconv.h"

/* Always add a default permission mask in case of flags|O_CREAT. */
int compat_open(const char *filename, int flags)
int INT123_compat_open(const char *filename, int flags)
{
int ret;
#if defined (WANT_WIN32_UNICODE)
Expand Down Expand Up @@ -105,8 +105,8 @@ int compat_open(const char *filename, int flags)
}

/* Moved over from wav.c, logic with fallbacks added from the
example of compat_open(). */
FILE* compat_fopen(const char *filename, const char *mode)
example of INT123_compat_open(). */
FILE* INT123_compat_fopen(const char *filename, const char *mode)
{
FILE* stream = NULL;
#ifdef WANT_WIN32_UNICODE
Expand All @@ -117,7 +117,7 @@ FILE* compat_fopen(const char *filename, const char *mode)
wname = u2wlongpath(filename);
if(!wname)
goto fopen_fallback;
cnt = win32_utf8_wide(mode, &wmode, NULL);
cnt = INT123_win32_utf8_wide(mode, &wmode, NULL);
if( (wmode == NULL) || (cnt == 0))
goto fopen_fallback;

Expand All @@ -136,12 +136,12 @@ FILE* compat_fopen(const char *filename, const char *mode)
return stream;
}

FILE* compat_fdopen(int fd, const char *mode)
FILE* INT123_compat_fdopen(int fd, const char *mode)
{
return fdopen(fd, mode);
}

int compat_close(int infd)
int INT123_compat_close(int infd)
{
#if (defined(WIN32) && !defined (__CYGWIN__)) /* MSDN says POSIX function is deprecated beginning in Visual C++ 2005 */
return _close(infd);
Expand All @@ -150,12 +150,12 @@ int compat_close(int infd)
#endif
}

int compat_fclose(FILE *stream)
int INT123_compat_fclose(FILE *stream)
{
return fclose(stream);
}

void compat_binmode(int fd, int enable)
void INT123_compat_binmode(int fd, int enable)
{
#if defined(HAVE__SETMODE)
_setmode(fd, enable ? _O_BINARY : _O_TEXT);
Expand Down Expand Up @@ -183,7 +183,7 @@ void compat_binmode(int fd, int enable)
typedef HRESULT (__stdcall *PCA_ptr)( const wchar_t *, const wchar_t*, unsigned long, wchar_t **);
#endif

char* compat_catpath(const char *prefix, const char* path)
char* INT123_compat_catpath(const char *prefix, const char* path)
{
char *ret = NULL;
#ifdef WANT_WIN32_UNICODE
Expand Down Expand Up @@ -253,7 +253,7 @@ char* compat_catpath(const char *prefix, const char* path)
return ret;
}

int compat_isdir(const char *path)
int INT123_compat_isdir(const char *path)
{
int ret = 0;
#ifdef WANT_WIN32_UNICODE
Expand Down Expand Up @@ -289,7 +289,7 @@ struct compat_dir
#endif
};

struct compat_dir* compat_diropen(char *path)
struct compat_dir* INT123_compat_diropen(char *path)
{
struct compat_dir *cd;
if(!path)
Expand All @@ -302,7 +302,7 @@ struct compat_dir* compat_diropen(char *path)
{
char *pattern;
wchar_t *wpattern;
pattern = compat_catpath(path, "*");
pattern = INT123_compat_catpath(path, "*");
wpattern = u2wlongpath(pattern);
if(wpattern)
{
Expand All @@ -329,17 +329,17 @@ struct compat_dir* compat_diropen(char *path)
#endif
if(cd)
{
cd->path = compat_strdup(path);
cd->path = INT123_compat_strdup(path);
if(!cd->path)
{
compat_dirclose(cd);
INT123_compat_dirclose(cd);
cd = NULL;
}
}
return cd;
}

void compat_dirclose(struct compat_dir *cd)
void INT123_compat_dirclose(struct compat_dir *cd)
{
if(cd)
{
Expand All @@ -353,7 +353,7 @@ void compat_dirclose(struct compat_dir *cd)
}
}

char* compat_nextfile(struct compat_dir *cd)
char* INT123_compat_nextfile(struct compat_dir *cd)
{
if(!cd)
return NULL;
Expand All @@ -364,7 +364,7 @@ char* compat_nextfile(struct compat_dir *cd)
if(!(cd->d.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
char *ret;
win32_wide_utf8(cd->d.cFileName, &ret, NULL);
INT123_win32_wide_utf8(cd->d.cFileName, &ret, NULL);
return ret;
}
}
Expand All @@ -374,11 +374,11 @@ char* compat_nextfile(struct compat_dir *cd)
while((dp = readdir(cd->dir)))
{
struct stat fst;
char *fullpath = compat_catpath(cd->path, dp->d_name);
char *fullpath = INT123_compat_catpath(cd->path, dp->d_name);
if(fullpath && !stat(fullpath, &fst) && S_ISREG(fst.st_mode))
{
free(fullpath);
return compat_strdup(dp->d_name);
return INT123_compat_strdup(dp->d_name);
}
free(fullpath);
}
Expand All @@ -387,7 +387,7 @@ char* compat_nextfile(struct compat_dir *cd)
return NULL;
}

char* compat_nextdir(struct compat_dir *cd)
char* INT123_compat_nextdir(struct compat_dir *cd)
{
if(!cd)
return NULL;
Expand All @@ -398,7 +398,7 @@ char* compat_nextdir(struct compat_dir *cd)
if(cd->d.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
char *ret;
win32_wide_utf8(cd->d.cFileName, &ret, NULL);
INT123_win32_wide_utf8(cd->d.cFileName, &ret, NULL);
return ret;
}
}
Expand All @@ -408,11 +408,11 @@ char* compat_nextdir(struct compat_dir *cd)
while((dp = readdir(cd->dir)))
{
struct stat fst;
char *fullpath = compat_catpath(cd->path, dp->d_name);
char *fullpath = INT123_compat_catpath(cd->path, dp->d_name);
if(fullpath && !stat(fullpath, &fst) && S_ISDIR(fst.st_mode))
{
free(fullpath);
return compat_strdup(dp->d_name);
return INT123_compat_strdup(dp->d_name);
}
free(fullpath);
}
Expand All @@ -438,7 +438,7 @@ char* compat_nextdir(struct compat_dir *cd)
// because of a serious reason (maybe EOF, maybe out of disk space). You
// can inspect errno.

size_t unintr_write(int fd, void const *buffer, size_t bytes)
size_t INT123_unintr_write(int fd, void const *buffer, size_t bytes)
{
size_t written = 0;
errno = 0;
Expand Down Expand Up @@ -466,7 +466,7 @@ size_t unintr_write(int fd, void const *buffer, size_t bytes)
}

/* Same for reading the data. */
size_t unintr_read(int fd, void *buffer, size_t bytes)
size_t INT123_unintr_read(int fd, void *buffer, size_t bytes)
{
size_t got = 0;
errno = 0;
Expand All @@ -489,7 +489,7 @@ size_t unintr_read(int fd, void *buffer, size_t bytes)
}

// and again for streams
size_t unintr_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
size_t INT123_unintr_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
size_t written = 0;
errno = 0;
Expand All @@ -509,7 +509,7 @@ size_t unintr_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)

#ifndef NO_CATCHSIGNAL
#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H)
void (*catchsignal(int signum, void(*handler)()))()
void (*INT123_catchsignal(int signum, void(*handler)()))()
{
struct sigaction new_sa;
struct sigaction old_sa;
Expand Down
Loading

0 comments on commit d0fbbe5

Please sign in to comment.