学生管理系统 makefile, 内容拆分

This commit is contained in:
2023-07-21 11:16:42 +08:00
parent 048a4d83ac
commit 218ac64079
12 changed files with 609 additions and 0 deletions
@@ -0,0 +1,38 @@
#ifndef __COLOR_E_H__
#define __COLOR_E_H__
// 属性定义枚举头文件
typedef enum front_color_e
{
BLACK = 30, // 黑色
RED, // 红色
GREEN, // 绿色
YELLOW, // 黄色
BLUE, // 蓝色
PURPLE, // 紫色
CYAN, // 青色
WHITE, // 白色
} Front_Color; // 前景色
typedef enum back_color_e
{
BLACK_B = 40, // 黑色
RED_B, // 红色
GREEN_B, // 绿色
YELLOW_B, // 黄色
BLUE_B, // 蓝色
PURPLE_B, // 紫色
CYAN_B, // 青色
WHITE_B, // 白色
} Back_Color; // 背景色
typedef enum attr_e
{
BOLD = 1, // 加粗
UNDERLINE = 4, // 下划线
BLINK, // 闪烁
REVERSE = 7, // 反显
HIDE, // 隐藏
} Attr; // 文本属性
#endif
+22
View File
@@ -0,0 +1,22 @@
#ifndef __LINK_H__
#define __LINK_H__
#include <stdio.h>
#include <stdlib.h> // malloc
#include <string.h> // strcpy
#include "stu_s.h"
#include "color_e.h"
// 函数声明头文件
// 不需要添加 extern,因为在头文件中定义的函数默认是 extern
void swap(STU *a, STU *b);
STU *insert_stu(STU *head, STU *item);
STU *delete_stu(STU *head, char sid);
void shows(STU *head);
STU *find_stu(STU *head, char sid);
STU *update_stu(STU *head, char sid);
STU *sort_stu(STU *head);
STU *reverse_stu(STU *head);
void saveToFile(STU *head, const char *filename);
STU *readFromFile(const char *filename);
#endif
+15
View File
@@ -0,0 +1,15 @@
#ifndef __STU_S_H__
#define __STU_S_H__
// 学生信息结构体头文件
// 定义学生信息结构体,链表的节点
typedef struct stu_s
{
int sid;
char name[32];
int age;
struct stu_s *next;
} STU;
#endif