Changeset 9572 for trunk/psModules/src/concepts/pmConcepts.c
- Timestamp:
- Oct 13, 2006, 4:35:39 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConcepts.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConcepts.c
r9570 r9572 25 25 } 26 26 27 pmConceptSpec *pmConceptSpecAlloc(psMetadataItem *blank, // Blank value; contains the name 28 pmConceptParseFunc parse, // Function to call to parse the concept 29 pmConceptFormatFunc format // Function to call to format the concept 30 ) 27 pmConceptSpec *pmConceptSpecAlloc(psMetadataItem *blank, pmConceptParseFunc parse, 28 pmConceptFormatFunc format) 31 29 { 32 30 pmConceptSpec *spec = psAlloc(sizeof(pmConceptSpec)); … … 41 39 42 40 43 bool pmConceptRegister(psMetadataItem *blank, // Blank value; contains the name 44 pmConceptParseFunc parse, // Function to call to parse the concept 45 pmConceptFormatFunc format, // Function to call to format the concept 46 pmFPALevel level // Level at which to store concept in the FPA hierarchy 47 ) 41 bool pmConceptRegister(psMetadataItem *blank, pmConceptParseFunc parse, 42 pmConceptFormatFunc format, pmFPALevel level) 48 43 { 49 44 PS_ASSERT_PTR_NON_NULL(blank, false); … … 185 180 // Write all registered concepts for the specified level 186 181 static bool conceptsWrite(psMetadata **specs, // One of the concepts specifications 187 pmFPA *fpa, // The FPA188 pmChip *chip, // The chip189 pmCell *cell, // The cell182 const pmFPA *fpa, // The FPA 183 const pmChip *chip, // The chip 184 const pmCell *cell, // The cell 190 185 pmConceptSource source, // The source of the concepts to write 191 186 psDB *db, // Database handle 192 psMetadata *concepts // The concepts to write out187 const psMetadata *concepts // The concepts to write out 193 188 ) 194 189 { … … 218 213 } 219 214 220 // Set the concepts for a given FPA to blanks 221 bool pmConceptsBlankFPA(pmFPA *fpa // FPA for which to set blank concepts 222 ) 223 { 224 PS_ASSERT_PTR_NON_NULL(fpa, false); 225 psTrace("psModules.concepts", 5, "Blanking FPA concepts: %p %p\n", conceptsFPA, fpa->concepts); 226 return conceptsBlank(&conceptsFPA, fpa->concepts); 227 } 228 229 // Read the concepts for the given set of fpa, chip, cell 230 bool pmConceptsRead(pmFPA *fpa, // FPA for which to read concepts 231 pmChip *chip, // Chip for which to read concepts, or NULL 232 pmCell *cell, // Cell for which to read concepts, or NULL 233 pmConceptSource source, // The source of the concepts to read 234 psDB *db // Database handle 235 ) 215 216 bool pmConceptsRead(pmFPA *fpa, pmChip *chip, pmCell *cell, pmConceptSource source, psDB *db) 236 217 { 237 218 PS_ASSERT_PTR_NON_NULL(fpa, false); … … 248 229 249 230 250 // Read the concepts for a given FPA 251 bool pmConceptsReadFPA(pmFPA *fpa, // FPA for which to read concepts 252 pmConceptSource source, // The source of the concepts to read 253 bool propagateDown, // Propagate to lower levels? 254 psDB *db // Database handle 255 ) 231 bool pmConceptsBlankFPA(pmFPA *fpa) 232 { 233 PS_ASSERT_PTR_NON_NULL(fpa, false); 234 psTrace("psModules.concepts", 5, "Blanking FPA concepts: %p %p\n", conceptsFPA, fpa->concepts); 235 return conceptsBlank(&conceptsFPA, fpa->concepts); 236 } 237 238 239 bool pmConceptsReadFPA(pmFPA *fpa, pmConceptSource source, bool propagateDown, psDB *db) 256 240 { 257 241 PS_ASSERT_PTR_NON_NULL(fpa, false); … … 271 255 } 272 256 273 // Read the concepts for a given FPA 274 bool pmConceptsWriteFPA(pmFPA *fpa, // FPA for which to write concepts 275 pmConceptSource source, // The source of the concepts to read 276 bool propagateDown, // Propagate to lower levels? 277 psDB *db // Database handle 278 ) 257 bool pmConceptsWriteFPA(const pmFPA *fpa, pmConceptSource source, bool propagateDown, psDB *db) 279 258 { 280 259 PS_ASSERT_PTR_NON_NULL(fpa, false); … … 293 272 } 294 273 295 // Set the concepts for a given chip to blanks 296 bool pmConceptsBlankChip(pmChip *chip // FPA for which to set blank concepts 297 ) 274 bool pmConceptsBlankChip(pmChip *chip) 298 275 { 299 276 PS_ASSERT_PTR_NON_NULL(chip, false); … … 302 279 } 303 280 304 // Read the concepts for a given FPA 305 bool pmConceptsReadChip(pmChip *chip, // Chip for which to read concepts 306 pmConceptSource source, // The source of the concepts to read 307 bool propagateUp, // Propagate to higher levels? 308 bool propagateDown, // Propagate to lower levels? 309 psDB *db // Database handle 310 ) 281 bool pmConceptsReadChip(pmChip *chip, pmConceptSource source, bool propagateUp, 282 bool propagateDown, psDB *db) 311 283 { 312 284 PS_ASSERT_PTR_NON_NULL(chip, false); … … 330 302 } 331 303 332 // Read the concepts for a given FPA 333 bool pmConceptsWriteChip(pmChip *chip, // Chip for which to write concepts 334 pmConceptSource source, // The source of the concepts to read 335 bool propagateUp, // Propagate to higher levels? 336 bool propagateDown, // Propagate to lower levels? 337 psDB *db // Database handle 338 ) 304 bool pmConceptsWriteChip(const pmChip *chip, pmConceptSource source, bool propagateUp, 305 bool propagateDown, psDB *db) 339 306 { 340 307 PS_ASSERT_PTR_NON_NULL(chip, false); … … 357 324 } 358 325 359 // Set the concepts for a given chip to blanks 360 bool pmConceptsBlankCell(pmCell *cell // Cell for which to set blank concepts 361 ) 326 bool pmConceptsBlankCell(pmCell *cell) 362 327 { 363 328 PS_ASSERT_PTR_NON_NULL(cell, false); … … 366 331 } 367 332 368 // Read the concepts for a given FPA 369 bool pmConceptsReadCell(pmCell *cell, // Cell for which to read concepts 370 pmConceptSource source, // The source of the concepts to read 371 bool propagateUp, // Propagate to higher levels? 372 psDB *db // Database handle 373 ) 333 bool pmConceptsReadCell(pmCell *cell, pmConceptSource source, bool propagateUp, psDB *db) 374 334 { 375 335 PS_ASSERT_PTR_NON_NULL(cell, false); … … 394 354 } 395 355 396 // Read the concepts for a given FPA 397 bool pmConceptsWriteCell(pmCell *cell, // FPA for which to write concepts 398 pmConceptSource source, // The source of the concepts to read 399 bool propagateUp, // Propagate to higher levels? 400 psDB *db // Database handle 401 ) 356 bool pmConceptsWriteCell(const pmCell *cell, pmConceptSource source, bool propagateUp, psDB *db) 402 357 { 403 358 PS_ASSERT_PTR_NON_NULL(cell, false); … … 423 378 { 424 379 conceptsInitialised = true; 380 381 p_psMemAllocatePersistent(true); 425 382 426 383 bool init = false; // Did we initialise anything? … … 761 718 } 762 719 720 p_psMemAllocatePersistent(false); 721 763 722 return init; 764 723 } … … 777 736 778 737 779 // Copy concepts from one FPA to another 780 bool pmFPACopyConcepts(pmFPA *target, // The target FPA 781 pmFPA *source // The target FPA 782 ) 738 bool pmFPACopyConcepts(pmFPA *target, const pmFPA *source) 783 739 { 784 740 PS_ASSERT_PTR_NON_NULL(target, false);
Note:
See TracChangeset
for help on using the changeset viewer.
