Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3193

Show
Ignore:
Timestamp:
02/15/08 15:37:25 (8 months ago)
Author:
larsivi
Message:

support for freebsd, thanks Ralith, refs #896

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/stdc/stdio.d

    r3187 r3193  
    6666else version ( freebsd ) 
    6767{ 
    68  
     68    const int EOF           = -1; 
     69    const int FOPEN_MAX     = 20; 
     70    const int FILENAME_MAX  = 1024; 
     71    const int TMP_MAX       = 308915776; 
     72    const int L_tmpnam      = 1024; 
     73 
     74    private 
     75    { 
     76        struct __sbuf 
     77        { 
     78            ubyte *_base; 
     79            int _size; 
     80        } 
     81        struct __sFILEX 
     82        { 
     83        } 
     84    } 
    6985} 
    7086else 
     
    144160        fpos_t    _offset; 
    145161    } 
     162    else version( freebsd ) 
     163    { 
     164        ubyte*    _p; 
     165        int       _r; 
     166        int       _w; 
     167        short     _flags; 
     168        short     _file; 
     169        __sbuf    _bf; 
     170        int       _lbfsize; 
     171 
     172        void* function()                        _cookie; 
     173        int* function(void*)                    _close; 
     174        int* function(void*, char*, int)        _read; 
     175        fpos_t* function(void*, fpos_t, int)    _seek; 
     176        int* function(void*, char *, int)       _write; 
     177 
     178        __sbuf    _ub; 
     179        __sFILEX* _extra; 
     180        int       _ur; 
     181 
     182        ubyte[3]  _ubuf; 
     183        ubyte[1]  _nbuf; 
     184 
     185        __sbuf    _lb; 
     186 
     187        int       _blksize; 
     188        fpos_t    _offset; 
     189    } 
     190    else 
     191    { 
     192        static assert( false ); 
     193    } 
    146194} 
    147195 
     
    229277    const FILE* stderr = &__sF[2]; 
    230278} 
     279else version( freebsd ) 
     280{ 
     281    extern FILE[3] __sF; 
     282    const FILE* stdin  = &__sF[0]; 
     283    const FILE* stdout = &__sF[1]; 
     284    const FILE* stderr = &__sF[2]; 
     285} 
    231286else 
    232287{ 
     
    327382    int  vsnprintf(char*, size_t, char*, va_list); 
    328383} 
     384else version( freebsd ) 
     385{ 
     386    void rewind(FILE*); 
     387    void clearerr(FILE*); 
     388    int  feof(FILE*); 
     389    int  ferror(FILE*); 
     390    int  fileno(FILE*); 
     391 
     392    int  snprintf(char*, size_t, char*, ...); 
     393    int  vsnprintf(char*, size_t, char*, va_list); 
     394} 
    329395else 
    330396{