当前位置: 首页>>代码示例>>C++>>正文


C++ TINY_INFO函数代码示例

本文整理汇总了C++中TINY_INFO函数的典型用法代码示例。如果您正苦于以下问题:C++ TINY_INFO函数的具体用法?C++ TINY_INFO怎么用?C++ TINY_INFO使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了TINY_INFO函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TouchFile

RET_T TouchFile( const char *name )
/****************************************/
{
    tiny_date_t     dt;
    tiny_time_t     tm;
    tiny_ftime_t    p_hms;
    tiny_fdate_t    p_ymd;
    tiny_ret_t      ret;

    ret = TinyOpen( name, TIO_WRITE );
    if( TINY_OK( ret ) ) {
        dt = TinyGetDate();
        p_ymd.year  = dt.year + (1900 - 1980);
        p_ymd.month = dt.month;
        p_ymd.day   = dt.day_of_month;

        tm = TinyGetTime();
        p_hms.hours   = tm.hour;
        p_hms.minutes = tm.minutes;
        p_hms.twosecs = tm.seconds / 2;

        TinySetFileStamp( TINY_INFO( ret ), p_hms, p_ymd );
        TinyClose( TINY_INFO( ret ) );
    } else {
        ret = TinyCreate( name, TIO_NORMAL );
        if( TINY_OK( ret ) ) {
            TinyClose( TINY_INFO( ret ) );
        } else {
            return( RET_ERROR );
        }
    }
    return( RET_SUCCESS );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:33,代码来源:msysdep.c

示例2: LocalOpen

sys_handle LocalOpen( const char *name, open_access access )
{
    tiny_ret_t  ret;
    unsigned    mode;

    if( (access & OP_WRITE) == 0 ) {
        mode = TIO_READ;
        access &= ~(OP_CREATE|OP_TRUNC);
    } else if( access & OP_READ ) {
        mode = TIO_READ_WRITE;
    } else {
        mode = TIO_WRITE;
    }
    if( access & (OP_CREATE|OP_TRUNC) ) {
        ret = TinyCreate( name, TIO_NORMAL );
    } else {
        if( _osmajor >= 3 ) mode |= 0x80; /* set no inheritance */
        ret = TinyOpen( name, mode );
    }
    if( TINY_ERROR( ret ) ) {
        StashErrCode( TINY_INFO( ret ), OP_LOCAL );
        return( NIL_SYS_HANDLE );
    }
    return( TINY_INFO( ret ) );
}
开发者ID:NoSuchProcess,项目名称:open-watcom-v2,代码行数:25,代码来源:winfilio.c

示例3: LocalRead

size_t LocalRead( sys_handle filehndl, void *ptr, size_t len )
{
    tiny_ret_t  ret;
    size_t      total;
    unsigned    piece_len;
    unsigned    read_len;

    piece_len = INT_MAX;
    total = 0;
    while( len > 0 ) {
        if( piece_len > len )
            piece_len = (unsigned)len;
        ret = TinyRead( filehndl, ptr, piece_len );
        if( TINY_ERROR( ret ) ) {
            StashErrCode( TINY_INFO( ret ), OP_LOCAL );
            return( ERR_RETURN );
        }
        read_len = TINY_INFO( ret );
        total += read_len;
        if( read_len != piece_len )
            break;
        ptr = (char *)ptr + read_len;
        len -= read_len;
    }
    return( total );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:26,代码来源:dosfilio.c

示例4: QOpenRW

f_handle QOpenRW( char *name )
/***********************************/
{
    tiny_ret_t h;

    h = DoOpen( name, TRUE, TIO_NORMAL );
    if( TINY_OK( h ) ) return( (f_handle)TINY_INFO( h ) );
    LnkMsg( FTL+MSG_CANT_OPEN, "12", name, QErrMsg( TINY_INFO( h ) ) );
    return( NIL_HANDLE );
}
开发者ID:JWasm,项目名称:JWlink,代码行数:10,代码来源:linkio.c

示例5: ExeCreate

f_handle ExeCreate( char *name )
/*************************************/
{
    tiny_ret_t      h;

    h = DoOpen( name, TRUE, TIO_NORMAL );
    LastResult = TINY_INFO( h );
    if( TINY_OK( h ) ) return( TINY_INFO( h ) );
    return( NIL_HANDLE );
}
开发者ID:JWasm,项目名称:JWlink,代码行数:10,代码来源:linkio.c

示例6: NSOpen

static f_handle NSOpen( char *name, unsigned mode )
/*************************************************/
{
    tiny_ret_t       h;

    h = DoOpen( name, FALSE, mode );
    LastResult = TINY_INFO( h );
    if( TINY_OK( h ) ) return( TINY_INFO( h ) );
    return( NIL_HANDLE );
}
开发者ID:JWasm,项目名称:JWlink,代码行数:10,代码来源:linkio.c

示例7: LocalWrite

unsigned LocalWrite( sys_handle filehndl, const void *ptr, unsigned len )
{
    tiny_ret_t  ret;

    ret = TinyWrite( filehndl, ptr, len );
    if( TINY_ERROR( ret ) ) {
        StashErrCode( TINY_INFO( ret ), OP_LOCAL );
        return( ERR_RETURN );
    }
    return( TINY_INFO( ret ) );
}
开发者ID:NoSuchProcess,项目名称:open-watcom-v2,代码行数:11,代码来源:winfilio.c

示例8: QDelete

void QDelete( char *name )
/*******************************/
{
    tiny_ret_t   h;

    if( name == NULL ) return;
    h = TinyDelete( name );
    if( TINY_ERROR( h ) ) {
        if( TINY_INFO( h ) != 2 ) {  /* file not found is OK */
            LnkMsg( ERR+MSG_IO_PROBLEM, "12", name, QErrMsg( TINY_INFO( h ) ) );
        }
    }
}
开发者ID:JWasm,项目名称:JWlink,代码行数:13,代码来源:linkio.c

示例9: __F_NAME

_WCRTLINK int __F_NAME(mkdir,_wmkdir)( const CHAR_TYPE *path )
/************************************************************/
{
#ifdef __WIDECHAR__
    size_t              rcConvert;
    char                mbcsPath[MB_CUR_MAX * _MAX_PATH];
    unsigned char       *p;

    /*** Convert the wide character string to a multibyte string ***/
    rcConvert = wcstombs( mbcsPath, path, sizeof( mbcsPath ) );
    p = _mbsninc( (unsigned char *)mbcsPath, rcConvert );
    *p = '\0';
    return( mkdir( mbcsPath ) );
#else
  #ifdef __WATCOM_LFN__
    tiny_ret_t  rc = 0;

    if( _RWD_uselfn && TINY_OK( rc = _mkdir_lfn( path ) ) ) {
        return( 0 );
    }
    if( IS_LFN_ERROR( rc ) ) {
        return( __set_errno_dos( TINY_INFO( rc ) ) );
    }
  #endif
    return( __mkdir_sfn( path ) );
#endif
}
开发者ID:Graham-stott,项目名称:open-watcom-v2,代码行数:27,代码来源:mkdir.c

示例10: _dos_open

_WCRTLINK unsigned _dos_open( const char *path, unsigned mode, int *handle )
/**************************************************************************/
{
#ifdef __WATCOM_LFN__
    tiny_ret_t  rc = 0;

    if( _RWD_uselfn && TINY_OK( rc = __dos_open_lfn( path, mode ) ) ) {
        *handle = TINY_INFO( rc );
        return( 0 );
    }
    if( IS_LFN_ERROR( rc ) ) {
        return( __set_errno_dos_reterr( TINY_INFO( rc ) ) );
    }
#endif
    return( __dos_open_sfn_err( path, mode, handle ) );
}
开发者ID:Graham-stott,项目名称:open-watcom-v2,代码行数:16,代码来源:opendos.c

示例11: __lseek

_WCRTLINK long __lseek( int handle, long offset, int origin )
{
    long            pos;

    __handle_check( handle, -1 );

#if defined( __OS2__ )
    {
        APIRET          rc;

        rc = DosChgFilePtr( handle, offset, origin, (PULONG)&pos );
        if( rc != 0 ) {
            return( __set_errno_dos( rc ) );
        }
    }
#elif defined( __NT__ )
    pos = SetFilePointer( __getOSHandle( handle ), offset, 0, origin );
    if( pos == INVALID_SET_FILE_POINTER ) {
        return( __set_errno_nt() );
    }
#elif defined( __DOS__ ) || defined( __WINDOWS__ )
    {
        tiny_ret_t      rc;

        rc = TinyLSeek( handle, offset, origin, (u32_stk_ptr)&pos );
        if( TINY_ERROR( rc ) ) {
            return( __set_errno_dos( TINY_INFO( rc ) ) );
        }
    }
#endif
    return( pos );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:32,代码来源:__lseek.c

示例12: _dos_findnext

_WCRTLINK unsigned _dos_findnext( struct find_t *buf ) {
/*****************************************************/

#if defined(__OS2_286__)
    if( _RWD_osmode == OS2_MODE ) {        /* protected mode */
#endif
        APIRET  rc;

        FF_BUFFER       dir_buff;
        OS_UINT         searchcount = 1;

        rc = DosFindNext( FIND_HANDLE_OF( buf ), (PVOID)&dir_buff,
                    sizeof( dir_buff ), &searchcount );
        if( rc != 0 ) {
            return( __set_errno_dos_reterr( rc ) );
        }

        copydir( buf, &dir_buff );

#if defined(__OS2_286__)
    } else {            /* real mode */
        tiny_ret_t      rc;
        void __far *    old_dta;

        old_dta = TinyFarChangeDTA( buf );  /* set our DTA */
        rc = TinyFindNext();
        TinyFarSetDTA( old_dta );           /* restore DTA */
        if( TINY_ERROR( rc ) ) {
            return( __set_errno_dos_reterr( TINY_INFO( rc ) ) );
        }
    }
#endif
    return( 0 );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:34,代码来源:findos2.c

示例13: __FreeSeg

int __FreeSeg( __segment seg )
{
#if defined(__QNX__)
    if( qnx_segment_free( seg ) == -1 ) {
        return( -1 );
    }
#elif defined(__WINDOWS__)
    if( __DoFreeSeg( seg ) ) {
        return( -1 );
    }
#elif defined(__OS2__)
    APIRET  rc;

    rc = __DoFreeSeg( seg );
    if( rc ) {
        return( __set_errno_dos( rc ) );
    }
#else
    tiny_ret_t rc;

    rc = TinyFreeBlock( seg );
    if( TINY_ERROR( rc ) ) {
        return( __set_errno_dos( TINY_INFO( rc ) ) );
    }
#endif
    return( 0 );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:27,代码来源:freeseg.c

示例14: ReqFile_run_cmd

trap_retval ReqFile_run_cmd( void )
{
    file_run_cmd_ret    *ret;
#if defined(__WINDOWS__)

    ret = GetOutPtr( 0 );
    ret->err = 0;
#else
    bool                chk;
    char                buff[64];
    file_run_cmd_req    *acc;
    unsigned            len;
    tiny_ret_t          rc;

    acc = GetInPtr( 0 );
    len = GetTotalSize() - sizeof( *acc );
    ret = GetOutPtr( 0 );

    chk = CheckPointMem( acc->chk_size, buff );
    rc = Fork( (char *)GetInPtr( sizeof(*acc) ), len );
    ret->err = TINY_ERROR( rc ) ? TINY_INFO( rc ) : 0;
    if( chk ) CheckPointRestore();
#endif
    return( sizeof( *ret ) );
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:25,代码来源:dosfile.c

示例15: ReqFile_string_to_fullpath

trap_retval ReqFile_string_to_fullpath( void )
{
    char                        *name;
    char                        *fullname;
    char                        *ext_list;
    file_string_to_fullpath_req *acc;
    file_string_to_fullpath_ret *ret;
    tiny_ret_t                  rc;

    acc = GetInPtr( 0 );
    name = GetInPtr( sizeof( *acc ) );
    ret = GetOutPtr( 0 );
    fullname = GetOutPtr( sizeof( *ret ) );
    if( acc->file_type == TF_TYPE_EXE ) {
        ext_list = GetExeExtensions();
    } else {
        ext_list = "";
    }
    rc = FindFilePath( name, fullname, ext_list );
    if( TINY_OK( rc ) ) {
        ret->err = 0;
    } else {
        ret->err = TINY_INFO( rc );
        *fullname = '\0';
    }
    return( sizeof( *ret ) + 1 + strlen( fullname ) );
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:27,代码来源:dosfile.c


注:本文中的TINY_INFO函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。