github.com/bugraaydogar/snapd@v0.0.0-20210315170335-8c70bb858939/cmd/libsnap-confine-private/feature.h (about)

     1  /*
     2   * Copyright (C) 2018 Canonical Ltd
     3   *
     4   * This program is free software: you can redistribute it and/or modify
     5   * it under the terms of the GNU General Public License version 3 as
     6   * published by the Free Software Foundation.
     7   *
     8   * This program is distributed in the hope that it will be useful,
     9   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11   * GNU General Public License for more details.
    12   *
    13   * You should have received a copy of the GNU General Public License
    14   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    15   *
    16   */
    17  
    18  #ifndef SNAP_CONFINE_FEATURE_H
    19  #define SNAP_CONFINE_FEATURE_H
    20  
    21  #include <stdbool.h>
    22  
    23  typedef enum sc_feature_flag {
    24  	SC_FEATURE_PER_USER_MOUNT_NAMESPACE = 1 << 0,
    25  	SC_FEATURE_REFRESH_APP_AWARENESS = 1 << 1,
    26  	SC_FEATURE_PARALLEL_INSTANCES = 1 << 2,
    27  	SC_FEATURE_HIDDEN_SNAP_FOLDER = 1 << 3,
    28  } sc_feature_flag;
    29  
    30  /**
    31   * sc_feature_enabled returns true if a given feature flag has been activated
    32   * by the user via "snap set core experimental.xxx=true". This is determined by
    33   * testing the presence of a file in /var/lib/snapd/features/ that is named
    34   * after the flag name.
    35  **/
    36  bool sc_feature_enabled(sc_feature_flag flag);
    37  
    38  #endif