Ignore:
Timestamp:
2018-06-15T13:06:18Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8338a81
Parents:
1ae9c07
git-author:
Jiri Svoboda <jiri@…> (2018-06-14 22:05:23)
git-committer:
Jiri Svoboda <jiri@…> (2018-06-15 13:06:18)
Message:

Clean up libposix stdio.h and stdlib.h a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/include/posix/stdio.h

    r1ae9c07 r55092672  
    4040
    4141#include "stddef.h"
    42 #include "unistd.h"
    4342#include "libc/io/verify.h"
    4443#include "sys/types.h"
     
    4645#include "limits.h"
    4746
    48 /*
    49  * These are the same as in HelenOS libc.
    50  * It would be possible to directly include <stdio.h> but
    51  * it is better not to pollute POSIX namespace with other functions
    52  * defined in that header.
    53  *
    54  * Because libposix is always linked with libc, providing only these
    55  * forward declarations ought to be enough.
    56  */
    57 #define EOF (-1)
    58 
    59 /** Size of buffers used in stdio header. */
    60 #define BUFSIZ  4096
    61 
    62 /** Maximum size in bytes of the longest filename. */
    63 #define FILENAME_MAX 4096
    64 
    65 typedef struct _IO_FILE FILE;
    66 
    67 extern FILE *stdin;
    68 extern FILE *stdout;
    69 extern FILE *stderr;
    70 
    71 extern int fgetc(FILE *);
    72 extern char *fgets(char *, int, FILE *);
    73 
    74 extern int getchar(void);
    75 extern char *gets(char *, size_t);
    76 
    77 extern int fputc(int, FILE *);
    78 extern int fputs(const char *, FILE *);
    79 
    80 extern int putchar(int);
    81 extern int puts(const char *);
    82 
    83 extern int fprintf(FILE *, const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(2, 3);
    84 extern int vfprintf(FILE *, const char *, va_list);
    85 
    86 extern int printf(const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(1, 2);
    87 extern int vprintf(const char *, va_list);
    88 
    89 extern int snprintf(char *, size_t, const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(3, 4);
    90 #ifdef _GNU_SOURCE
    91 extern int vasprintf(char **, const char *, va_list);
    92 extern int asprintf(char **, const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(2, 3);
    93 #endif
    94 extern int vsnprintf(char *, size_t, const char *, va_list);
    95 
    96 extern FILE *fopen(const char *, const char *);
    9747extern FILE *fdopen(int, const char *);
    98 extern int fclose(FILE *);
    99 
    100 extern size_t fread(void *, size_t, size_t, FILE *);
    101 extern size_t fwrite(const void *, size_t, size_t, FILE *);
    102 
    103 extern void rewind(FILE *);
    104 extern int feof(FILE *);
    10548extern int fileno(FILE *);
    106 
    107 extern int fflush(FILE *);
    108 extern int ferror(FILE *);
    109 extern void clearerr(FILE *);
    110 
    111 extern void setvbuf(FILE *, void *, int, size_t);
    112 extern void setbuf(FILE *, void *);
    113 
    114 /* POSIX specific stuff. */
    11549
    11650/* Identifying the Terminal */
     
    11953extern char *ctermid(char *s);
    12054
    121 /* Error Recovery */
    122 extern void clearerr(FILE *stream);
    123 
    12455/* Input/Output */
    125 #undef putc
    126 #define putc fputc
    127 extern int fputs(const char *__restrict__ s, FILE *__restrict__ stream);
    128 #undef getc
    129 #define getc fgetc
    130 extern int ungetc(int c, FILE *stream);
    13156extern ssize_t getdelim(char **__restrict__ lineptr, size_t *__restrict__ n,
    13257    int delimiter, FILE *__restrict__ stream);
    13358extern ssize_t getline(char **__restrict__ lineptr, size_t *__restrict__ n,
    13459    FILE *__restrict__ stream);
    135 
    136 /* Opening Streams */
    137 extern FILE *freopen(const char *__restrict__ filename,
    138     const char *__restrict__ mode, FILE *__restrict__ stream);
    13960
    14061/* Error Messages */
     
    14869extern int fsetpos(FILE *stream, const fpos_t *pos);
    14970extern int fgetpos(FILE *__restrict__ stream, fpos_t *__restrict__ pos);
    150 extern int fseek(FILE *stream, long offset, int whence);
    15171extern int fseeko(FILE *stream, off_t offset, int whence);
    152 extern long ftell(FILE *stream);
    15372extern off_t ftello(FILE *stream);
    154 
    155 /* Flushing Buffers */
    156 extern int fflush(FILE *stream);
    15773
    15874/* Formatted Output */
     
    17389extern int putchar_unlocked(int c);
    17490
    175 /* Deleting Files */
    176 extern int remove(const char *path);
    177 
    178 /* Renaming Files */
    179 extern int rename(const char *oldname, const char *newname);
    180 
    18191/* Temporary Files */
    18292#undef L_tmpnam
     
    18696extern FILE *tmpfile(void);
    18797
    188 
    18998#endif /* POSIX_STDIO_H_ */
    19099
Note: See TracChangeset for help on using the changeset viewer.