Changeset 32b3a12 in mainline


Ignore:
Timestamp:
2012-09-07T14:27:25Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b800b0e, d948095
Parents:
baeeee2
Message:

libposix: even less includes from libc

Location:
uspace
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/msim/arch_helenos/input.c

    rbaeeee2 r32b3a12  
    3232/** @file HelenOS specific functions for MSIM simulator.
    3333 */
     34
     35/* Because of asprintf. */
     36#define _GNU_SOURCE
    3437#include "../../io/input.h"
    3538#include "../../io/output.h"
  • uspace/lib/posix/include/posix/stdio.h

    rbaeeee2 r32b3a12  
    3939#include "stddef.h"
    4040#include "unistd.h"
    41 #include "libc/stdio.h"
     41#include "libc/io/verify.h"
    4242#include "sys/types.h"
    4343#include "stdarg.h"
    4444#include "limits.h"
     45
     46/*
     47 * These are the same as in HelenOS libc.
     48 * It would be possible to directly include <stdio.h> but
     49 * it is better not to pollute POSIX namespace with other functions
     50 * defined in that header.
     51 *
     52 * Because libposix is always linked with libc, providing only these
     53 * forward declarations ought to be enough.
     54 */
     55#define EOF (-1)
     56
     57#define BUFSIZ  4096
     58#define SEEK_SET  0
     59#define SEEK_CUR  1
     60#define SEEK_END  2
     61
     62typedef struct _IO_FILE FILE;
     63
     64extern FILE *stdin;
     65extern FILE *stdout;
     66extern FILE *stderr;
     67
     68extern int fgetc(FILE *);
     69extern char *fgets(char *, int, FILE *);
     70
     71extern int getchar(void);
     72extern char *gets(char *, size_t);
     73
     74extern int fputc(wchar_t, FILE *);
     75extern int fputs(const char *, FILE *);
     76
     77extern int putchar(wchar_t);
     78extern int puts(const char *);
     79
     80extern int fprintf(FILE *, const char*, ...) PRINTF_ATTRIBUTE(2, 3);
     81extern int vfprintf(FILE *, const char *, va_list);
     82
     83extern int printf(const char *, ...) PRINTF_ATTRIBUTE(1, 2);
     84extern int vprintf(const char *, va_list);
     85
     86extern int snprintf(char *, size_t , const char *, ...) PRINTF_ATTRIBUTE(3, 4);
     87#ifdef _GNU_SOURCE
     88extern int asprintf(char **, const char *, ...) PRINTF_ATTRIBUTE(2, 3);
     89#endif
     90extern int vsnprintf(char *, size_t, const char *, va_list);
     91
     92extern FILE *fopen(const char *, const char *);
     93extern FILE *fdopen(int, const char *);
     94extern int fclose(FILE *);
     95
     96extern size_t fread(void *, size_t, size_t, FILE *);
     97extern size_t fwrite(const void *, size_t, size_t, FILE *);
     98
     99extern int fseek(FILE *, off64_t, int);
     100extern void rewind(FILE *);
     101extern off64_t ftell(FILE *);
     102extern int feof(FILE *);
     103extern int fileno(FILE *);
     104
     105extern int fflush(FILE *);
     106extern int ferror(FILE *);
     107extern void clearerr(FILE *);
     108
     109extern void setvbuf(FILE *, void *, int, size_t);
     110
     111
     112/* POSIX specific stuff. */
    45113
    46114/* Identifying the Terminal */
  • uspace/lib/posix/include/posix/string.h

    rbaeeee2 r32b3a12  
    3737#define POSIX_STRING_H_
    3838
    39 #include <mem.h>
    40 #include <str.h>
     39#include "sys/types.h"
    4140
    42 /* available in str.h
    43  *
    44  * char *strtok(char *restrict, const char *restrict);
    45  * char *strtok_r(char *restrict, const char *restrict, char **restrict);
    46  *
    47  * available in mem.h
    48  *
    49  * void *memset(void *, int, size_t);
    50  * void *memcpy(void *, const void *, size_t);
    51  * void *memmove(void *, const void *, size_t);
    52  *
     41/*
    5342 * TODO: not implemented due to missing locale support
    5443 *
     
    6150        #define NULL  ((void *) 0)
    6251#endif
     52
     53/*
     54 * These are the same as in HelenOS libc.
     55 * It would be possible to directly include <str.h> and <mem.h> but
     56 * it is better not to pollute POSIX namespace with other functions
     57 * defined in that header.
     58 *
     59 * Because libposix is always linked with libc, providing only these
     60 * forward declarations ought to be enough.
     61 */
     62/* From str.h. */
     63extern char * strtok_r(char *, const char *, char **);
     64extern char * strtok(char *, const char *);
     65
     66/* From mem.h */
     67#define bzero(ptr, len)  memset((ptr), 0, (len))
     68extern void *memset(void *, int, size_t);
     69extern void *memcpy(void *, const void *, size_t);
     70extern void *memmove(void *, const void *, size_t);
     71
    6372
    6473/* Copying and Concatenation */
  • uspace/lib/posix/source/pwd.c

    rbaeeee2 r32b3a12  
    3535#define LIBPOSIX_INTERNAL
    3636
     37#include "posix/stdbool.h"
    3738#include "posix/pwd.h"
    3839#include "posix/string.h"
  • uspace/lib/posix/source/stdio.c

    rbaeeee2 r32b3a12  
    4949#include "posix/unistd.h"
    5050
     51#include "libc/stdio.h"
    5152#include "libc/io/printf_core.h"
    5253#include "libc/str.h"
Note: See TracChangeset for help on using the changeset viewer.