1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /****************************************************************** 18 * THIS CODE WAS GENERATED BY matchgen.py, DO NOT MODIFY DIRECTLY * 19 ******************************************************************/ 20 21 #include <private/android_filesystem_config.h> 22 MatchExtension(const char * ext)23int MatchExtension(const char* ext) { 24 25 switch (ext[0]) { 26 case '3': 27 switch (ext[1]) { 28 case 'g': case 'G': 29 switch (ext[2]) { 30 case '2': 31 switch (ext[3]) { 32 case '\0': return AID_MEDIA_VIDEO; 33 } 34 break; 35 case 'p': case 'P': 36 switch (ext[3]) { 37 case '\0': return AID_MEDIA_VIDEO; 38 case 'p': case 'P': 39 switch (ext[4]) { 40 case '\0': return AID_MEDIA_VIDEO; 41 case '2': 42 switch (ext[5]) { 43 case '\0': return AID_MEDIA_VIDEO; 44 } 45 break; 46 } 47 break; 48 } 49 break; 50 } 51 break; 52 } 53 break; 54 case 'a': case 'A': 55 switch (ext[1]) { 56 case 'a': case 'A': 57 switch (ext[2]) { 58 case 'c': case 'C': 59 switch (ext[3]) { 60 case '\0': return AID_MEDIA_AUDIO; 61 } 62 break; 63 } 64 break; 65 case 'i': case 'I': 66 switch (ext[2]) { 67 case 'f': case 'F': 68 switch (ext[3]) { 69 case '\0': return AID_MEDIA_AUDIO; 70 case 'c': case 'C': 71 switch (ext[4]) { 72 case '\0': return AID_MEDIA_AUDIO; 73 } 74 break; 75 case 'f': case 'F': 76 switch (ext[4]) { 77 case '\0': return AID_MEDIA_AUDIO; 78 } 79 break; 80 } 81 break; 82 } 83 break; 84 case 'm': case 'M': 85 switch (ext[2]) { 86 case 'r': case 'R': 87 switch (ext[3]) { 88 case '\0': return AID_MEDIA_AUDIO; 89 } 90 break; 91 } 92 break; 93 case 'r': case 'R': 94 switch (ext[2]) { 95 case 't': case 'T': 96 switch (ext[3]) { 97 case '\0': return AID_MEDIA_IMAGE; 98 } 99 break; 100 case 'w': case 'W': 101 switch (ext[3]) { 102 case '\0': return AID_MEDIA_IMAGE; 103 } 104 break; 105 } 106 break; 107 case 's': case 'S': 108 switch (ext[2]) { 109 case 'f': case 'F': 110 switch (ext[3]) { 111 case '\0': return AID_MEDIA_VIDEO; 112 } 113 break; 114 case 'x': case 'X': 115 switch (ext[3]) { 116 case '\0': return AID_MEDIA_VIDEO; 117 } 118 break; 119 } 120 break; 121 case 'v': case 'V': 122 switch (ext[2]) { 123 case 'i': case 'I': 124 switch (ext[3]) { 125 case '\0': return AID_MEDIA_VIDEO; 126 } 127 break; 128 } 129 break; 130 case 'w': case 'W': 131 switch (ext[2]) { 132 case 'b': case 'B': 133 switch (ext[3]) { 134 case '\0': return AID_MEDIA_AUDIO; 135 } 136 break; 137 } 138 break; 139 } 140 break; 141 case 'b': case 'B': 142 switch (ext[1]) { 143 case 'm': case 'M': 144 switch (ext[2]) { 145 case 'p': case 'P': 146 switch (ext[3]) { 147 case '\0': return AID_MEDIA_IMAGE; 148 } 149 break; 150 } 151 break; 152 } 153 break; 154 case 'c': case 'C': 155 switch (ext[1]) { 156 case 'r': case 'R': 157 switch (ext[2]) { 158 case '2': 159 switch (ext[3]) { 160 case '\0': return AID_MEDIA_IMAGE; 161 } 162 break; 163 } 164 break; 165 } 166 break; 167 case 'd': case 'D': 168 switch (ext[1]) { 169 case 'i': case 'I': 170 switch (ext[2]) { 171 case 'f': case 'F': 172 switch (ext[3]) { 173 case '\0': return AID_MEDIA_VIDEO; 174 } 175 break; 176 } 177 break; 178 case 'l': case 'L': 179 switch (ext[2]) { 180 case '\0': return AID_MEDIA_VIDEO; 181 } 182 break; 183 case 'n': case 'N': 184 switch (ext[2]) { 185 case 'g': case 'G': 186 switch (ext[3]) { 187 case '\0': return AID_MEDIA_IMAGE; 188 } 189 break; 190 } 191 break; 192 case 'v': case 'V': 193 switch (ext[2]) { 194 case '\0': return AID_MEDIA_VIDEO; 195 } 196 break; 197 } 198 break; 199 case 'f': case 'F': 200 switch (ext[1]) { 201 case 'l': case 'L': 202 switch (ext[2]) { 203 case 'a': case 'A': 204 switch (ext[3]) { 205 case 'c': case 'C': 206 switch (ext[4]) { 207 case '\0': return AID_MEDIA_AUDIO; 208 } 209 break; 210 } 211 break; 212 case 'i': case 'I': 213 switch (ext[3]) { 214 case '\0': return AID_MEDIA_VIDEO; 215 } 216 break; 217 } 218 break; 219 } 220 break; 221 case 'g': case 'G': 222 switch (ext[1]) { 223 case 'i': case 'I': 224 switch (ext[2]) { 225 case 'f': case 'F': 226 switch (ext[3]) { 227 case '\0': return AID_MEDIA_IMAGE; 228 } 229 break; 230 } 231 break; 232 case 's': case 'S': 233 switch (ext[2]) { 234 case 'm': case 'M': 235 switch (ext[3]) { 236 case '\0': return AID_MEDIA_AUDIO; 237 } 238 break; 239 } 240 break; 241 } 242 break; 243 case 'j': case 'J': 244 switch (ext[1]) { 245 case 'n': case 'N': 246 switch (ext[2]) { 247 case 'g': case 'G': 248 switch (ext[3]) { 249 case '\0': return AID_MEDIA_IMAGE; 250 } 251 break; 252 } 253 break; 254 case 'p': case 'P': 255 switch (ext[2]) { 256 case 'e': case 'E': 257 switch (ext[3]) { 258 case '\0': return AID_MEDIA_IMAGE; 259 case 'g': case 'G': 260 switch (ext[4]) { 261 case '\0': return AID_MEDIA_IMAGE; 262 } 263 break; 264 } 265 break; 266 case 'g': case 'G': 267 switch (ext[3]) { 268 case '\0': return AID_MEDIA_IMAGE; 269 } 270 break; 271 } 272 break; 273 } 274 break; 275 case 'l': case 'L': 276 switch (ext[1]) { 277 case 's': case 'S': 278 switch (ext[2]) { 279 case 'f': case 'F': 280 switch (ext[3]) { 281 case '\0': return AID_MEDIA_VIDEO; 282 } 283 break; 284 case 'x': case 'X': 285 switch (ext[3]) { 286 case '\0': return AID_MEDIA_VIDEO; 287 } 288 break; 289 } 290 break; 291 } 292 break; 293 case 'm': case 'M': 294 switch (ext[1]) { 295 case '3': 296 switch (ext[2]) { 297 case 'u': case 'U': 298 switch (ext[3]) { 299 case '\0': return AID_MEDIA_AUDIO; 300 } 301 break; 302 } 303 break; 304 case '4': 305 switch (ext[2]) { 306 case 'a': case 'A': 307 switch (ext[3]) { 308 case '\0': return AID_MEDIA_AUDIO; 309 } 310 break; 311 case 'v': case 'V': 312 switch (ext[3]) { 313 case '\0': return AID_MEDIA_VIDEO; 314 } 315 break; 316 } 317 break; 318 case 'k': case 'K': 319 switch (ext[2]) { 320 case 'a': case 'A': 321 switch (ext[3]) { 322 case '\0': return AID_MEDIA_AUDIO; 323 } 324 break; 325 case 'v': case 'V': 326 switch (ext[3]) { 327 case '\0': return AID_MEDIA_VIDEO; 328 } 329 break; 330 } 331 break; 332 case 'n': case 'N': 333 switch (ext[2]) { 334 case 'g': case 'G': 335 switch (ext[3]) { 336 case '\0': return AID_MEDIA_VIDEO; 337 } 338 break; 339 } 340 break; 341 case 'o': case 'O': 342 switch (ext[2]) { 343 case 'v': case 'V': 344 switch (ext[3]) { 345 case '\0': return AID_MEDIA_VIDEO; 346 case 'i': case 'I': 347 switch (ext[4]) { 348 case 'e': case 'E': 349 switch (ext[5]) { 350 case '\0': return AID_MEDIA_VIDEO; 351 } 352 break; 353 } 354 break; 355 } 356 break; 357 } 358 break; 359 case 'p': case 'P': 360 switch (ext[2]) { 361 case '2': 362 switch (ext[3]) { 363 case '\0': return AID_MEDIA_AUDIO; 364 } 365 break; 366 case '3': 367 switch (ext[3]) { 368 case '\0': return AID_MEDIA_AUDIO; 369 } 370 break; 371 case '4': 372 switch (ext[3]) { 373 case '\0': return AID_MEDIA_VIDEO; 374 } 375 break; 376 case 'e': case 'E': 377 switch (ext[3]) { 378 case '\0': return AID_MEDIA_VIDEO; 379 case 'g': case 'G': 380 switch (ext[4]) { 381 case '\0': return AID_MEDIA_VIDEO; 382 case 'a': case 'A': 383 switch (ext[5]) { 384 case '\0': return AID_MEDIA_AUDIO; 385 } 386 break; 387 } 388 break; 389 } 390 break; 391 case 'g': case 'G': 392 switch (ext[3]) { 393 case '\0': return AID_MEDIA_VIDEO; 394 case 'a': case 'A': 395 switch (ext[4]) { 396 case '\0': return AID_MEDIA_AUDIO; 397 } 398 break; 399 } 400 break; 401 } 402 break; 403 case 'x': case 'X': 404 switch (ext[2]) { 405 case 'u': case 'U': 406 switch (ext[3]) { 407 case '\0': return AID_MEDIA_VIDEO; 408 } 409 break; 410 } 411 break; 412 } 413 break; 414 case 'n': case 'N': 415 switch (ext[1]) { 416 case 'e': case 'E': 417 switch (ext[2]) { 418 case 'f': case 'F': 419 switch (ext[3]) { 420 case '\0': return AID_MEDIA_IMAGE; 421 } 422 break; 423 } 424 break; 425 case 'r': case 'R': 426 switch (ext[2]) { 427 case 'w': case 'W': 428 switch (ext[3]) { 429 case '\0': return AID_MEDIA_IMAGE; 430 } 431 break; 432 } 433 break; 434 } 435 break; 436 case 'o': case 'O': 437 switch (ext[1]) { 438 case 'g': case 'G': 439 switch (ext[2]) { 440 case 'a': case 'A': 441 switch (ext[3]) { 442 case '\0': return AID_MEDIA_AUDIO; 443 } 444 break; 445 case 'g': case 'G': 446 switch (ext[3]) { 447 case '\0': return AID_MEDIA_AUDIO; 448 } 449 break; 450 } 451 break; 452 case 'r': case 'R': 453 switch (ext[2]) { 454 case 'f': case 'F': 455 switch (ext[3]) { 456 case '\0': return AID_MEDIA_IMAGE; 457 } 458 break; 459 } 460 break; 461 } 462 break; 463 case 'p': case 'P': 464 switch (ext[1]) { 465 case 'b': case 'B': 466 switch (ext[2]) { 467 case 'm': case 'M': 468 switch (ext[3]) { 469 case '\0': return AID_MEDIA_IMAGE; 470 } 471 break; 472 } 473 break; 474 case 'c': case 'C': 475 switch (ext[2]) { 476 case 'x': case 'X': 477 switch (ext[3]) { 478 case '\0': return AID_MEDIA_IMAGE; 479 } 480 break; 481 } 482 break; 483 case 'e': case 'E': 484 switch (ext[2]) { 485 case 'f': case 'F': 486 switch (ext[3]) { 487 case '\0': return AID_MEDIA_IMAGE; 488 } 489 break; 490 } 491 break; 492 case 'g': case 'G': 493 switch (ext[2]) { 494 case 'm': case 'M': 495 switch (ext[3]) { 496 case '\0': return AID_MEDIA_IMAGE; 497 } 498 break; 499 } 500 break; 501 case 'l': case 'L': 502 switch (ext[2]) { 503 case 's': case 'S': 504 switch (ext[3]) { 505 case '\0': return AID_MEDIA_AUDIO; 506 } 507 break; 508 } 509 break; 510 case 'n': case 'N': 511 switch (ext[2]) { 512 case 'g': case 'G': 513 switch (ext[3]) { 514 case '\0': return AID_MEDIA_IMAGE; 515 } 516 break; 517 case 'm': case 'M': 518 switch (ext[3]) { 519 case '\0': return AID_MEDIA_IMAGE; 520 } 521 break; 522 } 523 break; 524 case 'p': case 'P': 525 switch (ext[2]) { 526 case 'm': case 'M': 527 switch (ext[3]) { 528 case '\0': return AID_MEDIA_IMAGE; 529 } 530 break; 531 } 532 break; 533 case 's': case 'S': 534 switch (ext[2]) { 535 case 'd': case 'D': 536 switch (ext[3]) { 537 case '\0': return AID_MEDIA_IMAGE; 538 } 539 break; 540 } 541 break; 542 } 543 break; 544 case 'q': case 'Q': 545 switch (ext[1]) { 546 case 't': case 'T': 547 switch (ext[2]) { 548 case '\0': return AID_MEDIA_VIDEO; 549 } 550 break; 551 } 552 break; 553 case 'r': case 'R': 554 switch (ext[1]) { 555 case 'a': case 'A': 556 switch (ext[2]) { 557 case '\0': return AID_MEDIA_AUDIO; 558 case 'm': case 'M': 559 switch (ext[3]) { 560 case '\0': return AID_MEDIA_AUDIO; 561 } 562 break; 563 case 's': case 'S': 564 switch (ext[3]) { 565 case '\0': return AID_MEDIA_IMAGE; 566 } 567 break; 568 } 569 break; 570 case 'g': case 'G': 571 switch (ext[2]) { 572 case 'b': case 'B': 573 switch (ext[3]) { 574 case '\0': return AID_MEDIA_IMAGE; 575 } 576 break; 577 } 578 break; 579 case 'm': case 'M': 580 switch (ext[2]) { 581 case '\0': return AID_MEDIA_AUDIO; 582 } 583 break; 584 case 'w': case 'W': 585 switch (ext[2]) { 586 case '2': 587 switch (ext[3]) { 588 case '\0': return AID_MEDIA_IMAGE; 589 } 590 break; 591 } 592 break; 593 } 594 break; 595 case 's': case 'S': 596 switch (ext[1]) { 597 case 'd': case 'D': 598 switch (ext[2]) { 599 case '2': 600 switch (ext[3]) { 601 case '\0': return AID_MEDIA_AUDIO; 602 } 603 break; 604 } 605 break; 606 case 'n': case 'N': 607 switch (ext[2]) { 608 case 'd': case 'D': 609 switch (ext[3]) { 610 case '\0': return AID_MEDIA_AUDIO; 611 } 612 break; 613 } 614 break; 615 case 'r': case 'R': 616 switch (ext[2]) { 617 case 'w': case 'W': 618 switch (ext[3]) { 619 case '\0': return AID_MEDIA_IMAGE; 620 } 621 break; 622 } 623 break; 624 case 'v': case 'V': 625 switch (ext[2]) { 626 case 'g': case 'G': 627 switch (ext[3]) { 628 case '\0': return AID_MEDIA_IMAGE; 629 case 'z': case 'Z': 630 switch (ext[4]) { 631 case '\0': return AID_MEDIA_IMAGE; 632 } 633 break; 634 } 635 break; 636 } 637 break; 638 } 639 break; 640 case 't': case 'T': 641 switch (ext[1]) { 642 case 'i': case 'I': 643 switch (ext[2]) { 644 case 'f': case 'F': 645 switch (ext[3]) { 646 case '\0': return AID_MEDIA_IMAGE; 647 case 'f': case 'F': 648 switch (ext[4]) { 649 case '\0': return AID_MEDIA_IMAGE; 650 } 651 break; 652 } 653 break; 654 } 655 break; 656 case 's': case 'S': 657 switch (ext[2]) { 658 case '\0': return AID_MEDIA_VIDEO; 659 } 660 break; 661 } 662 break; 663 case 'v': case 'V': 664 switch (ext[1]) { 665 case 'o': case 'O': 666 switch (ext[2]) { 667 case 'b': case 'B': 668 switch (ext[3]) { 669 case '\0': return AID_MEDIA_VIDEO; 670 } 671 break; 672 } 673 break; 674 } 675 break; 676 case 'w': case 'W': 677 switch (ext[1]) { 678 case 'a': case 'A': 679 switch (ext[2]) { 680 case 'v': case 'V': 681 switch (ext[3]) { 682 case '\0': return AID_MEDIA_AUDIO; 683 } 684 break; 685 case 'x': case 'X': 686 switch (ext[3]) { 687 case '\0': return AID_MEDIA_AUDIO; 688 } 689 break; 690 } 691 break; 692 case 'b': case 'B': 693 switch (ext[2]) { 694 case 'm': case 'M': 695 switch (ext[3]) { 696 case 'p': case 'P': 697 switch (ext[4]) { 698 case '\0': return AID_MEDIA_IMAGE; 699 } 700 break; 701 } 702 break; 703 } 704 break; 705 case 'e': case 'E': 706 switch (ext[2]) { 707 case 'b': case 'B': 708 switch (ext[3]) { 709 case 'm': case 'M': 710 switch (ext[4]) { 711 case '\0': return AID_MEDIA_VIDEO; 712 } 713 break; 714 case 'p': case 'P': 715 switch (ext[4]) { 716 case '\0': return AID_MEDIA_IMAGE; 717 } 718 break; 719 } 720 break; 721 } 722 break; 723 case 'm': case 'M': 724 switch (ext[2]) { 725 case '\0': return AID_MEDIA_VIDEO; 726 case 'a': case 'A': 727 switch (ext[3]) { 728 case '\0': return AID_MEDIA_AUDIO; 729 } 730 break; 731 case 'v': case 'V': 732 switch (ext[3]) { 733 case '\0': return AID_MEDIA_VIDEO; 734 } 735 break; 736 case 'x': case 'X': 737 switch (ext[3]) { 738 case '\0': return AID_MEDIA_VIDEO; 739 } 740 break; 741 } 742 break; 743 case 'r': case 'R': 744 switch (ext[2]) { 745 case 'f': case 'F': 746 switch (ext[3]) { 747 case '\0': return AID_MEDIA_VIDEO; 748 } 749 break; 750 } 751 break; 752 case 'v': case 'V': 753 switch (ext[2]) { 754 case 'x': case 'X': 755 switch (ext[3]) { 756 case '\0': return AID_MEDIA_VIDEO; 757 } 758 break; 759 } 760 break; 761 } 762 break; 763 case 'x': case 'X': 764 switch (ext[1]) { 765 case 'b': case 'B': 766 switch (ext[2]) { 767 case 'm': case 'M': 768 switch (ext[3]) { 769 case '\0': return AID_MEDIA_IMAGE; 770 } 771 break; 772 } 773 break; 774 case 'p': case 'P': 775 switch (ext[2]) { 776 case 'm': case 'M': 777 switch (ext[3]) { 778 case '\0': return AID_MEDIA_IMAGE; 779 } 780 break; 781 } 782 break; 783 case 'w': case 'W': 784 switch (ext[2]) { 785 case 'd': case 'D': 786 switch (ext[3]) { 787 case '\0': return AID_MEDIA_IMAGE; 788 } 789 break; 790 } 791 break; 792 } 793 break; 794 } 795 796 return 0; 797 } 798