1 /*
2  * $Id: list_rngs.c 420 2008-08-18 18:29:17Z rgb $
3  *
4  * See copyright in copyright.h and the accompanying file COPYING
5  */
6 
7 /*
8  * ========================================================================
9  * These two functions JUST output a "standard header" with version and
10  * copyright information for use in various output routines or the version
11  * information alone.  Note that version might be e.g. 3.28.0beta, that
12  * is, it may not be strictly numerical.
13  * ========================================================================
14  */
15 
16 #include "dieharder/libdieharder.h"
17 
18 /*
19  * dh_header isn't QUITE trivial, because the version string can vary in
20  * length.  If it is longer than around 20 characters, this is going to
21  * make ugly output but nothing should "break".  Note that we assume 80
22  * character lines, sorry.
23  */
24 
25 #define LINE_LENGTH 80
dh_header()26 void dh_header()
27 {
28 
29  int i,half,version_length;
30 
31  version_length = strlen(QUOTEME(VERSION));
32 
33  fprintf(stdout,"#=============================================================================#\n");
34  fprintf(stdout,"#");
35  /* Pad the front */
36  half = (LINE_LENGTH - 48 - version_length - 2)/2;
37  for(i=0;i<half;i++){
38    fprintf(stdout," ");
39  }
40  fprintf(stdout,"dieharder version %s Copyright 2003 Robert G. Brown",QUOTEME(VERSION));
41  /* Pad the rear */
42  half = LINE_LENGTH - 52 - version_length - half;
43  for(i=0;i<half;i++){
44    fprintf(stdout," ");
45  }
46  fprintf(stdout,"#\n");
47  fprintf(stdout,"#=============================================================================#\n");
48 
49 }
50 
dh_version()51 void dh_version()
52 {
53  fprintf(stdout,"%s\n",QUOTEME(VERSION));
54 }
55