uri.c File Reference

Funtions for file URI handling. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "uri.h"

Include dependency graph for uri.c:

Go to the source code of this file.

Functions

void set_uri_port (uri_t *uri, char *port)
void set_uri_passwd (uri_t *uri, char *passwd)
void set_uri_params (uri_t *uri, char *params)
void set_uri_query (uri_t *uri, char *query)
void set_uri_frag (uri_t *uri, char *frag)
char * parse_path (uri_t *uri, char *uri_pointer)
char * parse_params (uri_t *uri, char *uri_pointer)
char * parse_query (uri_t *uri, char *uri_pointer)
char * parse_frag (uri_t *uri, char *uri_pointer)
char * parse_scheme (uri_t *uri, char *uri_pointer)
char * parse_userinfo (uri_t *uri, char *uri_pointer)
char * parse_hostport (uri_t *uri, char *uri_pointer)
char * parse_authority (uri_t *uri, char *uri_pointer)
char * get_uri_host (uri_t *uri)
char * get_uri_port (uri_t *uri)
char * get_uri_path (uri_t *uri)
char * get_uri_params (uri_t *uri)
char * get_uri_query (uri_t *uri)
char * get_uri_frag (uri_t *uri)
char * get_uri_user (uri_t *uri)
char * get_uri_passwd (uri_t *uri)
char * get_uri_scheme (uri_t *uri)
uri_talloc_uri_struct (void)
uri_tparse_uri (char *uri_string, int len)
char * uri_string (uri_t *uri)
void free_uri (uri_t *uri)
char * get_uri_host_and_path (uri_t *uri)
void set_uri_scheme (uri_t *uri, char *scheme)
void set_uri_user (uri_t *uri, char *user)
void set_uri_host (uri_t *uri, char *host)
void set_uri_path (uri_t *uri, char *path)


Detailed Description

Funtions for file URI handling.

Author
peltotal
Date
2007/02/28 08:58:01
Revision
1.13

MAD-FLUTELIB: Implementation of FLUTE protocol. Copyright (c) 2003-2007 TUT - Tampere University of Technology main authors/contacts: jani.peltotalo@tut.fi and sami.peltotalo@tut.fi

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

In addition, as a special exception, TUT - Tampere University of Technology gives permission to link the code of this program with the OpenSSL library (or with modified versions of OpenSSL that use the same license as OpenSSL), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than OpenSSL. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.

Definition in file uri.c.


Function Documentation

uri_t* alloc_uri_struct ( void   ) 

This function allocates memory for uri_t structure.

Returns:
pointer to allocated uri_t structure, NULL in error cases.

Definition at line 595 of file uri.c.

Referenced by encode_directory(), and encode_file().

Here is the caller graph for this function:

void free_uri ( uri_t uri  ) 

This function frees uri_t structure.

Parameters:
uri uri_t structure

Definition at line 714 of file uri.c.

References uri::frag, uri::host, uri::params, uri::passwd, uri::path, uri::port, uri::query, uri::scheme, and uri::user.

Referenced by encode_directory(), encode_file(), fdtbasedrecv(), fdtbasedsend(), free_query_str(), name_incomplete_objects(), receiver_in_ui_mode(), and repair_sender_in_fdt_based_mode().

Here is the caller graph for this function:

char* get_uri_frag ( uri_t uri  ) 

This is a private function which returns fragment part of the URI.

Parameters:
uri uri_t structure
Returns:
fragment part of the URI

Definition at line 552 of file uri.c.

References uri::frag.

char* get_uri_host ( uri_t uri  ) 

This is a private function which returns hostname part of the URI.

Parameters:
uri uri_t structure
Returns:
hostname part of the URI

Definition at line 487 of file uri.c.

References uri::host.

char* get_uri_host_and_path ( uri_t uri  ) 

This function returns host and path string (e.g. www.foo.com/foo).

Parameters:
uri uri_t structure
Returns:
pointer to constructed string, NULL in error cases.

Definition at line 747 of file uri.c.

References uri::host, and uri::path.

Referenced by fdtbasedrecv(), main(), name_incomplete_objects(), and receiver_in_ui_mode().

Here is the caller graph for this function:

char* get_uri_params ( uri_t uri  ) 

This is a private function which returns parameter part of the URI.

Parameters:
uri uri_t structure
Returns:
parameter part of the URI

Definition at line 526 of file uri.c.

References uri::params.

char* get_uri_passwd ( uri_t uri  ) 

This is a private function which returns password part of the URI.

Parameters:
uri uri_t structure
Returns:
password part of the URI

Definition at line 578 of file uri.c.

References uri::passwd.

char* get_uri_path ( uri_t uri  ) 

This is a private function which returns path part of the URI.

Parameters:
uri uri_t structure
Returns:
path part of the URI

Definition at line 513 of file uri.c.

References uri::path.

char* get_uri_port ( uri_t uri  ) 

This is a private function which returns port part of the URI.

Parameters:
uri uri_t structure
Returns:
port part of the URI

Definition at line 500 of file uri.c.

References uri::port.

char* get_uri_query ( uri_t uri  ) 

This is a private function which returns query part of the URI.

Parameters:
uri uri_t structure
Returns:
query part of the URI

Definition at line 539 of file uri.c.

References uri::query.

char* get_uri_scheme ( uri_t uri  ) 

This is a private function which returns scheme part of the URI.

Parameters:
uri uri_t structure
Returns:
scheme part of the URI

Definition at line 591 of file uri.c.

References uri::scheme.

char* get_uri_user ( uri_t uri  ) 

This is a private function which returns user part of the URI.

Parameters:
uri uri_t structure
Returns:
user part of the URI

Definition at line 565 of file uri.c.

References uri::user.

char* parse_authority ( uri_t uri,
char *  uri_pointer 
)

This is a private function which parses authority part of the URI string and stores the result to the uri_t structure.

Parameters:
uri uri_t structure
uri_pointer pointer to authority part of the URI string
Returns:
pointer to the next character after authority part

Definition at line 440 of file uri.c.

References parse_hostport(), and parse_userinfo().

Referenced by parse_uri().

Here is the call graph for this function:

Here is the caller graph for this function:

char* parse_frag ( uri_t uri,
char *  uri_pointer 
)

This is a private function which parses fragment part of the URI string and stores the result to the uri_t structure.

Parameters:
uri uri_t structure
uri_pointer pointer to fragment part of the URI string
Returns:
pointer to the next character after fragment part

Definition at line 289 of file uri.c.

References set_uri_frag().

Referenced by parse_uri().

Here is the call graph for this function:

Here is the caller graph for this function:

char* parse_hostport ( uri_t uri,
char *  uri_pointer 
)

This is a private function which parses host and port part of the URI string and stores the result to the uri_t structure.

Parameters:
uri uri_t structure
uri_pointer pointer to host and port part of the URI string
Returns:
pointer to the next character after host and port part

Definition at line 403 of file uri.c.

References set_uri_host(), and set_uri_port().

Referenced by parse_authority().

Here is the call graph for this function:

Here is the caller graph for this function:

char* parse_params ( uri_t uri,
char *  uri_pointer 
)

This is a private function which parses parameter part of the URI string and stores the result to the uri_t structure.

Parameters:
uri uri_t structure
uri_pointer pointer to parameter part of the URI string
Returns:
pointer to the next character after parameter part

Definition at line 193 of file uri.c.

References set_uri_scheme().

Here is the call graph for this function:

char* parse_path ( uri_t uri,
char *  uri_pointer 
)

This is a private function which parses path part of the URI string and stores the result to the uri_t structure.

Parameters:
uri uri_t structure
uri_pointer pointer to path part of the URI string
Returns:
pointer to the next character after path part

Definition at line 161 of file uri.c.

References set_uri_path().

Referenced by parse_uri().

Here is the call graph for this function:

Here is the caller graph for this function:

char* parse_query ( uri_t uri,
char *  uri_pointer 
)

This is a private function which parses query part of the URI string and stores the result to the uri_t structure.

Parameters:
uri uri_t structure
uri_pointer pointer to query part of the URI string
Returns:
pointer to the next character after query part

Definition at line 241 of file uri.c.

References set_uri_scheme().

Here is the call graph for this function:

char* parse_scheme ( uri_t uri,
char *  uri_pointer 
)

This is a private function which parses scheme of the URI string and stores the result to the uri_t structure.

Parameters:
uri uri_t structure
uri_pointer pointer to scheme of the URI string
Returns:
pointer to the next character after scheme part

Definition at line 307 of file uri.c.

References set_uri_scheme().

Referenced by parse_uri().

Here is the call graph for this function:

Here is the caller graph for this function:

uri_t* parse_uri ( char *  uri_string,
int  len 
)

This function parses URI string to the uri_t structure.

Parameters:
uri_string URI string
len length of thr URI string
Returns:
pointer to constructed uri_t structure, NULL in error cases.

Definition at line 606 of file uri.c.

References parse_authority(), parse_frag(), parse_path(), and parse_scheme().

Referenced by fdtbasedrecv(), fdtbasedsend(), name_incomplete_objects(), parse_query_string(), receiver_in_ui_mode(), remove_gz_files(), and repair_sender_in_fdt_based_mode().

Here is the call graph for this function:

Here is the caller graph for this function:

char* parse_userinfo ( uri_t uri,
char *  uri_pointer 
)

This is a private function which parses userinfo part of the URI string and stores the result to the uri_t structure.

Parameters:
uri uri_t structure
uri_pointer pointer to userinfo part of the URI string
Returns:
pointer to the next character after userinfo part

Definition at line 362 of file uri.c.

References set_uri_passwd(), and set_uri_user().

Referenced by parse_authority().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_uri_frag ( uri_t uri,
char *  frag 
)

This is a private function which sets fragment part.

Parameters:
uri uri_t structure
frag fragment

Definition at line 136 of file uri.c.

References uri::frag.

Referenced by parse_frag().

Here is the caller graph for this function:

void set_uri_host ( uri_t uri,
char *  host 
)

This function sets hostname.

Parameters:
uri uri_t structure
host (sender's) hostname

Definition at line 803 of file uri.c.

References uri::host.

Referenced by encode_directory(), encode_file(), and parse_hostport().

Here is the caller graph for this function:

void set_uri_params ( uri_t uri,
char *  params 
)

This is a private function which sets parameter part.

Parameters:
uri uri_t structure
params parameter part

Definition at line 92 of file uri.c.

References uri::params.

void set_uri_passwd ( uri_t uri,
char *  passwd 
)

This is a private function which sets password.

Parameters:
uri uri_t structure
passwd password

Definition at line 70 of file uri.c.

References uri::passwd.

Referenced by parse_userinfo().

Here is the caller graph for this function:

void set_uri_path ( uri_t uri,
char *  path 
)

This function sets path.

Parameters:
uri uri_t structure
path file path

Definition at line 817 of file uri.c.

References uri::path.

Referenced by encode_directory(), encode_file(), and parse_path().

Here is the caller graph for this function:

void set_uri_port ( uri_t uri,
char *  port 
)

This is a private function which sets port number.

Parameters:
uri uri_t structure
port port number

Definition at line 48 of file uri.c.

References uri::port.

Referenced by parse_hostport().

Here is the caller graph for this function:

void set_uri_query ( uri_t uri,
char *  query 
)

This is a private function which sets query part.

Parameters:
uri uri_t structure
query query part

Definition at line 114 of file uri.c.

References uri::query.

void set_uri_scheme ( uri_t uri,
char *  scheme 
)

This function sets scheme.

Parameters:
uri uri_t structure
scheme URI scheme (file, http, ftp...)

Definition at line 775 of file uri.c.

References uri::scheme.

Referenced by encode_directory(), encode_file(), parse_params(), parse_query(), and parse_scheme().

Here is the caller graph for this function:

void set_uri_user ( uri_t uri,
char *  user 
)

This function sets username.

Parameters:
uri uri_t structure
user username

Definition at line 789 of file uri.c.

References uri::user.

Referenced by encode_directory(), encode_file(), and parse_userinfo().

Here is the caller graph for this function:

char* uri_string ( uri_t uri  ) 

This function constructs URI string.

Parameters:
uri uri_t structure
Returns:
pointer to constructed URI string, NULL in error cases.

Definition at line 648 of file uri.c.

References uri::host, uri::path, uri::port, and uri::scheme.

Referenced by encode_directory(), and encode_file().

Here is the caller graph for this function:


Generated on Fri Mar 9 20:08:58 2007 for MAD-FCL by  doxygen 1.5.0