From 8bb30347641ed10742fcd65853ccfff680df83c0 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Sun, 13 Nov 2011 09:34:29 -0800 Subject: [PATCH 01/30] Arrumei um bug que pegava lixo na entrada --- builtin.c | 2 +- list.c | 2 +- main.c | 2 +- parser.c | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/builtin.c b/builtin.c index abe51f8..58c7baa 100644 --- a/builtin.c +++ b/builtin.c @@ -6,7 +6,7 @@ #include "main.h" #include "builtin.h" #include "parser.h" -#include "lista.h" +#include "list.h" int isBuiltIn(char * cmd) { diff --git a/list.c b/list.c index 77a4916..a629fe1 100644 --- a/list.c +++ b/list.c @@ -1,7 +1,7 @@ #include #include #include -#include "lista.h" +#include "list.h" void ListCreate(LIST *list) { diff --git a/main.c b/main.c index ecd7f72..4e76c52 100644 --- a/main.c +++ b/main.c @@ -9,7 +9,7 @@ #include "main.h" #include "parser.h" #include "builtin.h" -#include "lista.h" +#include "list.h" void printPrompt(char* username, char* hostname) { diff --git a/parser.c b/parser.c index 3aaa24c..0fe9d64 100644 --- a/parser.c +++ b/parser.c @@ -68,8 +68,10 @@ char* readline() c = getchar(); while (c != '\n') { - input[i] = c; - i++; + if((c > 31) && (c < 127)) { + input[i] = c; + i++; + } c = getchar(); } input[i] = '\0'; From a3f1f07ffc587d5f155b6fa9e66a1b9bee662b79 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Sun, 13 Nov 2011 14:01:19 -0800 Subject: [PATCH 02/30] Pequeno conserto no prompt do shell --- main.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) mode change 100644 => 100755 main.c diff --git a/main.c b/main.c old mode 100644 new mode 100755 index 4e76c52..7c2f73f --- a/main.c +++ b/main.c @@ -17,17 +17,18 @@ void printPrompt(char* username, char* hostname) getcwd(path, 256); if(strcmp(path, userdir) == 0) printf("%s@%s:~$ ", username, hostname); + else if(strstr(path, userdir)) + printf("%s@%s:~%s$ ", username, hostname, path + strlen(userdir)); else printf("%s@%s:%s$ ", username, hostname, path); -} - -void execute(char ** cmd) -{ } + void termination_handler (int signum) { + printf("\n"); + printPrompt(username, hostname); if (fgChildPid != 0) { kill(fgChildPid, signum); @@ -47,10 +48,17 @@ void child_handler(int signum) } void sigtstop_handler(int signum) { - ITEM *item; - item = malloc(sizeof(ITEM)); - ListGetRunningProcess(childs, item); - kill(childPid, SIGSTOP); + printf("\n"); + if(!ListIsEmpty(childs)) { + ITEM *item; + item = malloc(sizeof(ITEM)); + ListGetRunningProcess(childs, item); + if (childPid >= 0) kill(childPid, SIGSTOP); + else printPrompt(username, hostname); + + } + else + printPrompt(username, hostname); } int main (int argc, char **argv) @@ -58,9 +66,7 @@ int main (int argc, char **argv) char * cmdLine; - char * username; char ** cmd; - char hostname[256]; size_t len = 256; struct sigaction new_action, old_action; @@ -115,7 +121,7 @@ int main (int argc, char **argv) { printPrompt(username, hostname); output_r = input_r = 0; - rewind(stdin); + //if (tcflush(ttyDevice, TCIFLUSH) == 0) cmdLine = readline(); if(strcmp(cmdLine, "") != 0) { From 4d420de4d0d8f33f85facf0f725ab8204cb89613 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Sun, 13 Nov 2011 14:24:11 -0800 Subject: [PATCH 03/30] Adicionado redirecionamento de entrada e saida. Funciona em todos os casos. --- builtin.c | 2 -- builtin.h | 0 list.c | 0 list.h | 0 main.c | 11 +++++++---- main.h | 12 ++++++++---- parser.c | 18 ++++++++++++++---- 7 files changed, 29 insertions(+), 14 deletions(-) mode change 100644 => 100755 builtin.c mode change 100644 => 100755 builtin.h mode change 100644 => 100755 list.c mode change 100644 => 100755 list.h mode change 100644 => 100755 main.h mode change 100644 => 100755 parser.c diff --git a/builtin.c b/builtin.c old mode 100644 new mode 100755 index 58c7baa..68e3a02 --- a/builtin.c +++ b/builtin.c @@ -124,10 +124,8 @@ void bg(char * arg) pid = ListLastStoppedToBg(childs); else { n = strtol(arg, &end, 10); - printf("n: %d", n); pid = ListToBg(childs, n); } - printf("pid escolhido: %d", pid); kill(pid, SIGCONT); } } diff --git a/builtin.h b/builtin.h old mode 100644 new mode 100755 diff --git a/list.c b/list.c old mode 100644 new mode 100755 diff --git a/list.h b/list.h old mode 100644 new mode 100755 diff --git a/main.c b/main.c index 7c2f73f..7d0f143 100755 --- a/main.c +++ b/main.c @@ -64,7 +64,8 @@ void sigtstop_handler(int signum) { int main (int argc, char **argv) { - + int fd_in; + int fd_out; char * cmdLine; char ** cmd; size_t len = 256; @@ -135,13 +136,13 @@ int main (int argc, char **argv) { if(output_r) { - fd_out = open(output_r_filename, O_WRONLY, 0666); - dup2(fd_out, 0); + fd_out = open(output_r_filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + dup2(fd_out, 1); } if(input_r) { fd_in = open(input_r_filename, O_RDONLY, 0666); - dup2(fd_in, 1); + dup2(fd_in, 0); } fgChildPid = childPid; int i = execvp(cmd[0], cmd); @@ -167,6 +168,8 @@ int main (int argc, char **argv) ListInsert(childs, p); isBackground = 0; /*E espera ele terminar, caso seja um processo de foreground */ + output_r = 0; + input_r = 0; if(!p->isBackground) { child_handler_lock = 1; pidfg = waitpid(childPid, &status, WUNTRACED); diff --git a/main.h b/main.h old mode 100644 new mode 100755 index 4b53068..64398b6 --- a/main.h +++ b/main.h @@ -4,11 +4,15 @@ char * userdir; int output_r; int input_r; -char output_r_filename[100]; -char input_r_filename[100]; -int fd_out; -int fd_in; +char * output_r_filename; +char * input_r_filename; +char field0_name[100]; +char field1_name[100]; +int is_pipe; pid_t fgChildPid; int isBackground; int child_handler_lock; +char * username; +char hostname[256]; + #endif diff --git a/parser.c b/parser.c old mode 100644 new mode 100755 index 0fe9d64..58b3d07 --- a/parser.c +++ b/parser.c @@ -42,6 +42,16 @@ char ** parse(char * cmdLine) { isBackground = 1; words--; } + else if((strcmp("<", cmds) == 0)) { + input_r = 1; + words--; + input_r_filename = strtok(NULL, " "); + } + else if((strcmp(">", cmds) == 0)) { + output_r = 1; + words--; + output_r_filename = strtok(NULL, " "); + } else { parsed[i] = malloc(strlen(cmds)); strcpy(parsed[i], cmds); @@ -68,10 +78,10 @@ char* readline() c = getchar(); while (c != '\n') { - if((c > 31) && (c < 127)) { - input[i] = c; - i++; - } + if((c > 31) && (c < 172)) { + input[i] = c; + i++; + } c = getchar(); } input[i] = '\0'; From 0f8bffca8c3163c24a2d6eefdc74a2a6f101823c Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Sun, 13 Nov 2011 14:45:40 -0800 Subject: [PATCH 04/30] Adicionado suporte a append (>>). --- main.c | 6 +++++- main.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 7d0f143..e6da1b7 100755 --- a/main.c +++ b/main.c @@ -136,7 +136,10 @@ int main (int argc, char **argv) { if(output_r) { - fd_out = open(output_r_filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + if(output_r_append) + fd_out = open(output_r_filename, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + else + fd_out = open(output_r_filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); dup2(fd_out, 1); } if(input_r) @@ -169,6 +172,7 @@ int main (int argc, char **argv) isBackground = 0; /*E espera ele terminar, caso seja um processo de foreground */ output_r = 0; + output_r_append = 0; input_r = 0; if(!p->isBackground) { child_handler_lock = 1; diff --git a/main.h b/main.h index 64398b6..b8c769b 100755 --- a/main.h +++ b/main.h @@ -3,6 +3,7 @@ char * userdir; int output_r; +int output_r_append; int input_r; char * output_r_filename; char * input_r_filename; From b4f593da86a67b80d415aa58ab1dfb931cd1ef22 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Sun, 13 Nov 2011 15:13:19 -0800 Subject: [PATCH 05/30] Comando builtin echo adicionado. --- builtin.c | 18 ++++++++++++++---- builtin.h | 3 ++- main.c | 2 +- parser.c | 18 ++++++++++++------ parser.h | 1 + 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/builtin.c b/builtin.c index 68e3a02..40ad423 100755 --- a/builtin.c +++ b/builtin.c @@ -17,7 +17,7 @@ int isBuiltIn(char * cmd) return -1; } -void callBuiltIn(int cmd_id, char * arg) +void callBuiltIn(int cmd_id, char ** arg) { switch(cmd_id) { @@ -37,13 +37,16 @@ void callBuiltIn(int cmd_id, char * arg) jobs(); break; case 5: - bg(arg); + bg(arg[1]); break; case 6: - fg(arg); + fg(arg[1]); break; case 7: - kill_cmd(arg); + kill_cmd(arg[1]); + break; + case 8: + echo(arg); break; default: break; @@ -160,5 +163,12 @@ void kill_cmd(char * arg) else n = strtol(arg, &end, 10); kill(n, SIGTERM); } +} +void echo(char ** cmds) { + int i; + for(i = 1; i < cmd_len; i++){ + printf("%s ", cmds[i]); + } + printf("\n"); } diff --git a/builtin.h b/builtin.h index 03391fa..023369e 100755 --- a/builtin.h +++ b/builtin.h @@ -11,7 +11,7 @@ struct node *history; pid_t childPid; int isBuiltIn(char * cmd); -void callBuiltIn(int cmd_id, char * arg); +void callBuiltIn(int cmd_id, char ** arg); void add_history(char * cmd); void print_history(); void cd(); @@ -20,5 +20,6 @@ void jobs(); void bg(char * arg); void fg(char * arg); void kill_cmd(char * arg); +void echo (char ** cmds); #endif diff --git a/main.c b/main.c index e6da1b7..db885f6 100755 --- a/main.c +++ b/main.c @@ -129,7 +129,7 @@ int main (int argc, char **argv) add_history(cmdLine); cmd = parse(cmdLine); int cmd_id = isBuiltIn(cmd[0]); - if(cmd_id >= 0) callBuiltIn(cmd_id, cmd[1]); + if(cmd_id >= 0) callBuiltIn(cmd_id, cmd); else { if((childPid = fork()) == 0) diff --git a/parser.c b/parser.c index 58b3d07..5964204 100755 --- a/parser.c +++ b/parser.c @@ -31,25 +31,31 @@ int word_count(char * source) } char ** parse(char * cmdLine) { - int words = word_count(cmdLine); + cmd_len = word_count(cmdLine); char * cmds; int i; - parsed = (char**)malloc((words+1)*sizeof(char*)); + parsed = (char**)malloc((cmd_len+1)*sizeof(char*)); cmds = strtok(cmdLine, " "); for(i = 0; cmds != NULL; i++) { if((strcmp("&", cmds) == 0)) { isBackground = 1; - words--; + cmd_len--; } else if((strcmp("<", cmds) == 0)) { input_r = 1; - words--; + cmd_len--; input_r_filename = strtok(NULL, " "); } else if((strcmp(">", cmds) == 0)) { output_r = 1; - words--; + cmd_len--; + output_r_filename = strtok(NULL, " "); + } + else if((strcmp(">>", cmds) == 0)) { + output_r_append = 1; + output_r = 1; + cmd_len--; output_r_filename = strtok(NULL, " "); } else { @@ -59,7 +65,7 @@ char ** parse(char * cmdLine) { cmds = strtok(NULL, " "); } - parsed[words] = (char *)0; + parsed[cmd_len] = (char *)0; //imprimir_argv(parsed, words); return parsed; } diff --git a/parser.h b/parser.h index 8f4a7e6..ac1f137 100644 --- a/parser.h +++ b/parser.h @@ -3,6 +3,7 @@ char ** parsed; +int cmd_len; void imprimir_argv(char ** matriz, int tamanho); int word_count(char * source); char * readline(void); From 605dd9427547c5be1071d6df749baeb0547f787c Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Sun, 13 Nov 2011 15:20:56 -0800 Subject: [PATCH 06/30] Adicionado comando builtin about. --- builtin.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builtin.c b/builtin.c index 40ad423..c9f1508 100755 --- a/builtin.c +++ b/builtin.c @@ -10,9 +10,9 @@ int isBuiltIn(char * cmd) { - char * commands[] = {"cd", "history", "pwd", "exit", "jobs", "bg", "fg", "kill", "echo"}; + char * commands[] = {"cd", "history", "pwd", "exit", "jobs", "bg", "fg", "kill", "echo", "about"}; int i; - for (i = 0; i < 9; i++) + for (i = 0; i < 10; i++) if (strcmp(commands[i], cmd) == 0) return i; return -1; } @@ -48,6 +48,9 @@ void callBuiltIn(int cmd_id, char ** arg) case 8: echo(arg); break; + case 9: + printf("\nShell para trabalho de SSC0141.\nDesenvolvido por Lucas Lobosque e Leandro Pozer."); + break; default: break; } From 1c91702ef96be6fbe8f03b6ba3e33c48665fe0f4 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Sun, 13 Nov 2011 15:35:38 -0800 Subject: [PATCH 07/30] Comando history melhorado, agora aceita um argumento com o maximo de linhas pra mostrar. --- builtin.c | 42 ++++++++++++++++++++++++++---------------- builtin.h | 2 +- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/builtin.c b/builtin.c index c9f1508..2180053 100755 --- a/builtin.c +++ b/builtin.c @@ -25,7 +25,7 @@ void callBuiltIn(int cmd_id, char ** arg) cd(); break; case 1: - print_history(); + print_history(arg[1]); break; case 2: pwd(); @@ -49,7 +49,7 @@ void callBuiltIn(int cmd_id, char ** arg) echo(arg); break; case 9: - printf("\nShell para trabalho de SSC0141.\nDesenvolvido por Lucas Lobosque e Leandro Pozer."); + printf("Shell para trabalho de SSC0141.\nDesenvolvido por Lucas Lobosque e Leandro Pozer.\n"); break; default: break; @@ -80,12 +80,15 @@ void add_history(char * cmd) } } -void print_history() +void print_history(char * arg) { + int n = 9999; + char * end; + if (arg != NULL) n = strtol(arg, &end, 10); struct node *tmp = history; int i = 1; printf("%d %s\n", i, tmp->cmd); - while(tmp->next != NULL) + while(tmp->next != NULL && (i < n)) { i++; tmp = tmp->next; @@ -122,13 +125,15 @@ void jobs() void bg(char * arg) { - if(!ListIsEmpty(childs)) { + if(!ListIsEmpty(childs)) + { char * end; int n; pid_t pid; if(arg == NULL) pid = ListLastStoppedToBg(childs); - else { + else + { n = strtol(arg, &end, 10); pid = ListToBg(childs, n); } @@ -138,14 +143,16 @@ void bg(char * arg) void fg(char * arg) { - if(!ListIsEmpty(childs)) { + if(!ListIsEmpty(childs)) + { char * end; int n; pid_t pid, pidfg; int status; if(arg == NULL) pid = ListLastToFg(childs); - else { + else + { n = strtol(arg, &end, 10); pid = ListToFg(childs, n); } @@ -158,20 +165,23 @@ void fg(char * arg) void kill_cmd(char * arg) { - if(!ListIsEmpty(childs)) { + if(!ListIsEmpty(childs)) + { char * end; int n; NODE * aux = childs->last; if(arg == NULL) n = aux->item->pid; else n = strtol(arg, &end, 10); - kill(n, SIGTERM); + kill(n, SIGTERM); } } -void echo(char ** cmds) { - int i; - for(i = 1; i < cmd_len; i++){ - printf("%s ", cmds[i]); - } - printf("\n"); +void echo(char ** cmds) +{ + int i; + for(i = 1; i < cmd_len; i++) + { + printf("%s ", cmds[i]); + } + printf("\n"); } diff --git a/builtin.h b/builtin.h index 023369e..ba15a06 100755 --- a/builtin.h +++ b/builtin.h @@ -13,7 +13,7 @@ pid_t childPid; int isBuiltIn(char * cmd); void callBuiltIn(int cmd_id, char ** arg); void add_history(char * cmd); -void print_history(); +void print_history(char * arg); void cd(); void pwd(); void jobs(); From effc89fa076db27d0d3fc5c1233fa237ddbd7e7f Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Sun, 13 Nov 2011 15:48:16 -0800 Subject: [PATCH 08/30] =?UTF-8?q?Pequeno=20erro=20no=20echo=20quando=20sem?= =?UTF-8?q?=20argumentos.=20(Quebra=20de=20linha=20desnecess=C3=A1ria).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin.c b/builtin.c index 2180053..745a4cf 100755 --- a/builtin.c +++ b/builtin.c @@ -183,5 +183,5 @@ void echo(char ** cmds) { printf("%s ", cmds[i]); } - printf("\n"); + if (cmd_len > 1) printf("\n"); } From 33236df9b9b9c9cac3bd4ae2e6e82d4efcdd6e74 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Sun, 13 Nov 2011 16:27:46 -0800 Subject: [PATCH 09/30] =?UTF-8?q?Poss=C3=ADveis=20problemas=20de=20concorr?= =?UTF-8?q?encia=20e=20bug=20no=20ctrl+z.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.c | 5 ++--- list.h | 2 +- main.c | 19 +++++++++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/list.c b/list.c index a629fe1..369a656 100755 --- a/list.c +++ b/list.c @@ -53,15 +53,14 @@ int ListGetByPid(LIST *list, pid_t pid, ITEM *item) return 0; } -int ListGetRunningProcess(LIST *list, ITEM *item) +int ListStopRunningProcessByPid(LIST *list, pid_t pid) { NODE *aux = list->first; while (aux != NULL) { - if(strcmp(aux->item->status, "Running") == 0) + if((strcmp(aux->item->status, "Running") == 0) && aux->item->pid == pid) { strcpy(aux->item->status, "Stopped"); - item = aux->item; return 1; } aux = aux->next; diff --git a/list.h b/list.h index b5072a2..c738ae9 100755 --- a/list.h +++ b/list.h @@ -25,7 +25,7 @@ void ListCreate(LIST *list); int ListIsEmpty(LIST *list); int ListInsert(LIST *list, ITEM *item); int ListGetByPid(LIST *list, pid_t pid, ITEM *item); -int ListGetRunningProcess(LIST *list, ITEM *item); +int ListStopRunningProcessByPid(LIST *list,pid_t pid); int ListRemoveByPid(LIST *list, pid_t pid); pid_t ListLastStoppedToBg(LIST *list); pid_t ListToBg(LIST *list, pid_t n); diff --git a/main.c b/main.c index db885f6..ec61c2d 100755 --- a/main.c +++ b/main.c @@ -48,12 +48,13 @@ void child_handler(int signum) } void sigtstop_handler(int signum) { + printf("childPid: %d\n", childPid); printf("\n"); if(!ListIsEmpty(childs)) { - ITEM *item; - item = malloc(sizeof(ITEM)); - ListGetRunningProcess(childs, item); - if (childPid >= 0) kill(childPid, SIGSTOP); + if (childPid >= 0) { + ListStopRunningProcessByPid(childs, childPid); + kill(childPid, SIGSTOP); + } else printPrompt(username, hostname); } @@ -66,6 +67,9 @@ int main (int argc, char **argv) int fd_in; int fd_out; + sigset_t chldMask; + sigemptyset (&chldMask); + sigaddset(&chldMask, SIGCHLD); char * cmdLine; char ** cmd; size_t len = 256; @@ -148,6 +152,7 @@ int main (int argc, char **argv) dup2(fd_in, 0); } fgChildPid = childPid; + signal(SIGTSTP, SIG_IGN); int i = execvp(cmd[0], cmd); if (output_r) close(fd_out); if (input_r) close(fd_in); @@ -168,16 +173,18 @@ int main (int argc, char **argv) p->isBackground = isBackground; strcpy(p->status, "Running"); strcpy(p->command, cmdLine); + sigprocmask(SIG_BLOCK, &chldMask, NULL); ListInsert(childs, p); + sigprocmask(SIG_UNBLOCK, &chldMask, NULL); isBackground = 0; /*E espera ele terminar, caso seja um processo de foreground */ output_r = 0; output_r_append = 0; input_r = 0; if(!p->isBackground) { - child_handler_lock = 1; + sigprocmask(SIG_BLOCK, &chldMask, NULL); pidfg = waitpid(childPid, &status, WUNTRACED); - child_handler_lock = 0; + sigprocmask(SIG_UNBLOCK, &chldMask, NULL); if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, childPid); } } From 277c07d9865fe2271b34f139dca8c8968fb0e836 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Sun, 13 Nov 2011 17:46:19 -0800 Subject: [PATCH 10/30] Adicionado a fila que guardara os comandos (para podermos tratar casos com pipe); --- cmdQueue.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ cmdQueue.h | 16 ++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 cmdQueue.c create mode 100644 cmdQueue.h diff --git a/cmdQueue.c b/cmdQueue.c new file mode 100644 index 0000000..a54a42b --- /dev/null +++ b/cmdQueue.c @@ -0,0 +1,50 @@ +#include "cmdQueue.h" + +void queueCreate(CMD_QUEUE *queue) +{ + queue->last = 0; + queue->first = 0; +} + +int queueEmpty(CMD_QUEUE *queue) +{ + return (queue->first == queue->last); +} + +int queueFull(CMD_QUEUE *queue) +{ + return (((queue->last+1) % SIZE) == queue->first); +} + +int queueRemove(CMD_QUEUE *queue, CMD *item) +{ + if (!queueFull(queue)) + { + queue->items[queue->last] = *item; + queue->last = (queue->last+1) % SIZE; + return 1; + } + return 0; +} +int queueAdd(CMD_QUEUE *queue, CMD *item) +{ + if (!queueEmpty(queue)) + { + *item = queue->items[queue->first]; + queue->first = (queue->first+1) % SIZE; + + return 1; + } + return 0; +} +int queueCount(CMD_QUEUE *queue) +{ + if (queue->last >= queue->first) + { + return (queue->last - queue->first); + } + else + { + return (SIZE - (queue->first - queue->last)); + } +} diff --git a/cmdQueue.h b/cmdQueue.h new file mode 100644 index 0000000..3620ba3 --- /dev/null +++ b/cmdQueue.h @@ -0,0 +1,16 @@ +#define SIZE 100 + +typedef struct +{ + int isBackground; + int input_r; + int output_r; + int output_r_append; +} CMD; + +typedef struct +{ + CMD items[SIZE]; + int last; + int first; +} CMD_QUEUE; From d1065250686f373fb3727fce02001640e6b78472 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Mon, 14 Nov 2011 08:19:15 -0800 Subject: [PATCH 11/30] Parser reconhece pipe. --- builtin.c | 10 +++-- list.c | 73 +++++++++++++++++++++----------- list.h | 26 +++++++++--- main.c | 121 ++++++++++++++++++++++++++++++------------------------ parser.c | 49 ++++++++++++++-------- parser.h | 5 ++- 6 files changed, 180 insertions(+), 104 deletions(-) diff --git a/builtin.c b/builtin.c index 745a4cf..ce75cc3 100755 --- a/builtin.c +++ b/builtin.c @@ -114,11 +114,11 @@ void pwd() void jobs() { NODE *aux = childs->first; - ITEM * item; + PROCESS * proc; while (aux != NULL) { - item = aux->item; - printf("[%d] %s %s\n",item->pid, item->status, item->command); + proc = aux->proc; + printf("[%d] %s %s\n",proc->pid, proc->status, proc->command); aux = aux->next; } } @@ -156,6 +156,8 @@ void fg(char * arg) n = strtol(arg, &end, 10); pid = ListToFg(childs, n); } + kill(pid, SIGCONT); + printf("pid achado: %d\n", pid); child_handler_lock = 1; pidfg = waitpid(pid, &status, WUNTRACED); child_handler_lock = 0; @@ -170,7 +172,7 @@ void kill_cmd(char * arg) char * end; int n; NODE * aux = childs->last; - if(arg == NULL) n = aux->item->pid; + if(arg == NULL) n = aux->proc->pid; else n = strtol(arg, &end, 10); kill(n, SIGTERM); } diff --git a/list.c b/list.c index 369a656..15333eb 100755 --- a/list.c +++ b/list.c @@ -9,6 +9,16 @@ void ListCreate(LIST *list) list->last = NULL; } +void initCommand(COMMAND *cmd) { + cmd->isBackground = 0; + cmd->input_r = 0; + cmd->output_r = 0; + cmd->output_r_append = 0; + cmd->size = 0; + cmd->id = -1; + cmd->pid = -1; +} + int ListIsEmpty(LIST *list) { if(list->first == NULL) return 1; @@ -16,13 +26,14 @@ int ListIsEmpty(LIST *list) } -int ListInsert(LIST *list, ITEM *item) +int ListInsert(LIST *list, PROCESS *proc, COMMAND *cmd) { NODE *newNode = (NODE *)malloc(sizeof(NODE)); if (newNode != NULL) { - newNode->item = item; + newNode->proc = proc; + newNode->cmd = cmd; newNode->next = NULL; newNode->prev = list->last; @@ -37,14 +48,14 @@ int ListInsert(LIST *list, ITEM *item) return 0; } -int ListGetByPid(LIST *list, pid_t pid, ITEM *item) +int ListGetByPid(LIST *list, pid_t pid, PROCESS *proc) { NODE *aux = list->first; while (aux != NULL) { - if (aux->item->pid == pid) + if (aux->proc->pid == pid) { - item = aux->item; + proc = aux->proc; return 1; } aux = aux->next; @@ -58,9 +69,9 @@ int ListStopRunningProcessByPid(LIST *list, pid_t pid) NODE *aux = list->first; while (aux != NULL) { - if((strcmp(aux->item->status, "Running") == 0) && aux->item->pid == pid) + if((strcmp(aux->proc->status, "Running") == 0) && aux->proc->pid == pid) { - strcpy(aux->item->status, "Stopped"); + strcpy(aux->proc->status, "Stopped"); return 1; } aux = aux->next; @@ -76,7 +87,7 @@ int ListRemoveByPid(LIST *list, pid_t pid) int i; NODE *aux = list->first; - while(aux->item->pid != pid) + while(aux->proc->pid != pid) { if (aux != list->last) aux = aux->next; @@ -93,7 +104,7 @@ int ListRemoveByPid(LIST *list, pid_t pid) else aux->next->prev = aux->prev; - free(aux->item); + free(aux->proc); free(aux); return 1; @@ -107,11 +118,11 @@ pid_t ListLastStoppedToBg(LIST *list) NODE *aux = list->last; while (aux != NULL) { - if(strcmp(aux->item->status, "Stopped") == 0) + if(strcmp(aux->proc->status, "Stopped") == 0) { - aux->item->isBackground = 1; - strcpy(aux->item->status, "Running"); - return aux->item->pid; + aux->proc->isBackground = 1; + strcpy(aux->proc->status, "Running"); + return aux->proc->pid; } aux = aux->prev; } @@ -125,11 +136,11 @@ pid_t ListToBg(LIST *list, pid_t pid) NODE *aux = list->last; while (aux != NULL) { - if(aux->item->pid == pid) + if(aux->proc->pid == pid) { - aux->item->isBackground = 1; - strcpy(aux->item->status, "Running"); - return aux->item->pid; + aux->proc->isBackground = 1; + strcpy(aux->proc->status, "Running"); + return aux->proc->pid; } aux = aux->prev; } @@ -143,9 +154,9 @@ pid_t ListLastToFg(LIST *list) NODE *aux = list->last; if (aux != NULL) { - aux->item->isBackground = 0; - strcpy(aux->item->status, "Running"); - return aux->item->pid; + aux->proc->isBackground = 0; + strcpy(aux->proc->status, "Running"); + return aux->proc->pid; } aux = aux->prev; } @@ -158,11 +169,11 @@ pid_t ListToFg(LIST *list, pid_t pid) NODE *aux = list->last; while (aux != NULL) { - if(aux->item->pid == pid) + if(aux->proc->pid == pid) { - aux->item->isBackground = 0; - strcpy(aux->item->status, "Running"); - return aux->item->pid; + aux->proc->isBackground = 0; + strcpy(aux->proc->status, "Running"); + return aux->proc->pid; } aux = aux->prev; } @@ -170,4 +181,18 @@ pid_t ListToFg(LIST *list, pid_t pid) return -1; } +void ListPurgeCmds(LIST *list) { + if(!ListIsEmpty(list)) { + NODE *aux = list->first; + while(aux != NULL) { + int i; + for(i = 0; i < aux->cmd->size; i++); + free(aux->cmd->args[i]); + free(aux->cmd->args); + free(aux->cmd); + aux = aux->next; + } + ListCreate(list); + } +} diff --git a/list.h b/list.h index c738ae9..32dfa4c 100755 --- a/list.h +++ b/list.h @@ -6,11 +6,26 @@ typedef struct char command[256]; char status[100]; int isBackground; -} ITEM; +} PROCESS; + +typedef struct +{ + char **args; + int isBackground; + int input_r; + int output_r; + int output_r_append; + int size; + char * output_r_filename; + char * input_r_filename; + int id; + pid_t pid; +} COMMAND; typedef struct NODE { - ITEM *item; + PROCESS *proc; + COMMAND *cmd; struct NODE *next; struct NODE *prev; } NODE; @@ -22,15 +37,16 @@ typedef struct } LIST; void ListCreate(LIST *list); +void initCommand(COMMAND *cmd); int ListIsEmpty(LIST *list); -int ListInsert(LIST *list, ITEM *item); -int ListGetByPid(LIST *list, pid_t pid, ITEM *item); +int ListInsert(LIST *list, PROCESS *proc, COMMAND *cmd); +int ListGetByPid(LIST *list, pid_t pid, PROCESS *proc); int ListStopRunningProcessByPid(LIST *list,pid_t pid); int ListRemoveByPid(LIST *list, pid_t pid); pid_t ListLastStoppedToBg(LIST *list); pid_t ListToBg(LIST *list, pid_t n); pid_t ListLastToFg(LIST *list); pid_t ListToFg(LIST *list, pid_t n); - +void ListPurgeCmds(LIST *list); LIST * childs; #endif diff --git a/main.c b/main.c index ec61c2d..b37ffdf 100755 --- a/main.c +++ b/main.c @@ -38,7 +38,8 @@ void termination_handler (int signum) void child_handler(int signum) { - if(child_handler_lock == 0) { + if(child_handler_lock == 0) + { int status; pid_t pid; pid = waitpid(0, &status, WNOHANG|WUNTRACED); @@ -47,13 +48,16 @@ void child_handler(int signum) } -void sigtstop_handler(int signum) { - printf("childPid: %d\n", childPid); - printf("\n"); - if(!ListIsEmpty(childs)) { - if (childPid >= 0) { - ListStopRunningProcessByPid(childs, childPid); - kill(childPid, SIGSTOP); +void sigtstop_handler(int signum) +{ + printf("childPid: %d\n", childs->last->proc->pid); + printf("\n"); + if(!ListIsEmpty(childs)) + { + if (childs->last->proc->pid >= 0) + { + ListStopRunningProcessByPid(childs, childs->last->proc->pid); + kill(childs->last->proc->pid, SIGSTOP); } else printPrompt(username, hostname); @@ -71,13 +75,15 @@ int main (int argc, char **argv) sigemptyset (&chldMask); sigaddset(&chldMask, SIGCHLD); char * cmdLine; - char ** cmd; + LIST * cmdList; size_t len = 256; struct sigaction new_action, old_action; /* Inicializa a lista que guarda os processos que rodam em background */ childs = malloc(sizeof(LIST)); ListCreate(childs); + cmdList = malloc(sizeof(LIST)); + ListCreate(cmdList); /* Inicializa a variável que guarda o ID do processo atual do foreground */ fgChildPid = 0; child_handler_lock = 0; @@ -131,66 +137,75 @@ int main (int argc, char **argv) if(strcmp(cmdLine, "") != 0) { add_history(cmdLine); - cmd = parse(cmdLine); - int cmd_id = isBuiltIn(cmd[0]); - if(cmd_id >= 0) callBuiltIn(cmd_id, cmd); - else + getCmds(cmdList, cmdLine); + NODE *aux = cmdList->first; + while (aux != NULL) { - if((childPid = fork()) == 0) - { - if(output_r) - { - if(output_r_append) - fd_out = open(output_r_filename, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); - else - fd_out = open(output_r_filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); - dup2(fd_out, 1); - } - if(input_r) - { - fd_in = open(input_r_filename, O_RDONLY, 0666); - dup2(fd_in, 0); - } - fgChildPid = childPid; - signal(SIGTSTP, SIG_IGN); - int i = execvp(cmd[0], cmd); - if (output_r) close(fd_out); - if (input_r) close(fd_in); - if(i < 0) + + aux->cmd->id = isBuiltIn(aux->cmd->args[0]); + if(aux->cmd->id >= 0) callBuiltIn(aux->cmd->id, aux->cmd->args); + else { + aux->cmd->pid = fork(); + if(aux->cmd->pid == 0) { - printf("%s: command not found\n", cmd[0]); - exit(101); + if(aux->cmd->output_r) + { + if(aux->cmd->output_r_append) + fd_out = open(aux->cmd->output_r_filename, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + else + fd_out = open(aux->cmd->output_r_filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + dup2(fd_out, 1); + } + if(aux->cmd->input_r) + { + fd_in = open(aux->cmd->input_r_filename, O_RDONLY, 0666); + dup2(fd_in, 0); + } + fgChildPid = aux->cmd->pid; + signal(SIGTSTP, SIG_IGN); + int i = execvp(aux->cmd->args[0], aux->cmd->args); + if (aux->cmd->output_r) close(fd_out); + if (aux->cmd->input_r) close(fd_in); + if(i < 0) + { + printf("%s: command not found\n", aux->cmd->args[0]); + exit(101); + } } } - else - { - /*Após criar o processo filho, o pai insere em uma lista ligada o novo processo */ + aux = aux->next; + } + aux = cmdList->first; + while (aux != NULL) + { /*Após criar o processo filho, o pai insere em uma lista ligada o novo processo */ + if(aux->cmd->id == -1) { int status; pid_t pidfg; - ITEM * p; - p = malloc(sizeof(ITEM)); - p->pid = childPid; - p->isBackground = isBackground; + PROCESS * p; + p = malloc(sizeof(PROCESS)); + p->pid = aux->cmd->pid; + p->isBackground = aux->cmd->isBackground; strcpy(p->status, "Running"); strcpy(p->command, cmdLine); sigprocmask(SIG_BLOCK, &chldMask, NULL); - ListInsert(childs, p); + ListInsert(childs, p, NULL); sigprocmask(SIG_UNBLOCK, &chldMask, NULL); - isBackground = 0; /*E espera ele terminar, caso seja um processo de foreground */ - output_r = 0; - output_r_append = 0; - input_r = 0; - if(!p->isBackground) { + if(!p->isBackground) + { sigprocmask(SIG_BLOCK, &chldMask, NULL); - pidfg = waitpid(childPid, &status, WUNTRACED); + pidfg = waitpid(aux->cmd->pid, &status, WUNTRACED); sigprocmask(SIG_UNBLOCK, &chldMask, NULL); - if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, childPid); + if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, aux->cmd->pid); } } + aux = aux->next; } - free_parse(); - free(cmdLine); } + ListPurgeCmds(cmdList); + free(cmdLine); } + } + + diff --git a/parser.c b/parser.c index 5964204..4e85090 100755 --- a/parser.c +++ b/parser.c @@ -30,44 +30,61 @@ int word_count(char * source) return words; } -char ** parse(char * cmdLine) { +void getCmds(LIST *cmdList, char *cmdLine) { + char *cmds; + char * saveptr; + int i; + int pos = 0; + cmds = strtok_r(cmdLine, "|", &saveptr); + while(cmds != NULL) { + COMMAND * cmd = malloc(sizeof(COMMAND)); + initCommand(cmd); + parse(cmds, cmd); + ListInsert(cmdList, NULL, cmd); + cmds = strtok_r(NULL, "|", &saveptr); + } +} + + +void parse(char * cmdLine, COMMAND * cmd) { cmd_len = word_count(cmdLine); char * cmds; int i; - parsed = (char**)malloc((cmd_len+1)*sizeof(char*)); - cmds = strtok(cmdLine, " "); + char *saveptr; + cmd->args = (char**)malloc((cmd_len+1)*sizeof(char*)); + cmds = strtok_r(cmdLine, " ", &saveptr); for(i = 0; cmds != NULL; i++) { if((strcmp("&", cmds) == 0)) { - isBackground = 1; + cmd->isBackground = 1; cmd_len--; } else if((strcmp("<", cmds) == 0)) { - input_r = 1; + cmd->input_r = 1; cmd_len--; - input_r_filename = strtok(NULL, " "); + cmd->input_r_filename = strtok_r(NULL, " ", &saveptr); } else if((strcmp(">", cmds) == 0)) { - output_r = 1; + cmd->output_r = 1; cmd_len--; - output_r_filename = strtok(NULL, " "); + cmd->output_r_filename = strtok_r(NULL, " ", &saveptr); } else if((strcmp(">>", cmds) == 0)) { - output_r_append = 1; - output_r = 1; + cmd->output_r_append = 1; + cmd->output_r = 1; cmd_len--; - output_r_filename = strtok(NULL, " "); + cmd->output_r_filename = strtok_r(NULL, " ", &saveptr); } else { - parsed[i] = malloc(strlen(cmds)); - strcpy(parsed[i], cmds); + cmd->args[i] = malloc(strlen(cmds)); + strcpy(cmd->args[i], cmds); } - cmds = strtok(NULL, " "); + cmds = strtok_r(NULL, " ", &saveptr); } - parsed[cmd_len] = (char *)0; + cmd->args[cmd_len] = (char *)0; + cmd->size = cmd_len; //imprimir_argv(parsed, words); - return parsed; } void free_parse() { diff --git a/parser.h b/parser.h index ac1f137..1149c72 100644 --- a/parser.h +++ b/parser.h @@ -1,13 +1,14 @@ #ifndef _PARSER_H_ #define _PARSER_H_ - +#include "list.h" char ** parsed; int cmd_len; void imprimir_argv(char ** matriz, int tamanho); int word_count(char * source); char * readline(void); -char ** parse(char * cmdLine); +void getCmds(LIST *cmdList, char *cmdLine); +void parse(char * cmdLine, COMMAND * command); void free_parse(); #endif From fb165cf5e2054f2bfc82821aeaeea1ab47f4926c Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Mon, 14 Nov 2011 08:33:12 -0800 Subject: [PATCH 12/30] =?UTF-8?q?Melhoras=20no=20tratamento=20de=20concorr?= =?UTF-8?q?=C3=AAncia.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builtin.c | 9 ++++++--- main.c | 14 +++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/builtin.c b/builtin.c index ce75cc3..478a579 100755 --- a/builtin.c +++ b/builtin.c @@ -149,6 +149,9 @@ void fg(char * arg) int n; pid_t pid, pidfg; int status; + sigset_t chldMask; + sigemptyset (&chldMask); + sigaddset(&chldMask, SIGCHLD); if(arg == NULL) pid = ListLastToFg(childs); else @@ -157,11 +160,11 @@ void fg(char * arg) pid = ListToFg(childs, n); } kill(pid, SIGCONT); - printf("pid achado: %d\n", pid); - child_handler_lock = 1; + sigprocmask(SIG_BLOCK, &chldMask, NULL); pidfg = waitpid(pid, &status, WUNTRACED); - child_handler_lock = 0; if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, childPid); + sigprocmask(SIG_UNBLOCK, &chldMask, NULL); + } } diff --git a/main.c b/main.c index b37ffdf..98150b6 100755 --- a/main.c +++ b/main.c @@ -38,14 +38,10 @@ void termination_handler (int signum) void child_handler(int signum) { - if(child_handler_lock == 0) - { - int status; - pid_t pid; - pid = waitpid(0, &status, WNOHANG|WUNTRACED); - if((pid >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, pid); - } - + int status; + pid_t pid; + pid = waitpid(0, &status, WNOHANG|WUNTRACED); + if((pid >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, pid); } void sigtstop_handler(int signum) @@ -195,8 +191,8 @@ int main (int argc, char **argv) { sigprocmask(SIG_BLOCK, &chldMask, NULL); pidfg = waitpid(aux->cmd->pid, &status, WUNTRACED); - sigprocmask(SIG_UNBLOCK, &chldMask, NULL); if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, aux->cmd->pid); + sigprocmask(SIG_UNBLOCK, &chldMask, NULL); } } aux = aux->next; From 8400360fc168232519ebf76895d49d6a84a9260c Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Mon, 14 Nov 2011 16:53:12 -0800 Subject: [PATCH 13/30] Pipe funcionando. Falta melhorar. --- builtin.c | 10 +++++----- builtin.h | 2 +- list.c | 2 ++ list.h | 1 + main.c | 35 ++++++++++++++++++++++++++++++----- shell - es.zip | Bin 40285 -> 0 bytes 6 files changed, 39 insertions(+), 11 deletions(-) delete mode 100644 shell - es.zip diff --git a/builtin.c b/builtin.c index 478a579..a01d141 100755 --- a/builtin.c +++ b/builtin.c @@ -22,7 +22,7 @@ void callBuiltIn(int cmd_id, char ** arg) switch(cmd_id) { case 0: - cd(); + cd(arg[1]); break; case 1: print_history(arg[1]); @@ -96,12 +96,12 @@ void print_history(char * arg) } } -void cd() +void cd(char * arg) { int error; - if(parsed[1] == NULL) error = chdir(userdir); - else error = chdir(parsed[1]); - if (error == -1) printf("bash: cd: %s: %s\n", parsed[1],strerror(errno)); + if(arg == NULL) error = chdir(userdir); + else error = chdir(arg); + if (error == -1) printf("bash: cd: %s: %s\n", arg,strerror(errno)); } void pwd() diff --git a/builtin.h b/builtin.h index ba15a06..9126954 100755 --- a/builtin.h +++ b/builtin.h @@ -14,7 +14,7 @@ int isBuiltIn(char * cmd); void callBuiltIn(int cmd_id, char ** arg); void add_history(char * cmd); void print_history(char * arg); -void cd(); +void cd(char * arg); void pwd(); void jobs(); void bg(char * arg); diff --git a/list.c b/list.c index 15333eb..5e946d8 100755 --- a/list.c +++ b/list.c @@ -17,6 +17,8 @@ void initCommand(COMMAND *cmd) { cmd->size = 0; cmd->id = -1; cmd->pid = -1; + cmd->pipe[0] = -1; + cmd->pipe[1] = -1; } int ListIsEmpty(LIST *list) diff --git a/list.h b/list.h index 32dfa4c..b713f94 100755 --- a/list.h +++ b/list.h @@ -19,6 +19,7 @@ typedef struct char * output_r_filename; char * input_r_filename; int id; + int pipe[2]; pid_t pid; } COMMAND; diff --git a/main.c b/main.c index 98150b6..03726fb 100755 --- a/main.c +++ b/main.c @@ -46,7 +46,6 @@ void child_handler(int signum) void sigtstop_handler(int signum) { - printf("childPid: %d\n", childs->last->proc->pid); printf("\n"); if(!ListIsEmpty(childs)) { @@ -137,13 +136,37 @@ int main (int argc, char **argv) NODE *aux = cmdList->first; while (aux != NULL) { - + if (aux->prev != NULL || aux->next != NULL) aux->cmd->isBackground = 1; aux->cmd->id = isBuiltIn(aux->cmd->args[0]); if(aux->cmd->id >= 0) callBuiltIn(aux->cmd->id, aux->cmd->args); else { + if(aux->next != NULL) + pipe2(aux->cmd->pipe, O_CLOEXEC ); aux->cmd->pid = fork(); if(aux->cmd->pid == 0) { + //sleep(60); + if(aux->prev != NULL || aux->next != NULL) { + if(aux->prev == NULL) { + dup2(aux->cmd->pipe[1], 1); + close(aux->cmd->pipe[0]); + //close(aux->next->cmd->pipe[0]); + //close(aux->next->cmd->pipe[1]); + } + else if(aux->next == NULL) { + //dup2(aux->cmd->pipe[0], 0); + dup2(aux->prev->cmd->pipe[0], 0); + close(aux->prev->cmd->pipe[1]); + //close(aux->prev->prev->cmd->pipe[0]); + //close(aux->prev->prev->cmd->pipe[1]); + } + else { + dup2(aux->prev->cmd->pipe[0], 0); + dup2(aux->cmd->pipe[1], 1); + close(aux->prev->cmd->pipe[1]); + close(aux->cmd->pipe[0]); + } + } if(aux->cmd->output_r) { if(aux->cmd->output_r_append) @@ -165,7 +188,7 @@ int main (int argc, char **argv) if(i < 0) { printf("%s: command not found\n", aux->cmd->args[0]); - exit(101); + exit(0); } } } @@ -173,7 +196,9 @@ int main (int argc, char **argv) } aux = cmdList->first; while (aux != NULL) - { /*Após criar o processo filho, o pai insere em uma lista ligada o novo processo */ + { + close(aux->cmd->pipe[0]); + close(aux->cmd->pipe[1]);/*Após criar o processo filho, o pai insere em uma lista ligada o novo processo */ if(aux->cmd->id == -1) { int status; pid_t pidfg; @@ -182,7 +207,7 @@ int main (int argc, char **argv) p->pid = aux->cmd->pid; p->isBackground = aux->cmd->isBackground; strcpy(p->status, "Running"); - strcpy(p->command, cmdLine); + strcpy(p->command, aux->cmd->args[0]); sigprocmask(SIG_BLOCK, &chldMask, NULL); ListInsert(childs, p, NULL); sigprocmask(SIG_UNBLOCK, &chldMask, NULL); diff --git a/shell - es.zip b/shell - es.zip deleted file mode 100644 index 9817e262271169ea2c6acebd0eb586c49cef52e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40285 zcmZ^qb8Ig_*XP??+qT`_y1lh++qT_bZQHhO+qTVH+k2lkZ+5fUegBxrc8KVvS~QI#)KBz1YflUcMdpULMYm8t=7wpS-Ge->Y9XtZp{3 zGi&8hgVXtvIWgN7^NpczH>j^o#hUAt5pysQevx}M%Q|^~Th3K9P zeuDSqN!xqqk*YIk&4&|wj|WT^Rt3%Clkn($Al~HwZO;dX?9sWGGu=*;LfaSjtfi(= zpg-%15HBjMU*k;_7@uOb+dEvecLu26`h&f8gEx))wq!U68)um|ue3PdQE-6CkX*At zy}Et3_1j3BR|vK(LwdI^o9eyRBPyOja&}j7{Ye3r*qjZ~37_Y0ytvgQ0)%XzO^5 z>(m#->sHLY;Up6C?4n08v=1$wLI$j5C~?7Sk#q);^IQ16rq<#hF{|kGUjueHpg<4q z#FtQF-n&F8u?>3i_)yKhjjfriUP7qSJy7c1DGi&DYiHLGVca$Q;NbSnwI~J2LA|Yv z`U2;JknUO_+MZo}jnAGOsxP~UNYL+@^*Ayh>&$5p_rc6#f#bjw)B_qO0$RN!9IUtz z_0`zer_(RfwcQl{u#w>%Mhi^8JFVGs@jR4{J52U}*w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&V!D0 z+kH1(OhA!05qA4V*{0$*;eVOz-&J`(srx|~#b*&j)ZH)NZ8W~-BZDTb_z2O{r0CuH z3K(R3{YM5)TKy5iWuFk`z59*(zvmrHivDl%CN1U&^X?~x Date: Mon, 14 Nov 2011 16:53:49 -0800 Subject: [PATCH 14/30] =?UTF-8?q?Removendo=20arquivos=20n=C3=A3o=20usados.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmdQueue.c | 50 -------------------------------------------------- cmdQueue.h | 16 ---------------- 2 files changed, 66 deletions(-) delete mode 100644 cmdQueue.c delete mode 100644 cmdQueue.h diff --git a/cmdQueue.c b/cmdQueue.c deleted file mode 100644 index a54a42b..0000000 --- a/cmdQueue.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "cmdQueue.h" - -void queueCreate(CMD_QUEUE *queue) -{ - queue->last = 0; - queue->first = 0; -} - -int queueEmpty(CMD_QUEUE *queue) -{ - return (queue->first == queue->last); -} - -int queueFull(CMD_QUEUE *queue) -{ - return (((queue->last+1) % SIZE) == queue->first); -} - -int queueRemove(CMD_QUEUE *queue, CMD *item) -{ - if (!queueFull(queue)) - { - queue->items[queue->last] = *item; - queue->last = (queue->last+1) % SIZE; - return 1; - } - return 0; -} -int queueAdd(CMD_QUEUE *queue, CMD *item) -{ - if (!queueEmpty(queue)) - { - *item = queue->items[queue->first]; - queue->first = (queue->first+1) % SIZE; - - return 1; - } - return 0; -} -int queueCount(CMD_QUEUE *queue) -{ - if (queue->last >= queue->first) - { - return (queue->last - queue->first); - } - else - { - return (SIZE - (queue->first - queue->last)); - } -} diff --git a/cmdQueue.h b/cmdQueue.h deleted file mode 100644 index 3620ba3..0000000 --- a/cmdQueue.h +++ /dev/null @@ -1,16 +0,0 @@ -#define SIZE 100 - -typedef struct -{ - int isBackground; - int input_r; - int output_r; - int output_r_append; -} CMD; - -typedef struct -{ - CMD items[SIZE]; - int last; - int first; -} CMD_QUEUE; From 54beef28dcd9f50d0486de389be96b5ae5616311 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Mon, 14 Nov 2011 18:13:11 -0800 Subject: [PATCH 15/30] =?UTF-8?q?Uso=20de=20grupos=20para=20tratar=20melho?= =?UTF-8?q?r=20concorr=C3=AAncia.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 58 ++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/main.c b/main.c index 03726fb..5d87f34 100755 --- a/main.c +++ b/main.c @@ -40,7 +40,7 @@ void child_handler(int signum) { int status; pid_t pid; - pid = waitpid(0, &status, WNOHANG|WUNTRACED); + pid = waitpid(-1, &status, WNOHANG|WUNTRACED); if((pid >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, pid); } @@ -136,31 +136,36 @@ int main (int argc, char **argv) NODE *aux = cmdList->first; while (aux != NULL) { - if (aux->prev != NULL || aux->next != NULL) aux->cmd->isBackground = 1; + //if (aux->prev != NULL || aux->next != NULL) aux->cmd->isBackground = 1; aux->cmd->id = isBuiltIn(aux->cmd->args[0]); if(aux->cmd->id >= 0) callBuiltIn(aux->cmd->id, aux->cmd->args); - else { + else + { if(aux->next != NULL) pipe2(aux->cmd->pipe, O_CLOEXEC ); aux->cmd->pid = fork(); if(aux->cmd->pid == 0) { //sleep(60); - if(aux->prev != NULL || aux->next != NULL) { - if(aux->prev == NULL) { + if(aux->prev != NULL || aux->next != NULL) + { + if(aux->prev == NULL) + { dup2(aux->cmd->pipe[1], 1); close(aux->cmd->pipe[0]); //close(aux->next->cmd->pipe[0]); //close(aux->next->cmd->pipe[1]); } - else if(aux->next == NULL) { + else if(aux->next == NULL) + { //dup2(aux->cmd->pipe[0], 0); dup2(aux->prev->cmd->pipe[0], 0); close(aux->prev->cmd->pipe[1]); //close(aux->prev->prev->cmd->pipe[0]); //close(aux->prev->prev->cmd->pipe[1]); } - else { + else + { dup2(aux->prev->cmd->pipe[0], 0); dup2(aux->cmd->pipe[1], 1); close(aux->prev->cmd->pipe[1]); @@ -195,11 +200,15 @@ int main (int argc, char **argv) aux = aux->next; } aux = cmdList->first; + int count = 0; while (aux != NULL) { - close(aux->cmd->pipe[0]); - close(aux->cmd->pipe[1]);/*Após criar o processo filho, o pai insere em uma lista ligada o novo processo */ - if(aux->cmd->id == -1) { + if(isBuiltIn(aux->cmd->args[0]) == -1) + { + if(aux->cmd->isBackground == 0) count++; + setpgid(aux->cmd->pid, cmdList->first->cmd->pid); + close(aux->cmd->pipe[0]); + close(aux->cmd->pipe[1]);/*Após criar o processo filho, o pai insere em uma lista ligada o novo processo */ int status; pid_t pidfg; PROCESS * p; @@ -212,21 +221,30 @@ int main (int argc, char **argv) ListInsert(childs, p, NULL); sigprocmask(SIG_UNBLOCK, &chldMask, NULL); /*E espera ele terminar, caso seja um processo de foreground */ - if(!p->isBackground) - { - sigprocmask(SIG_BLOCK, &chldMask, NULL); - pidfg = waitpid(aux->cmd->pid, &status, WUNTRACED); - if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, aux->cmd->pid); - sigprocmask(SIG_UNBLOCK, &chldMask, NULL); - } + //if(!p->isBackground) + //{ + + //printPrompt(username, hostname); } aux = aux->next; } + int i; + int status; + sigprocmask(SIG_BLOCK, &chldMask, NULL); + for (i = 0; i < count; i++) + { + pid_t pidfg = waitpid(-cmdList->first->cmd->pid, &status, WUNTRACED); + if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, pidfg); + } + sigprocmask(SIG_UNBLOCK, &chldMask, NULL); + + //} } - ListPurgeCmds(cmdList); - free(cmdLine); + ListPurgeCmds(cmdList); + free(cmdLine); } - } + + From 50d65103dafe885dce4d5ddb325fff42081b5f32 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Mon, 14 Nov 2011 19:02:17 -0800 Subject: [PATCH 16/30] Alguns memory leaks removidos. --- builtin.c | 4 ++-- main.c | 21 ++++++++++++++------- parser.c | 2 +- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/builtin.c b/builtin.c index a01d141..ff94475 100755 --- a/builtin.c +++ b/builtin.c @@ -62,7 +62,7 @@ void add_history(char * cmd) struct node *prev = history; if(history->cmd == NULL) { - history->cmd = malloc(strlen(cmd) + 1); + history->cmd = malloc((strlen(cmd) + 1)*sizeof(char)); strcpy(history->cmd, cmd); } else @@ -73,7 +73,7 @@ void add_history(char * cmd) tmp = tmp->next; } tmp = malloc(sizeof(struct node)); - tmp->cmd = malloc(strlen(cmd)); + tmp->cmd = malloc((strlen(cmd) + 1)*sizeof(char)); tmp->next = NULL; strcpy(tmp->cmd, cmd); prev->next = tmp; diff --git a/main.c b/main.c index 5d87f34..804edbe 100755 --- a/main.c +++ b/main.c @@ -28,11 +28,14 @@ void printPrompt(char* username, char* hostname) void termination_handler (int signum) { printf("\n"); - printPrompt(username, hostname); - if (fgChildPid != 0) + NODE *aux = childs->first; + while(aux != NULL) { - kill(fgChildPid, signum); - fgChildPid = 0; + if (!aux->proc->isBackground) { + kill(-aux->proc->pid, signum); + break; + } + aux = aux->next; } } @@ -185,7 +188,6 @@ int main (int argc, char **argv) fd_in = open(aux->cmd->input_r_filename, O_RDONLY, 0666); dup2(fd_in, 0); } - fgChildPid = aux->cmd->pid; signal(SIGTSTP, SIG_IGN); int i = execvp(aux->cmd->args[0], aux->cmd->args); if (aux->cmd->output_r) close(fd_out); @@ -200,6 +202,13 @@ int main (int argc, char **argv) aux = aux->next; } aux = cmdList->first; + while (aux->next != NULL) + { + close(aux->cmd->pipe[0]); + close(aux->cmd->pipe[1]); + aux = aux->next; + } + aux = cmdList->first; int count = 0; while (aux != NULL) { @@ -207,8 +216,6 @@ int main (int argc, char **argv) { if(aux->cmd->isBackground == 0) count++; setpgid(aux->cmd->pid, cmdList->first->cmd->pid); - close(aux->cmd->pipe[0]); - close(aux->cmd->pipe[1]);/*Após criar o processo filho, o pai insere em uma lista ligada o novo processo */ int status; pid_t pidfg; PROCESS * p; diff --git a/parser.c b/parser.c index 4e85090..1015c50 100755 --- a/parser.c +++ b/parser.c @@ -76,7 +76,7 @@ void parse(char * cmdLine, COMMAND * cmd) { cmd->output_r_filename = strtok_r(NULL, " ", &saveptr); } else { - cmd->args[i] = malloc(strlen(cmds)); + cmd->args[i] = malloc((strlen(cmds)+1)*sizeof(char)); strcpy(cmd->args[i], cmds); } cmds = strtok_r(NULL, " ", &saveptr); From c2069a0d8a5c7fdd82d9149c6fbbfcaebd175cf4 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Mon, 14 Nov 2011 19:24:16 -0800 Subject: [PATCH 17/30] =?UTF-8?q?Algumas=20vari=C3=A1veis=20in=C3=BAteis?= =?UTF-8?q?=20removidas.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builtin.c | 3 ++- list.c | 29 ++++++++++++++++++----------- main.c | 7 +++---- parser.c | 50 ++++++++++++++++++++++++++++++-------------------- 4 files changed, 53 insertions(+), 36 deletions(-) diff --git a/builtin.c b/builtin.c index ff94475..7095a4f 100755 --- a/builtin.c +++ b/builtin.c @@ -2,7 +2,8 @@ #include #include #include -#include +#include +#include #include "main.h" #include "builtin.h" #include "parser.h" diff --git a/list.c b/list.c index 5e946d8..ae461e7 100755 --- a/list.c +++ b/list.c @@ -9,7 +9,8 @@ void ListCreate(LIST *list) list->last = NULL; } -void initCommand(COMMAND *cmd) { +void initCommand(COMMAND *cmd) +{ cmd->isBackground = 0; cmd->input_r = 0; cmd->output_r = 0; @@ -86,7 +87,6 @@ int ListRemoveByPid(LIST *list, pid_t pid) { if (!ListIsEmpty(list)) { - int i; NODE *aux = list->first; while(aux->proc->pid != pid) @@ -116,7 +116,8 @@ int ListRemoveByPid(LIST *list, pid_t pid) pid_t ListLastStoppedToBg(LIST *list) { - if(!ListIsEmpty(list)) { + if(!ListIsEmpty(list)) + { NODE *aux = list->last; while (aux != NULL) { @@ -134,7 +135,8 @@ pid_t ListLastStoppedToBg(LIST *list) pid_t ListToBg(LIST *list, pid_t pid) { - if(!ListIsEmpty(list)) { + if(!ListIsEmpty(list)) + { NODE *aux = list->last; while (aux != NULL) { @@ -152,7 +154,8 @@ pid_t ListToBg(LIST *list, pid_t pid) pid_t ListLastToFg(LIST *list) { - if(!ListIsEmpty(list)) { + if(!ListIsEmpty(list)) + { NODE *aux = list->last; if (aux != NULL) { @@ -167,7 +170,8 @@ pid_t ListLastToFg(LIST *list) pid_t ListToFg(LIST *list, pid_t pid) { - if(!ListIsEmpty(list)) { + if(!ListIsEmpty(list)) + { NODE *aux = list->last; while (aux != NULL) { @@ -183,16 +187,19 @@ pid_t ListToFg(LIST *list, pid_t pid) return -1; } -void ListPurgeCmds(LIST *list) { - if(!ListIsEmpty(list)) { +void ListPurgeCmds(LIST *list) +{ + if(!ListIsEmpty(list)) + { NODE *aux = list->first; - while(aux != NULL) { + while(aux != NULL) + { int i; for(i = 0; i < aux->cmd->size; i++); - free(aux->cmd->args[i]); + free(aux->cmd->args[i]); free(aux->cmd->args); free(aux->cmd); - aux = aux->next; + aux = aux->next; } ListCreate(list); } diff --git a/main.c b/main.c index 804edbe..b0961ee 100755 --- a/main.c +++ b/main.c @@ -1,7 +1,7 @@ +#define _GNU_SOURCE #include #include #include -#include #include #include #include @@ -31,7 +31,8 @@ void termination_handler (int signum) NODE *aux = childs->first; while(aux != NULL) { - if (!aux->proc->isBackground) { + if (!aux->proc->isBackground) + { kill(-aux->proc->pid, signum); break; } @@ -216,8 +217,6 @@ int main (int argc, char **argv) { if(aux->cmd->isBackground == 0) count++; setpgid(aux->cmd->pid, cmdList->first->cmd->pid); - int status; - pid_t pidfg; PROCESS * p; p = malloc(sizeof(PROCESS)); p->pid = aux->cmd->pid; diff --git a/parser.c b/parser.c index 1015c50..7834873 100755 --- a/parser.c +++ b/parser.c @@ -5,13 +5,14 @@ #include "parser.h" #include "main.h" -void imprimir_argv(char ** matriz, int tamanho){ - int i = 0; - for(i = 0; i <= tamanho; i++){ - printf("%s ", matriz[i]); - } - +void imprimir_argv(char ** matriz, int tamanho) +{ + int i = 0; + for(i = 0; i <= tamanho; i++) + { + printf("%s ", matriz[i]); } +} int word_count(char * source) { @@ -30,13 +31,13 @@ int word_count(char * source) return words; } -void getCmds(LIST *cmdList, char *cmdLine) { +void getCmds(LIST *cmdList, char *cmdLine) +{ char *cmds; char * saveptr; - int i; - int pos = 0; cmds = strtok_r(cmdLine, "|", &saveptr); - while(cmds != NULL) { + while(cmds != NULL) + { COMMAND * cmd = malloc(sizeof(COMMAND)); initCommand(cmd); parse(cmds, cmd); @@ -46,7 +47,8 @@ void getCmds(LIST *cmdList, char *cmdLine) { } -void parse(char * cmdLine, COMMAND * cmd) { +void parse(char * cmdLine, COMMAND * cmd) +{ cmd_len = word_count(cmdLine); char * cmds; int i; @@ -54,32 +56,38 @@ void parse(char * cmdLine, COMMAND * cmd) { cmd->args = (char**)malloc((cmd_len+1)*sizeof(char*)); cmds = strtok_r(cmdLine, " ", &saveptr); - for(i = 0; cmds != NULL; i++) { - if((strcmp("&", cmds) == 0)) { + for(i = 0; cmds != NULL; i++) + { + if((strcmp("&", cmds) == 0)) + { cmd->isBackground = 1; cmd_len--; } - else if((strcmp("<", cmds) == 0)) { + else if((strcmp("<", cmds) == 0)) + { cmd->input_r = 1; cmd_len--; cmd->input_r_filename = strtok_r(NULL, " ", &saveptr); } - else if((strcmp(">", cmds) == 0)) { + else if((strcmp(">", cmds) == 0)) + { cmd->output_r = 1; cmd_len--; cmd->output_r_filename = strtok_r(NULL, " ", &saveptr); } - else if((strcmp(">>", cmds) == 0)) { + else if((strcmp(">>", cmds) == 0)) + { cmd->output_r_append = 1; cmd->output_r = 1; cmd_len--; cmd->output_r_filename = strtok_r(NULL, " ", &saveptr); } - else { + else + { cmd->args[i] = malloc((strlen(cmds)+1)*sizeof(char)); strcpy(cmd->args[i], cmds); } - cmds = strtok_r(NULL, " ", &saveptr); + cmds = strtok_r(NULL, " ", &saveptr); } cmd->args[cmd_len] = (char *)0; @@ -87,7 +95,8 @@ void parse(char * cmdLine, COMMAND * cmd) { //imprimir_argv(parsed, words); } -void free_parse() { +void free_parse() +{ int i; for(i = 0; parsed[i] != NULL; i++) free(parsed[i]); free(parsed); @@ -101,7 +110,8 @@ char* readline() c = getchar(); while (c != '\n') { - if((c > 31) && (c < 172)) { + if((c > 31) && (c < 172)) + { input[i] = c; i++; } From 710f7d5f4c1afea3dc90032a5589399077fb1ea8 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Mon, 14 Nov 2011 19:47:13 -0800 Subject: [PATCH 18/30] Pipe melhorado. --- main.c | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/main.c b/main.c index b0961ee..12c6213 100755 --- a/main.c +++ b/main.c @@ -75,9 +75,7 @@ int main (int argc, char **argv) sigaddset(&chldMask, SIGCHLD); char * cmdLine; LIST * cmdList; - size_t len = 256; struct sigaction new_action, old_action; - /* Inicializa a lista que guarda os processos que rodam em background */ childs = malloc(sizeof(LIST)); ListCreate(childs); @@ -120,10 +118,9 @@ int main (int argc, char **argv) history = malloc(sizeof(struct node)); history->cmd = NULL; history->next = NULL; - /* Pega o nome do usuario atual e da máquina */ username = getlogin(); - gethostname(hostname, len); + gethostname(hostname, 256); asprintf(&userdir, "/home/%s", username); /* Coloca o diretório do usuário como diretório inicial */ chdir(userdir); @@ -140,7 +137,6 @@ int main (int argc, char **argv) NODE *aux = cmdList->first; while (aux != NULL) { - //if (aux->prev != NULL || aux->next != NULL) aux->cmd->isBackground = 1; aux->cmd->id = isBuiltIn(aux->cmd->args[0]); if(aux->cmd->id >= 0) callBuiltIn(aux->cmd->id, aux->cmd->args); else @@ -150,30 +146,23 @@ int main (int argc, char **argv) aux->cmd->pid = fork(); if(aux->cmd->pid == 0) { - //sleep(60); if(aux->prev != NULL || aux->next != NULL) { if(aux->prev == NULL) - { dup2(aux->cmd->pipe[1], 1); - close(aux->cmd->pipe[0]); - //close(aux->next->cmd->pipe[0]); - //close(aux->next->cmd->pipe[1]); - } else if(aux->next == NULL) - { - //dup2(aux->cmd->pipe[0], 0); dup2(aux->prev->cmd->pipe[0], 0); - close(aux->prev->cmd->pipe[1]); - //close(aux->prev->prev->cmd->pipe[0]); - //close(aux->prev->prev->cmd->pipe[1]); - } else { dup2(aux->prev->cmd->pipe[0], 0); dup2(aux->cmd->pipe[1], 1); - close(aux->prev->cmd->pipe[1]); - close(aux->cmd->pipe[0]); + } + NODE * aux2 = cmdList->first; + while(aux2->next != NULL) + { + close(aux2->cmd->pipe[0]); + close(aux2->cmd->pipe[1]); + aux2 = aux2->next; } } if(aux->cmd->output_r) @@ -226,11 +215,6 @@ int main (int argc, char **argv) sigprocmask(SIG_BLOCK, &chldMask, NULL); ListInsert(childs, p, NULL); sigprocmask(SIG_UNBLOCK, &chldMask, NULL); - /*E espera ele terminar, caso seja um processo de foreground */ - //if(!p->isBackground) - //{ - - //printPrompt(username, hostname); } aux = aux->next; } @@ -243,8 +227,6 @@ int main (int argc, char **argv) if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, pidfg); } sigprocmask(SIG_UNBLOCK, &chldMask, NULL); - - //} } ListPurgeCmds(cmdList); free(cmdLine); @@ -254,3 +236,4 @@ int main (int argc, char **argv) + From 7a8d5413aa958d9854e47e868a86eb7eda6fe21e Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Tue, 15 Nov 2011 09:38:33 -0800 Subject: [PATCH 19/30] Parser melhorado. --- parser.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/parser.c b/parser.c index 7834873..f89430a 100755 --- a/parser.c +++ b/parser.c @@ -50,48 +50,48 @@ void getCmds(LIST *cmdList, char *cmdLine) void parse(char * cmdLine, COMMAND * cmd) { cmd_len = word_count(cmdLine); + int before = cmd_len; char * cmds; - int i; + int j, i = 0; char *saveptr; cmd->args = (char**)malloc((cmd_len+1)*sizeof(char*)); cmds = strtok_r(cmdLine, " ", &saveptr); - - for(i = 0; cmds != NULL; i++) + while(cmds != NULL) { if((strcmp("&", cmds) == 0)) { cmd->isBackground = 1; - cmd_len--; } else if((strcmp("<", cmds) == 0)) { cmd->input_r = 1; - cmd_len--; cmd->input_r_filename = strtok_r(NULL, " ", &saveptr); } else if((strcmp(">", cmds) == 0)) { cmd->output_r = 1; - cmd_len--; cmd->output_r_filename = strtok_r(NULL, " ", &saveptr); } else if((strcmp(">>", cmds) == 0)) { cmd->output_r_append = 1; cmd->output_r = 1; - cmd_len--; cmd->output_r_filename = strtok_r(NULL, " ", &saveptr); } else { cmd->args[i] = malloc((strlen(cmds)+1)*sizeof(char)); strcpy(cmd->args[i], cmds); + i++; } cmds = strtok_r(NULL, " ", &saveptr); } - cmd->args[cmd_len] = (char *)0; - cmd->size = cmd_len; + cmd->args[i] = (char *)0; + for(j = i+1; j <= cmd_len ; j++) + free(cmd->args[j]); + + cmd->size = i; //imprimir_argv(parsed, words); } From b34f6e8ab212993e32d2d07bf301df10919c5b21 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Tue, 15 Nov 2011 10:37:22 -0800 Subject: [PATCH 20/30] =?UTF-8?q?Pequenos=20melhoramentos=20no=20gerenciam?= =?UTF-8?q?ento=20da=20mem=C3=B3ria.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builtin.c | 2 ++ list.c | 2 +- main.c | 3 +-- main.h | 3 +++ parser.c | 6 +++--- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/builtin.c b/builtin.c index 7095a4f..df2b111 100755 --- a/builtin.c +++ b/builtin.c @@ -32,6 +32,8 @@ void callBuiltIn(int cmd_id, char ** arg) pwd(); break; case 3: + ListPurgeCmds(cmdList); + free(cmdLine); exit(0); break; case 4: diff --git a/list.c b/list.c index ae461e7..8b4d7e4 100755 --- a/list.c +++ b/list.c @@ -196,7 +196,7 @@ void ListPurgeCmds(LIST *list) { int i; for(i = 0; i < aux->cmd->size; i++); - free(aux->cmd->args[i]); + free(aux->cmd->args[i]); free(aux->cmd->args); free(aux->cmd); aux = aux->next; diff --git a/main.c b/main.c index 12c6213..77970a3 100755 --- a/main.c +++ b/main.c @@ -73,8 +73,7 @@ int main (int argc, char **argv) sigset_t chldMask; sigemptyset (&chldMask); sigaddset(&chldMask, SIGCHLD); - char * cmdLine; - LIST * cmdList; + struct sigaction new_action, old_action; /* Inicializa a lista que guarda os processos que rodam em background */ childs = malloc(sizeof(LIST)); diff --git a/main.h b/main.h index b8c769b..e8f5fd7 100755 --- a/main.h +++ b/main.h @@ -1,5 +1,6 @@ #ifndef _MAIN_H_ #define _MAIN_H_ +#include "list.h" char * userdir; int output_r; @@ -15,5 +16,7 @@ int isBackground; int child_handler_lock; char * username; char hostname[256]; +char * cmdLine; +LIST * cmdList; #endif diff --git a/parser.c b/parser.c index f89430a..8412575 100755 --- a/parser.c +++ b/parser.c @@ -52,7 +52,8 @@ void parse(char * cmdLine, COMMAND * cmd) cmd_len = word_count(cmdLine); int before = cmd_len; char * cmds; - int j, i = 0; + int j, i; + j = i = 0; char *saveptr; cmd->args = (char**)malloc((cmd_len+1)*sizeof(char*)); cmds = strtok_r(cmdLine, " ", &saveptr); @@ -88,8 +89,7 @@ void parse(char * cmdLine, COMMAND * cmd) } cmd->args[i] = (char *)0; - for(j = i+1; j <= cmd_len ; j++) - free(cmd->args[j]); + cmd->args = (char**)realloc(cmd->args, (i+1)*sizeof(char*)); cmd->size = i; //imprimir_argv(parsed, words); From 15870492ddbef28caa2a312da1c43c3d31d6c935 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Tue, 15 Nov 2011 15:36:24 -0800 Subject: [PATCH 21/30] =?UTF-8?q?Mais=20otimiza=C3=A7=C3=A3o=20de=20mem?= =?UTF-8?q?=C3=B3ria.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builtin.c | 13 ++++++++++++- builtin.h | 1 + list.c | 2 +- list.h | 43 +++++++++++++++++++++++++++++++++++++++++++ main.c | 10 +++++++++- main.h | 2 ++ 6 files changed, 68 insertions(+), 3 deletions(-) diff --git a/builtin.c b/builtin.c index df2b111..a5859cc 100755 --- a/builtin.c +++ b/builtin.c @@ -34,6 +34,7 @@ void callBuiltIn(int cmd_id, char ** arg) case 3: ListPurgeCmds(cmdList); free(cmdLine); + free_memory(); exit(0); break; case 4: @@ -85,7 +86,7 @@ void add_history(char * cmd) void print_history(char * arg) { - int n = 9999; + int n = 10; char * end; if (arg != NULL) n = strtol(arg, &end, 10); struct node *tmp = history; @@ -99,6 +100,16 @@ void print_history(char * arg) } } +void free_history() { + struct node *tmp = history; + while(tmp != NULL) + { + free(tmp->cmd); + tmp = tmp->next; + } + free(history); +} + void cd(char * arg) { int error; diff --git a/builtin.h b/builtin.h index 9126954..ff1bf4e 100755 --- a/builtin.h +++ b/builtin.h @@ -14,6 +14,7 @@ int isBuiltIn(char * cmd); void callBuiltIn(int cmd_id, char ** arg); void add_history(char * cmd); void print_history(char * arg); +void free_history(); void cd(char * arg); void pwd(); void jobs(); diff --git a/list.c b/list.c index 8b4d7e4..52ed487 100755 --- a/list.c +++ b/list.c @@ -195,7 +195,7 @@ void ListPurgeCmds(LIST *list) while(aux != NULL) { int i; - for(i = 0; i < aux->cmd->size; i++); + for(i = 0; i < aux->cmd->size; i++) free(aux->cmd->args[i]); free(aux->cmd->args); free(aux->cmd); diff --git a/list.h b/list.h index b713f94..895d4be 100755 --- a/list.h +++ b/list.h @@ -37,10 +37,53 @@ typedef struct NODE *last; } LIST; + +/** @brief Inicializa a lista para uso posterior. +* @param list - Ponteiro para lista a ser inicializada. +* @return Void. +*/ void ListCreate(LIST *list); +/** @brief Inicializa um comando (estrutura) para +* uso posterior. +* @param list - Ponteiro para comando (estrutura) +* a ser inicializada. +* @return Void. +*/ void initCommand(COMMAND *cmd); +/** @brief Verifica se uma lista está vazia. +* @param list - Ponteiro para a lista. +* @return Se a lista está vazia +* Caso contrário. +* @retval 1 - Sim. +* @retval 0 - Não. +*/ int ListIsEmpty(LIST *list); +/** @brief Insere um processo e/ou um comando na lista. +* Na prática, deve ser usada uma lista para +* comandos e outra para processos. +* Elas só estão na mesma estrutura para evitar +* repetição de código. +* Caso esteja inserindo em uma lista de processos, +* o argumento cmd deve ser NULL. +* Caso esteja inserindo em uma lista de comandos, +* o argumento proc deve ser NULL. +* @param list - Ponteiro para a lista. +* @param proc - Ponteiro para processo (estrutura). +* @param cmd - Ponteiro para comando (estrutura). +* @return Se foi possível inserir +* @retval 1 - Sim. +* @retval 0 - Não. +*/ int ListInsert(LIST *list, PROCESS *proc, COMMAND *cmd); +/** @brief Retorna um processo (estrutura) pelo seu id. +* @param list - Ponteiro para a lista. +* @param pid - Id do processo a ser procurado. +* @param proc - Ponteiro que apontará para lista +* @return Se a lista está vazia +* Caso contrário. +* @retval 1 - Sim. +* @retval 0 - Não. +*/ int ListGetByPid(LIST *list, pid_t pid, PROCESS *proc); int ListStopRunningProcessByPid(LIST *list,pid_t pid); int ListRemoveByPid(LIST *list, pid_t pid); diff --git a/main.c b/main.c index 77970a3..71e6ba3 100755 --- a/main.c +++ b/main.c @@ -65,9 +65,15 @@ void sigtstop_handler(int signum) printPrompt(username, hostname); } +void free_memory() { + free(childs); + free(cmdList); + free_history(); + +} + int main (int argc, char **argv) { - int fd_in; int fd_out; sigset_t chldMask; @@ -230,6 +236,8 @@ int main (int argc, char **argv) ListPurgeCmds(cmdList); free(cmdLine); } + free_history(); + return 0; } diff --git a/main.h b/main.h index e8f5fd7..d2b0727 100755 --- a/main.h +++ b/main.h @@ -19,4 +19,6 @@ char hostname[256]; char * cmdLine; LIST * cmdList; +void free_memory(); + #endif From acc3c59fa3abb35261a08b65a3005bae627b60ad Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Tue, 15 Nov 2011 17:09:39 -0800 Subject: [PATCH 22/30] =?UTF-8?q?C=C3=B3digo=20mais=20modularizado=20e=20m?= =?UTF-8?q?elhoramentos=20em=20fg,=20bg,=20e=20ctrl+z=20(stop).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builtin.c | 54 +++++++++++++++++++-------------- list.c | 91 ++++++++++--------------------------------------------- list.h | 12 +++----- main.c | 12 +++----- parser.c | 5 +-- 5 files changed, 59 insertions(+), 115 deletions(-) diff --git a/builtin.c b/builtin.c index a5859cc..64a4a6c 100755 --- a/builtin.c +++ b/builtin.c @@ -100,7 +100,8 @@ void print_history(char * arg) } } -void free_history() { +void free_history() +{ struct node *tmp = history; while(tmp != NULL) { @@ -141,43 +142,52 @@ void bg(char * arg) { if(!ListIsEmpty(childs)) { - char * end; int n; - pid_t pid; + PROCESS *process; if(arg == NULL) - pid = ListLastStoppedToBg(childs); + process = ListGetLastStopped(childs); else { - n = strtol(arg, &end, 10); - pid = ListToBg(childs, n); + n = strtol(arg, NULL, 10); + process = ListGetProcess(childs, n); } - kill(pid, SIGCONT); + if (process) + if(kill(process->pid, SIGCONT) == 0) + { + process->isBackground = 1; + strcpy(process->status, "Running"); + } } } void fg(char * arg) { + int n; + pid_t pidfg; + int status; + sigset_t chldMask; + sigemptyset (&chldMask); + sigaddset(&chldMask, SIGCHLD); + PROCESS * process; if(!ListIsEmpty(childs)) { - char * end; - int n; - pid_t pid, pidfg; - int status; - sigset_t chldMask; - sigemptyset (&chldMask); - sigaddset(&chldMask, SIGCHLD); if(arg == NULL) - pid = ListLastToFg(childs); + process = childs->first->proc; else { - n = strtol(arg, &end, 10); - pid = ListToFg(childs, n); + n = strtol(arg, NULL, 10); + process = ListGetProcess(childs, n); } - kill(pid, SIGCONT); - sigprocmask(SIG_BLOCK, &chldMask, NULL); - pidfg = waitpid(pid, &status, WUNTRACED); - if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, childPid); - sigprocmask(SIG_UNBLOCK, &chldMask, NULL); + if(process) + if(kill(process->pid, SIGCONT) == 0) { + printf("entrou aqui. pid - %d\n", process->pid); + process->isBackground = 0; + strcpy(process->status, "Running"); + sigprocmask(SIG_BLOCK, &chldMask, NULL); + pidfg = waitpid(process->pid, &status, WUNTRACED); + if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, pidfg); + sigprocmask(SIG_UNBLOCK, &chldMask, NULL); + } } } diff --git a/list.c b/list.c index 52ed487..550bfd3 100755 --- a/list.c +++ b/list.c @@ -51,38 +51,6 @@ int ListInsert(LIST *list, PROCESS *proc, COMMAND *cmd) return 0; } -int ListGetByPid(LIST *list, pid_t pid, PROCESS *proc) -{ - NODE *aux = list->first; - while (aux != NULL) - { - if (aux->proc->pid == pid) - { - proc = aux->proc; - return 1; - } - aux = aux->next; - } - - return 0; -} - -int ListStopRunningProcessByPid(LIST *list, pid_t pid) -{ - NODE *aux = list->first; - while (aux != NULL) - { - if((strcmp(aux->proc->status, "Running") == 0) && aux->proc->pid == pid) - { - strcpy(aux->proc->status, "Stopped"); - return 1; - } - aux = aux->next; - } - return 0; -} - - int ListRemoveByPid(LIST *list, pid_t pid) { if (!ListIsEmpty(list)) @@ -114,61 +82,34 @@ int ListRemoveByPid(LIST *list, pid_t pid) return 0; } -pid_t ListLastStoppedToBg(LIST *list) +PROCESS *ListGetCurrentProcess(LIST *list) { - if(!ListIsEmpty(list)) + NODE *aux = list->first; + while (aux != NULL) { - NODE *aux = list->last; - while (aux != NULL) - { - if(strcmp(aux->proc->status, "Stopped") == 0) - { - aux->proc->isBackground = 1; - strcpy(aux->proc->status, "Running"); - return aux->proc->pid; - } - aux = aux->prev; - } + if((strcmp(aux->proc->status, "Running") == 0) && !aux->proc->isBackground) + return aux->proc; + aux = aux->next; } - return -1; + return NULL; } -pid_t ListToBg(LIST *list, pid_t pid) +PROCESS * ListGetLastStopped(LIST *list) { if(!ListIsEmpty(list)) { NODE *aux = list->last; while (aux != NULL) { - if(aux->proc->pid == pid) - { - aux->proc->isBackground = 1; - strcpy(aux->proc->status, "Running"); - return aux->proc->pid; - } + if(strcmp(aux->proc->status, "Stopped") == 0) + return aux->proc; aux = aux->prev; } } - return -1; -} - -pid_t ListLastToFg(LIST *list) -{ - if(!ListIsEmpty(list)) - { - NODE *aux = list->last; - if (aux != NULL) - { - aux->proc->isBackground = 0; - strcpy(aux->proc->status, "Running"); - return aux->proc->pid; - } - aux = aux->prev; - } - return -1; + return NULL; } -pid_t ListToFg(LIST *list, pid_t pid) +PROCESS * ListGetProcess(LIST *list, pid_t pid) { if(!ListIsEmpty(list)) { @@ -177,14 +118,14 @@ pid_t ListToFg(LIST *list, pid_t pid) { if(aux->proc->pid == pid) { - aux->proc->isBackground = 0; - strcpy(aux->proc->status, "Running"); - return aux->proc->pid; + //aux->proc->isBackground = 1; + //strcpy(aux->proc->status, "Running"); + return aux->proc; } aux = aux->prev; } } - return -1; + return NULL; } void ListPurgeCmds(LIST *list) diff --git a/list.h b/list.h index 895d4be..e757129 100755 --- a/list.h +++ b/list.h @@ -75,6 +75,10 @@ int ListIsEmpty(LIST *list); * @retval 0 - Não. */ int ListInsert(LIST *list, PROCESS *proc, COMMAND *cmd); +int ListRemoveByPid(LIST *list, pid_t pid); +PROCESS *ListGetCurrentProcess(LIST *list); + +PROCESS * ListGetLastStopped(LIST *list); /** @brief Retorna um processo (estrutura) pelo seu id. * @param list - Ponteiro para a lista. * @param pid - Id do processo a ser procurado. @@ -84,13 +88,7 @@ int ListInsert(LIST *list, PROCESS *proc, COMMAND *cmd); * @retval 1 - Sim. * @retval 0 - Não. */ -int ListGetByPid(LIST *list, pid_t pid, PROCESS *proc); -int ListStopRunningProcessByPid(LIST *list,pid_t pid); -int ListRemoveByPid(LIST *list, pid_t pid); -pid_t ListLastStoppedToBg(LIST *list); -pid_t ListToBg(LIST *list, pid_t n); -pid_t ListLastToFg(LIST *list); -pid_t ListToFg(LIST *list, pid_t n); +PROCESS * ListGetProcess(LIST *list, pid_t n); void ListPurgeCmds(LIST *list); LIST * childs; #endif diff --git a/main.c b/main.c index 71e6ba3..436c594 100755 --- a/main.c +++ b/main.c @@ -51,15 +51,13 @@ void child_handler(int signum) void sigtstop_handler(int signum) { printf("\n"); + PROCESS * process; if(!ListIsEmpty(childs)) { - if (childs->last->proc->pid >= 0) - { - ListStopRunningProcessByPid(childs, childs->last->proc->pid); - kill(childs->last->proc->pid, SIGSTOP); - } - else printPrompt(username, hostname); - + process = ListGetCurrentProcess(childs); + if(process) + if(kill(process->pid, SIGSTOP) == 0) + strcpy(process->status, "Stopped"); } else printPrompt(username, hostname); diff --git a/parser.c b/parser.c index 8412575..4eae7d7 100755 --- a/parser.c +++ b/parser.c @@ -52,8 +52,7 @@ void parse(char * cmdLine, COMMAND * cmd) cmd_len = word_count(cmdLine); int before = cmd_len; char * cmds; - int j, i; - j = i = 0; + int i = 0; char *saveptr; cmd->args = (char**)malloc((cmd_len+1)*sizeof(char*)); cmds = strtok_r(cmdLine, " ", &saveptr); @@ -90,9 +89,7 @@ void parse(char * cmdLine, COMMAND * cmd) } cmd->args[i] = (char *)0; cmd->args = (char**)realloc(cmd->args, (i+1)*sizeof(char*)); - cmd->size = i; - //imprimir_argv(parsed, words); } void free_parse() From d4b583634d592b67796c93e8a0ea61831edfba40 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Tue, 15 Nov 2011 18:36:43 -0800 Subject: [PATCH 23/30] =?UTF-8?q?Mais=20melhoras=20na=20modulariza=C3=A7?= =?UTF-8?q?=C3=A3o=20e=20remo=C3=A7=C3=A3o=20de=20algumas=20vari=C3=A1veis?= =?UTF-8?q?=20n=C3=A3o=20utilizadas.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builtin.c | 33 ++++++------ builtin.h | 12 +---- list.h | 9 +++- main.c | 150 +++++++++++++++++++++++++----------------------------- main.h | 24 ++++----- parser.c | 13 ++--- parser.h | 3 -- 7 files changed, 109 insertions(+), 135 deletions(-) diff --git a/builtin.c b/builtin.c index 64a4a6c..667f730 100755 --- a/builtin.c +++ b/builtin.c @@ -18,15 +18,15 @@ int isBuiltIn(char * cmd) return -1; } -void callBuiltIn(int cmd_id, char ** arg) +void callBuiltIn(int cmd_id, COMMAND *cmd) { switch(cmd_id) { case 0: - cd(arg[1]); + cd(cmd->args[1]); break; case 1: - print_history(arg[1]); + print_history(cmd->args[1]); break; case 2: pwd(); @@ -41,16 +41,16 @@ void callBuiltIn(int cmd_id, char ** arg) jobs(); break; case 5: - bg(arg[1]); + bg(cmd->args[1]); break; case 6: - fg(arg[1]); + fg(cmd->args[1]); break; case 7: - kill_cmd(arg[1]); + kill_cmd(cmd->args[1]); break; case 8: - echo(arg); + echo(cmd); break; case 9: printf("Shell para trabalho de SSC0141.\nDesenvolvido por Lucas Lobosque e Leandro Pozer.\n"); @@ -62,8 +62,8 @@ void callBuiltIn(int cmd_id, char ** arg) void add_history(char * cmd) { - struct node *tmp = history->next; - struct node *prev = history; + HISTORY *tmp = history->next; + HISTORY *prev = history; if(history->cmd == NULL) { history->cmd = malloc((strlen(cmd) + 1)*sizeof(char)); @@ -76,7 +76,7 @@ void add_history(char * cmd) prev = tmp; tmp = tmp->next; } - tmp = malloc(sizeof(struct node)); + tmp = malloc(sizeof(HISTORY)); tmp->cmd = malloc((strlen(cmd) + 1)*sizeof(char)); tmp->next = NULL; strcpy(tmp->cmd, cmd); @@ -89,7 +89,7 @@ void print_history(char * arg) int n = 10; char * end; if (arg != NULL) n = strtol(arg, &end, 10); - struct node *tmp = history; + HISTORY *tmp = history; int i = 1; printf("%d %s\n", i, tmp->cmd); while(tmp->next != NULL && (i < n)) @@ -102,7 +102,7 @@ void print_history(char * arg) void free_history() { - struct node *tmp = history; + HISTORY *tmp = history; while(tmp != NULL) { free(tmp->cmd); @@ -180,7 +180,6 @@ void fg(char * arg) } if(process) if(kill(process->pid, SIGCONT) == 0) { - printf("entrou aqui. pid - %d\n", process->pid); process->isBackground = 0; strcpy(process->status, "Running"); sigprocmask(SIG_BLOCK, &chldMask, NULL); @@ -205,12 +204,12 @@ void kill_cmd(char * arg) } } -void echo(char ** cmds) +void echo(COMMAND *cmd) { int i; - for(i = 1; i < cmd_len; i++) + for(i = 1; i < cmd->size; i++) { - printf("%s ", cmds[i]); + printf("%s ", cmd->args[i]); } - if (cmd_len > 1) printf("\n"); + if (cmd->size > 1) printf("\n"); } diff --git a/builtin.h b/builtin.h index ff1bf4e..11aa52a 100755 --- a/builtin.h +++ b/builtin.h @@ -1,17 +1,9 @@ #ifndef _BUILTIN_H_ #define _BUILTIN_H_ -struct node -{ - char * cmd; - struct node *next; -}; -struct node *history; - -pid_t childPid; int isBuiltIn(char * cmd); -void callBuiltIn(int cmd_id, char ** arg); +void callBuiltIn(int cmd_id, COMMAND *cmd); void add_history(char * cmd); void print_history(char * arg); void free_history(); @@ -21,6 +13,6 @@ void jobs(); void bg(char * arg); void fg(char * arg); void kill_cmd(char * arg); -void echo (char ** cmds); +void echo (COMMAND *cmd); #endif diff --git a/list.h b/list.h index e757129..7351d6d 100755 --- a/list.h +++ b/list.h @@ -1,5 +1,12 @@ #ifndef _LISTA_H_ #define _LISTA_H_ + +typedef struct history +{ + char * cmd; + struct history *next; +} HISTORY; + typedef struct { pid_t pid; @@ -90,5 +97,5 @@ PROCESS * ListGetLastStopped(LIST *list); */ PROCESS * ListGetProcess(LIST *list, pid_t n); void ListPurgeCmds(LIST *list); -LIST * childs; + #endif diff --git a/main.c b/main.c index 436c594..feb02b3 100755 --- a/main.c +++ b/main.c @@ -11,87 +11,21 @@ #include "builtin.h" #include "list.h" -void printPrompt(char* username, char* hostname) -{ - char path[256]; - getcwd(path, 256); - if(strcmp(path, userdir) == 0) - printf("%s@%s:~$ ", username, hostname); - else if(strstr(path, userdir)) - printf("%s@%s:~%s$ ", username, hostname, path + strlen(userdir)); - else - printf("%s@%s:%s$ ", username, hostname, path); - -} - - -void termination_handler (int signum) -{ - printf("\n"); - NODE *aux = childs->first; - while(aux != NULL) - { - if (!aux->proc->isBackground) - { - kill(-aux->proc->pid, signum); - break; - } - aux = aux->next; - } -} - -void child_handler(int signum) -{ - int status; - pid_t pid; - pid = waitpid(-1, &status, WNOHANG|WUNTRACED); - if((pid >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, pid); -} - -void sigtstop_handler(int signum) -{ - printf("\n"); - PROCESS * process; - if(!ListIsEmpty(childs)) - { - process = ListGetCurrentProcess(childs); - if(process) - if(kill(process->pid, SIGSTOP) == 0) - strcpy(process->status, "Stopped"); - } - else - printPrompt(username, hostname); -} - -void free_memory() { - free(childs); - free(cmdList); - free_history(); - -} - int main (int argc, char **argv) { int fd_in; int fd_out; + sigset_t chldMask; sigemptyset (&chldMask); sigaddset(&chldMask, SIGCHLD); struct sigaction new_action, old_action; - /* Inicializa a lista que guarda os processos que rodam em background */ - childs = malloc(sizeof(LIST)); - ListCreate(childs); - cmdList = malloc(sizeof(LIST)); - ListCreate(cmdList); - /* Inicializa a variável que guarda o ID do processo atual do foreground */ - fgChildPid = 0; - child_handler_lock = 0; - /* Set up the structure to specify the new action. */ + + /* Setup dos sinais utilizados */ new_action.sa_handler = termination_handler; sigemptyset (&new_action.sa_mask); new_action.sa_flags = 0; - sigaction (SIGINT, NULL, &old_action); if (old_action.sa_handler != SIG_IGN) sigaction (SIGINT, &new_action, NULL); @@ -105,7 +39,6 @@ int main (int argc, char **argv) new_action.sa_handler = child_handler; sigemptyset (&new_action.sa_mask); new_action.sa_flags = 0; - sigaction (SIGCHLD, NULL, &old_action); if (old_action.sa_handler != SIG_IGN) sigaction (SIGCHLD, &new_action, NULL); @@ -113,12 +46,17 @@ int main (int argc, char **argv) new_action.sa_handler = sigtstop_handler; sigemptyset (&new_action.sa_mask); new_action.sa_flags = 0; - sigaction (SIGTSTP, NULL, &old_action); if (old_action.sa_handler != SIG_IGN) sigaction (SIGTSTP, &new_action, NULL); - /*inicializa lista que guarda o historico de comandos */ - history = malloc(sizeof(struct node)); + + /*Setup das listas utilizadas */ + childs = malloc(sizeof(LIST)); + ListCreate(childs); + cmdList = malloc(sizeof(LIST)); + ListCreate(cmdList); + + history = malloc(sizeof(HISTORY)); history->cmd = NULL; history->next = NULL; /* Pega o nome do usuario atual e da máquina */ @@ -127,11 +65,10 @@ int main (int argc, char **argv) asprintf(&userdir, "/home/%s", username); /* Coloca o diretório do usuário como diretório inicial */ chdir(userdir); + /*Loop Principal */ while (1) { printPrompt(username, hostname); - output_r = input_r = 0; - //if (tcflush(ttyDevice, TCIFLUSH) == 0) cmdLine = readline(); if(strcmp(cmdLine, "") != 0) { @@ -141,11 +78,11 @@ int main (int argc, char **argv) while (aux != NULL) { aux->cmd->id = isBuiltIn(aux->cmd->args[0]); - if(aux->cmd->id >= 0) callBuiltIn(aux->cmd->id, aux->cmd->args); + if(aux->cmd->id >= 0) callBuiltIn(aux->cmd->id, aux->cmd); else { if(aux->next != NULL) - pipe2(aux->cmd->pipe, O_CLOEXEC ); + pipe2(aux->cmd->pipe, O_CLOEXEC); aux->cmd->pid = fork(); if(aux->cmd->pid == 0) { @@ -161,7 +98,7 @@ int main (int argc, char **argv) dup2(aux->cmd->pipe[1], 1); } NODE * aux2 = cmdList->first; - while(aux2->next != NULL) + while(aux2->next != NULL) // Fecha o pipe { close(aux2->cmd->pipe[0]); close(aux2->cmd->pipe[1]); @@ -181,7 +118,7 @@ int main (int argc, char **argv) fd_in = open(aux->cmd->input_r_filename, O_RDONLY, 0666); dup2(fd_in, 0); } - signal(SIGTSTP, SIG_IGN); + signal(SIGTSTP, SIG_IGN); //Ignora sinal de parada. Tratado pelo pai int i = execvp(aux->cmd->args[0], aux->cmd->args); if (aux->cmd->output_r) close(fd_out); if (aux->cmd->input_r) close(fd_in); @@ -195,7 +132,7 @@ int main (int argc, char **argv) aux = aux->next; } aux = cmdList->first; - while (aux->next != NULL) + while (aux->next != NULL) //Fecha o pipe { close(aux->cmd->pipe[0]); close(aux->cmd->pipe[1]); @@ -238,7 +175,60 @@ int main (int argc, char **argv) return 0; } +void printPrompt(char* username, char* hostname) +{ + char path[256]; + getcwd(path, 256); + if(strcmp(path, userdir) == 0) + printf("%s@%s:~$ ", username, hostname); + else if(strstr(path, userdir)) + printf("%s@%s:~%s$ ", username, hostname, path + strlen(userdir)); + else + printf("%s@%s:%s$ ", username, hostname, path); + +} + +void termination_handler(int signum) +{ + printf("\n"); + NODE *aux = childs->first; + while(aux != NULL) + { + if (!aux->proc->isBackground) + { + kill(-aux->proc->pid, signum); + break; + } + aux = aux->next; + } +} +void child_handler(int signum) +{ + int status; + pid_t pid; + pid = waitpid(-1, &status, WNOHANG|WUNTRACED); + if((pid >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, pid); +} +void sigtstop_handler(int signum) +{ + printf("\n"); + PROCESS * process; + if(!ListIsEmpty(childs)) + { + process = ListGetCurrentProcess(childs); + if(process) + if(kill(process->pid, SIGSTOP) == 0) + strcpy(process->status, "Stopped"); + } + else + printPrompt(username, hostname); +} +void free_memory() { + free(childs); + free(cmdList); + free_history(); +} diff --git a/main.h b/main.h index d2b0727..7dad658 100755 --- a/main.h +++ b/main.h @@ -1,24 +1,20 @@ #ifndef _MAIN_H_ #define _MAIN_H_ #include "list.h" -char * userdir; -int output_r; -int output_r_append; -int input_r; -char * output_r_filename; -char * input_r_filename; -char field0_name[100]; -char field1_name[100]; -int is_pipe; -pid_t fgChildPid; -int isBackground; -int child_handler_lock; +void printPrompt(char* username, char* hostname); +void termination_handler(int signum); +void child_handler(int signum); +void sigtstop_handler(int signum); +void free_memory(); + +char * userdir; char * username; char hostname[256]; char * cmdLine; -LIST * cmdList; -void free_memory(); +HISTORY *history; +LIST * cmdList; +LIST * childs; #endif diff --git a/parser.c b/parser.c index 4eae7d7..8b99faa 100755 --- a/parser.c +++ b/parser.c @@ -49,11 +49,11 @@ void getCmds(LIST *cmdList, char *cmdLine) void parse(char * cmdLine, COMMAND * cmd) { - cmd_len = word_count(cmdLine); - int before = cmd_len; char * cmds; int i = 0; char *saveptr; + int cmd_len; + cmd_len = word_count(cmdLine); cmd->args = (char**)malloc((cmd_len+1)*sizeof(char*)); cmds = strtok_r(cmdLine, " ", &saveptr); while(cmds != NULL) @@ -92,13 +92,6 @@ void parse(char * cmdLine, COMMAND * cmd) cmd->size = i; } -void free_parse() -{ - int i; - for(i = 0; parsed[i] != NULL; i++) free(parsed[i]); - free(parsed); -} - char* readline() { char * input = (char *)malloc(sizeof(char) * 100); @@ -107,7 +100,7 @@ char* readline() c = getchar(); while (c != '\n') { - if((c > 31) && (c < 172)) + if(c > 31) //Com esta condição, evitamos lixo na entrada. { input[i] = c; i++; diff --git a/parser.h b/parser.h index 1149c72..f676223 100644 --- a/parser.h +++ b/parser.h @@ -1,14 +1,11 @@ #ifndef _PARSER_H_ #define _PARSER_H_ #include "list.h" -char ** parsed; -int cmd_len; void imprimir_argv(char ** matriz, int tamanho); int word_count(char * source); char * readline(void); void getCmds(LIST *cmdList, char *cmdLine); void parse(char * cmdLine, COMMAND * command); -void free_parse(); #endif From 573d15462ff867b56a0b3f3e0e94275ce2303b08 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Tue, 15 Nov 2011 19:26:27 -0800 Subject: [PATCH 24/30] =?UTF-8?q?Comandos=20bultion=20agora=20aceitam=20re?= =?UTF-8?q?direcionamento=20de=20sa=C3=ADda.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builtin.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++------ builtin.h | 7 +++-- 2 files changed, 79 insertions(+), 12 deletions(-) diff --git a/builtin.c b/builtin.c index 667f730..6a51ff9 100755 --- a/builtin.c +++ b/builtin.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "main.h" #include "builtin.h" #include "parser.h" @@ -26,10 +27,10 @@ void callBuiltIn(int cmd_id, COMMAND *cmd) cd(cmd->args[1]); break; case 1: - print_history(cmd->args[1]); + print_history(cmd); break; case 2: - pwd(); + pwd(cmd); break; case 3: ListPurgeCmds(cmdList); @@ -38,7 +39,7 @@ void callBuiltIn(int cmd_id, COMMAND *cmd) exit(0); break; case 4: - jobs(); + jobs(cmd); break; case 5: bg(cmd->args[1]); @@ -53,7 +54,7 @@ void callBuiltIn(int cmd_id, COMMAND *cmd) echo(cmd); break; case 9: - printf("Shell para trabalho de SSC0141.\nDesenvolvido por Lucas Lobosque e Leandro Pozer.\n"); + about(cmd); break; default: break; @@ -84,11 +85,21 @@ void add_history(char * cmd) } } -void print_history(char * arg) +void print_history(COMMAND *cmd) { int n = 10; char * end; - if (arg != NULL) n = strtol(arg, &end, 10); + int fd_out; + int fd_std = dup(STDOUT_FILENO); + if(cmd->output_r) + { + if(cmd->output_r_append) + fd_out = open(cmd->output_r_filename, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + else + fd_out = open(cmd->output_r_filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + dup2(fd_out, 1); + } + if (cmd->args[1] != NULL) n = strtol(cmd->args[1], &end, 10); HISTORY *tmp = history; int i = 1; printf("%d %s\n", i, tmp->cmd); @@ -98,6 +109,8 @@ void print_history(char * arg) tmp = tmp->next; printf("%d %s\n", i, tmp->cmd); } + dup2(fd_std, 1); + close(fd_out); } void free_history() @@ -119,23 +132,47 @@ void cd(char * arg) if (error == -1) printf("bash: cd: %s: %s\n", arg,strerror(errno)); } -void pwd() +void pwd(COMMAND *cmd) { + int fd_out; + int fd_std = dup(STDOUT_FILENO); + if(cmd->output_r) + { + if(cmd->output_r_append) + fd_out = open(cmd->output_r_filename, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + else + fd_out = open(cmd->output_r_filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + dup2(fd_out, 1); + } char path[256]; getcwd(path, 256); printf("%s\n", path); + dup2(fd_std, 1); + close(fd_out); } -void jobs() +void jobs(COMMAND *cmd) { NODE *aux = childs->first; PROCESS * proc; + int fd_out; + int fd_std = dup(STDOUT_FILENO); + if(cmd->output_r) + { + if(cmd->output_r_append) + fd_out = open(cmd->output_r_filename, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + else + fd_out = open(cmd->output_r_filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + dup2(fd_out, 1); + } while (aux != NULL) { proc = aux->proc; printf("[%d] %s %s\n",proc->pid, proc->status, proc->command); aux = aux->next; } + dup2(fd_std, 1); + close(fd_out); } void bg(char * arg) @@ -179,7 +216,8 @@ void fg(char * arg) process = ListGetProcess(childs, n); } if(process) - if(kill(process->pid, SIGCONT) == 0) { + if(kill(process->pid, SIGCONT) == 0) + { process->isBackground = 0; strcpy(process->status, "Running"); sigprocmask(SIG_BLOCK, &chldMask, NULL); @@ -207,9 +245,37 @@ void kill_cmd(char * arg) void echo(COMMAND *cmd) { int i; + int fd_out; + int fd_std = dup(STDOUT_FILENO); + if(cmd->output_r) + { + if(cmd->output_r_append) + fd_out = open(cmd->output_r_filename, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + else + fd_out = open(cmd->output_r_filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + dup2(fd_out, 1); + } for(i = 1; i < cmd->size; i++) { printf("%s ", cmd->args[i]); } if (cmd->size > 1) printf("\n"); + dup2(fd_std, 1); + close(fd_out); +} + +void about(COMMAND *cmd) { + int fd_out; + int fd_std = dup(STDOUT_FILENO); + if(cmd->output_r) + { + if(cmd->output_r_append) + fd_out = open(cmd->output_r_filename, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + else + fd_out = open(cmd->output_r_filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IRGRP | S_IWGRP | S_IWUSR, 0666); + dup2(fd_out, 1); + } + printf("Shell para trabalho de SSC0141.\nDesenvolvido por Lucas Lobosque e Leandro Pozer.\n"); + dup2(fd_std, 1); + close(fd_out); } diff --git a/builtin.h b/builtin.h index 11aa52a..57c63c4 100755 --- a/builtin.h +++ b/builtin.h @@ -5,14 +5,15 @@ int isBuiltIn(char * cmd); void callBuiltIn(int cmd_id, COMMAND *cmd); void add_history(char * cmd); -void print_history(char * arg); +void print_history(COMMAND *cmd); void free_history(); void cd(char * arg); -void pwd(); -void jobs(); +void pwd(COMMAND *cmd); +void jobs(COMMAND *cmd); void bg(char * arg); void fg(char * arg); void kill_cmd(char * arg); void echo (COMMAND *cmd); +void about(COMMAND *cmd); #endif From a609f5162b81471d1f979eefaf740bfe1bd13e0c Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Wed, 16 Nov 2011 07:13:03 -0800 Subject: [PATCH 25/30] =?UTF-8?q?Pequena=20otimiza=C3=A7=C3=A3o=20no=20pip?= =?UTF-8?q?e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index feb02b3..3b73005 100755 --- a/main.c +++ b/main.c @@ -82,7 +82,7 @@ int main (int argc, char **argv) else { if(aux->next != NULL) - pipe2(aux->cmd->pipe, O_CLOEXEC); + pipe(aux->cmd->pipe); aux->cmd->pid = fork(); if(aux->cmd->pid == 0) { @@ -152,7 +152,7 @@ int main (int argc, char **argv) p->isBackground = aux->cmd->isBackground; strcpy(p->status, "Running"); strcpy(p->command, aux->cmd->args[0]); - sigprocmask(SIG_BLOCK, &chldMask, NULL); + sigprocmask(SIG_BLOCK, &chldMask, NULL); //Atrasa sinal para evitar problemas de concorrência ListInsert(childs, p, NULL); sigprocmask(SIG_UNBLOCK, &chldMask, NULL); } @@ -160,13 +160,14 @@ int main (int argc, char **argv) } int i; int status; - sigprocmask(SIG_BLOCK, &chldMask, NULL); - for (i = 0; i < count; i++) + sigprocmask(SIG_BLOCK, &chldMask, NULL); //Atrasa sinal para evitar problemas de concorrência + for (i = 0; i < count; i++) //Espera por todos os processos do grupo terminar { pid_t pidfg = waitpid(-cmdList->first->cmd->pid, &status, WUNTRACED); if ((pidfg >= 0) && (WIFSTOPPED(status) == 0)) ListRemoveByPid(childs, pidfg); } sigprocmask(SIG_UNBLOCK, &chldMask, NULL); + } ListPurgeCmds(cmdList); free(cmdLine); @@ -217,16 +218,17 @@ void sigtstop_handler(int signum) PROCESS * process; if(!ListIsEmpty(childs)) { - process = ListGetCurrentProcess(childs); - if(process) - if(kill(process->pid, SIGSTOP) == 0) - strcpy(process->status, "Stopped"); + process = ListGetCurrentProcess(childs); + if(process) + if(kill(process->pid, SIGSTOP) == 0) + strcpy(process->status, "Stopped"); } else printPrompt(username, hostname); } -void free_memory() { +void free_memory() +{ free(childs); free(cmdList); free_history(); From 95d8634bdb4d8e5d8fc237b0a50d744b0f467b84 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Wed, 16 Nov 2011 07:27:55 -0800 Subject: [PATCH 26/30] =?UTF-8?q?Formata=C3=A7=C3=A3o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builtin.c | 3 ++- list.c | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/builtin.c b/builtin.c index 6a51ff9..8961a6e 100755 --- a/builtin.c +++ b/builtin.c @@ -264,7 +264,8 @@ void echo(COMMAND *cmd) close(fd_out); } -void about(COMMAND *cmd) { +void about(COMMAND *cmd) +{ int fd_out; int fd_std = dup(STDOUT_FILENO); if(cmd->output_r) diff --git a/list.c b/list.c index 550bfd3..66888ac 100755 --- a/list.c +++ b/list.c @@ -117,11 +117,7 @@ PROCESS * ListGetProcess(LIST *list, pid_t pid) while (aux != NULL) { if(aux->proc->pid == pid) - { - //aux->proc->isBackground = 1; - //strcpy(aux->proc->status, "Running"); return aux->proc; - } aux = aux->prev; } } From 18944c1097ffea7abcdf63b4e8bfc07aef0860fe Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Wed, 16 Nov 2011 14:25:56 -0800 Subject: [PATCH 27/30] =?UTF-8?q?Vers=C3=A3o=20final=20com=20documenta?= =?UTF-8?q?=C3=A7=C3=A3o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Doxyfile | 280 ++++++++++ Doxyfile~ | 280 ++++++++++ Mainpage.h | 42 ++ Mainpage.h~ | 40 ++ Makefile | 14 + Makefile~ | 18 + README | 56 ++ README~ | 56 ++ builtin.h | 106 +++- docs/annotated.html | 90 +++ docs/bc_s.png | Bin 0 -> 677 bytes docs/classes.html | 91 +++ docs/closed.png | Bin 0 -> 126 bytes docs/d0/d29/main_8c.html | 273 +++++++++ docs/d1/d2b/Mainpage_8h.html | 86 +++ docs/d1/d2b/Mainpage_8h_source.html | 83 +++ docs/d2/d72/parser_8c.html | 252 +++++++++ docs/d4/dbf/main_8h.html | 321 +++++++++++ docs/d4/dbf/main_8h_source.html | 106 ++++ docs/d5/d36/parser_8h.html | 221 ++++++++ docs/d5/d36/parser_8h_source.html | 94 ++++ docs/d6/dcd/builtin_8h.html | 466 ++++++++++++++++ docs/d6/dcd/builtin_8h_source.html | 111 ++++ docs/d7/d40/list_8c.html | 407 ++++++++++++++ docs/d8/d91/structLIST.html | 128 +++++ docs/d9/d2e/structhistory.html | 128 +++++ docs/da/d23/list_8h.html | 457 +++++++++++++++ docs/da/d23/list_8h_source.html | 149 +++++ docs/db/d62/structNODE.html | 157 ++++++ docs/dc/d56/structCOMMAND.html | 255 +++++++++ docs/dc/dd8/structPROCESS.html | 157 ++++++ docs/dd/da0/todo.html | 82 +++ docs/df/d8a/builtin_8c.html | 475 ++++++++++++++++ docs/doxygen.css | 835 ++++++++++++++++++++++++++++ docs/doxygen.png | Bin 0 -> 3942 bytes docs/files.html | 93 ++++ docs/functions.html | 148 +++++ docs/functions_vars.html | 148 +++++ docs/globals.html | 351 ++++++++++++ docs/globals_defs.html | 92 +++ docs/globals_func.html | 301 ++++++++++ docs/globals_type.html | 95 ++++ docs/globals_vars.html | 110 ++++ docs/index.html | 124 +++++ docs/installdox | 112 ++++ docs/jquery.js | 54 ++ docs/nav_f.png | Bin 0 -> 159 bytes docs/nav_h.png | Bin 0 -> 97 bytes docs/open.png | Bin 0 -> 118 bytes docs/pages.html | 81 +++ docs/search/all_5f.html | 26 + docs/search/all_61.html | 44 ++ docs/search/all_62.html | 39 ++ docs/search/all_63.html | 83 +++ docs/search/all_65.html | 29 + docs/search/all_66.html | 53 ++ docs/search/all_67.html | 29 + docs/search/all_68.html | 36 ++ docs/search/all_69.html | 71 +++ docs/search/all_6a.html | 29 + docs/search/all_6b.html | 29 + docs/search/all_6c.html | 113 ++++ docs/search/all_6d.html | 41 ++ docs/search/all_6e.html | 38 ++ docs/search/all_6f.html | 38 ++ docs/search/all_70.html | 98 ++++ docs/search/all_72.html | 29 + docs/search/all_73.html | 41 ++ docs/search/all_74.html | 29 + docs/search/all_75.html | 32 ++ docs/search/all_77.html | 29 + docs/search/classes_63.html | 25 + docs/search/classes_68.html | 25 + docs/search/classes_6c.html | 25 + docs/search/classes_6e.html | 25 + docs/search/classes_70.html | 25 + docs/search/close.png | Bin 0 -> 273 bytes docs/search/defines_5f.html | 26 + docs/search/files_62.html | 30 + docs/search/files_6c.html | 30 + docs/search/files_6d.html | 35 ++ docs/search/files_70.html | 30 + docs/search/functions_61.html | 38 ++ docs/search/functions_62.html | 29 + docs/search/functions_63.html | 47 ++ docs/search/functions_65.html | 29 + docs/search/functions_66.html | 47 ++ docs/search/functions_67.html | 29 + docs/search/functions_69.html | 44 ++ docs/search/functions_6a.html | 29 + docs/search/functions_6b.html | 29 + docs/search/functions_6c.html | 92 +++ docs/search/functions_6d.html | 26 + docs/search/functions_70.html | 56 ++ docs/search/functions_72.html | 29 + docs/search/functions_73.html | 29 + docs/search/functions_74.html | 29 + docs/search/functions_77.html | 29 + docs/search/mag_sel.png | Bin 0 -> 563 bytes docs/search/nomatches.html | 12 + docs/search/search.css | 240 ++++++++ docs/search/search.js | 738 ++++++++++++++++++++++++ docs/search/search_l.png | Bin 0 -> 604 bytes docs/search/search_m.png | Bin 0 -> 158 bytes docs/search/search_r.png | Bin 0 -> 612 bytes docs/search/typedefs_68.html | 26 + docs/search/typedefs_6e.html | 26 + docs/search/variables_61.html | 26 + docs/search/variables_63.html | 53 ++ docs/search/variables_66.html | 26 + docs/search/variables_68.html | 32 ++ docs/search/variables_69.html | 47 ++ docs/search/variables_6c.html | 26 + docs/search/variables_6e.html | 29 + docs/search/variables_6f.html | 38 ++ docs/search/variables_70.html | 47 ++ docs/search/variables_73.html | 32 ++ docs/search/variables_75.html | 32 ++ docs/tab_a.png | Bin 0 -> 140 bytes docs/tab_b.png | Bin 0 -> 178 bytes docs/tab_h.png | Bin 0 -> 192 bytes docs/tab_s.png | Bin 0 -> 189 bytes docs/tabs.css | 59 ++ list.h | 79 ++- main.c | 6 +- main.h | 39 +- parser.h | 43 +- 127 files changed, 11502 insertions(+), 22 deletions(-) create mode 100644 Doxyfile create mode 100644 Doxyfile~ create mode 100644 Mainpage.h create mode 100644 Mainpage.h~ create mode 100644 Makefile create mode 100644 Makefile~ create mode 100644 README~ create mode 100644 docs/annotated.html create mode 100644 docs/bc_s.png create mode 100644 docs/classes.html create mode 100644 docs/closed.png create mode 100644 docs/d0/d29/main_8c.html create mode 100644 docs/d1/d2b/Mainpage_8h.html create mode 100644 docs/d1/d2b/Mainpage_8h_source.html create mode 100644 docs/d2/d72/parser_8c.html create mode 100644 docs/d4/dbf/main_8h.html create mode 100644 docs/d4/dbf/main_8h_source.html create mode 100644 docs/d5/d36/parser_8h.html create mode 100644 docs/d5/d36/parser_8h_source.html create mode 100644 docs/d6/dcd/builtin_8h.html create mode 100644 docs/d6/dcd/builtin_8h_source.html create mode 100644 docs/d7/d40/list_8c.html create mode 100644 docs/d8/d91/structLIST.html create mode 100644 docs/d9/d2e/structhistory.html create mode 100644 docs/da/d23/list_8h.html create mode 100644 docs/da/d23/list_8h_source.html create mode 100644 docs/db/d62/structNODE.html create mode 100644 docs/dc/d56/structCOMMAND.html create mode 100644 docs/dc/dd8/structPROCESS.html create mode 100644 docs/dd/da0/todo.html create mode 100644 docs/df/d8a/builtin_8c.html create mode 100644 docs/doxygen.css create mode 100644 docs/doxygen.png create mode 100644 docs/files.html create mode 100644 docs/functions.html create mode 100644 docs/functions_vars.html create mode 100644 docs/globals.html create mode 100644 docs/globals_defs.html create mode 100644 docs/globals_func.html create mode 100644 docs/globals_type.html create mode 100644 docs/globals_vars.html create mode 100644 docs/index.html create mode 100755 docs/installdox create mode 100644 docs/jquery.js create mode 100644 docs/nav_f.png create mode 100644 docs/nav_h.png create mode 100644 docs/open.png create mode 100644 docs/pages.html create mode 100644 docs/search/all_5f.html create mode 100644 docs/search/all_61.html create mode 100644 docs/search/all_62.html create mode 100644 docs/search/all_63.html create mode 100644 docs/search/all_65.html create mode 100644 docs/search/all_66.html create mode 100644 docs/search/all_67.html create mode 100644 docs/search/all_68.html create mode 100644 docs/search/all_69.html create mode 100644 docs/search/all_6a.html create mode 100644 docs/search/all_6b.html create mode 100644 docs/search/all_6c.html create mode 100644 docs/search/all_6d.html create mode 100644 docs/search/all_6e.html create mode 100644 docs/search/all_6f.html create mode 100644 docs/search/all_70.html create mode 100644 docs/search/all_72.html create mode 100644 docs/search/all_73.html create mode 100644 docs/search/all_74.html create mode 100644 docs/search/all_75.html create mode 100644 docs/search/all_77.html create mode 100644 docs/search/classes_63.html create mode 100644 docs/search/classes_68.html create mode 100644 docs/search/classes_6c.html create mode 100644 docs/search/classes_6e.html create mode 100644 docs/search/classes_70.html create mode 100644 docs/search/close.png create mode 100644 docs/search/defines_5f.html create mode 100644 docs/search/files_62.html create mode 100644 docs/search/files_6c.html create mode 100644 docs/search/files_6d.html create mode 100644 docs/search/files_70.html create mode 100644 docs/search/functions_61.html create mode 100644 docs/search/functions_62.html create mode 100644 docs/search/functions_63.html create mode 100644 docs/search/functions_65.html create mode 100644 docs/search/functions_66.html create mode 100644 docs/search/functions_67.html create mode 100644 docs/search/functions_69.html create mode 100644 docs/search/functions_6a.html create mode 100644 docs/search/functions_6b.html create mode 100644 docs/search/functions_6c.html create mode 100644 docs/search/functions_6d.html create mode 100644 docs/search/functions_70.html create mode 100644 docs/search/functions_72.html create mode 100644 docs/search/functions_73.html create mode 100644 docs/search/functions_74.html create mode 100644 docs/search/functions_77.html create mode 100644 docs/search/mag_sel.png create mode 100644 docs/search/nomatches.html create mode 100644 docs/search/search.css create mode 100644 docs/search/search.js create mode 100644 docs/search/search_l.png create mode 100644 docs/search/search_m.png create mode 100644 docs/search/search_r.png create mode 100644 docs/search/typedefs_68.html create mode 100644 docs/search/typedefs_6e.html create mode 100644 docs/search/variables_61.html create mode 100644 docs/search/variables_63.html create mode 100644 docs/search/variables_66.html create mode 100644 docs/search/variables_68.html create mode 100644 docs/search/variables_69.html create mode 100644 docs/search/variables_6c.html create mode 100644 docs/search/variables_6e.html create mode 100644 docs/search/variables_6f.html create mode 100644 docs/search/variables_70.html create mode 100644 docs/search/variables_73.html create mode 100644 docs/search/variables_75.html create mode 100644 docs/tab_a.png create mode 100644 docs/tab_b.png create mode 100644 docs/tab_h.png create mode 100644 docs/tab_s.png create mode 100644 docs/tabs.css diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..3295faf --- /dev/null +++ b/Doxyfile @@ -0,0 +1,280 @@ +# Doxyfile 1.7.4 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = Shell +PROJECT_NUMBER = +PROJECT_BRIEF = +PROJECT_LOGO = +OUTPUT_DIRECTORY = docs +CREATE_SUBDIRS = YES +OUTPUT_LANGUAGE = Portuguese +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +EXTENSION_MAPPING = +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +TYPEDEF_HIDES_STRUCT = NO +SYMBOL_CACHE_SIZE = 0 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +FORCE_LOCAL_INCLUDES = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = YES +HTML_ALIGN_MEMBERS = YES +HTML_DYNAMIC_SECTIONS = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +USE_INLINE_TREES = NO +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +FORMULA_FONTSIZE = 10 +FORMULA_TRANSPARENT = YES +USE_MATHJAX = NO +MATHJAX_RELPATH = http://www.mathjax.org/mathjax +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4 +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +LATEX_SOURCE_CODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Helvetica +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MSCFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = YES +GENERATE_LEGEND = YES +DOT_CLEANUP = YES diff --git a/Doxyfile~ b/Doxyfile~ new file mode 100644 index 0000000..de75cef --- /dev/null +++ b/Doxyfile~ @@ -0,0 +1,280 @@ +# Doxyfile 1.7.4 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = Shell +PROJECT_NUMBER = +PROJECT_BRIEF = +PROJECT_LOGO = +OUTPUT_DIRECTORY = docs +CREATE_SUBDIRS = YES +OUTPUT_LANGUAGE = Português +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +EXTENSION_MAPPING = +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +TYPEDEF_HIDES_STRUCT = NO +SYMBOL_CACHE_SIZE = 0 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +FORCE_LOCAL_INCLUDES = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = YES +HTML_ALIGN_MEMBERS = YES +HTML_DYNAMIC_SECTIONS = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +USE_INLINE_TREES = NO +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +FORMULA_FONTSIZE = 10 +FORMULA_TRANSPARENT = YES +USE_MATHJAX = NO +MATHJAX_RELPATH = http://www.mathjax.org/mathjax +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4 +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +LATEX_SOURCE_CODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Helvetica +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MSCFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = YES +GENERATE_LEGEND = YES +DOT_CLEANUP = YES diff --git a/Mainpage.h b/Mainpage.h new file mode 100644 index 0000000..a632b67 --- /dev/null +++ b/Mainpage.h @@ -0,0 +1,42 @@ +/** + * @mainpage Shell + * @author Lucas Lobosque - 6792645 + * @author José Leandro Pozer - 6793222 + * @date 16/11/2011 + * + * @section intro Introdução + * + * @subsection estrutura_basica_subsec Estrutura básica de Arquivos + * Desenvolvemos o shell utilizando 4 arquivos diferentes (e seus headers): + * + *
    + *
  • main.c - Arquivo com a função main, onde fica o loop principal e com handlers de sinais como SIGINT, SIGTSTP e SIGCHLD.
  • + *
  • parser.c - Funções relacionadas a transformar a entrada do usuário em uma estrutura compreensível para o programa.
  • + *
  • builtin.c - Aqui estáo todos os comandos builtin e também uma função que checa se um dado comando é builtin ou não.
  • + *
  • list.c - Funções que manipulam as listas usadas pelo programa.
  • + *
+ * + * @subsection estrutura_dados_subsec Estrutura básica de Dados + * No nosso programa, temos três listas ligadas diferentes que são constantemente utilizadas: + *
    + *
  • history - Esta é a mais simples das três. Guarda strings com os comandos anteriormente utilizados pelo usuário. É usada pelo comando builtin history.
  • + *
  • childs - Nesta lista ligada armazenamos todos os processos que estão rodando ou estão interrompidos.
  • + *
  • cmdList - Lista responsável por guardar o último comando enviado pelo usuário. Nesta lista, o comando é guardado depois de "parseado", então todas suas informações são + * guardadas aqui (roda no background? tem redirecionamento de saída? pra onde?). Cada item da lista é um comando diferente, sendo que a lista e sempre resetada no loop. Ou seja, esta lista só conterá mais de um item se houver pipe no comando.
  • + *
+ * + * @section section_toc Características Não Implementadas (limitações). + * Na nossa shell, os seguintes tipos de comando não são possíveis: + *
    + *
  • Comando builtin rodando em background (sempre rodará em foreground).
  • + *
  • Redirecionamento de entrada para comandos builtin (redirecionamento de saída implementado).
  • + *
  • Pipe com comandos builtin
  • + *
+ * Tornou-se uma tarefa complicada para nós lidar com essas peculiaridades de comandos builtin, já que implementamos sem elas em mente, e, quando percebemos que haveriam essas possibilidades, teríamos que mudar muito a estrutura do programa. + * + * @section testes Testes + * Além de exaustivos testes com vários comandos complexos, rodamos nossa shell com o Valgrind e encontramos vários memory leaks (a maioria causada por erros bobos, porém alguns eram bem complexos). + * Arrumamos a maioria deles, mas infelizmente teve um leak que não foi possível concertar, pois ele é causado pela função getlogin(), (implementada na unistd.h). + * @section conclusao Conclusão + * Além de bastante desafiador, o desenvolvimento da shell foi de grande valia para nós, já que nunca tivemos um contato a nível de sistema com o Linux. Depois do desenvolvimento desse programa, arriscamos dizer que entendemos ao menos um pouco de Linux :). +*/ diff --git a/Mainpage.h~ b/Mainpage.h~ new file mode 100644 index 0000000..abc1e74 --- /dev/null +++ b/Mainpage.h~ @@ -0,0 +1,40 @@ +/** + * @mainpage Shell + * @author Lucas Lobosque - 6792645 + * @author José Leandro Pozer - 6793222 + * @date 16/11/2011 + * + * @section intro Introdução + * + * @subsection estrutura_basica_subsec Estrutura básica de Arquivos + * Desenvolvemos o shell utilizando 4 arquivos diferentes (e seus headers): + * + *
    + *
  • main.c - Arquivo com a função main, onde fica o loop principal e com handlers de sinais como SIGINT, SIGTSTP e SIGCHLD.
  • + *
  • parser.c - Funções relacionadas a transformar a entrada do usuário em uma estrutura compreensível para o programa.
  • + *
  • builtin.c - Aqui estáo todos os comandos builtin e também uma função que checa se um dado comando é builtin ou não.
  • + *
  • list.c - Funções que manipulam as listas usadas pelo programa.
  • + *
+ * + * @subsection estrutura_dados_subsec Estrutura básica de Dados + * No nosso programa, temos três listas ligadas diferentes que são constantemente utilizadas: + *
    + *
  • history - Esta é a mais simples das três. Guarda strings com os comandos anteriormente utilizados pelo usuário. É usada pelo comando builtin history.
  • + *
  • childs - Nesta lista ligada armazenamos todos os processos que estão rodando ou estão interrompidos.
  • + *
  • cmdList - Lista responsável por guardar o último comando enviado pelo usuário. Nesta lista, o comando é guardado depois de "parseado", então todas suas informações são + * guardadas aqui (roda no background? tem redirecionamento de saída? pra onde?). Cada item da lista é um comando diferente, sendo que a lista e sempre resetada no loop. Ou seja, esta lista só conterá mais de um item se houver pipe no comando.
  • + *
+ * + * @section section_toc Características Não Implementadas (limitações). + * Na nossa shell, os seguintes tipos de comando não são possíveis: + *
    + *
  • Comando builtin rodando em background (sempre rodará em foreground).
  • + *
  • Redirecionamento de entrada para comandos builtin (redirecionamento de saída implementado).
  • + *
  • Pipe com comandos builtin
  • + *
+ * Tornou-se uma tarefa complicada para nós lidar com essas peculiaridades de comandos builtin, já que implementamos sem elas em mente, e, quando percebemos que haveriam essas possibilidades, teríamos que mudar muito a estrutura do programa. + * + * @section testes Testes + * Além de exaustivos testes com vários comandos complexos, rodamos nossa shell com o Valgrind e encontramos vários memory leaks (a maioria causada por erros bobos, porém alguns eram bem complexos). + * Arrumamos a maioria deles, mas infelizmente teve um leak que não foi possível concertar, pois ele é causado pela função getlogin(), (implementada na unistd.h). +*/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2f52171 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +shell : builtin.o main.o list.o parser.o + gcc obj/builtin.o obj/main.o obj/list.o obj/parser.o -o bin/shell + +builtin.o : builtin.c + gcc -c builtin.c -o obj/builtin.o + +main.o : main.c + gcc -c main.c -o obj/main.o + +list.o : list.c + gcc -c list.c -o obj/list.o + +parser.o : parser.c + gcc -c parser.c -o obj/parser.o diff --git a/Makefile~ b/Makefile~ new file mode 100644 index 0000000..184f687 --- /dev/null +++ b/Makefile~ @@ -0,0 +1,18 @@ +shell : builtin.o main.o list.o parser.o a + gcc obj/builtin.o obj/main.o obj/list.o obj/parser.o -o bin/shell + +a : + echo oi + +builtin.o : builtin.c + gcc -c builtin.c -o obj/builtin.o + +main.o : main.c + gcc -c main.c -o obj/main.o + +list.o : list.c + gcc -c list.c -o obj/list.o + +parser.o : parser.c + gcc -c parser.c -o obj/parser.o + diff --git a/README b/README index e69de29..4b07900 100644 --- a/README +++ b/README @@ -0,0 +1,56 @@ +Autores: + Lucas Lobosque - 6792645 + José Leandro Pozer - 6793222 + +Data: + 16/11/2011 + +==Introdução== + +--Estrutura básica de Arquivos-- + + Desenvolvemos o shell utilizando 4 arquivos diferentes (e seus headers): + + * main.c - Arquivo com a função main, onde fica o loop principal e com handlers de sinais como SIGINT, SIGTSTP e SIGCHLD. + * parser.c - Funções relacionadas a transformar a entrada do usuário em uma estrutura compreensível para o programa. + * builtin.c - Aqui estáo todos os comandos builtin e também uma função que checa se um dado comando é builtin ou não. + * list.c - Funções que manipulam as listas usadas pelo programa. + + +--Estrutura básica de Dados-- + + No nosso programa, temos três listas ligadas diferentes que são constantemente utilizadas: + + * history - Esta é a mais simples das três. Guarda strings com os comandos anteriormente utilizados pelo usuário. É usada + pelo comando builtin history. + * childs - Nesta lista ligada armazenamos todos os processos que estão rodando ou estão interrompidos. + * cmdList - Lista responsável por guardar o último comando enviado pelo usuário. Nesta lista, o comando é guardado depois de + "parseado", então todas suas informações são guardadas aqui (roda no background? tem redirecionamento de saída? + pra onde?). Cada item da lista é um comando diferente, sendo que a lista e sempre resetada no loop. Ou seja, + esta lista só conterá mais de um item se houver pipe no comando. + + +==Características Não Implementadas (limitações)== + + Na nossa shell, os seguintes tipos de comando não são possíveis: + + * Comando builtin rodando em background (sempre rodará em foreground). + * Redirecionamento de entrada para comandos builtin (redirecionamento de saída implementado). + * Pipe com comandos builtin + + Tornou-se uma tarefa complicada para nós lidar com essas peculiaridades de comandos builtin, já que implementamos sem elas em mente, e, +quando percebemos que haveriam essas possibilidades, teríamos que mudar muito a estrutura do programa. + + +==Testes== + + Além de exaustivos testes com vários comandos complexos, rodamos nossa shell com o Valgrind e encontramos vários memory leaks (a maioria causada +por erros bobos, porém alguns eram bem complexos). Arrumamos a maioria deles, mas infelizmente teve um leak que não foi possível concertar, pois +ele é causado pela função getlogin(), (implementada na unistd.h). + + +==Conclusão== + + Além de bastante desafiador, o desenvolvimento da shell foi de grande valia para nós, já que nunca tivemos um contato a nível de sistema com +o Linux. Depois do desenvolvimento desse programa, arriscamos dizer que entendemos ao menos um pouco de Linux :). + diff --git a/README~ b/README~ new file mode 100644 index 0000000..5653226 --- /dev/null +++ b/README~ @@ -0,0 +1,56 @@ +Autores: + Lucas Lobosque - 6792645 + José Leandro Pozer - 6793222 + +Data: + 16/11/2011 + +==Introdução== + +--Estrutura básica de Arquivos-- + + Desenvolvemos o shell utilizando 4 arquivos diferentes (e seus headers): + + * main.c - Arquivo com a função main, onde fica o loop principal e com handlers de sinais como SIGINT, SIGTSTP e SIGCHLD. + * parser.c - Funções relacionadas a transformar a entrada do usuário em uma estrutura compreensível para o programa. + * builtin.c - Aqui estáo todos os comandos builtin e também uma função que checa se um dado comando é builtin ou não. + * list.c - Funções que manipulam as listas usadas pelo programa. + + +--Estrutura básica de Dados-- + + No nosso programa, temos três listas ligadas diferentes que são constantemente utilizadas: + + * history - Esta é a mais simples das três. Guarda strings com os comandos anteriormente utilizados pelo usuário. É usada + pelo comando builtin history. + * childs - Nesta lista ligada armazenamos todos os processos que estão rodando ou estão interrompidos. + * cmdList - Lista responsável por guardar o último comando enviado pelo usuário. Nesta lista, o comando é guardado depois de + "parseado", então todas suas informações são guardadas aqui (roda no background? tem redirecionamento de saída? + pra onde?). Cada item da lista é um comando diferente, sendo que a lista e sempre resetada no loop. Ou seja, + esta lista só conterá mais de um item se houver pipe no comando. + + +==Características Não Implementadas (limitações)== + +Na nossa shell, os seguintes tipos de comando não são possíveis: + + * Comando builtin rodando em background (sempre rodará em foreground). + * Redirecionamento de entrada para comandos builtin (redirecionamento de saída implementado). + * Pipe com comandos builtin + + Tornou-se uma tarefa complicada para nós lidar com essas peculiaridades de comandos builtin, já que implementamos sem elas em mente, e, +quando percebemos que haveriam essas possibilidades, teríamos que mudar muito a estrutura do programa. + + +==Testes== + + Além de exaustivos testes com vários comandos complexos, rodamos nossa shell com o Valgrind e encontramos vários memory leaks (a maioria causada +por erros bobos, porém alguns eram bem complexos). Arrumamos a maioria deles, mas infelizmente teve um leak que não foi possível concertar, pois +ele é causado pela função getlogin(), (implementada na unistd.h). + + +==Conclusão== + + Além de bastante desafiador, o desenvolvimento da shell foi de grande valia para nós, já que nunca tivemos um contato a nível de sistema com +o Linux. Depois do desenvolvimento desse programa, arriscamos dizer que entendemos ao menos um pouco de Linux :). + diff --git a/builtin.h b/builtin.h index 57c63c4..3f25062 100755 --- a/builtin.h +++ b/builtin.h @@ -1,19 +1,121 @@ #ifndef _BUILTIN_H_ #define _BUILTIN_H_ - +/** +* @brief Verifica se o comando é BuiltIn +* +* Se o comando for BuiltIn, retorna seu id para ser executado +* posteriormente. +* @param cmd - comando a ser analisado. +* @return Valor do id do comando. +* @retval -1 Se o comando não é BuiltIn. +* +*/ int isBuiltIn(char * cmd); + +/** +* @brief Executa o comando BuiltIn. +* @param cmd_id - id do comando a ser executado, retorno da função isBuiltIn. +* @param cmd - Estrutura com informações do comando. +* @return void. +* +*/ void callBuiltIn(int cmd_id, COMMAND *cmd); + +/** +* @brief Adiciona o comando do usuário na lista do histórico. +* @param cmd - Comando a ser adicionado. +* @return void. +* +*/ void add_history(char * cmd); + +/** +* @brief Imprime os comando armazenados no histórico. +* @param cmd - Estrutura com possível parâmetro do comando, representa +* quantos comandos deseja imprimir, se for NULL imprime os últimos +* 10, que é o valor default. +* @return void. +* +*/ void print_history(COMMAND *cmd); + +/** +* @brief Libera memória alocada pelo histórico. +* @return void. +* +*/ void free_history(); + +/** +* @brief Muda o diretório atual no qual o sistema está trabalhando. +* @param arg - Diretorio para o qual deseja mudar. +* @return void. +* +*/ void cd(char * arg); + +/** +* @brief Mostra o diretório no qual o sistema está trabalhando. +* @param cmd - Estrutura com informações do comando. (Necessário para +* redirecionamento de saída). +* @return void. +* +*/ void pwd(COMMAND *cmd); + +/** +* @brief Mostra uma lista com os jobs atuais. +* @param cmd - Estrutura com informações do comando. (Necessário para +* redirecionamento de saída). +* @return void. +* +*/ void jobs(COMMAND *cmd); + +/** +* @brief Coloca um processo em background. +* @param arg - Id do processo a ser colocado em background, se for +* NULL o processo mais recente é colocado em foreground. +* @return void. +* +*/ void bg(char * arg); + +/** +* @brief Coloca um processo suspenso em foreground. +* @param arg - Id do processo a ser colocado em foreground, se for +* NULL o processo suspenso mais recente é colocado em foreground. +* @return void. +* +*/ void fg(char * arg); + +/** +* @brief Manda o sinal SIGTERM para um processo filho +* @param arg - Id do processo a receber o sinal, se for NULL o processo +* mais recente recebe o sinal. +* @return void. +* +*/ void kill_cmd(char * arg); + +/** +* @brief imprime os argumentos enviados na tela. +* @param cmd - Estrutura com informações do comando. Daqui se extrai os +* argumentos a serem imprimidos. (Também necessário para +* redirecionamento de saída). +* @return void. +* +*/ void echo (COMMAND *cmd); + +/** +* @brief Comando simples que imprime informações sobre os autores. +* @param cmd - Estrutura com informações do comando. (Necessário para +* redirecionamento de saída). +* @return void. +* +*/ void about(COMMAND *cmd); #endif - diff --git a/docs/annotated.html b/docs/annotated.html new file mode 100644 index 0000000..a864ad8 --- /dev/null +++ b/docs/annotated.html @@ -0,0 +1,90 @@ + + + + +Shell: Estruturas de dados + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+
+
Estruturas de dados
+
+
+
Lista das estruturas de dados com uma breve descrição:
+ + + + + +
COMMANDEstrutura do comando
historyLista simples para uso do comando builtin history
LISTEstrutura da lista em si
NODENó das listas de comandos e processos
PROCESSEstrutura do processo
+
+ + + + +
+ +
+ + + + diff --git a/docs/bc_s.png b/docs/bc_s.png new file mode 100644 index 0000000000000000000000000000000000000000..e4018628b5b45cb4301037485a29d7d74ac22138 GIT binary patch literal 677 zcmV;W0$TlvP)X?0Pv5h+5!wElpi=&YL!gfY!djl#UDdPKy97F|A-deTa@qo3BWh1YQIvzmHR^g zFjV4I6pLB7_*vEZk^%p7c7Bh>0`4r^X#gpJE_Vz9fSHKqclcZaV^k3gX%h+1`u||O zZ+BY?7(R=ayr^kXE=E0Dw=$Ud3VJ?9^Cz@hP?388Cw5>9TloOJ>^KczCgj zns2=|0!a|)Yq3{hjL{xyy7|Tk0N}Pe+g9PUTL!4{#;eUhrNd@!_T<>Vu+35c)h>sq ztgb?(6W3oFLz#%?OMEV@{j#4LuDvjVGZ~6hpQT8li5b0yjvK8c4efl+vSz5)P6 zle78)00_Iv5)&E~hnOdcd}L}i+MU>k+Q8#@KjqJJN`gRj(~)RmNrck9ht@LelPtVO zwp(J;k!T=gC#%o(13-^E+g@aqc()pf{+j|0w)AH*Mq$54UjLv#jV$RYpz3Vjg$$=u z>yjfBQOhL=^@+#4#$l|{~}HZ-?1Yy{lI*$N}*YDC`<{+;>_#gMXZdz4NI00000 LNkvXXu0mjfx86dR literal 0 HcmV?d00001 diff --git a/docs/classes.html b/docs/classes.html new file mode 100644 index 0000000..4068fec --- /dev/null +++ b/docs/classes.html @@ -0,0 +1,91 @@ + + + + +Shell: Índice das estruturas de dados + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+
+
Índice das estruturas de dados
+
+
+
C | H | L | N | P
+ +
  C  
+
  H  
+
  L  
+
  N  
+
  P  
+
COMMAND   history   LIST   NODE   PROCESS   
C | H | L | N | P
+
+ + + + +
+ +
+ + + + diff --git a/docs/closed.png b/docs/closed.png new file mode 100644 index 0000000000000000000000000000000000000000..b7d4bd9fef2272c74b94762c9e2496177017775e GIT binary patch literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VuAVNAAr*{o?>h22DDp4|bgj*t z)u^AqcA-V@guRYpb17F<&b?_~8HV>~XqWvB;^$!VVSTy0!eQcJp_yD7TIQA>7dijs YXf6~H5cs^Q6KEiVr>mdKI;Vst0NsWqGynhq literal 0 HcmV?d00001 diff --git a/docs/d0/d29/main_8c.html b/docs/d0/d29/main_8c.html new file mode 100644 index 0000000..1c86fe7 --- /dev/null +++ b/docs/d0/d29/main_8c.html @@ -0,0 +1,273 @@ + + + + +Shell: Referência ao ficheiro main.c + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência ao ficheiro main.c
+
+
+
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <fcntl.h>
+#include <signal.h>
+#include "main.h"
+#include "parser.h"
+#include "builtin.h"
+#include "list.h"
+
+ + + + + + + + + + + + + + +

+Macros

#define _GNU_SOURCE

+Funções

int main (int argc, char **argv)
void printPrompt ()
 Imprime o prompt na tela (formato copiado do gnome shell).
void termination_handler (int signum)
 Função executada quando usuário manda ctrl+c.
void child_handler (int signum)
 Função executada quando um processo filho termina.
void sigtstop_handler (int signum)
 Função executada quando usuário manda ctrl+z.
void free_memory ()
 Função que libera memória utilizada antes de terminar o programa.
+

Documentação das macros

+ +
+
+ + + + +
#define _GNU_SOURCE
+
+
+ +
+
+

Documentação das funções

+ +
+
+ + + + + + + + +
void child_handler (int signum)
+
+
+ +

Função executada quando um processo filho termina.

+

Esta função só é útil para processos em background, já que ela fica bloqueada quando um processo roda em foreground.

+
Parâmetros:
+ + +
signum- id do sinal.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + +
void free_memory ()
+
+
+ +

Função que libera memória utilizada antes de terminar o programa.

+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char ** argv 
)
+
+
+ +
+
+ +
+
+ + + + + + + +
void printPrompt ()
+
+
+ +

Imprime o prompt na tela (formato copiado do gnome shell).

+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void sigtstop_handler (int signum)
+
+
+ +

Função executada quando usuário manda ctrl+z.

+
Parâmetros:
+ + +
signum- id do sinal.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void termination_handler (int signum)
+
+
+ +

Função executada quando usuário manda ctrl+c.

+
Parâmetros:
+ + +
signum- id do sinal.
+
+
+
Retorna:
void.
+ +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/d1/d2b/Mainpage_8h.html b/docs/d1/d2b/Mainpage_8h.html new file mode 100644 index 0000000..34ebb2e --- /dev/null +++ b/docs/d1/d2b/Mainpage_8h.html @@ -0,0 +1,86 @@ + + + + +Shell: Referência ao ficheiro Mainpage.h + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+
+
Referência ao ficheiro Mainpage.h
+
+ + + + + +
+ +
+ + + + diff --git a/docs/d1/d2b/Mainpage_8h_source.html b/docs/d1/d2b/Mainpage_8h_source.html new file mode 100644 index 0000000..7d23fab --- /dev/null +++ b/docs/d1/d2b/Mainpage_8h_source.html @@ -0,0 +1,83 @@ + + + + +Shell: Mainpage.h Source File + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+
Mainpage.h
+
+ +
+ + + + +
+ +
+ + + + diff --git a/docs/d2/d72/parser_8c.html b/docs/d2/d72/parser_8c.html new file mode 100644 index 0000000..9bc26a7 --- /dev/null +++ b/docs/d2/d72/parser_8c.html @@ -0,0 +1,252 @@ + + + + +Shell: Referência ao ficheiro parser.c + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência ao ficheiro parser.c
+
+
+
#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include "parser.h"
+#include "main.h"
+
+ + + + + + + + + + +

+Funções

void imprimir_argv (char **matriz, int tamanho)
int word_count (char *source)
 Conta o número de palavras de uma string.
void getCmds (LIST *cmdList, char *cmdLine)
 Adiciona em uma lista o(s) comando(s) digitado(s) pelo usuário.
void parse (char *cmdLine, COMMAND *cmd)
 Recebe a linha de comando e separa os argumentos.
char * readline ()
 Lê o comando digitado pelo usuário.
+

Documentação das funções

+ +
+
+ + + + + + + + + + + + + + + + + + +
void getCmds (LISTcmdList,
char * cmdLine 
)
+
+
+ +

Adiciona em uma lista o(s) comando(s) digitado(s) pelo usuário.

+

Pega toda a linha de comando digitada e adiciona o comando com seus parâmetros na lista. Em caso de uso do pipe, haverá mais de um comando a ser executado, ela quebrará a linha de comando e colocará cada comando com seus parâmetros em uma lista.

+
Parâmetros:
+ + + +
cmdList- lista onde os comandos serão armazenados
cmdLine- linha de comando digitada pelo usuário
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void imprimir_argv (char ** matriz,
int tamanho 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void parse (char * cmdLine,
COMMANDcommand 
)
+
+
+ +

Recebe a linha de comando e separa os argumentos.

+

Retira os espaços entre os comandos e seus argumentos, armazena os comandos e seus parâmetros em um vetor de strings, na última posição do vetor coloca NULL, isso para o camando ser interpretado pela função execvp.

+
Parâmetros:
+ + + +
cmdLine- linha de comando que será "parseada".
command- estrutura que receberá cada comando, com suas flags e parâmetros
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + +
char* readline ()
+
+
+ +

Lê o comando digitado pelo usuário.

+
Retorna:
Comando digitado pelo usuário.
+ +
+
+ +
+
+ + + + + + + + +
int word_count (char * source)
+
+
+ +

Conta o número de palavras de uma string.

+
Parâmetros:
+ + +
source- String para contar.
+
+
+
Retorna:
Número de palavras da string passada como parâmetro.
+ +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/d4/dbf/main_8h.html b/docs/d4/dbf/main_8h.html new file mode 100644 index 0000000..74e256e --- /dev/null +++ b/docs/d4/dbf/main_8h.html @@ -0,0 +1,321 @@ + + + + +Shell: Referência ao ficheiro main.h + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência ao ficheiro main.h
+
+
+
#include "list.h"
+
+

Ir para o código fonte deste ficheiro.

+ + + + + + + + + + + + + + + + + + + + +

+Funções

void printPrompt ()
 Imprime o prompt na tela (formato copiado do gnome shell).
void termination_handler (int signum)
 Função executada quando usuário manda ctrl+c.
void child_handler (int signum)
 Função executada quando um processo filho termina.
void sigtstop_handler (int signum)
 Função executada quando usuário manda ctrl+z.
void free_memory ()
 Função que libera memória utilizada antes de terminar o programa.

+Variáveis

char * userdir
char * username
char hostname [256]
char * cmdLine
HISTORYhistory
LISTcmdList
LISTchilds
+

Documentação das funções

+ +
+
+ + + + + + + + +
void child_handler (int signum)
+
+
+ +

Função executada quando um processo filho termina.

+

Esta função só é útil para processos em background, já que ela fica bloqueada quando um processo roda em foreground.

+
Parâmetros:
+ + +
signum- id do sinal.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + +
void free_memory ()
+
+
+ +

Função que libera memória utilizada antes de terminar o programa.

+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + +
void printPrompt ()
+
+
+ +

Imprime o prompt na tela (formato copiado do gnome shell).

+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void sigtstop_handler (int signum)
+
+
+ +

Função executada quando usuário manda ctrl+z.

+
Parâmetros:
+ + +
signum- id do sinal.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void termination_handler (int signum)
+
+
+ +

Função executada quando usuário manda ctrl+c.

+
Parâmetros:
+ + +
signum- id do sinal.
+
+
+
Retorna:
void.
+ +
+
+

Documentação das variáveis

+ +
+
+ + + + +
LIST* childs
+
+
+ +
+
+ +
+
+ + + + +
char* cmdLine
+
+
+ +
+
+ +
+
+ + + + +
LIST* cmdList
+
+
+ +
+
+ +
+
+ + + + +
HISTORY* history
+
+
+ +
+
+ +
+
+ + + + +
char hostname[256]
+
+
+ +
+
+ +
+
+ + + + +
char* userdir
+
+
+ +
+
+ +
+
+ + + + +
char* username
+
+
+ +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/d4/dbf/main_8h_source.html b/docs/d4/dbf/main_8h_source.html new file mode 100644 index 0000000..2b3182d --- /dev/null +++ b/docs/d4/dbf/main_8h_source.html @@ -0,0 +1,106 @@ + + + + +Shell: main.h Source File + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+
main.h
+
+
+Ir para a documentação deste ficheiro.
00001 #ifndef _MAIN_H_
+00002 #define _MAIN_H_
+00003 #include "list.h"
+00004 
+00010 void printPrompt();
+00011 
+00018 void termination_handler(int signum);
+00019 
+00030 void child_handler(int signum);
+00031 
+00038 void sigtstop_handler(int signum);
+00039 
+00046 void free_memory();
+00047 
+00048 char * userdir;
+00049 char * username;
+00050 char hostname[256];
+00051 char * cmdLine;
+00052 
+00053 HISTORY *history;
+00054 LIST * cmdList;
+00055 LIST * childs;
+00056 
+00057 #endif
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/d5/d36/parser_8h.html b/docs/d5/d36/parser_8h.html new file mode 100644 index 0000000..cb1f2cf --- /dev/null +++ b/docs/d5/d36/parser_8h.html @@ -0,0 +1,221 @@ + + + + +Shell: Referência ao ficheiro parser.h + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência ao ficheiro parser.h
+
+
+
#include "list.h"
+
+

Ir para o código fonte deste ficheiro.

+ + + + + + + + + + +

+Funções

int word_count (char *source)
 Conta o número de palavras de uma string.
char * readline ()
 Lê o comando digitado pelo usuário.
void getCmds (LIST *cmdList, char *cmdLine)
 Adiciona em uma lista o(s) comando(s) digitado(s) pelo usuário.
void parse (char *cmdLine, COMMAND *command)
 Recebe a linha de comando e separa os argumentos.
+

Documentação das funções

+ +
+
+ + + + + + + + + + + + + + + + + + +
void getCmds (LISTcmdList,
char * cmdLine 
)
+
+
+ +

Adiciona em uma lista o(s) comando(s) digitado(s) pelo usuário.

+

Pega toda a linha de comando digitada e adiciona o comando com seus parâmetros na lista. Em caso de uso do pipe, haverá mais de um comando a ser executado, ela quebrará a linha de comando e colocará cada comando com seus parâmetros em uma lista.

+
Parâmetros:
+ + + +
cmdList- lista onde os comandos serão armazenados
cmdLine- linha de comando digitada pelo usuário
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void parse (char * cmdLine,
COMMANDcommand 
)
+
+
+ +

Recebe a linha de comando e separa os argumentos.

+

Retira os espaços entre os comandos e seus argumentos, armazena os comandos e seus parâmetros em um vetor de strings, na última posição do vetor coloca NULL, isso para o camando ser interpretado pela função execvp.

+
Parâmetros:
+ + + +
cmdLine- linha de comando que será "parseada".
command- estrutura que receberá cada comando, com suas flags e parâmetros
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + +
char* readline ()
+
+
+ +

Lê o comando digitado pelo usuário.

+
Retorna:
Comando digitado pelo usuário.
+ +
+
+ +
+
+ + + + + + + + +
int word_count (char * source)
+
+
+ +

Conta o número de palavras de uma string.

+
Parâmetros:
+ + +
source- String para contar.
+
+
+
Retorna:
Número de palavras da string passada como parâmetro.
+ +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/d5/d36/parser_8h_source.html b/docs/d5/d36/parser_8h_source.html new file mode 100644 index 0000000..e09c6cb --- /dev/null +++ b/docs/d5/d36/parser_8h_source.html @@ -0,0 +1,94 @@ + + + + +Shell: parser.h Source File + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+
parser.h
+
+
+Ir para a documentação deste ficheiro.
00001 #ifndef _PARSER_H_
+00002 #define _PARSER_H_
+00003 #include "list.h"
+00010 int word_count(char * source);
+00011 
+00017 char * readline();
+00018 
+00032 void getCmds(LIST *cmdList, char *cmdLine);
+00033 
+00046 void parse(char * cmdLine, COMMAND * command);
+00047 
+00048 #endif
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/d6/dcd/builtin_8h.html b/docs/d6/dcd/builtin_8h.html new file mode 100644 index 0000000..444e51c --- /dev/null +++ b/docs/d6/dcd/builtin_8h.html @@ -0,0 +1,466 @@ + + + + +Shell: Referência ao ficheiro builtin.h + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência ao ficheiro builtin.h
+
+
+ +

Ir para o código fonte deste ficheiro.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Funções

int isBuiltIn (char *cmd)
 Verifica se o comando é BuiltIn.
void callBuiltIn (int cmd_id, COMMAND *cmd)
 Executa o comando BuiltIn.
void add_history (char *cmd)
 Adiciona o comando do usuário na lista do histórico.
void print_history (COMMAND *cmd)
 Imprime os comando armazenados no histórico.
void free_history ()
 Libera memória alocada pelo histórico.
void cd (char *arg)
 Muda o diretório atual no qual o sistema está trabalhando.
void pwd (COMMAND *cmd)
 Mostra o diretório no qual o sistema está trabalhando.
void jobs (COMMAND *cmd)
 Mostra uma lista com os jobs atuais.
void bg (char *arg)
 Coloca um processo em background.
void fg (char *arg)
 Coloca um processo suspenso em foreground.
void kill_cmd (char *arg)
 Manda o sinal SIGTERM para um processo filho.
void echo (COMMAND *cmd)
 imprime os argumentos enviados na tela.
void about (COMMAND *cmd)
 Comando simples que imprime informações sobre os autores.
+

Documentação das funções

+ +
+
+ + + + + + + + +
void about (COMMANDcmd)
+
+
+ +

Comando simples que imprime informações sobre os autores.

+
Parâmetros:
+ + +
cmd- Estrutura com informações do comando. (Necessário para redirecionamento de saída).
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void add_history (char * cmd)
+
+
+ +

Adiciona o comando do usuário na lista do histórico.

+
Parâmetros:
+ + +
cmd- Comando a ser adicionado.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void bg (char * arg)
+
+
+ +

Coloca um processo em background.

+
Parâmetros:
+ + +
arg- Id do processo a ser colocado em background, se for NULL o processo mais recente é colocado em foreground.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void callBuiltIn (int cmd_id,
COMMANDcmd 
)
+
+
+ +

Executa o comando BuiltIn.

+
Parâmetros:
+ + + +
cmd_id- id do comando a ser executado, retorno da função isBuiltIn.
cmd- Estrutura com informações do comando.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void cd (char * arg)
+
+
+ +

Muda o diretório atual no qual o sistema está trabalhando.

+
Parâmetros:
+ + +
arg- Diretorio para o qual deseja mudar.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void echo (COMMANDcmd)
+
+
+ +

imprime os argumentos enviados na tela.

+
Parâmetros:
+ + +
cmd- Estrutura com informações do comando. Daqui se extrai os argumentos a serem imprimidos. (Também necessário para redirecionamento de saída).
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void fg (char * arg)
+
+
+ +

Coloca um processo suspenso em foreground.

+
Parâmetros:
+ + +
arg- Id do processo a ser colocado em foreground, se for NULL o processo suspenso mais recente é colocado em foreground.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + +
void free_history ()
+
+
+ +

Libera memória alocada pelo histórico.

+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
int isBuiltIn (char * cmd)
+
+
+ +

Verifica se o comando é BuiltIn.

+

Se o comando for BuiltIn, retorna seu id para ser executado posteriormente.

+
Parâmetros:
+ + +
cmd- comando a ser analisado.
+
+
+
Retorna:
Valor do id do comando.
+
Valores retornados:
+ + +
-1Se o comando não é BuiltIn.
+
+
+ +
+
+ +
+
+ + + + + + + + +
void jobs (COMMANDcmd)
+
+
+ +

Mostra uma lista com os jobs atuais.

+
Parâmetros:
+ + +
cmd- Estrutura com informações do comando. (Necessário para redirecionamento de saída).
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void kill_cmd (char * arg)
+
+
+ +

Manda o sinal SIGTERM para um processo filho.

+
Parâmetros:
+ + +
arg- Id do processo a receber o sinal, se for NULL o processo mais recente recebe o sinal.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void print_history (COMMANDcmd)
+
+
+ +

Imprime os comando armazenados no histórico.

+
Parâmetros:
+ + +
cmd- Estrutura com possível parâmetro do comando, representa quantos comandos deseja imprimir, se for NULL imprime os últimos 10, que é o valor default.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void pwd (COMMANDcmd)
+
+
+ +

Mostra o diretório no qual o sistema está trabalhando.

+
Parâmetros:
+ + +
cmd- Estrutura com informações do comando. (Necessário para redirecionamento de saída).
+
+
+
Retorna:
void.
+ +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/d6/dcd/builtin_8h_source.html b/docs/d6/dcd/builtin_8h_source.html new file mode 100644 index 0000000..c034c00 --- /dev/null +++ b/docs/d6/dcd/builtin_8h_source.html @@ -0,0 +1,111 @@ + + + + +Shell: builtin.h Source File + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+
builtin.h
+
+
+Ir para a documentação deste ficheiro.
00001 #ifndef _BUILTIN_H_
+00002 #define _BUILTIN_H_
+00003 
+00014 int isBuiltIn(char * cmd);
+00015 
+00023 void callBuiltIn(int cmd_id, COMMAND *cmd);
+00024 
+00031 void add_history(char * cmd);
+00032 
+00041 void print_history(COMMAND *cmd);
+00042 
+00048 void free_history();
+00049 
+00056 void cd(char * arg);
+00057 
+00065 void pwd(COMMAND *cmd);
+00066 
+00074 void jobs(COMMAND *cmd);
+00075 
+00083 void bg(char * arg);
+00084 
+00092 void fg(char * arg);
+00093 
+00101 void kill_cmd(char * arg);
+00102 
+00111 void echo (COMMAND *cmd);
+00112 
+00120 void about(COMMAND *cmd);
+00121 #endif
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/d7/d40/list_8c.html b/docs/d7/d40/list_8c.html new file mode 100644 index 0000000..46a6f0c --- /dev/null +++ b/docs/d7/d40/list_8c.html @@ -0,0 +1,407 @@ + + + + +Shell: Referência ao ficheiro list.c + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência ao ficheiro list.c
+
+
+
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "list.h"
+
+ + + + + + + + + + + + + + + + + + + +

+Funções

void ListCreate (LIST *list)
 Inicializa a lista para uso posterior.
void initCommand (COMMAND *cmd)
 Inicializa um comando (estrutura) para uso posterior.
int ListIsEmpty (LIST *list)
 Verifica se uma lista está vazia.
int ListInsert (LIST *list, PROCESS *proc, COMMAND *cmd)
 Insere um processo e/ou um comando na lista.
int ListRemoveByPid (LIST *list, pid_t pid)
 Remove um processo da lista pelo seu ID.
PROCESSListGetCurrentProcess (LIST *list)
 Retorna o processo que está rodando em foreground.
PROCESSListGetLastStopped (LIST *list)
 Busca e retorna o processo parado mais recente.
PROCESSListGetProcess (LIST *list, pid_t pid)
 Retorna um processo pelo seu id.
void ListPurgeCmds (LIST *list)
 Libera espaço alocado pela lista de comandos.
+

Documentação das funções

+ +
+
+ + + + + + + + +
void initCommand (COMMANDcmd)
+
+
+ +

Inicializa um comando (estrutura) para uso posterior.

+
Parâmetros:
+ + +
cmd- Ponteiro para comando (estrutura) a ser inicializada.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void ListCreate (LISTlist)
+
+
+ +

Inicializa a lista para uso posterior.

+
Parâmetros:
+ + +
list- Ponteiro para lista a ser inicializada.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
PROCESS* ListGetCurrentProcess (LISTlist)
+
+
+ +

Retorna o processo que está rodando em foreground.

+
Parâmetros:
+ + +
list- Ponteiro para a lista de processos.
+
+
+
Retorna:
Processo em questão. (NULL caso não tenha um).
+ +
+
+ +
+
+ + + + + + + + +
PROCESS* ListGetLastStopped (LISTlist)
+
+
+ +

Busca e retorna o processo parado mais recente.

+
Parâmetros:
+ + +
list- Ponteiro para a lista de processos.
+
+
+
Retorna:
Processo em questão. (NULL caso não tenha um).
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
PROCESS* ListGetProcess (LISTlist,
pid_t pid 
)
+
+
+ +

Retorna um processo pelo seu id.

+
Parâmetros:
+ + + +
list- Ponteiro para a lista.
pid- Id do processo a ser procurado.
+
+
+
Retorna:
Ponteiro para o processo. (NULL caso não encontrado).
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int ListInsert (LISTlist,
PROCESSproc,
COMMANDcmd 
)
+
+
+ +

Insere um processo e/ou um comando na lista.

+

Na prática, deve ser usada uma lista para comandos e outra para processos. Elas só estão na mesma estrutura para evitar repetição de código. Caso esteja inserindo em uma lista de processos, o argumento cmd deve ser NULL. Caso esteja inserindo em uma lista de comandos, o argumento proc deve ser NULL.

+
Parâmetros:
+ + + + +
list- Ponteiro para a lista.
proc- Ponteiro para processo (estrutura).
cmd- Ponteiro para comando (estrutura).
+
+
+
Retorna:
Se foi possível inserir.
+
Valores retornados:
+ + + +
1- Sim.
0- Não.
+
+
+ +
+
+ +
+
+ + + + + + + + +
int ListIsEmpty (LISTlist)
+
+
+ +

Verifica se uma lista está vazia.

+
Parâmetros:
+ + +
list- Ponteiro para a lista.
+
+
+
Retorna:
Se a lista está vazia.
+
Valores retornados:
+ + + +
1- Sim.
0- Não.
+
+
+ +
+
+ +
+
+ + + + + + + + +
void ListPurgeCmds (LISTlist)
+
+
+ +

Libera espaço alocado pela lista de comandos.

+
Parâmetros:
+ + +
list- Ponteiro para a lista de comandos.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int ListRemoveByPid (LISTlist,
pid_t pid 
)
+
+
+ +

Remove um processo da lista pelo seu ID.

+
Parâmetros:
+ + + +
list- Ponteiro para a lista de processos.
pid- ID do processo.
+
+
+
Retorna:
Se a remoção foi feita.
+
Valores retornados:
+ + + +
1- Sim.
0- Não.
+
+
+ +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/d8/d91/structLIST.html b/docs/d8/d91/structLIST.html new file mode 100644 index 0000000..d7b0872 --- /dev/null +++ b/docs/d8/d91/structLIST.html @@ -0,0 +1,128 @@ + + + + +Shell: Referência à estrutura LIST + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência à estrutura LIST
+
+
+ +

Estrutura da lista em si. + Mais...

+ +

#include <list.h>

+ + + + +

+Campos de Dados

NODEfirst
NODElast
+

Descrição detalhada

+

Estrutura da lista em si.

+

Documentação dos campos e atributos

+ +
+
+ + + + +
NODE* LIST::first
+
+
+ +
+
+ +
+
+ + + + +
NODE* LIST::last
+
+
+ +
+
+
A documentação para esta estrutura foi gerada a partir do seguinte ficheiro: +
+ + + + +
+ +
+ + + + diff --git a/docs/d9/d2e/structhistory.html b/docs/d9/d2e/structhistory.html new file mode 100644 index 0000000..5dfa6ca --- /dev/null +++ b/docs/d9/d2e/structhistory.html @@ -0,0 +1,128 @@ + + + + +Shell: Referência à estrutura history + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência à estrutura history
+
+
+ +

Lista simples para uso do comando builtin history. + Mais...

+ +

#include <list.h>

+ + + + +

+Campos de Dados

char * cmd
struct historynext
+

Descrição detalhada

+

Lista simples para uso do comando builtin history.

+

Documentação dos campos e atributos

+ +
+
+ + + + +
char* history::cmd
+
+
+ +
+
+ +
+
+ + + + +
struct history* history::next
+
+
+ +
+
+
A documentação para esta estrutura foi gerada a partir do seguinte ficheiro: +
+ + + + +
+ +
+ + + + diff --git a/docs/da/d23/list_8h.html b/docs/da/d23/list_8h.html new file mode 100644 index 0000000..b53913f --- /dev/null +++ b/docs/da/d23/list_8h.html @@ -0,0 +1,457 @@ + + + + +Shell: Referência ao ficheiro list.h + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência ao ficheiro list.h
+
+
+ +

Ir para o código fonte deste ficheiro.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Estruturas de Dados

struct  history
 Lista simples para uso do comando builtin history. Mais...
struct  PROCESS
 Estrutura do processo. Mais...
struct  COMMAND
 Estrutura do comando. Mais...
struct  NODE
 Nó das listas de comandos e processos. Mais...
struct  LIST
 Estrutura da lista em si. Mais...

+Definições de tipos

typedef struct history HISTORY
 Lista simples para uso do comando builtin history.
typedef struct NODE NODE
 Nó das listas de comandos e processos.

+Funções

void ListCreate (LIST *list)
 Inicializa a lista para uso posterior.
void initCommand (COMMAND *cmd)
 Inicializa um comando (estrutura) para uso posterior.
int ListIsEmpty (LIST *list)
 Verifica se uma lista está vazia.
int ListInsert (LIST *list, PROCESS *proc, COMMAND *cmd)
 Insere um processo e/ou um comando na lista.
int ListRemoveByPid (LIST *list, pid_t pid)
 Remove um processo da lista pelo seu ID.
PROCESSListGetCurrentProcess (LIST *list)
 Retorna o processo que está rodando em foreground.
PROCESSListGetLastStopped (LIST *list)
 Busca e retorna o processo parado mais recente.
PROCESSListGetProcess (LIST *list, pid_t pid)
 Retorna um processo pelo seu id.
void ListPurgeCmds (LIST *list)
 Libera espaço alocado pela lista de comandos.
+

Documentação dos tipos

+ +
+
+ + + + +
typedef struct history HISTORY
+
+
+ +

Lista simples para uso do comando builtin history.

+ +
+
+ +
+
+ + + + +
typedef struct NODE NODE
+
+
+ +

Nó das listas de comandos e processos.

+

Temos na mesma estrutura de nó um ponteiro para comando e outro para processo. Isso foi feito para facilitar a implementação, os dois não devem ser usados juntos.

+ +
+
+

Documentação das funções

+ +
+
+ + + + + + + + +
void initCommand (COMMANDcmd)
+
+
+ +

Inicializa um comando (estrutura) para uso posterior.

+
Parâmetros:
+ + +
cmd- Ponteiro para comando (estrutura) a ser inicializada.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void ListCreate (LISTlist)
+
+
+ +

Inicializa a lista para uso posterior.

+
Parâmetros:
+ + +
list- Ponteiro para lista a ser inicializada.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
PROCESS* ListGetCurrentProcess (LISTlist)
+
+
+ +

Retorna o processo que está rodando em foreground.

+
Parâmetros:
+ + +
list- Ponteiro para a lista de processos.
+
+
+
Retorna:
Processo em questão. (NULL caso não tenha um).
+ +
+
+ +
+
+ + + + + + + + +
PROCESS* ListGetLastStopped (LISTlist)
+
+
+ +

Busca e retorna o processo parado mais recente.

+
Parâmetros:
+ + +
list- Ponteiro para a lista de processos.
+
+
+
Retorna:
Processo em questão. (NULL caso não tenha um).
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
PROCESS* ListGetProcess (LISTlist,
pid_t pid 
)
+
+
+ +

Retorna um processo pelo seu id.

+
Parâmetros:
+ + + +
list- Ponteiro para a lista.
pid- Id do processo a ser procurado.
+
+
+
Retorna:
Ponteiro para o processo. (NULL caso não encontrado).
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int ListInsert (LISTlist,
PROCESSproc,
COMMANDcmd 
)
+
+
+ +

Insere um processo e/ou um comando na lista.

+

Na prática, deve ser usada uma lista para comandos e outra para processos. Elas só estão na mesma estrutura para evitar repetição de código. Caso esteja inserindo em uma lista de processos, o argumento cmd deve ser NULL. Caso esteja inserindo em uma lista de comandos, o argumento proc deve ser NULL.

+
Parâmetros:
+ + + + +
list- Ponteiro para a lista.
proc- Ponteiro para processo (estrutura).
cmd- Ponteiro para comando (estrutura).
+
+
+
Retorna:
Se foi possível inserir.
+
Valores retornados:
+ + + +
1- Sim.
0- Não.
+
+
+ +
+
+ +
+
+ + + + + + + + +
int ListIsEmpty (LISTlist)
+
+
+ +

Verifica se uma lista está vazia.

+
Parâmetros:
+ + +
list- Ponteiro para a lista.
+
+
+
Retorna:
Se a lista está vazia.
+
Valores retornados:
+ + + +
1- Sim.
0- Não.
+
+
+ +
+
+ +
+
+ + + + + + + + +
void ListPurgeCmds (LISTlist)
+
+
+ +

Libera espaço alocado pela lista de comandos.

+
Parâmetros:
+ + +
list- Ponteiro para a lista de comandos.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int ListRemoveByPid (LISTlist,
pid_t pid 
)
+
+
+ +

Remove um processo da lista pelo seu ID.

+
Parâmetros:
+ + + +
list- Ponteiro para a lista de processos.
pid- ID do processo.
+
+
+
Retorna:
Se a remoção foi feita.
+
Valores retornados:
+ + + +
1- Sim.
0- Não.
+
+
+ +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/da/d23/list_8h_source.html b/docs/da/d23/list_8h_source.html new file mode 100644 index 0000000..78f6340 --- /dev/null +++ b/docs/da/d23/list_8h_source.html @@ -0,0 +1,149 @@ + + + + +Shell: list.h Source File + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+
list.h
+
+
+Ir para a documentação deste ficheiro.
00001 #ifndef _LISTA_H_
+00002 #define _LISTA_H_
+00003 
+00007 typedef struct history
+00008 {
+00009     char * cmd;
+00010     struct history *next;
+00011 } HISTORY;
+00012 
+00019 typedef struct
+00020 {
+00021     pid_t pid;
+00022     char command[256];
+00023     char status[100];
+00024     int isBackground;
+00025 } PROCESS;
+00026 
+00037 typedef struct
+00038 {
+00039     char **args;
+00040     int isBackground;
+00041     int input_r;
+00042     int output_r;
+00043     int output_r_append;
+00044     int size;
+00045     char * output_r_filename;
+00046     char * input_r_filename;
+00047     int id;
+00048     int pipe[2];
+00049     pid_t pid;
+00050 } COMMAND;
+00051 
+00059 typedef struct NODE
+00060 {
+00061     PROCESS *proc;
+00062     COMMAND *cmd;
+00063     struct NODE *next;
+00064     struct NODE *prev;
+00065 } NODE;
+00066 
+00067 
+00071 typedef struct
+00072 {
+00073     NODE *first;
+00074     NODE *last;
+00075 } LIST;
+00076 
+00077 
+00082 void ListCreate(LIST *list);
+00083 
+00090 void initCommand(COMMAND *cmd);
+00091 
+00098 int ListIsEmpty(LIST *list);
+00099 
+00117 int ListInsert(LIST *list, PROCESS *proc, COMMAND *cmd);
+00118 
+00126 int ListRemoveByPid(LIST *list, pid_t pid);
+00127 
+00132 PROCESS *ListGetCurrentProcess(LIST *list);
+00133 
+00138 PROCESS * ListGetLastStopped(LIST *list);
+00139 
+00146 PROCESS * ListGetProcess(LIST *list, pid_t pid);
+00147 
+00152 void ListPurgeCmds(LIST *list);
+00153 
+00154 #endif
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/db/d62/structNODE.html b/docs/db/d62/structNODE.html new file mode 100644 index 0000000..97208da --- /dev/null +++ b/docs/db/d62/structNODE.html @@ -0,0 +1,157 @@ + + + + +Shell: Referência à estrutura NODE + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência à estrutura NODE
+
+
+ +

Nó das listas de comandos e processos. + Mais...

+ +

#include <list.h>

+ + + + + + +

+Campos de Dados

PROCESSproc
COMMANDcmd
struct NODEnext
struct NODEprev
+

Descrição detalhada

+

Nó das listas de comandos e processos.

+

Temos na mesma estrutura de nó um ponteiro para comando e outro para processo. Isso foi feito para facilitar a implementação, os dois não devem ser usados juntos.

+

Documentação dos campos e atributos

+ +
+
+ + + + +
COMMAND* NODE::cmd
+
+
+ +
+
+ +
+
+ + + + +
struct NODE* NODE::next
+
+
+ +
+
+ +
+
+ + + + +
struct NODE* NODE::prev
+
+
+ +
+
+ +
+
+ + + + +
PROCESS* NODE::proc
+
+
+ +
+
+
A documentação para esta estrutura foi gerada a partir do seguinte ficheiro: +
+ + + + +
+ +
+ + + + diff --git a/docs/dc/d56/structCOMMAND.html b/docs/dc/d56/structCOMMAND.html new file mode 100644 index 0000000..df437f2 --- /dev/null +++ b/docs/dc/d56/structCOMMAND.html @@ -0,0 +1,255 @@ + + + + +Shell: Referência à estrutura COMMAND + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência à estrutura COMMAND
+
+
+ +

Estrutura do comando. + Mais...

+ +

#include <list.h>

+ + + + + + + + + + + + + +

+Campos de Dados

char ** args
int isBackground
int input_r
int output_r
int output_r_append
int size
char * output_r_filename
char * input_r_filename
int id
int pipe [2]
pid_t pid
+

Descrição detalhada

+

Estrutura do comando.

+

Esta estrutura guarda todas as informações pertinentes de um comando. Nesta implementação, um comando é definido como um execultável ou builtin e seus argumentos. cat arquivo | grep palavra | cut -c 1-6 tem 3 comandos, por exemplo.

+

Documentação dos campos e atributos

+ +
+
+ + + + +
char** COMMAND::args
+
+
+ +
+
+ +
+
+ + + + +
int COMMAND::id
+
+
+ +
+
+ +
+
+ + + + +
int COMMAND::input_r
+
+
+ +
+
+ +
+
+ + + + +
char* COMMAND::input_r_filename
+
+
+ +
+
+ +
+
+ + + + +
int COMMAND::isBackground
+
+
+ +
+
+ +
+
+ + + + +
int COMMAND::output_r
+
+
+ +
+
+ +
+
+ + + + +
int COMMAND::output_r_append
+
+
+ +
+
+ +
+
+ + + + +
char* COMMAND::output_r_filename
+
+
+ +
+
+ +
+
+ + + + +
pid_t COMMAND::pid
+
+
+ +
+
+ +
+
+ + + + +
int COMMAND::pipe[2]
+
+
+ +
+
+ +
+
+ + + + +
int COMMAND::size
+
+
+ +
+
+
A documentação para esta estrutura foi gerada a partir do seguinte ficheiro: +
+ + + + +
+ +
+ + + + diff --git a/docs/dc/dd8/structPROCESS.html b/docs/dc/dd8/structPROCESS.html new file mode 100644 index 0000000..fb3923c --- /dev/null +++ b/docs/dc/dd8/structPROCESS.html @@ -0,0 +1,157 @@ + + + + +Shell: Referência à estrutura PROCESS + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência à estrutura PROCESS
+
+
+ +

Estrutura do processo. + Mais...

+ +

#include <list.h>

+ + + + + + +

+Campos de Dados

pid_t pid
char command [256]
char status [100]
int isBackground
+

Descrição detalhada

+

Estrutura do processo.

+

Esta estrutura guarda todas as informações pertinentes de um processo.

+

Documentação dos campos e atributos

+ +
+
+ + + + +
char PROCESS::command[256]
+
+
+ +
+
+ +
+
+ + + + +
int PROCESS::isBackground
+
+
+ +
+
+ +
+
+ + + + +
pid_t PROCESS::pid
+
+
+ +
+
+ +
+
+ + + + +
char PROCESS::status[100]
+
+
+ +
+
+
A documentação para esta estrutura foi gerada a partir do seguinte ficheiro: +
+ + + + +
+ +
+ + + + diff --git a/docs/dd/da0/todo.html b/docs/dd/da0/todo.html new file mode 100644 index 0000000..37c8976 --- /dev/null +++ b/docs/dd/da0/todo.html @@ -0,0 +1,82 @@ + + + + +Shell: Lista de tarefas + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ +
+
+
+
Lista de tarefas
+
+
+

+
+
page Eina
+
add debug function
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/df/d8a/builtin_8c.html b/docs/df/d8a/builtin_8c.html new file mode 100644 index 0000000..ca96261 --- /dev/null +++ b/docs/df/d8a/builtin_8c.html @@ -0,0 +1,475 @@ + + + + +Shell: Referência ao ficheiro builtin.c + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+ +
+
Referência ao ficheiro builtin.c
+
+
+
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <wait.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include "main.h"
+#include "builtin.h"
+#include "parser.h"
+#include "list.h"
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Funções

int isBuiltIn (char *cmd)
 Verifica se o comando é BuiltIn.
void callBuiltIn (int cmd_id, COMMAND *cmd)
 Executa o comando BuiltIn.
void add_history (char *cmd)
 Adiciona o comando do usuário na lista do histórico.
void print_history (COMMAND *cmd)
 Imprime os comando armazenados no histórico.
void free_history ()
 Libera memória alocada pelo histórico.
void cd (char *arg)
 Muda o diretório atual no qual o sistema está trabalhando.
void pwd (COMMAND *cmd)
 Mostra o diretório no qual o sistema está trabalhando.
void jobs (COMMAND *cmd)
 Mostra uma lista com os jobs atuais.
void bg (char *arg)
 Coloca um processo em background.
void fg (char *arg)
 Coloca um processo suspenso em foreground.
void kill_cmd (char *arg)
 Manda o sinal SIGTERM para um processo filho.
void echo (COMMAND *cmd)
 imprime os argumentos enviados na tela.
void about (COMMAND *cmd)
 Comando simples que imprime informações sobre os autores.
+

Documentação das funções

+ +
+
+ + + + + + + + +
void about (COMMANDcmd)
+
+
+ +

Comando simples que imprime informações sobre os autores.

+
Parâmetros:
+ + +
cmd- Estrutura com informações do comando. (Necessário para redirecionamento de saída).
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void add_history (char * cmd)
+
+
+ +

Adiciona o comando do usuário na lista do histórico.

+
Parâmetros:
+ + +
cmd- Comando a ser adicionado.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void bg (char * arg)
+
+
+ +

Coloca um processo em background.

+
Parâmetros:
+ + +
arg- Id do processo a ser colocado em background, se for NULL o processo mais recente é colocado em foreground.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void callBuiltIn (int cmd_id,
COMMANDcmd 
)
+
+
+ +

Executa o comando BuiltIn.

+
Parâmetros:
+ + + +
cmd_id- id do comando a ser executado, retorno da função isBuiltIn.
cmd- Estrutura com informações do comando.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void cd (char * arg)
+
+
+ +

Muda o diretório atual no qual o sistema está trabalhando.

+
Parâmetros:
+ + +
arg- Diretorio para o qual deseja mudar.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void echo (COMMANDcmd)
+
+
+ +

imprime os argumentos enviados na tela.

+
Parâmetros:
+ + +
cmd- Estrutura com informações do comando. Daqui se extrai os argumentos a serem imprimidos. (Também necessário para redirecionamento de saída).
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void fg (char * arg)
+
+
+ +

Coloca um processo suspenso em foreground.

+
Parâmetros:
+ + +
arg- Id do processo a ser colocado em foreground, se for NULL o processo suspenso mais recente é colocado em foreground.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + +
void free_history ()
+
+
+ +

Libera memória alocada pelo histórico.

+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
int isBuiltIn (char * cmd)
+
+
+ +

Verifica se o comando é BuiltIn.

+

Se o comando for BuiltIn, retorna seu id para ser executado posteriormente.

+
Parâmetros:
+ + +
cmd- comando a ser analisado.
+
+
+
Retorna:
Valor do id do comando.
+
Valores retornados:
+ + +
-1Se o comando não é BuiltIn.
+
+
+ +
+
+ +
+
+ + + + + + + + +
void jobs (COMMANDcmd)
+
+
+ +

Mostra uma lista com os jobs atuais.

+
Parâmetros:
+ + +
cmd- Estrutura com informações do comando. (Necessário para redirecionamento de saída).
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void kill_cmd (char * arg)
+
+
+ +

Manda o sinal SIGTERM para um processo filho.

+
Parâmetros:
+ + +
arg- Id do processo a receber o sinal, se for NULL o processo mais recente recebe o sinal.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void print_history (COMMANDcmd)
+
+
+ +

Imprime os comando armazenados no histórico.

+
Parâmetros:
+ + +
cmd- Estrutura com possível parâmetro do comando, representa quantos comandos deseja imprimir, se for NULL imprime os últimos 10, que é o valor default.
+
+
+
Retorna:
void.
+ +
+
+ +
+
+ + + + + + + + +
void pwd (COMMANDcmd)
+
+
+ +

Mostra o diretório no qual o sistema está trabalhando.

+
Parâmetros:
+ + +
cmd- Estrutura com informações do comando. (Necessário para redirecionamento de saída).
+
+
+
Retorna:
void.
+ +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/doxygen.css b/docs/doxygen.css new file mode 100644 index 0000000..74445fe --- /dev/null +++ b/docs/doxygen.css @@ -0,0 +1,835 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + font-size: 150%; +} + +.title { + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { + color: #4665A2; +} + +a.codeRef { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 10px; + margin-right: 5px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C4CFE5; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; +} + +.memname { + white-space: nowrap; + font-weight: bold; + margin-left: 6px; +} + +.memproto { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 8px; + border-top-left-radius: 8px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + +} + +.memdoc { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 2px 5px; + background-color: #FBFCFD; + border-top-width: 0; + /* opera specific markup */ + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +.params, .retval, .exception, .tparams { + border-spacing: 6px 2px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + + + + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0px; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; + margin: 5px; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + font-size: 8pt; + padding-left: 5px; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug +{ + border-left:4px solid; + padding: 0 0 0 6px; +} + +dl.note +{ + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + border-color: #00D000; +} + +dl.deprecated +{ + border-color: #505050; +} + +dl.todo +{ + border-color: #00C0E0; +} + +dl.test +{ + border-color: #3030E0; +} + +dl.bug +{ + border-color: #C08050; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + diff --git a/docs/doxygen.png b/docs/doxygen.png new file mode 100644 index 0000000000000000000000000000000000000000..635ed52fce7057ac24df92ec7664088a881fa5d0 GIT binary patch literal 3942 zcmV-s51H_ZP)95ENDh(OT9xpYZC{M(=rqI* z+1erNEr&9zRjUI-4rN=4BBz>P@ys*xOjGRjzVE*Fx_qvyt9d@B@BO*&@8Mq!nM{Tc z_WoM84-~xLreSL9@vgZ{m2dF}`u=^ZF3syQ-s2tnBwCI3ZFvSfI20Wbj236~Urq*8Kfw@RKKfRQTgE>}uUHK^ptamY=o)LU(xy55zNQ(`qZ znZ&$O075mrrInIXQgw4%GCbMD8Vn`3n3$EaRwtP1D{A!Gs=e!L%3;ayv@I{rAw{xw z^x^>EIWQM8ob3m}$(BaupDMV;Ed8w5|i(*e`7rU$TOc&1o7`|!LyN5jHI z7uWAR!v4c2xMp?}QmRYyf>i}tYGU(g=>DW&==J@GbhR z5@BNVY3O$`^D%gk4khm9XpFhuwzxUhi9T=Du4rpVuYRSMPHeDqo+4htnZRU@G9`0& z9~p)CsFl1|t*wjfoTo&%davN^3RfJUhQ{ZZIAcD77X^XsF_iR&ZMQ;p>K5*+*48)x z+=<>nh+6Uq85jOkg>{z>a;+V`s(I;I%*5s+R@9a^wNoZ03(g9-EcH%uHvX&yp7`D#`9Kw>DU3s zjD-VuW_A-K)unlS4O3f>_B%pPONUmI#oyL};Lglp3=04>0eBBEw$D1k-$WTsoi#K* z$7h`NcyRZsZ#w~6I<%~u!^xDofYrzF>zVIj2N>Ijs`mVR(Oy&*9f}<{JtQj8jJT!oEc!NQXBq5y|6ET*N?7ox*E6#{i- z@_DLD^IYTtg|Pg?A~!7@OCd8p^)kxK%VBM84docx$Z{MvO)iiqep@or-N}TEU8$%; zJih?#yJ9)V1s_`}c3XbY9V}nEKwNz8ILmR|v)(w|D@oVG;=i`+$*)!(xH{9#$2Za;pyZ1wgU#)mHl|&8%iwu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RxQvep*2 z0mk+kMP>J)K`8X3`6Zq|X~5IQ-_rrOn+_WvU{1Gs{ow1-Eb;K(Z?p$@ugXpr^?PM( z(5Hv;$*X=QZaqG_4q)N1v9sO(Dsei!;%IcIztt6YUs{yj z^77e`UYa^%<-Ts+d*b=ihKt?0_sj!ePNO@K*PGmGD*v^;rRAkduikx~UNk=@{XKeV zp_ir(dTaGVWBr{_02Kg2Xmlsn|IvIIRYivbo|L{yx}yX5Bte@P6C>1KyqvYnT{boB#j-07*qoM6N<$f^XQQ A+yDRo literal 0 HcmV?d00001 diff --git a/docs/files.html b/docs/files.html new file mode 100644 index 0000000..214ca2f --- /dev/null +++ b/docs/files.html @@ -0,0 +1,93 @@ + + + + +Shell: Lista de ficheiros + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + +
+
+
+
Lista de ficheiros
+
+
+
Lista de todos os ficheiros com uma breve descrição:
+ + + + + + + + + +
builtin.c
builtin.h [código]
list.c
list.h [código]
main.c
main.h [código]
Mainpage.h [código]
parser.c
parser.h [código]
+
+ + + + +
+ +
+ + + + diff --git a/docs/functions.html b/docs/functions.html new file mode 100644 index 0000000..ff2d05c --- /dev/null +++ b/docs/functions.html @@ -0,0 +1,148 @@ + + + + +Shell: Campos de dados + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + + +
+
+
Lista de todas as estruturas e campos de uniões com referência para as estruturas/uniões a que pertencem:
+
+ + + + +
+ +
+ + + + diff --git a/docs/functions_vars.html b/docs/functions_vars.html new file mode 100644 index 0000000..1ca2b3a --- /dev/null +++ b/docs/functions_vars.html @@ -0,0 +1,148 @@ + + + + +Shell: Campos de dados - Variáveis + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + + +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/globals.html b/docs/globals.html new file mode 100644 index 0000000..d8200ea --- /dev/null +++ b/docs/globals.html @@ -0,0 +1,351 @@ + + + + +Shell: Globais + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + + + +
+
+
Lista de todas as funções, variáveis, definições, enumerações e definições de tipo com referência para o ficheiro a que pertecem:
+ +

- _ -

+ + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- j -

+ + +

- k -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- w -

+
+ + + + +
+ +
+ + + + diff --git a/docs/globals_defs.html b/docs/globals_defs.html new file mode 100644 index 0000000..03ac738 --- /dev/null +++ b/docs/globals_defs.html @@ -0,0 +1,92 @@ + + + + +Shell: Globais + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + + +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/globals_func.html b/docs/globals_func.html new file mode 100644 index 0000000..7b0eac7 --- /dev/null +++ b/docs/globals_func.html @@ -0,0 +1,301 @@ + + + + +Shell: Globais + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + + + +
+
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- i -

+ + +

- j -

+ + +

- k -

+ + +

- l -

+ + +

- m -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- w -

+
+ + + + +
+ +
+ + + + diff --git a/docs/globals_type.html b/docs/globals_type.html new file mode 100644 index 0000000..92a4d69 --- /dev/null +++ b/docs/globals_type.html @@ -0,0 +1,95 @@ + + + + +Shell: Globais + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + + +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/globals_vars.html b/docs/globals_vars.html new file mode 100644 index 0000000..9b94934 --- /dev/null +++ b/docs/globals_vars.html @@ -0,0 +1,110 @@ + + + + +Shell: Globais + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ + + +
+
+
+ + + + +
+ +
+ + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..64cfa21 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,124 @@ + + + + +Shell: Shell + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ +
+
+
+
Shell
+
+
+
Autor:
Lucas Lobosque - 6792645
+
+José Leandro Pozer - 6793222
+
Data:
16/11/2011
+

+Introdução

+

+Estrutura básica de Arquivos

+

Desenvolvemos o shell utilizando 4 arquivos diferentes (e seus headers):

+
    +
  • +main.c - Arquivo com a função main, onde fica o loop principal e com handlers de sinais como SIGINT, SIGTSTP e SIGCHLD.
  • +
  • +parser.c - Funções relacionadas a transformar a entrada do usuário em uma estrutura compreensível para o programa.
  • +
  • +builtin.c - Aqui estáo todos os comandos builtin e também uma função que checa se um dado comando é builtin ou não.
  • +
  • +list.c - Funções que manipulam as listas usadas pelo programa.
  • +
+

+Estrutura básica de Dados

+

No nosso programa, temos três listas ligadas diferentes que são constantemente utilizadas:

+
    +
  • +history - Esta é a mais simples das três. Guarda strings com os comandos anteriormente utilizados pelo usuário. É usada pelo comando builtin history.
  • +
  • +childs - Nesta lista ligada armazenamos todos os processos que estão rodando ou estão interrompidos.
  • +
  • +cmdList - Lista responsável por guardar o último comando enviado pelo usuário. Nesta lista, o comando é guardado depois de "parseado", então todas suas informações são guardadas aqui (roda no background? tem redirecionamento de saída? pra onde?). Cada item da lista é um comando diferente, sendo que a lista e sempre resetada no loop. Ou seja, esta lista só conterá mais de um item se houver pipe no comando.
  • +
+

+Características Não Implementadas (limitações).

+

Na nossa shell, os seguintes tipos de comando não são possíveis:

+
    +
  • +Comando builtin rodando em background (sempre rodará em foreground).
  • +
  • +Redirecionamento de entrada para comandos builtin (redirecionamento de saída implementado).
  • +
  • +Pipe com comandos builtin
  • +
+

Tornou-se uma tarefa complicada para nós lidar com essas peculiaridades de comandos builtin, já que implementamos sem elas em mente, e, quando percebemos que haveriam essas possibilidades, teríamos que mudar muito a estrutura do programa.

+

+Testes

+

Além de exaustivos testes com vários comandos complexos, rodamos nossa shell com o Valgrind e encontramos vários memory leaks (a maioria causada por erros bobos, porém alguns eram bem complexos). Arrumamos a maioria deles, mas infelizmente teve um leak que não foi possível concertar, pois ele é causado pela função getlogin(), (implementada na unistd.h).

+

+Conclusão

+

Além de bastante desafiador, o desenvolvimento da shell foi de grande valia para nós, já que nunca tivemos um contato a nível de sistema com o Linux. Depois do desenvolvimento desse programa, arriscamos dizer que entendemos ao menos um pouco de Linux :).

+
+ + + + +
+ +
+ + + + diff --git a/docs/installdox b/docs/installdox new file mode 100755 index 0000000..edf5bbf --- /dev/null +++ b/docs/installdox @@ -0,0 +1,112 @@ +#!/usr/bin/perl + +%subst = ( ); +$quiet = 0; + +while ( @ARGV ) { + $_ = shift @ARGV; + if ( s/^-// ) { + if ( /^l(.*)/ ) { + $v = ($1 eq "") ? shift @ARGV : $1; + ($v =~ /\/$/) || ($v .= "/"); + $_ = $v; + if ( /(.+)\@(.+)/ ) { + if ( exists $subst{$1} ) { + $subst{$1} = $2; + } else { + print STDERR "Unknown tag file $1 given with option -l\n"; + &usage(); + } + } else { + print STDERR "Argument $_ is invalid for option -l\n"; + &usage(); + } + } + elsif ( /^q/ ) { + $quiet = 1; + } + elsif ( /^\?|^h/ ) { + &usage(); + } + else { + print STDERR "Illegal option -$_\n"; + &usage(); + } + } + else { + push (@files, $_ ); + } +} + +foreach $sub (keys %subst) +{ + if ( $subst{$sub} eq "" ) + { + print STDERR "No substitute given for tag file `$sub'\n"; + &usage(); + } + elsif ( ! $quiet && $sub ne "_doc" && $sub ne "_cgi" ) + { + print "Substituting $subst{$sub} for each occurrence of tag file $sub\n"; + } +} + +if ( ! @files ) { + if (opendir(D,".")) { + foreach $file ( readdir(D) ) { + $match = ".html"; + next if ( $file =~ /^\.\.?$/ ); + ($file =~ /$match/) && (push @files, $file); + ($file =~ /\.svg/) && (push @files, $file); + ($file =~ "navtree.js") && (push @files, $file); + } + closedir(D); + } +} + +if ( ! @files ) { + print STDERR "Warning: No input files given and none found!\n"; +} + +foreach $f (@files) +{ + if ( ! $quiet ) { + print "Editing: $f...\n"; + } + $oldf = $f; + $f .= ".bak"; + unless (rename $oldf,$f) { + print STDERR "Error: cannot rename file $oldf\n"; + exit 1; + } + if (open(F,"<$f")) { + unless (open(G,">$oldf")) { + print STDERR "Error: opening file $oldf for writing\n"; + exit 1; + } + if ($oldf ne "tree.js") { + while () { + s/doxygen\=\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\" (xlink:href|href|src)=\"\2/doxygen\=\"$1:$subst{$1}\" \3=\"$subst{$1}/g; + print G "$_"; + } + } + else { + while () { + s/\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\", \"\2/\"$1:$subst{$1}\" ,\"$subst{$1}/g; + print G "$_"; + } + } + } + else { + print STDERR "Warning file $f does not exist\n"; + } + unlink $f; +} + +sub usage { + print STDERR "Usage: installdox [options] [html-file [html-file ...]]\n"; + print STDERR "Options:\n"; + print STDERR " -l tagfile\@linkName tag file + URL or directory \n"; + print STDERR " -q Quiet mode\n\n"; + exit 1; +} diff --git a/docs/jquery.js b/docs/jquery.js new file mode 100644 index 0000000..c052173 --- /dev/null +++ b/docs/jquery.js @@ -0,0 +1,54 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0) +{I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function() +{G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); +/* + * jQuery UI 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + */ +jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* * jQuery UI Resizable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * ui.core.js + */ +(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f
');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)) +{s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);; +/** + * jQuery.ScrollTo - Easy element scrolling using jQuery. + * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com + * Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php). + * Date: 2/8/2008 + * @author Ariel Flesler + * @version 1.3.2 + */ +;(function($){var o=$.scrollTo=function(a,b,c){o.window().scrollTo(a,b,c)};o.defaults={axis:'y',duration:1};o.window=function(){return $($.browser.safari?'body':'html')};$.fn.scrollTo=function(l,m,n){if(typeof m=='object'){n=m;m=0}n=$.extend({},o.defaults,n);m=m||n.speed||n.duration;n.queue=n.queue&&n.axis.length>1;if(n.queue)m/=2;n.offset=j(n.offset);n.over=j(n.over);return this.each(function(){var a=this,b=$(a),t=l,c,d={},w=b.is('html,body');switch(typeof t){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(t)){t=j(t);break}t=$(t,this);case'object':if(t.is||t.style)c=(t=$(t)).offset()}$.each(n.axis.split(''),function(i,f){var P=f=='x'?'Left':'Top',p=P.toLowerCase(),k='scroll'+P,e=a[k],D=f=='x'?'Width':'Height';if(c){d[k]=c[p]+(w?0:e-b.offset()[p]);if(n.margin){d[k]-=parseInt(t.css('margin'+P))||0;d[k]-=parseInt(t.css('border'+P+'Width'))||0}d[k]+=n.offset[p]||0;if(n.over[p])d[k]+=t[D.toLowerCase()]()*n.over[p]}else d[k]=t[p];if(/^\d+$/.test(d[k]))d[k]=d[k]<=0?0:Math.min(d[k],h(D));if(!i&&n.queue){if(e!=d[k])g(n.onAfterFirst);delete d[k]}});g(n.onAfter);function g(a){b.animate(d,m,n.easing,a&&function(){a.call(this,l)})};function h(D){var b=w?$.browser.opera?document.body:document.documentElement:a;return b['scroll'+D]-b['client'+D]}})};function j(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); + diff --git a/docs/nav_f.png b/docs/nav_f.png new file mode 100644 index 0000000000000000000000000000000000000000..1b07a16207e67c95fe2ee17e7016e6d08ac7ac99 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^j6iI`!2~2XGqLUlQfZzpjv*C{Z|{2YIT`Y>1X`Eg z-tTbne1`SITM8Q!Pb(<)UFZ(m>wMzvKZQqKM~~GcZ=A7j<~E6K62>ozFS=cD3)mf8 z9WX0+R&m(l9KUsLdTx4?9~({T__KA%`}olPJ^N;y|F^pHgs_K%!rj~{8>RwnWbkzL Kb6Mw<&;$VTdq1fF literal 0 HcmV?d00001 diff --git a/docs/nav_h.png b/docs/nav_h.png new file mode 100644 index 0000000000000000000000000000000000000000..01f5fa6a596e36bd12c2d6ceff1b0169fda7e699 GIT binary patch literal 97 zcmeAS@N?(olHy`uVBq!ia0vp^j6lr8!2~3AUOE6t1`SUa$B+ufw|6&kG8phMJMJ~w va4>Y+bZ&9QY?(VEUPY_cGd9nQ`um^ZSUyYpAAuKhL7F^W{an^LB{Ts5DmojT literal 0 HcmV?d00001 diff --git a/docs/open.png b/docs/open.png new file mode 100644 index 0000000000000000000000000000000000000000..7b35d2c2c389743089632fe24c3104f2173d97af GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{Vww^AIAr*{o=Nbw!DDW^(zOibV zl!F8B0?t?i!vld4k#$~0_AX3zElaokn + + + +Shell: Páginas relacionadas + + + + + + + + +
+
+ + + + + + +
+
Shell
+
+
+ +
+
+
+
Páginas relacionadas
+
+
+
Lista de documentação relacionada:
+
+ + + + +
+ +
+ + + + diff --git a/docs/search/all_5f.html b/docs/search/all_5f.html new file mode 100644 index 0000000..fcadb85 --- /dev/null +++ b/docs/search/all_5f.html @@ -0,0 +1,26 @@ + + + + + + + +
+
Loading...
+
+
+ _GNU_SOURCE + main.c +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_61.html b/docs/search/all_61.html new file mode 100644 index 0000000..eedd8f3 --- /dev/null +++ b/docs/search/all_61.html @@ -0,0 +1,44 @@ + + + + + + + +
+
Loading...
+ + +
+
+ args + COMMAND +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_62.html b/docs/search/all_62.html new file mode 100644 index 0000000..4d4aa73 --- /dev/null +++ b/docs/search/all_62.html @@ -0,0 +1,39 @@ + + + + + + + +
+
Loading...
+ +
+
+ builtin.c +
+
+
+
+ builtin.h +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_63.html b/docs/search/all_63.html new file mode 100644 index 0000000..fbde031 --- /dev/null +++ b/docs/search/all_63.html @@ -0,0 +1,83 @@ + + + + + + + +
+
Loading...
+ + + +
+
+ childs + main.h +
+
+
+ +
+
+
+ cmdLine + main.h +
+
+
+
+ cmdList + main.h +
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_65.html b/docs/search/all_65.html new file mode 100644 index 0000000..98ef9d1 --- /dev/null +++ b/docs/search/all_65.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_66.html b/docs/search/all_66.html new file mode 100644 index 0000000..ab841c8 --- /dev/null +++ b/docs/search/all_66.html @@ -0,0 +1,53 @@ + + + + + + + +
+
Loading...
+ +
+
+ first + LIST +
+
+ + +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_67.html b/docs/search/all_67.html new file mode 100644 index 0000000..6824140 --- /dev/null +++ b/docs/search/all_67.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_68.html b/docs/search/all_68.html new file mode 100644 index 0000000..c71b7df --- /dev/null +++ b/docs/search/all_68.html @@ -0,0 +1,36 @@ + + + + + + + +
+
Loading...
+ +
+
+ hostname + main.h +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_69.html b/docs/search/all_69.html new file mode 100644 index 0000000..f1fa5d6 --- /dev/null +++ b/docs/search/all_69.html @@ -0,0 +1,71 @@ + + + + + + + +
+
Loading...
+
+
+ id + COMMAND +
+
+
+
+ imprimir_argv + parser.c +
+
+ +
+
+ input_r + COMMAND +
+
+
+
+ input_r_filename + COMMAND +
+
+ + +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_6a.html b/docs/search/all_6a.html new file mode 100644 index 0000000..be9587a --- /dev/null +++ b/docs/search/all_6a.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_6b.html b/docs/search/all_6b.html new file mode 100644 index 0000000..cfceb40 --- /dev/null +++ b/docs/search/all_6b.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_6c.html b/docs/search/all_6c.html new file mode 100644 index 0000000..be76bc7 --- /dev/null +++ b/docs/search/all_6c.html @@ -0,0 +1,113 @@ + + + + + + + + + + diff --git a/docs/search/all_6d.html b/docs/search/all_6d.html new file mode 100644 index 0000000..4931189 --- /dev/null +++ b/docs/search/all_6d.html @@ -0,0 +1,41 @@ + + + + + + + +
+
Loading...
+
+
+ main + main.c +
+
+
+
+ main.c +
+
+
+
+ main.h +
+
+
+ +
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_6e.html b/docs/search/all_6e.html new file mode 100644 index 0000000..e93b089 --- /dev/null +++ b/docs/search/all_6e.html @@ -0,0 +1,38 @@ + + + + + + + +
+
Loading...
+ +
+
+ NODE + +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_6f.html b/docs/search/all_6f.html new file mode 100644 index 0000000..275ca78 --- /dev/null +++ b/docs/search/all_6f.html @@ -0,0 +1,38 @@ + + + + + + + +
+
Loading...
+
+
+ output_r + COMMAND +
+
+
+
+ output_r_append + COMMAND +
+
+
+
+ output_r_filename + COMMAND +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_70.html b/docs/search/all_70.html new file mode 100644 index 0000000..df011ca --- /dev/null +++ b/docs/search/all_70.html @@ -0,0 +1,98 @@ + + + + + + + +
+
Loading...
+ +
+
+ parser.c +
+
+
+
+ parser.h +
+
+ +
+
+ pipe + COMMAND +
+
+
+
+ prev + NODE +
+
+ + +
+
+ proc + NODE +
+
+
+
+ PROCESS +
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_72.html b/docs/search/all_72.html new file mode 100644 index 0000000..0515695 --- /dev/null +++ b/docs/search/all_72.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_73.html b/docs/search/all_73.html new file mode 100644 index 0000000..54a915b --- /dev/null +++ b/docs/search/all_73.html @@ -0,0 +1,41 @@ + + + + + + + +
+
Loading...
+ +
+
+ size + COMMAND +
+
+
+
+ status + PROCESS +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_74.html b/docs/search/all_74.html new file mode 100644 index 0000000..da28034 --- /dev/null +++ b/docs/search/all_74.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_75.html b/docs/search/all_75.html new file mode 100644 index 0000000..2e40578 --- /dev/null +++ b/docs/search/all_75.html @@ -0,0 +1,32 @@ + + + + + + + +
+
Loading...
+
+
+ userdir + main.h +
+
+
+
+ username + main.h +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/all_77.html b/docs/search/all_77.html new file mode 100644 index 0000000..310c5f3 --- /dev/null +++ b/docs/search/all_77.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/classes_63.html b/docs/search/classes_63.html new file mode 100644 index 0000000..bf09ff0 --- /dev/null +++ b/docs/search/classes_63.html @@ -0,0 +1,25 @@ + + + + + + + +
+
Loading...
+
+
+ COMMAND +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/classes_68.html b/docs/search/classes_68.html new file mode 100644 index 0000000..1ec1c3d --- /dev/null +++ b/docs/search/classes_68.html @@ -0,0 +1,25 @@ + + + + + + + +
+
Loading...
+
+
+ history +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/classes_6c.html b/docs/search/classes_6c.html new file mode 100644 index 0000000..183f604 --- /dev/null +++ b/docs/search/classes_6c.html @@ -0,0 +1,25 @@ + + + + + + + +
+
Loading...
+
+
+ LIST +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/classes_6e.html b/docs/search/classes_6e.html new file mode 100644 index 0000000..1bca842 --- /dev/null +++ b/docs/search/classes_6e.html @@ -0,0 +1,25 @@ + + + + + + + +
+
Loading...
+
+
+ NODE +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/classes_70.html b/docs/search/classes_70.html new file mode 100644 index 0000000..f8dd44e --- /dev/null +++ b/docs/search/classes_70.html @@ -0,0 +1,25 @@ + + + + + + + +
+
Loading...
+
+
+ PROCESS +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/close.png b/docs/search/close.png new file mode 100644 index 0000000000000000000000000000000000000000..9342d3dfeea7b7c4ee610987e717804b5a42ceb9 GIT binary patch literal 273 zcmV+s0q*{ZP)4(RlMby96)VwnbG{ zbe&}^BDn7x>$<{ck4zAK-=nT;=hHG)kmplIF${xqm8db3oX6wT3bvp`TE@m0cg;b) zBuSL}5?N7O(iZLdAlz@)b)Rd~DnSsSX&P5qC`XwuFwcAYLC+d2>+1(8on;wpt8QIC X2MT$R4iQDd00000NkvXXu0mjfia~GN literal 0 HcmV?d00001 diff --git a/docs/search/defines_5f.html b/docs/search/defines_5f.html new file mode 100644 index 0000000..fcadb85 --- /dev/null +++ b/docs/search/defines_5f.html @@ -0,0 +1,26 @@ + + + + + + + +
+
Loading...
+
+
+ _GNU_SOURCE + main.c +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/files_62.html b/docs/search/files_62.html new file mode 100644 index 0000000..51777cd --- /dev/null +++ b/docs/search/files_62.html @@ -0,0 +1,30 @@ + + + + + + + +
+
Loading...
+
+
+ builtin.c +
+
+
+
+ builtin.h +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/files_6c.html b/docs/search/files_6c.html new file mode 100644 index 0000000..470befb --- /dev/null +++ b/docs/search/files_6c.html @@ -0,0 +1,30 @@ + + + + + + + +
+
Loading...
+
+
+ list.c +
+
+
+
+ list.h +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/files_6d.html b/docs/search/files_6d.html new file mode 100644 index 0000000..f2680f7 --- /dev/null +++ b/docs/search/files_6d.html @@ -0,0 +1,35 @@ + + + + + + + +
+
Loading...
+
+
+ main.c +
+
+
+
+ main.h +
+
+
+ +
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/files_70.html b/docs/search/files_70.html new file mode 100644 index 0000000..6cd1c43 --- /dev/null +++ b/docs/search/files_70.html @@ -0,0 +1,30 @@ + + + + + + + +
+
Loading...
+
+
+ parser.c +
+
+
+
+ parser.h +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_61.html b/docs/search/functions_61.html new file mode 100644 index 0000000..eba40a7 --- /dev/null +++ b/docs/search/functions_61.html @@ -0,0 +1,38 @@ + + + + + + + +
+
Loading...
+ + +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_62.html b/docs/search/functions_62.html new file mode 100644 index 0000000..e8e9c16 --- /dev/null +++ b/docs/search/functions_62.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_63.html b/docs/search/functions_63.html new file mode 100644 index 0000000..2ee43dc --- /dev/null +++ b/docs/search/functions_63.html @@ -0,0 +1,47 @@ + + + + + + + +
+
Loading...
+ + + +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_65.html b/docs/search/functions_65.html new file mode 100644 index 0000000..98ef9d1 --- /dev/null +++ b/docs/search/functions_65.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_66.html b/docs/search/functions_66.html new file mode 100644 index 0000000..0b5272f --- /dev/null +++ b/docs/search/functions_66.html @@ -0,0 +1,47 @@ + + + + + + + +
+
Loading...
+ + + +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_67.html b/docs/search/functions_67.html new file mode 100644 index 0000000..6824140 --- /dev/null +++ b/docs/search/functions_67.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_69.html b/docs/search/functions_69.html new file mode 100644 index 0000000..2208e30 --- /dev/null +++ b/docs/search/functions_69.html @@ -0,0 +1,44 @@ + + + + + + + +
+
Loading...
+
+
+ imprimir_argv + parser.c +
+
+ + +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_6a.html b/docs/search/functions_6a.html new file mode 100644 index 0000000..be9587a --- /dev/null +++ b/docs/search/functions_6a.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_6b.html b/docs/search/functions_6b.html new file mode 100644 index 0000000..cfceb40 --- /dev/null +++ b/docs/search/functions_6b.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_6c.html b/docs/search/functions_6c.html new file mode 100644 index 0000000..1436775 --- /dev/null +++ b/docs/search/functions_6c.html @@ -0,0 +1,92 @@ + + + + + + + + + + diff --git a/docs/search/functions_6d.html b/docs/search/functions_6d.html new file mode 100644 index 0000000..ce11213 --- /dev/null +++ b/docs/search/functions_6d.html @@ -0,0 +1,26 @@ + + + + + + + +
+
Loading...
+
+
+ main + main.c +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_70.html b/docs/search/functions_70.html new file mode 100644 index 0000000..1c080c5 --- /dev/null +++ b/docs/search/functions_70.html @@ -0,0 +1,56 @@ + + + + + + + +
+
Loading...
+ + + + +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_72.html b/docs/search/functions_72.html new file mode 100644 index 0000000..0515695 --- /dev/null +++ b/docs/search/functions_72.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_73.html b/docs/search/functions_73.html new file mode 100644 index 0000000..f568391 --- /dev/null +++ b/docs/search/functions_73.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_74.html b/docs/search/functions_74.html new file mode 100644 index 0000000..da28034 --- /dev/null +++ b/docs/search/functions_74.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/functions_77.html b/docs/search/functions_77.html new file mode 100644 index 0000000..310c5f3 --- /dev/null +++ b/docs/search/functions_77.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/mag_sel.png b/docs/search/mag_sel.png new file mode 100644 index 0000000000000000000000000000000000000000..81f6040a2092402b4d98f9ffa8855d12a0d4ca17 GIT binary patch literal 563 zcmV-30?hr1P)zxx&tqG15pu7)IiiXFflOc2k;dXd>%13GZAy? zRz!q0=|E6a6vV)&ZBS~G9oe0kbqyw1*gvY`{Pop2oKq#FlzgXt@Xh-7fxh>}`Fxg> z$%N%{$!4=5nM{(;=c!aG1Ofr^Do{u%Ih{^&Fc@H2)+a-?TBXrw5DW&z%Nb6mQ!L9O zl}b@6mB?f=tX3;#vl)}ggh(Vpyh(IK z(Mb0D{l{U$FsRjP;!{($+bsaaVi8T#1c0V#qEIOCYa9@UVLV`f__E81L;?WEaRA;Y zUH;rZ;vb;mk7JX|$=i3O~&If0O@oZfLg8gfIjW=dcBsz;gI=!{-r4# z4%6v$&~;q^j7Fo67yJ(NJWuX+I~I!tj^nW3?}^9bq|<3^+vapS5sgM^x7!cs(+mMT z&y%j};&~po+YO)3hoUH4E*E;e9>?R6SS&`X)p`njycAVcg{rEb41T{~Hk(bl-7eSb zmFxA2uIqo#@R?lKm50ND`~6Nfn|-b1|L6O98vt3Tx@gKz#isxO002ovPDHLkV1kyW B_l^Jn literal 0 HcmV?d00001 diff --git a/docs/search/nomatches.html b/docs/search/nomatches.html new file mode 100644 index 0000000..b1ded27 --- /dev/null +++ b/docs/search/nomatches.html @@ -0,0 +1,12 @@ + + + + + + + +
+
No Matches
+
+ + diff --git a/docs/search/search.css b/docs/search/search.css new file mode 100644 index 0000000..50249e5 --- /dev/null +++ b/docs/search/search.css @@ -0,0 +1,240 @@ +/*---------------- Search Box */ + +#FSearchBox { + float: left; +} + +#searchli { + float: right; + display: block; + width: 170px; + height: 36px; +} + +#MSearchBox { + white-space : nowrap; + position: absolute; + float: none; + display: inline; + margin-top: 8px; + right: 0px; + width: 170px; + z-index: 102; +} + +#MSearchBox .left +{ + display:block; + position:absolute; + left:10px; + width:20px; + height:19px; + background:url('search_l.png') no-repeat; + background-position:right; +} + +#MSearchSelect { + display:block; + position:absolute; + width:20px; + height:19px; +} + +.left #MSearchSelect { + left:4px; +} + +.right #MSearchSelect { + right:5px; +} + +#MSearchField { + display:block; + position:absolute; + height:19px; + background:url('search_m.png') repeat-x; + border:none; + width:116px; + margin-left:20px; + padding-left:4px; + color: #909090; + outline: none; + font: 9pt Arial, Verdana, sans-serif; +} + +#FSearchBox #MSearchField { + margin-left:15px; +} + +#MSearchBox .right { + display:block; + position:absolute; + right:10px; + top:0px; + width:20px; + height:19px; + background:url('search_r.png') no-repeat; + background-position:left; +} + +#MSearchClose { + display: none; + position: absolute; + top: 4px; + background : none; + border: none; + margin: 0px 4px 0px 0px; + padding: 0px 0px; + outline: none; +} + +.left #MSearchClose { + left: 6px; +} + +.right #MSearchClose { + right: 2px; +} + +.MSearchBoxActive #MSearchField { + color: #000000; +} + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #90A5CE; + background-color: #F9FAFC; + z-index: 1; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt Arial, Verdana, sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: monospace; + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: #000000; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: #000000; + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: #FFFFFF; + background-color: #3D578C; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + width: 60ex; + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #000; + background-color: #EEF1F7; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; + padding-bottom: 15px; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +body.SRPage { + margin: 5px 2px; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; +} + +.SRResult { + display: none; +} + +DIV.searchresults { + margin-left: 10px; + margin-right: 10px; +} diff --git a/docs/search/search.js b/docs/search/search.js new file mode 100644 index 0000000..2a014c2 --- /dev/null +++ b/docs/search/search.js @@ -0,0 +1,738 @@ +// Search script generated by doxygen +// Copyright (C) 2009 by Dimitri van Heesch. + +// The code in this file is loosly based on main.js, part of Natural Docs, +// which is Copyright (C) 2003-2008 Greg Valure +// Natural Docs is licensed under the GPL. + +var indexSectionsWithContent = +{ + 0: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010111011111111111101111010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + 1: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000010001010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + 2: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000001100100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + 3: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111011101111100101110010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + 4: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101001011001011100101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + 5: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + 6: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" +}; + +var indexSectionNames = +{ + 0: "all", + 1: "classes", + 2: "files", + 3: "functions", + 4: "variables", + 5: "typedefs", + 6: "defines" +}; + +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var hexCode; + if (code<16) + { + hexCode="0"+code.toString(16); + } + else + { + hexCode=code.toString(16); + } + + var resultsPage; + var resultsPageWithSearch; + var hasResultsPage; + + if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1') + { + resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html'; + resultsPageWithSearch = resultsPage+'?'+escape(searchValue); + hasResultsPage = true; + } + else // nothing available for this search term + { + resultsPage = this.resultsPath + '/nomatches.html'; + resultsPageWithSearch = resultsPage; + hasResultsPage = false; + } + + window.frames.MSearchResults.location.href = resultsPageWithSearch; + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + + if (domPopupSearchResultsWindow.style.display!='block') + { + var domSearchBox = this.DOMSearchBox(); + this.DOMSearchClose().style.display = 'inline'; + if (this.insideFrame) + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + domPopupSearchResultsWindow.style.position = 'relative'; + domPopupSearchResultsWindow.style.display = 'block'; + var width = document.body.clientWidth - 8; // the -8 is for IE :-( + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResults.style.width = width + 'px'; + } + else + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; + var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + } + } + + this.lastSearchValue = searchValue; + this.lastResultsPage = resultsPage; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + + var searchField = this.DOMSearchField(); + + if (searchField.value == this.searchLabel) // clear "Search" term upon entry + { + searchField.value = ''; + this.searchActive = true; + } + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.DOMSearchField().value = this.searchLabel; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName == 'DIV' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName == 'DIV' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + parent.document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} diff --git a/docs/search/search_l.png b/docs/search/search_l.png new file mode 100644 index 0000000000000000000000000000000000000000..c872f4da4a01d0754f923e6c94fd8159c0621bd1 GIT binary patch literal 604 zcmV-i0;BzjP)k7RCwB~R6VQOP#AvB$vH7i{6H{96zot$7cZT<7246EF5Np6N}+$IbiG6W zg#87A+NFaX+=_^xM1#gCtshC=E{%9^uQX_%?YwXvo{#q&MnpJ8uh(O?ZRc&~_1%^SsPxG@rfElJg-?U zm!Cz-IOn(qJP3kDp-^~qt+FGbl=5jNli^Wj_xIBG{Rc0en{!oFvyoNC7{V~T8}b>| z=jL2WIReZzX(YN(_9fV;BBD$VXQIxNasAL8ATvEu822WQ%mvv4FO#qs` BFGc_W literal 0 HcmV?d00001 diff --git a/docs/search/search_r.png b/docs/search/search_r.png new file mode 100644 index 0000000000000000000000000000000000000000..97ee8b439687084201b79c6f776a41f495c6392a GIT binary patch literal 612 zcmV-q0-ODbP)PbXFRCwB?)W514K@j&X?z2*SxFI6-@HT2E2K=9X9%Pb zEK*!TBw&g(DMC;|A)uGlRkOS9vd-?zNs%bR4d$w+ox_iFnE8fvIvv7^5<(>Te12Li z7C)9srCzmK{ZcNM{YIl9j{DePFgOWiS%xG@5CnnnJa4nvY<^glbz7^|-ZY!dUkAwd z{gaTC@_>b5h~;ug#R0wRL0>o5!hxm*s0VW?8dr}O#zXTRTnrQm_Z7z1Mrnx>&p zD4qifUjzLvbVVWi?l?rUzwt^sdb~d!f_LEhsRVIXZtQ=qSxuxqm zEX#tf>$?M_Y1-LSDT)HqG?`%-%ZpY!#{N!rcNIiL;G7F0`l?)mNGTD9;f9F5Up3Kg zw}a<-JylhG&;=!>B+fZaCX+?C+kHYrP%c?X2!Zu_olK|GcS4A70HEy;vn)I0>0kLH z`jc(WIaaHc7!HS@f*^R^Znx8W=_jIl2oWJoQ*h1^$FX!>*PqR1J8k|fw}w_y}TpE>7m8DqDO<3z`OzXt$ccSejbEZCg@0000 + + + + + + +
+
Loading...
+
+
+ HISTORY + list.h +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/typedefs_6e.html b/docs/search/typedefs_6e.html new file mode 100644 index 0000000..723717c --- /dev/null +++ b/docs/search/typedefs_6e.html @@ -0,0 +1,26 @@ + + + + + + + +
+
Loading...
+
+
+ NODE + list.h +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_61.html b/docs/search/variables_61.html new file mode 100644 index 0000000..2eeb27f --- /dev/null +++ b/docs/search/variables_61.html @@ -0,0 +1,26 @@ + + + + + + + +
+
Loading...
+
+
+ args + COMMAND +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_63.html b/docs/search/variables_63.html new file mode 100644 index 0000000..9c04985 --- /dev/null +++ b/docs/search/variables_63.html @@ -0,0 +1,53 @@ + + + + + + + +
+
Loading...
+
+
+ childs + main.h +
+
+
+ +
+
+
+ cmdLine + main.h +
+
+
+
+ cmdList + main.h +
+
+
+
+ command + PROCESS +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_66.html b/docs/search/variables_66.html new file mode 100644 index 0000000..b3d350f --- /dev/null +++ b/docs/search/variables_66.html @@ -0,0 +1,26 @@ + + + + + + + +
+
Loading...
+
+
+ first + LIST +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_68.html b/docs/search/variables_68.html new file mode 100644 index 0000000..1ec8749 --- /dev/null +++ b/docs/search/variables_68.html @@ -0,0 +1,32 @@ + + + + + + + +
+
Loading...
+
+
+ history + main.h +
+
+
+
+ hostname + main.h +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_69.html b/docs/search/variables_69.html new file mode 100644 index 0000000..4142911 --- /dev/null +++ b/docs/search/variables_69.html @@ -0,0 +1,47 @@ + + + + + + + +
+
Loading...
+
+
+ id + COMMAND +
+
+
+
+ input_r + COMMAND +
+
+
+
+ input_r_filename + COMMAND +
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_6c.html b/docs/search/variables_6c.html new file mode 100644 index 0000000..343bda4 --- /dev/null +++ b/docs/search/variables_6c.html @@ -0,0 +1,26 @@ + + + + + + + +
+
Loading...
+
+
+ last + LIST +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_6e.html b/docs/search/variables_6e.html new file mode 100644 index 0000000..7021a68 --- /dev/null +++ b/docs/search/variables_6e.html @@ -0,0 +1,29 @@ + + + + + + + +
+
Loading...
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_6f.html b/docs/search/variables_6f.html new file mode 100644 index 0000000..275ca78 --- /dev/null +++ b/docs/search/variables_6f.html @@ -0,0 +1,38 @@ + + + + + + + +
+
Loading...
+
+
+ output_r + COMMAND +
+
+
+
+ output_r_append + COMMAND +
+
+
+
+ output_r_filename + COMMAND +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_70.html b/docs/search/variables_70.html new file mode 100644 index 0000000..c2a3eb4 --- /dev/null +++ b/docs/search/variables_70.html @@ -0,0 +1,47 @@ + + + + + + + +
+
Loading...
+ +
+
+ pipe + COMMAND +
+
+
+
+ prev + NODE +
+
+
+
+ proc + NODE +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_73.html b/docs/search/variables_73.html new file mode 100644 index 0000000..6340274 --- /dev/null +++ b/docs/search/variables_73.html @@ -0,0 +1,32 @@ + + + + + + + +
+
Loading...
+
+
+ size + COMMAND +
+
+
+
+ status + PROCESS +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/search/variables_75.html b/docs/search/variables_75.html new file mode 100644 index 0000000..2e40578 --- /dev/null +++ b/docs/search/variables_75.html @@ -0,0 +1,32 @@ + + + + + + + +
+
Loading...
+
+
+ userdir + main.h +
+
+
+
+ username + main.h +
+
+
Searching...
+
No Matches
+ +
+ + diff --git a/docs/tab_a.png b/docs/tab_a.png new file mode 100644 index 0000000000000000000000000000000000000000..2d99ef23fed78c7683f0b5aa803d937060d288c4 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!Qo)`sjv*C{Z|CmjY;X`^DSv)) z;hc^cTF;t%XWXdwWP5+kt?jQ5uhqKtjd^EY`^^-S;M%tFAj_l)EwVTK)E@1LSD0{e q?a6($SGQTzz1#QBzr0NMKf^0WCX-0bi?u-G89ZJ6T-G@yGywp8?ljB* literal 0 HcmV?d00001 diff --git a/docs/tab_b.png b/docs/tab_b.png new file mode 100644 index 0000000000000000000000000000000000000000..b2c3d2be3c7e518fbca6bb30f571882e72fc506d GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!Qk9-Ajv*C{Z|~mbJ)|JfaM8Xd zIP7xAmLwau9@iXhZTrl-TjWj9jM#?{xt`6uU{<)jb9Suc^QnbhJ(o{ib8=j9u0_mE8M7kgF7f<7W7IEf=8(L_qx|g0H;V7iPxm&Q@G7p8W2Kx&iT|YUM=ITC zY<0Qbr;u&AtXD{o@41wH=7&d8=2Z_{M9Tsa=g*t*@A3H$UOlxZk7?f6RUWpx>Fc_L s#LQ{edY3MpIXkMeV^&YV=9fR%8Jv|Kya=#u06K}m)78&qol`;+0RKEt)&Kwi literal 0 HcmV?d00001 diff --git a/docs/tab_s.png b/docs/tab_s.png new file mode 100644 index 0000000000000000000000000000000000000000..978943ac807718de0e69e5a585a8f0a1e5999285 GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QZ1e?jv*C{Z|}b5Yzkm-c<7z3 zq^cq0=~}Z;b(!Zvb5Z%sTRFKGlz1=qOFg;myyu?$r`wZb^irPsN1a)6)TwB0r+)wb zPL25;=adu89?fTK`qDR>$D*)b_WOmdKI;Vst02j(hg8%>k literal 0 HcmV?d00001 diff --git a/docs/tabs.css b/docs/tabs.css new file mode 100644 index 0000000..2192056 --- /dev/null +++ b/docs/tabs.css @@ -0,0 +1,59 @@ +.tabs, .tabs2, .tabs3 { + background-image: url('tab_b.png'); + width: 100%; + z-index: 101; + font-size: 13px; +} + +.tabs2 { + font-size: 10px; +} +.tabs3 { + font-size: 9px; +} + +.tablist { + margin: 0; + padding: 0; + display: table; +} + +.tablist li { + float: left; + display: table-cell; + background-image: url('tab_b.png'); + line-height: 36px; + list-style: none; +} + +.tablist a { + display: block; + padding: 0 20px; + font-weight: bold; + background-image:url('tab_s.png'); + background-repeat:no-repeat; + background-position:right; + color: #283A5D; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; + outline: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist a:hover { + background-image: url('tab_h.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + text-decoration: none; +} + +.tablist li.current a { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} diff --git a/list.h b/list.h index 7351d6d..3958b8d 100755 --- a/list.h +++ b/list.h @@ -1,12 +1,21 @@ #ifndef _LISTA_H_ #define _LISTA_H_ +/** @brief Lista simples para uso do comando builtin history. +* +*/ typedef struct history { char * cmd; struct history *next; } HISTORY; +/** @brief Estrutura do processo. +* +* Esta estrutura guarda todas as informações +* pertinentes de um processo. +* +*/ typedef struct { pid_t pid; @@ -15,6 +24,16 @@ typedef struct int isBackground; } PROCESS; +/** @brief Estrutura do comando. +* +* Esta estrutura guarda todas as informações +* pertinentes de um comando. +* Nesta implementação, um comando é definido +* como um execultável ou builtin e seus argumentos. +* cat arquivo | grep palavra | cut -c 1-6 tem 3 comandos, +* por exemplo. +* +*/ typedef struct { char **args; @@ -30,6 +49,13 @@ typedef struct pid_t pid; } COMMAND; +/** @brief Nó das listas de comandos e processos. +* +* Temos na mesma estrutura de nó um ponteiro para comando +* e outro para processo. Isso foi feito para facilitar a +* implementação, os dois não devem ser usados juntos. +* +*/ typedef struct NODE { PROCESS *proc; @@ -38,6 +64,10 @@ typedef struct NODE struct NODE *prev; } NODE; + +/** @brief Estrutura da lista em si. +* +*/ typedef struct { NODE *first; @@ -47,25 +77,28 @@ typedef struct /** @brief Inicializa a lista para uso posterior. * @param list - Ponteiro para lista a ser inicializada. -* @return Void. +* @return void. */ void ListCreate(LIST *list); + /** @brief Inicializa um comando (estrutura) para * uso posterior. -* @param list - Ponteiro para comando (estrutura) +* @param cmd - Ponteiro para comando (estrutura) * a ser inicializada. -* @return Void. +* @return void. */ void initCommand(COMMAND *cmd); + /** @brief Verifica se uma lista está vazia. * @param list - Ponteiro para a lista. -* @return Se a lista está vazia -* Caso contrário. +* @return Se a lista está vazia. * @retval 1 - Sim. * @retval 0 - Não. */ int ListIsEmpty(LIST *list); + /** @brief Insere um processo e/ou um comando na lista. +* * Na prática, deve ser usada uma lista para * comandos e outra para processos. * Elas só estão na mesma estrutura para evitar @@ -77,25 +110,45 @@ int ListIsEmpty(LIST *list); * @param list - Ponteiro para a lista. * @param proc - Ponteiro para processo (estrutura). * @param cmd - Ponteiro para comando (estrutura). -* @return Se foi possível inserir +* @return Se foi possível inserir. * @retval 1 - Sim. * @retval 0 - Não. */ int ListInsert(LIST *list, PROCESS *proc, COMMAND *cmd); + +/** @brief Remove um processo da lista pelo seu ID. +* @param list - Ponteiro para a lista de processos. +* @param pid - ID do processo. +* @return Se a remoção foi feita. +* @retval 1 - Sim. +* @retval 0 - Não. +*/ int ListRemoveByPid(LIST *list, pid_t pid); + +/** @brief Retorna o processo que está rodando em foreground. +* @param list - Ponteiro para a lista de processos. +* @return Processo em questão. (NULL caso não tenha um). +*/ PROCESS *ListGetCurrentProcess(LIST *list); +/** @brief Busca e retorna o processo parado mais recente. +* @param list - Ponteiro para a lista de processos. +* @return Processo em questão. (NULL caso não tenha um). +*/ PROCESS * ListGetLastStopped(LIST *list); -/** @brief Retorna um processo (estrutura) pelo seu id. + +/** @brief Retorna um processo pelo seu id. * @param list - Ponteiro para a lista. * @param pid - Id do processo a ser procurado. -* @param proc - Ponteiro que apontará para lista -* @return Se a lista está vazia -* Caso contrário. -* @retval 1 - Sim. -* @retval 0 - Não. +* @return Ponteiro para o processo. (NULL caso +* não encontrado). +*/ +PROCESS * ListGetProcess(LIST *list, pid_t pid); + +/** @brief Libera espaço alocado pela lista de comandos. +* @param list - Ponteiro para a lista de comandos. +* @return void. */ -PROCESS * ListGetProcess(LIST *list, pid_t n); void ListPurgeCmds(LIST *list); #endif diff --git a/main.c b/main.c index 3b73005..0983e8d 100755 --- a/main.c +++ b/main.c @@ -68,7 +68,7 @@ int main (int argc, char **argv) /*Loop Principal */ while (1) { - printPrompt(username, hostname); + printPrompt(); cmdLine = readline(); if(strcmp(cmdLine, "") != 0) { @@ -176,7 +176,7 @@ int main (int argc, char **argv) return 0; } -void printPrompt(char* username, char* hostname) +void printPrompt() { char path[256]; getcwd(path, 256); @@ -224,7 +224,7 @@ void sigtstop_handler(int signum) strcpy(process->status, "Stopped"); } else - printPrompt(username, hostname); + printPrompt(); } void free_memory() diff --git a/main.h b/main.h index 7dad658..5d702cd 100755 --- a/main.h +++ b/main.h @@ -2,10 +2,47 @@ #define _MAIN_H_ #include "list.h" -void printPrompt(char* username, char* hostname); +/** +* @brief Imprime o prompt na tela (formato copiado do gnome shell). +* @return void. +* +*/ +void printPrompt(); + +/** +* @brief Função executada quando usuário manda ctrl+c. +* @param signum - id do sinal. +* @return void. +* +*/ void termination_handler(int signum); + +/** +* @brief Função executada quando um processo filho termina. +* +* Esta função só é útil para processos em background, +* já que ela fica bloqueada quando um processo roda +* em foreground. +* @param signum - id do sinal. +* @return void. +* +*/ void child_handler(int signum); + +/** +* @brief Função executada quando usuário manda ctrl+z. +* @param signum - id do sinal. +* @return void. +* +*/ void sigtstop_handler(int signum); + +/** +* @brief Função que libera memória utilizada antes de terminar +* o programa. +* @return void. +* +*/ void free_memory(); char * userdir; diff --git a/parser.h b/parser.h index f676223..bd10355 100644 --- a/parser.h +++ b/parser.h @@ -1,11 +1,48 @@ #ifndef _PARSER_H_ #define _PARSER_H_ #include "list.h" - -void imprimir_argv(char ** matriz, int tamanho); +/** +* @brief Conta o número de palavras de uma string. +* @param source - String para contar. +* @return Número de palavras da string passada como parâmetro. +* +*/ int word_count(char * source); -char * readline(void); + +/** +* @brief Lê o comando digitado pelo usuário. +* @return Comando digitado pelo usuário. +* +*/ +char * readline(); + +/** +* @brief Adiciona em uma lista o(s) comando(s) digitado(s) pelo usuário. +* +* Pega toda a linha de comando digitada e adiciona o comando com +* seus parâmetros na lista. +* Em caso de uso do pipe, haverá mais de um comando a ser executado, +* ela quebrará a linha de comando e colocará cada comando com seus +* parâmetros em uma lista. +* @param cmdList - lista onde os comandos serão armazenados +* @param cmdLine - linha de comando digitada pelo usuário +* @return void. +* +*/ void getCmds(LIST *cmdList, char *cmdLine); + +/** +* @brief Recebe a linha de comando e separa os argumentos. +* +* Retira os espaços entre os comandos e seus argumentos, +* armazena os comandos e seus parâmetros em um vetor de strings, +* na última posição do vetor coloca NULL, isso para o camando ser +* interpretado pela função execvp. +* @param cmdLine - linha de comando que será "parseada". +* @param command - estrutura que receberá cada comando, com suas flags e parâmetros +* @return void. +* +*/ void parse(char * cmdLine, COMMAND * command); #endif From f270487fecaf4a4f4ae55191b6b1a9a8e61fdd31 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Wed, 16 Nov 2011 14:27:04 -0800 Subject: [PATCH 28/30] Adicionado arquivos empty. --- bin/empty | 0 obj/empty | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 bin/empty create mode 100644 obj/empty diff --git a/bin/empty b/bin/empty new file mode 100644 index 0000000..e69de29 diff --git a/obj/empty b/obj/empty new file mode 100644 index 0000000..e69de29 From 35a2c5195553a2ce072c724434e06d1751c7b406 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Wed, 16 Nov 2011 14:35:42 -0800 Subject: [PATCH 29/30] Removendo arquivos de backup que foram colocados sem querer. --- Doxyfile~ | 280 ---------------------------------------------------- Mainpage.h~ | 40 -------- Makefile~ | 18 ---- 3 files changed, 338 deletions(-) delete mode 100644 Doxyfile~ delete mode 100644 Mainpage.h~ delete mode 100644 Makefile~ diff --git a/Doxyfile~ b/Doxyfile~ deleted file mode 100644 index de75cef..0000000 --- a/Doxyfile~ +++ /dev/null @@ -1,280 +0,0 @@ -# Doxyfile 1.7.4 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = Shell -PROJECT_NUMBER = -PROJECT_BRIEF = -PROJECT_LOGO = -OUTPUT_DIRECTORY = docs -CREATE_SUBDIRS = YES -OUTPUT_LANGUAGE = Português -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -QT_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -OPTIMIZE_FOR_FORTRAN = NO -OPTIMIZE_OUTPUT_VHDL = NO -EXTENSION_MAPPING = -BUILTIN_STL_SUPPORT = NO -CPP_CLI_SUPPORT = NO -SIP_SUPPORT = NO -IDL_PROPERTY_SUPPORT = YES -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -INLINE_GROUPED_CLASSES = NO -TYPEDEF_HIDES_STRUCT = NO -SYMBOL_CACHE_SIZE = 0 -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -EXTRACT_ANON_NSPACES = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -FORCE_LOCAL_INCLUDES = NO -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_MEMBERS_CTORS_1ST = NO -SORT_GROUP_NAMES = NO -SORT_BY_SCOPE_NAME = NO -STRICT_PROTO_MATCHING = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO -SHOW_FILES = YES -SHOW_NAMESPACES = YES -FILE_VERSION_FILTER = -LAYOUT_FILE = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = -INPUT_ENCODING = UTF-8 -FILE_PATTERNS = -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXCLUDE_SYMBOLS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -FILTER_SOURCE_PATTERNS = -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = NO -REFERENCES_LINK_SOURCE = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_EXTRA_FILES = -HTML_COLORSTYLE_HUE = 220 -HTML_COLORSTYLE_SAT = 100 -HTML_COLORSTYLE_GAMMA = 80 -HTML_TIMESTAMP = YES -HTML_ALIGN_MEMBERS = YES -HTML_DYNAMIC_SECTIONS = NO -GENERATE_DOCSET = NO -DOCSET_FEEDNAME = "Doxygen generated docs" -DOCSET_BUNDLE_ID = org.doxygen.Project -DOCSET_PUBLISHER_ID = org.doxygen.Publisher -DOCSET_PUBLISHER_NAME = Publisher -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -CHM_INDEX_ENCODING = -BINARY_TOC = NO -TOC_EXPAND = NO -GENERATE_QHP = NO -QCH_FILE = -QHP_NAMESPACE = org.doxygen.Project -QHP_VIRTUAL_FOLDER = doc -QHP_CUST_FILTER_NAME = -QHP_CUST_FILTER_ATTRS = -QHP_SECT_FILTER_ATTRS = -QHG_LOCATION = -GENERATE_ECLIPSEHELP = NO -ECLIPSE_DOC_ID = org.doxygen.Project -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -USE_INLINE_TREES = NO -TREEVIEW_WIDTH = 250 -EXT_LINKS_IN_WINDOW = NO -FORMULA_FONTSIZE = 10 -FORMULA_TRANSPARENT = YES -USE_MATHJAX = NO -MATHJAX_RELPATH = http://www.mathjax.org/mathjax -SEARCHENGINE = YES -SERVER_BASED_SEARCH = NO -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = YES -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4 -EXTRA_PACKAGES = -LATEX_HEADER = -LATEX_FOOTER = -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -LATEX_SOURCE_CODE = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -MSCGEN_PATH = -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -DOT_NUM_THREADS = 0 -DOT_FONTNAME = Helvetica -DOT_FONTSIZE = 10 -DOT_FONTPATH = -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -CALLER_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MSCFILE_DIRS = -DOT_GRAPH_MAX_NODES = 50 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = YES -GENERATE_LEGEND = YES -DOT_CLEANUP = YES diff --git a/Mainpage.h~ b/Mainpage.h~ deleted file mode 100644 index abc1e74..0000000 --- a/Mainpage.h~ +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @mainpage Shell - * @author Lucas Lobosque - 6792645 - * @author José Leandro Pozer - 6793222 - * @date 16/11/2011 - * - * @section intro Introdução - * - * @subsection estrutura_basica_subsec Estrutura básica de Arquivos - * Desenvolvemos o shell utilizando 4 arquivos diferentes (e seus headers): - * - *
    - *
  • main.c - Arquivo com a função main, onde fica o loop principal e com handlers de sinais como SIGINT, SIGTSTP e SIGCHLD.
  • - *
  • parser.c - Funções relacionadas a transformar a entrada do usuário em uma estrutura compreensível para o programa.
  • - *
  • builtin.c - Aqui estáo todos os comandos builtin e também uma função que checa se um dado comando é builtin ou não.
  • - *
  • list.c - Funções que manipulam as listas usadas pelo programa.
  • - *
- * - * @subsection estrutura_dados_subsec Estrutura básica de Dados - * No nosso programa, temos três listas ligadas diferentes que são constantemente utilizadas: - *
    - *
  • history - Esta é a mais simples das três. Guarda strings com os comandos anteriormente utilizados pelo usuário. É usada pelo comando builtin history.
  • - *
  • childs - Nesta lista ligada armazenamos todos os processos que estão rodando ou estão interrompidos.
  • - *
  • cmdList - Lista responsável por guardar o último comando enviado pelo usuário. Nesta lista, o comando é guardado depois de "parseado", então todas suas informações são - * guardadas aqui (roda no background? tem redirecionamento de saída? pra onde?). Cada item da lista é um comando diferente, sendo que a lista e sempre resetada no loop. Ou seja, esta lista só conterá mais de um item se houver pipe no comando.
  • - *
- * - * @section section_toc Características Não Implementadas (limitações). - * Na nossa shell, os seguintes tipos de comando não são possíveis: - *
    - *
  • Comando builtin rodando em background (sempre rodará em foreground).
  • - *
  • Redirecionamento de entrada para comandos builtin (redirecionamento de saída implementado).
  • - *
  • Pipe com comandos builtin
  • - *
- * Tornou-se uma tarefa complicada para nós lidar com essas peculiaridades de comandos builtin, já que implementamos sem elas em mente, e, quando percebemos que haveriam essas possibilidades, teríamos que mudar muito a estrutura do programa. - * - * @section testes Testes - * Além de exaustivos testes com vários comandos complexos, rodamos nossa shell com o Valgrind e encontramos vários memory leaks (a maioria causada por erros bobos, porém alguns eram bem complexos). - * Arrumamos a maioria deles, mas infelizmente teve um leak que não foi possível concertar, pois ele é causado pela função getlogin(), (implementada na unistd.h). -*/ diff --git a/Makefile~ b/Makefile~ deleted file mode 100644 index 184f687..0000000 --- a/Makefile~ +++ /dev/null @@ -1,18 +0,0 @@ -shell : builtin.o main.o list.o parser.o a - gcc obj/builtin.o obj/main.o obj/list.o obj/parser.o -o bin/shell - -a : - echo oi - -builtin.o : builtin.c - gcc -c builtin.c -o obj/builtin.o - -main.o : main.c - gcc -c main.c -o obj/main.o - -list.o : list.c - gcc -c list.c -o obj/list.o - -parser.o : parser.c - gcc -c parser.c -o obj/parser.o - From 448f64d18e16ccc0c4812a827d0cb744a0bde647 Mon Sep 17 00:00:00 2001 From: Lucas Lobosque Date: Wed, 16 Nov 2011 14:37:22 -0800 Subject: [PATCH 30/30] Removendo backup do readme. --- README~ | 56 -------------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 README~ diff --git a/README~ b/README~ deleted file mode 100644 index 5653226..0000000 --- a/README~ +++ /dev/null @@ -1,56 +0,0 @@ -Autores: - Lucas Lobosque - 6792645 - José Leandro Pozer - 6793222 - -Data: - 16/11/2011 - -==Introdução== - ---Estrutura básica de Arquivos-- - - Desenvolvemos o shell utilizando 4 arquivos diferentes (e seus headers): - - * main.c - Arquivo com a função main, onde fica o loop principal e com handlers de sinais como SIGINT, SIGTSTP e SIGCHLD. - * parser.c - Funções relacionadas a transformar a entrada do usuário em uma estrutura compreensível para o programa. - * builtin.c - Aqui estáo todos os comandos builtin e também uma função que checa se um dado comando é builtin ou não. - * list.c - Funções que manipulam as listas usadas pelo programa. - - ---Estrutura básica de Dados-- - - No nosso programa, temos três listas ligadas diferentes que são constantemente utilizadas: - - * history - Esta é a mais simples das três. Guarda strings com os comandos anteriormente utilizados pelo usuário. É usada - pelo comando builtin history. - * childs - Nesta lista ligada armazenamos todos os processos que estão rodando ou estão interrompidos. - * cmdList - Lista responsável por guardar o último comando enviado pelo usuário. Nesta lista, o comando é guardado depois de - "parseado", então todas suas informações são guardadas aqui (roda no background? tem redirecionamento de saída? - pra onde?). Cada item da lista é um comando diferente, sendo que a lista e sempre resetada no loop. Ou seja, - esta lista só conterá mais de um item se houver pipe no comando. - - -==Características Não Implementadas (limitações)== - -Na nossa shell, os seguintes tipos de comando não são possíveis: - - * Comando builtin rodando em background (sempre rodará em foreground). - * Redirecionamento de entrada para comandos builtin (redirecionamento de saída implementado). - * Pipe com comandos builtin - - Tornou-se uma tarefa complicada para nós lidar com essas peculiaridades de comandos builtin, já que implementamos sem elas em mente, e, -quando percebemos que haveriam essas possibilidades, teríamos que mudar muito a estrutura do programa. - - -==Testes== - - Além de exaustivos testes com vários comandos complexos, rodamos nossa shell com o Valgrind e encontramos vários memory leaks (a maioria causada -por erros bobos, porém alguns eram bem complexos). Arrumamos a maioria deles, mas infelizmente teve um leak que não foi possível concertar, pois -ele é causado pela função getlogin(), (implementada na unistd.h). - - -==Conclusão== - - Além de bastante desafiador, o desenvolvimento da shell foi de grande valia para nós, já que nunca tivemos um contato a nível de sistema com -o Linux. Depois do desenvolvimento desse programa, arriscamos dizer que entendemos ao menos um pouco de Linux :). -