view conv/cbc2c.c @ 556:ef225b589888 s-dandy-work

s-dandy fix emit_copy register parallel rassign struct init alignment MIPS fregister save
author kono
date Fri, 06 Jan 2006 21:19:13 +0900
parents 0b068058dd67
children df04bc5fd5fe
line wrap: on
line source

#define EXTERN /**/

#include "mc.h"

static void open(char *);
static void print(char *);
static void close();
static void comment(char *s);

Converter cbc2c_converter = {
    &open,
    &print,
    &close,
    &comment,
};

static FILE *vout;

static void
comment(char *s)
{
}

static void
open(char *s)
{
    char *p=cheapp;
    while((*cheapp++ = *s++)) {
        if (*s=='.') {
            *cheapp++=*s++; *cheapp++='c';
            *cheapp++='c'; *cheapp++=0;
            break;
        }
    }
    vout = fopen(p,"w");
    if(!vout) error(-1);
}

static void
print(char *s)
{
    fprintf(vout,"c: %s\n",s);
}

static void
close()
{
    fclose(vout);
}