#ifndef _PAPI_IMPL_H
#define _PAPI_IMPL_H
#include <papi.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <time.h>
#include <sys/types.h>
#include <stdarg.h>
#include <uri.h>
typedef struct {
papi_attribute_t **attributes;
} printer_t;
typedef struct job {
papi_attribute_t **attributes;
} job_t;
typedef struct stream {
job_t *job;
int fd;
char *metadata;
char *dfname;
} stream_t;
typedef struct {
time_t timestamp;
printer_t *printer;
job_t **jobs;
} cache_t;
typedef struct {
papi_attribute_t **attributes;
uri_t *uri;
cache_t *cache;
int (*authCB)(papi_service_t svc, void *app_data);
void *app_data;
} service_t;
extern papi_status_t service_fill_in(service_t *svc, char *name);
extern void detailed_error(service_t *svc, char *fmt, ...);
extern char *queue_name_from_uri(uri_t *uri);
extern char *fdgets(char *buf, size_t len, int fd);
extern int lpd_open(service_t *svc, char type, char **args,
int timeout);
extern papi_status_t lpd_purge_jobs(service_t *svc, job_t ***jobs);
extern papi_status_t lpd_cancel_job(service_t *svc, int job_id);
extern papi_status_t lpd_submit_job(service_t *svc, char *metadata,
papi_attribute_t ***attributes, int *fd);
extern papi_status_t lpd_job_add_attributes(service_t *svc,
papi_attribute_t **attributes,
char **metadata,
papi_attribute_t ***used_attributes);
extern papi_status_t lpd_job_add_files(service_t *svc,
papi_attribute_t **attributes, char **files,
char **metadata,
papi_attribute_t ***used_attributes);
extern papi_status_t lpd_find_printer_info(service_t *svc, printer_t **result);
extern papi_status_t lpd_find_job_info(service_t *svc, int job_id, job_t **job);
extern papi_status_t lpd_find_jobs_info(service_t *svc, job_t ***jobs);
#ifdef __cplusplus
}
#endif
#endif