File: regenerate-enum-header.sh

package info (click to toggle)
gconf 3.2.6-6
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 15,120 kB
  • sloc: ansic: 39,709; sh: 11,189; python: 1,107; makefile: 445; xml: 332
file content (25 lines) | stat: -rwxr-xr-x 878 bytes parent folder | download | duplicates (8)
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
#! /bin/sh

cd $GCONF_SRCDIR || exit 1

glib-mkenums \
	--fhead "#ifndef __GCONF_ENUM_TYPES_H__\n#define __GCONF_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n\n" \
	--fprod "/* enumerations from \"@filename@\" */\n\n" \
	--vhead "GType @enum_name@_get_type (void);\n#define GCONF_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n\n" \
	--ftail "G_END_DECLS\n\n#endif /* __GCONF_ENUM_TYPES_H__ */" \
	$* > tmp-unfixed-gconf-enum-types.h || exit 1

cat tmp-unfixed-gconf-enum-types.h | sed -e 's/g_conf/gconf/g' -e 's/TYPE_CONF/TYPE/g' > tmp-gconf-enum-types.h || exit 1

rm -f tmp-unfixed-gconf-enum-types.h || exit 1

if cmp -s tmp-gconf-enum-types.h gconf-enum-types.h; then
  echo "gconf-enum-types.h is unchanged"
else
  echo "Replacing gconf-enum-types.h"
  cp tmp-gconf-enum-types.h gconf-enum-types.h || exit 1
fi

rm -f tmp-gconf-enum-types.h || exit 1

exit 0