From 9fb682770176e6680a1f4002b180e8bfae2861a5 Mon Sep 17 00:00:00 2001 From: Julia Desmazes Date: Mon, 18 Sep 2023 17:46:13 -0700 Subject: [PATCH] MAKE,DOC,C: Make release recipe, added generated c files, update readme with build instructions --- .gitignore | 4 +- README.md | 25 ++ gen/ouch_enum.h | 218 ++++++++++++ gen/ouch_enum_print.c | 675 ++++++++++++++++++++++++++++++++++++ gen/ouch_enum_print.h | 21 ++ gen/ouch_in_struct_elem.h | 4 + gen/ouch_out_struct_elem.h | 14 + gen/ouch_struct.h | 169 +++++++++ gen/ouch_struct_in_read.c | 31 ++ gen/ouch_struct_in_read.h | 1 + gen/ouch_struct_in_write.c | 40 +++ gen/ouch_struct_in_write.h | 1 + gen/ouch_struct_out_read.c | 59 ++++ gen/ouch_struct_out_read.h | 1 + gen/ouch_struct_out_write.c | 87 +++++ gen/ouch_struct_out_write.h | 1 + gen/ouch_struct_print.c | 297 ++++++++++++++++ gen/ouch_struct_print.h | 18 + gen/ouch_union.h | 78 +++++ gen/ouch_union_print.c | 264 ++++++++++++++ gen/ouch_union_print.h | 5 + makefile | 21 +- 22 files changed, 2022 insertions(+), 12 deletions(-) create mode 100644 gen/ouch_enum.h create mode 100644 gen/ouch_enum_print.c create mode 100644 gen/ouch_enum_print.h create mode 100644 gen/ouch_in_struct_elem.h create mode 100644 gen/ouch_out_struct_elem.h create mode 100644 gen/ouch_struct.h create mode 100644 gen/ouch_struct_in_read.c create mode 100644 gen/ouch_struct_in_read.h create mode 100644 gen/ouch_struct_in_write.c create mode 100644 gen/ouch_struct_in_write.h create mode 100644 gen/ouch_struct_out_read.c create mode 100644 gen/ouch_struct_out_read.h create mode 100644 gen/ouch_struct_out_write.c create mode 100644 gen/ouch_struct_out_write.h create mode 100644 gen/ouch_struct_print.c create mode 100644 gen/ouch_struct_print.h create mode 100644 gen/ouch_union.h create mode 100644 gen/ouch_union_print.c create mode 100644 gen/ouch_union_print.h diff --git a/.gitignore b/.gitignore index aa48ed1..a2de808 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.o +*.a gen_flag -gen/*.h -gen/*.c test +release diff --git a/README.md b/README.md index ce4bd5e..1edeb41 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,31 @@ The python script and generated content can be found in the `gen` directory. `xml` format file can found in the `doc` directory. +## Build library + +To build the static library `libouch.a` : + +``` +make lib +``` + +## Build release + +To build a release and have it packaged in the `release` directory : + +``` +make release +``` + + +## Build test + +To test the build: + +``` +make test +``` + ## Sources Reference OUCH 5.0 specification : http://nasdaqtrader.com/content/technicalsupport/specifications/TradingProducts/Ouch5.0.pdf diff --git a/gen/ouch_enum.h b/gen/ouch_enum.h new file mode 100644 index 0000000..a6e5cf7 --- /dev/null +++ b/gen/ouch_enum.h @@ -0,0 +1,218 @@ +typedef enum { + IMBALANCE_ONLY = 'I', + RETAIL_ORDER_TYPE_1 = 'O', + RETAIL_ORDER_TYPE_2 = 'T', + RETAIL_PRICE_IMPROVEMENT = 'Q', + EXTENDED_LIFE_CONTINUOUS = 'B', + DIRECT_LISTING_CAPITAL_RAISE = 'D', + RETAIL_PRICE_IMPROVEMENT_HIDDEN = 'R', + NO_INSTRUCTIONS = ' ' +} eHandleInst; + +typedef enum { + ZERO_ZERO_DOT_TWO = '0', + ZERO_DOT_TWO_ONE = '1', + ONE_TWO = '2', + GREATER_THAN_TWO = '3', + UNSPECIFIED = ' ', + SETS_QBBO = 'S', + IMPROVES_NBBO = 'N' +} eBBOWeightIndicator; + +typedef enum { + YES = 'Y', + NO = 'N' +} eYesNo; + +typedef enum { + POST_ONLY = 'P', + POST_NO = 'N' +} ePostOnly; + +typedef enum { + CUSTOMER_RETAIL = 'R', + CUSTOMER_NOT_RETAIL = 'N' +} eCustomerType; + +typedef enum { + DISCRETION_PRICE_TYPE_LIMIT = 'L', + DISCRETION_PRICE_TYPE_MARKET_PEG = 'P', + DISCRETION_PRICE_TYPE_MIDPOINT_PEG = 'M', + DISCRETION_PRICE_TYPE_PRIMARY_PEG = 'R' +} eDiscretionPriceType; + +typedef enum { + PRICE_TYPE_LIMIT = 'L', + PRICE_TYPE_MARKET_PEG = 'P', + PRICE_TYPE_MIDPOINT_PEG = 'M', + PRICE_TYPE_PRIMARY_PEG = 'R', + PRICE_TYPE_MARKET_MAKER_PEG = 'Q', + PRICE_TYPE_MIDPOINT = 'm' +} ePriceType; + +typedef enum { + BUY = 'B', + SELL = 'S', + SELL_SHORT = 'T', + SELL_SHORT_EXEMPT = 'E' +} eSide; + +typedef enum { + DAY = '0', + IOC = '3', + GTX = '5', + GTT = '6', + AFTER_HOURS = 'E' +} eTimeInForce; + +typedef enum { + VISIBLE = 'Y', + HIDDEN = 'N', + ATTRIBUTABLE = 'A' +} eDisplay; + +typedef enum { + AGENCY = 'A', + PRINCIPAL = 'P', + RISKLESS = 'R', + OTHER = 'O' +} eCapacity; + +typedef enum { + CONTINUOUS_MARKET = 'N', + OPENING_CROSS = 'O', + CLOSING_CROSS = 'C', + HALT_IPO = 'H', + SUPPLEMENTAL = 'S', + RETAIL = 'R', + EXTENDED_LIFE = 'E', + AFTER_HOURS_CLOSE = 'A' +} eCrossType; + +typedef enum { + ELIGIBLE = 'Y', + NOT_ELIGIBLE = 'N' +} eEligibility; + +typedef enum { + ORDER_LIVE = 'L', + ORDER_DEAD = 'D' +} eOrderState; + +typedef enum { + CANCEL_REGULATORY_RESTRICTION = 'D', + CANCEL_CLOSING_CROSS = 'E', + CANCEL_POST_ONLY_PRICE_SLID = 'F', + CANCEL_POST_ONLY_CONTRA_SIDE = 'G', + CANCEL_HALTED = 'H', + CANCEL_IMMEDIATE_OR_CANCEL = 'I', + CANCEL_MARKET_COLLARS = 'K', + CANCEL_SELF_MATCH_PREVENTION = 'Q', + CANCEL_SUPERVISORY = 'S', + CANCEL_TIMEOUT = 'T', + CANCEL_USER_REQUESTED_CANCEL = 'U', + CANCEL_OPEN_PROTECTION = 'X', + CANCEL_SYSTEM_CANCEL = 'Z', + CANCEL_COMPANY_DIRECT_LISTING = 'e' +} eOrderCancelReason; + +typedef enum { + START_OF_DAY = 'S', + END_OF_DAY = 'E' +} eEventCode; + +typedef enum { + LIQUIDITY_ADDED = 'A', + LIQUIDITY_CLOSING_CROSS = 'C', + LIQUIDITY_RETAIL_DESIGNATED_ADDING = 'e', + LIQUIDITY_HALT_IPO_CROSS = 'H', + LIQUIDITY_AFTER_HOURS_CLOSING_CROSS = 'i', + LIQUIDITY_NON_DISPLAYED_ADDING = 'J', + LIQUIDITY_RPI_ORDER_PROVIDES_LIQUIDITY = 'j', + LIQUIDITY_ADDED_LIQUIDITY_MIDPOINT = 'k', + LIQUIDITY_HALT_CROSS = 'K', + LIQUIDITY_CLOSING_CROSS_IMBALANCE = 'L', + LIQUIDITY_OPENING_CROSS_IMBALANCE = 'M', + LIQUIDITY_REMOVED_LIQUIDITY_MIDPOINT = 'm', + LIQUIDITY_PASSIVE_MIDPOINT_EXECUTION = 'N', + LIQUIDITY_MIDPOINT_EXTENDED_LIFE_ORDER_EXECUTION = 'n', + LIQUIDITY_OPENING_CROSS = 'O', + LIQUIDITY_REMOVED_PRICE_IMPROVING_NON_DISPLAYED = 'p', + LIQUIDITY_RMO_RETAIL_ORDER_REMOVES_NON_RPI_MIDPOINT = 'q', + LIQUIDITY_REMOVED = 'R', + LIQUIDITY_RETAIL_ORDER_REMOVES_RPI_LIQUIDITY = 'r', + LIQUIDITY_RETAIL_ORDER_REMOVES_NON_RPI_MIDPOINT_OTHER = 't', + LIQUIDITY_SUPPLEMENTAL_ORDER_EXECUTION = '0', + LIQUIDITY_DISPLAYED_ADDING_ORDER_IMPROVES_NBBO = '7', + LIQUIDITY_DISPLAYED_ADDING_ORDER_SETS_QBBO = '8', + LIQUIDITY_RPI_ORDER_PROVIDES_LIQUIDITY_NO_RPII = '1' +} eLiquidityFlags; + +typedef enum { + MPID_CANCEL_OLDEST = 'O', + MPID_CANCEL_NEWEST = 'W', + MPID_DECREMENT_BOTH = 'D', + MPID_DECREMENT_BOTH_NO_DETAILS = 'Y', + ORG_ID_CANCEL_OLDEST = 'o', + ORG_ID_CANCEL_NEWEST = 'w', + ORG_ID_DECREMENT_BOTH = 'd', + ORG_ID_DECREMENT_BOTH_NO_DETAILS = 'y' +} eAIQStrategy; + +typedef enum { + BROKEN_ERRONEOUS = 'E', + BROKEN_CONSENT = 'C', + BROKEN_SUPERVISOR = 'S', + BROKEN_EXTERNAL = 'X' +} eBrokenTradeReason; + +typedef enum { + REJECT_QUOTE_UNAVAILABLE = 0x0001, + REJECT_DESTINATION_CLOSED = 0x0002, + REJECT_INVALID_DISPLAY = 0x0003, + REJECT_INVALID_MAX_FLOOR = 0x0004, + REJECT_INVALID_PEG_TYPE = 0x0005, + REJECT_FAT_FINGER = 0x0006, + REJECT_HALTED = 0x0007, + REJECT_ISO_NOT_ALLOWED = 0x0008, + REJECT_INVALID_SIDE = 0x0009, + REJECT_PROCESSING_ERROR = 0x000A, + REJECT_CANCEL_PENDING = 0x000B, + REJECT_FIRM_NOT_AUTHORIZED = 0x000C, + REJECT_INVALID_MIN_QUANTITY = 0x000D, + REJECT_NO_CLOSING_REFERENCE_PRICE = 0x000E, + REJECT_OTHER = 0x000F, + REJECT_CANCEL_NOT_ALLOWED = 0x0010, + REJECT_PEGGING_NOT_ALLOWED = 0x0011, + REJECT_CROSSED_MARKET = 0x0012, + REJECT_INVALID_QUANTITY = 0x0013, + REJECT_INVALID_CROSS_ORDER = 0x0014, + REJECT_REPLACE_NOT_ALLOWED = 0x0015, + REJECT_ROUTING_NOT_ALLOWED = 0x0016, + REJECT_INVALID_SYMBOL = 0x0017, + REJECT_TEST = 0x0018, + REJECT_LATE_LOC_TOO_AGGRESSIVE = 0x0019, + REJECT_RETAIL_NOT_ALLOWED = 0x001A, + REJECT_INVALID_MIDPOINT_POST_ONLY_PRICE = 0x001B, + REJECT_INVALID_DESTINATION = 0x001C, + REJECT_INVALID_PRICE = 0x001D, + REJECT_SHARES_EXCEED_THRESHOLD = 0x001E, + REJECT_EXCEEDS_MAXIMUM_ALLOWED_NOTIONAL_VALUE = 0x001F, + REJECT_RISK_AGGREGATE_EXPOSURE_EXCEEDED = 0x0020, + REJECT_RISK_MARKET_IMPACT = 0x0021, + REJECT_RISK_RESTRICTED_STOCK = 0x0022, + REJECT_RISK_SHORT_SELL_RESTRICTED = 0x0023, + REJECT_RISK_ORDER_TYPE_RESTRICTED = 0x0024, + REJECT_RISK_EXCEEDS_ADV_LIMIT = 0x0025, + REJECT_RISK_FAT_FINGER = 0x0026, + REJECT_RISK_LOCATE_REQUIRED = 0x0027, + REJECT_RISK_SYMBOL_MESSAGE_RATE_RESTRICTION = 0x0028, + REJECT_RISK_PORT_MESSAGE_RATE_RESTRICTION = 0x0029, + REJECT_RISK_DUPLICATE_MESSAGE_RATE_RESTRICTION = 0x002A +} eOrderRejectReason; + +typedef enum { + REFRESH_OF_DISPLAY = 'R', + UPDATE_OF_DISPLAY = 'P' +} eOrderRestartReason; + diff --git a/gen/ouch_enum_print.c b/gen/ouch_enum_print.c new file mode 100644 index 0000000..409b502 --- /dev/null +++ b/gen/ouch_enum_print.c @@ -0,0 +1,675 @@ +void print_eHandleInst(eHandleInst e) +{ printf("eHandleInst : "); + switch(e) + { + case IMBALANCE_ONLY: + printf("IMBALANCE_ONLY"); + break; + case RETAIL_ORDER_TYPE_1: + printf("RETAIL_ORDER_TYPE_1"); + break; + case RETAIL_ORDER_TYPE_2: + printf("RETAIL_ORDER_TYPE_2"); + break; + case RETAIL_PRICE_IMPROVEMENT: + printf("RETAIL_PRICE_IMPROVEMENT"); + break; + case EXTENDED_LIFE_CONTINUOUS: + printf("EXTENDED_LIFE_CONTINUOUS"); + break; + case DIRECT_LISTING_CAPITAL_RAISE: + printf("DIRECT_LISTING_CAPITAL_RAISE"); + break; + case RETAIL_PRICE_IMPROVEMENT_HIDDEN: + printf("RETAIL_PRICE_IMPROVEMENT_HIDDEN"); + break; + case NO_INSTRUCTIONS: + printf("NO_INSTRUCTIONS"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eBBOWeightIndicator(eBBOWeightIndicator e) +{ printf("eBBOWeightIndicator : "); + switch(e) + { + case ZERO_ZERO_DOT_TWO: + printf("ZERO_ZERO_DOT_TWO"); + break; + case ZERO_DOT_TWO_ONE: + printf("ZERO_DOT_TWO_ONE"); + break; + case ONE_TWO: + printf("ONE_TWO"); + break; + case GREATER_THAN_TWO: + printf("GREATER_THAN_TWO"); + break; + case UNSPECIFIED: + printf("UNSPECIFIED"); + break; + case SETS_QBBO: + printf("SETS_QBBO"); + break; + case IMPROVES_NBBO: + printf("IMPROVES_NBBO"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eYesNo(eYesNo e) +{ printf("eYesNo : "); + switch(e) + { + case YES: + printf("YES"); + break; + case NO: + printf("NO"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_ePostOnly(ePostOnly e) +{ printf("ePostOnly : "); + switch(e) + { + case POST_ONLY: + printf("POST_ONLY"); + break; + case POST_NO: + printf("POST_NO"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eCustomerType(eCustomerType e) +{ printf("eCustomerType : "); + switch(e) + { + case CUSTOMER_RETAIL: + printf("CUSTOMER_RETAIL"); + break; + case CUSTOMER_NOT_RETAIL: + printf("CUSTOMER_NOT_RETAIL"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eDiscretionPriceType(eDiscretionPriceType e) +{ printf("eDiscretionPriceType : "); + switch(e) + { + case DISCRETION_PRICE_TYPE_LIMIT: + printf("DISCRETION_PRICE_TYPE_LIMIT"); + break; + case DISCRETION_PRICE_TYPE_MARKET_PEG: + printf("DISCRETION_PRICE_TYPE_MARKET_PEG"); + break; + case DISCRETION_PRICE_TYPE_MIDPOINT_PEG: + printf("DISCRETION_PRICE_TYPE_MIDPOINT_PEG"); + break; + case DISCRETION_PRICE_TYPE_PRIMARY_PEG: + printf("DISCRETION_PRICE_TYPE_PRIMARY_PEG"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_ePriceType(ePriceType e) +{ printf("ePriceType : "); + switch(e) + { + case PRICE_TYPE_LIMIT: + printf("PRICE_TYPE_LIMIT"); + break; + case PRICE_TYPE_MARKET_PEG: + printf("PRICE_TYPE_MARKET_PEG"); + break; + case PRICE_TYPE_MIDPOINT_PEG: + printf("PRICE_TYPE_MIDPOINT_PEG"); + break; + case PRICE_TYPE_PRIMARY_PEG: + printf("PRICE_TYPE_PRIMARY_PEG"); + break; + case PRICE_TYPE_MARKET_MAKER_PEG: + printf("PRICE_TYPE_MARKET_MAKER_PEG"); + break; + case PRICE_TYPE_MIDPOINT: + printf("PRICE_TYPE_MIDPOINT"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eSide(eSide e) +{ printf("eSide : "); + switch(e) + { + case BUY: + printf("BUY"); + break; + case SELL: + printf("SELL"); + break; + case SELL_SHORT: + printf("SELL_SHORT"); + break; + case SELL_SHORT_EXEMPT: + printf("SELL_SHORT_EXEMPT"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eTimeInForce(eTimeInForce e) +{ printf("eTimeInForce : "); + switch(e) + { + case DAY: + printf("DAY"); + break; + case IOC: + printf("IOC"); + break; + case GTX: + printf("GTX"); + break; + case GTT: + printf("GTT"); + break; + case AFTER_HOURS: + printf("AFTER_HOURS"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eDisplay(eDisplay e) +{ printf("eDisplay : "); + switch(e) + { + case VISIBLE: + printf("VISIBLE"); + break; + case HIDDEN: + printf("HIDDEN"); + break; + case ATTRIBUTABLE: + printf("ATTRIBUTABLE"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eCapacity(eCapacity e) +{ printf("eCapacity : "); + switch(e) + { + case AGENCY: + printf("AGENCY"); + break; + case PRINCIPAL: + printf("PRINCIPAL"); + break; + case RISKLESS: + printf("RISKLESS"); + break; + case OTHER: + printf("OTHER"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eCrossType(eCrossType e) +{ printf("eCrossType : "); + switch(e) + { + case CONTINUOUS_MARKET: + printf("CONTINUOUS_MARKET"); + break; + case OPENING_CROSS: + printf("OPENING_CROSS"); + break; + case CLOSING_CROSS: + printf("CLOSING_CROSS"); + break; + case HALT_IPO: + printf("HALT_IPO"); + break; + case SUPPLEMENTAL: + printf("SUPPLEMENTAL"); + break; + case RETAIL: + printf("RETAIL"); + break; + case EXTENDED_LIFE: + printf("EXTENDED_LIFE"); + break; + case AFTER_HOURS_CLOSE: + printf("AFTER_HOURS_CLOSE"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eEligibility(eEligibility e) +{ printf("eEligibility : "); + switch(e) + { + case ELIGIBLE: + printf("ELIGIBLE"); + break; + case NOT_ELIGIBLE: + printf("NOT_ELIGIBLE"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eOrderState(eOrderState e) +{ printf("eOrderState : "); + switch(e) + { + case ORDER_LIVE: + printf("ORDER_LIVE"); + break; + case ORDER_DEAD: + printf("ORDER_DEAD"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eOrderCancelReason(eOrderCancelReason e) +{ printf("eOrderCancelReason : "); + switch(e) + { + case CANCEL_REGULATORY_RESTRICTION: + printf("CANCEL_REGULATORY_RESTRICTION"); + break; + case CANCEL_CLOSING_CROSS: + printf("CANCEL_CLOSING_CROSS"); + break; + case CANCEL_POST_ONLY_PRICE_SLID: + printf("CANCEL_POST_ONLY_PRICE_SLID"); + break; + case CANCEL_POST_ONLY_CONTRA_SIDE: + printf("CANCEL_POST_ONLY_CONTRA_SIDE"); + break; + case CANCEL_HALTED: + printf("CANCEL_HALTED"); + break; + case CANCEL_IMMEDIATE_OR_CANCEL: + printf("CANCEL_IMMEDIATE_OR_CANCEL"); + break; + case CANCEL_MARKET_COLLARS: + printf("CANCEL_MARKET_COLLARS"); + break; + case CANCEL_SELF_MATCH_PREVENTION: + printf("CANCEL_SELF_MATCH_PREVENTION"); + break; + case CANCEL_SUPERVISORY: + printf("CANCEL_SUPERVISORY"); + break; + case CANCEL_TIMEOUT: + printf("CANCEL_TIMEOUT"); + break; + case CANCEL_USER_REQUESTED_CANCEL: + printf("CANCEL_USER_REQUESTED_CANCEL"); + break; + case CANCEL_OPEN_PROTECTION: + printf("CANCEL_OPEN_PROTECTION"); + break; + case CANCEL_SYSTEM_CANCEL: + printf("CANCEL_SYSTEM_CANCEL"); + break; + case CANCEL_COMPANY_DIRECT_LISTING: + printf("CANCEL_COMPANY_DIRECT_LISTING"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eEventCode(eEventCode e) +{ printf("eEventCode : "); + switch(e) + { + case START_OF_DAY: + printf("START_OF_DAY"); + break; + case END_OF_DAY: + printf("END_OF_DAY"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eLiquidityFlags(eLiquidityFlags e) +{ printf("eLiquidityFlags : "); + switch(e) + { + case LIQUIDITY_ADDED: + printf("LIQUIDITY_ADDED"); + break; + case LIQUIDITY_CLOSING_CROSS: + printf("LIQUIDITY_CLOSING_CROSS"); + break; + case LIQUIDITY_RETAIL_DESIGNATED_ADDING: + printf("LIQUIDITY_RETAIL_DESIGNATED_ADDING"); + break; + case LIQUIDITY_HALT_IPO_CROSS: + printf("LIQUIDITY_HALT_IPO_CROSS"); + break; + case LIQUIDITY_AFTER_HOURS_CLOSING_CROSS: + printf("LIQUIDITY_AFTER_HOURS_CLOSING_CROSS"); + break; + case LIQUIDITY_NON_DISPLAYED_ADDING: + printf("LIQUIDITY_NON_DISPLAYED_ADDING"); + break; + case LIQUIDITY_RPI_ORDER_PROVIDES_LIQUIDITY: + printf("LIQUIDITY_RPI_ORDER_PROVIDES_LIQUIDITY"); + break; + case LIQUIDITY_ADDED_LIQUIDITY_MIDPOINT: + printf("LIQUIDITY_ADDED_LIQUIDITY_MIDPOINT"); + break; + case LIQUIDITY_HALT_CROSS: + printf("LIQUIDITY_HALT_CROSS"); + break; + case LIQUIDITY_CLOSING_CROSS_IMBALANCE: + printf("LIQUIDITY_CLOSING_CROSS_IMBALANCE"); + break; + case LIQUIDITY_OPENING_CROSS_IMBALANCE: + printf("LIQUIDITY_OPENING_CROSS_IMBALANCE"); + break; + case LIQUIDITY_REMOVED_LIQUIDITY_MIDPOINT: + printf("LIQUIDITY_REMOVED_LIQUIDITY_MIDPOINT"); + break; + case LIQUIDITY_PASSIVE_MIDPOINT_EXECUTION: + printf("LIQUIDITY_PASSIVE_MIDPOINT_EXECUTION"); + break; + case LIQUIDITY_MIDPOINT_EXTENDED_LIFE_ORDER_EXECUTION: + printf("LIQUIDITY_MIDPOINT_EXTENDED_LIFE_ORDER_EXECUTION"); + break; + case LIQUIDITY_OPENING_CROSS: + printf("LIQUIDITY_OPENING_CROSS"); + break; + case LIQUIDITY_REMOVED_PRICE_IMPROVING_NON_DISPLAYED: + printf("LIQUIDITY_REMOVED_PRICE_IMPROVING_NON_DISPLAYED"); + break; + case LIQUIDITY_RMO_RETAIL_ORDER_REMOVES_NON_RPI_MIDPOINT: + printf("LIQUIDITY_RMO_RETAIL_ORDER_REMOVES_NON_RPI_MIDPOINT"); + break; + case LIQUIDITY_REMOVED: + printf("LIQUIDITY_REMOVED"); + break; + case LIQUIDITY_RETAIL_ORDER_REMOVES_RPI_LIQUIDITY: + printf("LIQUIDITY_RETAIL_ORDER_REMOVES_RPI_LIQUIDITY"); + break; + case LIQUIDITY_RETAIL_ORDER_REMOVES_NON_RPI_MIDPOINT_OTHER: + printf("LIQUIDITY_RETAIL_ORDER_REMOVES_NON_RPI_MIDPOINT_OTHER"); + break; + case LIQUIDITY_SUPPLEMENTAL_ORDER_EXECUTION: + printf("LIQUIDITY_SUPPLEMENTAL_ORDER_EXECUTION"); + break; + case LIQUIDITY_DISPLAYED_ADDING_ORDER_IMPROVES_NBBO: + printf("LIQUIDITY_DISPLAYED_ADDING_ORDER_IMPROVES_NBBO"); + break; + case LIQUIDITY_DISPLAYED_ADDING_ORDER_SETS_QBBO: + printf("LIQUIDITY_DISPLAYED_ADDING_ORDER_SETS_QBBO"); + break; + case LIQUIDITY_RPI_ORDER_PROVIDES_LIQUIDITY_NO_RPII: + printf("LIQUIDITY_RPI_ORDER_PROVIDES_LIQUIDITY_NO_RPII"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eAIQStrategy(eAIQStrategy e) +{ printf("eAIQStrategy : "); + switch(e) + { + case MPID_CANCEL_OLDEST: + printf("MPID_CANCEL_OLDEST"); + break; + case MPID_CANCEL_NEWEST: + printf("MPID_CANCEL_NEWEST"); + break; + case MPID_DECREMENT_BOTH: + printf("MPID_DECREMENT_BOTH"); + break; + case MPID_DECREMENT_BOTH_NO_DETAILS: + printf("MPID_DECREMENT_BOTH_NO_DETAILS"); + break; + case ORG_ID_CANCEL_OLDEST: + printf("ORG_ID_CANCEL_OLDEST"); + break; + case ORG_ID_CANCEL_NEWEST: + printf("ORG_ID_CANCEL_NEWEST"); + break; + case ORG_ID_DECREMENT_BOTH: + printf("ORG_ID_DECREMENT_BOTH"); + break; + case ORG_ID_DECREMENT_BOTH_NO_DETAILS: + printf("ORG_ID_DECREMENT_BOTH_NO_DETAILS"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eBrokenTradeReason(eBrokenTradeReason e) +{ printf("eBrokenTradeReason : "); + switch(e) + { + case BROKEN_ERRONEOUS: + printf("BROKEN_ERRONEOUS"); + break; + case BROKEN_CONSENT: + printf("BROKEN_CONSENT"); + break; + case BROKEN_SUPERVISOR: + printf("BROKEN_SUPERVISOR"); + break; + case BROKEN_EXTERNAL: + printf("BROKEN_EXTERNAL"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eOrderRejectReason(eOrderRejectReason e) +{ printf("eOrderRejectReason : "); + switch(e) + { + case REJECT_QUOTE_UNAVAILABLE: + printf("REJECT_QUOTE_UNAVAILABLE"); + break; + case REJECT_DESTINATION_CLOSED: + printf("REJECT_DESTINATION_CLOSED"); + break; + case REJECT_INVALID_DISPLAY: + printf("REJECT_INVALID_DISPLAY"); + break; + case REJECT_INVALID_MAX_FLOOR: + printf("REJECT_INVALID_MAX_FLOOR"); + break; + case REJECT_INVALID_PEG_TYPE: + printf("REJECT_INVALID_PEG_TYPE"); + break; + case REJECT_FAT_FINGER: + printf("REJECT_FAT_FINGER"); + break; + case REJECT_HALTED: + printf("REJECT_HALTED"); + break; + case REJECT_ISO_NOT_ALLOWED: + printf("REJECT_ISO_NOT_ALLOWED"); + break; + case REJECT_INVALID_SIDE: + printf("REJECT_INVALID_SIDE"); + break; + case REJECT_PROCESSING_ERROR: + printf("REJECT_PROCESSING_ERROR"); + break; + case REJECT_CANCEL_PENDING: + printf("REJECT_CANCEL_PENDING"); + break; + case REJECT_FIRM_NOT_AUTHORIZED: + printf("REJECT_FIRM_NOT_AUTHORIZED"); + break; + case REJECT_INVALID_MIN_QUANTITY: + printf("REJECT_INVALID_MIN_QUANTITY"); + break; + case REJECT_NO_CLOSING_REFERENCE_PRICE: + printf("REJECT_NO_CLOSING_REFERENCE_PRICE"); + break; + case REJECT_OTHER: + printf("REJECT_OTHER"); + break; + case REJECT_CANCEL_NOT_ALLOWED: + printf("REJECT_CANCEL_NOT_ALLOWED"); + break; + case REJECT_PEGGING_NOT_ALLOWED: + printf("REJECT_PEGGING_NOT_ALLOWED"); + break; + case REJECT_CROSSED_MARKET: + printf("REJECT_CROSSED_MARKET"); + break; + case REJECT_INVALID_QUANTITY: + printf("REJECT_INVALID_QUANTITY"); + break; + case REJECT_INVALID_CROSS_ORDER: + printf("REJECT_INVALID_CROSS_ORDER"); + break; + case REJECT_REPLACE_NOT_ALLOWED: + printf("REJECT_REPLACE_NOT_ALLOWED"); + break; + case REJECT_ROUTING_NOT_ALLOWED: + printf("REJECT_ROUTING_NOT_ALLOWED"); + break; + case REJECT_INVALID_SYMBOL: + printf("REJECT_INVALID_SYMBOL"); + break; + case REJECT_TEST: + printf("REJECT_TEST"); + break; + case REJECT_LATE_LOC_TOO_AGGRESSIVE: + printf("REJECT_LATE_LOC_TOO_AGGRESSIVE"); + break; + case REJECT_RETAIL_NOT_ALLOWED: + printf("REJECT_RETAIL_NOT_ALLOWED"); + break; + case REJECT_INVALID_MIDPOINT_POST_ONLY_PRICE: + printf("REJECT_INVALID_MIDPOINT_POST_ONLY_PRICE"); + break; + case REJECT_INVALID_DESTINATION: + printf("REJECT_INVALID_DESTINATION"); + break; + case REJECT_INVALID_PRICE: + printf("REJECT_INVALID_PRICE"); + break; + case REJECT_SHARES_EXCEED_THRESHOLD: + printf("REJECT_SHARES_EXCEED_THRESHOLD"); + break; + case REJECT_EXCEEDS_MAXIMUM_ALLOWED_NOTIONAL_VALUE: + printf("REJECT_EXCEEDS_MAXIMUM_ALLOWED_NOTIONAL_VALUE"); + break; + case REJECT_RISK_AGGREGATE_EXPOSURE_EXCEEDED: + printf("REJECT_RISK_AGGREGATE_EXPOSURE_EXCEEDED"); + break; + case REJECT_RISK_MARKET_IMPACT: + printf("REJECT_RISK_MARKET_IMPACT"); + break; + case REJECT_RISK_RESTRICTED_STOCK: + printf("REJECT_RISK_RESTRICTED_STOCK"); + break; + case REJECT_RISK_SHORT_SELL_RESTRICTED: + printf("REJECT_RISK_SHORT_SELL_RESTRICTED"); + break; + case REJECT_RISK_ORDER_TYPE_RESTRICTED: + printf("REJECT_RISK_ORDER_TYPE_RESTRICTED"); + break; + case REJECT_RISK_EXCEEDS_ADV_LIMIT: + printf("REJECT_RISK_EXCEEDS_ADV_LIMIT"); + break; + case REJECT_RISK_FAT_FINGER: + printf("REJECT_RISK_FAT_FINGER"); + break; + case REJECT_RISK_LOCATE_REQUIRED: + printf("REJECT_RISK_LOCATE_REQUIRED"); + break; + case REJECT_RISK_SYMBOL_MESSAGE_RATE_RESTRICTION: + printf("REJECT_RISK_SYMBOL_MESSAGE_RATE_RESTRICTION"); + break; + case REJECT_RISK_PORT_MESSAGE_RATE_RESTRICTION: + printf("REJECT_RISK_PORT_MESSAGE_RATE_RESTRICTION"); + break; + case REJECT_RISK_DUPLICATE_MESSAGE_RATE_RESTRICTION: + printf("REJECT_RISK_DUPLICATE_MESSAGE_RATE_RESTRICTION"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} +void print_eOrderRestartReason(eOrderRestartReason e) +{ printf("eOrderRestartReason : "); + switch(e) + { + case REFRESH_OF_DISPLAY: + printf("REFRESH_OF_DISPLAY"); + break; + case UPDATE_OF_DISPLAY: + printf("UPDATE_OF_DISPLAY"); + break; + default : + printf("ERROR, Unmatch value"); + assert(0); + } + printf("\n"); +} diff --git a/gen/ouch_enum_print.h b/gen/ouch_enum_print.h new file mode 100644 index 0000000..5b256a2 --- /dev/null +++ b/gen/ouch_enum_print.h @@ -0,0 +1,21 @@ +void print_eHandleInst(eHandleInst e); +void print_eBBOWeightIndicator(eBBOWeightIndicator e); +void print_eYesNo(eYesNo e); +void print_ePostOnly(ePostOnly e); +void print_eCustomerType(eCustomerType e); +void print_eDiscretionPriceType(eDiscretionPriceType e); +void print_ePriceType(ePriceType e); +void print_eSide(eSide e); +void print_eTimeInForce(eTimeInForce e); +void print_eDisplay(eDisplay e); +void print_eCapacity(eCapacity e); +void print_eCrossType(eCrossType e); +void print_eEligibility(eEligibility e); +void print_eOrderState(eOrderState e); +void print_eOrderCancelReason(eOrderCancelReason e); +void print_eEventCode(eEventCode e); +void print_eLiquidityFlags(eLiquidityFlags e); +void print_eAIQStrategy(eAIQStrategy e); +void print_eBrokenTradeReason(eBrokenTradeReason e); +void print_eOrderRejectReason(eOrderRejectReason e); +void print_eOrderRestartReason(eOrderRestartReason e); diff --git a/gen/ouch_in_struct_elem.h b/gen/ouch_in_struct_elem.h new file mode 100644 index 0000000..ad7392f --- /dev/null +++ b/gen/ouch_in_struct_elem.h @@ -0,0 +1,4 @@ + entry_order_request_s entry_order_request; + replace_order_request_s replace_order_request; + cancel_order_request_s cancel_order_request; + modify_order_request_s modify_order_request; diff --git a/gen/ouch_out_struct_elem.h b/gen/ouch_out_struct_elem.h new file mode 100644 index 0000000..ca0a515 --- /dev/null +++ b/gen/ouch_out_struct_elem.h @@ -0,0 +1,14 @@ + system_event_message_s system_event_message; + order_accepted_s order_accepted; + replaced_message_s replaced_message; + order_canceled_s order_canceled; + aiq_canceled_message_s aiq_canceled_message; + executed_message_s executed_message; + broken_trade_message_s broken_trade_message; + rejected_order_message_s rejected_order_message; + cancel_pending_message_s cancel_pending_message; + cancel_reject_message_s cancel_reject_message; + order_priority_update_message_s order_priority_update_message; + order_modified_message_s order_modified_message; + order_restated_message_s order_restated_message; + account_query_response_message_s account_query_response_message; diff --git a/gen/ouch_struct.h b/gen/ouch_struct.h new file mode 100644 index 0000000..a7792c2 --- /dev/null +++ b/gen/ouch_struct.h @@ -0,0 +1,169 @@ +typedef struct{ + u32_t user_ref_num; + eSide side; + u32_t quantity; + char_8_t symbol; + price_t price; + eTimeInForce time_in_force; + char_t display; + eCapacity capacity; + eEligibility inter_market_sweep_eligibility; + eCrossType cross_type; + char_14_t CIOrdID; + u8_t appendage_length; + u8_t appendage_tag; + uEntryOrderOption optional_appendage; +} __attribute__((__packed__)) entry_order_request_s ; + +typedef struct{ + u32_t orig_user_ref_num; + u32_t user_ref_num; + u32_t quantity; + price_t price; + eTimeInForce time_in_force; + eDisplay display; + eEligibility inter_market_sweep_eligibility; + char_14_t CIOrdID; + u8_t appendage_length; + u8_t appendage_tag; + uReplaceOrderOption optional_appendage; +} __attribute__((__packed__)) replace_order_request_s ; + +typedef struct{ + u32_t user_ref_num; + u32_t quantity; +} __attribute__((__packed__)) cancel_order_request_s ; + +typedef struct{ + u32_t user_ref_num; + eSide side; + u32_t quantity; +} __attribute__((__packed__)) modify_order_request_s ; + +typedef struct{ + timestamp_t timestamp; + eEventCode event_code; +} __attribute__((__packed__)) system_event_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; + eSide side; + u32_t quantity; + char_8_t symbol; + price_t price; + eTimeInForce time_in_force; + eDisplay display; + u64_t order_reference_number; + eCapacity capacity; + eEligibility inter_market_sweep_eligibility; + eCrossType cross_type; + eOrderState order_state; + char_14_t CIOrdID; + u8_t appendage_length; + u8_t appendage_tag; + uOrderAcceptedOption optional_appendage; +} __attribute__((__packed__)) order_accepted_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t orig_user_ref_num; + u32_t user_ref_num; + eSide side; + u32_t quantity; + price_t price; + eTimeInForce time_in_force; + eDisplay display; + u64_t order_reference_number; + eCapacity capacity; + eEligibility inter_market_sweep_eligibility; + eCrossType cross_type; + eOrderState order_state; + char_14_t CIOrdID; + u8_t appendage_length; + u8_t appendage_tag; + uOrderReplacedOption optional_appendage; +} __attribute__((__packed__)) replaced_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; + u32_t quantity; + eOrderCancelReason reason; +} __attribute__((__packed__)) order_canceled_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; + u32_t decrement_shares; + eOrderCancelReason reason; + u32_t quantity_prevented_from_trading; + price_t execution_price; + eLiquidityFlags liquidity_flag; + eAIQStrategy aiq_strategy; +} __attribute__((__packed__)) aiq_canceled_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; + u32_t quantity; + price_t price; + eLiquidityFlags liquidity_flag; + u64_t match_number; + u16_t appendage_length; +} __attribute__((__packed__)) executed_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; + u64_t match_number; + eBrokenTradeReason reason; + char_14_t CIOrdID; +} __attribute__((__packed__)) broken_trade_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; + eOrderRejectReason reason; + char_14_t CIOrdID; +} __attribute__((__packed__)) rejected_order_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; +} __attribute__((__packed__)) cancel_pending_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; +} __attribute__((__packed__)) cancel_reject_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; + price_t price; + eDisplay display; + u64_t order_reference_number; +} __attribute__((__packed__)) order_priority_update_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; + eSide side; + u32_t quantity; +} __attribute__((__packed__)) order_modified_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t user_ref_num; + eOrderRejectReason reason; + u8_t appendage_length; + u8_t appendage_tag; + uOrderRestartedOption optional_appendage; +} __attribute__((__packed__)) order_restated_message_s ; + +typedef struct{ + timestamp_t timestamp; + u32_t next_user_ref_num; +} __attribute__((__packed__)) account_query_response_message_s ; + diff --git a/gen/ouch_struct_in_read.c b/gen/ouch_struct_in_read.c new file mode 100644 index 0000000..1a647ad --- /dev/null +++ b/gen/ouch_struct_in_read.c @@ -0,0 +1,31 @@ +ouch_in_s* read_ouch_in_s(uint8_t* buff, size_t len) +{ + assert(buff); + if(len==0){ + return NULL; + }else{ + ouch_in_s*s = malloc(sizeof(ouch_in_s)); + s->message_type = buff[0]; + switch(s->message_type){ + case 'O': + memcpy(&(s->entry_order_request),buff+1,sizeof(s->entry_order_request)); + break; + case 'U': + memcpy(&(s->replace_order_request),buff+1,sizeof(s->replace_order_request)); + break; + case 'X': + memcpy(&(s->cancel_order_request),buff+1,sizeof(s->cancel_order_request)); + break; + case 'M': + memcpy(&(s->modify_order_request),buff+1,sizeof(s->modify_order_request)); + break; + case 'Q': + break; + default: + printf("ERROR: Unknown message type %c\n",s->message_type); + assert(0); + break; + } + return s; + } +} diff --git a/gen/ouch_struct_in_read.h b/gen/ouch_struct_in_read.h new file mode 100644 index 0000000..446c5ea --- /dev/null +++ b/gen/ouch_struct_in_read.h @@ -0,0 +1 @@ +ouch_in_s* read_ouch_in_s(uint8_t* buff, size_t len); \ No newline at end of file diff --git a/gen/ouch_struct_in_write.c b/gen/ouch_struct_in_write.c new file mode 100644 index 0000000..eda2a80 --- /dev/null +++ b/gen/ouch_struct_in_write.c @@ -0,0 +1,40 @@ +uint8_t* write_ouch_in(ouch_in_s* s, size_t *len) +{ + assert(s); + *len = 0; + uint8_t *buff = NULL; + switch(s->message_type){ + case 'O': + *len = 47; + *len += s->entry_order_request.appendage_length; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->entry_order_request),sizeof(uint8_t)*(*len)); + break; + case 'U': + *len = 40; + *len += s->replace_order_request.appendage_length; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->replace_order_request),sizeof(uint8_t)*(*len)); + break; + case 'X': + *len = 9; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->cancel_order_request),sizeof(uint8_t)*(*len)); + break; + case 'M': + *len = 10; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->modify_order_request),sizeof(uint8_t)*(*len)); + break; + case 'Q': + *len = 1; + buff = malloc(sizeof(uint8_t)*1); + buff[0] = s->message_type;; + break; + default: + printf("ERROR: Unknown message type %c\n",s->message_type); + assert(0); + break; + } + return buff; +} diff --git a/gen/ouch_struct_in_write.h b/gen/ouch_struct_in_write.h new file mode 100644 index 0000000..0da9d4a --- /dev/null +++ b/gen/ouch_struct_in_write.h @@ -0,0 +1 @@ +uint8_t* write_ouch_in(ouch_in_s* s, size_t *len); \ No newline at end of file diff --git a/gen/ouch_struct_out_read.c b/gen/ouch_struct_out_read.c new file mode 100644 index 0000000..547b732 --- /dev/null +++ b/gen/ouch_struct_out_read.c @@ -0,0 +1,59 @@ +ouch_out_s* read_ouch_out_s(uint8_t* buff, size_t len) +{ + assert(buff); + if(len==0){ + return NULL; + }else{ + ouch_out_s*s = malloc(sizeof(ouch_out_s)); + s->message_type = buff[0]; + switch(s->message_type){ + case 'S': + memcpy(&(s->system_event_message),buff+1,sizeof(s->system_event_message)); + break; + case 'A': + memcpy(&(s->order_accepted),buff+1,sizeof(s->order_accepted)); + break; + case 'U': + memcpy(&(s->replaced_message),buff+1,sizeof(s->replaced_message)); + break; + case 'C': + memcpy(&(s->order_canceled),buff+1,sizeof(s->order_canceled)); + break; + case 'D': + memcpy(&(s->aiq_canceled_message),buff+1,sizeof(s->aiq_canceled_message)); + break; + case 'E': + memcpy(&(s->executed_message),buff+1,sizeof(s->executed_message)); + break; + case 'B': + memcpy(&(s->broken_trade_message),buff+1,sizeof(s->broken_trade_message)); + break; + case 'J': + memcpy(&(s->rejected_order_message),buff+1,sizeof(s->rejected_order_message)); + break; + case 'P': + memcpy(&(s->cancel_pending_message),buff+1,sizeof(s->cancel_pending_message)); + break; + case 'I': + memcpy(&(s->cancel_reject_message),buff+1,sizeof(s->cancel_reject_message)); + break; + case 'T': + memcpy(&(s->order_priority_update_message),buff+1,sizeof(s->order_priority_update_message)); + break; + case 'M': + memcpy(&(s->order_modified_message),buff+1,sizeof(s->order_modified_message)); + break; + case 'R': + memcpy(&(s->order_restated_message),buff+1,sizeof(s->order_restated_message)); + break; + case 'Q': + memcpy(&(s->account_query_response_message),buff+1,sizeof(s->account_query_response_message)); + break; + default: + printf("ERROR: Unknown message type %c\n",s->message_type); + assert(0); + break; + } + return s; + } +} diff --git a/gen/ouch_struct_out_read.h b/gen/ouch_struct_out_read.h new file mode 100644 index 0000000..6848200 --- /dev/null +++ b/gen/ouch_struct_out_read.h @@ -0,0 +1 @@ +ouch_out_s* read_ouch_out_s(uint8_t* buff, size_t len); \ No newline at end of file diff --git a/gen/ouch_struct_out_write.c b/gen/ouch_struct_out_write.c new file mode 100644 index 0000000..370cf57 --- /dev/null +++ b/gen/ouch_struct_out_write.c @@ -0,0 +1,87 @@ +uint8_t* write_ouch_out(ouch_out_s* s, size_t *len) +{ + assert(s); + *len = 0; + uint8_t *buff = NULL; + switch(s->message_type){ + case 'S': + *len = 10; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->system_event_message),sizeof(uint8_t)*(*len)); + break; + case 'A': + *len = 64; + *len += s->order_accepted.appendage_length; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->order_accepted),sizeof(uint8_t)*(*len)); + break; + case 'U': + *len = 68; + *len += s->replaced_message.appendage_length; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->replaced_message),sizeof(uint8_t)*(*len)); + break; + case 'C': + *len = 18; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->order_canceled),sizeof(uint8_t)*(*len)); + break; + case 'D': + *len = 32; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->aiq_canceled_message),sizeof(uint8_t)*(*len)); + break; + case 'E': + *len = 36; + *len += s->executed_message.appendage_length; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->executed_message),sizeof(uint8_t)*(*len)); + break; + case 'B': + *len = 36; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->broken_trade_message),sizeof(uint8_t)*(*len)); + break; + case 'J': + *len = 29; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->rejected_order_message),sizeof(uint8_t)*(*len)); + break; + case 'P': + *len = 13; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->cancel_pending_message),sizeof(uint8_t)*(*len)); + break; + case 'I': + *len = 13; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->cancel_reject_message),sizeof(uint8_t)*(*len)); + break; + case 'T': + *len = 30; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->order_priority_update_message),sizeof(uint8_t)*(*len)); + break; + case 'M': + *len = 18; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->order_modified_message),sizeof(uint8_t)*(*len)); + break; + case 'R': + *len = 16; + *len += s->order_restated_message.appendage_length; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->order_restated_message),sizeof(uint8_t)*(*len)); + break; + case 'Q': + *len = 13; + buff = malloc(sizeof(uint8_t)*(*len)); + memcpy(buff, &(s->account_query_response_message),sizeof(uint8_t)*(*len)); + break; + default: + printf("ERROR: Unknown message type %c\n",s->message_type); + assert(0); + break; + } + return buff; +} diff --git a/gen/ouch_struct_out_write.h b/gen/ouch_struct_out_write.h new file mode 100644 index 0000000..e663bb0 --- /dev/null +++ b/gen/ouch_struct_out_write.h @@ -0,0 +1 @@ +uint8_t* write_ouch_out(ouch_out_s* s, size_t *len); \ No newline at end of file diff --git a/gen/ouch_struct_print.c b/gen/ouch_struct_print.c new file mode 100644 index 0000000..532be5c --- /dev/null +++ b/gen/ouch_struct_print.c @@ -0,0 +1,297 @@ +void print_entry_order_request(const entry_order_request_s* e) +{ printf("entry_order_request {\n\n"); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("side : "); + print_eSide(e->side); + printf("quantity : "); + print_u32_t(e->quantity); + printf("symbol : "); + print_char_8_t(e->symbol); + printf("price : "); + print_price_t(e->price); + printf("time_in_force : "); + print_eTimeInForce(e->time_in_force); + printf("display : "); + print_char_t(e->display); + printf("capacity : "); + print_eCapacity(e->capacity); + printf("inter_market_sweep_eligibility : "); + print_eEligibility(e->inter_market_sweep_eligibility); + printf("cross_type : "); + print_eCrossType(e->cross_type); + printf("CIOrdID : "); + print_char_14_t(e->CIOrdID); + printf("appendage_length : "); + print_u8_t(e->appendage_length); + printf("appendage_tag : "); + print_u8_t(e->appendage_tag); + print_uEntryOrderOption(e->appendage_length, e->appendage_tag,e->optional_appendage); + printf("}\n"); +} +void print_replace_order_request(const replace_order_request_s* e) +{ printf("replace_order_request {\n\n"); + printf("orig_user_ref_num : "); + print_u32_t(e->orig_user_ref_num); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("quantity : "); + print_u32_t(e->quantity); + printf("price : "); + print_price_t(e->price); + printf("time_in_force : "); + print_eTimeInForce(e->time_in_force); + printf("display : "); + print_eDisplay(e->display); + printf("inter_market_sweep_eligibility : "); + print_eEligibility(e->inter_market_sweep_eligibility); + printf("CIOrdID : "); + print_char_14_t(e->CIOrdID); + printf("appendage_length : "); + print_u8_t(e->appendage_length); + printf("appendage_tag : "); + print_u8_t(e->appendage_tag); + print_uReplaceOrderOption(e->appendage_length, e->appendage_tag,e->optional_appendage); + printf("}\n"); +} +void print_cancel_order_request(const cancel_order_request_s* e) +{ printf("cancel_order_request {\n\n"); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("quantity : "); + print_u32_t(e->quantity); + printf("}\n"); +} +void print_modify_order_request(const modify_order_request_s* e) +{ printf("modify_order_request {\n\n"); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("side : "); + print_eSide(e->side); + printf("quantity : "); + print_u32_t(e->quantity); + printf("}\n"); +} +void print_system_event_message(const system_event_message_s* e) +{ printf("system_event_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("event_code : "); + print_eEventCode(e->event_code); + printf("}\n"); +} +void print_order_accepted(const order_accepted_s* e) +{ printf("order_accepted {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("side : "); + print_eSide(e->side); + printf("quantity : "); + print_u32_t(e->quantity); + printf("symbol : "); + print_char_8_t(e->symbol); + printf("price : "); + print_price_t(e->price); + printf("time_in_force : "); + print_eTimeInForce(e->time_in_force); + printf("display : "); + print_eDisplay(e->display); + printf("order_reference_number : "); + print_u64_t(e->order_reference_number); + printf("capacity : "); + print_eCapacity(e->capacity); + printf("inter_market_sweep_eligibility : "); + print_eEligibility(e->inter_market_sweep_eligibility); + printf("cross_type : "); + print_eCrossType(e->cross_type); + printf("order_state : "); + print_eOrderState(e->order_state); + printf("CIOrdID : "); + print_char_14_t(e->CIOrdID); + printf("appendage_length : "); + print_u8_t(e->appendage_length); + printf("appendage_tag : "); + print_u8_t(e->appendage_tag); + print_uOrderAcceptedOption(e->appendage_length, e->appendage_tag,e->optional_appendage); + printf("}\n"); +} +void print_replaced_message(const replaced_message_s* e) +{ printf("replaced_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("orig_user_ref_num : "); + print_u32_t(e->orig_user_ref_num); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("side : "); + print_eSide(e->side); + printf("quantity : "); + print_u32_t(e->quantity); + printf("price : "); + print_price_t(e->price); + printf("time_in_force : "); + print_eTimeInForce(e->time_in_force); + printf("display : "); + print_eDisplay(e->display); + printf("order_reference_number : "); + print_u64_t(e->order_reference_number); + printf("capacity : "); + print_eCapacity(e->capacity); + printf("inter_market_sweep_eligibility : "); + print_eEligibility(e->inter_market_sweep_eligibility); + printf("cross_type : "); + print_eCrossType(e->cross_type); + printf("order_state : "); + print_eOrderState(e->order_state); + printf("CIOrdID : "); + print_char_14_t(e->CIOrdID); + printf("appendage_length : "); + print_u8_t(e->appendage_length); + printf("appendage_tag : "); + print_u8_t(e->appendage_tag); + print_uOrderReplacedOption(e->appendage_length, e->appendage_tag,e->optional_appendage); + printf("}\n"); +} +void print_order_canceled(const order_canceled_s* e) +{ printf("order_canceled {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("quantity : "); + print_u32_t(e->quantity); + printf("reason : "); + print_eOrderCancelReason(e->reason); + printf("}\n"); +} +void print_aiq_canceled_message(const aiq_canceled_message_s* e) +{ printf("aiq_canceled_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("decrement_shares : "); + print_u32_t(e->decrement_shares); + printf("reason : "); + print_eOrderCancelReason(e->reason); + printf("quantity_prevented_from_trading : "); + print_u32_t(e->quantity_prevented_from_trading); + printf("execution_price : "); + print_price_t(e->execution_price); + printf("liquidity_flag : "); + print_eLiquidityFlags(e->liquidity_flag); + printf("aiq_strategy : "); + print_eAIQStrategy(e->aiq_strategy); + printf("}\n"); +} +void print_executed_message(const executed_message_s* e) +{ printf("executed_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("quantity : "); + print_u32_t(e->quantity); + printf("price : "); + print_price_t(e->price); + printf("liquidity_flag : "); + print_eLiquidityFlags(e->liquidity_flag); + printf("match_number : "); + print_u64_t(e->match_number); + printf("appendage_length : "); + print_u16_t(e->appendage_length); + printf("}\n"); +} +void print_broken_trade_message(const broken_trade_message_s* e) +{ printf("broken_trade_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("match_number : "); + print_u64_t(e->match_number); + printf("reason : "); + print_eBrokenTradeReason(e->reason); + printf("CIOrdID : "); + print_char_14_t(e->CIOrdID); + printf("}\n"); +} +void print_rejected_order_message(const rejected_order_message_s* e) +{ printf("rejected_order_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("reason : "); + print_eOrderRejectReason(e->reason); + printf("CIOrdID : "); + print_char_14_t(e->CIOrdID); + printf("}\n"); +} +void print_cancel_pending_message(const cancel_pending_message_s* e) +{ printf("cancel_pending_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("}\n"); +} +void print_cancel_reject_message(const cancel_reject_message_s* e) +{ printf("cancel_reject_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("}\n"); +} +void print_order_priority_update_message(const order_priority_update_message_s* e) +{ printf("order_priority_update_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("price : "); + print_price_t(e->price); + printf("display : "); + print_eDisplay(e->display); + printf("order_reference_number : "); + print_u64_t(e->order_reference_number); + printf("}\n"); +} +void print_order_modified_message(const order_modified_message_s* e) +{ printf("order_modified_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("side : "); + print_eSide(e->side); + printf("quantity : "); + print_u32_t(e->quantity); + printf("}\n"); +} +void print_order_restated_message(const order_restated_message_s* e) +{ printf("order_restated_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("user_ref_num : "); + print_u32_t(e->user_ref_num); + printf("reason : "); + print_eOrderRejectReason(e->reason); + printf("appendage_length : "); + print_u8_t(e->appendage_length); + printf("appendage_tag : "); + print_u8_t(e->appendage_tag); + print_uOrderRestartedOption(e->appendage_length, e->appendage_tag,e->optional_appendage); + printf("}\n"); +} +void print_account_query_response_message(const account_query_response_message_s* e) +{ printf("account_query_response_message {\n\n"); + printf("timestamp : "); + print_timestamp_t(e->timestamp); + printf("next_user_ref_num : "); + print_u32_t(e->next_user_ref_num); + printf("}\n"); +} diff --git a/gen/ouch_struct_print.h b/gen/ouch_struct_print.h new file mode 100644 index 0000000..c2431e2 --- /dev/null +++ b/gen/ouch_struct_print.h @@ -0,0 +1,18 @@ +void print_entry_order_request(const entry_order_request_s* e); +void print_replace_order_request(const replace_order_request_s* e); +void print_cancel_order_request(const cancel_order_request_s* e); +void print_modify_order_request(const modify_order_request_s* e); +void print_system_event_message(const system_event_message_s* e); +void print_order_accepted(const order_accepted_s* e); +void print_replaced_message(const replaced_message_s* e); +void print_order_canceled(const order_canceled_s* e); +void print_aiq_canceled_message(const aiq_canceled_message_s* e); +void print_executed_message(const executed_message_s* e); +void print_broken_trade_message(const broken_trade_message_s* e); +void print_rejected_order_message(const rejected_order_message_s* e); +void print_cancel_pending_message(const cancel_pending_message_s* e); +void print_cancel_reject_message(const cancel_reject_message_s* e); +void print_order_priority_update_message(const order_priority_update_message_s* e); +void print_order_modified_message(const order_modified_message_s* e); +void print_order_restated_message(const order_restated_message_s* e); +void print_account_query_response_message(const account_query_response_message_s* e); diff --git a/gen/ouch_union.h b/gen/ouch_union.h new file mode 100644 index 0000000..8d56706 --- /dev/null +++ b/gen/ouch_union.h @@ -0,0 +1,78 @@ +typedef union { + char_4_t firm; + u32_t min_qty; + eCustomerType customer_type; + u32_t max_floor; + ePriceType price_type; + sprice_t peg_offset; + price_t discretion_price; + eDiscretionPriceType discretion_price_type; + sprice_t discretion_peg_offset; + ePostOnly post_only; + u32_t random_reserves; + char_4_t route; + u32_t expire_time; + eYesNo trade_now; + eHandleInst handle_inst; + u16_t group_id; + eYesNo shares_located; +} uEntryOrderOption; + +typedef union { + u32_t min_qty; + u32_t max_floor; + ePriceType price_type; + sprice_t peg_offset; + price_t discretion_price; + eDiscretionPriceType discretion_price_type; + sprice_t discretion_peg_offset; + ePostOnly post_only; + u32_t random_reserves; + u32_t expire_time; + eYesNo trade_now; + eHandleInst handle_inst; + u16_t group_id; + eYesNo shares_located; +} uReplaceOrderOption; + +typedef union { + char_4_t firm; + u32_t min_qty; + eCustomerType customer_type; + u32_t max_floor; + ePriceType price_type; + sprice_t peg_offset; + price_t discretion_price; + eDiscretionPriceType discretion_price_type; + sprice_t discretion_peg_offset; + ePostOnly post_only; + u32_t random_reserves; + char_4_t route; + u32_t expire_time; + eYesNo trade_now; + eHandleInst handle_inst; + eBBOWeightIndicator bbo_weight_indicator; + u32_t display_quantity; + u64_t display_price; + u16_t group_id; + eYesNo shares_located; +} uOrderAcceptedOption; + +typedef union { + char_4_t firm; + u32_t min_qty; + u32_t max_floor; + ePriceType price_type; + ePostOnly post_only; + u32_t expire_time; + eYesNo trade_now; + eHandleInst handle_inst; + eBBOWeightIndicator bbo_weight_indicator; +} uOrderReplacedOption; + +typedef union { + u32_t display_quantity; + u64_t display_price; + u64_t secondary_ord_ref_num; +} uOrderRestartedOption; + diff --git a/gen/ouch_union_print.c b/gen/ouch_union_print.c new file mode 100644 index 0000000..31c2ed3 --- /dev/null +++ b/gen/ouch_union_print.c @@ -0,0 +1,264 @@ +void print_uEntryOrderOption(const u8_t l, const char_t t, const uEntryOrderOption u) +{ + printf("uEntryOrderOption : "); + if(l==0){ + printf("none\n"); + }else{ + switch(t) + { + case 2: + print_char_4_t(u.firm); + break; + case 3: + print_u32_t(u.min_qty); + break; + case 4: + print_eCustomerType(u.customer_type); + break; + case 5: + print_u32_t(u.max_floor); + break; + case 6: + print_ePriceType(u.price_type); + break; + case 7: + print_sprice_t(u.peg_offset); + break; + case 9: + print_price_t(u.discretion_price); + break; + case 10: + print_eDiscretionPriceType(u.discretion_price_type); + break; + case 11: + print_sprice_t(u.discretion_peg_offset); + break; + case 12: + print_ePostOnly(u.post_only); + break; + case 13: + print_u32_t(u.random_reserves); + break; + case 14: + print_char_4_t(u.route); + break; + case 15: + print_u32_t(u.expire_time); + break; + case 16: + print_eYesNo(u.trade_now); + break; + case 17: + print_eHandleInst(u.handle_inst); + break; + case 24: + print_u16_t(u.group_id); + break; + case 25: + print_eYesNo(u.shares_located); + break; + default : + printf("ERROR, Unknown tag %u",t); + assert(0); + } + } + printf("\n"); +} +void print_uReplaceOrderOption(const u8_t l, const char_t t, const uReplaceOrderOption u) +{ + printf("uReplaceOrderOption : "); + if(l==0){ + printf("none\n"); + }else{ + switch(t) + { + case 3: + print_u32_t(u.min_qty); + break; + case 5: + print_u32_t(u.max_floor); + break; + case 6: + print_ePriceType(u.price_type); + break; + case 7: + print_sprice_t(u.peg_offset); + break; + case 9: + print_price_t(u.discretion_price); + break; + case 10: + print_eDiscretionPriceType(u.discretion_price_type); + break; + case 11: + print_sprice_t(u.discretion_peg_offset); + break; + case 12: + print_ePostOnly(u.post_only); + break; + case 13: + print_u32_t(u.random_reserves); + break; + case 15: + print_u32_t(u.expire_time); + break; + case 16: + print_eYesNo(u.trade_now); + break; + case 17: + print_eHandleInst(u.handle_inst); + break; + case 24: + print_u16_t(u.group_id); + break; + case 25: + print_eYesNo(u.shares_located); + break; + default : + printf("ERROR, Unknown tag %u",t); + assert(0); + } + } + printf("\n"); +} +void print_uOrderAcceptedOption(const u8_t l, const char_t t, const uOrderAcceptedOption u) +{ + printf("uOrderAcceptedOption : "); + if(l==0){ + printf("none\n"); + }else{ + switch(t) + { + case 2: + print_char_4_t(u.firm); + break; + case 3: + print_u32_t(u.min_qty); + break; + case 4: + print_eCustomerType(u.customer_type); + break; + case 5: + print_u32_t(u.max_floor); + break; + case 6: + print_ePriceType(u.price_type); + break; + case 7: + print_sprice_t(u.peg_offset); + break; + case 9: + print_price_t(u.discretion_price); + break; + case 10: + print_eDiscretionPriceType(u.discretion_price_type); + break; + case 11: + print_sprice_t(u.discretion_peg_offset); + break; + case 12: + print_ePostOnly(u.post_only); + break; + case 13: + print_u32_t(u.random_reserves); + break; + case 14: + print_char_4_t(u.route); + break; + case 15: + print_u32_t(u.expire_time); + break; + case 16: + print_eYesNo(u.trade_now); + break; + case 17: + print_eHandleInst(u.handle_inst); + break; + case 18: + print_eBBOWeightIndicator(u.bbo_weight_indicator); + break; + case 22: + print_u32_t(u.display_quantity); + break; + case 23: + print_u64_t(u.display_price); + break; + case 24: + print_u16_t(u.group_id); + break; + case 25: + print_eYesNo(u.shares_located); + break; + default : + printf("ERROR, Unknown tag %u",t); + assert(0); + } + } + printf("\n"); +} +void print_uOrderReplacedOption(const u8_t l, const char_t t, const uOrderReplacedOption u) +{ + printf("uOrderReplacedOption : "); + if(l==0){ + printf("none\n"); + }else{ + switch(t) + { + case 2: + print_char_4_t(u.firm); + break; + case 3: + print_u32_t(u.min_qty); + break; + case 5: + print_u32_t(u.max_floor); + break; + case 6: + print_ePriceType(u.price_type); + break; + case 12: + print_ePostOnly(u.post_only); + break; + case 15: + print_u32_t(u.expire_time); + break; + case 16: + print_eYesNo(u.trade_now); + break; + case 17: + print_eHandleInst(u.handle_inst); + break; + case 18: + print_eBBOWeightIndicator(u.bbo_weight_indicator); + break; + default : + printf("ERROR, Unknown tag %u",t); + assert(0); + } + } + printf("\n"); +} +void print_uOrderRestartedOption(const u8_t l, const char_t t, const uOrderRestartedOption u) +{ + printf("uOrderRestartedOption : "); + if(l==0){ + printf("none\n"); + }else{ + switch(t) + { + case 22: + print_u32_t(u.display_quantity); + break; + case 23: + print_u64_t(u.display_price); + break; + case 1: + print_u64_t(u.secondary_ord_ref_num); + break; + default : + printf("ERROR, Unknown tag %u",t); + assert(0); + } + } + printf("\n"); +} diff --git a/gen/ouch_union_print.h b/gen/ouch_union_print.h new file mode 100644 index 0000000..41baea6 --- /dev/null +++ b/gen/ouch_union_print.h @@ -0,0 +1,5 @@ +void print_uEntryOrderOption(const u8_t l, const char_t t, const uEntryOrderOption u); +void print_uReplaceOrderOption(const u8_t l, const char_t t, const uReplaceOrderOption u); +void print_uOrderAcceptedOption(const u8_t l, const char_t t, const uOrderAcceptedOption u); +void print_uOrderReplacedOption(const u8_t l, const char_t t, const uOrderReplacedOption u); +void print_uOrderRestartedOption(const u8_t l, const char_t t, const uOrderRestartedOption u); diff --git a/makefile b/makefile index 5cbc1ad..bcc7d6b 100644 --- a/makefile +++ b/makefile @@ -12,7 +12,7 @@ LD = cc test : test.o type.o ouch_s.o $(LD) -o test -g $^ -test.o : test.c +test.o : gen_flag test.c $(CC) -c test.c $(FLAGS) gen_flag : ${DOC_DIR}/${XML} ${GEN_DIR}/${SCRIPT} @@ -25,19 +25,20 @@ type.o : gen_flag type.c type.h ouch_s.o: gen_flag ouch_s.h ouch_s.c $(CC) -c ouch_s.c $(FLAGS) -lib: itch.o file.o - ar rcs libitch.a itch.o file.o +lib: ouch_s.o type.o + ar rcs libouch.a ouch_s.o type.o release: lib mkdir -p $(RELEASE)/$(INC)/$(GEN_DIR) - cp libitch.a $(RELEASE)/. + cp libouch.a $(RELEASE)/. cp *.h $(RELEASE)/$(INC) cp $(GEN_DIR)/*.h $(RELEASE)/$(INC)/$(GEN_DIR) clean: - rm gen_flag - rm -f ${GEN_DIR}/*.h - rm -f *.o - rm -f *.a - rm -f test - rm -fr $(RELEASE) + -rm gen_flag + -rm -f ${GEN_DIR}/*.h + -rm -f ${GEN_DIR}/*.c + -rm -f *.o + -rm -f *.a + -rm -f test + -rm -fr $(RELEASE)