JezK
Edit File: page-SetHeaders_cpp_cxxcodebuilder.ri
U:RDoc::TopLevel[ i I"5src/apache2_module/SetHeaders.cpp.cxxcodebuilder:ETcRDoc::Parser::Simpleo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph;[I"># Phusion Passenger - https://www.phusionpassenger.com/ ;TI"5# Copyright (c) 2010-2016 Phusion Holding B.V. ;TI"# ;TI"L# "Passenger", "Phusion Passenger" and "Union Station" are registered ;TI"+# trademarks of Phusion Holding B.V. ;TI"# ;TI"U# Permission is hereby granted, free of charge, to any person obtaining a copy ;TI"V# of this software and associated documentation files (the "Software"), to deal ;TI"U# in the Software without restriction, including without limitation the rights ;TI"R# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ;TI"N# copies of the Software, and to permit persons to whom the Software is ;TI"A# furnished to do so, subject to the following conditions: ;TI"# ;TI"S# The above copyright notice and this permission notice shall be included in ;TI"<# all copies or substantial portions of the Software. ;TI"# ;TI"S# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ;TI"Q# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ;TI"T# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ;TI"O# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ;TI"V# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ;TI"R# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ;TI"# THE SOFTWARE.;To:RDoc::Markup::BlankLine o; ;[I"=# This file uses the cxxcodebuilder API. Learn more at: ;TI"0# https://github.com/phusion/cxxcodebuilder;T@$o; ;[I"7require 'phusion_passenger/apache2/config_options';T@$o; ;[I" def main;To:RDoc::Markup::Verbatim;[)I"/comment copyright_header_for(__FILE__), 1 ;TI" ;TI"separator ;TI" ;TI"comment %q{ ;TI"U SetHeaders.cpp is automatically generated from SetHeaders.cpp.cxxcodebuilder, ;TI"_ using definitions from src/ruby_supportlib/phusion_passenger/apache2/config_options.rb. ;TI"- Edits to SetHeaders.cpp will be lost. ;TI" ;TI"! To update SetHeaders.cpp: ;TI" rake apache2 ;TI" ;TI"0 To force regeneration of SetHeaders.cpp: ;TI"1 rm -f src/apache2_module/SetHeaders.cpp ;TI"0 rake src/apache2_module/SetHeaders.cpp ;TI"} ;TI" ;TI"separator ;TI" ;TI"Wfilter_eligible_options(APACHE2_DIRECTORY_CONFIGURATION_OPTIONS).each do |option| ;TI"= if option[:type] == :string || option[:type] == :flag ;TI" add_code %Q{ ;TI"F addHeader(result, StaticString(#{header_name_for(option)}, ;TI"8 sizeof(#{header_name_for(option)}) - 1), ;TI"0 #{header_expression_for(option)}); ;TI" } ;TI"' elsif option[:type] == :integer ;TI" add_code %Q{ ;TI"I addHeader(r, result, StaticString(#{header_name_for(option)}, ;TI"8 sizeof(#{header_name_for(option)}) - 1), ;TI"0 #{header_expression_for(option)}); ;TI" } ;TI" else ;TI"Z raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}" ;TI" end ;TI" end ;T:@format0o; ;[I"end;T@$o; ;[I")def filter_eligible_options(options);To;;[I"'return options.reject do |option| ;TI" option[:alias_for] || ;TI", option.fetch(:field, true).nil? || ;TI"( option[:field].to_s =~ /\./ || ;TI"8 (option.has_key?(:header) && !option[:header]) ;TI" end ;T;0o; ;[I"end;T@$o; ;[I"!def struct_field_for(option);To;;[I" if option.has_key?(:field) ;TI" option[:field] ;TI" else ;TI"4 result = option[:name].sub(/^Passenger/, '') ;TI") result[0] = result[0..0].downcase ;TI" result ;TI" end ;T;0o; ;[I"end;T@$o; ;[I" def header_name_for(option);To;;[I"if option[:header] ;TI"& "!~#{option[:header]}".inspect ;TI" else ;TI"4 result = option[:name].sub(/^Passenger/, '') ;TI"& result.gsub!(/([A-Z])/, '_\1') ;TI"- "!~PASSENGER#{result.upcase}".inspect ;TI" end ;T;0o; ;[I"end;T@$o; ;[I"&def header_expression_for(option);To;;[ I"#if option[:header_expression] ;TI"" option[:header_expression] ;TI" else ;TI"- "config->" + struct_field_for(option) ;TI" end ;T;0o; ;[I"end;T@$o; ;[I" main;T: @file@:0@omit_headings_from_table_of_contents_below0