1{# 2Copyright (C) 2018 The Android Open Source Project 3 4Licensed under the Apache License, Version 2.0 (the "License"); 5you may not use this file except in compliance with the License. 6You 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{# 17 18 Jinja2 is used for templating throughout this file. {% and {{ indicate the 19 beginning of a Jinja2 templated section, and {# begins a comment. 20 21 See http://jinja.pocoo.org/ for more information 22#} 23{{ '/* GENERATED SOURCE. DO NOT MODIFY. */' }} 24{{ '/* Run external/icu/tools/icu4c_srcgen/generate_libandroidicu.py to regenerate */' }} 25{{ '// © 2018 and later: Unicode, Inc. and others.' }} 26{{ '// License & terms of use: http://www.unicode.org/copyright.html' }} 27 28{% for header in icu_headers|sort %} 29#include <{{ header }}> 30{% endfor %} 31 32extern "C" { 33{# Generates a wrapper function for each exposed ICU function. #} 34{% for func in functions %} 35{{ func.result_type }} {{ func.name }}{{ suffix }}({{ func.param_str }}) { 36 {% if func.is_variadic and func.return_void %} 37 va_list args; 38 va_start(args, {{ func.last_param }}); 39 {{ func.callee }}({{ func.arg_str }}); 40 va_end(args); 41 return; 42 {% elif func.is_variadic %} 43 va_list args; 44 va_start(args, {{ func.last_param }}); 45 {{ func.result_type }} ret = {{ func.callee }}({{ func.arg_str }}); 46 va_end(args); 47 return ret; 48 {% elif func.return_void %} 49 {{ func.callee }}({{ func.arg_str }}); 50 {% else %} 51 return {{ func.callee }}({{ func.arg_str }}); 52 {% endif %} 53} 54{% endfor %} 55} 56