#include <curses.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <stdio.h>#include "misc.h"#include "main.h"#include "listparse.h"#include "ftp.h"#include "tty.h"#include "cmdloop.h"Functions | |
| parse_list * | get_element (struct parse_list *head, int i) |
| int | cmd_loop (int sockfd, struct sock_hostport info, char *dir, struct parse_list *head) |
| char * | local_loop () |
| int cmd_loop | ( | int | sockfd, | |
| struct sock_hostport | info, | |||
| char * | dir, | |||
| struct parse_list * | head | |||
| ) |
The main I/O loop; this is where the program spends a majority of its time. Takes in commands from the user and then does something based on that. The function loops infinitely until a quit command is received from the user.
| sockfd | The socket descriptor for the FTP server. | |
| info | The sock_hostport structure with the FTP server info. | |
| dir | What directory are we in on the FTP server? | |
| head | The beginning of the linked list of files on the server. |
| struct parse_list* get_element | ( | struct parse_list * | head, | |
| int | i | |||
| ) |
Gets the ith element of the given parse_list and returns it.
| head | The first directory entry. | |
| i | The index of the element we want. |
| char* local_loop | ( | ) |
This function is for when you are selecting a local file. It displays the files just as it does for the remote view.
1.4.7.