using with header files

Tournie tourney.email at yahoo.com
Tue Mar 27 10:50:50 PDT 2012


Thanks Michael,

that would be great and much appreciated.


Jeff


> Tournie,
>
> I will work on some simple examples to add to the API documentation and post here when they are available.
>
>
> On Mar 27, 2012, at 8:08 AM, Tournie <tourney.email at yahoo.com> wrote:
>
> > Ok, I got this.  Since I am using VS I should use the vcnet one, not xcode.  But I am still tracing down includes - now I am up to needing sspi-private.h.
> >
> > Am I the first one doing this?  Isn't there an example out there that would be nice and simple and just do the httpConnect and ippNewRequest, etc.?  I seem like I might be re-inventing the wheel here, but I can't seem to find example code anywhere.
> >
> >> Ok, I am trying to start with httpConnect() and then move on to ippNewRequest().  You suggested a line like this:
> >>
> >> http_t *http = httpConnect(hostname, port);
> >>
> >> To make a variable of type 'http_t *' I need to include http.h.  However, that just has the line
> >>
> >> typedef struct _http_s http_t;
> >>
> >> and so the compiler needs to know what an '_http_s' is.  That is in http-private.h.  When I include that file, it wants a config.h.  There are two different config.h's in the download.  How do I know which one?
> >>
> >> Thanks,
> >>
> >>
> >> Tournie
> >>
> >>> Use ippNewRequest() to create a request with the given operation code.
> >>>
> >>> Also look at the referenced documentation - every field has a corresponding ippGet and ippSet function.
> >>>
> >>> The ipptool source is not a good example since it has to access private data for some of the tests it does (working on that), and most of the other CUPS sources have not yet been updated to use the new APIs. The long-term goal is to eliminate all usage of private headers from everywhere except the libcups sources themselves.
> >>>
> >>> On Mar 26, 2012, at 3:15 PM, Tournie wrote:
> >>>> Thanks Michael,
> >>>>
> >>>> this helps.  But I feel like I am going back to square 1 again.  I'll use httpConnect() but then what?  I assume ippNew() or ippNewRequest() would come next, so I looked at ipptool.c for examples.  There is a variable declared of type 'ipp_t *'  As soon as I have one of these and I try and fill in the request.op.operation_id field I need ipp-private.h for the definition of the _ipp_s struct.  All ipp.h has is typedef struct _ipp_s ipp_t; so that's why I need the ipp-private.h, no?
> >>>>
> >>>>
> >>>> Thanks,
> >>>>
> >>>> Tournie
> >>>>
> >>>>
> >>>>> Tournie,
> >>>>>
> >>>>> On Mar 26, 2012, at 2:05 PM, Tournie wrote:
> >>>>>> ...
> >>>>>> want to find out about its jobs, send jobs to it, cancel jobs if necessary, etc.  When do I need to use ippNew().  What about httpConnect()?  Is there a page that explains this or gives an example?  http://www.cups.org/doc-1.1/spm.html is in the right direction....
> >>>>>
> >>>>> and is wholly out-of-date...
> >>>>>
> >>>>> Try the following:
> >>>>>
> >>>>> 	http://www.cups.org/documentation.php/doc-1.6/api-httpipp.html
> >>>>>
> >>>>> What you want is:
> >>>>>
> >>>>> 	http_t *http = httpConnect(hostname, port);
> >>>>>
> >>>>> 	/* or httpConnectEncrypt, if the printer supports SSL or TLS */
> >>>>>
> >>>>> and then the example code you see in the above link.
> >>>>>
> >>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>> The documentation here will provide what you want for CUPS 1.5 and earlier:
> >>>>>>>
> >>>>>>> 	http://www.cups.org/documentation.php/api-httpipp.html
> >>>>>>>
> >>>>>>> It has not (yet) been updated for CUPS 1.6 and its new data accessor APIs.
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mar 26, 2012, at 11:49 AM, Tournie wrote:
> >>>>>>>
> >>>>>>>> Thanks,
> >>>>>>>>
> >>>>>>>> I guess what would be helpful is an example of how to do something basic, like query the server for its active jobs.  I had assumed I would make variables of type 'ipp_t *' and 'http_t *' and call ippNew(), fill out the resulting fields of the 'ipp_t *' variable, kind of like this:
> >>>>>>>>
> >>>>>>>> ipp_t * pIpp;
> >>>>>>>>
> >>>>>>>> pIpp = ippNew();
> >>>>>>>> pIpp->request.op.operation_id = IPP_GET_JOBS;
> >>>>>>>> ..
> >>>>>>>> ..
> >>>>>>>> ..
> >>>>>>>>
> >>>>>>>> but I'm certainly welcome to suggestions.
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> -T
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>> Tournie,
> >>>>>>>>>
> >>>>>>>>> You need the following header files:
> >>>>>>>>>
> >>>>>>>>> array.h
> >>>>>>>>> cups.h
> >>>>>>>>> dir.h
> >>>>>>>>> file.h
> >>>>>>>>> http.h
> >>>>>>>>> ipp.h
> >>>>>>>>> language.h
> >>>>>>>>> transcode.h
> >>>>>>>>> versioning.h
> >>>>>>>>>
> >>>>>>>>> The -private headers are not for user programs, and you don't access those structures directly but instead use accessor functions to get or set values as needed.
> >>>>>>>>>
> >>>>>>>>> I am working on a libcupsinstalller project that will provide the necessary bits without compiling CUPS yourself.
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On Mar 26, 2012, at 10:37 AM, Tournie wrote:
> >>>>>>>>>
> >>>>>>>>>> I built libcups2.lib with Visual Studio.  To use it with my project, I included it along with ipp.h and http.h.  But now I'm seeing that to use variables of type 'ipp_t *' or 'http_t *' I need to bring over the files ipp-private.h and http-private.h, and the http-private.h wants config.h, and there are two config.h files, etc.
> >>>>>>>>>>
> >>>>>>>>>> Before I proceed further, am I going down the wrong path?  When I got past just needing ipp.h and http.h I started thinking I might be looking at this wrong.  Just looking for comments before I get too deep into bring in include files, etc.
> >>>>>>>>>> _______________________________________________
> >>>>>>>>>> cups mailing list
> >>>>>>>>>> cups at easysw.com
> >>>>>>>>>> http://lists.easysw.com/mailman/listinfo/cups
> >>>>>>>>>
> >>>>>>>>> ________________________________________________________________________
> >>>>>>>>> Michael Sweet, Senior Printing System Engineer, PWG Chair
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>> _______________________________________________
> >>>>>>>> cups mailing list
> >>>>>>>> cups at easysw.com
> >>>>>>>> http://lists.easysw.com/mailman/listinfo/cups
> >>>>>>>
> >>>>>>> ________________________________________________________________________
> >>>>>>> Michael Sweet, Senior Printing System Engineer, PWG Chair
> >>>>>>>
> >>>>>>
> >>>>>> _______________________________________________
> >>>>>> cups mailing list
> >>>>>> cups at easysw.com
> >>>>>> http://lists.easysw.com/mailman/listinfo/cups
> >>>>>
> >>>>> ________________________________________________________________________
> >>>>> Michael Sweet, Senior Printing System Engineer, PWG Chair
> >>>>>
> >>>>
> >>>> _______________________________________________
> >>>> cups mailing list
> >>>> cups at easysw.com
> >>>> http://lists.easysw.com/mailman/listinfo/cups
> >>>
> >>> ________________________________________________________________________
> >>> Michael Sweet, Senior Printing System Engineer, PWG Chair
> >>>
> >>
> >
> > _______________________________________________
> > cups mailing list
> > cups at easysw.com
> > http://lists.easysw.com/mailman/listinfo/cups
>
> __________________________________________________
> Michael Sweet, Senior Printing System Engineer, PWG Chair
>





More information about the cups mailing list