OpenCores
URL https://opencores.org/ocsvn/raptor64/raptor64/trunk

Subversion Repositories raptor64

[/] [raptor64/] [trunk/] [software/] [c64/] [source/] [Cmain.c] - Diff between revs 37 and 51

Show entire file | Details | Blame | View Log

Rev 37 Rev 51
Line 32... Line 32...
void summary();
void summary();
int options(char *);
int options(char *);
int openfiles(char *);
int openfiles(char *);
void closefiles();
void closefiles();
 
 
char            infile[20],
char            infile[32],
                listfile[20],
                listfile[32],
                outfile[20];
                outfile[32],
 
                                outfileG[32];
 
 
extern TABLE    tagtable;
extern TABLE    tagtable;
int             mainflag;
int             mainflag;
extern int      total_errors;
extern int      total_errors;
int uctran_off;
int uctran_off;
 
 
Line 73... Line 75...
        return 0;
        return 0;
}
}
 
 
int     openfiles(char *s)
int     openfiles(char *s)
{
{
        int     ofl;
        int     ofl,oflg;
 
        int i;
        strcpy(infile,s);
        strcpy(infile,s);
        strcpy(listfile,s);
        strcpy(listfile,s);
        strcpy(outfile,s);
        strcpy(outfile,s);
 
                strcpy(outfileG,s);
 
                _splitpath(s,NULL,NULL,nmspace[0],NULL);
        makename(listfile,".lis");
        makename(listfile,".lis");
        makename(outfile,".s");
        makename(outfile,".s");
 
                makename(outfileG,".sg");
        if( (input = fopen(infile,"r")) == 0) {
        if( (input = fopen(infile,"r")) == 0) {
                printf(" cant open %s\n",infile);
                printf(" cant open %s\n",infile);
                return 0;
                return 0;
                }
                }
        ofl = _creat(outfile,-1);
        ofl = _creat(outfile,-1);
Line 90... Line 96...
                {
                {
                printf(" cant create %s\n",outfile);
                printf(" cant create %s\n",outfile);
                fclose(input);
                fclose(input);
                return 0;
                return 0;
                }
                }
 
        oflg = _creat(outfileG,-1);
 
        if( oflg < 0 )
 
                {
 
                printf(" cant create %s\n",outfileG);
 
                fclose(input);
 
                return 0;
 
                }
        if( (output = _fdopen(ofl,"w")) == 0) {
        if( (output = _fdopen(ofl,"w")) == 0) {
                printf(" cant open %s\n",outfile);
                printf(" cant open %s\n",outfile);
                fclose(input);
                fclose(input);
                return 0;
                return 0;
                }
                }
 
        if( (outputG = _fdopen(oflg,"w")) == 0) {
 
                printf(" cant open %s\n",outfileG);
 
                fclose(input);
 
                fclose(output);
 
                return 0;
 
                }
        if( (list = fopen(listfile,"w")) == 0) {
        if( (list = fopen(listfile,"w")) == 0) {
                printf(" cant open %s\n",listfile);
                printf(" cant open %s\n",listfile);
                fclose(input);
                fclose(input);
                fclose(output);
                fclose(output);
 
                fclose(outputG);
                return 0;
                return 0;
                }
                }
        return 1;
        return 1;
}
}
 
 
Line 124... Line 144...
 
 
void closefiles()
void closefiles()
{
{
        fclose(input);
        fclose(input);
    fclose(output);
    fclose(output);
 
        fclose(outputG);
    fclose(list);
    fclose(list);
}
}
 
 
 No newline at end of file
 No newline at end of file
 
char *GetNamespace()
 
{
 
        return nmspace[incldepth];
 
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.