1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877
|
<html>
<head>
<link rel="stylesheet" type="text/css" href="dox.css" />
<title>libapreq2-2.05-dev: libapreq2: include/apreq_parser.h File Reference</title>
</head>
<body>
<div id="page-header">
<p class="menu">
<a href="http://www.apache.org/">Apache Software Foundation</a> > <a href="http://httpd.apache.org">HTTP Server Project</a> >
<a href="http://httpd.apache.org/apreq/">Request Library Subproject</a></p>
<p class="apache">Apache HTTP Server Request Library</p>
<img alt="" src="feather.gif" /></div>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">include</a></div>
<h1>apreq_parser.h File Reference</h1>Request body parser API. <a href="#_details">More...</a>
<p>
<code>#include "<a class="el" href="apreq__param_8h-source.html">apreq_param.h</a>"</code><br>
<p>
<a href="apreq__parser_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a0">APREQ_PARSER_ARGS</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a1">APREQ_HOOK_ARGS</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a2">APREQ_DECLARE_PARSER</a>(f)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a3">APREQ_DECLARE_HOOK</a>(f)</td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a4">apreq_hook_t</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="structapreq__parser__t.html">apreq_parser_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a5">apreq_parser_t</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a6">apreq_parser_function_t</a> )(APREQ_PARSER_ARGS)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a7">apreq_hook_function_t</a> )(APREQ_HOOK_ARGS)</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__platform.html#ga11">APR_INLINE</a> <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a8">apreq_parser_run</a> (struct <a class="el" href="structapreq__parser__t.html">apreq_parser_t</a> *psr, <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__tables.html#gga0">apr_table_t</a> *t, <a class="elRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> *bb)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__platform.html#ga11">APR_INLINE</a> <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a9">apreq_hook_run</a> (struct <a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> *h, <a class="el" href="structapreq__param__t.html">apreq_param_t</a> *param, <a class="elRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> *bb)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a10">APREQ_DECLARE_PARSER</a> (apreq_parse_headers)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a11">APREQ_DECLARE_PARSER</a> (apreq_parse_urlencoded)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a12">APREQ_DECLARE_PARSER</a> (apreq_parse_multipart)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a13">APREQ_DECLARE_PARSER</a> (apreq_parse_generic)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a14">APREQ_DECLARE_HOOK</a> (apreq_hook_apr_xml_parser)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structapreq__parser__t.html">apreq_parser_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a15">apreq_parser_make</a> (<a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__pools.html#gga0">apr_pool_t</a> *pool, <a class="elRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/group___a_p_r___util___bucket___brigades.html#gga2">apr_bucket_alloc_t</a> *ba, const char *content_type, <a class="el" href="apreq__parser_8h.html#a6">apreq_parser_function_t</a> pfn, <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__platform.html#gga7">apr_size_t</a> brigade_limit, const char *temp_dir, <a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> *hook, void *ctx)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a16">apreq_hook_make</a> (<a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__pools.html#gga0">apr_pool_t</a> *pool, <a class="el" href="apreq__parser_8h.html#a7">apreq_hook_function_t</a> hook, <a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> *next, void *ctx)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a17">apreq_parser_add_hook</a> (<a class="el" href="structapreq__parser__t.html">apreq_parser_t</a> *p, <a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> *h)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="apreq__parser_8h.html#a6">apreq_parser_function_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a18">apreq_parser</a> (const char *enctype)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a19">apreq_register_parser</a> (const char *enctype, <a class="el" href="apreq__parser_8h.html#a6">apreq_parser_function_t</a> pfn)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a20">APREQ_DECLARE_HOOK</a> (apreq_hook_disable_uploads)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a21">APREQ_DECLARE_HOOK</a> (apreq_hook_discard_brigade)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="apreq__parser_8h.html#a22">APREQ_DECLARE_HOOK</a> (apreq_hook_find_param)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Request body parser API.
<p>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="a3" doxytag="apreq_parser.h::APREQ_DECLARE_HOOK"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define APREQ_DECLARE_HOOK </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">f </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">APREQ_DECLARE_NONSTD(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a>) \
(f) (<a class="code" href="apreq__parser_8h.html#a1">APREQ_HOOK_ARGS</a>)
</pre></div>Declares an API hook. </td>
</tr>
</table>
<a class="anchor" name="a2" doxytag="apreq_parser.h::APREQ_DECLARE_PARSER"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define APREQ_DECLARE_PARSER </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">f </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">APREQ_DECLARE_NONSTD(<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a>) \
(f) (<a class="code" href="apreq__parser_8h.html#a0">APREQ_PARSER_ARGS</a>)
</pre></div>Declares a API parser. </td>
</tr>
</table>
<a class="anchor" name="a1" doxytag="apreq_parser.h::APREQ_HOOK_ARGS"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define APREQ_HOOK_ARGS </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="structapreq__hook__t.html">apreq_hook_t</a> *hook, \
<a class="code" href="structapreq__param__t.html">apreq_param_t</a> *param, \
<a class="codeRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> *bb
</pre></div>Hook arguments </td>
</tr>
</table>
<a class="anchor" name="a0" doxytag="apreq_parser.h::APREQ_PARSER_ARGS"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define APREQ_PARSER_ARGS </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="structapreq__parser__t.html">apreq_parser_t</a> *parser, \
<a class="codeRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__tables.html#gga0">apr_table_t</a> *t, \
<a class="codeRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> *bb
</pre></div>Parser arguments. </td>
</tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="a7" doxytag="apreq_parser.h::apreq_hook_function_t"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">typedef <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a>(* <a class="el" href="apreq__parser_8h.html#a7">apreq_hook_function_t</a>)(APREQ_HOOK_ARGS) </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The callback function of a hook. See <a class="el" href="structapreq__hook__t.html">apreq_hook_t</a>. </td>
</tr>
</table>
<a class="anchor" name="a4" doxytag="apreq_parser.h::apreq_hook_t"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">typedef struct <a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> <a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
A hook is called by the parser whenever data arrives in a file upload parameter of the request body. You may associate any number of hooks with a parser instance with <a class="el" href="apreq__parser_8h.html#a17">apreq_parser_add_hook()</a>. </td>
</tr>
</table>
<a class="anchor" name="a6" doxytag="apreq_parser.h::apreq_parser_function_t"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">typedef <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a>(* <a class="el" href="apreq__parser_8h.html#a6">apreq_parser_function_t</a>)(APREQ_PARSER_ARGS) </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The callback function implementing a request body parser. </td>
</tr>
</table>
<a class="anchor" name="a5" doxytag="apreq_parser.h::apreq_parser_t"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">typedef struct <a class="el" href="structapreq__parser__t.html">apreq_parser_t</a> <a class="el" href="structapreq__parser__t.html">apreq_parser_t</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
A request body parser instance. </td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a22" doxytag="apreq_parser.h::APREQ_DECLARE_HOOK"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">APREQ_DECLARE_HOOK </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">apreq_hook_find_param </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Special purpose utility for locating a parameter during parsing. The hook's ctx shoud be initialized to a const char *, which is a pointer to the desired param name. The hook's ctx will be reassigned to the first param found.<p>
<dl compact><dt><b>Remarks:</b></dt><dd>When used, this should always be the first hook invoked, so add it manually as parser->hook instead of using apreq_parser_add_hook. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a21" doxytag="apreq_parser.h::APREQ_DECLARE_HOOK"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">APREQ_DECLARE_HOOK </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">apreq_hook_discard_brigade </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Calls apr_brigade_cleanup on the incoming brigade after passing the brigade to any subsequent hooks. </td>
</tr>
</table>
<a class="anchor" name="a20" doxytag="apreq_parser.h::APREQ_DECLARE_HOOK"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">APREQ_DECLARE_HOOK </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">apreq_hook_disable_uploads </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Returns APREQ_ERROR_GENERAL. Effectively disables mfd parser if a file-upload field is present. </td>
</tr>
</table>
<a class="anchor" name="a14" doxytag="apreq_parser.h::APREQ_DECLARE_HOOK"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">APREQ_DECLARE_HOOK </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">apreq_hook_apr_xml_parser </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
apr_xml_parser hook. It will parse until EOS appears. The parsed document isn't available until parsing has completed successfully. The hook's ctx pointer may be cast as (<a class="elRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__xml__doc.html">apr_xml_doc</a> **) to retrieve the parsed document. </td>
</tr>
</table>
<a class="anchor" name="a13" doxytag="apreq_parser.h::APREQ_DECLARE_PARSER"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">APREQ_DECLARE_PARSER </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">apreq_parse_generic </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Generic parser. No table entries will be added to the req->body table by this parser. The parser creates a dummy <a class="el" href="structapreq__param__t.html">apreq_param_t</a> to pass to any configured hooks. If no hooks are configured, the dummy param's bb slot will contain a copy of the request body. It can be retrieved by casting the parser's ctx pointer to (<a class="el" href="structapreq__param__t.html">apreq_param_t</a> **). </td>
</tr>
</table>
<a class="anchor" name="a12" doxytag="apreq_parser.h::APREQ_DECLARE_PARSER"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">APREQ_DECLARE_PARSER </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">apreq_parse_multipart </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
RFC 2388 multipart/form-data (and XForms 1.0 multipart/related) parser. It will reject any buckets representing preamble and postamble text (this is normal behavior, not an error condition). See <a class="el" href="apreq__parser_8h.html#a8">apreq_parser_run()</a> for more info on rejected data. </td>
</tr>
</table>
<a class="anchor" name="a11" doxytag="apreq_parser.h::APREQ_DECLARE_PARSER"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">APREQ_DECLARE_PARSER </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">apreq_parse_urlencoded </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
RFC 2396 application/x-www-form-urlencoded parser. </td>
</tr>
</table>
<a class="anchor" name="a10" doxytag="apreq_parser.h::APREQ_DECLARE_PARSER"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">APREQ_DECLARE_PARSER </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">apreq_parse_headers </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
RFC 822 Header parser. It will reject all data after the first CRLF CRLF sequence (an empty line). See <a class="el" href="apreq__parser_8h.html#a8">apreq_parser_run()</a> for more info on rejected data. </td>
</tr>
</table>
<a class="anchor" name="a16" doxytag="apreq_parser.h::apreq_hook_make"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="structapreq__hook__t.html">apreq_hook_t</a>* apreq_hook_make </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__pools.html#gga0">apr_pool_t</a> * </td>
<td class="mdname" nowrap> <em>pool</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="apreq__parser_8h.html#a7">apreq_hook_function_t</a> </td>
<td class="mdname" nowrap> <em>hook</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> * </td>
<td class="mdname" nowrap> <em>next</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>void * </td>
<td class="mdname" nowrap> <em>ctx</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Construct a hook.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>pool</em> </td><td>used to allocate the hook. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>hook</em> </td><td>The hook function. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>next</em> </td><td>List of other hooks for this hook to call on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>Hook's internal scratch pad. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>New hook. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a9" doxytag="apreq_parser.h::apreq_hook_run"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__platform.html#ga11">APR_INLINE</a> <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a> apreq_hook_run </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">struct <a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> * </td>
<td class="mdname" nowrap> <em>h</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="structapreq__param__t.html">apreq_param_t</a> * </td>
<td class="mdname" nowrap> <em>param</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="elRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> * </td>
<td class="mdname" nowrap> <em>bb</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Run the hook with the current parameter and the incoming bucket brigade. The hook may modify the brigade if necessary. Once all hooks have completed, the contents of the brigade will be added to the parameter's bb attribute. <dl compact><dt><b>Returns:</b></dt><dd>APR_SUCCESS on success. All other values represent errors. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a18" doxytag="apreq_parser.h::apreq_parser"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="apreq__parser_8h.html#a6">apreq_parser_function_t</a> apreq_parser </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const char * </td>
<td class="mdname1" valign="top" nowrap> <em>enctype</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Fetch the default parser function associated with the given MIME type. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>enctype</em> </td><td>The desired enctype (can also be a full "Content-Type" header). </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The parser function, or NULL if the enctype is unrecognized. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a17" doxytag="apreq_parser.h::apreq_parser_add_hook"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a> apreq_parser_add_hook </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structapreq__parser__t.html">apreq_parser_t</a> * </td>
<td class="mdname" nowrap> <em>p</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> * </td>
<td class="mdname" nowrap> <em>h</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Add a new hook to the end of the parser's hook list.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>Parser. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>h</em> </td><td>Hook to append. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="a15" doxytag="apreq_parser.h::apreq_parser_make"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="structapreq__parser__t.html">apreq_parser_t</a>* apreq_parser_make </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__pools.html#gga0">apr_pool_t</a> * </td>
<td class="mdname" nowrap> <em>pool</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="elRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/group___a_p_r___util___bucket___brigades.html#gga2">apr_bucket_alloc_t</a> * </td>
<td class="mdname" nowrap> <em>ba</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>content_type</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="apreq__parser_8h.html#a6">apreq_parser_function_t</a> </td>
<td class="mdname" nowrap> <em>pfn</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__platform.html#gga7">apr_size_t</a> </td>
<td class="mdname" nowrap> <em>brigade_limit</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>temp_dir</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="structapreq__hook__t.html">apreq_hook_t</a> * </td>
<td class="mdname" nowrap> <em>hook</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>void * </td>
<td class="mdname" nowrap> <em>ctx</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Construct a parser.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>pool</em> </td><td>Pool used to allocate the parser. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>ba</em> </td><td>bucket allocator used to create bucket brigades </td></tr>
<tr><td valign="top"></td><td valign="top"><em>content_type</em> </td><td>Content-type that this parser can deal with. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>pfn</em> </td><td>The parser function. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>brigade_limit</em> </td><td>the maximum in-memory bytes a brigade may use </td></tr>
<tr><td valign="top"></td><td valign="top"><em>temp_dir</em> </td><td>the directory used by the parser for temporary files </td></tr>
<tr><td valign="top"></td><td valign="top"><em>hook</em> </td><td>Hooks to asssociate this parser with. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>Parser's internal scratch pad. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>New parser. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a8" doxytag="apreq_parser.h::apreq_parser_run"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__platform.html#ga11">APR_INLINE</a> <a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a> apreq_parser_run </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">struct <a class="el" href="structapreq__parser__t.html">apreq_parser_t</a> * </td>
<td class="mdname" nowrap> <em>psr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__tables.html#gga0">apr_table_t</a> * </td>
<td class="mdname" nowrap> <em>t</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="elRef" doxygen="apu.tag:http://apr.apache.org/docs/apr-util/" href="http://apr.apache.org/docs/apr-util/structapr__bucket__brigade.html">apr_bucket_brigade</a> * </td>
<td class="mdname" nowrap> <em>bb</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Parse the incoming brigade into a table. Parsers normally consume all the buckets of the brigade during parsing. However parsers may leave "rejected" data in the brigade, even during a successful parse, so callers may need to clean up the brigade themselves (in particular, rejected buckets should not be passed back to the parser again). <dl compact><dt><b>Remarks:</b></dt><dd>bb == NULL is valid: the parser should return its public status: APR_INCOMPLETE, APR_SUCCESS, or an error code. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a19" doxytag="apreq_parser.h::apreq_register_parser"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="elRef" doxygen="apr.tag:http://apr.apache.org/docs/apr/" href="http://apr.apache.org/docs/apr/group__apr__errno.html#gga0">apr_status_t</a> apreq_register_parser </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const char * </td>
<td class="mdname" nowrap> <em>enctype</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="apreq__parser_8h.html#a6">apreq_parser_function_t</a> </td>
<td class="mdname" nowrap> <em>pfn</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Register a new parsing function with a MIME enctype. Registered parsers are added to <a class="el" href="apreq__parser_8h.html#a18">apreq_parser()</a>'s internal lookup table.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>enctype</em> </td><td>The MIME type. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>pfn</em> </td><td>The function to use during parsing. Setting parser == NULL will remove an existing parser.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>APR_SUCCESS or error. </dd></dl>
</td>
</tr>
</table>
<div id="footer">
<p class="apache">
Copyright © 2003-2005 <a href="http://www.apache.org">The Apache Software Foundation</a>.<br/>
See <a href="apreq_license.html">LICENSE</a>.</p>
<p class="menu">
<span style="color:#aaa">page generated by <a href="http://www.doxygen.org/"><code>doxygen</code></a>
version 1.4.2 on 4 May 2005</span>
</p>
</div>
</body>
</html>
|