]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/array.c
License change: Apache License, Version 2.0.
[thirdparty/cups.git] / cups / array.c
index 0f04eab0aa12733c8a682a6c8cd88950c71627b6..b2ec00104daf5c20fa7d354c7dad3d4436274ca3 100644 (file)
@@ -1,24 +1,17 @@
 /*
- * "$Id$"
- *
  * Sorted array routines for CUPS.
  *
  * Copyright 2007-2014 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products.
  *
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- * which should have been included with this file.  If this file is
- * file is missing or damaged, see the license at "http://www.cups.org/".
- *
- * This file is subject to the Apple OS-Developed Software exception.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
  */
 
 /*
  * Include necessary headers...
  */
 
+#include <cups/cups.h>
 #include "string-private.h"
 #include "debug-private.h"
 #include "array-private.h"
@@ -78,14 +71,14 @@ static int  cups_array_find(cups_array_t *a, void *e, int prev, int *rdiff);
  * appended at the end of the run of identical elements.  For unsorted arrays,
  * the element is appended to the end of the array.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
 cupsArrayAdd(cups_array_t *a,          /* I - Array */
              void         *e)          /* I - Element */
 {
-  DEBUG_printf(("2cupsArrayAdd(a=%p, e=%p)", a, e));
+  DEBUG_printf(("2cupsArrayAdd(a=%p, e=%p)", (void *)a, e));
 
  /*
   * Range check input...
@@ -124,8 +117,7 @@ _cupsArrayAddStrings(cups_array_t *a,       /* I - Array */
   int          status = 1;             /* Status of add */
 
 
-  DEBUG_printf(("_cupsArrayAddStrings(a=%p, s=\"%s\", delim='%c')", a, s,
-                delim));
+  DEBUG_printf(("_cupsArrayAddStrings(a=%p, s=\"%s\", delim='%c')", (void *)a, s, delim));
 
   if (!a || !s || !*s)
   {
@@ -209,7 +201,7 @@ _cupsArrayAddStrings(cups_array_t *a,       /* I - Array */
  * The caller is responsible for freeing the memory used by the
  * elements themselves.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void
@@ -251,7 +243,7 @@ cupsArrayClear(cups_array_t *a)             /* I - Array */
 /*
  * 'cupsArrayCount()' - Get the number of elements in the array.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 int                                    /* O - Number of elements */
@@ -278,7 +270,7 @@ cupsArrayCount(cups_array_t *a)             /* I - Array */
  * The current element is undefined until you call @link cupsArrayFind@,
  * @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void *                                 /* O - Element */
@@ -308,7 +300,7 @@ cupsArrayCurrent(cups_array_t *a)   /* I - Array */
  * The caller is responsible for freeing the memory used by the
  * elements themselves.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void
@@ -352,7 +344,7 @@ cupsArrayDelete(cups_array_t *a)    /* I - Array */
 /*
  * 'cupsArrayDup()' - Duplicate the array.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 cups_array_t *                         /* O - Duplicate array */
@@ -437,7 +429,7 @@ cupsArrayDup(cups_array_t *a)               /* I - Array */
 /*
  * 'cupsArrayFind()' - Find an element in the array.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void *                                 /* O - Element found or @code NULL@ */
@@ -532,7 +524,7 @@ cupsArrayFind(cups_array_t *a,              /* I - Array */
 /*
  * 'cupsArrayFirst()' - Get the first element in the array.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void *                                 /* O - First element or @code NULL@ if the array is empty */
@@ -561,7 +553,7 @@ cupsArrayFirst(cups_array_t *a)             /* I - Array */
  * The current element is undefined until you call @link cupsArrayFind@,
  * @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@.
  *
- * @since CUPS 1.3/OS X 10.5@
+ * @since CUPS 1.3/macOS 10.5@
  */
 
 int                                    /* O - Index of the current element, starting at 0 */
@@ -577,7 +569,7 @@ cupsArrayGetIndex(cups_array_t *a)  /* I - Array */
 /*
  * 'cupsArrayGetInsert()' - Get the index of the last inserted element.
  *
- * @since CUPS 1.3/OS X 10.5@
+ * @since CUPS 1.3/macOS 10.5@
  */
 
 int                                    /* O - Index of the last inserted element, starting at 0 */
@@ -593,7 +585,7 @@ cupsArrayGetInsert(cups_array_t *a) /* I - Array */
 /*
  * 'cupsArrayIndex()' - Get the N-th element in the array.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void *                                 /* O - N-th element or @code NULL@ */
@@ -616,14 +608,14 @@ cupsArrayIndex(cups_array_t *a,           /* I - Array */
  * inserted at the beginning of the run of identical elements.  For unsorted
  * arrays, the element is inserted at the beginning of the array.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 int                                    /* O - 0 on failure, 1 on success */
 cupsArrayInsert(cups_array_t *a,       /* I - Array */
                void         *e)        /* I - Element */
 {
-  DEBUG_printf(("2cupsArrayInsert(a=%p, e=%p)", a, e));
+  DEBUG_printf(("2cupsArrayInsert(a=%p, e=%p)", (void *)a, e));
 
  /*
   * Range check input...
@@ -646,7 +638,7 @@ cupsArrayInsert(cups_array_t *a,    /* I - Array */
 /*
  * 'cupsArrayLast()' - Get the last element in the array.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void *                                 /* O - Last element or @code NULL@ if the array is empty */
@@ -677,7 +669,7 @@ cupsArrayLast(cups_array_t *a)              /* I - Array */
  * data pointer argument can safely be omitted when not required so functions
  * like @code strcmp@ can be used for sorted string arrays.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 cups_array_t *                         /* O - Array */
@@ -699,7 +691,7 @@ cupsArrayNew(cups_array_func_t f,   /* I - Comparison function or @code NULL@ for
  * The hash function ("h") is used to implement cached lookups with the
  * specified hash size ("hsize").
  *
- * @since CUPS 1.3/OS X 10.5@
+ * @since CUPS 1.3/macOS 10.5@
  */
 
 cups_array_t *                         /* O - Array */
@@ -729,7 +721,7 @@ cupsArrayNew2(cups_array_func_t  f, /* I - Comparison function or @code NULL@ fo
  * The free function ("cf") is used to automatically free/release elements when
  * removed or the array is deleted.
  *
- * @since CUPS 1.5/OS X 10.7@
+ * @since CUPS 1.5/macOS 10.7@
  */
 
 cups_array_t *                         /* O - Array */
@@ -813,7 +805,7 @@ _cupsArrayNewStrings(const char *s, /* I - Delimited strings or NULL */
  * @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@
  * to set the current element.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void *                                 /* O - Next element or @code NULL@ */
@@ -846,7 +838,7 @@ cupsArrayNext(cups_array_t *a)              /* I - Array */
  * @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@
  * to set the current element.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void *                                 /* O - Previous element or @code NULL@ */
@@ -879,7 +871,7 @@ cupsArrayPrev(cups_array_t *a)              /* I - Array */
  * The caller is responsible for freeing the memory used by the
  * removed element.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
@@ -944,7 +936,7 @@ cupsArrayRemove(cups_array_t *a,    /* I - Array */
 /*
  * 'cupsArrayRestore()' - Reset the current element to the last @link cupsArraySave@.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void *                                 /* O - New current element */
@@ -975,7 +967,7 @@ cupsArrayRestore(cups_array_t *a)   /* I - Array */
  *
  * The save/restore stack is guaranteed to be at least 32 elements deep.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
@@ -997,7 +989,7 @@ cupsArraySave(cups_array_t *a)              /* I - Array */
 /*
  * 'cupsArrayUserData()' - Return the user data for an array.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 void *                                 /* O - User data */
@@ -1013,7 +1005,7 @@ cupsArrayUserData(cups_array_t *a)        /* I - Array */
 /*
  * 'cups_array_add()' - Insert or append an element to the array.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 static int                             /* O - 1 on success, 0 on failure */
@@ -1026,7 +1018,7 @@ cups_array_add(cups_array_t *a,           /* I - Array */
   int          diff;                   /* Comparison with current element */
 
 
-  DEBUG_printf(("7cups_array_add(a=%p, e=%p, insert=%d)", a, e, insert));
+  DEBUG_printf(("7cups_array_add(a=%p, e=%p, insert=%d)", (void *)a, e, insert));
 
  /*
   * Verify we have room for the new element...
@@ -1206,8 +1198,7 @@ cups_array_find(cups_array_t *a,  /* I - Array */
        diff;                           /* Comparison with current element */
 
 
-  DEBUG_printf(("7cups_array_find(a=%p, e=%p, prev=%d, rdiff=%p)", a, e, prev,
-                rdiff));
+  DEBUG_printf(("7cups_array_find(a=%p, e=%p, prev=%d, rdiff=%p)", (void *)a, e, prev, (void *)rdiff));
 
   if (a->compare)
   {
@@ -1326,8 +1317,3 @@ cups_array_find(cups_array_t *a,  /* I - Array */
 
   return (current);
 }
-
-
-/*
- * End of "$Id$".
- */