token-map.h revision 299742
1/** 2 * ==================================================================== 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * ==================================================================== 20 * 21 * This header is parsed by transform-sql.py to allow SQLite 22 * statements to refer to string values by symbolic names. 23 */ 24 25#ifndef SVN_WC_TOKEN_MAP_H 26#define SVN_WC_TOKEN_MAP_H 27 28#include "svn_types.h" 29#include "wc_db.h" 30#include "private/svn_token.h" 31 32#ifdef __cplusplus 33extern "C" { 34#endif 35 36/* The kind values used on NODES */ 37static const svn_token_map_t kind_map[] = { 38 { "file", svn_node_file }, /* MAP_FILE */ 39 { "dir", svn_node_dir }, /* MAP_DIR */ 40 { "symlink", svn_node_symlink }, /* MAP_SYMLINK */ 41 { "unknown", svn_node_unknown }, /* MAP_UNKNOWN */ 42 { NULL } 43}; 44 45/* Like kind_map, but also supports 'none' */ 46static const svn_token_map_t kind_map_none[] = { 47 { "none", svn_node_none }, 48 { "file", svn_node_file }, 49 { "dir", svn_node_dir }, 50 { "symlink", svn_node_symlink }, 51 { "unknown", svn_node_unknown }, 52 { NULL } 53}; 54 55/* Note: we only decode presence values from the database. These are a 56 subset of all the status values. */ 57static const svn_token_map_t presence_map[] = { 58 { "normal", svn_wc__db_status_normal }, /* MAP_NORMAL */ 59 { "server-excluded", svn_wc__db_status_server_excluded }, /* MAP_SERVER_EXCLUDED */ 60 { "excluded", svn_wc__db_status_excluded }, /* MAP_EXCLUDED */ 61 { "not-present", svn_wc__db_status_not_present }, /* MAP_NOT_PRESENT */ 62 { "incomplete", svn_wc__db_status_incomplete }, /* MAP_INCOMPLETE */ 63 { "base-deleted", svn_wc__db_status_base_deleted }, /* MAP_BASE_DELETED */ 64 { NULL } 65}; 66 67/* The subset of svn_depth_t used in the database. */ 68static const svn_token_map_t depth_map[] = { 69 { "unknown", svn_depth_unknown }, /* MAP_DEPTH_UNKNOWN */ 70 { "empty", svn_depth_empty }, 71 { "files", svn_depth_files }, 72 { "immediates", svn_depth_immediates }, 73 { "infinity", svn_depth_infinity }, /* MAP_DEPTH_INFINITY */ 74 { NULL } 75}; 76 77#ifdef __cplusplus 78} 79#endif 80 81#endif 82