#!/bin/sh

set -e

echo '/* This file was generated by gen-plublic-types.sh, do not edit it. */
'

for var in "$@"
do
  echo "#include \"$var\""
done

echo '#include "hdy-main-private.h"

void
hdy_init_public_types (void)
{'

sed -ne 's/^#define \{1,\}\(HDY_TYPE_[A-Z0-9_]\{1,\}\) \{1,\}.*/  g_type_ensure (\1);/p' "$@" | sort

echo '}
'
