⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cd_data.h

📁 《linux程序设计(第三版)》例程代码
💻 H
字号:
/* The catalog table */#define CAT_CAT_LEN       30#define CAT_TITLE_LEN     70#define CAT_TYPE_LEN      30#define CAT_ARTIST_LEN    70typedef struct {    char catalog[CAT_CAT_LEN + 1];    char title[CAT_TITLE_LEN + 1];    char type[CAT_TYPE_LEN + 1];    char artist[CAT_ARTIST_LEN + 1];} cdc_entry;/* The tracks table, one entry per track */#define TRACK_CAT_LEN     CAT_CAT_LEN#define TRACK_TTEXT_LEN   70typedef struct {    char catalog[TRACK_CAT_LEN + 1];    int  track_no;    char track_txt[TRACK_TTEXT_LEN + 1];} cdt_entry;/* Now that we have some data structures, we can define some access routines that we'll need. Functions with cdc_ are for catalog entries; functions with cdt_ are for track entries. Notice that some of the functions return data structures. We can indicate the failure of these functions by forcing the contents of the structure to be empty.*//* Initialization and termination functions */int database_initialize(const int new_database);void database_close(void);/* two for simple data retrieval */cdc_entry get_cdc_entry(const char *cd_catalog_ptr);cdt_entry get_cdt_entry(const char *cd_catalog_ptr, const int track_no);/* two for data addition */int add_cdc_entry(const cdc_entry entry_to_add);int add_cdt_entry(const cdt_entry entry_to_add);/* two for data deletion */int del_cdc_entry(const char *cd_catalog_ptr);int del_cdt_entry(const char *cd_catalog_ptr, const int track_no);/* one search function */cdc_entry search_cdc_entry(const char *cd_catalog_ptr, int *first_call_ptr);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -