From d8ffdcc3e16a5bb7aeafe6547fe6c2eda113cc09 Mon Sep 17 00:00:00 2001 From: leslie Date: Sat, 21 Mar 2009 17:37:36 +0800 Subject: [PATCH] smartcards: fix forward use of class --- smartcard.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/smartcard.c b/smartcard.c index 5f1369a..52e9319 100644 --- a/smartcard.c +++ b/smartcard.c @@ -547,7 +547,23 @@ bool cSmartCardSlot::ParseAtr(void) #undef NEED -// -- cSmartCardSlots ---------------------------------------------------------- +// -- cSmartCardSlots / cSmartCardSlotLink ------------------------------------- + +class cSmartCardSlotLink { +public: + cSmartCardSlotLink *next; + const char *name; +public: + cSmartCardSlotLink(const char *Name); + virtual ~cSmartCardSlotLink() {} + virtual cSmartCardSlot *Create(void)=0; + }; + +template class cSmartCardSlotLinkReg : public cSmartCardSlotLink { +public: + cSmartCardSlotLinkReg(const char *Name):cSmartCardSlotLink(Name) {} + virtual cSmartCardSlot *Create(void) { return new LL; } + }; class cSmartCardSlots : public cStructListPlain { friend class cSmartCardSlotLink; @@ -568,32 +584,12 @@ cSmartCardSlotLink *cSmartCardSlots::first=0; static cSmartCardSlots cardslots; -// -- cSmartCardSlotLink ------------------------------------------------------- - -class cSmartCardSlotLink { -public: - cSmartCardSlotLink *next; - const char *name; -public: - cSmartCardSlotLink(const char *Name); - virtual ~cSmartCardSlotLink() {} - virtual cSmartCardSlot *Create(void)=0; - }; - -template class cSmartCardSlotLinkReg : public cSmartCardSlotLink { -public: - cSmartCardSlotLinkReg(const char *Name):cSmartCardSlotLink(Name) {} - virtual cSmartCardSlot *Create(void) { return new LL; } - }; - cSmartCardSlotLink::cSmartCardSlotLink(const char *Name) { name=Name; cSmartCardSlots::Register(this); } -// -- cSmartCardSlots ---------------------------------------------------------- - cSmartCardSlots::cSmartCardSlots(void) :cStructListPlain("cardslot config","cardslot.conf",SL_MISSINGOK|SL_VERBOSE|SL_NOPURGE) {} -- 2.39.5