feat: acquire-core full legacy C corpus (~2066 files, build-verified) + generator + inventory
This commit is contained in:
commit
b96cf702ee
2897 changed files with 264970 additions and 0 deletions
27
app/shared/include/acq_util.h
Normal file
27
app/shared/include/acq_util.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* acq_util.h - 공통 유틸리티 (일자/금액/전문) 선언 (공유)
|
||||
*/
|
||||
#ifndef ACQ_UTIL_H
|
||||
#define ACQ_UTIL_H
|
||||
|
||||
#include "msg_layout.h"
|
||||
|
||||
int date_is_valid(const char *yyyymmdd);
|
||||
int date_weekday(const char *yyyymmdd);
|
||||
int date_is_weekend(const char *yyyymmdd);
|
||||
int date_next_business(const char *yyyymmdd, char *out);
|
||||
void date_today(char *out);
|
||||
|
||||
long amount_parse(const char *field, int len);
|
||||
int amount_format(long amount, char *out, int len);
|
||||
void amount_format_won(long amount, char *out, int outlen);
|
||||
int amount_is_valid(long amount);
|
||||
|
||||
void msg_field_copy(char *out, const char *field, int len);
|
||||
void msg_field_set(char *field, const char *src, int len);
|
||||
void msg_field_set_num(char *field, const char *src, int len);
|
||||
int msg_unpack(acq_msg_t *msg, const char *raw, int rawlen);
|
||||
int msg_pack(const acq_msg_t *msg, char *raw, int rawlen);
|
||||
int msg_validate(const acq_msg_t *msg);
|
||||
|
||||
#endif /* ACQ_UTIL_H */
|
||||
43
app/shared/include/msg_layout.h
Normal file
43
app/shared/include/msg_layout.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* msg_layout.h - 카드 매입 전문(電文) 고정길이 레이아웃 (공유)
|
||||
*/
|
||||
#ifndef MSG_LAYOUT_H
|
||||
#define MSG_LAYOUT_H
|
||||
|
||||
#define MSG_TYPE_RECV "0200"
|
||||
#define MSG_TYPE_RESP "0210"
|
||||
#define MSG_TYPE_RECON "0500"
|
||||
|
||||
#define RESP_OK "0000"
|
||||
#define RESP_INVALID "9001"
|
||||
#define RESP_NOMERCH "9002"
|
||||
#define RESP_SYSERR "9999"
|
||||
|
||||
typedef struct {
|
||||
char msg_type[4];
|
||||
char trans_code[6];
|
||||
char merch_id[15];
|
||||
char card_no[16];
|
||||
char approval_no[9];
|
||||
char amount[12];
|
||||
char txn_date[8];
|
||||
char txn_time[6];
|
||||
char inst_month[2];
|
||||
char resp_code[4];
|
||||
char filler[18];
|
||||
} acq_msg_t;
|
||||
|
||||
#define MSG_ACQ_LEN ((int)sizeof(acq_msg_t))
|
||||
|
||||
#define FLD_MSG_TYPE_LEN 4
|
||||
#define FLD_TRANS_CODE_LEN 6
|
||||
#define FLD_MERCH_ID_LEN 15
|
||||
#define FLD_CARD_NO_LEN 16
|
||||
#define FLD_APPROVAL_LEN 9
|
||||
#define FLD_AMOUNT_LEN 12
|
||||
#define FLD_TXN_DATE_LEN 8
|
||||
#define FLD_TXN_TIME_LEN 6
|
||||
#define FLD_INST_LEN 2
|
||||
#define FLD_RESP_LEN 4
|
||||
|
||||
#endif /* MSG_LAYOUT_H */
|
||||
Reference in a new issue