*----------------------------------------------------------------------
*/
-TkTextBTree
-TkBTreeCreate()
+TkTextBTree
+TkBTreeCreate (void)
{
register BTree *treePtr;
register Node *rootPtr;
*----------------------------------------------------------------------
*/
-void
-TkBTreeDestroy(tree)
- TkTextBTree tree; /* Pointer to tree to delete. */
+void
+TkBTreeDestroy (
+ TkTextBTree tree /* Pointer to tree to delete. */
+)
{
BTree *treePtr = (BTree *) tree;
*----------------------------------------------------------------------
*/
-static void
-DestroyNode(nodePtr)
- register Node *nodePtr;
+static void
+DestroyNode (register Node *nodePtr)
{
if (nodePtr->level == 0) {
register TkTextLine *curPtr, *nextLinePtr;
*----------------------------------------------------------------------
*/
-static void
-DeleteSummaries(summaryPtr)
- register Summary *summaryPtr; /* First in list of node's tag
+static void
+DeleteSummaries (
+ register Summary *summaryPtr /* First in list of node's tag
* summaries. */
+)
{
register Summary *nextPtr;
while (summaryPtr != NULL) {
*----------------------------------------------------------------------
*/
-void
-TkBTreeInsertChars(tree, linePtr, ch, string)
- TkTextBTree tree; /* B-tree in which to insert. */
- register TkTextLine *linePtr; /* Pointer to line in which to
+void
+TkBTreeInsertChars (
+ TkTextBTree tree, /* B-tree in which to insert. */
+ register TkTextLine *linePtr, /* Pointer to line in which to
* insert. */
- int ch; /* Index of character before which
+ int ch, /* Index of character before which
* to insert. Must not be after
* last character in line.*/
- char *string; /* Pointer to bytes to insert (may
+ char *string /* Pointer to bytes to insert (may
* contain newlines, must be null-
* terminated). */
+)
{
BTree *treePtr = (BTree *) tree;
register Node *nodePtr;
*----------------------------------------------------------------------
*/
-void
-TkBTreeDeleteChars(tree, line1Ptr, ch1, line2Ptr, ch2)
- TkTextBTree tree; /* B-tree in which to delete. */
- register TkTextLine *line1Ptr; /* Line containing first character
+void
+TkBTreeDeleteChars (
+ TkTextBTree tree, /* B-tree in which to delete. */
+ register TkTextLine *line1Ptr, /* Line containing first character
* to delete. */
- int ch1; /* Index within linePtr1 of first
+ int ch1, /* Index within linePtr1 of first
* character to delete. */
- register TkTextLine *line2Ptr; /* Line containing character just
+ register TkTextLine *line2Ptr, /* Line containing character just
* after last one to delete. */
- int ch2; /* Index within linePtr2 of character
+ int ch2 /* Index within linePtr2 of character
* just after last one to delete. */
+)
{
BTree *treePtr = (BTree *) tree;
TkTextLine *linePtr, *nextPtr, *prevLinePtr;
*----------------------------------------------------------------------
*/
-void
-TkBTreeTag(tree, line1, ch1, line2, ch2, tagPtr, add)
- TkTextBTree tree; /* B-tree in which to add tag
+void
+TkBTreeTag (
+ TkTextBTree tree, /* B-tree in which to add tag
* information. */
- int line1, ch1; /* Position of first character to
+ int line1,
+ int ch1, /* Position of first character to
* tag. */
- int line2, ch2; /* Position of character just after
+ int line2,
+ int ch2, /* Position of character just after
* last one to tag. */
- TkTextTag *tagPtr; /* Tag to associate with the range
+ TkTextTag *tagPtr, /* Tag to associate with the range
* of characters. */
- int add; /* One means add tag to the given
+ int add /* One means add tag to the given
* range of characters; zero means
* remove the tag from the range. */
+)
{
BTree *treePtr = (BTree *) tree;
register TkTextLine *line1Ptr, *line2Ptr;
*/
/* ARGSUSED */
-void
-TkBTreeAddAnnotation(annotPtr)
- TkAnnotation *annotPtr; /* Pointer to annotation. The caller must
+void
+TkBTreeAddAnnotation (
+ TkAnnotation *annotPtr /* Pointer to annotation. The caller must
* have filled in all the fields except the
* "nextPtr" field. The type should NOT be
* TK_ANNOT_TOGGLE; these annotations are
* managed by the TkBTreeTag procedure. */
+)
{
register TkAnnotation *annotPtr2, *prevPtr;
*/
/* ARGSUSED */
-void
-TkBTreeRemoveAnnotation(annotPtr)
- TkAnnotation *annotPtr; /* Pointer to annotation, which must
+void
+TkBTreeRemoveAnnotation (
+ TkAnnotation *annotPtr /* Pointer to annotation, which must
* have been linked into tree by a previous
* call to TkBTreeAddAnnotation. */
+)
{
register TkAnnotation *prevPtr;
*/
TkTextLine *
-TkBTreeFindLine(tree, line)
- TkTextBTree tree; /* B-tree in which to find line. */
- int line; /* Index of desired line. */
+TkBTreeFindLine (
+ TkTextBTree tree, /* B-tree in which to find line. */
+ int line /* Index of desired line. */
+)
{
BTree *treePtr = (BTree *) tree;
register Node *nodePtr;
*/
TkTextLine *
-TkBTreeNextLine(linePtr)
- register TkTextLine *linePtr; /* Pointer to existing line in
+TkBTreeNextLine (
+ register TkTextLine *linePtr /* Pointer to existing line in
* B-tree. */
+)
{
register Node *nodePtr;
*----------------------------------------------------------------------
*/
-int
-TkBTreeLineIndex(linePtr)
- TkTextLine *linePtr; /* Pointer to existing line in
+int
+TkBTreeLineIndex (
+ TkTextLine *linePtr /* Pointer to existing line in
* B-tree. */
+)
{
register TkTextLine *linePtr2;
register Node *nodePtr, *parentPtr, *nodePtr2;
*----------------------------------------------------------------------
*/
-void
-TkBTreeStartSearch(tree, line1, ch1, line2, ch2, tagPtr, searchPtr)
- TkTextBTree tree; /* Tree to search. */
- int line1, ch1; /* Character position at which to * start search (tags at this position
+void
+TkBTreeStartSearch (
+ TkTextBTree tree, /* Tree to search. */
+ int line1,
+ int ch1, /* Character position at which to * start search (tags at this position
* will be returned). */
- int line2, ch2; /* Character position at which to * stop search (tags at this position
+ int line2,
+ int ch2, /* Character position at which to * stop search (tags at this position
* will be returned). */
- TkTextTag *tagPtr; /* Tag to search for. NULL means
+ TkTextTag *tagPtr, /* Tag to search for. NULL means
* search for any tag. */
- register TkTextSearch *searchPtr; /* Where to store information about
+ register TkTextSearch *searchPtr /* Where to store information about
* search's progress. */
+)
{
register TkAnnotation *annotPtr;
*----------------------------------------------------------------------
*/
-int
-TkBTreeNextTag(searchPtr)
- register TkTextSearch *searchPtr; /* Information about search in
+int
+TkBTreeNextTag (
+ register TkTextSearch *searchPtr /* Information about search in
* progress; must have been set up by
* call to TkBTreeStartSearch. */
+)
{
register TkAnnotation *annotPtr;
register Node *nodePtr;
*----------------------------------------------------------------------
*/
-void
-TkBTreeCheck(tree)
- TkTextBTree tree; /* Tree to check. */
+void
+TkBTreeCheck (
+ TkTextBTree tree /* Tree to check. */
+)
{
BTree *treePtr = (BTree *) tree;
register Summary *summaryPtr;
*----------------------------------------------------------------------
*/
-static void
-Rebalance(treePtr, nodePtr)
- BTree *treePtr; /* Tree that is being rebalanced. */
- register Node *nodePtr; /* Node that may be out of balance. */
+static void
+Rebalance (
+ BTree *treePtr, /* Tree that is being rebalanced. */
+ register Node *nodePtr /* Node that may be out of balance. */
+)
{
/*
* Loop over the entire ancestral chain of the node, working up
*----------------------------------------------------------------------
*/
-static void
-RecomputeNodeCounts(nodePtr)
- register Node *nodePtr; /* Node whose tag summary information
+static void
+RecomputeNodeCounts (
+ register Node *nodePtr /* Node whose tag summary information
* must be recomputed. */
+)
{
register Summary *summaryPtr, *summaryPtr2;
register Node *childPtr;
*----------------------------------------------------------------------
*/
-static void
-AddToggleToLine(linePtr, index, tagPtr)
- TkTextLine *linePtr; /* Line within which to add
+static void
+AddToggleToLine (
+ TkTextLine *linePtr, /* Line within which to add
* transition. */
- int index; /* Character before which to
+ int index, /* Character before which to
* add transition. */
- TkTextTag *tagPtr; /* Information about tag. */
+ TkTextTag *tagPtr /* Information about tag. */
+)
{
register TkAnnotation *annotPtr, *prevPtr;
int delta = 1;
*----------------------------------------------------------------------
*/
-static void
-ChangeNodeToggleCount(nodePtr, tagPtr, delta)
- register Node *nodePtr; /* Node whose toggle count for a tag
+static void
+ChangeNodeToggleCount (
+ register Node *nodePtr, /* Node whose toggle count for a tag
* must be changed. */
- TkTextTag *tagPtr; /* Information about tag. */
- int delta; /* Amount to add to current toggle
+ TkTextTag *tagPtr, /* Information about tag. */
+ int delta /* Amount to add to current toggle
* count for tag (may be negative). */
+)
{
register Summary *summaryPtr, *prevPtr;
*----------------------------------------------------------------------
*/
-int
-TkBTreeCharTagged(linePtr, ch, tagPtr)
- TkTextLine *linePtr; /* Line containing character of
+int
+TkBTreeCharTagged (
+ TkTextLine *linePtr, /* Line containing character of
* interest. */
- int ch; /* Index of character in linePtr. */
- TkTextTag *tagPtr; /* Tag of interest. */
+ int ch, /* Index of character in linePtr. */
+ TkTextTag *tagPtr /* Tag of interest. */
+)
{
register Node *nodePtr;
register TkTextLine *siblingLinePtr;
/* ARGSUSED */
TkTextTag **
-TkBTreeGetTags(tree, linePtr, ch, numTagsPtr)
- TkTextBTree tree; /* Tree to check. */
- TkTextLine *linePtr; /* Line containing character of interest. */
- int ch; /* Index within linePtr of character for
+TkBTreeGetTags (
+ TkTextBTree tree, /* Tree to check. */
+ TkTextLine *linePtr, /* Line containing character of interest. */
+ int ch, /* Index within linePtr of character for
* which tag information is wanted. */
- int *numTagsPtr; /* Store number of tags found at this
+ int *numTagsPtr /* Store number of tags found at this
* location. */
+)
{
register Node *nodePtr;
register TkTextLine *siblingLinePtr;
*----------------------------------------------------------------------
*/
-static void
-IncCount(tagPtr, inc, tagInfoPtr)
- TkTextTag *tagPtr; /* Handle for tag. */
- int inc; /* Amount by which to increment tag count. */
- TagInfo *tagInfoPtr; /* Holds cumulative information about tags;
+static void
+IncCount (
+ TkTextTag *tagPtr, /* Handle for tag. */
+ int inc, /* Amount by which to increment tag count. */
+ TagInfo *tagInfoPtr /* Holds cumulative information about tags;
* increment count here. */
+)
{
register TkTextTag **tagPtrPtr;
int count;
*----------------------------------------------------------------------
*/
-static void
-CheckNodeConsistency(nodePtr)
- register Node *nodePtr; /* Node whose subtree should be
+static void
+CheckNodeConsistency (
+ register Node *nodePtr /* Node whose subtree should be
* checked. */
+)
{
register Node *childNodePtr;
register Summary *summaryPtr, *summaryPtr2;
*----------------------------------------------------------------------
*/
-int
-TkBTreeNumLines(tree)
- TkTextBTree tree; /* Information about tree. */
+int
+TkBTreeNumLines (
+ TkTextBTree tree /* Information about tree. */
+)
{
BTree *treePtr = (BTree *) tree;
return treePtr->rootPtr->numLines;