source: icGREP/icgrep-devel/cudd-2.5.1/util/test-sav.c @ 5820

Last change on this file since 5820 was 4597, checked in by nmedfort, 4 years ago

Upload of the CUDD library.

File size: 725 bytes
Line 
1#include <stdio.h>
2#include "util.h"
3
4
5/* ARGSUSED */
6static int
7saveit(prog, file2)
8char *prog, *file2;
9{
10    char *file1;
11
12    /* get current executable name by searching the path ... */
13    file1 = util_path_search(prog);
14    if (file1 == 0) {
15        (void) fprintf(stderr, "cannot locate current executable\n");
16        return 1;
17    }
18
19    /* users name for the new executable -- perform tilde-expansion */
20    if (! util_save_image(file1, file2)) {
21        (void) fprintf(stderr, "error occured during save ...\n");
22        return 1;
23    }
24    FREE(file1);
25    return 0;
26}
27
28int restart;
29
30main(argc, argv)
31char **argv;
32{
33    if (restart) {
34        (void) printf("restarted ...\n");
35        exit(0);
36    }
37    restart = 1;
38    exit(saveit(argv[0], "foobar"));
39}
Note: See TracBrowser for help on using the repository browser.