File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #
2+ # Copyright (c) 2016 Red Hat Inc.
3+ #
4+ # This software is licensed to you under the GNU General Public License,
5+ # version 2 (GPLv2). There is NO WARRANTY for this software, express or
6+ # implied, including the implied warranties of MERCHANTABILITY or FITNESS
7+ # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
8+ # along with this software; if not, see
9+ # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
10+ #
11+
12+ require 'openscap/exceptions'
13+
14+ module OpenSCAP
15+ module Xccdf
16+ class Policy
17+ def initialize ( p )
18+ case p
19+ when FFI ::Pointer
20+ @raw = p
21+ else
22+ fail OpenSCAP ::OpenSCAPError ,
23+ "Cannot initialize OpenSCAP::Xccdf::Policy with '#{ p } '"
24+ end
25+ OpenSCAP . raise! if @raw . null?
26+ end
27+
28+ def id
29+ OpenSCAP . xccdf_policy_get_id raw
30+ end
31+ end
32+ end
33+
34+ attach_function :xccdf_policy_get_id , [ :pointer ] , :string
35+ end
You can’t perform that action at this time.
0 commit comments