summaryrefslogtreecommitdiffstats
path: root/win32caml/history.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32caml/history.c')
-rw-r--r--win32caml/history.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/win32caml/history.c b/win32caml/history.c
index 11397ac66..9a0003482 100644
--- a/win32caml/history.c
+++ b/win32caml/history.c
@@ -1,6 +1,6 @@
/***********************************************************************/
/* */
-/* Objective Caml */
+/* OCaml */
/* */
/* Jacob Navia, after Xavier Leroy */
/* */
@@ -21,78 +21,78 @@
/*------------------------------------------------------------------------
Procedure: AddToHistory ID:2
-Author: Chris Watford watford@uiuc.edu
+Author: Chris Watford watford@uiuc.edu
Purpose: Adds an edit buffer to the history control
-Input: Pointer to the edit buffer to add
+Input: Pointer to the edit buffer to add
Output:
Errors:
--------------------------------------------------------------------------
Edit History:
- 15 Sept 2003 - Chris Watford watford@uiuc.edu
- - Complete rewrite
- - Got it to add the edit buffer to the history
- 17 Sept 2003 - Chris Watford watford@uiuc.edu
- - Added doubly link list support
+ 15 Sept 2003 - Chris Watford watford@uiuc.edu
+ - Complete rewrite
+ - Got it to add the edit buffer to the history
+ 17 Sept 2003 - Chris Watford watford@uiuc.edu
+ - Added doubly link list support
------------------------------------------------------------------------*/
void AddToHistory(EditBuffer *edBuf)
{
- StatementHistory *newLine;
+ StatementHistory *newLine;
- // sanity checks
- if(edBuf == NULL)
- {
- return;
- } else if (edBuf->LineCount == 0 || edBuf->Lines == NULL) {
- // fix any possible errors that may come from this
- edBuf->LineCount = 0;
- edBuf->Lines = NULL;
- return;
- }
+ // sanity checks
+ if(edBuf == NULL)
+ {
+ return;
+ } else if (edBuf->LineCount == 0 || edBuf->Lines == NULL) {
+ // fix any possible errors that may come from this
+ edBuf->LineCount = 0;
+ edBuf->Lines = NULL;
+ return;
+ }
- // setup newline and add as the front of the linked list
- newLine = SafeMalloc(sizeof(StatementHistory));
- newLine->Next = History;
- newLine->Prev = NULL;
- newLine->Statement = edBuf;
+ // setup newline and add as the front of the linked list
+ newLine = SafeMalloc(sizeof(StatementHistory));
+ newLine->Next = History;
+ newLine->Prev = NULL;
+ newLine->Statement = edBuf;
- // setup back linking
- if(History != NULL)
- History->Prev = newLine;
+ // setup back linking
+ if(History != NULL)
+ History->Prev = newLine;
- // set the history up
- History = newLine;
+ // set the history up
+ History = newLine;
- // search for the new history tail
- for(HistoryTail = (HistoryTail != NULL ? HistoryTail : History); HistoryTail->Next != NULL; HistoryTail = HistoryTail->Next);
+ // search for the new history tail
+ for(HistoryTail = (HistoryTail != NULL ? HistoryTail : History); HistoryTail->Next != NULL; HistoryTail = HistoryTail->Next);
}
/*------------------------------------------------------------------------
Procedure: GetHistoryLine ID:2
-Author: Chris Watford watford@uiuc.edu
+Author: Chris Watford watford@uiuc.edu
Purpose: Returns an entry from the history table
-Input: Index of the history entry to return
-Output: The history entry as a single line
+Input: Index of the history entry to return
+Output: The history entry as a single line
Errors:
--------------------------------------------------------------------------
Edit History:
- 15 Sept 2003 - Chris Watford watford@uiuc.edu
- - Complete rewrite
- 17 Sept 2003 - Chris Watford watford@uiuc.edu
- - Added doubly link list support
+ 15 Sept 2003 - Chris Watford watford@uiuc.edu
+ - Complete rewrite
+ 17 Sept 2003 - Chris Watford watford@uiuc.edu
+ - Added doubly link list support
------------------------------------------------------------------------*/
char *GetHistoryLine(int n)
{
- StatementHistory *histentry = History;
- int i;
+ StatementHistory *histentry = History;
+ int i;
- // traverse linked list looking for member n
- for (i = 0; ((i < n) && (histentry != NULL)); i++, histentry = histentry->Next);
+ // traverse linked list looking for member n
+ for (i = 0; ((i < n) && (histentry != NULL)); i++, histentry = histentry->Next);
- // figure out what to return
- if (histentry != NULL)
- {
- return editbuffer_getasline(histentry->Statement);
- } else {
- return "";
- }
+ // figure out what to return
+ if (histentry != NULL)
+ {
+ return editbuffer_getasline(histentry->Statement);
+ } else {
+ return "";
+ }
}