mphq now runs Subversion 1.5.
[mplayer/glamo.git] / stream / freesdp / parserpriv.h
blob9d44102d3195245821676265f04d2fec5041aa98
1 /*
2 This file is part of FreeSDP
3 Copyright (C) 2001,2002,2003 Federico Montesino Pouzols <fedemp@suidzer0.org>
5 FreeSDP is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 /**
21 * @file parserpriv.h
23 * @short Private header for parser module.
24 **/
26 #ifndef FSDP_PARSERPRIV_H
27 #define FSDP_PARSERPRIV_H
29 #include "priv.h"
30 #include "parser.h"
32 /**
33 * Parse a connection (c=<network type> <address type> <connection
34 * address>) line. If the textual description in <code>p</code> begins
35 * with a connection line, it is parsed. If not, nothing is done.
37 * @param p fraction of textual SDP description.
38 * @param ntype where to store the network type.
39 * @param atype where to store the address type.
40 * @param address where to store the connection address as a string.
42 * @return parse error code.
43 **/
44 static fsdp_error_t
45 fsdp_parse_c (const char **p, fsdp_network_type_t * ntype,
46 fsdp_address_type_t * atype,
47 fsdp_connection_address_t * address);
49 /**
50 * Parse b (b=<modifier>:<bandwidth-value>) consecutive lines. If the
51 * textual description in <code>p</code> begins with a bandwidth line,
52 * it is parsed as well as all b lines inmediately after it. If not,
53 * nothing is done.
55 * @param p fraction of textual SDP description.
56 * @param bw_modifiers pointer to empty array of bandwidth modifiers to fill.
57 * @param bw_modifiers_count where to set the number of bandwidth
58 * modifiers successfully parsed.
60 * @return parse error code.
61 **/
62 static fsdp_error_t
63 fsdp_parse_b (const char **p, fsdp_bw_modifier_t ** bw_modifiers,
64 unsigned int *bw_modifiers_count);
66 /**
67 * Parse a k (k=<method>) or (k=<method>:<encryption key>) line. If
68 * the textual description in <code>p</code> begins with an encryption
69 * line, it is parsed. If not, nothing is done.
71 * @param p fraction of textual SDP description.
72 * @param method where to store the encryption method.
73 * @param content where to store the encryption key if provided.
75 * @return parse error code.
76 **/
77 static fsdp_error_t
78 fsdp_parse_k (const char **p, fsdp_encryption_method_t * method,
79 char **content);
82 /**
83 * Parses a string whose first token (first characters before the
84 * first space or end of string) is supposed to be a time in SDP
85 * syntax. Some examples of SDP times are: 2d, 5h, 3444, 7778s,
87 * @param time time in SDP syntax as a string.
88 * @param seconds where to store the value in seconds as an integer.
90 * @return parse error code.
91 **/
92 static fsdp_error_t
93 fsdp_repeat_time_to_uint (const char *time, unsigned long int *seconds);
95 static fsdp_error_t
96 fsdp_parse_rtpmap (fsdp_rtpmap_t *** rtpmap, unsigned int *counter,
97 const char *value);
99 /**
100 * Maximun default field len for "expected to be short" fields, like
101 * username, session_id or inet addresses.
103 * MDFLENS value must be MAXSHORTFIELDLEN - 1
105 #define MAXSHORTFIELDLEN 96
106 #define MSFLENS "95"
109 * Maximun default field len for "maybe very long" fields, like
110 * information, attribute values. This can also be used for lines
111 * where there is only a string field, like phone and email.
113 * MLFLENS value must be MAXLONGFIELDLEN - 1
115 #define MAXLONGFIELDLEN 1024
116 #define MLFLENS "1023"
118 #endif /* FSDP_PARSERPRIV_H */