// C的精华在指针 指针的精华在函数指针
int insert_linklist_mount(FILE *p ,Ocean_Element **wordtemp, char**s,uint32_t mount);
回调函数实现接口设计
32行 回调函数 主要功能 向链表插入从文件p 中读出的两行数据 第二参数传入传出参数 初始化结构并传出 第三参数char **s 堆上的空间用来接收文件内容 mount 用来指定想链表中插入Ocean_Element 结构(记录)的个数
//dzm_project
2 #ifndef _HABITS
3 #define _HABITS
4 #include <malloc.h>
5 #include <stdio.h>
6 #include <string.h>
7 #include "simplified.h"
8 #define READ_LEN 150
9 #define CHIN_LEN 150
10 #define WORK_LEN 150
11 typedef struct _OCEAN
12 {
13 char *word;
14 char *chin[CHIN_LEN];
15 uint32_t count ;
16 struct _OCEAN* maintain;
17 struct _OCEAN* next;
18 struct _OCEAN* prev;
19 }Ocean_Element;
20
21 typedef void(*Tpfocus) (FILE *p, Ocean_Element** temp, char **s);
22
23 extern Ocean_Element *head;
24
25 int receive_vw_count(uint32_t *count);
26 void preserve_chin_array(Ocean_Element **node, char* tempword, char **arp);
27 void creat_virtual(Ocean_Element **list);
28 int read_file_line(FILE* p, Ocean_Element **wordtemp, char** s);
29 void judge_changeline(char ** para);
30 int judge_char(char **par, char val);
31 int egodic_list(void);
32 int insert_linklist_mount(FILE *p ,Ocean_Element **wordtemp, char**s,uint32_t mo unt);
33 char* cpy_str(char **dest, char **src);
34 char* judge_delete_ch(char**para, char ch) ;
35 char* user_search(char **s);
36 int search_word(Ocean_Element *temp, const char * str);
37
38 void main_task(FILE *p, Ocean_Element **wordtemp, char**s);
|