# Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
# Copyright (C) 2007 Apple Inc. All rights reserved.
# Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+# Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
#include \"CSSValueKeywords.h\"
%}
-struct css_value {
+%struct-type
+struct Value {
const char* name;
int id;
};
+%language=ANSI-C
+%readonly-tables
+%compare-strncmp
+%define lookup-function-name findValue
+%define hash-function-name value_hash_function
+%define word-array-name value_word_list
+%includes
+%enum
%%
EOF
print HEADER << "EOF";
/* This file is automatically generated from CSSValueKeywords.in by makevalues, do not edit */
-#ifndef CSSValues_h
-#define CSSValues_h
+#ifndef CSSValueKeywords_h
+#define CSSValueKeywords_h
const int CSSValueInvalid = 0;
EOF
const char* getValueName(unsigned short id);
-#endif
+#endif // CSSValueKeywords_h
EOF
close HEADER;
-system("gperf -L ANSI-C -E -C -n -o -t --key-positions=\"*\" -NfindValue -Hhash_val -Wwordlist_value -D CSSValueKeywords.gperf > CSSValueKeywords.c") == 0 || die "calling gperf failed: $?";
+system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";
-open C, ">>CSSValueKeywords.c" || die "Could not open CSSValueKeywords.c for writing";
+open C, ">>CSSValueKeywords.cpp" || die "Could not open CSSValueKeywords.cpp for writing";
print C "static const char * const valueList[] = {\n";
print C "\"\",\n";
foreach my $name (@names) {