File: mmain.c

package info (click to toggle)
lmemory 0.6c-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,092 kB
  • ctags: 173
  • sloc: sh: 5,739; ansic: 761; makefile: 75
file content (42 lines) | stat: -rw-r--r-- 943 bytes parent folder | download | duplicates (11)
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
/* 
 *  Linux memory game
 *  By Xiaoguang Zhang
 */

#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include "lmemory.h"

int
main (int argc, char *argv[])
{
  gint x, z, i, j, k;
  char buf[40];
  struct stat statbuf;


  gtk_init (&argc, &argv);

/* read LMEM_PIX_DIR environment variable first before resorting to default
  path for pixmap files --- contributed by philippe.capdepuy@libertysurf.fr */

  lmem_image_dir = getenv("LMEM_PIX_DIR");
  if (stat (lmem_image_dir, &statbuf))
      asprintf (&lmem_image_dir, "%s/pixmaps/", DATADIR);
  if (stat (lmem_image_dir, &statbuf))
      lmem_image_dir = "/usr/share/pixmaps/";
  if (stat (lmem_image_dir, &statbuf))
      lmem_image_dir = "/usr/share/icons/";
  printf ("Using `%s' for image dir\n", lmem_image_dir);

  /* create a new window and setup the pixmaps */
  lmem_setup();

  gtk_main ();

  return 0;
}