aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-06-21 08:23:35 +0000
committerWerner Koch <[email protected]>2019-06-21 09:42:59 +0000
commit43dcf93407d6d2b87b6e7db74fd05fd237495bfe (patch)
tree508f393126fd9994b7eea9a6523676be5872b949
parentgpg: Very minor code cleanup. (diff)
downloadgnupg-43dcf93407d6d2b87b6e7db74fd05fd237495bfe.tar.gz
gnupg-43dcf93407d6d2b87b6e7db74fd05fd237495bfe.zip
scd: Simplify inclusion of app-common.h.
* scd/scdaemon.h: Include app-common.h. Remove inclusion of that header from all other files. (card_t, app_t): Move typedef to ... * scd/app-common.h: here. Use them in the defs. -- In another patch we will need apptype_t in the ctrl object and thus we need to reorganize things a bit now. Given that most files need app-common anyway it makes sense to always include it. Signed-off-by: Werner Koch <[email protected]>
-rw-r--r--scd/app-common.h11
-rw-r--r--scd/app-dinsig.c1
-rw-r--r--scd/app-geldkarte.c1
-rw-r--r--scd/app-help.c1
-rw-r--r--scd/app-nks.c1
-rw-r--r--scd/app-openpgp.c1
-rw-r--r--scd/app-p15.c1
-rw-r--r--scd/app-piv.c1
-rw-r--r--scd/app-sc-hsm.c1
-rw-r--r--scd/app.c1
-rw-r--r--scd/command.c1
-rw-r--r--scd/scdaemon.c1
-rw-r--r--scd/scdaemon.h4
13 files changed, 10 insertions, 16 deletions
diff --git a/scd/app-common.h b/scd/app-common.h
index d3d8869fa..3925eacf7 100644
--- a/scd/app-common.h
+++ b/scd/app-common.h
@@ -70,13 +70,18 @@ typedef enum
} apptype_t;
-/* Formeard declararion. */
+/* Forward declarations. */
+struct card_ctx_s;
+struct app_ctx_s;
struct app_local_s; /* Defined by all app-*.c. */
+typedef struct card_ctx_s *card_t;
+typedef struct app_ctx_s *app_t;
+
/* The object describing a card. */
struct card_ctx_s {
- struct card_ctx_s *next;
+ card_t next;
npth_mutex_t lock;
@@ -114,7 +119,7 @@ struct card_ctx_s {
* several applications and it is usuallay required to explicity
* switch between applications. */
struct app_ctx_s {
- struct app_ctx_s *next;
+ app_t next;
card_t card; /* Link back to the card. */
diff --git a/scd/app-dinsig.c b/scd/app-dinsig.c
index d02938cb1..16a82ade4 100644
--- a/scd/app-dinsig.c
+++ b/scd/app-dinsig.c
@@ -81,7 +81,6 @@
#include "../common/i18n.h"
#include "iso7816.h"
-#include "app-common.h"
#include "../common/tlv.h"
diff --git a/scd/app-geldkarte.c b/scd/app-geldkarte.c
index 4589f3da6..15b38194d 100644
--- a/scd/app-geldkarte.c
+++ b/scd/app-geldkarte.c
@@ -39,7 +39,6 @@
#include "../common/i18n.h"
#include "iso7816.h"
-#include "app-common.h"
#include "../common/tlv.h"
diff --git a/scd/app-help.c b/scd/app-help.c
index 59221ea9c..e3ad74434 100644
--- a/scd/app-help.c
+++ b/scd/app-help.c
@@ -24,7 +24,6 @@
#include <string.h>
#include "scdaemon.h"
-#include "app-common.h"
#include "iso7816.h"
#include "../common/tlv.h"
diff --git a/scd/app-nks.c b/scd/app-nks.c
index 3f985c24a..0651e5d57 100644
--- a/scd/app-nks.c
+++ b/scd/app-nks.c
@@ -53,7 +53,6 @@
#include "scdaemon.h"
#include "../common/i18n.h"
#include "iso7816.h"
-#include "app-common.h"
#include "../common/tlv.h"
#include "apdu.h"
#include "../common/host2net.h"
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index b93b7b557..c301f8218 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -54,7 +54,6 @@
#include "../common/util.h"
#include "../common/i18n.h"
#include "iso7816.h"
-#include "app-common.h"
#include "../common/tlv.h"
#include "../common/host2net.h"
#include "../common/openpgpdefs.h"
diff --git a/scd/app-p15.c b/scd/app-p15.c
index 3b7233926..9cd423ee6 100644
--- a/scd/app-p15.c
+++ b/scd/app-p15.c
@@ -38,7 +38,6 @@
#include "scdaemon.h"
#include "iso7816.h"
-#include "app-common.h"
#include "../common/tlv.h"
#include "apdu.h" /* fixme: we should move the card detection to a
separate file */
diff --git a/scd/app-piv.c b/scd/app-piv.c
index 331f914bb..c1bc79435 100644
--- a/scd/app-piv.c
+++ b/scd/app-piv.c
@@ -61,7 +61,6 @@
#include "../common/util.h"
#include "../common/i18n.h"
#include "iso7816.h"
-#include "app-common.h"
#include "../common/tlv.h"
#include "../common/host2net.h"
#include "apdu.h" /* We use apdu_send_direct. */
diff --git a/scd/app-sc-hsm.c b/scd/app-sc-hsm.c
index d18a1a737..87e58d984 100644
--- a/scd/app-sc-hsm.c
+++ b/scd/app-sc-hsm.c
@@ -33,7 +33,6 @@
#include "scdaemon.h"
#include "iso7816.h"
-#include "app-common.h"
#include "../common/tlv.h"
#include "apdu.h"
diff --git a/scd/app.c b/scd/app.c
index ef9e993d3..d9b762994 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -26,7 +26,6 @@
#include "scdaemon.h"
#include "../common/exechelp.h"
-#include "app-common.h"
#include "iso7816.h"
#include "apdu.h"
#include "../common/tlv.h"
diff --git a/scd/command.c b/scd/command.c
index 1c8338446..3c63ef5fd 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -33,7 +33,6 @@
#include "scdaemon.h"
#include <assuan.h>
#include <ksba.h>
-#include "app-common.h"
#include "iso7816.h"
#include "apdu.h" /* Required for apdu_*_reader (). */
#include "atr.h"
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 42efb4c37..e89569e5d 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -46,7 +46,6 @@
#include "../common/i18n.h"
#include "../common/sysutils.h"
-#include "app-common.h"
#include "iso7816.h"
#include "apdu.h"
#include "ccid-driver.h"
diff --git a/scd/scdaemon.h b/scd/scdaemon.h
index f4a243703..d9c476d52 100644
--- a/scd/scdaemon.h
+++ b/scd/scdaemon.h
@@ -30,6 +30,8 @@
#include <gcrypt.h>
#include "../common/util.h"
#include "../common/sysutils.h"
+#include "app-common.h"
+
/* To convey some special hash algorithms we use algorithm numbers
reserved for application use. */
@@ -112,8 +114,6 @@ struct server_control_s
} in_data;
};
-typedef struct card_ctx_s *card_t;
-typedef struct app_ctx_s *app_t;
/*-- scdaemon.c --*/
void scd_exit (int rc);