-
Notifications
You must be signed in to change notification settings - Fork 2
/
ccode.h
57 lines (47 loc) · 987 Bytes
/
ccode.h
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
43
44
45
46
47
48
49
50
51
52
53
54
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <time.h>
#include "tinyexpr.h"
#include <dirent.h>
#include <sys/stat.h>
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Chart.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
int fexist(const char *a_option)
{
char dir1[PATH_MAX];
char *dir2;
DIR *dip;
strncpy( dir1 , "", PATH_MAX );
strncpy( dir1 , a_option, PATH_MAX );
struct stat st_buf;
int status;
int fileordir = 0 ;
status = stat ( dir1 , &st_buf);
if (status != 0) {
fileordir = 0;
}
FILE *fp2check = fopen( dir1 ,"r");
if( fp2check ) {
fileordir = 1;
fclose(fp2check);
}
if (S_ISDIR (st_buf.st_mode)) {
fileordir = 2;
}
return fileordir;
}