aboutsummaryrefslogtreecommitdiff
path: root/debugrl.cpp
diff options
context:
space:
mode:
authorJames Brown2002-04-11 17:19:16 +0000
committerJames Brown2002-04-11 17:19:16 +0000
commit7696081c54a6cac8152a227bd9d0bcc41999f261 (patch)
tree70859cf2d6be5ad77d7e7c41ed01c20837a0b2d0 /debugrl.cpp
parent34747b792a42e8129af60371541e9b7321d4d55f (diff)
downloadscummvm-rg350-7696081c54a6cac8152a227bd9d0bcc41999f261.tar.gz
scummvm-rg350-7696081c54a6cac8152a227bd9d0bcc41999f261.tar.bz2
scummvm-rg350-7696081c54a6cac8152a227bd9d0bcc41999f261.zip
Large pointless reindentation of all the code. Also fixed a few mistakes
in the object flags code cleanup. Flags used: indent *.cpp -br -bap -nbc -lp -ce -cdw -brs -nbad -nbc -npsl -nip -ts2 -ncs -nbs -npcs -nbap -Tbyte -Tuint32 -Tuint8 -Tuint16 -TArrayHeader -TMemBlkHeader -TVerbSlot -TObjectData -Tvoid -TImageHeader -TRoomHeader -TCodeHeader -TResHdr -TBompHeader -TMidiChannelAdl -TGui -TScumm -TSoundEngine -TPart -TPlayer svn-id: r3908
Diffstat (limited to 'debugrl.cpp')
-rw-r--r--debugrl.cpp119
1 files changed, 60 insertions, 59 deletions
diff --git a/debugrl.cpp b/debugrl.cpp
index 86d72327a0..8c9366a2f4 100644
--- a/debugrl.cpp
+++ b/debugrl.cpp
@@ -4,83 +4,84 @@
// A lot of this was ripped straight from the readline fileman.c example.
-char* _debugger_commands[] = {
- "help",
- "quit",
- "go",
- "actor",
- "scripts",
- "exit",
- (char *)NULL
+char *_debugger_commands[] = {
+ "help",
+ "quit",
+ "go",
+ "actor",
+ "scripts",
+ "exit",
+ (char *)NULL
};
// forwards decls
-char ** scumm_debugger_completion (const char *text, int start, int end);
-char * scumm_debugger_command_generator (const char *text, int state);
+char **scumm_debugger_completion(const char *text, int start, int end);
+char *scumm_debugger_command_generator(const char *text, int state);
-void initialize_readline () {
- /* Allow conditional parsing of the ~/.inputrc file. */
- rl_readline_name = "scummvm";
+void initialize_readline()
+{
+ /* Allow conditional parsing of the ~/.inputrc file. */
+ rl_readline_name = "scummvm";
- /* Tell the completer that we want a crack first. */
- rl_attempted_completion_function = scumm_debugger_completion;
+ /* Tell the completer that we want a crack first. */
+ rl_attempted_completion_function = scumm_debugger_completion;
}
-char ** scumm_debugger_completion (const char *text, int start, int end) {
+char **scumm_debugger_completion(const char *text, int start, int end)
+{
- char **matches;
+ char **matches;
- matches = (char **)NULL;
+ matches = (char **)NULL;
- // If this word is at the start of the line, then it is a command
- // to complete.
- if (start == 0) {
- matches = rl_completion_matches (text, scumm_debugger_command_generator);
- } else {
- // At some stage it'd be nice to have symbolic actor name completion
- // or something similarly groovy. Not right now though.
- }
+ // If this word is at the start of the line, then it is a command
+ // to complete.
+ if (start == 0) {
+ matches = rl_completion_matches(text, scumm_debugger_command_generator);
+ } else {
+ // At some stage it'd be nice to have symbolic actor name completion
+ // or something similarly groovy. Not right now though.
+ }
- // This just makes sure that readline doesn't try to use its default
- // completer, which uses filenames in the current dir, if we can't find
- // a match, since filenames don't have much use in the debuger :)
- // There's probably a nice way to do this once, rather than every time.
- rl_attempted_completion_over = 1;
-
- return (matches);
+ // This just makes sure that readline doesn't try to use its default
+ // completer, which uses filenames in the current dir, if we can't find
+ // a match, since filenames don't have much use in the debuger :)
+ // There's probably a nice way to do this once, rather than every time.
+ rl_attempted_completion_over = 1;
+
+ return (matches);
}
/* Generator function for command completion. STATE lets us know whether
to start from scratch; without any state (i.e. STATE == 0), then we
start at the top of the list. */
-char * scumm_debugger_command_generator (const char *text, int state) {
-
- static int list_index, len;
- char *name;
-
- /* If this is a new word to complete, initialize now. This includes
- saving the length of TEXT for efficiency, and initializing the index
- variable to 0. */
- if (!state)
- {
- list_index = 0;
- len = strlen (text);
- }
-
- /* Return the next name which partially matches from the command list. */
- while (name = _debugger_commands[list_index])
- {
- list_index++;
-
- if (strncmp (name, text, len) == 0)
- //return (dupstr(name));
- return strdup(name);
- }
-
- /* If no names matched, then return NULL. */
- return ((char *)NULL);
+char *scumm_debugger_command_generator(const char *text, int state)
+{
+
+ static int list_index, len;
+ char *name;
+
+ /* If this is a new word to complete, initialize now. This includes
+ saving the length of TEXT for efficiency, and initializing the index
+ variable to 0. */
+ if (!state) {
+ list_index = 0;
+ len = strlen(text);
+ }
+
+ /* Return the next name which partially matches from the command list. */
+ while (name = _debugger_commands[list_index]) {
+ list_index++;
+
+ if (strncmp(name, text, len) == 0)
+ //return (dupstr(name));
+ return strdup(name);
+ }
+
+ /* If no names matched, then return NULL. */
+ return ((char *)NULL);
}
#endif /* HAVE_READLINE */