2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

c8/br.c File Reference


Detailed Description

More-complete Web Browser [Sec. 8.4.3 (not in book)].

Definition in file br.c.

Go to the source code of this file.

Defines

#define MAX_LINK   100
#define MAX_HREF   120
#define MAX_ANCHORS   200
#define FN_TRANSFER_ENCODING   "Transfer-Encoding"
#define FN_CONTENT_LENGTH   "Content-Length"
#define FN_LOCATION   "Location"

Functions

void add_href (const char *tag)
void add_link (const char *link)
const char * go_link (int limit)
void parse_url (const char *url, char *host, size_t max_host, char *path, size_t max_path)
void makepath (char *path, size_t max_path, const char *newpath)
void display (const char *s, int len, bool showtags, bool want_display)
bool response (char *s, int len, bool start, bool showtags, bool want_display, char **newloc)
int main (int argc, char *argv[])

Variables

struct {
   char   a_link [MAX_LINK]
   char   a_href [MAX_HREF]
anchor [MAX_ANCHORS]
int nanchors


Define Documentation

#define FN_CONTENT_LENGTH   "Content-Length"
 

Definition at line 295 of file br.c.

Referenced by response().

#define FN_LOCATION   "Location"
 

Definition at line 296 of file br.c.

Referenced by response().

#define FN_TRANSFER_ENCODING   "Transfer-Encoding"
 

Definition at line 294 of file br.c.

Referenced by response().

#define MAX_ANCHORS   200
 

Definition at line 32 of file br.c.

Referenced by add_href(), and add_link().

#define MAX_HREF   120
 

Definition at line 31 of file br.c.

Referenced by add_href(), go_link(), and main().

#define MAX_LINK   100
 

Definition at line 30 of file br.c.

Referenced by add_link(), and display().


Function Documentation

void add_href const char *  tag  )  [static]
 

Definition at line 40 of file br.c.

References a_href, anchor, MAX_ANCHORS, MAX_HREF, and nanchors.

Referenced by display().

void add_link const char *  link  )  [static]
 

Definition at line 75 of file br.c.

References a_link, anchor, link(), MAX_ANCHORS, MAX_LINK, and nanchors.

Referenced by display().

void display const char *  s,
int  len,
bool  showtags,
bool  want_display
[static]
 

Definition at line 178 of file br.c.

References add_href(), add_link(), exit(), link(), and MAX_LINK.

Referenced by response().

const char* go_link int  limit  )  [static]
 

Definition at line 89 of file br.c.

References a_href, a_link, anchor, MAX_HREF, and nanchors.

Referenced by main().

int main int  argc,
char *  argv[]
 

Definition at line 393 of file br.c.

References anchor, EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, ec_neg1, exit(), go_link(), makepath(), MAX_HREF, nanchors, parse_url(), read(), response(), ssi_close(), ssi_get_server_fd(), ssi_open(), syserr_print(), and writeall().

void makepath char *  path,
size_t  max_path,
const char *  newpath
[static]
 

Definition at line 157 of file br.c.

Referenced by main().

void parse_url const char *  url,
char *  host,
size_t  max_host,
char *  path,
size_t  max_path
[static]
 

Definition at line 120 of file br.c.

Referenced by main().

bool response char *  s,
int  len,
bool  start,
bool  showtags,
bool  want_display,
char **  newloc
[static]
 

Definition at line 301 of file br.c.

References display(), FN_CONTENT_LENGTH, FN_LOCATION, and FN_TRANSFER_ENCODING.

Referenced by main().


Variable Documentation

char a_href[MAX_HREF]
 

Definition at line 36 of file br.c.

Referenced by add_href(), and go_link().

char a_link[MAX_LINK]
 

Definition at line 35 of file br.c.

Referenced by add_link(), and go_link().

struct { ... } anchor[MAX_ANCHORS] [static]
 

Referenced by add_href(), add_link(), go_link(), and main().

int nanchors [static]
 

Definition at line 38 of file br.c.

Referenced by add_href(), add_link(), go_link(), and main().


Generated on Fri Apr 23 10:57:10 2004 for AUP2 Example Source by doxygen 1.3.1