| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: $ |
|---|
| 11 | * $brcm_Revision: $ |
|---|
| 12 | * $brcm_Date: $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: parser for CCAD input file format |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: $ |
|---|
| 19 | * |
|---|
| 20 | * |
|---|
| 21 | ***************************************************************************/ |
|---|
| 22 | #if !defined(__input_parser_h__) |
|---|
| 23 | #define __input_parser_h__ |
|---|
| 24 | |
|---|
| 25 | #define MATCHED_EOF 99 |
|---|
| 26 | #define MATCHED_ADDR 5 |
|---|
| 27 | #define MATCHED_PID 9 |
|---|
| 28 | #define MATCHED_MSG 13 |
|---|
| 29 | |
|---|
| 30 | /* routines to parse hex files of messages */ |
|---|
| 31 | |
|---|
| 32 | /* initialize parser */ |
|---|
| 33 | void iparser_init(unsigned char * buffer, unsigned int size); |
|---|
| 34 | |
|---|
| 35 | /* process character */ |
|---|
| 36 | int iparser_process(int ch); |
|---|
| 37 | |
|---|
| 38 | /* return size of the output so far */ |
|---|
| 39 | unsigned int iparser_size(void); |
|---|
| 40 | |
|---|
| 41 | /* routines to parse keyword=number format */ |
|---|
| 42 | |
|---|
| 43 | /* initialize keyword parser */ |
|---|
| 44 | void iparser_init_keyw(void); |
|---|
| 45 | |
|---|
| 46 | /* process expected keyword character */ |
|---|
| 47 | int iparser_process_keyw(int ch); |
|---|
| 48 | |
|---|
| 49 | #define MATCHED_XNUMBER 2 |
|---|
| 50 | /* initialize hex parser */ |
|---|
| 51 | void iparser_init_hex(void); |
|---|
| 52 | |
|---|
| 53 | /* process expected hex character */ |
|---|
| 54 | int iparser_process_hex(int ch, int * value); |
|---|
| 55 | |
|---|
| 56 | #endif |
|---|