Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

validate.c File Reference

Validation functions. More...

#include "config.h"
#include "defines.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <idna.h>
#include "utils.h"
#include "validate.h"

Go to the source code of this file.

Functions

int is_valid_hostname (const u_char *hostname)
int is_valid_http_link (const u_char *link, int strict)
int is_valid_mailto_link (const u_char *addr)
int is_valid_mailaddress (const u_char *address)
int is_valid_wais_link (const u_char *link)
int is_valid_prospero_link (const u_char *link)
int is_valid_telnet_link (const u_char *link)
int is_valid_nntp_link (const u_char *link)
int is_valid_news_link (const u_char *link)
int is_valid_gopher_link (const u_char *link)
int is_valid_ftp_link (const u_char *link)
int is_valid_link (const u_char *link)


Detailed Description

Validation functions.

Author:
Christian Kruse, <cjk@wwwtech.de>
This file contains validation functions (e.g. link and mail validation)

Todo:
file:// URL validation

Definition in file validate.c.


Function Documentation

int is_valid_ftp_link const u_char *  link  ) 
 

Checks if a link is a valid ftp link

Parameters:
link The link string to check
Returns:
0 if the address is valid, -1 if it isn't

Definition at line 961 of file validate.c.

int is_valid_gopher_link const u_char *  link  ) 
 

Checks if a link is a valid gopher link

Parameters:
link The link string to check
Returns:
0 if the address is valid, -1 if it isn't

Definition at line 815 of file validate.c.

int is_valid_hostname const u_char *  hostname  ) 
 

Checks if a hostname is valid

Parameters:
hostname The name of the host
Returns:
0 if it is valid, -1 if it isn't

Definition at line 92 of file validate.c.

int is_valid_http_link const u_char *  link,
int  strict
 

Validation function for HTTP links

Parameters:
link The link to check
strict Strict mode or no strict mode. If strict, no anchors are allowed
Returns:
0 if link is valid, -1 if it isn't

Definition at line 128 of file validate.c.

int is_valid_link const u_char *  link  ) 
 

Wrapper function; it checks for a scheme and calls the scheme validation function

Definition at line 1097 of file validate.c.

int is_valid_mailaddress const u_char *  addr  ) 
 

Validation function for a mail address

Parameters:
addr The mail address \¶eturn 0 if the address is valid, -1 if it isn't

Definition at line 286 of file validate.c.

int is_valid_mailto_link const u_char *  addr  ) 
 

Checks if a link is a valid mailto link

Parameters:
addr The link string to check
Returns:
0 if the address is valid, -1 if it isn't

Definition at line 270 of file validate.c.

int is_valid_news_link const u_char *  link  ) 
 

Checks if a link is a valid news link

Parameters:
link The link string to check
Returns:
0 if the address is valid, -1 if it isn't

Definition at line 719 of file validate.c.

int is_valid_nntp_link const u_char *  link  ) 
 

Checks if a link is a valid nntp link

Parameters:
link The link string to check
Returns:
0 if the address is valid, -1 if it isn't

Definition at line 674 of file validate.c.

int is_valid_prospero_link const u_char *  link  ) 
 

Checks if a link is a valid prospero link

Parameters:
link The link string to check
Returns:
0 if the address is valid, -1 if it isn't

Definition at line 443 of file validate.c.

int is_valid_telnet_link const u_char *  link  ) 
 

Checks if a link is a valid telnet link

Parameters:
link The link string to check
Returns:
0 if the address is valid, -1 if it isn't

Definition at line 562 of file validate.c.

int is_valid_wais_link const u_char *  link  ) 
 

Checks if a link is a valid wais link

Parameters:
link The link string to check
Returns:
0 if the address is valid, -1 if it isn't

Definition at line 325 of file validate.c.


Generated on Sun Apr 25 16:37:39 2004 for Classic Forum by doxygen 1.3.5