Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] Commenting source code



>> (You do have all of your carbon symbols entered as a custom keywords
>> right? It's easy to do and very helpful!)
>
> How does one do this all at once so the Carbon function and constant names
> show up in blue?
>

For the functions:
What you need to do is generate a text file of all the carbon functions and
import this into one of the custom keyword lists in CodeWarrior:Text Colors
preference panel.

Creating the list is not too tricky. The way I did it was (a bit clucky):

Add CarbonLib to a CFM target (It will probably already be in one)
Disassemble CarbonLib

At the top of the disassembly is a section which starts:


Names:
1: CarbonLib
2: kCFTypeDictionaryKeyCallBacks
3: GetPort
4: LMGetMemTop
5: PenNormal
6: CFPlugInInstanceCreate
7: FSClose


In CodeWarrior, Command-drag out a selection rectangle from the start of
kCFTypeDictionaryKeyCallBacks to the end of the last function in the list of
names (OTDeleteNameByID in mine). This will require you to be using a
monospace font and to move the mouse far enough to the right to ensure
everything is selected correcty.

- You did all know what Command-Dragging does in CodeWarrior. Right ;)

Copy this and paste it into a new file


I imagine that there is some nifty command line tool that will do the same
thing for Frameworks, but haven't hunted it down yet

For constants etc:
you have to not use one of the standard precompiled headers and roll your
own one as part of the project.

Matt
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: [OT] Commenting source code (From: Trygve Inda <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.