1%{ 2/* 3 * Copyright (C) 2007 Esmertec AG. 4 * Copyright (C) 2007 The Android Open Source Project 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19#include <string.h> 20#include "csp13_hash.h" 21 22%} 23 24struct TokenEntry { 25 const char * name; 26 int key; 27}; 28 29%% 30AccessType, 0x00 31ActiveUsers, 0x01 32Admin, 0x02 33application/, 0x03 34application/vnd.wap.mms-message, 0x04 35application/x-sms, 0x05 36AutoJoin, 0x06 37BASE64, 0x07 38Closed, 0x08 39Default, 0x09 40DisplayName, 0x0A 41F, 0x0B 42G, 0x0C 43GR, 0x0D 44http://, 0x0E 45https://, 0x0F 46image/, 0x10 47Inband, 0x11 48IM, 0x12 49MaxActiveUsers, 0x13 50Mod, 0x14 51Name, 0x15 52None, 0x16 53N, 0x17 54Open, 0x18 55Outband, 0x19 56PR, 0x1A 57Private, 0x1B 58PrivateMessaging, 0x1C 59PrivilegeLevel, 0x1D 60Public, 0x1E 61P, 0x1F 62Request, 0x20 63Response, 0x21 64Restricted, 0x22 65ScreenName, 0x23 66Searchable, 0x24 67S, 0x25 68SC, 0x26 69text/, 0x27 70text/plain, 0x28 71text/x-vCalendar, 0x29 72text/x-vCard, 0x2A 73Topic, 0x2B 74T, 0x2C 75Type, 0x2D 76U, 0x2E 77US, 0x2F 78www.wireless-village.org, 0x30 79AutoDelete, 0x31 80GM, 0x32 81Validity, 0x33 82DENIED, 0x34 83GRANTED, 0x35 84PENDING, 0x36 85ShowID, 0x37 86RequireInvitation, 0x38 87Tiny, 0x39 88PPU, 0x3A 89SPA, 0x3B 90ANC, 0x3C 91GROUP_ID, 0x3D 92History, 0x3D 93GROUP_NAME, 0x3E 94GROUP_TOPIC, 0x3F 95GROUP_USER_ID_JOINED, 0x40 96GROUP_USER_ID_OWNER, 0x41 97HTTP, 0x42 98SMS, 0x43 99STCP, 0x44 100SUDP, 0x45 101USER_ALIAS, 0x46 102USER_EMAIL_ADDRESS, 0x47 103USER_FIRST_NAME, 0x48 104USER_ID, 0x49 105USER_LAST_NAME, 0x4A 106USER_MOBILE_NUMBER, 0x4B 107USER_ONLINE_STATUS, 0x4C 108WAPSMS, 0x4D 109WAPUDP, 0x4E 110WSP, 0x4F 111GROUP_USER_ID_AUTOJOIN, 0x50 112AND, 0x51 113AC, 0x52 114BLC, 0x53 115BLUC, 0x54 116CLCR, 0x55 117CLD, 0x56 118GC, 0x57 119GD, 0x58 120GLC, 0x59 121ANU, 0x5A 122ANGRY, 0x5B 123ANXIOUS, 0x5C 124ASHAMED, 0x5D 125AVAILABLE, 0x5F 126BORED, 0x60 127CALL, 0x61 128CLI, 0x62 129COMPUTER, 0x63 130DISCREET, 0x64 131EMAIL, 0x65 132EXCITED, 0x66 133HAPPY, 0x67 134AP, 0x68 135IN_LOVE, 0x6B 136INVINCIBLE, 0x6C 137JEALOUS, 0x6D 138MMS, 0x6E 139MOBILE_PHONE, 0x6F 140NOT_AVAILABLE, 0x70 141OTHER, 0x71 142PDA, 0x72 143SAD, 0x73 144SLEEPY, 0x74 145www.openmobilealliance.org, 0x78 146Small, 0x79 147Medium, 0x7A 148Big, 0x7B 149Huge, 0x7C 150Bold, 0x7D 151Italic, 0x7E 152Underline, 0x7F 153Black, 0x80 154Silver, 0x81 155Gray, 0x82 156White, 0x83 157Maroon, 0x84 158Red, 0x85 159Purple, 0x86 160Fuchsia, 0x87 161Green, 0x88 162Lime, 0x89 163Olive, 0x8A 164Yellow, 0x8B 165Navy, 0x8C 166Blue, 0x8D 167Teal, 0x8E 168Aqua, 0x8F 169ATCL, 0x90 170CLC, 0x91 171USER_CITY, 0x93 172USER_COUNTRY, 0x94 173USER_FRIENDLY_NAME, 0x95 174USER_GENDER, 0x96 175USER_INTENTION, 0x97 176USER_INTERESTS_HOBBIES, 0x98 177USER_MARITAL_STATUS, 0x99 178PRIORITYREJECT, 0x9A 179PRIORITYSTORE, 0x9B 180REJECT, 0x9C 181SENDREJECT, 0x9D 182SENDSTORE, 0x9E 183IR, 0x9F 184EC, 0xA0 185GLUC, 0xA1 186IA, 0xA2 187IC, 0xA3 188SSMS, 0xA4 189SHTTP, 0xA5 190DoNotNotify, 0xA6 191GMAU, 0xA7 192GMG, 0xA8 193GMR, 0xA9 194GMU, 0xAA 195DETECT, 0xAB 196FORKALL, 0xAC 197OEU, 0xAD 198SERVERLOGIC, 0xAE 199PP_AGE, 0xAF 200PP_CITY, 0xB0 201PP_COUNTRY, 0xB1 202PP_FRIENDLY_NAME, 0xB2 203PP_FREE_TEXT, 0xB3 204PP_GENDER, 0xB4 205PP_INTENTION, 0xB5 206PP_INTERESTS, 0xB6 207PP_MARITAL_STATUS, 0xB7 208USER_AGE_MAX, 0xB8 209USER_AGE_MIN, 0xB9 210EG, 0xBA 211MinimumAge, 0xBB 212C, 0xBC 213CURRENT_SUBSCRIBER, 0xBD 214FORMER_SUBSCRIBER, 0xBE 215PRESENCE_ACCESS, 0xBF 216R, 0xC0 217%% 218 219int csp13ValueTokenToKey(const char * str, int len) 220{ 221 const struct TokenEntry * tag = findToken(str, len); 222 return tag ? tag->key : -1; 223} 224 225