So simple, so wrong

Anonymous anonymous at easysw.com
Sat Aug 13 06:18:04 PDT 2005


>      int
>      main(void)
>      {

please, put these lines in API doc!

>      }


other problem: print a file.
Following docs i wrote this simple .c code:

#######################################################################
#include <cups/cups.h>

int num_dests;
int num_options;
int jobid;
cups_option_t *options;
cups_dest_t *dests;
cups_dest_t *dest;

int main()
{
        num_dests = cupsGetDests(&dests);
        dest = cupsGetDest(NULL, NULL, num_dests, dests);
        if (dest)
        {
                printf("Destination: %s.\n", dest->name);
        }
        else
        {
                printf("No Destination.\n");
        }
        return 0;

        /* print file */
        jobid = cupsPrintFile(dest->name, "test.ps", "One test", dest->num_options, dest->options);

        /* error */
        if(jobid == 0)
        {
                puts(ippErrorString(cupsLastError()));
        }
}
#######################################################################

I receive well the default destination (eg. "LaserJet-1010") but the cupsPrintFile didn't print anything. The file "test.ps" is in the same directory where I run the exe (right compile now).

Is there a way to know what's up?
Why I cannot print my file?




More information about the cups mailing list