forked from arminbiere/lingeling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lglbnr.c
54 lines (50 loc) · 1.56 KB
/
lglbnr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*-------------------------------------------------------------------------*/
/* Copyright 2010-2018 Armin Biere Johannes Kepler University Linz Austria */
/*-------------------------------------------------------------------------*/
#include "lglib.h"
#include "lglcfg.h"
#include "lglcflags.h"
#include <stdio.h>
#include <string.h>
#include <assert.h>
void lglbnr (const char * name, const char * prefix, FILE * file) {
const char * p = LGL_CFLAGS, * q, * n;
int len = 78 - strlen (prefix);
fprintf (file, "%s%s\n", prefix, name);
fprintf (file, "%s\n", prefix);
fprintf (file, "%sVersion %s %s\n", prefix, LGL_VERSION, LGL_ID);
fprintf (file, "%s\n", prefix);
fprintf (file,
"%sCopyright (C) 2010-2016 Armin Biere JKU Linz Austria.\n",
prefix);
fprintf (file, "%sAll rights reserved.\n", prefix);
fprintf (file, "%s\n", prefix);
fprintf (file, "%sreleased %s\n", prefix, LGL_RELEASED);
fprintf (file, "%scompiled %s\n", prefix, LGL_COMPILED);
fprintf (file, "%s\n", prefix);
fprintf (file, "%s%s\n", prefix, LGL_CC);
assert (*p);
for (;;) {
fputs (prefix, file);
for (q = p; *q && *q != ' '; q++)
;
if (*q && q - p < len) {
for (;;) {
for (n = q + 1; *n && *n != ' '; n++)
;
if (n - p >= len) break;
q = n;
if (!*n) break;
}
}
while (p < q) fputc (*p++, file);
fputc ('\n', file);
if (!*p) break;
assert(*p == ' ');
p++;
}
fprintf (file, "%s%s\n", prefix, LGL_OS);
fprintf (file, "%s\n", prefix);
fflush (file);
}
const char * lglversion (void) { return LGL_VERSION " " LGL_ID; }