× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 6/29/2011 6:02 PM, gn pr wrote:

I have the next code, because I'm trying to get the user
certificates , but I cannot recover the certificates
of the user, I think it because the Selection Control is not in a good format.
Any help is appreciated.
...
char *Selection_control = " 8 0\0" ;
...
QsyListUserCertificates
(Qualified_user_space_name,
User_name,
Format_name,
Selection_control,
&error_code) ;

Before you do anything else, set up your error_code parameter properly. Currently, you are risking serious storage corruption by not initializing it properly. Try this for a quick-and-dirty error code parameter.

#include <qusec.h>
Qus_EC_t error_code = {0};

I think you will find it easier to use the Qsy_Sel_Ctrl_T and Qsy_Sel_Ctrl_Pair_T typedefs rather than trying to build a string like that. They are defined in <qsydigid.h> (QSYSINC/H member QSYDIGID).

If you know everything at code-writing time, you might be able to define it like this, but this is just a guess from looking at the prototype and structure definnitions; I am not familiar with this API.
struct
{
Qsy_Sel_Ctrl_T sel_ctrl_header;
Qsy_Sel_Ctrl_Pair_T pair1;
char data1[whatever size you need for selection data 1];
Qsy_Sel_Ctrl_Pair_T pair2;
char data2[whatever size you need for selection data 2];
etc
} Selection_control;

Then add logic to set all the values in the Selection_control struct according to the documentation.

If you don't know the size of the selection data until runtime, it would be more complicated. You'd have to figure out the total length needed, then allocate enough storage for the whole thing, then you'd use pointers to the various structures, keeping track of your current offset in the storage to know where to put the next piece of information.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.