#ifdef TARGET1

#include "pcn_types.h"

#ifdef SYSV
#include <fcntl.h>
#else  /* SYSV */
#include <sys/file.h>
#endif /* SYSV */


open_file(F,D)
char *F;
int_t *D;
{
    *D = (int_t) open(F,(O_TRUNC | O_WRONLY | O_CREAT),0666);
}

write_char(F,C)
int_t *F;
u_int_t *C;
{
    unsigned char c = (unsigned char)(*C);
    if(write((int) *F, &c, 1) != 1)
	printf("Error: writing to binary file\n");
}

close_file(F)
int_t *F;
{
    if(close((int) *F) != 0)
	printf("Error: when closing binary file\n");
}

#endif TARGET1
