#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <ctype.h>
#include "misc.h"
#include "main.h"
#include "ftp.h"
#include "tty.h"
#include "listparse.h"
#include "cmdloop.h"
Defines | |
#define | STFTP_VERSION "1.1.0" |
Functions | |
parse_list * | list_parse (char *output) |
void | print_usage (char *progname) |
void | print_version () |
parse_list * | get_list (int sockfd, struct sock_hostport info) |
int | main (int argc, char *argv[]) |
#define STFTP_VERSION "1.1.0" |
Used in stftp -V and other such places.
struct parse_list* get_list | ( | int | sockfd, | |
struct sock_hostport | info | |||
) |
Gets the directory listing of the current directory and returns it.
sockfd | FTP socket descriptor. | |
info | Host and port information. |
struct parse_list* list_parse | ( | char * | output | ) |
Breaks the output of LIST into (hopefully) distinct entries and returns an amalgamated list of all the entires.
output | What LIST has given us. |
int main | ( | int | argc, | |
char * | argv[] | |||
) |
The main function. Probably does more than it should at this point. It mainly does initializing things, like ask for the username & pass, and connecting to the server, getting the first directory, etc. Near the end of the function it gives up control to cmd_loop(). Then, once that returns, it quits.
void print_usage | ( | char * | progname | ) |
Print the usage message and die.
progname | The name of the program as it was called. |
void print_version | ( | ) |
Print the version number and such and die.