Home | History | Annotate | Download | only in installd
      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 
     23 int 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             case 'p': case 'P':
     35                 switch (ext[3]) {
     36                 case '\0': return AID_MEDIA_VIDEO;
     37                 case 'p': case 'P':
     38                     switch (ext[4]) {
     39                     case '\0': return AID_MEDIA_VIDEO;
     40                     case '2':
     41                         switch (ext[5]) {
     42                         case '\0': return AID_MEDIA_VIDEO;
     43                         }
     44                     }
     45                 }
     46             }
     47         }
     48     case 'a': case 'A':
     49         switch (ext[1]) {
     50         case 'a': case 'A':
     51             switch (ext[2]) {
     52             case 'c': case 'C':
     53                 switch (ext[3]) {
     54                 case '\0': return AID_MEDIA_AUDIO;
     55                 }
     56             }
     57         case 'i': case 'I':
     58             switch (ext[2]) {
     59             case 'f': case 'F':
     60                 switch (ext[3]) {
     61                 case '\0': return AID_MEDIA_AUDIO;
     62                 case 'c': case 'C':
     63                     switch (ext[4]) {
     64                     case '\0': return AID_MEDIA_AUDIO;
     65                     }
     66                 case 'f': case 'F':
     67                     switch (ext[4]) {
     68                     case '\0': return AID_MEDIA_AUDIO;
     69                     }
     70                 }
     71             }
     72         case 'm': case 'M':
     73             switch (ext[2]) {
     74             case 'r': case 'R':
     75                 switch (ext[3]) {
     76                 case '\0': return AID_MEDIA_AUDIO;
     77                 }
     78             }
     79         case 'r': case 'R':
     80             switch (ext[2]) {
     81             case 't': case 'T':
     82                 switch (ext[3]) {
     83                 case '\0': return AID_MEDIA_IMAGE;
     84                 }
     85             case 'w': case 'W':
     86                 switch (ext[3]) {
     87                 case '\0': return AID_MEDIA_IMAGE;
     88                 }
     89             }
     90         case 's': case 'S':
     91             switch (ext[2]) {
     92             case 'f': case 'F':
     93                 switch (ext[3]) {
     94                 case '\0': return AID_MEDIA_VIDEO;
     95                 }
     96             case 'x': case 'X':
     97                 switch (ext[3]) {
     98                 case '\0': return AID_MEDIA_VIDEO;
     99                 }
    100             }
    101         case 'v': case 'V':
    102             switch (ext[2]) {
    103             case 'i': case 'I':
    104                 switch (ext[3]) {
    105                 case '\0': return AID_MEDIA_VIDEO;
    106                 }
    107             }
    108         case 'w': case 'W':
    109             switch (ext[2]) {
    110             case 'b': case 'B':
    111                 switch (ext[3]) {
    112                 case '\0': return AID_MEDIA_AUDIO;
    113                 }
    114             }
    115         }
    116     case 'b': case 'B':
    117         switch (ext[1]) {
    118         case 'm': case 'M':
    119             switch (ext[2]) {
    120             case 'p': case 'P':
    121                 switch (ext[3]) {
    122                 case '\0': return AID_MEDIA_IMAGE;
    123                 }
    124             }
    125         }
    126     case 'c': case 'C':
    127         switch (ext[1]) {
    128         case 'r': case 'R':
    129             switch (ext[2]) {
    130             case '2':
    131                 switch (ext[3]) {
    132                 case '\0': return AID_MEDIA_IMAGE;
    133                 }
    134             }
    135         }
    136     case 'd': case 'D':
    137         switch (ext[1]) {
    138         case 'i': case 'I':
    139             switch (ext[2]) {
    140             case 'f': case 'F':
    141                 switch (ext[3]) {
    142                 case '\0': return AID_MEDIA_VIDEO;
    143                 }
    144             }
    145         case 'l': case 'L':
    146             switch (ext[2]) {
    147             case '\0': return AID_MEDIA_VIDEO;
    148             }
    149         case 'n': case 'N':
    150             switch (ext[2]) {
    151             case 'g': case 'G':
    152                 switch (ext[3]) {
    153                 case '\0': return AID_MEDIA_IMAGE;
    154                 }
    155             }
    156         case 'v': case 'V':
    157             switch (ext[2]) {
    158             case '\0': return AID_MEDIA_VIDEO;
    159             }
    160         }
    161     case 'f': case 'F':
    162         switch (ext[1]) {
    163         case 'l': case 'L':
    164             switch (ext[2]) {
    165             case 'a': case 'A':
    166                 switch (ext[3]) {
    167                 case 'c': case 'C':
    168                     switch (ext[4]) {
    169                     case '\0': return AID_MEDIA_AUDIO;
    170                     }
    171                 }
    172             case 'i': case 'I':
    173                 switch (ext[3]) {
    174                 case '\0': return AID_MEDIA_VIDEO;
    175                 }
    176             }
    177         }
    178     case 'g': case 'G':
    179         switch (ext[1]) {
    180         case 'i': case 'I':
    181             switch (ext[2]) {
    182             case 'f': case 'F':
    183                 switch (ext[3]) {
    184                 case '\0': return AID_MEDIA_IMAGE;
    185                 }
    186             }
    187         case 's': case 'S':
    188             switch (ext[2]) {
    189             case 'm': case 'M':
    190                 switch (ext[3]) {
    191                 case '\0': return AID_MEDIA_AUDIO;
    192                 }
    193             }
    194         }
    195     case 'j': case 'J':
    196         switch (ext[1]) {
    197         case 'n': case 'N':
    198             switch (ext[2]) {
    199             case 'g': case 'G':
    200                 switch (ext[3]) {
    201                 case '\0': return AID_MEDIA_IMAGE;
    202                 }
    203             }
    204         case 'p': case 'P':
    205             switch (ext[2]) {
    206             case 'e': case 'E':
    207                 switch (ext[3]) {
    208                 case '\0': return AID_MEDIA_IMAGE;
    209                 case 'g': case 'G':
    210                     switch (ext[4]) {
    211                     case '\0': return AID_MEDIA_IMAGE;
    212                     }
    213                 }
    214             case 'g': case 'G':
    215                 switch (ext[3]) {
    216                 case '\0': return AID_MEDIA_IMAGE;
    217                 }
    218             }
    219         }
    220     case 'l': case 'L':
    221         switch (ext[1]) {
    222         case 's': case 'S':
    223             switch (ext[2]) {
    224             case 'f': case 'F':
    225                 switch (ext[3]) {
    226                 case '\0': return AID_MEDIA_VIDEO;
    227                 }
    228             case 'x': case 'X':
    229                 switch (ext[3]) {
    230                 case '\0': return AID_MEDIA_VIDEO;
    231                 }
    232             }
    233         }
    234     case 'm': case 'M':
    235         switch (ext[1]) {
    236         case '3':
    237             switch (ext[2]) {
    238             case 'u': case 'U':
    239                 switch (ext[3]) {
    240                 case '\0': return AID_MEDIA_AUDIO;
    241                 }
    242             }
    243         case '4':
    244             switch (ext[2]) {
    245             case 'a': case 'A':
    246                 switch (ext[3]) {
    247                 case '\0': return AID_MEDIA_AUDIO;
    248                 }
    249             case 'v': case 'V':
    250                 switch (ext[3]) {
    251                 case '\0': return AID_MEDIA_VIDEO;
    252                 }
    253             }
    254         case 'k': case 'K':
    255             switch (ext[2]) {
    256             case 'a': case 'A':
    257                 switch (ext[3]) {
    258                 case '\0': return AID_MEDIA_AUDIO;
    259                 }
    260             case 'v': case 'V':
    261                 switch (ext[3]) {
    262                 case '\0': return AID_MEDIA_VIDEO;
    263                 }
    264             }
    265         case 'n': case 'N':
    266             switch (ext[2]) {
    267             case 'g': case 'G':
    268                 switch (ext[3]) {
    269                 case '\0': return AID_MEDIA_VIDEO;
    270                 }
    271             }
    272         case 'o': case 'O':
    273             switch (ext[2]) {
    274             case 'v': case 'V':
    275                 switch (ext[3]) {
    276                 case '\0': return AID_MEDIA_VIDEO;
    277                 case 'i': case 'I':
    278                     switch (ext[4]) {
    279                     case 'e': case 'E':
    280                         switch (ext[5]) {
    281                         case '\0': return AID_MEDIA_VIDEO;
    282                         }
    283                     }
    284                 }
    285             }
    286         case 'p': case 'P':
    287             switch (ext[2]) {
    288             case '2':
    289                 switch (ext[3]) {
    290                 case '\0': return AID_MEDIA_AUDIO;
    291                 }
    292             case '3':
    293                 switch (ext[3]) {
    294                 case '\0': return AID_MEDIA_AUDIO;
    295                 }
    296             case '4':
    297                 switch (ext[3]) {
    298                 case '\0': return AID_MEDIA_VIDEO;
    299                 }
    300             case 'e': case 'E':
    301                 switch (ext[3]) {
    302                 case '\0': return AID_MEDIA_VIDEO;
    303                 case 'g': case 'G':
    304                     switch (ext[4]) {
    305                     case '\0': return AID_MEDIA_VIDEO;
    306                     case 'a': case 'A':
    307                         switch (ext[5]) {
    308                         case '\0': return AID_MEDIA_AUDIO;
    309                         }
    310                     }
    311                 }
    312             case 'g': case 'G':
    313                 switch (ext[3]) {
    314                 case '\0': return AID_MEDIA_VIDEO;
    315                 case 'a': case 'A':
    316                     switch (ext[4]) {
    317                     case '\0': return AID_MEDIA_AUDIO;
    318                     }
    319                 }
    320             }
    321         case 'x': case 'X':
    322             switch (ext[2]) {
    323             case 'u': case 'U':
    324                 switch (ext[3]) {
    325                 case '\0': return AID_MEDIA_VIDEO;
    326                 }
    327             }
    328         }
    329     case 'n': case 'N':
    330         switch (ext[1]) {
    331         case 'e': case 'E':
    332             switch (ext[2]) {
    333             case 'f': case 'F':
    334                 switch (ext[3]) {
    335                 case '\0': return AID_MEDIA_IMAGE;
    336                 }
    337             }
    338         case 'r': case 'R':
    339             switch (ext[2]) {
    340             case 'w': case 'W':
    341                 switch (ext[3]) {
    342                 case '\0': return AID_MEDIA_IMAGE;
    343                 }
    344             }
    345         }
    346     case 'o': case 'O':
    347         switch (ext[1]) {
    348         case 'g': case 'G':
    349             switch (ext[2]) {
    350             case 'a': case 'A':
    351                 switch (ext[3]) {
    352                 case '\0': return AID_MEDIA_AUDIO;
    353                 }
    354             case 'g': case 'G':
    355                 switch (ext[3]) {
    356                 case '\0': return AID_MEDIA_AUDIO;
    357                 }
    358             }
    359         case 'r': case 'R':
    360             switch (ext[2]) {
    361             case 'f': case 'F':
    362                 switch (ext[3]) {
    363                 case '\0': return AID_MEDIA_IMAGE;
    364                 }
    365             }
    366         }
    367     case 'p': case 'P':
    368         switch (ext[1]) {
    369         case 'b': case 'B':
    370             switch (ext[2]) {
    371             case 'm': case 'M':
    372                 switch (ext[3]) {
    373                 case '\0': return AID_MEDIA_IMAGE;
    374                 }
    375             }
    376         case 'c': case 'C':
    377             switch (ext[2]) {
    378             case 'x': case 'X':
    379                 switch (ext[3]) {
    380                 case '\0': return AID_MEDIA_IMAGE;
    381                 }
    382             }
    383         case 'e': case 'E':
    384             switch (ext[2]) {
    385             case 'f': case 'F':
    386                 switch (ext[3]) {
    387                 case '\0': return AID_MEDIA_IMAGE;
    388                 }
    389             }
    390         case 'g': case 'G':
    391             switch (ext[2]) {
    392             case 'm': case 'M':
    393                 switch (ext[3]) {
    394                 case '\0': return AID_MEDIA_IMAGE;
    395                 }
    396             }
    397         case 'l': case 'L':
    398             switch (ext[2]) {
    399             case 's': case 'S':
    400                 switch (ext[3]) {
    401                 case '\0': return AID_MEDIA_AUDIO;
    402                 }
    403             }
    404         case 'n': case 'N':
    405             switch (ext[2]) {
    406             case 'g': case 'G':
    407                 switch (ext[3]) {
    408                 case '\0': return AID_MEDIA_IMAGE;
    409                 }
    410             case 'm': case 'M':
    411                 switch (ext[3]) {
    412                 case '\0': return AID_MEDIA_IMAGE;
    413                 }
    414             }
    415         case 'p': case 'P':
    416             switch (ext[2]) {
    417             case 'm': case 'M':
    418                 switch (ext[3]) {
    419                 case '\0': return AID_MEDIA_IMAGE;
    420                 }
    421             }
    422         case 's': case 'S':
    423             switch (ext[2]) {
    424             case 'd': case 'D':
    425                 switch (ext[3]) {
    426                 case '\0': return AID_MEDIA_IMAGE;
    427                 }
    428             }
    429         }
    430     case 'q': case 'Q':
    431         switch (ext[1]) {
    432         case 't': case 'T':
    433             switch (ext[2]) {
    434             case '\0': return AID_MEDIA_VIDEO;
    435             }
    436         }
    437     case 'r': case 'R':
    438         switch (ext[1]) {
    439         case 'a': case 'A':
    440             switch (ext[2]) {
    441             case '\0': return AID_MEDIA_AUDIO;
    442             case 'm': case 'M':
    443                 switch (ext[3]) {
    444                 case '\0': return AID_MEDIA_AUDIO;
    445                 }
    446             case 's': case 'S':
    447                 switch (ext[3]) {
    448                 case '\0': return AID_MEDIA_IMAGE;
    449                 }
    450             }
    451         case 'g': case 'G':
    452             switch (ext[2]) {
    453             case 'b': case 'B':
    454                 switch (ext[3]) {
    455                 case '\0': return AID_MEDIA_IMAGE;
    456                 }
    457             }
    458         case 'm': case 'M':
    459             switch (ext[2]) {
    460             case '\0': return AID_MEDIA_AUDIO;
    461             }
    462         case 'w': case 'W':
    463             switch (ext[2]) {
    464             case '2':
    465                 switch (ext[3]) {
    466                 case '\0': return AID_MEDIA_IMAGE;
    467                 }
    468             }
    469         }
    470     case 's': case 'S':
    471         switch (ext[1]) {
    472         case 'd': case 'D':
    473             switch (ext[2]) {
    474             case '2':
    475                 switch (ext[3]) {
    476                 case '\0': return AID_MEDIA_AUDIO;
    477                 }
    478             }
    479         case 'n': case 'N':
    480             switch (ext[2]) {
    481             case 'd': case 'D':
    482                 switch (ext[3]) {
    483                 case '\0': return AID_MEDIA_AUDIO;
    484                 }
    485             }
    486         case 'r': case 'R':
    487             switch (ext[2]) {
    488             case 'w': case 'W':
    489                 switch (ext[3]) {
    490                 case '\0': return AID_MEDIA_IMAGE;
    491                 }
    492             }
    493         case 'v': case 'V':
    494             switch (ext[2]) {
    495             case 'g': case 'G':
    496                 switch (ext[3]) {
    497                 case '\0': return AID_MEDIA_IMAGE;
    498                 case 'z': case 'Z':
    499                     switch (ext[4]) {
    500                     case '\0': return AID_MEDIA_IMAGE;
    501                     }
    502                 }
    503             }
    504         }
    505     case 't': case 'T':
    506         switch (ext[1]) {
    507         case 'i': case 'I':
    508             switch (ext[2]) {
    509             case 'f': case 'F':
    510                 switch (ext[3]) {
    511                 case '\0': return AID_MEDIA_IMAGE;
    512                 case 'f': case 'F':
    513                     switch (ext[4]) {
    514                     case '\0': return AID_MEDIA_IMAGE;
    515                     }
    516                 }
    517             }
    518         case 's': case 'S':
    519             switch (ext[2]) {
    520             case '\0': return AID_MEDIA_VIDEO;
    521             }
    522         }
    523     case 'v': case 'V':
    524         switch (ext[1]) {
    525         case 'o': case 'O':
    526             switch (ext[2]) {
    527             case 'b': case 'B':
    528                 switch (ext[3]) {
    529                 case '\0': return AID_MEDIA_VIDEO;
    530                 }
    531             }
    532         }
    533     case 'w': case 'W':
    534         switch (ext[1]) {
    535         case 'a': case 'A':
    536             switch (ext[2]) {
    537             case 'v': case 'V':
    538                 switch (ext[3]) {
    539                 case '\0': return AID_MEDIA_AUDIO;
    540                 }
    541             case 'x': case 'X':
    542                 switch (ext[3]) {
    543                 case '\0': return AID_MEDIA_AUDIO;
    544                 }
    545             }
    546         case 'b': case 'B':
    547             switch (ext[2]) {
    548             case 'm': case 'M':
    549                 switch (ext[3]) {
    550                 case 'p': case 'P':
    551                     switch (ext[4]) {
    552                     case '\0': return AID_MEDIA_IMAGE;
    553                     }
    554                 }
    555             }
    556         case 'e': case 'E':
    557             switch (ext[2]) {
    558             case 'b': case 'B':
    559                 switch (ext[3]) {
    560                 case 'm': case 'M':
    561                     switch (ext[4]) {
    562                     case '\0': return AID_MEDIA_VIDEO;
    563                     }
    564                 case 'p': case 'P':
    565                     switch (ext[4]) {
    566                     case '\0': return AID_MEDIA_IMAGE;
    567                     }
    568                 }
    569             }
    570         case 'm': case 'M':
    571             switch (ext[2]) {
    572             case '\0': return AID_MEDIA_VIDEO;
    573             case 'a': case 'A':
    574                 switch (ext[3]) {
    575                 case '\0': return AID_MEDIA_AUDIO;
    576                 }
    577             case 'v': case 'V':
    578                 switch (ext[3]) {
    579                 case '\0': return AID_MEDIA_VIDEO;
    580                 }
    581             case 'x': case 'X':
    582                 switch (ext[3]) {
    583                 case '\0': return AID_MEDIA_VIDEO;
    584                 }
    585             }
    586         case 'r': case 'R':
    587             switch (ext[2]) {
    588             case 'f': case 'F':
    589                 switch (ext[3]) {
    590                 case '\0': return AID_MEDIA_VIDEO;
    591                 }
    592             }
    593         case 'v': case 'V':
    594             switch (ext[2]) {
    595             case 'x': case 'X':
    596                 switch (ext[3]) {
    597                 case '\0': return AID_MEDIA_VIDEO;
    598                 }
    599             }
    600         }
    601     case 'x': case 'X':
    602         switch (ext[1]) {
    603         case 'b': case 'B':
    604             switch (ext[2]) {
    605             case 'm': case 'M':
    606                 switch (ext[3]) {
    607                 case '\0': return AID_MEDIA_IMAGE;
    608                 }
    609             }
    610         case 'p': case 'P':
    611             switch (ext[2]) {
    612             case 'm': case 'M':
    613                 switch (ext[3]) {
    614                 case '\0': return AID_MEDIA_IMAGE;
    615                 }
    616             }
    617         case 'w': case 'W':
    618             switch (ext[2]) {
    619             case 'd': case 'D':
    620                 switch (ext[3]) {
    621                 case '\0': return AID_MEDIA_IMAGE;
    622                 }
    623             }
    624         }
    625     }
    626 
    627     return 0;
    628 }
    629