亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? stream.inl

?? eCos/RedBoot for勤研ARM AnywhereII(4510) 含全部源代碼
?? INL
字號(hào):
#ifndef CYGONCE_LIBC_STDIO_STREAM_INL
#define CYGONCE_LIBC_STDIO_STREAM_INL
//========================================================================
//
//      stream.inl
//
//      Inline functions for internal C library stdio stream interface
//
//========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s):     jlarmour
// Contributors:  
// Date:          2000-04-19
// Purpose:     
// Description: 
// Usage:         Do not include this file -
//                #include <cyg/libc/stdio/stream.hxx> instead.
//
//####DESCRIPTIONEND####
//
//========================================================================

// CONFIGURATION

#include <pkgconf/libc_stdio.h>    // Configuration header

// INCLUDES

#include <cyg/infra/cyg_type.h>    // Common project-wide type definitions
#include <stddef.h>                // NULL and size_t from compiler
#include <errno.h>                 // Error codes
#include <cyg/libc/stdio/stream.hxx> // Just be sure that this really is
                                   // included

#include <cyg/libc/stdio/io.inl>     // I/O system inlines

// FUNCTIONS

#ifdef CYGDBG_USE_ASSERTS
inline cyg_bool
Cyg_StdioStream::check_this( cyg_assert_class_zeal zeal ) const
{
    // check that it has the magic word set meaning it is valid.
    if ( magic_validity_word != 0x7b4321ce )
        return false;
    return true;
} // check_this()

#endif // ifdef CYGDBG_USE_ASSERTS



// LOCKING FUNCTIONS

// returns true on success
inline cyg_bool
Cyg_StdioStream::lock_me( void )
{
    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS
    return stream_lock.lock();
#else
    // otherwise it "worked"
    return true;
#endif
    
} // lock_me()


// returns true on success
inline cyg_bool
Cyg_StdioStream::trylock_me( void )
{
    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS
    return stream_lock.trylock();
#else
    // otherwise it "worked"
    return true;
#endif
    
} // lock_me()


inline void
Cyg_StdioStream::unlock_me( void )
{
    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
#ifdef CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS
    stream_lock.unlock();
#endif
} // unlock_me()


// DESTRUCTOR

inline Cyg_ErrNo
Cyg_StdioStream::close()
{
    Cyg_ErrNo err = ENOERR;
    
    if (!lock_me())
        return EBADF;

    if( my_device != CYG_STDIO_HANDLE_NULL )
    {
        flush_output_unlocked();

        err = cyg_stdio_close( my_device );
    
        if( err == ENOERR )
            my_device = CYG_STDIO_HANDLE_NULL;
    }
    
    unlock_me();
    
    return err;
} // close()

inline
Cyg_StdioStream::~Cyg_StdioStream()
{
    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );

    // Close the device if it has not already been closed.
    if( my_device != CYG_STDIO_HANDLE_NULL )
        close();
    
#ifdef CYGDBG_USE_ASSERTS
    magic_validity_word = 0xbadbad;
#endif
} // Cyg_StdioStream destructor


// MEMBER FUNCTIONS


// this is currently just a wrapper around write, but having this interface
// leaves scope for optimisations in future
inline Cyg_ErrNo
Cyg_StdioStream::write_byte( cyg_uint8 c )
{
    cyg_ucount32 dummy_bytes_written;
    Cyg_ErrNo err;

    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
    err = write( &c, 1, &dummy_bytes_written );

    CYG_ASSERT( (err!=ENOERR) || (dummy_bytes_written==1),
                "Single byte not written, but no error returned!" );

    return err;
} // write_byte()


inline Cyg_ErrNo
Cyg_StdioStream::unread_byte( cyg_uint8 c )
{
    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
#ifdef CYGFUN_LIBC_STDIO_ungetc
    if (!lock_me())
        return EBADF;  // assume file is now invalid

    if (flags.unread_char_buf_in_use) {
        unlock_me();
        return ENOMEM;
    } // if

    flags.unread_char_buf_in_use = true;
    unread_char_buf = c;

    // can't be at EOF any more
    flags.at_eof = false;

    if (position)    // position is always 0 for certain devices
        --position;
    
    unlock_me();

    return ENOERR;

#else // ifdef CYGFUN_LIBC_STDIO_ungetc

    return ENOSYS;
#endif // ifdef CYGFUN_LIBC_STDIO_ungetc
} // unread_byte()


inline cyg_ucount32
Cyg_StdioStream::bytes_available_to_read( void )
{
    cyg_ucount32 bytes=0;

    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
#ifdef CYGFUN_LIBC_STDIO_ungetc
    if (flags.unread_char_buf_in_use)
        ++bytes;
#endif 

#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO

    // either the last operation was a read, which attempted to read bytes
    // into the buffer, or there are no bytes in the buffer

    if (flags.buffering) {
        if (flags.last_buffer_op_was_read == true)
            bytes += io_buf.get_buffer_space_used();
    }
    else

#endif

    if (flags.readbuf_char_in_use)
        ++bytes;

    return bytes;
} // bytes_available_to_read()



inline Cyg_ErrNo
Cyg_StdioStream::flush_output( void )
{
    Cyg_ErrNo err;

    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
    if (!lock_me())
        return EBADF;  // assume file is now invalid
    
    err = flush_output_unlocked();

    unlock_me();
  
    return err;
} // flush_output()


// get error status for this file
inline Cyg_ErrNo
Cyg_StdioStream::get_error( void )
{
    Cyg_ErrNo err_temp;
    
    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
    if (!lock_me())
        return EBADF;     // well, we've certainly got an error now!
    
    err_temp = error;

    unlock_me();

    return err_temp;
} // get_error()


// set error status for this file
inline void
Cyg_StdioStream::set_error( Cyg_ErrNo errno_to_set )
{
    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
    if (!lock_me())
    {
        errno = EBADF; // best we can do - we can't trust error to be there
        return;
    } // if
    
    errno = error = errno_to_set;

    if ( EEOF == error )
        flags.at_eof = 1;

    unlock_me();
} // set_error()


// are we at EOF? true means we are, false means no
inline cyg_bool
Cyg_StdioStream::get_eof_state( void )
{
    cyg_bool eof_temp;

    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
    if (!lock_me())
        return false;     // not much we can do here
    
    eof_temp = flags.at_eof;

    unlock_me();
    
    return eof_temp;
} // get_eof_state()


// Set whether we are at EOF.
inline void
Cyg_StdioStream::set_eof_state( cyg_bool eof_to_set )
{
    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
    if (!lock_me())
        return;     // not much we can do here
    
    flags.at_eof = eof_to_set;

    unlock_me();
} // set_eof_state()


// retrieve position
inline Cyg_ErrNo
Cyg_StdioStream::get_position( fpos_t *pos )
{
    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
    if (!lock_me())
        return EBADF; // assume file is now invalid

    *pos = position;

    unlock_me();

    return ENOERR;

} // get_position()


// set absolute position
inline Cyg_ErrNo
Cyg_StdioStream::set_position( fpos_t pos, int whence )
{
    CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
    
#ifndef CYGPKG_LIBC_STDIO_FILEIO    
    // this is currently a workaround until we have real files
    // this will be corrected when we decide the true filesystem interface

    Cyg_ErrNo err;
    cyg_uint8 c;

    if ((whence != SEEK_CUR) || pos < 0)
        return ENOSYS;

    if (!lock_me())
        return EBADF; // assume file is now invalid

    // Drain read buffer
    
    for ( ; pos > 0 ; pos-- ) {
        err = read_byte( &c );
        if (err == EAGAIN)
            err=refill_read_buffer();

        // if read_byte retured error, or refill_read_buffer returned error
        if (err) {
            unlock_me();
            return err;
        } // if
    } // for

    unlock_me();

    return ENOERR;
    
#else

    if (!lock_me())
        return EBADF; // assume file is now invalid

    if ( whence != SEEK_END ) {
        off_t bytesavail = (off_t)bytes_available_to_read();
        off_t abspos = (whence == SEEK_CUR) ? position + pos : pos;
        off_t posdiff = abspos - position;

        if ( posdiff >= 0 && bytesavail > posdiff ) {
            // can just "seek" within the existing buffer
#ifdef CYGFUN_LIBC_STDIO_ungetc
            if (posdiff>0 && flags.unread_char_buf_in_use) {
                flags.unread_char_buf_in_use = false;
                posdiff--;
            }
#endif
#ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO
            if (posdiff>0 && flags.buffering) {
                io_buf.set_bytes_read(posdiff);
                posdiff=0;
            } else 
#endif
            if (posdiff>0 && flags.readbuf_char_in_use) {
                flags.readbuf_char_in_use = false;
                posdiff--;
            }
            CYG_ASSERT(posdiff==0, "Failed to seek within buffer correctly");

            position = abspos;
            unlock_me();
            return ENOERR;
        } // endif (bytesavail > posdiff)

        if (whence == SEEK_CUR) {
            position += bytesavail;
        }
    } //endif (whence != SEEK_END)

    Cyg_ErrNo err;

    // Flush output if any present.
    err = flush_output_unlocked();

    if( err == ENOERR )
    {
        off_t newpos=pos;
 
        // Clear any input out of input buffer and any ungot chars
        // from unread buffer.
        io_buf.drain_buffer();
    
#ifdef CYGFUN_LIBC_STDIO_ungetc
        flags.unread_char_buf_in_use = false;
#endif

        // Clear EOF indicator.
        flags.at_eof = false;

        // Seek the file to the correct place
        err = cyg_stdio_lseek( my_device, &newpos, whence );
       
        if ( err == ENOERR) {
          // update stream pos
          position = newpos;
        }
    }
    
    unlock_me();

    return err;
#endif    
    
} // set_position()


#endif // CYGONCE_LIBC_STDIO_STREAM_INL multiple inclusion protection

// EOF stream.inl

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本v片在线高清不卡在线观看| 亚洲午夜久久久久久久久久久| 成年人午夜久久久| 亚洲一区二区三区四区在线| 久久久无码精品亚洲日韩按摩| 色菇凉天天综合网| 国产成人aaa| 婷婷开心激情综合| 亚洲婷婷综合久久一本伊一区| 日韩欧美中文字幕精品| 欧美系列日韩一区| 成人成人成人在线视频| 久久99精品久久久久久久久久久久 | 成人av免费网站| 美女视频黄频大全不卡视频在线播放| 中文字幕在线不卡一区二区三区| 欧美mv日韩mv国产网站| 欧美久久久久久久久| 色综合久久久久久久久| 成人av综合在线| 国产精品一二三区在线| 久久99国产精品免费| 三级久久三级久久| 亚洲国产成人高清精品| 亚洲老司机在线| 国产精品传媒入口麻豆| 国产免费久久精品| 亚洲18女电影在线观看| 亚洲欧美激情一区二区| 国产精品天美传媒沈樵| 久久久精品tv| 久久久综合精品| 久久久亚洲精品石原莉奈 | 精品国产亚洲在线| 欧美一区二区不卡视频| 欧美精品一二三| 在线播放中文字幕一区| 欧美伦理影视网| 欧美精品v日韩精品v韩国精品v| 欧美三级在线播放| 欧美日韩国产精选| 91精品中文字幕一区二区三区| 欧美色窝79yyyycom| 欧美日韩一区二区三区免费看 | 欧美日韩一本到| 欧美亚日韩国产aⅴ精品中极品| 91黄色免费观看| 欧美午夜影院一区| 欧美精品黑人性xxxx| 欧美精品一二三| 欧美tickle裸体挠脚心vk| 精品久久国产字幕高潮| 国产丝袜在线精品| 国产精品久久久久久久久免费樱桃| 中文字幕综合网| 一区二区三区四区蜜桃| 性做久久久久久久免费看| 视频一区国产视频| 另类欧美日韩国产在线| 国产精华液一区二区三区| 成人综合婷婷国产精品久久免费| 成人动漫av在线| 欧美丝袜丝交足nylons图片| 欧美精品日日鲁夜夜添| 欧美精品一区二区三区四区 | 久久久久久久久久久电影| 日本一区二区三区高清不卡 | 亚洲精品国产精品乱码不99| 一级中文字幕一区二区| 免费在线观看日韩欧美| 国产精品亚洲午夜一区二区三区| 99久久综合99久久综合网站| 欧美视频在线观看一区二区| 日韩欧美美女一区二区三区| 欧美国产视频在线| 亚洲成人黄色小说| 国产一区二区成人久久免费影院| 99在线视频精品| 91精品麻豆日日躁夜夜躁| 欧美精品一区二区三区四区| 亚洲另类中文字| 极品少妇xxxx精品少妇| av一区二区三区| 欧美一区二区三区免费大片| 国产精品亲子伦对白| 午夜天堂影视香蕉久久| 国产精品乡下勾搭老头1| 色婷婷综合久久久中文字幕| 精品国产3级a| 亚洲与欧洲av电影| 国产成人精品网址| 欧美精品视频www在线观看 | 美女脱光内衣内裤视频久久影院| 国产91精品露脸国语对白| 欧美另类一区二区三区| 国产精品三级在线观看| 免费在线观看一区| 色婷婷av久久久久久久| 日韩欧美国产小视频| 一区二区日韩av| 国产suv一区二区三区88区| 欧美精品xxxxbbbb| 亚洲乱码中文字幕| 国产精品66部| 日韩精品一区二区三区在线| 一区二区三区高清在线| 成人激情图片网| 久久亚洲精品国产精品紫薇| 日韩国产在线一| 欧洲精品一区二区| 国产精品区一区二区三区| 国产在线视视频有精品| 在线不卡中文字幕播放| 洋洋成人永久网站入口| 成人h动漫精品一区二区| 久久综合国产精品| 免费成人av在线播放| 欧美日韩一区高清| 一区二区三区在线播放| 99久久亚洲一区二区三区青草| 欧美精品一区男女天堂| 捆绑调教美女网站视频一区| 欧美精品日韩一区| 亚洲va韩国va欧美va精品| 色综合婷婷久久| 亚洲同性同志一二三专区| 成人午夜免费av| 欧美高清在线视频| 国产精品亚洲人在线观看| 精品国产一区二区三区忘忧草| 日韩av中文字幕一区二区三区| 精品国产乱码久久久久久影片| 轻轻草成人在线| 日韩欧美一级在线播放| 蜜臀精品一区二区三区在线观看 | 欧美性色综合网| 一区二区三国产精华液| 在线看不卡av| 五月天激情小说综合| 欧美精品日韩一区| 六月婷婷色综合| 精品国产露脸精彩对白| 国产麻豆日韩欧美久久| 精品国产乱码久久久久久免费| 精品在线你懂的| 国产午夜三级一区二区三| 国产高清视频一区| 国产精品久久久久国产精品日日| av动漫一区二区| 一区二区三区色| 欧美人与z0zoxxxx视频| 免费在线观看一区二区三区| 精品粉嫩超白一线天av| 国产福利一区二区三区在线视频| 欧美国产一区二区| 色综合视频一区二区三区高清| 亚洲国产中文字幕在线视频综合| 欧美日韩国产高清一区二区三区| 日本午夜一本久久久综合| 2024国产精品| 97久久人人超碰| 午夜精品福利视频网站| 亚洲精品一区二区三区蜜桃下载 | 日本午夜一本久久久综合| 精品捆绑美女sm三区| 国产成a人亚洲精品| 亚洲制服丝袜一区| 日韩欧美国产一区二区三区 | 91.麻豆视频| 国产专区欧美精品| 亚洲欧美电影一区二区| 欧美一区二区精品| 东方aⅴ免费观看久久av| 亚洲综合在线视频| 欧美mv日韩mv亚洲| 一本色道久久综合亚洲精品按摩| 婷婷六月综合网| 国产精品美女久久久久aⅴ国产馆| 欧美在线视频全部完| 国产一区二区在线电影| 一区二区三区影院| 久久综合狠狠综合久久综合88| 91色|porny| 久久99精品国产麻豆婷婷| 亚洲人成在线观看一区二区| 日韩欧美激情一区| 91福利国产成人精品照片| 麻豆国产欧美日韩综合精品二区| 亚洲四区在线观看| 欧美tickle裸体挠脚心vk| 欧亚洲嫩模精品一区三区| 国产乱子伦视频一区二区三区| 亚洲国产综合91精品麻豆 | 肉色丝袜一区二区| 国产精品国产三级国产三级人妇| 日韩一区二区三区视频在线观看 | 99视频精品在线| 久久超碰97中文字幕| 亚洲一区在线播放| 国产精品毛片久久久久久久|