summaryrefslogtreecommitdiff
path: root/boilerplate/make-cairo-boilerplate-constructors.sh
blob: dd63111785bf3be76a49f4b7b4181a59443370cc (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 $# == 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 "}"