Ignore:
File:
1 edited

Legend:

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

    r55092672 r4e6a610  
    11/*
    22 * Copyright (c) 2005 Martin Decky
     3 * Copyright (c) 2018 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    3637#define LIBC_STDIO_H_
    3738
     39#include <offset.h>
    3840#include <stdarg.h>
    3941#include <io/verify.h>
     42#include <_bits/NULL.h>
    4043#include <_bits/size_t.h>
    4144#include <_bits/wchar_t.h>
    4245#include <_bits/wint_t.h>
    4346
    44 #define EOF  (-1)
    45 
    46 #ifndef SEEK_SET
    47 #define SEEK_SET  0
    48 #endif
    49 
    50 #ifndef SEEK_CUR
    51 #define SEEK_CUR  1
    52 #endif
    53 
    54 #ifndef SEEK_END
    55 #define SEEK_END  2
    56 #endif
    57 
    58 /** Default size for stream I/O buffers */
    59 #define BUFSIZ  4096
    60 
    61 /** Recommended size of fixed-size array for holding file names. */
    62 #define FILENAME_MAX 4096
    63 
    6447/** Forward declaration */
    6548struct _IO_FILE;
    6649typedef struct _IO_FILE FILE;
     50
     51/** File position */
     52typedef struct {
     53        off64_t pos;
     54} fpos_t;
     55
     56#ifndef _HELENOS_SOURCE
     57#define _IONBF 0
     58#define _IOLBF 1
     59#define _IOFBF 2
     60#endif
     61
     62/** Default size for stream I/O buffers */
     63#define BUFSIZ  4096
     64
     65#define EOF  (-1)
     66
     67/** Max number of files that is guaranteed to be able to open at the same time */
     68#define FOPEN_MAX VFS_MAX_OPEN_FILES
     69
     70/** Recommended size of fixed-size array for holding file names. */
     71#define FILENAME_MAX 4096
     72
     73/** Length of "/tmp/tmp.XXXXXX" + 1 */
     74#define L_tmpnam 16
     75
     76#ifndef SEEK_SET
     77#define SEEK_SET  0
     78#endif
     79
     80#ifndef SEEK_CUR
     81#define SEEK_CUR  1
     82#endif
     83
     84#ifndef SEEK_END
     85#define SEEK_END  2
     86#endif
     87
     88/** Minimum number of unique temporary file names */
     89#define TMP_MAX 1000000
    6790
    6891extern FILE *stdin;
     
    7497extern int fgetc(FILE *);
    7598extern char *fgets(char *, int, FILE *);
     99extern char *gets(char *, size_t) __attribute__((deprecated));
    76100
    77101extern int getchar(void);
     
    104128extern int vasprintf(char **, const char *, va_list);
    105129extern int asprintf(char **, const char *, ...)
    106 #endif
    107130    _HELENOS_PRINTF_ATTRIBUTE(2, 3);
     131#endif
    108132extern int vsnprintf(char *, size_t, const char *, va_list);
     133
     134extern int sprintf(char *, const char *, ...)
     135    __attribute__((deprecated)) _HELENOS_PRINTF_ATTRIBUTE(2, 3);
     136extern int vsprintf(char *, const char *, va_list) __attribute__((deprecated));
    109137
    110138/* Formatted input */
     
    124152extern size_t fwrite(const void *, size_t, size_t, FILE *);
    125153
     154extern int fgetpos(FILE *, fpos_t *);
     155extern int fsetpos(FILE *, const fpos_t *);
     156
    126157extern int fseek(FILE *, long, int);
    127158extern void rewind(FILE *);
     
    133164extern void clearerr(FILE *);
    134165
     166extern void perror(const char *);
     167
    135168extern void setvbuf(FILE *, void *, int, size_t);
    136169extern void setbuf(FILE *, void *);
    137170
    138171/* Misc file functions */
     172extern int remove(const char *);
    139173extern int rename(const char *, const char *);
    140 extern int remove(const char *);
    141 
    142 #ifndef _HELENOS_SOURCE
    143 #define _IONBF 0
    144 #define _IOLBF 1
    145 #define _IOFBF 2
    146 
    147 extern char *gets(char *, size_t);
    148 
    149 #endif
     174
     175extern FILE *tmpfile(void);
     176extern char *tmpnam(char *s) __attribute__((deprecated));
    150177
    151178#ifdef _HELENOS_SOURCE
Note: See TracChangeset for help on using the changeset viewer.