Source Insight

Embed Size (px)

Citation preview

  • 8/8/2019 Source Insight

    1/393

    Source Insight User Manual i

    Contents

    Contents

    CHAPTER 1 INTRODUCTION ........................................................................................ 1 The Big Picture ................................................................................................. 2Feature Highlights ............................................................................................ 3

    System Requirements: ............................................................................................. 14

    Technical Support .......................................................................................... 14

    CHAPTER 2 SETUP AND QUICKSTART........................................................................ 15Installing Source Insight ................................................................................. 15

    Installing on Windows NT/2000/XP ......................................................................... 15Upgrading from Version 2 ....................................................................................... 15Upgrading from Version 3.0 and 3.1 ........................................................................ 16Insert the CD-ROM.................................................................................................. 16Choosing a Drive for the Installation ....................................................................... 16Using Version 3 and Version 2 Together ................................................................... 17 Configuring Source Insight ..................................................................................... 17 Entering Your Serial Number ................................................................................... 17 Creating Common Projects ..................................................................................... 17

    Creating a Project ................................................................................................... 18

    CHAPTER 3 WINDOW TOUR ...................................................................................... 21Source Insight Application Window ............................................................... 21 Toolbars ......................................................................................................... 22Source File Windows ...................................................................................... 26Symbol Windows ........................................................................................... 27Floating Windows .......................................................................................... 29

    Project Window .............................................................................................. 30Opening Files Quickly ............................................................................................. 31Project Window Views ............................................................................................. 31

    Context Window ............................................................................................ 34Previewing Files ...................................................................................................... 35Showing Declarations and Definitions .................................................................... 35Decoding Base Types to Show Structures ................................................................. 37 Customizing the Context Window .......................................................................... 38

  • 8/8/2019 Source Insight

    2/393

    Contents

    ii Source Insight User Manual

    Relation Window ............................................................................................ 39Outline and Graph Views ........................................................................................ 40Relationship Types ................................................................................................. 40Relation Window Performance ............................................................................... 40Relationship Rules .................................................................................................. 41Call Graphs ............................................................................................................ 41

    Multiple Relation Windows ..................................................................................... 41Customizing the Relation Window .......................................................................... 41

    Clip Window ................................................................................................... 42What Is A Clip? ....................................................................................................... 42Creating a New Clip ............................................................................................... 42Clip Storage ........................................................................................................... 43

    Search Results Window .................................................................................. 43

    CHAPTER 4 SOURCE INSIGHT CONCEPTS .................................................................... 45

    Projects .......................................................................................................... 45Project Features ..................................................................................................... 47 Creating a Project .................................................................................................. 47 Project Directories .................................................................................................. 47 Normalized File Names .......................................................................................... 48The Project List ....................................................................................................... 49 Adding Files to a Project ......................................................................................... 49Removing Files from a Project ................................................................................. 50Closing Projects ..................................................................................................... 50Opening Projects .................................................................................................... 50Removing a Project ................................................................................................ 51Changing Project Settings ...................................................................................... 51

    Working in a Team Environment .................................................................... 51Using a Network .................................................................................................... 52 Adding Remote Files to a Project ............................................................................. 52Using Source Control .............................................................................................. 53

    Understanding Symbols and Projects ............................................................ 54Languages Used to Parse Source Files ..................................................................... 54Symbol Naming ..................................................................................................... 54Updating the Symbol Database ............................................................................. 55File Names Are Like Symbols................................................................................... 55Synchronizing Project Files ..................................................................................... 55

    Using Common Projects: The Project Symbol Path................................................... 56

    Searching the Project Symbol Path ......................................................................... 57 Working With No Project Open ............................................................................... 57 The Base Project ..................................................................................................... 57

    Programming Languages .............................................................................. 58Built-In Languages ................................................................................................. 58Custom Languages ................................................................................................ 58.Net Framework Support ........................................................................................ 59

  • 8/8/2019 Source Insight

    3/393

    Source Insight User Manual iii

    Contents

    Using HTML............................................................................................................ 59Using HTML and ASP Compound Languages ........................................................... 59 Java Language Editing ........................................................................................... 60

    C/C++ Language Features .............................................................................. 60Working with Inactive Code - ifdef Support .............................................................. 60Conditional Parsing ................................................................................................ 61

    Preprocessor Token Macros ..................................................................................... 62Parsing Considerations ........................................................................................... 65Coding Tips for Good Parsing Results ...................................................................... 65

    Document Types ............................................................................................ 66Document-Specific Options .................................................................................... 67 Associating Files with Document Types ................................................................... 67 Associating Special File Names ............................................................................... 68 Adding New File Types............................................................................................ 68Editing the Document Options ................................................................................ 68

    Typing Symbol Names with Syllable Indexing ............................................... 68What is a Symbol Syllable? ...................................................................................... 69

    Symbol Indexes for Projects ..................................................................................... 69Setting Index Options for Projects ............................................................................ 70Controlling Syllable Matching ................................................................................. 70Using Syllable Matching ......................................................................................... 70Using Syllable Shortcuts ......................................................................................... 71

    Analysis Features ............................................................................................ 71Parsing ................................................................................................................... 72Symbol Navigation Commands .............................................................................. 72Project Window Symbol List .................................................................................... 73Call Trees and Reference Trees ................................................................................. 73Context Window ..................................................................................................... 73

    Command Line Symbol Access ................................................................................ 73Finding References to Symbols ................................................................................ 74Creating a Project Report ........................................................................................ 74Smart Renaming .................................................................................................... 74

    Syntax Formatting and Styles ........................................................................ 74How a Style Works .................................................................................................. 75Formatting Properties ............................................................................................. 75Parent Styles ........................................................................................................... 76How Styles Apply to Source Code ............................................................................ 77 Language Keyword Styles ....................................................................................... 77 Declaration Styles ................................................................................................... 78

    Reference Styles ...................................................................................................... 78Inactive Code Style ................................................................................................. 79Comment Styles ..................................................................................................... 79Syntax Decorations ................................................................................................ 81Controlling Syntax Formatting ................................................................................ 82

    Searching and Replacing Text ........................................................................ 83Searching for Symbol References ............................................................................. 84Renaming an Identifier ........................................................................................... 84

  • 8/8/2019 Source Insight

    4/393

    Contents

    iv Source Insight User Manual

    Searching the Current File ...................................................................................... 84Replacing in the Current File ................................................................................... 84Searching Multiple Files ......................................................................................... 85Replacing in Multiple Files ...................................................................................... 85Searching for Keywords .......................................................................................... 85

    Regular Expressions ....................................................................................... 85Wildcard Matching ................................................................................................ 85Matching the Beginning or End of a Line ................................................................. 86Matching a Tab or Space ........................................................................................ 86Matching 0, 1, or More Occurrences ........................................................................ 86Matching Any in a Set of Characters ....................................................................... 86Regular Expression Groups ..................................................................................... 87 Overriding Regular Expression Characters .............................................................. 87 Regular Expression Summary ................................................................................. 88

    Bookmarks ..................................................................................................... 89Navigation with the Selection History ........................................................... 89

    Go Back and Go Forward commands ...................................................................... 89

    Navigation Using Source Links ...................................................................... 90Searching and Source Links .................................................................................... 90Creating Source Links ............................................................................................. 91Source Links from Custom Command Output ......................................................... 91Navigating with Source Links ................................................................................. 91

    Scrolling and Selecting Text ........................................................................... 92Moving Through a File ........................................................................................... 92Scrolling Commands .............................................................................................. 93Selection Commands ............................................................................................. 93Extending the Selection .......................................................................................... 95Selection Shortcuts ................................................................................................ 96

    File Buffer Basics............................................................................................. 97Time stamping ....................................................................................................... 99What Happens when you Start Source Insight ........................................................ 99

    Recovering From Crashes ............................................................................... 99Recovery Procedure .............................................................................................. 100Warnings ............................................................................................................. 100

    Command Line Syntax ................................................................................. 101Specifying File Arguments .................................................................................... 101Opening Files ....................................................................................................... 101Opening Workspaces ........................................................................................... 102

    Command Line Options....................................................................................... 103

    User-Level Commands ................................................................................. 104Custom Commands ..................................................................................... 105Customizing Source Insight ......................................................................... 105

    Loading and Saving Configurations ..................................................................... 106Project Settings .................................................................................................... 106

    Saving Configurations .................................................................................. 106Configuration Files ............................................................................................... 107

  • 8/8/2019 Source Insight

    5/393

    Source Insight User Manual v

    Contents

    Where Are Configuration Files Stored? ................................................................... 107 Loading a Configuration ....................................................................................... 108Saving a Configuration ......................................................................................... 108

    Saving and Restoring Workspaces ............................................................... 109Loading and Saving Workspaces ........................................................................... 109Managing Tasks With Workspaces ........................................................................ 109

    Performance Tuning ..................................................................................... 110Factors That Affect Performance ........................................................................... 110Speeding Up Program Features ............................................................................. 113

    Files Created by Source Insight .................................................................... 117Files in the Program Directory ............................................................................... 117 Per-User Data Folder ............................................................................................. 117 Files Created for Each User .................................................................................... 118Configuration Template for All Users ..................................................................... 119Files Created for Each Project ................................................................................ 119

    CHAPTER 5 COMMAND REFERENCE..........................................................................121Commands Overview ........................................................................................... 121 About Source Insight ............................................................................................ 122 Activate Menu Commands .................................................................................... 122 Activate Global Symbol List ................................................................................... 122 Activate Relation Window ..................................................................................... 122 Activate Search Results ......................................................................................... 123 Activate Symbol Window ...................................................................................... 123 Add and Remove Project Files ................................................................................ 123 Add File................................................................................................................ 125

    Add File List .......................................................................................................... 127

    Advanced Options ................................................................................................ 127 Back Tab............................................................................................................... 127 Backspace ............................................................................................................ 127 Beginning of Line.................................................................................................. 127 Beginning of Selection .......................................................................................... 128Blank Line Down .................................................................................................. 128Blank Line Up....................................................................................................... 128Block Down.......................................................................................................... 128Block Up............................................................................................................... 128Bookmark ............................................................................................................ 128Bottom of File ....................................................................................................... 129

    Bottom of Window ............................................................................................... 129Browse Files.......................................................................................................... 129Browse Project Symbols ........................................................................................ 129Browse Global Symbols Dialog box ....................................................................... 130Browse Local File Symbols..................................................................................... 132Cascade Windows ................................................................................................ 134Checkpoint ........................................................................................................... 134Checkpoint All ...................................................................................................... 134

  • 8/8/2019 Source Insight

    6/393

    Contents

    vi Source Insight User Manual

    Clear Highlights ................................................................................................... 134Clip Properties ...................................................................................................... 135Clip Window Properties ........................................................................................ 135Close ................................................................................................................... 136Close All ............................................................................................................... 137 Close Project ........................................................................................................ 137

    Close Window ...................................................................................................... 137 Color Options ...................................................................................................... 138Command Shell ................................................................................................... 139Complete Symbol ................................................................................................. 139Context Window .................................................................................................. 140Context Window Properties .................................................................................. 140Copy .................................................................................................................... 142Copy Line............................................................................................................. 143Copy Line Right .................................................................................................... 143Copy List .............................................................................................................. 143Copy Symbol ........................................................................................................ 143Copy To Clip......................................................................................................... 144Create Key List ...................................................................................................... 144Create Command List ........................................................................................... 144Cursor Down ........................................................................................................ 144Cursor Left ........................................................................................................... 144Cursor Right ......................................................................................................... 144Cursor Up ............................................................................................................ 145Custom Commands ............................................................................................. 145Cut ...................................................................................................................... 152Cut Line ............................................................................................................... 152Cut Line Left ......................................................................................................... 153Cut Line Right ...................................................................................................... 153

    Cut Selection or Paste ........................................................................................... 153Cut Symbol .......................................................................................................... 153Cut To Clip ........................................................................................................... 153Cut Word ............................................................................................................. 153Cut Word Left ....................................................................................................... 153Delete .................................................................................................................. 154Delete All Clips..................................................................................................... 154Delete Character .................................................................................................. 154Delete Clip ........................................................................................................... 154Delete File............................................................................................................ 154Delete Line........................................................................................................... 154Display Options ................................................................................................... 155Document Options .............................................................................................. 161Draft View ........................................................................................................... 166Drag Line Down ................................................................................................... 167 Drag Line Down More .......................................................................................... 167 Drag Line Up........................................................................................................ 167 Drag Line Up More ............................................................................................... 167 Duplicate ............................................................................................................. 167 Duplicate Symbol ................................................................................................. 167

  • 8/8/2019 Source Insight

    7/393

    Source Insight User Manual vii

    Contents

    Edit Condition ...................................................................................................... 167 Enable Event Handlers .......................................................................................... 169End of Line ........................................................................................................... 169End of Selection .................................................................................................... 169Exit ....................................................................................................................... 169Exit and Suspend .................................................................................................. 169

    Expand Special ..................................................................................................... 170File Options .......................................................................................................... 170Folder Options ...................................................................................................... 174Function Down ..................................................................................................... 175Function Up .......................................................................................................... 175General Options ................................................................................................... 175Go Back ................................................................................................................ 178Go Back Toggle..................................................................................................... 178Go Forward .......................................................................................................... 178Go To First Link ..................................................................................................... 179Go To Line ............................................................................................................ 181Go To Next Change ............................................................................................... 181Go To Previous Change ......................................................................................... 181Go To Next Link ..................................................................................................... 181Go To Previous Link ............................................................................................... 181Help ..................................................................................................................... 181Help Mode ............................................................................................................ 182Highlight Word ..................................................................................................... 182Incremental Search .............................................................................................. 182Incremental Search Mode ..................................................................................... 183Incremental Search Backward .............................................................................. 183Horizontal Scroll Bar ............................................................................................. 183HTML Help........................................................................................................... 183

    Indent Left ............................................................................................................ 183Indent Right ......................................................................................................... 183Insert ASCII ........................................................................................................... 184Insert File.............................................................................................................. 185Insert Line ............................................................................................................ 186Insert Line Before Next .......................................................................................... 186Insert New Line..................................................................................................... 186 Join Lines ............................................................................................................. 186 Jump To Base Type ................................................................................................ 186 Jump To Caller ...................................................................................................... 187 Jump To Definition ............................................................................................... 187 Jump To Link ........................................................................................................ 187 Jump To Prototype ................................................................................................ 187 Key Assignments................................................................................................... 187 Keyword List ......................................................................................................... 190Language Options ................................................................................................ 193Language Properties ............................................................................................ 196Line Numbers ....................................................................................................... 202Link All Windows.................................................................................................. 202Link Window ........................................................................................................ 203

  • 8/8/2019 Source Insight

    8/393

    Contents

    viii Source Insight User Manual

    Load Configuration .............................................................................................. 204Load File.............................................................................................................. 206Load Search String ............................................................................................... 207 Lock Context Window .......................................................................................... 207 Lock Relation Window .......................................................................................... 207 Lookup References ............................................................................................... 208

    Make Column Selection ........................................................................................ 211Menu Assignments ............................................................................................... 211New ..................................................................................................................... 212New Clip.............................................................................................................. 213New Relation Window .......................................................................................... 213New Project ......................................................................................................... 213New Window ....................................................................................................... 214Next File............................................................................................................... 214Next Relation Window View ................................................................................. 214Open ................................................................................................................... 214Open Project ........................................................................................................ 215Page Down .......................................................................................................... 215Page Setup .......................................................................................................... 216Page Up ............................................................................................................... 218Paren Left ............................................................................................................ 218Paren Right .......................................................................................................... 218Parse Source Links ................................................................................................ 218Paste ................................................................................................................... 219Paste From Clip .................................................................................................... 219Paste Line ............................................................................................................ 219Paste Symbol ....................................................................................................... 219Play Recording ..................................................................................................... 220Preferences .......................................................................................................... 220

    Print .................................................................................................................... 220Print Relation Window ......................................................................................... 221Project Document Types ....................................................................................... 221Project File Browser .............................................................................................. 222Project File List ..................................................................................................... 222Project Symbol Classes ......................................................................................... 223Project Symbol List ............................................................................................... 223Project Window Properties ................................................................................... 224Project Settings .................................................................................................... 225Project Report ...................................................................................................... 228Project Window command ................................................................................... 229Rebuild Project ..................................................................................................... 229Record New Default Properties ............................................................................. 230Redo .................................................................................................................... 230Redo All ............................................................................................................... 230Redraw Screen ..................................................................................................... 231Reform Paragraph ............................................................................................... 231Refresh Relation Window ..................................................................................... 231Relation Graph Properties .................................................................................... 232Relation Window ................................................................................................. 233

  • 8/8/2019 Source Insight

    9/393

    Source Insight User Manual ix

    Contents

    Relation Window Properties .................................................................................. 233Relation Window Properties Dialog Box ................................................................ 234Reload File............................................................................................................ 238Reload Modified Files............................................................................................ 239Remove File.......................................................................................................... 239Remove Project ..................................................................................................... 240

    Remote Options ................................................................................................... 241Rename ................................................................................................................ 242Renumber ............................................................................................................ 242Repeat Typing ...................................................................................................... 243Replace ................................................................................................................ 243Replace Files......................................................................................................... 245Restore File........................................................................................................... 247 Restore Lines ........................................................................................................ 248Save ..................................................................................................................... 248Save A Copy ......................................................................................................... 248Save All ................................................................................................................ 249Save All Quietly ..................................................................................................... 250Save As................................................................................................................. 250Save Configuration ............................................................................................... 251Save Selection ...................................................................................................... 252Save Workspace ................................................................................................... 252Scroll Half Page Down .......................................................................................... 252Scroll Half Page Up ............................................................................................... 252Scroll Left ............................................................................................................. 253Scroll Line Down................................................................................................... 253Scroll Line Up........................................................................................................ 253Scroll Right ........................................................................................................... 253SDK Help.............................................................................................................. 253

    Search .................................................................................................................. 254Search Backward .................................................................................................. 255Search Backward for Selection .............................................................................. 255Search Files .......................................................................................................... 255Search Forward .................................................................................................... 258Search Forward for Selection ................................................................................ 259Search List ............................................................................................................ 259Search Project ...................................................................................................... 259Searching Options ................................................................................................ 260Select All .............................................................................................................. 260Select Block .......................................................................................................... 261Select Char Left ..................................................................................................... 261Select Char Right .................................................................................................. 261Select Function or Symbol ..................................................................................... 261Select Line............................................................................................................ 261Select Line Down .................................................................................................. 261Select Line Up....................................................................................................... 261Select Match ......................................................................................................... 261Select Next Window .............................................................................................. 261Select Sentence .................................................................................................... 262

  • 8/8/2019 Source Insight

    10/393

    Contents

    x Source Insight User Manual

    Select Symbol ...................................................................................................... 262Select To .............................................................................................................. 262Select To End Of File............................................................................................. 262Select To Top Of File.............................................................................................. 262Select Word .......................................................................................................... 262Select Word Left ................................................................................................... 262

    Select Word Right ................................................................................................. 263Selection History .................................................................................................. 263Setup Common Projects ....................................................................................... 263Setup HTML Help................................................................................................. 265Setup WinHelp File............................................................................................... 265Show Clipboard ................................................................................................... 265Show File Status ................................................................................................... 265Simple Tab ........................................................................................................... 265Smart End of Line................................................................................................. 266Smart Beginning of Line ....................................................................................... 266Smart Rename ..................................................................................................... 266Smart Tab ............................................................................................................ 268Sort Symbol Window ............................................................................................ 269Sort Symbols By Line............................................................................................ 269Sort Symbols by Name ......................................................................................... 269Sort Symbols By Type ........................................................................................... 270Source Dynamics on the Web ............................................................................... 270Start Recording .................................................................................................... 270Stop Recording .................................................................................................... 270Style Properties .................................................................................................... 270Symbol Info ......................................................................................................... 273Symbol Lookup Options ....................................................................................... 274Symbol Window command .................................................................................. 276

    Symbol Window Properties .................................................................................. 276Sync File Windows................................................................................................ 277 Synchronize Files.................................................................................................. 277 Syntax Decorations .............................................................................................. 278Syntax Formatting ............................................................................................... 280Tile Horizontal ..................................................................................................... 282Tile One Window .................................................................................................. 283Tile Two Windows ................................................................................................ 283Tile Vertical .......................................................................................................... 283Toggle Insert Mode ............................................................................................... 283Top of File ............................................................................................................ 283Top of Window ..................................................................................................... 283Touch All Files in Relation..................................................................................... 283Typing Options .................................................................................................... 284Undo ................................................................................................................... 286Undo All .............................................................................................................. 287 Vertical Scroll Bar ................................................................................................. 287 View Clip.............................................................................................................. 288View Relation Outline ........................................................................................... 288View Relation Window Horizontal Graph .............................................................. 288

  • 8/8/2019 Source Insight

    11/393

    Source Insight User Manual xi

    Contents

    View Relation Window Vertical Graph ................................................................... 288Window List ......................................................................................................... 289Word Left .............................................................................................................. 290Word Right ........................................................................................................... 290 Zoom Window ...................................................................................................... 290

    CHAPTER 6 MACRO LANGUAGE GUIDE ....................................................................291Macro Language Overview .......................................................................... 291

    Basic Syntax Rules ................................................................................................ 291

    Variables ....................................................................................................... 295Declaring a Variable ............................................................................................. 296Variable Initialization ........................................................................................... 296Global Variables ................................................................................................... 296Variable Name Expansion ..................................................................................... 297 Expanding Variables in a String ............................................................................. 297

    Variable Arithmetic ............................................................................................... 298

    Indexing Into Strings ............................................................................................. 298Record Variables ................................................................................................... 299Record Variable Storage ........................................................................................ 299 Array Techniques .................................................................................................. 300

    Special Constants ......................................................................................... 301Operators ..................................................................................................... 301Conditions and Loops: if-else and while ...................................................... 302Naming Conventions ................................................................................... 304Standard Record Structures ......................................................................... 305

    Bookmark Record ................................................................................................. 305Bufprop Record ..................................................................................................... 306DIM Record ........................................................................................................... 306Link Record ........................................................................................................... 307 ProgEnvInfo Record .............................................................................................. 307 ProgInfo Record .................................................................................................... 307 Rect Record .......................................................................................................... 308Selection Record ................................................................................................... 309Symbol Record ..................................................................................................... 309SYSTIME Record .................................................................................................... 310

    Internal Macro Functions ............................................................................. 310

    String Functions ........................................................................................... 311AsciiFromChar (ch) ............................................................................................. 311cat (a, b) .............................................................................................................. 311CharFromAscii (ascii_code) ................................................................................ 311islower (ch) ......................................................................................................... 311IsNumber (s) ....................................................................................................... 311isupper (ch) ........................................................................................................ 311strlen (s) .............................................................................................................. 311strmid (s, ichFirst, ichLim) ................................................................................... 311

  • 8/8/2019 Source Insight

    12/393

    Contents

    xii Source Insight User Manual

    strtrunc (s, cch) ................................................................................................... 312tolower (s) ........................................................................................................... 312toupper (s) .......................................................................................................... 312

    User Input and Output Functions ................................................................ 312Ask (prompt_string) ............................................................................................ 312AssignKeyToCmd(key_value, cmd_name) .......................................................... 312

    Beep () ................................................................................................................ 312CharFromKey (key_code) .................................................................................... 312CmdFromKey(key_value) .................................................................................... 313EndMsg () ............................................................................................................ 313FuncFromKey (key_code) ................................................................................... 313GetChar () ........................................................................................................... 313GetKey () ............................................................................................................. 313GetSysTime(fLocalTime) ..................................................................................... 313IsAltKeyDown (key_code) ................................................................................... 313IsCtrlKeyDown (key_code) .................................................................................. 314IsFuncKey (key_code) ......................................................................................... 314

    KeyFromChar(char, fCtrl, fShift, fAlt) ................................................................... 314Msg (s) ................................................................................................................ 315StartMsg (s) ......................................................................................................... 315

    Buffer List Functions ..................................................................................... 315BufListCount () .................................................................................................... 315BufListItem (index) ............................................................................................. 316

    File Buffer Functions ..................................................................................... 316AppendBufLine (hbuf, s) ..................................................................................... 316ClearBuf (hbuf) ................................................................................................... 316CloseBuf (hbuf) ................................................................................................... 316CopyBufLine (hbuf, ln) ........................................................................................ 316

    DelBufLine (hbuf, ln) ........................................................................................... 316GetBufHandle (filename) .................................................................................... 316GetBufLine (hbuf, ln) ........................................................................................... 317GetBufLineCount (hbuf) ..................................................................................... 317GetBufLineLength (hbuf, ln) ............................................................................... 317GetBufLnCur (hbuf) ............................................................................................ 317GetBufName (hbuf) ............................................................................................ 317GetBufProps (hbuf) ............................................................................................. 317GetBufSelText (hbuf) .......................................................................................... 317GetCurrentBuf () ................................................................................................. 317InsBufLine (hbuf, ln, s) ......................................................................................... 317IsBufDirty (hbuf) ................................................................................................. 318IsBufRW (hbuf) ................................................................................................... 318MakeBufClip (hbuf, fClip) .................................................................................... 318NewBuf (name) ................................................................................................... 318OpenBuf (filename) ............................................................................................ 318OpenMiscFile (filename) ..................................................................................... 318PasteBufLine (hbuf, ln) ........................................................................................ 318PrintBuf (hbuf, fUseDialogBox) ........................................................................... 318PutBufLine (hbuf, ln, s) ........................................................................................ 318

  • 8/8/2019 Source Insight

    13/393

    Source Insight User Manual xiii

    Contents

    RenameBuf (hbuf, szNewName) ......................................................................... 319SaveBuf (hbuf) ................................................................................................... 319SaveBufAs (hbuf, filename) ................................................................................. 319SetBufDirty (hbuf, fDirty) .................................................................................... 319SetBufIns (hbuf, ln, ich) ....................................................................................... 319SetBufSelText (hbuf, s) ........................................................................................ 319

    SetCurrentBuf (hbuf) .......................................................................................... 319Environment and Process Functions ............................................................ 320

    GetEnv (env_name) ............................................................................................ 320GetReg (reg_key_name) .................................................................................... 320IsCmdEnabled (cmd_name) ............................................................................... 320PutEnv (env_name, value) .................................................................................. 320RunCmd (cmd_name) ........................................................................................ 320RunCmdLine (sCmdLine, sWorkingDirectory, fWait) .......................................... 320SetReg (reg_key_name, value) ........................................................................... 320ShellExecute (sVerb, sFile, sExtraParams, sWorkingDirectory, windowstate) ...... 321

    Window List Functions ................................................................................. 322

    WndListCount () ................................................................................................. 322WndListItem (index) ........................................................................................... 322

    Window Functions ....................................................................................... 323CloseWnd (hwnd) ............................................................................................... 323GetApplicationWnd () ........................................................................................ 323GetCurrentWnd () ............................................................................................... 323GetNextWnd (hwnd) .......................................................................................... 324GetWndBuf (hwnd) ............................................................................................ 324GetWndClientRect (hwnd) ................................................................................. 324GetWndDim (hwnd) ........................................................................................... 324GetWndHandle (hbuf) ........................................................................................ 324

    GetWndHorizScroll (hwnd) ................................................................................. 324GetWndLineCount (hwnd) ................................................................................. 324GetWndLineWidth (hwnd, ln, cch) ...................................................................... 325GetWndParent (hwnd) ....................................................................................... 325GetWndRect (hwnd) ........................................................................................... 325GetWndSel (hwnd) ............................................................................................. 325GetWndSelIchFirst (hwnd) ................................................................................. 325GetWndSelIchLim (hwnd) .................................................................................. 326GetWndSelLnFirst (hwnd) .................................................................................. 326GetWndSelLnLast (hwnd) ................................................................................... 326GetWndVertScroll (hwnd) .................................................................................. 326IchFromXpos (hwnd, ln, xp) ................................................................................ 326IsWndMax (hwnd) .............................................................................................. 326IsWndMin (hwnd) ............................................................................................... 326IsWndRestored (hwnd) ....................................................................................... 327MaximizeWnd (hwnd) ........................................................................................ 327MinimizeWnd (hwnd) ......................................................................................... 327NewWnd (hbuf) ................................................................................................. 327ScrollWndHoriz (hwnd, pixel_count) .................................................................. 327ScrollWndToLine (hwnd, ln) ................................................................................ 327

  • 8/8/2019 Source Insight

    14/393

    Contents

    xiv Source Insight User Manual

    ScrollWndVert (hwnd, line_count) ...................................................................... 327SetCurrentWnd (hwnd) ....................................................................................... 327SetWndRect (hwnd, left, top, right, bottom) ....................................................... 327SetWndSel (hwnd, selection_record) .................................................................. 328 ToggleWndMax (hwnd) ...................................................................................... 328XposFromIch (hwnd, ln, ich) ............................................................................... 328

    Bookmark Functions .................................................................................... 328BookmarksAdd (name, filename, ln, ich) ............................................................ 328BookmarksCount () ............................................................................................. 329BookmarksDelete (name) ................................................................................... 329BookmarksItem (index) ...................................................................................... 329BookmarksLookupLine (filename, ln) ................................................................. 329BookmarksLookupName (name) ........................................................................ 329

    Symbol List Functions .................................................................................. 329SymListCount () .................................................................................................. 330SymListFree (hsyml) ............................................................................................ 330SymListInsert (hsyml, isym, symbolNew) ............................................................ 330

    SymListItem (hsyml, isym) .................................................................................. 330SymListNew () ..................................................................................................... 330SymListRemove (hsyml, isym) ............................................................................. 330

    Symbol Functions ........................................................................................ 331GetBufSymCount(hbuf) ...................................................................................... 331GetBufSymLocation(hbuf, isym) ......................................................................... 331GetBufSymName(hbuf, isym) ............................................................................. 331GetCurSymbol () ................................................................................................. 332GetSymbolLine (symbol_name) ......................................................................... 332GetSymbolLocation (symbol_name) .................................................................. 332GetSymbolLocationEx (symbol_name, output_buffer, fMatchCase, LocateFiles,

    fLocateSymbols) ............................................................................................ 333GetSymbolFromCursor (hbuf, ln, ich) .................................................................. 334GetSymbolLocationFromLn (hbuf, ln) ................................................................. 334JumpToLocation (symbol_record) ...................................................................... 334JumpToSymbolDef (symbol_name) .................................................................... 335SymbolChildren (symbol) ................................................................................... 335SymbolContainerName (symbol) ....................................................................... 335SymbolDeclaredType (symbol) ........................................................................... 336SymbolLeafName (symbol) ................................................................................. 336SymbolParent (symbol) ...................................................................................... 336SymbolRootContainer (symbol) ......................................................................... 336SymbolStructureType (symbol) .......................................................................... 336

    Searching Functions .................................................................................... 336GetSourceLink (hbufSource, lnSource) ............................................................... 336LoadSearchPattern(pattern, fMatchCase, fRegExp, fWholeWordsOnly) .............. 337ReplaceInBuf(hbuf, oldPattern, newPattern, lnStart, lnLim, fMatchCase, fRegExp,

    fWholeWordsOnly, fConfirm) ........................................................................ 337SearchForRefs (hbuf, word, fTouchFiles) ............................................................. 337SearchInBuf (hbuf, pattern, lnStart, ichStart, fMatchCase, fRegExp,

    fWholeWordsOnly) ........................................................................................ 338

  • 8/8/2019 Source Insight

    15/393

    Source Insight User Manual xv

    Contents

    SetSourceLink (hbufSource, lnSource, target_file, lnTarget) ............................... 338

    Project Functions ......................................................................................... 338AddConditionVariable(hprj, szName, szValue) ................................................... 338AddFileToProj(hprj, filename) ............................................................................. 339CloseProj (hprj) ................................................................................................... 339DeleteConditionVariable(hprj, szName) ............................................................. 339

    DeleteProj (proj_name) ...................................................................................... 339EmptyProj () ........................................................................................................ 339GetCurrentProj () ................................................................................................ 339GetProjDir (hprj) ................................................................................................. 340GetProjFileCount (hprj) ...................................................................................... 340GetProjFileName (hprj, ifile) ............................................................................... 340GetProjName (hprj) ............................................................................................ 340GetProjSymCount (hprj) ..................................................................................... 340GetProjSymLocation (hprj, isym) ........................................................................ 340GetProjSymName (hprj, isym) ............................................................................ 340NewProj (proj_name) ......................................................................................... 341

    OpenProj (proj_name) ....................................................................................... 341RemoveFileFromProj(hprj, filename) .................................................................. 341SyncProj (hprj) .................................................................................................... 341SyncProjEx(hprj, fAddNewFiles, fForceAll, fSupressWarnings) ............................ 341

    Miscellaneous Macro Functions ................................................................... 342DumpMacroState (hbufOutput) ......................................................................... 342GetProgramEnvironmentInfo () .......................................................................... 342GetProgramInfo () .............................................................................................. 342

    Other Information about Macros ................................................................. 342Debugging ........................................................................................................... 342Persistence ........................................................................................................... 342

    No Self-Modifying Macros..................................................................................... 342

    Sample Macros ..................................................................................................... 343

    Event Handlers ............................................................................................. 343

    CHAPTER 7 MACRO EVENT HANDLERS..................................................................... 345Macro Event Handlers .................................................................................. 345Event Handler Uses ...................................................................................... 346Adding Event Handlers to Source Insight .................................................... 347

    Enabling Event Handlers ....................................................................................... 347

    Editing Event Handler Files .................................................................................... 347 Errors in Event Handlers ........................................................................................ 347 Synchronous Vs. Asynchronous Events .................................................................. 347 Other Tips ............................................................................................................ 348

    Application Events ....................................................................................... 348event AppStart() ................................................................................................. 348event AppShutdown() ........................................................................................ 348event AppCommand(sCommand) ..................................................................... 348

  • 8/8/2019 Source Insight

    16/393

    Contents

    xvi Source Insight User Manual

    Document Events ......................................................................................... 348event DocumentNew(sFile) ................................................................................ 348event DocumentOpen(sFile) .............................................................................. 348event DocumentClose(sFile) ............................................................................... 349event DocumentSave(sFile) ................................................................................ 349event DocumentSaveComplete(sFile) ................................................................ 349

    event DocumentChanged(sFile) ......................................................................... 349event DocumentSelectionChanged(sFile) .......................................................... 349

    Project Events .............................................................................................. 349event ProjectOpen(sProject) ............................................................................... 349event ProjectClose(sProject) ............................................................................... 349

    Statusbar Events .......................................................................................... 349event StatusbarUpdate(sMessage) ..................................................................... 350

    CHAPTER 8 APPENDIX: UPGRADING FROM OLDERVERSIONS..................................... 351

    Upgrading from Version 3.1 or Version 3.0 ................................................... 351Per-User Data Folder ............................................................................................ 352Per-User Project List .............................................................................................. 352Project File Storage .............................................................................................. 352.Net Framework Support ...................................................................................... 353

    Upgrading from Version 2 ............................................................................ 353Installing Version 3 ............................................................................................... 353Opening Older Projects ........................................................................................ 353Finding Your Old Projects ..................................................................................... 353Loading Old Customizations ................................................................................ 354Using Version 3 and Version 2 Together ................................................................. 354

    What's New in Version 3 ............................................................................... 354Improved Language Features ............................................................................... 355Improved Browsing and Analysis Features ............................................................ 356Improved Editing and Display Features ................................................................. 357

    New Commands .......................................................................................... 358New Command List .............................................................................................. 358File Format Compatibility with Older Versions ....................................................... 361

    CHAPTER 9 LICENSEAGREEMENT............................................................................ 363

  • 8/8/2019 Source Insight

    17/393

    Source Insight 3.5

    User Manual

    Copyright 2004-2006 by Source Dynamics, Inc.

    1.26.2006

  • 8/8/2019 Source Insight

    18/393

  • 8/8/2019 Source Insight

    19/393

    Source Insight - Version 3.5Copyright 1987-2003 by Source Dynamics, Inc.

    This documentation and the software described in it are copyrighted with all rights

    reserved. Under the copyright laws, neither the documentation nor the software may becopied, photocopied, reproduced, translated, or reduced to any electronic medium ormachine readable form, in whole or in part, without the prior written consent of SourceDynamics, Inc.

    Disclaimer of Warranties and Limitation of Liabilities

    This manual and the software described in it were prepared by Source Dynamics, Inc., andare subject to change without notice. Source Dynamics, Inc. assumes no liability resultingfrom any inaccuracy or omissions contained herein or from the use of the information orprograms contained herewith.

    Source Dynamics, Inc. makes no expressed or implied warranty of any kind with regard tothese programs or to the supplemental documentation in this manual. In no event shallSource Dynamics, Inc. be liable for incidental or consequential damages in connectionwith or arising out of the furnishing, performance, or use of the program or documenta-tion. This disclaimer includes, but is not limited to, any loss of service, loss of business, oanticipatory profits, or consequential damages resulting from the use or operation of theenclosed software.

    Source Insight is a trademark of Source Dynamics, Inc.Other product names are trademarks of their respective manufacturers.

    Source Dynamics, Inc.22525 SE 64th Place, Suite 260Issaquah, WA 98027USA

    Phone: (425) 557-3630Fax: (425) 557-3631Web: www.sourceinsight.com

    Technical Support: [email protected]

    Sales: [email protected]

  • 8/8/2019 Source Insight

    20/393

  • 8/8/2019 Source Insight

    21/393

    Source Insight User Manual 1

    CHAPTER 1 Introduction

    Thank you for purchasing Source Insight. Source Insight has been continu-ously improved for over ten years. We believe that Source Insight will improveyour productivity and increase your enjoyment of programming.This chapter introduces you to some of Source Insight's capabilities.

  • 8/8/2019 Source Insight

    22/393

    Introduction Chapter 1

    2 Source Insight User Manual

    The Big Picture

    The Problem

    You have a multitude of source files spread out all over the place. You have todeal with functions that somebody else wrote. You have to figure out how somepiece of code works and see all of its clients. You didnt write the code, or youwrote it in a past life.You may be one of the cleverest developers in the world, but if you cant find allthe myriad pieces of your program, or cant get your head wrapped around thecode, then you will not be very productive.Enter Source Insight.

    The Solution

    Source Insight was designed to enhance your ability to understand and modify your program. Our company mission is to increase programming team pro-ductivity by clarifying source code, presenting information in a useful way, andallowing programmers to modify software in large, complex projects.Think of your programs source code as a free form database of information. Ithas not only classes, members, and functions in it, but it has many importantcomments. (You do have comments, dont you?)Your source code also has a history. In fact, many large programs have a longlifetime that includes contributions by many programmers over many years.Some of it is not pretty, but you have to live with it.Source Insight acts as an information server that surrounds your projectssource code. With it, you can have instant access to symbolic and textual infor-mation in your program.Whether you are new to a project, or an old-timer, Source Insight will give youuseful leverage to stay productive.

    You

    SourceInsight

    Your Program