├── CSubSub ├── CSubSub.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── CSubSub.xccheckout │ │ └── xcuserdata │ │ │ └── plter.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── plter.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── CSubSub.xcscheme │ │ ├── E001UsingString.xcscheme │ │ ├── E002UsingFile.xcscheme │ │ ├── E003UsingList.xcscheme │ │ ├── E004UsingArray.xcscheme │ │ ├── E005UsingMap.xcscheme │ │ └── xcschememanagement.plist ├── E001UsingString │ ├── E001UsingString.1 │ └── main.c ├── E002UsingFile │ ├── Data.txt │ ├── E002UsingFile.1 │ └── main.c ├── E003UsingList │ ├── E003UsingList.1 │ └── main.c ├── E004UsingArray │ ├── E004UsingArray.1 │ └── main.c ├── E005UsingMap │ ├── E005UsingMap.1 │ └── main.c └── lib │ ├── css.h │ ├── cssArray.c │ ├── cssArray.h │ ├── cssFile.c │ ├── cssFile.h │ ├── cssList.c │ ├── cssList.h │ ├── cssMap.c │ ├── cssMap.h │ ├── cssObject.c │ ├── cssObject.h │ ├── cssString.c │ ├── cssString.h │ ├── cssSystem.c │ └── cssSystem.h └── README.md /CSubSub/CSubSub.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 310CD7C4192A4487004D4327 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 310CD7C3192A4487004D4327 /* main.c */; }; 11 | 310CD7C6192A4487004D4327 /* E001UsingString.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 310CD7C5192A4487004D4327 /* E001UsingString.1 */; }; 12 | 311B0DA0192F3861006A8A29 /* cssSystem.c in Sources */ = {isa = PBXBuildFile; fileRef = 311B0D9E192F3861006A8A29 /* cssSystem.c */; }; 13 | 311B0DA1192F3861006A8A29 /* cssSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 311B0D9F192F3861006A8A29 /* cssSystem.h */; }; 14 | 313BBBC7192CA21F00832B0B /* cssArray.c in Sources */ = {isa = PBXBuildFile; fileRef = 313BBBC5192CA21F00832B0B /* cssArray.c */; }; 15 | 313BBBC8192CA21F00832B0B /* cssArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 313BBBC6192CA21F00832B0B /* cssArray.h */; }; 16 | 313BBBD0192CB22D00832B0B /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 313BBBCF192CB22D00832B0B /* main.c */; }; 17 | 313BBBD2192CB22D00832B0B /* E004UsingArray.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 313BBBD1192CB22D00832B0B /* E004UsingArray.1 */; }; 18 | 313BBBD8192CB24300832B0B /* libCSubSub.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 310CD7B1192A441A004D4327 /* libCSubSub.a */; }; 19 | 318CF6111931EE1E00FFDA3A /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 318CF6101931EE1E00FFDA3A /* main.c */; }; 20 | 318CF6131931EE1E00FFDA3A /* E005UsingMap.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 318CF6121931EE1E00FFDA3A /* E005UsingMap.1 */; }; 21 | 318CF6171931EE9400FFDA3A /* libCSubSub.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 310CD7B1192A441A004D4327 /* libCSubSub.a */; }; 22 | 318CF6201931FE2400FFDA3A /* cssMap.c in Sources */ = {isa = PBXBuildFile; fileRef = 318CF61F1931FE2400FFDA3A /* cssMap.c */; }; 23 | 318CF6221931FE2D00FFDA3A /* cssMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 318CF6211931FE2D00FFDA3A /* cssMap.h */; }; 24 | 31E1380D192AC682006DDF4D /* libCSubSub.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 310CD7B1192A441A004D4327 /* libCSubSub.a */; }; 25 | 31E1381C192ACFED006DDF4D /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 31E1381B192ACFED006DDF4D /* main.c */; }; 26 | 31E1381E192ACFED006DDF4D /* E002UsingFile.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 31E1381D192ACFED006DDF4D /* E002UsingFile.1 */; }; 27 | 31E13823192AD0DD006DDF4D /* libCSubSub.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 310CD7B1192A441A004D4327 /* libCSubSub.a */; }; 28 | 31E1382D192AD437006DDF4D /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 31E1382C192AD437006DDF4D /* main.c */; }; 29 | 31E1382F192AD437006DDF4D /* E003UsingList.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 31E1382E192AD437006DDF4D /* E003UsingList.1 */; }; 30 | 31E13835192AD449006DDF4D /* libCSubSub.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 310CD7B1192A441A004D4327 /* libCSubSub.a */; }; 31 | 31E13838192AD67D006DDF4D /* cssString.c in Sources */ = {isa = PBXBuildFile; fileRef = 31E13836192AD67D006DDF4D /* cssString.c */; }; 32 | 31E13839192AD67D006DDF4D /* cssString.h in Headers */ = {isa = PBXBuildFile; fileRef = 31E13837192AD67D006DDF4D /* cssString.h */; }; 33 | 31E1383C192AD6D0006DDF4D /* cssObject.c in Sources */ = {isa = PBXBuildFile; fileRef = 31E1383A192AD6D0006DDF4D /* cssObject.c */; }; 34 | 31E1383D192AD6D0006DDF4D /* cssObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 31E1383B192AD6D0006DDF4D /* cssObject.h */; }; 35 | 31E13840192AD7BD006DDF4D /* cssFile.c in Sources */ = {isa = PBXBuildFile; fileRef = 31E1383E192AD7BD006DDF4D /* cssFile.c */; }; 36 | 31E13841192AD7BD006DDF4D /* cssFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 31E1383F192AD7BD006DDF4D /* cssFile.h */; }; 37 | 31E13844192AD841006DDF4D /* cssList.c in Sources */ = {isa = PBXBuildFile; fileRef = 31E13842192AD840006DDF4D /* cssList.c */; }; 38 | 31E13845192AD841006DDF4D /* cssList.h in Headers */ = {isa = PBXBuildFile; fileRef = 31E13843192AD841006DDF4D /* cssList.h */; }; 39 | /* End PBXBuildFile section */ 40 | 41 | /* Begin PBXContainerItemProxy section */ 42 | 313BBBD6192CB23E00832B0B /* PBXContainerItemProxy */ = { 43 | isa = PBXContainerItemProxy; 44 | containerPortal = 310CD7A9192A441A004D4327 /* Project object */; 45 | proxyType = 1; 46 | remoteGlobalIDString = 310CD7B0192A441A004D4327; 47 | remoteInfo = CSubSub; 48 | }; 49 | 318CF6181931EE9900FFDA3A /* PBXContainerItemProxy */ = { 50 | isa = PBXContainerItemProxy; 51 | containerPortal = 310CD7A9192A441A004D4327 /* Project object */; 52 | proxyType = 1; 53 | remoteGlobalIDString = 310CD7B0192A441A004D4327; 54 | remoteInfo = CSubSub; 55 | }; 56 | 31E1380E192AC68A006DDF4D /* PBXContainerItemProxy */ = { 57 | isa = PBXContainerItemProxy; 58 | containerPortal = 310CD7A9192A441A004D4327 /* Project object */; 59 | proxyType = 1; 60 | remoteGlobalIDString = 310CD7B0192A441A004D4327; 61 | remoteInfo = CSubSub; 62 | }; 63 | 31E13824192AD0E4006DDF4D /* PBXContainerItemProxy */ = { 64 | isa = PBXContainerItemProxy; 65 | containerPortal = 310CD7A9192A441A004D4327 /* Project object */; 66 | proxyType = 1; 67 | remoteGlobalIDString = 310CD7B0192A441A004D4327; 68 | remoteInfo = CSubSub; 69 | }; 70 | 31E13833192AD445006DDF4D /* PBXContainerItemProxy */ = { 71 | isa = PBXContainerItemProxy; 72 | containerPortal = 310CD7A9192A441A004D4327 /* Project object */; 73 | proxyType = 1; 74 | remoteGlobalIDString = 310CD7B0192A441A004D4327; 75 | remoteInfo = CSubSub; 76 | }; 77 | /* End PBXContainerItemProxy section */ 78 | 79 | /* Begin PBXCopyFilesBuildPhase section */ 80 | 310CD7BF192A4487004D4327 /* CopyFiles */ = { 81 | isa = PBXCopyFilesBuildPhase; 82 | buildActionMask = 2147483647; 83 | dstPath = /usr/share/man/man1/; 84 | dstSubfolderSpec = 0; 85 | files = ( 86 | 310CD7C6192A4487004D4327 /* E001UsingString.1 in CopyFiles */, 87 | ); 88 | runOnlyForDeploymentPostprocessing = 1; 89 | }; 90 | 313BBBCB192CB22C00832B0B /* CopyFiles */ = { 91 | isa = PBXCopyFilesBuildPhase; 92 | buildActionMask = 2147483647; 93 | dstPath = /usr/share/man/man1/; 94 | dstSubfolderSpec = 0; 95 | files = ( 96 | 313BBBD2192CB22D00832B0B /* E004UsingArray.1 in CopyFiles */, 97 | ); 98 | runOnlyForDeploymentPostprocessing = 1; 99 | }; 100 | 318CF60C1931EE1E00FFDA3A /* CopyFiles */ = { 101 | isa = PBXCopyFilesBuildPhase; 102 | buildActionMask = 2147483647; 103 | dstPath = /usr/share/man/man1/; 104 | dstSubfolderSpec = 0; 105 | files = ( 106 | 318CF6131931EE1E00FFDA3A /* E005UsingMap.1 in CopyFiles */, 107 | ); 108 | runOnlyForDeploymentPostprocessing = 1; 109 | }; 110 | 31E13817192ACFED006DDF4D /* CopyFiles */ = { 111 | isa = PBXCopyFilesBuildPhase; 112 | buildActionMask = 2147483647; 113 | dstPath = /usr/share/man/man1/; 114 | dstSubfolderSpec = 0; 115 | files = ( 116 | 31E1381E192ACFED006DDF4D /* E002UsingFile.1 in CopyFiles */, 117 | ); 118 | runOnlyForDeploymentPostprocessing = 1; 119 | }; 120 | 31E13828192AD437006DDF4D /* CopyFiles */ = { 121 | isa = PBXCopyFilesBuildPhase; 122 | buildActionMask = 2147483647; 123 | dstPath = /usr/share/man/man1/; 124 | dstSubfolderSpec = 0; 125 | files = ( 126 | 31E1382F192AD437006DDF4D /* E003UsingList.1 in CopyFiles */, 127 | ); 128 | runOnlyForDeploymentPostprocessing = 1; 129 | }; 130 | /* End PBXCopyFilesBuildPhase section */ 131 | 132 | /* Begin PBXFileReference section */ 133 | 310CD7B1192A441A004D4327 /* libCSubSub.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCSubSub.a; sourceTree = BUILT_PRODUCTS_DIR; }; 134 | 310CD7C1192A4487004D4327 /* E001UsingString */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = E001UsingString; sourceTree = BUILT_PRODUCTS_DIR; }; 135 | 310CD7C3192A4487004D4327 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; 136 | 310CD7C5192A4487004D4327 /* E001UsingString.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = E001UsingString.1; sourceTree = ""; }; 137 | 311B0D9E192F3861006A8A29 /* cssSystem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cssSystem.c; path = lib/cssSystem.c; sourceTree = ""; }; 138 | 311B0D9F192F3861006A8A29 /* cssSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cssSystem.h; path = lib/cssSystem.h; sourceTree = ""; }; 139 | 313BBBC5192CA21F00832B0B /* cssArray.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cssArray.c; path = lib/cssArray.c; sourceTree = ""; }; 140 | 313BBBC6192CA21F00832B0B /* cssArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cssArray.h; path = lib/cssArray.h; sourceTree = ""; }; 141 | 313BBBCD192CB22C00832B0B /* E004UsingArray */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = E004UsingArray; sourceTree = BUILT_PRODUCTS_DIR; }; 142 | 313BBBCF192CB22D00832B0B /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; 143 | 313BBBD1192CB22D00832B0B /* E004UsingArray.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = E004UsingArray.1; sourceTree = ""; }; 144 | 316C693419434BBF0058206F /* Data.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Data.txt; sourceTree = ""; }; 145 | 318CF60E1931EE1E00FFDA3A /* E005UsingMap */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = E005UsingMap; sourceTree = BUILT_PRODUCTS_DIR; }; 146 | 318CF6101931EE1E00FFDA3A /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; 147 | 318CF6121931EE1E00FFDA3A /* E005UsingMap.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = E005UsingMap.1; sourceTree = ""; }; 148 | 318CF61F1931FE2400FFDA3A /* cssMap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cssMap.c; path = lib/cssMap.c; sourceTree = ""; }; 149 | 318CF6211931FE2D00FFDA3A /* cssMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cssMap.h; path = lib/cssMap.h; sourceTree = ""; }; 150 | 31E13814192AC6F6006DDF4D /* css.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = css.h; path = lib/css.h; sourceTree = ""; }; 151 | 31E13819192ACFED006DDF4D /* E002UsingFile */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = E002UsingFile; sourceTree = BUILT_PRODUCTS_DIR; }; 152 | 31E1381B192ACFED006DDF4D /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; 153 | 31E1381D192ACFED006DDF4D /* E002UsingFile.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = E002UsingFile.1; sourceTree = ""; }; 154 | 31E1382A192AD437006DDF4D /* E003UsingList */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = E003UsingList; sourceTree = BUILT_PRODUCTS_DIR; }; 155 | 31E1382C192AD437006DDF4D /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; 156 | 31E1382E192AD437006DDF4D /* E003UsingList.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = E003UsingList.1; sourceTree = ""; }; 157 | 31E13836192AD67D006DDF4D /* cssString.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cssString.c; path = lib/cssString.c; sourceTree = ""; }; 158 | 31E13837192AD67D006DDF4D /* cssString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cssString.h; path = lib/cssString.h; sourceTree = ""; }; 159 | 31E1383A192AD6D0006DDF4D /* cssObject.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cssObject.c; path = lib/cssObject.c; sourceTree = ""; }; 160 | 31E1383B192AD6D0006DDF4D /* cssObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cssObject.h; path = lib/cssObject.h; sourceTree = ""; }; 161 | 31E1383E192AD7BD006DDF4D /* cssFile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cssFile.c; path = lib/cssFile.c; sourceTree = ""; }; 162 | 31E1383F192AD7BD006DDF4D /* cssFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cssFile.h; path = lib/cssFile.h; sourceTree = ""; }; 163 | 31E13842192AD840006DDF4D /* cssList.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cssList.c; path = lib/cssList.c; sourceTree = ""; }; 164 | 31E13843192AD841006DDF4D /* cssList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cssList.h; path = lib/cssList.h; sourceTree = ""; }; 165 | /* End PBXFileReference section */ 166 | 167 | /* Begin PBXFrameworksBuildPhase section */ 168 | 310CD7AE192A441A004D4327 /* Frameworks */ = { 169 | isa = PBXFrameworksBuildPhase; 170 | buildActionMask = 2147483647; 171 | files = ( 172 | ); 173 | runOnlyForDeploymentPostprocessing = 0; 174 | }; 175 | 310CD7BE192A4487004D4327 /* Frameworks */ = { 176 | isa = PBXFrameworksBuildPhase; 177 | buildActionMask = 2147483647; 178 | files = ( 179 | 31E1380D192AC682006DDF4D /* libCSubSub.a in Frameworks */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | 313BBBCA192CB22C00832B0B /* Frameworks */ = { 184 | isa = PBXFrameworksBuildPhase; 185 | buildActionMask = 2147483647; 186 | files = ( 187 | 313BBBD8192CB24300832B0B /* libCSubSub.a in Frameworks */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | 318CF60B1931EE1E00FFDA3A /* Frameworks */ = { 192 | isa = PBXFrameworksBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | 318CF6171931EE9400FFDA3A /* libCSubSub.a in Frameworks */, 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | }; 199 | 31E13816192ACFED006DDF4D /* Frameworks */ = { 200 | isa = PBXFrameworksBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | 31E13823192AD0DD006DDF4D /* libCSubSub.a in Frameworks */, 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | 31E13827192AD437006DDF4D /* Frameworks */ = { 208 | isa = PBXFrameworksBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | 31E13835192AD449006DDF4D /* libCSubSub.a in Frameworks */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXFrameworksBuildPhase section */ 216 | 217 | /* Begin PBXGroup section */ 218 | 310CD7A8192A441A004D4327 = { 219 | isa = PBXGroup; 220 | children = ( 221 | 310CD7B8192A4431004D4327 /* lib */, 222 | 310CD7C2192A4487004D4327 /* E001UsingString */, 223 | 31E1381A192ACFED006DDF4D /* E002UsingFile */, 224 | 31E1382B192AD437006DDF4D /* E003UsingList */, 225 | 313BBBCE192CB22D00832B0B /* E004UsingArray */, 226 | 318CF60F1931EE1E00FFDA3A /* E005UsingMap */, 227 | 310CD7B2192A441A004D4327 /* Products */, 228 | ); 229 | sourceTree = ""; 230 | }; 231 | 310CD7B2192A441A004D4327 /* Products */ = { 232 | isa = PBXGroup; 233 | children = ( 234 | 310CD7B1192A441A004D4327 /* libCSubSub.a */, 235 | 310CD7C1192A4487004D4327 /* E001UsingString */, 236 | 31E13819192ACFED006DDF4D /* E002UsingFile */, 237 | 31E1382A192AD437006DDF4D /* E003UsingList */, 238 | 313BBBCD192CB22C00832B0B /* E004UsingArray */, 239 | 318CF60E1931EE1E00FFDA3A /* E005UsingMap */, 240 | ); 241 | name = Products; 242 | sourceTree = ""; 243 | }; 244 | 310CD7B8192A4431004D4327 /* lib */ = { 245 | isa = PBXGroup; 246 | children = ( 247 | 31E1386C192AEE48006DDF4D /* source */, 248 | 31E1386B192AEE29006DDF4D /* header */, 249 | ); 250 | name = lib; 251 | sourceTree = ""; 252 | }; 253 | 310CD7C2192A4487004D4327 /* E001UsingString */ = { 254 | isa = PBXGroup; 255 | children = ( 256 | 310CD7C3192A4487004D4327 /* main.c */, 257 | 310CD7C5192A4487004D4327 /* E001UsingString.1 */, 258 | ); 259 | path = E001UsingString; 260 | sourceTree = ""; 261 | }; 262 | 313BBBCE192CB22D00832B0B /* E004UsingArray */ = { 263 | isa = PBXGroup; 264 | children = ( 265 | 313BBBCF192CB22D00832B0B /* main.c */, 266 | 313BBBD1192CB22D00832B0B /* E004UsingArray.1 */, 267 | ); 268 | path = E004UsingArray; 269 | sourceTree = ""; 270 | }; 271 | 318CF60F1931EE1E00FFDA3A /* E005UsingMap */ = { 272 | isa = PBXGroup; 273 | children = ( 274 | 318CF6101931EE1E00FFDA3A /* main.c */, 275 | 318CF6121931EE1E00FFDA3A /* E005UsingMap.1 */, 276 | ); 277 | path = E005UsingMap; 278 | sourceTree = ""; 279 | }; 280 | 31E1381A192ACFED006DDF4D /* E002UsingFile */ = { 281 | isa = PBXGroup; 282 | children = ( 283 | 316C693419434BBF0058206F /* Data.txt */, 284 | 31E1381B192ACFED006DDF4D /* main.c */, 285 | 31E1381D192ACFED006DDF4D /* E002UsingFile.1 */, 286 | ); 287 | path = E002UsingFile; 288 | sourceTree = ""; 289 | }; 290 | 31E1382B192AD437006DDF4D /* E003UsingList */ = { 291 | isa = PBXGroup; 292 | children = ( 293 | 31E1382C192AD437006DDF4D /* main.c */, 294 | 31E1382E192AD437006DDF4D /* E003UsingList.1 */, 295 | ); 296 | path = E003UsingList; 297 | sourceTree = ""; 298 | }; 299 | 31E1386B192AEE29006DDF4D /* header */ = { 300 | isa = PBXGroup; 301 | children = ( 302 | 318CF6211931FE2D00FFDA3A /* cssMap.h */, 303 | 311B0D9F192F3861006A8A29 /* cssSystem.h */, 304 | 313BBBC6192CA21F00832B0B /* cssArray.h */, 305 | 31E1383F192AD7BD006DDF4D /* cssFile.h */, 306 | 31E13837192AD67D006DDF4D /* cssString.h */, 307 | 31E1383B192AD6D0006DDF4D /* cssObject.h */, 308 | 31E13843192AD841006DDF4D /* cssList.h */, 309 | 31E13814192AC6F6006DDF4D /* css.h */, 310 | ); 311 | name = header; 312 | sourceTree = ""; 313 | }; 314 | 31E1386C192AEE48006DDF4D /* source */ = { 315 | isa = PBXGroup; 316 | children = ( 317 | 318CF61F1931FE2400FFDA3A /* cssMap.c */, 318 | 311B0D9E192F3861006A8A29 /* cssSystem.c */, 319 | 313BBBC5192CA21F00832B0B /* cssArray.c */, 320 | 31E1383E192AD7BD006DDF4D /* cssFile.c */, 321 | 31E13836192AD67D006DDF4D /* cssString.c */, 322 | 31E1383A192AD6D0006DDF4D /* cssObject.c */, 323 | 31E13842192AD840006DDF4D /* cssList.c */, 324 | ); 325 | name = source; 326 | sourceTree = ""; 327 | }; 328 | /* End PBXGroup section */ 329 | 330 | /* Begin PBXHeadersBuildPhase section */ 331 | 310CD7AF192A441A004D4327 /* Headers */ = { 332 | isa = PBXHeadersBuildPhase; 333 | buildActionMask = 2147483647; 334 | files = ( 335 | 31E13841192AD7BD006DDF4D /* cssFile.h in Headers */, 336 | 311B0DA1192F3861006A8A29 /* cssSystem.h in Headers */, 337 | 31E13839192AD67D006DDF4D /* cssString.h in Headers */, 338 | 318CF6221931FE2D00FFDA3A /* cssMap.h in Headers */, 339 | 31E13845192AD841006DDF4D /* cssList.h in Headers */, 340 | 31E1383D192AD6D0006DDF4D /* cssObject.h in Headers */, 341 | 313BBBC8192CA21F00832B0B /* cssArray.h in Headers */, 342 | ); 343 | runOnlyForDeploymentPostprocessing = 0; 344 | }; 345 | /* End PBXHeadersBuildPhase section */ 346 | 347 | /* Begin PBXNativeTarget section */ 348 | 310CD7B0192A441A004D4327 /* CSubSub */ = { 349 | isa = PBXNativeTarget; 350 | buildConfigurationList = 310CD7B5192A441A004D4327 /* Build configuration list for PBXNativeTarget "CSubSub" */; 351 | buildPhases = ( 352 | 310CD7AD192A441A004D4327 /* Sources */, 353 | 310CD7AE192A441A004D4327 /* Frameworks */, 354 | 310CD7AF192A441A004D4327 /* Headers */, 355 | ); 356 | buildRules = ( 357 | ); 358 | dependencies = ( 359 | ); 360 | name = CSubSub; 361 | productName = CSubSub; 362 | productReference = 310CD7B1192A441A004D4327 /* libCSubSub.a */; 363 | productType = "com.apple.product-type.library.static"; 364 | }; 365 | 310CD7C0192A4487004D4327 /* E001UsingString */ = { 366 | isa = PBXNativeTarget; 367 | buildConfigurationList = 310CD7C7192A4487004D4327 /* Build configuration list for PBXNativeTarget "E001UsingString" */; 368 | buildPhases = ( 369 | 310CD7BD192A4487004D4327 /* Sources */, 370 | 310CD7BE192A4487004D4327 /* Frameworks */, 371 | 310CD7BF192A4487004D4327 /* CopyFiles */, 372 | ); 373 | buildRules = ( 374 | ); 375 | dependencies = ( 376 | 31E1380F192AC68A006DDF4D /* PBXTargetDependency */, 377 | ); 378 | name = E001UsingString; 379 | productName = E001UsingString; 380 | productReference = 310CD7C1192A4487004D4327 /* E001UsingString */; 381 | productType = "com.apple.product-type.tool"; 382 | }; 383 | 313BBBCC192CB22C00832B0B /* E004UsingArray */ = { 384 | isa = PBXNativeTarget; 385 | buildConfigurationList = 313BBBD3192CB22D00832B0B /* Build configuration list for PBXNativeTarget "E004UsingArray" */; 386 | buildPhases = ( 387 | 313BBBC9192CB22C00832B0B /* Sources */, 388 | 313BBBCA192CB22C00832B0B /* Frameworks */, 389 | 313BBBCB192CB22C00832B0B /* CopyFiles */, 390 | ); 391 | buildRules = ( 392 | ); 393 | dependencies = ( 394 | 313BBBD7192CB23E00832B0B /* PBXTargetDependency */, 395 | ); 396 | name = E004UsingArray; 397 | productName = E004UsingArray; 398 | productReference = 313BBBCD192CB22C00832B0B /* E004UsingArray */; 399 | productType = "com.apple.product-type.tool"; 400 | }; 401 | 318CF60D1931EE1E00FFDA3A /* E005UsingMap */ = { 402 | isa = PBXNativeTarget; 403 | buildConfigurationList = 318CF6161931EE1E00FFDA3A /* Build configuration list for PBXNativeTarget "E005UsingMap" */; 404 | buildPhases = ( 405 | 318CF60A1931EE1E00FFDA3A /* Sources */, 406 | 318CF60B1931EE1E00FFDA3A /* Frameworks */, 407 | 318CF60C1931EE1E00FFDA3A /* CopyFiles */, 408 | ); 409 | buildRules = ( 410 | ); 411 | dependencies = ( 412 | 318CF6191931EE9900FFDA3A /* PBXTargetDependency */, 413 | ); 414 | name = E005UsingMap; 415 | productName = E005UsingMap; 416 | productReference = 318CF60E1931EE1E00FFDA3A /* E005UsingMap */; 417 | productType = "com.apple.product-type.tool"; 418 | }; 419 | 31E13818192ACFED006DDF4D /* E002UsingFile */ = { 420 | isa = PBXNativeTarget; 421 | buildConfigurationList = 31E1381F192ACFED006DDF4D /* Build configuration list for PBXNativeTarget "E002UsingFile" */; 422 | buildPhases = ( 423 | 31E13815192ACFED006DDF4D /* Sources */, 424 | 31E13816192ACFED006DDF4D /* Frameworks */, 425 | 31E13817192ACFED006DDF4D /* CopyFiles */, 426 | ); 427 | buildRules = ( 428 | ); 429 | dependencies = ( 430 | 31E13825192AD0E4006DDF4D /* PBXTargetDependency */, 431 | ); 432 | name = E002UsingFile; 433 | productName = E002UsingFile; 434 | productReference = 31E13819192ACFED006DDF4D /* E002UsingFile */; 435 | productType = "com.apple.product-type.tool"; 436 | }; 437 | 31E13829192AD437006DDF4D /* E003UsingList */ = { 438 | isa = PBXNativeTarget; 439 | buildConfigurationList = 31E13830192AD437006DDF4D /* Build configuration list for PBXNativeTarget "E003UsingList" */; 440 | buildPhases = ( 441 | 31E13826192AD437006DDF4D /* Sources */, 442 | 31E13827192AD437006DDF4D /* Frameworks */, 443 | 31E13828192AD437006DDF4D /* CopyFiles */, 444 | ); 445 | buildRules = ( 446 | ); 447 | dependencies = ( 448 | 31E13834192AD445006DDF4D /* PBXTargetDependency */, 449 | ); 450 | name = E003UsingList; 451 | productName = E003UsingList; 452 | productReference = 31E1382A192AD437006DDF4D /* E003UsingList */; 453 | productType = "com.apple.product-type.tool"; 454 | }; 455 | /* End PBXNativeTarget section */ 456 | 457 | /* Begin PBXProject section */ 458 | 310CD7A9192A441A004D4327 /* Project object */ = { 459 | isa = PBXProject; 460 | attributes = { 461 | LastUpgradeCheck = 0510; 462 | ORGANIZATIONNAME = plter; 463 | }; 464 | buildConfigurationList = 310CD7AC192A441A004D4327 /* Build configuration list for PBXProject "CSubSub" */; 465 | compatibilityVersion = "Xcode 3.2"; 466 | developmentRegion = English; 467 | hasScannedForEncodings = 0; 468 | knownRegions = ( 469 | en, 470 | ); 471 | mainGroup = 310CD7A8192A441A004D4327; 472 | productRefGroup = 310CD7B2192A441A004D4327 /* Products */; 473 | projectDirPath = ""; 474 | projectRoot = ""; 475 | targets = ( 476 | 310CD7B0192A441A004D4327 /* CSubSub */, 477 | 310CD7C0192A4487004D4327 /* E001UsingString */, 478 | 31E13818192ACFED006DDF4D /* E002UsingFile */, 479 | 31E13829192AD437006DDF4D /* E003UsingList */, 480 | 313BBBCC192CB22C00832B0B /* E004UsingArray */, 481 | 318CF60D1931EE1E00FFDA3A /* E005UsingMap */, 482 | ); 483 | }; 484 | /* End PBXProject section */ 485 | 486 | /* Begin PBXSourcesBuildPhase section */ 487 | 310CD7AD192A441A004D4327 /* Sources */ = { 488 | isa = PBXSourcesBuildPhase; 489 | buildActionMask = 2147483647; 490 | files = ( 491 | 31E13838192AD67D006DDF4D /* cssString.c in Sources */, 492 | 31E13840192AD7BD006DDF4D /* cssFile.c in Sources */, 493 | 31E13844192AD841006DDF4D /* cssList.c in Sources */, 494 | 31E1383C192AD6D0006DDF4D /* cssObject.c in Sources */, 495 | 311B0DA0192F3861006A8A29 /* cssSystem.c in Sources */, 496 | 313BBBC7192CA21F00832B0B /* cssArray.c in Sources */, 497 | 318CF6201931FE2400FFDA3A /* cssMap.c in Sources */, 498 | ); 499 | runOnlyForDeploymentPostprocessing = 0; 500 | }; 501 | 310CD7BD192A4487004D4327 /* Sources */ = { 502 | isa = PBXSourcesBuildPhase; 503 | buildActionMask = 2147483647; 504 | files = ( 505 | 310CD7C4192A4487004D4327 /* main.c in Sources */, 506 | ); 507 | runOnlyForDeploymentPostprocessing = 0; 508 | }; 509 | 313BBBC9192CB22C00832B0B /* Sources */ = { 510 | isa = PBXSourcesBuildPhase; 511 | buildActionMask = 2147483647; 512 | files = ( 513 | 313BBBD0192CB22D00832B0B /* main.c in Sources */, 514 | ); 515 | runOnlyForDeploymentPostprocessing = 0; 516 | }; 517 | 318CF60A1931EE1E00FFDA3A /* Sources */ = { 518 | isa = PBXSourcesBuildPhase; 519 | buildActionMask = 2147483647; 520 | files = ( 521 | 318CF6111931EE1E00FFDA3A /* main.c in Sources */, 522 | ); 523 | runOnlyForDeploymentPostprocessing = 0; 524 | }; 525 | 31E13815192ACFED006DDF4D /* Sources */ = { 526 | isa = PBXSourcesBuildPhase; 527 | buildActionMask = 2147483647; 528 | files = ( 529 | 31E1381C192ACFED006DDF4D /* main.c in Sources */, 530 | ); 531 | runOnlyForDeploymentPostprocessing = 0; 532 | }; 533 | 31E13826192AD437006DDF4D /* Sources */ = { 534 | isa = PBXSourcesBuildPhase; 535 | buildActionMask = 2147483647; 536 | files = ( 537 | 31E1382D192AD437006DDF4D /* main.c in Sources */, 538 | ); 539 | runOnlyForDeploymentPostprocessing = 0; 540 | }; 541 | /* End PBXSourcesBuildPhase section */ 542 | 543 | /* Begin PBXTargetDependency section */ 544 | 313BBBD7192CB23E00832B0B /* PBXTargetDependency */ = { 545 | isa = PBXTargetDependency; 546 | target = 310CD7B0192A441A004D4327 /* CSubSub */; 547 | targetProxy = 313BBBD6192CB23E00832B0B /* PBXContainerItemProxy */; 548 | }; 549 | 318CF6191931EE9900FFDA3A /* PBXTargetDependency */ = { 550 | isa = PBXTargetDependency; 551 | target = 310CD7B0192A441A004D4327 /* CSubSub */; 552 | targetProxy = 318CF6181931EE9900FFDA3A /* PBXContainerItemProxy */; 553 | }; 554 | 31E1380F192AC68A006DDF4D /* PBXTargetDependency */ = { 555 | isa = PBXTargetDependency; 556 | target = 310CD7B0192A441A004D4327 /* CSubSub */; 557 | targetProxy = 31E1380E192AC68A006DDF4D /* PBXContainerItemProxy */; 558 | }; 559 | 31E13825192AD0E4006DDF4D /* PBXTargetDependency */ = { 560 | isa = PBXTargetDependency; 561 | target = 310CD7B0192A441A004D4327 /* CSubSub */; 562 | targetProxy = 31E13824192AD0E4006DDF4D /* PBXContainerItemProxy */; 563 | }; 564 | 31E13834192AD445006DDF4D /* PBXTargetDependency */ = { 565 | isa = PBXTargetDependency; 566 | target = 310CD7B0192A441A004D4327 /* CSubSub */; 567 | targetProxy = 31E13833192AD445006DDF4D /* PBXContainerItemProxy */; 568 | }; 569 | /* End PBXTargetDependency section */ 570 | 571 | /* Begin XCBuildConfiguration section */ 572 | 310CD7B3192A441A004D4327 /* Debug */ = { 573 | isa = XCBuildConfiguration; 574 | buildSettings = { 575 | ALWAYS_SEARCH_USER_PATHS = NO; 576 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 577 | CLANG_CXX_LIBRARY = "libc++"; 578 | CLANG_ENABLE_MODULES = YES; 579 | CLANG_ENABLE_OBJC_ARC = YES; 580 | CLANG_WARN_BOOL_CONVERSION = YES; 581 | CLANG_WARN_CONSTANT_CONVERSION = YES; 582 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 583 | CLANG_WARN_EMPTY_BODY = YES; 584 | CLANG_WARN_ENUM_CONVERSION = YES; 585 | CLANG_WARN_INT_CONVERSION = YES; 586 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 587 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 588 | COPY_PHASE_STRIP = NO; 589 | GCC_C_LANGUAGE_STANDARD = gnu99; 590 | GCC_DYNAMIC_NO_PIC = NO; 591 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 592 | GCC_OPTIMIZATION_LEVEL = 0; 593 | GCC_PREPROCESSOR_DEFINITIONS = ( 594 | "DEBUG=1", 595 | "$(inherited)", 596 | ); 597 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 598 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 599 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 600 | GCC_WARN_UNDECLARED_SELECTOR = YES; 601 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 602 | GCC_WARN_UNUSED_FUNCTION = YES; 603 | GCC_WARN_UNUSED_VARIABLE = YES; 604 | MACOSX_DEPLOYMENT_TARGET = 10.9; 605 | ONLY_ACTIVE_ARCH = YES; 606 | SDKROOT = macosx; 607 | }; 608 | name = Debug; 609 | }; 610 | 310CD7B4192A441A004D4327 /* Release */ = { 611 | isa = XCBuildConfiguration; 612 | buildSettings = { 613 | ALWAYS_SEARCH_USER_PATHS = NO; 614 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 615 | CLANG_CXX_LIBRARY = "libc++"; 616 | CLANG_ENABLE_MODULES = YES; 617 | CLANG_ENABLE_OBJC_ARC = YES; 618 | CLANG_WARN_BOOL_CONVERSION = YES; 619 | CLANG_WARN_CONSTANT_CONVERSION = YES; 620 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 621 | CLANG_WARN_EMPTY_BODY = YES; 622 | CLANG_WARN_ENUM_CONVERSION = YES; 623 | CLANG_WARN_INT_CONVERSION = YES; 624 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 625 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 626 | COPY_PHASE_STRIP = YES; 627 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 628 | ENABLE_NS_ASSERTIONS = NO; 629 | GCC_C_LANGUAGE_STANDARD = gnu99; 630 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 631 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 632 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 633 | GCC_WARN_UNDECLARED_SELECTOR = YES; 634 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 635 | GCC_WARN_UNUSED_FUNCTION = YES; 636 | GCC_WARN_UNUSED_VARIABLE = YES; 637 | MACOSX_DEPLOYMENT_TARGET = 10.9; 638 | SDKROOT = macosx; 639 | }; 640 | name = Release; 641 | }; 642 | 310CD7B6192A441A004D4327 /* Debug */ = { 643 | isa = XCBuildConfiguration; 644 | buildSettings = { 645 | EXECUTABLE_PREFIX = lib; 646 | PRODUCT_NAME = "$(TARGET_NAME)"; 647 | }; 648 | name = Debug; 649 | }; 650 | 310CD7B7192A441A004D4327 /* Release */ = { 651 | isa = XCBuildConfiguration; 652 | buildSettings = { 653 | EXECUTABLE_PREFIX = lib; 654 | PRODUCT_NAME = "$(TARGET_NAME)"; 655 | }; 656 | name = Release; 657 | }; 658 | 310CD7C8192A4487004D4327 /* Debug */ = { 659 | isa = XCBuildConfiguration; 660 | buildSettings = { 661 | GCC_PREPROCESSOR_DEFINITIONS = ( 662 | "DEBUG=1", 663 | "$(inherited)", 664 | ); 665 | PRODUCT_NAME = "$(TARGET_NAME)"; 666 | }; 667 | name = Debug; 668 | }; 669 | 310CD7C9192A4487004D4327 /* Release */ = { 670 | isa = XCBuildConfiguration; 671 | buildSettings = { 672 | PRODUCT_NAME = "$(TARGET_NAME)"; 673 | }; 674 | name = Release; 675 | }; 676 | 313BBBD4192CB22D00832B0B /* Debug */ = { 677 | isa = XCBuildConfiguration; 678 | buildSettings = { 679 | GCC_PREPROCESSOR_DEFINITIONS = ( 680 | "DEBUG=1", 681 | "$(inherited)", 682 | ); 683 | PRODUCT_NAME = "$(TARGET_NAME)"; 684 | }; 685 | name = Debug; 686 | }; 687 | 313BBBD5192CB22D00832B0B /* Release */ = { 688 | isa = XCBuildConfiguration; 689 | buildSettings = { 690 | PRODUCT_NAME = "$(TARGET_NAME)"; 691 | }; 692 | name = Release; 693 | }; 694 | 318CF6141931EE1E00FFDA3A /* Debug */ = { 695 | isa = XCBuildConfiguration; 696 | buildSettings = { 697 | GCC_PREPROCESSOR_DEFINITIONS = ( 698 | "DEBUG=1", 699 | "$(inherited)", 700 | ); 701 | PRODUCT_NAME = "$(TARGET_NAME)"; 702 | }; 703 | name = Debug; 704 | }; 705 | 318CF6151931EE1E00FFDA3A /* Release */ = { 706 | isa = XCBuildConfiguration; 707 | buildSettings = { 708 | PRODUCT_NAME = "$(TARGET_NAME)"; 709 | }; 710 | name = Release; 711 | }; 712 | 31E13820192ACFED006DDF4D /* Debug */ = { 713 | isa = XCBuildConfiguration; 714 | buildSettings = { 715 | GCC_PREPROCESSOR_DEFINITIONS = ( 716 | "DEBUG=1", 717 | "$(inherited)", 718 | ); 719 | PRODUCT_NAME = "$(TARGET_NAME)"; 720 | }; 721 | name = Debug; 722 | }; 723 | 31E13821192ACFED006DDF4D /* Release */ = { 724 | isa = XCBuildConfiguration; 725 | buildSettings = { 726 | PRODUCT_NAME = "$(TARGET_NAME)"; 727 | }; 728 | name = Release; 729 | }; 730 | 31E13831192AD437006DDF4D /* Debug */ = { 731 | isa = XCBuildConfiguration; 732 | buildSettings = { 733 | GCC_PREPROCESSOR_DEFINITIONS = ( 734 | "DEBUG=1", 735 | "$(inherited)", 736 | ); 737 | PRODUCT_NAME = "$(TARGET_NAME)"; 738 | }; 739 | name = Debug; 740 | }; 741 | 31E13832192AD437006DDF4D /* Release */ = { 742 | isa = XCBuildConfiguration; 743 | buildSettings = { 744 | PRODUCT_NAME = "$(TARGET_NAME)"; 745 | }; 746 | name = Release; 747 | }; 748 | /* End XCBuildConfiguration section */ 749 | 750 | /* Begin XCConfigurationList section */ 751 | 310CD7AC192A441A004D4327 /* Build configuration list for PBXProject "CSubSub" */ = { 752 | isa = XCConfigurationList; 753 | buildConfigurations = ( 754 | 310CD7B3192A441A004D4327 /* Debug */, 755 | 310CD7B4192A441A004D4327 /* Release */, 756 | ); 757 | defaultConfigurationIsVisible = 0; 758 | defaultConfigurationName = Release; 759 | }; 760 | 310CD7B5192A441A004D4327 /* Build configuration list for PBXNativeTarget "CSubSub" */ = { 761 | isa = XCConfigurationList; 762 | buildConfigurations = ( 763 | 310CD7B6192A441A004D4327 /* Debug */, 764 | 310CD7B7192A441A004D4327 /* Release */, 765 | ); 766 | defaultConfigurationIsVisible = 0; 767 | defaultConfigurationName = Release; 768 | }; 769 | 310CD7C7192A4487004D4327 /* Build configuration list for PBXNativeTarget "E001UsingString" */ = { 770 | isa = XCConfigurationList; 771 | buildConfigurations = ( 772 | 310CD7C8192A4487004D4327 /* Debug */, 773 | 310CD7C9192A4487004D4327 /* Release */, 774 | ); 775 | defaultConfigurationIsVisible = 0; 776 | defaultConfigurationName = Release; 777 | }; 778 | 313BBBD3192CB22D00832B0B /* Build configuration list for PBXNativeTarget "E004UsingArray" */ = { 779 | isa = XCConfigurationList; 780 | buildConfigurations = ( 781 | 313BBBD4192CB22D00832B0B /* Debug */, 782 | 313BBBD5192CB22D00832B0B /* Release */, 783 | ); 784 | defaultConfigurationIsVisible = 0; 785 | defaultConfigurationName = Release; 786 | }; 787 | 318CF6161931EE1E00FFDA3A /* Build configuration list for PBXNativeTarget "E005UsingMap" */ = { 788 | isa = XCConfigurationList; 789 | buildConfigurations = ( 790 | 318CF6141931EE1E00FFDA3A /* Debug */, 791 | 318CF6151931EE1E00FFDA3A /* Release */, 792 | ); 793 | defaultConfigurationIsVisible = 0; 794 | defaultConfigurationName = Release; 795 | }; 796 | 31E1381F192ACFED006DDF4D /* Build configuration list for PBXNativeTarget "E002UsingFile" */ = { 797 | isa = XCConfigurationList; 798 | buildConfigurations = ( 799 | 31E13820192ACFED006DDF4D /* Debug */, 800 | 31E13821192ACFED006DDF4D /* Release */, 801 | ); 802 | defaultConfigurationIsVisible = 0; 803 | defaultConfigurationName = Release; 804 | }; 805 | 31E13830192AD437006DDF4D /* Build configuration list for PBXNativeTarget "E003UsingList" */ = { 806 | isa = XCConfigurationList; 807 | buildConfigurations = ( 808 | 31E13831192AD437006DDF4D /* Debug */, 809 | 31E13832192AD437006DDF4D /* Release */, 810 | ); 811 | defaultConfigurationIsVisible = 0; 812 | defaultConfigurationName = Release; 813 | }; 814 | /* End XCConfigurationList section */ 815 | }; 816 | rootObject = 310CD7A9192A441A004D4327 /* Project object */; 817 | } 818 | -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/project.xcworkspace/xcshareddata/CSubSub.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 58D6230F-A164-42D3-897D-7A0BB9E80146 9 | IDESourceControlProjectName 10 | CSubSub 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 9C651EBC-48F5-46E1-83AD-19220C345E64 14 | https://github.com/plter/CSubSub.git 15 | 16 | IDESourceControlProjectPath 17 | CSubSub/CSubSub.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 9C651EBC-48F5-46E1-83AD-19220C345E64 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/plter/CSubSub.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | 9C651EBC-48F5-46E1-83AD-19220C345E64 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 9C651EBC-48F5-46E1-83AD-19220C345E64 36 | IDESourceControlWCCName 37 | CSubSub 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/project.xcworkspace/xcuserdata/plter.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plter/CSubSub/478fe3621a5de90a2e2b0056209e041f7e7613d2/CSubSub/CSubSub.xcodeproj/project.xcworkspace/xcuserdata/plter.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/xcuserdata/plter.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/xcuserdata/plter.xcuserdatad/xcschemes/CSubSub.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/xcuserdata/plter.xcuserdatad/xcschemes/E001UsingString.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/xcuserdata/plter.xcuserdatad/xcschemes/E002UsingFile.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/xcuserdata/plter.xcuserdatad/xcschemes/E003UsingList.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/xcuserdata/plter.xcuserdatad/xcschemes/E004UsingArray.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/xcuserdata/plter.xcuserdatad/xcschemes/E005UsingMap.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /CSubSub/CSubSub.xcodeproj/xcuserdata/plter.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CSubSub.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | E001UsingString.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | E002UsingFile.xcscheme 18 | 19 | orderHint 20 | 2 21 | 22 | E003UsingList.xcscheme 23 | 24 | orderHint 25 | 3 26 | 27 | E004UsingArray.xcscheme 28 | 29 | orderHint 30 | 4 31 | 32 | E005UsingMap.xcscheme 33 | 34 | orderHint 35 | 5 36 | 37 | 38 | SuppressBuildableAutocreation 39 | 40 | 310CD7B0192A441A004D4327 41 | 42 | primary 43 | 44 | 45 | 310CD7C0192A4487004D4327 46 | 47 | primary 48 | 49 | 50 | 313BBBCC192CB22C00832B0B 51 | 52 | primary 53 | 54 | 55 | 318CF60D1931EE1E00FFDA3A 56 | 57 | primary 58 | 59 | 60 | 31E13818192ACFED006DDF4D 61 | 62 | primary 63 | 64 | 65 | 31E13829192AD437006DDF4D 66 | 67 | primary 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /CSubSub/E001UsingString/E001UsingString.1: -------------------------------------------------------------------------------- 1 | .\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. 2 | .\"See Also: 3 | .\"man mdoc.samples for a complete listing of options 4 | .\"man mdoc for the short list of editing options 5 | .\"/usr/share/misc/mdoc.template 6 | .Dd 14-5-19 \" DATE 7 | .Dt E001UsingString 1 \" Program name and manual section number 8 | .Os Darwin 9 | .Sh NAME \" Section Header - required - don't modify 10 | .Nm E001UsingString, 11 | .\" The following lines are read in generating the apropos(man -k) database. Use only key 12 | .\" words here as the database is built based on the words here and in the .ND line. 13 | .Nm Other_name_for_same_program(), 14 | .Nm Yet another name for the same program. 15 | .\" Use .Nm macro to designate other names for the documented program. 16 | .Nd This line parsed for whatis database. 17 | .Sh SYNOPSIS \" Section Header - required - don't modify 18 | .Nm 19 | .Op Fl abcd \" [-abcd] 20 | .Op Fl a Ar path \" [-a path] 21 | .Op Ar file \" [file] 22 | .Op Ar \" [file ...] 23 | .Ar arg0 \" Underlined argument - use .Ar anywhere to underline 24 | arg2 ... \" Arguments 25 | .Sh DESCRIPTION \" Section Header - required - don't modify 26 | Use the .Nm macro to refer to your program throughout the man page like such: 27 | .Nm 28 | Underlining is accomplished with the .Ar macro like this: 29 | .Ar underlined text . 30 | .Pp \" Inserts a space 31 | A list of items with descriptions: 32 | .Bl -tag -width -indent \" Begins a tagged list 33 | .It item a \" Each item preceded by .It macro 34 | Description of item a 35 | .It item b 36 | Description of item b 37 | .El \" Ends the list 38 | .Pp 39 | A list of flags and their descriptions: 40 | .Bl -tag -width -indent \" Differs from above in tag removed 41 | .It Fl a \"-a flag as a list item 42 | Description of -a flag 43 | .It Fl b 44 | Description of -b flag 45 | .El \" Ends the list 46 | .Pp 47 | .\" .Sh ENVIRONMENT \" May not be needed 48 | .\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 49 | .\" .It Ev ENV_VAR_1 50 | .\" Description of ENV_VAR_1 51 | .\" .It Ev ENV_VAR_2 52 | .\" Description of ENV_VAR_2 53 | .\" .El 54 | .Sh FILES \" File used or created by the topic of the man page 55 | .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact 56 | .It Pa /usr/share/file_name 57 | FILE_1 description 58 | .It Pa /Users/joeuser/Library/really_long_file_name 59 | FILE_2 description 60 | .El \" Ends the list 61 | .\" .Sh DIAGNOSTICS \" May not be needed 62 | .\" .Bl -diag 63 | .\" .It Diagnostic Tag 64 | .\" Diagnostic informtion here. 65 | .\" .It Diagnostic Tag 66 | .\" Diagnostic informtion here. 67 | .\" .El 68 | .Sh SEE ALSO 69 | .\" List links in ascending order by section, alphabetically within a section. 70 | .\" Please do not reference files that do not exist without filing a bug report 71 | .Xr a 1 , 72 | .Xr b 1 , 73 | .Xr c 1 , 74 | .Xr a 2 , 75 | .Xr b 2 , 76 | .Xr a 3 , 77 | .Xr b 3 78 | .\" .Sh BUGS \" Document known, unremedied bugs 79 | .\" .Sh HISTORY \" Document history if command behaves in a unique manner -------------------------------------------------------------------------------- /CSubSub/E001UsingString/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // E001UsingString 4 | // 5 | // Created by plter on 14-5-19. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include 10 | #include "css.h" 11 | 12 | int main(int argc, const char * argv[]) 13 | { 14 | 15 | cssCall(cssSystemGetInstance(), logOn); 16 | 17 | cssString * str = cssStringCreateWithCString("Hello World"); 18 | 19 | // insert code here... 20 | printf("%s\n",cssCall(str, getCString)); 21 | 22 | cssCall(cssSystemGetInstance(), gc); 23 | return 0; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /CSubSub/E002UsingFile/Data.txt: -------------------------------------------------------------------------------- 1 | Hello CSS -------------------------------------------------------------------------------- /CSubSub/E002UsingFile/E002UsingFile.1: -------------------------------------------------------------------------------- 1 | .\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. 2 | .\"See Also: 3 | .\"man mdoc.samples for a complete listing of options 4 | .\"man mdoc for the short list of editing options 5 | .\"/usr/share/misc/mdoc.template 6 | .Dd 14-5-20 \" DATE 7 | .Dt E002UsingFile 1 \" Program name and manual section number 8 | .Os Darwin 9 | .Sh NAME \" Section Header - required - don't modify 10 | .Nm E002UsingFile, 11 | .\" The following lines are read in generating the apropos(man -k) database. Use only key 12 | .\" words here as the database is built based on the words here and in the .ND line. 13 | .Nm Other_name_for_same_program(), 14 | .Nm Yet another name for the same program. 15 | .\" Use .Nm macro to designate other names for the documented program. 16 | .Nd This line parsed for whatis database. 17 | .Sh SYNOPSIS \" Section Header - required - don't modify 18 | .Nm 19 | .Op Fl abcd \" [-abcd] 20 | .Op Fl a Ar path \" [-a path] 21 | .Op Ar file \" [file] 22 | .Op Ar \" [file ...] 23 | .Ar arg0 \" Underlined argument - use .Ar anywhere to underline 24 | arg2 ... \" Arguments 25 | .Sh DESCRIPTION \" Section Header - required - don't modify 26 | Use the .Nm macro to refer to your program throughout the man page like such: 27 | .Nm 28 | Underlining is accomplished with the .Ar macro like this: 29 | .Ar underlined text . 30 | .Pp \" Inserts a space 31 | A list of items with descriptions: 32 | .Bl -tag -width -indent \" Begins a tagged list 33 | .It item a \" Each item preceded by .It macro 34 | Description of item a 35 | .It item b 36 | Description of item b 37 | .El \" Ends the list 38 | .Pp 39 | A list of flags and their descriptions: 40 | .Bl -tag -width -indent \" Differs from above in tag removed 41 | .It Fl a \"-a flag as a list item 42 | Description of -a flag 43 | .It Fl b 44 | Description of -b flag 45 | .El \" Ends the list 46 | .Pp 47 | .\" .Sh ENVIRONMENT \" May not be needed 48 | .\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 49 | .\" .It Ev ENV_VAR_1 50 | .\" Description of ENV_VAR_1 51 | .\" .It Ev ENV_VAR_2 52 | .\" Description of ENV_VAR_2 53 | .\" .El 54 | .Sh FILES \" File used or created by the topic of the man page 55 | .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact 56 | .It Pa /usr/share/file_name 57 | FILE_1 description 58 | .It Pa /Users/joeuser/Library/really_long_file_name 59 | FILE_2 description 60 | .El \" Ends the list 61 | .\" .Sh DIAGNOSTICS \" May not be needed 62 | .\" .Bl -diag 63 | .\" .It Diagnostic Tag 64 | .\" Diagnostic informtion here. 65 | .\" .It Diagnostic Tag 66 | .\" Diagnostic informtion here. 67 | .\" .El 68 | .Sh SEE ALSO 69 | .\" List links in ascending order by section, alphabetically within a section. 70 | .\" Please do not reference files that do not exist without filing a bug report 71 | .Xr a 1 , 72 | .Xr b 1 , 73 | .Xr c 1 , 74 | .Xr a 2 , 75 | .Xr b 2 , 76 | .Xr a 3 , 77 | .Xr b 3 78 | .\" .Sh BUGS \" Document known, unremedied bugs 79 | .\" .Sh HISTORY \" Document history if command behaves in a unique manner -------------------------------------------------------------------------------- /CSubSub/E002UsingFile/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // E002UsingFile 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include 10 | #include "css.h" 11 | 12 | int main(int argc, const char * argv[]) 13 | { 14 | 15 | cssCall(cssSystemGetInstance(), logOn); 16 | cssString * str = cssStringCreateWithCString("/Users/plter/Work/gitroot/github/CSubSub/CSubSub/E002UsingFile/Data.txt"); 17 | cssFile * f = cssFileCreate(str); 18 | cssCallA(f, open, "r"); 19 | 20 | printf("File Content : %s\n",f->getStringContent(f)->_cstr); 21 | 22 | cssCall(cssSystemGetInstance(), gc); 23 | return 0; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /CSubSub/E003UsingList/E003UsingList.1: -------------------------------------------------------------------------------- 1 | .\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. 2 | .\"See Also: 3 | .\"man mdoc.samples for a complete listing of options 4 | .\"man mdoc for the short list of editing options 5 | .\"/usr/share/misc/mdoc.template 6 | .Dd 14-5-20 \" DATE 7 | .Dt E003UsingList 1 \" Program name and manual section number 8 | .Os Darwin 9 | .Sh NAME \" Section Header - required - don't modify 10 | .Nm E003UsingList, 11 | .\" The following lines are read in generating the apropos(man -k) database. Use only key 12 | .\" words here as the database is built based on the words here and in the .ND line. 13 | .Nm Other_name_for_same_program(), 14 | .Nm Yet another name for the same program. 15 | .\" Use .Nm macro to designate other names for the documented program. 16 | .Nd This line parsed for whatis database. 17 | .Sh SYNOPSIS \" Section Header - required - don't modify 18 | .Nm 19 | .Op Fl abcd \" [-abcd] 20 | .Op Fl a Ar path \" [-a path] 21 | .Op Ar file \" [file] 22 | .Op Ar \" [file ...] 23 | .Ar arg0 \" Underlined argument - use .Ar anywhere to underline 24 | arg2 ... \" Arguments 25 | .Sh DESCRIPTION \" Section Header - required - don't modify 26 | Use the .Nm macro to refer to your program throughout the man page like such: 27 | .Nm 28 | Underlining is accomplished with the .Ar macro like this: 29 | .Ar underlined text . 30 | .Pp \" Inserts a space 31 | A list of items with descriptions: 32 | .Bl -tag -width -indent \" Begins a tagged list 33 | .It item a \" Each item preceded by .It macro 34 | Description of item a 35 | .It item b 36 | Description of item b 37 | .El \" Ends the list 38 | .Pp 39 | A list of flags and their descriptions: 40 | .Bl -tag -width -indent \" Differs from above in tag removed 41 | .It Fl a \"-a flag as a list item 42 | Description of -a flag 43 | .It Fl b 44 | Description of -b flag 45 | .El \" Ends the list 46 | .Pp 47 | .\" .Sh ENVIRONMENT \" May not be needed 48 | .\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 49 | .\" .It Ev ENV_VAR_1 50 | .\" Description of ENV_VAR_1 51 | .\" .It Ev ENV_VAR_2 52 | .\" Description of ENV_VAR_2 53 | .\" .El 54 | .Sh FILES \" File used or created by the topic of the man page 55 | .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact 56 | .It Pa /usr/share/file_name 57 | FILE_1 description 58 | .It Pa /Users/joeuser/Library/really_long_file_name 59 | FILE_2 description 60 | .El \" Ends the list 61 | .\" .Sh DIAGNOSTICS \" May not be needed 62 | .\" .Bl -diag 63 | .\" .It Diagnostic Tag 64 | .\" Diagnostic informtion here. 65 | .\" .It Diagnostic Tag 66 | .\" Diagnostic informtion here. 67 | .\" .El 68 | .Sh SEE ALSO 69 | .\" List links in ascending order by section, alphabetically within a section. 70 | .\" Please do not reference files that do not exist without filing a bug report 71 | .Xr a 1 , 72 | .Xr b 1 , 73 | .Xr c 1 , 74 | .Xr a 2 , 75 | .Xr b 2 , 76 | .Xr a 3 , 77 | .Xr b 3 78 | .\" .Sh BUGS \" Document known, unremedied bugs 79 | .\" .Sh HISTORY \" Document history if command behaves in a unique manner -------------------------------------------------------------------------------- /CSubSub/E003UsingList/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // E003UsingList 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include 10 | #include "css.h" 11 | 12 | int main(int argc, const char * argv[]) 13 | { 14 | cssCall(cssSystemGetInstance(), logOn); 15 | 16 | cssList * l = cssListCreate(); 17 | 18 | cssString * str; 19 | for (int i=0; i<5; i++) { 20 | str = cssStringCreateWithCString("Item "); 21 | str->addInt(str,i); 22 | l->addAtLast(l,cssAs(cssObject*, str)); 23 | } 24 | 25 | cssListEach(l, cssString*, s, { 26 | printf("%s\n",s->getCString(s)); 27 | }); 28 | 29 | // str = cssStringCreateWithCString("Hello"); 30 | // l->addAtLast(l,cssAs(cssObject*, str)); 31 | // l->addAtLast(l,cssAs(cssObject*, str)); 32 | // 33 | // l->remove(l,cssAs(cssObject*, str)); 34 | 35 | cssCall(cssSystemGetInstance(), gc); 36 | 37 | return 0; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /CSubSub/E004UsingArray/E004UsingArray.1: -------------------------------------------------------------------------------- 1 | .\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. 2 | .\"See Also: 3 | .\"man mdoc.samples for a complete listing of options 4 | .\"man mdoc for the short list of editing options 5 | .\"/usr/share/misc/mdoc.template 6 | .Dd 14-5-21 \" DATE 7 | .Dt E004UsingArray 1 \" Program name and manual section number 8 | .Os Darwin 9 | .Sh NAME \" Section Header - required - don't modify 10 | .Nm E004UsingArray, 11 | .\" The following lines are read in generating the apropos(man -k) database. Use only key 12 | .\" words here as the database is built based on the words here and in the .ND line. 13 | .Nm Other_name_for_same_program(), 14 | .Nm Yet another name for the same program. 15 | .\" Use .Nm macro to designate other names for the documented program. 16 | .Nd This line parsed for whatis database. 17 | .Sh SYNOPSIS \" Section Header - required - don't modify 18 | .Nm 19 | .Op Fl abcd \" [-abcd] 20 | .Op Fl a Ar path \" [-a path] 21 | .Op Ar file \" [file] 22 | .Op Ar \" [file ...] 23 | .Ar arg0 \" Underlined argument - use .Ar anywhere to underline 24 | arg2 ... \" Arguments 25 | .Sh DESCRIPTION \" Section Header - required - don't modify 26 | Use the .Nm macro to refer to your program throughout the man page like such: 27 | .Nm 28 | Underlining is accomplished with the .Ar macro like this: 29 | .Ar underlined text . 30 | .Pp \" Inserts a space 31 | A list of items with descriptions: 32 | .Bl -tag -width -indent \" Begins a tagged list 33 | .It item a \" Each item preceded by .It macro 34 | Description of item a 35 | .It item b 36 | Description of item b 37 | .El \" Ends the list 38 | .Pp 39 | A list of flags and their descriptions: 40 | .Bl -tag -width -indent \" Differs from above in tag removed 41 | .It Fl a \"-a flag as a list item 42 | Description of -a flag 43 | .It Fl b 44 | Description of -b flag 45 | .El \" Ends the list 46 | .Pp 47 | .\" .Sh ENVIRONMENT \" May not be needed 48 | .\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 49 | .\" .It Ev ENV_VAR_1 50 | .\" Description of ENV_VAR_1 51 | .\" .It Ev ENV_VAR_2 52 | .\" Description of ENV_VAR_2 53 | .\" .El 54 | .Sh FILES \" File used or created by the topic of the man page 55 | .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact 56 | .It Pa /usr/share/file_name 57 | FILE_1 description 58 | .It Pa /Users/joeuser/Library/really_long_file_name 59 | FILE_2 description 60 | .El \" Ends the list 61 | .\" .Sh DIAGNOSTICS \" May not be needed 62 | .\" .Bl -diag 63 | .\" .It Diagnostic Tag 64 | .\" Diagnostic informtion here. 65 | .\" .It Diagnostic Tag 66 | .\" Diagnostic informtion here. 67 | .\" .El 68 | .Sh SEE ALSO 69 | .\" List links in ascending order by section, alphabetically within a section. 70 | .\" Please do not reference files that do not exist without filing a bug report 71 | .Xr a 1 , 72 | .Xr b 1 , 73 | .Xr c 1 , 74 | .Xr a 2 , 75 | .Xr b 2 , 76 | .Xr a 3 , 77 | .Xr b 3 78 | .\" .Sh BUGS \" Document known, unremedied bugs 79 | .\" .Sh HISTORY \" Document history if command behaves in a unique manner -------------------------------------------------------------------------------- /CSubSub/E004UsingArray/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // E004UsingArray 4 | // 5 | // Created by plter on 14-5-21. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include 10 | #include "css.h" 11 | 12 | int main(int argc, const char * argv[]) 13 | { 14 | cssCall(cssSystemGetInstance(), logOn); 15 | cssArray* arr = cssArrayCreate(); 16 | cssString * str; 17 | 18 | for (int i=0; i<200; i++) { 19 | str = cssStringCreateWithCString("Item "); 20 | str->addInt(str,i); 21 | arr->add(arr,cssAs(cssObject*, str)); 22 | } 23 | 24 | str = cssStringCreateWithCString("HelloWorld"); 25 | arr->addAt(arr,cssAs(cssObject*, str),3); 26 | 27 | cssArrayEach(arr, cssString*, item, { 28 | printf("%s\n",item->_cstr); 29 | }) 30 | 31 | cssCall(cssSystemGetInstance(), gc); 32 | return 0; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /CSubSub/E005UsingMap/E005UsingMap.1: -------------------------------------------------------------------------------- 1 | .\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. 2 | .\"See Also: 3 | .\"man mdoc.samples for a complete listing of options 4 | .\"man mdoc for the short list of editing options 5 | .\"/usr/share/misc/mdoc.template 6 | .Dd 14-5-25 \" DATE 7 | .Dt E005UsingMap 1 \" Program name and manual section number 8 | .Os Darwin 9 | .Sh NAME \" Section Header - required - don't modify 10 | .Nm E005UsingMap, 11 | .\" The following lines are read in generating the apropos(man -k) database. Use only key 12 | .\" words here as the database is built based on the words here and in the .ND line. 13 | .Nm Other_name_for_same_program(), 14 | .Nm Yet another name for the same program. 15 | .\" Use .Nm macro to designate other names for the documented program. 16 | .Nd This line parsed for whatis database. 17 | .Sh SYNOPSIS \" Section Header - required - don't modify 18 | .Nm 19 | .Op Fl abcd \" [-abcd] 20 | .Op Fl a Ar path \" [-a path] 21 | .Op Ar file \" [file] 22 | .Op Ar \" [file ...] 23 | .Ar arg0 \" Underlined argument - use .Ar anywhere to underline 24 | arg2 ... \" Arguments 25 | .Sh DESCRIPTION \" Section Header - required - don't modify 26 | Use the .Nm macro to refer to your program throughout the man page like such: 27 | .Nm 28 | Underlining is accomplished with the .Ar macro like this: 29 | .Ar underlined text . 30 | .Pp \" Inserts a space 31 | A list of items with descriptions: 32 | .Bl -tag -width -indent \" Begins a tagged list 33 | .It item a \" Each item preceded by .It macro 34 | Description of item a 35 | .It item b 36 | Description of item b 37 | .El \" Ends the list 38 | .Pp 39 | A list of flags and their descriptions: 40 | .Bl -tag -width -indent \" Differs from above in tag removed 41 | .It Fl a \"-a flag as a list item 42 | Description of -a flag 43 | .It Fl b 44 | Description of -b flag 45 | .El \" Ends the list 46 | .Pp 47 | .\" .Sh ENVIRONMENT \" May not be needed 48 | .\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 49 | .\" .It Ev ENV_VAR_1 50 | .\" Description of ENV_VAR_1 51 | .\" .It Ev ENV_VAR_2 52 | .\" Description of ENV_VAR_2 53 | .\" .El 54 | .Sh FILES \" File used or created by the topic of the man page 55 | .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact 56 | .It Pa /usr/share/file_name 57 | FILE_1 description 58 | .It Pa /Users/joeuser/Library/really_long_file_name 59 | FILE_2 description 60 | .El \" Ends the list 61 | .\" .Sh DIAGNOSTICS \" May not be needed 62 | .\" .Bl -diag 63 | .\" .It Diagnostic Tag 64 | .\" Diagnostic informtion here. 65 | .\" .It Diagnostic Tag 66 | .\" Diagnostic informtion here. 67 | .\" .El 68 | .Sh SEE ALSO 69 | .\" List links in ascending order by section, alphabetically within a section. 70 | .\" Please do not reference files that do not exist without filing a bug report 71 | .Xr a 1 , 72 | .Xr b 1 , 73 | .Xr c 1 , 74 | .Xr a 2 , 75 | .Xr b 2 , 76 | .Xr a 3 , 77 | .Xr b 3 78 | .\" .Sh BUGS \" Document known, unremedied bugs 79 | .\" .Sh HISTORY \" Document history if command behaves in a unique manner -------------------------------------------------------------------------------- /CSubSub/E005UsingMap/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // E005UsingMap 4 | // 5 | // Created by plter on 14-5-25. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include 10 | #include "css.h" 11 | 12 | int main(int argc, const char * argv[]) 13 | { 14 | cssCall(cssSystemGetInstance(), logOn); 15 | cssMap * map = cssMapCreate(); 16 | 17 | cssCallA(map, put, "haha",cssAs(cssObject*, cssStringCreateWithCString("Haha"))); 18 | cssMapPutD(map, "hello", cssStringCreateWithCString("Hello")); 19 | map->put(map,"world",cssAs(cssObject*, cssStringCreateWithCString("World"))); 20 | 21 | printf("%ld\n",cssCall(map,getLength)); 22 | printf("%s\n",cssCallRTA(cssString*, map, get,"hello")->_cstr); 23 | cssSystemLog("%s", cssCallRTA(cssString*, map, get,"haha")->_cstr); 24 | 25 | cssCallA(map, remove, "hello"); 26 | 27 | printf("%ld\n",cssCall(map,getLength)); 28 | 29 | cssCall(cssSystemGetInstance(), gc); 30 | return 0; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /CSubSub/lib/css.h: -------------------------------------------------------------------------------- 1 | // 2 | // css.h 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #ifndef CSubSub_css_h 10 | #define CSubSub_css_h 11 | 12 | #ifdef __cplusplus 13 | extern "C" { //c++ header start 14 | #endif 15 | 16 | #include "cssObject.h" 17 | #include "cssString.h" 18 | #include "cssFile.h" 19 | #include "cssList.h" 20 | #include "cssArray.h" 21 | #include "cssSystem.h" 22 | #include "cssMap.h" 23 | 24 | #ifdef __cplusplus 25 | } //c++ header end 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /CSubSub/lib/cssArray.c: -------------------------------------------------------------------------------- 1 | // 2 | // cssArray.c 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-21. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include "cssArray.h" 10 | #include "cssSystem.h" 11 | 12 | 13 | static long cssArrayGetLength(cssArray* _this){ 14 | return _this->_length; 15 | } 16 | 17 | 18 | static long cssArrayGetCap(cssArray * _this){ 19 | return _this->_cap; 20 | } 21 | 22 | 23 | static void cssArrayAddAt(cssArray * _this,cssObject * obj,long index){ 24 | 25 | if (index<0||index>_this->_length) { 26 | cssSystemLog("%s","cssArrayAddAt:Error, Array index out of bounds"); 27 | return; 28 | } 29 | 30 | if (_this->_length>=_this->_cap) { 31 | cssObject** tmp = _this->_arr; 32 | 33 | _this->_cap*=2; 34 | _this->_arr = malloc(sizeof(cssObject*)*_this->_cap); 35 | 36 | for (long i=0; i<_this->_length; i++) { 37 | _this->_arr[i] = tmp[i]; 38 | } 39 | 40 | free(tmp); 41 | } 42 | 43 | for (long i =_this->_length-1 ; i>=index; i--) { 44 | _this->_arr[i+1] = _this->_arr[i]; 45 | } 46 | 47 | _this->_arr[index] = obj; 48 | _this->_length++; 49 | obj->retain(obj); 50 | } 51 | 52 | static void cssArrayAdd(cssArray * _this,cssObject * obj){ 53 | cssArrayAddAt(_this, obj, _this->_length); 54 | } 55 | 56 | static void cssArrayRemoveAt(cssArray * _this,long index){ 57 | 58 | if (index<0||index>=_this->_length) { 59 | cssSystemLog("%s","cssArrayAddAt:Error, Array index out of bounds"); 60 | return; 61 | } 62 | 63 | cssObject * obj = _this->_arr[index]; 64 | 65 | _this->_length--; 66 | 67 | for (long i = index; i<_this->_length; i++) { 68 | _this->_arr[i] = _this->_arr[i+1]; 69 | } 70 | 71 | obj->release(obj); 72 | } 73 | 74 | static void cssArrayRemove(cssArray * _this,cssObject * obj){ 75 | for (long i =0; i<_this->_length; i++) { 76 | if (_this->_arr[i]==obj) { 77 | cssArrayRemoveAt(_this, i); 78 | break; 79 | } 80 | } 81 | } 82 | 83 | 84 | static cssObject* cssArrayGet(cssArray * _this,long index){ 85 | if (index<0||index>=_this->_length) { 86 | cssSystemLog("%s","cssArrayAddAt:Error, Array index out of bounds"); 87 | return NULL; 88 | } 89 | 90 | return _this->_arr[index]; 91 | } 92 | 93 | static void cssArrayClear(cssArray * _this){ 94 | cssObject * item; 95 | for (long i = 0; i <_this->_length; i++) { 96 | item = _this->_arr[i]; 97 | cssCall(item, release); 98 | } 99 | _this->_length = 0; 100 | } 101 | 102 | static void cssArrayOnDelloc(cssArray * _this){ 103 | cssSystemLog("delloc array %lld", (long long)_this); 104 | 105 | cssArrayClear(_this); 106 | 107 | free(_this->_arr); 108 | _this->_onCssObjectDelloc(_this); 109 | } 110 | 111 | 112 | cssArray* cssArrayInitWithCap(cssArray* _this,long cap){ 113 | cssObjectInit(cssAs(cssObject*, _this)); 114 | 115 | _this->_cap = cap; 116 | _this->_length = 0; 117 | _this->_arr = malloc(sizeof(cssObject*)*_this->_cap); 118 | 119 | _this->getLength = &cssArrayGetLength; 120 | _this->getCap = &cssArrayGetCap; 121 | _this->addAt = &cssArrayAddAt; 122 | _this->add = &cssArrayAdd; 123 | _this->removeAt = &cssArrayRemoveAt; 124 | _this->remove = &cssArrayRemove; 125 | _this->get = &cssArrayGet; 126 | _this->_onCssObjectDelloc = _this->onDelloc; 127 | _this->onDelloc = &cssArrayOnDelloc; 128 | _this->clear = &cssArrayClear; 129 | 130 | cssSystemLog("init array %lld", (long long)_this); 131 | return _this; 132 | } 133 | 134 | 135 | cssArray* cssArrayCreateWithCap(long cap){ 136 | cssArray * _ins = cssArrayInitWithCap(cssAlloc(cssArray), cap); 137 | _ins->autorelease(_ins); 138 | return _ins; 139 | } 140 | 141 | cssArray* cssArrayCreate(){ 142 | return cssArrayCreateWithCap(64); 143 | } -------------------------------------------------------------------------------- /CSubSub/lib/cssArray.h: -------------------------------------------------------------------------------- 1 | // 2 | // cssArray.h 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-21. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #ifndef __CSubSub__cssArray__ 10 | #define __CSubSub__cssArray__ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { //c++ header start 14 | #endif 15 | 16 | #include "cssObject.h" 17 | 18 | #define cssArrayFields(TYPE) \ 19 | cssObjectFields(TYPE) \ 20 | long _length; \ 21 | long _cap; \ 22 | cssObject ** _arr; \ 23 | long (*getLength)(TYPE); \ 24 | long (*getCap)(TYPE); \ 25 | void (*addAt)(TYPE,cssObject * obj,long index); \ 26 | void (*removeAt)(TYPE,long index); \ 27 | void (*add)(TYPE,cssObject * obj); \ 28 | void (*remove)(TYPE,cssObject * obj); \ 29 | cssObject* (*get)(TYPE,long index); \ 30 | void (*_onCssObjectDelloc)(TYPE); \ 31 | void (*clear)(TYPE); 32 | 33 | cssClass(cssArray) 34 | 35 | cssArray* cssArrayInitWithCap(cssArray* _this,long cap); 36 | cssArray* cssArrayCreateWithCap(long cap); 37 | cssArray* cssArrayCreate(); 38 | 39 | #define cssArrayEach(array,type,obj,code){ \ 40 | type obj; \ 41 | for(long index = 0;index_length;index++){ \ 42 | obj = (type)(array->_arr[index]); \ 43 | code \ 44 | } \ 45 | } 46 | 47 | #ifdef __cplusplus 48 | } //c++ header end 49 | #endif 50 | #endif /* defined(__CSubSub__cssArray__) */ 51 | -------------------------------------------------------------------------------- /CSubSub/lib/cssFile.c: -------------------------------------------------------------------------------- 1 | // 2 | // cssFile.cpp 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include "cssFile.h" 10 | #include "cssSystem.h" 11 | 12 | 13 | static bool cssFileOpen(cssFile * _this,char * mode){ 14 | 15 | if (_this->_currentCFile!=NULL) { 16 | fclose(_this->_currentCFile); 17 | } 18 | 19 | _this->_currentCFile = fopen(_this->_fileName->_cstr,mode); 20 | 21 | if (_this->_currentCFile!=NULL) { 22 | 23 | fseek(_this->_currentCFile,0,SEEK_END); 24 | _this->_size = ftell(_this->_currentCFile); 25 | rewind(_this->_currentCFile); 26 | return true; 27 | }else{ 28 | return false; 29 | } 30 | } 31 | 32 | static void cssFileClose(cssFile * _this){ 33 | 34 | if (_this->_currentCFile!=NULL) { 35 | fclose(_this->_currentCFile); 36 | _this->_currentCFile = NULL; 37 | } 38 | } 39 | 40 | static long cssFileGetSize(cssFile * _this){ 41 | return _this->_size; 42 | } 43 | 44 | static cssString * cssFileGetStringContent(cssFile * _this){ 45 | 46 | if (_this->_currentCFile!=NULL) { 47 | 48 | if (_this->_stringContent!=NULL) { 49 | cssCall(_this->_stringContent, release); 50 | } 51 | 52 | char buff[_this->_size+1]; 53 | fread(buff,1,_this->_size,_this->_currentCFile); 54 | buff[_this->_size] = '\0'; 55 | _this->_stringContent = cssStringInitWithCString(cssAlloc(cssString),buff); 56 | return _this->_stringContent; 57 | }else{ 58 | cssSystemLog("%s","Current CFile is NULL,please call open method first"); 59 | } 60 | 61 | return NULL; 62 | } 63 | 64 | static void cssFileOnDelloc(cssFile *_this){ 65 | 66 | cssSystemLog("delloc file %s", _this->_fileName->_cstr); 67 | 68 | _this->_fileName->release(_this->_fileName); 69 | if (_this->_currentCFile!=NULL) { 70 | fclose(_this->_currentCFile); 71 | } 72 | if (_this->_stringContent!=NULL) { 73 | _this->_stringContent->release(_this->_stringContent); 74 | } 75 | 76 | _this->_onCssObjectDelloc(_this); 77 | } 78 | 79 | static cssString* cssFileGetFileName(cssFile *_this){ 80 | return _this->_fileName; 81 | } 82 | 83 | cssFile * cssFileInit(cssFile * _this,cssString * fileName){ 84 | 85 | cssObjectInit(cssAs(cssObject*,_this)); 86 | 87 | _this->_size = 0; 88 | 89 | _this->_onCssObjectDelloc = _this->onDelloc; 90 | _this->onDelloc = &cssFileOnDelloc; 91 | 92 | _this->_fileName = fileName; 93 | _this->_fileName->retain(_this->_fileName); 94 | 95 | _this->_currentCFile = NULL; 96 | _this->_stringContent = NULL; 97 | 98 | _this->open = &cssFileOpen; 99 | _this->close = &cssFileClose; 100 | _this->getSize = &cssFileGetSize; 101 | _this->getFileName = &cssFileGetFileName; 102 | _this->getStringContent = &cssFileGetStringContent; 103 | 104 | cssSystemLog("init file %s", fileName->_cstr); 105 | return _this; 106 | } 107 | 108 | cssFile * cssFileCreate(cssString * fileName){ 109 | cssFile * _ins =cssFileInit(cssAlloc(cssFile),fileName); 110 | _ins->autorelease(_ins); 111 | return _ins; 112 | } -------------------------------------------------------------------------------- /CSubSub/lib/cssFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // cssFile.h 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #ifndef __CSubSub__cssFile__ 10 | #define __CSubSub__cssFile__ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #include "cssObject.h" 17 | #include "cssString.h" 18 | #include 19 | 20 | #define cssFileFields(TYPE) \ 21 | cssObjectFields(TYPE) \ 22 | cssString *_fileName; \ 23 | FILE * _currentCFile;\ 24 | long _size; \ 25 | cssString * _stringContent; \ 26 | cssString * (*getFileName)(TYPE _this); \ 27 | void(*_onCssObjectDelloc)(TYPE _this); \ 28 | bool(*open)(TYPE _this,char * mode); \ 29 | long(*getSize)(TYPE _this); \ 30 | void(*close)(TYPE _this); \ 31 | cssString* (*getStringContent)(TYPE _this); 32 | 33 | 34 | cssClass(cssFile) 35 | 36 | cssFile * cssFileInit(cssFile * _this,cssString * fileName); 37 | cssFile * cssFileCreate(cssString * fileName); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* defined(__CSubSub__cssFile__) */ 44 | -------------------------------------------------------------------------------- /CSubSub/lib/cssList.c: -------------------------------------------------------------------------------- 1 | // 2 | // cssList.c 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include "cssList.h" 10 | #include "cssSystem.h" 11 | 12 | static struct _cssListItem* createAndInitCssListItem(){ 13 | struct _cssListItem * i = malloc(sizeof(struct _cssListItem)); 14 | i->next = NULL; 15 | i->pre = NULL; 16 | i->value = NULL; 17 | return i; 18 | } 19 | 20 | static void cssListRemoveListItem(cssList * _this,struct _cssListItem * item){ 21 | if (_this->_length<=0) { 22 | return; 23 | } 24 | 25 | item->next->pre = item->pre; 26 | if (item->pre!=NULL) { 27 | item->pre->next = item->next; 28 | }else{//pre is NULL means this item is _begin 29 | _this->_begin = item->next; 30 | } 31 | 32 | item->value->release(item->value); 33 | _this->_length--; 34 | 35 | free(item); 36 | 37 | if (_this->_length<=0) {//if _length is 0,we must reset _begin to NULL 38 | _this->_begin = NULL; 39 | } 40 | } 41 | 42 | 43 | static void cssListAddListItemBefore(cssList * _this,struct _cssListItem * itemForAdd,struct _cssListItem * item){ 44 | 45 | itemForAdd->pre = item->pre; 46 | itemForAdd->next = item; 47 | item->pre = itemForAdd; 48 | 49 | if (itemForAdd->pre!=NULL) { 50 | itemForAdd->pre->next = itemForAdd; 51 | }else{ 52 | _this->_begin = itemForAdd; 53 | } 54 | 55 | _this->_length++; 56 | } 57 | 58 | 59 | static void cssListAddObjectBefore(cssList * _this,cssObject * objForAdd,struct _cssListItem * item){ 60 | struct _cssListItem * newItem = createAndInitCssListItem(); 61 | newItem->value = objForAdd; 62 | objForAdd->retain(objForAdd); 63 | cssListAddListItemBefore(_this, newItem, item); 64 | } 65 | 66 | 67 | static long cssListGetLength(cssList * _this){ 68 | return _this->_length; 69 | } 70 | 71 | static struct _cssListItem * cssListGetListItem(cssList * _this,long index){ 72 | if (index<0||index>=_this->_length) { 73 | cssSystemLog("%s","cssListGet:index out of bounds"); 74 | return NULL; 75 | } 76 | 77 | struct _cssListItem * tmp = NULL; 78 | long i = 0; 79 | if (index<_this->_length/2) { 80 | tmp = _this->_begin; 81 | for (i = 0; i < index; ++i) { 82 | tmp = tmp->next; 83 | } 84 | }else{ 85 | tmp = _this->_end; 86 | for (i = _this->_length-1; i <= index; ++i) { 87 | tmp = tmp->pre; 88 | } 89 | } 90 | 91 | return tmp; 92 | } 93 | 94 | static cssObject * cssListGet(cssList * _this,long index){ 95 | return cssListGetListItem(_this,index)->value; 96 | } 97 | 98 | static void cssListAddAt(cssList * _this,cssObject * obj,long index){ 99 | 100 | if (index<0||index>_this->_length) { 101 | cssSystemLog("%s","cssListAddAt:index out of bounds"); 102 | return; 103 | } 104 | 105 | if (_this->_length==0||_this->_length==index) { 106 | cssListAddObjectBefore(_this, obj, _this->_end); 107 | }else if(index==0){ 108 | cssListAddObjectBefore(_this, obj, _this->_begin); 109 | }else{ 110 | cssListAddObjectBefore(_this, obj, cssListGetListItem(_this,index)); 111 | } 112 | } 113 | 114 | static void cssListAddAtLast(cssList * _this,cssObject * obj){ 115 | cssListAddAt(_this,obj,cssListGetLength(_this)); 116 | } 117 | 118 | static void cssListAddAtFirst(cssList * _this,cssObject * obj){ 119 | cssListAddAt(_this,obj,0); 120 | } 121 | 122 | static void cssListRemoveAt(cssList * _this,long index){ 123 | 124 | if (index<0||index>=_this->_length||_this->_length<=0) { 125 | cssSystemLog("%s","cssListRemoveAt:index out of bounds"); 126 | return; 127 | } 128 | 129 | struct _cssListItem * tmp = NULL; 130 | long i=0; 131 | 132 | if (index<_this->_length/2) { 133 | tmp = _this->_begin; 134 | for (i = 0; i < index; ++i) { 135 | tmp = tmp->next; 136 | } 137 | }else{ 138 | tmp = _this->_end; 139 | for (i = _this->_length-1; i >=index; --i) { 140 | tmp=tmp->pre; 141 | } 142 | } 143 | 144 | cssListRemoveListItem(_this, tmp); 145 | } 146 | 147 | static void cssListRemoveFirst(cssList * _this){ 148 | cssListRemoveAt(_this,0); 149 | } 150 | 151 | static void cssListRemoveLast(cssList * _this){ 152 | cssListRemoveAt(_this,cssListGetLength(_this)-1); 153 | } 154 | 155 | //TODO 156 | static void cssListRemove(cssList * _this,cssObject * obj){ 157 | 158 | if (_this->_length<=0) { 159 | return; 160 | } 161 | 162 | struct _cssListItem * item = _this->_begin; 163 | struct _cssListItem * tmp = NULL; 164 | while (item!=_this->_end) { 165 | if (item->value == obj) { 166 | tmp = item; 167 | item = item->next; 168 | cssListRemoveListItem(_this, tmp); 169 | break; 170 | }else{ 171 | item = item->next; 172 | } 173 | } 174 | 175 | } 176 | 177 | static void cssListClear(cssList * _this){ 178 | while(_this->_length){ 179 | cssListRemoveAt(_this,0); 180 | } 181 | } 182 | 183 | static void cssListOnDelloc(cssList * _this){ 184 | 185 | cssListClear(_this); 186 | 187 | free(_this->_end); 188 | 189 | _this->_onCssObjectDelloc(_this); 190 | } 191 | 192 | cssList* cssListInit(cssList * _this){ 193 | 194 | cssObjectInit(cssAs(cssObject*,_this)); 195 | 196 | _this->_begin = NULL; 197 | _this->_end = createAndInitCssListItem(); 198 | 199 | _this->_length = 0; 200 | _this->getLength = &cssListGetLength; 201 | 202 | _this->addAtLast = &cssListAddAtLast; 203 | _this->addAtFirst = &cssListAddAtFirst; 204 | _this->addAt = &cssListAddAt; 205 | _this->removeAt = &cssListRemoveAt; 206 | _this->removeFirst = &cssListRemoveFirst; 207 | _this->removeLast = &cssListRemoveLast; 208 | _this->remove = &cssListRemove; 209 | _this->removeListItem = &cssListRemoveListItem; 210 | _this->get = &cssListGet; 211 | _this->clear = &cssListClear; 212 | 213 | _this->_onCssObjectDelloc = _this->onDelloc; 214 | _this->onDelloc = &cssListOnDelloc; 215 | 216 | return _this; 217 | } 218 | 219 | cssCreateFuncImpl(cssList) 220 | -------------------------------------------------------------------------------- /CSubSub/lib/cssList.h: -------------------------------------------------------------------------------- 1 | // 2 | // cssList.h 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #ifndef __CSubSub__cssList__ 10 | #define __CSubSub__cssList__ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #include "cssObject.h" 17 | 18 | struct _cssListItem{ 19 | cssObject * value; 20 | struct _cssListItem * pre; 21 | struct _cssListItem * next; 22 | }; 23 | 24 | #define cssListFields(TYPE) \ 25 | cssObjectFields(TYPE) \ 26 | struct _cssListItem * _begin; \ 27 | struct _cssListItem * _end; \ 28 | long _length; \ 29 | long (*getLength)(TYPE _this); \ 30 | void (*addAt)(TYPE _this,cssObject *obj,long index);\ 31 | void (*addAtLast)(TYPE _this,cssObject* obj); \ 32 | void (*addAtFirst)(TYPE _this,cssObject * obj); \ 33 | void (*removeAt)(TYPE _this,long index); \ 34 | void (*removeFirst)(TYPE _this); \ 35 | void (*removeLast)(TYPE _this); \ 36 | void (*remove)(TYPE _this,cssObject* obj); \ 37 | cssObject * (*get)(TYPE _this,long index); \ 38 | void (*_onCssObjectDelloc)(TYPE _this); \ 39 | void (*clear)(TYPE _this); \ 40 | void (*removeListItem)(TYPE,struct _cssListItem *); \ 41 | void (*addListItem)(TYPE,struct _cssListItem *); 42 | 43 | cssClass(cssList) 44 | 45 | cssList* cssListInit(cssList * _this); 46 | cssCreateFunc(cssList); 47 | 48 | #define cssListEach(list,type,obj,code) {\ 49 | type obj = NULL; \ 50 | for (struct _cssListItem * item = list->_begin; list->_length>0&&item!=list->_end; item=item->next) {\ 51 | obj = (type)(item->value) ; \ 52 | code \ 53 | }\ 54 | } 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* defined(__CSubSub__cssList__) */ 61 | -------------------------------------------------------------------------------- /CSubSub/lib/cssMap.c: -------------------------------------------------------------------------------- 1 | // 2 | // cssMap.c 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-25. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include "cssMap.h" 10 | #include 11 | #include "cssSystem.h" 12 | 13 | //KV class >>>>>>>>>>>>>>>>>>>>>>> 14 | #define cssMapKVFields(TYPE) \ 15 | cssObjectFields(TYPE) \ 16 | char * key; \ 17 | cssObject * value; \ 18 | void (*_onObjectDelloc)(TYPE); 19 | 20 | cssClass(cssMapKV) 21 | 22 | static void cssMapKVOnDelloc(cssMapKV * _this){ 23 | _this->value->release(_this->value); 24 | 25 | _this->_onObjectDelloc(_this); 26 | } 27 | 28 | static cssMapKV * cssMapKVInit(cssMapKV * _this,char * key,cssObject * value){ 29 | cssObjectInit(cssAs(cssObject*, _this)); 30 | 31 | _this->_onObjectDelloc = _this->onDelloc; 32 | _this->onDelloc = &cssMapKVOnDelloc; 33 | 34 | _this->key = key; 35 | _this->value = value; 36 | value->retain(value); 37 | return _this; 38 | } 39 | //KV class <<<<<<<<<<<<<<<<<<<<<<<<< 40 | 41 | 42 | void cssMapOnDelloc(cssMap * _this){ 43 | 44 | cssSystemLog("delloc map %lld", (long long)_this); 45 | 46 | _this->_kvList->release(_this->_kvList); 47 | 48 | _this->_onObjectDelloc(_this); 49 | } 50 | 51 | bool cssMapContainsKey(cssMap * _this,char * key){ 52 | cssListEach(_this->_kvList, cssMapKV*, obj, { 53 | if (strcmp(obj->key, key)==0) { 54 | return true; 55 | } 56 | }) 57 | 58 | return false; 59 | } 60 | 61 | void cssMapPut(cssMap * _this,char * key,cssObject * value){ 62 | if (!cssMapContainsKey(_this, key)) { 63 | cssMapKV * kv = cssMapKVInit(cssAlloc(cssMapKV), key, value); 64 | _this->_kvList->addAtLast(_this->_kvList,cssAs(cssObject*,kv)); 65 | kv->release(kv); 66 | } 67 | } 68 | 69 | long cssMapGetLength(cssMap * _this){ 70 | return _this->_kvList->getLength(_this->_kvList); 71 | } 72 | 73 | cssObject * cssMapGet(cssMap * _this,char * key){ 74 | cssListEach(_this->_kvList, cssMapKV*, kv, { 75 | if (strcmp(key, kv->key)==0) { 76 | return kv->value; 77 | } 78 | }) 79 | 80 | return NULL; 81 | } 82 | 83 | void cssMapRemove(cssMap * _this,char *key){ 84 | cssListEach(_this->_kvList, cssMapKV*, kv, { 85 | if (strcmp(key, kv->key)==0) { 86 | _this->_kvList->removeListItem(_this->_kvList,item); 87 | break; 88 | } 89 | }) 90 | } 91 | 92 | cssMap * cssMapInit(cssMap * _this){ 93 | cssObjectInit(cssAs(cssObject*, _this)); 94 | 95 | _this->_onObjectDelloc = _this->onDelloc; 96 | _this->onDelloc = &cssMapOnDelloc; 97 | 98 | _this->_kvList = cssListInit(cssAlloc(cssList)); 99 | _this->put = &cssMapPut; 100 | _this->containsKey = &cssMapContainsKey; 101 | _this->get = &cssMapGet; 102 | _this->getLength = &cssMapGetLength; 103 | _this->remove = &cssMapRemove; 104 | 105 | cssSystemLog("init map %lld", (long long)_this); 106 | return _this; 107 | } 108 | 109 | cssCreateFuncImpl(cssMap) 110 | 111 | -------------------------------------------------------------------------------- /CSubSub/lib/cssMap.h: -------------------------------------------------------------------------------- 1 | // 2 | // cssMap.h 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-25. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #ifndef __CSubSub__cssMap__ 10 | #define __CSubSub__cssMap__ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { //c++ header start 14 | #endif 15 | 16 | #include "cssObject.h" 17 | #include "cssString.h" 18 | #include "cssList.h" 19 | #include 20 | 21 | 22 | #define cssMapFields(TYPE) \ 23 | cssObjectFields(TYPE) \ 24 | cssList * _kvList; \ 25 | void (*put)(TYPE,char * key,cssObject * value); \ 26 | cssObject* (*get)(TYPE,char *key); \ 27 | bool (*containsKey)(TYPE,char * key); \ 28 | long (*getLength)(TYPE); \ 29 | void (*_onObjectDelloc)(TYPE); \ 30 | void (*remove)(TYPE,char *key); 31 | 32 | cssClass(cssMap) 33 | 34 | cssMap* cssMapInit(cssMap * _this); 35 | cssCreateFunc(cssMap); 36 | 37 | #define cssMapPutD(map,key,value) map->put(map,key,cssAs(cssObject*, value)); 38 | 39 | 40 | 41 | #ifdef __cplusplus 42 | } //c++ header end 43 | #endif 44 | 45 | 46 | #endif /* defined(__CSubSub__cssMap__) */ 47 | -------------------------------------------------------------------------------- /CSubSub/lib/cssObject.c: -------------------------------------------------------------------------------- 1 | // 2 | // cssObject.c 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include "cssObject.h" 10 | #include "cssSystem.h" 11 | 12 | 13 | static void cssFuncImpl(cssObject*,cssObjectRetain){ 14 | _this->_retainCount++; 15 | } 16 | 17 | static void cssFuncImpl(cssObject*,cssObjectRelease){ 18 | _this->_retainCount--; 19 | if (_this->_retainCount<=0) { 20 | _this->onDelloc(_this); 21 | cssDelloc(_this); 22 | } 23 | } 24 | 25 | static cssObject * cssFuncImpl(cssObject*,cssObjectAutoRelease){ 26 | cssList * l = cssSystemGetInstance()->_pendingReleaseList; 27 | l->addAtLast(l,_this); 28 | return _this; 29 | } 30 | 31 | static int cssFuncImpl(cssObject*,cssObjectRetainCount){ 32 | return _this->_retainCount; 33 | } 34 | 35 | static void cssFuncImpl(cssObject*,cssObjectOnDelloc){ 36 | // 37 | } 38 | 39 | 40 | cssObject* cssFuncImpl(cssObject*,cssObjectInit){ 41 | 42 | _this->_retainCount = 1; 43 | _this->onDelloc = &cssObjectOnDelloc; 44 | _this->release = &cssObjectRelease; 45 | _this->autorelease = &cssObjectAutoRelease; 46 | _this->retain = &cssObjectRetain; 47 | _this->retainCount = &cssObjectRetainCount; 48 | 49 | return _this; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /CSubSub/lib/cssObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // cssObject.h 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #ifndef __CSubSub__cssObject__ 10 | #define __CSubSub__cssObject__ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | 22 | #define cssClass(name) typedef struct name{name##Fields(struct name *)}name; 23 | #define cssAs(type,object) ((type)(object)) 24 | #define cssAlloc(__class__) cssAs(__class__ *,malloc(sizeof(__class__))) 25 | #define cssDelloc(object) free(object) 26 | #define cssCreateFunc(__class__) __class__ * __class__##Create() 27 | #define cssCreateFuncImpl(__class__) cssCreateFunc(__class__) { \ 28 | __class__ * _ins = cssAlloc(__class__); \ 29 | if(_ins){ \ 30 | __class__##Init(_ins); \ 31 | _ins->autorelease(_ins); \ 32 | } \ 33 | return _ins; \ 34 | } 35 | #define cssFunc(classType,funcName) (* funcName)(classType _this) 36 | #define cssFuncA(classType,funcName,args...) (* funcName)(classType _this,args) 37 | #define cssFuncImpl(classType,funcName) funcName(classType _this) 38 | #define cssFuncImplA(classType,funcName,args...) funcName(classType _this,args) 39 | #define cssCall(target,method) (target->method(target)) 40 | #define cssCallA(target,method,args...) (target->method(target,args)) 41 | #define cssCallRT(ReturnType,target,method) ((ReturnType)(cssCall(target,method))) 42 | #define cssCallRTA(ReturnType,target,method,args...) ((ReturnType)(target->method(target,args))) 43 | 44 | 45 | 46 | //TYPE is type of the class that you wanna to create 47 | #define cssObjectFields(TYPE) \ 48 | int _retainCount; \ 49 | void cssFunc(TYPE,retain); \ 50 | void cssFunc(TYPE,release); \ 51 | TYPE cssFunc(TYPE,autorelease); \ 52 | int cssFunc(TYPE,retainCount); \ 53 | void cssFunc(TYPE,onDelloc); 54 | 55 | cssClass(cssObject) 56 | 57 | cssObject* cssObjectInit(cssObject *_this); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* defined(__CSubSub__cssObject__) */ 64 | -------------------------------------------------------------------------------- /CSubSub/lib/cssString.c: -------------------------------------------------------------------------------- 1 | // 2 | // cssString.c 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include "cssString.h" 10 | #include "cssSystem.h" 11 | 12 | 13 | static long cssFuncImpl(cssString*,cssStringGetLength){ 14 | return _this->_length; 15 | } 16 | 17 | static char* cssFuncImpl(cssString*,cssStringGetCString){ 18 | return _this->_cstr; 19 | } 20 | 21 | static void cssFuncImpl(cssString*,cssStringOnDelloc){ 22 | 23 | cssSystemLog("delloc string %s", _this->_cstr); 24 | 25 | free(_this->_cstr); 26 | 27 | _this->_onCssObjectDelloc(_this); 28 | } 29 | 30 | static cssString* cssFuncImplA(cssString*,cssStringAddCString,char * _other){ 31 | char * tmp = _this->_cstr; 32 | _this->_length+=strlen(_other); 33 | _this->_cstr = malloc(_this->_length+1); 34 | _this->_cstr[0] = '\0'; 35 | strcat(_this->_cstr,tmp); 36 | strcat(_this->_cstr,_other); 37 | _this->_cstr[_this->_length] = '\0'; 38 | free(tmp); 39 | 40 | return _this; 41 | } 42 | 43 | static cssString* cssFuncImplA(cssString*,cssStringAddCssString,cssString * _other){ 44 | cssStringAddCString(_this,cssAs(cssString*,_other)->getCString(_other)); 45 | return _this; 46 | } 47 | 48 | static cssString* cssStringAddInt(cssString * _this,int value){ 49 | 50 | char buf[20]; 51 | memset(buf, 0, 20); 52 | sprintf(buf, "%d",value); 53 | 54 | cssStringAddCString(_this, buf); 55 | 56 | return _this; 57 | } 58 | 59 | static cssString* cssStringAddLong(cssString * _this,long value){ 60 | 61 | char buf[20]; 62 | memset(buf, 0, 20); 63 | sprintf(buf, "%ld",value); 64 | 65 | cssStringAddCString(_this, buf); 66 | 67 | return _this; 68 | } 69 | 70 | static cssString* cssStringAddFloat(cssString * _this,float value){ 71 | 72 | char buf[20]; 73 | memset(buf, 0, 20); 74 | sprintf(buf, "%f",value); 75 | 76 | cssStringAddCString(_this, buf); 77 | return _this; 78 | } 79 | 80 | static char cssStringGetChar(cssString * _this,long index){ 81 | return _this->_cstr[index]; 82 | } 83 | 84 | cssString* cssStringInitWithCString(cssString * _this,char * cstr){ 85 | cssObjectInit(cssAs(cssObject*,_this)); 86 | 87 | //config Delloc functions >>> 88 | _this->_onCssObjectDelloc = _this->onDelloc; 89 | _this->onDelloc = &cssStringOnDelloc; 90 | 91 | //config related c string 92 | _this->_length = strlen(cstr); 93 | _this->_cstr = malloc(_this->_length+1); 94 | memset(_this->_cstr,0,_this->_length+1); 95 | strcpy(_this->_cstr,cstr); 96 | 97 | _this->getLength = &cssStringGetLength; 98 | _this->getCString = &cssStringGetCString; 99 | _this->addCString = &cssStringAddCString; 100 | _this->addCssString = &cssStringAddCssString; 101 | _this->addInt = &cssStringAddInt; 102 | _this->addLong = &cssStringAddLong; 103 | _this->addFloat = &cssStringAddFloat; 104 | _this->getChar = &cssStringGetChar; 105 | 106 | cssSystemLog("init string %s", cstr); 107 | return _this; 108 | } 109 | 110 | cssString* cssStringCreateWithCString(char * cstr){ 111 | 112 | cssString * _ins = cssStringInitWithCString(cssAlloc(cssString),cstr); 113 | _ins->autorelease(_ins); 114 | return _ins; 115 | } 116 | 117 | cssString* cssStringCreate(){ 118 | return cssStringCreateWithCString(""); 119 | } 120 | -------------------------------------------------------------------------------- /CSubSub/lib/cssString.h: -------------------------------------------------------------------------------- 1 | // 2 | // cssString.h 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-20. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #ifndef __CSubSub__cssString__ 10 | #define __CSubSub__cssString__ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #include "cssObject.h" 17 | 18 | #define cssStringFields(TYPE) \ 19 | cssObjectFields(TYPE) \ 20 | long _length; \ 21 | char * _cstr; \ 22 | void cssFunc(TYPE,_onCssObjectDelloc); \ 23 | long cssFunc(TYPE,getLength); \ 24 | char* cssFunc(TYPE,getCString); \ 25 | TYPE cssFuncA(TYPE,addCssString,TYPE _other); \ 26 | TYPE cssFuncA(TYPE,addCString,char * _other); \ 27 | TYPE cssFuncA(TYPE,addInt,int value); \ 28 | TYPE cssFuncA(TYPE,addLong,long value); \ 29 | TYPE cssFuncA(TYPE,addFloat,float value); \ 30 | char cssFuncA(TYPE,getChar,long index); 31 | 32 | cssClass(cssString) 33 | 34 | cssString* cssStringInitWithCString(cssString * str,char * cstr); 35 | cssString* cssStringCreateWithCString(char * cstr); 36 | cssString* cssStringCreate(); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* defined(__CSubSub__cssString__) */ 43 | -------------------------------------------------------------------------------- /CSubSub/lib/cssSystem.c: -------------------------------------------------------------------------------- 1 | // 2 | // cssSystem.c 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-23. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #include "cssSystem.h" 10 | 11 | 12 | static void cssSystemGc(cssSystem * _this){ 13 | cssList * l = _this->_pendingReleaseList; 14 | 15 | cssObject * obj =NULL; 16 | while (l->_length) { 17 | obj = cssCallA(l, get, 0); 18 | cssCall(obj, release); 19 | cssCallA(l, removeAt, 0); 20 | } 21 | } 22 | 23 | static void cssSystemOnDelloc(cssSystem * _this){ 24 | cssCall(_this->_pendingReleaseList, release); 25 | cssCall(_this, _onObjectDelloc); 26 | } 27 | 28 | static void cssSystemLogOn(cssSystem * _this){ 29 | _this->_isLogOn = true; 30 | } 31 | 32 | static void cssSystemLogOff(cssSystem * _this){ 33 | _this->_isLogOn = false; 34 | } 35 | 36 | static bool cssSystemIsLogOn(cssSystem * _this){ 37 | return _this->_isLogOn; 38 | } 39 | 40 | static cssSystem * cssSystemInit(cssSystem * _this){ 41 | 42 | cssObjectInit(cssAs(cssObject*, _this)); 43 | 44 | _this->_isLogOn = false; 45 | _this->_pendingReleaseList = cssListInit(cssAlloc(cssList)); 46 | _this->gc = &cssSystemGc; 47 | 48 | _this->_onObjectDelloc = _this->onDelloc; 49 | _this->onDelloc = &cssSystemOnDelloc; 50 | _this->logOff = &cssSystemLogOff; 51 | _this->logOn = &cssSystemLogOn; 52 | _this->isLogOn = &cssSystemIsLogOn; 53 | 54 | return _this; 55 | } 56 | 57 | cssSystem * cssSystemGetInstance(){ 58 | static cssSystem * __ins = NULL; 59 | 60 | if (__ins==NULL) { 61 | __ins = cssSystemInit(cssAlloc(cssSystem)); 62 | } 63 | 64 | return __ins; 65 | } -------------------------------------------------------------------------------- /CSubSub/lib/cssSystem.h: -------------------------------------------------------------------------------- 1 | // 2 | // cssSystem.h 3 | // CSubSub 4 | // 5 | // Created by plter on 14-5-23. 6 | // Copyright (c) 2014年 plter. All rights reserved. 7 | // 8 | 9 | #ifndef __CSubSub__cssSystem__ 10 | #define __CSubSub__cssSystem__ 11 | 12 | 13 | #ifdef __cplusplus 14 | extern "C" { //c++ header start 15 | #endif 16 | 17 | #include "cssObject.h" 18 | #include "cssList.h" 19 | #include 20 | 21 | #define cssSystemFields(TYPE) \ 22 | cssObjectFields(TYPE) \ 23 | cssList * _pendingReleaseList; \ 24 | bool _isLogOn; \ 25 | void (*gc)(TYPE); \ 26 | void (*_onObjectDelloc)(TYPE); \ 27 | void (*logOn)(TYPE); \ 28 | void (*logOff)(TYPE); \ 29 | bool (*isLogOn)(TYPE); 30 | 31 | cssClass(cssSystem) 32 | 33 | cssSystem * cssSystemGetInstance(); 34 | 35 | 36 | #define cssSystemLog(format,args...) {\ 37 | if(cssCall(cssSystemGetInstance(),isLogOn)){ \ 38 | time_t t = time(NULL); \ 39 | struct tm* tm = localtime(&t); \ 40 | printf("[%d:%d:%d]",tm->tm_hour,tm->tm_min,tm->tm_sec); \ 41 | printf(format,args); \ 42 | printf("\n"); \ 43 | } \ 44 | } 45 | 46 | #ifdef __cplusplus 47 | } //c++ header end 48 | #endif 49 | 50 | 51 | #endif /* defined(__CSubSub__cssSystem__) */ 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CSubSub 2 | ======= 3 | 4 | C语言面向对象库 5 | 6 | #为什么要使用C-- 7 | 1. C--完全使用C语言开发,高效、快速 8 | 2. C++越来越复杂,概念越来越多,给人的感觉就像是一个天生有病的人,在后天又用各种方式去治疗,导致这个病人伤痕累累、体无完肤,好像说得有点儿过了,但是事实上是因为C++概念太多,用法太多,学起来太不人性了,爱因斯坦说过,这个世界上任何看似复杂的存在,都有一个简单的解释,那么按这一原则来说,C++设计得太逆天了 9 | 3. 用C--可以写出完美的面向对象的程序 10 | 4. 一起来拥抱简洁完美的C语言吧 11 | 12 | #C--的自动释放机制 13 | 1. 如果指定一个对象为自动释放(autorelease)的话,cssSystem会将该对象记录 14 | 2. 在执行cssCall(cssSystemGetInstance(), gc)时,所有记录的对象都将被释放 15 | 16 | 17 | 18 | #HelloWorld示例代码如下: 19 | ```c 20 | 21 | #include 22 | #include "css.h" 23 | 24 | #include 25 | #include "css.h" 26 | 27 | int main(int argc, const char * argv[]) 28 | { 29 | 30 | cssCall(cssSystemGetInstance(), logOn); 31 | 32 | cssString * str = cssStringCreateWithCString("Hello World"); 33 | 34 | // insert code here... 35 | printf("%s\n",cssCall(str, getCString)); 36 | 37 | cssCall(cssSystemGetInstance(), gc); 38 | return 0; 39 | } 40 | 41 | ``` --------------------------------------------------------------------------------