diff options
| author | Kristian Monsen <kristianm@google.com> | 2010-09-30 15:42:16 +0100 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2010-10-07 10:59:29 +0100 |
| commit | bec39347bb3bb5bf1187ccaf471d26247f28b585 (patch) | |
| tree | 56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /WebCore/css/makeprop.pl | |
| parent | 90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff) | |
| download | external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2 | |
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
Diffstat (limited to 'WebCore/css/makeprop.pl')
| -rw-r--r-- | WebCore/css/makeprop.pl | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/WebCore/css/makeprop.pl b/WebCore/css/makeprop.pl index 8810e8d..64f5a6b 100644 --- a/WebCore/css/makeprop.pl +++ b/WebCore/css/makeprop.pl @@ -41,15 +41,14 @@ print GPERF << "EOF"; #include \"CSSPropertyNames.h\" %} %struct-type -struct Property { - const char* name; - int id; -}; -%language=ANSI-C +struct Property; +%omit-struct-type +%language=C++ %readonly-tables %global-table %compare-strncmp -%define lookup-function-name findProperty +%define class-name CSSPropertyNamesHash +%define lookup-function-name findPropertyImpl %define hash-function-name propery_hash_function %define word-array-name property_wordlist %includes @@ -72,6 +71,10 @@ print HEADER << "EOF"; #ifndef CSSPropertyNames_h #define CSSPropertyNames_h +#include <string.h> + +namespace WebCore { + enum CSSPropertyID { CSSPropertyInvalid = 0, EOF @@ -105,17 +108,41 @@ print HEADER << "EOF"; const char* getPropertyName(CSSPropertyID); +} // namespace WebCore + #endif // CSSPropertyNames_h EOF close HEADER; -system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?"; +system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.h") == 0 || die "calling gperf failed: $?"; -open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing"; +open C, ">>CSSPropertyNamesHash.h" || die "Could not open CSSPropertyNamesHash.h for writing"; print C << "EOF"; +EOF + +close C; + +my $propertyNamesImpl = "CSSPropertyNames.cpp"; + +open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing"; +print PROPERTYNAMES << "EOF"; +/* This file is automatically generated by make-hash-tools.pl, do not edit */ + + +#include "CSSPropertyNames.h" +#include "HashTools.h" + +namespace WebCore { +#include "CSSPropertyNamesHash.h" + +const Property* findProperty (register const char* str, register unsigned int len) +{ + return CSSPropertyNamesHash::findPropertyImpl(str, len); +} + const char* getPropertyName(CSSPropertyID id) { if (id < firstCSSProperty) @@ -125,7 +152,10 @@ const char* getPropertyName(CSSPropertyID id) return 0; return propertyNameStrings[index]; } + +} // namespace WebCore + EOF -close C; +close PROPERTYNAMES; |
