Пример #1
0
void ProcInvoke( void )
{
    char      *fstart;
    unsigned   flen;
    char      *start;
    char_ring *parmlist;
    char_ring **owner;
    char_ring *path;
    unsigned   len;

    if( !ScanItem( TRUE, &fstart, &flen ) ) Error( ERR_LOC, LIT( ERR_WANT_FILENAME ) );
    parmlist = NULL;
    owner = &parmlist;
    while( !ScanEOC() ) {
        ScanItem( TRUE, &start, &len );
        _Alloc( path, sizeof( char_ring ) + len );
        if( path == NULL ) {
            FreeRing( parmlist );
            Error( ERR_NONE, LIT( ERR_NO_MEMORY ) );
        }
        memcpy( path->name, start, len );
        path->name[ len ] = NULLCHAR;
        path->next = NULL;
        *owner = path;
        owner = &path->next;
    }
    Invoke( fstart, (int)flen, parmlist );
}
Пример #2
0
static void DoInvoke( handle hndl, char *name, char_ring *parmlist )
{
    invokes     *inv;

    _Alloc( inv, sizeof( invokes ) + strlen( name ) );
    if( inv != NULL ) {
        inv->buff_size = CMD_LEN;
        _Alloc( inv->buff, inv->buff_size+1 ); /* extra for NULLCHAR */
    }
    if( inv == NULL || inv->buff == NULL ) {
        if( inv != NULL ) _Free( inv );
        FileClose( hndl );
        FreeRing( parmlist );
        Error( ERR_NONE, LIT( ERR_NO_MEMORY ) );
    }
    strcpy( inv->name, name );
    inv->in_size = 0;
    inv->in_off = 0;
    inv->flags = 0;
    inv->redirect = NULL;
    inv->inv_input = hndl;
    inv->prmlst = parmlist;
    inv->number = InvCount++;
    inv->line = 0;
    PushInpStack( inv, DoneInvLine, TRUE );
    TypeInpStack( INP_CMD_FILE );
}
Пример #3
0
static void Conclude( invokes *inv )
{
    if( inv->inv_input != NIL_HANDLE ) {
        FileClose( inv->inv_input );
    }
    FreeRing( inv->prmlst );
    _Free( inv->buff );
    _Free( inv );
}
Пример #4
0
void Invoke( const char *invfile, int len, char_ring *parmlist )
{
    handle      hndl;

    hndl = LocalFullPathOpen( invfile, len, "dbg", TxtBuff, TXT_LEN );
    if( hndl == NIL_HANDLE ) {
        MakeFileName( TxtBuff, invfile, "dbg", 0 );
        FreeRing( parmlist );
        Error( ERR_NONE, LIT_ENG( ERR_FILE_NOT_OPEN ), TxtBuff );
    }
    DoInvoke( hndl, TxtBuff, parmlist );
}
Пример #5
0
void Invoke( char *invfile, int len, char_ring *parmlist )
{
    char        *invname;
    handle      hndl;

    _AllocA( invname, len + 1 );
    memcpy( invname, invfile, len );
    invname[ len ] = '\0';
    hndl = LocalFullPathOpen( invname, "dbg", TxtBuff, TXT_LEN );
    if( hndl == NIL_HANDLE ) {
        MakeFileName( TxtBuff, invname, "dbg", 0 );
        FreeRing( parmlist );
        Error( ERR_NONE, LIT( ERR_FILE_NOT_OPEN ), TxtBuff );
    }
    DoInvoke( hndl, TxtBuff, parmlist );
}
Пример #6
0
void FiniLocalInfo( void )
{
    FreeRing( LocalDebugInfo );
    LocalDebugInfo = NULL;
}
Пример #7
0
void FiniSource( void )
{
    FreeRing( SrcSpec );
    SrcSpec = NULL;
}
Пример #8
0
void FiniDLLList( void )
{
    FreeRing( DLLList );
    DLLList = NULL;
}