2 * sparse/smatch_files.c
4 * Copyright (C) 2009 Dan Carpenter.
6 * Licensed under the Open Software License version 1.1
16 static int open_file(const char *filename
)
19 char *buf
= malloc(256);
21 fd
= open(filename
, O_RDONLY
);
26 strncpy(buf
, data_dir
, 254);
28 strncat(buf
, filename
, 254 - strlen(buf
));
29 fd
= open(buf
, O_RDONLY
);
38 struct token
*get_tokens_file(const char *filename
)
45 fd
= open_file(filename
);
48 token
= tokenize(filename
, fd
, NULL
, NULL
);