FLTK 1.3.0
Filenames

Functions

int fl_open_uri (const char *uri, char *msg, int msglen)
 Opens the specified Uniform Resource Identifier (URI).

Function Documentation

int fl_open_uri ( const char *  uri,
char *  msg,
int  msglen 
)

Opens the specified Uniform Resource Identifier (URI).

Uses an operating-system dependent program or interface. For URIs using the "ftp", "http", or "https" schemes, the system default web browser is used to open the URI, while "mailto" and "news" URIs are typically opened using the system default mail reader and "file" URIs are opened using the file system navigator.

On success, the (optional) msg buffer is filled with the command that was run to open the URI; on Windows, this will always be "open uri".

On failure, the msg buffer is filled with an English error message.

Example

 #include <FL/filename.H>
 [..]
 char errmsg[512];
 if ( !fl_open_uri("http://google.com/", errmsg, sizeof(errmsg)) ) {
     char warnmsg[768];
     sprintf(warnmsg, "Error: %s", errmsg);
     fl_alert(warnmsg);
 }
Parameters:
uriThe URI to open
msgOptional buffer which contains the command or error message
msglenLength of optional buffer
Returns:
1 on success, 0 on failure