mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-09 21:14:02 +00:00
Sync to current darcs tree:
Mon Sep 17 14:50:04 EDT 2007 Pekka.Pessi@nokia.com * sofia-sip/sip_util.h: updated documentation Mon Sep 17 14:50:18 EDT 2007 Pekka.Pessi@nokia.com * sofia-sip/tport_tag.h: updated documentation Mon Sep 17 14:50:28 EDT 2007 Pekka.Pessi@nokia.com * soa_tag.c: updated documentation Wed Sep 19 12:50:01 EDT 2007 Pekka.Pessi@nokia.com * msg: updated documentation Wed Sep 19 13:29:50 EDT 2007 Pekka.Pessi@nokia.com * url: updated documentation Wed Sep 19 13:32:14 EDT 2007 Pekka.Pessi@nokia.com * nth: updated documentation Wed Sep 19 13:32:27 EDT 2007 Pekka.Pessi@nokia.com * nea: updated documentation Wed Sep 19 13:33:36 EDT 2007 Pekka.Pessi@nokia.com * http: updated documentation Wed Sep 19 13:36:58 EDT 2007 Pekka.Pessi@nokia.com * bnf: updated documentation Wed Sep 19 13:38:58 EDT 2007 Pekka.Pessi@nokia.com * nua: updated nua_stack_init_handle() prototype Wed Sep 19 18:45:56 EDT 2007 Pekka.Pessi@nokia.com * sip: added sip_name_addr_xtra(), sip_name_addr_dup() Wed Sep 19 19:00:19 EDT 2007 Pekka.Pessi@nokia.com * sip_basic.c: cleaned old crud Thu Sep 20 13:34:04 EDT 2007 Pekka.Pessi@nokia.com * iptsec: updated documentation Thu Sep 20 13:36:22 EDT 2007 Pekka.Pessi@nokia.com * tport: updated documentation Thu Sep 20 13:36:56 EDT 2007 Pekka.Pessi@nokia.com * su: updated documentation Removed internal files from doxygen-generated documentation. Thu Sep 20 13:38:29 EDT 2007 Pekka.Pessi@nokia.com * soa: fixed documentation Thu Sep 20 13:39:56 EDT 2007 Pekka.Pessi@nokia.com * sdp: updated documentation Thu Sep 20 13:40:16 EDT 2007 Pekka.Pessi@nokia.com * ipt: updated documentation Thu Sep 20 14:24:20 EDT 2007 Pekka.Pessi@nokia.com * nta: updated documentation Thu Sep 20 14:41:04 EDT 2007 Pekka.Pessi@nokia.com * nua: updated documentation Updated tag documentation. Moved doxygen doc entries from sofia-sip/nua_tag.h to nua_tag.c. Removed internal datatypes and files from the generated documents. Wed Sep 19 13:34:20 EDT 2007 Pekka.Pessi@nokia.com * docs: updated the generation of documentation. Updated links to header files. Thu Sep 20 08:45:32 EDT 2007 Pekka.Pessi@nokia.com * sip/Makefile.am: added tags to <sofia-sip/sip_extra.h> Added check for extra tags in torture_sip.c. Thu Sep 20 14:45:22 EDT 2007 Pekka.Pessi@nokia.com * stun: updated documentation Wed Jul 4 18:55:20 EDT 2007 Pekka.Pessi@nokia.com * torture_heap.c: added tests for ##sort() and su_smoothsort() Wed Jul 4 18:56:59 EDT 2007 Pekka.Pessi@nokia.com * Makefile.am: added smoothsort.c Fri Jul 13 12:38:44 EDT 2007 Pekka.Pessi@nokia.com * sofia-sip/heap.h: heap_remove() now set()s index to 0 on removed item Mon Jul 23 11:14:22 EDT 2007 Pekka.Pessi@nokia.com * sofia-sip/heap.h: fixed bug in heap##remove() If left kid was in heap but right was not, left kid was ignored. Wed Jul 4 18:51:08 EDT 2007 Pekka.Pessi@nokia.com * smoothsort.c: added Wed Jul 4 18:51:34 EDT 2007 Pekka.Pessi@nokia.com * heap.h: using su_smoothsort() Fri Jul 6 10:20:27 EDT 2007 Pekka.Pessi@nokia.com * smoothsort.c: added Wed Sep 19 17:40:30 EDT 2007 Pekka.Pessi@nokia.com * msg_parser.awk: generate two parser tables, default and extended Wed Sep 19 18:39:45 EDT 2007 Pekka.Pessi@nokia.com * msg_parser.awk: just generate list of extra headers Allocate extended parser dynamically. Wed Sep 19 18:59:59 EDT 2007 Pekka.Pessi@nokia.com * sip: added Remote-Party-ID, P-Asserted-Identity, P-Preferred-Identity Added functions sip_update_default_mclass() and sip_extend_mclass() for handling the extended parser. Note that Reply-To and Alert-Info are only available with the extended parser. Wed Sep 19 19:05:44 EDT 2007 Pekka.Pessi@nokia.com * RELEASE: updated Thu Sep 20 13:38:59 EDT 2007 Pekka.Pessi@nokia.com * sip: updated documentation Thu Sep 20 14:17:28 EDT 2007 Pekka.Pessi@nokia.com * docs/conformance.docs: updated Mon Oct 1 10:11:14 EDT 2007 Pekka.Pessi@nokia.com * tport_tag.c: re-enabled tptag_trusted Thu Oct 4 09:21:07 EDT 2007 Pekka.Pessi@nokia.com * su_osx_runloop.c: moved virtual function table after struct definition Preparing for su_port_vtable_t refactoring. Thu Oct 4 10:22:03 EDT 2007 Pekka.Pessi@nokia.com * su_source.c: refactored initialization/deinitialization Fri Oct 5 04:58:18 EDT 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * sip_extra.c: fixed prototypes with isize_t Fri Oct 5 04:58:45 EDT 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * test_nta_api.c: removed warnings about signedness Fri Oct 5 04:59:02 EDT 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * test_nua_params.c: removed warnings about constness Fri Oct 5 07:20:26 EDT 2007 Pekka Pessi <first.lastname@nokia.com> * su_port.h, su_root.c: cleaned argument checking The su_root_*() and su_port_*() functions now check their arguments once and do not assert() with NULL arguments. The sur_task->sut_port should always be valid while su_root_t is alive. Fri Oct 5 07:22:09 EDT 2007 Pekka Pessi <first.lastname@nokia.com> * su: added su_root_obtain(), su_root_release() and su_root_has_thread() When root is created with su_root_create() or cloned with su_clone_start(), the resulting root is obtained by the calling or created thread, respectively. The root can be released with su_root_release() and another thread can obtain it. The function su_root_has_thread() can be used to check if a thread has obtained or released the root. Implementation upgraded the su_port_own_thread() method as su_port_thread(). Fri Oct 5 07:28:10 EDT 2007 Pekka Pessi <first.lastname@nokia.com> * su_port.h: removed su_port_threadsafe() and su_port_yield() methods su_port_wait_events() replaces su_port_yield(). Fri Oct 5 13:26:04 EDT 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * msg_parser.awk: not extending header structure unless needed. Removed gawk-ish /* comments */. Fri Oct 5 14:32:25 EDT 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * run_test_su: removed GNUisms Fri Oct 5 14:32:47 EDT 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * Makefile.am: removed implicit check target test_urlmap Fri Oct 5 14:22:32 EDT 2007 Pekka Pessi <first.lastname@nokia.com> * torture_sresolv.c: use CLOCK_REALTIME if no CLOCK_PROCESS_CPUTIME_ID available Casting timespec tv_sec to unsigned long. Fri Oct * nua_s added handling nua_prack() Thanks to Fabio Margarido for the patch. Mon Oct 8 10:24:35 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for sf.net bug #1803686 Mon Oct 8 08:15:23 EDT 2007 Pekka.Pessi@nokia.com * RELEASE: updated. Mon Oct 8 09:30:36 EDT 2007 Pekka.Pessi@nokia.com * nua_stack: added handling nua_prack() Thanks to Fabio Margarido for the patch. Mon Oct 8 10:24:35 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for sf.net bug #1803686 Mon Oct 8 10:26:31 EDT 2007 Pekka.Pessi@nokia.com * nua: added test for nua_prack() (sf.net bug #1804248) Avoid sending nua_i_state after nua_prack() if no SDP O/A is happening, too. Mon Oct 8 10:32:04 EDT 2007 Mikhail Zabaluev <mikhail.zabaluev@nokia.com> * su_source.c: don t leak the wait arrays Mon Oct 8 10:37:11 EDT 2007 Pekka.Pessi@nokia.com * RELEASE: updated Wed Oct 10 11:55:21 EDT 2007 Pekka.Pessi@nokia.com * sip_parser.c: silenced warning about extra const in sip_extend_mclass() Wed Oct 10 11:57:08 EDT 2007 Pekka.Pessi@nokia.com * nta_tag.c: updated tag documentation Wed Oct 10 13:16:40 EDT 2007 Pekka.Pessi@nokia.com * nua: fix logging crash if outbound used with application contact Silenced warnings. Wed Oct 10 13:30:45 EDT 2007 Pekka.Pessi@nokia.com * msg_parser.awk: removed extra "const" Wed Oct 10 13:31:45 EDT 2007 Pekka.Pessi@nokia.com * Makefile.am's: fixed distclean of documentation git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5840 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -7,6 +7,8 @@ INPUT = @srcdir@/msg.docs @srcdir@/sofia-sip sofia-sip @srcdir@ .
|
||||
@INCLUDE = ../docs/Doxyfile.conf
|
||||
@INCLUDE = ../sip/sip.doxyaliases
|
||||
|
||||
EXCLUDE_PATTERNS += msg_test*.h msg_test*.c
|
||||
|
||||
TAGFILES += ../docs/ipt.doxytags=../ipt \
|
||||
../docs/su.doxytags=../su \
|
||||
../docs/sip.doxytags=../sip \
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file msg.c Message object implementation.
|
||||
/**@internal @file msg.c Message object implementation.
|
||||
*
|
||||
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
|
||||
*
|
||||
|
||||
@@ -142,7 +142,7 @@ separator and the message body are all in their own fragment structure. The
|
||||
fragments form a dual-linked list known as @e fragment @e chain as shown in
|
||||
the above figure. The memory buffers for the message, the fragment chain,
|
||||
and a whole lot of other stuff is held by the generic message type, #msg_t,
|
||||
defined in <msg.h>. The internal structure of #msg_t is known only within @b
|
||||
defined in <sofia-sip/msg.h>. The internal structure of #msg_t is known only within @b
|
||||
msg module and it is opaque to other modules.
|
||||
|
||||
The @b msg parser engine also drives the reverse process, invoking the
|
||||
@@ -262,7 +262,7 @@ header members that are also found in the beginning of a header
|
||||
structure. The @e sip_size indicates the size of the structure - the
|
||||
application can extend the parser and #sip_t structure beyond the
|
||||
original size. The @e sip_flags contains various flags used during the
|
||||
parsing and printing process. They are documented in the <msg.h>. These
|
||||
parsing and printing process. They are documented in the <sofia-sip/msg.h>. These
|
||||
boilerplate members are followed by the pointers to various message
|
||||
elements and headers.
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**@ingroup msg_parser
|
||||
/**@internal
|
||||
* @ingroup msg_parser
|
||||
* @file msg_generic.c
|
||||
* @brief Functions for generic headers
|
||||
*
|
||||
|
||||
@@ -67,36 +67,6 @@ size_t memcspn(const void *mem, size_t memlen,
|
||||
/** Protocol version of MIME */
|
||||
char const msg_mime_version_1_0[] = "MIME/1.0";
|
||||
|
||||
/* Internally used version of msg_header_t */
|
||||
union msg_mime_u
|
||||
{
|
||||
msg_common_t sh_common[1];
|
||||
struct {
|
||||
msg_common_t shn_common;
|
||||
msg_header_t *shn_next;
|
||||
} sh_header_next[1];
|
||||
|
||||
msg_multipart_t sh_multipart[1];
|
||||
|
||||
msg_accept_t sh_accept[1];
|
||||
msg_accept_any_t sh_accept_any[1];
|
||||
msg_accept_charset_t sh_accept_charset[1];
|
||||
msg_accept_encoding_t sh_accept_encoding[1];
|
||||
msg_accept_language_t sh_accept_language[1];
|
||||
msg_content_disposition_t sh_content_disposition[1];
|
||||
msg_content_encoding_t sh_content_encoding[1];
|
||||
msg_content_id_t sh_content_id[1];
|
||||
msg_content_language_t sh_content_language[1];
|
||||
msg_content_length_t sh_content_length[1];
|
||||
msg_content_location_t sh_content_location[1];
|
||||
msg_content_type_t sh_content_type[1];
|
||||
msg_mime_version_t sh_mime_version[1];
|
||||
msg_warning_t sh_warning[1];
|
||||
msg_unknown_t sh_unknown[1];
|
||||
msg_separator_t sh_separator[1];
|
||||
msg_payload_t sh_payload[1];
|
||||
};
|
||||
|
||||
#include <sofia-sip/msg_parser.h>
|
||||
#include <sofia-sip/msg_mime_protos.h>
|
||||
|
||||
|
||||
@@ -54,25 +54,26 @@ BEGIN {
|
||||
split("", NAMES);
|
||||
split("", Comments);
|
||||
split("", COMMENTS);
|
||||
split("", experimental);
|
||||
|
||||
# indexed by the C name of the header
|
||||
split("", Since); # Non-NUL if extra
|
||||
split("", Extra); # Offset in extra headers
|
||||
|
||||
total = 0;
|
||||
ordinary = 0;
|
||||
basic = 0;
|
||||
extra = 0;
|
||||
without_experimental = 0;
|
||||
|
||||
template="";
|
||||
template1="";
|
||||
template2="";
|
||||
template3="";
|
||||
prefix="";
|
||||
tprefix="";
|
||||
extra=0;
|
||||
failed=0;
|
||||
success=0;
|
||||
|
||||
extra_struct = "msg_pub_extra";
|
||||
|
||||
ERRNO="error";
|
||||
}
|
||||
|
||||
@@ -159,7 +160,6 @@ function protos (name, comment, hash, since)
|
||||
symbols[name] = comment;
|
||||
if (since) {
|
||||
Since[name] = since;
|
||||
Extra[name] = extra++;
|
||||
}
|
||||
|
||||
expr = (without_experimental > 0 && do_hash);
|
||||
@@ -210,7 +210,7 @@ function replace (p, hash, name, NAME, comment, Comment, COMMENT, since)
|
||||
|
||||
#
|
||||
# Repeat each line in the footer containing the magic replacement
|
||||
# pattern with a instance of all headers
|
||||
# pattern with an instance of all headers
|
||||
#
|
||||
function process_footer (text)
|
||||
{
|
||||
@@ -368,9 +368,14 @@ function templates ()
|
||||
}
|
||||
|
||||
/^#### EXTRA HEADER LIST STARTS HERE ####$/ { HLIST=1; templates(); }
|
||||
HLIST && /^#### DEFAULT HEADER LIST ENDS HERE ####$/ { basic=total; }
|
||||
HLIST && /^#### EXPERIMENTAL HEADER LIST STARTS HERE ####$/ {
|
||||
without_experimental=total; }
|
||||
HLIST && /^[a-z]/ { protos($1, $0, 0, $2); headers[total++] = $1; }
|
||||
without_experimental = total; }
|
||||
|
||||
HLIST && /^[a-z]/ { protos($1, $0, 0, $2);
|
||||
headers[total++] = $1;
|
||||
Extra[$1] = extra++;
|
||||
}
|
||||
/^#### EXTRA HEADER LIST ENDS HERE ####$/ { HLIST=0; }
|
||||
|
||||
/^ *\/\* === Headers start here \*\// { in_header_list=1; templates(); }
|
||||
@@ -396,15 +401,117 @@ in_header_list && /^ (sip|rtsp|http|msg|mp)_[a-z_0-9]+_t/ {
|
||||
if (!NO_MIDDLE)
|
||||
protos(n, $0, 0);
|
||||
|
||||
headers[total++] = n;
|
||||
headers[total] = n; total++; ordinary++;
|
||||
}
|
||||
|
||||
function print_parser_table(struct, scope, name, N, N_EXPERIMENTAL)
|
||||
{
|
||||
if (PT) {
|
||||
if (N > ordinary) {
|
||||
printf("/* Ordinary %u, extra %u, experimental %u */\n",
|
||||
ordinary, N - ordinary, N_EXPERIMENTAL - N) > PT;
|
||||
printf("struct %s {\n", struct) > PT;
|
||||
printf(" %s_t base;\n", module) > PT;
|
||||
printf(" msg_header_t *extra[%u];\n", N - ordinary) > PT;
|
||||
if (N != N_EXPERIMENTAL) {
|
||||
print "#if SU_HAVE_EXPERIMENTAL" > PT;
|
||||
printf(" msg_header_t *extra[%u];\n", N_EXPERIMENTAL - N) > PT;
|
||||
print "#endif" > PT;
|
||||
}
|
||||
printf("};\n\n") > PT;
|
||||
}
|
||||
|
||||
printf("%s\n", scope) > PT;
|
||||
printf("msg_mclass_t const %s[1] = \n{{\n", name) > PT;
|
||||
printf("# if defined (%s_HCLASS)\n", toupper(module)) > PT;
|
||||
printf(" %s_HCLASS,\n", toupper(module)) > PT;
|
||||
printf("#else\n") > PT;
|
||||
printf(" {{ 0 }},\n") > PT;
|
||||
printf("#endif\n") > PT;
|
||||
printf(" %s_VERSION_CURRENT,\n", toupper(module)) > PT;
|
||||
printf(" %s_PROTOCOL_TAG,\n", toupper(module)) > PT;
|
||||
printf("#if defined (%s_PARSER_FLAGS)\n", toupper(module)) > PT;
|
||||
printf(" %s_PARSER_FLAGS,\n", toupper(module)) > PT;
|
||||
printf("#else\n") > PT;
|
||||
printf(" 0,\n") > PT;
|
||||
printf("#endif\n") > PT;
|
||||
if (N > ordinary) {
|
||||
printf(" sizeof (struct %s),\n", struct) > PT;
|
||||
}
|
||||
else {
|
||||
printf(" sizeof (%s_t),\n", module) > PT;
|
||||
}
|
||||
printf(" %s_extract_body,\n", module) > PT;
|
||||
|
||||
len = split("request status separator payload unknown error", unnamed, " ");
|
||||
|
||||
for (i = 1; i <= len; i++) {
|
||||
printf(" {{ %s_%s_class, msg_offsetof(%s_t, %s_%s) }},\n",
|
||||
tprefix, unnamed[i], module, prefix, unnamed[i]) > PT;
|
||||
}
|
||||
if (multipart) {
|
||||
printf(" {{ %s_class, msg_offsetof(%s_t, %s_multipart) }},\n",
|
||||
multipart, module, prefix) > PT;
|
||||
} else {
|
||||
printf(" {{ NULL, 0 }},\n") > PT;
|
||||
}
|
||||
if (MC_SHORT_SIZE) {
|
||||
printf(" %s_short_forms, \n", module) > PT;
|
||||
}
|
||||
else {
|
||||
printf(" NULL, \n") > PT;
|
||||
}
|
||||
printf(" %d, \n", MC_HASH_SIZE) > PT;
|
||||
if (N != N_EXPERIMENTAL) {
|
||||
print "#if SU_HAVE_EXPERIMENTAL" > PT;
|
||||
printf(" %d,\n", N_EXPERIMENTAL) > PT;
|
||||
print "#else" > PT;
|
||||
}
|
||||
printf(" %d,\n", N) > PT;
|
||||
if (N != N_EXPERIMENTAL) {
|
||||
print "#endif" > PT;
|
||||
}
|
||||
|
||||
printf(" {\n") > PT;
|
||||
|
||||
for (j = 0; j < MC_HASH_SIZE; j++) {
|
||||
c = (j + 1 == MC_HASH_SIZE) ? "" : ",";
|
||||
if (j in header_hash) {
|
||||
n = header_hash[j];
|
||||
i = index_hash[j];
|
||||
|
||||
flags = header_flags[n]; if (flags) flags = ",\n " flags;
|
||||
|
||||
if (i >= N) {
|
||||
print "#if SU_HAVE_EXPERIMENTAL" > PT;
|
||||
}
|
||||
|
||||
if (i >= ordinary) {
|
||||
printf(" { %s_%s_class,\n" \
|
||||
" msg_offsetof(struct %s, extra[%u])%s }%s\n",
|
||||
tprefix, n, struct, Extra[n], flags, c) > PT;
|
||||
}
|
||||
else {
|
||||
printf(" { %s_%s_class, msg_offsetof(%s_t, %s_%s)%s }%s\n",
|
||||
tprefix, n, module, prefix, n, flags, c) > PT;
|
||||
}
|
||||
|
||||
if (i >= N) {
|
||||
printf("#else\n { NULL, 0 }%s\n#endif\n", c) > PT;
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf(" { NULL, 0 }%s\n", c) > PT;
|
||||
}
|
||||
}
|
||||
printf(" }\n}};\n\n") > PT;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
END {
|
||||
if (failed) { exit };
|
||||
|
||||
if (without_experimental == 0)
|
||||
without_experimental = total;
|
||||
|
||||
if (!NO_LAST) {
|
||||
protos("unknown", "/**< Unknown headers */", -3);
|
||||
protos("error", "/**< Erroneous headers */", -4);
|
||||
@@ -429,8 +536,6 @@ END {
|
||||
getline footer < TEMPLATE;
|
||||
RS=RS0;
|
||||
|
||||
module_struct = module "_t";
|
||||
|
||||
sub(/.*[\/]/, "", TEMPLATE);
|
||||
gsub(/#AUTO#/, auto, header);
|
||||
gsub(/#DATE#/, "@date Generated: " date, header);
|
||||
@@ -451,9 +556,9 @@ END {
|
||||
n = shorts[i];
|
||||
flags = header_flags[n]; if (flags) flags = ",\n " flags;
|
||||
|
||||
printf(" { /* %s */ %s_%s_class, msg_offsetof(%s_t, %s_%s)%s }%s\n",
|
||||
substr(lower_case, i, 1),
|
||||
tprefix, n, module, prefix, n, flags, c) \
|
||||
printf(" { /* %s */ %s_%s_class, msg_offsetof(%s_t, %s_%s)%s }%s\n",
|
||||
substr(lower_case, i, 1),
|
||||
tprefix, n, module, prefix, n, flags, c) \
|
||||
> PT;
|
||||
}
|
||||
else {
|
||||
@@ -466,67 +571,13 @@ END {
|
||||
|
||||
# printf("extern msg_hclass_t msg_multipart_class[];\n\n") > PT;
|
||||
|
||||
if (extra > 0) {
|
||||
printf("struct %s {\n", extra_struct) > PT;
|
||||
printf(" %s base;\n", module_struct) > PT;
|
||||
if (total - without_experimental < extra) {
|
||||
printf(" msg_header_t *extra[%u];\n",
|
||||
extra - (total - without_experimental)) > PT;
|
||||
}
|
||||
if (total - without_experimental > 0) {
|
||||
print "#if SU_HAVE_EXPERIMENTAL" > PT;
|
||||
printf(" msg_header_t *experimental[%u];\n",
|
||||
total - without_experimental) > PT;
|
||||
print "#endif" > PT;
|
||||
}
|
||||
printf("};\n\n") > PT;
|
||||
module_struct = "struct " extra_struct;
|
||||
}
|
||||
if (basic == 0) basic = total;
|
||||
if (without_experimental == 0) without_experimental = total;
|
||||
|
||||
printf("msg_mclass_t const %s_mclass[1] = \n{{\n", module) > PT;
|
||||
printf("# if defined (%s_HCLASS)\n", toupper(module)) > PT;
|
||||
printf(" %s_HCLASS,\n", toupper(module)) > PT;
|
||||
printf("#else\n") > PT;
|
||||
printf(" {{ 0 }},\n") > PT;
|
||||
printf("#endif\n") > PT;
|
||||
printf(" %s_VERSION_CURRENT,\n", toupper(module)) > PT;
|
||||
printf(" %s_PROTOCOL_TAG,\n", toupper(module)) > PT;
|
||||
printf("#if defined (%s_PARSER_FLAGS)\n", toupper(module)) > PT;
|
||||
printf(" %s_PARSER_FLAGS,\n", toupper(module)) > PT;
|
||||
printf("#else\n") > PT;
|
||||
printf(" 0,\n") > PT;
|
||||
printf("#endif\n") > PT;
|
||||
printf(" sizeof (%s),\n", module_struct) > PT;
|
||||
printf(" %s_extract_body,\n", module) > PT;
|
||||
split("", header_hash);
|
||||
split("", index_hash);
|
||||
|
||||
len = split("request status separator payload unknown error", unnamed, " ");
|
||||
|
||||
for (i = 1; i <= len; i++) {
|
||||
printf(" {{ %s_%s_class, msg_offsetof(%s_t, %s_%s) }},\n",
|
||||
tprefix, unnamed[i], module, prefix, unnamed[i]) > PT;
|
||||
}
|
||||
if (multipart) {
|
||||
printf(" {{ %s_class, msg_offsetof(%s_t, %s_multipart) }},\n",
|
||||
multipart, module, prefix) > PT;
|
||||
} else {
|
||||
printf(" {{ NULL, 0 }},\n") > PT;
|
||||
}
|
||||
if (MC_SHORT_SIZE) {
|
||||
printf(" %s_short_forms, \n", module) > PT;
|
||||
}
|
||||
else {
|
||||
printf(" NULL, \n") > PT;
|
||||
}
|
||||
printf(" %d, \n", MC_HASH_SIZE) > PT;
|
||||
printf ("#if SU_HAVE_EXPERIMENTAL\n" \
|
||||
" %d,\n" \
|
||||
"#else\n" \
|
||||
" %d,\n" \
|
||||
"#endif\n", \
|
||||
total, without_experimental) > PT;
|
||||
printf(" {\n") > PT;
|
||||
|
||||
for (i = 0; i < total; i++) {
|
||||
for (i = 0; i < basic; i++) {
|
||||
n = headers[i];
|
||||
h = hashed[n];
|
||||
|
||||
@@ -542,38 +593,67 @@ END {
|
||||
}
|
||||
|
||||
header_hash[j] = n;
|
||||
experimental2[j] = (i >= without_experimental);
|
||||
index_hash[j] = i;
|
||||
}
|
||||
|
||||
for (i = 0; i < MC_HASH_SIZE; i++) {
|
||||
c = (i + 1 == MC_HASH_SIZE) ? "" : ",";
|
||||
if (i in header_hash) {
|
||||
n = header_hash[i];
|
||||
flags = header_flags[n]; if (flags) flags = ",\n " flags;
|
||||
m = module "_mclass";
|
||||
s = "_d_" module "_t";
|
||||
|
||||
if (experimental2[i]) {
|
||||
# Add basic headers
|
||||
if (ordinary == basic) {
|
||||
print_parser_table(s, "", m, basic, basic);
|
||||
}
|
||||
else if (basic < without_experimental) {
|
||||
print_parser_table(s, "", m, basic, basic);
|
||||
}
|
||||
else {
|
||||
print_parser_table(s, "", m, without_experimental, basic);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
|
||||
# Hash extra headers
|
||||
for (i = basic; i < total; i++) {
|
||||
n = headers[i];
|
||||
h = hashed[n];
|
||||
|
||||
if (h < 0)
|
||||
continue;
|
||||
|
||||
j = h % MC_HASH_SIZE; if (j == -0) j = 0;
|
||||
|
||||
for (; j in header_hash;) {
|
||||
if (++j == MC_HASH_SIZE) {
|
||||
j = 0;
|
||||
}
|
||||
}
|
||||
|
||||
header_hash[j] = n;
|
||||
index_hash[j] = i;
|
||||
}
|
||||
|
||||
if (basic < total) {
|
||||
m = module "_ext_mclass";
|
||||
s = "_e_" module "_s";
|
||||
print_parser_table(s, "static", m, without_experimental, total);
|
||||
}
|
||||
|
||||
printf("msg_mclass_t const * %s_extended_mclass = %s;\n\n", module, m) > PT;
|
||||
|
||||
}
|
||||
|
||||
if (basic < total) {
|
||||
printf("msg_hclass_t * const %s_extensions[] = {\n", module) > PT;
|
||||
for (i = basic; i < total; i++) {
|
||||
if (i == without_experimental) {
|
||||
print "#if SU_HAVE_EXPERIMENTAL" > PT;
|
||||
}
|
||||
|
||||
if (Since[n]) {
|
||||
printf(" { %s_%s_class,\n" \
|
||||
" msg_offsetof(struct %s, extra[%u])%s }%s\n",
|
||||
tprefix, n, extra_struct, Extra[n], flags, c) > PT;
|
||||
}
|
||||
else {
|
||||
printf(" { %s_%s_class, msg_offsetof(%s_t, %s_%s)%s }%s\n",
|
||||
tprefix, n, module, prefix, n, flags, c) > PT;
|
||||
}
|
||||
|
||||
if (experimental2[i]) {
|
||||
printf("#else\n { NULL, 0 }%s\n#endif\n", c) > PT;
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf(" { NULL, 0 }%s\n", c) > PT;
|
||||
}
|
||||
printf(" %s_%s_class,\n", module, headers[i]) > PT;
|
||||
}
|
||||
if (total != without_experimental)
|
||||
print "#endif" > PT;
|
||||
print " NULL\n};\n\n" > PT;
|
||||
}
|
||||
printf(" }\n}};\n\n") > PT;
|
||||
}
|
||||
|
||||
exit success;
|
||||
|
||||
Reference in New Issue
Block a user