On Thu, 2011-02-03 at 15:55 -0600, Douglas E. Engert wrote:
> 
> On 2/3/2011 3:14 PM, Andre Zepezauer wrote:
> > On Thu, 2011-02-03 at 14:04 -0600, Douglas E. Engert wrote:
> >> I have updates #321 with a new version of the cardmod patch
> >> and would like to start to commit it in pieces.
> >>
> >> Piece 1 is the attachment I sent on 1/28 as new.martin.patch
> >> based on Martin's patch from 1/19. This was the patch that would
> >> work for Brian. The main change is adding two parameters to all
> >> the *_detect_readers routines.  Martin's patch already required these
> >> to be added in a number of places.
> >>
> >> Is there any objection to adding this patch now?
> >
> > Yes, why you want to call 'sc_context_create()' altogether. There is not
> > much functionality in it. So you could easily implement the required
> > initialisation in 'CardAcquireContext()'.
> 
> I disagree there is a lot of functionality in it. It main functions is to
> read the config files, and other initialization needed by OpenSC, and that
> is more then enough to justify calling it.

I got it. The whole file ctx.c is basically one single function, that is
scattered into a lot of small functions, which are mostly called once.
The fact that most of these functions are 'static' makes it even more
interesting. So, it seem that calling 'sc_context_create()' is really
required.

There is still the option to separate reader-pcsc and reader-cardmod.
That this would be the best solution shows the following example:

1. A Mini-Driver doesn't need to detect readers at all. Thus it should
define "driver->ops->detect_readers = NULL". That's the trick.
2. Looking at 'detect_readers' of the current driver looks like rocket
science [1]. IMO there is something fundamentally wrong. 

Regards
Andre

[1] 
http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/reader-pcsc.c#L1662


_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to