Skip to content

Commit

Permalink
Cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgalloy committed Mar 4, 2010
1 parent ea8b77d commit 34737f6
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion doxygen.config
Expand Up @@ -307,7 +307,7 @@ EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.

EXTRACT_STATIC = NO
EXTRACT_STATIC = YES

# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
Expand Down
4 changes: 4 additions & 0 deletions src/ridl.c
Expand Up @@ -861,6 +861,10 @@ int main(int argc, char *argv[]) {
ridl_magic_history(line, firstcharIndex, 10, 0);
} else if (strcmp(cmd, ":histedit") == 0) {
ridl_magic_histedit(line, firstcharIndex);
} else if (strcmp(cmd, ":version") == 0) {
ridl_printversion();
} else {
printf("unknown magic command: %s\n", cmd);
}
}
} else {
Expand Down
4 changes: 0 additions & 4 deletions src/ridl.h
Expand Up @@ -18,9 +18,5 @@ static int ridl_cmdnumber = 1;

static float ridl_event_delay = 0.1;

static char history_file_location[1024];
static char history_file_backup_location[1024];


char *ridl_currenttimestamp(void);
void ridl_printversion(void);
16 changes: 8 additions & 8 deletions src/ridl_history.c
Expand Up @@ -8,19 +8,18 @@
#include "ridl.h"


static char history_filename[1024];
static char historybackup_filename[1024];
/// Filename of file containing IDL's command history
static char history_filename[1024];

/**
rIDL history system implementation.
*/
/// rIDL backup of history file
static char historybackup_filename[1024];


/**
Reads IDL history file and populates the Readline history.
*/
int ridl_populatehistory(void) {
FILE *fp = fopen(history_file_location, "r");
FILE *fp = fopen(history_filename, "r");
int i, cmdnum = 0, line_number = 0, rline_number;
char history[RIDL_RBUF_SIZE][RIDL_MAX_LINE_LENGTH];
char line[RIDL_MAX_LINE_LENGTH];
Expand Down Expand Up @@ -74,7 +73,7 @@ void ridl_addhistoryline(char *line) {
FILE *fp;
int i, line_number = 0;

// add line to readline's history
// add line to Readline's history
add_history(line);

// create history line with time stamp
Expand All @@ -88,7 +87,8 @@ void ridl_addhistoryline(char *line) {

// read history file into a buffer
fp = fopen(history_filename, "r");
while (fgets(tmpline, RIDL_MAX_LINE_LENGTH, fp) != NULL && line_number < RIDL_RBUF_SIZE) {
while (fgets(tmpline, RIDL_MAX_LINE_LENGTH, fp) != NULL
&& line_number < RIDL_RBUF_SIZE) {
strcpy(history[line_number++], tmpline);
}
fclose(fp);
Expand Down
3 changes: 0 additions & 3 deletions src/ridl_history.h
@@ -1,6 +1,3 @@
/**
rIDL history system interface.
*/

int ridl_initialize_history(void);
void ridl_addhistoryline(char *line);
15 changes: 8 additions & 7 deletions src/ridl_magic.c
Expand Up @@ -4,13 +4,13 @@
#include "ridl.h"


//
// Print help for the magic commands.
//
/**
Print help for the magic commands.
*/
void ridl_printmagichelp(void) {
char *indent = " ";
char *magic_format = "%s%-*s %s\n";
int magic_width = 16;
int magic_width = 21;

ridl_printversion();

Expand All @@ -23,9 +23,9 @@ void ridl_printmagichelp(void) {
printf(magic_format, indent, magic_width, ":help",
"show this help message");
printf(magic_format, indent, magic_width, ":history [n]",
"show the last n commands prefixed with the command number");
"show the last n commands; defaults to 10 lines");
printf(magic_format, indent, magic_width, ":qhistory [n]",
"show the last n commands with no prefix");
"show the last n commands with no prefix; defaults to 10 lines");
printf(magic_format, indent, magic_width, ":histedit n filename",
"send the last n commands to filename and launch editor");
printf(magic_format, indent, magic_width, ":log filename",
Expand All @@ -36,4 +36,5 @@ void ridl_printmagichelp(void) {
"log output to filename");
printf(magic_format, indent, magic_width, ":untee",
"stop logging output");
}
printf(magic_format, indent, magic_width, ":version",
"print version information");}
1 change: 1 addition & 0 deletions src/ridl_magic.h
@@ -1 +1,2 @@

void ridl_printmagichelp(void);
Binary file modified src/ridl_magic.o
Binary file not shown.

0 comments on commit 34737f6

Please sign in to comment.