• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/apache-793/httpd/modules/core/

Lines Matching defs:macro

57   this is a macro: name, arguments, contents, location.
61 char *name; /* lower case name of the macro */
62 apr_array_header_t *arguments; /* of char*, macro parameter names */
63 apr_array_header_t *contents; /* of char*, macro body */
64 char *location; /* of macro definition, for error messages */
87 hash type: (char *) name -> (ap_macro_t *) macro
238 generates an error on macro with two arguments of the same name.
239 generates an error if a macro argument name is empty.
244 const ap_macro_t * macro)
246 char **tab = (char **) macro->arguments->elts;
247 int nelts = macro->arguments->nelts;
256 "macro '%s' (%s): empty argument #%d name",
257 macro->name, macro->location, i + 1);
261 "macro '%s' (%s) "
264 macro->name, macro->location,
274 "argument name conflict in macro '%s' (%s): "
277 macro->name, macro->location,
286 "macro '%s' (%s): "
288 " be careful about your macro definition!",
289 macro->name, macro->location,
416 substitute macro arguments by replacements in buf of bufsize.
418 if used is defined, returns the used macro arguments.
423 const ap_macro_t * macro,
428 **atab = (char **) macro->arguments->elts,
437 while ((ptr = next_substitution(ptr, macro->arguments, &whichone))) {
455 perform substitutions in a macro contents and
461 const ap_macro_t * macro,
466 apr_array_header_t *contents = macro->contents;
474 /* for each line of the macro body */
477 /* copy the line and subtitute macro parameters */
480 macro, replacements, used);
483 "while processing line %d of macro '%s' (%s) %s",
484 i + 1, macro->name, macro->location, errmsg);
497 warn if some macro arguments are not used.
500 const ap_macro_t * macro)
502 int nelts = macro->arguments->nelts;
503 char **names = (char **) macro->arguments->elts;
508 if (macro->contents->nelts == 0) {
510 "macro '%s' (%s): empty contents!",
511 macro->name, macro->location);
521 errmsg = process_content(pool, macro, macro->arguments, used, NULL);
530 "macro '%s' (%s): argument '%s' (#%d) never used",
531 macro->name, macro->location, names[i], i + 1);
542 The expanded content of the macro is to be parsed as a ap_configfile_t.
549 being processed and is interrupted by the macro expansion. At the end
550 of processing the macro, the initial data structure will be put back
554 arrays used to insert the expanded macro contents before resuming the real
701 ap_macro_t *macro;
719 return BEGIN_MACRO " macro definition: empty name";
728 /* get lowercase macro name */
731 return BEGIN_MACRO " macro definition: name not found";
735 macro = apr_hash_get(ap_macros, name, APR_HASH_KEY_STRING);
737 if (macro != NULL) {
740 "macro '%s' multiply defined: "
742 macro->name, macro->location,
746 /* allocate a new macro */
747 macro = (ap_macro_t *) apr_palloc(pool, sizeof(ap_macro_t));
748 macro->name = name;
753 /* get macro arguments */
754 macro->location = apr_psprintf(pool,
758 debug(fprintf(stderr, "macro_section: location=%s\n", macro->location));
761 apr_psprintf(pool, "macro '%s' (%s)", macro->name, macro->location);
765 "%s better prefix a macro name with any of '%s'",
769 /* get macro parameters */
770 macro->arguments = get_arguments(pool, arg);
772 errmsg = check_macro_arguments(cmd->temp_pool, macro);
780 where, &macro->contents);
788 errmsg = check_macro_contents(cmd->temp_pool, macro);
796 /* store the new macro */
797 apr_hash_set(ap_macros, name, APR_HASH_KEY_STRING, macro);
809 ap_macro_t *macro;
817 return "no macro defined before " USE_MACRO;
820 /* get lowercase macro name */
825 return "no macro name specified with " USE_MACRO;
828 /* get macro definition */
829 macro = apr_hash_get(ap_macros, name, APR_HASH_KEY_STRING);
831 if (!macro) {
832 return apr_psprintf(cmd->temp_pool, "macro '%s' undefined", name);
836 * which may already contains "macro 'foo'". Ok, it looks like a hack,
841 apr_pstrcat(cmd->temp_pool, "macro '", macro->name, "'", NULL);
845 "recursive use of macro '%s' is invalid",
846 macro->name);
849 /* get macro arguments */
852 if (macro->arguments->nelts != replacements->nelts) {
854 "macro '%s' (%s) used "
856 macro->name, macro->location,
857 replacements->nelts, macro->arguments->nelts);
861 "macro '%s' (%s) used on line %d of \"%s\"",
862 macro->name, macro->location,
868 errmsg = process_content(cmd->temp_pool, macro, replacements,
889 ap_macro_t *macro;
893 return "no macro defined before " UNDEF_MACRO;
897 return "no macro name specified with " UNDEF_MACRO;
900 /* check that the macro is defined */
903 macro = apr_hash_get(ap_macros, name, APR_HASH_KEY_STRING);
904 if (macro == NULL) {
907 "cannot remove undefined macro '%s'", name);
910 /* free macro: cannot do that */
911 /* remove macro from hash table */
920 macro module commands.
921 configuration file macro stuff
926 "Beginning of a macro definition section."),
928 "Use of a macro."),
930 "Remove a macro definition."),
945 AP_DECLARE_MODULE(macro) = {