main.c File Reference

#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_listlist_parse (char *output)
void print_usage (char *progname)
void print_version ()
parse_listget_list (int sockfd, struct sock_hostport info)
int main (int argc, char *argv[])

Detailed Description

The main function.

Define Documentation

#define STFTP_VERSION   "1.1.0"

Used in stftp -V and other such places.


Function Documentation

struct parse_list* get_list ( int  sockfd,
struct sock_hostport  info 
)

Gets the directory listing of the current directory and returns it.

Parameters:
sockfd FTP socket descriptor.
info Host and port information.
Returns:
A parse_list with all the directory entries.

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.

Parameters:
output What LIST has given us.
Returns:
A parse_list with all the files from the directory.

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.

Parameters:
progname The name of the program as it was called.

void print_version (  ) 

Print the version number and such and die.


Generated by  doxygen 1.4.7.
SourceForge.net Logo