]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add API versioning definitions so that Mac OS X developers can identify
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 19 Oct 2007 00:57:45 +0000 (00:57 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 19 Oct 2007 00:57:45 +0000 (00:57 +0000)
functions that are not available in particular releases.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@7026 7a7537e8-13f0-0310-91df-b6672ffda945

13 files changed:
Makedefs.in
cups/adminutil.h
cups/array.h
cups/backend.h
cups/cups.h
cups/dir.h
cups/file.h
cups/http.h
cups/ipp.h
cups/ppd.h
cups/sidechannel.h
cups/transcode.h
cups/versioning.h [new file with mode: 0644]

index 3ed5cd3198dabbacf1c9342275902f1a442bdce8..fdd907fc409d36ad8f6140e1ac935bf00d8e2cdd 100644 (file)
@@ -113,11 +113,11 @@ ALL_CFLAGS        =       $(CFLAGS) $(SSLFLAGS) @LARGEFILE@ @PTHREAD_FLAGS@ \
 ARCHFLAGS      =       @ARCHFLAGS@
 ARFLAGS                =       @ARFLAGS@
 BACKLIBS       =       @BACKLIBS@
-CFLAGS         =       -I.. @CPPFLAGS@ @CFLAGS@ \
+CFLAGS         =       -I.. -D_CUPS_SOURCE @CPPFLAGS@ @CFLAGS@ \
                        @LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
 COMMONLIBS     =       @LIBS@
 CUPSDLIBS      =       @CUPSDLIBS@
-CXXFLAGS       =       -I.. $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
+CXXFLAGS       =       -I.. -D_CUPS_SOURCE $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
                        @LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
 CXXLIBS                =       @CXXLIBS@
 DSOFLAGS       =       @DSOFLAGS@
index 36fd2842ff8197825922c0373781ca82d61c88c7..13b37fad48fc9d629ea6e0b3b2af8201eaec69cf 100644 (file)
@@ -58,16 +58,16 @@ extern int  cupsAdminExportSamba(const char *dest, const char *ppd,
                                     const char *samba_server,
                                     const char *samba_user,
                                     const char *samba_password,
-                                    FILE *logfile);
+                                    FILE *logfile) _CUPS_API_1_2;
 extern char    *cupsAdminCreateWindowsPPD(http_t *http, const char *dest,
-                                          char *buffer, int bufsize);
+                                          char *buffer, int bufsize) _CUPS_API_1_2;
 
 extern int     cupsAdminGetServerSettings(http_t *http,
                                           int *num_settings,
-                                          cups_option_t **settings);
+                                          cups_option_t **settings) _CUPS_API_1_3;
 extern int     cupsAdminSetServerSettings(http_t *http,
                                           int num_settings,
-                                          cups_option_t *settings);
+                                          cups_option_t *settings) _CUPS_API_1_3;
 
 
 #  ifdef __cplusplus
index b16983300812e05a982ddfb4d7ee953728acc381..2323a06ed329e1ce7925ff15bdaadb9087caecab 100644 (file)
@@ -22,6 +22,7 @@
  * Include necessary headers...
  */
 
+#  include "versioning.h"
 #  include <stdlib.h>
 
 
@@ -50,28 +51,28 @@ typedef int (*cups_ahash_func_t)(void *element, void *data);
  * Functions...
  */
 
-extern int             cupsArrayAdd(cups_array_t *a, void *e);
-extern void            cupsArrayClear(cups_array_t *a);
-extern int             cupsArrayCount(cups_array_t *a);
-extern void            *cupsArrayCurrent(cups_array_t *a);
-extern void            cupsArrayDelete(cups_array_t *a);
-extern cups_array_t    *cupsArrayDup(cups_array_t *a);
-extern void            *cupsArrayFind(cups_array_t *a, void *e);
-extern void            *cupsArrayFirst(cups_array_t *a);
-extern int             cupsArrayGetIndex(cups_array_t *a);
-extern int             cupsArrayGetInsert(cups_array_t *a);
-extern void            *cupsArrayIndex(cups_array_t *a, int n);
-extern int             cupsArrayInsert(cups_array_t *a, void *e);
-extern void            *cupsArrayLast(cups_array_t *a);
-extern cups_array_t    *cupsArrayNew(cups_array_func_t f, void *d);
+extern int             cupsArrayAdd(cups_array_t *a, void *e) _CUPS_API_1_2;
+extern void            cupsArrayClear(cups_array_t *a) _CUPS_API_1_2;
+extern int             cupsArrayCount(cups_array_t *a) _CUPS_API_1_2;
+extern void            *cupsArrayCurrent(cups_array_t *a) _CUPS_API_1_2;
+extern void            cupsArrayDelete(cups_array_t *a) _CUPS_API_1_2;
+extern cups_array_t    *cupsArrayDup(cups_array_t *a) _CUPS_API_1_2;
+extern void            *cupsArrayFind(cups_array_t *a, void *e) _CUPS_API_1_2;
+extern void            *cupsArrayFirst(cups_array_t *a) _CUPS_API_1_2;
+extern int             cupsArrayGetIndex(cups_array_t *a) _CUPS_API_1_3;
+extern int             cupsArrayGetInsert(cups_array_t *a) _CUPS_API_1_3;
+extern void            *cupsArrayIndex(cups_array_t *a, int n) _CUPS_API_1_2;
+extern int             cupsArrayInsert(cups_array_t *a, void *e) _CUPS_API_1_2;
+extern void            *cupsArrayLast(cups_array_t *a) _CUPS_API_1_2;
+extern cups_array_t    *cupsArrayNew(cups_array_func_t f, void *d) _CUPS_API_1_2;
 extern cups_array_t    *cupsArrayNew2(cups_array_func_t f, void *d,
-                                      cups_ahash_func_t h, int hsize);
-extern void            *cupsArrayNext(cups_array_t *a);
-extern void            *cupsArrayPrev(cups_array_t *a);
-extern int             cupsArrayRemove(cups_array_t *a, void *e);
-extern void            *cupsArrayRestore(cups_array_t *a);
-extern int             cupsArraySave(cups_array_t *a);
-extern void            *cupsArrayUserData(cups_array_t *a);
+                                      cups_ahash_func_t h, int hsize) _CUPS_API_1_3;
+extern void            *cupsArrayNext(cups_array_t *a) _CUPS_API_1_2;
+extern void            *cupsArrayPrev(cups_array_t *a) _CUPS_API_1_2;
+extern int             cupsArrayRemove(cups_array_t *a, void *e) _CUPS_API_1_2;
+extern void            *cupsArrayRestore(cups_array_t *a) _CUPS_API_1_2;
+extern int             cupsArraySave(cups_array_t *a) _CUPS_API_1_2;
+extern void            *cupsArrayUserData(cups_array_t *a) _CUPS_API_1_2;
 
 #  ifdef __cplusplus
 }
index 2b1219637e247f9dda8ee34dd87570b44292c1b6..04131fac7c10a43af57455597cca4140a8dac4e8 100644 (file)
 #  define _CUPS_BACKEND_H_
 
 
+/*
+ * Include necessary headers...
+ */
+
+#  include "versioning.h"
+
+
 /*
  * Constants...
  */
@@ -38,7 +45,7 @@ typedef enum cups_backend_e           /**** Backend exit codes ****/
  * Prototypes...
  */
 
-extern const char      *cupsBackendDeviceURI(char **argv);
+extern const char      *cupsBackendDeviceURI(char **argv) _CUPS_API_1_2;
 
 
 #endif /* !_CUPS_BACKEND_H_ */
index dc7740a9e1bfb0e648e4439a1f486bd8fc6495ff..e020b7c8a7c47b43fba008c39b52af94c2ac8947 100644 (file)
@@ -194,64 +194,64 @@ extern const char *cupsUser(void);
 
 /**** New in CUPS 1.1.20 ****/
 extern int             cupsDoAuthentication(http_t *http, const char *method,
-                                            const char *resource);
+                                            const char *resource) _CUPS_API_1_1_20;
 extern http_status_t   cupsGetFile(http_t *http, const char *resource,
-                                   const char *filename);
+                                   const char *filename) _CUPS_API_1_1_20;
 extern http_status_t   cupsGetFd(http_t *http, const char *resource, int fd);
 extern http_status_t   cupsPutFile(http_t *http, const char *resource,
-                                   const char *filename);
-extern http_status_t   cupsPutFd(http_t *http, const char *resource, int fd);
+                                   const char *filename) _CUPS_API_1_1_20;
+extern http_status_t   cupsPutFd(http_t *http, const char *resource, int fd) _CUPS_API_1_1_20;
 
 /**** New in CUPS 1.1.21 ****/
-extern const char      *cupsGetDefault2(http_t *http);
-extern int             cupsGetDests2(http_t *http, cups_dest_t **dests);
+extern const char      *cupsGetDefault2(http_t *http) _CUPS_API_1_1_21;
+extern int             cupsGetDests2(http_t *http, cups_dest_t **dests) _CUPS_API_1_1_21;
 extern int             cupsGetJobs2(http_t *http, cups_job_t **jobs,
                                     const char *dest, int myjobs,
-                                    int completed);
-extern const char      *cupsGetPPD2(http_t *http, const char *printer);
+                                    int completed) _CUPS_API_1_1_21;
+extern const char      *cupsGetPPD2(http_t *http, const char *printer) _CUPS_API_1_1_21;
 extern int             cupsPrintFile2(http_t *http, const char *printer,
                                       const char *filename,
                                       const char *title, int num_options,
-                                      cups_option_t *options);
+                                      cups_option_t *options) _CUPS_API_1_1_21;
 extern int             cupsPrintFiles2(http_t *http, const char *printer,
                                        int num_files, const char **files,
                                        const char *title, int num_options,
-                                       cups_option_t *options);
+                                       cups_option_t *options) _CUPS_API_1_1_21;
 extern int             cupsSetDests2(http_t *http, int num_dests,
-                                     cups_dest_t *dests);
+                                     cups_dest_t *dests) _CUPS_API_1_1_21;
 
 /**** New in CUPS 1.2 ****/
 extern ssize_t         cupsBackChannelRead(char *buffer, size_t bytes,
-                                           double timeout);
+                                           double timeout) _CUPS_API_1_2;
 extern ssize_t         cupsBackChannelWrite(const char *buffer, size_t bytes,
-                                            double timeout);
+                                            double timeout) _CUPS_API_1_2;
 extern void            cupsEncodeOptions2(ipp_t *ipp, int num_options,
                                           cups_option_t *options,
-                                          ipp_tag_t group_tag);
-extern const char      *cupsLastErrorString(void);
-extern char            *cupsNotifySubject(cups_lang_t *lang, ipp_t *event);
-extern char            *cupsNotifyText(cups_lang_t *lang, ipp_t *event);
+                                          ipp_tag_t group_tag) _CUPS_API_1_2;
+extern const char      *cupsLastErrorString(void) _CUPS_API_1_2;
+extern char            *cupsNotifySubject(cups_lang_t *lang, ipp_t *event) _CUPS_API_1_2;
+extern char            *cupsNotifyText(cups_lang_t *lang, ipp_t *event) _CUPS_API_1_2;
 extern int             cupsRemoveOption(const char *name, int num_options,
-                                        cups_option_t **options);
-extern cups_file_t     *cupsTempFile2(char *filename, int len);
+                                        cups_option_t **options) _CUPS_API_1_2;
+extern cups_file_t     *cupsTempFile2(char *filename, int len) _CUPS_API_1_2;
 
 /**** New in CUPS 1.3 ****/
 extern ipp_t           *cupsDoIORequest(http_t *http, ipp_t *request,
                                         const char *resource, int infile,
-                                        int outfile);
-extern char            *cupsGetServerPPD(http_t *http, const char *name);
+                                        int outfile) _CUPS_API_1_3;
+extern char            *cupsGetServerPPD(http_t *http, const char *name) _CUPS_API_1_3;
 extern int             cupsRemoveDest(const char *name,
                                       const char *instance,
-                                      int num_dests, cups_dest_t **dests);
+                                      int num_dests, cups_dest_t **dests) _CUPS_API_1_3;
 extern void            cupsSetDefaultDest(const char *name,
                                           const char *instance,
                                           int num_dests,
-                                          cups_dest_t *dests);
+                                          cups_dest_t *dests) _CUPS_API_1_3;
 
 /**** New in CUPS 1.4 ****/
 extern http_status_t   cupsGetPPD3(http_t *http, const char *name,
                                    time_t *modtime, char *buffer,
-                                   size_t bufsize);
+                                   size_t bufsize) _CUPS_API_1_4;
 
 #  ifdef __cplusplus
 }
index 9b5eb3ceffe0bb6eae6bcf8ce4e540d487e23b6b..5a4f8d6d00bac8c37b93025df7b9bf0748dc101f 100644 (file)
@@ -23,6 +23,7 @@
  * Include necessary headers...
  */
 
+#  include "versioning.h"
 #  include <sys/stat.h>
 
 
@@ -52,10 +53,10 @@ typedef struct cups_dentry_s                /**** Directory entry type ****/
  * Prototypes...
  */
 
-extern void            cupsDirClose(cups_dir_t *dp);
-extern cups_dir_t      *cupsDirOpen(const char *directory);
-extern cups_dentry_t   *cupsDirRead(cups_dir_t *dp);
-extern void            cupsDirRewind(cups_dir_t *dp);
+extern void            cupsDirClose(cups_dir_t *dp) _CUPS_API_1_2;
+extern cups_dir_t      *cupsDirOpen(const char *directory) _CUPS_API_1_2;
+extern cups_dentry_t   *cupsDirRead(cups_dir_t *dp) _CUPS_API_1_2;
+extern void            cupsDirRewind(cups_dir_t *dp) _CUPS_API_1_2;
 
 
 #  ifdef __cplusplus
index 80d9b738cb9a1ece69b410c56bb3febb5a929c73..d978b5b24f31afc40a3784d8a7aba7fe7e87d5f4 100644 (file)
@@ -26,6 +26,7 @@
  * Include necessary headers...
  */
 
+#  include "versioning.h"
 #  include <sys/types.h>
 #  if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
 #    define __CUPS_SSIZE_T_DEFINED
@@ -62,36 +63,36 @@ typedef struct _cups_file_s cups_file_t;/**** CUPS file type ****/
  * Prototypes...
  */
 
-extern int             cupsFileClose(cups_file_t *fp);
-extern int             cupsFileCompression(cups_file_t *fp);
-extern int             cupsFileEOF(cups_file_t *fp);
+extern int             cupsFileClose(cups_file_t *fp) _CUPS_API_1_2;
+extern int             cupsFileCompression(cups_file_t *fp) _CUPS_API_1_2;
+extern int             cupsFileEOF(cups_file_t *fp) _CUPS_API_1_2;
 extern const char      *cupsFileFind(const char *filename, const char *path,
                                      int executable, char *buffer,
-                                     int bufsize);
-extern int             cupsFileFlush(cups_file_t *fp);
-extern int             cupsFileGetChar(cups_file_t *fp);
+                                     int bufsize) _CUPS_API_1_2;
+extern int             cupsFileFlush(cups_file_t *fp) _CUPS_API_1_2;
+extern int             cupsFileGetChar(cups_file_t *fp) _CUPS_API_1_2;
 extern char            *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen,
-                                        char **value, int *linenum);
+                                        char **value, int *linenum) _CUPS_API_1_2;
 extern size_t          cupsFileGetLine(cups_file_t *fp, char *buf,
-                                       size_t buflen);
-extern char            *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen);
-extern int             cupsFileLock(cups_file_t *fp, int block);
-extern int             cupsFileNumber(cups_file_t *fp);
-extern cups_file_t     *cupsFileOpen(const char *filename, const char *mode);
-extern cups_file_t     *cupsFileOpenFd(int fd, const char *mode);
-extern int             cupsFilePeekChar(cups_file_t *fp);
-extern int             cupsFilePrintf(cups_file_t *fp, const char *format, ...);
-extern int             cupsFilePutChar(cups_file_t *fp, int c);
-extern int             cupsFilePuts(cups_file_t *fp, const char *s);
-extern ssize_t         cupsFileRead(cups_file_t *fp, char *buf, size_t bytes);
-extern off_t           cupsFileRewind(cups_file_t *fp);
-extern off_t           cupsFileSeek(cups_file_t *fp, off_t pos);
-extern cups_file_t     *cupsFileStderr(void);
-extern cups_file_t     *cupsFileStdin(void);
-extern cups_file_t     *cupsFileStdout(void);
-extern off_t           cupsFileTell(cups_file_t *fp);
-extern int             cupsFileUnlock(cups_file_t *fp);
-extern ssize_t         cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes);
+                                       size_t buflen) _CUPS_API_1_2;
+extern char            *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2;
+extern int             cupsFileLock(cups_file_t *fp, int block) _CUPS_API_1_2;
+extern int             cupsFileNumber(cups_file_t *fp) _CUPS_API_1_2;
+extern cups_file_t     *cupsFileOpen(const char *filename, const char *mode) _CUPS_API_1_2;
+extern cups_file_t     *cupsFileOpenFd(int fd, const char *mode) _CUPS_API_1_2;
+extern int             cupsFilePeekChar(cups_file_t *fp) _CUPS_API_1_2;
+extern int             cupsFilePrintf(cups_file_t *fp, const char *format, ...) _CUPS_API_1_2;
+extern int             cupsFilePutChar(cups_file_t *fp, int c) _CUPS_API_1_2;
+extern int             cupsFilePuts(cups_file_t *fp, const char *s) _CUPS_API_1_2;
+extern ssize_t         cupsFileRead(cups_file_t *fp, char *buf, size_t bytes) _CUPS_API_1_2;
+extern off_t           cupsFileRewind(cups_file_t *fp) _CUPS_API_1_2;
+extern off_t           cupsFileSeek(cups_file_t *fp, off_t pos) _CUPS_API_1_2;
+extern cups_file_t     *cupsFileStderr(void) _CUPS_API_1_2;
+extern cups_file_t     *cupsFileStdin(void) _CUPS_API_1_2;
+extern cups_file_t     *cupsFileStdout(void) _CUPS_API_1_2;
+extern off_t           cupsFileTell(cups_file_t *fp) _CUPS_API_1_2;
+extern int             cupsFileUnlock(cups_file_t *fp) _CUPS_API_1_2;
+extern ssize_t         cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes) _CUPS_API_1_2;
 
 
 #  ifdef __cplusplus
index 5d7c6b2dc2d099f57075782ad8cb512452e49f61..c643315181e3623ff31faf6542bacf747d8211e7 100644 (file)
@@ -23,6 +23,7 @@
  * Include necessary headers...
  */
 
+#  include "versioning.h"
 #  include <string.h>
 #  include <time.h>
 #  include <sys/types.h>
@@ -60,17 +61,6 @@ typedef off_t ssize_t;                       /* @private@ */
 #    endif /* LOCAL_PEERCRED && !SO_PEERCRED */
 #  endif /* WIN32 */
 
-/*
- * With GCC 3.0 and higher, we can mark old APIs "deprecated" so you get
- * a warning at compile-time.
- */
-
-#  if defined(__GNUC__) && __GNUC__ > 2
-#    define _HTTP_DEPRECATED __attribute__ ((__deprecated__))
-#  else
-#    define _HTTP_DEPRECATED
-#  endif /* __GNUC__ && __GNUC__ > 2 */
-
 
 /*
  * C++ magic...
@@ -358,20 +348,20 @@ __attribute__ ((__format__ (__printf__, 2, 3)))
 #  endif /* __GNUC__ */
 ;
 extern int             httpPut(http_t *http, const char *uri);
-extern int             httpRead(http_t *http, char *buffer, int length) _HTTP_DEPRECATED;
+extern int             httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED;
 extern int             httpReconnect(http_t *http);
 extern void            httpSeparate(const char *uri, char *method,
                                     char *username, char *host, int *port,
-                                    char *resource) _HTTP_DEPRECATED;
+                                    char *resource) _CUPS_DEPRECATED;
 extern void            httpSetField(http_t *http, http_field_t field,
                                     const char *value);
 extern const char      *httpStatus(http_status_t status);
 extern int             httpTrace(http_t *http, const char *uri);
 extern http_status_t   httpUpdate(http_t *http);
-extern int             httpWrite(http_t *http, const char *buffer, int length) _HTTP_DEPRECATED;
-extern char            *httpEncode64(char *out, const char *in) _HTTP_DEPRECATED;
-extern char            *httpDecode64(char *out, const char *in) _HTTP_DEPRECATED;
-extern int             httpGetLength(http_t *http) _HTTP_DEPRECATED;
+extern int             httpWrite(http_t *http, const char *buffer, int length) _CUPS_DEPRECATED;
+extern char            *httpEncode64(char *out, const char *in) _CUPS_DEPRECATED;
+extern char            *httpDecode64(char *out, const char *in) _CUPS_DEPRECATED;
+extern int             httpGetLength(http_t *http) _CUPS_DEPRECATED;
 extern char            *httpMD5(const char *, const char *, const char *,
                                 char [33]);
 extern char            *httpMD5Final(const char *, const char *, const char *,
@@ -379,73 +369,73 @@ extern char               *httpMD5Final(const char *, const char *, const char *,
 extern char            *httpMD5String(const unsigned char *, char [33]);
 
 /**** New in CUPS 1.1.19 ****/
-extern void            httpClearCookie(http_t *http);
-extern const char      *httpGetCookie(http_t *http);
-extern void            httpSetCookie(http_t *http, const char *cookie);
-extern int             httpWait(http_t *http, int msec);
+extern void            httpClearCookie(http_t *http) _CUPS_API_1_1_19;
+extern const char      *httpGetCookie(http_t *http) _CUPS_API_1_1_19;
+extern void            httpSetCookie(http_t *http, const char *cookie) _CUPS_API_1_1_19;
+extern int             httpWait(http_t *http, int msec) _CUPS_API_1_1_19;
 
 /**** New in CUPS 1.1.21 ****/
-extern char            *httpDecode64_2(char *out, int *outlen, const char *in);
+extern char            *httpDecode64_2(char *out, int *outlen, const char *in) _CUPS_API_1_1_21;
 extern char            *httpEncode64_2(char *out, int outlen, const char *in,
-                                       int inlen);
+                                       int inlen) _CUPS_API_1_1_21;
 extern void            httpSeparate2(const char *uri,
                                      char *method, int methodlen,
                                      char *username, int usernamelen,
                                      char *host, int hostlen, int *port,
-                                     char *resource, int resourcelen) _HTTP_DEPRECATED;
+                                     char *resource, int resourcelen) _CUPS_DEPRECATED;
 
 /**** New in CUPS 1.2 ****/
-extern int             httpAddrAny(const http_addr_t *addr);
-extern http_addrlist_t *httpAddrConnect(http_addrlist_t *addrlist, int *sock);
+extern int             httpAddrAny(const http_addr_t *addr) _CUPS_API_1_2;
+extern http_addrlist_t *httpAddrConnect(http_addrlist_t *addrlist, int *sock) _CUPS_API_1_2;
 extern int             httpAddrEqual(const http_addr_t *addr1,
-                                     const http_addr_t *addr2);
-extern void            httpAddrFreeList(http_addrlist_t *addrlist);
+                                     const http_addr_t *addr2) _CUPS_API_1_2;
+extern void            httpAddrFreeList(http_addrlist_t *addrlist) _CUPS_API_1_2;
 extern http_addrlist_t *httpAddrGetList(const char *hostname, int family,
-                                        const char *service);
-extern int             httpAddrLength(const http_addr_t *addr);
-extern int             httpAddrLocalhost(const http_addr_t *addr);
+                                        const char *service) _CUPS_API_1_2;
+extern int             httpAddrLength(const http_addr_t *addr) _CUPS_API_1_2;
+extern int             httpAddrLocalhost(const http_addr_t *addr) _CUPS_API_1_2;
 extern char            *httpAddrLookup(const http_addr_t *addr,
-                                        char *name, int namelen);
+                                        char *name, int namelen) _CUPS_API_1_2;
 extern char            *httpAddrString(const http_addr_t *addr,
-                                       char *s, int slen);
+                                       char *s, int slen) _CUPS_API_1_2;
 extern http_uri_status_t httpAssembleURI(http_uri_coding_t encoding,
                                         char *uri, int urilen,
                                         const char *scheme,
                                         const char *username,
                                         const char *host, int port,
-                                        const char *resource);
+                                        const char *resource) _CUPS_API_1_2;
 extern http_uri_status_t httpAssembleURIf(http_uri_coding_t encoding,
                                          char *uri, int urilen,
                                          const char *scheme,
                                          const char *username,
                                          const char *host, int port,
-                                         const char *resourcef, ...);
-extern int             httpFlushWrite(http_t *http);
-extern int             httpGetBlocking(http_t *http);
-extern const char      *httpGetDateString2(time_t t, char *s, int slen);
-extern int             httpGetFd(http_t *http);
-extern const char      *httpGetHostname(http_t *http, char *s, int slen);
-extern off_t           httpGetLength2(http_t *http);
-extern http_status_t   httpGetStatus(http_t *http);
+                                         const char *resourcef, ...) _CUPS_API_1_2;
+extern int             httpFlushWrite(http_t *http) _CUPS_API_1_2;
+extern int             httpGetBlocking(http_t *http) _CUPS_API_1_2;
+extern const char      *httpGetDateString2(time_t t, char *s, int slen) _CUPS_API_1_2;
+extern int             httpGetFd(http_t *http) _CUPS_API_1_2;
+extern const char      *httpGetHostname(http_t *http, char *s, int slen) _CUPS_API_1_2;
+extern off_t           httpGetLength2(http_t *http) _CUPS_API_1_2;
+extern http_status_t   httpGetStatus(http_t *http) _CUPS_API_1_2;
 extern char            *httpGetSubField2(http_t *http, http_field_t field,
                                          const char *name, char *value,
-                                         int valuelen);
-extern ssize_t         httpRead2(http_t *http, char *buffer, size_t length);
+                                         int valuelen) _CUPS_API_1_2;
+extern ssize_t         httpRead2(http_t *http, char *buffer, size_t length) _CUPS_API_1_2;
 extern http_uri_status_t httpSeparateURI(http_uri_coding_t decoding,
                                         const char *uri,
                                         char *scheme, int schemelen,
                                         char *username, int usernamelen,
                                         char *host, int hostlen, int *port,
-                                        char *resource, int resourcelen);
-extern void            httpSetExpect(http_t *http, http_status_t expect);
-extern void            httpSetLength(http_t *http, size_t length);
+                                        char *resource, int resourcelen) _CUPS_API_1_2;
+extern void            httpSetExpect(http_t *http, http_status_t expect) _CUPS_API_1_2;
+extern void            httpSetLength(http_t *http, size_t length) _CUPS_API_1_2;
 extern ssize_t         httpWrite2(http_t *http, const char *buffer,
-                                  size_t length);
+                                  size_t length) _CUPS_API_1_2;
 
 /**** New in CUPS 1.3 ****/
-extern char            *httpGetAuthString(http_t *http);
+extern char            *httpGetAuthString(http_t *http) _CUPS_API_1_3;
 extern void            httpSetAuthString(http_t *http, const char *scheme,
-                                         const char *data);
+                                         const char *data) _CUPS_API_1_3;
 
 /*
  * C++ magic...
index 9c0bb7849aa9eca6b10effdb510ce76197bb944d..bf860e14be5f52a0c1bc1fc2494d03fc4e0463e9 100644 (file)
@@ -461,26 +461,26 @@ extern void               ippSetPort(int p);
 
 /**** New in CUPS 1.1.19 ****/
 extern ipp_attribute_t *ippAddCollection(ipp_t *ipp, ipp_tag_t group,
-                                         const char *name, ipp_t *value);
+                                         const char *name, ipp_t *value) _CUPS_API_1_1_19;
 extern ipp_attribute_t *ippAddCollections(ipp_t *ipp, ipp_tag_t group,
                                           const char *name, int num_values,
-                                          const ipp_t **values);
-extern void            ippDeleteAttribute(ipp_t *ipp, ipp_attribute_t *attr);
-extern ipp_state_t     ippReadFile(int fd, ipp_t *ipp);
-extern ipp_state_t     ippWriteFile(int fd, ipp_t *ipp);
+                                          const ipp_t **values) _CUPS_API_1_1_19;
+extern void            ippDeleteAttribute(ipp_t *ipp, ipp_attribute_t *attr) _CUPS_API_1_1_19;
+extern ipp_state_t     ippReadFile(int fd, ipp_t *ipp) _CUPS_API_1_1_19;
+extern ipp_state_t     ippWriteFile(int fd, ipp_t *ipp) _CUPS_API_1_1_19;
 
 /**** New in CUPS 1.2 ****/
 extern ipp_attribute_t *ippAddOctetString(ipp_t *ipp, ipp_tag_t group,
                                           const char *name,
-                                          const void *data, int datalen);
-extern ipp_status_t    ippErrorValue(const char *name);
-extern ipp_t           *ippNewRequest(ipp_op_t op);
-extern const char      *ippOpString(ipp_op_t op);
-extern ipp_op_t                ippOpValue(const char *name);
+                                          const void *data, int datalen) _CUPS_API_1_2;
+extern ipp_status_t    ippErrorValue(const char *name) _CUPS_API_1_2;
+extern ipp_t           *ippNewRequest(ipp_op_t op) _CUPS_API_1_2;
+extern const char      *ippOpString(ipp_op_t op) _CUPS_API_1_2;
+extern ipp_op_t                ippOpValue(const char *name) _CUPS_API_1_2;
 extern ipp_state_t     ippReadIO(void *src, ipp_iocb_t cb, int blocking,
-                                 ipp_t *parent, ipp_t *ipp);
+                                 ipp_t *parent, ipp_t *ipp) _CUPS_API_1_2;
 extern ipp_state_t     ippWriteIO(void *dst, ipp_iocb_t cb, int blocking,
-                                  ipp_t *parent, ipp_t *ipp);
+                                  ipp_t *parent, ipp_t *ipp) _CUPS_API_1_2;
 
 
 /*
index 2405e0a412c325e87f115a518d9f8be19fc0bafb..34de054c9f914b05385e7edae9a3ad3c3b7cbf7e 100644 (file)
@@ -358,41 +358,41 @@ extern ppd_size_t *ppdPageSize(ppd_file_t *ppd, const char *name);
 extern float           ppdPageWidth(ppd_file_t *ppd, const char *name);
 
 /**** New in CUPS 1.1.19 ****/
-extern const char      *ppdErrorString(ppd_status_t status);
+extern const char      *ppdErrorString(ppd_status_t status) _CUPS_API_1_1_19;
 extern ppd_attr_t      *ppdFindAttr(ppd_file_t *ppd, const char *name,
-                                    const char *spec);
+                                    const char *spec) _CUPS_API_1_1_19;
 extern ppd_attr_t      *ppdFindNextAttr(ppd_file_t *ppd, const char *name,
-                                        const char *spec);
-extern ppd_status_t    ppdLastError(int *line);
+                                        const char *spec) _CUPS_API_1_1_19;
+extern ppd_status_t    ppdLastError(int *line) _CUPS_API_1_1_19;
 
 /**** New in CUPS 1.1.20 ****/
-extern void            ppdSetConformance(ppd_conform_t c);
+extern void            ppdSetConformance(ppd_conform_t c) _CUPS_API_1_1_20;
 
 /**** New in CUPS 1.2 ****/
 extern int             ppdCollect2(ppd_file_t *ppd, ppd_section_t section,
-                                   float min_order, ppd_choice_t  ***choices);
+                                   float min_order, ppd_choice_t  ***choices) _CUPS_API_1_2;
 extern int             ppdEmitAfterOrder(ppd_file_t *ppd, FILE *fp,
                                          ppd_section_t section, int limit,
-                                         float min_order);
-extern int             ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp);
+                                         float min_order) _CUPS_API_1_2;
+extern int             ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp) _CUPS_API_1_2;
 extern char            *ppdEmitString(ppd_file_t *ppd, ppd_section_t section,
-                                      float min_order);
+                                      float min_order) _CUPS_API_1_2;
 extern ppd_coption_t   *ppdFindCustomOption(ppd_file_t *ppd,
-                                            const char *keyword);
+                                            const char *keyword) _CUPS_API_1_2;
 extern ppd_cparam_t    *ppdFindCustomParam(ppd_coption_t *opt,
-                                           const char *name);
-extern ppd_cparam_t    *ppdFirstCustomParam(ppd_coption_t *opt);
-extern ppd_option_t    *ppdFirstOption(ppd_file_t *ppd);
-extern ppd_cparam_t    *ppdNextCustomParam(ppd_coption_t *opt);
-extern ppd_option_t    *ppdNextOption(ppd_file_t *ppd);
-extern int             ppdLocalize(ppd_file_t *ppd);
-extern ppd_file_t      *ppdOpen2(cups_file_t *fp);
+                                           const char *name) _CUPS_API_1_2;
+extern ppd_cparam_t    *ppdFirstCustomParam(ppd_coption_t *opt) _CUPS_API_1_2;
+extern ppd_option_t    *ppdFirstOption(ppd_file_t *ppd) _CUPS_API_1_2;
+extern ppd_cparam_t    *ppdNextCustomParam(ppd_coption_t *opt) _CUPS_API_1_2;
+extern ppd_option_t    *ppdNextOption(ppd_file_t *ppd) _CUPS_API_1_2;
+extern int             ppdLocalize(ppd_file_t *ppd) _CUPS_API_1_2;
+extern ppd_file_t      *ppdOpen2(cups_file_t *fp) _CUPS_API_1_2;
 
 /**** New in CUPS 1.3 ****/
 extern const char      *ppdLocalizeIPPReason(ppd_file_t *ppd,
                                              const char *reason,
                                              const char *scheme,
-                                             char *buffer, size_t bufsize);
+                                             char *buffer, size_t bufsize) _CUPS_API_1_3;
 
 
 /*
index 91c70690aae0e52b0760d4fc3609fe1c18fe4d05..ed042157c366af1c8c5aead5ea554f79e4452163 100644 (file)
 #ifndef _CUPS_SIDECHANNEL_H_
 #  define _CUPS_SIDECHANNEL_H_
 
+/*
+ * Include necessary headers...
+ */
+
+#  include "versioning.h"
+
+
 /*
  * C++ magic...
  */
@@ -84,15 +91,15 @@ typedef enum                                /**** Response status codes ****/
 
 extern cups_sc_status_t        cupsSideChannelDoRequest(cups_sc_command_t command,
                                                 char *data, int *datalen,
-                                                double timeout);
+                                                double timeout) _CUPS_API_1_3;
 extern int             cupsSideChannelRead(cups_sc_command_t *command,
                                            cups_sc_status_t *status,
                                            char *data, int *datalen,
-                                           double timeout);
+                                           double timeout) _CUPS_API_1_3;
 extern int             cupsSideChannelWrite(cups_sc_command_t command,
                                             cups_sc_status_t status,
                                             const char *data, int datalen,
-                                            double timeout);
+                                            double timeout) _CUPS_API_1_3;
 
 
 #  ifdef __cplusplus
index 40d1765742b31fde5c00b571435c16092820c6a9..e4343e14e802637984b9b3f751088c17cf957f65 100644 (file)
@@ -57,17 +57,17 @@ typedef unsigned long  cups_vbcs_t; /* VBCS Legacy 32-bit unit */
 extern int     cupsCharsetToUTF8(cups_utf8_t *dest,
                                  const char *src,
                                  const int maxout,
-                                 const cups_encoding_t encoding);
+                                 const cups_encoding_t encoding) _CUPS_API_1_2;
 extern int     cupsUTF8ToCharset(char *dest,
                                  const cups_utf8_t *src,
                                  const int maxout,
-                                 const cups_encoding_t encoding);
+                                 const cups_encoding_t encoding) _CUPS_API_1_2;
 extern int     cupsUTF8ToUTF32(cups_utf32_t *dest,
                                const cups_utf8_t *src,
-                               const int maxout);
+                               const int maxout) _CUPS_API_1_2;
 extern int     cupsUTF32ToUTF8(cups_utf8_t *dest,
                                const cups_utf32_t *src,
-                               const int maxout);
+                               const int maxout) _CUPS_API_1_2;
 
 #  ifdef __cplusplus
 }
diff --git a/cups/versioning.h b/cups/versioning.h
new file mode 100644 (file)
index 0000000..cdb2308
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * "$Id$"
+ *
+ *   API versioning definitions for the Common UNIX Printing System (CUPS).
+ *
+ *   Copyright 2007 by Apple Inc.
+ *
+ *   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.
+ */
+
+#ifndef _CUPS_VERSIONING_H_
+#  define _CUPS_VERSIONING_H_
+
+/*
+ * This header defines several constants - _CUPS_DEPRECATED,
+ * _CUPS_API_1_1, _CUPS_API_1_1_19, _CUPS_API_1_1_20, _CUPS_API_1_1_21,
+ * _CUPS_API_1_2, _CUPS_API_1_3, _CUPS_API_1_4 - which add compiler-
+ * specific attributes that flag functions that are deprecated or added
+ * in particular releases.  On Mac OS X, the _CUPS_API_* constants are
+ * defined based on the value of the MAC_OS_X_VERSION_MAX_ALLOWED constant
+ * provided by the compiler.
+ */
+
+#  if defined(__APPLE__) && !defined(_CUPS_SOURCE)
+#    if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
+#      define _CUPS_API_1_1_19 __attribute__((unavailable))
+#      define _CUPS_API_1_1_20 __attribute__((unavailable))
+#      define _CUPS_API_1_1_21 __attribute__((unavailable))
+#      define _CUPS_API_1_2 __attribute__((unavailable))
+#      define _CUPS_API_1_3 __attribute__((unavailable))
+#      define _CUPS_API_1_4 __attribute__((unavailable))
+#    elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
+#      define _CUPS_API_1_1_19
+#      define _CUPS_API_1_1_20 __attribute__((unavailable))
+#      define _CUPS_API_1_1_21 __attribute__((unavailable))
+#      define _CUPS_API_1_2 __attribute__((unavailable))
+#      define _CUPS_API_1_3 __attribute__((unavailable))
+#      define _CUPS_API_1_4 __attribute__((unavailable))
+#    elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
+#      define _CUPS_API_1_1_19
+#      define _CUPS_API_1_1_20
+#      define _CUPS_API_1_1_21
+#      define _CUPS_API_1_2 __attribute__((unavailable))
+#      define _CUPS_API_1_3 __attribute__((unavailable))
+#      define _CUPS_API_1_4 __attribute__((unavailable))
+#    elif MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_5
+#      define _CUPS_API_1_1_19
+#      define _CUPS_API_1_1_20
+#      define _CUPS_API_1_1_21
+#      define _CUPS_API_1_2
+#      define _CUPS_API_1_3
+#      define _CUPS_API_1_4 __attribute__((unavailable))
+#    else
+#      define _CUPS_API_1_1_19
+#      define _CUPS_API_1_1_20
+#      define _CUPS_API_1_1_21
+#      define _CUPS_API_1_2
+#      define _CUPS_API_1_3
+#      define _CUPS_API_1_4
+#    endif /* MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_x */
+#  else
+#    define _CUPS_API_1_1_19
+#    define _CUPS_API_1_1_20
+#    define _CUPS_API_1_1_21
+#    define _CUPS_API_1_2
+#    define _CUPS_API_1_3
+#    define _CUPS_API_1_4
+#  endif /* __APPLE__ */
+
+/*
+ * With GCC 3.0 and higher, we can mark old APIs "deprecated" so you get
+ * a warning at compile-time.
+ */
+
+#  if defined(__GNUC__) && __GNUC__ > 2
+#    define _CUPS_DEPRECATED __attribute__ ((__deprecated__))
+#  else
+#    define _CUPS_DEPRECATED
+#  endif /* __GNUC__ && __GNUC__ > 2 */
+
+#endif /* !_CUPS_VERSIONING_H_ */
+
+/*
+ * End of "$Id$".
+ */