├── .gitmodules ├── tests └── CTryCatchTest │ ├── CTryCatchTest.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── james.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ ├── xcuserdata │ │ └── james.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── CTryCatchTest.xcscheme │ └── project.pbxproj │ └── CTryCatchTest │ └── main.c ├── LICENSE ├── ctrycatch.c ├── ctrycatch.h ├── README.md └── ctrycatch_exception_types.conf /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/CTryCatchTest/CTryCatchTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/CTryCatchTest/CTryCatchTest.xcodeproj/project.xcworkspace/xcuserdata/james.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jamesits/CTryCatch/HEAD/tests/CTryCatchTest/CTryCatchTest.xcodeproj/project.xcworkspace/xcuserdata/james.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /tests/CTryCatchTest/CTryCatchTest.xcodeproj/xcuserdata/james.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CTryCatchTest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1A8307C81C39649600A2F204 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 James Swineson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /ctrycatch.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is a part of CTryCatch library ( https://github.com/Jamesits/CTryCatch ). 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (c) 2016 James Swineson 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #include "ctrycatch.h" 28 | 29 | // Global variables to store exception details 30 | jmp_buf CTRYCATCH_NAME(exception_env); 31 | CTRYCATCH_NAME(exception_types) CTRYCATCH_NAME(exception_type); 32 | char *CTRYCATCH_NAME(exception_message); 33 | -------------------------------------------------------------------------------- /tests/CTryCatchTest/CTryCatchTest/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is a part of CTryCatch library ( https://github.com/Jamesits/CTryCatch ). 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (c) 2016 James Swineson 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #include 28 | #include "../../../ctrycatch.h" 29 | 30 | void throwArgumentException() { 31 | puts("Function reached."); 32 | throw(ArgumentException, "Ooh! Some ArgumentException was thrown. "); 33 | } 34 | 35 | int main() { 36 | 37 | puts("Test1: try/catch/finally, function, with message"); 38 | try { 39 | throwArgumentException(); 40 | } catch(ArgumentException) { 41 | puts("ArgumentException block reached"); 42 | if (__ctrycatch_exception_message_exists) printf("message: %s\n", __ctrycatch_exception_message); 43 | } finally { 44 | puts("finally block reached"); 45 | } 46 | 47 | puts("\nTest2: try/catch, default catch block, without message"); 48 | try { 49 | throw(InvalidPrinterException); 50 | } catch(ArgumentException) { 51 | puts("ArgumentException block reached"); 52 | if (__ctrycatch_exception_message_exists) printf("message: %s\n", __ctrycatch_exception_message); 53 | } catch() { 54 | puts("default block reached"); 55 | if (__ctrycatch_exception_message_exists) printf("message: %s\n", __ctrycatch_exception_message); 56 | } 57 | 58 | return 0; 59 | } -------------------------------------------------------------------------------- /ctrycatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is a part of CTryCatch library ( https://github.com/Jamesits/CTryCatch ). 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (c) 2016 James Swineson 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #pragma once 28 | #ifndef ctrycatch_h 29 | #define ctrycatch_h 30 | 31 | #include 32 | #include 33 | 34 | // Some macro magic 35 | #define CTRYCATCH_CAT(a, ...) CTRYCATCH_PRIMITIVE_CAT(a, __VA_ARGS__) 36 | #define CTRYCATCH_PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__ 37 | 38 | #define CTRYCATCH_NAME(X) CTRYCATCH_CAT(__ctrycatch_, X) 39 | 40 | // New block arguments 41 | #define try \ 42 | if(!(CTRYCATCH_NAME(exception_type) = setjmp(CTRYCATCH_NAME(exception_env)))) 43 | 44 | #define catch(X) \ 45 | else if((X +0) == 0 || CTRYCATCH_NAME(exception_type) == (X +0)) 46 | 47 | #define finally 48 | 49 | #define throw(X,...) \ 50 | CTRYCATCH_NAME(exception_message) = (__VA_ARGS__ +0), longjmp(CTRYCATCH_NAME(exception_env), (X)) 51 | 52 | // Exception type 53 | typedef int CTRYCATCH_NAME(exception_types); 54 | 55 | // Global variables to store exception details 56 | extern jmp_buf CTRYCATCH_NAME(exception_env); 57 | extern CTRYCATCH_NAME(exception_types) CTRYCATCH_NAME(exception_type); 58 | extern char *CTRYCATCH_NAME(exception_message); 59 | 60 | // Helper functions 61 | #define __ctrycatch_exception_message_exists (bool)CTRYCATCH_NAME(exception_message) 62 | 63 | // Exception types 64 | #ifdef Exception 65 | #undef Exception 66 | #endif 67 | 68 | enum exception_type { 69 | Exception, // Caution: 0 **IS** defined as "no error" to make it work. DO NOT modify this line. 70 | #include "ctrycatch_exception_types.conf" 71 | }; 72 | 73 | #define Exception 0 74 | 75 | #endif /* ctrycatch_h */ 76 | -------------------------------------------------------------------------------- /tests/CTryCatchTest/CTryCatchTest.xcodeproj/xcuserdata/james.xcuserdatad/xcschemes/CTryCatchTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CTryCatch 2 | 3 | A library which enables you to write try/catch statements in pure C. 4 | 5 | Notes: 6 | 7 | * Compatible with C99. Support of older C standards are not guaranteed. 8 | * **Experimental project**. Updates may broke backward compatibility. Use with caution. 9 | * Not sure if it is thread safety. See: [issues/2](https://github.com/Jamesits/CTryCatch/issues/2) 10 | * WARNING: you might see a lot of messy errors if you break its grammer. See: [issues/3](https://github.com/Jamesits/CTryCatch/issues/3) 11 | 12 | ## Usage 13 | 14 | To use CTryCatch, simply include its header in your program: `#include "ctrycatch.h"`. 15 | 16 | Definitions: 17 | 18 | * `try` starts a try block. 19 | * `catch(ExceptionType)` catches a specific error. 20 | * `catch()` or `catch(Exception)` catches any error and executes the corresponding catch block; put it after other `catch`es if there are any. 21 | * `finally` starts a finally block. 22 | * `throw(ExceptionType)` throws an exception. 23 | * `throw(ExceptionType, "message")` throws an exception with a message. 24 | * `bool __ctrycatch_exception_message_exists;` is set to true if there is a message with exception. 25 | * `char *__ctrycatch_exception_message` contains the message (if there is any) or NULL if not. 26 | 27 | Notes 28 | 29 | * `ctrycatch.c` needs to be compiled and linked to your program. 30 | * Full inheritance support is not implemented due to the limitations of C. However, any exception type is a "subclass" of `Exception`. 31 | * The generic `catch()` should be put after other `catch`es if there are any. Otherwise more than one catch blocks may be executed. 32 | * `catch()` is exactly the same as `catch(Exception)`. 33 | * No good support for `throw`ing inside catch block or nested try/catch structure currently. *Help wanted.* See: [issues/1](https://github.com/Jamesits/CTryCatch/issues/1) 34 | * `__ctrycatch_exception_message` may bring memory leaks. See: [issues/4](https://github.com/Jamesits/CTryCatch/issues/4) 35 | 36 | ## Add/Change Exception Types 37 | 38 | Edit `ctrycatch_exception_types.conf` and add/modify that list: 39 | 40 | ```C 41 | AccessViolationException, 42 | AppDomainUnloadedException, 43 | ApplicationException, 44 | ArgumentException, 45 | ArgumentNullException, 46 | ArgumentOutOfRangeException, 47 | ArithmeticException, 48 | // ... 49 | SomeCustomException, 50 | AnotherCustomException, 51 | ``` 52 | 53 | ## Example 54 | 55 | [Here](https://github.com/Jamesits/CTryCatch/blob/master/tests/CTryCatchTest/CTryCatchTest/main.c) is an simple C program which demonstrates the usage of CTryCatch. 56 | 57 | ### Comparison with C++ try/catch 58 | 59 | ```C 60 | // CTryCatch 61 | 62 | try { 63 | // do something 64 | throw(ArgumentsException); 65 | // or 66 | throw(ArgumentsException, "description"); 67 | } catch(ArgumentsException) { 68 | // error handling 69 | } catch() { 70 | // error handling for default case 71 | } finally { 72 | // cleanup 73 | } 74 | ``` 75 | 76 | ```C++ 77 | // C++ 78 | 79 | try { 80 | // do something 81 | throw(new ArgumentsException()); 82 | // or 83 | throw(new ArgumentsException("description")); 84 | } catch(ArgumentsException e) { 85 | // error handling 86 | } catch { 87 | // error handling 88 | } 89 | // C++ doesn't support finally 90 | ``` 91 | 92 | ## Author 93 | 94 | [James Swineson](https://swineson.me) 95 | 96 | ## Thanks 97 | 98 | Exceptions list is from [.NET Exceptions (all of them)](https://mikevallotton.wordpress.com/2009/07/08/net-exceptions-all-of-them/). 99 | 100 | ## License 101 | 102 | The MIT License (MIT) 103 | 104 | Copyright (c) 2016 James Swineson 105 | 106 | Permission is hereby granted, free of charge, to any person obtaining a copy 107 | of this software and associated documentation files (the "Software"), to deal 108 | in the Software without restriction, including without limitation the rights 109 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 110 | copies of the Software, and to permit persons to whom the Software is 111 | furnished to do so, subject to the following conditions: 112 | 113 | The above copyright notice and this permission notice shall be included in all 114 | copies or substantial portions of the Software. 115 | 116 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 117 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 118 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 119 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 120 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 121 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 122 | SOFTWARE. -------------------------------------------------------------------------------- /ctrycatch_exception_types.conf: -------------------------------------------------------------------------------- 1 | // Most of the default exceptions are from C#. 2 | // Modify this list to satisfy your own need. 3 | // And don't forget the trailing comma. 4 | 5 | AccessViolationException, 6 | AppDomainUnloadedException, 7 | ApplicationException, 8 | ArgumentException, 9 | ArgumentNullException, 10 | ArgumentOutOfRangeException, 11 | ArithmeticException, 12 | ArrayTypeMismatchException, 13 | BadImageFormatException, 14 | CannotUnloadAppDomainException, 15 | ContextMarshalException, 16 | DataMisalignedException, 17 | DivideByZeroException, 18 | DllNotFoundException, 19 | DuplicateWaitObjectException, 20 | EntryPointNotFoundException, 21 | ExecutionEngineException, 22 | FieldAccessException, 23 | FormatException, 24 | IndexOutOfRangeException, 25 | InsufficientMemoryException, 26 | InvalidCastException, 27 | InvalidOperationException, 28 | InvalidProgramException, 29 | MemberAccessException, 30 | MethodAccessException, 31 | MissingFieldException, 32 | MissingMemberException, 33 | MissingMethodException, 34 | MulticastNotSupportedException, 35 | NotFiniteNumberException, 36 | NotImplementedException, 37 | NotSupportedException, 38 | NullReferenceException, 39 | ObjectDisposedException, 40 | OperationCanceledException, 41 | OutOfMemoryException, 42 | OverflowException, 43 | PlatformNotSupportedException, 44 | RankException, 45 | StackOverflowException, 46 | SystemException, 47 | TimeoutException, 48 | TypeInitializationException, 49 | TypeLoadException, 50 | TypeUnloadedException, 51 | UnauthorizedAccessException, 52 | KeyNotFoundException, 53 | DirectoryNotFoundException, 54 | DriveNotFoundException, 55 | EndOfStreamException, 56 | FileLoadException, 57 | FileNotFoundException, 58 | IOException, 59 | PathTooLongException, 60 | IsolatedStorageException, 61 | AmbiguousMatchException, 62 | CustomAttributeFormatException, 63 | InvalidFilterCriteriaException, 64 | MetadataException, 65 | ReflectionTypeLoadException, 66 | TargetException, 67 | TargetInvocationException, 68 | TargetParameterCountException, 69 | MissingManifestResourceException, 70 | MissingSatelliteAssemblyException, 71 | RuntimeWrappedException, 72 | COMException, 73 | ExternalException, 74 | InvalidComObjectException, 75 | InvalidOleVariantTypeException, 76 | MarshalDirectiveException, 77 | SafeArrayRankMismatchException, 78 | SafeArrayTypeMismatchException, 79 | SEHException, 80 | RemotingException, 81 | RemotingTimeoutException, 82 | ServerException, 83 | SerializationException, 84 | HostProtectionException, 85 | SecurityException, 86 | VerificationException, 87 | XmlSyntaxException, 88 | PrivilegeNotHeldException, 89 | CryptographicException, 90 | CryptographicUnexpectedOperationException, 91 | PolicyException, 92 | IdentityNotMappedException, 93 | DecoderFallbackException, 94 | EncoderFallbackException, 95 | AbandonedMutexException, 96 | SynchronizationLockException, 97 | ThreadAbortException, 98 | ThreadInterruptedException, 99 | ThreadStartException, 100 | ThreadStateException, 101 | WaitHandleCannotBeOpenedException, 102 | ContractPlusAssertionException, 103 | ContractPlusAssumptionException, 104 | ContractPlusInvariantException, 105 | ContractPlusPostconditionException, 106 | ContractPlusPreconditionException, 107 | AddInBaseInAddInFolderException, 108 | AddInSegmentDirectoryNotFoundException, 109 | InvalidPipelineStoreException, 110 | GenericsNotImplementedException, 111 | ConfigurationErrorsException, 112 | ProviderException, 113 | InstallException, 114 | ModuleLoadException, 115 | ModuleLoadExceptionHandlerException, 116 | InvalidUdtException, 117 | ConstraintException, 118 | DataException, 119 | DBConcurrencyException, 120 | DeletedRowInaccessibleException, 121 | DuplicateNameException, 122 | EvaluateException, 123 | InRowChangingEventException, 124 | InvalidConstraintException, 125 | InvalidExpressionException, 126 | MissingPrimaryKeyException, 127 | NoNullAllowedException, 128 | OperationAbortedException, 129 | ReadOnlyException, 130 | RowNotInTableException, 131 | StrongTypingException, 132 | SyntaxErrorException, 133 | TypedDataSetGeneratorException, 134 | VersionNotFoundException, 135 | DbException, 136 | OdbcException, 137 | OleDbException, 138 | SqlException, 139 | SqlAlreadyFilledException, 140 | SqlNotFilledException, 141 | SqlNullValueException, 142 | SqlTruncateException, 143 | SqlTypeException, 144 | InvalidPrinterException, 145 | DirectoryServicesCOMException, 146 | ActiveDirectoryObjectExistsException, 147 | ActiveDirectoryObjectNotFoundException, 148 | ActiveDirectoryOperationException, 149 | ActiveDirectoryServerDownException, 150 | ForestTrustCollisionException, 151 | SyncFromAllServersOperationException, 152 | ManagementException, 153 | MessageQueueException, 154 | HttpCompileException, 155 | HttpException, 156 | HttpParseException, 157 | HttpRequestValidationException, 158 | HttpUnhandledException, 159 | DatabaseNotEnabledForNotificationException, 160 | TableNotEnabledForNotificationException, 161 | HostingEnvironmentException, 162 | SqlExecutionException, 163 | MembershipCreateUserException, 164 | MembershipPasswordException, 165 | ViewStateException, 166 | AxHostPlusInvalidActiveXStateException, 167 | CodeDomSerializerException, 168 | DataSourceGeneratorException, 169 | DataSourceSerializationException, 170 | InternalException, 171 | NameValidationException, 172 | XmlException, 173 | UpaException, 174 | XmlSchemaException, 175 | XmlSchemaInferenceException, 176 | XmlSchemaValidationException, 177 | XPathException, 178 | XsltCompileException, 179 | XsltException, 180 | UriFormatException, 181 | InvalidAsynchronousStateException, 182 | InvalidEnumArgumentException, 183 | LicenseException, 184 | WarningException, 185 | Win32Exception, 186 | CheckoutException, 187 | ConfigurationException, 188 | SettingsPropertyIsReadOnlyException, 189 | SettingsPropertyNotFoundException, 190 | SettingsPropertyWrongTypeException, 191 | InternalBufferOverflowException, 192 | InvalidDataException, 193 | CookieException, 194 | HttpListenerException, 195 | ProtocolViolationException, 196 | WebException, 197 | SmtpException, 198 | SmtpFailedRecipientException, 199 | SmtpFailedRecipientsException, 200 | NetworkInformationException, 201 | PingException, 202 | SocketException, 203 | AuthenticationException, 204 | InvalidCredentialException, 205 | SemaphoreFullException, -------------------------------------------------------------------------------- /tests/CTryCatchTest/CTryCatchTest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1A8307CD1C39649600A2F204 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8307CC1C39649600A2F204 /* main.c */; }; 11 | 1A8307D51C3964A900A2F204 /* ctrycatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8307D31C3964A900A2F204 /* ctrycatch.c */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | 1A8307C71C39649600A2F204 /* CopyFiles */ = { 16 | isa = PBXCopyFilesBuildPhase; 17 | buildActionMask = 2147483647; 18 | dstPath = /usr/share/man/man1/; 19 | dstSubfolderSpec = 0; 20 | files = ( 21 | ); 22 | runOnlyForDeploymentPostprocessing = 1; 23 | }; 24 | /* End PBXCopyFilesBuildPhase section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 1A8307C91C39649600A2F204 /* CTryCatchTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CTryCatchTest; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 1A8307CC1C39649600A2F204 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; 29 | 1A8307D31C3964A900A2F204 /* ctrycatch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ctrycatch.c; path = ../../../ctrycatch.c; sourceTree = ""; }; 30 | 1A8307D41C3964A900A2F204 /* ctrycatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ctrycatch.h; path = ../../../ctrycatch.h; sourceTree = ""; }; 31 | 1A8307D61C39714900A2F204 /* ctrycatch_exception_types.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ctrycatch_exception_types.conf; path = ../../../ctrycatch_exception_types.conf; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | 1A8307C61C39649600A2F204 /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 1A8307C01C39649600A2F204 = { 46 | isa = PBXGroup; 47 | children = ( 48 | 1A8307CB1C39649600A2F204 /* CTryCatchTest */, 49 | 1A8307CA1C39649600A2F204 /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | 1A8307CA1C39649600A2F204 /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 1A8307C91C39649600A2F204 /* CTryCatchTest */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | 1A8307CB1C39649600A2F204 /* CTryCatchTest */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 1A8307D31C3964A900A2F204 /* ctrycatch.c */, 65 | 1A8307D61C39714900A2F204 /* ctrycatch_exception_types.conf */, 66 | 1A8307D41C3964A900A2F204 /* ctrycatch.h */, 67 | 1A8307CC1C39649600A2F204 /* main.c */, 68 | ); 69 | path = CTryCatchTest; 70 | sourceTree = ""; 71 | }; 72 | /* End PBXGroup section */ 73 | 74 | /* Begin PBXNativeTarget section */ 75 | 1A8307C81C39649600A2F204 /* CTryCatchTest */ = { 76 | isa = PBXNativeTarget; 77 | buildConfigurationList = 1A8307D01C39649600A2F204 /* Build configuration list for PBXNativeTarget "CTryCatchTest" */; 78 | buildPhases = ( 79 | 1A8307C51C39649600A2F204 /* Sources */, 80 | 1A8307C61C39649600A2F204 /* Frameworks */, 81 | 1A8307C71C39649600A2F204 /* CopyFiles */, 82 | ); 83 | buildRules = ( 84 | ); 85 | dependencies = ( 86 | ); 87 | name = CTryCatchTest; 88 | productName = CTryCatchTest; 89 | productReference = 1A8307C91C39649600A2F204 /* CTryCatchTest */; 90 | productType = "com.apple.product-type.tool"; 91 | }; 92 | /* End PBXNativeTarget section */ 93 | 94 | /* Begin PBXProject section */ 95 | 1A8307C11C39649600A2F204 /* Project object */ = { 96 | isa = PBXProject; 97 | attributes = { 98 | LastUpgradeCheck = 0720; 99 | ORGANIZATIONNAME = "James Swineson"; 100 | TargetAttributes = { 101 | 1A8307C81C39649600A2F204 = { 102 | CreatedOnToolsVersion = 7.2; 103 | }; 104 | }; 105 | }; 106 | buildConfigurationList = 1A8307C41C39649600A2F204 /* Build configuration list for PBXProject "CTryCatchTest" */; 107 | compatibilityVersion = "Xcode 3.2"; 108 | developmentRegion = English; 109 | hasScannedForEncodings = 0; 110 | knownRegions = ( 111 | en, 112 | ); 113 | mainGroup = 1A8307C01C39649600A2F204; 114 | productRefGroup = 1A8307CA1C39649600A2F204 /* Products */; 115 | projectDirPath = ""; 116 | projectRoot = ""; 117 | targets = ( 118 | 1A8307C81C39649600A2F204 /* CTryCatchTest */, 119 | ); 120 | }; 121 | /* End PBXProject section */ 122 | 123 | /* Begin PBXSourcesBuildPhase section */ 124 | 1A8307C51C39649600A2F204 /* Sources */ = { 125 | isa = PBXSourcesBuildPhase; 126 | buildActionMask = 2147483647; 127 | files = ( 128 | 1A8307CD1C39649600A2F204 /* main.c in Sources */, 129 | 1A8307D51C3964A900A2F204 /* ctrycatch.c in Sources */, 130 | ); 131 | runOnlyForDeploymentPostprocessing = 0; 132 | }; 133 | /* End PBXSourcesBuildPhase section */ 134 | 135 | /* Begin XCBuildConfiguration section */ 136 | 1A8307CE1C39649600A2F204 /* Debug */ = { 137 | isa = XCBuildConfiguration; 138 | buildSettings = { 139 | ALWAYS_SEARCH_USER_PATHS = NO; 140 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 141 | CLANG_CXX_LIBRARY = "libc++"; 142 | CLANG_ENABLE_MODULES = YES; 143 | CLANG_ENABLE_OBJC_ARC = YES; 144 | CLANG_WARN_BOOL_CONVERSION = YES; 145 | CLANG_WARN_CONSTANT_CONVERSION = YES; 146 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 147 | CLANG_WARN_EMPTY_BODY = YES; 148 | CLANG_WARN_ENUM_CONVERSION = YES; 149 | CLANG_WARN_INT_CONVERSION = YES; 150 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 151 | CLANG_WARN_UNREACHABLE_CODE = YES; 152 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 153 | CODE_SIGN_IDENTITY = "-"; 154 | COPY_PHASE_STRIP = NO; 155 | DEBUG_INFORMATION_FORMAT = dwarf; 156 | ENABLE_STRICT_OBJC_MSGSEND = YES; 157 | ENABLE_TESTABILITY = YES; 158 | GCC_C_LANGUAGE_STANDARD = gnu99; 159 | GCC_DYNAMIC_NO_PIC = NO; 160 | GCC_NO_COMMON_BLOCKS = YES; 161 | GCC_OPTIMIZATION_LEVEL = 0; 162 | GCC_PREPROCESSOR_DEFINITIONS = ( 163 | "DEBUG=1", 164 | "$(inherited)", 165 | ); 166 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 167 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 168 | GCC_WARN_UNDECLARED_SELECTOR = YES; 169 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 170 | GCC_WARN_UNUSED_FUNCTION = YES; 171 | GCC_WARN_UNUSED_VARIABLE = YES; 172 | MACOSX_DEPLOYMENT_TARGET = 10.11; 173 | MTL_ENABLE_DEBUG_INFO = YES; 174 | ONLY_ACTIVE_ARCH = YES; 175 | SDKROOT = macosx; 176 | }; 177 | name = Debug; 178 | }; 179 | 1A8307CF1C39649600A2F204 /* Release */ = { 180 | isa = XCBuildConfiguration; 181 | buildSettings = { 182 | ALWAYS_SEARCH_USER_PATHS = NO; 183 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 184 | CLANG_CXX_LIBRARY = "libc++"; 185 | CLANG_ENABLE_MODULES = YES; 186 | CLANG_ENABLE_OBJC_ARC = YES; 187 | CLANG_WARN_BOOL_CONVERSION = YES; 188 | CLANG_WARN_CONSTANT_CONVERSION = YES; 189 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 190 | CLANG_WARN_EMPTY_BODY = YES; 191 | CLANG_WARN_ENUM_CONVERSION = YES; 192 | CLANG_WARN_INT_CONVERSION = YES; 193 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 194 | CLANG_WARN_UNREACHABLE_CODE = YES; 195 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 196 | CODE_SIGN_IDENTITY = "-"; 197 | COPY_PHASE_STRIP = NO; 198 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 199 | ENABLE_NS_ASSERTIONS = NO; 200 | ENABLE_STRICT_OBJC_MSGSEND = YES; 201 | GCC_C_LANGUAGE_STANDARD = gnu99; 202 | GCC_NO_COMMON_BLOCKS = YES; 203 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 204 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 205 | GCC_WARN_UNDECLARED_SELECTOR = YES; 206 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 207 | GCC_WARN_UNUSED_FUNCTION = YES; 208 | GCC_WARN_UNUSED_VARIABLE = YES; 209 | MACOSX_DEPLOYMENT_TARGET = 10.11; 210 | MTL_ENABLE_DEBUG_INFO = NO; 211 | SDKROOT = macosx; 212 | }; 213 | name = Release; 214 | }; 215 | 1A8307D11C39649600A2F204 /* Debug */ = { 216 | isa = XCBuildConfiguration; 217 | buildSettings = { 218 | PRODUCT_NAME = "$(TARGET_NAME)"; 219 | }; 220 | name = Debug; 221 | }; 222 | 1A8307D21C39649600A2F204 /* Release */ = { 223 | isa = XCBuildConfiguration; 224 | buildSettings = { 225 | PRODUCT_NAME = "$(TARGET_NAME)"; 226 | }; 227 | name = Release; 228 | }; 229 | /* End XCBuildConfiguration section */ 230 | 231 | /* Begin XCConfigurationList section */ 232 | 1A8307C41C39649600A2F204 /* Build configuration list for PBXProject "CTryCatchTest" */ = { 233 | isa = XCConfigurationList; 234 | buildConfigurations = ( 235 | 1A8307CE1C39649600A2F204 /* Debug */, 236 | 1A8307CF1C39649600A2F204 /* Release */, 237 | ); 238 | defaultConfigurationIsVisible = 0; 239 | defaultConfigurationName = Release; 240 | }; 241 | 1A8307D01C39649600A2F204 /* Build configuration list for PBXNativeTarget "CTryCatchTest" */ = { 242 | isa = XCConfigurationList; 243 | buildConfigurations = ( 244 | 1A8307D11C39649600A2F204 /* Debug */, 245 | 1A8307D21C39649600A2F204 /* Release */, 246 | ); 247 | defaultConfigurationIsVisible = 0; 248 | }; 249 | /* End XCConfigurationList section */ 250 | }; 251 | rootObject = 1A8307C11C39649600A2F204 /* Project object */; 252 | } 253 | --------------------------------------------------------------------------------