util_cfgtree.inc 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. { Copyright 2000-2005 The Apache Software Foundation or its licensors, as
  2. * applicable.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. }
  16. //#include "ap_config.h"
  17. {
  18. * @package Config Tree Package
  19. }
  20. type
  21. Pap_directive_t = ^ap_directive_t;
  22. PPap_directive_t = ^Pap_directive_t;
  23. {
  24. * Structure used to build the config tree. The config tree only stores
  25. * the directives that will be active in the running server. Directives
  26. * that contain other directions, such as <Directory ...> cause a sub-level
  27. * to be created, where the included directives are stored. The closing
  28. * directive (</Directory>) is not stored in the tree.
  29. }
  30. ap_directive_t = record
  31. { The current directive }
  32. directive: PChar;
  33. { The arguments for the current directive, stored as a space
  34. * separated list }
  35. args: PChar;
  36. { The next directive node in the tree
  37. * @defvar ap_directive_t *next }
  38. next: Pap_directive_t;
  39. { The first child node of this directive
  40. * @defvar ap_directive_t *first_child }
  41. first_child: Pap_directive_t;
  42. { The parent node of this directive
  43. * @defvar ap_directive_t *parent }
  44. parent: Pap_directive_t;
  45. { directive's module can store add'l data here }
  46. data: Pointer;
  47. { ### these may go away in the future, but are needed for now }
  48. { The name of the file this directive was found in }
  49. filename: PChar;
  50. { The line number the directive was on }
  51. line_num: Integer;
  52. end;
  53. {
  54. * The root of the configuration tree
  55. * @defvar ap_directive_t *conftree
  56. }
  57. //AP_DECLARE_DATA extern ap_directive_t *ap_conftree;
  58. {
  59. * Add a node to the configuration tree.
  60. * @param parent The current parent node. If the added node is a first_child,
  61. then this is changed to the current node
  62. * @param current The current node
  63. * @param toadd The node to add to the tree
  64. * @param child Is the node to add a child node
  65. * @return the added node
  66. }
  67. //ap_directive_t *ap_add_node(ap_directive_t **parent, ap_directive_t *current,
  68. // ap_directive_t *toadd, int child);