コード例 #1
0
STATIC char *getCurlPath( void )
/*******************************
 * get the path between  { and }
 */
{
    STRM_T  s;
    char    path[_MAX_PATH + 1];
    int     pos;

    pos = 0;

    s = PreGetCH();

    if( s == L_CURL_PAREN ) {
        for( s = PreGetCH(); s != R_CURL_PAREN && s != EOL && pos < _MAX_PATH; s = PreGetCH() ) {
            path[pos++] = s;
        }
        path[pos] = NULLCHAR;
        if( s == EOL ) {
            UnGetCH( EOL );
            PrtMsg( ERR | LOC | NON_MATCHING_CURL_PAREN);
        } else if( pos == _MAX_PATH ) {
            PrtMsg( WRN | LOC | PATH_TOO_LONG );
        }
        return( StrDupSafe( path ) );

    } else {
        UnGetCH( s );
        return( "" );
    }
}
コード例 #2
0
ファイル: at83c26.c プロジェクト: shuishang/contact-driver
int AT83C26_Init(void)
{
    PrtMsg("welcome to entry the function: %s\n",__FUNCTION__);

    Reg_83C26_RESET = ioremap(GPIO13_12, 1);
    if(Reg_83C26_RESET == NULL)
    {
        PrtMsg("%s:IORemap register memory faild!!!\n",__FUNCTION__);
        goto err1;
    }
    PrtMsg("*Reg_83C26_RESET = %X\n", *Reg_83C26_RESET);
    Gpio_Init(Reg_83C26_RESET, MODE4_GPIO, PULLUPDOWNENABLE, DIREC_OUTPUT, OFFS_16);
    udelay(10);

    // config AT83C26 address at i2c bus
    Set_GPIO_Low(Reg_83C26_RESET, OFFS_16);
    udelay(160);
    Set_GPIO_High(Reg_83C26_RESET, OFFS_16);
    udelay(400);

    if(i2c_add_driver(&AT83C26_Driver))
    {
        PrtMsg("%s: Fail on AT83C26\n", __FUNCTION__);
        goto err2;
    }

    return (0);

err2:
    iounmap(Reg_83C26_RESET);
err1:
    iounmap(Reg_83c26_INT);
    return(-1);
}
コード例 #3
0
ファイル: at83c26.c プロジェクト: shuishang/contact-driver
int AT83C26_ReadCmd(int Cmd,  unsigned char *data, int size) 
{
    int ret;

    PrtMsg("%s with Cmd = %d\n", __FUNCTION__, Cmd);

    switch (Cmd)
    {
        case 1: if (i2c_master_send(AT83C26.client, "\xFC", 1) < 0) return(-1); break;
        case 2: if (i2c_master_send(AT83C26.client, "\xF8", 1) < 0) return(-1); break;
        case 3: if (i2c_master_send(AT83C26.client, "\xF9", 1) < 0) return(-1); break;
        case 4: if (i2c_master_send(AT83C26.client, "\xFA", 1) < 0) return(-1); break;
        case 5: if (i2c_master_send(AT83C26.client, "\xFB", 1) < 0) return(-1); break;
        case 6: if (i2c_master_send(AT83C26.client, "\xFD", 1) < 0) return(-1); break;
        case 7: if (i2c_master_send(AT83C26.client, "\xFE", 1) < 0) return(-1); break;
        case 8: if (i2c_master_send(AT83C26.client, "\xF7", 1) < 0) return(-1); break;
        default: return(-1);
    }
   
    ret = i2c_master_recv(AT83C26.client, (char*)data, (size > 12) ? 12 : size);
    if (ret<0)
    {
       PrtMsg("fail to receive the i2c data!\n");
       return(-1);
    }
    return(0);
}
コード例 #4
0
ファイル: mupdate.c プロジェクト: Azarien/open-watcom-v2
STATIC RET_T isOutOfDate( TARGET *targ, TARGET *deptarg, bool *outofdate )
/*************************************************************************
 * Checks if the current target is out of date
 */
{
    getDate( targ );
    if( targ->existing && targ->attr.existsonly ) {
        return( RET_SUCCESS );
    }
    getDate( deptarg );
    if( targ->existing && deptarg->existing && deptarg->attr.existsonly ) {
        return( RET_SUCCESS );
    }
    if( dateCmp( targ->date, deptarg->date ) < 0 ) {
        *outofdate = true;
        if( Glob.show_offenders ) {
            PrtMsg( INF | WILL_BE_BUILT_BECAUSE_OF,
                targ->node.name, deptarg->node.name);
        }
    }
    if( deptarg->error ) {
       /* one of the targets had an error while being updated
        * abort now
        */
        return( RET_ERROR );
    }
    if( (!deptarg->attr.recheck && deptarg->cmds_done) || deptarg->backdated ) {
        *outofdate = true;
    }
    return( RET_SUCCESS );
}
コード例 #5
0
ファイル: cmdline.c プロジェクト: ABratovic/open-watcom-v2
static void waitForKey( void ) {

    char                c;

    PrtMsg( MSG_PRESS_KEY );
    c = getch();
}
コード例 #6
0
ファイル: mlexmac.c プロジェクト: ABratovic/open-watcom-v2
STATIC TOKEN_T lexFormQualifier( TOKEN_T tok )
/*********************************************
 * pre:     $<file_specifier> read already; passed in tok
 * post:    1 character of input may be read
 * returns: tok; CurAttr.u.form contains enum FormQualifiers
 * errors:  If next character of input is not a form-qual. it is pushed back
 *          and CurAttr.u.form == FORM_FULL
 */
{
    STRM_T  s;

    s = PreGetCH();

    switch( s ) {
        case '@':   CurAttr.u.form = FORM_FULL;            break;
        case '*':   CurAttr.u.form = FORM_NOEXT;           break;
        case '&':   CurAttr.u.form = FORM_NOEXT_NOPATH;    break;
        case '.':   CurAttr.u.form = FORM_NOPATH;          break;
        case ':':   CurAttr.u.form = FORM_PATH;            break;
        case '!':   CurAttr.u.form = FORM_EXT;             break;
        default:
            PrtMsg( ERR | LOC | EXPECTING_M, M_FORM_QUALIFIER );
            UnGetCH( s );               /* put character back */
            CurAttr.u.form = FORM_FULL;   /* assume full name */
    }

    return( tok );
}
コード例 #7
0
ファイル: mstream.c プロジェクト: Ukusbobra/open-watcom-v2
STATIC void popSENT( void )
/**************************
 * pop top SENT off stack.  If necessary, close or free the apropriate things.
 */
{
    SENT    *tmp;

    assert( headSent != NULL );

    tmp = headSent;

    switch( tmp->type ) {
    case SENT_FILE:
        if( tmp->free ) {
            close( tmp->data.file.fh );
            PrtMsg( DBG | INF | LOC | FINISHED_FILE, tmp->data.file.name );
        }
        FreeSafe( tmp->data.file.buf );
        FreeSafe( (void *)headSent->data.file.name );
        break;
    case SENT_STR:
        if( tmp->free ) {
            FreeSafe( (void *)headSent->data.str.str );
        }
        break;
    case SENT_CHAR:
        break;
    }

    headSent = tmp->next;       /* advance to next SENT */
    tmp->next = freeSent;       /* push onto free stack */
    freeSent = tmp;
}
コード例 #8
0
ファイル: mcache.c プロジェクト: NoSuchProcess/open-watcom-v2
STATIC void freeDirectList( DHEADPTR dhead )
/******************************************/
{
    DHEADPTR    dhead_next;
    CENTRYPTR   cwalk_next;
    CENTRYPTR   cwalk;
    HASH_T      h;
#ifdef CACHE_STATS
    UINT32      bytes = 0UL;
#endif

    for( ; dhead != NULL; dhead = dhead_next ) {
        dhead_next = dhead->dh_next;
        for( h = 0; h < HASH_PRIME; h++ ) {
            for( cwalk = dhead->dh_table[h]; cwalk != NULL; cwalk = cwalk_next ) {
                cwalk_next = cwalk->ce_next;
                myFree( cwalk );
#ifdef CACHE_STATS
                bytes += sizeof( *cwalk );
#endif
            }
        }
        myFree( dhead );
#ifdef CACHE_STATS
        bytes += sizeof( *dhead );
#endif
    }
#ifdef CACHE_STATS
    if( Glob.cachestat ) {
        PrtMsg( INF | CACHE_FREED_BYTES, bytes );
    }
#endif
}
コード例 #9
0
ファイル: at83c26.c プロジェクト: shuishang/contact-driver
int AT83C26_Reset(void)
{

    PrtMsg("Welcome to entry to the function: %s\n",__FUNCTION__);

    // initial slot 1:  VCARD1 = 0V, CPRES1: normal open,  CCLK1 = CLK, internal pull-up
    if(AT83C26_SendCmd(3, SC1_PWR, sizeof(SC1_PWR)))
    {
        return(-1);
    }
    // initial slot 1: CIO1 = 0, CCLK1 = 0, CRST1 = 0
    if(AT83C26_SendCmd(5 , (unsigned char*)SC1_INTFACE, sizeof(SC1_INTFACE)))
    {
        return(-1);
    }

    // initial DCDCB: VDCB = 5.2V
    if(AT83C26_SendCmd(11, VDCB_INITIAL, sizeof(VDCB_INITIAL)))
    {
        return(-1);
    }

    // initial slot 2: VCARD2 = 0V, CRST2 = 0, CCLK2 = 0,  CCLK2 = CLK
    if(AT83C26_SendCmd(7, SC2_PWR, sizeof(SC2_PWR)))
    {
        return(-1);
    }
    // initial slot 3: VCARD3 = 0V, CRST3 = 0, CCLK3 = 0,  CCLK3 = CLK
    if(AT83C26_SendCmd(8, SC3_PWR, sizeof(SC3_PWR)))
    {
        return(-1);
    }
    // initial slot 4: VCARD4 = 0V, CRST4 = 0, CCLK4 = 0,  CCLK4 = CLK
    if(AT83C26_SendCmd(9, SC4_PWR, sizeof(SC4_PWR)))
    {
        return(-1);
    }
    // initial slot 5: VCARD5 = 0V, CRST5 = 0, CCLK5 = 0,  CCLK5 = CLK
    if(AT83C26_SendCmd(10, SC5_PWR, sizeof(SC5_PWR)))
    {
        return(-1);
    }

    if(AT83C26_SendCmd(6, (unsigned char*)SCx_INTFACE, sizeof(SCx_INTFACE)))
    {
        return(-1);
    }


/*    AT83C26_CRSTx(0, 1);
    if(AT83C26_CCLKx(0, 1, 0))    return(-1);
    if(AT83C26_CVCCx(0, 1)) return(-1);
    mdelay(20);

    if(AT83C26_CVCCx(1, 2)) return(-1);
    if(AT83C26_CCLKx(1, 1, 0))    return(-1);
    AT83C26_CRSTx(1, 1);*/
    return(0);
}
コード例 #10
0
ファイル: msysdep.c プロジェクト: Azarien/open-watcom-v2
void CheckForBreak( void )
{
    if( sig_count > 0 ) {
        sig_count = 0;
        PrtMsg( ERR | USER_BREAK_ENCOUNTERED );
        ExitError();
    }
}
コード例 #11
0
char *GetMacroValue( const char *name )
/*********************************************
 * Now we need to check for string substitution
 * $(MACRONAME:oldstring=newstring)
 */
{
    char        *InName;
    const char  *beforeSub;
    char        *afterSub;
    char        *current;
    const char  *new;
    const char  *old;
    char        *line;

    InName = StrDupSafe( name );
    current = strchr( InName, COLON );

    if( current == NULL ) {
        beforeSub = GetMacroValueProcess( InName );
        if( beforeSub == NULL ) {
            afterSub = NULL;
        } else {
            afterSub  = StrDupSafe( beforeSub );
        }
    } else {
        *current++ = NULLCHAR;
        beforeSub = GetMacroValueProcess( InName );

        if( beforeSub == NULL ) {
            afterSub = NULL;
        } else {
            line = NULL;
            // recursively expand so $(macro:sub) OK if macro contains another
            if( strchr( beforeSub, DOLLAR ) != NULL ) {
                UnGetCH( STRM_MAGIC );
                InsString( beforeSub, FALSE );
                beforeSub = line = DeMacro( TOK_MAGIC );
                GetCHR();   // eat STRM_MAGIC
            }
            if( beforeSub == NULL ) {
                afterSub = NULL;
            } else {
                if( getOldNewString( current, &old, &new ) == RET_SUCCESS ) {
                    afterSub = doStringSubstitute( beforeSub, old, new );
                } else {
                    afterSub = NULL;
                    PrtMsg( ERR | LOC | INVALID_STRING_SUBSTITUTE );
                }
                if( line ) {
                    FreeSafe( line );
                }
            }
        }
    }
コード例 #12
0
void exPush( TARGET *targ, DEPEND *dep, DEPEND *impDep )
/*************************************************************/
{
    if( exStackP == MAX_EXSTACK ) {
        PrtMsg( FTL| PERCENT_MAKE_DEPTH );
    }
    exStack[exStackP].targ   = targ;
    exStack[exStackP].dep    = dep;
    exStack[exStackP].impDep = impDep;
    ++exStackP;
}
コード例 #13
0
ファイル: errmsg.c プロジェクト: OS2World/DEV-ASM-UTIL-JWasm
void PrintNote( int msgnum, ... )
/*****************************/
{
    va_list args1, args2;

    va_start( args1, msgnum );
    va_start( args2, msgnum );

    PrtMsg( 0, msgnum, args1, args2 );
    va_end( args1 );
    va_end( args2 );
}
コード例 #14
0
STATIC bool checkMacro( STRM_T s )
/*********************************
 * returns: true    if the line WAS a macro defn
 *          false   if it wasn't
 * recognizes:      {macc}+{ws}*"="{ws}*{defn}*"\n"
 *                  {macc}+{ws}*"+="{ws}*{defn}*"\n"
 * second gets translated from "macro += defn" to "macro=$+$(macro)$- defn"
 */
{
    char        mac[MAX_MAC_NAME];
    unsigned    pos;
    bool        ws;

    pos = 0;
    while( pos < MAX_MAC_NAME && sismacc( s ) ) {
        mac[pos++] = s;
        s = PreGetCHR();
    }
    if( pos == MAX_MAC_NAME ) {
        PrtMsg( FTL | LOC | MAXIMUM_TOKEN_IS, MAX_MAC_NAME - 1 );
        ExitFatal();
        // never return
    }
    mac[pos] = NULLCHAR;
    ws = sisws( s );
    while( sisws( s ) ) {
        s = PreGetCHR();
    }
    if( s == '=' ) {
        DefMacro( mac );
        return( true );          /* go around again */
    } else if( s == '+' ) {
        s = PreGetCHR();
        if( s == '=' ) {
            InsString( ")$-", false );
            InsString( mac, false );
            InsString( "$+$(", false );
            DefMacro( mac );
            return( true );     /* go around again */
        }
        UnGetCHR( s );
        s = '+';
    }

    UnGetCHR( s );           /* not a macro line, put everything back*/
    if( ws ) {
        UnGetCHR( ' ' );
    }
    InsString( StrDupSafe( mac + 1 ), true );
    return( false );
}
コード例 #15
0
ファイル: mstream.c プロジェクト: Ukusbobra/open-watcom-v2
STATIC BOOLEAN fillBuffer( void )
/********************************
 * Fill the top file buffer, and reset counters
 * returns: TRUE if buffer is not empty
 *          FALSE if buffer is empty (EOF)
 */
{
    int     max;
    SENT    *tmp;   /* just to make sure optimizer will registerize this */

    assert( headSent != NULL && headSent->type == SENT_FILE );

    tmp = headSent;

    if( tmp->data.file.nestLevel == -1 ) {
        tmp->data.file.nestLevel = GetNestLevel();
    }

    tmp->data.file.cur = tmp->data.file.buf;

    max = read( tmp->data.file.fh, tmp->data.file.buf, FILE_BUFFER_SIZE - 1 );
    if( max < 0 ) {     /* 31-jul-91 DJG */
        PrtMsg( ERR | READ_ERROR, tmp->data.file.name );
        max = 0;
    } else if( max > 0 && tmp->data.file.buf[max - 1] == '\r' ) {
        /* read one more character if it ends in \r (possibly CRLF) */
        int     max2;

        max2 = read( tmp->data.file.fh, &tmp->data.file.buf[max], 1 );
        if( max2 < 0 ) {     /* 13-sep-03 BEO */
            PrtMsg( ERR | READ_ERROR, tmp->data.file.name );
            max2 = 0;
        }
        max += max2;
    }
    tmp->data.file.max = tmp->data.file.buf + max;
    return( max > 0 );
}
コード例 #16
0
STATIC TOKEN_T lexFileName( STRM_T s )
/*************************************
 * Now we need two ways of taking file names if the filename needs special
 * characters then use "filename"  this will ignore all the different
 * characters except for the quote which can be specified as \t
 */
{
    char        file[_MAX_PATH];
    unsigned    pos;

    assert( sisfilec( s ) || s == '\"' ||
       ( (Glob.compat_nmake || Glob.compat_posix) && s == SPECIAL_TMP_DOLLAR ) );

    if( s == '\"' ) {
        return( lexLongFilePathName( s, TOK_FILENAME ) );
    }

    pos = 0;
    while( pos < _MAX_PATH && (sisfilec( s ) ||
            ( s == SPECIAL_TMP_DOLLAR && (Glob.compat_nmake || Glob.compat_posix) ) ) ) {
        file[pos++] = s;
        s = PreGetCHR();
    }
    if( pos == _MAX_PATH ) {
        PrtMsg( FTL | LOC | MAXIMUM_TOKEN_IS, _MAX_PATH - 1 ); // NOTREACHED
        ExitFatal();
        // never return
    }
    file[pos] = NULLCHAR;
    UnGetCHR( s );

    /* if it is a file, we have to check last position for a ':', and
     * trim it off if it's there */
    if( pos > 1 && file[pos - 1] == ':' ) {
        file[pos - 1] = NULLCHAR;   /* trim a trailing colon */
        UnGetCHR( ':' );            /* push back the colon */
        --pos;
    }
    /*
     * try to do the trim twice because if file ends with a double colon
     * it means its a double colon explicit rule
     */
    if( pos > 1 && file[pos - 1] == ':' ) {
        file[pos - 1] = NULLCHAR;   /* trim a trailing colon */
        UnGetCHR( ':' );            /* push back the colon */
    }

    CurAttr.u.ptr = StrDupSafe( file );
    return( TOK_FILENAME );
}
コード例 #17
0
ファイル: errmsg.c プロジェクト: OS2World/DEV-ASM-UTIL-JWasm
void AsmWarn( int level, int msgnum, ... )
/****************************************/
{
    va_list args1, args2;

    if( level <= WngLevel ) {
#ifdef DEBUG_OUT
        DebugCurrLine();
#endif
        va_start( args1, msgnum );
        va_start( args2, msgnum );
        if( !Options.warning_error ) {
            PrtMsg( 4, msgnum, args1, args2 );
            ModuleInfo.warning_count++;
        } else {
            PrtMsg( 2, msgnum, args1, args2 );
            ModuleInfo.error_count++;
        }
        va_end( args1 );
        va_end( args2 );
        print_source_nesting_structure();
    }
}
コード例 #18
0
STATIC TOKEN_T lexLongFilePathName( STRM_T s, TOKEN_T tok )
/**********************************************************
 * This will enable taking in of special filenames
 * it takes long file names or long path names
 */
{
    char    file[_MAX_PATH];
    int     pos;

    assert( s == '\"' );

    pos = 0;

    s = PreGetCHR();

    /* \" is considered a double quote character                         */
    /* and if a double quote is found again then we break out as the end */
    /* of the filename                                                   */
    while( pos < _MAX_PATH && s != '\"' && s != '\n' && s != STRM_END ) {
        file[pos++] = s;
        s = PreGetCHR();
        if( s == '\\' ) {
            if( pos >= _MAX_PATH ) {
                break;
            }
            s = PreGetCHR();
            if( s == '\"' ) {
                file[pos++] = s;
                s = PreGetCHR();
            } else {
                file[pos++] = '\\';
            }
        }
    }

    if( pos >= _MAX_PATH ) {
        PrtMsg( FTL | LOC | MAXIMUM_TOKEN_IS, _MAX_PATH - 1 ); // NOTREACHED
        ExitFatal();
        // never return
    }
    file[pos] = NULLCHAR;

    if( s != '\"' ) {
        UnGetCHR( s );
    }

    CurAttr.u.ptr = StrDupSafe( file );
    return( tok );
}
コード例 #19
0
ファイル: errmsg.c プロジェクト: OS2World/DEV-ASM-UTIL-JWasm
void AsmErr( int msgnum, ... )
/****************************/
{
    va_list args1, args2;

#ifdef DEBUG_OUT
    DebugCurrLine();
#endif
    va_start( args1, msgnum );
    va_start( args2, msgnum );
    PrtMsg( 2, msgnum, args1, args2 );
    va_end( args1 );
    va_end( args2 );
    ModuleInfo.error_count++;
    write_to_file = FALSE;
    print_source_nesting_structure();
    if( ErrLimit != -1  &&  ModuleInfo.error_count == ErrLimit+1 ) {
        PrtMsg( 2, TOO_MANY_ERRORS, args1, args2 );
        /* Just simulate the END directive, don't do a fatal exit!
         This allows to continue to assemble further modules.
         */
        ModuleInfo.EndDirectiveFound = TRUE;
    }
}
コード例 #20
0
ファイル: mupdate.c プロジェクト: Azarien/open-watcom-v2
void UpdateFini( void )
/****************************/
{
    CLIST   *after;

    assert( exStackP == 0 );

    after = DotCList( DOT_AFTER );
    if( doneBefore && after != NULL ) {
        ++cListCount;
        if( ExecCList( DotCList( DOT_AFTER ) ) != RET_SUCCESS ) {
            PrtMsg( ERR | S_COMMAND_RET_BAD, DotNames[DOT_AFTER] );
        }
    }
    DoingUpdate = false;
}
コード例 #21
0
ファイル: mcache.c プロジェクト: NoSuchProcess/open-watcom-v2
void CacheRelease( void )
/*******************************
 * Called at any time we want to invalidate the cache
 */
{
#ifdef USE_DIR_CACHE
#ifdef CACHE_STATS
    if( Glob.cachestat ) {
        PrtMsg( INF | CACHERELEASE );
    }
#endif
    freeDirectList( cacheHead );
    cacheHead = NULL;
    MemShrink();
    CACHE_DELAY_RELEASE();
#endif
}
コード例 #22
0
ファイル: mupdate.c プロジェクト: Azarien/open-watcom-v2
STATIC void implyDebugInfo( TARGET *targ, UINT32 startcount )
/***********************************************************/
{
    enum MsgClass   msg;

    if( Glob.debug ) {
        if( targExists( targ ) ) {
            if( startcount != cListCount ) {
                msg = M_HAD_TO_BE_UPDATED;
            } else {
                msg = M_IS_CLEAR_WITH;
            }
        } else {
            msg = M_COULD_NOT_BE_IMPLIED;
        }
        PrtMsg( DBG | INF | IMP_ENV_M, targ->node.name, msg );
    }
}
コード例 #23
0
ファイル: mupdate.c プロジェクト: Azarien/open-watcom-v2
RET_T MakeList( TLIST *tlist )
/***********************************/
{
    RET_T   ret;
    TARGET  *targ;

    ret = RET_SUCCESS;
    for( ; tlist != NULL; tlist = tlist->next ) {
        targ = tlist->target;
        if( !targ->mentioned ) {
            PrtMsg( WRN | TARGET_NOT_MENTIONED, targ->node.name );
            targ->mentioned = true;
        }   /* warning suggested by John */
        if( Update( targ ) != RET_SUCCESS ) {
            ret = RET_ERROR;
        }
    }
    return( ret );
}
コード例 #24
0
ファイル: at83c26.c プロジェクト: shuishang/contact-driver
int AT83C26_Probe(struct i2c_client *client, const struct i2c_device_id *id)
{
    PrtMsg("Welcome to entry the function: %s\n",__FUNCTION__);

    
    AT83C26.client = client;
    

    
    if(AT83C26_Reset())          // initial each slot with low level
    {
        AT83C26.client = NULL;
        return(-1);
    }

    if(AT83C26_INT_CFG(AT83C26.client))    return(-1);

    return (0);
}
コード例 #25
0
ファイル: mstream.c プロジェクト: Ukusbobra/open-watcom-v2
    /*
     * Because we do a line++ when we return a {nl}, we have to check if
     * the last character returned was a {nl}.  We check the last character
     * if any characters have been read - it is just at cur[-1].  The only
     * time that cur > buf == FALSE is when nothing has been read.  (Check
     * the code for reading - even after filling the buffer this doesn't
     * evaluate improperly).
     */
    *pline = cur->data.file.line;
    if( cur->data.file.cur > cur->data.file.buf &&
        cur->data.file.cur[-1] == EOL ) {
        --(*pline);
    }

    *pname = cur->data.file.name;

    return( RET_SUCCESS );
}


int IsStreamEOF( void )
{
    return( flagEOF );
}


#ifdef DEVELOPMENT      /* code to dump the stack of SENTs */
void dispSENT( void )
/**************************/
{
    char    buf[256];
    size_t  pos;
    SENT    *cur;

    if( headSent ) {
        PrtMsg( INF | PRNTSTR, "\n[stream contents:]" );
        for( cur = headSent; cur != NULL; cur = cur->next ) {
            pos = FmtStr( buf, "[type %d, ", cur->type );
            switch( cur->type ) {
            case SENT_FILE:
                if( cur->data.file.cur == cur->data.file.max ) {
                    pos += FmtStr( &buf[pos], "fh %d, buffer empty, line %d",
                        cur->data.file.fh, cur->data.file.line );
                } else {
                    pos += FmtStr( &buf[pos],
                        "fh %d, in buf %d, next 0x%x, line %d",
                        cur->data.file.fh, cur->data.file.max - cur->data.file.cur,
                        *(cur->data.file.cur), cur->data.file.line );
                }
                if( cur->data.file.name ) {
                    pos += FmtStr( &buf[pos], ", name %s", cur->data.file.name );
                }
                pos += FmtStr( &buf[pos], "]" );
                PrtMsg( INF | PRNTSTR, buf );
                break;
            case SENT_STR:
                pos += FmtStr( &buf[pos], "(" );
                PrtMsg( INF | NEOL | PRNTSTR, buf );
                PrtMsg( INF | NEOL | PRNTSTR, cur->data.str.cur );
                PrtMsg( INF | PRNTSTR, ")]" );
                break;
            case SENT_CHAR:
                pos += FmtStr( &buf[pos], "character 0x%x]", cur->data.ch );
                PrtMsg( INF | PRNTSTR, buf );
                break;
            }
        }
    } else {
        PrtMsg( INF | PRNTSTR, "[stream empty]" );
    }
}
コード例 #26
0
ファイル: mupdate.c プロジェクト: Azarien/open-watcom-v2
STATIC void getDate( TARGET *targ )
/*********************************/
{
    getStats( targ );
    if( Glob.debug ) {
        char        buf[20];    /* large enough for date */
        struct tm   *tm;

        if( targ->date == YOUNGEST_DATE ) {
            FmtStr( buf, "%M", M_YOUNGEST_DATE );
        } else if( targ->date == OLDEST_DATE ) {
            FmtStr( buf, "%M", M_OLDEST_DATE );
        } else {
            tm = localtime( &targ->date );
            FmtStr( buf, "%D-%s-%D  %D:%D:%D",
                    tm->tm_mday, MonthNames[tm->tm_mon], tm->tm_year,
                    tm->tm_hour, tm->tm_min, tm->tm_sec
                );
        }
        PrtMsg( DBG | INF | GETDATE_MSG, buf, targ->node.name );
    }
}
コード例 #27
0
ファイル: at83c26.c プロジェクト: shuishang/contact-driver
static irqreturn_t AT83C26_Irq(int irq, void *dev_id)
{
//    unsigned char RecBuf[12];
/*    
    AT83C26_ReadCmd(1, RecBuf, 2);

    if(BITisSET(RecBuf[1], 4))    // a change in card status
    {
        SET_BIT(CardParam[SlotICC].CardStatus, ICC_STATUS_CHANGE_BIT);
        if(BITisSET(RecBuf[0], 5))    // a card is detected
        {
            SET_BIT(CardParam[SlotICC].CardStatus, ICC_PRESENT_BIT);
        }
        else
        {
            SET_BIT(CardParam[SlotICC].CardStatus, ICC_PRESENT_BIT);
        }
    }
*/
    PrtMsg("welcome to entry the interrupt function: %s\n\n", __FUNCTION__);
    return(IRQ_HANDLED);
}
コード例 #28
0
ファイル: mstream.c プロジェクト: Ukusbobra/open-watcom-v2
RET_T InsFile( const char *name, BOOLEAN envsearch )
/**********************************************************
 * Open file named name, and push it into stream.  If can't find name, it
 * tries an implicit suffix search (possibly using the env variable PATH)
 */
{
    SENT    *tmp;
    int     fh;
    char    path[_MAX_PATH];

    assert( name != NULL );

    if( TrySufPath( path, name, NULL, envsearch ) == RET_SUCCESS ) {
        PrtMsg( DBG | INF | LOC | ENTERING_FILE, path );

        fh = sopen3( path, O_RDONLY | O_BINARY, SH_DENYWR );
        if( fh == -1 ) {
            return( RET_ERROR );
        }

        tmp = getSENT( SENT_FILE );
        tmp->free = TRUE;
        tmp->data.file.name = StrDupSafe( path );

        pushFH( tmp, fh );

        if( !Glob.overide ) {
            UnGetCH( EOL );
            InsString( path, FALSE );
            InsString( "$+$(__MAKEFILES__)$- ", FALSE );
            DefMacro( "__MAKEFILES__" );
        }

        return( RET_SUCCESS );
    }
    return( RET_ERROR );
}
コード例 #29
0
ファイル: at83c26.c プロジェクト: shuishang/contact-driver
static int AT83C26_INT_CFG(struct i2c_client *client)
{
    int ret;
    
    PrtMsg("%s: start, irq = %d\n", __FUNCTION__, client->irq);
    PrtMsg("%s: start, name = %s\n", __FUNCTION__, client->name);
    PrtMsg("%s: start, addr = %02X\n", __FUNCTION__, client->addr);
//    omap_cfg_reg(157);
    Reg_83c26_INT = ioremap(GPIO157_156, 1);
    if(Reg_83c26_INT == NULL)
    {
        PrtMsg("%s:IORemap register memory faild!!!\n",__FUNCTION__);
        return(-1);
    }
    PrtMsg("*Reg_83c26_INT = %X\n", *Reg_83c26_INT);
    Gpio_Init(Reg_83c26_INT, MODE4_GPIO, PULLUPDOWNENABLE, DIREC_INPUT, OFFS_16);

//    ret = gpio_request(client->irq, "at83c26_INT");
//    if(ret < 0)
//    {
//        PrtMsg("%s: fail to got gpio for at83c26 INT pin(ret = %08X)!\n",__FUNCTION__, ret);
//        return(-1);
//    }
    gpio_direction_input(client->irq);
    set_irq_type(OMAP_GPIO_IRQ(client->irq), IRQ_TYPE_LEVEL_HIGH);
//    PrtMsg("OMAP_GPIO_IRQ(157) = %d, gpio_to_irq(157) = %d \n", OMAP_GPIO_IRQ(157),gpio_to_irq(157));
    ret = request_irq(OMAP_GPIO_IRQ(client->irq), AT83C26_Irq, IRQF_DISABLED , (char*)"at83c26_INT", NULL);
    if(ret)
    {
       PrtMsg("fail to request irq: ret = %X\n",ret); 
       return(-1);    
    }
    
    enable_irq(gpio_to_irq(client->irq));
    
    return(0);
}
コード例 #30
0
ファイル: mupdate.c プロジェクト: Azarien/open-watcom-v2
RET_T Update( TARGET *targ )
/*********************************/
{
    DEPEND      *curdep;
    UINT32      startcount;
    bool        target_exists;
    RET_T       ret;

    CheckForBreak();
    if( targ->error ) {
        return( RET_ERROR );
    }
    if( targ->updated ) {
        return( RET_SUCCESS );
    }
    if( targ->special ) {
        PrtMsg( FTL | ATTEMPT_MAKE_SPECIAL, targ->node.name );
        ExitFatal();
    }
    if( targ->busy ) {
        PrtMsg( FTL | RECURSIVE_DEFINITION, targ->node.name );
        ExitFatal();
    }
    PrtMsg( DBG | INF | NEOL | UPDATING_TARGET, targ->node.name );
    targ->busy = true;
    targExists( targ );     /* find file using sufpath */
    startcount = cListCount;

    if( targ->depend == NULL || (targ->depend->clist == NULL && targ->depend->targs == NULL) ) {
        /* has no depend/explicit rules */
        PrtMsg( DBG | INF | M_EXPLICIT_RULE, M_NO );
        ret = tryImply( targ, false );
        if( ret == RET_ERROR ) {
            targ->busy = false;
            targ->error = true;
            return( RET_ERROR );
        } else if( ret == RET_WARN ) {
            // If target with no commands is acceptable, consider it done
            if( targ->allow_nocmd ) {
                targ->cmds_done = true;
            }
        }
    } else if( !targ->scolon ) {
        /* double colon */
        PrtMsg( DBG | INF | M_EXPLICIT_RULE, M_DCOLON );
        for( curdep = targ->depend; curdep != NULL; curdep = curdep->next ) {
            if( resolve( targ, curdep ) != RET_SUCCESS ) {
                targ->busy = false;
                targ->error = true;
                return( RET_ERROR );
            }
        }
        if( !Glob.compat_nmake ) {
            if( tryImply( targ, false ) == RET_ERROR ) {
                targ->busy = false;
                targ->error = true;
                return( RET_ERROR );
            }
        }
    } else {
        PrtMsg( DBG | INF | M_EXPLICIT_RULE, M_SCOLON );
        if( resolve( targ, targ->depend ) != RET_SUCCESS ) {
            targ->busy = false;
            targ->error = true;
            return( RET_ERROR );
        }
    }

    if( (targ->attr.symbolic || Glob.noexec || Glob.query)
        && startcount != cListCount ) {
        targ->existing = true;
        targ->touched = true;
        targ->executed = false;
        targ->date = YOUNGEST_DATE;
    }

    target_exists = targExists( targ );
    if( target_exists || targ->attr.symbolic || Glob.ignore ) {
        // Target exists or it is symbolic or we're ignoring errors,
        // therefore everyone's happy and we can charge forward
        PrtMsg( DBG | INF | TARGET_IS_UPDATED, targ->node.name );
    } else {
        // Target doesn't exist, we may be in trouble
        if( targ->cmds_done && Glob.nocheck ) {
            // Target doesn't exist even though we processed some commands,
            // but we're not checking existence of files. Consider it uptodate.
            targ->existing = true;
            PrtMsg( DBG | INF | TARGET_FORCED_UPTODATE, targ->node.name );
        } else if( Glob.cont ) {
            // Target doesn't exist but we're forcibly continuing. Report
            // nonfatal error.
            targ->error = true;
            targ->busy = false;
            PrtMsg( ERR | UNABLE_TO_MAKE, targ->node.name );
            return( RET_ERROR );
        } else {
            // Target doesn't exist and we have no clue how to make it. Bomb out.
            PrtMsg( FTL | UNABLE_TO_MAKE, targ->node.name );
            ExitFatal();
        }
    }

    targ->updated = ( !targ->attr.multi );
    targ->busy = false;
    targ->error = false;
    return( RET_SUCCESS );
}