Print this page
2837 - remove print/lp* from gate and use CUPS from userland

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/print/libpapi-common/common/attribute.c
          +++ new/usr/src/lib/print/libpapi-common/common/attribute.c
↓ open down ↓ 195 lines elided ↑ open up ↑
 196  196                  default:        /* unknown type, fail to duplicate */
 197  197                          free(result);
 198  198                          result = NULL;
 199  199                  }
 200  200          }
 201  201  
 202  202          return (result);
 203  203  }
 204  204  
 205  205  static papi_attribute_t *
 206      -papiAttributeAlloc(char *name, papi_attribute_value_type_t type)
      206 +papiAttributeAlloc(const char *name, papi_attribute_value_type_t type)
 207  207  {
 208  208          papi_attribute_t *result = NULL;
 209  209  
 210  210          if ((result = calloc(1, sizeof (*result))) != NULL) {
 211  211                  result->name = strdup(name);
 212  212                  result->type = type;
 213  213          }
 214  214  
 215  215          return (result);
 216  216  }
↓ open down ↓ 14 lines elided ↑ open up ↑
 231  231                          return (PAPI_TEMPORARY_ERROR);
 232  232  
 233  233                  list_append(values, tmp);
 234  234          }
 235  235  
 236  236          return (PAPI_OK);
 237  237  }
 238  238  
 239  239  papi_status_t
 240  240  papiAttributeListAddValue(papi_attribute_t ***list, int flgs,
 241      -                char *name, papi_attribute_value_type_t type,
      241 +                const char *name, papi_attribute_value_type_t type,
 242  242                  papi_attribute_value_t *value)
 243  243  {
 244  244          papi_status_t result;
 245  245          int flags = flgs;
 246  246          papi_attribute_t *attribute = NULL;
 247  247          papi_attribute_value_t **values = NULL;
 248  248  
 249  249          if ((list == NULL) || (name == NULL))
 250  250                  return (PAPI_BAD_ARGUMENT);
 251  251  
↓ open down ↓ 59 lines elided ↑ open up ↑
 311  311                          char *name, int integer)
 312  312  {
 313  313          papi_attribute_value_t v;
 314  314  
 315  315          v.integer = integer;
 316  316          return (papiAttributeListAddValue(list, flags, name, PAPI_INTEGER, &v));
 317  317  }
 318  318  
 319  319  papi_status_t
 320  320  papiAttributeListAddBoolean(papi_attribute_t ***list, int flags,
 321      -                        char *name, char boolean)
      321 +                        const char *name, char boolean)
 322  322  {
 323  323          papi_attribute_value_t v;
 324  324  
 325  325          v.boolean = boolean;
 326  326          return (papiAttributeListAddValue(list, flags, name, PAPI_BOOLEAN, &v));
 327  327  }
 328  328  
 329  329  papi_status_t
 330  330  papiAttributeListAddRange(papi_attribute_t ***list, int flags,
 331  331                          char *name, int lower, int upper)
↓ open down ↓ 63 lines elided ↑ open up ↑
 395  395          if ((attribute = papiAttributeListFind(*list, name)) == NULL)
 396  396                  return (PAPI_NOT_FOUND);
 397  397  
 398  398          list_remove(list, attribute);
 399  399          papiAttributeFree(attribute);
 400  400  
 401  401          return (PAPI_OK);
 402  402  }
 403  403  
 404  404  papi_attribute_t *
 405      -papiAttributeListFind(papi_attribute_t **list, char *name)
      405 +papiAttributeListFind(papi_attribute_t **list, const char *name)
 406  406  {
 407  407          int i;
 408  408          if ((list == NULL) || (name == NULL))
 409  409                  return (NULL);
 410  410  
 411  411          for (i = 0; list[i] != NULL; i++)
 412  412                  if (strcasecmp(list[i]->name, name) == 0)
 413  413                          return ((papi_attribute_t *)list[i]);
 414  414  
 415  415          return (NULL);
↓ open down ↓ 704 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX