scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <stdio.h>
 2#include <string.h>
 3
 4#include <scc/ar.h>
 5#include <scc/mach.h>
 6#include "libmach.h"
 7
 8int
 9archive(FILE *fp)
10{
11	int n;
12	fpos_t pos;
13	char magic[SARMAG];
14
15	fgetpos(fp, &pos);
16
17	n = fread(magic, SARMAG, 1, fp);
18	if (n == 1 && strncmp(magic, ARMAG, SARMAG) == 0)
19		return 1;
20
21	fsetpos(fp, &pos);
22
23	return 0;
24}