Browse Source

Move definition of gfsec_scheme_t to a separate header

Isolate the definition of the gfsec_scheme_t enum to a dedicated
header. This is to reduce coupling as this enum will be reused
elsewhere.
develop
Damien Goutte-Gattat 5 years ago
parent
commit
98be500db8
  1. 1
      src/Makefile.am
  2. 31
      src/schemes.h
  3. 7
      src/secret.h

1
src/Makefile.am

@ -2,6 +2,7 @@ bin_PROGRAMS = gfsec-use
gfsec_use_SOURCES = gfsec-use.c util.c util.h secret.c secret.h \
secretcfg.c secretcfg.h gfsec-errors.h \
schemes.h \
mtp-support.c mtp-support.h \
uuid-support.c uuid-support.h

31
src/schemes.h

@ -0,0 +1,31 @@
/*
* gfsecret - Secret sharing tools
* Copyright (C) 2016 Damien Goutte-Gattat
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICP20160820_SCHEMES_H
#define ICP20160820_SCHEMES_H
typedef enum gfsec_scheme {
GFSEC_SCHEME_FILE = 0,
GFSEC_SCHEME_UUID,
GFSEC_SCHEME_LABEL,
GFSEC_SCHEME_MTP
} gfsec_scheme_t;
#define GFSEC_SCHEME_MAX 4
#endif /* !ICP20160820_SCHEMES_H */

7
src/secret.h

@ -29,12 +29,7 @@ enum gfsec_error {
#define GFSEC_SHARE_NUMBER_FULL 0
#define GFSEC_SHARE_NUMBER_AUTOASSIGN 256
typedef enum gfsec_scheme {
GFSEC_SCHEME_FILE,
GFSEC_SCHEME_UUID,
GFSEC_SCHEME_LABEL,
GFSEC_SCHEME_MTP
} gfsec_scheme_t;
#include "schemes.h"
/**
* Represents a share of a splitted secret.

Loading…
Cancel
Save