Lines Matching refs:priv
99 static void _cleanup_plugin_data(plugin_data_t *priv) { in _cleanup_plugin_data() argument
100 if (priv != NULL) { in _cleanup_plugin_data()
101 if (priv->msgQ != MSG_Q_INVALID_ID) { in _cleanup_plugin_data()
102 priv->job_info.wprint_ifc->msgQDelete(priv->msgQ); in _cleanup_plugin_data()
104 sem_destroy(&priv->buffs_sem); in _cleanup_plugin_data()
105 free(priv); in _cleanup_plugin_data()
114 plugin_data_t *priv = (plugin_data_t *) param; in _send_thread() local
116 while (priv->job_info.wprint_ifc->msgQReceive(priv->msgQ, (char *) &msg, sizeof(msgQ_msg_t), in _send_thread()
119 priv->pcl_ifc->start_job(priv->job_handle, &priv->job_info, in _send_thread()
120 priv->job_params->media_size, priv->job_params->media_type, in _send_thread()
121 priv->job_params->pixel_units, priv->job_params->duplex, in _send_thread()
122 priv->job_params->dry_time, priv->job_params->color_space, in _send_thread()
123 priv->job_params->media_tray, priv->job_params->page_top_margin, in _send_thread()
124 priv->job_params->page_left_margin); in _send_thread()
126 priv->pcl_ifc->start_page(&priv->job_info, msg.param.start_page.width, in _send_thread()
129 if (!priv->pcl_ifc->canCancelMidPage() || !priv->job_params->cancelled) { in _send_thread()
130 priv->pcl_ifc->print_swath(&priv->job_info, msg.param.send.buffer, in _send_thread()
134 sem_post(&priv->buffs_sem); in _send_thread()
137 priv->pcl_ifc->end_page(&priv->job_info, msg.param.end_page.page); in _send_thread()
144 priv->pcl_ifc->end_job(&priv->job_info); in _send_thread()
197 static status_t _stop_thread(plugin_data_t *priv) { in _stop_thread() argument
199 if (priv == NULL) { in _stop_thread()
202 if (!pthread_equal(priv->send_tid, pthread_self())) { in _stop_thread()
206 priv->job_info.wprint_ifc->msgQSend( in _stop_thread()
207 priv->msgQ, (char *) &msg, sizeof(msgQ_msg_t), NO_WAIT, MSG_Q_FIFO); in _stop_thread()
208 pthread_join(priv->send_tid, 0); in _stop_thread()
209 priv->send_tid = pthread_self(); in _stop_thread()
212 _cleanup_plugin_data(priv); in _stop_thread()
219 plugin_data_t *priv = NULL; in _start_job() local
227 priv = (plugin_data_t *) malloc(sizeof(plugin_data_t)); in _start_job()
228 if (priv == NULL) continue; in _start_job()
230 memset(priv, 0, sizeof(plugin_data_t)); in _start_job()
232 priv->job_handle = job_handle; in _start_job()
233 priv->job_params = job_params; in _start_job()
234 priv->send_tid = pthread_self(); in _start_job()
235 priv->job_info.job_handle = _WJOBH_NONE; in _start_job()
236 priv->job_info.print_ifc = (ifc_print_job_t *) print_ifc_p; in _start_job()
237 priv->job_info.wprint_ifc = (ifc_wprint_t *) wprint_ifc_p; in _start_job()
238 priv->job_info.strip_height = job_params->strip_height; in _start_job()
239 priv->job_info.useragent = job_params->useragent; in _start_job()
241 sem_init(&priv->buffs_sem, 0, MAX_SEND_BUFFS); in _start_job()
244 priv->pcl_ifc = pclm_connect(); in _start_job()
247 priv->pcl_ifc = pwg_connect(); in _start_job()
253 if (priv->pcl_ifc == NULL) { in _start_job()
258 priv->msgQ = priv->job_info.wprint_ifc->msgQCreate( in _start_job()
260 if (priv->msgQ == MSG_Q_INVALID_ID) continue; in _start_job()
262 if (_start_thread(priv) == ERROR) continue; in _start_job()
264 job_params->plugin_data = (void *) priv; in _start_job()
266 priv->job_info.wprint_ifc->msgQSend( in _start_job()
267 priv->msgQ, (char *) &msg, sizeof(msgQ_msg_t), NO_WAIT, MSG_Q_FIFO); in _start_job()
272 _cleanup_plugin_data(priv); in _start_job()
288 plugin_data_t *priv; in _print_page() local
294 priv = (plugin_data_t *) job_params->plugin_data; in _print_page()
296 if (priv == NULL) return ERROR; in _print_page()
319 wprint_image_setup(image_info, mime_type, priv->job_info.wprint_ifc, in _print_page()
384 priv->job_info.num_components = image_info->num_components; in _print_page()
385 priv->job_info.wprint_ifc->msgQSend(priv->msgQ, (char *) &msg, in _print_page()
399 if (priv->pcl_ifc->canCancelMidPage() && job_params->cancelled) { in _print_page()
402 sem_wait(&priv->buffs_sem); in _print_page()
426 result = priv->job_info.wprint_ifc->msgQSend(priv->msgQ, (char *) &msg, in _print_page()
429 sem_post(&priv->buffs_sem); in _print_page()
435 sem_post(&priv->buffs_sem); in _print_page()
494 priv->job_info.wprint_ifc->msgQSend(priv->msgQ, (char *) &msg, sizeof(msgQ_msg_t), NO_WAIT, in _print_page()
504 plugin_data_t *priv; in _print_blank_page() local
508 priv = (plugin_data_t *) job_params->plugin_data; in _print_blank_page()
509 if (priv == NULL) return ERROR; in _print_blank_page()
514 priv->job_info.wprint_ifc->msgQSend(priv->msgQ, (char *) &msg, sizeof(msgQ_msg_t), NO_WAIT, in _print_blank_page()