int GetCurrSrcPos( char *buffer )
/*******************************/
{
    struct file_list *fl;
    uint_32 line;
    char *p;

    line = LineNumber;
    for( fl = file_stack; fl && fl->islinesrc; fl = fl->next );
    if ( fl ) {
#ifdef __FULLSRCPATH
    	p = GetFName( fl->srcfile )->fullname;
#else
    	p = GetFName( fl->srcfile )->name;
#endif
	if ( line )
	    return( sprintf( buffer, "%s(%lu) : ", p, line ) );
	else
	    return( sprintf( buffer, "%s : ", p ) );
    }
    *buffer = NULLC;
    return( 0 );
}

#ifdef __FIXLABELS
extern ret_code LabelMacro(struct asm_tok tokenarray[]);
ret_code ExpandLine_xlabel(char *string, struct asm_tok tokenarray[])
{
    if (LabelMacro(tokenarray))
	return 0;
    return ExpandLine(string, tokenarray);
}
#endif

int GetPreprocessedLine( char *line, struct asm_tok tokenarray[] )
/****************************************************************/
{
    int i;

    if (GetTextLine(line) == NULL) {
	DebugMsg1(("GetPreprocessedLine: GetTextLine() returned NULL (end of file/macro)\n" ));
	return( -1 ); /* EOF */
    }

    /* v2.08: moved here from GetTextLine() */
    ModuleInfo.CurrComment = NULL;
    /* v2.06: moved here from Tokenize() */
    ModuleInfo.line_flags = 0;
    /* Token_Count is the number of tokens scanned */
    Token_Count = Tokenize( line, 0, tokenarray, TOK_DEFAULT );

#ifdef DEBUG_OUT
    cntppl0++;
    if ( file_stack && file_stack->islinesrc ) {
	if ( file_stack->macro )
	    DebugMsg1(("GetPreprocessedLine(mac=%s): >%s<\n", file_stack->macro->name, line ));
	else
	    DebugMsg1(("GetPreprocessedLine: >%s<\n", line ));
    } else if ( file_stack && file_stack->srcfile ) {
	DebugMsg1(("GetPreprocessedLine(%s): >%s<\n", GetFName( file_stack->srcfile )->name, line ));
    } else
	DebugMsg1(("GetPreprocessedLine(cnt=%u): >%s<\n", Token_Count, line));
#endif

#if REMOVECOMENT == 0
    if ( Token_Count == 0 && ( CurrIfState == BLOCK_ACTIVE || ModuleInfo.listif ) )
	LstWriteSrcLine();
#endif

#ifdef DEBUG_OUT
    /* option -np, skip preprocessor? */
    if ( Options.skip_preprocessor )
	return( Token_Count );
#endif

    if ( Token_Count == 0 )
	return( 0 );

    /* CurrIfState != BLOCK_ACTIVE && Token_Count == 1 | 3 may happen
     * if a conditional assembly directive has been detected by Tokenize().
     * However, it's important NOT to expand then */
    if ( CurrIfState == BLOCK_ACTIVE ) {
	if ( ( tokenarray[Token_Count].bytval & TF3_EXPANSION ?
	    ExpandText( line, tokenarray, TRUE ) :
#ifdef __FIXLABELS
	    ExpandLine_xlabel(line, tokenarray)) != NOT_ERROR)
#else
	    ExpandLine( line, tokenarray ) ) != NOT_ERROR )
#endif
	    return( 0 );
    }
