Fossil SCM
Documenting the Label structure I introduced.
Commit
58a02a2e4adae108ef28c599fb1e7445a2b01c34
Parent
ef8266b710505ed…
1 file changed
+14
-7
+14
-7
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -619,22 +619,29 @@ | ||
| 619 | 619 | /************************************************************************** |
| 620 | 620 | ** The basic difference engine is above. What follows is the annotation |
| 621 | 621 | ** engine. Both are in the same file since they share many components. |
| 622 | 622 | */ |
| 623 | 623 | |
| 624 | +/* | |
| 625 | +** Linked list of strings, labels used in the annotator code. | |
| 626 | +** The elements of the list and the pointed string (str) | |
| 627 | +** will be freed once they become totally unreferenced | |
| 628 | +** (nref == 0). | |
| 629 | +*/ | |
| 630 | +struct Label | |
| 631 | +{ | |
| 632 | + struct Label *prev; /* previous element */ | |
| 633 | + struct Label *next; /* next element */ | |
| 634 | + char *str; /* The label string */ | |
| 635 | + int nref; /* Number of references to the string */ | |
| 636 | +}; | |
| 637 | + | |
| 624 | 638 | /* |
| 625 | 639 | ** The status of an annotation operation is recorded by an instance |
| 626 | 640 | ** of the following structure. |
| 627 | 641 | */ |
| 628 | 642 | typedef struct Annotator Annotator; |
| 629 | -struct Label | |
| 630 | -{ | |
| 631 | - struct Label *prev; | |
| 632 | - struct Label *next; | |
| 633 | - char *str; | |
| 634 | - int nref; | |
| 635 | -}; | |
| 636 | 643 | struct Annotator { |
| 637 | 644 | DContext c; /* The diff-engine context */ |
| 638 | 645 | struct AnnLine { /* Lines of the original files... */ |
| 639 | 646 | const char *z; /* The text of the line */ |
| 640 | 647 | short int n; /* Number of bytes (omitting trailing space and \n) */ |
| 641 | 648 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -619,22 +619,29 @@ | |
| 619 | /************************************************************************** |
| 620 | ** The basic difference engine is above. What follows is the annotation |
| 621 | ** engine. Both are in the same file since they share many components. |
| 622 | */ |
| 623 | |
| 624 | /* |
| 625 | ** The status of an annotation operation is recorded by an instance |
| 626 | ** of the following structure. |
| 627 | */ |
| 628 | typedef struct Annotator Annotator; |
| 629 | struct Label |
| 630 | { |
| 631 | struct Label *prev; |
| 632 | struct Label *next; |
| 633 | char *str; |
| 634 | int nref; |
| 635 | }; |
| 636 | struct Annotator { |
| 637 | DContext c; /* The diff-engine context */ |
| 638 | struct AnnLine { /* Lines of the original files... */ |
| 639 | const char *z; /* The text of the line */ |
| 640 | short int n; /* Number of bytes (omitting trailing space and \n) */ |
| 641 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -619,22 +619,29 @@ | |
| 619 | /************************************************************************** |
| 620 | ** The basic difference engine is above. What follows is the annotation |
| 621 | ** engine. Both are in the same file since they share many components. |
| 622 | */ |
| 623 | |
| 624 | /* |
| 625 | ** Linked list of strings, labels used in the annotator code. |
| 626 | ** The elements of the list and the pointed string (str) |
| 627 | ** will be freed once they become totally unreferenced |
| 628 | ** (nref == 0). |
| 629 | */ |
| 630 | struct Label |
| 631 | { |
| 632 | struct Label *prev; /* previous element */ |
| 633 | struct Label *next; /* next element */ |
| 634 | char *str; /* The label string */ |
| 635 | int nref; /* Number of references to the string */ |
| 636 | }; |
| 637 | |
| 638 | /* |
| 639 | ** The status of an annotation operation is recorded by an instance |
| 640 | ** of the following structure. |
| 641 | */ |
| 642 | typedef struct Annotator Annotator; |
| 643 | struct Annotator { |
| 644 | DContext c; /* The diff-engine context */ |
| 645 | struct AnnLine { /* Lines of the original files... */ |
| 646 | const char *z; /* The text of the line */ |
| 647 | short int n; /* Number of bytes (omitting trailing space and \n) */ |
| 648 |