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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2019-06-21 10:23:35 +02:00
parent 4256e9f0f1
commit 43dcf93407
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
13 changed files with 10 additions and 16 deletions

View File

@ -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. */

View File

@ -81,7 +81,6 @@
#include "../common/i18n.h"
#include "iso7816.h"
#include "app-common.h"
#include "../common/tlv.h"

View File

@ -39,7 +39,6 @@
#include "../common/i18n.h"
#include "iso7816.h"
#include "app-common.h"
#include "../common/tlv.h"

View File

@ -24,7 +24,6 @@
#include <string.h>
#include "scdaemon.h"
#include "app-common.h"
#include "iso7816.h"
#include "../common/tlv.h"

View File

@ -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"

View File

@ -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"

View File

@ -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 */

View File

@ -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. */

View File

@ -33,7 +33,6 @@
#include "scdaemon.h"
#include "iso7816.h"
#include "app-common.h"
#include "../common/tlv.h"
#include "apdu.h"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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);