mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-12 20:47:06 +00:00
merge changes from current sofia-sip tree.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4153 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
7f8c4decad
commit
cad28828b2
212 files changed
+36821
-13381
No files matched your search
@@ -54,11 +54,13 @@ 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
|
||||
|
||||
without_experimental = 0;
|
||||
template="";
|
||||
template1="";
|
||||
template2="";
|
||||
@@ -155,11 +157,24 @@ function protos (name, comment, hash, since)
|
||||
Extra[name] = extra++;
|
||||
}
|
||||
|
||||
expr = (without_experimental > 0 && do_hash);
|
||||
if (expr) {
|
||||
printf "%s is experimental\n", Comment;
|
||||
}
|
||||
|
||||
experimental[N] = expr;
|
||||
|
||||
if (PR) {
|
||||
if (expr) {
|
||||
print "#if SU_HAVE_EXPERIMENTAL" > PR;
|
||||
}
|
||||
replace(template, hash, name, NAME, comment, Comment, COMMENT, since);
|
||||
replace(template1, hash, name, NAME, comment, Comment, COMMENT, since);
|
||||
replace(template2, hash, name, NAME, comment, Comment, COMMENT, since);
|
||||
replace(template3, hash, name, NAME, comment, Comment, COMMENT, since);
|
||||
if (expr) {
|
||||
print "#endif /* SU_HAVE_EXPERIMENTAL */" > PR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,8 +225,19 @@ function process_footer (text)
|
||||
for (i = 1; i <= n; i++) {
|
||||
l = lines[i];
|
||||
if (match(tolower(l), /#(xxxxxx(x_xxxxxxx)?|hash)#/)) {
|
||||
expr = 0;
|
||||
|
||||
for (j = 1; j <= N; j++) {
|
||||
l = lines[i];
|
||||
if (expr != experimental[j]) {
|
||||
expr = experimental[j];
|
||||
if (expr) {
|
||||
print "#if SU_HAVE_EXPERIMENTAL" > PR;
|
||||
}
|
||||
else {
|
||||
print "#endif /* SU_HAVE_EXPERIMENTAL */" > PR;
|
||||
}
|
||||
}
|
||||
gsub(/#hash#/, hashes[j], l);
|
||||
gsub(/#xxxxxxx_xxxxxxx#/, comments[j], l);
|
||||
gsub(/#Xxxxxxx_Xxxxxxx#/, Comments[j], l);
|
||||
@@ -220,6 +246,10 @@ function process_footer (text)
|
||||
gsub(/#XXXXXX#/, NAMES[j], l);
|
||||
print l > PR;
|
||||
}
|
||||
|
||||
if (expr) {
|
||||
print "#endif /* SU_HAVE_EXPERIMENTAL */" > PR;
|
||||
}
|
||||
} else {
|
||||
print l > PR;
|
||||
}
|
||||
@@ -333,10 +363,11 @@ function templates ()
|
||||
}
|
||||
|
||||
/^#### EXTRA HEADER LIST STARTS HERE ####$/ { HLIST=1; templates(); }
|
||||
HLIST && /^#### EXPERIMENTAL HEADER LIST STARTS HERE ####$/ {
|
||||
without_experimental=total; }
|
||||
HLIST && /^[a-z]/ { protos($1, $0, 0, $2); headers[total++] = $1; }
|
||||
/^#### EXTRA HEADER LIST ENDS HERE ####$/ { HLIST=0; }
|
||||
|
||||
|
||||
/^ *\/\* === Headers start here \*\// { in_header_list=1; templates(); }
|
||||
/^ *\/\* === Headers end here \*\// { in_header_list=0; }
|
||||
|
||||
@@ -366,10 +397,13 @@ in_header_list && /^ (sip|rtsp|http|msg|mp)_[a-z_0-9]+_t/ {
|
||||
END {
|
||||
if (failed) { exit };
|
||||
|
||||
if (without_experimental == 0)
|
||||
without_experimental = total;
|
||||
|
||||
if (!NO_LAST) {
|
||||
protos("unknown", "/**< Unknown headers */", -3);
|
||||
protos("error", "/**< Erroneous headers */", -4);
|
||||
protos("separator", "/**< Separator line between headers and payload */", -5);
|
||||
protos("separator", "/**< Separator line between headers and body */", -5);
|
||||
protos("payload", "/**< Message payload */", -6);
|
||||
if (multipart)
|
||||
protos("multipart", "/**< Multipart payload */", -7);
|
||||
@@ -426,7 +460,16 @@ END {
|
||||
if (extra > 0) {
|
||||
printf("struct %s {\n", extra_struct) > PT;
|
||||
printf(" %s base;\n", module_struct) > PT;
|
||||
printf(" msg_header_t *extra[%u];\n", extra) > 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;
|
||||
}
|
||||
@@ -465,7 +508,13 @@ END {
|
||||
else {
|
||||
printf(" NULL, \n") > PT;
|
||||
}
|
||||
printf(" %d, %d, \n", MC_HASH_SIZE, total) > 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++) {
|
||||
@@ -484,6 +533,7 @@ END {
|
||||
}
|
||||
|
||||
header_hash[j] = n;
|
||||
experimental2[j] = (i >= without_experimental);
|
||||
}
|
||||
|
||||
for (i = 0; i < MC_HASH_SIZE; i++) {
|
||||
@@ -492,14 +542,23 @@ END {
|
||||
n = header_hash[i];
|
||||
flags = header_flags[n]; if (flags) flags = ",\n " flags;
|
||||
|
||||
if (experimental2[i]) {
|
||||
print "#if SU_HAVE_EXPERIMENTAL" > PT;
|
||||
}
|
||||
|
||||
if (Since[n]) {
|
||||
printf(" { %s_%s_class, offsetof(struct %s, extra[%u])%s }%s\n",
|
||||
printf(" { %s_%s_class,\n" \
|
||||
" offsetof(struct %s, extra[%u])%s }%s\n",
|
||||
tprefix, n, extra_struct, Extra[n], flags, c) > PT;
|
||||
}
|
||||
else {
|
||||
printf(" { %s_%s_class, 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;
|
||||
|
||||
Reference in new issue
Block a user