ddl任务的新增函数

This commit is contained in:
psyyds 2021-12-17 10:54:49 +08:00
parent cb81c3b42a
commit 22f185492d
7 changed files with 44 additions and 4 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
/out/build/x64-Debug
/.vscode
/out/
/build

View File

@ -21,7 +21,7 @@ add_library(GuiLib "gui/WndUtil.h" "gui/WndUtil.c")
add_executable(TeamProject
main.c "console/ConsoleSettings.c" "console/ConsoleSettings.h"
gui/WndUtil.c gui/WndUtil.h linked_list/struct_def.h
gui/WndUtil.c gui/WndUtil.h linked_list/struct_def.h
note_byHYL/note.h)
# hylTest
@ -31,3 +31,6 @@ add_executable(hylTest note_byHYL/note.h note_byHYL/note.c note_byHYL/note_add.c
add_executable(jzyTest note_by_jzy/note.c note_by_jzy/note.h note_by_jzy/menu.c note_by_jzy/menu.h note_by_jzy/test.c note_by_jzy/notebook.c note_by_jzy/notebook.h)
target_link_libraries(jzyTest ConsoleLib)
target_link_libraries(jzyTest GuiLib)
#psTest
add_executable(psTest note_by_ps/addnew.c note_by_ps/test.c linked_list/struct_def.h inout/ddlinout.c inout/ddlinout.h)

View File

@ -105,7 +105,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
return 0;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case 0x0:
case 0x0: {
RECT tmp;
GetClientRect(hWnd, &tmp);
WCHAR wstr[100];
@ -113,6 +113,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
tmp.bottom, text_metric.tmHeight);
MessageBox(hWnd, wstr, L"Button clicked", MB_OK);
break;
}
case 0x01:
// TODO: 添加消息框
break;

View File

@ -21,7 +21,7 @@ day_data read_info(void) {
date read_date() {
// 时间字符串长固定, 为 17
start:
start:;
wchar_t date_str[DATE_STR_LEN + 1];
wscanf(L"%ls", date_str);
if (wcslen(date_str) != 17) {

View File

@ -27,6 +27,6 @@ typedef struct m_day_data {//每天项目内容
typedef struct m_day_node {//链表
day_data data;//内容
struct m_day_node *next;//下一个链表的信息
} linked_list, *list_head;
} linked_list,*list_head;
#endif //TEAMPROJECT_STRUCT_DEF_H

28
note_by_ps/addnew.c Normal file
View File

@ -0,0 +1,28 @@
#include<stdio.h>
#include <stdlib.h>
#include "../linked_list/struct_def.h"
#include "../inout/ddlinout.h"
void addnew(list_head head){
linked_list *ok_list=head;
linked_list *now;
linked_list *new_node =(linked_list*) malloc(sizeof(linked_list));
day_data dd = read_info();
if(head->next=NULL){
head->next=new_node;
}
for(now= head; (now->next)!=NULL; now = now->next){
if(new_node->data.due_date.year<=now->next->data.due_date.year){
if(new_node->data.due_date.month<=now->next->data.due_date.month){
if(new_node->data.due_date.day<=now->next->data.due_date.day){
new_node->next=now->next;
now->next=new_node;
}
}
}
}
if((now->next)==NULL)
now->next=new_node;
return(ok_list);
}

7
note_by_ps/test.c Normal file
View File

@ -0,0 +1,7 @@
#include <stdio.h>
int main(int argc, char const *argv[])
{
printf("A");
return 0;
}