source: SHX/trunk/sandbox/static.c @ 120

Revision 120, 335 bytes checked in by marcus, 11 years ago (diff)
  • update command structure
  • some efforts to handle static var issue
Line 
1// build shared lib via
2// gcc -shared -o staticlib.so static.c
3
4#include <stdio.h>
5
6static FILE *fp;
7
8void open()
9{
10        //puts("open");
11        fp = fopen("static.c", "r");
12 
13        if (fp == NULL)
14        {
15                puts("cannot open file");
16        } else {
17                //puts("successful");
18        }
19}
20
21void close()
22{
23        //puts("close");
24       
25        fclose(fp);
26}
27
28int main()
29{
30        puts("main");
31}
Note: See TracBrowser for help on using the repository browser.