-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
61 lines (50 loc) · 1.47 KB
/
main.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
55
56
57
58
59
60
61
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
#include "netconv.h"
#include "unfold.h"
#include "output.h"
/*****************************************************************************/
void usage(char *myname)
{
fprintf(stderr,
"Unfolder -- unfolder for nets with read arcs\n\n"
"Usage: unfolder -[lLd] <LLnetfile>\n"
"\t-l outputs the net in ll_net format\n"
"\t-L outputs the net in ll_net format with the extension of"
"histories\n"
"\t-d outputs the net in dot file format [default] \n\n"
"Unfolder is a spin-off from Mole that works for nets with read arcs.\n"
"The output is a dot-compatible graph of the result.\n\n"
"Version 0.0.1 (14.06.2009)\n");
exit(1);
}
/*****************************************************************************/
/**
* Main function, calls all necessary function for unfolding the net
* \param argc
* \param argv
* \return the exitcode
*/
int main (int argc, char **argv)
{
if (argc == 2 || argc == 3) {
char *llnet = argv[argc-1];
char *stoptr_name = NULL;
net = read_pep_net(llnet);
nc_static_checks(net,stoptr_name);
unfold();
if (argc == 3) {
if (strcmp(argv[1], "-l")==0)
write_ll_net(unf, cutoff_list, UNF_FALSE);
else if (strcmp(argv[1], "-L")==0)
write_ll_net(unf, cutoff_list, UNF_TRUE);
else if (strcmp(argv[1], "-d")==0)
write_dot_output(unf, cutoff_list);
} else
write_dot_output(unf, cutoff_list);
} else
usage(argv[0]);
return exitcode;
}