~ubuntu-branches/ubuntu/raring/hplip/raring-proposed

« back to all changes in this revision

Viewing changes to scan/sane/soapht.c

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-05-26 11:20:39 UTC
  • mfrom: (1.5.6) (31.1.3 precise)
  • Revision ID: package-import@ubuntu.com-20120526112039-bevxczegxnbyr5m7
Tags: 3.12.4-1
* New upstream release
* Switch to source/format 3.0 (quilt) - drop dpatch
* Refreshed debian/patches
* dh_autoreconf debian/autogen.sh & set local-options single-debian-patch
* Update to debian/compat -> 9
* Fix "hardened build flags" patch from Moritz - thanks (Closes: #667828)
* Fix "duplex descriptor uninitialized" patch from Matej (Closes: #583273)
* Fix "please migrate to kde-runtime" patch from Pino (Closes: #666544)

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
   int stat=1;
64
64
 
65
65
   /* Load hpmud manually with symbols exported. Otherwise the plugin will not find it. */ 
66
 
   if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
 
66
   if ((ps->hpmud_handle = dlopen("libhpmud.so", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
67
67
   {
68
 
      BUG("unable to load restricted library: %s\n", dlerror());
69
 
      goto bugout;
 
68
      if ((ps->hpmud_handle = dlopen("libhpmud.so.0", RTLD_LAZY|RTLD_GLOBAL)) == NULL)
 
69
      {
 
70
         BUG("unable to load restricted library: %s\n", dlerror());
 
71
         goto bugout;
 
72
      }
70
73
   } 
71
74
 
72
75
   /* Load math library manually with symbols exported (Ubuntu 8.04). Otherwise the plugin will not find it. */ 
912
915
   int stat, ret;
913
916
 
914
917
   DBG8("sane_hpaio_start()\n");
915
 
 
 
918
   
 
919
    ps -> user_cancel = 0;
 
920
    ps -> cnt = 0;
 
921
    ps -> index = 0;
 
922
  
916
923
   if (set_extents(ps))
917
924
   {
918
925
      BUG("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n",
928
935
      if (ret == 0)
929
936
      {
930
937
         stat = SANE_STATUS_NO_DOCS;     /* done scanning */
 
938
         SendScanEvent (ps->uri, EVENT_SCAN_ADF_NO_DOCS);
931
939
         goto bugout;
932
940
      }
933
941
      else if (ret < 0)
943
951
      stat = SANE_STATUS_IO_ERROR;
944
952
      goto bugout;
945
953
   }
946
 
 
 
954
   SendScanEvent(ps->uri, EVENT_START_SCAN_JOB);
947
955
   memset(xforms, 0, sizeof(xforms));    
948
956
 
949
957
   /* Setup image-processing pipeline for xform. */
1081
1089
   int ret, stat=SANE_STATUS_IO_ERROR;
1082
1090
 
1083
1091
   DBG8("sane_hpaio_read() handle=%p data=%p maxLength=%d\n", (void *)handle, data, maxLength);
1084
 
 
 
1092
   if(ps->user_cancel)
 
1093
   {
 
1094
     DBG8("soapht_read() EVENT_SCAN_CANCEL****uri=%s\n", ps->uri);
 
1095
     SendScanEvent(ps->uri, EVENT_SCAN_CANCEL);
 
1096
     return SANE_STATUS_CANCELLED;
 
1097
   }
 
1098
  
1085
1099
   ret = get_ip_data(ps, data, maxLength, length);
1086
1100
 
1087
1101
   if(ret & (IP_INPUT_ERROR | IP_FATAL_ERROR))
1091
1105
   }
1092
1106
 
1093
1107
   if (ret & IP_DONE)
 
1108
   {
1094
1109
      stat = SANE_STATUS_EOF;
 
1110
      SendScanEvent(ps->uri, EVENT_END_SCAN_JOB);
 
1111
   }
1095
1112
   else
1096
1113
      stat = SANE_STATUS_GOOD;
1097
1114
 
1122
1139
    * Sane_cancel is always called at the end of the scan job. Note that on a multiple page scan job 
1123
1140
    * sane_cancel is called only once.
1124
1141
    */
1125
 
 
 
1142
   ps -> user_cancel = 1;
1126
1143
   if (ps->ip_handle)
1127
1144
   {
1128
1145
      ipClose(ps->ip_handle);