Skip to content

Commit

Permalink
Header file cleanup.
Browse files Browse the repository at this point in the history
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4081 c6295689-39f2-0310-b995-f0e70906c6a9
  • Loading branch information
aj committed Mar 4, 2010
1 parent 1bd07ba commit d22a248
Show file tree
Hide file tree
Showing 169 changed files with 770 additions and 626 deletions.
2 changes: 1 addition & 1 deletion Makefile.mak
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

SUBDIRS = src
SUBDIRS = win32 src

all::

Expand Down
8 changes: 1 addition & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -652,13 +652,9 @@ AC_DEFINE_UNQUOTED([OPENSC_VERSION_MINOR], [${OPENSC_VERSION_MINOR}], [OpenSC ve
AC_DEFINE_UNQUOTED([OPENSC_VERSION_FIX], [${OPENSC_VERSION_FIX}], [OpenSC version fix component])
AC_DEFINE_UNQUOTED([OPENSC_FEATURES], ["${OPENSC_FEATURES}"], [Enabled OpenSC features])

openscincludedir="\$(includedir)/opensc"
pkcs11dir="\$(libdir)/pkcs11"
pkgconfigdir="\$(libdir)/pkgconfig"

AC_SUBST([openscincludedir])
AC_SUBST([pkcs11dir])
AC_SUBST([pkgconfigdir])
AC_SUBST([xslstylesheetsdir])
AC_SUBST([OPENSC_VERSION_MAJOR])
AC_SUBST([OPENSC_VERSION_MINOR])
Expand Down Expand Up @@ -713,9 +709,6 @@ AC_CONFIG_FILES([
etc/Makefile
src/Makefile
src/common/Makefile
src/include/Makefile
src/include/winconfig.h
src/include/opensc/Makefile
src/libopensc/Makefile
src/libopensc/libopensc.pc
src/pkcs11/Makefile
Expand All @@ -728,6 +721,7 @@ AC_CONFIG_FILES([
src/cardmod/cardmod.inf
win32/Makefile
win32/versioninfo.rc
win32/winconfig.h
])
AC_OUTPUT

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
EXTRA_DIST = Makefile.mak

# Order IS important
SUBDIRS = common include scconf pkcs15init libopensc pkcs11 \
SUBDIRS = common scconf pkcs15init libopensc pkcs11 \
tools tests cardmod
2 changes: 1 addition & 1 deletion src/Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TOPDIR = ..

!INCLUDE $(TOPDIR)\win32\Make.rules.mak

SUBDIRS = include common scconf pkcs15init libopensc pkcs11 tools tests cardmod
SUBDIRS = common scconf pkcs15init libopensc pkcs11 tools tests cardmod

all::

Expand Down
4 changes: 1 addition & 3 deletions src/cardmod/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ else
dist_noinst_DATA = cardmod.inf cardmod-westcos.reg
endif

INCLUDES = -I$(top_builddir)/src/include \
-I$(top_srcdir)/src/common \
-I$(top_srcdir)/src/libopensc
INCLUDES = -I$(top_srcdir)/src

opensc_cardmod@LIBRARY_BITNESS@_la_SOURCES = cardmod.c cardmod.exports \
$(top_builddir)/win32/versioninfo.rc
Expand Down
17 changes: 7 additions & 10 deletions src/cardmod/cardmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,18 @@
#pragma managed(push, off)
#endif

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <windows.h>
#include <cardmod.h>

#include <opensc/opensc.h>
#include <opensc/pkcs15.h>
#include "config.h"

#include <log.h>

#include <stdio.h>
#include <stdlib.h>

#include <windows.h>
#include <cardmod.h>

#include "libopensc/opensc.h"
#include "libopensc/pkcs15.h"

#define NULLSTR(a) (a == NULL ? "<NULL>" : a)
#define NULLWSTR(a) (a == NULL ? L"<NULL>" : a)

Expand Down
3 changes: 1 addition & 2 deletions src/common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ libcompat_la_SOURCES = \
compat_strlcpy.h compat_strlcpy.c \
compat_getpass.h compat_getpass.c \
compat_getopt.h compat_getopt.c \
simclist.c
simclist.c simclist.h

openscinclude_HEADERS = simclist.h
3 changes: 1 addition & 2 deletions src/common/compat_getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@
* DEALINGS IN THE SOFTWARE.
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifndef HAVE_GETOPT_H

#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "compat_getopt.h"

int my_optind=1, my_opterr=1, my_optopt=0;
Expand Down
11 changes: 6 additions & 5 deletions src/common/compat_getpass.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef HAVE_GETPASS
#include "config.h"

#ifndef HAVE_GETPASS /* empty file if getpass is available */
#include <stdio.h>

#include "compat_getpass.h"

#ifdef _WIN32
char *getpass(const char *prompt)
{
Expand All @@ -24,4 +25,4 @@ char *getpass(const char *prompt)
#else
#error Need getpass implementation
#endif
#endif
#endif /* HAVE_GETPASS */
4 changes: 2 additions & 2 deletions src/common/compat_strlcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/

#include "config.h"
#ifndef HAVE_STRLCPY

#ifndef HAVE_STRLCPY /* empty file if strlcpy is available */
#include <sys/types.h>
#include <string.h>

Expand Down Expand Up @@ -55,4 +55,4 @@ strlcpy(char *dst, const char *src, size_t siz)
return(s - src - 1); /* count does not include NUL */
}

#endif
#endif /* HAVE_STRLCPY */
7 changes: 0 additions & 7 deletions src/include/Makefile.am

This file was deleted.

21 changes: 0 additions & 21 deletions src/include/opensc/Makefile.am

This file was deleted.

3 changes: 0 additions & 3 deletions src/include/opensc/svnignore

This file was deleted.

8 changes: 3 additions & 5 deletions src/libopensc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
EXTRA_DIST = Makefile.mak

lib_LTLIBRARIES = libopensc.la
openscinclude_HEADERS = \
noinst_HEADERS = cards.h ctbcs.h internal.h esteid.h muscle.h muscle-filesystem.h \
internal-winscard.h p15card-helper.h \
opensc.h pkcs15.h \
cardctl.h asn1.h log.h \
errors.h types.h compression.h
noinst_HEADERS = cards.h ctbcs.h internal.h esteid.h muscle.h muscle-filesystem.h \
internal-winscard.h p15card-helper.h
pkgconfig_DATA = libopensc.pc

AM_CPPFLAGS = -DOPENSC_CONF_PATH=\"$(sysconfdir)/opensc.conf\"
AM_CFLAGS = $(OPTIONAL_OPENSSL_CFLAGS) $(OPTIONAL_OPENCT_CFLAGS) \
$(OPTIONAL_PCSC_CFLAGS) $(OPTIONAL_ZLIB_CFLAGS) \
$(OPTIONAL_ICONV_CFLAGS) $(LTLIB_CFLAGS)
INCLUDES = -I$(top_builddir)/src/include -I$(top_srcdir)/src/common
INCLUDES = -I$(top_srcdir)/src

libopensc_la_SOURCES = \
sc.c ctx.c log.c errors.c \
Expand Down
2 changes: 2 additions & 0 deletions src/libopensc/apdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "config.h"

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
Expand Down
7 changes: 5 additions & 2 deletions src/libopensc/asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "internal.h"
#include "asn1.h"
#include "config.h"

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <stdlib.h>

#include "internal.h"
#include "asn1.h"

static int asn1_decode(sc_context_t *ctx, struct sc_asn1_entry *asn1,
const u8 *in, size_t len, const u8 **newp, size_t *len_left,
int choice, int depth);
Expand Down
4 changes: 2 additions & 2 deletions src/libopensc/asn1.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
extern "C" {
#endif

#include <opensc/opensc.h>
#include <opensc/pkcs15.h>
#include "libopensc/opensc.h"
#include "libopensc/pkcs15.h"

struct sc_asn1_entry {
const char *name;
Expand Down
5 changes: 4 additions & 1 deletion src/libopensc/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "internal.h"
#include "config.h"

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>

#include "internal.h"

static const u8 base64_table[66] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
"0123456789+/=";
Expand Down
3 changes: 3 additions & 0 deletions src/libopensc/card-acos5.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "config.h"

#include <string.h>

#include "internal.h"
#include "cardctl.h"

Expand Down
2 changes: 2 additions & 0 deletions src/libopensc/card-akis.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "config.h"

#include <string.h>
#include <stdlib.h>

Expand Down
4 changes: 3 additions & 1 deletion src/libopensc/card-asepcos.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "internal.h"
#include "config.h"

#include <ctype.h>
#include <string.h>

#include "internal.h"
#include "asn1.h"
#include "cardctl.h"

Expand Down
7 changes: 5 additions & 2 deletions src/libopensc/card-atrust-acos.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "config.h"

#include <stdlib.h>
#include <string.h>

#include "internal.h"
#include "asn1.h"
#include "cardctl.h"
#include <stdlib.h>
#include <string.h>

/*****************************************************************************/

Expand Down
7 changes: 5 additions & 2 deletions src/libopensc/card-belpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,14 @@
* language-selection functionality.
*/

#include "internal.h"
#include "log.h"
#include "config.h"

#include <stdlib.h>
#include <string.h>

#include "internal.h"
#include "log.h"

#ifdef BELPIC_PIN_PAD
#ifndef HAVE_GUI
#define HAVE_GUI
Expand Down
8 changes: 5 additions & 3 deletions src/libopensc/card-cardos.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "internal.h"
#include "cardctl.h"
#include "config.h"

#include <ctype.h>
#include <string.h>

#include <opensc/asn1.h>
#include "internal.h"
#include "asn1.h"
#include "cardctl.h"

static const struct sc_card_operations *iso_ops = NULL;

Expand Down
5 changes: 4 additions & 1 deletion src/libopensc/card-default.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "internal.h"
#include "config.h"

#include <string.h>

#include "internal.h"

static struct sc_card_operations default_ops;
static struct sc_card_driver default_drv = {
"Default driver for unknown cards",
Expand Down
11 changes: 7 additions & 4 deletions src/libopensc/card-entersafe.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@

/* Initially written by Weitao Sun ([email protected]) 2008 */

#include "internal.h"
#include "asn1.h"
#include "cardctl.h"
#include "config.h"
#ifdef ENABLE_OPENSSL /* empty file without openssl */

#include <stdlib.h>
#include <string.h>

#ifdef ENABLE_OPENSSL
#include <openssl/evp.h>

#include "internal.h"
#include "asn1.h"
#include "cardctl.h"

static struct sc_atr_table entersafe_atrs[] = {
{
"3b:0f:00:65:46:53:05:19:05:71:df:00:00:00:00:00:00",
Expand Down
Loading

0 comments on commit d22a248

Please sign in to comment.