Ignore:
Timestamp:
Nov 11, 2005 7:01:31 PM (18 years ago)
Author:
bennylp
Message:

First clean compile of pjsip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/main/pjsip/include/pjsip/sip_parser.h

    • Property svn:keywords set to Id
    r38 r43  
    11/* $Id$ 
    2  * 
    32 */ 
    43#ifndef __PJSIP_SIP_PARSER_H__ 
     
    1110 
    1211#include <pjsip/sip_types.h> 
    13 #include <pj/scanner.h> 
     12#include <pjlib-util/scanner.h> 
    1413#include <pj/list.h> 
    1514 
     
    5251typedef struct pjsip_parser_err_report 
    5352{ 
    54     PJ_DECL_LIST_MEMBER(struct pjsip_parser_err_report) 
     53    PJ_DECL_LIST_MEMBER(struct pjsip_parser_err_report); 
    5554    int         exception_code; /**< Error exception (e.g. PJSIP_SYN_ERR_EXCEPTION) */ 
    5655    int         line;           /**< Line number. */ 
     
    5857    pj_str_t    hname;          /**< Header name, if any. */ 
    5958} pjsip_parser_err_report; 
     59 
     60 
     61/** 
     62 * Parsing context, the default argument for parsing functions. 
     63 */ 
     64typedef struct pjsip_parse_ctx 
     65{ 
     66    pj_scanner      *scanner;   /**< The scanner.       */ 
     67    pj_pool_t       *pool;      /**< The pool.          */ 
     68    pjsip_rx_data   *rdata;     /**< Optional rdata.    */ 
     69} pjsip_parse_ctx; 
    6070 
    6171 
     
    7787 *        can be terminated when seeing EOF. 
    7888 */ 
    79 typedef void* (pjsip_parse_hdr_func)(pj_scanner *scanner, pj_pool_t *pool); 
     89typedef pjsip_hdr* (pjsip_parse_hdr_func)(pjsip_parse_ctx *context); 
    8090 
    8191/** 
     
    95105 * @param fptr          The pointer to function to parser the header. 
    96106 * 
    97  * @return              zero if success. 
    98  * @see pjsip_parse_hdr_func 
     107 * @return              PJ_SUCCESS if success, or the appropriate error code. 
    99108 */ 
    100109PJ_DECL(pj_status_t) pjsip_register_hdr_parser( const char *hname, 
     
    186195 
    187196/** 
     197 * Parse a packet buffer and build a rdata. The resulting message will be 
     198 * stored in \c msg field in the \c rdata. This behaves pretty much like 
     199 * #pjsip_parse_msg(), except that it will also initialize the header fields 
     200 * in the \c rdata. 
     201 * 
     202 * This function is normally called by the transport layer. 
     203 * 
     204 * @param buf           The input buffer 
     205 * @param buf           The input buffer, which size must be at least (size+1) 
     206 *                      because the function will temporarily put NULL  
     207 *                      termination at the end of the buffer during parsing. 
     208 * @param size          The length of the string (not counting NULL terminator). 
     209 * @param rdata         The receive data buffer to store the message and 
     210 *                      its elements. 
     211 * 
     212 * @return              The message inside the rdata if successfull, or NULL. 
     213 */ 
     214PJ_DECL(pjsip_msg *) pjsip_parse_rdata( char *buf, pj_size_t size, 
     215                                        pjsip_rx_data *rdata ); 
     216 
     217/** 
    188218 * Check incoming packet to see if a (probably) valid SIP message has been  
    189219 * received. 
     
    194224 *                      the size of the SIP message (including body, if any). 
    195225 * 
    196  * @return              PJ_TRUE (1) if a message is found. 
    197  */ 
    198 PJ_DECL(pj_bool_t) pjsip_find_msg( const char *buf, pj_size_t size,  
    199                                    pj_bool_t is_datagram, pj_size_t *msg_size); 
     226 * @return              PJ_SUCCESS if a message is found, or an error code. 
     227 */ 
     228PJ_DECL(pj_status_t) pjsip_find_msg(const char *buf,  
     229                                    pj_size_t size,  
     230                                    pj_bool_t is_datagram,  
     231                                    pj_size_t *msg_size); 
    200232 
    201233/** 
     
    248280 */ 
    249281extern 
    250 pj_char_spec    pjsip_HOST_SPEC,            /* For scanning host part. */ 
     282pj_cis_t        pjsip_HOST_SPEC,            /* For scanning host part. */ 
    251283                pjsip_DIGIT_SPEC,           /* Decimal digits */ 
    252284                pjsip_ALPHA_SPEC,           /* Alpha (A-Z, a-z) */ 
Note: See TracChangeset for help on using the changeset viewer.