Print this page
Bump Apache dependency to Apache 2

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