📄 tools.h
字号:
#ifndef TOOLS_H
#define TOOLS_H
/*---------------------------------------------------------------------------------------------*/
struct file_info {
char *name;
FILE *fp;
struct {
unsigned int compressed : 1; /* is the file compressed */
unsigned int pipe : 1; /* the file is a pipe */
unsigned int eof : 1; /* has end of line been reached */
} flags;
int error; /* error code or 0 if OK */
long lineno; /* line number we are on */
};
/*---------------------------------------------------------------------------------------------*/
struct entries *alloc_entries(void);
int label_not_needed(int level);
struct entries *copy_entries(struct entries *entr);
struct data_entry *rewind_entries(struct entries *entries, eptr *ptr);
struct data_entry *next_entry(eptr *ptr);
void free_entrys(struct data_entry *data);
void close_entries(struct entries *entries);
struct data_entry *copy_entry(struct entries *entries, struct data_entry *data);
struct data_entry *init_entry(struct entries *entr, struct data_entry *entry);
void free_entry(struct data_entry *entry);
int alpha_read(float *alpha, long noc, char *infile);
int alpha_write(float *alpha, long noc, char *outfile);
void invalidate_alphafile(char *outfile);
int set_teach_params(struct teach_params *params, struct entries *codes,
struct entries *data, long dbuffer);
/*---------------------------------------------------------------------------------------------*/
struct file_info *open_file(char *name, char *fmode);
static struct file_info *alloc_file_info(void);
int close_file(struct file_info *fi);
static char *check_for_compression(char *name);
char *getline(struct file_info *fi);
/*---------------------------------------------------------------------------------------------*/
#ifndef TOOLS_C
extern struct typelist topol_list[], neigh_list[], snapshot_list[];
#endif /*TOOLS_C*/
/*---------------------------------------------------------------------------------------------*/
#define fi2fp(fi) ((fi != NULL) ? (fi)->fp : NULL)
#define alloc_entry(entr) init_entry((entr), NULL)
#ifndef STR_LNG
#define STR_LNG 1000
#endif
#ifndef ABS_STR_LNG
#define ABS_STR_LNG 10000
#endif
#endif /*TOOLS_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -