-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbview.c
41 lines (32 loc) · 862 Bytes
/
bview.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
/**
# Basilisk View "dump files" server
This can be used to interactively display [dump files](output.h#dump)
using the [javascript interface](jview/README).
Typical usage is:
~~~bash
bview3D /path/to/file/dump
~~~
(note that the appropriate 2D/3D version must be chosen). The
connection URL for the client will then be displayed. */
#define DISPLAY 0
#define DISPLAY_NO_CONTROLS
#include "display.h"
int main (int argc, char * argv[])
{
char * file = argc > 1 ? argv[1] : "dump";
if (!restore (file = file, list = all)) {
fprintf (stderr, "%s: could not restore from '%s'\n", argv[0], file);
exit (1);
}
restriction (all);
fields_stats();
fputc ('\n', stderr);
display_url (stderr);
fputc ('\n', stderr);
display ("box();");
while (1) {
if (display_poll (-1))
display_update (INT_MAX);
}
display_destroy();
}