(root)/
tar-1.35/
gnu/
se-context.in.h
       1  /* SELinux-related headers.
       2     Copyright (C) 2007-2023 Free Software Foundation, Inc.
       3  
       4     This file is free software: you can redistribute it and/or modify
       5     it under the terms of the GNU Lesser General Public License as
       6     published by the Free Software Foundation; either version 2.1 of the
       7     License, or (at your option) any later version.
       8  
       9     This file is distributed in the hope that it will be useful,
      10     but WITHOUT ANY WARRANTY; without even the implied warranty of
      11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      12     GNU Lesser General Public License for more details.
      13  
      14     You should have received a copy of the GNU Lesser General Public License
      15     along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
      16  
      17  /* Written by Jim Meyering, 2007.  */
      18  
      19  #ifndef SELINUX_CONTEXT_H
      20  #define SELINUX_CONTEXT_H
      21  
      22  /* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE,
      23     _GL_ATTRIBUTE_MAYBE_UNUSED.  */
      24  #if !_GL_CONFIG_H_INCLUDED
      25   #error "Please include config.h first."
      26  #endif
      27  
      28  #include <errno.h>
      29  
      30  _GL_INLINE_HEADER_BEGIN
      31  #ifndef SE_CONTEXT_INLINE
      32  # define SE_CONTEXT_INLINE _GL_INLINE
      33  #endif
      34  
      35  /* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if
      36     the entity is not used.  The compiler should not warn if the entity is not
      37     used.  */
      38  #ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
      39  # if 0 /* no GCC or clang version supports this yet */
      40  #  define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
      41  # elif defined __GNUC__ || defined __clang__
      42  #  define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
      43  # else
      44  #  define _GL_ATTRIBUTE_MAYBE_UNUSED
      45  # endif
      46  #endif
      47  
      48  typedef int context_t;
      49  SE_CONTEXT_INLINE context_t
      50  context_new (_GL_ATTRIBUTE_MAYBE_UNUSED char const *s)
      51    { errno = ENOTSUP; return 0; }
      52  SE_CONTEXT_INLINE char *
      53  context_str (_GL_ATTRIBUTE_MAYBE_UNUSED context_t con)
      54    { errno = ENOTSUP; return (void *) 0; }
      55  SE_CONTEXT_INLINE void context_free (_GL_ATTRIBUTE_MAYBE_UNUSED context_t c) {}
      56  
      57  SE_CONTEXT_INLINE int
      58  context_user_set (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc,
      59                    _GL_ATTRIBUTE_MAYBE_UNUSED char const *s)
      60    { errno = ENOTSUP; return -1; }
      61  SE_CONTEXT_INLINE int
      62  context_role_set (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc,
      63                    _GL_ATTRIBUTE_MAYBE_UNUSED char const *s)
      64    { errno = ENOTSUP; return -1; }
      65  SE_CONTEXT_INLINE int
      66  context_range_set (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc,
      67                     _GL_ATTRIBUTE_MAYBE_UNUSED char const *s)
      68    { errno = ENOTSUP; return -1; }
      69  SE_CONTEXT_INLINE int
      70  context_type_set (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc,
      71                    _GL_ATTRIBUTE_MAYBE_UNUSED char const *s)
      72    { errno = ENOTSUP; return -1; }
      73  SE_CONTEXT_INLINE char *
      74  context_type_get (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc)
      75    { errno = ENOTSUP; return (void *) 0; }
      76  SE_CONTEXT_INLINE char *
      77  context_range_get (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc)
      78    { errno = ENOTSUP; return (void *) 0; }
      79  SE_CONTEXT_INLINE char *
      80  context_role_get (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc)
      81    { errno = ENOTSUP; return (void *) 0; }
      82  SE_CONTEXT_INLINE char *
      83  context_user_get (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc)
      84    { errno = ENOTSUP; return (void *) 0; }
      85  
      86  _GL_INLINE_HEADER_END
      87  
      88  #endif