OSDN Git Service

am 3c54ece0: am 5dc34a85: activeDocumentLoader() causes crash in WebCoreFrameBridge.cpp
[android-x86/external-webkit.git] / WebCore / css / makevalues.pl
index e49981d..421e470 100644 (file)
@@ -5,6 +5,7 @@
 #   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
@@ -40,10 +41,19 @@ print GPERF << "EOF";
 
 #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
 
@@ -59,8 +69,8 @@ open HEADER, ">CSSValueKeywords.h" || die "Could not open CSSValueKeywords.h for
 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
@@ -82,13 +92,13 @@ print HEADER << "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) {