cmdloop.c File Reference

#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_listget_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 ()

Detailed Description

The main I/O loop.

Function Documentation

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.

Parameters:
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.
Returns:
0 if a quit is received.

struct parse_list* get_element ( struct parse_list head,
int  i 
)

Gets the ith element of the given parse_list and returns it.

Parameters:
head The first directory entry.
i The index of the element we want.
Returns:
The directory entry 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.

Returns:
The name of the file to send.


Generated by  doxygen 1.4.7.
SourceForge.net Logo