wmcore: use CC variable.
[dockapps.git] / wmacpiload / src / battest.c
blob924177fab80df3989bfb209c1d4d8c71a7552eef
1 #include <stdio.h>
3 int i;
4 FILE *fd;
5 int temp;
6 char *buf;
9 main() {
10 buf=(char *)malloc(sizeof(char)*512);
11 for (i=0;i<20000;i++) {
12 if ((fd = fopen("/proc/acpi/battery/BAT0/state", "r"))) {
13 bzero(buf, 512);
14 fseek(fd,57,0);
15 fscanf(fd, "charging state: %s", buf);
17 printf("We are at loop %d and charging is %s\n",i,buf);
18 fclose(fd);
21 free(buf);