Functions

select.c File Reference

SIP-router core ::Module: SIP-router core. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include "select.h"
#include "dprint.h"
#include "select_core.h"
#include "mem/mem.h"
#include "mem/shm_mem.h"
Include dependency graph for select.c:

Go to the source code of this file.

Functions


Detailed Description

Definition in file select.c.


Function Documentation

int parse_select ( char **  p,
select_t **  s 
)

Parse select string into select structure s and moves pointer p to the first unused char.

 * The select identifier must be of the form:
 *   [@] <sel_id> [ '.' <sel_id> ...]
 *   
 * Where 
 *       <sel_id> = <id> |
 *                  <id> '[' <idx> ']'
 *       <id> = [a-zA-Z0-9_]+
 *       <idx> = <number>  | '-' <number> | <string>
 *       <string> = '"' <ascii> '"' | 
 *                  '\"' <ascii> '\"'
 *
 * Examples:
 *     @to.tag
 *     @hf_value["contact"]
 *     @msg.header["SER-Server-ID"]
 *     @eval.pop[-1]
 *     contact.uri.params.maddr
 *     cfg_get.rtp_proxy.enabled 
Parameters:
p - double string (asciiz) pointer, *p is moved to the first char after the select identifier
s - the result will be stored here
Returns:
< 0 on error, 0 on success

Definition at line 217 of file select.c.

References w_parse_select().

Referenced by fix_param().

Here is the call graph for this function:

Here is the caller graph for this function:

int w_parse_select ( char **  p,
select_t *  sel 
)

The select identifier must be of the form:

 *   [@] <sel_id> [ '.' <sel_id> ...]
 *   
 * Where 
 *       <sel_id> = <id> |
 *                  <id> '[' <idx> ']'
 *       <id> = [a-zA-Z0-9_]+
 *       <idx> = <number> | <string>
 *       <string> = '"' <ascii> '"' | 
 *                  '\"' <ascii> '\"'
 *
 * Examples:
 *     @to.tag
 *     @hf_value["contact"]
 *     @msg.header["SER-Server-ID"]
 *     @eval.pop[-1]
 *     contact.uri.params.maddr
 *     cfg_get.rtp_proxy.enabled 
Returns:
-1 error p points to the first unconsumed char 0 success p points to the first unconsumed char s points to the select structure

Definition at line 109 of file select.c.

References _str::len, and _str::s.

Referenced by parse_select().

Here is the caller graph for this function: