From: leslie Date: Sat, 21 Mar 2009 09:37:36 +0000 (+0800) Subject: smartcards: fix forward use of class X-Git-Tag: 0.9.2~54 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=d8ffdcc3e16a5bb7aeafe6547fe6c2eda113cc09;p=sasc-ng.git smartcards: fix forward use of class --- 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) {}