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/libipp-listener/common/ipp-listener.c
          +++ new/usr/src/lib/print/libipp-listener/common/ipp-listener.c
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   *
  26   26   */
  27   27  
  28   28  /* $Id: ipp-listener.c 146 2006-03-24 00:26:54Z njacobs $ */
  29   29  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   30  #include <stdio.h>
  33   31  #include <stdlib.h>
  34   32  #include <string.h>
  35   33  #include <netinet/in.h>
  36   34  #include <assert.h>
  37   35  #include <errno.h>
  38   36  #include <syslog.h>
  39   37  #include <sys/types.h>
  40   38  #include <sys/stat.h>
  41   39  #include <fcntl.h>
↓ open down ↓ 102 lines elided ↑ open up ↑
 144  142                                                                  OP_VENDOR },
 145  143          { 0x4008, "cups-accept-jobs",           cups_accept_jobs,
 146  144                                                                  OP_VENDOR },
 147  145          { 0x4009, "cups-reject-jobs",           cups_reject_jobs,
 148  146                                                                  OP_VENDOR },
 149  147          { 0x400D, "cups-move-job",              cups_move_job,  OP_VENDOR },
 150  148          { 0, NULL, NULL, OP_VENDOR }
 151  149  };
 152  150  
 153  151  static int
 154      -ipp_operation_name_to_index(char *name)
      152 +ipp_operation_name_to_index(const char *name)
 155  153  {
 156  154          int i;
 157  155  
 158  156          for (i = 0; handlers[i].name != NULL; i++)
 159  157                  if (strcasecmp(name, handlers[i].name) == 0)
 160  158                          return (i);
 161  159  
 162  160          return (-1);
 163  161  }
 164  162  
↓ open down ↓ 61 lines elided ↑ open up ↑
 226  224                  ipp_set_status(response, PAPI_OPERATION_NOT_SUPPORTED,
 227  225                          "operation (%s 0x%4.4x) not enabled on server",
 228  226                          handlers[index].name, id);
 229  227                  return (default_handler);
 230  228          }
 231  229  
 232  230          return (handlers[index].function);
 233  231  }
 234  232  
 235  233  static char
 236      -type_to_boolean(char *type)
      234 +type_to_boolean(const char *type)
 237  235  {
 238  236          char result = PAPI_FALSE;
 239  237  
 240  238          if ((strcasecmp(type, "true") == 0) ||
 241  239              (strcasecmp(type, "yes") == 0) ||
 242  240              (strcasecmp(type, "on") == 0) ||
 243  241              (strcasecmp(type, "enable") == 0))
 244  242                  result = PAPI_TRUE;
 245  243  
 246  244          return (result);
↓ open down ↓ 22 lines elided ↑ open up ↑
 269  267          int i;
 270  268  
 271  269          for (i = 0; ((result == PAPI_OK) && (handlers[i].name != NULL)); i++)
 272  270                  result = papiAttributeListAddBoolean(list, PAPI_ATTR_REPLACE,
 273  271                                  handlers[i].name, boolean);
 274  272  
 275  273          return (result);
 276  274  }
 277  275  
 278  276  papi_status_t
 279      -ipp_configure_operation(papi_attribute_t ***list, char *operation, char *type)
      277 +ipp_configure_operation(papi_attribute_t ***list, const char *operation, const char *type)
 280  278  {
 281  279          papi_status_t result = PAPI_OPERATION_NOT_SUPPORTED;
 282  280          char boolean = PAPI_FALSE;
 283  281  
 284  282          if ((list == NULL) || (operation == NULL) || (type == NULL))
 285  283                  return (PAPI_BAD_ARGUMENT);
 286  284  
 287  285          boolean = type_to_boolean(type);
 288  286  
 289  287          if (strcasecmp(operation, "all") == 0) {
↓ open down ↓ 231 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX