summaryrefslogtreecommitdiff
path: root/Examples/guile/port/example.c
blob: 95867b68710fdba88f641e3f70c70038b51050c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <errno.h>

void print_int(FILE *f, int i)
{
  if (fprintf(f, "%d\n", i)<0)
    perror("print_int");
}

int read_int(FILE *f)
{
  int i;
  if (fscanf(f, "%d", &i)!=1) {
    fprintf(stderr, "read_int: error reading from file\n");
    perror("read_int");
  }
  return i;
}