summaryrefslogtreecommitdiff
path: root/libs/cairo-1.16.0/boilerplate/make-cairo-boilerplate-constructors.sh
blob: 09716ca9e1c374e650317cc1bac684a2836d99a0 (plain)
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
#! /bin/sh

if test $# -eq 0; then
    echo "$0: no input files." >&2
    exit 0
fi

cat <<HERE
/* WARNING: Autogenerated file - see $0! */

#include "cairo-boilerplate-private.h"

void _cairo_boilerplate_register_all (void);

HERE

cat "$@" |  sed '/^CAIRO_BOILERPLATE/!d; s/CAIRO_BOILERPLATE.*(\(.*\),.*/extern void _register_\1 (void);/'

cat <<HERE

void
_cairo_boilerplate_register_all (void)
{
HERE

cat "$@" |  sed '/^CAIRO_BOILERPLATE/!d; s/CAIRO_BOILERPLATE.*(\(.*\),.*/    _register_\1 ();/'

echo "}"