prout

print out papers using libcups
git clone git://z3bra.org/prout
Log | Files | Refs | README | LICENSE

commit 5062a6e4f83c38059c8d7836a98b6cad828970ec
parent 9592f4509a11b7b9a777c8af7b6876c53c7eead7
Author: Klemens Nanni <kl3@posteo.org>
Date:   Sat Feb 13 20:48:14 2016

Use printf instead of puts (deprecated)

Diffstat:
 prout.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/prout.c b/prout.c @@ -22,7 +22,7 @@ /* Usage function */ static void usage() { - fputs("usage: prout [-h] <file>\n", stdout); + printf("usage: prout [-h] <file>\n"); } /* Return the file name if the file is opennable. exit instead */ @@ -34,7 +34,7 @@ static char* check_file(char *file) f = fopen(file, "r"); if (!f) { - fputs("Cannot open the given file\n", stderr); + fprintf(stderr, "Cannot open the given file\n"); exit (1); } @@ -55,7 +55,7 @@ static cups_dest_t* check_dest() /* Leave if there is no default printer configured */ if (num_dests < 1) { - fputs("No default printer configured\n", stderr); + fprintf(stderr, "No default printer configured\n"); exit (1); } @@ -64,7 +64,7 @@ static cups_dest_t* check_dest() /* No need to go on if we can't reach the printer */ if (!dest) { - fputs("Cannot get a pointer to the default destination", stderr); + fprintf(stderr, "Cannot get a pointer to the default destination"); exit (1); } @@ -109,25 +109,25 @@ static void check_job (cups_dest_t *dest, int job_id) switch (state) { case IPP_JOB_PENDING : - fprintf(stdout, "job %d pending.\n", job_id); + printf("job %d pending.\n", job_id); break; case IPP_JOB_HELD : - fprintf(stdout, "job %d held.\n", job_id); + printf("job %d held.\n", job_id); break; case IPP_JOB_PROCESSING : - fprintf(stdout, "job %d processing.\n", job_id); + printf("job %d processing.\n", job_id); break; case IPP_JOB_STOPPED : - fprintf(stdout, "job %d stopped.\n", job_id); + printf("job %d stopped.\n", job_id); break; case IPP_JOB_CANCELED : - fprintf(stdout, "job %d canceled.\n", job_id); + printf("job %d canceled.\n", job_id); break; case IPP_JOB_ABORTED : - fprintf(stdout, "job %d aborted.\n", job_id); + printf("job %d aborted.\n", job_id); break; case IPP_JOB_COMPLETED : - fprintf(stdout, "job %d completed.\n", job_id); + printf("job %d completed.\n", job_id); break; } }