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

html.c File Reference

HTML I/O handling. More...

#include "html.h"
#include "inf.h"

Go to the source code of this file.

Functions

char * ascii2rq (char *orig)
 Escapes special chars in an ascii string to make it request compliant.

void list_songs (request_rec *r, struct mu_ent *p, mu_config *conf)
 Formats the list of songs to be sent.

char treat_args (request_rec *r, mu_config *conf)
 Treats the URL arguments.

void send_url (request_rec *r, char *uri, char *command)
 Formats a complete url string to be sent to client.

void send_head (request_rec *r, mu_config *conf)
 Sends HTML page headers and top of the page.

void send_directories (request_rec *r, struct mu_ent *p, mu_config *conf)
 Sends directory listing for the current folder.

void send_tracks (request_rec *r, struct mu_ent *p, mu_config *conf)
 Sends track listing for the current folder.

void send_playlist (request_rec *r, mu_ent *p, mu_config *conf)
 Sends playlist with url and EXTM3U info to the client.

void send_foot (request_rec *r, mu_config *conf)
 Sends HTML page footers.


Variables

char chaine [MAX_STRING]
 Global string used in URL processing.


Detailed Description

HTML I/O handling.

Author:
Regis Boudin

Thibaut Varene

Version:
Revision
1.46
Date:
2003
That file groups all functions related to HTML generation and parsing, that is to say functions that are used to send HTML code to the client and functions that are in the process of parsing URI requests. Here are also the functions related to m3u playlist creation.

Definition in file html.c.


Function Documentation

char* ascii2rq char *  orig  )  [static]
 

Escapes special chars in an ascii string to make it request compliant.

Bug:
Will fail in the worst case if the URI is made only of chars to be escaped and is more than MAX_STRING/3 long.
Parameters:
orig The string to escape.
Returns:
The escaped string.

Definition at line 55 of file html.c.

References chaine.

Referenced by list_songs().

void list_songs request_rec *  r,
struct mu_ent p,
mu_config conf
[static]
 

Formats the list of songs to be sent.

This function formats a list of tracks (if any) to be sent to the client, as found in the p list passed in argument. Depending on config options, it allows streaming/shuffle etc.

Parameters:
r Apache request_rec struct to handle connection details.
p struct mu_ent.
conf MusicIndex configuration paramaters struct.

Definition at line 87 of file html.c.

References ascii2rq(), mu_config::fetch_icon, mu_config::fields, FT_MP3, FT_OGG, MI_ALLOWDWNLD, MI_ALLOWSTREAM, MI_QUICKPL, MI_RECURSIVE, MI_SEARCH, mu_config::options, SB_ALBUM, SB_ARTIST, SB_BITRATE, SB_DATE, SB_FILETYPE, SB_GENRE, SB_LENGTH, SB_POSN, SB_TITLE, SB_TRACK, and mu_config::sound_icon.

Referenced by send_tracks().

void send_directories request_rec *  r,
struct mu_ent p,
mu_config conf
 

Sends directory listing for the current folder.

This function takes care of preparing and sending to the client the list (if any) of the available directories in the current folder. Depending on config options, it allows streaming/shuffle etc.

Parameters:
r Apache request_rec struct to handle connection details.
p struct mu_ent.
conf MusicIndex configuration paramaters struct.

Definition at line 463 of file html.c.

References FT_DIR, MAX_STRING, MI_ALLOWSTREAM, mu_config::options, and mu_config::small_cd_icon.

void send_foot request_rec *  r,
mu_config conf
 

Sends HTML page footers.

This function takes care of the formating of the HTML page footers. It sends the data that is common to all pages generated by the handler. Currently it relies on apache_mp3 original stylesheets.

Parameters:
r Apache request_rec struct to handle connection details.
conf MusicIndex configuration paramaters struct.

Definition at line 744 of file html.c.

References MUSIC_AUTHORS_STRING, and MUSIC_VERSION_STRING.

Referenced by musicindex_directory().

void send_head request_rec *  r,
mu_config conf
 

Sends HTML page headers and top of the page.

This function takes care of the formating of the HTML page headers. It sends the data that is common to all pages generated by the handler.

Parameters:
r Apache request_rec struct to handle connection details.
conf MusicIndex configuration paramaters struct.

Definition at line 353 of file html.c.

References mu_config::arrow, mu_config::cd_icon, mu_config::css, MI_ALLOWSEARCH, MI_ALLOWSTREAM, mu_config::options, and mu_config::title.

Referenced by musicindex_directory().

void send_playlist request_rec *  r,
mu_ent p,
mu_config conf
 

Sends playlist with url and EXTM3U info to the client.

This function prepares an m3u playlist (with extra information where available: length, artist, title, album) and sends it to the client.

Bug:
Some browsers have trouble detecting the mime type. Try to send a ".m3u" file extension?
Parameters:
r Apache request_rec struct to handle connection details.
p struct mu_ent.
conf MusicIndex configuration paramaters struct.

Definition at line 712 of file html.c.

References mu_ent::album, mu_ent::artist, mu_ent::length, mu_ent::next, send_url(), mu_ent::title, and mu_ent::uri.

Referenced by playlist_directory(), and playlist_selected().

void send_tracks request_rec *  r,
struct mu_ent p,
mu_config conf
 

Sends track listing for the current folder.

This function takes care of preparing and sending to the client the list (if any) of the available songs in the current p list. Depending on config options, it allows streaming/shuffle etc.

Bug:
Know potential problem when sorting search results.
Parameters:
r Apache request_rec struct to handle connection details.
p struct mu_ent.
conf MusicIndex configuration paramaters struct.

Definition at line 554 of file html.c.

References mu_config::fields, FT_DIR, list_songs(), MI_ALLOWDWNLD, MI_ALLOWSTREAM, MI_QUICKPL, MI_SEARCH, mu_ent::next, mu_config::options, mu_config::order, SB_ALBUM, SB_ARTIST, SB_BITRATE, SB_DATE, SB_FILETYPE, SB_GENRE, SB_LENGTH, SB_POSN, SB_TITLE, and SB_TRACK.

void send_url request_rec *  r,
char *  uri,
char *  command
 

Formats a complete url string to be sent to client.

This function does all the URL formatting, in the form: http://[user:][passwd@]hostname[:port]/uri/

Parameters:
r Apache request_rec struct to handle connection details.
uri A string (basically a path) to be sent to form a complete url.
command An eventual command (like ?action=playall).

Definition at line 302 of file html.c.

References MAX_PREFIX.

Referenced by send_playlist().

char treat_args request_rec *  r,
mu_config conf
 

Treats the URL arguments.

This function searches for keywords passed as URL arguments (with "?xxx") and sets the handler options accordingly.

Parameters:
r Apache request_rec struct to handle connection details.
conf MusicIndex configuration paramaters struct.
Returns:
The corresponding option letter.

Definition at line 222 of file html.c.

References ARG_NUMBER, mu_config::cache_path, MI_ALLOWSEARCH, MI_ALLOWSTREAM, MI_QUICKPL, MI_RECURSIVE, MI_SEARCH, mu_config::options, mu_config::order, mu_config::play_recursive, SB_DEFAULT, SB_RANDOM, SB_URI, mu_config::search, and set_fctptrs().

Referenced by handle_musicindex().


Variable Documentation

char chaine[MAX_STRING]
 

Global string used in URL processing.

That global variable is mandatory since it's used by ascii2rq to return a proper request string.

Definition at line 43 of file html.c.

Referenced by ascii2rq().


Generated on Thu Oct 30 13:50:29 2003 for mod_musicindex by doxygen 1.3.4