refraction part 4
[mancala] / src / launcher / mancala-launcher.c
1 /**
2    @file crazyparking.c
3
4    Wrapper crazyparking launcher
5    <p>
6    Copyright (c) 2005 INdT. All eigths reserved.
7
8    @author Andre Moreira Magalhaes <andre.magalhaes@indt.org.br>
9 */
10
11 #include <stdio.h>
12 #include <unistd.h>
13
14 char *argh[] = { "/usr/games/wrapper/wrapper",
15                  "/home/opt/mancala/data/mancala.game",
16                  NULL };
17
18 int main(int argc, char *argv[])
19 {
20     
21     FILE *pFile;
22     
23     pFile = fopen ("/home/rzingg/mancala.debug", "a");
24     if (pFile) {
25         fprintf (pFile, "app launched...\n");
26         fclose (pFile);
27     }
28     
29     if (execv ("/usr/games/wrapper/wrapper", argh) == -1) {
30         pFile = fopen ("/home/rzingg/mancala.debug", "a");
31         if (pFile) {
32             fprintf (pFile, "cannot execute wrapper...\n");
33             fclose (pFile);
34         }
35     }
36
37     return 0;
38 }