github.com/rigado/snapd@v2.42.5-go-mod+incompatible/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_flag;
    28  
    29  /**
    30   * sc_feature_enabled returns true if a given feature flag has been activated
    31   * by the user via "snap set core experimental.xxx=true". This is determined by
    32   * testing the presence of a file in /var/lib/snapd/features/ that is named
    33   * after the flag name.
    34  **/
    35  bool sc_feature_enabled(sc_feature_flag flag);
    36  
    37  #endif