~ubuntu-branches/ubuntu/raring/gtk+2.0/raring-proposed

« back to all changes in this revision

Viewing changes to modules/printbackends/cups/gtkcupsutils.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-07-29 12:02:36 UTC
  • mfrom: (1.14.13)
  • Revision ID: package-import@ubuntu.com-20120729120236-msbyj7ckzuhyp5ud
Tags: 2.24.11-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
  _get_read_data
84
84
};
85
85
 
 
86
#ifndef HAVE_CUPS_API_1_6
 
87
#define ippSetOperation(ipp_request, ipp_op_id) ipp_request->request.op.operation_id = ipp_op_id
 
88
#define ippSetRequestId(ipp_request, ipp_rq_id) ipp_request->request.op.request_id = ipp_rq_id
 
89
#define ippSetState(ipp_request, ipp_state) ipp_request->state = ipp_state
 
90
#define ippGetString(attr, index, foo) attr->values[index].string.text
 
91
#define ippGetCount(attr) attr->num_values
 
92
#endif
 
93
 
86
94
static void
87
95
gtk_cups_result_set_error (GtkCupsResult    *result,
88
96
                           GtkCupsErrorType  error_type,
165
173
  request->data_io = data_io;
166
174
 
167
175
  request->ipp_request = ippNew ();
168
 
  request->ipp_request->request.op.operation_id = operation_id;
169
 
  request->ipp_request->request.op.request_id = 1;
 
176
  ippSetOperation (request->ipp_request, operation_id);
 
177
  ippSetRequestId (request->ipp_request, 1);
170
178
 
171
179
  language = cupsLangDefault ();
172
180
 
352
360
                                  name,
353
361
                                  tag);
354
362
 
355
 
  if (attribute != NULL && attribute->values != NULL)
356
 
    return attribute->values[0].string.text;
 
363
  if (attribute != NULL && ippGetCount (attribute) > 0)
 
364
      return ippGetString (attribute, 0, NULL);
357
365
  else
358
366
    return NULL;
359
367
}
731
739
    request->attempts = 0;
732
740
 
733
741
    request->state = GTK_CUPS_POST_WRITE_REQUEST;
734
 
    request->ipp_request->state = IPP_IDLE;
 
742
    ippSetState (request->ipp_request, IPP_IDLE);
735
743
}
736
744
 
737
745
static void 
1223
1231
  request->state = GTK_CUPS_GET_CHECK;
1224
1232
  request->poll_state = GTK_CUPS_HTTP_READ;
1225
1233
  
1226
 
  request->ipp_request->state = IPP_IDLE;
 
1234
  ippSetState (request->ipp_request, IPP_IDLE);
1227
1235
}
1228
1236
 
1229
1237
static void