[Cbe-oss-dev] [PATCH 5/7] libspe2: Hide internal symbols: C99 handler
Kazunori Asayama
asayama at sm.sony.co.jp
Thu Jul 19 23:22:29 EST 2007
This patch hides internal symbols in the C99 handler of libspe2.
Signed-off-by: Kazunori Asayama <asayama at sm.sony.co.jp>
---
spebase/default_c99_handler.c | 86 +++++++++++++++++++++---------------------
spebase/default_c99_handler.h | 45 ---------------------
spebase/lib_builtin.c | 2
3 files changed, 45 insertions(+), 88 deletions(-)
Index: b/spebase/default_c99_handler.c
===================================================================
--- a/spebase/default_c99_handler.c 2007-07-19 12:46:16.000000000 +0900
+++ b/spebase/default_c99_handler.c 2007-07-19 12:48:34.000000000 +0900
@@ -769,7 +769,7 @@ static int __parse_scanf_format(char *ls
*
* int remove(const char *pathname);
*/
-int default_c99_handler_remove(char *ls, unsigned long opdata)
+static int default_c99_handler_remove(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -793,7 +793,7 @@ int default_c99_handler_remove(char *ls,
*
* int rename(const char *oldname, const char *newname);
*/
-int default_c99_handler_rename(char *ls, unsigned long opdata)
+static int default_c99_handler_rename(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
DECL_RET();
@@ -819,7 +819,7 @@ int default_c99_handler_rename(char *ls,
*
* FILE *tmpfile(void);
*/
-int default_c99_handler_tmpfile(char *ls, unsigned long opdata)
+static int default_c99_handler_tmpfile(char *ls, unsigned long opdata)
{
DECL_0_ARGS();
DECL_RET();
@@ -860,7 +860,7 @@ int default_c99_handler_tmpfile(char *ls
* For integrity reasons we return failure. We should expose
* mkstemp() instead.
*/
-int default_c99_handler_tmpnam(char *ls, unsigned long opdata)
+static int default_c99_handler_tmpnam(char *ls, unsigned long opdata)
{
DECL_0_ARGS();
DECL_RET();
@@ -880,7 +880,7 @@ int default_c99_handler_tmpnam(char *ls,
*
* int fclose(FILE *stream);
*/
-int default_c99_handler_fclose(char *ls, unsigned long opdata)
+static int default_c99_handler_fclose(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -910,7 +910,7 @@ int default_c99_handler_fclose(char *ls,
*
* int fflush(FILE *stream);
*/
-int default_c99_handler_fflush(char *ls, unsigned long opdata)
+static int default_c99_handler_fflush(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -934,7 +934,7 @@ int default_c99_handler_fflush(char *ls,
*
* FILE *fopen(const char *path, const char *mode);
*/
-int default_c99_handler_fopen(char *ls, unsigned long opdata)
+static int default_c99_handler_fopen(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
DECL_RET();
@@ -976,7 +976,7 @@ int default_c99_handler_fopen(char *ls,
*
* FILE *freopen(const char *path, const char *mode, FILE *stream);
*/
-int default_c99_handler_freopen(char *ls, unsigned long opdata)
+static int default_c99_handler_freopen(char *ls, unsigned long opdata)
{
DECL_3_ARGS();
DECL_RET();
@@ -1013,7 +1013,7 @@ int default_c99_handler_freopen(char *ls
*
* void setbuf(FILE *stream, char *buf);
*/
-int default_c99_handler_setbuf(char *ls, unsigned long opdata)
+static int default_c99_handler_setbuf(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
FILE *stream;
@@ -1036,7 +1036,7 @@ int default_c99_handler_setbuf(char *ls,
*
* int setvbuf(FILE *stream, char *buf, int mode , size_t size);
*/
-int default_c99_handler_setvbuf(char *ls, unsigned long opdata)
+static int default_c99_handler_setvbuf(char *ls, unsigned long opdata)
{
DECL_4_ARGS();
DECL_RET();
@@ -1066,7 +1066,7 @@ int default_c99_handler_setvbuf(char *ls
*
* int vfprintf(FILE *stream, const char *format, va_list ap);
*/
-int default_c99_handler_vfprintf(char *ls, unsigned long opdata)
+static int default_c99_handler_vfprintf(char *ls, unsigned long opdata)
{
DECL_3_ARGS();
DECL_RET();
@@ -1098,7 +1098,7 @@ int default_c99_handler_vfprintf(char *l
*
* int vfscanf(FILE *stream, const char *format, va_list ap);
*/
-int default_c99_handler_vfscanf(char *ls, unsigned long opdata)
+static int default_c99_handler_vfscanf(char *ls, unsigned long opdata)
{
DECL_3_ARGS();
DECL_RET();
@@ -1138,7 +1138,7 @@ int default_c99_handler_vfscanf(char *ls
*
* int vprintf(const char *format, va_list ap);
*/
-int default_c99_handler_vprintf(char *ls, unsigned long opdata)
+static int default_c99_handler_vprintf(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
DECL_RET();
@@ -1170,7 +1170,7 @@ int default_c99_handler_vprintf(char *ls
*
* int vscanf(const char *format, va_list ap);
*/
-int default_c99_handler_vscanf(char *ls, unsigned long opdata)
+static int default_c99_handler_vscanf(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
DECL_RET();
@@ -1210,7 +1210,7 @@ int default_c99_handler_vscanf(char *ls,
*
* int vsnprintf(char *str, size_t size, const char *format, va_list ap);
*/
-int default_c99_handler_vsnprintf(char *ls, unsigned long opdata)
+static int default_c99_handler_vsnprintf(char *ls, unsigned long opdata)
{
DECL_4_ARGS();
DECL_RET();
@@ -1244,7 +1244,7 @@ int default_c99_handler_vsnprintf(char *
*
* int vsprintf(char *str, const char *format, va_list ap);
*/
-int default_c99_handler_vsprintf(char *ls, unsigned long opdata)
+static int default_c99_handler_vsprintf(char *ls, unsigned long opdata)
{
DECL_3_ARGS();
DECL_RET();
@@ -1276,7 +1276,7 @@ int default_c99_handler_vsprintf(char *l
*
* int vsscanf(const char *str, const char *format, va_list ap);
*/
-int default_c99_handler_vsscanf(char *ls, unsigned long opdata)
+static int default_c99_handler_vsscanf(char *ls, unsigned long opdata)
{
DECL_3_ARGS();
DECL_RET();
@@ -1316,7 +1316,7 @@ int default_c99_handler_vsscanf(char *ls
*
* int fgetc(FILE *stream);
*/
-int default_c99_handler_fgetc(char *ls, unsigned long opdata)
+static int default_c99_handler_fgetc(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -1340,7 +1340,7 @@ int default_c99_handler_fgetc(char *ls,
*
* char *fgets(char *s, int size, FILE *stream);
*/
-int default_c99_handler_fgets(char *ls, unsigned long opdata)
+static int default_c99_handler_fgets(char *ls, unsigned long opdata)
{
DECL_3_ARGS();
DECL_RET();
@@ -1367,7 +1367,7 @@ int default_c99_handler_fgets(char *ls,
*
* int fileno(FILE *stream);
*/
-int default_c99_handler_fileno(char *ls, unsigned long opdata)
+static int default_c99_handler_fileno(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -1391,7 +1391,7 @@ int default_c99_handler_fileno(char *ls,
*
* int fputc(int c, FILE *stream);
*/
-int default_c99_handler_fputc(char *ls, unsigned long opdata)
+static int default_c99_handler_fputc(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
DECL_RET();
@@ -1417,7 +1417,7 @@ int default_c99_handler_fputc(char *ls,
*
* int fputs(const char *s, FILE *stream);
*/
-int default_c99_handler_fputs(char *ls, unsigned long opdata)
+static int default_c99_handler_fputs(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
DECL_RET();
@@ -1443,7 +1443,7 @@ int default_c99_handler_fputs(char *ls,
*
* int getc(FILE *stream);
*/
-int default_c99_handler_getc(char *ls, unsigned long opdata)
+static int default_c99_handler_getc(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -1467,7 +1467,7 @@ int default_c99_handler_getc(char *ls, u
*
* int getchar(void);
*/
-int default_c99_handler_getchar(char *ls, unsigned long opdata)
+static int default_c99_handler_getchar(char *ls, unsigned long opdata)
{
DECL_0_ARGS();
DECL_RET();
@@ -1495,7 +1495,7 @@ int default_c99_handler_getchar(char *ls
* hole, since its impossible to tell how many characters will
* be input.
*/
-int default_c99_handler_gets(char *ls, unsigned long opdata)
+static int default_c99_handler_gets(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -1528,7 +1528,7 @@ int default_c99_handler_gets(char *ls, u
*
* int putc(int c, FILE *stream);
*/
-int default_c99_handler_putc(char *ls, unsigned long opdata)
+static int default_c99_handler_putc(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
DECL_RET();
@@ -1552,7 +1552,7 @@ int default_c99_handler_putc(char *ls, u
*
* int putchar(int c);
*/
-int default_c99_handler_putchar(char *ls, unsigned long opdata)
+static int default_c99_handler_putchar(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -1576,7 +1576,7 @@ int default_c99_handler_putchar(char *ls
*
* int puts(const char *s);
*/
-int default_c99_handler_puts(char *ls, unsigned long opdata)
+static int default_c99_handler_puts(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -1600,7 +1600,7 @@ int default_c99_handler_puts(char *ls, u
*
* int ungetc(int c, FILE *stream);
*/
-int default_c99_handler_ungetc(char *ls, unsigned long opdata)
+static int default_c99_handler_ungetc(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
DECL_RET();
@@ -1625,7 +1625,7 @@ int default_c99_handler_ungetc(char *ls,
*
* size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
*/
-int default_c99_handler_fread(char *ls, unsigned long opdata)
+static int default_c99_handler_fread(char *ls, unsigned long opdata)
{
DECL_4_ARGS();
DECL_RET();
@@ -1654,7 +1654,7 @@ int default_c99_handler_fread(char *ls,
*
* size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
*/
-int default_c99_handler_fwrite(char *ls, unsigned long opdata)
+static int default_c99_handler_fwrite(char *ls, unsigned long opdata)
{
DECL_4_ARGS();
DECL_RET();
@@ -1683,7 +1683,7 @@ int default_c99_handler_fwrite(char *ls,
*
* int fgetpos(FILE *stream, fpos_t *pos);
*/
-int default_c99_handler_fgetpos(char *ls, unsigned long opdata)
+static int default_c99_handler_fgetpos(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
DECL_RET();
@@ -1709,7 +1709,7 @@ int default_c99_handler_fgetpos(char *ls
*
* int fseek(FILE *stream, long offset, int whence);
*/
-int default_c99_handler_fseek(char *ls, unsigned long opdata)
+static int default_c99_handler_fseek(char *ls, unsigned long opdata)
{
DECL_3_ARGS();
DECL_RET();
@@ -1737,7 +1737,7 @@ int default_c99_handler_fseek(char *ls,
*
* int fsetpos(FILE *stream, fpos_t *pos);
*/
-int default_c99_handler_fsetpos(char *ls, unsigned long opdata)
+static int default_c99_handler_fsetpos(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
DECL_RET();
@@ -1763,7 +1763,7 @@ int default_c99_handler_fsetpos(char *ls
*
* long ftell(FILE *stream);
*/
-int default_c99_handler_ftell(char *ls, unsigned long opdata)
+static int default_c99_handler_ftell(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -1787,7 +1787,7 @@ int default_c99_handler_ftell(char *ls,
*
* void rewind(FILE *stream);
*/
-int default_c99_handler_rewind(char *ls, unsigned long opdata)
+static int default_c99_handler_rewind(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
FILE *stream;
@@ -1808,7 +1808,7 @@ int default_c99_handler_rewind(char *ls,
*
* void clearerr(FILE *stream);
*/
-int default_c99_handler_clearerr(char *ls, unsigned long opdata)
+static int default_c99_handler_clearerr(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
FILE *stream;
@@ -1829,7 +1829,7 @@ int default_c99_handler_clearerr(char *l
*
* int feof(FILE *stream);
*/
-int default_c99_handler_feof(char *ls, unsigned long opdata)
+static int default_c99_handler_feof(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -1853,7 +1853,7 @@ int default_c99_handler_feof(char *ls, u
*
* void ferror(FILE *stream);
*/
-int default_c99_handler_ferror(char *ls, unsigned long opdata)
+static int default_c99_handler_ferror(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -1878,7 +1878,7 @@ int default_c99_handler_ferror(char *ls,
*
* void perror(const char *s);
*/
-int default_c99_handler_perror(char *ls, unsigned long opdata)
+static int default_c99_handler_perror(char *ls, unsigned long opdata)
{
DECL_2_ARGS();
char *s;
@@ -1904,7 +1904,7 @@ int default_c99_handler_perror(char *ls,
*
* int system(const char *string);
*/
-int default_c99_handler_system(char *ls, unsigned long opdata)
+static int default_c99_handler_system(char *ls, unsigned long opdata)
{
DECL_1_ARGS();
DECL_RET();
@@ -1918,7 +1918,7 @@ int default_c99_handler_system(char *ls,
return 0;
}
-int (*default_c99_funcs[SPE_C99_NR_OPCODES]) (char *, unsigned long) = {
+static int (*default_c99_funcs[SPE_C99_NR_OPCODES]) (char *, unsigned long) = {
[SPE_C99_UNUSED] = NULL,
[SPE_C99_CLEARERR] = default_c99_handler_clearerr,
[SPE_C99_FCLOSE] = default_c99_handler_fclose,
@@ -1970,7 +1970,7 @@ int (*default_c99_funcs[SPE_C99_NR_OPCOD
*
* Top-level dispatch for SPE C99 library operations.
*/
-int default_c99_handler(unsigned long *base, unsigned long offset)
+int _base_spe_default_c99_handler(unsigned long *base, unsigned long offset)
{
int op, opdata;
Index: b/spebase/default_c99_handler.h
===================================================================
--- a/spebase/default_c99_handler.h 2007-07-19 12:46:16.000000000 +0900
+++ b/spebase/default_c99_handler.h 2007-07-19 12:48:34.000000000 +0900
@@ -22,49 +22,6 @@
#define SPE_C99_CLASS 0x2100
-extern int default_c99_handler(unsigned long *base, unsigned long args);
-
-extern int default_c99_handler_clearerr(char *ls, unsigned long args);
-extern int default_c99_handler_fclose(char *ls, unsigned long args);
-extern int default_c99_handler_feof(char *ls, unsigned long args);
-extern int default_c99_handler_ferror(char *ls, unsigned long args);
-extern int default_c99_handler_fflush(char *ls, unsigned long args);
-extern int default_c99_handler_fgetc(char *ls, unsigned long args);
-extern int default_c99_handler_fgetpos(char *ls, unsigned long args);
-extern int default_c99_handler_fgets(char *ls, unsigned long args);
-extern int default_c99_handler_fileno(char *ls, unsigned long args);
-extern int default_c99_handler_fopen(char *ls, unsigned long args);
-extern int default_c99_handler_fputc(char *ls, unsigned long args);
-extern int default_c99_handler_fputs(char *ls, unsigned long args);
-extern int default_c99_handler_fread(char *ls, unsigned long args);
-extern int default_c99_handler_freopen(char *ls, unsigned long args);
-extern int default_c99_handler_fseek(char *ls, unsigned long args);
-extern int default_c99_handler_fsetpos(char *ls, unsigned long args);
-extern int default_c99_handler_ftell(char *ls, unsigned long args);
-extern int default_c99_handler_fwrite(char *ls, unsigned long args);
-extern int default_c99_handler_getc(char *ls, unsigned long args);
-extern int default_c99_handler_getchar(char *ls, unsigned long args);
-extern int default_c99_handler_getenv(char *ls, unsigned long args);
-extern int default_c99_handler_gets(char *ls, unsigned long args);
-extern int default_c99_handler_perror(char *ls, unsigned long args);
-extern int default_c99_handler_putc(char *ls, unsigned long args);
-extern int default_c99_handler_putchar(char *ls, unsigned long args);
-extern int default_c99_handler_puts(char *ls, unsigned long args);
-extern int default_c99_handler_remove(char *ls, unsigned long args);
-extern int default_c99_handler_rename(char *ls, unsigned long args);
-extern int default_c99_handler_rewind(char *ls, unsigned long args);
-extern int default_c99_handler_setbuf(char *ls, unsigned long args);
-extern int default_c99_handler_setvbuf(char *ls, unsigned long args);
-extern int default_c99_handler_system(char *ls, unsigned long args);
-extern int default_c99_handler_tmpfile(char *ls, unsigned long args);
-extern int default_c99_handler_tmpnam(char *ls, unsigned long args);
-extern int default_c99_handler_ungetc(char *ls, unsigned long args);
-extern int default_c99_handler_vfprintf(char *ls, unsigned long args);
-extern int default_c99_handler_vfscanf(char *ls, unsigned long args);
-extern int default_c99_handler_vprintf(char *ls, unsigned long args);
-extern int default_c99_handler_vscanf(char *ls, unsigned long args);
-extern int default_c99_handler_vsnprintf(char *ls, unsigned long args);
-extern int default_c99_handler_vsprintf(char *ls, unsigned long args);
-extern int default_c99_handler_vsscanf(char *ls, unsigned long args);
+extern int _base_spe_default_c99_handler(unsigned long *base, unsigned long args);
#endif /* __DEFAULT_C99_HANDLER_H__ */
Index: b/spebase/lib_builtin.c
===================================================================
--- a/spebase/lib_builtin.c 2007-07-19 12:49:01.000000000 +0900
+++ b/spebase/lib_builtin.c 2007-07-19 12:49:21.000000000 +0900
@@ -29,7 +29,7 @@
/*Default SPE library call handlers for 21xx stop-and-signal.
*/
static void *handlers[] = {
- default_c99_handler, default_posix1_handler,
+ _base_spe_default_c99_handler, default_posix1_handler,
NULL,NULL,default_libea_handler ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
More information about the cbe-oss-dev
mailing list