#include
#include
#include
#ifndef MKFILE_AC_
#define PAY 0
#define INCOME 1
#define DATA 2
#define MKFILENAME(action) ((action == INCOME) ? "income/log" : ((action == PAY) ? "pay/log" : "stock/data"))
#define MKDIR(action) ((action == INCOME) ? system("mkdir income") : system("mkdir pay"))
#endif
#ifndef EXIT_CODE_
#define NORMAL 0
#endif
#ifndef STRUCT_AC_
#define ITEMS 20
typedef struct account{
char items[ITEMS];
double amount;
time_t time;
}Account;
#endif
#ifndef STRUCT_KEY_
#define KEY_LONG 20
typedef struct key{
char word[KEY_LONG];
time_t from;
time_t to;
}Key;
#endif
#ifndef STRUCT_STOCK_
#define MATERIAL_LONG 20
#define STRUCT_STOCK
typedef struct stock_data {
char material[MATERIAL_LONG];
double number;
double price;
}Data;
typedef struct stock_log {
Data data;
time_t time;
char action[5];
double value;
}Log;
#endif
//yean
#ifndef PRICE_
#define NI_PRICE 2 // 水泥单价
#define SHA_PRICE 1
#endif
#include
#include
int clear(void);
#include
//stock
#ifndef STRUCT_STOCK_
#define MATERIAL_LONG 20
#define STRUCT_STOCK
typedef struct stock_data {
char material[MATERIAL_LONG];
double number;
double price;
}Data;
typedef struct stock_log {
Data data;
time_t time;
char action[5];
double value;
}Log;
#endif
enum event{IN, OUT};
#ifndef MKFILE_STOCK_
#define DATA 0
#define LOG 1
#define YEANLOG 2
#define MKFILENAME(action) ((action == DATA) ? "stock/data": ((action == LOG) ? "stock/log" : "yean/log"))
#define MKDIR(path) system("mkdir " #path)
#endif
#include
#include
#include
#include "define.h"
Data *getdata(FILE *fp, const int action, Log *data_ptr);
#include
#include
#include
#include "account.h"
int getkey(Key *keydata);
#include
#include
time_t gettime(time_t *result);
#include
#include
#include
int income_main(void);
int income(void);
#include
#include
#include
extern int menu(const int n, const int select);
extern int stock_main(void);
extern int yean_main(void);
extern int pay_main(void);
extern int income_main(void);
#include
int menu(const int n, const int select);
#include
#include
enum op_case{MAIN, STOCK, YEAN, ACCOUNT};
int option(const int select);
#include
#include
#include
#include "account.h"
int pay_main(void);
int pay(void);
#include
#include "define.h"
size_t putdata(FILE *fp, const Data dat);
#include
#include
#include "account.h"
double query(const Key key, const int action);
#include "stock.h"
#include
int readlog(void);
#include
#include
#include "define.h"
Data *seach(FILE *fp, const char *key, Data *data);
#include
#include
#include
#include
#include "define.h"
int readlog(void);
int getstock(void);
int stock_main(void);
int stock(const int action);
#include
#include "define.h"
size_t writelog(FILE *fp,const void *log, size_t n);
#include
#include
#include
#include
#include "define.h"
#ifndef PRICE_
#define SHA_RATIO 8 // 石沙比例
#define NI_RATIO 2
#define NI_PRICE 2 // 水泥单价
#define SHA_PRICE 1
#define STEP 0
#define BRICK_PRICE (NI_PRICE * NI_RATIO) + (SHA_PRICE * SHA_RATIO) + STEP
#endif
typedef struct yean_log {
int people;
time_t time;
double brick;
}Yean_log;
int yean_main(void);
int yean(void);
int yeanlog(void);
extern time_t getdate(time_t *result);
extern size_t putdata(FILE *fp, const Data data);
extern Data *seach(FILE *fp, const char *key, Data *data);
extern size_t writelog(FILE *fp,const void *log, size_t n);
extern time_t gettime(time_t *result);
阅读(565) | 评论(0) | 转发(0) |