diff options
362 files changed, 4511 insertions, 35836 deletions
diff --git a/Makefile.in b/Makefile.in index 69b4620398..df32d179d8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,7 +31,8 @@ BIN_DIRS= \ xbmc/lib/cmyth/libcmyth \ xbmc/lib/cmyth/librefmem \ xbmc/lib/libhts \ - xbmc/lib/libGoAhead \ + xbmc/lib/libjsonrpc \ + xbmc/lib/libhttpapi \ xbmc/lib/libPython \ xbmc/lib/libPython/xbmcmodule \ xbmc/lib/libRTMP \ @@ -236,8 +237,12 @@ xbmc/lib/libXBMS/libxbms-@ARCH@.a: force $(MAKE) -C xbmc/lib/libXBMS xbmc/lib/libXDAAP/libxdaap-@ARCH@.a: force $(MAKE) -C xbmc/lib/libXDAAP -xbmc/lib/libGoAhead/libGoAhead-@ARCH@.a: force - $(MAKE) -C xbmc/lib/libGoAhead +lib/jsoncpp/jsoncpp/src/lib_json/libjsoncpp.a: force + $(MAKE) -C lib/jsoncpp/jsoncpp/src/lib_json +xbmc/lib/libjsonrpc/libjsonrpc.a: force + $(MAKE) -C xbmc/lib/libjsonrpc +xbmc/lib/libhttpapi/libhttpapi.a: force + $(MAKE) -C xbmc/lib/libhttpapi xbmc/lib/sqLite/sqllite.a: force $(MAKE) -C xbmc/lib/sqLite xbmc/lib/UnrarXLib/UnrarXLib.a: force @@ -348,7 +353,9 @@ xcode_depends: \ xbmc/lib/libRTV/librtv-@ARCH@.a \ xbmc/lib/libXDAAP/libxdaap-@ARCH@.a \ xbmc/lib/libshout/libshout-@ARCH@.a \ - xbmc/lib/libGoAhead/libGoAhead-@ARCH@.a + xbmc/lib/libjsonrpc/libjsonrpc.a \ + lib/jsoncpp/jsoncpp/src/lib_json.a \ + xbmc/lib/libhttpapi/libhttpapi.a # platform independend objects OBJSXBMC= \ @@ -388,7 +395,9 @@ OBJSXBMC= \ xbmc/lib/libshout/libshout-@ARCH@.a \ xbmc/lib/libUPnP/libupnp-@ARCH@.a \ xbmc/lib/libXDAAP/libxdaap-@ARCH@.a \ - xbmc/lib/libGoAhead/libGoAhead-@ARCH@.a \ + xbmc/lib/libjsonrpc/libjsonrpc.a \ + lib/jsoncpp/jsoncpp/src/lib_json/libjsoncpp.a \ + xbmc/lib/libhttpapi/libhttpapi.a \ xbmc/lib/sqLite/sqllite.a \ xbmc/lib/libsquish/libsquish-@ARCH@.a \ xbmc/lib/libapetag/.libs/libapetag.a \ @@ -501,7 +510,7 @@ install-livedatas: install-web: @mkdir -p $(prefix)/share/xbmc/web - @cp -r web/Project_Mayhem_III/* $(prefix)/share/xbmc/web + @cp -r web/poc_jsonrpc/* $(prefix)/share/xbmc/web @find $(prefix)/share/xbmc/web -depth -name .svn -exec rm -rf {} \; uninstall: diff --git a/configure.in b/configure.in index 8100fa10f5..7c3f2baba5 100644 --- a/configure.in +++ b/configure.in @@ -188,6 +188,11 @@ AC_ARG_ENABLE([asap-codec], [enable ASAP ADPCM support])], [use_asap=$enableval], [use_asap=no]) +AC_ARG_ENABLE([webserver], + [AS_HELP_STRING([--disable-webserver], + [disable webserver])], + [use_webserver=$enableval], + [use_webserver=yes]) AC_ARG_ENABLE([libdts], [AS_HELP_STRING([--enable-libdts], [enable deprecated libdts support])], @@ -306,6 +311,12 @@ else AC_CHECK_LIB([SDL_gfx], [main]) fi +if test "$host_vendor" != "apple" ; then + if test "$use_webserver" = "yes"; then + AC_CHECK_LIB([microhttpd], [main],, AC_MSG_ERROR($missing_library)) + fi +fi + # platform independent libraries AC_CHECK_HEADER([mad.h],, AC_MSG_ERROR($missing_library)) @@ -937,6 +948,15 @@ else final_message="$final_message\n ASAP Codec:\tNo" fi +if test "$use_webserver" = "yes"; then + final_message="$final_message\n Webserver:\tYes" + HAVE_XBMC_NONFREE=1 + AC_DEFINE([HAS_WEB_SERVER], [1], [Define to 1 to enable webserver.]) +else + HAS_WEB_SERVER=0 + final_message="$final_message\n Webserver:\tNo" +fi + if test "$use_libdts" = "yes"; then USE_LIBDTS_DECODER=1 AC_DEFINE([USE_LIBDTS_DECODER], [1], [Define to 1 to enable deprecated libdts support]) @@ -1021,7 +1041,9 @@ OUTPUT_FILES="Makefile \ xbmc/lib/libexif/Makefile \ xbmc/lib/libXDAAP/Makefile \ xbmc/lib/libhdhomerun/Makefile \ - xbmc/lib/libGoAhead/Makefile \ + xbmc/lib/libhttpapi/Makefile \ + lib/jsoncpp/jsoncpp/src/lib_json/Makefile \ + xbmc/lib/libjsonrpc/Makefile \ xbmc/lib/libshout/Makefile \ xbmc/lib/libsquish/Makefile \ xbmc/lib/libid3tag/Makefile \ diff --git a/guilib/system.h b/guilib/system.h index 40afb4ac4b..19b9f88d28 100644 --- a/guilib/system.h +++ b/guilib/system.h @@ -44,7 +44,9 @@ #define HAS_UPNP #define HAS_VIDEO_PLAYBACK #define HAS_VISUALISATION -#define HAS_WEB_SERVER +#define HAS_WEB_INTERFACE +#define HAS_JSONRPC +#define HAS_HTTPAPI #define HAS_AC3_CODEC #define HAS_DTS_CODEC diff --git a/lib/jsoncpp/jsoncpp/src/lib_json/Makefile.in b/lib/jsoncpp/jsoncpp/src/lib_json/Makefile.in new file mode 100644 index 0000000000..fc615bcdec --- /dev/null +++ b/lib/jsoncpp/jsoncpp/src/lib_json/Makefile.in @@ -0,0 +1,7 @@ +INCLUDES=-I../../include + +SRCS=json_reader.cpp json_value.cpp json_writer.cpp + +LIB= libjsoncpp.a + +include ../../../../../Makefile.include diff --git a/web/poc_jsonrpc/albums.html b/web/poc_jsonrpc/albums.html new file mode 100644 index 0000000000..bb038db598 --- /dev/null +++ b/web/poc_jsonrpc/albums.html @@ -0,0 +1,29 @@ +<html> +<head> +<title>XBMC - Albums</title> +<link type="text/css" rel="stylesheet" href="basic.css"> +<script type="text/javascript" src="json.js"> // FOR browsers which doesn't have it included +</script> +</head> +<body> +<h1>Albums</h1> + +<script type="text/javascript"> +var http_request = new XMLHttpRequest(); +http_request.open( "POST", "jsonrpc", false ); +http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"MusicLibrary.GetAlbums\", \"id\": 1}"); + +var the_object = JSON.parse(http_request.responseText); +var result = the_object["result"]; +var array = result["albums"]; +for (var property in array) { + var item = array[property]; + if (item["thumbnail"]) + document.write("<img src=thumb/" + item["thumbnail"] + ".jpg width=100 alt=\"" + item["album"] + "\"></img>"); + else + document.write("<img src=images/DefaultAlbumCover.png width=100 alt=\"" + item["album"] + "\"></img>"); +} + +</script> +</body> +</html> diff --git a/web/poc_jsonrpc/basic.css b/web/poc_jsonrpc/basic.css new file mode 100644 index 0000000000..7f70ff166b --- /dev/null +++ b/web/poc_jsonrpc/basic.css @@ -0,0 +1,45 @@ +body +{ + background-color:black; + color:grey; +} + +A:link { + color: red; +} + +h1 +{ + color:white; +} + + + +table { + border:0px; + width:500px; +} + +table.Movies th { + text-align:left; + background-color:rgb(50,50,50); +} + +table.Movies td.Cover { + text-align:center; + background:black; +} + +table.Movies tr.Odd { + background:rgb(0,0,0); +} + +table.Movies tr.Even { + background:rgb(30,30,30); +} + +table.Info td.Title { + background-color:yellow; + text-align:right; + color:white; +} diff --git a/web/poc_jsonrpc/images/DefaultAlbumCover.png b/web/poc_jsonrpc/images/DefaultAlbumCover.png Binary files differnew file mode 100644 index 0000000000..ef73da903b --- /dev/null +++ b/web/poc_jsonrpc/images/DefaultAlbumCover.png diff --git a/web/poc_jsonrpc/index.html b/web/poc_jsonrpc/index.html new file mode 100644 index 0000000000..02438bef22 --- /dev/null +++ b/web/poc_jsonrpc/index.html @@ -0,0 +1,12 @@ +<html> +<head> +<title>XBMC</title> +<link type="text/css" rel="stylesheet" href="basic.css"> +</head> +<body> +<h1>XBMC Webinterface</h1> +<a href="movies.html"><h2>Movies</h2></a> +<a href="tvshows.html"><h2>TVShows</h2></a> +<a href="albums.html"><h2>Albums</h2></a> +</body> +</html> diff --git a/web/poc_jsonrpc/json.js b/web/poc_jsonrpc/json.js new file mode 100644 index 0000000000..37eb6d473a --- /dev/null +++ b/web/poc_jsonrpc/json.js @@ -0,0 +1,482 @@ +//alert('IMPORTANT: Remove this line from json2.js before deployment.'); +/* + http://www.JSON.org/json2.js + 2009-09-29 + + Public Domain. + + NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + + See http://www.JSON.org/js.html + + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. + + + This file creates a global JSON object containing two methods: stringify + and parse. + + JSON.stringify(value, replacer, space) + value any JavaScript value, usually an object or array. + + replacer an optional parameter that determines how object + values are stringified for objects. It can be a + function or an array of strings. + + space an optional parameter that specifies the indentation + of nested structures. If it is omitted, the text will + be packed without extra whitespace. If it is a number, + it will specify the number of spaces to indent at each + level. If it is a string (such as '\t' or ' '), + it contains the characters used to indent at each level. + + This method produces a JSON text from a JavaScript value. + + When an object value is found, if the object contains a toJSON + method, its toJSON method will be called and the result will be + stringified. A toJSON method does not serialize: it returns the + value represented by the name/value pair that should be serialized, + or undefined if nothing should be serialized. The toJSON method + will be passed the key associated with the value, and this will be + bound to the value + + For example, this would serialize Dates as ISO strings. + + Date.prototype.toJSON = function (key) { + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + return this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z'; + }; + + You can provide an optional replacer method. It will be passed the + key and value of each member, with this bound to the containing + object. The value that is returned from your method will be + serialized. If your method returns undefined, then the member will + be excluded from the serialization. + + If the replacer parameter is an array of strings, then it will be + used to select the members to be serialized. It filters the results + such that only members with keys listed in the replacer array are + stringified. + + Values that do not have JSON representations, such as undefined or + functions, will not be serialized. Such values in objects will be + dropped; in arrays they will be replaced with null. You can use + a replacer function to replace those with JSON values. + JSON.stringify(undefined) returns undefined. + + The optional space parameter produces a stringification of the + value that is filled with line breaks and indentation to make it + easier to read. + + If the space parameter is a non-empty string, then that string will + be used for indentation. If the space parameter is a number, then + the indentation will be that many spaces. + + Example: + + text = JSON.stringify(['e', {pluribus: 'unum'}]); + // text is '["e",{"pluribus":"unum"}]' + + + text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); + // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' + + text = JSON.stringify([new Date()], function (key, value) { + return this[key] instanceof Date ? + 'Date(' + this[key] + ')' : value; + }); + // text is '["Date(---current time---)"]' + + + JSON.parse(text, reviver) + This method parses a JSON text to produce an object or array. + It can throw a SyntaxError exception. + + The optional reviver parameter is a function that can filter and + transform the results. It receives each of the keys and values, + and its return value is used instead of the original value. + If it returns what it received, then the structure is not modified. + If it returns undefined then the member is deleted. + + Example: + + // Parse the text. Values that look like ISO date strings will + // be converted to Date objects. + + myData = JSON.parse(text, function (key, value) { + var a; + if (typeof value === 'string') { + a = +/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); + if (a) { + return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], + +a[5], +a[6])); + } + } + return value; + }); + + myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { + var d; + if (typeof value === 'string' && + value.slice(0, 5) === 'Date(' && + value.slice(-1) === ')') { + d = new Date(value.slice(5, -1)); + if (d) { + return d; + } + } + return value; + }); + + + This is a reference implementation. You are free to copy, modify, or + redistribute. +*/ + +/*jslint evil: true, strict: false */ + +/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, + call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, + getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, + lastIndex, length, parse, prototype, push, replace, slice, stringify, + test, toJSON, toString, valueOf +*/ + + +// Create a JSON object only if one does not already exist. We create the +// methods in a closure to avoid creating global variables. + +if (!this.JSON) { + this.JSON = {}; +} + +(function () { + + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + if (typeof Date.prototype.toJSON !== 'function') { + + Date.prototype.toJSON = function (key) { + + return isFinite(this.valueOf()) ? + this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z' : null; + }; + + String.prototype.toJSON = + Number.prototype.toJSON = + Boolean.prototype.toJSON = function (key) { + return this.valueOf(); + }; + } + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + + + function quote(string) { + +// If the string contains no control characters, no quote characters, and no +// backslash characters, then we can safely slap some quotes around it. +// Otherwise we must also replace the offending characters with safe escape +// sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? + '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : + '"' + string + '"'; + } + + + function str(key, holder) { + +// Produce a string from holder[key]. + + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + +// If the value has a toJSON method, call it to obtain a replacement value. + + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + +// If we were called with a replacer function, then call the replacer to +// obtain a replacement value. + + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + +// What happens next depends on the value's type. + + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + +// JSON numbers must be finite. Encode non-finite numbers as null. + + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + +// If the value is a boolean or null, convert it to a string. Note: +// typeof null does not produce 'null'. The case is included here in +// the remote chance that this gets fixed someday. + + return String(value); + +// If the type is 'object', we might be dealing with an object or an array or +// null. + + case 'object': + +// Due to a specification blunder in ECMAScript, typeof null is 'object', +// so watch out for that case. + + if (!value) { + return 'null'; + } + +// Make an array to hold the partial results of stringifying this object value. + + gap += indent; + partial = []; + +// Is the value an array? + + if (Object.prototype.toString.apply(value) === '[object Array]') { + +// The value is an array. Stringify every element. Use null as a placeholder +// for non-JSON values. + + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + +// Join all of the elements together, separated with commas, and wrap them in +// brackets. + + v = partial.length === 0 ? '[]' : + gap ? '[\n' + gap + + partial.join(',\n' + gap) + '\n' + + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + +// If the replacer is an array, use it to select the members to be stringified. + + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } else { + +// Otherwise, iterate through all of the keys in the object. + + for (k in value) { + if (Object.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + +// Join all of the member texts together, separated with commas, +// and wrap them in braces. + + v = partial.length === 0 ? '{}' : + gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + + mind + '}' : '{' + partial.join(',') + '}'; + gap = mind; + return v; + } + } + +// If the JSON object does not yet have a stringify method, give it one. + + if (typeof JSON.stringify !== 'function') { + JSON.stringify = function (value, replacer, space) { + +// The stringify method takes a value and an optional replacer, and an optional +// space parameter, and returns a JSON text. The replacer can be a function +// that can replace values, or an array of strings that will select the keys. +// A default replacer method can be provided. Use of the space parameter can +// produce text that is more easily readable. + + var i; + gap = ''; + indent = ''; + +// If the space parameter is a number, make an indent string containing that +// many spaces. + + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + +// If the space parameter is a string, it will be used as the indent string. + + } else if (typeof space === 'string') { + indent = space; + } + +// If there is a replacer, it must be a function or an array. +// Otherwise, throw an error. + + rep = replacer; + if (replacer && typeof replacer !== 'function' && + (typeof replacer !== 'object' || + typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + +// Make a fake root object containing our value under the key of ''. +// Return the result of stringifying the value. + + return str('', {'': value}); + }; + } + + +// If the JSON object does not yet have a parse method, give it one. + + if (typeof JSON.parse !== 'function') { + JSON.parse = function (text, reviver) { + +// The parse method takes a text and an optional reviver function, and returns +// a JavaScript value if the text is a valid JSON text. + + var j; + + function walk(holder, key) { + +// The walk method is used to recursively walk the resulting structure so +// that modifications can be made. + + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + + +// Parsing happens in four stages. In the first stage, we replace certain +// Unicode characters with escape sequences. JavaScript handles many characters +// incorrectly, either silently deleting them, or treating them as line endings. + + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + +// In the second stage, we run the text against regular expressions that look +// for non-JSON patterns. We are especially concerned with '()' and 'new' +// because they can cause invocation, and '=' because it can cause mutation. +// But just to be safe, we want to reject all unexpected forms. + +// We split the second stage into 4 regexp operations in order to work around +// crippling inefficiencies in IE's and Safari's regexp engines. First we +// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we +// replace all simple value tokens with ']' characters. Third, we delete all +// open brackets that follow a colon or comma or that begin the text. Finally, +// we look to see that the remaining characters are only whitespace or ']' or +// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. + + if (/^[\],:{}\s]*$/. +test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). +replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). +replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + +// In the third stage we use the eval function to compile the text into a +// JavaScript structure. The '{' operator is subject to a syntactic ambiguity +// in JavaScript: it can begin a block or an object literal. We wrap the text +// in parens to eliminate the ambiguity. + + j = eval('(' + text + ')'); + +// In the optional fourth stage, we recursively walk the new structure, passing +// each name/value pair to a reviver function for possible transformation. + + return typeof reviver === 'function' ? + walk({'': j}, '') : j; + } + +// If the text is not JSON parseable, then a SyntaxError is thrown. + + throw new SyntaxError('JSON.parse'); + }; + } +}()); diff --git a/web/poc_jsonrpc/movies.html b/web/poc_jsonrpc/movies.html new file mode 100644 index 0000000000..3e41a62042 --- /dev/null +++ b/web/poc_jsonrpc/movies.html @@ -0,0 +1,54 @@ +<html> +<head> +<title>XBMC - Movies</title> +<link type="text/css" rel="stylesheet" href="basic.css"> +<script type="text/javascript" src="json.js"> // FOR browsers which doesn't have it included +</script> +<script type="text/javascript"> +function PlayMovie(movieid) +{ + alert("Not implemented"); +} +</script> +</head> +<body> +<h1>Movies</h1> + +<script type="text/javascript"> +var http_request = new XMLHttpRequest(); +http_request.open( "POST", "jsonrpc", false ); +var send = { "jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "id": 1 } +http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.GetMovies\", \"params\": { \"fields\": [\"title\", \"plot\"] }, \"id\": 1}"); + +var the_object = JSON.parse(http_request.responseText); +var result = the_object["result"]; +var array = result["movies"]; + +document.write("<table class=\"Movies\"><thead><tr><th>Thumbnail</th><th>Info</th></tr></thead><tbody>"); +var odd = false; +for (var property in array) { + var item = array[property]; + var row = "even"; + if (odd) + row = "odd"; + + document.write("<tr class=\"" + row + "\"><td class=\"cover\">"); + if (item["thumbnail"]) + document.write("<img src=thumb/" + item["thumbnail"] + ".jpg alt=\"" + item["title"] + "\" height=200 onclick=\"PlayMovie(" + item["movieid"] + ")\"></img>"); + document.write("</td><td>"); + + document.write("<table class\"Info\"><tr><td class=\"Title\">"); + document.write("<h1>" + item["title"] + "</h1>"); + document.write("</td></tr><tr><td class=\"Plot\">"); + if (item["plot"]) + document.write(item["plot"]); + document.write("</td></tr></table>"); + + + document.write("</td></tr>"); + odd = !odd; +} +document.write("</tbody></table>"); +</script> +</body> +</html> diff --git a/web/poc_jsonrpc/tvshows.html b/web/poc_jsonrpc/tvshows.html new file mode 100644 index 0000000000..8528bcc152 --- /dev/null +++ b/web/poc_jsonrpc/tvshows.html @@ -0,0 +1,53 @@ +<html> +<head> +<link type="text/css" rel="stylesheet" href="basic.css"> +<script type="text/javascript" src="json.js"> // FOR browsers which doesn't have it included +</script> +<script type="text/javascript"> +function PrintSeasons(tvshowid) +{ + document.close(); + document.open(); + document.write("<html><head><title>XBMC - Test</title><link type=\"text/css\" rel=\"stylesheet\" href=\"basic.css\"></head><body>"); + + var http_request = new XMLHttpRequest(); + http_request.open( "POST", "jsonrpc", false ); + http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.GetSeasons\", \"params\": { \"tvshowid\": " + tvshowid + ", \"fields\": [\"title\"] }, \"id\": 1}"); + + var the_object = JSON.parse(http_request.responseText); + var result = the_object["result"]; + var array = result["seasons"]; + for (var property in array) { + var item = array[property]; + document.write("<h1>" + item["title"] + "</h1>"); + document.write("<img src=thumb/" + (item["thumbnail"] ? item["thumbnail"] : "images/nocover.jpg") + ".jpg width=100></img>"); + document.write("<br>"); + } + + document.write("</body></html>"); +} +function PrintTVShows() +{ + document.write("<html><head><title>XBMC - TV Shows</title><link type=\"text/css\" rel=\"stylesheet\" href=\"basic.css\"></head><body><h1>TV Shows</h1>"); + + var http_request = new XMLHttpRequest(); + http_request.open( "POST", "jsonrpc", false ); + var send = { "jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "id": 1 } + http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.GetTVShows\", \"params\": { \"fields\": [\"title\"] }, \"id\": 1}"); + + var the_object = JSON.parse(http_request.responseText); + var result = the_object["result"]; + var array = result["tvshows"]; + for (var property in array) { + var item = array[property]; + document.write("<img src=thumb/" + (item["thumbnail"] ? item["thumbnail"] : "images/nocover.jpg") + ".jpg onclick=\"PrintSeasons(" + item["tvshowid"] + ")\"></img>"); + document.write("<br>"); + } +} +</script> +</head> +<body onload="PrintTVShows()"> + + +</body> +</html> diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 8709b60de0..3c502d66b3 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -117,19 +117,23 @@ #ifndef _LINUX #include "utils/Win32Exception.h" #endif -#ifdef HAS_WEB_SERVER -#include "lib/libGoAhead/XBMChttp.h" -#include "lib/libGoAhead/WebServer.h" -#endif #ifdef HAS_EVENT_SERVER #include "utils/EventServer.h" #endif #ifdef HAS_DBUS_SERVER #include "utils/DbusServer.h" #endif +#ifdef HAS_HTTPAPI +#include "lib/libhttpapi/XBMChttp.h" +#endif +#ifdef HAS_JSONRPC +#include "lib/libjsonrpc/JSONRPC.h" +#include "lib/libjsonrpc/TCPServer.h" +#endif #if defined(HAVE_LIBCRYSTALHD) #include "cores/dvdplayer/DVDCodecs/Video/CrystalHD/CrystalHD.h" #endif +#include "utils/AnnouncementManager.h" // Windows includes #include "GUIWindowManager.h" @@ -275,6 +279,10 @@ using namespace EVENTSERVER; #ifdef HAS_DBUS_SERVER using namespace DBUSSERVER; #endif +#ifdef HAS_JSONRPC +using namespace JSONRPC; +#endif +using namespace ANNOUNCEMENT; // uncomment this if you want to use release libs in the debug build. // Atm this saves you 7 mb of memory @@ -294,11 +302,6 @@ using namespace DBUSSERVER; CApplication::CApplication(void) : m_itemCurrentFile(new CFileItem), m_progressTrackingItem(new CFileItem) { m_iPlaySpeed = 1; -#ifdef HAS_WEB_SERVER - m_pWebServer = NULL; - m_pXbmcHttp = NULL; - m_prevMedia=""; -#endif m_pPlayer = NULL; m_bScreenSave = false; m_dpms = NULL; @@ -1311,21 +1314,27 @@ void CApplication::StartWebServer() #endif CSectionLoader::Load("LIBHTTP"); if (m_network.GetFirstConnectedInterface()) + m_WebServer.Start(m_network.GetFirstConnectedInterface()->GetCurrentIPAddress().c_str(), webPort/*, "special://xbmc/web", false*/); + + if (m_WebServer.IsStarted()) { - m_pWebServer = new CWebServer(); - m_pWebServer->Start(m_network.GetFirstConnectedInterface()->GetCurrentIPAddress().c_str(), webPort, "special://xbmc/web", false); - } - if (m_pWebServer) - { - m_pWebServer->SetUserName(g_guiSettings.GetString("services.webserverusername").c_str()); - m_pWebServer->SetPassword(g_guiSettings.GetString("services.webserverpassword").c_str()); + m_WebServer.SetCredentials(g_guiSettings.GetString("services.webserverusername"), g_guiSettings.GetString("services.webserverpassword")); // publish web frontend and API services +#ifdef HAS_WEBINTERFACE CZeroconf::GetInstance()->PublishService("servers.webserver", "_http._tcp", "XBMC Web Server", webPort); +#endif +#ifdef HAS_HTTPAPI CZeroconf::GetInstance()->PublishService("servers.webapi", "_xbmc-web._tcp", "XBMC HTTP API", webPort); +#endif +#ifdef HAS_JSONRPC + CZeroconf::GetInstance()->PublishService("servers.webjsonrpc", "_xbmc-jsonrpc._tcp", "XBMC JSONRPC", webPort); +#endif } - if (m_pWebServer && m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) +#ifdef HAS_HTTPAPI + if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) getApplicationMessenger().HttpApi("broadcastlevel; StartUp;1"); +#endif } #endif } @@ -1333,27 +1342,44 @@ void CApplication::StartWebServer() void CApplication::StopWebServer(bool bWait) { #ifdef HAS_WEB_SERVER - if (m_pWebServer) +// if (m_WebServer.IsStarted()) { if (!bWait) { CLog::Log(LOGNOTICE, "Webserver: Stopping..."); - m_pWebServer->Stop(false); + m_WebServer.Stop(); } else { - m_pWebServer->Stop(true); - delete m_pWebServer; - m_pWebServer = NULL; CSectionLoader::Unload("LIBHTTP"); CLog::Log(LOGNOTICE, "Webserver: Stopped..."); CZeroconf::GetInstance()->RemoveService("services.webserver"); + CZeroconf::GetInstance()->RemoveService("servers.webjsonrpc"); CZeroconf::GetInstance()->RemoveService("services.webapi"); } } #endif } +void CApplication::StartJSONRPCServer() +{ +#ifdef HAS_JSONRPC + if (g_guiSettings.GetBool("services.esenabled")) + { + CTCPServer::StartServer(9090, g_guiSettings.GetBool("services.esallinterfaces")); + CZeroconf::GetInstance()->PublishService("servers.jsonrpc", "_xbmc-jsonrpc._tcp", "XBMC JSONRPC", 9090); + } +#endif +} + +void CApplication::StopJSONRPCServer(bool bWait) +{ +#ifdef HAS_JSONRPC + CTCPServer::StopServer(bWait); + CZeroconf::GetInstance()->RemoveService("servers.jsonrpc"); +#endif +} + void CApplication::StartUPnP() { #ifdef HAS_UPNP @@ -2377,7 +2403,7 @@ bool CApplication::OnKey(CKey& key) bool CApplication::OnAction(CAction &action) { -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI // Let's tell the outside world about this action if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=2) { @@ -2902,7 +2928,7 @@ bool CApplication::ProcessMouse() void CApplication::CheckForTitleChange() { -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI if (g_settings.m_HttpApiBroadcastLevel>=1) { if (IsPlayingVideo()) @@ -2941,7 +2967,7 @@ void CApplication::CheckForTitleChange() bool CApplication::ProcessHTTPApiButtons() { -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI if (m_pXbmcHttp) { // copy key from webserver, and reset it in case we're called again before @@ -3301,7 +3327,7 @@ void CApplication::Stop() // cancel any jobs from the jobmanager CJobManager::GetInstance().CancelJobs(); -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI if (m_pXbmcHttp) { if (g_settings.m_HttpApiBroadcastLevel >= 1) @@ -3310,6 +3336,7 @@ void CApplication::Stop() m_pXbmcHttp->shuttingDown = true; } #endif + CAnnouncementManager::Announce(System, "xbmc", "ApplicationStop"); if( m_bSystemScreenSaverEnable ) g_Windowing.EnableSystemScreenSaver(true); @@ -3836,11 +3863,14 @@ void CApplication::OnPlayBackEnded() g_pythonParser.OnPlayBackEnded(); #endif -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI // Let's tell the outside world as well if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) getApplicationMessenger().HttpApi("broadcastlevel; OnPlayBackEnded;1"); #endif + + CAnnouncementManager::Announce(Playback, "xbmc", "PlaybackEnded"); + if (IsPlayingAudio()) { CLastfmScrobbler::GetInstance()->SubmitQueue(); @@ -3864,12 +3894,14 @@ void CApplication::OnPlayBackStarted() g_pythonParser.OnPlayBackStarted(); #endif -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI // Let's tell the outside world as well if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) getApplicationMessenger().HttpApi("broadcastlevel; OnPlayBackStarted;1"); #endif + CAnnouncementManager::Announce(Playback, "xbmc", "PlaybackStarted"); + CLog::Log(LOGDEBUG, "%s - Playback has started", __FUNCTION__); CGUIMessage msg(GUI_MSG_PLAYBACK_STARTED, 0, 0); @@ -3884,11 +3916,14 @@ void CApplication::OnQueueNextItem() g_pythonParser.OnQueueNextItem(); // currently unimplemented #endif -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI // Let's tell the outside world as well if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) getApplicationMessenger().HttpApi("broadcastlevel; OnQueueNextItem;1"); #endif + + CAnnouncementManager::Announce(Playback, "xbmc", "QueueNextItem"); + CLog::Log(LOGDEBUG, "Player has asked for the next item"); if(IsPlayingAudio()) @@ -3912,11 +3947,14 @@ void CApplication::OnPlayBackStopped() g_pythonParser.OnPlayBackStopped(); #endif -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI // Let's tell the outside world as well if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) getApplicationMessenger().HttpApi("broadcastlevel; OnPlayBackStopped;1"); #endif + + CAnnouncementManager::Announce(Playback, "xbmc", "PlaybackStopped"); + CLastfmScrobbler::GetInstance()->SubmitQueue(); CLibrefmScrobbler::GetInstance()->SubmitQueue(); @@ -3932,12 +3970,14 @@ void CApplication::OnPlayBackPaused() g_pythonParser.OnPlayBackPaused(); #endif -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI // Let's tell the outside world as well if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) getApplicationMessenger().HttpApi("broadcastlevel; OnPlayBackPaused;1"); #endif + CAnnouncementManager::Announce(Playback, "xbmc", "PlaybackPaused"); + CLog::Log(LOGDEBUG, "%s - Playback was paused", __FUNCTION__); } @@ -3947,12 +3987,14 @@ void CApplication::OnPlayBackResumed() g_pythonParser.OnPlayBackResumed(); #endif -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI // Let's tell the outside world as well if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) getApplicationMessenger().HttpApi("broadcastlevel; OnPlayBackResumed;1"); #endif + CAnnouncementManager::Announce(Playback, "xbmc", "PlaybackResumed"); + CLog::Log(LOGDEBUG, "%s - Playback was resumed", __FUNCTION__); } @@ -3962,7 +4004,7 @@ void CApplication::OnPlayBackSpeedChanged(int iSpeed) g_pythonParser.OnPlayBackSpeedChanged(iSpeed); #endif -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI // Let's tell the outside world as well if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) { @@ -3972,6 +4014,8 @@ void CApplication::OnPlayBackSpeedChanged(int iSpeed) } #endif + CAnnouncementManager::Announce(Playback, "xbmc", "PlaybackSpeedChanged"); + CLog::Log(LOGDEBUG, "%s - Playback speed changed", __FUNCTION__); } @@ -3981,7 +4025,7 @@ void CApplication::OnPlayBackSeek(int iTime) g_pythonParser.OnPlayBackSeek(iTime); #endif -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI // Let's tell the outside world as well if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) { @@ -3991,6 +4035,8 @@ void CApplication::OnPlayBackSeek(int iTime) } #endif + CAnnouncementManager::Announce(Playback, "xbmc", "PlaybackSeek"); + CLog::Log(LOGDEBUG, "%s - Playback skip", __FUNCTION__); } @@ -4000,7 +4046,7 @@ void CApplication::OnPlayBackSeekChapter(int iChapter) g_pythonParser.OnPlayBackSeekChapter(iChapter); #endif -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI // Let's tell the outside world as well if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) { @@ -4010,6 +4056,8 @@ void CApplication::OnPlayBackSeekChapter(int iChapter) } #endif + CAnnouncementManager::Announce(Playback, "xbmc", "PlaybackSeekChapter"); + CLog::Log(LOGDEBUG, "%s - Playback skip", __FUNCTION__); } diff --git a/xbmc/Application.h b/xbmc/Application.h index 024b0f6971..6704f15c07 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h @@ -56,11 +56,14 @@ class CFileItemList; #include "XBMC_events.h" #include "utils/Thread.h" +#ifdef HAS_WEB_SERVER +#include "utils/WebServer.h" +#endif + #ifdef HAS_SDL #include <SDL/SDL_mutex.h> #endif -class CWebServer; class CKaraokeLyricsManager; class CApplicationMessenger; class DPMSSupport; @@ -95,8 +98,8 @@ public: void StopServices(); void StartWebServer(); void StopWebServer(bool bWait); - void StartTimeServer(); - void StopTimeServer(); + void StartJSONRPCServer(); + void StopJSONRPCServer(bool bWait); void StartUPnP(); void StopUPnP(bool bWait); void StartUPnPRenderer(); @@ -159,6 +162,7 @@ public: void CheckScreenSaverAndDPMS(); void CheckPlayingProgress(); void CheckAudioScrobblerStatus(); + void CheckForTitleChange(); void ActivateScreenSaver(bool forceType = false); virtual void Process(); @@ -218,7 +222,11 @@ public: #if !defined(_WIN32) && defined(HAS_DVD_DRIVE) MEDIA_DETECT::CDetectDVDMedia m_DetectDVDType; #endif - CWebServer* m_pWebServer; + +#ifdef HAS_WEB_SERVER + CWebServer m_WebServer; +#endif + IPlayer* m_pPlayer; inline bool IsInScreenSaver() { return m_bScreenSave; }; @@ -328,16 +336,14 @@ protected: bool PlayStack(const CFileItem& item, bool bRestart); bool SwitchToFullScreen(); bool ProcessMouse(); - bool ProcessHTTPApiButtons(); bool ProcessKeyboard(); bool ProcessRemote(float frameTime); bool ProcessGamepad(float frameTime); bool ProcessEventServer(float frameTime); - + bool ProcessHTTPApiButtons(); bool ProcessJoystickEvent(const std::string& joystickName, int button, bool isAxis, float fAmount); float NavigationIdleTime(); - void CheckForTitleChange(); static bool AlwaysProcess(const CAction& action); void SaveCurrentFileSettings(); diff --git a/xbmc/ApplicationMessenger.cpp b/xbmc/ApplicationMessenger.cpp index e99bcde6e5..df0633d749 100644 --- a/xbmc/ApplicationMessenger.cpp +++ b/xbmc/ApplicationMessenger.cpp @@ -31,9 +31,6 @@ #include "lib/libPython/XBPython.h" #endif #include "GUIWindowSlideShow.h" -#ifdef HAS_WEB_SERVER -#include "lib/libGoAhead/XBMChttp.h" -#endif #include "utils/Builtins.h" #include "utils/Network.h" #include "utils/log.h" @@ -58,6 +55,10 @@ #include "lib/libPython/xbmcmodule/GUIPythonWindowDialog.h" #include "lib/libPython/xbmcmodule/GUIPythonWindowXMLDialog.h" +#ifdef HAS_HTTPAPI +#include "lib/libhttpapi/XBMChttp.h" +#endif + using namespace std; CApplicationMessenger::~CApplicationMessenger() @@ -421,7 +422,7 @@ case TMSG_POWERDOWN: case TMSG_HTTPAPI: { -#ifdef HAS_WEB_SERVER +#ifdef HAS_HTTPAPI if (!m_pXbmcHttp) { CSectionLoader::Load("LIBHTTP"); diff --git a/xbmc/GUIWindowSettingsCategory.cpp b/xbmc/GUIWindowSettingsCategory.cpp index 68c53b4ac9..db0bff0b8a 100644 --- a/xbmc/GUIWindowSettingsCategory.cpp +++ b/xbmc/GUIWindowSettingsCategory.cpp @@ -58,9 +58,6 @@ #include "GUIWindowPrograms.h" #include "MediaManager.h" #include "utils/Network.h" -#ifdef HAS_WEB_SERVER -#include "lib/libGoAhead/WebServer.h" -#endif #include "GUIControlGroupList.h" #include "GUIWindowManager.h" #include "GUIFontManager.h" @@ -471,35 +468,13 @@ void CGUIWindowSettingsCategory::CreateSettings() pControl->AddLabel(g_localizeStrings.Get(21377), VIDEO_WIDESCREEN); pControl->SetValue(pSettingInt->GetData()); } - else if (strSetting.Equals("services.webserverusername")) - { -#ifdef HAS_WEB_SERVER - // get password from the webserver if it's running (and update our settings) - if (g_application.m_pWebServer) - { - ((CSettingString *)GetSetting(strSetting)->GetSetting())->SetData(g_application.m_pWebServer->GetUserName()); - g_settings.Save(); - } -#endif - } - else if (strSetting.Equals("services.webserverpassword")) - { #ifdef HAS_WEB_SERVER - // get password from the webserver if it's running (and update our settings) - if (g_application.m_pWebServer) - { - ((CSettingString *)GetSetting(strSetting)->GetSetting())->SetData(g_application.m_pWebServer->GetPassword()); - g_settings.Save(); - } -#endif - } else if (strSetting.Equals("services.webserverport")) { -#ifdef HAS_WEB_SERVER CBaseSettingControl *control = GetSetting(pSetting->GetSetting()); control->SetDelayed(); -#endif } +#endif else if (strSetting.Equals("services.esport")) { #ifdef HAS_EVENT_SERVER @@ -883,6 +858,7 @@ void CGUIWindowSettingsCategory::UpdateSettings() if (pControl) pControl->SetEnabled(g_guiSettings.GetInt("musicplayer.crossfade") > 0 && g_guiSettings.GetString("audiooutput.audiodevice").find("wasapi:") == CStdString::npos); } +#ifdef HAS_WEB_SERVER else if (strSetting.Equals("services.webserverusername")) { CGUIEditControl *pControl = (CGUIEditControl *)GetControl(pSettingControl->GetID()); @@ -900,6 +876,7 @@ void CGUIWindowSettingsCategory::UpdateSettings() CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID()); if (pControl) pControl->SetEnabled(g_guiSettings.GetBool("services.webserver")); } +#endif else if (strSetting.Equals("network.ipaddress") || strSetting.Equals("network.subnet") || strSetting.Equals("network.gateway") || strSetting.Equals("network.dns")) { #ifdef _LINUX @@ -1440,25 +1417,20 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC g_lcd->Initialize(); } #endif - else if ( strSetting.Equals("services.webserver") || strSetting.Equals("services.webserverport") || - strSetting.Equals("services.webserverusername") || strSetting.Equals("services.webserverpassword")) +#ifdef HAS_WEB_SERVER + else if ( strSetting.Equals("services.webserver") || strSetting.Equals("services.webserverport")) { if (strSetting.Equals("services.webserverport")) ValidatePortNumber(pSettingControl, "8080", "80"); -#ifdef HAS_WEB_SERVER g_application.StopWebServer(true); if (g_guiSettings.GetBool("services.webserver")) - { g_application.StartWebServer(); - if (g_application.m_pWebServer) { - if (strSetting.Equals("services.webserverusername")) - g_application.m_pWebServer->SetUserName(g_guiSettings.GetString("services.webserverusername").c_str()); - else - g_application.m_pWebServer->SetPassword(g_guiSettings.GetString("services.webserverpassword").c_str()); - } - } -#endif } + else if (strSetting.Equals("services.webserverusername") || strSetting.Equals("services.webserverpassword")) + { + g_application.m_WebServer.SetCredentials(g_guiSettings.GetString("services.webserverusername"), g_guiSettings.GetString("services.webserverpassword")); + } +#endif else if (strSetting.Equals("services.zeroconf")) { #ifdef HAS_ZEROCONF @@ -1857,6 +1829,10 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC } } #endif + if (g_guiSettings.GetBool("services.esenabled")) + g_application.StartJSONRPCServer(); + else + g_application.StopJSONRPCServer(false); } else if (strSetting.Equals("services.esport")) { @@ -1886,6 +1862,10 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC } } #endif + if (g_guiSettings.GetBool("services.esenabled")) + g_application.StartJSONRPCServer(); + else + g_application.StopJSONRPCServer(false); } else if (strSetting.Equals("services.esinitialdelay") || strSetting.Equals("services.escontinuousdelay")) diff --git a/xbmc/Makefile.in b/xbmc/Makefile.in index bf3ba02cc6..e2bce3e1dd 100644 --- a/xbmc/Makefile.in +++ b/xbmc/Makefile.in @@ -14,6 +14,8 @@ INCLUDES+=-Ilib/libUPnP/Platinum/Source/Core \ INCLUDES+=-Ilib/libcdio/libcdio/include +INCLUDES+=-I../lib/jsoncpp/jsoncpp/include + SRCS=Application.cpp \ CueDocument.cpp \ GUISettings.cpp \ diff --git a/xbmc/MusicDatabase.cpp b/xbmc/MusicDatabase.cpp index fd3450eb7f..1506a02817 100644 --- a/xbmc/MusicDatabase.cpp +++ b/xbmc/MusicDatabase.cpp @@ -2720,6 +2720,7 @@ bool CMusicDatabase::GetArtistsNav(const CStdString& strBaseDir, CFileItemList& strDir.Format("%ld/", idArtist); pItem->m_strPath=strBaseDir + strDir; pItem->m_bIsFolder=true; + pItem->GetMusicInfoTag()->SetDatabaseId(idArtist); if (CFile::Exists(pItem->GetCachedArtistThumb())) pItem->SetThumbnailImage(pItem->GetCachedArtistThumb()); pItem->SetIconImage("DefaultArtist.png"); diff --git a/xbmc/PowerManager.cpp b/xbmc/PowerManager.cpp index e41e733452..09700883d8 100644 --- a/xbmc/PowerManager.cpp +++ b/xbmc/PowerManager.cpp @@ -26,6 +26,7 @@ #include "GUISettings.h" #include "WindowingFactory.h" #include "utils/log.h" +#include "AnnouncementManager.h" #ifdef HAS_LCD #include "utils/LCDFactory.h" @@ -46,10 +47,12 @@ extern HWND g_hWnd; #ifdef HAS_LIRC #include "common/LIRC.h" #endif -#ifdef HAS_IRSERVERSUITE - #include "common/IRServerSuite/IRServerSuite.h" +#ifdef HAS_IRSERVERSUITE
+ #include "common/IRServerSuite/IRServerSuite.h"
#endif +using namespace ANNOUNCEMENT;
+ CPowerManager g_powerManager; CPowerManager::CPowerManager() @@ -132,10 +135,16 @@ void CPowerManager::SetDefaults() bool CPowerManager::Powerdown() { - return CanPowerdown() ? m_instance->Powerdown() : false; + + bool success = CanPowerdown() ? m_instance->Powerdown() : false; + if (success) + CAnnouncementManager::Announce(System, "xbmc", "Shutdown"); + + return success; } bool CPowerManager::Suspend() { + bool success = false; if (CanSuspend()) { g_application.m_bRunResumeJobs = true; @@ -143,25 +152,37 @@ bool CPowerManager::Suspend() g_lcd->SetBackLight(0); #endif g_Keyboard.ResetState(); - return m_instance->Suspend(); + success = m_instance->Suspend(); } + + if (success) + CAnnouncementManager::Announce(System, "xbmc", "Suspend"); - return false; + return success; } bool CPowerManager::Hibernate() { + bool success = false; if (CanHibernate()) { g_application.m_bRunResumeJobs = true; g_Keyboard.ResetState(); - return m_instance->Hibernate(); + success = m_instance->Hibernate(); } - return false; + if (success) + CAnnouncementManager::Announce(System, "xbmc", "Hibernate"); + + return success; } bool CPowerManager::Reboot() { - return CanReboot() ? m_instance->Reboot() : false; + bool success = CanReboot() ? m_instance->Reboot() : false; + + if (success) + CAnnouncementManager::Announce(System, "xbmc", "Reboot"); + + return success; } void CPowerManager::Resume() @@ -203,6 +224,8 @@ void CPowerManager::Resume() // reset g_application.m_bRunResumeJobs = false; + + CAnnouncementManager::Announce(System, "xbmc", "Resume"); } bool CPowerManager::CanPowerdown() diff --git a/xbmc/lib/libGoAhead/DMF_Brochure.pdf b/xbmc/lib/libGoAhead/DMF_Brochure.pdf Binary files differdeleted file mode 100644 index c40ad63d83..0000000000 --- a/xbmc/lib/libGoAhead/DMF_Brochure.pdf +++ /dev/null diff --git a/xbmc/lib/libGoAhead/Makefile.in b/xbmc/lib/libGoAhead/Makefile.in deleted file mode 100644 index aa11424159..0000000000 --- a/xbmc/lib/libGoAhead/Makefile.in +++ /dev/null @@ -1,73 +0,0 @@ -# -# Makefile for the GoAhead web server reference source base -# for the Linux OS -# -# Copyright (c) GoAhead Software, Inc. 1995-2000 -# -# $Id: Makefile,v 1.2 2002/11/01 16:20:19 mmitchell Exp $ -# - -NAME = webs - -# User Management switch -UMSW = -DUSER_MANAGEMENT_SUPPORT - -# Digest Access switch -DASW = -DDIGEST_ACCESS_SUPPORT - -LIB=libGoAhead-@ARCH@.a - -# -# SSL switches -# -# You must uncomment this line to enable SSL -# SSLPATCHFILE = ../websSSL.o -# -# Then uncomment these three lines if you are using the RSAREF library -# and set them to the correct path. -# -# SSLINC = /RSASSL/library/include -# SSLLIB = /RSASSL/library/lib/libsslc.a -# SSLSW = -DWEBS_SSL_SUPPORT -I$(SSLINC) -# -# Or alternatively, -# -# Uncomment these three lines if you are using the OpenSSL library. -# Change the value of SSLINC to the path where your OpenSSL header -# files reside, and change the value of SSLLIB to the path to your -# OpenSSL libssl.a and libcrypto.a. -# -# SSLINC = /usr/include/openssl -# SSLLIB = /usr/lib/libssl.a /usr/lib/libcrypto.a -# SSLSW = -DWEBS_SSL_SUPPORT -I$(SSLINC) -DOPENSSL - - -# If-Modified-Support switches (requires math library, libm.a) -# IFMODSW = -DWEBS_IF_MODIFIED_SUPPORT -# IFMODLIB = /usr/lib/libm.a - -# Dependencies -GOOBJS = src/asp.o src/balloc.o src/base64.o src/default.o \ - src/ejlex.o src/ejparse.o src/form.o \ - src/h.o src/handler.o src/mime.o src/misc.o src/page.o \ - src/ringq.o src/rom.o \ - src/sock.o src/sockGen.o $(SSLPATCHFILE) \ - src/security.o src/sym.o src/uemf.o src/url.o src/value.o \ - src/um.o src/websda.o src/emfdb.o \ - src/webrom.o src/webs.o src/websuemf.o \ - src/spy.o src/umui.o src/md5c.o SpyceModule.o WebServer.o \ - XBMCConfiguration.o XBMChttp.o XBMCweb.o #src/cgi.o - -SRCS=$(GOOBJS:.o=.c) -CFLAGS += -DWEBS -DUEMF -DOS="LINUX" -DLINUX $(UMSW) $(DASW) $(SSLSW) $(IFMODSW)-DDEV -D__NO_CGI_BIN -ifeq ($(findstring osx, @ARCH@),osx) -CXXFLAGS += -fvisibility-inlines-hidden -endif -OTHERS = -DB_STATS -DB_FILL -DDEBUG -DEBUG = -g -Wall -INCLUDES += -I. -I../../ -I../../linux -I../../../guilib -I../../utils -I../../cores -LDFLAGS += $(SSLLIB) $(IFMODLIB) - -include ../../../Makefile.include - --include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) diff --git a/xbmc/lib/libGoAhead/ReadMe.txt b/xbmc/lib/libGoAhead/ReadMe.txt deleted file mode 100644 index 46ee98594d..0000000000 --- a/xbmc/lib/libGoAhead/ReadMe.txt +++ /dev/null @@ -1,3 +0,0 @@ -For current WebServer startup instructions and other information
-specific to Release 2.1, please refer to the release.htm file
-(Release Notes).
diff --git a/xbmc/lib/libGoAhead/SpyceModule.cpp b/xbmc/lib/libGoAhead/SpyceModule.cpp deleted file mode 100644 index ea06e7b2a7..0000000000 --- a/xbmc/lib/libGoAhead/SpyceModule.cpp +++ /dev/null @@ -1,145 +0,0 @@ -#ifdef SPYCE_SUPPORT -#include "SpyceModule.h" - -#ifndef __GNUC__ -#pragma code_seg("WEB_TEXT") -#pragma data_seg("WEB_DATA") -#pragma bss_seg("WEB_BSS") -#pragma const_seg("WEB_RD") -#endif - -namespace WEBS_SPYCE -{ - static bool spyInitialized = false; - static PyThreadState* spyThreadState = NULL; - static PyObject* spyFunc; - - int spyceOpen() - { - return 0; - } - - void spyceClose() - { - if(spyInitialized) - { - PyEval_AcquireLock(); - PyThreadState_Swap(NULL); - PyThreadState_Clear(spyThreadState); - PyThreadState_Delete(spyThreadState); - PyEval_ReleaseLock(); - g_pythonParser.Finalize(); - } - } - - int spyceRequest(webs_t wp, char_t *lpath) - { - // initialize python first - if(!spyInitialized) - { - g_pythonParser.Initialize(); - - PyEval_AcquireLock(); - PyInterpreterState * mainInterpreterState = g_pythonParser.getMainThreadState()->interp; - spyThreadState = PyThreadState_New(mainInterpreterState); - PyThreadState_Swap(spyThreadState); - - PyObject* pName = PyString_FromString("spyceXbmc"); - PyObject* pModule = PyImport_Import(pName); - Py_XDECREF(pName); - - if(!pModule) websError(wp, 500, (char*)"%s", (char*)"Corrupted Spyce installation"); - else - { - PyObject* pDict = PyModule_GetDict(pModule); - Py_XDECREF(pModule); - spyFunc = PyDict_GetItemString(pDict, "ParseFile"); - if(!spyFunc) websError(wp, 500, (char*)"%s", (char*)"Corrupted Spyce installation"); - - else spyInitialized = true; - } - - PyThreadState_Swap(NULL); - PyEval_ReleaseLock(); - if(!spyInitialized) - { - PyThreadState_Clear(spyThreadState); - PyThreadState_Delete(spyThreadState); - g_pythonParser.Finalize(); - return -1; - } - - } - - PyEval_AcquireLock(); - PyThreadState_Swap(spyThreadState); - - std::string strRequestMethod; - std::string strQuery = wp->query; - std::string strCookie; - int iContentLength = 0; - - if (strlen(wp->query) > 0) - { - if(wp->flags & WEBS_POST_REQUEST) strRequestMethod = "POST"; - else if (wp->flags & WEBS_HEAD_REQUEST) strRequestMethod = "HEAD"; - else strRequestMethod = "GET"; - } - - if (wp->flags & WEBS_COOKIE) strCookie = wp->cookie; - iContentLength = strQuery.length(); - - // create enviroment and parse file - PyObject* pEnv = PyDict_New(); - PyObject* pREQUEST_METHOD = PyString_FromString(strRequestMethod.c_str()); - PyObject* pCONTENT_LENGTH = PyInt_FromLong(iContentLength); - PyObject* pQUERY_STRING = PyString_FromString(strQuery.c_str()); - PyObject* pHTTP_COOKIE = PyString_FromString(strCookie.c_str()); - PyObject* pCONTENT_TYPE = PyString_FromString(wp->type); - PyObject* pHTTP_HOST = PyString_FromString(wp->host); - PyObject* pHTTP_USER_AGENT = PyString_FromString(wp->userAgent ? wp->userAgent : ""); - PyObject* pHTTP_CONNECTION = PyString_FromString((wp->flags & WEBS_KEEP_ALIVE)? "Keep-Alive" : ""); - - PyDict_SetItemString(pEnv, "REQUEST_METHOD", pREQUEST_METHOD); - PyDict_SetItemString(pEnv, "CONTENT_LENGTH", pCONTENT_LENGTH); - PyDict_SetItemString(pEnv, "QUERY_STRING", pQUERY_STRING); - PyDict_SetItemString(pEnv, "HTTP_COOKIE", pHTTP_COOKIE); - //PyDict_SetItemString(pEnv, "CONTENT_TYPE", pCONTENT_TYPE); - PyDict_SetItemString(pEnv, "HTTP_HOST", pHTTP_HOST); - PyDict_SetItemString(pEnv, "HTTP_USER_AGENT", pHTTP_USER_AGENT); - PyDict_SetItemString(pEnv, "HTTP_CONNECTION", pHTTP_CONNECTION); - - PyObject* pResult = PyObject_CallFunction(spyFunc, (char*)"sO", lpath, pEnv); - - Py_XDECREF(pREQUEST_METHOD); - Py_XDECREF(pCONTENT_LENGTH); - Py_XDECREF(pQUERY_STRING); - Py_XDECREF(pHTTP_COOKIE); - Py_XDECREF(pCONTENT_TYPE); - Py_XDECREF(pHTTP_HOST); - Py_XDECREF(pHTTP_USER_AGENT); - Py_XDECREF(pHTTP_CONNECTION); - - Py_XDECREF(pEnv); - - if(!pResult) websError(wp, 500, (char*)"%s", (char*)"Corrupted Spyce installation"); - else - { - char* cResult = PyString_AsString(pResult); - websWriteBlock(wp, cResult, strlen(cResult)); - Py_XDECREF(pResult); - } - - PyThreadState_Swap(NULL); - PyEval_ReleaseLock(); - - /* - * Common exit and cleanup - */ - if (websValid(wp)) { - websPageClose(wp); - } - return 0; - } -} -#endif diff --git a/xbmc/lib/libGoAhead/SpyceModule.h b/xbmc/lib/libGoAhead/SpyceModule.h deleted file mode 100644 index 718b2dc87d..0000000000 --- a/xbmc/lib/libGoAhead/SpyceModule.h +++ /dev/null @@ -1,20 +0,0 @@ -#include "includes.h" -#ifdef SPYCE_SUPPORT -#include "../libPython/XBPython.h" - -#ifdef __cplusplus -extern "C" { -#endif - - namespace WEBS_SPYCE - { - int spyceOpen(); - void spyceClose(); - int spyceRequest(webs_t wp, char_t *lpath); - } - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/xbmc/lib/libGoAhead/WebServer.cpp b/xbmc/lib/libGoAhead/WebServer.cpp deleted file mode 100644 index f50c125cd7..0000000000 --- a/xbmc/lib/libGoAhead/WebServer.cpp +++ /dev/null @@ -1,677 +0,0 @@ - -/* WebServer.cpp: implementation of the CWebServer class. - * A darivation of: main.c -- Main program for the GoAhead WebServer - * - * main.c -- Main program for the GoAhead WebServer - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -#include "WebServer.h" -#include "XBMCweb.h" -#include "FileSystem/SpecialProtocol.h" -#include "utils/log.h" - -#ifdef SPYCE_SUPPORT -#include "SpyceModule.h" -#endif - -#include "XBMCweb.h" -#include "XBMCConfiguration.h" -#include "XBMChttp.h" -#include "includes.h" - -using namespace std; - -static CXbmcWeb* pXbmcWeb; -static CXbmcConfiguration* pXbmcWebConfig; - -#ifdef _XBOX -#pragma code_seg("WEB_TEXT") -#pragma data_seg("WEB_DATA") -#pragma bss_seg("WEB_BSS") -#pragma const_seg("WEB_RD") - -#pragma comment(linker, "/merge:WEB_TEXT=LIBHTTP") -#pragma comment(linker, "/merge:WEB_DATA=LIBHTTP") -#pragma comment(linker, "/merge:WEB_BSS=LIBHTTP") -#pragma comment(linker, "/merge:WEB_RD=LIBHTTP") -#pragma comment(linker, "/section:LIBHTTP,RWE") -#endif - -// this is from a C library so use C style function calls -#ifdef __cplusplus -extern "C" { -#endif - -/**************************** Forward Declarations ****************************/ -extern void basicSetProductDir(char_t *proddir); -static int websHomePageHandler(webs_t wp, char_t *urlPrefix, - char_t *webDir, int arg, char_t *url, char_t *path, - char_t *query); -extern void defaultErrorHandler(int etype, char_t *msg); -extern void defaultTraceHandler(int level, char_t *buf); -//static void memLeaks(); -//static int nCopyAnsiToWideChar(LPWORD, LPSTR); -extern void dbZero(int did); - - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -CWebServer::CWebServer() -{ - pXbmcWeb = new CXbmcWeb(); - if (!pXbmcWebConfig) - pXbmcWebConfig = new CXbmcConfiguration(); - if (!pXbmcHttpShim) - pXbmcHttpShim = new CXbmcHttpShim(); - if (!m_pXbmcHttp) - m_pXbmcHttp = new CXbmcHttp(); - m_port = 80; /* Server port */ - m_szPassword[0] = '\0'; - int end = sizeof(m_szUserName); - strncpy(m_szUserName,"xbmc",end); - if (end) - m_szUserName[end-1] = '\0'; - - m_hEvent = CreateEvent(NULL, true, false, NULL); -} - - -CWebServer::~CWebServer() -{ - CloseHandle(m_hEvent); - if (pXbmcWeb) - { - delete pXbmcWeb; - pXbmcWeb=NULL; - } - if (pXbmcWebConfig) - { - delete pXbmcWebConfig; - pXbmcWebConfig=NULL; - } - if (pXbmcHttpShim) - { - delete pXbmcHttpShim; - pXbmcHttpShim=NULL; - } - if (m_pXbmcHttp) - { - delete m_pXbmcHttp; - m_pXbmcHttp=NULL; - } -} -/* -DWORD CWebServer::SuspendThread() -{ - return ::SuspendThread(m_ThreadHandle); -} - -DWORD CWebServer::ResumeThread() -{ - BOOL res=::ResumeThread(m_ThreadHandle); - if (res) WaitForSingleObject(m_hEvent, INFINITE); - return res; -} -*/ -bool CWebServer::Start(const char *szLocalAddress, int port, const char_t* web, bool wait) -{ - m_bFinished = false; - m_bStarted = false; - ResetEvent(m_hEvent); - - int end = sizeof(m_szLocalAddress); - strncpy(m_szLocalAddress, szLocalAddress, end); - if (end) - m_szLocalAddress[end - 1] = '\0'; - end = sizeof(m_szRootWeb); - strncpy(m_szRootWeb, _P(web), end); - if (end) - m_szRootWeb[end - 1] = '\0'; - m_port = port; - Create(false, THREAD_MINSTACKSIZE); - if (m_ThreadHandle == NULL) return false; - - CThread::SetName("Webserver"); - if( wait ) - { - // wait until the webserver is ready - WaitForSingleObject(m_hEvent, INFINITE); - } - else - { - SetPriority(THREAD_PRIORITY_BELOW_NORMAL); - } - - return true; -} - -void CWebServer::Stop(bool bWait) -{ - m_bFinished = true; - - StopThread(bWait); -} - - -//************************************************************************************* -void CWebServer::OnStartup() -{ - /* - * Initialize the memory allocator. Allow use of malloc and start - * with a 60K heap. For each page request approx 8KB is allocated. - * 60KB allows for several concurrent page requests. If more space - * is required, malloc will be used for the overflow. - */ - bopen(NULL, (60 * 1024), B_USE_MALLOC); - - // Initialize the web server, error is written to log by initWebs() - if (initWebs() < 0) - { - m_bFinished = true; - SetEvent(m_hEvent); - return; - } - - m_bStarted = true; - - #ifdef WEBS_SSL_SUPPORT - websSSLOpen(); - #endif - - // notify we are ready - SetEvent(m_hEvent); -} - -/* - * Initialize the web server. - */ -int CWebServer::initWebs() -{ - CLog::Log(LOGINFO, "WebServer: Server starting using %s on %s:%i\n", m_szRootWeb, m_szLocalAddress, m_port); - - // Initialize the socket subsystem - if (socketOpen() == -1) - { - CLog::Log(LOGERROR, "Unable to open socket for webserver"); - return -1; - } - - // Initialize the User Management database - #ifdef USER_MANAGEMENT_SUPPORT - umOpen(); - basicSetProductDir(m_szRootWeb); - #endif - - // set callbacks for spyce parser - #ifdef SPYCE_SUPPORT - setSpyOpenCallback(WEBS_SPYCE::spyceOpen); - setSpyCloseCallback(WEBS_SPYCE::spyceClose); - setSpyRequestCallback(WEBS_SPYCE::spyceRequest); - #endif - - // Configure the web server options before opening the web server - websSetIpaddr((char*)m_szLocalAddress); - websSetHost((char*)m_szLocalAddress); - websSetDefaultDir(m_szRootWeb); - websSetDefaultPage(T((char*)"default.asp")); - - /* - * Open the web server on the given port. If that port is taken, try - * the next sequential port for up to "retries" attempts. - */ - if(websOpenServer(m_port, 5 /* retries*/) < 0) - { - CLog::Log(LOGERROR, "Unable to start webserver on port : %i", m_port); - return -1; - } - - /* - * First create the URL handlers. Note: handlers are called in sorted order - * with the longest path handler examined first. Here we define the security - * handler, forms handler and the default web page handler. - */ - websUrlHandlerDefine(T((char*)""), NULL, 0, websSecurityHandler, WEBS_HANDLER_FIRST); - websUrlHandlerDefine(T((char*)"/goform"), NULL, 0, websFormHandler, 0); - websUrlHandlerDefine(T((char*)"/xbmcCmds"), NULL, 0, websFormHandler, 0); - websUrlHandlerDefine(T((char*)""), NULL, 0, websDefaultHandler, WEBS_HANDLER_LAST); - - /* - * Now define two test procedures. Replace these with your application - * relevant ASP script procedures and form functions. - */ - websAspDefine(T((char*)"aspTest"), XbmcAspTest); - websFormDefine(T((char*)"formTest"), XbmcFormTest); - websFormDefine(T((char*)"xbmcForm"), XbmcWebsForm); - websFormDefine(T((char*)"xbmcHttp"), XbmcHttpCommand); - - //Create the Form handlers for the User Management pages - #ifdef USER_MANAGEMENT_SUPPORT - formDefineUserMgmt(); - #endif - - // asp commands for xbmc - websAspDefine(T((char*)"xbmcCommand"), XbmcWebsAspCommand); - websAspDefine(T((char*)"xbmcAPI"), XbmcAPIAspCommand); - - // asp command for xbmc Configuration - websAspDefine(T((char*)"xbmcCfgBookmarkSize"), XbmcWebsAspConfigBookmarkSize); - websAspDefine(T((char*)"xbmcCfgGetBookmark"), XbmcWebsAspConfigGetBookmark); - websAspDefine(T((char*)"xbmcCfgAddBookmark"), XbmcWebsAspConfigAddBookmark); - websAspDefine(T((char*)"xbmcCfgSaveBookmark"), XbmcWebsAspConfigSaveBookmark); - websAspDefine(T((char*)"xbmcCfgRemoveBookmark"), XbmcWebsAspConfigRemoveBookmark); - websAspDefine(T((char*)"xbmcCfgSaveConfiguration"), XbmcWebsAspConfigSaveConfiguration); - websAspDefine(T((char*)"xbmcCfgGetOption"), XbmcWebsAspConfigGetOption); - websAspDefine(T((char*)"xbmcCfgSetOption"), XbmcWebsAspConfigSetOption); - - // Create a handler for the default home page - websUrlHandlerDefine(T((char*)"/"), NULL, 0, websHomePageHandler, 0); - - CLog::Log(LOGNOTICE, "Webserver: Started"); - return 0; -} - - -//************************************************************************************* -void CWebServer::OnExit() -{ - CLog::Log(LOGDEBUG, "WebServer:OnExit - Exit web server.\n"); - - #ifdef WEBS_SSL_SUPPORT - websSSLClose(); - #endif - - //Close the User Management database - #ifdef USER_MANAGEMENT_SUPPORT - umClose(); - #endif - - // Close the socket module - if (m_bStarted) - { - websCloseServer(); - socketClose(); - } - - // Free up resources - websDefaultClose(); - - // close memory allocator - bclose(); - - // notify we are ready - PulseEvent(m_hEvent); -} - - -//************************************************************************************* -void CWebServer::Process() -{ - /* - * Basic event loop. SocketReady returns true when a socket is ready for - * service. SocketSelect will block until an event occurs. SocketProcess - * will actually do the servicing. - */ - int sockReady = -1, sockSelect = -1; - - /* set our thread priority */ - SetPriority(THREAD_PRIORITY_NORMAL); - - while (!m_bFinished) - { - sockReady = socketReady(-1); - // wait for event or timeout (default 1000 msec) - sockSelect = socketSelect(-1, SOCK_DFT_SVC_TIME); - if (sockReady || sockSelect) { - socketProcess(-1); - } - emfSchedProcess(); - } - CLog::Log(LOGDEBUG, "WebServer:Exiting thread sockReady=%i, sockSelect=%i.\n", sockReady, sockSelect); -} - -/* - * Sets password for user - * this is done in group "sys_xbox". - * Note that when setting the password this function will delete all database info!! - */ -void CWebServer::SetPassword(const char* strPassword) -{ - // wait until the webserver is ready - if( WaitForSingleObject(m_hEvent, 5000) != WAIT_OBJECT_0 ) - return; - - // open the database and clean it - int did = umOpen(); - dbZero(did); - - // save password in member var for later usage by GetPassword() - if (strPassword) - { - int end = sizeof(m_szPassword); - strncpy(m_szPassword, strPassword, end); - if (end) - m_szPassword[end - 1] = '\0'; - } - - // if password !NULL and greater then 0, enable user access - if (strPassword && strlen(strPassword) > 0) - { - // create group - umAddGroup((char*)WEBSERVER_UM_GROUP, PRIV_READ | PRIV_WRITE | PRIV_ADMIN, AM_BASIC, false, false); - - // greate user - umAddUser(m_szUserName, m_szPassword, (char*)WEBSERVER_UM_GROUP, false, false); - - // create access limit - umAddAccessLimit((char*)"/", AM_BASIC, 0, (char*)WEBSERVER_UM_GROUP); - } - - // save new information in database - umClose(); -} - -void CWebServer::SetUserName(const char* strUserName) -{ - // wait until the webserver is ready - if( WaitForSingleObject(m_hEvent, 5000) != WAIT_OBJECT_0 ) - return; - - // if username !NULL and greater then 0, enable user access - if (strUserName && strlen(strUserName) > 0) - { - // save username in member var for later usage by GetPassword() - int end = sizeof(m_szUserName); - strncpy(m_szUserName, strUserName, end); - if (end) - m_szUserName[end - 1] = '\0'; - if (m_szPassword && m_szPassword[0] != '\0') - SetPassword(m_szPassword); - } -} - -char* CWebServer::GetPassword() -{ - // wait until the webserver is ready - if( WaitForSingleObject(m_hEvent, 5000) != WAIT_OBJECT_0 ) - return (char*)""; - - char* pPass = (char*)""; - - umOpen(); - if (umUserExists(m_szUserName)) pPass = umGetUserPassword(m_szUserName); - - umClose(); - - return pPass; -} - -char* CWebServer::GetUserName() -{ - // wait until the webserver is ready - if( WaitForSingleObject(m_hEvent, 5000) != WAIT_OBJECT_0 || - !m_szUserName || m_szUserName[0] == '\0') - return (char*)"xbmc"; - - return m_szUserName; -} - -/******************************************************************************/ -/* - * Home page handler - */ -static int websHomePageHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, - int arg, char_t *url, char_t *path, char_t *query) -{ -/* - * If the empty or "/" URL is invoked, redirect default URLs to the home page - */ - char dir[1024]; - char files[][20] = { - {"index.html"}, - {"index.htm"}, - {"home.htm"}, - {"home.html"}, - {"default.asp"}, - {"home.asp"}, - {'\0' } - }; - - // check if one of the above files exist, if one does then redirect to it. - int size = sizeof(dir); - strncpy(dir, websGetDefaultDir(), size); - if (size) - dir[size-1] = '\0'; - strncat(dir, path, size - strlen(dir)); - for(u_int pos = 0; pos < strlen(dir); pos++) - if (dir[pos] == '/') dir[pos] = '\\'; - - DWORD attributes = GetFileAttributes(dir); - if (FILE_ATTRIBUTE_DIRECTORY == attributes) - { - int i = 0; - char buf[1024]; - size = sizeof(buf); - while (files[i][0]) - { - strncpy(buf, dir, size); - if (size) - buf[size-1] = '\0'; - if (buf[strlen(buf)-1] != '\\') - strncat(buf, "\\", size - strlen(buf)); - strncat(buf, files[i], size - strlen(buf)); - - if (!access(buf, 0)) - { - strncpy(buf, path, size); - if (size) - buf[size-1] = '\0'; - if (path[strlen(path)-1] != '/') strncat(buf, "/", size - strlen(buf)); - strncat(buf, files[i], size - strlen(buf)); - websRedirect(wp, buf); - return 1; - } - i++; - } - - //no default file found, list directory contents - string strPath = wp->path; - if(strPath[strPath.length()-1] != '/') - { - websRedirect(wp, (char*)(strPath + "/").c_str()); - return 0; - } - WIN32_FIND_DATA FindFileData; - HANDLE hFind; - vector<string> vecFiles; - strncat(dir, "\\*", sizeof(dir) - strlen(dir)); - hFind=FindFirstFile(dir, &FindFileData); - - do - { - string fn = FindFileData.cFileName; - if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) fn+= "/"; - vecFiles.push_back(fn); - } - while (FindNextFile(hFind, &FindFileData)); - FindClose(hFind); - - sort(vecFiles.begin(), vecFiles.end()); - - websWrite(wp, (char*)"%s", (char*)"<title>Directory listing for /</title>\n"); - websWrite(wp, (char*)"%s", (char*)"<h2>Directory listing for /</h2>\n"); - websWrite(wp, (char*)"%s", (char*)"<hr>\n"); - websWrite(wp, (char*)"%s", (char*)"<ul>\n"); - - vector<string>::iterator it = vecFiles.begin(); - while (it != vecFiles.end()) - { - string w = "<li><a href='"; - w += *it; - w += "'>"; - w += *it; - w += "</a>\n"; - websWrite(wp, (char*)"%s", (char*)w.c_str()); - ++it; - } - - websWrite(wp, (char*)"%s", (char*)"</ul></hr>\n"); - websDone(wp, 200); - return 1; - } - return 0; -} - -/* - * Default error handler. The developer should insert code to handle - * error messages in the desired manner. - */ -void defaultErrorHandler(int etype, char_t *msg) -{ - if (msg) CLog::Log(LOGERROR, "%s", msg); -} - -/* - * Trace log. Customize this function to log trace output - */ -void defaultTraceHandler(int level, char_t *buf) -{ - if (buf) CLog::Log(LOGDEBUG, "%s", buf); -} - -/* Test Javascript binding for ASP. This will be invoked when "aspTest" is - * embedded in an ASP page. See web/asp.asp for usage. Set browser to - * "localhost/asp.asp" to test. - */ -int XbmcAspTest(int eid, webs_t wp, int argc, char_t **argv) -{ - char_t *name, *address; - - if (ejArgs(argc, argv, T((char*)"%s %s"), &name, &address) < 2) { - websError(wp, 400, T((char*)"Insufficient args\n")); - return -1; - } - return websWrite(wp, T((char*)"Name: %s, Address %s"), name, address); -} - -/* Test form for posted data (in-memory CGI). This will be called when the - * form in web/forms.asp is invoked. Set browser to "localhost/forms.asp" to test. - */ -void XbmcFormTest(webs_t wp, char_t *path, char_t *query) -{ - char_t *name, *address; - - name = websGetVar(wp, T((char*)"name"), T((char*)"Joe Smith")); - address = websGetVar(wp, T((char*)"address"), T((char*)"1212 Milky Way Ave.")); - - websHeader(wp); - websWrite(wp, T((char*)"<body><h2>Name: %s, Address: %s</h2>\n"), name, address); - websFooter(wp); - websDone(wp, 200); -} - -#ifdef __APPLE__ - -// I took this from the libGoAhead sample, it appears to be new. - -/******************************************************************************/ -/* - * Returns a pointer to an allocated qualified unique temporary file name. - * This filename must eventually be deleted with bfree(); - */ -char_t *websGetCgiCommName() -{ - char_t *pname1, *pname2; - - pname1 = tempnam(NULL, T("cgi")); - pname2 = bstrdup(B_L, pname1); - free(pname1); - return pname2; -} -#endif - -// Restore code and data sections to normal. -#ifndef __GNUC__ -#pragma code_seg() -#pragma data_seg() -#pragma bss_seg() -#pragma const_seg() -#endif - -void XbmcHttpCommand(webs_t wp, char_t *path, char_t *query) -{ - if (!pXbmcHttpShim) return ; - return pXbmcHttpShim->xbmcForm(wp, path, query); -} - -int XbmcAPIAspCommand(int eid, webs_t wp, int argc, char_t **argv) -{ - if (!pXbmcHttpShim) return -1; - return pXbmcHttpShim->xbmcCommand(eid, wp, argc, argv); -} - -int XbmcWebsAspCommand(int eid, webs_t wp, int argc, char_t **argv) -{ - if (!pXbmcWeb) return -1; - return pXbmcWeb->xbmcCommand(eid, wp, argc, argv); -} - -void XbmcWebsForm(webs_t wp, char_t *path, char_t *query) -{ - if (!pXbmcWeb) return; - return pXbmcWeb->xbmcForm(wp, path, query); -} - -bool XbmcWebConfigInit() -{ - if (!pXbmcWebConfig) { - pXbmcWebConfig = new CXbmcConfiguration(); - return true; - } - else - return false; -} - -void XbmcWebConfigRelease() -{ - if (pXbmcWebConfig) - { - delete pXbmcWebConfig; - pXbmcWebConfig=NULL; - } -} - -/* - * wrappers for xbmcConfig - */ -int XbmcWebsAspConfigBookmarkSize(int eid, webs_t wp, int argc, char_t **argv) { CStdString response; return pXbmcWebConfig ? pXbmcWebConfig->BookmarkSize(eid, wp, response, argc, argv) : -1; } -int XbmcWebsAspConfigGetBookmark(int eid, webs_t wp, int argc, char_t **argv) { CStdString response; return pXbmcWebConfig ? pXbmcWebConfig->GetBookmark(eid, wp, response, argc, argv) : -1; } -int XbmcWebsAspConfigAddBookmark(int eid, webs_t wp, int argc, char_t **argv) { CStdString response; return pXbmcWebConfig ? pXbmcWebConfig->AddBookmark(eid, wp, response, argc, argv) : -1; } -int XbmcWebsAspConfigSaveBookmark(int eid, webs_t wp, int argc, char_t **argv) { CStdString response; return pXbmcWebConfig ? pXbmcWebConfig->SaveBookmark(eid, wp, response, argc, argv) : -1; } -int XbmcWebsAspConfigRemoveBookmark(int eid, webs_t wp, int argc, char_t **argv) { CStdString response; return pXbmcWebConfig ? pXbmcWebConfig->RemoveBookmark(eid, wp, response, argc, argv) : -1; } -int XbmcWebsAspConfigSaveConfiguration(int eid, webs_t wp, int argc, char_t **argv) { CStdString response; return pXbmcWebConfig ? pXbmcWebConfig->SaveConfiguration(eid, wp, response, argc, argv) : -1; } -int XbmcWebsAspConfigGetOption(int eid, webs_t wp, int argc, char_t **argv) { CStdString response; return pXbmcWebConfig ? pXbmcWebConfig->GetOption(eid, wp, response, argc, argv) : -1; } -int XbmcWebsAspConfigSetOption(int eid, webs_t wp, int argc, char_t **argv) { CStdString response; return pXbmcWebConfig ? pXbmcWebConfig->SetOption(eid, wp, response, argc, argv) : -1; } - -/* - * wrappers for HttpAPI xbmcConfig - */ -int XbmcWebsHttpAPIConfigBookmarkSize(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->BookmarkSize(-1, NULL, response, argc, argv) : -1; } -int XbmcWebsHttpAPIConfigGetBookmark(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->GetBookmark(-1, NULL, response, argc, argv) : -1; } -int XbmcWebsHttpAPIConfigAddBookmark(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->AddBookmark(-1, NULL, response, argc, argv) : -1; } -int XbmcWebsHttpAPIConfigSaveBookmark(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->SaveBookmark(-1, NULL, response, argc, argv) : -1; } -int XbmcWebsHttpAPIConfigRemoveBookmark(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->RemoveBookmark(-1, NULL, response, argc, argv) : -1; } -int XbmcWebsHttpAPIConfigSaveConfiguration(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->SaveConfiguration(-1, NULL, response, argc, argv) : -1; } -int XbmcWebsHttpAPIConfigGetOption(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->GetOption(-1, NULL, response, argc, argv) : -1; } -int XbmcWebsHttpAPIConfigSetOption(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->SetOption(-1, NULL, response, argc, argv) : -1; } - - -#if defined(__cplusplus) -} -#endif - diff --git a/xbmc/lib/libGoAhead/WebServer.h b/xbmc/lib/libGoAhead/WebServer.h deleted file mode 100644 index 7b7ed433d8..0000000000 --- a/xbmc/lib/libGoAhead/WebServer.h +++ /dev/null @@ -1,93 +0,0 @@ - -/* WebServer.h: interface for the CWebServer class. - * A darivation of: main.c -- Main program for the GoAhead WebServer - * - * main.c -- Main program for the GoAhead WebServer - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -#pragma once - -#include "StdString.h" -#include "utils/Thread.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef char char_t; -typedef struct websRec *webs_t; - -int XbmcAspTest(int eid, webs_t wp, int argc, char_t **argv); -void XbmcFormTest(webs_t wp, char_t *path, char_t *query); -int XbmcWebsAspCommand(int eid, webs_t wp, int argc, char_t **argv); -void XbmcWebsForm(webs_t wp, char_t *path, char_t *query); -void XbmcHttpCommand(webs_t wp, char_t *path, char_t *query); -int XbmcAPIAspCommand(int eid, webs_t wp, int argc, char_t **argv); -bool XbmcWebConfigInit(); -void XbmcWebConfigRelease(); - -// wrapers for XBMCConfiguration -int XbmcWebsAspConfigBookmarkSize(int eid, webs_t wp, int argc, char_t **argv); -int XbmcWebsAspConfigGetBookmark(int eid, webs_t wp, int argc, char_t **argv); -int XbmcWebsAspConfigAddBookmark(int eid, webs_t wp, int argc, char_t **argv); -int XbmcWebsAspConfigSaveBookmark(int eid, webs_t wp, int argc, char_t **argv); -int XbmcWebsAspConfigRemoveBookmark(int eid, webs_t wp, int argc, char_t **argv); -int XbmcWebsAspConfigSaveConfiguration(int eid, webs_t wp, int argc, char_t **argv); -int XbmcWebsAspConfigGetOption(int eid, webs_t wp, int argc, char_t **argv); -int XbmcWebsAspConfigSetOption(int eid, webs_t wp, int argc, char_t **argv); - -// wrapers for HttpAPI XBMCConfiguration -int XbmcWebsHttpAPIConfigBookmarkSize(CStdString& response, int argc, char_t **argv); -int XbmcWebsHttpAPIConfigGetBookmark(CStdString& response, int argc, char_t **argv); -int XbmcWebsHttpAPIConfigAddBookmark(CStdString& response, int argc, char_t **argv); -int XbmcWebsHttpAPIConfigSaveBookmark(CStdString& response, int argc, char_t **argv); -int XbmcWebsHttpAPIConfigRemoveBookmark(CStdString& response, int argc, char_t **argv); -int XbmcWebsHttpAPIConfigSaveConfiguration(CStdString& response, int argc, char_t **argv); -int XbmcWebsHttpAPIConfigGetOption(CStdString& response, int argc, char_t **argv); -int XbmcWebsHttpAPIConfigSetOption(CStdString& response, int argc, char_t **argv); - -#if defined(__cplusplus) -} -#endif - -// group for default xbox user -#define WEBSERVER_UM_GROUP "sys_xbmc" - -class CWebServer : public CThread -{ -public: - - CWebServer(); - virtual ~CWebServer(); - bool Start(const char* szLocalAddress, int port = 80, const char* web = "special://home/web", bool wait = true); - void Stop(bool bWait); - - DWORD SuspendThread(); - DWORD ResumeThread(); - - void SetUserName(const char* strUserName); - void SetPassword(const char* strPassword); - char* GetUserName(); - char* GetPassword(); - -protected: - - virtual void OnStartup(); - virtual void OnExit(); - virtual void Process(); - - int initWebs(); - - char m_szLocalAddress[128]; /* local ip address */ - char m_szRootWeb[1024]; /* local directory */ - char m_szPassword[128]; /* password */ - char m_szUserName[128]; /* password */ - int m_port; /* Server port */ - bool m_bFinished; /* Finished flag */ - bool m_bStarted; /* Started flag */ - HANDLE m_hEvent; -}; diff --git a/xbmc/lib/libGoAhead/XBMCweb.cpp b/xbmc/lib/libGoAhead/XBMCweb.cpp deleted file mode 100644 index 97d1ec4ed5..0000000000 --- a/xbmc/lib/libGoAhead/XBMCweb.cpp +++ /dev/null @@ -1,1074 +0,0 @@ -/* -* XBMCweb.c -- Active Server Page Support -* -*/ - -/******************************** Description *********************************/ - -/* -* This module provides the links between the web server and XBMC -*/ - -/********************************* Includes ***********************************/ - -#include "system.h" -#include "XBMCweb.h" -#undef min -#undef max -#include "Application.h" - -#include "Util.h" -#include "PlayListPlayer.h" -#include "FileSystem/CDDADirectory.h" -#include "FileSystem/ZipManager.h" -#include "PlayListFactory.h" -#include "utils/GUIInfoManager.h" -#include "MusicInfoTagLoaderFactory.h" -#include "MusicDatabase.h" -#include "MusicInfoTag.h" -#include "FileItem.h" -#include "PlayList.h" -#include "GUISettings.h" -#include "Settings.h" -#include "FileSystem/VirtualDirectory.h" - -using namespace std; -using namespace XFILE; -using namespace PLAYLIST; -using namespace MUSIC_INFO; - -#ifndef __GNUC__ -#pragma code_seg("WEB_TEXT") -#pragma data_seg("WEB_DATA") -#pragma bss_seg("WEB_BSS") -#pragma const_seg("WEB_RD") -#endif - -#define XML_MAX_INNERTEXT_SIZE 256 -#define NO_EID -1 - -/***************************** Definitions ***************************/ -/* Define common commands */ - -#define XBMC_NONE T("none") -#define XBMC_ID T("id") -#define XBMC_TYPE T("type") - -#define XBMC_REMOTE_MENU T("menu") -#define XBMC_REMOTE_BACK T("back") -#define XBMC_REMOTE_SELECT T("select") -#define XBMC_REMOTE_DISPLAY T("display") -#define XBMC_REMOTE_TITLE T("title") -#define XBMC_REMOTE_INFO T("info") -#define XBMC_REMOTE_UP T("up") -#define XBMC_REMOTE_DOWN T("down") -#define XBMC_REMOTE_LEFT T("left") -#define XBMC_REMOTE_RIGHT T("right") -#define XBMC_REMOTE_PLAY T("play") -#define XBMC_REMOTE_FORWARD T("forward") -#define XBMC_REMOTE_REVERSE T("reverse") -#define XBMC_REMOTE_PAUSE T("pause") -#define XBMC_REMOTE_STOP T("stop") -#define XBMC_REMOTE_SKIP_PLUS T("skip+") -#define XBMC_REMOTE_SKIP_MINUS T("skip-") -#define XBMC_REMOTE_1 T("1") -#define XBMC_REMOTE_2 T("2") -#define XBMC_REMOTE_3 T("3") -#define XBMC_REMOTE_4 T("4") -#define XBMC_REMOTE_5 T("5") -#define XBMC_REMOTE_6 T("6") -#define XBMC_REMOTE_7 T("7") -#define XBMC_REMOTE_8 T("8") -#define XBMC_REMOTE_9 T("9") -#define XBMC_REMOTE_0 T("0") - -#define WEB_VIDEOS T("videos") -#define WEB_MUSIC T("music") -#define WEB_PICTURES T("pictures") -#define WEB_PROGRAMS T("programs") -#define WEB_FILES T("files") -#define WEB_MUSICPLAYLIST T("musicplaylist") -#define WEB_VIDEOPLAYLIST T("videoplaylist") - -#define XBMC_CAT_NAME T("name") -#define XBMC_CAT_SELECT T("select") -#define XBMC_CAT_QUE T("que") -#define XBMC_CAT_UNQUE T("unque") -#define XBMC_CAT_TYPE T("type") -#define XBMC_CAT_PREVIOUS T("previous") -#define XBMC_CAT_ITEMS T("items") -#define XBMC_CAT_FIRST T("first") -#define XBMC_CAT_NEXT T("next") - -#define XBMC_CMD_URL T("/xbmcCmds/xbmcForm") -#define XBMC_CMD_DIRECTORY T("directory") -#define XBMC_CMD_VIDEO T("video") -#define XBMC_CMD_MUSIC T("music") -#define XBMC_CMD_PICTURE T("picture") -#define XBMC_CMD_APPLICATION T("application") - -CXbmcWeb::CXbmcWeb() -{ - navigatorState = 0; - directory = NULL; - catalogItemCounter = 0; - webDirItems = new CFileItemList; - currentMediaItem = new CFileItem; -} - -CXbmcWeb::~CXbmcWeb() -{ - if (directory) delete directory; - delete webDirItems; - delete currentMediaItem; -} - -char* CXbmcWeb::GetCurrentDir() -{ - return currentDir; -} - -void CXbmcWeb::SetCurrentDir(const char* newDir) -{ - strcpy(currentDir, newDir); -} -DWORD CXbmcWeb::GetNavigatorState() -{ - return navigatorState; -} - -void CXbmcWeb::SetNavigatorState(DWORD state) -{ - navigatorState = state; -} - -void CXbmcWeb::AddItemToPlayList(const CFileItemPtr &pItem) -{ - if (pItem->m_bIsFolder) - { - // recursive - if (pItem->IsParentFolder()) return; - - CStdString strDirectory=pItem->m_strPath; - CFileItemList items; - directory->GetDirectory(strDirectory, items); - - // sort the items before adding to playlist - items.Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC); - - for (int i=0; i < (int) items.Size(); ++i) - AddItemToPlayList(items[i]); - } - else if (pItem->IsZIP() && g_guiSettings.GetBool("VideoFiles.HandleArchives")) - { - CStdString strDirectory; - CUtil::CreateArchivePath(strDirectory, "zip", pItem->m_strPath, ""); - CFileItemList items; - directory->GetDirectory(strDirectory, items); - - // sort the items before adding to playlist - items.Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC); - - for (int i=0; i < (int) items.Size(); ++i) - AddItemToPlayList(items[i]); - } - else if (pItem->IsRAR() && g_guiSettings.GetBool("VideoFiles.HandleArchives")) - { - CStdString strDirectory; - CUtil::CreateArchivePath(strDirectory, "rar", pItem->m_strPath, ""); - CFileItemList items; - directory->GetDirectory(strDirectory, items); - - // sort the items before adding to playlist - items.Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC); - - for (int i=0; i < (int) items.Size(); ++i) - AddItemToPlayList(items[i]); - } - else - { - //selected item is a file, add it to playlist - switch(GetNavigatorState()) - { - case WEB_NAV_VIDEOS: - g_playlistPlayer.Add(PLAYLIST_VIDEO, pItem); - break; - - case WEB_NAV_MUSIC: - g_playlistPlayer.Add(PLAYLIST_MUSIC, pItem); - break; - } - } -} - -/************************************* Code ***********************************/ - -/* Handle rempte control requests */ -int CXbmcWeb::xbmcRemoteControl( int eid, webs_t wp, char_t *parameter) -{ - /*********************************** - * Remote control command structure - * This structure is formatted as follows: - * command string, XBMC IR command - */ - xbmcRemoteControlHandlerType xbmcRemoteControls[ ] = { - {XBMC_REMOTE_MENU, XINPUT_IR_REMOTE_MENU}, - {XBMC_REMOTE_BACK, XINPUT_IR_REMOTE_BACK}, - {XBMC_REMOTE_SELECT, XINPUT_IR_REMOTE_SELECT}, - {XBMC_REMOTE_DISPLAY, XINPUT_IR_REMOTE_DISPLAY}, - {XBMC_REMOTE_TITLE, XINPUT_IR_REMOTE_TITLE}, - {XBMC_REMOTE_INFO, XINPUT_IR_REMOTE_INFO}, - {XBMC_REMOTE_UP, XINPUT_IR_REMOTE_UP}, - {XBMC_REMOTE_DOWN, XINPUT_IR_REMOTE_DOWN}, - {XBMC_REMOTE_LEFT, XINPUT_IR_REMOTE_LEFT}, - {XBMC_REMOTE_RIGHT, XINPUT_IR_REMOTE_RIGHT}, - {XBMC_REMOTE_PLAY, XINPUT_IR_REMOTE_PLAY}, - {XBMC_REMOTE_FORWARD, XINPUT_IR_REMOTE_FORWARD}, - {XBMC_REMOTE_REVERSE, XINPUT_IR_REMOTE_REVERSE}, - {XBMC_REMOTE_PAUSE, XINPUT_IR_REMOTE_PAUSE}, - {XBMC_REMOTE_STOP, XINPUT_IR_REMOTE_STOP}, - {XBMC_REMOTE_SKIP_PLUS, XINPUT_IR_REMOTE_SKIP_MINUS}, - {XBMC_REMOTE_SKIP_MINUS, XINPUT_IR_REMOTE_SKIP_PLUS}, - {XBMC_REMOTE_1, XINPUT_IR_REMOTE_1}, - {XBMC_REMOTE_2, XINPUT_IR_REMOTE_2}, - {XBMC_REMOTE_3, XINPUT_IR_REMOTE_3}, - {XBMC_REMOTE_4, XINPUT_IR_REMOTE_4}, - {XBMC_REMOTE_5, XINPUT_IR_REMOTE_5}, - {XBMC_REMOTE_6, XINPUT_IR_REMOTE_6}, - {XBMC_REMOTE_7, XINPUT_IR_REMOTE_7}, - {XBMC_REMOTE_8, XINPUT_IR_REMOTE_8}, - {XBMC_REMOTE_9, XINPUT_IR_REMOTE_9}, - {XBMC_REMOTE_0, XINPUT_IR_REMOTE_0}, - {"", -1} - }; - - int cmd = 0; - // look through the xbmcCommandStructure - while( xbmcRemoteControls[ cmd].xbmcIRCode != -1) { - // if we have a match - if( stricmp( parameter,xbmcRemoteControls[ cmd].xbmcRemoteParameter) == 0) { - // send it to the application - g_application.FrameMove(); - // return the number of characters written - return 0; - } - cmd++; - } - return 0; -} - -/* Handle navagate requests */ -int CXbmcWeb::xbmcNavigate( int eid, webs_t wp, char_t *parameter) -{ - - /*********************************** - * Navagation command structure - * This structure is formatted as follows: - * command string, XBMC application state - */ - xbmcNavigationHandlerType xbmcNavigator[ ] = { - {WEB_VIDEOS, WEB_NAV_VIDEOS}, - {WEB_MUSIC, WEB_NAV_MUSIC}, - {WEB_PICTURES, WEB_NAV_PICTURES}, - {WEB_PROGRAMS, WEB_NAV_PROGRAMS}, - {WEB_FILES, WEB_NAV_FILES}, - {WEB_MUSICPLAYLIST, WEB_NAV_MUSICPLAYLIST}, - {WEB_VIDEOPLAYLIST, WEB_NAV_VIDEOPLAYLIST}, - {"", -1} - }; - - // are we navigating to a music or video playlist? - if (!stricmp(WEB_MUSICPLAYLIST, parameter) || !stricmp(WEB_VIDEOPLAYLIST, parameter)) - { - // set navigator state - if (!stricmp(WEB_MUSICPLAYLIST, parameter)) SetNavigatorState(WEB_NAV_MUSICPLAYLIST); - else SetNavigatorState(WEB_NAV_VIDEOPLAYLIST); - catalogItemCounter = 0; - - //delete old directory - if (directory) { - delete directory; - directory = NULL; - } - webDirItems->Clear(); - - return 0; - } - - int cmd = 0; - // look through the xbmcCommandStructure - while( xbmcNavigator[ cmd].xbmcAppStateCode != -1) { - // if we have a match - if( stricmp( parameter,xbmcNavigator[ cmd].xbmcNavigateParameter) == 0) { - - SetNavigatorState(xbmcNavigator[cmd].xbmcAppStateCode); - catalogItemCounter = 0; - - //delete old directory - if (directory) { - delete directory; - directory = NULL; - } - - webDirItems->Clear(); - - //make a new directory and set the nessecary shares - directory = new CVirtualDirectory(); - - VECSOURCES *shares = NULL; - CStdString strDirectory; - - //get shares and extensions - if (!strcmp(parameter, WEB_VIDEOS)) - { - g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO); - strDirectory = g_settings.m_defaultVideoSource; - shares = &g_settings.m_videoSources; - directory->SetMask(g_settings.m_videoExtensions); - } - else if (!strcmp(parameter, WEB_MUSIC)) - { - g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_MUSIC); - strDirectory = g_settings.m_defaultMusicSource; - shares = &g_settings.m_musicSources; - directory->SetMask(g_settings.m_musicExtensions); - } - else if (!strcmp(parameter, WEB_PICTURES)) - { - strDirectory = g_settings.m_defaultPictureSource; - shares = &g_settings.m_pictureSources; - directory->SetMask(g_settings.m_pictureExtensions); - } - else if (!strcmp(parameter, WEB_PROGRAMS)) - { - strDirectory = g_settings.m_defaultFileSource; - shares = &g_settings.m_fileSources; - directory->SetMask("xbe|cut"); - } - else if (!strcmp(parameter, WEB_FILES)) - { - strDirectory = g_settings.m_defaultFileSource; - shares = &g_settings.m_fileSources; - directory->SetMask("*"); - } - - directory->SetSources(*shares); - directory->GetDirectory("",*webDirItems); - - //sort items - webDirItems->Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC); - - return 0; - } - cmd++; - } - return 0; -} - -int CXbmcWeb::xbmcNavigatorState( int eid, webs_t wp, char_t *parameter) -{ - int cnt = 0; - int cmd = 0; - xbmcNavigationHandlerType xbmcNavigator[ ] = { - {WEB_VIDEOS, WEB_NAV_VIDEOS}, - {WEB_MUSIC, WEB_NAV_MUSIC}, - {WEB_PICTURES, WEB_NAV_PICTURES}, - {WEB_PROGRAMS, WEB_NAV_PROGRAMS}, - {WEB_FILES, WEB_NAV_FILES}, - {WEB_MUSICPLAYLIST, WEB_NAV_MUSICPLAYLIST}, - {WEB_VIDEOPLAYLIST, WEB_NAV_VIDEOPLAYLIST}, - {"", -1} - }; - - // look through the xbmcCommandStructure - while( xbmcNavigator[cmd].xbmcAppStateCode != -1) - { - // if we have a match - if((DWORD)xbmcNavigator[cmd].xbmcAppStateCode == navigatorState) - { - if( eid != NO_EID) { - ejSetResult( eid, (char*)xbmcNavigator[cmd].xbmcNavigateParameter); - } else { - cnt = websWrite(wp, (char*)xbmcNavigator[cmd].xbmcNavigateParameter); - } - } - cmd++; - } - return cnt; -} - -int catalogNumber( char_t *parameter) -{ - int itemNumber = 0; - char_t *comma = NULL; - - if(( comma = strchr( parameter, ',')) != NULL) { - itemNumber = atoi( comma + 1); - } - return itemNumber; -} - -/* Deal with catalog requests */ -int CXbmcWeb::xbmcCatalog( int eid, webs_t wp, char_t *parameter) -{ - int selectionNumber = 0; - int iItemCount = 0; // for test purposes - int cnt = 0; - char buffer[XML_MAX_INNERTEXT_SIZE] = ""; - - // by default the answer to any question is 0 - if( eid != NO_EID) { - ejSetResult( eid, (char*)"0"); - } - - // if we are in an interface that supports media catalogs - DWORD state = GetNavigatorState(); - if((state == WEB_NAV_VIDEOS) || - (state == WEB_NAV_MUSIC) || - (state == WEB_NAV_PICTURES) || - (state == WEB_NAV_PROGRAMS) || - (state == WEB_NAV_FILES) || - (state == WEB_NAV_MUSICPLAYLIST) || - (state == WEB_NAV_VIDEOPLAYLIST)) - { - const char* output = "error"; - - // get total items in current state - if (navigatorState == WEB_NAV_MUSICPLAYLIST) - iItemCount = g_playlistPlayer.GetPlaylist(PLAYLIST_MUSIC).size(); - else if (navigatorState == WEB_NAV_VIDEOPLAYLIST) - iItemCount = g_playlistPlayer.GetPlaylist(PLAYLIST_VIDEO).size(); - else iItemCount = webDirItems->Size(); - - // have we requested a catalog item name? - if( strstr( parameter, XBMC_CAT_NAME) != NULL) - { - selectionNumber = catalogNumber( parameter); - if (navigatorState == WEB_NAV_MUSICPLAYLIST) - { - // we want to know the name from an item in the music playlist - if (selectionNumber <= g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size()) - { - strcpy(buffer, g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC )[selectionNumber]->GetLabel()); - output = buffer; - } - } - else if (navigatorState == WEB_NAV_VIDEOPLAYLIST) - { - // we want to know the name from an item in the video playlist - if (selectionNumber <= g_playlistPlayer.GetPlaylist( PLAYLIST_VIDEO ).size()) - { - strcpy(buffer, g_playlistPlayer.GetPlaylist( PLAYLIST_VIDEO )[selectionNumber]->GetLabel()); - output = buffer; - } - } - else - { - if( selectionNumber >= 0 && selectionNumber < iItemCount) - { - CFileItemPtr itm = webDirItems->Get(selectionNumber); - strcpy(buffer, itm->m_strPath); - output = buffer; - } - } - websWrite(wp, T((char*)"<html>\n")); - cnt = websWrite(wp, (char*)output); - websWrite(wp, T((char*)"</html>\n")); - return cnt; - } - - // have we requested a catalog item type? - if( strstr( parameter, XBMC_CAT_TYPE) != NULL) - { - selectionNumber = catalogNumber( parameter); - if (navigatorState == WEB_NAV_MUSICPLAYLIST) - { - // we have a music type - output = XBMC_CMD_MUSIC; - } - else if (navigatorState == WEB_NAV_VIDEOPLAYLIST) - { - // we have a video type - output = XBMC_CMD_MUSIC; - } - else - { - if( selectionNumber >= 0 && selectionNumber < iItemCount) { - CFileItemPtr itm = webDirItems->Get(selectionNumber); - if (itm->m_bIsFolder || itm->IsRAR() || itm->IsZIP()) - { - output = XBMC_CMD_DIRECTORY; - } - else - { - switch(GetNavigatorState()) - { - case WEB_NAV_VIDEOS: - output = XBMC_CMD_VIDEO; - break; - case WEB_NAV_MUSIC: - output = XBMC_CMD_MUSIC; - break; - case WEB_NAV_PICTURES: - output = XBMC_CMD_PICTURE; - break; - default: - output = XBMC_CMD_APPLICATION; - break; - } - } - } - } - if( eid != NO_EID) { - ejSetResult( eid, (char*)output); - } else { - cnt = websWrite(wp, (char*)output); - } - return cnt; - } - - // have we requested the number of catalog items? - if( stricmp( parameter, XBMC_CAT_ITEMS) == 0) { - int items; - if (navigatorState == WEB_NAV_MUSICPLAYLIST) - { - // we want to know how much music files are in the music playlist - items = g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size(); - } - else if (navigatorState == WEB_NAV_VIDEOPLAYLIST) - { - // we want to know how much video files are in the video playlist - items = g_playlistPlayer.GetPlaylist( PLAYLIST_VIDEO ).size(); - } - else - { - items = iItemCount; - } - if( eid != NO_EID) { - itoa(items, buffer, 10); - ejSetResult( eid, buffer); - } else { - cnt = websWrite(wp, (char*)"%i", (char*)items); - } - return cnt; - } - - // have we requested the first catalog item? - if( stricmp( parameter, XBMC_CAT_FIRST) == 0) { - catalogItemCounter = 0; - CStdString name; - if (navigatorState == WEB_NAV_MUSICPLAYLIST) - { - // we want the first music item form the music playlist - if(catalogItemCounter < g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size()) { - name = g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC )[catalogItemCounter]->GetLabel(); - } - } - else if (navigatorState == WEB_NAV_VIDEOPLAYLIST) - { - // we want the first video item form the video playlist - if(catalogItemCounter < g_playlistPlayer.GetPlaylist( PLAYLIST_VIDEO ).size()) { - name = g_playlistPlayer.GetPlaylist( PLAYLIST_VIDEO )[catalogItemCounter]->GetLabel(); - } - } - else - { - if(catalogItemCounter < iItemCount) { - name = webDirItems->Get(catalogItemCounter)->GetLabel(); - if (name == "") name = ".."; - } - } - if( eid != NO_EID) { - ejSetResult( eid, ( char_t *)name.c_str()); - } else { - cnt = websWrite(wp, (char_t *)name.c_str()); - } - return cnt; - } - - // have we requested the next catalog item? - if( stricmp( parameter, XBMC_CAT_NEXT) == 0) { - // are there items left to see - CStdString name; - if (navigatorState == WEB_NAV_MUSICPLAYLIST || navigatorState == WEB_NAV_VIDEOPLAYLIST) - { - if(navigatorState == WEB_NAV_MUSICPLAYLIST && (catalogItemCounter + 1) < g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size()) - { - // we want the next item in the music playlist - ++catalogItemCounter; - name = g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC )[catalogItemCounter]->GetLabel(); - if( eid != NO_EID) { - ejSetResult( eid, (char_t *)name.c_str()); - } else { - cnt = websWrite(wp, (char_t *)name.c_str()); - } - } - else if(navigatorState == WEB_NAV_VIDEOPLAYLIST && (catalogItemCounter + 1) < g_playlistPlayer.GetPlaylist( PLAYLIST_VIDEO ).size()) - { - // we want the next item in the video playlist - ++catalogItemCounter; - name = g_playlistPlayer.GetPlaylist( PLAYLIST_VIDEO )[catalogItemCounter]->GetLabel(); - if( eid != NO_EID) { - ejSetResult( eid, (char_t *)name.c_str()); - } else { - cnt = websWrite(wp, (char_t *)name.c_str()); - } - } - else - { - if( eid != NO_EID) { - ejSetResult( eid, (char*)XBMC_NONE); - } else { - cnt = websWrite(wp, (char*)XBMC_NONE); - } - } - } - else - { - if((catalogItemCounter + 1) < iItemCount) { - ++catalogItemCounter; - - name = webDirItems->Get(catalogItemCounter)->GetLabel(); - if (name == "") name = ".."; - if( eid != NO_EID) { - ejSetResult( eid, (char_t *)name.c_str()); - } else { - cnt = websWrite(wp, (char_t *)name.c_str()); - } - } else { - if( eid != NO_EID) { - ejSetResult( eid, (char*)XBMC_NONE); - } else { - cnt = websWrite(wp, (char*)XBMC_NONE); - } - } - } - return cnt; - } - - // have we selected a catalog item name? - if (( strstr( parameter, XBMC_CAT_SELECT) != NULL) || - ( strstr( parameter, XBMC_CAT_UNQUE) != NULL) || - ( strstr( parameter, XBMC_CAT_QUE) != NULL)) - { - selectionNumber = catalogNumber( parameter); - if( selectionNumber < iItemCount) - { - CStdString strAction = parameter; - strAction = strAction.substr(0, strAction.find(',')); - if (strAction == XBMC_CAT_QUE) - { - // attempt to enque the selected directory or file - CFileItemPtr itm = webDirItems->Get(selectionNumber); - AddItemToPlayList(itm); - } - else if (strAction == XBMC_CAT_UNQUE) - { - // get xbmc's playlist using our navigator state - int iPlaylist; - if (navigatorState == WEB_NAV_MUSICPLAYLIST) iPlaylist = PLAYLIST_MUSIC; - else iPlaylist = PLAYLIST_VIDEO; - - // attemt to unque item from playlist. - g_playlistPlayer.GetPlaylist(iPlaylist).Remove(catalogNumber(parameter)); - } - else - { - CFileItemPtr itm; - if (navigatorState == WEB_NAV_MUSICPLAYLIST) - { - itm = g_playlistPlayer.GetPlaylist(PLAYLIST_MUSIC)[selectionNumber]; - itm->m_bIsFolder = false; - } - else if (navigatorState == WEB_NAV_VIDEOPLAYLIST) - { - itm = g_playlistPlayer.GetPlaylist(PLAYLIST_VIDEO)[selectionNumber]; - itm->m_bIsFolder = false; - } - else itm = webDirItems->Get(selectionNumber); - - if (!itm) return 0; - - if (itm->IsZIP()) // mount zip archive - { - CMediaSource shareZip; - CUtil::CreateArchivePath(shareZip.strPath,"zip",itm->m_strPath,""); - itm->m_strPath = shareZip.strPath; - itm->m_bIsFolder = true; - } - else if (itm->IsRAR()) // mount rar archive - { - CMediaSource shareRar; - CStdString strRarPath; - CUtil::CreateArchivePath(strRarPath,"rar",itm->m_strPath,""); - shareRar.strPath = strRarPath; - - itm->m_strPath = shareRar.strPath; - itm->m_bIsFolder = true; - } - - if (itm->m_bIsFolder) - { - // enter the directory - if (itm->GetLabel() == "..") - { - char temp[7]; - if (strlen(currentDir) > 6) - strncpy(temp,currentDir,6); - temp[6] = '\0'; - - if (stricmp(temp,"zip://") == 0) // unmount archive - g_ZipManager.release(currentDir); - } - CStdString strDirectory = itm->m_strPath; - CStdString strParentPath; - webDirItems->Clear(); - - //set new current directory for webserver - SetCurrentDir(strDirectory.c_str()); - - bool bParentExists=CUtil::GetParentPath(strDirectory, strParentPath); - - // check if current directory is a root share - if ( !directory->IsSource(strDirectory) ) - { - // no, do we got a parent dir? - if ( bParentExists ) - { - // yes - CFileItemPtr pItem(new CFileItem("..")); - pItem->m_strPath=strParentPath; - pItem->m_bIsFolder=true; - pItem->m_bIsShareOrDrive=false; - webDirItems->Add(pItem); - } - } - else - { - // yes, this is the root of a share - // add parent path to the virtual directory - CFileItemPtr pItem(new CFileItem("..")); - pItem->m_strPath=""; - pItem->m_bIsShareOrDrive=false; - pItem->m_bIsFolder=true; - webDirItems->Add(pItem); - } - directory->GetDirectory(strDirectory, *webDirItems); - webDirItems->Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC); - } - else - { - //no directory, execute file - if (GetNavigatorState() == WEB_NAV_VIDEOS || - GetNavigatorState() == WEB_NAV_MUSIC || - GetNavigatorState() == WEB_NAV_MUSICPLAYLIST || - GetNavigatorState() == WEB_NAV_VIDEOPLAYLIST) - { - if (itm->IsPlayList()) - { - int iPlayList = PLAYLIST_MUSIC; - if (GetNavigatorState() == WEB_NAV_VIDEOS) iPlayList = PLAYLIST_VIDEO; - - // load a playlist like .m3u, .pls - // first get correct factory to load playlist - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(*itm)); - if ( NULL != pPlayList.get()) - { - // load it - if (!pPlayList->Load(itm->m_strPath)) - { - //hmmm unable to load playlist? - return -1; - } - - // clear current playlist - CPlayList& playlist = g_playlistPlayer.GetPlaylist(iPlayList); - playlist.Clear(); - - // add each item of the playlist to the playlistplayer - for (int i=0; i < (int)pPlayList->size(); ++i) - { - CFileItemPtr playlistItem =(*pPlayList)[i]; - if (playlistItem->GetLabel().IsEmpty()) - playlistItem->SetLabel(CUtil::GetFileName(playlistItem->m_strPath)); - playlist.Add(playlistItem); - } - - g_playlistPlayer.SetCurrentPlaylist(iPlayList); - - // play first item in playlist - g_application.getApplicationMessenger().PlayListPlayerPlay(); - - // set current file item - SetCurrentMediaItem(*playlist[0]); - } - } - else - { - // just play the file - SetCurrentMediaItem(*itm); - g_application.getApplicationMessenger().MediaStop(); - g_application.getApplicationMessenger().MediaPlay(itm->m_strPath); - } - } - else - { - if (GetNavigatorState() == WEB_NAV_PICTURES) - { - g_application.getApplicationMessenger().PictureShow(itm->m_strPath); - } - } - } - } - } - return 0; - } - } - return 0; -} - - -/* Play */ -int CXbmcWeb::xbmcPlayerPlay( int eid, webs_t wp, char_t *parameter) -{ - if (currentMediaItem->m_strPath.size() > 0) - { - g_application.getApplicationMessenger().MediaPlay(currentMediaItem->m_strPath); - } - else - { - // we haven't played an item through the webinterface yet. Try playing the current playlist - g_application.getApplicationMessenger().PlayListPlayerPlay(); - } - return 0; -} - -/* -* Play next file in active playlist -* Active playlist = MUSIC or VIDEOS -*/ -int CXbmcWeb::xbmcPlayerNext(int eid, webs_t wp, char_t *parameter) -{ - // get the playlist we want for the current navigator state - int currentPlayList = (navigatorState == WEB_NAV_MUSICPLAYLIST) ? PLAYLIST_MUSIC : PLAYLIST_VIDEO; - // activate needed playlist - g_playlistPlayer.SetCurrentPlaylist(currentPlayList); - - g_application.getApplicationMessenger().PlayListPlayerNext(); - return 0; -} - -/* -* Play previous file in active playlist -* Active playlist = MUSIC or VIDEOS -*/ -int CXbmcWeb::xbmcPlayerPrevious(int eid, webs_t wp, char_t *parameter) -{ - // get the playlist we want for the current navigator state - int currentPlayList = (navigatorState == WEB_NAV_MUSICPLAYLIST) ? PLAYLIST_MUSIC : PLAYLIST_VIDEO; - // activate playlist - g_playlistPlayer.SetCurrentPlaylist(currentPlayList); - - g_application.getApplicationMessenger().PlayListPlayerPrevious(); - return 0; -} - -/* Turn on subtitles */ -int CXbmcWeb::xbmcSubtitles( int eid, webs_t wp, char_t *parameter) -{ - if (g_application.m_pPlayer) g_application.m_pPlayer->SetSubtitleVisible(!g_application.m_pPlayer->GetSubtitleVisible()); - return 0; -} - -/* Parse an XBMC command */ -int CXbmcWeb::xbmcProcessCommand( int eid, webs_t wp, char_t *command, char_t *parameter) -{ - if (!strcmp(command, "play")) return xbmcPlayerPlay(eid, wp, parameter); - else if (!strcmp(command, "stop")) g_application.getApplicationMessenger().MediaStop(); - else if (!strcmp(command, "pause")) g_application.getApplicationMessenger().MediaPause(); - else if (!strcmp(command, "shutdown")) g_application.getApplicationMessenger().Shutdown(); - else if (!strcmp(command, "restart")) g_application.getApplicationMessenger().Restart(); - else if (!strcmp(command, "exit")) g_application.getApplicationMessenger().RebootToDashBoard(); - else if (!strcmp(command, "show_time")) return 0; - else if (!strcmp(command, "remote")) return xbmcRemoteControl(eid, wp, parameter); // remote control functions - else if (!strcmp(command, "navigate")) return xbmcNavigate(eid, wp, parameter); // Navigate to a particular interface - else if (!strcmp(command, "navigatorstate"))return xbmcNavigatorState(eid, wp, parameter); - else if (!strcmp(command, "catalog")) return xbmcCatalog(eid, wp, parameter); // interface to teh media catalog - - else if (!strcmp(command, "ff")) return 0; - else if (!strcmp(command, "rw")) return 0; - else if (!strcmp(command, "next")) return xbmcPlayerNext(eid, wp, parameter); - else if (!strcmp(command, "previous")) return xbmcPlayerPrevious(eid, wp, parameter); - - else if (!strcmp(command, "previous")) return xbmcPlayerPrevious(eid, wp, parameter); - return 0; -} - -/* XBMC Javascript binding for ASP. This will be invoked when "XBMCCommand" is -* embedded in an ASP page. -*/ -int CXbmcWeb::xbmcCommand( int eid, webs_t wp, int argc, char_t **argv) -{ - char_t *command, *parameter; - - int parameters = ejArgs(argc, argv, T((char*)"%s %s"), &command, ¶meter); - if (parameters < 1) { - websError(wp, 500, T((char*)"Insufficient args\n")); - return -1; - } - else if (parameters < 2) parameter = (char*)""; - - return xbmcProcessCommand( eid, wp, command, parameter); -} - -/* XBMC form for posted data (in-memory CGI). This will be called when the -* form in /xbmc/xbmcForm is invoked. Set browser to "localhost/xbmc/xbmcForm?command=test¶meter=videos" to test. -* Parameters: -* command: The command that will be invoked -* parameter: The parameter for this command -* next_page: The next page to display, use to invoke another page following this call -*/ -void CXbmcWeb::xbmcForm(webs_t wp, char_t *path, char_t *query) -{ - char_t *command, *parameter, *next_page; - - command = websGetVar(wp, (char*)WEB_COMMAND, (char*)XBMC_NONE); - parameter = websGetVar(wp, (char*)WEB_PARAMETER, (char*)XBMC_NONE); - - // do the command - websWrite(wp, T((char*)"HTTP/1.0 200 OK\r\n")); - websWrite(wp, T((char*)"Pragma: no-cache\r\n")); - websWrite(wp, T((char*)"Cache-control: no-cache\r\n")); - websWrite(wp, T((char*)"Content-Type: text/html\r\n")); - websWrite(wp, T((char*)"\r\n")); - - xbmcProcessCommand( NO_EID, wp, command, parameter); - - // if we do want to redirect - if( websTestVar(wp, (char*)WEB_NEXT_PAGE)) { - next_page = websGetVar(wp, (char*)WEB_NEXT_PAGE, (char*)XBMC_NONE); - // redirect to another web page - websRedirect(wp, next_page); - return; - } - websDone(wp, 200); -} - -void CXbmcWeb::SetCurrentMediaItem(CFileItem& newItem) -{ - *currentMediaItem = newItem; - - // No audio file, we are finished here - if (!newItem.IsAudio() ) - return; - - // Get a reference to the item's tag - CMusicInfoTag* tag = newItem.GetMusicInfoTag(); - - // we have a audio file. - // Look if we have this file in database... - bool bFound=false; - CMusicDatabase musicdatabase; - if (musicdatabase.Open()) - { - CSong song; - bFound=musicdatabase.GetSongByFileName(newItem.m_strPath, song); - tag->SetSong(song); - musicdatabase.Close(); - } - - if (!bFound && g_guiSettings.GetBool("musicfiles.usetags")) - { - // ...no, try to load the tag of the file. - auto_ptr<IMusicInfoTagLoader> pLoader(CMusicInfoTagLoaderFactory::CreateLoader(newItem.m_strPath)); - // Do we have a tag loader for this file type? - if (pLoader.get() != NULL) - pLoader->Load(newItem.m_strPath,*tag); - } - - // If we have tag information, ... - if (tag->Loaded()) - { - g_infoManager.SetCurrentSongTag(*tag); - } - /* - // display only, if we have a title - if (tag.GetTitle().size()) - { - //if (tag.GetArtist().size()) - - //if (tag.GetAlbum().size()) - - int iTrack = tag.GetTrackNumber(); - if (iTrack >= 1) - { - // Tracknumber - CStdString strText=g_localizeStrings.Get(554); // "Track" - if (strText.GetAt(strText.size()-1) != ' ') - strText+=" "; - CStdString strTrack; - strTrack.Format(strText+"%i", iTrack); - - } - - SYSTEMTIME systemtime; - tag.GetReleaseDate(systemtime); - int iYear=systemtime.wYear; - if (iYear >=1900) - { - // Year - CStdString strText=g_localizeStrings.Get(562); // "Year:" - if (strText.GetAt(strText.size()-1) != ' ') - strText+=" "; - CStdString strYear; - strYear.Format(strText+"%i", iYear); - } - - if (tag.GetDuration() > 0) - { - // Duration - CStdString strDuration, strTime; - - CStdString strText=g_localizeStrings.Get(180); - if (strText.GetAt(strText.size()-1) != ' ') - strText+=" "; - - CUtil::SecondsToTimeString(tag.GetDuration(), strTime); - - strDuration=strText+strTime; - } - } - } // if (tag.Loaded()) - else - { - // If we have a cdda track without cddb information,... - if (url.GetProtocol()=="cdda" ) - { - // we have the tracknumber... - int iTrack=tag.GetTrackNumber(); - if (iTrack >=1) - { - CStdString strText=g_localizeStrings.Get(554); // "Track" - if (strText.GetAt(strText.size()-1) != ' ') - strText+=" "; - CStdString strTrack; - strTrack.Format(strText+"%i", iTrack); - } - - // ...and its duration for display. - if (tag.GetDuration() > 0) - { - CStdString strDuration, strTime; - - CStdString strText=g_localizeStrings.Get(180); - if (strText.GetAt(strText.size()-1) != ' ') - strText+=" "; - - CUtil::SecondsToTimeString(tag.GetDuration(), strTime); - - strDuration=strText+strTime; - } - } - } - */ -} diff --git a/xbmc/lib/libGoAhead/XBMCweb.h b/xbmc/lib/libGoAhead/XBMCweb.h deleted file mode 100644 index b740e56705..0000000000 --- a/xbmc/lib/libGoAhead/XBMCweb.h +++ /dev/null @@ -1,104 +0,0 @@ -#pragma once - -/******************************** Description *********************************/ - -/* - * Header fil for the module that provides the links between the web server and - * XBMC. This defines the Web private APIs - * Include this header when you want to create XBMC handlers. - */ - -/********************************* Includes ***********************************/ -#include <boost/shared_ptr.hpp> -#include "includes.h" - -class CFileItem; typedef boost::shared_ptr<CFileItem> CFileItemPtr; -class CFileItemList; -namespace XFILE { - class CVirtualDirectory; -} - -class CXbmcWeb -{ -public: - CXbmcWeb(); - ~CXbmcWeb(); - char* GetCurrentDir(); - void SetCurrentDir(const char* newDir); - DWORD GetNavigatorState(); - void SetNavigatorState(DWORD state); - - void AddItemToPlayList(const CFileItemPtr &pItem); - - int xbmcCommand( int eid, webs_t wp, int argc, char_t **argv); - - void xbmcForm(webs_t wp, char_t *path, char_t *query); - int xbmcProcessCommand( int eid, webs_t wp, char_t *command, char_t *parameter); - - - int xbmcPlayerPlay( int eid, webs_t wp, char_t *parameter); - int xbmcPlayerPrevious( int eid, webs_t wp, char_t *parameter); - int xbmcPlayerNext( int eid, webs_t wp, char_t *parameter); - int xbmcNavigate( int eid, webs_t wp, char_t *parameter); - int xbmcNavigatorState( int eid, webs_t wp, char_t *parameter); - int xbmcCatalog( int eid, webs_t wp, char_t *parameter); - int xbmcRemoteControl( int eid, webs_t wp, char_t *parameter); - int xbmcSubtitles( int eid, webs_t wp, char_t *parameter); - - void SetCurrentMediaItem(CFileItem& newItem); - -private: - DWORD navigatorState; - char currentDir[1024]; - CFileItemList* webDirItems; - int catalogItemCounter; - XFILE::CVirtualDirectory *directory; - CFileItem* currentMediaItem; -}; - -/* - * Remote Control handler structure. Maps parameters from a remote command - * function to an XBMC ir remote command. - */ -typedef struct { - const char_t *xbmcRemoteParameter; - int xbmcIRCode; -} xbmcRemoteControlHandlerType; - -/* - * Navagation handler structure. Maps parameters from a navagation request - * to an XBMC application state. - */ -typedef struct { - const char_t *xbmcNavigateParameter; - int xbmcAppStateCode; -} xbmcNavigationHandlerType; - -/**************** - * Command names - */ -#define WEB_COMMAND T("command") -#define WEB_PARAMETER T("parameter") -#define WEB_NEXT_PAGE T("redirect") - -//actions for the use of messaging betweeen threads -#define XBMC_SHUTDOWN 10 -#define XBMC_DASHBOARD 11 -#define XBMC_RESTART 12 -#define XBMC_MEDIA_PLAY 13 -#define XBMC_MEDIA_STOP 14 -#define XBMC_MEDIA_PAUSE 15 -#define XBMC_PICTURE_SHOW 16 - -//navigator states -#define WEB_NAV_PROGRAMS 1 -#define WEB_NAV_PICTURES 2 -#define WEB_NAV_FILES 3 -#define WEB_NAV_MUSIC 5 -#define WEB_NAV_VIDEOS 6 -#define WEB_NAV_MUSICPLAYLIST 10 -#define WEB_NAV_VIDEOPLAYLIST 11 - -/* defines for use in xbmc */ -#define WEBSERVER_UPDATE 1 -#define WEBSERVER_CLICKED 2 diff --git a/xbmc/lib/libGoAhead/default.css b/xbmc/lib/libGoAhead/default.css deleted file mode 100644 index 77b55d319f..0000000000 --- a/xbmc/lib/libGoAhead/default.css +++ /dev/null @@ -1,188 +0,0 @@ -/*
-:Author: David Goodger
-:Contact: goodger@users.sourceforge.net
-:date: $Date: 2003/03/18 21:43:49 $
-:version: $Revision: 1.1 $
-:copyright: This stylesheet has been placed in the public domain.
-
-Default cascading style sheet for the HTML output of Docutils.
-*/
-
-.first {
- margin-top: 0 }
-
-.last {
- margin-bottom: 0 }
-
-a.toc-backref {
- text-decoration: none ;
- color: black }
-
-dd {
- margin-bottom: 0.5em }
-
-div.abstract {
- margin: 2em 5em }
-
-div.abstract p.topic-title {
- font-weight: bold ;
- text-align: center }
-
-div.attention, div.caution, div.danger, div.error, div.hint,
-div.important, div.note, div.tip, div.warning {
- margin: 2em ;
- border: medium outset ;
- padding: 1em }
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title {
- color: red ;
- font-weight: bold ;
- font-family: sans-serif }
-
-div.hint p.admonition-title, div.important p.admonition-title,
-div.note p.admonition-title, div.tip p.admonition-title {
- font-weight: bold ;
- font-family: sans-serif }
-
-div.dedication {
- margin: 2em 5em ;
- text-align: center ;
- font-style: italic }
-
-div.dedication p.topic-title {
- font-weight: bold ;
- font-style: normal }
-
-div.figure {
- margin-left: 2em }
-
-div.footer, div.header {
- font-size: smaller }
-
-div.system-messages {
- margin: 5em }
-
-div.system-messages h1 {
- color: red }
-
-div.system-message {
- border: medium outset ;
- padding: 1em }
-
-div.system-message p.system-message-title {
- color: red ;
- font-weight: bold }
-
-div.topic {
- margin: 2em }
-
-h1.title {
- text-align: center }
-
-h2.subtitle {
- text-align: center }
-
-hr {
- width: 75% }
-
-ol.simple, ul.simple {
- margin-bottom: 1em }
-
-ol.arabic {
- list-style: decimal }
-
-ol.loweralpha {
- list-style: lower-alpha }
-
-ol.upperalpha {
- list-style: upper-alpha }
-
-ol.lowerroman {
- list-style: lower-roman }
-
-ol.upperroman {
- list-style: upper-roman }
-
-p.caption {
- font-style: italic }
-
-p.credits {
- font-style: italic ;
- font-size: smaller }
-
-p.label {
- white-space: nowrap }
-
-p.topic-title {
- font-weight: bold }
-
-pre.address {
- margin-bottom: 0 ;
- margin-top: 0 ;
- font-family: serif ;
- font-size: 100% }
-
-pre.line-block {
- font-family: serif ;
- font-size: 100% }
-
-pre.literal-block, pre.doctest-block {
- margin-left: 2em ;
- margin-right: 2em ;
- background-color: #eeeeee }
-
-span.classifier {
- font-family: sans-serif ;
- font-style: oblique }
-
-span.classifier-delimiter {
- font-family: sans-serif ;
- font-weight: bold }
-
-span.interpreted {
- font-family: sans-serif }
-
-span.option-argument {
- font-style: italic }
-
-span.pre {
- white-space: pre }
-
-span.problematic {
- color: red }
-
-table {
- margin-top: 0.5em ;
- margin-bottom: 0.5em }
-
-table.citation {
- border-left: solid thin gray ;
- padding-left: 0.5ex }
-
-table.docinfo {
- margin: 2em 4em }
-
-table.footnote {
- border-left: solid thin black ;
- padding-left: 0.5ex }
-
-td, th {
- padding-left: 0.5em ;
- padding-right: 0.5em ;
- vertical-align: top }
-
-th.docinfo-name, th.field-name {
- font-weight: bold ;
- text-align: left ;
- white-space: nowrap }
-
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
- font-size: 100% }
-
-tt {
- background-color: #eeeeee }
-
-ul.auto-toc {
- list-style-type: none }
diff --git a/xbmc/lib/libGoAhead/goahead.lib b/xbmc/lib/libGoAhead/goahead.lib Binary files differdeleted file mode 100755 index 3df4f81a2e..0000000000 --- a/xbmc/lib/libGoAhead/goahead.lib +++ /dev/null diff --git a/xbmc/lib/libGoAhead/goahead.sln b/xbmc/lib/libGoAhead/goahead.sln deleted file mode 100644 index 6dd90602bf..0000000000 --- a/xbmc/lib/libGoAhead/goahead.sln +++ /dev/null @@ -1,36 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "goahead", "goahead.vcproj", "{F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Debug (Win32) = Debug (Win32)
- Profile = Profile
- Profile_FastCap = Profile_FastCap
- Release = Release
- Release (Win32) = Release (Win32)
- Release_LTCG = Release_LTCG
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Debug.ActiveCfg = Debug|Xbox
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Debug.Build.0 = Debug|Xbox
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Debug (Win32).ActiveCfg = Debug|Win32
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Debug (Win32).Build.0 = Debug|Win32
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Profile.ActiveCfg = Profile|Xbox
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Profile.Build.0 = Profile|Xbox
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Profile_FastCap.ActiveCfg = Profile_FastCap|Xbox
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Profile_FastCap.Build.0 = Profile_FastCap|Xbox
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Release.ActiveCfg = Release|Xbox
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Release.Build.0 = Release|Xbox
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Release (Win32).ActiveCfg = Release|Win32
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Release (Win32).Build.0 = Release|Win32
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Release_LTCG.ActiveCfg = Release_LTCG|Xbox
- {F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}.Release_LTCG.Build.0 = Release_LTCG|Xbox
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/xbmc/lib/libGoAhead/goahead.vcproj b/xbmc/lib/libGoAhead/goahead.vcproj deleted file mode 100644 index 195f0694f2..0000000000 --- a/xbmc/lib/libGoAhead/goahead.vcproj +++ /dev/null @@ -1,679 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="goahead"
- ProjectGUID="{F6117C48-1AAD-4784-A5C0-BC87E1EE9F4E}"
- Keyword="XboxProj">
- <Platforms>
- <Platform
- Name="Xbox"/>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Xbox"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- OmitFramePointers="TRUE"
- OptimizeForProcessor="2"
- AdditionalIncludeDirectories="../../../guilib;../../../guilib/common;../../../xbmc;../../../guilib/tinyxml"
- PreprocessorDefinitions="_DEBUG;_XBOX;WEBS;UEMF;DIGEST_ACCESS_SUPPORT;DEV;WIN;USER_MANAGEMENT_SUPPORT;__NO_CGI_BIN"
- StringPooling="FALSE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- EnableFunctionLevelLinking="TRUE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/goaheadd.lib"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"
- CommandLine=""$(VCInstallDir)"\bin\editbin /SECTION:.text=WEB_TEXT .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.data=WEB_DATA .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.bss=WEB_BSS .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.rdata=WEB_RD .\$(OutDir)\*.obj >null
-"/>
- </Configuration>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- OmitFramePointers="TRUE"
- OptimizeForProcessor="2"
- AdditionalIncludeDirectories="../../../guilib;../../../guilib/common;../../../xbmc;../../../guilib/tinyxml"
- PreprocessorDefinitions="_DEBUG;WIN32;WEBS;UEMF;DIGEST_ACCESS_SUPPORT;DEV;WIN;USER_MANAGEMENT_SUPPORT;__NO_CGI_BIN"
- StringPooling="FALSE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- EnableFunctionLevelLinking="TRUE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/$(ProjectName)_win32d.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"
- CommandLine=""$(VCInstallDir)"\bin\editbin /SECTION:.text=WEB_TEXT .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.data=WEB_DATA .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.bss=WEB_BSS .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.rdata=WEB_RD .\$(OutDir)\*.obj >null
-"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Profile|Xbox"
- OutputDirectory="Profile"
- IntermediateDirectory="Profile"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- OmitFramePointers="TRUE"
- OptimizeForProcessor="2"
- PreprocessorDefinitions="NDEBUG;_XBOX;PROFILE"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="3"
- PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="xapilib.lib d3d8i.lib d3dx8.lib xgraphics.lib dsound.lib dmusici.lib xactengi.lib xsndtrk.lib xvoice.lib xonlines.lib xboxkrnl.lib xbdm.lib xperf.lib"
- OutputFile="$(OutDir)/$(ProjectName).exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- SetChecksum="TRUE"
- TargetMachine="1"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="XboxDeploymentTool"/>
- <Tool
- Name="XboxImageTool"
- StackSize="65536"
- IncludeDebugInfo="TRUE"
- NoLibWarn="TRUE"/>
- </Configuration>
- <Configuration
- Name="Profile|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- OmitFramePointers="TRUE"
- OptimizeForProcessor="2"
- PreprocessorDefinitions="NDEBUG;_XBOX;PROFILE"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="3"
- PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="xapilib.lib d3d8i.lib d3dx8.lib xgraphics.lib dsound.lib dmusici.lib xactengi.lib xsndtrk.lib xvoice.lib xonlines.lib xboxkrnl.lib xbdm.lib xperf.lib"
- OutputFile="$(OutDir)/$(ProjectName).exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- SetChecksum="TRUE"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Profile_FastCap|Xbox"
- OutputDirectory="Profile_FastCap"
- IntermediateDirectory="Profile_FastCap"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- OmitFramePointers="TRUE"
- OptimizeForProcessor="2"
- PreprocessorDefinitions="NDEBUG;_XBOX;PROFILE;FASTCAP"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="3"
- PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"
- FastCAP="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="xapilib.lib d3d8i.lib d3dx8.lib xgraphics.lib dsound.lib dmusici.lib xactengi.lib xsndtrk.lib xvoice.lib xonlines.lib xboxkrnl.lib xbdm.lib xperf.lib"
- OutputFile="$(OutDir)/$(ProjectName).exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- SetChecksum="TRUE"
- TargetMachine="1"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="XboxDeploymentTool"/>
- <Tool
- Name="XboxImageTool"
- StackSize="65536"
- IncludeDebugInfo="TRUE"
- NoLibWarn="TRUE"/>
- </Configuration>
- <Configuration
- Name="Profile_FastCap|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- OmitFramePointers="TRUE"
- OptimizeForProcessor="2"
- PreprocessorDefinitions="NDEBUG;_XBOX;PROFILE;FASTCAP"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="3"
- PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"
- FastCAP="TRUE"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="xapilib.lib d3d8i.lib d3dx8.lib xgraphics.lib dsound.lib dmusici.lib xactengi.lib xsndtrk.lib xvoice.lib xonlines.lib xboxkrnl.lib xbdm.lib xperf.lib"
- OutputFile="$(OutDir)/$(ProjectName).exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- SetChecksum="TRUE"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Xbox"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- GlobalOptimizations="TRUE"
- FavorSizeOrSpeed="1"
- OmitFramePointers="TRUE"
- EnableFiberSafeOptimizations="FALSE"
- OptimizeForProcessor="2"
- AdditionalIncludeDirectories="../../../guilib;../../../guilib/common;../../../xbmc;../../../guilib/tinyxml"
- PreprocessorDefinitions="NDEBUG;_XBOX;WEBS;UEMF;DIGEST_ACCESS_SUPPORT;DEV;WIN;USER_MANAGEMENT_SUPPORT;__NO_CGI_BIN"
- StringPooling="FALSE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"
- CommandLine=""$(VCInstallDir)"\bin\editbin /SECTION:.text=WEB_TEXT .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.data=WEB_DATA .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.bss=WEB_BSS .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.rdata=WEB_RD .\$(OutDir)\*.obj >null
-"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- GlobalOptimizations="TRUE"
- FavorSizeOrSpeed="1"
- OmitFramePointers="TRUE"
- EnableFiberSafeOptimizations="FALSE"
- OptimizeForProcessor="2"
- AdditionalIncludeDirectories="../../../guilib;../../../guilib/common;../../../xbmc;../../../guilib/tinyxml"
- PreprocessorDefinitions="NDEBUG;WIN32;WEBS;UEMF;DIGEST_ACCESS_SUPPORT;DEV;WIN;USER_MANAGEMENT_SUPPORT;__NO_CGI_BIN"
- StringPooling="FALSE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/$(ProjectName)_win32.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"
- CommandLine=""$(VCInstallDir)"\bin\editbin /SECTION:.text=WEB_TEXT .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.data=WEB_DATA .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.bss=WEB_BSS .\$(OutDir)\*.obj >null
-"$(VCInstallDir)"\bin\editbin /SECTION:.rdata=WEB_RD .\$(OutDir)\*.obj >null
-"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release_LTCG|Xbox"
- OutputDirectory="Release_LTCG"
- IntermediateDirectory="Release_LTCG"
- ConfigurationType="1"
- CharacterSet="2"
- WholeProgramOptimization="TRUE">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- OmitFramePointers="TRUE"
- OptimizeForProcessor="2"
- PreprocessorDefinitions="NDEBUG;_XBOX;LTCG"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="3"
- PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="xapilib.lib d3d8ltcg.lib d3dx8.lib xgraphicsltcg.lib dsound.lib dmusicltcg.lib xactengltcg.lib xsndtrk.lib xvoice.lib xonlines.lib xboxkrnl.lib"
- OutputFile="$(OutDir)/$(ProjectName).exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- SetChecksum="TRUE"
- TargetMachine="1"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="XboxDeploymentTool"/>
- <Tool
- Name="XboxImageTool"
- StackSize="65536"/>
- </Configuration>
- <Configuration
- Name="Release_LTCG|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- WholeProgramOptimization="TRUE">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- OmitFramePointers="TRUE"
- OptimizeForProcessor="2"
- PreprocessorDefinitions="NDEBUG;_XBOX;LTCG"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- EnableEnhancedInstructionSet="1"
- UsePrecompiledHeader="3"
- PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch"
- WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="xapilib.lib d3d8ltcg.lib d3dx8.lib xgraphicsltcg.lib dsound.lib dmusicltcg.lib xactengltcg.lib xsndtrk.lib xvoice.lib xonlines.lib xboxkrnl.lib"
- OutputFile="$(OutDir)/$(ProjectName).exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- SetChecksum="TRUE"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath=".\src\asp.c">
- </File>
- <File
- RelativePath=".\src\balloc.c">
- </File>
- <File
- RelativePath=".\src\base64.c">
- </File>
- <File
- RelativePath=".\src\cgi.c">
- </File>
- <File
- RelativePath=".\src\default.c">
- </File>
- <File
- RelativePath=".\src\ejlex.c">
- </File>
- <File
- RelativePath=".\src\ejparse.c">
- </File>
- <File
- RelativePath=".\src\emfdb.c">
- </File>
- <File
- RelativePath=".\src\form.c">
- </File>
- <File
- RelativePath=".\src\h.c">
- </File>
- <File
- RelativePath=".\src\handler.c">
- </File>
- <File
- RelativePath=".\src\md5c.c">
- </File>
- <File
- RelativePath=".\src\mime.c">
- </File>
- <File
- RelativePath=".\src\misc.c">
- </File>
- <File
- RelativePath=".\src\mocana_ssl.c">
- </File>
- <File
- RelativePath=".\src\page.c">
- </File>
- <File
- RelativePath=".\src\ringq.c">
- </File>
- <File
- RelativePath=".\src\rom.c">
- </File>
- <File
- RelativePath=".\src\security.c">
- </File>
- <File
- RelativePath=".\src\sock.c">
- </File>
- <File
- RelativePath=".\src\socketutil.cpp">
- </File>
- <File
- RelativePath=".\src\sockGen.c">
- </File>
- <File
- RelativePath=".\src\spy.c">
- </File>
- <File
- RelativePath=".\src\sym.c">
- </File>
- <File
- RelativePath=".\src\uemf.c">
- </File>
- <File
- RelativePath=".\src\um.c">
- </File>
- <File
- RelativePath=".\src\umui.c">
- </File>
- <File
- RelativePath=".\src\url.c">
- </File>
- <File
- RelativePath=".\src\value.c">
- </File>
- <File
- RelativePath=".\src\webcomp.c">
- </File>
- <File
- RelativePath=".\src\webrom.c">
- </File>
- <File
- RelativePath=".\src\webs.c">
- </File>
- <File
- RelativePath=".\src\websda.c">
- </File>
- <File
- RelativePath=".\src\websuemf.c">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath=".\src\ej.h">
- </File>
- <File
- RelativePath=".\src\ejIntrn.h">
- </File>
- <File
- RelativePath=".\src\emfdb.h">
- </File>
- <File
- RelativePath=".\src\md5.h">
- </File>
- <File
- RelativePath=".\src\socketutil.h">
- </File>
- <File
- RelativePath=".\src\uemf.h">
- </File>
- <File
- RelativePath=".\src\um.h">
- </File>
- <File
- RelativePath=".\src\webs.h">
- </File>
- <File
- RelativePath=".\src\websda.h">
- </File>
- <File
- RelativePath=".\src\websSSL.h">
- </File>
- <File
- RelativePath=".\src\wsIntrn.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/xbmc/lib/libGoAhead/goahead_win32.lib b/xbmc/lib/libGoAhead/goahead_win32.lib Binary files differdeleted file mode 100644 index 5c7a077d75..0000000000 --- a/xbmc/lib/libGoAhead/goahead_win32.lib +++ /dev/null diff --git a/xbmc/lib/libGoAhead/goaheadd.lib b/xbmc/lib/libGoAhead/goaheadd.lib Binary files differdeleted file mode 100755 index c9ecc2e78d..0000000000 --- a/xbmc/lib/libGoAhead/goaheadd.lib +++ /dev/null diff --git a/xbmc/lib/libGoAhead/includes.h b/xbmc/lib/libGoAhead/includes.h deleted file mode 100644 index 2ba19e9af7..0000000000 --- a/xbmc/lib/libGoAhead/includes.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#ifndef WEBS -#define WEBS -#endif -#ifndef UEMF -#define UEMF -#endif -#ifndef DIGEST_ACCESS_SUPPORT -#define DIGEST_ACCESS_SUPPORT -#endif -#ifndef DEV -#define DEV -#endif -#ifndef _LINUX -#ifndef WIN -#define WIN -#endif -#else -#ifndef LINUX -#define LINUX -#endif -#endif -#ifndef USER_MANAGEMENT_SUPPORT -#define USER_MANAGEMENT_SUPPORT -#endif -#ifndef __NO_CGI_BIN -#define __NO_CGI_BIN -#endif - -#define SOCK_DFT_SVC_TIME 1000 -#undef SPYCE_SUPPORT - -#ifdef __cplusplus -extern "C" { -#endif - -#include "src/wsIntrn.h" - -#ifdef WEBS_SSL_SUPPORT -#include "src/websSSL.h" -#endif - -#ifdef USER_MANAGEMENT_SUPPORT -#include "src/um.h" - void formDefineUserMgmt(void); -#endif - -#if defined(__cplusplus) -} -#endif diff --git a/xbmc/lib/libGoAhead/release.htm b/xbmc/lib/libGoAhead/release.htm deleted file mode 100644 index 24c4c36e09..0000000000 --- a/xbmc/lib/libGoAhead/release.htm +++ /dev/null @@ -1,598 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.2.8: http://docutils.sourceforge.net/" />
-<title>GoAhead WebServer 2.1.7 Release Notes</title>
-<link rel="stylesheet" href="default.css" type="text/css" />
-</head>
-<body>
-<div class="document" id="goahead-webserver-2-1-7-release-notes">
-<h1 class="title">GoAhead WebServer 2.1.7 Release Notes</h1>
-<!-- NOTES: -->
-<!-- This document is maintained using the reStructuredText markup system. -->
-<!-- You may download this from <http://docutils.sf.net>. Also note that running -->
-<!-- the docutils code requires that a version of Python version 2.1 or later -->
-<!-- be installed on the machine. Since the GoAhead release procedure itself -->
-<!-- runs in Python, this should not be a problem. -->
-<!-- -->
-<!-- To add new entries to the release notes, follow the markup shown below -->
-<!-- (releases should be underlined with a row of '=' characters, each item -->
-<!-- noted within a release should be underlined with '-' characters. -->
-<div class="contents topic" id="contents">
-<p class="topic-title"><a name="contents">Contents</a></p>
-<ul class="simple">
-<li><a class="reference" href="#id1" id="id2" name="id2">GoAhead WebServer 2.1.7 Release Notes</a><ul>
-<li><a class="reference" href="#added-support-for-the-mocana-ssl-toolkit" id="id3" name="id3">Added support for the Mocana SSL Toolkit</a></li>
-<li><a class="reference" href="#changes-to-dbsearchstring" id="id4" name="id4">Changes to <tt class="literal"><span class="pre">dbSearchString()</span></tt></a></li>
-<li><a class="reference" href="#use-memcpy-when-converting-to-from-unicode" id="id5" name="id5">Use <tt class="literal"><span class="pre">memcpy()</span></tt> when converting to/from Unicode</a></li>
-<li><a class="reference" href="#bug-when-using-utf-8-encoded-text-inside-asp-ejscript-blocks" id="id6" name="id6">Bug when using UTF-8 encoded text inside ASP/ejScript blocks</a></li>
-<li><a class="reference" href="#wrong-error-code-on-invalid-password" id="id7" name="id7">Wrong error code on invalid password</a></li>
-<li><a class="reference" href="#windows-ce-net" id="id8" name="id8">Windows CE.NET</a></li>
-<li><a class="reference" href="#lynx-makefile" id="id9" name="id9">LYNX <tt class="literal"><span class="pre">Makefile</span></tt></a></li>
-</ul>
-</li>
-<li><a class="reference" href="#goahead-webserver-2-1-6-release-notes" id="id10" name="id10">GoAhead WebServer 2.1.6 Release Notes</a><ul>
-<li><a class="reference" href="#null-pointer-crash-in-webssafeurl" id="id11" name="id11"><tt class="literal"><span class="pre">NULL</span></tt> pointer crash in <tt class="literal"><span class="pre">websSafeUrl()</span></tt></a></li>
-</ul>
-</li>
-<li><a class="reference" href="#goahead-webserver-2-1-5-release-notes" id="id12" name="id12">GoAhead WebServer 2.1.5 Release Notes</a><ul>
-<li><a class="reference" href="#bopen-failure-mode" id="id13" name="id13"><tt class="literal"><span class="pre">bopen()</span></tt> failure mode</a></li>
-<li><a class="reference" href="#windows-95-98-me-aux-denial-of-service" id="id14" name="id14">Windows 95/98/ME <tt class="literal"><span class="pre">AUX</span></tt> Denial of Service</a></li>
-<li><a class="reference" href="#cross-site-scripting-exploit" id="id15" name="id15">404 Cross-site Scripting Exploit</a></li>
-<li><a class="reference" href="#long-url-overflow-crash" id="id16" name="id16">Long URL Overflow Crash</a></li>
-<li><a class="reference" href="#incorrect-error-code-in-security-c" id="id17" name="id17">Incorrect Error Code in <tt class="literal"><span class="pre">security.c</span></tt></a></li>
-<li><a class="reference" href="#pragma-code-for-risc-architectures" id="id18" name="id18">Pragma Code for RISC Architectures</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#goahead-webserver-2-1-4-release-notes" id="id19" name="id19">GoAhead® WebServer 2.1.4 Release Notes</a><ul>
-<li><a class="reference" href="#fixed-vulnerability-to-malicious-code-in-webs-c" id="id20" name="id20">Fixed vulnerability to malicious code in <tt class="literal"><span class="pre">webs.c</span></tt></a></li>
-<li><a class="reference" href="#https-bug-in-security-handler" id="id21" name="id21">https:// bug in security handler</a></li>
-<li><a class="reference" href="#fixed-vulnerability-to-malicious-code-in-sockgen-c" id="id22" name="id22">Fixed vulnerability to malicious code in sockGen.c</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#bug-fixes-for-version-2-1-3" id="id23" name="id23">Bug Fixes for Version 2.1.3</a><ul>
-<li><a class="reference" href="#directory-traversal-exploit" id="id24" name="id24">Directory Traversal Exploit</a></li>
-<li><a class="reference" href="#mime-type-for-external-javascript-files" id="id25" name="id25">MIME type for external JavaScript files</a></li>
-<li><a class="reference" href="#bug-in-if-modified-since-parsing" id="id26" name="id26">Bug in If-Modified-Since parsing</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#bug-fixes-for-version-2-1-2" id="id27" name="id27">Bug Fixes for Version 2.1.2</a><ul>
-<li><a class="reference" href="#ejscript-error-messages" id="id28" name="id28">Ejscript Error Messages</a></li>
-<li><a class="reference" href="#security-handler-response-codes" id="id29" name="id29">Security Handler Response Codes</a></li>
-<li><a class="reference" href="#security-handler-memory-leak" id="id30" name="id30">Security Handler Memory Leak</a></li>
-<li><a class="reference" href="#ejscript-write-corruption" id="id31" name="id31">Ejscript Write Corruption</a></li>
-<li><a class="reference" href="#error-in-dsnprintf-x-format" id="id32" name="id32">Error in dsnprintf(): "%X" format</a></li>
-<li><a class="reference" href="#bug018565-re-fixed" id="id33" name="id33">BUG018565 Re-fixed</a></li>
-<li><a class="reference" href="#potential-error-in-error" id="id34" name="id34">Potential Error in <tt class="literal"><span class="pre">error()</span></tt></a></li>
-<li><a class="reference" href="#added-support-for-customized-access-control" id="id35" name="id35">Added Support For Customized Access Control</a></li>
-<li><a class="reference" href="#memory-leak-in-websparserequest" id="id36" name="id36">Memory Leak in websParseRequest()</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#macintosh-os-x-support" id="id37" name="id37">Macintosh OS X Support</a></li>
-<li><a class="reference" href="#bug-fixes-for-version-2-1-1" id="id38" name="id38">Bug Fixes for Version 2.1.1</a><ul>
-<li><a class="reference" href="#intermittent-access-error-for-cgi-scripts-bug01937" id="id39" name="id39">Intermittent Access Error for CGI Scripts (BUG01937)</a></li>
-<li><a class="reference" href="#cpu-utilization-hangs-at-100-on-a-socket-disconnect-bug01865" id="id40" name="id40">CPU Utilization Hangs at 100% on a Socket Disconnect (BUG01865)</a></li>
-<li><a class="reference" href="#security-features-can-be-bypassed-by-adding-an-extra-slash-in-the-url-bug01518" id="id41" name="id41">Security Features can be Bypassed by Adding an Extra Slash in the URL (BUG01518)</a></li>
-<li><a class="reference" href="#call-to-webssetvar-causes-a-crash-bug01938" id="id42" name="id42">Call to <tt class="literal"><span class="pre">websSetVar</span></tt> causes a crash (BUG01938)</a></li>
-<li><a class="reference" href="#remove-stray-semicolon-in-emfdb-c-bug01820" id="id43" name="id43">Remove stray semicolon in <tt class="literal"><span class="pre">emfdb.c</span></tt> (BUG01820)</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#novell-netware-support" id="id44" name="id44">Novell Netware Support</a></li>
-<li><a class="reference" href="#copyright-information" id="id45" name="id45">Copyright Information</a></li>
-</ul>
-</div>
-<div class="section" id="id1">
-<h1><a class="toc-backref" href="#id2" name="id1">GoAhead WebServer 2.1.7 Release Notes</a></h1>
-<dl>
-<dt>Release Date:</dt>
-<dd>01 Oct 2003</dd>
-</dl>
-<div class="section" id="added-support-for-the-mocana-ssl-toolkit">
-<h2><a class="toc-backref" href="#id3" name="added-support-for-the-mocana-ssl-toolkit">Added support for the Mocana SSL Toolkit</a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>Added support for Mocana Corporation's embedded SSL server</dd>
-</dl>
-</div>
-<div class="section" id="changes-to-dbsearchstring">
-<h2><a class="toc-backref" href="#id4" name="changes-to-dbsearchstring">Changes to <tt class="literal"><span class="pre">dbSearchString()</span></tt></a></h2>
-<p>Description:</p>
-<blockquote>
-Pass <tt class="literal"><span class="pre">DB_CASE_INSENSITIVE</span></tt> as the "flags" argument to
-dbSearchString() to force a case-insensitive search.</blockquote>
-</div>
-<div class="section" id="use-memcpy-when-converting-to-from-unicode">
-<h2><a class="toc-backref" href="#id5" name="use-memcpy-when-converting-to-from-unicode">Use <tt class="literal"><span class="pre">memcpy()</span></tt> when converting to/from Unicode</a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>The functions <tt class="literal"><span class="pre">uniToAsc()</span></tt> and <tt class="literal"><span class="pre">ascToUni()</span></tt> were using the relatively
-slow <tt class="literal"><span class="pre">strncpy()</span></tt> runtime library function.</dd>
-<dt>Fix:</dt>
-<dd>A new preprocessor macro <tt class="literal"><span class="pre">kUseMemcopy</span></tt> was added to <tt class="literal"><span class="pre">misc.c</span></tt>, and both
-functions were recoded to use <tt class="literal"><span class="pre">memcpy()</span></tt> when that macro is defined.
-Remove the definition to revert to the earlier code, using <tt class="literal"><span class="pre">strncpy()</span></tt>.</dd>
-</dl>
-</div>
-<div class="section" id="bug-when-using-utf-8-encoded-text-inside-asp-ejscript-blocks">
-<h2><a class="toc-backref" href="#id6" name="bug-when-using-utf-8-encoded-text-inside-asp-ejscript-blocks">Bug when using UTF-8 encoded text inside ASP/ejScript blocks</a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>When reading ASP code containing UTF-8 encoded source text, any characters
-encountered having a value > 127 were treated as an error by the parser.</dd>
-<dt>Fix:</dt>
-<dd>The ring queue code in <tt class="literal"><span class="pre">ringq.c</span></tt> was modified so that it can correctly
-handle any character it encounters by casting to unsigned char before
-casting back to signed integer.</dd>
-</dl>
-</div>
-<div class="section" id="wrong-error-code-on-invalid-password">
-<h2><a class="toc-backref" href="#id7" name="wrong-error-code-on-invalid-password">Wrong error code on invalid password</a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>The WebServer was sending back an inappropriate error code when it received
-an incorrect password.</dd>
-<dt>Fix:</dt>
-<dd>Changed error code returned from <tt class="literal"><span class="pre">405</span></tt> to <tt class="literal"><span class="pre">401</span></tt>. (Thanks to Jay
-Chalfant).</dd>
-</dl>
-</div>
-<div class="section" id="windows-ce-net">
-<h2><a class="toc-backref" href="#id8" name="windows-ce-net">Windows CE.NET</a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>Removed "compatibility functions" that are directly supported in Windows
-CE.NET.</dd>
-</dl>
-</div>
-<div class="section" id="lynx-makefile">
-<h2><a class="toc-backref" href="#id9" name="lynx-makefile">LYNX <tt class="literal"><span class="pre">Makefile</span></tt></a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>Corrected problem in LYNX Makefile that prevented OpenSSL from being linked
-in correctly.</dd>
-</dl>
-</div>
-</div>
-<div class="section" id="goahead-webserver-2-1-6-release-notes">
-<h1><a class="toc-backref" href="#id10" name="goahead-webserver-2-1-6-release-notes">GoAhead WebServer 2.1.6 Release Notes</a></h1>
-<dl>
-<dt>Release Date:</dt>
-<dd>25 Mar 2003</dd>
-</dl>
-<div class="section" id="null-pointer-crash-in-webssafeurl">
-<h2><a class="toc-backref" href="#id11" name="null-pointer-crash-in-webssafeurl"><tt class="literal"><span class="pre">NULL</span></tt> pointer crash in <tt class="literal"><span class="pre">websSafeUrl()</span></tt></a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>Passing a NULL pointer into the <tt class="literal"><span class="pre">websSafeUrl()</span></tt> function (as would happen
-when the server is processing an invalid URL) crashes the server.</dd>
-<dt>Fix:</dt>
-<dd>Code modified to check for NULL pointer before performing any string
-operations.</dd>
-</dl>
-</div>
-</div>
-<div class="section" id="goahead-webserver-2-1-5-release-notes">
-<h1><a class="toc-backref" href="#id12" name="goahead-webserver-2-1-5-release-notes">GoAhead WebServer 2.1.5 Release Notes</a></h1>
-<dl>
-<dt>Release Date:</dt>
-<dd>19 Mar 2003</dd>
-</dl>
-<div class="section" id="bopen-failure-mode">
-<h2><a class="toc-backref" href="#id13" name="bopen-failure-mode"><tt class="literal"><span class="pre">bopen()</span></tt> failure mode</a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>New failure behavior for <tt class="literal"><span class="pre">bopen()</span></tt> (see <tt class="literal"><span class="pre">balloc.c</span></tt>)</dd>
-<dt>Fix:</dt>
-<dd>Changed failure behavior of the bopen() function (suggested by Simon
-Byholm). If the malloc() request fails, we reset the bopenCount
-variable, and thus allow the client code to reattempt the open with
-a smaller memory request.</dd>
-</dl>
-</div>
-<div class="section" id="windows-95-98-me-aux-denial-of-service">
-<h2><a class="toc-backref" href="#id14" name="windows-95-98-me-aux-denial-of-service">Windows 95/98/ME <tt class="literal"><span class="pre">AUX</span></tt> Denial of Service</a></h2>
-<dl>
-<dt>Description:</dt>
-<dd><p class="first">When running on Windows 95/98/ME, URLs requested with path components
-matching a set of reserved DOS device names caused the WebServer to crash.</p>
-<p>The names that cause the crash are:</p>
-<pre class="last literal-block">
-aux
-con
-nul
-clock$
-config$
-</pre>
-</dd>
-<dt>Fix:</dt>
-<dd><p class="first">Code added to the <tt class="literal"><span class="pre">websValidateUrl()</span></tt> function to check the contents of
-the parsed URL against the list of prohibited names. If any of those names
-are present in the parsed URL, the URL is rejected as invalid.</p>
-<p>The code that checks for these prohibited pathname components checks for
-them in the form of either:</p>
-<pre class="literal-block">
-http://<<server address>>/aux
-</pre>
-<p>or:</p>
-<pre class="literal-block">
-http://<<server address>>/aux:
-</pre>
-<p class="last">where any non-alphanumeric character following one of the prohibited names
-will cause the URL request to be rejected.</p>
-</dd>
-</dl>
-</div>
-<div class="section" id="cross-site-scripting-exploit">
-<h2><a class="toc-backref" href="#id15" name="cross-site-scripting-exploit">404 Cross-site Scripting Exploit</a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>Malicious users could request an invalid URL containing embedded JavaScript
-code that would be executed in the user's browser.</dd>
-<dt>Fix:</dt>
-<dd>404 (and other error messages) returned by the WebServer no longer display
-the invalid URL.</dd>
-</dl>
-</div>
-<div class="section" id="long-url-overflow-crash">
-<h2><a class="toc-backref" href="#id16" name="long-url-overflow-crash">Long URL Overflow Crash</a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>URLs containing more than 64 levels of path components caused the WebServer
-to crash, entering a buffer overflow condition.</dd>
-<dt>Fix:</dt>
-<dd>The WebServer now keeps track of the depth as it validates the URL. URLs
-that are too long are now rejected with an error message.</dd>
-</dl>
-</div>
-<div class="section" id="incorrect-error-code-in-security-c">
-<h2><a class="toc-backref" href="#id17" name="incorrect-error-code-in-security-c">Incorrect Error Code in <tt class="literal"><span class="pre">security.c</span></tt></a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>Pages assigned an access level of <tt class="literal"><span class="pre">AM_NONE</span></tt> should return an error code
-of 404 instead of 400 when an attempt it made to access them.</dd>
-<dt>Fix:</dt>
-<dd>Error code corrected.</dd>
-</dl>
-</div>
-<div class="section" id="pragma-code-for-risc-architectures">
-<h2><a class="toc-backref" href="#id18" name="pragma-code-for-risc-architectures">Pragma Code for RISC Architectures</a></h2>
-<dl>
-<dt>Description:</dt>
-<dd>A pragma was not set correctly when compiling for SPARC machines.</dd>
-<dt>Fix:</dt>
-<dd><p class="first">Code added to <tt class="literal"><span class="pre">uemf.h</span></tt>:</p>
-<pre class="last literal-block">
-#ifdef sparc
-# define __NO_PACK
-#endif /* sparc */
-</pre>
-</dd>
-</dl>
-</div>
-</div>
-<div class="section" id="goahead-webserver-2-1-4-release-notes">
-<h1><a class="toc-backref" href="#id19" name="goahead-webserver-2-1-4-release-notes">GoAhead® WebServer 2.1.4 Release Notes</a></h1>
-<dl>
-<dt>Release Date:</dt>
-<dd>17 Oct 2002</dd>
-</dl>
-<div class="section" id="fixed-vulnerability-to-malicious-code-in-webs-c">
-<h2><a class="toc-backref" href="#id20" name="fixed-vulnerability-to-malicious-code-in-webs-c">Fixed vulnerability to malicious code in <tt class="literal"><span class="pre">webs.c</span></tt></a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>There were two vulnerabilities in <tt class="literal"><span class="pre">webs.c</span></tt>. Sending a POST message
-with a content-length but no data resulted in an attempt to perform
-a <tt class="literal"><span class="pre">strlen()</span></tt> on a NULL pointer (thanks to Richard Cullen). Also,
-sending an HTTP POST message with a Content-Length header indicating
-that the length of the posted data was less than zero would crash
-the server (thanks to Auriemma Luigi).</dd>
-<dt>Fix:</dt>
-<dd>Code errors corrected.</dd>
-</dl>
-</div>
-<div class="section" id="https-bug-in-security-handler">
-<h2><a class="toc-backref" href="#id21" name="https-bug-in-security-handler"><a class="reference" href="https://">https://</a> bug in security handler</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>The <tt class="literal"><span class="pre">websSecurityHandler()</span></tt> function was performing a logical
-OR: (<tt class="literal"><span class="pre">flags</span> <span class="pre">|</span> <span class="pre">WEBS_SECURE</span></tt>) instead of a logical AND (<tt class="literal"><span class="pre">flags</span> <span class="pre">&</span>
-<span class="pre">WEBS_SECURE</span></tt>), leading to incorrect results (thanks to "Dhanwa T").</dd>
-<dt>Fix:</dt>
-<dd>Code errors corrected.</dd>
-</dl>
-</div>
-<div class="section" id="fixed-vulnerability-to-malicious-code-in-sockgen-c">
-<h2><a class="toc-backref" href="#id22" name="fixed-vulnerability-to-malicious-code-in-sockgen-c">Fixed vulnerability to malicious code in sockGen.c</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>At line 613 of <tt class="literal"><span class="pre">sockGen.c</span></tt>, the return value of the function
-<tt class="literal"><span class="pre">socketInputBuffered()</span></tt> was being discarded, leading to incorrect
-behavior in some cases. (Thanks to Richard Cullen)</dd>
-<dt>Fix:</dt>
-<dd>Code errors corrected.</dd>
-</dl>
-</div>
-</div>
-<div class="section" id="bug-fixes-for-version-2-1-3">
-<h1><a class="toc-backref" href="#id23" name="bug-fixes-for-version-2-1-3">Bug Fixes for Version 2.1.3</a></h1>
-<div class="section" id="directory-traversal-exploit">
-<h2><a class="toc-backref" href="#id24" name="directory-traversal-exploit">Directory Traversal Exploit</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>Several sources have reported that requesting an URL with URL-encoded
-backslashes (%5C) allow accessing files located outside the server's
-designated web root. This should only have been possible on Windows, as
-URL-encoded forward slashes (%2F) were already being handled correctly.</dd>
-<dt>Fix:</dt>
-<dd>Modified <tt class="literal"><span class="pre">default.c</span></tt> so that any backslash characters created as
-part of decoding the URL string are converted (in place) to forward
-slashes. The pre-existing directory-traversal detection code then
-rejects the bad URL as expected.</dd>
-</dl>
-</div>
-<div class="section" id="mime-type-for-external-javascript-files">
-<h2><a class="toc-backref" href="#id25" name="mime-type-for-external-javascript-files">MIME type for external JavaScript files</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>The WebServer would not serve external JavaScript files (<tt class="literal"><span class="pre">*.js</span></tt>)
-correctly.</dd>
-<dt>Fix:</dt>
-<dd>modified <tt class="literal"><span class="pre">mime.c</span></tt> to associate <tt class="literal"><span class="pre">.js</span></tt> files with the MIME
-type <tt class="literal"><span class="pre">application/x-javascript</span></tt>.</dd>
-</dl>
-</div>
-<div class="section" id="bug-in-if-modified-since-parsing">
-<h2><a class="toc-backref" href="#id26" name="bug-in-if-modified-since-parsing">Bug in If-Modified-Since parsing</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>There was an off-by-one error when converting from Gregorian date to
-time_t.</dd>
-<dt>Fix:</dt>
-<dd>modified function <tt class="literal"><span class="pre">dateToTimet</span></tt> in file <tt class="literal"><span class="pre">webs.c</span></tt>. The <tt class="literal"><span class="pre">month</span></tt>
-parameter is numbered from 0 (Jan == 0), but <tt class="literal"><span class="pre">FixedFromGregorian()</span></tt>
-takes months numbered from 1 (January == 1). We need to add 1 to
-the month before calling FixedFromGregorian.</dd>
-</dl>
-</div>
-</div>
-<div class="section" id="bug-fixes-for-version-2-1-2">
-<h1><a class="toc-backref" href="#id27" name="bug-fixes-for-version-2-1-2">Bug Fixes for Version 2.1.2</a></h1>
-<div class="section" id="ejscript-error-messages">
-<h2><a class="toc-backref" href="#id28" name="ejscript-error-messages">Ejscript Error Messages</a></h2>
-<p>Summary:</p>
-<blockquote>
-Changed ejEval() function so it displays in the browser the error string that is
-reported by the ejScript interpreter (old code discarded it completely).</blockquote>
-<dl>
-<dt>Fix:</dt>
-<dd>modified <tt class="literal"><span class="pre">websuemf.c</span></tt></dd>
-</dl>
-</div>
-<div class="section" id="security-handler-response-codes">
-<h2><a class="toc-backref" href="#id29" name="security-handler-response-codes">Security Handler Response Codes</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>Several places in the <tt class="literal"><span class="pre">websSecurityHandler()</span></tt> function were
-returning error code 200 (success) instead of the correct 400-level error code.</dd>
-<dt>Fix:</dt>
-<dd>Corrected error codes in <tt class="literal"><span class="pre">security.c</span></tt></dd>
-</dl>
-</div>
-<div class="section" id="security-handler-memory-leak">
-<h2><a class="toc-backref" href="#id30" name="security-handler-memory-leak">Security Handler Memory Leak</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>In <tt class="literal"><span class="pre">websSecurityHandler()</span></tt>, if the WebServer was compiled with
-<tt class="literal"><span class="pre">WEBS_SSL_SUPPORT</span></tt> enabled, there was a return path that leaked
-memory.</dd>
-<dt>Fix:</dt>
-<dd>Added call to <tt class="literal"><span class="pre">bfree(B_L,</span> <span class="pre">accessLimit);</span></tt></dd>
-</dl>
-</div>
-<div class="section" id="ejscript-write-corruption">
-<h2><a class="toc-backref" href="#id31" name="ejscript-write-corruption">Ejscript Write Corruption</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>Very long text strings passed to the Ejscript <tt class="literal"><span class="pre">write()</span></tt> function
-were being corrupted before being displayed.</dd>
-<dt>Fix:</dt>
-<dd>Commented out a <tt class="literal"><span class="pre">trace()</span></tt> statement in <tt class="literal"><span class="pre">ejGetLexToken()</span></tt> that appears to have been the
-culprit. The value of <tt class="literal"><span class="pre">ep->token</span></tt> was being corrupted somewhere
-in the trace.</dd>
-</dl>
-</div>
-<div class="section" id="error-in-dsnprintf-x-format">
-<h2><a class="toc-backref" href="#id32" name="error-in-dsnprintf-x-format">Error in dsnprintf(): "%X" format</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>The "%X" format specifier did not correctly cause the function to output
-uppercase hexadecimal digits.</dd>
-<dt>Fix:</dt>
-<dd>Added support for the "%X" format specifier.</dd>
-</dl>
-</div>
-<div class="section" id="bug018565-re-fixed">
-<h2><a class="toc-backref" href="#id33" name="bug018565-re-fixed">BUG018565 Re-fixed</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>See 2.1.1 release notes (below). This bug fix did not make it into the
-2.1.1 release.</dd>
-<dt>Fix:</dt>
-<dd>Corrected code in <tt class="literal"><span class="pre">sockGen.c</span></tt>.</dd>
-</dl>
-</div>
-<div class="section" id="potential-error-in-error">
-<h2><a class="toc-backref" href="#id34" name="potential-error-in-error">Potential Error in <tt class="literal"><span class="pre">error()</span></tt></a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>If <tt class="literal"><span class="pre">error()</span></tt> is called where the etype parameter is not E_LOG, E_ASSERT,
-or E_USER, the call to <tt class="literal"><span class="pre">bfreeSafe(B_L,</span> <span class="pre">buf)</span></tt> now at line 71 will fail,
-because 'buf' is randomly initialized.</dd>
-<dt>Fix:</dt>
-<dd>We format a message saying that this is an unknown message type,
-and in doing so give buf a valid value.</dd>
-</dl>
-</div>
-<div class="section" id="added-support-for-customized-access-control">
-<h2><a class="toc-backref" href="#id35" name="added-support-for-customized-access-control">Added Support For Customized Access Control</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>Several users requested a method to control URL access in a hierarchical
-fashion. For example, users assigned to an 'admin' group might have
-access to all URLs on the WebServer, and users assigned to the group
-'technician' would have access to a smaller set of pages, and users
-assigned to the group 'users' would perhaps only have access to a set of
-read-only pages. The built-in WebServer access control system only
-allows users to access URLs that exactly match their group membership.</dd>
-<dt>Fix:</dt>
-<dd>Added call to a user-supplied function `` bool_t dmfCanAccess(const
-char_t* userGroup, const char_t* group)``. This function is called
-from inside <tt class="literal"><span class="pre">umUserCanAccessURL()</span></tt> if the macro
-<tt class="literal"><span class="pre">qHierarchicalAccess</span></tt> is defined.</dd>
-</dl>
-</div>
-<div class="section" id="memory-leak-in-websparserequest">
-<h2><a class="toc-backref" href="#id36" name="memory-leak-in-websparserequest">Memory Leak in websParseRequest()</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>Memory was being leaked in the code now at line 907 of <tt class="literal"><span class="pre">webs.c</span></tt>.</dd>
-<dt>Fix:</dt>
-<dd>Added a call to <tt class="literal"><span class="pre">bfree()</span></tt>.</dd>
-</dl>
-</div>
-</div>
-<div class="section" id="macintosh-os-x-support">
-<h1><a class="toc-backref" href="#id37" name="macintosh-os-x-support">Macintosh OS X Support</a></h1>
-<p>A separate Mac OS X platform directory has been added, and this platform
-has been tested on version 10.1.5 of the operating system.
-To build the WebServer on OS X:</p>
-<pre class="literal-block">
-cd MACOSX
-make
-</pre>
-<p>Note that like all *nix operating systems, only the root user has
-permission to open a server port with a lower number than 1024. You must
-run the WebServer as root to serve pages over port 80, or change the server
-port (in <tt class="literal"><span class="pre">main.c</span></tt>) to a different port (typically port 8080).</p>
-</div>
-<div class="section" id="bug-fixes-for-version-2-1-1">
-<h1><a class="toc-backref" href="#id38" name="bug-fixes-for-version-2-1-1">Bug Fixes for Version 2.1.1</a></h1>
-<div class="section" id="intermittent-access-error-for-cgi-scripts-bug01937">
-<h2><a class="toc-backref" href="#id39" name="intermittent-access-error-for-cgi-scripts-bug01937">Intermittent Access Error for CGI Scripts (BUG01937)</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>Pages were occasionally replaced with the message, <tt class="literal"><span class="pre">Access</span> <span class="pre">Error:</span> <span class="pre">Data</span>
-<span class="pre">follows</span> <span class="pre">when</span> <span class="pre">trying</span> <span class="pre">to</span> <span class="pre">obtain</span> <span class="pre">CGI</span> <span class="pre">generated</span> <span class="pre">no</span> <span class="pre">output</span></tt>.</dd>
-<dt>Fix:</dt>
-<dd>On multiple CPU systems, it is possible for a CGI application to exit before
-its output is flushed to disk. The change for this release locates the code
-that collects the output from the CGI application in a separate routine.
-In addition to calling that routine from within the CGI application processing
-loop, it is also called in a brief loop after the CGI application has exited.
-This extra loop runs for only up to one second while the collected output
-remains empty. If, after 1 second, the output remains empty, the original
-course of action is followed (<tt class="literal"><span class="pre">Access</span> <span class="pre">Error</span></tt> is reported).</dd>
-</dl>
-</div>
-<div class="section" id="cpu-utilization-hangs-at-100-on-a-socket-disconnect-bug01865">
-<h2><a class="toc-backref" href="#id40" name="cpu-utilization-hangs-at-100-on-a-socket-disconnect-bug01865">CPU Utilization Hangs at 100% on a Socket Disconnect (BUG01865)</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>This error occurs whenever a user terminates a request before the server
-has had ample time to service it. This can be simulated by quickly hitting
-the refresh button on the browser twice in a row, causing the first request
-to be terminated. The server then enters into a tight loop that utilizes
-all of its time.</dd>
-<dt>Fix:</dt>
-<dd>Always close the socket prior to a disconnect.</dd>
-</dl>
-</div>
-<div class="section" id="security-features-can-be-bypassed-by-adding-an-extra-slash-in-the-url-bug01518">
-<h2><a class="toc-backref" href="#id41" name="security-features-can-be-bypassed-by-adding-an-extra-slash-in-the-url-bug01518">Security Features can be Bypassed by Adding an Extra Slash in the URL (BUG01518)</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>By adding an extra slash in a URL, password prompting is bypassed, allowing
-unrestricted access to secured pages.</dd>
-<dt>Fix:</dt>
-<dd>Remove multiple adjacent occurrences of slashes in the URL before passing
-it to the security handler.</dd>
-</dl>
-</div>
-<div class="section" id="call-to-webssetvar-causes-a-crash-bug01938">
-<h2><a class="toc-backref" href="#id42" name="call-to-webssetvar-causes-a-crash-bug01938">Call to <tt class="literal"><span class="pre">websSetVar</span></tt> causes a crash (BUG01938)</a></h2>
-<dl>
-<dt>Summary:</dt>
-<dd>Whenever a request is not completed while being processed by websGetInput(),
-a call to websDone is made, followed by an attempt to process the partial
-request data.</dd>
-<dt>Fix:</dt>
-<dd>Return immediately after closing the socket.</dd>
-</dl>
-</div>
-<div class="section" id="remove-stray-semicolon-in-emfdb-c-bug01820">
-<h2><a class="toc-backref" href="#id43" name="remove-stray-semicolon-in-emfdb-c-bug01820">Remove stray semicolon in <tt class="literal"><span class="pre">emfdb.c</span></tt> (BUG01820)</a></h2>
-<dl>
-<dt>Summary and Fix:</dt>
-<dd>A stray semicolon was removed from this file.</dd>
-</dl>
-</div>
-</div>
-<div class="section" id="novell-netware-support">
-<h1><a class="toc-backref" href="#id44" name="novell-netware-support">Novell Netware Support</a></h1>
-<p>With the addition of Novell Netware in this 2.11 release, WebServer now supports these platforms:</p>
-<blockquote>
-<ul class="simple">
-<li>LINUX</li>
-<li>LynxOS</li>
-<li>Novell Netware </font>4.2, 5.1</li>
-<li>Mac OS X</li>
-<li>UNIX - SCO OpenServer 3.2V5.0.0</li>
-<li>VxWorks 5.3.1</li>
-<li>Windows 2000</li>
-<li>Windows 98</li>
-<li>Windows 95</li>
-<li>Windows NT</li>
-<li>Windows CE</li>
-</ul>
-</blockquote>
-<p>To make a Novell Netware target file (<tt class="literal"><span class="pre">webs.nlm</span></tt>):</p>
-<pre class="literal-block">
-cd NW
-wmake webs.nlm
-load <path>; \webs.nlm
-webs
-</pre>
-<p><strong>Note:</strong> This makefile lacks a valid default rule. In addition, an
-environment variable (QMKVER) controls the amount of debug information
-that is compiled and linked into the nlm file. If this variable is set
-to <tt class="literal"><span class="pre">P</span></tt>, it produces a production version. All other settings
-(or the omission of the variable) results in a debug version. For other
-platforms supported by WebServer, please refer to your WebServer 2.1
-documentation for appropriate instructions.</p>
-</div>
-<div class="section" id="copyright-information">
-<h1><a class="toc-backref" href="#id45" name="copyright-information">Copyright Information</a></h1>
-<dl>
-<dt>Trademarks</dt>
-<dd>GoAhead and GoAhead WebServer are registered trademarks of GoAhead
-Software. All other brand or product names are the trademarks or
-registered trademarks of their respective holders.</dd>
-<dt>Copyright </dt>
-<dd>Copyright © 2000, 2001 GoAhead Software, Inc. All rights reserved.
-Product and technical information in this document is subject to
-change without notice and does not represent a commitment on the part
-of GoAhead Software, Inc.</dd>
-<dt>Copy Restrictions </dt>
-<dd>The software described in this document may be used and copied only
-in accordance with the terms of the accompanying license agreement.</dd>
-<dt>GoAhead Software, Inc.</dt>
-<dd>10900 NE 8th Street Suite 750 Bellevue, WA 98004 +1 ( 425) 453-1900
-www.goahead.com <a class="reference" href="mailto:info@goahead.com">info@goahead.com</a></dd>
-</dl>
-<p>1-53-03</p>
-</div>
-</div>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/release.txt b/xbmc/lib/libGoAhead/release.txt deleted file mode 100644 index 6add339b81..0000000000 --- a/xbmc/lib/libGoAhead/release.txt +++ /dev/null @@ -1,594 +0,0 @@ -=====================================
-GoAhead WebServer 2.1.7 Release Notes
-=====================================
-
-.. NOTES:
-.. This document is maintained using the reStructuredText markup system.
-.. You may download this from <http://docutils.sf.net>. Also note that running
-.. the docutils code requires that a version of Python version 2.1 or later
-.. be installed on the machine. Since the GoAhead release procedure itself
-.. runs in Python, this should not be a problem.
-..
-.. To add new entries to the release notes, follow the markup shown below
-.. (releases should be underlined with a row of '=' characters, each item
-.. noted within a release should be underlined with '-' characters.
-
-
-.. contents::
-
-GoAhead WebServer 2.1.7 Release Notes
-=====================================
-
-Release Date:
- 01 Oct 2003
-
-Added support for the Mocana SSL Toolkit
-----------------------------------------
-
-Description:
- Added support for Mocana Corporation's embedded SSL server
-
-Changes to ``dbSearchString()``
--------------------------------
-
-Description:
-
- Pass ``DB_CASE_INSENSITIVE`` as the "flags" argument to
- dbSearchString() to force a case-insensitive search.
-
-
-Use ``memcpy()`` when converting to/from Unicode
-------------------------------------------------
-Description:
- The functions ``uniToAsc()`` and ``ascToUni()`` were using the relatively
- slow ``strncpy()`` runtime library function.
-
-Fix:
- A new preprocessor macro ``kUseMemcopy`` was added to ``misc.c``, and both
- functions were recoded to use ``memcpy()`` when that macro is defined.
- Remove the definition to revert to the earlier code, using ``strncpy()``.
-
-
-Bug when using UTF-8 encoded text inside ASP/ejScript blocks
----------------------------------------------------------------
-
-Description:
- When reading ASP code containing UTF-8 encoded source text, any characters
- encountered having a value > 127 were treated as an error by the parser.
-
-Fix:
- The ring queue code in ``ringq.c`` was modified so that it can correctly
- handle any character it encounters by casting to unsigned char before
- casting back to signed integer.
-
-Wrong error code on invalid password
-------------------------------------
-
-Description:
- The WebServer was sending back an inappropriate error code when it received
- an incorrect password.
-
-Fix:
- Changed error code returned from ``405`` to ``401``. (Thanks to Jay
- Chalfant).
-
-Windows CE.NET
------------------
-
-Description:
- Removed "compatibility functions" that are directly supported in Windows
- CE.NET.
-
-LYNX ``Makefile``
------------------
-
-Description:
- Corrected problem in LYNX Makefile that prevented OpenSSL from being linked
- in correctly.
-
-GoAhead WebServer 2.1.6 Release Notes
-=====================================
-Release Date:
- 25 Mar 2003
-
-``NULL`` pointer crash in ``websSafeUrl()``
--------------------------------------------
-
-Description:
- Passing a NULL pointer into the ``websSafeUrl()`` function (as would happen
- when the server is processing an invalid URL) crashes the server.
-
-Fix:
- Code modified to check for NULL pointer before performing any string
- operations.
-
-
-GoAhead WebServer 2.1.5 Release Notes
-=====================================
-Release Date:
- 19 Mar 2003
-
-
-
-``bopen()`` failure mode
-------------------------
-
-
-
-Description:
- New failure behavior for ``bopen()`` (see ``balloc.c``)
-
-Fix:
- Changed failure behavior of the bopen() function (suggested by Simon
- Byholm). If the malloc() request fails, we reset the bopenCount
- variable, and thus allow the client code to reattempt the open with
- a smaller memory request.
-
-
-Windows 95/98/ME ``AUX`` Denial of Service
-------------------------------------------
-
-
-
-Description:
- When running on Windows 95/98/ME, URLs requested with path components
- matching a set of reserved DOS device names caused the WebServer to crash.
-
- The names that cause the crash are::
-
- aux
- con
- nul
- clock$
- config$
-
-
-
-
-Fix:
- Code added to the ``websValidateUrl()`` function to check the contents of
- the parsed URL against the list of prohibited names. If any of those names
- are present in the parsed URL, the URL is rejected as invalid.
-
- The code that checks for these prohibited pathname components checks for
- them in the form of either::
-
- http://<<server address>>/aux
-
- or::
-
- http://<<server address>>/aux:
-
- where any non-alphanumeric character following one of the prohibited names
- will cause the URL request to be rejected.
-
-
-404 Cross-site Scripting Exploit
------------------------------------
-
-
-Description:
- Malicious users could request an invalid URL containing embedded JavaScript
- code that would be executed in the user's browser.
-
-Fix:
- 404 (and other error messages) returned by the WebServer no longer display
- the invalid URL.
-
-Long URL Overflow Crash
------------------------
-
-
-Description:
- URLs containing more than 64 levels of path components caused the WebServer
- to crash, entering a buffer overflow condition.
-
-Fix:
- The WebServer now keeps track of the depth as it validates the URL. URLs
- that are too long are now rejected with an error message.
-
-Incorrect Error Code in ``security.c``
---------------------------------------
-
-
-Description:
- Pages assigned an access level of ``AM_NONE`` should return an error code
- of 404 instead of 400 when an attempt it made to access them.
-
-Fix:
- Error code corrected.
-
-Pragma Code for RISC Architectures
--------------------------------------
-
-
-Description:
- A pragma was not set correctly when compiling for SPARC machines.
-
-Fix:
- Code added to ``uemf.h``::
-
- #ifdef sparc
- # define __NO_PACK
- #endif /* sparc */
-
-
-
-
-
-GoAhead® WebServer 2.1.4 Release Notes
-=======================================
-
-Release Date:
- 17 Oct 2002
-
-
-
-
-Fixed vulnerability to malicious code in ``webs.c``
----------------------------------------------------
-
-
-
-Summary:
- There were two vulnerabilities in ``webs.c``. Sending a POST message
- with a content-length but no data resulted in an attempt to perform
- a ``strlen()`` on a NULL pointer (thanks to Richard Cullen). Also,
- sending an HTTP POST message with a Content-Length header indicating
- that the length of the posted data was less than zero would crash
- the server (thanks to Auriemma Luigi).
-
-Fix:
- Code errors corrected.
-
-
-
-https:// bug in security handler
---------------------------------
-
-
-Summary:
- The ``websSecurityHandler()`` function was performing a logical
- OR: (``flags | WEBS_SECURE``) instead of a logical AND (``flags &
- WEBS_SECURE``), leading to incorrect results (thanks to "Dhanwa T").
-
-Fix:
- Code errors corrected.
-
-
-
-Fixed vulnerability to malicious code in sockGen.c
---------------------------------------------------
-
-
-Summary:
- At line 613 of ``sockGen.c``, the return value of the function
- ``socketInputBuffered()`` was being discarded, leading to incorrect
- behavior in some cases. (Thanks to Richard Cullen)
-
-Fix:
- Code errors corrected.
-
-
-Bug Fixes for Version 2.1.3
-===========================
-
-
-Directory Traversal Exploit
-----------------------------
-
-
-Summary:
- Several sources have reported that requesting an URL with URL-encoded
- backslashes (%5C) allow accessing files located outside the server's
- designated web root. This should only have been possible on Windows, as
- URL-encoded forward slashes (%2F) were already being handled correctly.
-
-Fix:
- Modified ``default.c`` so that any backslash characters created as
- part of decoding the URL string are converted (in place) to forward
- slashes. The pre-existing directory-traversal detection code then
- rejects the bad URL as expected.
-
-
-MIME type for external JavaScript files
-----------------------------------------
-
-
-Summary:
- The WebServer would not serve external JavaScript files (``*.js``)
- correctly.
-
-
-Fix:
- modified ``mime.c`` to associate ``.js`` files with the MIME
- type ``application/x-javascript``.
-
-
-Bug in If-Modified-Since parsing
---------------------------------
-
-
-Summary:
- There was an off-by-one error when converting from Gregorian date to
- time_t.
-
-Fix:
- modified function ``dateToTimet`` in file ``webs.c``. The ``month``
- parameter is numbered from 0 (Jan == 0), but ``FixedFromGregorian()``
- takes months numbered from 1 (January == 1). We need to add 1 to
- the month before calling FixedFromGregorian.
-
-
-
-
-Bug Fixes for Version 2.1.2
-============================
-
-
-Ejscript Error Messages
-------------------------
-
-
-Summary:
-
- Changed ejEval() function so it displays in the browser the error string that is
- reported by the ejScript interpreter (old code discarded it completely).
-
-Fix:
- modified ``websuemf.c``
-
-
-Security Handler Response Codes
---------------------------------
-
-
-Summary:
- Several places in the ``websSecurityHandler()`` function were
- returning error code 200 (success) instead of the correct 400-level error code.
-Fix:
- Corrected error codes in ``security.c``
-
-Security Handler Memory Leak
------------------------------
-
-
-Summary:
- In ``websSecurityHandler()``, if the WebServer was compiled with
- ``WEBS_SSL_SUPPORT`` enabled, there was a return path that leaked
- memory.
-
-Fix:
- Added call to ``bfree(B_L, accessLimit);``
-
-Ejscript Write Corruption
---------------------------
-
-
-Summary:
- Very long text strings passed to the Ejscript ``write()`` function
- were being corrupted before being displayed.
-
-Fix:
- Commented out a ``trace()`` statement in ``ejGetLexToken()`` that appears to have been the
- culprit. The value of ``ep->token`` was being corrupted somewhere
- in the trace.
-
-Error in dsnprintf(): "%X" format
-----------------------------------
-
-
-Summary:
- The "%X" format specifier did not correctly cause the function to output
- uppercase hexadecimal digits.
-
-Fix:
- Added support for the "%X" format specifier.
-
-BUG018565 Re-fixed
--------------------
-
-
-Summary:
- See 2.1.1 release notes (below). This bug fix did not make it into the
- 2.1.1 release.
-
-Fix:
- Corrected code in ``sockGen.c``.
-
-Potential Error in ``error()``
--------------------------------
-
-
-
-Summary:
- If ``error()`` is called where the etype parameter is not E_LOG, E_ASSERT,
- or E_USER, the call to ``bfreeSafe(B_L, buf)`` now at line 71 will fail,
- because 'buf' is randomly initialized.
-
-Fix:
- We format a message saying that this is an unknown message type,
- and in doing so give buf a valid value.
-
-
-Added Support For Customized Access Control
---------------------------------------------
-
-
-Summary:
- Several users requested a method to control URL access in a hierarchical
- fashion. For example, users assigned to an 'admin' group might have
- access to all URLs on the WebServer, and users assigned to the group
- 'technician' would have access to a smaller set of pages, and users
- assigned to the group 'users' would perhaps only have access to a set of
- read-only pages. The built-in WebServer access control system only
- allows users to access URLs that exactly match their group membership.
-
-Fix:
- Added call to a user-supplied function `` bool_t dmfCanAccess(const
- char_t* userGroup, const char_t* group)``. This function is called
- from inside ``umUserCanAccessURL()`` if the macro
- ``qHierarchicalAccess`` is defined.
-
-
-
-Memory Leak in websParseRequest()
-----------------------------------
-
-
-Summary:
- Memory was being leaked in the code now at line 907 of ``webs.c``.
-
-Fix:
- Added a call to ``bfree()``.
-
-Macintosh OS X Support
-========================
-
-
-A separate Mac OS X platform directory has been added, and this platform
-has been tested on version 10.1.5 of the operating system.
-To build the WebServer on OS X::
-
- cd MACOSX
- make
-
-
-Note that like all \*nix operating systems, only the root user has
-permission to open a server port with a lower number than 1024. You must
-run the WebServer as root to serve pages over port 80, or change the server
-port (in ``main.c``) to a different port (typically port 8080).
-
-
-
-
-Bug Fixes for Version 2.1.1
-===========================
-
-Intermittent Access Error for CGI Scripts (BUG01937)
-----------------------------------------------------
-
-
-Summary:
- Pages were occasionally replaced with the message, ``Access Error: Data
- follows when trying to obtain CGI generated no output``.
-Fix:
- On multiple CPU systems, it is possible for a CGI application to exit before
- its output is flushed to disk. The change for this release locates the code
- that collects the output from the CGI application in a separate routine.
- In addition to calling that routine from within the CGI application processing
- loop, it is also called in a brief loop after the CGI application has exited.
- This extra loop runs for only up to one second while the collected output
- remains empty. If, after 1 second, the output remains empty, the original
- course of action is followed (``Access Error`` is reported).
-
-
-CPU Utilization Hangs at 100% on a Socket Disconnect (BUG01865)
----------------------------------------------------------------
-
-
-Summary:
- This error occurs whenever a user terminates a request before the server
- has had ample time to service it. This can be simulated by quickly hitting
- the refresh button on the browser twice in a row, causing the first request
- to be terminated. The server then enters into a tight loop that utilizes
- all of its time.
-
-Fix:
- Always close the socket prior to a disconnect.
-
-
-Security Features can be Bypassed by Adding an Extra Slash in the URL (BUG01518)
---------------------------------------------------------------------------------
-
-
-Summary:
- By adding an extra slash in a URL, password prompting is bypassed, allowing
- unrestricted access to secured pages.
-
-Fix:
- Remove multiple adjacent occurrences of slashes in the URL before passing
- it to the security handler.
-
-
-Call to ``websSetVar`` causes a crash (BUG01938)
-------------------------------------------------
-
-
-
-Summary:
- Whenever a request is not completed while being processed by websGetInput(),
- a call to websDone is made, followed by an attempt to process the partial
- request data.
-
-Fix:
- Return immediately after closing the socket.
-
-
-Remove stray semicolon in ``emfdb.c`` (BUG01820)
-------------------------------------------------
-
-
-Summary and Fix:
- A stray semicolon was removed from this file.
-
-Novell Netware Support
-======================
-
-
-With the addition of Novell Netware in this 2.11 release, WebServer now supports these platforms:
-
- * LINUX
- * LynxOS
- * Novell Netware </font>4.2, 5.1
- * Mac OS X
- * UNIX - SCO OpenServer 3.2V5.0.0
- * VxWorks 5.3.1
- * Windows 2000
- * Windows 98
- * Windows 95
- * Windows NT
- * Windows CE
-
-To make a Novell Netware target file (``webs.nlm``)::
-
- cd NW
- wmake webs.nlm
- load <path>; \webs.nlm
- webs
-
-
-**Note:** This makefile lacks a valid default rule. In addition, an
-environment variable (QMKVER) controls the amount of debug information
-that is compiled and linked into the nlm file. If this variable is set
-to ``P``, it produces a production version. All other settings
-(or the omission of the variable) results in a debug version. For other
-platforms supported by WebServer, please refer to your WebServer 2.1
-documentation for appropriate instructions.
-
-Copyright Information
-=====================
-
-
-Trademarks
- GoAhead and GoAhead WebServer are registered trademarks of GoAhead
- Software. All other brand or product names are the trademarks or
- registered trademarks of their respective holders.
-
-Copyright
- Copyright © 2000, 2001 GoAhead Software, Inc. All rights reserved.
- Product and technical information in this document is subject to
- change without notice and does not represent a commitment on the part
- of GoAhead Software, Inc.
-
-Copy Restrictions
- The software described in this document may be used and copied only
- in accordance with the terms of the accompanying license agreement.
-
-
-GoAhead Software, Inc.
- 10900 NE 8th Street Suite 750 Bellevue, WA 98004 +1 ( 425) 453-1900
- www.goahead.com info@goahead.com
-
-1-53-03
-
diff --git a/xbmc/lib/libGoAhead/src/asp.c b/xbmc/lib/libGoAhead/src/asp.c deleted file mode 100644 index 3fd810fdd2..0000000000 --- a/xbmc/lib/libGoAhead/src/asp.c +++ /dev/null @@ -1,335 +0,0 @@ -/*
- * asp.c -- Active Server Page Support
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: asp.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * The ASP module processes ASP pages and executes embedded scripts. It
- * support an open scripting architecture with in-built support for
- * Ejscript(TM).
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-
-/********************************** Locals ************************************/
-
-static sym_fd_t websAspFunctions = -1; /* Symbol table of functions */
-static int aspOpenCount = 0; /* count of apps using this module */
-
-/***************************** Forward Declarations ***************************/
-
-static char_t *strtokcmp(char_t *s1, char_t *s2);
-static char_t *skipWhite(char_t *s);
-
-/************************************* Code ***********************************/
-/*
- * Create script spaces and commands
- */
-
-int websAspOpen()
-{
- if (++aspOpenCount == 1) {
-/*
- * Create the table for ASP functions
- */
- websAspFunctions = symOpen(WEBS_SYM_INIT * 2);
-
-/*
- * Create standard ASP commands
- */
- websAspDefine(T("write"), websAspWrite);
- websAspDefine(T("isset"), websAspIsSet);
- }
- return 0;
-}
-
-/************************************* Code ***********************************/
-/*
- * Close Asp symbol table.
- */
-
-void websAspClose()
-{
- if (--aspOpenCount <= 0) {
- if (websAspFunctions != -1) {
- symClose(websAspFunctions);
- websAspFunctions = -1;
- }
- }
-}
-
-/******************************************************************************/
-/*
- * Process ASP requests and expand all scripting commands. We read the
- * entire ASP page into memory and then process. If you have really big
- * documents, it is better to make them plain HTML files rather than ASPs.
- */
-
-int websAspRequest(webs_t wp, char_t *lpath)
-{
- websStatType sbuf;
- char *rbuf;
- char_t *token, *lang, *result, *path, *ep, *cp, *buf, *nextp;
- char_t *last;
- int rc, engine, len, ejid;
-
- a_assert(websValid(wp));
- a_assert(lpath && *lpath);
-
- rc = -1;
- buf = NULL;
- rbuf = NULL;
- engine = EMF_SCRIPT_EJSCRIPT;
- wp->flags |= WEBS_HEADER_DONE;
- path = websGetRequestPath(wp);
-
-/*
- * Create Ejscript instance in case it is needed
- */
- ejid = ejOpenEngine(wp->cgiVars, websAspFunctions);
- if (ejid < 0) {
- websError(wp, 200, T("Can't create Ejscript engine"));
- goto done;
- }
- ejSetUserHandle(ejid, wp);
-
- if (websPageStat(wp, lpath, path, &sbuf) < 0) {
- websError(wp, 200, T("Can't stat %s"), lpath);
- goto done;
- }
-
-/*
- * Create a buffer to hold the ASP file in-memory
- */
- len = sbuf.size * sizeof(char);
- if ((rbuf = balloc(B_L, len + 1)) == NULL) {
- websError(wp, 200, T("Can't get memory"));
- goto done;
- }
- rbuf[len] = '\0';
-
- if (websPageReadData(wp, rbuf, len) != len) {
- websError(wp, 200, T("Cant read %s"), lpath);
- goto done;
- }
- websPageClose(wp);
-
-/*
- * Convert to UNICODE if necessary.
- */
- if ((buf = ballocAscToUni(rbuf, len)) == NULL) {
- websError(wp, 200, T("Can't get memory"));
- goto done;
- }
-
-/*
- * Scan for the next "<%"
- */
- last = buf;
- rc = 0;
- while (rc == 0 && *last && ((nextp = gstrstr(last, T("<%"))) != NULL)) {
- websWriteBlock(wp, last, (nextp - last));
- nextp = skipWhite(nextp + 2);
-
-/*
- * Decode the language
- */
- token = T("language");
-
- if ((lang = strtokcmp(nextp, token)) != NULL) {
- if ((cp = strtokcmp(lang, T("=javascript"))) != NULL) {
- engine = EMF_SCRIPT_EJSCRIPT;
- } else {
- cp = nextp;
- }
- nextp = cp;
- }
-
-/*
- * Find tailing bracket and then evaluate the script
- */
- if ((ep = gstrstr(nextp, T("%>"))) != NULL) {
-
- *ep = '\0';
- last = ep + 2;
- nextp = skipWhite(nextp);
-/*
- * Handle backquoted newlines
- */
- for (cp = nextp; *cp; ) {
- if (*cp == '\\' && (cp[1] == '\r' || cp[1] == '\n')) {
- *cp++ = ' ';
- while (*cp == '\r' || *cp == '\n') {
- *cp++ = ' ';
- }
- } else {
- cp++;
- }
- }
-
-/*
- * Now call the relevant script engine. Output is done directly
- * by the ASP script procedure by calling websWrite()
- */
- if (*nextp) {
- result = NULL;
- if (engine == EMF_SCRIPT_EJSCRIPT) {
- rc = scriptEval(engine, nextp, &result, (void*) ejid);
- } else {
- rc = scriptEval(engine, nextp, &result, wp);
- }
- if (rc < 0) {
-/*
- * On an error, discard all output accumulated so far
- * and store the error in the result buffer. Be careful if the
- * user has called websError() already.
- */
- if (websValid(wp)) {
- if (result) {
- websWrite(wp, T("<h2><b>ASP Error: %s</b></h2>\n"),
- result);
- websWrite(wp, T("<pre>%s</pre>"), nextp);
- bfree(B_L, result);
- } else {
- websWrite(wp, T("<h2><b>ASP Error</b></h2>\n%s\n"),
- nextp);
- }
- websWrite(wp, T("</body></html>\n"));
- rc = 0;
- }
- goto done;
- }
- }
-
- } else {
- websError(wp, 200, T("Unterminated script in %s: \n"), lpath);
- rc = -1;
- goto done;
- }
- }
-/*
- * Output any trailing HTML page text
- */
- if (last && *last && rc == 0) {
- websWriteBlock(wp, last, gstrlen(last));
- }
- rc = 0;
-
-/*
- * Common exit and cleanup
- */
-done:
- if (websValid(wp)) {
- websPageClose(wp);
- if (ejid >= 0) {
- ejCloseEngine(ejid);
- }
- }
- bfreeSafe(B_L, buf);
- bfreeSafe(B_L, rbuf);
- return rc;
-}
-
-/******************************************************************************/
-/*
- * Define an ASP Ejscript function. Bind an ASP name to a C procedure.
- */
-
-int websAspDefine(char_t *name,
- int (*fn)(int ejid, webs_t wp, int argc, char_t **argv))
-{
- return ejSetGlobalFunctionDirect(websAspFunctions, name,
- (int (*)(int, void*, int, char_t**)) fn);
-}
-
-/******************************************************************************/
-/*
- * Asp write command. This implemements <% write("text"); %> command
- */
-
-int websAspWrite(int ejid, webs_t wp, int argc, char_t **argv)
-{
- int i;
-
- a_assert(websValid(wp));
-
- for (i = 0; i < argc; ) {
- a_assert(argv);
- if (websWriteBlock(wp, argv[i], gstrlen(argv[i])) < 0) {
- return -1;
- }
- if (++i < argc) {
- if (websWriteBlock(wp, T(" "), 2) < 0) {
- return -1;
- }
- }
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Asp isset command. This implemements <% isset("text"); %> command
- */
-
-int websAspIsSet(int ejid, webs_t wp, int argc, char_t **argv)
-{
- if (argc != 1) return -1;
- ejSetResult( ejid, websGetVar(wp, argv[0], NULL) ? "1" : "0");
- return 0;
-}
-
-/******************************************************************************/
-/*
- * strtokcmp -- Find s2 in s1. We skip leading white space in s1.
- * Return a pointer to the location in s1 after s2 ends.
- */
-
-static char_t *strtokcmp(char_t *s1, char_t *s2)
-{
- int len;
-
- s1 = skipWhite(s1);
- len = gstrlen(s2);
- for (len = gstrlen(s2); len > 0 && (tolower(*s1) == tolower(*s2)); len--) {
- if (*s2 == '\0') {
- return s1;
- }
- s1++;
- s2++;
- }
- if (len == 0) {
- return s1;
- }
- return NULL;
-}
-
-/******************************************************************************/
-/*
- * Skip white space
- */
-
-static char_t *skipWhite(char_t *s)
-{
- a_assert(s);
-
- if (s == NULL) {
- return s;
- }
- while (*s && gisspace(*s)) {
- s++;
- }
- return s;
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/balloc.c b/xbmc/lib/libGoAhead/src/balloc.c deleted file mode 100644 index afebd3b2cc..0000000000 --- a/xbmc/lib/libGoAhead/src/balloc.c +++ /dev/null @@ -1,974 +0,0 @@ -/*
- * balloc.c -- Block allocation module
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: balloc.c,v 1.4 2002/12/02 15:34:19 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module implements a very fast block allocation scheme suitable for
- * ROMed environments. It maintains block class queues for rapid allocation
- * and minimal fragmentation. This module does not coalesce blocks. The
- * storage space may be populated statically or via the traditional malloc
- * mechanisms. Large blocks greater than the maximum class size may be
- * allocated from the O/S or run-time system via malloc. To permit the use
- * of malloc, call bopen with flags set to B_USE_MALLOC (this is the default).
- * It is recommended that bopen be called first thing in the application.
- * If it is not, it will be called with default values on the first call to
- * balloc(). Note that this code is not designed for multi-threading purposes
- * and it depends on newly declared variables being initialized to zero.
- */
-
-/********************************* Includes ***********************************/
-
-#define IN_BALLOC
-
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include "basic/basicInternal.h"
-#endif
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-#ifndef NO_BALLOC
-/********************************* Defines ************************************/
-
-/*
- * Define B_STATS if you wish to track memory block and stack usage
- */
-#ifdef B_STATS
-/*
- * Optional statistics
- */
-
-typedef struct {
- long alloc; /* Block allocation calls */
- long inuse; /* Blocks in use */
-} bStatsType;
-
-typedef struct {
- char_t file[FNAMESIZE];
- long allocated; /* Bytes currently allocated */
- long count; /* Current block count */
- long times; /* Count of alloc attempts */
- long largest; /* largest allocated here */
- int q;
-} bStatsFileType;
-
-/*
- * This one is very expensive but great stats
- */
-typedef struct {
- void *ptr; /* Pointer to memory */
- bStatsFileType *who; /* Who allocated the memory */
-} bStatsBlkType;
-
-static bStatsType bStats[B_MAX_CLASS]; /* Per class stats */
-static bStatsFileType bStatsFiles[B_MAX_FILES];/* Per file stats */
-static bStatsBlkType bStatsBlks[B_MAX_BLOCKS];/* Per block stats */
-static int bStatsBlksMax = 0; /* Max block entry */
-static int bStatsFilesMax = 0; /* Max file entry */
-static int bStatsMemInUse = 0; /* Memory currently in use */
-static int bStatsBallocInUse = 0; /* Memory currently balloced */
-static int bStatsMemMax = 0; /* Max memory ever used */
-static int bStatsBallocMax = 0; /* Max memory ever balloced */
-static void *bStackMin = (void*) -1;/* Miniumum stack position */
-static void *bStackStart; /* Starting stack position */
-static int bStatsMemMalloc = 0; /* Malloced memory */
-#endif /* B_STATS */
-
-/*
- * ROUNDUP4(size) returns the next higher integer value of size that is
- * divisible by 4, or the value of size if size is divisible by 4.
- * ROUNDUP4() is used in aligning memory allocations on 4-byte boundaries.
- *
- * Note: ROUNDUP4() is only required on some operating systems (IRIX).
- */
-
-#define ROUNDUP4(size) ((size) % 4) ? (size) + (4 - ((size) % 4)) : (size)
-
-/********************************** Locals ************************************/
-/*
- * bQhead blocks are created as the original memory allocation is freed up.
- * See bfree.
- */
-static bType *bQhead[B_MAX_CLASS]; /* Per class block q head */
-static char *bFreeBuf; /* Pointer to free memory */
-static char *bFreeNext; /* Pointer to next free mem */
-static int bFreeSize; /* Size of free memory */
-static int bFreeLeft; /* Size of free left for use */
-static int bFlags = B_USE_MALLOC; /* Default to auto-malloc */
-static int bopenCount = 0; /* Num tasks using balloc */
-
-/*************************** Forward Declarations *****************************/
-
-#ifdef B_STATS
-static void bStatsAlloc(B_ARGS_DEC, void *ptr, int q, int size);
-static void bStatsFree(B_ARGS_DEC, void *ptr, int q, int size);
-static void bstatsWrite(int handle, char_t *fmt, ...);
-static int bStatsFileSort(const void *cp1, const void *cp2);
-#endif /* B_STATS */
-
-#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
-static void bFillBlock(void *buf, int bufsize);
-#endif
-
-#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
-static void verifyUsedBlock(bType *bp, int q);
-static void verifyFreeBlock(bType *bp, int q);
-void verifyBallocSpace();
-#endif
-
-static int ballocGetSize(int size, int *q);
-
-/********************************** Code **************************************/
-/*
- * Initialize the balloc module. bopen should be called the very first thing
- * after the application starts and bclose should be called the last thing
- * before exiting. If bopen is not called, it will be called on the first
- * allocation with default values. "buf" points to memory to use of size
- * "bufsize". If buf is NULL, memory is allocated using malloc. flags may
- * be set to B_USE_MALLOC if using malloc is okay. This routine will allocate
- * an initial buffer of size bufsize for use by the application.
- */
-
-int bopen(void *buf, int bufsize, int flags)
-{
- bFlags = flags;
-
-#ifdef BASTARD_TESTING
- srand(time(0L));
-#endif /* BASTARD_TESTING */
-
-/*
- * If bopen already called by a shared process, just increment the count
- * and return;
- */
- if (++bopenCount > 1) {
- return 0;
- }
-
- if (buf == NULL) {
- if (bufsize == 0) {
- bufsize = B_DEFAULT_MEM;
- }
-#ifdef IRIX
- bufsize = ROUNDUP4(bufsize);
-#endif
- if ((buf = malloc(bufsize)) == NULL) {
- /* resetting bopenCount lets client code decide to attempt to call
- * bopen() again with a smaller memory request, should it desire to.
- * Fix suggested by Simon Byholm.
- */
- --bopenCount;
- return -1;
- }
-#ifdef B_STATS
- bStatsMemMalloc += bufsize;
-#endif
- } else {
- bFlags |= B_USER_BUF;
- }
-
- bFreeSize = bFreeLeft = bufsize;
- bFreeBuf = bFreeNext = buf;
- memset(bQhead, 0, sizeof(bQhead));
-#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
- bFillBlock(buf, bufsize);
-#endif
-#ifdef B_STATS
- bStackStart = &buf;
-#endif
-#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
- verifyFreeBlock(buf, bufsize);
-#endif
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Close down the balloc module and free all malloced memory.
- */
-
-void bclose()
-{
-#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
- verifyBallocSpace();
-#endif
- if (--bopenCount <= 0 && !(bFlags & B_USER_BUF)) {
- free(bFreeBuf);
- bopenCount = 0;
- }
-}
-
-/******************************************************************************/
-/*
- * Allocate a block of the requested size. First check the block
- * queues for a suitable one.
- */
-
-void *balloc(B_ARGS_DEC, int size)
-{
- bType *bp;
- int q, memSize;
-
-/*
- * Call bopen with default values if the application has not yet done so
- */
- if (bFreeBuf == NULL) {
- if (bopen(NULL, B_DEFAULT_MEM, 0) < 0) {
- return NULL;
- }
- }
-#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
- verifyBallocSpace();
-#endif
- if (size < 0) {
- return NULL;
- }
-
-#ifdef BASTARD_TESTING
- if (rand() == 0x7fff) {
- return NULL;
- }
-#endif /* BASTARD_TESTING */
-
-
- memSize = ballocGetSize(size, &q);
-
- if (q >= B_MAX_CLASS) {
-/*
- * Size if bigger than the maximum class. Malloc if use has been okayed
- */
- if (bFlags & B_USE_MALLOC) {
-#ifdef B_STATS
- bstats(0, NULL);
-#endif
-#ifdef IRIX
- memSize = ROUNDUP4(memSize);
-#endif
- bp = (bType*) malloc(memSize);
- if (bp == NULL) {
- traceRaw(T("B: malloc failed\n"));
- return NULL;
- }
-#ifdef B_STATS
- bStatsMemMalloc += memSize;
-#endif
-#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
- bFillBlock(bp, memSize);
-#endif
-
- } else {
- traceRaw(T("B: malloc failed\n"));
- return NULL;
- }
-
-/*
- * the u.size is the actual size allocated for data
- */
- bp->u.size = memSize - sizeof(bType);
- bp->flags = B_MALLOCED;
-
- } else if ((bp = bQhead[q]) != NULL) {
-/*
- * Take first block off the relevant q if non-empty
- */
- bQhead[q] = bp->u.next;
-#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
- verifyFreeBlock(bp, q);
-#endif
-#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
- bFillBlock(bp, memSize);
-#endif
- bp->u.size = memSize - sizeof(bType);
- bp->flags = 0;
-
- } else {
- if (bFreeLeft > memSize) {
-/*
- * The q was empty, and the free list has spare memory so
- * create a new block out of the primary free block
- */
- bp = (bType*) bFreeNext;
-#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
- verifyFreeBlock(bp, q);
-#endif
- bFreeNext += memSize;
- bFreeLeft -= memSize;
-#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
- bFillBlock(bp, memSize);
-#endif
- bp->u.size = memSize - sizeof(bType);
- bp->flags = 0;
-
- } else if (bFlags & B_USE_MALLOC) {
-#ifdef B_STATS
- static int once = 0;
- if (once++ == 0) {
- bstats(0, NULL);
- }
-#endif
-/*
- * Nothing left on the primary free list, so malloc a new block
- */
-#ifdef IRIX
- memSize = ROUNDUP4(memSize);
-#endif
- if ((bp = (bType*) malloc(memSize)) == NULL) {
- traceRaw(T("B: malloc failed\n"));
- return NULL;
- }
-#ifdef B_STATS
- bStatsMemMalloc += memSize;
-#endif
-#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
- bFillBlock(bp, memSize);
-#endif
- bp->u.size = memSize - sizeof(bType);
- bp->flags = B_MALLOCED;
-
- } else {
- traceRaw(T("B: malloc failed\n"));
- return NULL;
- }
- }
-
-#ifdef B_STATS
- bStatsAlloc(B_ARGS, bp, q, memSize);
-#endif
- bp->flags |= B_INTEGRITY;
-
-/*
- * The following is a good place to put a breakpoint when trying to reduce
- * determine and reduce maximum memory use.
- */
-#if 0
-#ifdef B_STATS
- if (bStatsBallocInUse == bStatsBallocMax) {
- bstats(0, NULL);
- }
-#endif
-#endif
- return (void*) ((char*) bp + sizeof(bType));
-}
-
-/******************************************************************************/
-/*
- * Free a block back to the relevant free q. We don't free back to the O/S
- * or run time system unless the block is greater than the maximum class size.
- * We also do not coalesce blocks.
- */
-
-void bfree(B_ARGS_DEC, void *mp)
-{
- bType *bp;
- int q, memSize;
-
-#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
- verifyBallocSpace();
-#endif
- bp = (bType*) ((char*) mp - sizeof(bType));
-
- a_assert((bp->flags & B_INTEGRITY_MASK) == B_INTEGRITY);
-
- if ((bp->flags & B_INTEGRITY_MASK) != B_INTEGRITY) {
- return;
- }
-
- memSize = ballocGetSize(bp->u.size, &q);
-
-#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
- verifyUsedBlock(bp,q);
-#endif
-#ifdef B_STATS
- bStatsFree(B_ARGS, bp, q, bp->u.size+sizeof(bType));
-#endif
- if (bp->flags & B_MALLOCED) {
- free(bp);
- return;
- }
-
-#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
- bFillBlock(bp, memSize);
-#endif
-
-/*
- * Simply link onto the head of the relevant q
- */
- bp->u.next = bQhead[q];
- bQhead[q] = bp;
-
- bp->flags = B_FILL_WORD;
-}
-
-/******************************************************************************/
-/*
- * Safe free
- */
-
-void bfreeSafe(B_ARGS_DEC, void *mp)
-{
- if (mp) {
- bfree(B_ARGS, mp);
- }
-}
-
-/******************************************************************************/
-#ifdef UNICODE
-/*
- * Duplicate a string, allow NULL pointers and then dup an empty string.
- */
-
-char *bstrdupA(B_ARGS_DEC, char *s)
-{
- char *cp;
- int len;
-
- if (s == NULL) {
- s = "";
- }
- len = strlen(s) + 1;
- if (cp = balloc(B_ARGS, len)) {
- strcpy(cp, s);
- }
- return cp;
-}
-
-#endif /* UNICODE */
-/******************************************************************************/
-/*
- * Duplicate an ascii string, allow NULL pointers and then dup an empty string.
- * If UNICODE, bstrdup above works with wide chars, so we need this routine
- * for ascii strings.
- */
-
-char_t *bstrdup(B_ARGS_DEC, char_t *s)
-{
- char_t *cp;
- int len;
-
- if (s == NULL) {
- s = T("");
- }
- len = gstrlen(s) + 1;
- if ((cp = balloc(B_ARGS, len * sizeof(char_t))) != NULL) {
- gstrcpy(cp, s);
- }
- return cp;
-}
-
-/******************************************************************************/
-/*
- * Reallocate a block. Allow NULL pointers and just do a malloc.
- * Note: if the realloc fails, we return NULL and the previous buffer is
- * preserved.
- */
-
-void *brealloc(B_ARGS_DEC, void *mp, int newsize)
-{
- bType *bp;
- void *newbuf;
-
- if (mp == NULL) {
- return balloc(B_ARGS, newsize);
- }
- bp = (bType*) ((char*) mp - sizeof(bType));
- a_assert((bp->flags & B_INTEGRITY_MASK) == B_INTEGRITY);
-
-/*
- * If the allocated memory already has enough room just return the previously
- * allocated address.
- */
- if (bp->u.size >= newsize) {
- return mp;
- }
- if ((newbuf = balloc(B_ARGS, newsize)) != NULL) {
- memcpy(newbuf, mp, bp->u.size);
- bfree(B_ARGS, mp);
- }
- return newbuf;
-}
-
-/******************************************************************************/
-/*
- * Find the size of the block to be balloc'ed. It takes in a size, finds the
- * smallest binary block it fits into, adds an overhead amount and returns.
- * q is the binary size used to keep track of block sizes in use. Called
- * from both balloc and bfree.
- */
-
-static int ballocGetSize(int size, int *q)
-{
- int mask;
-
- mask = (size == 0) ? 0 : (size-1) >> B_SHIFT;
- for (*q = 0; mask; mask >>= 1) {
- *q = *q + 1;
- }
- return ((1 << (B_SHIFT + *q)) + sizeof(bType));
-}
-
-/******************************************************************************/
-#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
-/*
- * Fill the block (useful during development to catch zero fill assumptions)
- */
-
-static void bFillBlock(void *buf, int bufsize)
-{
- memset(buf, B_FILL_CHAR, bufsize);
-}
-#endif
-
-/******************************************************************************/
-#ifdef B_STATS
-/*
- * Statistics. Do output via calling the writefn callback function with
- * "handle" as the output file handle.
- */
-
-void bstats(int handle, void (*writefn)(int handle, char_t *fmt, ...))
-{
- bStatsFileType *fp, *files;
- bStatsBlkType *blkp;
- bType *bp;
- char_t *cp;
- int q, count, mem, total, len;
- static int recurseProtect = 0;
-
- if (recurseProtect++ > 0) {
- recurseProtect--;
- return;
- }
-
- if (writefn == NULL) {
- writefn = bstatsWrite;
- }
-
-/*
- * Print stats for each memory block
- */
- (*writefn)(handle, T("\nMemory Stats\n"));
-
-/*
- * The following tabular format is now used for the output.
- * Q Size Free Bytes Inuse Bytes Allocs
- * dd ddddd ddd ddddd dddd ddddd dddd
- */
- (*writefn)(handle, " Q Size Free Bytes Inuse Bytes Allocs\n");
-
- total = 0;
- for (q = 0; q < B_MAX_CLASS; q++) {
- count = 0;
- for (bp = bQhead[q]; bp; bp = bp->u.next) {
- count++;
- }
- mem = count * (1 << (q + B_SHIFT));
- total += mem;
- (*writefn)(handle,
- T("%2d %5d %4d %6d %4d %5d %4d\n"),
- q, 1 << (q + B_SHIFT), count, mem, bStats[q].inuse,
- bStats[q].inuse * (1 << (q + B_SHIFT)), bStats[q].alloc);
- }
-
- (*writefn)(handle, T("\n"));
-
-/*
- * Print summary stats
- *
- * bFreeSize Initial memory reserved with bopen call
- * bStatsMemMalloc memory from calls to system MALLOC
- * bStatsMemMax
- * bStatsBallocMax largest amount of memory from balloc calls
- * bStatsMemInUse
- * bStatsBallocInUse present balloced memory being used
- * bStatsBlksMax);
- * bStackStart
- * bStackMin);
- * total);
- * bFreeLeft);
- *
- */
- (*writefn)(handle, T("Initial free list size %7d\n"), bFreeSize);
- (*writefn)(handle, T("Max memory malloced %7d\n"), bStatsMemMalloc);
- (*writefn)(handle, T("Max memory ever used %7d\n"), bStatsMemMax);
- (*writefn)(handle, T("Max memory ever balloced %7d\n"), bStatsBallocMax);
- (*writefn)(handle, T("Memory currently in use %7d\n"), bStatsMemInUse);
- (*writefn)(handle, T("Memory currently balloced %7d\n"), bStatsBallocInUse);
- (*writefn)(handle, T("Max blocks allocated %7d\n"), bStatsBlksMax);
- (*writefn)(handle, T("Maximum stack used %7d\n"),
- (int) bStackStart - (int) bStackMin);
-
- (*writefn)(handle, T("Free memory on all queues %7d\n"), total);
- (*writefn)(handle, T("Free list buffer left %7d\n"), bFreeLeft);
- (*writefn)(handle, T("Total free memory %7d\n"), bFreeLeft + total);
-
-/*
- * Print per file allocation stats. Sort the copied table.
- */
- len = sizeof(bStatsFileType) * B_MAX_FILES;
- files = malloc(len);
- if (files == NULL) {
- (*writefn)(handle, T("Can't allocate stats memory\n"));
- recurseProtect--;
- return;
- }
- memcpy(files, bStatsFiles, len);
- qsort(files, bStatsFilesMax, sizeof(bStatsFileType), bStatsFileSort);
-
- (*writefn)(handle, T("\nMemory Currently Allocated\n"));
- total = 0;
- (*writefn)(handle,
- T(" bytes, blocks in use, total times,")
- T("largest, q\n"));
-
- for (fp = files; fp < &files[bStatsFilesMax]; fp++) {
- if (fp->file[0]) {
- (*writefn)(handle, T("%18s, %7d, %5d, %6d, %7d,%4d\n"),
- fp->file, fp->allocated, fp->count, fp->times, fp->largest,
- fp->q);
- total += fp->allocated;
- }
- }
- (*writefn)(handle, T("\nTotal allocated %7d\n\n"), total);
-
-/*
- * Dump the actual strings
- */
- (*writefn)(handle, T("\nStrings\n"));
- for (blkp = &bStatsBlks[bStatsBlksMax - 1]; blkp >= bStatsBlks; blkp--) {
- if (blkp->ptr) {
- cp = (char_t*) ((char*) blkp->ptr + sizeof(bType));
- fp = blkp->who;
- if (gisalnum(*cp)) {
- (*writefn)(handle, T("%-50s allocated by %s\n"), cp,
- fp->file);
- }
- }
- }
- free(files);
- recurseProtect--;
-}
-
-/******************************************************************************/
-/*
- * File sort function. Used to sort per file stats
- */
-
-static int bStatsFileSort(const void *cp1, const void *cp2)
-{
- bStatsFileType *s1, *s2;
-
- s1 = (bStatsFileType*) cp1;
- s2 = (bStatsFileType*) cp2;
-
- if (s1->allocated < s2->allocated)
- return -1;
- else if (s1->allocated == s2->allocated)
- return 0;
- return 1;
-}
-
-/******************************************************************************/
-/*
- * Accumulate allocation statistics
- */
-
-static void bStatsAlloc(B_ARGS_DEC, void *ptr, int q, int size)
-{
- int memSize;
- bStatsFileType *fp;
- bStatsBlkType *bp;
- char_t name[FNAMESIZE + 10];
-
- gsprintf(name, T("%s:%d"), B_ARGS);
-
- bStats[q].alloc++;
- bStats[q].inuse++;
- bStatsMemInUse += size;
- if (bStatsMemInUse > bStatsMemMax) {
- bStatsMemMax = bStatsMemInUse;
- }
- memSize = (1 << (B_SHIFT + q)) + sizeof(bType);
- bStatsBallocInUse += memSize;
- if (bStatsBallocInUse > bStatsBallocMax) {
- bStatsBallocMax = bStatsBallocInUse;
- }
-
-/*
- * Track maximum stack usage. Assumes a stack growth down. Approximate as
- * we only measure this on block allocation.
- */
- if ((void*) &file < bStackMin) {
- bStackMin = (void*) &file;
- }
-
-/*
- * Find the file and adjust the stats for this file
- */
- for (fp = bStatsFiles; fp < &bStatsFiles[bStatsFilesMax]; fp++) {
- if (fp->file[0] == file[0] && gstrcmp(fp->file, name) == 0) {
- fp->allocated += size;
- fp->count++;
- fp->times++;
- if (fp->largest < size) {
- fp->largest = size;
- fp->q = q;
- }
- break;
- }
- }
-
-/*
- * New entry: find the first free slot and create a new entry
- */
- if (fp >= &bStatsFiles[bStatsFilesMax]) {
- for (fp = bStatsFiles; fp < &bStatsFiles[B_MAX_FILES]; fp++) {
- if (fp->file[0] == '\0') {
- gstrncpy(fp->file, name, TSZ(fp->file));
- fp->allocated += size;
- fp->count++;
- fp->times++;
- fp->largest = size;
- fp->q = q;
- if ((fp - bStatsFiles) >= bStatsFilesMax) {
- bStatsFilesMax = (fp - bStatsFiles) + 1;
- }
- break;
- }
- }
- }
-
-/*
- * Update the per block stats. Allocate a new slot.
- */
- for (bp = bStatsBlks; bp < &bStatsBlks[B_MAX_BLOCKS]; bp++) {
- if (bp->ptr == NULL) {
- bp->ptr = ptr;
- bp->who = fp;
- if ((bp - bStatsBlks) >= bStatsBlksMax) {
- bStatsBlksMax = (bp - bStatsBlks) + 1;
- }
- break;
- }
- }
-}
-
-/******************************************************************************/
-/*
- * Free statistics
- */
-
-static void bStatsFree(B_ARGS_DEC, void *ptr, int q, int size)
-{
- int memSize;
- bStatsFileType *fp;
- bStatsBlkType *bp;
-
- memSize = (1 << (B_SHIFT + q)) + sizeof(bType);
- bStatsMemInUse -= size;
- bStatsBallocInUse -= memSize;
- bStats[q].inuse--;
-
-/*
- * Update the per block stats. Try from the end first
- */
- for (bp = &bStatsBlks[bStatsBlksMax - 1]; bp >= bStatsBlks; bp--) {
- if (bp->ptr == ptr) {
- bp->ptr = NULL;
- fp = bp->who;
- bp->who = NULL;
- fp->allocated -= size;
- fp->count--;
- return;
- }
- }
-}
-
-/******************************************************************************/
-/*
- * Default output function. Just send to trace channel.
- */
-
-#undef sprintf
-static void bstatsWrite(int handle, char_t *fmt, ...)
-{
- va_list args;
- char_t buf[BUF_MAX];
-
- va_start(args, fmt);
- vsprintf(buf, fmt, args);
- va_end(args);
- traceRaw(buf);
-}
-
-
-#else /* not B_STATS */
-/******************************************************************************/
-/*
- * Dummy bstats for external calls that aren't protected by #if B_STATS.
- */
-
-void bstats(int handle, void (*writefn)(int handle, char_t *fmt, ...))
-{
-}
-#endif /* B_STATS */
-
-/******************************************************************************/
-#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
-/*
- * The following routines verify the integrity of the balloc memory space.
- * These functions use the B_FILL feature. Corruption is defined
- * as bad integrity flags in allocated blocks or data other than B_FILL_CHAR
- * being found anywhere in the space which is unallocated and that is not a
- * next pointer in the free queues. a_assert is called if any corruption is
- * found. CAUTION: These functions add severe processing overhead and should
- * only be used when searching for a tough corruption problem.
- */
-
-/******************************************************************************/
-/*
- * verifyUsedBlock verifies that a block which was previously allocated is
- * still uncorrupted.
- */
-
-static void verifyUsedBlock(bType *bp, int q)
-{
- int memSize, size;
- char *p;
-
- memSize = (1 << (B_SHIFT + q)) + sizeof(bType);
- a_assert((bp->flags & ~B_MALLOCED) == B_INTEGRITY);
- size = bp->u.size;
- for (p = ((char *)bp)+sizeof(bType)+size; p < ((char*)bp)+memSize; p++) {
- a_assert(*p == B_FILL_CHAR);
- }
-}
-
-/******************************************************************************/
-/*
- * verifyFreeBlock verifies that a previously free'd block in one of the queues
- * is still uncorrupted.
- */
-
-static void verifyFreeBlock(bType *bp, int q)
-{
- int memSize;
- char *p;
-
- memSize = (1 << (B_SHIFT + q)) + sizeof(bType);
- for (p = ((char *)bp)+sizeof(void*); p < ((char*)bp)+memSize; p++) {
- a_assert(*p == B_FILL_CHAR);
- }
- bp = (bType *)p;
- a_assert((bp->flags & ~B_MALLOCED) == B_INTEGRITY ||
- bp->flags == B_FILL_WORD);
-}
-
-/******************************************************************************/
-/*
- * verifyBallocSpace reads through the entire balloc memory space and
- * verifies that all allocated blocks are uncorrupted and that, with the
- * exception of free list next pointers, all other unallocated space is
- * filled with B_FILL_CHAR.
- */
-
-void verifyBallocSpace()
-{
- int q;
- char *p;
- bType *bp;
-
-/*
- * First verify all the free blocks.
- */
- for (q = 0; q < B_MAX_CLASS; q++) {
- for (bp = bQhead[q]; bp != NULL; bp = bp->u.next) {
- verifyFreeBlock(bp, q);
- }
- }
-
-/*
- * Now verify other space
- */
- p = bFreeBuf;
- while (p < (bFreeBuf + bFreeSize)) {
- bp = (bType *)p;
- if (bp->u.size > 0xFFFFF) {
- p += sizeof(bp->u);
- while (p < (bFreeBuf + bFreeSize) && *p == B_FILL_CHAR) {
- p++;
- }
- } else {
- a_assert(((bp->flags & ~B_MALLOCED) == B_INTEGRITY) ||
- bp->flags == B_FILL_WORD);
- p += (sizeof(bType) + bp->u.size);
- while (p < (bFreeBuf + bFreeSize) && *p == B_FILL_CHAR) {
- p++;
- }
- }
- }
-}
-#endif /* B_VERIFY_CAUSES_SEVERE_OVERHEAD */
-
-/******************************************************************************/
-
-#else /* NO_BALLOC */
-int bopen(void *buf, int bufsize, int flags)
-{
- return 0;
-}
-
-/******************************************************************************/
-
-void bclose()
-{
-}
-
-/******************************************************************************/
-
-void bstats(int handle, void (*writefn)(int handle, char_t *fmt, ...))
-{
-}
-
-/******************************************************************************/
-
-char_t *bstrdupNoBalloc(char_t *s)
-{
-#ifdef UNICODE
- if (s) {
- return wcsdup(s);
- } else {
- return wcsdup(T(""));
- }
-#else
- return bstrdupANoBalloc(s);
-#endif
-}
-
-/******************************************************************************/
-
-char *bstrdupANoBalloc(char *s)
-{
- char* buf;
-
- if (s == NULL) {
- s = "";
- }
- buf = malloc(strlen(s)+1);
- strcpy(buf, s);
- return buf;
-}
-
-#endif /* NO_BALLOC */
-/******************************************************************************/
-
-
diff --git a/xbmc/lib/libGoAhead/src/base64.c b/xbmc/lib/libGoAhead/src/base64.c deleted file mode 100644 index 0e400d12f0..0000000000 --- a/xbmc/lib/libGoAhead/src/base64.c +++ /dev/null @@ -1,150 +0,0 @@ -/*
- * base64.c -- Base64 Mime encoding
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: base64.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * The base64 command encodes and decodes a string in mime base64 format
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-
-/******************************** Local Data **********************************/
-/*
- * Mapping of ANSI chars to base64 Mime encoding alphabet (see below)
- */
-
-static char_t map64[] = {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
- -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-};
-
-static char_t alphabet64[] = {
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
- 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
- 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
- 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
- 'w', 'x', 'y', 'z', '0', '1', '2', '3',
- '4', '5', '6', '7', '8', '9', '+', '/',
-};
-
-/*********************************** Code *************************************/
-/*
- * Decode a buffer from "string" and into "outbuf"
- */
-
-int websDecode64(char_t *outbuf, char_t *string, int outlen)
-{
- unsigned long shiftbuf;
- char_t *cp, *op;
- int c, i, j, shift;
-
- op = outbuf;
- *op = '\0';
- cp = string;
- while (*cp && *cp != '=') {
-/*
- * Map 4 (6bit) input bytes and store in a single long (shiftbuf)
- */
- shiftbuf = 0;
- shift = 18;
- for (i = 0; i < 4 && *cp && *cp != '='; i++, cp++) {
- c = map64[*cp & 0xff];
- if (c == -1) {
- error(E_L, E_LOG, T("Bad string: %s at %c index %d"), string,
- c, i);
- return -1;
- }
- shiftbuf = shiftbuf | (c << shift);
- shift -= 6;
- }
-/*
- * Interpret as 3 normal 8 bit bytes (fill in reverse order).
- * Check for potential buffer overflow before filling.
- */
- --i;
- if ((op + i) >= &outbuf[outlen]) {
- gstrcpy(outbuf, T("String too big"));
- return -1;
- }
- for (j = 0; j < i; j++) {
- *op++ = (char_t) ((shiftbuf >> (8 * (2 - j))) & 0xff);
- }
- *op = '\0';
- }
- return 0;
-}
-
-
-/******************************************************************************/
-/*
- * Encode a buffer from "string" into "outbuf"
- */
-
-void websEncode64(char_t *outbuf, char_t *string, int outlen)
-{
- unsigned long shiftbuf;
- char_t *cp, *op;
- int x, i, j, shift;
-
- op = outbuf;
- *op = '\0';
- cp = string;
- while (*cp) {
-/*
- * Take three characters and create a 24 bit number in shiftbuf
- */
- shiftbuf = 0;
- for (j = 2; j >= 0 && *cp; j--, cp++) {
- shiftbuf |= ((*cp & 0xff) << (j * 8));
- }
-/*
- * Now convert shiftbuf to 4 base64 letters. The i,j magic calculates
- * how many letters need to be output.
- */
- shift = 18;
- for (i = ++j; i < 4 && op < &outbuf[outlen] ; i++) {
- x = (shiftbuf >> shift) & 0x3f;
- *op++ = alphabet64[(shiftbuf >> shift) & 0x3f];
- shift -= 6;
- }
-/*
- * Pad at the end with '='
- */
- while (j-- > 0) {
- *op++ = '=';
- }
- *op = '\0';
- }
-}
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/cgi.c b/xbmc/lib/libGoAhead/src/cgi.c deleted file mode 100644 index d66731ebcd..0000000000 --- a/xbmc/lib/libGoAhead/src/cgi.c +++ /dev/null @@ -1,332 +0,0 @@ -/*
- * cgi.c -- CGI processing (for the GoAhead Web server
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: cgi.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/********************************** Description *******************************/
-/*
- * This module implements the /cgi-bin handler. CGI processing differs from
- * goforms processing in that each CGI request is executed as a separate
- * process, rather than within the webserver process. For each CGI request the
- * environment of the new process must be set to include all the CGI variables
- * and its standard input and output must be directed to the socket. This
- * is done using temporary files.
- */
-
-/*********************************** Includes *********************************/
-#include "wsIntrn.h"
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include "basic/basicInternal.h"
-#endif
-
-/************************************ Locals **********************************/
-typedef struct { /* Struct for CGI tasks which have completed */
- webs_t wp; /* pointer to session websRec */
- char_t *stdIn; /* file desc. for task's temp input fd */
- char_t *stdOut; /* file desc. for task's temp output fd */
- char_t *cgiPath; /* path to executable process file */
- char_t **argp; /* pointer to buf containing argv tokens */
- char_t **envp; /* pointer to array of environment strings */
- int handle; /* process handle of the task */
- long fplacemark; /* seek location for CGI output file */
-} cgiRec;
-static cgiRec **cgiList; /* hAlloc chain list of wp's to be closed */
-static int cgiMax; /* Size of hAlloc list */
-
-/************************************* Code ***********************************/
-
-/*
- * Process a form request. Returns 1 always to indicate it handled the URL
- */
-int websCgiHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg,
- char_t *url, char_t *path, char_t* query)
-{
- cgiRec *cgip;
- sym_t *s;
- char_t cgiBuf[FNAMESIZE], *stdIn, *stdOut, cwd[FNAMESIZE];
- char_t *cp, *cgiName, *cgiPath, **argp, **envp, **ep;
- int n, envpsize, argpsize, pHandle, cid;
- a_assert(websValid(wp));
- a_assert(url && *url);
- a_assert(path && *path == '/');
- websStats.cgiHits++;
-/*
- * Extract the form name and then build the full path name. The form
- * name will follow the first '/' in path.
- */
- gstrncpy(cgiBuf, path, TSZ(cgiBuf));
- if ((cgiName = gstrchr(&cgiBuf[1], '/')) == NULL) {
- websError(wp, 200, T("Missing CGI name"));
- return 1;
- }
- cgiName++;
- if ((cp = gstrchr(cgiName, '/')) != NULL) {
- *cp = '\0';
- }
- fmtAlloc(&cgiPath, FNAMESIZE, T("%s/%s/%s"), websGetDefaultDir(),
- CGI_BIN, cgiName);
-#ifndef VXWORKS
-/*
- * See if the file exists and is executable. If not error out.
- * Don't do this step for VxWorks, since the module may already
- * be part of the OS image, rather than in the file system.
- */
- {
- gstat_t sbuf;
- if (gstat(cgiPath, &sbuf) != 0 || (sbuf.st_mode & S_IFREG) == 0) {
- websError(wp, 200, T("CGI process file does not exist"));
- bfree(B_L, cgiPath);
- return 1;
- }
-#if (defined (WIN) || defined (CE))
- if (gstrstr(cgiPath, T(".exe")) == NULL &&
- gstrstr(cgiPath, T(".bat")) == NULL) {
-#elif (defined (NW))
- if (gstrstr(cgiPath, T(".nlm")) == NULL) {
-#else
- if (gaccess(cgiPath, X_OK) != 0) {
-#endif /* WIN || CE */
- websError(wp, 200, T("CGI process file is not executable"));
- bfree(B_L, cgiPath);
- return 1;
- }
- }
-#endif /* ! VXWORKS */
-
-
-/*
- * Get the CWD for resetting after launching the child process CGI
- */
- ggetcwd(cwd, FNAMESIZE);
-/*
- * Retrieve the directory of the child process CGI
- */
- if ((cp = gstrrchr(cgiPath, '/')) != NULL) {
- *cp = '\0';
- gchdir(cgiPath);
- *cp = '/';
- }
-/*
- * Build command line arguments. Only used if there is no non-encoded
- * = character. This is indicative of a ISINDEX query. POST separators
- * are & and others are +. argp will point to a balloc'd array of
- * pointers. Each pointer will point to substring within the
- * query string. This array of string pointers is how the spawn or
- * exec routines expect command line arguments to be passed. Since
- * we don't know ahead of time how many individual items there are in
- * the query string, the for loop includes logic to grow the array
- * size via brealloc.
- */
- argpsize = 10;
- argp = balloc(B_L, argpsize * sizeof(char_t *));
- *argp = cgiPath;
- n = 1;
- if (gstrchr(query, '=') == NULL) {
- websDecodeUrl(query, query, gstrlen(query));
- for (cp = gstrtok(query, T(" ")); cp != NULL; ) {
- *(argp+n) = cp;
- n++;
- if (n >= argpsize) {
- argpsize *= 2;
- argp = brealloc(B_L, argp, argpsize * sizeof(char_t *));
- }
- cp = gstrtok(NULL, T(" "));
- }
- }
- *(argp+n) = NULL;
-/*
- * Add all CGI variables to the environment strings to be passed
- * to the spawned CGI process. This includes a few we don't
- * already have in the symbol table, plus all those that are in
- * the cgiVars symbol table. envp will point to a balloc'd array of
- * pointers. Each pointer will point to a balloc'd string containing
- * the keyword value pair in the form keyword=value. Since we don't
- * know ahead of time how many environment strings there will be the
- * for loop includes logic to grow the array size via brealloc.
- */
- envpsize = WEBS_SYM_INIT;
- envp = balloc(B_L, envpsize * sizeof(char_t *));
- n = 0;
- fmtAlloc(envp+n, FNAMESIZE, T("%s=%s"),T("PATH_TRANSLATED"), cgiPath);
- n++;
- fmtAlloc(envp+n, FNAMESIZE, T("%s=%s/%s"),T("SCRIPT_NAME"),
- CGI_BIN, cgiName);
- n++;
- fmtAlloc(envp+n, FNAMESIZE, T("%s=%s"),T("REMOTE_USER"), wp->userName);
- n++;
- fmtAlloc(envp+n, FNAMESIZE, T("%s=%s"),T("AUTH_TYPE"), wp->authType);
- n++;
- for (s = symFirst(wp->cgiVars); s != NULL; s = symNext(wp->cgiVars)) {
- if (s->content.valid && s->content.type == vtype_string &&
- gstrcmp(s->name.value.string, T("REMOTE_HOST")) != 0 &&
- gstrcmp(s->name.value.string, T("HTTP_AUTHORIZATION")) != 0) {
- fmtAlloc(envp+n, FNAMESIZE, T("%s=%s"), s->name.value.string,
- s->content.value.string);
- n++;
- if (n >= envpsize) {
- envpsize *= 2;
- envp = brealloc(B_L, envp, envpsize * sizeof(char_t *));
- }
- }
- }
- *(envp+n) = NULL;
-/*
- * Create temporary file name(s) for the child's stdin and stdout.
- * For POST data the stdin temp file (and name) should already exist.
- */
- if (wp->cgiStdin == NULL) {
- wp->cgiStdin = websGetCgiCommName();
- }
- stdIn = wp->cgiStdin;
- stdOut = websGetCgiCommName();
-/*
- * Now launch the process. If not successful, do the cleanup of resources.
- * If successful, the cleanup will be done after the process completes.
- */
- if ((pHandle = websLaunchCgiProc(cgiPath, argp, envp, stdIn, stdOut))
- == -1) {
- websError(wp, 200, T("failed to spawn CGI task"));
- for (ep = envp; *ep != NULL; ep++) {
- bfreeSafe(B_L, *ep);
- }
- bfreeSafe(B_L, cgiPath);
- bfreeSafe(B_L, argp);
- bfreeSafe(B_L, envp);
- bfreeSafe(B_L, stdOut);
- } else {
-/*
- * If the spawn was successful, put this wp on a queue to be
- * checked for completion.
- */
- cid = hAllocEntry((void***) &cgiList, &cgiMax, sizeof(cgiRec));
- cgip = cgiList[cid];
- cgip->handle = pHandle;
- cgip->stdIn = stdIn;
- cgip->stdOut = stdOut;
- cgip->cgiPath = cgiPath;
- cgip->argp = argp;
- cgip->envp = envp;
- cgip->wp = wp;
- cgip->fplacemark = 0;
- websTimeoutCancel(wp);
- }
-/*
- * Restore the current working directory after spawning child CGI
- */
- gchdir(cwd);
- return 1;
-}
-
-
-
-/******************************************************************************/
-/*
- * Any entry in the cgiList need to be checked to see if it has
- */
-void websCgiGatherOutput (cgiRec *cgip)
-{
- gstat_t sbuf;
- char_t cgiBuf[FNAMESIZE];
- if ((gstat(cgip->stdOut, &sbuf) == 0) &&
- (sbuf.st_size > cgip->fplacemark)) {
- int fdout;
- fdout = gopen(cgip->stdOut, O_RDONLY | O_BINARY, 0444 );
-/*
- * Check to see if any data is available in the
- * output file and send its contents to the socket.
- */
- if (fdout >= 0) {
- webs_t wp = cgip->wp;
- int nRead;
-/*
- * Write the HTTP header on our first pass
- */
- if (cgip->fplacemark == 0) {
- websWrite(wp, T("HTTP/1.0 200 OK\r\n"));
- }
- glseek(fdout, cgip->fplacemark, SEEK_SET);
- while ((nRead = gread(fdout, cgiBuf, FNAMESIZE)) > 0) {
- websWriteBlock(wp, cgiBuf, nRead);
- cgip->fplacemark += nRead;
- }
- gclose(fdout);
- }
- }
-}
-
-
-
-/******************************************************************************/
-/*
- * Any entry in the cgiList need to be checked to see if it has
- * completed, and if so, process its output and clean up.
- */
-void websCgiCleanup()
-{
- cgiRec *cgip;
- webs_t wp;
- char_t **ep;
- int cid, nTries;
- for (cid = 0; cid < cgiMax; cid++) {
- if ((cgip = cgiList[cid]) != NULL) {
- wp = cgip->wp;
- websCgiGatherOutput (cgip);
- if (websCheckCgiProc(cgip->handle) == 0) {
-/*
- * We get here if the CGI process has terminated. Clean up.
- */
- nTries = 0;
-/*
- * Make sure we didn't miss something during a task switch.
- * Maximum wait is 100 times 10 msecs (1 second).
- */
- while ((cgip->fplacemark == 0) && (nTries < 100)) {
- websCgiGatherOutput(cgip);
-/*
- * There are some cases when we detect app exit
- * before the file is ready.
- */
- if (cgip->fplacemark == 0) {
-#ifdef WIN
- Sleep(10);
-#endif /* WIN*/
- }
- nTries++;
- }
- if (cgip->fplacemark == 0) {
- websError(wp, 200, T("CGI generated no output"));
- } else {
- websDone(wp, 200);
- }
-/*
- * Remove the temporary re-direction files
- */
- gunlink(cgip->stdIn);
- gunlink(cgip->stdOut);
-/*
- * Free all the memory buffers pointed to by cgip.
- * The stdin file name (wp->cgiStdin) gets freed as
- * part of websFree().
- */
- cgiMax = hFree((void***) &cgiList, cid);
- for (ep = cgip->envp; ep != NULL && *ep != NULL; ep++) {
- bfreeSafe(B_L, *ep);
- }
- bfreeSafe(B_L, cgip->cgiPath);
- bfreeSafe(B_L, cgip->argp);
- bfreeSafe(B_L, cgip->envp);
- bfreeSafe(B_L, cgip->stdOut);
- bfreeSafe(B_L, cgip);
- }
- }
- }
-}
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/default.c b/xbmc/lib/libGoAhead/src/default.c deleted file mode 100644 index 943772ca21..0000000000 --- a/xbmc/lib/libGoAhead/src/default.c +++ /dev/null @@ -1,631 +0,0 @@ -/*
- * default.c -- Default URL handler. Includes support for ASP.
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: default.c,v 1.9 2003/04/11 18:10:28 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module provides default URL handling and Active Server Page support.
- *
- * In many cases we don't check the return code of calls to websWrite as
- * it is easier, smaller and non-fatal to continue even when the requesting
- * browser has gone away.
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-
-/*********************************** Locals ***********************************/
-
-static char_t *websDefaultPage; /* Default page name */
-static char_t *websDefaultDir; /* Default Web page directory */
-
-/**************************** Forward Declarations ****************************/
-
-static void websDefaultWriteEvent(webs_t wp);
-
-/*********************************** Code *************************************/
-/*
- * Process a default URL request. This will validate the URL and handle "../"
- * and will provide support for Active Server Pages. As the handler is the
- * last handler to run, it always indicates that it has handled the URL
- * by returning 1.
- */
-
-int websDefaultHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg,
- char_t *url, char_t *path, char_t *query)
-{
- websStatType sbuf;
- char_t *lpath, *tmp, *date;
- int bytes, flags, nchars;
-
-#ifdef _XBOX
- char_t *cp;
-#endif
-
- a_assert(websValid(wp));
- a_assert(url && *url);
- a_assert(path);
- a_assert(query);
-
-/*
- * Validate the URL and ensure that ".."s don't give access to unwanted files
- */
- flags = websGetRequestFlags(wp);
-
- if (websValidateUrl(wp, path) < 0)
- {
- /*
- * preventing a cross-site scripting exploit -- you may restore the
- * following line of code to revert to the original behavior...
- */
- /*websError(wp, 500, T("Invalid URL %s"), url);*/
- websError(wp, 500, T("Invalid URL"));
- return 1;
- }
- lpath = websGetRequestLpath(wp);
-
-#ifdef _XBOX
- // Just to be sure... The XBox does not like '/' directory delimiters
- for (cp = lpath; *cp; cp++) {
- if (*cp == '/')
- *cp = '\\';
- }
-#endif
-
- nchars = gstrlen(lpath) - 1;
- if (lpath[nchars] == '/' || lpath[nchars] == '\\') {
- lpath[nchars] = '\0';
- }
-
-/*
- * If the file is a directory, redirect using the nominated default page
- */
- if (websPageIsDirectory(lpath)) {
- nchars = gstrlen(path);
- if (path[nchars-1] == '/' || path[nchars-1] == '\\') {
- path[--nchars] = '\0';
- }
- nchars += gstrlen(websDefaultPage) + 2;
- fmtAlloc(&tmp, nchars, T("%s/%s"), path, websDefaultPage);
- websRedirect(wp, tmp);
- bfreeSafe(B_L, tmp);
- return 1;
- }
-
-/*
- * Open the document. Stat for later use.
- */
- if (websPageOpen(wp, lpath, path, SOCKET_RDONLY | SOCKET_BINARY,
- 0666) < 0)
- {
- /* 10 Dec 02 BgP -- according to
- * <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>,
- * the proper code to return here is NOT 400 (old code), which is used
- * to indicate a malformed request. Here, the request is good, but the
- * error we need to tell the client about is 404 (Not Found).
- */
- /*
- * 17 Mar 03 BgP -- prevent a cross-site scripting exploit
- websError(wp, 404, T("Cannot open URL %s"), url);
- */
-
- websError(wp, 404, T("Cannot open URL"));
- return 1;
- }
-
- if (websPageStat(wp, lpath, path, &sbuf) < 0) {
- /*
- * 17 Mar 03 BgP
- * prevent a cross-site scripting exploit
- websError(wp, 400, T("Cannot stat page for URL %s"), url);
- */
- websError(wp, 400, T("Cannot stat page for URL"));
- return 1;
- }
-
-/*
- * If the page has not been modified since the user last received it and it
- * is not dynamically generated each time (ASP), then optimize request by
- * sending a 304 Use local copy response
- */
- websStats.localHits++;
-#ifdef WEBS_IF_MODIFIED_SUPPORT
- if (flags & WEBS_IF_MODIFIED && !(flags & WEBS_ASP) && !(flags & WEBS_SPY)) {
- if (sbuf.mtime <= wp->since) {
- websWrite(wp, T("HTTP/1.0 304 Use local copy\r\n"));
-
-/*
- * by license terms the following line of code must
- * not be modified.
- */
- websWrite(wp, T("Server: %s\r\n"), WEBS_NAME);
-
- if (flags & WEBS_KEEP_ALIVE) {
- websWrite(wp, T("Connection: keep-alive\r\n"));
- }
- websWrite(wp, T("\r\n"));
- websSetRequestFlags(wp, flags |= WEBS_HEADER_DONE);
- websDone(wp, 304);
- return 1;
- }
- }
-#endif
-
-/*
- * Output the normal HTTP response header
- */
- if ((date = websGetDateString(NULL)) != NULL) {
- websWrite(wp, T("HTTP/1.0 200 OK\r\nDate: %s\r\n"), date);
-
-/*
- * By license terms the following line of code must not be modified.
- */
- websWrite(wp, T("Server: %s\r\n"), WEBS_NAME);
- bfree(B_L, date);
- }
- flags |= WEBS_HEADER_DONE;
-
-/*
- * If this is an ASP request, ensure the remote browser doesn't cache it.
- * Send back both HTTP/1.0 and HTTP/1.1 cache control directives
- */
- if ((flags & WEBS_ASP) || (flags & WEBS_SPY)) {
- bytes = 0;
- websWrite(wp, T("Pragma: no-cache\r\nCache-Control: no-cache\r\n"));
-
- } else {
- if ((date = websGetDateString(&sbuf)) != NULL) {
- websWrite(wp, T("Last-modified: %s\r\n"), date);
- bfree(B_L, date);
- }
- bytes = sbuf.size;
- }
-
- if (bytes) {
- websWrite(wp, T("Content-length: %d\r\n"), bytes);
- websSetRequestBytes(wp, bytes);
- }
- websWrite(wp, T("Content-type: %s\r\n"), websGetRequestType(wp));
-
- if ((flags & WEBS_KEEP_ALIVE) && !(flags & WEBS_ASP) && !(flags & WEBS_SPY)) {
- websWrite(wp, T("Connection: keep-alive\r\n"));
- }
-
- if (!(flags & WEBS_SPY))
- {
- websWrite(wp, T("\r\n"));
- }
-
-/*
- * All done if the browser did a HEAD request
- */
- if (flags & WEBS_HEAD_REQUEST) {
- websDone(wp, 200);
- return 1;
- }
-
-/*
- * Evaluate ASP requests
- */
- if (flags & WEBS_ASP) {
- if (websAspRequest(wp, lpath) < 0) {
- return 1;
- }
- websDone(wp, 200);
- return 1;
- }
-
-/*
- * Evaluate SPY requests
- */
- if (flags & WEBS_SPY) {
- if (websSpyRequest(wp, lpath) < 0) {
- return 1;
- }
- websDone(wp, 200);
- return 1;
- }
-
-#ifdef WEBS_SSL_SUPPORT
- if (wp->flags & WEBS_SECURE) {
- websDefaultWriteEvent(wp);
- } else {
- websSetRequestSocketHandler(wp, SOCKET_WRITABLE, websDefaultWriteEvent);
- }
-#else
-/*
- * For normal web documents, return the data via background write
- */
- websSetRequestSocketHandler(wp, SOCKET_WRITABLE, websDefaultWriteEvent);
-#endif
- return 1;
-}
-
-
-#ifdef WIN32
-
-static int badPath(char_t* path, char_t* badPath, int badLen)
-{
- int retval = 0;
- int len = gstrlen(path);
- int i = 0;
-
- if (len <= badLen +1)
- {
- for (i = 0; i < badLen; ++i)
- {
- if (badPath[i] != gtolower(path[i]))
- {
- return 0;
- }
- }
- /* if we get here, the first 'badLen' characters match.
- * If 'path' is 1 character larger than 'badPath' and that extra
- * character is NOT a letter or a number, we have a bad path.
- */
- retval = 1;
- if (badLen + 1 == len)
- {
- /* e.g. path == "aux:" */
- if (gisalnum(path[len-1]))
- {
- /* the last character is alphanumeric, so we let this path go
- * through.
- */
- retval = 0;
- }
- }
- }
-
- return retval;
-}
-
-
-static int isBadWindowsPath(char_t** parts, int partCount)
-{
- /*
- * If we're running on Windows 95/98/ME, malicious users can crash the
- * OS by requesting an URL with any of several reserved DOS device names
- * in them (AUX, NUL, etc.).
- * If we're running on any of those OS versions, we scan the URL
- * for paths with any of these elements before
- * trying to access them. If any of the subdirectory names match one
- * of our prohibited links, we declare this to be a 'bad' path, and return
- * 1 to indicate this. This may be an overly heavy-handed approach, but should
- * prevent the DOS attack.
- * NOTE that this function is only compiled in when we are running on Win32,
- * and only has an effect when we are running on Win95/98, or ME. On all other
- * versions of Windows, we check the version info, and return 0 immediately.
- *
- * According to http://packetstormsecurity.nl/0003-exploits/SCX-SA-01.txt:
-
- * II. Problem Description
- * When the Microsoft Windows operating system is parsing a path that
- * is being crafted like "c:\[device]\[device]" it will halt, and crash
- * the entire operating system.
- * Four device drivers have been found to crash the system. The CON,
- * NUL, AUX, CLOCK$ and CONFIG$ are the two device drivers which are
- * known to crash. Other devices as LPT[x]:, COM[x]: and PRN have not
- * been found to crash the system.
- * Making combinations as CON\NUL, NUL\CON, AUX\NUL, ... seems to
- * crash Ms Windows as well.
- * Calling a path such as "C:\CON\[filename]" won't result in a crash
- * but in an error-message. Creating the map "CON", "CLOCK$", "AUX"
- * "NUL" or "CONFIG$" will also result in a simple error-message
- * saying: ''creating that map isn't allowed''.
- *
- * returns 1 if it finds a bad path element.
- */
- OSVERSIONINFO version;
- int i;
- version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (GetVersionEx(&version))
- {
- if (VER_PLATFORM_WIN32_NT != version.dwPlatformId)
- {
- /*
- * we are currently running on 95/98/ME.
- */
- for (i = 0; i < partCount; ++i)
- {
- /*
- * check against the prohibited names. If any of our requested
- * subdirectories match any of these, return '1' immediately.
- */
-
- if (
- (badPath(parts[i], T("con"), 3)) ||
- (badPath(parts[i], T("nul"), 3)) ||
- (badPath(parts[i], T("aux"), 3)) ||
- (badPath(parts[i], T("clock$"), 6)) ||
- (badPath(parts[i], T("config$"), 7)) )
- {
- return 1;
- }
- }
- }
- }
- /*
- * either we're not on one of the bad OS versions, or the request has
- * no problems.
- */
- return 0;
-}
-#endif
-
-
-/******************************************************************************/
-/*
- * Validate the URL path and process ".." path segments. Return -1 if the URL
- * is bad.
- */
-
-int websValidateUrl(webs_t wp, char_t *path)
-{
- /*
- Thanks to Dhanwa T (dhanwa@polyserve.com) for this fix -- previously,
- if an URL was requested having more than (the hardcoded) 64 parts,
- the webServer would experience a hard crash as it attempted to
- write past the end of the array 'parts'.
- */
-
-#define kMaxUrlParts 64
- char_t *parts[kMaxUrlParts]; /* Array of ptr's to URL parts */
- char_t *token, *dir, *lpath;
- int i, len, npart;
-
- a_assert(websValid(wp));
- a_assert(path);
-
- dir = websGetRequestDir(wp);
- if (dir == NULL || *dir == '\0') {
- return -1;
- }
-
-/*
- * Copy the string so we don't destroy the original
- */
- path = bstrdup(B_L, path);
- websDecodeUrl(path, path, gstrlen(path));
-
- len = npart = 0;
- parts[0] = NULL;
-
- /*
- * 22 Jul 02 -- there were reports that a directory traversal exploit was
- * possible in the WebServer running under Windows if directory paths
- * outside the server's specified root web were given by URL-encoding the
- * backslash character, like:
- *
- * GoAhead is vulnerable to a directory traversal bug. A request such as
- *
- * GoAhead-server/../../../../../../../ results in an error message
- * 'Cannot open URL'.
-
- * However, by encoding the '/' character, it is possible to break out of
- * the
- * web root and read arbitrary files from the server.
- * Hence a request like:
- *
- * GoAhead-server/..%5C..%5C..%5C..%5C..%5C..%5C/winnt/win.ini returns the
- * contents of the win.ini file.
- * (Note that the description uses forward slashes (0x2F), but the example
- * uses backslashes (0x5C). In my tests, forward slashes are correctly
- * trapped, but backslashes are not. The code below substitutes forward
- * slashes for backslashes before attempting to validate that there are no
- * unauthorized paths being accessed.
- */
- token = gstrchr(path, '\\');
- while (token != NULL)
- {
- *token = '/';
- token = gstrchr(token, '\\');
- }
-
- token = gstrtok(path, T("/"));
-
-/*
- * Look at each directory segment and process "." and ".." segments
- * Don't allow the browser to pop outside the root web.
- */
- while (token != NULL)
- {
- if (npart >= kMaxUrlParts)
- {
- /*
- * malformed URL -- too many parts for us to process.
- */
- bfree(B_L, path);
- return -1;
- }
- if (gstrcmp(token, T("..")) == 0)
- {
- if (npart > 0)
- {
- npart--;
- }
-
- }
- else if (gstrcmp(token, T(".")) != 0)
- {
- parts[npart] = token;
- len += gstrlen(token) + 1;
- npart++;
- }
- token = gstrtok(NULL, T("/"));
- }
-
-#ifdef WIN32
- if (isBadWindowsPath(parts, npart))
- {
- bfree(B_L, path);
- return -1;
- }
-
-#endif
-
-/*
- * Create local path for document. Need extra space all "/" and null.
- */
- if (npart || (gstrcmp(path, T("/")) == 0) || (path[0] == '\0'))
- {
- lpath = balloc(B_L, (gstrlen(dir) + 1 + len + 1) * sizeof(char_t));
- gstrcpy(lpath, dir);
-
- for (i = 0; i < npart; i++)
- {
- gstrcat(lpath, T("/"));
- gstrcat(lpath, parts[i]);
- }
- websSetRequestLpath(wp, lpath);
- bfree(B_L, path);
- bfree(B_L, lpath);
-
- }
- else
- {
- bfree(B_L, path);
- return -1;
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Do output back to the browser in the background. This is a socket
- * write handler.
- */
-
-static void websDefaultWriteEvent(webs_t wp)
-{
- int len, wrote, flags, bytes, written;
- char *buf;
-
- a_assert(websValid(wp));
-
- flags = websGetRequestFlags(wp);
-
- websSetTimeMark(wp);
-
- wrote = bytes = 0;
- written = websGetRequestWritten(wp);
-
-/*
- * We only do this for non-ASP documents
- */
- if ( !(flags & WEBS_ASP) && !(flags & WEBS_SPY)) {
- bytes = websGetRequestBytes(wp);
-/*
- * Note: websWriteDataNonBlock may return less than we wanted. It will
- * return -1 on a socket error
- */
- if ((buf = balloc(B_L, PAGE_READ_BUFSIZE)) == NULL) {
- websError(wp, 200, T("Can't get memory"));
- } else {
- while ((len = websPageReadData(wp, buf, PAGE_READ_BUFSIZE)) > 0) {
- if ((wrote = websWriteDataNonBlock(wp, buf, len)) < 0) {
- break;
- }
- written += wrote;
- if (wrote != len) {
- websPageSeek(wp, - (len - wrote));
- break;
- }
- }
-/*
- * Safety. If we are at EOF, we must be done
- */
- if (len == 0) {
- a_assert(written >= bytes);
- written = bytes;
- }
- bfree(B_L, buf);
- }
- }
-
-/*
- * We're done if an error, or all bytes output
- */
- websSetRequestWritten(wp, written);
- if (wrote < 0 || written >= bytes) {
- websDone(wp, 200);
- }
-}
-
-/******************************************************************************/
-/*
- * Closing down. Free resources.
- */
-
-void websDefaultClose()
-{
- if (websDefaultPage) {
- bfree(B_L, websDefaultPage);
- websDefaultPage = NULL;
- }
- if (websDefaultDir) {
- bfree(B_L, websDefaultDir);
- websDefaultDir = NULL;
- }
-}
-
-/******************************************************************************/
-/*
- * Get the default page for URL requests ending in "/"
- */
-
-char_t *websGetDefaultPage()
-{
- return websDefaultPage;
-}
-
-/******************************************************************************/
-/*
- * Get the default web directory
- */
-
-char_t *websGetDefaultDir()
-{
- return websDefaultDir;
-}
-
-/******************************************************************************/
-/*
- * Set the default page for URL requests ending in "/"
- */
-
-void websSetDefaultPage(char_t *page)
-{
- a_assert(page && *page);
-
- if (websDefaultPage) {
- bfree(B_L, websDefaultPage);
- }
- websDefaultPage = bstrdup(B_L, page);
-}
-
-/******************************************************************************/
-/*
- * Set the default web directory
- */
-
-void websSetDefaultDir(char_t *dir)
-{
- a_assert(dir && *dir);
- if (websDefaultDir) {
- bfree(B_L, websDefaultDir);
- }
- websDefaultDir = bstrdup(B_L, dir);
-}
-
-/******************************************************************************/
-
-
diff --git a/xbmc/lib/libGoAhead/src/ej.h b/xbmc/lib/libGoAhead/src/ej.h deleted file mode 100644 index 5bec6d7ff7..0000000000 --- a/xbmc/lib/libGoAhead/src/ej.h +++ /dev/null @@ -1,47 +0,0 @@ -/*
- * ej.h -- Ejscript(TM) header
- *
- * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved.
- *
- * See the file "license.txt" for information on usage and redistribution
- *
- * $Id: ej.h,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-#ifndef _h_EJ
-#define _h_EJ 1
-
-/******************************** Description *********************************/
-
-/*
- * GoAhead Ejscript(TM) header. This defines the Ejscript API and internal
- * structures.
- */
-
-/********************************* Includes ***********************************/
-
-#ifndef UEMF
- #include "basic/basic.h"
- #include "emf/emf.h"
-#else
- #include "uemf.h"
-#endif
-
-/********************************** Defines ***********************************/
-
-/******************************** Prototypes **********************************/
-
-extern int ejArgs(int argc, char_t **argv, char_t *fmt, ...);
-extern void ejSetResult(int eid, char_t *s);
-extern int ejOpenEngine(sym_fd_t variables, sym_fd_t functions);
-extern void ejCloseEngine(int eid);
-extern int ejSetGlobalFunction(int eid, char_t *name,
- int (*fn)(int eid, void *handle, int argc, char_t **argv));
-extern void ejSetVar(int eid, char_t *var, char_t *value);
-extern int ejGetVar(int eid, char_t *var, char_t **value);
-extern char_t *ejEval(int eid, char_t *script, char_t **emsg);
-
-#endif /* _h_EJ */
-
-/*****************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/ejIntrn.h b/xbmc/lib/libGoAhead/src/ejIntrn.h deleted file mode 100644 index 5da33e396d..0000000000 --- a/xbmc/lib/libGoAhead/src/ejIntrn.h +++ /dev/null @@ -1,231 +0,0 @@ -/*
- * ejIntrn.h -- Ejscript(TM) header
- *
- * Copyright (c) GoAhead Software, Inc., 1992-2000
- *
- * See the file "license.txt" for information on usage and redistribution
- *
- * $Id: ejIntrn.h,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-#ifndef _h_EJINTERNAL
-#define _h_EJINTERNAL 1
-
-/******************************** Description *********************************/
-
-/*
- * GoAhead Ejscript(TM) header. This defines the Ejscript API and internal
- * structures.
- */
-
-/********************************* Includes ***********************************/
-
-#include <ctype.h>
-#include <stdarg.h>
-#include <stdlib.h>
-
-#ifdef CE
-#ifndef UEMF
- #include <io.h>
-#endif
-#endif
-
-#ifdef LYNX
- #include <unistd.h>
-#endif
-
-#ifdef QNX4
- #include <dirent.h>
-#endif
-
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include <param.h>
- #include <stat.h>
- #include "basic/basicInternal.h"
- #include "emf/emfInternal.h"
-#endif
-
-#include "ej.h"
-
-/********************************** Defines ***********************************/
-/*
- * Constants
- */
-#define EJ_INC 110 /* Growth for tags/tokens */
-#define EJ_SCRIPT_INC 1023 /* Growth for ej scripts */
-#define EJ_OFFSET 1 /* hAlloc doesn't like 0 entries */
-#define EJ_MAX_RECURSE 100 /* Sanity for maximum recursion */
-
-/*
- * Ejscript Lexical analyser tokens
- */
-#define TOK_ERR -1 /* Any error */
-#define TOK_LPAREN 1 /* ( */
-#define TOK_RPAREN 2 /* ) */
-#define TOK_IF 3 /* if */
-#define TOK_ELSE 4 /* else */
-#define TOK_LBRACE 5 /* { */
-#define TOK_RBRACE 6 /* } */
-#define TOK_LOGICAL 7 /* ||, &&, ! */
-#define TOK_EXPR 8 /* +, -, /, % */
-#define TOK_SEMI 9 /* ; */
-#define TOK_LITERAL 10 /* literal string */
-#define TOK_FUNCTION 11 /* function name */
-#define TOK_NEWLINE 12 /* newline white space */
-#define TOK_ID 13 /* function name */
-#define TOK_EOF 14 /* End of script */
-#define TOK_COMMA 15 /* Comma */
-#define TOK_VAR 16 /* var */
-#define TOK_ASSIGNMENT 17 /* = */
-#define TOK_FOR 18 /* for */
-#define TOK_INC_DEC 19 /* ++, -- */
-#define TOK_RETURN 20 /* return */
-
-/*
- * Expression operators
- */
-#define EXPR_LESS 1 /* < */
-#define EXPR_LESSEQ 2 /* <= */
-#define EXPR_GREATER 3 /* > */
-#define EXPR_GREATEREQ 4 /* >= */
-#define EXPR_EQ 5 /* == */
-#define EXPR_NOTEQ 6 /* != */
-#define EXPR_PLUS 7 /* + */
-#define EXPR_MINUS 8 /* - */
-#define EXPR_DIV 9 /* / */
-#define EXPR_MOD 10 /* % */
-#define EXPR_LSHIFT 11 /* << */
-#define EXPR_RSHIFT 12 /* >> */
-#define EXPR_MUL 13 /* * */
-#define EXPR_ASSIGNMENT 14 /* = */
-#define EXPR_INC 15 /* ++ */
-#define EXPR_DEC 16 /* -- */
-#define EXPR_BOOL_COMP 17 /* ! */
-/*
- * Conditional operators
- */
-#define COND_AND 1 /* && */
-#define COND_OR 2 /* || */
-#define COND_NOT 3 /* ! */
-
-/*
- * States
- */
-#define STATE_ERR -1 /* Error state */
-#define STATE_EOF 1 /* End of file */
-#define STATE_COND 2 /* Parsing a "(conditional)" stmt */
-#define STATE_COND_DONE 3
-#define STATE_RELEXP 4 /* Parsing a relational expr */
-#define STATE_RELEXP_DONE 5
-#define STATE_EXPR 6 /* Parsing an expression */
-#define STATE_EXPR_DONE 7
-#define STATE_STMT 8 /* Parsing General statement */
-#define STATE_STMT_DONE 9
-#define STATE_STMT_BLOCK_DONE 10 /* End of block "}" */
-#define STATE_ARG_LIST 11 /* Function arg list */
-#define STATE_ARG_LIST_DONE 12
-#define STATE_DEC_LIST 16 /* Declaration list */
-#define STATE_DEC_LIST_DONE 17
-#define STATE_DEC 18
-#define STATE_DEC_DONE 19
-
-#define STATE_RET 20 /* Return statement */
-
-#define STATE_BEGIN STATE_STMT
-
-/*
- * Flags. Used in ej_t and as parameter to parse()
- */
-#define FLAGS_EXE 0x1 /* Execute statements */
-#define FLAGS_VARIABLES 0x2 /* Allocated variables store */
-#define FLAGS_FUNCTIONS 0x4 /* Allocated function store */
-
-/*
- * Function call structure
- */
-typedef struct {
- char_t *fname; /* Function name */
- char_t **args; /* Args for function (halloc) */
- int nArgs; /* Number of args */
-} ejfunc_t;
-
-/*
- * EJ evaluation block structure
- */
-typedef struct ejEval {
- ringq_t tokbuf; /* Current token */
- ringq_t script; /* Input script for parsing */
- char_t *putBackToken; /* Putback token string */
- int putBackTokenId; /* Putback token ID */
- char_t *line; /* Current line */
- int lineLength; /* Current line length */
- int lineNumber; /* Parse line number */
- int lineColumn; /* Column in line */
-} ejinput_t;
-
-/*
- * Per Ejscript session structure
- */
-typedef struct ej {
- ejinput_t *input; /* Input evaluation block */
- sym_fd_t functions; /* Symbol table for functions */
- sym_fd_t *variables; /* hAlloc list of variables */
- int variableMax; /* Number of entries */
- ejfunc_t *func; /* Current function */
- char_t *result; /* Current expression result */
- char_t *error; /* Error message */
- char_t *token; /* Pointer to token string */
- int tid; /* Current token id */
- int eid; /* Halloc handle */
- int flags; /* Flags */
- void* userHandle; /* User defined handle */
-} ej_t;
-
-/******************************** Prototypes **********************************/
-
-extern int ejOpenBlock(int eid);
-extern int ejCloseBlock(int eid, int vid);
-extern char_t *ejEvalBlock(int eid, char_t *script, char_t **emsg);
-#ifndef __NO_EJ_FILE
-extern char_t *ejEvalFile(int eid, char_t *path, char_t **emsg);
-#endif
-extern int ejRemoveGlobalFunction(int eid, char_t *name);
-extern void *ejGetGlobalFunction(int eid, char_t *name);
-extern int ejSetGlobalFunctionDirect(sym_fd_t functions, char_t *name,
- int (*fn)(int eid, void *handle, int argc, char_t **argv));
-extern void ejError(ej_t* ep, char_t* fmt, ...);
-extern void ejSetUserHandle(int eid, void* handle);
-extern void* ejGetUserHandle(int eid);
-extern int ejGetLineNumber(int eid);
-extern char_t *ejGetResult(int eid);
-extern void ejSetLocalVar(int eid, char_t *var, char_t *value);
-extern void ejSetGlobalVar(int eid, char_t *var, char_t *value);
-
-extern int ejLexOpen(ej_t* ep);
-extern void ejLexClose(ej_t* ep);
-extern int ejLexOpenScript(ej_t* ep, char_t *script);
-extern void ejLexCloseScript(ej_t* ep);
-extern void ejLexSaveInputState(ej_t* ep, ejinput_t* state);
-extern void ejLexFreeInputState(ej_t* ep, ejinput_t* state);
-extern void ejLexRestoreInputState(ej_t* ep, ejinput_t* state);
-extern int ejLexGetToken(ej_t* ep, int state);
-extern void ejLexPutbackToken(ej_t* ep, int tid, char_t *string);
-
-extern sym_fd_t ejGetVariableTable(int eid);
-extern sym_fd_t ejGetFunctionTable(int eid);
-
-extern int ejEmfOpen(int eid);
-extern void ejEmfClose(int eid);
-
-extern int ejEmfDbRead(int eid, void *handle, int argc, char_t **argv);
-extern int ejEmfDbReadKeyed(int eid, void *handle, int argc, char_t **argv);
-extern int ejEmfDbTableGetNrow(int eid, void *handle, int argc, char_t **argv);
-extern int ejEmfDbDeleteRow(int eid, void *handle, int argc, char_t **argv);
-extern int ejEmfTrace(int eid, void *handle, int argc, char_t **argv);
-extern int ejEmfDbWrite(int eid, void *handle, int argc, char_t **argv);
-extern int ejEmfDbCollectTable(int eid, void *handle, int argc, char_t **argv);
-
-#endif /* _h_EJINTERNAL */
-
diff --git a/xbmc/lib/libGoAhead/src/ejlex.c b/xbmc/lib/libGoAhead/src/ejlex.c deleted file mode 100644 index c129dafac9..0000000000 --- a/xbmc/lib/libGoAhead/src/ejlex.c +++ /dev/null @@ -1,722 +0,0 @@ -/*
- * ejlex.c -- Ejscript(TM) Lexical Analyser
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: ejlex.c,v 1.4 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * Ejscript lexical analyser. This implementes a lexical analyser for a
- * a subset of the JavaScript language.
- */
-
-/********************************** Includes **********************************/
-
-#include "ejIntrn.h"
-
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include "basic/basicInternal.h"
-#endif
-
-/********************************** Defines ***********************************/
-#define OCTAL 8
-#define HEX 16
-/****************************** Forward Declarations **************************/
-
-static int getLexicalToken(ej_t* ep, int state);
-static int tokenAddChar(ej_t *ep, int c);
-static int inputGetc(ej_t* ep);
-static void inputPutback(ej_t* ep, int c);
-static int charConvert(ej_t* ep, int base, int maxDig);
-
-/************************************* Code ***********************************/
-/*
- * Setup the lexical analyser
- */
-
-int ejLexOpen(ej_t* ep)
-{
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Close the lexicial analyser
- */
-
-void ejLexClose(ej_t* ep)
-{
-}
-
-/******************************************************************************/
-/*
- * Open a new input script
- */
-
-int ejLexOpenScript(ej_t* ep, char_t *script)
-{
- ejinput_t *ip;
-
- a_assert(ep);
- a_assert(script);
-
- if ((ep->input = balloc(B_L, sizeof(ejinput_t))) == NULL) {
- return -1;
- }
- ip = ep->input;
- memset(ip, 0, sizeof(*ip));
-
- a_assert(ip);
- a_assert(ip->putBackToken == NULL);
- a_assert(ip->putBackTokenId == 0);
-
-/*
- * Create the parse token buffer and script buffer
- */
- if (ringqOpen(&ip->tokbuf, EJ_INC, -1) < 0) {
- return -1;
- }
- if (ringqOpen(&ip->script, EJ_SCRIPT_INC, -1) < 0) {
- return -1;
- }
-/*
- * Put the Ejscript into a ring queue for easy parsing
- */
- ringqPutStr(&ip->script, script);
-
- ip->lineNumber = 1;
- ip->lineLength = 0;
- ip->lineColumn = 0;
- ip->line = NULL;
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Close the input script
- */
-
-void ejLexCloseScript(ej_t* ep)
-{
- ejinput_t *ip;
-
- a_assert(ep);
-
- ip = ep->input;
- a_assert(ip);
-
- if (ip->putBackToken) {
- bfree(B_L, ip->putBackToken);
- ip->putBackToken = NULL;
- }
- ip->putBackTokenId = 0;
-
- if (ip->line) {
- bfree(B_L, ip->line);
- ip->line = NULL;
- }
-
- ringqClose(&ip->tokbuf);
- ringqClose(&ip->script);
-
- bfree(B_L, ip);
-}
-
-/******************************************************************************/
-/*
- * Save the input state
- */
-
-void ejLexSaveInputState(ej_t* ep, ejinput_t* state)
-{
- ejinput_t *ip;
-
- a_assert(ep);
-
- ip = ep->input;
- a_assert(ip);
-
- *state = *ip;
- if (ip->putBackToken) {
- state->putBackToken = bstrdup(B_L, ip->putBackToken);
- }
-}
-
-/******************************************************************************/
-/*
- * Restore the input state
- */
-
-void ejLexRestoreInputState(ej_t* ep, ejinput_t* state)
-{
- ejinput_t *ip;
-
- a_assert(ep);
-
- ip = ep->input;
- a_assert(ip);
-
- ip->tokbuf = state->tokbuf;
- ip->script = state->script;
- ip->putBackTokenId = state->putBackTokenId;
- if (ip->putBackToken) {
- bfree(B_L, ip->putBackToken);
- }
- if (state->putBackToken) {
- ip->putBackToken = bstrdup(B_L, state->putBackToken);
- }
-}
-
-/******************************************************************************/
-/*
- * Free a saved input state
- */
-
-void ejLexFreeInputState(ej_t* ep, ejinput_t* state)
-{
- if (state->putBackToken) {
- bfree(B_L, state->putBackToken);
- state->putBackToken = NULL;
- }
-}
-
-/******************************************************************************/
-/*
- * Get the next Ejscript token
- */
-
-int ejLexGetToken(ej_t* ep, int state)
-{
- ep->tid = getLexicalToken(ep, state);
- /*
- * commented out 04 Apr 02 Bg Porter -- we found a case where very long
- * arguments to write() were being corrupted downstream in the trace call
- * (the ep->token pointer was being overwritten with the trace message.
- * restore this if it's useful for your debugging.
- trace(9, T("ejGetToken: %d, \"%s\"\n"), ep->tid, ep->token);
- */
- return ep->tid;
-}
-
-/******************************************************************************/
-/*
- * Get the next Ejscript token
- */
-
-static int getLexicalToken(ej_t* ep, int state)
-{
- ringq_t *inq, *tokq;
- ejinput_t* ip;
- int done, tid, c, quote, style;
-
- a_assert(ep);
- ip = ep->input;
- a_assert(ip);
-
- inq = &ip->script;
- tokq = &ip->tokbuf;
-
- ep->tid = -1;
- tid = -1;
- ep->token = T("");
-
- ringqFlush(tokq);
-
- if (ip->putBackTokenId > 0) {
- ringqPutStr(tokq, ip->putBackToken);
- tid = ip->putBackTokenId;
- ip->putBackTokenId = 0;
- ep->token = (char_t*) tokq->servp;
- return tid;
- }
-
- if ((c = inputGetc(ep)) < 0) {
- return TOK_EOF;
- }
-
- for (done = 0; !done; ) {
- switch (c) {
- case -1:
- return TOK_EOF;
-
- case ' ':
- case '\t':
- case '\r':
- do {
- if ((c = inputGetc(ep)) < 0)
- break;
- } while (c == ' ' || c == '\t' || c == '\r');
- break;
-
- case '\n':
- return TOK_NEWLINE;
-
- case '(':
- tokenAddChar(ep, c);
- return TOK_LPAREN;
-
- case ')':
- tokenAddChar(ep, c);
- return TOK_RPAREN;
-
- case '{':
- tokenAddChar(ep, c);
- return TOK_LBRACE;
-
- case '}':
- tokenAddChar(ep, c);
- return TOK_RBRACE;
-
- case '+':
- if ((c = inputGetc(ep)) < 0) {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
- if (c != '+' ) {
- inputPutback(ep, c);
- tokenAddChar(ep, EXPR_PLUS);
- return TOK_EXPR;
- }
- tokenAddChar(ep, EXPR_INC);
- return TOK_INC_DEC;
-
- case '-':
- if ((c = inputGetc(ep)) < 0) {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
- if (c != '-' ) {
- inputPutback(ep, c);
- tokenAddChar(ep, EXPR_MINUS);
- return TOK_EXPR;
- }
- tokenAddChar(ep, EXPR_DEC);
- return TOK_INC_DEC;
-
- case '*':
- tokenAddChar(ep, EXPR_MUL);
- return TOK_EXPR;
-
- case '%':
- tokenAddChar(ep, EXPR_MOD);
- return TOK_EXPR;
-
- case '/':
-/*
- * Handle the division operator and comments
- */
- if ((c = inputGetc(ep)) < 0) {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
- if (c != '*' && c != '/') {
- inputPutback(ep, c);
- tokenAddChar(ep, EXPR_DIV);
- return TOK_EXPR;
- }
- style = c;
-/*
- * Eat comments. Both C and C++ comment styles are supported.
- */
- while (1) {
- if ((c = inputGetc(ep)) < 0) {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
- if (c == '\n' && style == '/') {
- break;
- } else if (c == '*') {
- c = inputGetc(ep);
- if (style == '/') {
- if (c == '\n') {
- break;
- }
- } else {
- if (c == '/') {
- break;
- }
- }
- }
- }
-/*
- * Continue looking for a token, so get the next character
- */
- if ((c = inputGetc(ep)) < 0) {
- return TOK_EOF;
- }
- break;
-
- case '<': /* < and <= */
- if ((c = inputGetc(ep)) < 0) {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
- if (c == '<') {
- tokenAddChar(ep, EXPR_LSHIFT);
- return TOK_EXPR;
- } else if (c == '=') {
- tokenAddChar(ep, EXPR_LESSEQ);
- return TOK_EXPR;
- }
- tokenAddChar(ep, EXPR_LESS);
- inputPutback(ep, c);
- return TOK_EXPR;
-
- case '>': /* > and >= */
- if ((c = inputGetc(ep)) < 0) {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
- if (c == '>') {
- tokenAddChar(ep, EXPR_RSHIFT);
- return TOK_EXPR;
- } else if (c == '=') {
- tokenAddChar(ep, EXPR_GREATEREQ);
- return TOK_EXPR;
- }
- tokenAddChar(ep, EXPR_GREATER);
- inputPutback(ep, c);
- return TOK_EXPR;
-
- case '=': /* "==" */
- if ((c = inputGetc(ep)) < 0) {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
- if (c == '=') {
- tokenAddChar(ep, EXPR_EQ);
- return TOK_EXPR;
- }
- inputPutback(ep, c);
- return TOK_ASSIGNMENT;
-
- case '!': /* "!=" or "!"*/
- if ((c = inputGetc(ep)) < 0) {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
- if (c == '=') {
- tokenAddChar(ep, EXPR_NOTEQ);
- return TOK_EXPR;
- }
- inputPutback(ep, c);
- tokenAddChar(ep, EXPR_BOOL_COMP);
- return TOK_EXPR;
-
- case ';':
- tokenAddChar(ep, c);
- return TOK_SEMI;
-
- case ',':
- tokenAddChar(ep, c);
- return TOK_COMMA;
-
- case '|': /* "||" */
- if ((c = inputGetc(ep)) < 0 || c != '|') {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
- tokenAddChar(ep, COND_OR);
- return TOK_LOGICAL;
-
- case '&': /* "&&" */
- if ((c = inputGetc(ep)) < 0 || c != '&') {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
- tokenAddChar(ep, COND_AND);
- return TOK_LOGICAL;
-
- case '\"': /* String quote */
- case '\'':
- quote = c;
- if ((c = inputGetc(ep)) < 0) {
- ejError(ep, T("Syntax Error"));
- return TOK_ERR;
- }
-
- while (c != quote) {
-/*
- * check for escape sequence characters
- */
- if (c == '\\') {
- c = inputGetc(ep);
-
- if (gisdigit(c)) {
-/*
- * octal support, \101 maps to 65 = 'A'. put first char
- * back so converter will work properly.
- */
- inputPutback(ep, c);
- c = charConvert(ep, OCTAL, 3);
-
- } else {
- switch (c) {
- case 'n':
- c = '\n'; break;
- case 'b':
- c = '\b'; break;
- case 'f':
- c = '\f'; break;
- case 'r':
- c = '\r'; break;
- case 't':
- c = '\t'; break;
- case 'x':
-/*
- * hex support, \x41 maps to 65 = 'A'
- */
- c = charConvert(ep, HEX, 2);
- break;
- case 'u':
-/*
- * unicode support, \x0401 maps to 65 = 'A'
- */
- c = charConvert(ep, HEX, 2);
- c = c*16 + charConvert(ep, HEX, 2);
-
- break;
- case '\'':
- case '\"':
- case '\\':
- break;
- default:
- ejError(ep, T("Invalid Escape Sequence"));
- return TOK_ERR;
- }
- }
- if (tokenAddChar(ep, c) < 0) {
- return TOK_ERR;
- }
- } else {
- if (tokenAddChar(ep, c) < 0) {
- return TOK_ERR;
- }
- }
- if ((c = inputGetc(ep)) < 0) {
- ejError(ep, T("Unmatched Quote"));
- return TOK_ERR;
- }
- }
- return TOK_LITERAL;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- do {
- if (tokenAddChar(ep, c) < 0) {
- return TOK_ERR;
- }
- if ((c = inputGetc(ep)) < 0)
- break;
- } while (gisdigit(c));
- inputPutback(ep, c);
- return TOK_LITERAL;
-
- default:
-/*
- * Identifiers or a function names
- */
- while (1) {
- if (c == '\\') {
-/*
- * just ignore any \ characters.
- */
- } else if (tokenAddChar(ep, c) < 0) {
- break;
- }
- if ((c = inputGetc(ep)) < 0) {
- break;
- }
- if (!gisalnum(c) && c != '$' && c != '_' &&
- c != '\\') {
- break;
- }
- }
- if (! gisalpha(*tokq->servp) && *tokq->servp != '$' &&
- *tokq->servp != '_') {
- ejError(ep, T("Invalid identifier %s"), tokq->servp);
- return TOK_ERR;
- }
-/*
- * Check for reserved words (only "if", "else", "var", "for"
- * and "return" at the moment)
- */
- if (state == STATE_STMT) {
- if (gstrcmp(ep->token, T("if")) == 0) {
- return TOK_IF;
- } else if (gstrcmp(ep->token, T("else")) == 0) {
- return TOK_ELSE;
- } else if (gstrcmp(ep->token, T("var")) == 0) {
- return TOK_VAR;
- } else if (gstrcmp(ep->token, T("for")) == 0) {
- return TOK_FOR;
- } else if (gstrcmp(ep->token, T("return")) == 0) {
- if ((c == ';') || (c == '(')) {
- inputPutback(ep, c);
- }
- return TOK_RETURN;
- }
- }
-
-/*
- * Skip white space after token to find out whether this is
- * a function or not.
- */
- while (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
- if ((c = inputGetc(ep)) < 0)
- break;
- }
-
- tid = (c == '(') ? TOK_FUNCTION : TOK_ID;
- done++;
- }
- }
-
-/*
- * Putback the last extra character for next time
- */
- inputPutback(ep, c);
- return tid;
-}
-
-/******************************************************************************/
-/*
- * Putback the last token read
- */
-
-void ejLexPutbackToken(ej_t* ep, int tid, char_t *string)
-{
- ejinput_t* ip;
-
- a_assert(ep);
- ip = ep->input;
- a_assert(ip);
-
- if (ip->putBackToken) {
- bfree(B_L, ip->putBackToken);
- }
- ip->putBackTokenId = tid;
- ip->putBackToken = bstrdup(B_L, string);
-}
-
-/******************************************************************************/
-/*
- * Add a character to the token ringq buffer
- */
-
-static int tokenAddChar(ej_t *ep, int c)
-{
- ejinput_t* ip;
-
- a_assert(ep);
- ip = ep->input;
- a_assert(ip);
-
- if (ringqPutc(&ip->tokbuf, (char_t) c) < 0) {
- ejError(ep, T("Token too big"));
- return -1;
- }
- * ((char_t*) ip->tokbuf.endp) = '\0';
- ep->token = (char_t*) ip->tokbuf.servp;
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Get another input character
- */
-
-static int inputGetc(ej_t* ep)
-{
- ejinput_t *ip;
- int c, len;
-
- a_assert(ep);
- ip = ep->input;
-
- if ((len = ringqLen(&ip->script)) == 0) {
- return -1;
- }
-
- c = ringqGetc(&ip->script);
-
- if (c == '\n') {
- ip->lineNumber++;
- ip->lineColumn = 0;
- } else {
- if ((ip->lineColumn + 2) >= ip->lineLength) {
- ip->lineLength += EJ_INC;
- ip->line = brealloc(B_L, ip->line, ip->lineLength * sizeof(char_t));
- }
- ip->line[ip->lineColumn++] = c;
- ip->line[ip->lineColumn] = '\0';
- }
- return c;
-}
-
-/******************************************************************************/
-/*
- * Putback a character onto the input queue
- */
-
-static void inputPutback(ej_t* ep, int c)
-{
- ejinput_t *ip;
-
- a_assert(ep);
-
- ip = ep->input;
- ringqInsertc(&ip->script, (char_t) c);
- ip->lineColumn--;
- ip->line[ip->lineColumn] = '\0';
-}
-
-/******************************************************************************/
-/*
- * Convert a hex or octal character back to binary, return original char if
- * not a hex digit
- */
-
-static int charConvert(ej_t* ep, int base, int maxDig)
-{
- int i, c, lval, convChar;
-
- lval = 0;
- for (i = 0; i < maxDig; i++) {
- if ((c = inputGetc(ep)) < 0) {
- break;
- }
-/*
- * Initialize to out of range value
- */
- convChar = base;
- if (gisdigit(c)) {
- convChar = c - '0';
- } else if (c >= 'a' && c <= 'f') {
- convChar = c - 'a' + 10;
- } else if (c >= 'A' && c <= 'F') {
- convChar = c - 'A' + 10;
- }
-/*
- * if unexpected character then return it to buffer.
- */
- if (convChar >= base) {
- inputPutback(ep, c);
- break;
- }
- lval = (lval * base) + convChar;
- }
- return lval;
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/ejparse.c b/xbmc/lib/libGoAhead/src/ejparse.c deleted file mode 100644 index 9166042803..0000000000 --- a/xbmc/lib/libGoAhead/src/ejparse.c +++ /dev/null @@ -1,1805 +0,0 @@ -/*
- * ejparse.c -- Ejscript(TM) Parser
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: ejparse.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * Ejscript parser. This implementes a subset of the JavaScript language.
- * Multiple Ejscript parsers can be opened at a time.
- */
-
-/********************************** Includes **********************************/
-
-#include "ejIntrn.h"
-
-#ifdef CE
- #include "CE/wincompat.h"
-#endif
-
-/********************************** Local Data ********************************/
-
-ej_t **ejHandles; /* List of ej handles */
-int ejMax = -1; /* Maximum size of */
-
-/****************************** Forward Declarations **************************/
-
-#ifndef B_STATS
-#define setString(a,b,c) setstring(b,c)
-#endif
-
-static ej_t *ejPtr(int eid);
-static void clearString(char_t **ptr);
-static void setString(B_ARGS_DEC, char_t **ptr, char_t *s);
-static void appendString(char_t **ptr, char_t *s);
-static int parse(ej_t *ep, int state, int flags);
-static int parseStmt(ej_t *ep, int state, int flags);
-static int parseDeclaration(ej_t *ep, int state, int flags);
-static int parseArgs(ej_t *ep, int state, int flags);
-static int parseCond(ej_t *ep, int state, int flags);
-static int parseExpr(ej_t *ep, int state, int flags);
-static int evalExpr(ej_t *ep, char_t *lhs, int rel, char_t *rhs);
-static int evalCond(ej_t *ep, char_t *lhs, int rel, char_t *rhs);
-static int evalFunction(ej_t *ep);
-static void freeFunc(ejfunc_t *func);
-static void ejRemoveNewlines(ej_t *ep, int state);
-
-/************************************* Code ***********************************/
-/*
- * Initialize a Ejscript engine
- */
-
-int ejOpenEngine(sym_fd_t variables, sym_fd_t functions)
-{
- ej_t *ep;
- int eid, vid;
-
- if ((eid = hAllocEntry((void***) &ejHandles, &ejMax, sizeof(ej_t))) < 0) {
- return -1;
- }
- ep = ejHandles[eid];
- ep->eid = eid;
-
-/*
- * Create a top level symbol table if one is not provided for variables and
- * functions. Variables may create other symbol tables for block level
- * declarations so we use hAlloc to manage a list of variable tables.
- */
- if ((vid = hAlloc((void***) &ep->variables)) < 0) {
- ejMax = hFree((void***) &ejHandles, ep->eid);
- return -1;
- }
- if (vid >= ep->variableMax) {
- ep->variableMax = vid + 1;
- }
-
- if (variables == -1) {
- ep->variables[vid] = symOpen(64) + EJ_OFFSET;
- ep->flags |= FLAGS_VARIABLES;
- } else {
- ep->variables[vid] = variables + EJ_OFFSET;
- }
-
- if (functions == -1) {
- ep->functions = symOpen(64);
- ep->flags |= FLAGS_FUNCTIONS;
- } else {
- ep->functions = functions;
- }
-
- ejLexOpen(ep);
-
-/*
- * Define standard constants
- */
- ejSetGlobalVar(ep->eid, T("null"), NULL);
-
-#ifdef EMF
- ejEmfOpen(ep->eid);
-#endif
- return ep->eid;
-}
-
-/******************************************************************************/
-/*
- * Close
- */
-
-void ejCloseEngine(int eid)
-{
- ej_t *ep;
- int i;
-
- if ((ep = ejPtr(eid)) == NULL) {
- return;
- }
-
-#ifdef EMF
- ejEmfClose(eid);
-#endif
-
- bfreeSafe(B_L, ep->error);
- ep->error = NULL;
- bfreeSafe(B_L, ep->result);
- ep->result = NULL;
-
- ejLexClose(ep);
-
- for (i = ep->variableMax - 1; i >= 0; i--) {
- if (ep->flags & FLAGS_VARIABLES) {
- symClose(ep->variables[i] - EJ_OFFSET);
- }
- ep->variableMax = hFree((void***) &ep->variables, i);
- }
-
- if (ep->flags & FLAGS_FUNCTIONS) {
- symClose(ep->functions);
- }
-
- ejMax = hFree((void***) &ejHandles, ep->eid);
- bfree(B_L, ep);
-}
-
-#ifndef __NO_EJ_FILE
-/******************************************************************************/
-/*
- * Evaluate a Ejscript file
- */
-
-char_t *ejEvalFile(int eid, char_t *path, char_t **emsg)
-{
- gstat_t sbuf;
- ej_t *ep;
- char_t *script, *rs;
- char *fileBuf;
- int fd;
-
- a_assert(path && *path);
-
- if (emsg) {
- *emsg = NULL;
- }
-
- if ((ep = ejPtr(eid)) == NULL) {
- return NULL;
- }
-
- if ((fd = gopen(path, O_RDONLY | O_BINARY, 0666)) < 0) {
- ejError(ep, T("Bad handle %d"), eid);
- return NULL;
- }
-
- if (gstat(path, &sbuf) < 0) {
- gclose(fd);
- ejError(ep, T("Cant stat %s"), path);
- return NULL;
- }
-
- if ((fileBuf = balloc(B_L, sbuf.st_size + 1)) == NULL) {
- gclose(fd);
- ejError(ep, T("Cant malloc %d"), sbuf.st_size);
- return NULL;
- }
-
- if (gread(fd, fileBuf, sbuf.st_size) != (int)sbuf.st_size) {
- gclose(fd);
- bfree(B_L, fileBuf);
- ejError(ep, T("Error reading %s"), path);
- return NULL;
- }
-
- fileBuf[sbuf.st_size] = '\0';
- gclose(fd);
-
- if ((script = ballocAscToUni(fileBuf, sbuf.st_size)) == NULL) {
- bfree(B_L, fileBuf);
- ejError(ep, T("Cant malloc %d"), sbuf.st_size + 1);
- return NULL;
- }
- bfree(B_L, fileBuf);
-
- rs = ejEvalBlock(eid, script, emsg);
-
- bfree(B_L, script);
- return rs;
-}
-#endif /* __NO_EJ_FILE */
-
-/******************************************************************************/
-/*
- * Create a new variable scope block so that consecutive ejEval calls may
- * be made with the same varible scope. This space MUST be closed with
- * ejCloseBlock when the evaluations are complete.
- */
-
-int ejOpenBlock(int eid)
-{
- ej_t *ep;
- int vid;
-
- if((ep = ejPtr(eid)) == NULL) {
- return -1;
- }
-
- if ((vid = hAlloc((void***) &ep->variables)) < 0) {
- return -1;
- }
-
- if (vid >= ep->variableMax) {
- ep->variableMax = vid + 1;
- }
- ep->variables[vid] = symOpen(64) + EJ_OFFSET;
- return vid;
-
-}
-
-/******************************************************************************/
-/*
- * Close a variable scope block. The vid parameter is the return value from
- * the call to ejOpenBlock
- */
-
-int ejCloseBlock(int eid, int vid)
-{
- ej_t *ep;
-
- if((ep = ejPtr(eid)) == NULL) {
- return -1;
- }
- symClose(ep->variables[vid] - EJ_OFFSET);
- ep->variableMax = hFree((void***) &ep->variables, vid);
- return 0;
-
-}
-
-/******************************************************************************/
-/*
- * Create a new variable scope block and evaluate a script. All variables
- * created during this context will be automatically deleted when complete.
- */
-
-char_t *ejEvalBlock(int eid, char_t *script, char_t **emsg)
-{
- char_t* returnVal;
- int vid;
-
- a_assert(script);
-
- vid = ejOpenBlock(eid);
- returnVal = ejEval(eid, script, emsg);
- ejCloseBlock(eid, vid);
-
- return returnVal;
-}
-
-/******************************************************************************/
-/*
- * Parse and evaluate a Ejscript. The caller may provide a symbol table to
- * use for variables and function definitions. Return char_t pointer on
- * success otherwise NULL pointer is returned.
- */
-
-char_t *ejEval(int eid, char_t *script, char_t **emsg)
-{
- ej_t *ep;
- ejinput_t *oldBlock;
- int state;
- void *endlessLoopTest;
- int loopCounter;
-
-
- a_assert(script);
-
- if (emsg) {
- *emsg = NULL;
- }
-
- if ((ep = ejPtr(eid)) == NULL) {
- return NULL;
- }
-
- setString(B_L, &ep->result, T(""));
-
-/*
- * Allocate a new evaluation block, and save the old one
- */
- oldBlock = ep->input;
- ejLexOpenScript(ep, script);
-
-/*
- * Do the actual parsing and evaluation
- */
- loopCounter = 0;
- endlessLoopTest = NULL;
-
- do {
- state = parse(ep, STATE_BEGIN, FLAGS_EXE);
-
- if (state == STATE_RET) {
- state = STATE_EOF;
- }
-/*
- * prevent parser from going into infinite loop. If parsing the same
- * line 10 times then fail and report Syntax error. Most normal error
- * are caught in the parser itself.
- */
- if (endlessLoopTest == ep->input->script.servp) {
- if (loopCounter++ > 10) {
- state = STATE_ERR;
- ejError(ep, T("Syntax error"));
- }
- } else {
- endlessLoopTest = ep->input->script.servp;
- loopCounter = 0;
- }
- } while (state != STATE_EOF && state != STATE_ERR);
-
- ejLexCloseScript(ep);
-
-/*
- * Return any error string to the user
- */
- if (state == STATE_ERR && emsg) {
- *emsg = bstrdup(B_L, ep->error);
- }
-
-/*
- * Restore the old evaluation block
- */
- ep->input = oldBlock;
-
- if (state == STATE_EOF) {
- return ep->result;
- }
-
- if (state == STATE_ERR) {
- return NULL;
- }
-
- return ep->result;
-}
-
-/******************************************************************************/
-/*
- * Recursive descent parser for Ejscript
- */
-
-static int parse(ej_t *ep, int state, int flags)
-{
- a_assert(ep);
-
- switch (state) {
-/*
- * Any statement, function arguments or conditional expressions
- */
- case STATE_STMT:
- if ((state = parseStmt(ep, state, flags)) != STATE_STMT_DONE &&
- state != STATE_EOF && state != STATE_STMT_BLOCK_DONE &&
- state != STATE_RET) {
- state = STATE_ERR;
- }
- break;
-
- case STATE_DEC:
- if ((state = parseStmt(ep, state, flags)) != STATE_DEC_DONE &&
- state != STATE_EOF) {
- state = STATE_ERR;
- }
- break;
-
- case STATE_EXPR:
- if ((state = parseStmt(ep, state, flags)) != STATE_EXPR_DONE &&
- state != STATE_EOF) {
- state = STATE_ERR;
- }
- break;
-
-/*
- * Variable declaration list
- */
- case STATE_DEC_LIST:
- state = parseDeclaration(ep, state, flags);
- break;
-
-/*
- * Function argument string
- */
- case STATE_ARG_LIST:
- state = parseArgs(ep, state, flags);
- break;
-
-/*
- * Logical condition list (relational operations separated by &&, ||)
- */
- case STATE_COND:
- state = parseCond(ep, state, flags);
- break;
-
-/*
- * Expression list
- */
- case STATE_RELEXP:
- state = parseExpr(ep, state, flags);
- break;
- }
-
- if (state == STATE_ERR && ep->error == NULL) {
- ejError(ep, T("Syntax error"));
- }
- return state;
-}
-
-/******************************************************************************/
-/*
- * Parse any statement including functions and simple relational operations
- */
-
-static int parseStmt(ej_t *ep, int state, int flags)
-{
- ejfunc_t func;
- ejfunc_t *saveFunc;
- ejinput_t condScript, endScript, bodyScript, incrScript;
- char_t *value, *identifier;
- int done, expectSemi, thenFlags, elseFlags, tid, cond, forFlags;
- int ejVarType;
-
- a_assert(ep);
-
-/*
- * Set these to NULL, else we try to free them if an error occurs.
- */
- endScript.putBackToken = NULL;
- bodyScript.putBackToken = NULL;
- incrScript.putBackToken = NULL;
- condScript.putBackToken = NULL;
-
- expectSemi = 0;
- saveFunc = NULL;
-
- for (done = 0; !done; ) {
- tid = ejLexGetToken(ep, state);
-
- switch (tid) {
- default:
- ejLexPutbackToken(ep, TOK_EXPR, ep->token);
- done++;
- break;
-
- case TOK_ERR:
- state = STATE_ERR;
- done++;
- break;
-
- case TOK_EOF:
- state = STATE_EOF;
- done++;
- break;
-
- case TOK_NEWLINE:
- break;
-
- case TOK_SEMI:
-/*
- * This case is when we discover no statement and just a lone ';'
- */
- if (state != STATE_STMT) {
- ejLexPutbackToken(ep, tid, ep->token);
- }
- done++;
- break;
-
- case TOK_ID:
-/*
- * This could either be a reference to a variable or an assignment
- */
- identifier = NULL;
- setString(B_L, &identifier, ep->token);
-/*
- * Peek ahead to see if this is an assignment
- */
- tid = ejLexGetToken(ep, state);
- if (tid == TOK_ASSIGNMENT) {
- if (parse(ep, STATE_RELEXP, flags) != STATE_RELEXP_DONE) {
- clearString(&identifier);
- goto error;
- }
- if (flags & FLAGS_EXE) {
- if ( state == STATE_DEC ) {
- ejSetLocalVar(ep->eid, identifier, ep->result);
- } else {
- ejVarType = ejGetVar(ep->eid, identifier, &value);
- if (ejVarType > 0) {
- ejSetLocalVar(ep->eid, identifier, ep->result);
- } else {
- ejSetGlobalVar(ep->eid, identifier, ep->result);
- }
- }
- }
-
- } else if (tid == TOK_INC_DEC ) {
- value = NULL;
- if (flags & FLAGS_EXE) {
- ejVarType = ejGetVar(ep->eid, identifier, &value);
- if (ejVarType < 0) {
- ejError(ep, T("Undefined variable %s\n"), identifier);
- goto error;
- }
- setString(B_L, &ep->result, value);
- if (evalExpr(ep, value, (int) *ep->token, T("1")) < 0) {
- state = STATE_ERR;
- break;
- }
-
- if (ejVarType > 0) {
- ejSetLocalVar(ep->eid, identifier, ep->result);
- } else {
- ejSetGlobalVar(ep->eid, identifier, ep->result);
- }
- }
-
- } else {
-/*
- * If we are processing a declaration, allow undefined vars
- */
- value = NULL;
- if (state == STATE_DEC) {
- if (ejGetVar(ep->eid, identifier, &value) > 0) {
- ejError(ep, T("Variable already declared"),
- identifier);
- clearString(&identifier);
- goto error;
- }
- ejSetLocalVar(ep->eid, identifier, NULL);
- } else {
- if ( flags & FLAGS_EXE ) {
- if (ejGetVar(ep->eid, identifier, &value) < 0) {
- ejError(ep, T("Undefined variable %s\n"),
- identifier);
- clearString(&identifier);
- goto error;
- }
- }
- }
- setString(B_L, &ep->result, value);
- ejLexPutbackToken(ep, tid, ep->token);
- }
- clearString(&identifier);
-
- if (state == STATE_STMT) {
- expectSemi++;
- }
- done++;
- break;
-
- case TOK_LITERAL:
-/*
- * Set the result to the literal (number or string constant)
- */
- setString(B_L, &ep->result, ep->token);
- if (state == STATE_STMT) {
- expectSemi++;
- }
- done++;
- break;
-
- case TOK_FUNCTION:
-/*
- * We must save any current ep->func value for the current stack frame
- */
- if (ep->func) {
- saveFunc = ep->func;
- }
- memset(&func, 0, sizeof(ejfunc_t));
- setString(B_L, &func.fname, ep->token);
- ep->func = &func;
-
- setString(B_L, &ep->result, T(""));
- if (ejLexGetToken(ep, state) != TOK_LPAREN) {
- freeFunc(&func);
- goto error;
- }
-
- if (parse(ep, STATE_ARG_LIST, flags) != STATE_ARG_LIST_DONE) {
- freeFunc(&func);
- ep->func = saveFunc;
- goto error;
- }
-/*
- * Evaluate the function if required
- */
- if (flags & FLAGS_EXE && evalFunction(ep) < 0) {
- freeFunc(&func);
- ep->func = saveFunc;
- goto error;
- }
-
- freeFunc(&func);
- ep->func = saveFunc;
-
- if (ejLexGetToken(ep, state) != TOK_RPAREN) {
- goto error;
- }
- if (state == STATE_STMT) {
- expectSemi++;
- }
- done++;
- break;
-
- case TOK_IF:
- if (state != STATE_STMT) {
- goto error;
- }
- if (ejLexGetToken(ep, state) != TOK_LPAREN) {
- goto error;
- }
-/*
- * Evaluate the entire condition list "(condition)"
- */
- if (parse(ep, STATE_COND, flags) != STATE_COND_DONE) {
- goto error;
- }
- if (ejLexGetToken(ep, state) != TOK_RPAREN) {
- goto error;
- }
-/*
- * This is the "then" case. We need to always parse both cases and
- * execute only the relevant case.
- */
- if (*ep->result == '1') {
- thenFlags = flags;
- elseFlags = flags & ~FLAGS_EXE;
- } else {
- thenFlags = flags & ~FLAGS_EXE;
- elseFlags = flags;
- }
-/*
- * Process the "then" case. Allow for RETURN statement
- */
- switch (parse(ep, STATE_STMT, thenFlags)) {
- case STATE_RET:
- return STATE_RET;
- case STATE_STMT_DONE:
- break;
- default:
- goto error;
- }
-/*
- * check to see if there is an "else" case
- */
- ejRemoveNewlines(ep, state);
- tid = ejLexGetToken(ep, state);
- if (tid != TOK_ELSE) {
- ejLexPutbackToken(ep, tid, ep->token);
- done++;
- break;
- }
-/*
- * Process the "else" case. Allow for return.
- */
- switch (parse(ep, STATE_STMT, elseFlags)) {
- case STATE_RET:
- return STATE_RET;
- case STATE_STMT_DONE:
- break;
- default:
- goto error;
- }
- done++;
- break;
-
- case TOK_FOR:
-/*
- * Format for the expression is:
- *
- * for (initial; condition; incr) {
- * body;
- * }
- */
- if (state != STATE_STMT) {
- goto error;
- }
- if (ejLexGetToken(ep, state) != TOK_LPAREN) {
- goto error;
- }
-
-/*
- * Evaluate the for loop initialization statement
- */
- if (parse(ep, STATE_EXPR, flags) != STATE_EXPR_DONE) {
- goto error;
- }
- if (ejLexGetToken(ep, state) != TOK_SEMI) {
- goto error;
- }
-
-/*
- * The first time through, we save the current input context just
- * to each step: prior to the conditional, the loop increment and the
- * loop body.
- */
- ejLexSaveInputState(ep, &condScript);
- if (parse(ep, STATE_COND, flags) != STATE_COND_DONE) {
- goto error;
- }
- cond = (*ep->result != '0');
-
- if (ejLexGetToken(ep, state) != TOK_SEMI) {
- goto error;
- }
-
-/*
- * Don't execute the loop increment statement or the body first time
- */
- forFlags = flags & ~FLAGS_EXE;
- ejLexSaveInputState(ep, &incrScript);
- if (parse(ep, STATE_EXPR, forFlags) != STATE_EXPR_DONE) {
- goto error;
- }
- if (ejLexGetToken(ep, state) != TOK_RPAREN) {
- goto error;
- }
-
-/*
- * Parse the body and remember the end of the body script
- */
- ejLexSaveInputState(ep, &bodyScript);
- if (parse(ep, STATE_STMT, forFlags) != STATE_STMT_DONE) {
- goto error;
- }
- ejLexSaveInputState(ep, &endScript);
-
-/*
- * Now actually do the for loop. Note loop has been rotated
- */
- while (cond && (flags & FLAGS_EXE) ) {
-/*
- * Evaluate the body
- */
- ejLexRestoreInputState(ep, &bodyScript);
-
- switch (parse(ep, STATE_STMT, flags)) {
- case STATE_RET:
- return STATE_RET;
- case STATE_STMT_DONE:
- break;
- default:
- goto error;
- }
-/*
- * Evaluate the increment script
- */
- ejLexRestoreInputState(ep, &incrScript);
- if (parse(ep, STATE_EXPR, flags) != STATE_EXPR_DONE) {
- goto error;
- }
-/*
- * Evaluate the condition
- */
- ejLexRestoreInputState(ep, &condScript);
- if (parse(ep, STATE_COND, flags) != STATE_COND_DONE) {
- goto error;
- }
- cond = (*ep->result != '0');
- }
- ejLexRestoreInputState(ep, &endScript);
- done++;
- break;
-
- case TOK_VAR:
- if (parse(ep, STATE_DEC_LIST, flags) != STATE_DEC_LIST_DONE) {
- goto error;
- }
- done++;
- break;
-
- case TOK_COMMA:
- ejLexPutbackToken(ep, TOK_EXPR, ep->token);
- done++;
- break;
-
- case TOK_LPAREN:
- if (state == STATE_EXPR) {
- if (parse(ep, STATE_RELEXP, flags) != STATE_RELEXP_DONE) {
- goto error;
- }
- if (ejLexGetToken(ep, state) != TOK_RPAREN) {
- goto error;
- }
- return STATE_EXPR_DONE;
- }
- done++;
- break;
-
- case TOK_RPAREN:
- ejLexPutbackToken(ep, tid, ep->token);
- return STATE_EXPR_DONE;
-
- case TOK_LBRACE:
-/*
- * This handles any code in braces except "if () {} else {}"
- */
- if (state != STATE_STMT) {
- goto error;
- }
-
-/*
- * Parse will return STATE_STMT_BLOCK_DONE when the RBRACE is seen
- */
- do {
- state = parse(ep, STATE_STMT, flags);
- } while (state == STATE_STMT_DONE);
-
-/*
- * Allow return statement.
- */
- if (state == STATE_RET) {
- return state;
- }
-
- if (ejLexGetToken(ep, state) != TOK_RBRACE) {
- goto error;
- }
- return STATE_STMT_DONE;
-
- case TOK_RBRACE:
- if (state == STATE_STMT) {
- ejLexPutbackToken(ep, tid, ep->token);
- return STATE_STMT_BLOCK_DONE;
- }
- goto error;
-
- case TOK_RETURN:
- if (parse(ep, STATE_RELEXP, flags) != STATE_RELEXP_DONE) {
- goto error;
- }
- if (flags & FLAGS_EXE) {
- while ( ejLexGetToken(ep, state) != TOK_EOF );
- done++;
- return STATE_RET;
- }
- break;
- }
- }
-
- if (expectSemi) {
- tid = ejLexGetToken(ep, state);
- if (tid != TOK_SEMI && tid != TOK_NEWLINE) {
- goto error;
- }
-
-/*
- * Skip newline after semi-colon
- */
- ejRemoveNewlines(ep, state);
- }
-
-/*
- * Free resources and return the correct status
- */
-doneParse:
- if (tid == TOK_FOR) {
- ejLexFreeInputState(ep, &condScript);
- ejLexFreeInputState(ep, &incrScript);
- ejLexFreeInputState(ep, &endScript);
- ejLexFreeInputState(ep, &bodyScript);
- }
-
- if (state == STATE_STMT) {
- return STATE_STMT_DONE;
- } else if (state == STATE_DEC) {
- return STATE_DEC_DONE;
- } else if (state == STATE_EXPR) {
- return STATE_EXPR_DONE;
- } else if (state == STATE_EOF) {
- return state;
- } else {
- return STATE_ERR;
- }
-
-/*
- * Common error exit
- */
-error:
- state = STATE_ERR;
- goto doneParse;
-}
-
-/******************************************************************************/
-/*
- * Parse variable declaration list
- */
-
-static int parseDeclaration(ej_t *ep, int state, int flags)
-{
- int tid;
-
- a_assert(ep);
-
-/*
- * Declarations can be of the following forms:
- * var x;
- * var x, y, z;
- * var x = 1 + 2 / 3, y = 2 + 4;
- *
- * We set the variable to NULL if there is no associated assignment.
- */
-
- do {
- if ((tid = ejLexGetToken(ep, state)) != TOK_ID) {
- return STATE_ERR;
- }
- ejLexPutbackToken(ep, tid, ep->token);
-
-/*
- * Parse the entire assignment or simple identifier declaration
- */
- if (parse(ep, STATE_DEC, flags) != STATE_DEC_DONE) {
- return STATE_ERR;
- }
-
-/*
- * Peek at the next token, continue if comma seen
- */
- tid = ejLexGetToken(ep, state);
- if (tid == TOK_SEMI) {
- return STATE_DEC_LIST_DONE;
- } else if (tid != TOK_COMMA) {
- return STATE_ERR;
- }
- } while (tid == TOK_COMMA);
-
- if (tid != TOK_SEMI) {
- return STATE_ERR;
- }
- return STATE_DEC_LIST_DONE;
-}
-
-/******************************************************************************/
-/*
- * Parse function arguments
- */
-
-static int parseArgs(ej_t *ep, int state, int flags)
-{
- int tid, aid;
-
- a_assert(ep);
-
- do {
- state = parse(ep, STATE_RELEXP, flags);
- if (state == STATE_EOF || state == STATE_ERR) {
- return state;
- }
- if (state == STATE_RELEXP_DONE) {
- aid = hAlloc((void***) &ep->func->args);
- ep->func->args[aid] = bstrdup(B_L, ep->result);
- ep->func->nArgs++;
- }
-/*
- * Peek at the next token, continue if more args (ie. comma seen)
- */
- tid = ejLexGetToken(ep, state);
- if (tid != TOK_COMMA) {
- ejLexPutbackToken(ep, tid, ep->token);
- }
- } while (tid == TOK_COMMA);
-
- if (tid != TOK_RPAREN && state != STATE_RELEXP_DONE) {
- return STATE_ERR;
- }
- return STATE_ARG_LIST_DONE;
-}
-
-/******************************************************************************/
-/*
- * Parse conditional expression (relational ops separated by ||, &&)
- */
-
-static int parseCond(ej_t *ep, int state, int flags)
-{
- char_t *lhs, *rhs;
- int tid, operator;
-
- a_assert(ep);
-
- setString(B_L, &ep->result, T(""));
- rhs = lhs = NULL;
- operator = 0;
-
- do {
-/*
- * Recurse to handle one side of a conditional. Accumulate the
- * left hand side and the final result in ep->result.
- */
- state = parse(ep, STATE_RELEXP, flags);
- if (state != STATE_RELEXP_DONE) {
- state = STATE_ERR;
- break;
- }
-
- if (operator > 0) {
- setString(B_L, &rhs, ep->result);
- if (evalCond(ep, lhs, operator, rhs) < 0) {
- state = STATE_ERR;
- break;
- }
- }
- setString(B_L, &lhs, ep->result);
-
- tid = ejLexGetToken(ep, state);
- if (tid == TOK_LOGICAL) {
- operator = (int) *ep->token;
-
- } else if (tid == TOK_RPAREN || tid == TOK_SEMI) {
- ejLexPutbackToken(ep, tid, ep->token);
- state = STATE_COND_DONE;
- break;
-
- } else {
- ejLexPutbackToken(ep, tid, ep->token);
- }
-
- } while (state == STATE_RELEXP_DONE);
-
- if (lhs) {
- bfree(B_L, lhs);
- }
-
- if (rhs) {
- bfree(B_L, rhs);
- }
- return state;
-}
-
-/******************************************************************************/
-/*
- * Parse expression (leftHandSide operator rightHandSide)
- */
-
-static int parseExpr(ej_t *ep, int state, int flags)
-{
- char_t *lhs, *rhs;
- int rel, tid;
-
- a_assert(ep);
-
- setString(B_L, &ep->result, T(""));
- rhs = lhs = NULL;
- rel = 0;
- tid = 0;
-
- do {
-/*
- * This loop will handle an entire expression list. We call parse
- * to evalutate each term which returns the result in ep->result.
- */
- if (tid == TOK_LOGICAL) {
- if ((state = parse(ep, STATE_RELEXP, flags)) != STATE_RELEXP_DONE) {
- state = STATE_ERR;
- break;
- }
- } else {
- if ((state = parse(ep, STATE_EXPR, flags)) != STATE_EXPR_DONE) {
- state = STATE_ERR;
- break;
- }
- }
-
- if (rel > 0) {
- setString(B_L, &rhs, ep->result);
- if (tid == TOK_LOGICAL) {
- if (evalCond(ep, lhs, rel, rhs) < 0) {
- state = STATE_ERR;
- break;
- }
- } else {
- if (evalExpr(ep, lhs, rel, rhs) < 0) {
- state = STATE_ERR;
- break;
- }
- }
- }
- setString(B_L, &lhs, ep->result);
-
- if ((tid = ejLexGetToken(ep, state)) == TOK_EXPR ||
- tid == TOK_INC_DEC || tid == TOK_LOGICAL) {
- rel = (int) *ep->token;
-
- } else {
- ejLexPutbackToken(ep, tid, ep->token);
- state = STATE_RELEXP_DONE;
- }
-
- } while (state == STATE_EXPR_DONE);
-
- if (rhs) {
- bfree(B_L, rhs);
- }
-
- if (lhs) {
- bfree(B_L, lhs);
- }
-
- return state;
-}
-
-/******************************************************************************/
-/*
- * Evaluate a condition. Implements &&, ||, !
- */
-
-static int evalCond(ej_t *ep, char_t *lhs, int rel, char_t *rhs)
-{
- char_t buf[16];
- int l, r, lval;
-
- a_assert(lhs);
- a_assert(rhs);
- a_assert(rel > 0);
-
- lval = 0;
- if (gisdigit((int)*lhs) && gisdigit((int)*rhs)) {
- l = gatoi(lhs);
- r = gatoi(rhs);
- switch (rel) {
- case COND_AND:
- lval = l && r;
- break;
- case COND_OR:
- lval = l || r;
- break;
- default:
- ejError(ep, T("Bad operator %d"), rel);
- return -1;
- }
- } else {
- if (!gisdigit((int)*lhs)) {
- ejError(ep, T("Conditional must be numeric"), lhs);
- } else {
- ejError(ep, T("Conditional must be numeric"), rhs);
- }
- }
-
- webs_stritoa(lval, buf, sizeof(buf));
- setString(B_L, &ep->result, buf);
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Evaluate an operation
- */
-
-static int evalExpr(ej_t *ep, char_t *lhs, int rel, char_t *rhs)
-{
- char_t *cp, buf[16];
- int numeric, l, r, lval;
-
- a_assert(lhs);
- a_assert(rhs);
- a_assert(rel > 0);
-
-/*
- * All of the characters in the lhs and rhs must be numeric
- */
- numeric = 1;
- for (cp = lhs; *cp; cp++) {
- if (!gisdigit((int)*cp)) {
- numeric = 0;
- break;
- }
- }
-
- if (numeric) {
- for (cp = rhs; *cp; cp++) {
- if (!gisdigit((int)*cp)) {
- numeric = 0;
- break;
- }
- }
- }
-
- if (numeric) {
- l = gatoi(lhs);
- r = gatoi(rhs);
- switch (rel) {
- case EXPR_PLUS:
- lval = l + r;
- break;
- case EXPR_INC:
- lval = l + 1;
- break;
- case EXPR_MINUS:
- lval = l - r;
- break;
- case EXPR_DEC:
- lval = l - 1;
- break;
- case EXPR_MUL:
- lval = l * r;
- break;
- case EXPR_DIV:
- if (r != 0) {
- lval = l / r;
- } else {
- lval = 0;
- }
- break;
- case EXPR_MOD:
- if (r != 0) {
- lval = l % r;
- } else {
- lval = 0;
- }
- break;
- case EXPR_LSHIFT:
- lval = l << r;
- break;
- case EXPR_RSHIFT:
- lval = l >> r;
- break;
- case EXPR_EQ:
- lval = l == r;
- break;
- case EXPR_NOTEQ:
- lval = l != r;
- break;
- case EXPR_LESS:
- lval = (l < r) ? 1 : 0;
- break;
- case EXPR_LESSEQ:
- lval = (l <= r) ? 1 : 0;
- break;
- case EXPR_GREATER:
- lval = (l > r) ? 1 : 0;
- break;
- case EXPR_GREATEREQ:
- lval = (l >= r) ? 1 : 0;
- break;
- case EXPR_BOOL_COMP:
- lval = (r == 0) ? 1 : 0;
- break;
- default:
- ejError(ep, T("Bad operator %d"), rel);
- return -1;
- }
-
- } else {
- switch (rel) {
- case EXPR_PLUS:
- clearString(&ep->result);
- appendString(&ep->result, lhs);
- appendString(&ep->result, rhs);
- return 0;
- case EXPR_LESS:
- lval = gstrcmp(lhs, rhs) < 0;
- break;
- case EXPR_LESSEQ:
- lval = gstrcmp(lhs, rhs) <= 0;
- break;
- case EXPR_GREATER:
- lval = gstrcmp(lhs, rhs) > 0;
- break;
- case EXPR_GREATEREQ:
- lval = gstrcmp(lhs, rhs) >= 0;
- break;
- case EXPR_EQ:
- lval = gstrcmp(lhs, rhs) == 0;
- break;
- case EXPR_NOTEQ:
- lval = gstrcmp(lhs, rhs) != 0;
- break;
- case EXPR_INC:
- case EXPR_DEC:
- case EXPR_MINUS:
- case EXPR_DIV:
- case EXPR_MOD:
- case EXPR_LSHIFT:
- case EXPR_RSHIFT:
- default:
- ejError(ep, T("Bad operator"));
- return -1;
- }
- }
-
- webs_stritoa(lval, buf, sizeof(buf));
- setString(B_L, &ep->result, buf);
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Evaluate a function
- */
-
-static int evalFunction(ej_t *ep)
-{
- sym_t *sp;
- int (*fn)(int eid, void *handle, int argc, char_t **argv);
-
- if ((sp = symLookup(ep->functions, ep->func->fname)) == NULL) {
- ejError(ep, T("Undefined procedure %s"), ep->func->fname);
- return -1;
- }
-
- fn = (int (*)(int, void*, int, char_t**)) sp->content.value.integer;
- if (fn == NULL) {
- ejError(ep, T("Undefined procedure %s"), ep->func->fname);
- return -1;
- }
-
- return (*fn)(ep->eid, ep->userHandle, ep->func->nArgs,
- ep->func->args);
-}
-
-/******************************************************************************/
-/*
- * Output a parse ej_error message
- */
-
-void ejError(ej_t* ep, char_t* fmt, ...)
-{
- va_list args;
- ejinput_t *ip;
- char_t *errbuf, *msgbuf;
-
- a_assert(ep);
- a_assert(fmt);
- ip = ep->input;
-
- va_start(args, fmt);
- msgbuf = NULL;
- fmtValloc(&msgbuf, E_MAX_ERROR, fmt, args);
- va_end(args);
-
- if (ep && ip) {
- fmtAlloc(&errbuf, E_MAX_ERROR, T("%s\n At line %d, line => \n\n%s\n"),
- msgbuf, ip->lineNumber, ip->line);
- bfreeSafe(B_L, ep->error);
- ep->error = errbuf;
- }
- bfreeSafe(B_L, msgbuf);
-}
-
-/******************************************************************************/
-/*
- * Clear a string value
- */
-
-static void clearString(char_t **ptr)
-{
- a_assert(ptr);
-
- if (*ptr) {
- bfree(B_L, *ptr);
- }
- *ptr = NULL;
-}
-
-/******************************************************************************/
-/*
- * Set a string value
- */
-
-static void setString(B_ARGS_DEC, char_t **ptr, char_t *s)
-{
- a_assert(ptr);
-
- if (*ptr) {
- bfree(B_ARGS, *ptr);
- }
- *ptr = bstrdup(B_ARGS, s);
-}
-
-/******************************************************************************/
-/*
- * Append to the pointer value
- */
-
-static void appendString(char_t **ptr, char_t *s)
-{
- int len, oldlen;
-
- a_assert(ptr);
-
- if (*ptr) {
- len = gstrlen(s);
- oldlen = gstrlen(*ptr);
- *ptr = brealloc(B_L, *ptr, (len + oldlen + 1) * sizeof(char_t));
- gstrcpy(&(*ptr)[oldlen], s);
- } else {
- *ptr = bstrdup(B_L, s);
- }
-}
-
-/******************************************************************************/
-/*
- * Define a function
- */
-
-int ejSetGlobalFunction(int eid, char_t *name,
- int (*fn)(int eid, void *handle, int argc, char_t **argv))
-{
- ej_t *ep;
-
- if ((ep = ejPtr(eid)) == NULL) {
- return -1;
- }
- return ejSetGlobalFunctionDirect(ep->functions, name, fn);
-}
-
-/******************************************************************************/
-/*
- * Define a function directly into the function symbol table.
- */
-
-int ejSetGlobalFunctionDirect(sym_fd_t functions, char_t *name,
- int (*fn)(int eid, void *handle, int argc, char_t **argv))
-{
- if (symEnter(functions, name, valueInteger((long) fn), 0) == NULL) {
- return -1;
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Remove ("undefine") a function
- */
-
-int ejRemoveGlobalFunction(int eid, char_t *name)
-{
- ej_t *ep;
-
- if ((ep = ejPtr(eid)) == NULL) {
- return -1;
- }
- return symDelete(ep->functions, name);
-}
-
-/******************************************************************************/
-/*
- * Get a function definition
- */
-
-void *ejGetGlobalFunction(int eid, char_t *name)
-{
- ej_t *ep;
- sym_t *sp;
- int (*fn)(int eid, void *handle, int argc, char_t **argv);
-
- if ((ep = ejPtr(eid)) == NULL) {
- return NULL;
- }
-
- if ((sp = symLookup(ep->functions, name)) != NULL) {
- fn = (int (*)(int, void*, int, char_t**)) sp->content.value.integer;
- return (void*) fn;
- }
- return NULL;
-}
-
-/******************************************************************************/
-/*
- * Utility routine to crack Ejscript arguments. Return the number of args
- * seen. This routine only supports %s and %d type args.
- *
- * Typical usage:
- *
- * if (ejArgs(argc, argv, "%s %d", &name, &age) < 2) {
- * error("Insufficient args\n");
- * return -1;
- * }
- */
-
-int ejArgs(int argc, char_t **argv, char_t *fmt, ...)
-{
- va_list vargs;
- char_t *cp, **sp;
- int *ip;
- int argn;
-
- va_start(vargs, fmt);
-
- if (argv == NULL) {
- return 0;
- }
-
- for (argn = 0, cp = fmt; cp && *cp && argv[argn]; ) {
- if (*cp++ != '%') {
- continue;
- }
-
- switch (*cp) {
- case 'd':
- ip = va_arg(vargs, int*);
- *ip = gatoi(argv[argn]);
- break;
-
- case 's':
- sp = va_arg(vargs, char_t**);
- *sp = argv[argn];
- break;
-
- default:
-/*
- * Unsupported
- */
- a_assert(0);
- }
- argn++;
- }
-
- va_end(vargs);
- return argn;
-}
-
-/******************************************************************************/
-/*
- * Define the user handle
- */
-
-void ejSetUserHandle(int eid, void* handle)
-{
- ej_t *ep;
-
- if ((ep = ejPtr(eid)) == NULL) {
- return;
- }
- ep->userHandle = handle;
-}
-
-/******************************************************************************/
-/*
- * Get the user handle
- */
-
-void* ejGetUserHandle(int eid)
-{
- ej_t *ep;
-
- if ((ep = ejPtr(eid)) == NULL) {
- return NULL;
- }
- return ep->userHandle;
-}
-
-/******************************************************************************/
-/*
- * Get the current line number
- */
-
-int ejGetLineNumber(int eid)
-{
- ej_t *ep;
-
- if ((ep = ejPtr(eid)) == NULL) {
- return -1;
- }
- return ep->input->lineNumber;
-}
-
-/******************************************************************************/
-/*
- * Set the result
- */
-
-void ejSetResult(int eid, char_t *s)
-{
- ej_t *ep;
-
- if ((ep = ejPtr(eid)) == NULL) {
- return;
- }
- setString(B_L, &ep->result, s);
-}
-
-/******************************************************************************/
-/*
- * Get the result
- */
-
-char_t *ejGetResult(int eid)
-{
- ej_t *ep;
-
- if ((ep = ejPtr(eid)) == NULL) {
- return NULL;
- }
- return ep->result;
-}
-
-/******************************************************************************/
-/*
- * Set a variable. Note: a variable with a value of NULL means declared but
- * undefined. The value is defined in the top-most variable frame.
- */
-
-void ejSetVar(int eid, char_t *var, char_t *value)
-{
- ej_t *ep;
- value_t v;
-
- a_assert(var && *var);
-
- if ((ep = ejPtr(eid)) == NULL) {
- return;
- }
-
- if (value == NULL) {
- v = valueString(value, 0);
- } else {
- v = valueString(value, VALUE_ALLOCATE);
- }
- symEnter(ep->variables[ep->variableMax - 1] - EJ_OFFSET, var, v, 0);
-}
-
-/******************************************************************************/
-/*
- * Set a local variable. Note: a variable with a value of NULL means
- * declared but undefined. The value is defined in the top-most variable frame.
- */
-
-void ejSetLocalVar(int eid, char_t *var, char_t *value)
-{
- ej_t *ep;
- value_t v;
-
- a_assert(var && *var);
-
- if ((ep = ejPtr(eid)) == NULL) {
- return;
- }
-
- if (value == NULL) {
- v = valueString(value, 0);
- } else {
- v = valueString(value, VALUE_ALLOCATE);
- }
- symEnter(ep->variables[ep->variableMax - 1] - EJ_OFFSET, var, v, 0);
-}
-
-/******************************************************************************/
-/*
- * Set a global variable. Note: a variable with a value of NULL means
- * declared but undefined. The value is defined in the global variable frame.
- */
-
-void ejSetGlobalVar(int eid, char_t *var, char_t *value)
-{
- ej_t *ep;
- value_t v;
-
- a_assert(var && *var);
-
- if ((ep = ejPtr(eid)) == NULL) {
- return;
- }
-
- if (value == NULL) {
- v = valueString(value, 0);
- } else {
- v = valueString(value, VALUE_ALLOCATE);
- }
- symEnter(ep->variables[0] - EJ_OFFSET, var, v, 0);
-}
-
-/******************************************************************************/
-/*
- * Get a variable
- */
-
-int ejGetVar(int eid, char_t *var, char_t **value)
-{
- ej_t *ep;
- sym_t *sp;
- int i;
-
- a_assert(var && *var);
- a_assert(value);
-
- if ((ep = ejPtr(eid)) == NULL) {
- return -1;
- }
-
- i = ep->variableMax - 1;
- if ((sp = symLookup(ep->variables[i] - EJ_OFFSET, var)) == NULL) {
- i = 0;
- if ((sp = symLookup(ep->variables[0] - EJ_OFFSET, var)) == NULL) {
- return -1;
- }
- }
- a_assert(sp->content.type == string);
- *value = sp->content.value.string;
- return i;
-}
-
-/******************************************************************************/
-/*
- * Get the variable symbol table
- */
-
-sym_fd_t ejGetVariableTable(int eid)
-{
- ej_t *ep;
-
- if ((ep = ejPtr(eid)) == NULL) {
- return -1;
- }
- return *ep->variables;
-}
-
-/******************************************************************************/
-/*
- * Get the functions symbol table
- */
-
-sym_fd_t ejGetFunctionTable(int eid)
-{
- ej_t *ep;
-
- if ((ep = ejPtr(eid)) == NULL) {
- return -1;
- }
- return ep->functions;
-}
-
-/******************************************************************************/
-/*
- * Free an argument list
- */
-
-static void freeFunc(ejfunc_t *func)
-{
- int i;
-
- for (i = func->nArgs - 1; i >= 0; i--) {
- bfree(B_L, func->args[i]);
- func->nArgs = hFree((void***) &func->args, i);
- }
-
- if (func->fname) {
- bfree(B_L, func->fname);
- func->fname = NULL;
- }
-}
-
-/******************************************************************************/
-/*
- * Get Ejscript pointer
- */
-
-static ej_t *ejPtr(int eid)
-{
- a_assert(0 <= eid && eid < ejMax);
-
- if (eid < 0 || eid >= ejMax || ejHandles[eid] == NULL) {
- ejError(NULL, T("Bad handle %d"), eid);
- return NULL;
- }
- return ejHandles[eid];
-}
-
-/******************************************************************************/
-/*
- * This function removes any new lines. Used for else cases, etc.
- */
-static void ejRemoveNewlines(ej_t *ep, int state)
-{
- int tid;
-
- do {
- tid = ejLexGetToken(ep, state);
- } while (tid == TOK_NEWLINE);
-
- ejLexPutbackToken(ep, tid, ep->token);
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/emfdb.c b/xbmc/lib/libGoAhead/src/emfdb.c deleted file mode 100644 index c1fd7d1cdc..0000000000 --- a/xbmc/lib/libGoAhead/src/emfdb.c +++ /dev/null @@ -1,1076 +0,0 @@ -/*
- * emfdb.c -- EMF database compatability functions for GoAhead WebServer.
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: emfdb.c,v 1.4 2003/09/29 19:48:08 bporter Exp $
- */
-
-/******************************** Description *********************************/
-/*
- * Textfile-based database support for WebServer 2.1.
- */
-
-/********************************* Includes ***********************************/
-
-#include "emfdb.h"
-#include "wsIntrn.h"
-
-/********************************* Defines ************************************/
-
-#define KEYWORD_TABLE T("TABLE")
-#define KEYWORD_ROW T("ROW")
-
-/*********************************** Locals ***********************************/
-
-/*
- * Variable to support the basicSet and basicGet functions.
- */
-
-static char_t *basicProdDir = NULL;
-static char_t *basicDefaultDir = T("."); /* Default set to current */
-
-/*
- * hAlloc chain list of table schemas to be closed
- */
-
-static int dbMaxTables = 0;
-static dbTable_t **dbListTables = NULL;
-
-/****************************** Forward Declarations **************************/
-
-static int crack(char_t *buf, char_t **key, char_t **val);
-static char_t *trim(char_t *str);
-static int GetColumnIndex(int tid, char_t *colName);
-
-/******************************************************************************/
-/*
- * Add a schema to the module-internal schema database
- */
-
-int dbRegisterDBSchema(dbTable_t *pTableRegister)
-{
- dbTable_t *pTable;
- int tid;
-
- a_assert(pTableRegister);
-
- trace(4, T("DB: Registering database table <%s>\n"),
- pTableRegister->name);
-
-/*
- * Bump up the size of the table array
- */
- tid = hAllocEntry((void***) &dbListTables,
- &dbMaxTables, sizeof(dbTable_t));
-
-/*
- * Copy the table schema to the last spot in schema array
- */
- a_assert(dbListTables);
- pTable = dbListTables[tid];
- a_assert(pTable);
-
-/*
- * Copy the name of the table
- */
- pTable->name = bstrdup(B_L, pTableRegister->name);
-
-/*
- * Copy the number of columns
- */
- pTable->nColumns = pTableRegister->nColumns;
-
-/*
- * Copy the column definitions
- */
- if (pTable->nColumns > 0) {
- int i;
- pTable->columnNames = balloc(B_L, sizeof(char_t *) * pTable->nColumns);
- pTable->columnTypes = balloc(B_L, sizeof(int *) * pTable->nColumns);
-
- for (i = 0; (i < pTableRegister->nColumns); i++) {
- pTable->columnNames[i] =
- bstrdup(B_L, pTableRegister->columnNames[i]);
- pTable->columnTypes[i] = pTableRegister->columnTypes[i];
- }
-
- } else {
- pTable->columnNames = NULL;
- pTable->columnTypes = NULL;
- }
-
-/*
- * Zero out the table's data (very important!)
- */
- pTable->nRows = 0;
- pTable->rows = NULL;
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * This is provided for compatibility with EMF. Tables are "registered"
- * with staticly defined schemas. There is only one did in this package: 0.
- */
-
-int dbOpen(char_t *tablename, char_t *filename,
- int (*gettime)(int did), int flags)
-{
- basicProdDir = NULL;
- basicDefaultDir = T(".");
- dbMaxTables = 0;
- dbListTables = NULL;
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Delete all the rows of the tables, and all of the tables
- */
-
-void dbClose(int did)
-{
- int table, column;
- dbTable_t *pTable;
-
-/*
- * Before doing anything, delete all the contents of the database
- */
- dbZero(did);
-
-/*
- * Now delete the tables
- */
- for (table = 0; table < dbMaxTables; table++) {
- pTable = dbListTables[table];
-
- if (pTable != NULL) {
-/*
- * Delete the table schema
- */
- if (pTable->nColumns) {
- for (column = 0; column < pTable->nColumns; column++) {
- bfreeSafe(B_L, pTable->columnNames[column]);
- }
- bfreeSafe(B_L, pTable->columnNames);
- bfreeSafe(B_L, pTable->columnTypes);
- }
-/*
- * Delete the table name
- */
- bfreeSafe(B_L, pTable->name);
-/*
- * Free the table
- */
- bfreeSafe(B_L, pTable);
- hFree((void ***) &dbListTables, table);
- }
- }
-
- if (dbListTables) {
- bfree(B_L, dbListTables);
- }
-
-/*
- * Set the global table list to a safe value
- */
- dbListTables = NULL;
- dbMaxTables = 0;
-}
-
-
-/******************************************************************************/
-/*
- * Delete all the data records in all tables
- */
-
-void dbZero(int did)
-{
- int table, row, column, nRows, nColumns;
- int *pRow;
- dbTable_t *pTable;
-
-/*
- * Delete all data from all tables
- */
- for (table = 0; table < dbMaxTables; table++) {
- pTable = dbListTables[table];
-/*
- * Delete the row data contained within the schema
- */
- if (pTable) {
- nColumns = pTable->nColumns;
- nRows = pTable->nRows;
- for (row = 0; row < nRows; row++) {
- pRow = pTable->rows[row];
- if (pRow) {
-/*
- * Only delete the contents of rows not previously deleted!
- */
- for (column = 0; column < nColumns; column++) {
- if (pTable->columnTypes[column] == T_STRING) {
- bfreeSafe(B_L, (char_t *)(pRow[column]));
- pRow[column] = (int)NULL;
- }
- }
-
- bfreeSafe(B_L, pRow);
- hFree((void ***) &pTable->rows, row);
- }
- }
-
- pTable->rows = NULL;
- pTable->nRows = 0;
- }
- }
-}
-
-/******************************************************************************/
-/*
- * Find the a row in the table with the given string in the given column
- */
-
-int dbSearchStr(int did, char_t *tablename,
- char_t *colName, char_t *value, int flags)
-{
- int tid, nRows, nColumns, column;
- int match = 0;
- dbTable_t *pTable;
-
- a_assert(tablename);
- a_assert(colName);
- a_assert(value);
-
- tid = dbGetTableId(0, tablename);
- a_assert(tid >= 0);
-
- if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) {
- pTable = dbListTables[tid];
- } else {
- return DB_ERR_TABLE_NOT_FOUND;
- }
-
- nColumns = pTable->nColumns;
- nRows = pTable->nRows;
- column = GetColumnIndex(tid, colName);
- a_assert (column >= 0);
-
- if (column >= 0) {
- char_t *compareVal;
- int row, *pRow;
-/*
- * Scan through rows until we find a match.
- * Note that some of these rows may be deleted!
- */
- row = 0;
- while (row < nRows) {
- pRow = pTable->rows[row];
- if (pRow) {
- compareVal = (char_t *)(pRow[column]);
- if (NULL != compareVal)
- {
- if (DB_CASE_INSENSITIVE == flags)
- {
- match = gstricmp(compareVal, value);
- }
- else
- {
- match = gstrcmp(compareVal, value);
- }
- if (0 == match)
- {
- return row;
- }
- }
- }
- row++;
- }
- } else {
-/*
- * Return -2 if search column was not found
- */
- trace(3, T("DB: Unable to find column <%s> in table <%s>\n"),
- colName, tablename);
- return DB_ERR_COL_NOT_FOUND;
- }
-
- return -1;
-}
-
-/******************************************************************************/
-/*
- * Add a new row to the given table. Return the new row ID.
- */
-
-int dbAddRow(int did, char_t *tablename)
-{
- int tid, size;
- dbTable_t *pTable;
-
- a_assert(tablename);
-
- tid = dbGetTableId(0, tablename);
- a_assert(tid >= 0);
-
- if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) {
- pTable = dbListTables[tid];
- } else {
- return DB_ERR_TABLE_NOT_FOUND;
- }
-
- a_assert(pTable);
-
- if (pTable) {
- trace(5, T("DB: Adding a row to table <%s>\n"), tablename);
-
- size = pTable->nColumns * max(sizeof(int), sizeof(char_t *));
- return hAllocEntry((void***) &(pTable->rows), &(pTable->nRows), size);
- }
-
- return -1;
-}
-
-/******************************************************************************/
-/*
- * Delete a row in the table.
- */
-
-int dbDeleteRow(int did, char_t *tablename, int row)
-{
- int tid, nColumns, nRows;
- dbTable_t *pTable;
-
- a_assert(tablename);
- tid = dbGetTableId(0, tablename);
- a_assert(tid >= 0);
-
- if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) {
- pTable = dbListTables[tid];
- } else {
- return DB_ERR_TABLE_NOT_FOUND;
- }
-
- nColumns = pTable->nColumns;
- nRows = pTable->nRows;
-
- if ((row >= 0) && (row < nRows)) {
- int *pRow = pTable->rows[row];
-
- if (pRow) {
- int column = 0;
-/*
- * Free up any allocated strings
- */
- while (column < nColumns) {
- if (pRow[column] &&
- (pTable->columnTypes[column] == T_STRING)) {
- bfree(B_L, (char_t *)pRow[column]);
- }
-
- column++;
- }
-/*
- * Zero out the row for safety
- */
- memset(pRow, 0, nColumns * max(sizeof(int), sizeof(char_t *)));
-
- bfreeSafe(B_L, pRow);
- pTable->nRows = hFree((void ***)&pTable->rows, row);
- trace(5, T("DB: Deleted row <%d> from table <%s>\n"),
- row, tablename);
- }
- return 0;
- } else {
- trace(3, T("DB: Unable to delete row <%d> from table <%s>\n"),
- row, tablename);
- }
-
- return -1;
-}
-
-/*****************************************************************************/
-/*
- * Grow the rows in the table to the nominated size.
- */
-
-int dbSetTableNrow(int did, char_t *tablename, int nNewRows)
-{
- int nRet, tid, nRows, nColumns;
- dbTable_t *pTable;
-
- a_assert(tablename);
- tid = dbGetTableId(0, tablename);
- a_assert(tid >= 0) ;
-
- if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) {
- pTable = dbListTables[tid];
- } else {
- return DB_ERR_TABLE_NOT_FOUND;
- }
-
- nRet = -1;
-
- a_assert(pTable);
- if (pTable) {
- nColumns = pTable->nColumns;
- nRows = pTable->nRows;
- nRet = 0;
-
- if (nRows >= nNewRows) {
-/*
- * If number of rows already allocated exceeds requested number, do nothing
- */
- trace(4, T("DB: Ignoring row set to <%d> in table <%s>\n"),
- nNewRows, tablename);
- } else {
- trace(4, T("DB: Setting rows to <%d> in table <%s>\n"),
- nNewRows, tablename);
- while (pTable->nRows < nNewRows) {
- if (dbAddRow(did, tablename) < 0) {
- return -1;
- }
- }
- }
- }
-
- return nRet;
-}
-
-/******************************************************************************/
-/*
- * Return the number of rows in the given table
- */
-
-int dbGetTableNrow(int did, char_t *tablename)
-{
- int tid;
-
- a_assert(tablename);
- tid = dbGetTableId(did, tablename);
-
- if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) {
- return (dbListTables[tid])->nRows;
- } else {
- return -1;
- }
-}
-
-/******************************************************************************/
-/*
- * Do table driven read of the database
- */
-
-int dbReadInt(int did, char_t *table, char_t *column, int row, int *returnValue)
-{
- int colIndex, *pRow, tid;
- dbTable_t *pTable;
-
- a_assert(table);
- a_assert(column);
- a_assert(returnValue);
-
- tid = dbGetTableId(0, table);
- a_assert(tid >= 0);
-
-/*
- * Return -6 if table is not found
- */
- if (tid < 0) {
- return DB_ERR_TABLE_NOT_FOUND;
- }
-
-/*
- * Return -7 if table id has been deleted
- */
- pTable = dbListTables[tid];
- if (pTable == NULL) {
- return DB_ERR_TABLE_DELETED;
- }
-
- a_assert(row >= 0);
-
- if ((row >= 0) && (row < pTable->nRows)) {
- colIndex = GetColumnIndex(tid, column);
- a_assert(colIndex >= 0);
-
- if (colIndex >= 0) {
- pRow = pTable->rows[row];
- if (pRow) {
- *returnValue = pRow[colIndex];
- return 0;
- }
- return DB_ERR_ROW_DELETED;
- }
- return DB_ERR_COL_NOT_FOUND;
- }
-
- return DB_ERR_ROW_NOT_FOUND;
-}
-
-/******************************************************************************/
-/*
- * dbReadStr calls dbReadInt to do table driven read of database
- */
-
-int dbReadStr(int did, char_t *table, char_t *column, int row,
- char_t **returnValue)
-{
- return dbReadInt(did, table, column, row, (int *)returnValue);
-}
-
-/******************************************************************************/
-/*
- * The dbWriteInt function writes a value into a table at a given row and
- * column. The existence of the row and column is verified before the
- * write. 0 is returned on succes, -1 is returned on error.
- */
-
-int dbWriteInt(int did, char_t *table, char_t *column, int row, int iData)
-{
- int tid, colIndex, *pRow;
- dbTable_t *pTable;
-
- a_assert(table);
- a_assert(column);
-
-/*
- * Make sure that this table exists
- */
- tid = dbGetTableId(0, table);
- a_assert(tid >= 0);
-
- if (tid < 0) {
- return DB_ERR_TABLE_NOT_FOUND;
- }
-
- pTable = dbListTables[tid];
-
- if (pTable) {
-/*
- * Make sure that the column exists
- */
- colIndex = GetColumnIndex(tid, column);
- a_assert(colIndex >= 0);
- if (colIndex >= 0) {
-/*
- * Make sure that the row exists
- */
- a_assert((row >= 0) && (row < pTable->nRows));
- if ((row >= 0) && (row < pTable->nRows)) {
- pRow = pTable->rows[row];
- if (pRow) {
- pRow[colIndex] = iData;
- return 0;
- }
- return DB_ERR_ROW_DELETED;
- }
- return DB_ERR_ROW_NOT_FOUND;
- }
- return DB_ERR_COL_NOT_FOUND;
- }
-
- return DB_ERR_TABLE_DELETED;
-}
-
-/******************************************************************************/
-/*
- * The dbWriteStr function writes a string value into a table at a given row
- * and column. The existence of the row and column is verified before the
- * write. The column is also checked to confirm it is a string field.
- * 0 is returned on succes, -1 is returned on error.
- */
-
-int dbWriteStr(int did, char_t *table, char_t *column, int row, char_t *s)
-{
- int tid, colIndex;
- int *pRow;
- char_t *ptr;
- dbTable_t *pTable;
-
- a_assert(table);
- a_assert(column);
-
- tid = dbGetTableId(0, table);
- a_assert(tid >= 0);
-
- if (tid < 0) {
- return DB_ERR_TABLE_NOT_FOUND;
- }
-
-/*
- * Make sure that this table exists
- */
- pTable = dbListTables[tid];
- a_assert(pTable);
- if (!pTable) {
- return DB_ERR_TABLE_DELETED;
- }
-
-/*
- * Make sure that this column exists
- */
- colIndex = GetColumnIndex(tid, column);
- if (colIndex < 0) {
- return DB_ERR_COL_NOT_FOUND;
- }
-
-/*
- * Make sure that this column is a string column
- */
- if (pTable->columnTypes[colIndex] != T_STRING) {
- return DB_ERR_BAD_FORMAT;
- }
-
-/*
- * Make sure that the row exists
- */
- a_assert((row >= 0) && (row < pTable->nRows));
- if ((row >= 0) && (row < pTable->nRows)) {
- pRow = pTable->rows[row];
- } else {
- return DB_ERR_ROW_NOT_FOUND;
- }
-
- if (!pRow) {
- return DB_ERR_ROW_DELETED;
- }
-
-/*
- * If the column already has a value, be sure to delete it to prevent
- * memory leaks.
- */
- if (pRow[colIndex]) {
- bfree(B_L, (char_t *) pRow[colIndex]);
- }
-
-/*
- * Make sure we make a copy of the string to write into the column.
- * This allocated string will be deleted when the row is deleted.
- */
- ptr = bstrdup(B_L, s);
- pRow[colIndex] = (int)ptr;
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Print a key-value pair to a file
- */
-
-static int dbWriteKeyValue(int fd, char_t *key, char_t *value)
-{
- int rc;
- int len;
- char_t *pLineOut;
-
- a_assert(key && *key);
- a_assert(value);
-
- fmtAlloc(&pLineOut, BUF_MAX, T("%s=%s\n"), key, value);
-
- if (pLineOut) {
- len = gstrlen(pLineOut);
-#ifdef CE
- rc = writeUniToAsc(fd, pLineOut, len);
-#else
- rc = gwrite(fd, pLineOut, len);
-#endif
- bfree(B_L, pLineOut);
- } else {
- rc = -1;
- }
-
- return rc;
-}
-
-/******************************************************************************/
-/*
- * Persist a database to a file
- */
-
-int dbSave(int did, char_t *filename, int flags)
-{
- int row, column, nColumns, nRows, fd, rc;
- int *colTypes, *pRow, nRet, tid;
- char_t *path, *tmpFile, *tmpNum;
- char_t **colNames;
- dbTable_t *pTable;
-
- trace(5, T("DB: About to save database to file\n"));
-
- a_assert(dbMaxTables > 0);
-
-/*
- * First write to a temporary file, then switch around later.
- */
-#ifndef LINUX - fmtAlloc(&tmpFile, FNAMESIZE, T("%s\\data.tmp"), basicGetProductDir());
-#else - fmtAlloc(&tmpFile, FNAMESIZE, T("%s/data.tmp"), basicGetProductDir());
-#endif - if ((fd = gopen(tmpFile,
- O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666)) < 0) {
- trace(1, T("WARNING: Failed to open file %s\n"), tmpFile);
- bfree(B_L, tmpFile);
- return -1;
- }
-
- nRet = 0;
-
- for (tid = 0; (tid < dbMaxTables) && (nRet != -1); tid++) {
- pTable = dbListTables[tid];
-
- if (pTable) {
-/*
- * Print the TABLE=tableName directive to the file
- */
- rc = dbWriteKeyValue(fd, KEYWORD_TABLE, pTable->name);
-
- nColumns = pTable->nColumns;
- nRows = pTable->nRows;
-
- for (row = 0; (row < nRows) && (nRet == 0); row++) {
- pRow = pTable->rows[row];
-/*
- * if row is NULL, the row has been deleted, so don't
- * write it out.
- */
- if ((pRow == NULL) || (pRow[0] == '\0') ||
- (*(char_t *)(pRow[0]) == '\0')) {
- continue;
- }
-/*
- * Print the ROW=rowNumber directive to the file
- */
- fmtAlloc(&tmpNum, 20, T("%d"), row);
- rc = dbWriteKeyValue(fd, KEYWORD_ROW, tmpNum);
- bfreeSafe(B_L, tmpNum);
-
- colNames = pTable->columnNames;
- colTypes = pTable->columnTypes;
-/*
- * Print the key-value pairs (COLUMN=value) for data cells
- */
- for (column = 0; (column < nColumns) && (rc >= 0);
- column++, colNames++, colTypes++) {
- if (*colTypes == T_STRING) {
- rc = dbWriteKeyValue(fd, *colNames,
- (char_t *)(pRow[column]));
- } else {
- fmtAlloc(&tmpNum, 20, T("%d"), pRow[column]);
- rc = dbWriteKeyValue(fd, *colNames, tmpNum);
- bfreeSafe(B_L, tmpNum);
- }
- }
-
- if (rc < 0) {
- trace(1, T("WARNING: Failed to write to file %s\n"),
- tmpFile);
- nRet = -1;
- }
- }
- }
- }
-
- gclose(fd);
-
-/*
- * Replace the existing file with the temporary file, if no errors
- */
- if (nRet == 0) {
-#ifndef LINUX - fmtAlloc(&path, FNAMESIZE, T("%s\\%s"), basicGetProductDir(), filename);
-#else - fmtAlloc(&path, FNAMESIZE, T("%s/%s"), basicGetProductDir(), filename);
-#endif -
- gunlink(path);
- if (grename(tmpFile, path) != 0) {
- trace(1, T("WARNING: Failed to rename %s to %s\n"), tmpFile, path);
- nRet = -1;
- }
-
- bfree(B_L, path);
- }
-
- bfree(B_L, tmpFile);
-
- return nRet;
-}
-
-/******************************************************************************/
-/*
- * Crack a keyword=value string into keyword and value. We can change buf.
- */
-
-static int crack(char_t *buf, char_t **key, char_t **val)
-{
- char_t *ptr;
-
- if ((ptr = gstrrchr(buf, '\n')) != NULL ||
- (ptr = gstrrchr(buf, '\r')) != NULL) {
- *ptr = '\0';
- }
-
-/*
- * Find the = sign. It must exist.
- */
- if ((ptr = gstrstr(buf, T("="))) == NULL) {
- return -1;
- }
-
- *ptr++ = '\0';
- *key = trim(buf);
- *val = trim(ptr);
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Parse the file. These files consist of key-value pairs, separated by the
- * "=" sign. Parsing of tables starts with the "TABLE=value" pair, and rows
- * are parsed starting with the "ROW=value" pair.
- */
-
-int dbLoad(int did, char_t *filename, int flags)
-{
- gstat_t sbuf;
- char_t *buf, *keyword, *value, *path, *ptr;
- char_t *tablename;
- int fd, tid, row;
- dbTable_t *pTable;
-
- a_assert(did >= 0);
- -#ifndef LINUX
- fmtAlloc(&path, FNAMESIZE, T("%s\\%s"), basicGetProductDir(), filename); -#else - fmtAlloc(&path, FNAMESIZE, T("%s/%s"), basicGetProductDir(), filename); -#endif - trace(4, T("DB: About to read data file <%s>\n"), path);
-
- if (gstat(path, &sbuf) < 0) {
- trace(3, T("DB: Failed to stat persistent data file.\n"));
- bfree(B_L, path);
- return -1;
- }
-
- fd = gopen(path, O_RDONLY | O_BINARY, 0666);
- bfree(B_L, path);
-
- if (fd < 0) {
- trace(3, T("DB: No persistent data file present.\n"));
- return -1;
- }
-
- if (sbuf.st_size <= 0) {
- trace(3, T("DB: Persistent data file is empty.\n"));
- gclose(fd);
- return -1;
- }
-/*
- * Read entire file into temporary buffer
- */
- buf = balloc(B_L, sbuf.st_size + 1);
-#ifdef CE
- if (readAscToUni(fd, &buf, sbuf.st_size) != (int)sbuf.st_size) {
-#else
- if (gread(fd, buf, sbuf.st_size) != (int)sbuf.st_size) {
-#endif
- trace(3, T("DB: Persistent data read failed.\n"));
- bfree(B_L, buf);
- gclose(fd);
- return -1;
- }
-
- gclose(fd);
- *(buf + sbuf.st_size) = '\0';
-
- row = -1;
- tid = -1;
- pTable = NULL;
- ptr = gstrtok(buf, T("\n"));
- tablename = NULL;
-
- do {
- if (crack(ptr, &keyword, &value) < 0) {
- trace(5, T("DB: Failed to crack line %s\n"), ptr);
- continue;
- }
-
- a_assert(keyword && *keyword);
-
- if (gstrcmp(keyword, KEYWORD_TABLE) == 0) {
-/*
- * Table name found, check to see if it's registered
- */
- if (tablename) {
- bfree(B_L, tablename);
- }
-
- tablename = bstrdup(B_L, value);
- tid = dbGetTableId(did, tablename);
-
- if (tid >= 0) {
- pTable = dbListTables[tid];
- } else {
- pTable = NULL;
- }
-
- } else if (gstrcmp(keyword, KEYWORD_ROW) == 0) {
-/*
- * Row/Record indicator found, add a new row to table
- */
- if (tid >= 0) {
- int nRows = dbGetTableNrow(did, tablename);
-
- if (dbSetTableNrow(did, tablename, nRows + 1) == 0) {
- row = nRows;
- }
- }
-
- } else if (row != -1) {
-/*
- * some other data found, assume it's a COLUMN=value
- */
- int nColumn = GetColumnIndex(tid, keyword);
-
- if ((nColumn >= 0) && (pTable != NULL)) {
- int nColumnType = pTable->columnTypes[nColumn];
- if (nColumnType == T_STRING) {
- dbWriteStr(did, tablename, keyword, row, value);
- } else {
- dbWriteInt(did, tablename, keyword, row, gstrtoi(value));
- }
- }
- }
- } while ((ptr = gstrtok(NULL, T("\n"))) != NULL);
-
- if (tablename) {
- bfree(B_L, tablename);
- }
-
- bfree(B_L, buf);
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Return a table id given the table name
- */
-
-int dbGetTableId(int did, char_t *tablename)
-{
- int tid;
- dbTable_t *pTable;
-
- a_assert(tablename);
-
- for (tid = 0; (tid < dbMaxTables); tid++) {
- if ((pTable = dbListTables[tid]) != NULL) {
- if (gstrcmp(tablename, pTable->name) == 0) {
- return tid;
- }
- }
- }
-
- return -1;
-}
-
-/******************************************************************************/
-/*
- * Return a pointer to the table name, given its ID
- */
-
-char_t *dbGetTableName(int did, int tid)
-{
- if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) {
- return (dbListTables[tid])->name;
- }
-
- return NULL;
-}
-
-/******************************************************************************/
-/*
- * Trim leading white space.
- */
-
-static char_t *trim(char_t *str)
-{
- while (isspace((int)*str)) {
- str++;
- }
- return str;
-}
-
-/******************************************************************************/
-/*
- * Return a column index given the column name
- */
-
-static int GetColumnIndex(int tid, char_t *colName)
-{
- int column;
- dbTable_t *pTable;
-
- a_assert(colName);
-
- if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) {
- pTable = dbListTables[tid];
-
- for (column = 0; (column < pTable->nColumns); column++) {
- if (gstrcmp(colName, pTable->columnNames[column]) == 0)
- return column;
- }
- }
-
- return -1;
-}
-
-/******************************************************************************/
-/*
- * Set the prefix-directory
- */
-
-void basicSetProductDir(char_t *proddir)
-{
- int len;
-
- if (basicProdDir != NULL) {
- bfree(B_L, basicProdDir);
- }
-
- basicProdDir = bstrdup(B_L, proddir);
-/*
- * Make sure that prefix-directory doesn't end with a '/'
- */
- len = gstrlen(basicProdDir);
- if ((len > 0) && *(basicProdDir + len - 1) == '/') {
- *(basicProdDir+len-1) = '\0';
- }
-}
-
-/******************************************************************************/
-/*
- * Return the prefix-directory
- */
-
-char_t *basicGetProductDir()
-{
- if (basicProdDir) {
- return basicProdDir;
- } else {
- return basicDefaultDir;
- }
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/emfdb.h b/xbmc/lib/libGoAhead/src/emfdb.h deleted file mode 100644 index c9f228f131..0000000000 --- a/xbmc/lib/libGoAhead/src/emfdb.h +++ /dev/null @@ -1,111 +0,0 @@ -/*
- * emfdb.h -- EMF database compatability functions for GoAhead WebServer.
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: emfdb.h,v 1.3 2003/09/29 19:48:34 bporter Exp $
- */
-
-/******************************** Description *********************************/
-/*
- * Emf-like textfile database support for WebServer 2.1.
- */
-
-/********************************* Includes ***********************************/
-
-#ifndef _h_EMFDB
-#define _h_EMFDB 1
-
-#ifndef UEMF
- #include "basic/basic.h"
- #include "emf/emf.h"
-#else
- #include "uemf.h"
-#endif
-
-
-/********************************* Defines ************************************/
-
-#define T_INT 0
-#define T_STRING 1
-
-#define DB_OK 0
-#define DB_ERR_GENERAL -1
-#define DB_ERR_COL_NOT_FOUND -2
-#define DB_ERR_COL_DELETED -3
-#define DB_ERR_ROW_NOT_FOUND -4
-#define DB_ERR_ROW_DELETED -5
-#define DB_ERR_TABLE_NOT_FOUND -6
-#define DB_ERR_TABLE_DELETED -7
-#define DB_ERR_BAD_FORMAT -8
-
-/*
- * 30 Jun 03 BgP -- pass DB_CASE_INSENSITIVE as the "flags" argument to
- * dbSearchString() to force a case-insensitive search.
- */
-#define DB_CASE_INSENSITIVE 1
-
-typedef struct dbTable_s {
- char_t *name;
- int nColumns;
- char_t **columnNames;
- int *columnTypes;
- int nRows;
- int **rows;
-} dbTable_t;
-
-/********************************** Prototypes ********************************/
-
-/*
- * Add a schema to the module-internal schema database
- */
-extern int dbRegisterDBSchema(dbTable_t *sTable);
-
-extern int dbOpen(char_t *databasename, char_t *filename,
- int (*gettime)(int did), int flags);
-extern void dbClose(int did);
-extern int dbGetTableId(int did, char_t *tname);
-extern char_t *dbGetTableName(int did, int tid);
-extern int dbReadInt(int did, char_t *table, char_t *column, int row,
- int *returnValue);
-extern int dbReadStr(int did, char_t *table, char_t *column, int row,
- char_t **returnValue);
-extern int dbWriteInt(int did, char_t *table, char_t *column, int row,
- int idata);
-extern int dbWriteStr(int did, char_t *table, char_t *column, int row,
- char_t *s);
-extern int dbAddRow(int did, char_t *table);
-extern int dbDeleteRow(int did, char_t *table, int rid);
-extern int dbSetTableNrow(int did, char_t *table, int nNewRows);
-extern int dbGetTableNrow(int did, char_t *table);
-
-/*
- * Dump the contents of a database to file
- */
-extern int dbSave(int did, char_t *filename, int flags);
-
-/*
- * Load the contents of a database to file
- */
-extern int dbLoad(int did, char_t *filename, int flags);
-
-/*
- * Search for a data in a given column
- * 30 Jun 03 BgP: If the value of 'flags' is DB_CASE_INSENSITIVE, use a
- * case-insensitive string compare when searching.
- */
-extern int dbSearchStr(int did, char_t *table, char_t *column,
- char_t *value, int flags);
-
-extern void dbZero(int did);
-
-extern char_t *basicGetProductDir();
-extern void basicSetProductDir(char_t *proddir);
-
-#endif /* _h_EMFDB */
-
-/******************************************************************************/
-
-
diff --git a/xbmc/lib/libGoAhead/src/form.c b/xbmc/lib/libGoAhead/src/form.c deleted file mode 100644 index 83c00c79ff..0000000000 --- a/xbmc/lib/libGoAhead/src/form.c +++ /dev/null @@ -1,169 +0,0 @@ -/*
- * form.c -- Form processing (in-memory CGI) for the GoAhead Web server
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: form.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/********************************** Description *******************************/
-
-/*
- * This module implements the /goform handler. It emulates CGI processing
- * but performs this in-process and not as an external process. This enables
- * a very high performance implementation with easy parsing and decoding
- * of query strings and posted data.
- */
-
-/*********************************** Includes *********************************/
-
-#include "wsIntrn.h"
-
-/************************************ Locals **********************************/
-
-static sym_fd_t formSymtab = -1; /* Symbol table for form handlers */
-
-/************************************* Code ***********************************/
-/*
- * Process a form request. Returns 1 always to indicate it handled the URL
- */
-
-int websFormHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg,
- char_t *url, char_t *path, char_t *query)
-{
- sym_t *sp;
- char_t formBuf[FNAMESIZE];
- char_t *cp, *formName;
- int (*fn)(void *sock, char_t *path, char_t *args);
-
- a_assert(websValid(wp));
- a_assert(url && *url);
- a_assert(path && *path == '/');
-
- websStats.formHits++;
-
-/*
- * Extract the form name
- */
- gstrncpy(formBuf, path, TSZ(formBuf));
- if ((formName = gstrchr(&formBuf[1], '/')) == NULL) {
- websError(wp, 200, T("Missing form name"));
- return 1;
- }
- formName++;
- if ((cp = gstrchr(formName, '/')) != NULL) {
- *cp = '\0';
- }
-
-/*
- * Lookup the C form function first and then try tcl (no javascript support
- * yet).
- */
- sp = symLookup(formSymtab, formName);
- if (sp == NULL) {
- websError(wp, 200, T("Form %s is not defined"), formName);
- } else {
- fn = (int (*)(void *, char_t *, char_t *)) sp->content.value.integer;
- a_assert(fn);
- if (fn) {
-/*
- * For good practice, forms must call websDone()
- */
- (*fn)((void*) wp, formName, query);
-
-/*
- * Remove the test to force websDone, since this prevents
- * the server "push" from a form>
- */
-#if 0 /* push */
- if (websValid(wp)) {
- websError(wp, 200, T("Form didn't call websDone"));
- }
-#endif /* push */
- }
- }
- return 1;
-}
-
-/******************************************************************************/
-/*
- * Define a form function in the "form" map space.
- */
-
-int websFormDefine(char_t *name, void (*fn)(webs_t wp, char_t *path,
- char_t *query))
-{
- a_assert(name && *name);
- a_assert(fn);
-
- if (fn == NULL) {
- return -1;
- }
-
- symEnter(formSymtab, name, valueInteger((int) fn), (int) NULL);
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Open the symbol table for forms.
- */
-
-void websFormOpen()
-{
- formSymtab = symOpen(WEBS_SYM_INIT);
-}
-
-/******************************************************************************/
-/*
- * Close the symbol table for forms.
- */
-
-void websFormClose()
-{
- if (formSymtab != -1) {
- symClose(formSymtab);
- formSymtab = -1;
- }
-}
-
-/******************************************************************************/
-/*
- * Write a webs header. This is a convenience routine to write a common
- * header for a form back to the browser.
- */
-
-void websHeader(webs_t wp)
-{
- a_assert(websValid(wp));
-
- websWrite(wp, T("HTTP/1.0 200 OK\r\n"));
-
-/*
- * By license terms the following line of code must not be modified
- */
- websWrite(wp, T("Server: %s\r\n"), WEBS_NAME);
-
- websWrite(wp, T("Pragma: no-cache\r\n"));
- websWrite(wp, T("Cache-control: no-cache\r\n"));
- websWrite(wp, T("Content-Type: text/html\r\n"));
- websWrite(wp, T("\r\n"));
- websWrite(wp, T("<html>\n"));
-}
-
-/******************************************************************************/
-/*
- * Write a webs footer
- */
-
-void websFooter(webs_t wp)
-{
- a_assert(websValid(wp));
-
- websWrite(wp, T("</html>\n"));
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/h.c b/xbmc/lib/libGoAhead/src/h.c deleted file mode 100644 index 6ed2ba04e2..0000000000 --- a/xbmc/lib/libGoAhead/src/h.c +++ /dev/null @@ -1,196 +0,0 @@ -/*
- * h.c -- Handle allocation module
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: h.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module provides a simple API to allocate and free handles
- * It maintains a dynamic array of pointers. These usually point to
- * per-handle structures.
- */
-
-/********************************* Includes ***********************************/
-
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include "basic/basicInternal.h"
-#endif
-
-/********************************** Defines ***********************************/
-/*
- * The handle list stores the length of the list and the number of used
- * handles in the first two words. These are hidden from the caller by
- * returning a pointer to the third word to the caller
- */
-
-#define H_LEN 0 /* First entry holds length of list */
-#define H_USED 1 /* Second entry holds number of used */
-#define H_OFFSET 2 /* Offset to real start of list */
-
-#define H_INCR 16 /* Grow handle list in chunks this size */
-
-/*********************************** Code *************************************/
-/*
- * Allocate a new file handle. On the first call, the caller must set the
- * handle map to be a pointer to a null pointer. *map points to the second
- * element in the handle array.
- */
-
-#ifdef B_STATS
-int HALLOC(B_ARGS_DEC, void ***map)
-#else
-int hAlloc(void ***map)
-#endif
-{
- intptr_t *mp;
- int handle, len, memsize, incr;
-
- a_assert(map);
-
- if (*map == NULL) {
- incr = H_INCR;
- memsize = (incr + H_OFFSET) * sizeof(void**);
-#ifdef B_STATS
- if ((mp = (intptr_t*) balloc(B_ARGS, memsize)) == NULL) {
-#else
- if ((mp = (intptr_t*) balloc(B_L, memsize)) == NULL) {
-#endif
- return -1;
- }
- memset(mp, 0, memsize);
- mp[H_LEN] = incr;
- mp[H_USED] = 0;
- *map = (void**) &mp[H_OFFSET];
- } else {
- mp = &((*(intptr_t**)map)[-H_OFFSET]);
- }
-
- len = mp[H_LEN];
-
-/*
- * Find the first null handle
- */ - if (mp[H_USED] < mp[H_LEN]) {
- for (handle = 0; handle < len; handle++) {
- if (mp[handle+H_OFFSET] == 0) {
- mp[H_USED]++;
- return handle;
- }
- }
- } else {
- handle = len;
- }
-
-/*
- * No free handle so grow the handle list. Grow list in chunks of H_INCR.
- */
- len += H_INCR;
- memsize = (len + H_OFFSET) * sizeof(void**);
- if ((mp = (intptr_t*) brealloc(B_L, (void*) mp, memsize)) == NULL) {
- return -1;
- }
- *map = (void**) &mp[H_OFFSET];
- mp[H_LEN] = len;
- memset(&mp[H_OFFSET + len - H_INCR], 0, sizeof(intptr_t*) * H_INCR);
- mp[H_USED]++;
- return handle;
-}
-
-/******************************************************************************/
-/*
- * Free a handle. This function returns the value of the largest
- * handle in use plus 1, to be saved as a max value.
- */
-
-int hFree(void ***map, int handle)
-{
- intptr_t *mp;
- int len;
-
- a_assert(map);
- mp = &((*(intptr_t**)map)[-H_OFFSET]);
- a_assert(mp[H_LEN] >= H_INCR);
-
- a_assert(mp[handle + H_OFFSET]);
- a_assert(mp[H_USED]);
- mp[handle + H_OFFSET] = 0;
- if (--(mp[H_USED]) == 0) {
- bfree(B_L, (void*) mp);
- *map = NULL;
- }
-
-/*
- * Find the greatest handle number in use.
- */
- if (*map == NULL) {
- handle = -1;
- } else {
- len = mp[H_LEN];
- if (mp[H_USED] < mp[H_LEN]) {
- for (handle = len - 1; handle >= 0; handle--) {
- if (mp[handle + H_OFFSET])
- break;
- }
- } else {
- handle = len;
- }
- }
- return handle + 1;
-}
-
-/******************************************************************************/
-/*
- * Allocate an entry in the halloc array.
- */
-
-#ifdef B_STATS
-int HALLOCENTRY(B_ARGS_DEC, void ***list, int *max, int size)
-#else
-int hAllocEntry(void ***list, int *max, int size)
-#endif
-{
- char_t *cp;
- int id;
-
- a_assert(list);
- a_assert(max);
-
-#ifdef B_STATS
- if ((id = HALLOC(B_ARGS, (void***) list)) < 0) {
-#else
- if ((id = hAlloc((void***) list)) < 0) {
-#endif
- return -1;
- }
-
- if (size > 0) {
-#ifdef B_STATS
- if ((cp = balloc(B_ARGS, size)) == NULL) {
-#else
- if ((cp = balloc(B_L, size)) == NULL) {
-#endif
- hFree(list, id);
- return -1;
- }
- a_assert(cp);
- memset(cp, 0, size);
-
- (*list)[id] = (void*) cp;
- }
-
- if (id >= *max) {
- *max = id + 1;
- }
- return id;
-}
-
-/******************************************************************************/
-
-
diff --git a/xbmc/lib/libGoAhead/src/handler.c b/xbmc/lib/libGoAhead/src/handler.c deleted file mode 100644 index b4caec3e84..0000000000 --- a/xbmc/lib/libGoAhead/src/handler.c +++ /dev/null @@ -1,419 +0,0 @@ -/*
- * handler.c -- URL handler support
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: handler.c,v 1.4 2003/03/17 22:21:41 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module implements a URL handler interface and API to permit
- * the addition of user definable URL processors.
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-
-/*********************************** Locals ***********************************/
-
-static websUrlHandlerType *websUrlHandler; /* URL handler list */
-static int websUrlHandlerMax; /* Number of entries */
-static int urlHandlerOpenCount = 0; /* count of apps */
-
-/**************************** Forward Declarations ****************************/
-
-static int websUrlHandlerSort(const void *p1, const void *p2);
-static int websPublishHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
- int sid, char_t *url, char_t *path, char_t *query);
-static char_t *websCondenseMultipleChars(char_t *strToCondense, char_t cCondense);
-
-/*********************************** Code *************************************/
-/*
- * Initialize the URL handler module
- */
-
-int websUrlHandlerOpen()
-{
- if (++urlHandlerOpenCount == 1) {
- websAspOpen();
- websSpyOpen();
- websUrlHandler = NULL;
- websUrlHandlerMax = 0;
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Close the URL handler module
- */
-
-void websUrlHandlerClose()
-{
- websUrlHandlerType *sp;
-
- if (--urlHandlerOpenCount <= 0) {
- websAspClose();
- websSpyClose();
- for (sp = websUrlHandler; sp < &websUrlHandler[websUrlHandlerMax];
- sp++) {
- bfree(B_L, sp->urlPrefix);
- if (sp->webDir) {
- bfree(B_L, sp->webDir);
- }
- }
- bfree(B_L, websUrlHandler);
- websUrlHandlerMax = 0;
- }
-}
-
-/******************************************************************************/
-/*
- * Define a new URL handler. urlPrefix is the URL prefix to match. webDir is
- * an optional root directory path for a web directory. arg is an optional
- * arg to pass to the URL handler. flags defines the matching order. Valid
- * flags include WEBS_HANDLER_LAST, WEBS_HANDLER_FIRST. If multiple users
- * specify last or first, their order is defined alphabetically by the
- * urlPrefix.
- */
-
-int websUrlHandlerDefine(char_t *urlPrefix, char_t *webDir, int arg,
- int (*handler)(webs_t wp, char_t *urlPrefix, char_t *webdir, int arg,
- char_t *url, char_t *path, char_t *query), int flags)
-{
- websUrlHandlerType *sp;
- int len;
-
- a_assert(urlPrefix);
- a_assert(handler);
-
-/*
- * Grow the URL handler array to create a new slot
- */
- len = (websUrlHandlerMax + 1) * sizeof(websUrlHandlerType);
- if ((websUrlHandler = brealloc(B_L, websUrlHandler, len)) == NULL) {
- return -1;
- }
- sp = &websUrlHandler[websUrlHandlerMax++];
- memset(sp, 0, sizeof(websUrlHandlerType));
-
- sp->urlPrefix = bstrdup(B_L, urlPrefix);
- sp->len = gstrlen(sp->urlPrefix);
- if (webDir) {
- sp->webDir = bstrdup(B_L, webDir);
- } else {
- sp->webDir = bstrdup(B_L, T(""));
- }
- sp->handler = handler;
- sp->arg = arg;
- sp->flags = flags;
-
-/*
- * Sort in decreasing URL length order observing the flags for first and last
- */
- qsort(websUrlHandler, websUrlHandlerMax, sizeof(websUrlHandlerType),
- websUrlHandlerSort);
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Delete an existing URL handler. We don't reclaim the space of the old
- * handler, just NULL the entry. Return -1 if handler is not found.
- */
-
-int websUrlHandlerDelete(int (*handler)(webs_t wp, char_t *urlPrefix,
- char_t *webDir, int arg, char_t *url, char_t *path, char_t *query))
-{
- websUrlHandlerType *sp;
- int i;
-
- for (i = 0; i < websUrlHandlerMax; i++) {
- sp = &websUrlHandler[i];
- if (sp->handler == handler) {
- sp->handler = NULL;
- return 0;
- }
- }
- return -1;
-}
-
-/******************************************************************************/
-/*
- * Sort in decreasing URL length order observing the flags for first and last
- */
-
-static int websUrlHandlerSort(const void *p1, const void *p2)
-{
- websUrlHandlerType *s1, *s2;
- int rc;
-
- a_assert(p1);
- a_assert(p2);
-
- s1 = (websUrlHandlerType*) p1;
- s2 = (websUrlHandlerType*) p2;
-
- if ((s1->flags & WEBS_HANDLER_FIRST) || (s2->flags & WEBS_HANDLER_LAST)) {
- return -1;
- }
-
- if ((s2->flags & WEBS_HANDLER_FIRST) || (s1->flags & WEBS_HANDLER_LAST)) {
- return 1;
- }
-
- if ((rc = gstrcmp(s1->urlPrefix, s2->urlPrefix)) == 0) {
- if (s1->len < s2->len) {
- return 1;
- } else if (s1->len > s2->len) {
- return -1;
- }
- }
- return -rc;
-}
-
-/******************************************************************************/
-/*
- * Publish a new web directory (Use the default URL handler)
- */
-
-int websPublish(char_t *urlPrefix, char_t *path)
-{
- return websUrlHandlerDefine(urlPrefix, path, 0, websPublishHandler, 0);
-}
-
-/******************************************************************************/
-/*
- * Return the directory for a given prefix. Ignore empty prefixes
- */
-
-char_t *websGetPublishDir(char_t *path, char_t **urlPrefix)
-{
- websUrlHandlerType *sp;
- int i;
-
- for (i = 0; i < websUrlHandlerMax; i++) {
- sp = &websUrlHandler[i];
- if (sp->urlPrefix[0] == '\0') {
- continue;
- }
- if (sp->handler && gstrncmp(sp->urlPrefix, path, sp->len) == 0) {
- if (urlPrefix) {
- *urlPrefix = sp->urlPrefix;
- }
- return sp->webDir;
- }
- }
- return NULL;
-}
-
-/******************************************************************************/
-/*
- * Publish URL handler. We just patch the web page Directory and let the
- * default handler do the rest.
- */
-
-static int websPublishHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
- int sid, char_t *url, char_t *path, char_t *query)
-{
- int len;
-
- a_assert(websValid(wp));
- a_assert(path);
-
-/*
- * Trim the urlPrefix off the path and set the webdirectory. Add one to step
- * over the trailing '/'
- */
- len = gstrlen(urlPrefix) + 1;
- websSetRequestPath(wp, webDir, &path[len]);
- return 0;
-}
-
-/******************************************************************************/
-/*
- * See if any valid handlers are defined for this request. If so, call them
- * and continue calling valid handlers until one accepts the request.
- * Return true if a handler was invoked, else return FALSE.
- */
-
-int websUrlHandlerRequest(webs_t wp)
-{
- websUrlHandlerType *sp;
- int i, first;
-
- a_assert(websValid(wp));
-
-/*
- * Delete the socket handler as we don't want to start reading any
- * data on the connection as it may be for the next pipelined HTTP/1.1
- * request if using Keep Alive
- */
- socketDeleteHandler(wp->sid);
- wp->state = WEBS_PROCESSING;
- websStats.handlerHits++;
-
- websSetRequestPath(wp, websGetDefaultDir(), NULL);
-
-/*
- * Eliminate security hole
- */
- websCondenseMultipleChars(wp->path, '/');
- websCondenseMultipleChars(wp->url, '/');
-
-/*
- * We loop over each handler in order till one accepts the request.
- * The security handler will handle the request if access is NOT allowed.
- */
- first = 1;
- for (i = 0; i < websUrlHandlerMax; i++) {
- sp = &websUrlHandler[i];
- if (sp->handler && gstrncmp(sp->urlPrefix, wp->path, sp->len) == 0) {
- if (first) {
- websSetEnv(wp);
- first = 0;
- }
- if ((*sp->handler)(wp, sp->urlPrefix, sp->webDir, sp->arg,
- wp->url, wp->path, wp->query)) {
- return 1;
- }
- if (!websValid(wp)) {
- trace(0,
- T("webs: handler %s called websDone, but didn't return 1\n"),
- sp->urlPrefix);
- return 1;
- }
- }
- }
-/*
- * If no handler processed the request, then return an error. Note: It is
- * the handlers responsibility to call websDone
- */
- if (i >= websUrlHandlerMax) {
- /*
- * 13 Mar 03 BgP
- * preventing a cross-site scripting exploit
- websError(wp, 200, T("No handler for this URL %s"), wp->url);
- */
- websError(wp, 200, T("No handler for this URL"));
- }
- return 0;
-}
-
-#ifdef OBSOLETE_CODE
-
-/******************************************************************************/
-/*
- * Tidy up the URL path. Return -1 if the URL is bad.
- * Used to eliminate repeated directory delimiters ('/').
- */
-
-static int websTidyUrl(webs_t wp)
-{
- char_t *parts[64]; /* Array of ptr's to URL parts */
- char_t *token, *url, *tidyurl;
- int i, len, npart;
-
- a_assert(websValid(wp));
-
-/*
- * Copy the string so we don't destroy the original (yet)
- */
- url = bstrdup(B_L, wp->url);
- websDecodeUrl(url, url, gstrlen(url));
-
- len = npart = 0;
- parts[0] = NULL;
- token = gstrtok(url, T("/"));
-
-/*
- * Look at each directory segment and process "." and ".." segments
- * Don't allow the browser to pop outside the root web.
- */
- while (token != NULL) {
- if (gstrcmp(token, T("..")) == 0) {
- if (npart > 0) {
- npart--;
- }
-
- } else if (gstrcmp(token, T(".")) != 0) {
- parts[npart] = token;
- len += gstrlen(token) + 1;
- npart++;
- }
- token = gstrtok(NULL, T("/"));
- }
-
-/*
- * Re-construct URL. Need extra space all "/" and null.
- */
- if (npart || (gstrcmp(url, T("/")) == 0) || (url[0] == '\0')) {
- tidyurl = balloc(B_L, (len + 2) * sizeof(char_t));
- *tidyurl = '\0';
-
- for (i = 0; i < npart; i++) {
- gstrcat(tidyurl, T("/"));
- gstrcat(tidyurl, parts[i]);
- }
-
- bfree(B_L, url);
-
- bfree(B_L, wp->url);
- wp->url = tidyurl;
- return 0;
- } else {
- bfree(B_L, url);
- return -1;
- }
-}
-
-#endif
-
-/******************************************************************************/
-/*
- * Convert multiple adjacent occurrences of a given character to a single
- * instance.
- */
-
-static char_t *websCondenseMultipleChars(char_t *strToCondense, char_t cCondense)
-{
- if (strToCondense != NULL) {
- char_t *pStr, *pScan;
-
- pStr = pScan = strToCondense;
-
- while (*pScan && *pStr) {
-/*
- * Advance scan pointer over multiple occurences of condense character
- */
- while ((*pScan == cCondense) && (*(pScan + 1) == cCondense)) {
- pScan++;
- }
-/*
- * Copy character if an advance of the scan pointer has occurred
- */
- if (pStr != pScan) {
- *pStr = *pScan;
- }
-
- pScan++;
- pStr++;
- }
-/*
- * Zero terminate string if multiple adjacent characters were found and condensed
- */
- if (pStr != pScan) {
- *pStr = 0;
- }
- }
-
- return strToCondense;
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/license.txt b/xbmc/lib/libGoAhead/src/license.txt deleted file mode 100644 index 9a8d4a0e84..0000000000 --- a/xbmc/lib/libGoAhead/src/license.txt +++ /dev/null @@ -1,282 +0,0 @@ -License Agreement
-
-THIS LICENSE ALLOWS ONLY THE LIMITED USE OF GO AHEAD SOFTWARE,
-INC. PROPRIETARY CODE. PLEASE CAREFULLY READ THIS AGREEMENT AS IT
-PERTAINS TO THIS LICENSE, YOU CERTIFY THAT YOU WILL USE THE SOFTWARE
-ONLY IN THE MANNER PERMITTED HEREIN.
-
-1. Definitions.
-
-1.1 "Documentation" means any documentation GoAhead includes with the
-Original Code.
-
-1.2 "GoAhead" means Go Ahead Software, Inc.
-
-1.3 "Intellectual Property Rights" means all rights, whether now existing
-or hereinafter acquired, in and to trade secrets, patents, copyrights,
-trademarks, know-how, as well as moral rights and similar rights of any
-type under the laws of any governmental authority, domestic or foreign,
-including rights in and to all applications and registrations relating
-to any of the foregoing.
-
-1.4 "License" or "Agreement" means this document.
-
-1.5 "Modifications" means any addition to or deletion from the substance
-or structure of either the Original Code or any previous Modifications.
-
-1.6 "Original Code" means the Source Code to GoAhead’s proprietary
-computer software entitled GoAhead WebServer.
-
-1.7 "Response Header" means the first portion of the response message
-output by the GoAhead WebServer, containing but not limited to, header
-fields for date, content-type, server identification and cache control.
-
-1.8 "Server Identification Field" means the field in the Response Header
-which contains the text "Server: GoAhead-Webs".
-
-1.9 "You" means an individual or a legal entity exercising rights under,
-and complying with all of the terms of, this license or a future version
-of this license. For legal entities, "You" includes any entity which
-controls, is controlled by, or is under common control with You. For
-purposes of this definition, "control" means (a) the power, direct or
-indirect, to cause the direction or management of such entity, whether
-by contract or otherwise, or (b) ownership of fifty percent (50%) or
-more of the outstanding shares or beneficial ownership of such entity.
-
-2. Source Code License.
-
-2.1 Limited Source Code Grant.
-
-GoAhead hereby grants You a world-wide, royalty-free, non-exclusive
-license, subject to third party intellectual property claims, to use,
-reproduce, modify, copy and distribute the Original Code.
-
-2.2 Binary Code.
-
-GoAhead hereby grants You a world-wide, royalty-free, non-exclusive
-license to copy and distribute the binary code versions of the Original
-Code together with Your Modifications.
-
-2.3 License Back to GoAhead.
-
-You hereby grant in both source code and binary code to GoAhead a
-world-wide, royalty-free, non-exclusive license to copy, modify, display,
-use and sublicense any Modifications You make that are distributed or
-planned for distribution. Within 30 days of either such event, You
-agree to ship to GoAhead a file containing the Modifications (in a media
-to be determined by the parties), including any programmers’ notes and
-other programmers’ materials. Additionally, You will provide to GoAhead
-a complete description of the product, the product code or model number,
-the date on which the product is initially shipped, and a contact name,
-phone number and e-mail address for future correspondence. GoAhead will
-keep confidential all data specifically marked as such.
-
-2.4 Restrictions on Use.
-
-You may sublicense Modifications to third parties such as subcontractors
-or OEM's provided that You enter into license agreements with such third
-parties that bind such third parties to all the obligations under this
-Agreement applicable to you and that are otherwise substantially similar
-in scope and application to this Agreement.
-
-3. Term.
-
-This Agreement and license are effective from the time You accept the
-terms of this Agreement until this Agreement is terminated. You may
-terminate this Agreement at any time by uninstalling or destroying
-all copies of the Original Code including any and all binary versions
-and removing any Modifications to the Original Code existing in any
-products. This Agreement will terminate immediately and without further
-notice if You fail to comply with any provision of this Agreement. All
-restrictions on use, and all other provisions that may reasonably
-be interpreted to survive termination of this Agreement, will survive
-termination of this Agreement for any reason. Upon termination, You agree
-to uninstall or destroy all copies of the Original Code, Modifications,
-and Documentation.
-
-4. Trademarks and Brand.
-
-4.1 License and Use.
-
-GoAhead hereby grants to You a limited world-wide, royalty-free,
-non-exclusive license to use the GoAhead trade names, trademarks, logos,
-service marks and product designations posted in Exhibit A (collectively,
-the "GoAhead Marks") in connection with the activities by You under this
-Agreement. Additionally, GoAhead grants You a license under the terms
-above to such GoAhead trademarks as shall be identified at a URL (the
-"URL") provided by GoAhead. The use by You of GoAhead Marks shall be in
-accordance with GoAhead’s trademark policies regarding trademark usage
-as established at the web site designated by the URL, or as otherwise
-communicated to You by GoAhead at its sole discretion. You understand and
-agree that any use of GoAhead Marks in connection with this Agreement
-shall not create any right, title or interest in or to such GoAhead
-Marks and that all such use and goodwill associated with GoAhead Marks
-will inure to the benefit of GoAhead.
-
-4.2 Promotion by You of GoAhead WebServer Mark.
-
-In consideration for the licenses granted by GoAhead to You herein, You
-agree to notify GoAhead when You incorporate the GoAhead WebServer in
-Your product and to inform GoAhead when such product begins to ship. You
-agree to promote the Original Code by prominently and visibly displaying
-a graphic of the GoAhead WebServer mark on the initial web page of Your
-product that is displayed each time a user connects to it. You also agree
-that GoAhead may identify your company as a user of the GoAhead WebServer
-in conjunction with its own marketing efforts. You may further promote
-the Original Code by displaying the GoAhead WebServer mark in marketing
-and promotional materials such as the home page of your web site or web
-pages promoting the product.
-
-4.3 Placement of Copyright Notice by You.
-
-You agree to include copies of the following notice (the "Notice")
-regarding proprietary rights in all copies of the products that You
-distribute, as follows: (i) embedded in the object code; and (ii) on
-the title pages of all documentation. Furthermore, You agree to use
-commercially reasonable efforts to cause any licensees of your products
-to embed the Notice in object code and on the title pages or relevant
-documentation. The Notice is as follows: Copyright (c) 20xx GoAhead
-Software, Inc. All Rights Reserved. Unless GoAhead otherwise instructs,
-the year 20xx is to be replaced with the year during which the release of
-the Original Code containing the notice is issued by GoAhead. If this year
-is not supplied with Documentation, GoAhead will supply it upon request.
-
-4.4 No Modifications to Server Identification Field.
-
-You agree not to remove or modify the Server identification Field
-contained in the Response Header as defined in Section 1.6 and 1.7.
-
-5. Warranty Disclaimers.
-
-THE ORIGINAL CODE, THE DOCUMENTATION AND THE MEDIA UPON WHICH THE ORIGINAL
-CODE IS RECORDED (IF ANY) ARE PROVIDED "AS IS" AND WITHOUT WARRANTIES OF
-ANY KIND, EXPRESS, STATUTORY OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.
-
-The entire risk as to the quality and performance of the Original Code
-(including any Modifications You make) and the Documentation is with
-You. Should the Original Code or the Documentation prove defective,
-You (and not GoAhead or its distributors, licensors or dealers) assume
-the entire cost of all necessary servicing or repair. GoAhead does not
-warrant that the functions contained in the Original Code will meet your
-requirements or operate in the combination that You may select for use,
-that the operation of the Original Code will be uninterrupted or error
-free, or that defects in the Original Code will be corrected. No oral
-or written statement by GoAhead or by a representative of GoAhead shall
-create a warranty or increase the scope of this warranty.
-
-GOAHEAD DOES NOT WARRANT THE ORIGINAL CODE AGAINST INFRINGEMENT OR THE
-LIKE WITH RESPECT TO ANY COPYRIGHT, PATENT, TRADE SECRET, TRADEMARK
-OR OTHER PROPRIETARY RIGHT OF ANY THIRD PARTY AND DOES NOT WARRANT
-THAT THE ORIGINAL CODE DOES NOT INCLUDE ANY VIRUS, SOFTWARE ROUTINE
-OR OTHER SOFTWARE DESIGNED TO PERMIT UNAUTHORIZED ACCESS, TO DISABLE,
-ERASE OR OTHERWISE HARM SOFTWARE, HARDWARE OR DATA, OR TO PERFORM ANY
-OTHER SUCH ACTIONS.
-
-Any warranties that by law survive the foregoing disclaimers shall
-terminate ninety (90) days from the date You received the Original Code.
-
-6. Limitation of Liability.
-
-YOUR SOLE REMEDIES AND GOAHEAD'S ENTIRE LIABILITY ARE SET FORTH ABOVE. IN
-NO EVENT WILL GOAHEAD OR ITS DISTRIBUTORS OR DEALERS BE LIABLE FOR
-DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM
-THE USE OF THE ORIGINAL CODE, THE INABILITY TO USE THE ORIGINAL CODE,
-OR ANY DEFECT IN THE ORIGINAL CODE, INCLUDING ANY LOST PROFITS, EVEN IF
-THEY HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-You agree that GoAhead and its distributors and dealers will not be
-LIABLE for defense or indemnity with respect to any claim against You
-by any third party arising from your possession or use of the Original
-Code or the Documentation.
-
-In no event will GoAhead’s total liability to You for all damages, losses,
-and causes of action (whether in contract, tort, including negligence,
-or otherwise) exceed the amount You paid for this product.
-
-SOME STATES DO NOT ALLOW LIMITATIONS ON HOW LONG AN IMPLIED WARRANTY
-LASTS, AND SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION
-OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATIONS OR
-EXCLUSIONS MAY NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC LEGAL
-RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY FROM STATE TO STATE.
-
-7. Indemnification by You.
-
-You agree to indemnify and hold GoAhead harmless against any and all
-claims, losses, damages and costs (including legal expenses and reasonable
-counsel fees) arising out of any claim of a third party with respect to
-the contents of the Your products, and any intellectual property rights
-or other rights or interests related thereto.
-
-8. High Risk Activities.
-
-The Original Code is not fault-tolerant and is not designed , manufactured
-or intended for use or resale as online control equipment in hazardous
-environments requiring fail-safe performance, such as in the operation
-of nuclear facilities, aircraft navigation or communication systems,
-air traffic control, direct life support machines or weapons systems,
-in which the failure of the Original Code could lead directly to death,
-personal injury, or severe physical or environmental damage. GoAhead and
-its suppliers specifically disclaim any express or implied warranty of
-fitness for any high risk uses listed above.
-
-9. Government Restricted Rights.
-
-For units of the Department of Defense, use, duplication, or disclosure
-by the Government is subject to restrictions as set forth in subparagraph
-(c)(1)(ii) of the Rights in Technical Data and Computer Software clause
-at DFARS 252.227-7013. Contractor/manufacturer is GoAhead Software,
-Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004.
-
-If the Commercial Computer Software Restricted rights clause at FAR
-52.227-19 or its successors apply, the Software and Documentation
-constitute restricted computer software as defined in that clause and
-the Government shall not have the license for published software set
-forth in subparagraph (c)(3) of that clause.
-
-The Original Code (i) was developed at private expense, and no part of it
-was developed with governmental funds; (ii) is a trade secret of GoAhead
-(or its licensor(s)) for all purposes of the Freedom of Information Act;
-(iii) is "restricted computer software" subject to limited utilization as
-provided in the contract between the vendor and the governmental entity;
-and (iv) in all respects is proprietary data belonging solely to GoAhead
-(or its licensor(s)).
-
-10. Governing Law and Interpretation.
-
-This Agreement shall be interpreted under and governed by the laws of the
-State of Washington, without regard to its rules governing the conflict of
-laws. If any provision of this Agreement is held illegal or unenforceable
-by a court or tribunal of competent jurisdiction, the remaining provisions
-of this Agreement shall remain in effect and the invalid provision deemed
-modified to the least degree necessary to remedy such invalidity.
-
-11. Entire Agreement.
-
-This Agreement is the complete agreement between GoAhead and You and
-supersedes all prior agreements, oral or written, with respect to the
-subject matter hereof.
-
-If You have any questions concerning this Agreement, You may write to
-GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue,
-Washington 98004 or send e-mail to info@goahead.com.
-
-BY CLICKING ON THE "Register" BUTTON ON THE REGISTRATION FORM, YOU
-ACCEPT AND AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS SET
-FORTH IN THIS AGREEMENT. IF YOU DO NOT WISH TO ACCEPT THIS LICENSE OR
-YOU DO NOT QUALIFY FOR A LICENSE BASED ON THE TERMS SET FORTH ABOVE,
-YOU MUST NOT CLICK THE "Register" BUTTON.
-
-Exhibit A
-
-GoAhead Trademarks, Logos, and Product Designation Information
-
-
-
-
-01/28/00
-
-
-
-
diff --git a/xbmc/lib/libGoAhead/src/md5.h b/xbmc/lib/libGoAhead/src/md5.h deleted file mode 100644 index cfe3fc079f..0000000000 --- a/xbmc/lib/libGoAhead/src/md5.h +++ /dev/null @@ -1,50 +0,0 @@ -/* MD5.H - header file for MD5C.C
- *
- * $Id: md5.h,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
-rights reserved.
-
-License to copy and use this software is granted provided that it
-is identified as the "RSA Data Security, Inc. MD5 Message-Digest
-Algorithm" in all material mentioning or referencing this software
-or this function.
-
-License is also granted to make and use derivative works provided
-that such works are identified as "derived from the RSA Data
-Security, Inc. MD5 Message-Digest Algorithm" in all material
-mentioning or referencing the derived work.
-
-RSA Data Security, Inc. makes no representations concerning either
-the merchantability of this software or the suitability of this
-software for any particular purpose. It is provided "as is"
-without express or implied warranty of any kind.
-
-These notices must be retained in any copies of any part of this
-documentation and/or software.
- */
-
-#ifndef _h_MD5
-#define _h_MD5 1
-
-#ifndef UINT4
-#define UINT4 unsigned int
-#endif
-
-#ifndef POINTER
-#define POINTER unsigned char *
-#endif
-
-/* MD5 context. */
-typedef struct {
- UINT4 state[4]; /* state (ABCD) */
- UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
- unsigned char buffer[64]; /* input buffer */
-} MD5_CONTEXT;
-
-extern void MD5Init (MD5_CONTEXT *);
-extern void MD5Update (MD5_CONTEXT *, unsigned char *, unsigned int);
-extern void MD5Final (unsigned char [16], MD5_CONTEXT *);
-
-#endif /* _h_MD5 */
diff --git a/xbmc/lib/libGoAhead/src/md5c.c b/xbmc/lib/libGoAhead/src/md5c.c deleted file mode 100644 index 1005ba81c1..0000000000 --- a/xbmc/lib/libGoAhead/src/md5c.c +++ /dev/null @@ -1,338 +0,0 @@ -/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
- *
- * $Id: md5c.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
-rights reserved.
-
-License to copy and use this software is granted provided that it
-is identified as the "RSA Data Security, Inc. MD5 Message-Digest
-Algorithm" in all material mentioning or referencing this software
-or this function.
-
-License is also granted to make and use derivative works provided
-that such works are identified as "derived from the RSA Data
-Security, Inc. MD5 Message-Digest Algorithm" in all material
-mentioning or referencing the derived work.
-
-RSA Data Security, Inc. makes no representations concerning either
-the merchantability of this software or the suitability of this
-software for any particular purpose. It is provided "as is"
-without express or implied warranty of any kind.
-
-These notices must be retained in any copies of any part of this
-documentation and/or software.
- */
-
-#include "md5.h"
-
-/* Constants for MD5Transform routine.
- */
-#define S11 7
-#define S12 12
-#define S13 17
-#define S14 22
-#define S21 5
-#define S22 9
-#define S23 14
-#define S24 20
-#define S31 4
-#define S32 11
-#define S33 16
-#define S34 23
-#define S41 6
-#define S42 10
-#define S43 15
-#define S44 21
-
-static void MD5Transform (UINT4 [4], unsigned char [64]);
-static void Encode (unsigned char *, UINT4 *, unsigned int);
-static void Decode (UINT4 *, unsigned char *, unsigned int);
-static void MD5_memcpy (POINTER, POINTER, unsigned int);
-static void MD5_memset (POINTER, int, unsigned int);
-
-static unsigned char PADDING[64] = {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-/*
- * Note: The following MD5 macros can be implemented as functions
- * for code compactness, (at the expense of execution speed).
- */
-
-/* F, G, H and I are basic MD5 functions.
- */
-#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
-#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
-#define H(x, y, z) ((x) ^ (y) ^ (z))
-#define I(x, y, z) ((y) ^ ((x) | (~z)))
-
-/* ROTATE_LEFT rotates x left n bits.
- */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
-
-/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
-Rotation is separate from addition to prevent recomputation.
- */
-#define FF(a, b, c, d, x, s, ac) { \
- (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-#define GG(a, b, c, d, x, s, ac) { \
- (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-#define HH(a, b, c, d, x, s, ac) { \
- (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-#define II(a, b, c, d, x, s, ac) { \
- (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- }
-
-/* MD5 initialization. Begins an MD5 operation, writing a new context.
- */
-void MD5Init (context)
-MD5_CONTEXT *context; /* context */
-{
- context->count[0] = context->count[1] = 0;
- /* Load magic initialization constants.
-*/
- context->state[0] = 0x67452301;
- context->state[1] = 0xefcdab89;
- context->state[2] = 0x98badcfe;
- context->state[3] = 0x10325476;
-}
-
-/* MD5 block update operation. Continues an MD5 message-digest
- operation, processing another message block, and updating the
- context.
- */
-void MD5Update (context, input, inputLen)
-MD5_CONTEXT *context; /* context */
-unsigned char *input; /* input block */
-unsigned int inputLen; /* length of input block */
-{
- unsigned int i, index, partLen;
-
- /* Compute number of bytes mod 64 */
- index = (unsigned int)((context->count[0] >> 3) & 0x3F);
-
- /* Update number of bits */
- if ((context->count[0] += ((UINT4)inputLen << 3))
- < ((UINT4)inputLen << 3))
- context->count[1]++;
- context->count[1] += ((UINT4)inputLen >> 29);
-
- partLen = 64 - index;
-
- /* Transform as many times as possible.
-*/
- if (inputLen >= partLen) {
- MD5_memcpy
- ((POINTER)&context->buffer[index], (POINTER)input, partLen);
- MD5Transform (context->state, context->buffer);
-
- for (i = partLen; i + 63 < inputLen; i += 64)
- MD5Transform (context->state, &input[i]);
-
- index = 0;
- }
- else
- i = 0;
-
- /* Buffer remaining input */
- MD5_memcpy
- ((POINTER)&context->buffer[index], (POINTER)&input[i],
- inputLen-i);
-}
-
-/* MD5 finalization. Ends an MD5 message-digest operation, writing the
- the message digest and zeroizing the context.
- */
-void MD5Final (digest, context)
-unsigned char digest[16]; /* message digest */
-MD5_CONTEXT *context; /* context */
-{
- unsigned char bits[8];
- unsigned int index, padLen;
-
- /* Save number of bits */
- Encode (bits, context->count, 8);
-
- /* Pad out to 56 mod 64.
-*/
- index = (unsigned int)((context->count[0] >> 3) & 0x3f);
- padLen = (index < 56) ? (56 - index) : (120 - index);
- MD5Update (context, PADDING, padLen);
-
- /* Append length (before padding) */
- MD5Update (context, bits, 8);
- /* Store state in digest */
- Encode (digest, context->state, 16);
-
- /* Zeroize sensitive information.
-*/
- MD5_memset ((POINTER)context, 0, sizeof (*context));
-}
-
-/* MD5 basic transformation. Transforms state based on block.
- */
-static void MD5Transform (state, block)
-UINT4 state[4];
-unsigned char block[64];
-{
- UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
-
- Decode (x, block, 64);
-
- /* Round 1 */
- FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
- FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
- FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
- FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
- FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
- FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
- FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
- FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
- FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
- FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
- FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
- FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
- FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
- FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
- FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
- FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
-
- /* Round 2 */
- GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
- GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
- GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
- GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
- GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
- GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
- GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
- GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
- GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
- GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
- GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
- GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
- GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
- GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
- GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
- GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
-
- /* Round 3 */
- HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
- HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
- HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
- HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
- HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
- HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
- HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
- HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
- HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
- HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
- HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
- HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
- HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
- HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
- HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
- HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
-
- /* Round 4 */
- II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
- II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
- II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
- II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
- II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
- II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
- II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
- II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
- II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
- II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
- II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
- II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
- II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
- II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
- II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
- II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
-
- state[0] += a;
- state[1] += b;
- state[2] += c;
- state[3] += d;
-
- /* Zeroize sensitive information.
-*/
- MD5_memset ((POINTER)x, 0, sizeof (x));
-}
-
-/* Encodes input (UINT4) into output (unsigned char). Assumes len is
- a multiple of 4.
- */
-static void Encode (output, input, len)
-unsigned char *output;
-UINT4 *input;
-unsigned int len;
-{
- unsigned int i, j;
-
- for (i = 0, j = 0; j < len; i++, j += 4) {
- output[j] = (unsigned char)(input[i] & 0xff);
- output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
- output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
- output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
- }
-}
-
-/* Decodes input (unsigned char) into output (UINT4). Assumes len is
- a multiple of 4.
- */
-static void Decode (output, input, len)
-UINT4 *output;
-unsigned char *input;
-unsigned int len;
-{
- unsigned int i, j;
-
- for (i = 0, j = 0; j < len; i++, j += 4)
- output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
- (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
-}
-
-/* Note: Replace "for loop" with standard memcpy if possible.
- */
-
-static void MD5_memcpy (output, input, len)
-POINTER output;
-POINTER input;
-unsigned int len;
-{
- unsigned int i;
-
- for (i = 0; i < len; i++)
- output[i] = input[i];
-}
-
-/* Note: Replace "for loop" with standard memset if possible.
- */
-static void MD5_memset (output, value, len)
-POINTER output;
-int value;
-unsigned int len;
-{
- unsigned int i;
-
- for (i = 0; i < len; i++)
- ((char *)output)[i] = (char)value;
-}
-
diff --git a/xbmc/lib/libGoAhead/src/mime.c b/xbmc/lib/libGoAhead/src/mime.c deleted file mode 100644 index 2c6b571246..0000000000 --- a/xbmc/lib/libGoAhead/src/mime.c +++ /dev/null @@ -1,119 +0,0 @@ -/*
- * mime.c -- Web server mime types
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: mime.c,v 1.7 2003/03/17 20:12:33 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * Mime types and file extensions. This module maps URL extensions to
- * content types.
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-
-/******************************** Global Data *********************************/
-/*
- * Addd entries to the MimeList as required for your content
- */
-
-
-websMimeType websMimeList[] = {
- { T("application/java"), T(".class") },
- { T("application/java"), T(".jar") },
- { T("text/html"), T(".asp") },
- { T("text/html"), T(".htm") },
- { T("text/html"), T(".html") },
- { T("text/xml"), T(".xml") },
- { T("image/gif"), T(".gif") },
- { T("image/jpeg"), T(".jpg") },
- { T("text/css"), T(".css") },
- { T("text/plain"), T(".txt") },
- { T("application/x-javascript"), T(".js") },
- { T("application/x-shockwave-flash"), T(".swf") },
-
-#ifdef MORE_MIME_TYPES
- { T("application/binary"), T(".exe") },
- { T("application/compress"), T(".z") },
- { T("application/gzip"), T(".gz") },
- { T("application/octet-stream"), T(".bin") },
- { T("application/oda"), T(".oda") },
- { T("application/pdf"), T(".pdf") },
- { T("application/postscript"), T(".ai") },
- { T("application/postscript"), T(".eps") },
- { T("application/postscript"), T(".ps") },
- { T("application/rtf"), T(".rtf") },
- { T("application/x-bcpio"), T(".bcpio") },
- { T("application/x-cpio"), T(".cpio") },
- { T("application/x-csh"), T(".csh") },
- { T("application/x-dvi"), T(".dvi") },
- { T("application/x-gtar"), T(".gtar") },
- { T("application/x-hdf"), T(".hdf") },
- { T("application/x-latex"), T(".latex") },
- { T("application/x-mif"), T(".mif") },
- { T("application/x-netcdf"), T(".nc") },
- { T("application/x-netcdf"), T(".cdf") },
- { T("application/x-ns-proxy-autoconfig"), T(".pac") },
- { T("application/x-patch"), T(".patch") },
- { T("application/x-sh"), T(".sh") },
- { T("application/x-shar"), T(".shar") },
- { T("application/x-sv4cpio"), T(".sv4cpio") },
- { T("application/x-sv4crc"), T(".sv4crc") },
- { T("application/x-tar"), T(".tar") },
- { T("application/x-tcl"), T(".tcl") },
- { T("application/x-tex"), T(".tex") },
- { T("application/x-texinfo"), T(".texinfo") },
- { T("application/x-texinfo"), T(".texi") },
- { T("application/x-troff"), T(".t") },
- { T("application/x-troff"), T(".tr") },
- { T("application/x-troff"), T(".roff") },
- { T("application/x-troff-man"), T(".man") },
- { T("application/x-troff-me"), T(".me") },
- { T("application/x-troff-ms"), T(".ms") },
- { T("application/x-ustar"), T(".ustar") },
- { T("application/x-wais-source"), T(".src") },
- { T("application/zip"), T(".zip") },
- { T("audio/basic"), T(".au snd") },
- { T("audio/x-aiff"), T(".aif") },
- { T("audio/x-aiff"), T(".aiff") },
- { T("audio/x-aiff"), T(".aifc") },
- { T("audio/x-wav"), T(".wav") },
- { T("audio/x-wav"), T(".ram") },
- { T("image/ief"), T(".ief") },
- { T("image/jpeg"), T(".jpeg") },
- { T("image/jpeg"), T(".jpe") },
- { T("image/tiff"), T(".tiff") },
- { T("image/tiff"), T(".tif") },
- { T("image/x-cmu-raster"), T(".ras") },
- { T("image/x-portable-anymap"), T(".pnm") },
- { T("image/x-portable-bitmap"), T(".pbm") },
- { T("image/x-portable-graymap"), T(".pgm") },
- { T("image/x-portable-pixmap"), T(".ppm") },
- { T("image/x-rgb"), T(".rgb") },
- { T("image/x-xbitmap"), T(".xbm") },
- { T("image/x-xpixmap"), T(".xpm") },
- { T("image/x-xwindowdump"), T(".xwd") },
- { T("text/html"), T(".cfm") },
- { T("text/html"), T(".shtm") },
- { T("text/html"), T(".shtml") },
- { T("text/richtext"), T(".rtx") },
- { T("text/tab-separated-values"), T(".tsv") },
- { T("text/x-setext"), T(".etx") },
- { T("video/mpeg"), T(".mpeg mpg mpe") },
- { T("video/quicktime"), T(".qt") },
- { T("video/quicktime"), T(".mov") },
- { T("video/x-msvideo"), T(".avi") },
- { T("video/x-sgi-movie"), T(".movie") },
-#endif
- { NULL, NULL},
-};
-
-/*****************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/misc.c b/xbmc/lib/libGoAhead/src/misc.c deleted file mode 100644 index d54aa1c93a..0000000000 --- a/xbmc/lib/libGoAhead/src/misc.c +++ /dev/null @@ -1,690 +0,0 @@ -/*
- * misc.c -- Miscellaneous routines.
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: misc.c,v 1.6 2003/09/29 19:50:24 bporter Exp $
- */
-
-/********************************* Includes ***********************************/
-
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include "basic/basicInternal.h"
-#endif
-
-/*
- * 16 Sep 03 -- added option to use memcpy() instead of strncpy() in the
- * ascToUni and uniToAsc functions.
- */
-#define kUseMemcopy
-
-
-/********************************* Defines ************************************/
-/*
- * Sprintf buffer structure. Make the increment 64 so that
- * a balloc can use a 64 byte block.
- */
-
-#define STR_REALLOC 0x1 /* Reallocate the buffer as required */
-#define STR_INC 64 /* Growth increment */
-
-typedef struct {
- char_t *s; /* Pointer to buffer */
- int size; /* Current buffer size */
- int max; /* Maximum buffer size */
- int count; /* Buffer count */
- int flags; /* Allocation flags */
-} strbuf_t;
-
-/*
- * Sprintf formatting flags
- */
-enum flag {
- flag_none = 0,
- flag_minus = 1,
- flag_plus = 2,
- flag_space = 4,
- flag_hash = 8,
- flag_zero = 16,
- flag_short = 32,
- flag_long = 64
-};
-
-/************************** Forward Declarations ******************************/
-
-int dsnprintf(char_t **s, int size, char_t *fmt, va_list arg,
- int msize);
-int webs_strnlen(char_t *s, unsigned int n);
-void put_char(strbuf_t *buf, char_t c);
-void put_string(strbuf_t *buf, char_t *s, int len,
- int width, int prec, enum flag f);
-void put_ulong(strbuf_t *buf, unsigned long int value, int base,
- int upper, char_t *prefix, int width, int prec, enum flag f);
-
-/************************************ Code ************************************/
-/*
- * "basename" returns a pointer to the last component of a pathname
- * LINUX, LynxOS and Mac OS X have their own basename function
- */
-
-#if (!defined (LINUX) && !defined (LYNX) && !defined (MACOSX))
-char_t *basename(char_t *name)
-{
- char_t *cp;
-
-#if (defined (NW) || defined (WIN))
- if (((cp = gstrrchr(name, '\\')) == NULL) &&
- ((cp = gstrrchr(name, '/')) == NULL)) {
- return name;
-#else
- if ((cp = gstrrchr(name, '/')) == NULL) {
- return name;
-#endif
- } else if (*(cp + 1) == '\0' && cp == name) {
- return name;
- } else if (*(cp + 1) == '\0' && cp != name) {
- return T("");
- } else {
- return ++cp;
- }
-}
-#endif /* ! LINUX & ! LYNX & ! MACOSX */
-
-/******************************************************************************/
-/*
- * Returns a pointer to the directory component of a pathname. bufsize is
- * the size of the buffer in BYTES!
- */
-
-char_t *dirname(char_t *buf, char_t *name, int bufsize)
-{
- char_t *cp;
- int len;
-
- a_assert(name);
- a_assert(buf);
- a_assert(bufsize > 0);
-
-#if (defined (WIN) || defined (NW))
- if ((cp = gstrrchr(name, '/')) == NULL &&
- (cp = gstrrchr(name, '\\')) == NULL)
-#else
- if ((cp = gstrrchr(name, '/')) == NULL)
-#endif
- {
- gstrcpy(buf, T("."));
- return buf;
- }
-
- if ((*(cp + 1) == '\0' && cp == name)) {
- gstrncpy(buf, T("."), TSZ(bufsize));
- gstrcpy(buf, T("."));
- return buf;
- }
-
- len = cp - name;
-
- if (len < bufsize) {
- gstrncpy(buf, name, len);
- buf[len] = '\0';
- } else {
- gstrncpy(buf, name, TSZ(bufsize));
- buf[bufsize - 1] = '\0';
- }
-
- return buf;
-}
-
-
-/******************************************************************************/
-/*
- * sprintf and vsprintf are bad, ok. You can easily clobber memory. Use
- * fmtAlloc and fmtValloc instead! These functions do _not_ support floating
- * point, like %e, %f, %g...
- */
-
-int fmtAlloc(char_t **s, int n, char_t *fmt, ...)
-{
- va_list ap;
- int result;
-
- a_assert(s);
- a_assert(fmt);
-
- *s = NULL;
- va_start(ap, fmt);
- result = dsnprintf(s, n, fmt, ap, 0);
- va_end(ap);
- return result;
-}
-
-/******************************************************************************/
-/*
- * Support a static buffer version for small buffers only!
- */
-
-int fmtStatic(char_t *s, int n, char_t *fmt, ...)
-{
- va_list ap;
- int result;
-
- a_assert(s);
- a_assert(fmt);
- a_assert(n <= 256);
-
- if (n <= 0) {
- return -1;
- }
- va_start(ap, fmt);
- result = dsnprintf(&s, n, fmt, ap, 0);
- va_end(ap);
- return result;
-}
-
-/******************************************************************************/
-/*
- * This function appends the formatted string to the supplied string,
- * reallocing if required.
- */
-
-int fmtRealloc(char_t **s, int n, int msize, char_t *fmt, ...)
-{
- va_list ap;
- int result;
-
- a_assert(s);
- a_assert(fmt);
-
- if (msize == -1) {
- *s = NULL;
- }
- va_start(ap, fmt);
- result = dsnprintf(s, n, fmt, ap, msize);
- va_end(ap);
- return result;
-}
-
-/******************************************************************************/
-/*
- * A vsprintf replacement.
- */
-
-int fmtValloc(char_t **s, int n, char_t *fmt, va_list arg)
-{
- a_assert(s);
- a_assert(fmt);
-
- *s = NULL;
- return dsnprintf(s, n, fmt, arg, 0);
-}
-
-/******************************************************************************/
-/*
- * Dynamic sprintf implementation. Supports dynamic buffer allocation.
- * This function can be called multiple times to grow an existing allocated
- * buffer. In this case, msize is set to the size of the previously allocated
- * buffer. The buffer will be realloced, as required. If msize is set, we
- * return the size of the allocated buffer for use with the next call. For
- * the first call, msize can be set to -1.
- */
-
-int dsnprintf(char_t **s, int size, char_t *fmt, va_list arg, int msize)
-{
- strbuf_t buf;
- char_t c;
-
- a_assert(s);
- a_assert(fmt);
-
- memset(&buf, 0, sizeof(buf));
- buf.s = *s;
-
- if (*s == NULL || msize != 0) {
- buf.max = size;
- buf.flags |= STR_REALLOC;
- if (msize != 0) {
- buf.size = max(msize, 0);
- }
- if (*s != NULL && msize != 0) {
- buf.count = gstrlen(*s);
- }
- } else {
- buf.size = size;
- }
-
- while ((c = *fmt++) != '\0') {
- if (c != '%' || (c = *fmt++) == '%') {
- put_char(&buf, c);
- } else {
- enum flag f = flag_none;
- int width = 0;
- int prec = -1;
- for ( ; c != '\0'; c = *fmt++) {
- if (c == '-') {
- f |= flag_minus;
- } else if (c == '+') {
- f |= flag_plus;
- } else if (c == ' ') {
- f |= flag_space;
- } else if (c == '#') {
- f |= flag_hash;
- } else if (c == '0') {
- f |= flag_zero;
- } else {
- break;
- }
- }
- if (c == '*') {
- width = va_arg(arg, int);
- if (width < 0) {
- f |= flag_minus;
- width = -width;
- }
- c = *fmt++;
- } else {
- for ( ; gisdigit((int)c); c = *fmt++) {
- width = width * 10 + (c - '0');
- }
- }
- if (c == '.') {
- f &= ~flag_zero;
- c = *fmt++;
- if (c == '*') {
- prec = va_arg(arg, int);
- c = *fmt++;
- } else {
- for (prec = 0; gisdigit((int)c); c = *fmt++) {
- prec = prec * 10 + (c - '0');
- }
- }
- }
- if (c == 'h' || c == 'l') {
- f |= (c == 'h' ? flag_short : flag_long);
- c = *fmt++;
- }
- if (c == 'd' || c == 'i') {
- long int value;
- if (f & flag_short) {
- value = (short int) va_arg(arg, int);
- } else if (f & flag_long) {
- value = va_arg(arg, long int);
- } else {
- value = va_arg(arg, int);
- }
- if (value >= 0) {
- if (f & flag_plus) {
- put_ulong(&buf, value, 10, 0, T("+"), width, prec, f);
- } else if (f & flag_space) {
- put_ulong(&buf, value, 10, 0, T(" "), width, prec, f);
- } else {
- put_ulong(&buf, value, 10, 0, NULL, width, prec, f);
- }
- } else {
- put_ulong(&buf, -value, 10, 0, T("-"), width, prec, f);
- }
- } else if (c == 'o' || c == 'u' || c == 'x' || c == 'X') {
- unsigned long int value;
- if (f & flag_short) {
- value = (unsigned short int) va_arg(arg, unsigned int);
- } else if (f & flag_long) {
- value = va_arg(arg, unsigned long int);
- } else {
- value = va_arg(arg, unsigned int);
- }
- if (c == 'o') {
- if (f & flag_hash && value != 0) {
- put_ulong(&buf, value, 8, 0, T("0"), width, prec, f);
- } else {
- put_ulong(&buf, value, 8, 0, NULL, width, prec, f);
- }
- } else if (c == 'u') {
- put_ulong(&buf, value, 10, 0, NULL, width, prec, f);
- } else {
- if (f & flag_hash && value != 0) {
- if (c == 'x') {
- put_ulong(&buf, value, 16, 0, T("0x"), width,
- prec, f);
- } else {
- put_ulong(&buf, value, 16, 1, T("0X"), width,
- prec, f);
- }
- } else {
- /* 04 Apr 02 BgP -- changed so that %X correctly outputs
- * uppercase hex digits when requested.
- put_ulong(&buf, value, 16, 0, NULL, width, prec, f);
- */
- put_ulong(&buf, value, 16, ('X' == c) , NULL, width, prec, f);
- }
- }
-
- } else if (c == 'c') {
- char_t value = va_arg(arg, int);
- put_char(&buf, value);
-
- } else if (c == 's' || c == 'S') {
- char_t *value = va_arg(arg, char_t *);
- if (value == NULL) {
- put_string(&buf, T("(null)"), -1, width, prec, f);
- } else if (f & flag_hash) {
- put_string(&buf,
- value + 1, (char_t) *value, width, prec, f);
- } else {
- put_string(&buf, value, -1, width, prec, f);
- }
- } else if (c == 'p') {
- void *value = va_arg(arg, void *);
- put_ulong(&buf,
- (unsigned long int) value, 16, 0, T("0x"), width, prec, f);
- } else if (c == 'n') {
- if (f & flag_short) {
- short int *value = va_arg(arg, short int *);
- *value = buf.count;
- } else if (f & flag_long) {
- long int *value = va_arg(arg, long int *);
- *value = buf.count;
- } else {
- int *value = va_arg(arg, int *);
- *value = buf.count;
- }
- } else {
- put_char(&buf, c);
- }
- }
- }
- if (buf.s == NULL) {
- put_char(&buf, '\0');
- }
-
-/*
- * If the user requested a dynamic buffer (*s == NULL), ensure it is returned.
- */
- if (*s == NULL || msize != 0) {
- *s = buf.s;
- }
-
- if (*s != NULL && size > 0) {
- if (buf.count < size) {
- (*s)[buf.count] = '\0';
- } else {
- (*s)[buf.size - 1] = '\0';
- }
- }
-
- if (msize != 0) {
- return buf.size;
- }
- return buf.count;
-}
-
-/******************************************************************************/
-/*
- * Return the length of a string limited by a given length
- */
-
-int webs_strnlen(char_t *s, unsigned int n)
-{
- unsigned int len;
-
- len = gstrlen(s);
- return min(len, n);
-}
-
-/******************************************************************************/
-/*
- * Add a character to a string buffer
- */
-
-void put_char(strbuf_t *buf, char_t c)
-{
- if (buf->count >= (buf->size - 1)) {
- if (! (buf->flags & STR_REALLOC)) {
- return;
- }
- buf->size += STR_INC;
- if (buf->size > buf->max && buf->size > STR_INC) {
-/*
- * Caller should increase the size of the calling buffer
- */
- buf->size -= STR_INC;
- return;
- }
- if (buf->s == NULL) {
- buf->s = balloc(B_L, buf->size * sizeof(char_t));
- } else {
- buf->s = brealloc(B_L, buf->s, buf->size * sizeof(char_t));
- }
- }
- buf->s[buf->count] = c;
- if (c != '\0') {
- ++buf->count;
- }
-}
-
-/******************************************************************************/
-/*
- * Add a string to a string buffer
- */
-
-void put_string(strbuf_t *buf, char_t *s, int len, int width,
- int prec, enum flag f)
-{
- int i;
-
- if (len < 0) {
- len = webs_strnlen(s, prec >= 0 ? prec : ULONG_MAX);
- } else if (prec >= 0 && prec < len) {
- len = prec;
- }
- if (width > len && !(f & flag_minus)) {
- for (i = len; i < width; ++i) {
- put_char(buf, ' ');
- }
- }
- for (i = 0; i < len; ++i) {
- put_char(buf, s[i]);
- }
- if (width > len && f & flag_minus) {
- for (i = len; i < width; ++i) {
- put_char(buf, ' ');
- }
- }
-}
-
-/******************************************************************************/
-/*
- * Add a long to a string buffer
- */
-
-void put_ulong(strbuf_t *buf, unsigned long int value, int base,
- int upper, char_t *prefix, int width, int prec, enum flag f)
-{
- unsigned long x, x2;
- int len, zeros, i;
-
- for (len = 1, x = 1; x < ULONG_MAX / base; ++len, x = x2) {
- x2 = x * base;
- if (x2 > value) {
- break;
- }
- }
- zeros = (prec > len) ? prec - len : 0;
- width -= zeros + len;
- if (prefix != NULL) {
- width -= webs_strnlen(prefix, ULONG_MAX);
- }
- if (!(f & flag_minus)) {
- if (f & flag_zero) {
- for (i = 0; i < width; ++i) {
- put_char(buf, '0');
- }
- } else {
- for (i = 0; i < width; ++i) {
- put_char(buf, ' ');
- }
- }
- }
- if (prefix != NULL) {
- put_string(buf, prefix, -1, 0, -1, flag_none);
- }
- for (i = 0; i < zeros; ++i) {
- put_char(buf, '0');
- }
- for ( ; x > 0; x /= base) {
- int digit = (value / x) % base;
- put_char(buf, (char) ((digit < 10 ? '0' : (upper ? 'A' : 'a') - 10) +
- digit));
- }
- if (f & flag_minus) {
- for (i = 0; i < width; ++i) {
- put_char(buf, ' ');
- }
- }
-}
-
-/******************************************************************************/
-/*
- * Convert an ansi string to a unicode string. On an error, we return the
- * original ansi string which is better than returning NULL. nBytes is the
- * size of the destination buffer (ubuf) in _bytes_.
- */
-
-char_t *ascToUni(char_t *ubuf, char *str, int nBytes)
-{
-#ifdef UNICODE
- if (MultiByteToWideChar(CP_ACP, 0, str, nBytes / sizeof(char_t), ubuf,
- nBytes / sizeof(char_t)) < 0) {
- return (char_t*) str;
- }
-#else
-
-#ifdef kUseMemcopy
- memcpy(ubuf, str, nBytes);
-#else
- strncpy(ubuf, str, nBytes);
-#endif /*kUseMemcopy*/
-#endif
- return ubuf;
-}
-
-/******************************************************************************/
-/*
- * Convert a unicode string to an ansi string. On an error, return the
- * original unicode string which is better than returning NULL.
- * N.B. nBytes is the number of _bytes_ in the destination buffer, buf.
- */
-
-char *uniToAsc(char *buf, char_t *ustr, int nBytes)
-{
-#ifdef UNICODE
- if (WideCharToMultiByte(CP_ACP, 0, ustr, nBytes, buf, nBytes,
- NULL, NULL) < 0)
- {
- return (char*) ustr;
- }
-#else
-#ifdef kUseMemcopy
- memcpy(buf, ustr, nBytes);
-#else
- strncpy(buf, ustr, nBytes);
-#endif /* kUseMemcopy */
-#endif
- return (char*) buf;
-}
-
-/******************************************************************************/
-/*
- * allocate (balloc) a buffer and do ascii to unicode conversion into it.
- * cp points to the ascii buffer. alen is the length of the buffer to be
- * converted not including a terminating NULL. Return a pointer to the
- * unicode buffer which must be bfree'd later. Return NULL on failure to
- * get buffer. The buffer returned is NULL terminated.
- */
-
-char_t *ballocAscToUni(char *cp, int alen)
-{
- char_t *unip;
- int ulen;
-
- ulen = (alen + 1) * sizeof(char_t);
- if ((unip = balloc(B_L, ulen)) == NULL) {
- return NULL;
- }
- ascToUni(unip, cp, ulen);
- unip[alen] = 0;
- return unip;
-}
-
-/******************************************************************************/
-/*
- * allocate (balloc) a buffer and do unicode to ascii conversion into it.
- * unip points to the unicoded string. ulen is the number of characters
- * in the unicode string not including a teminating null. Return a pointer
- * to the ascii buffer which must be bfree'd later. Return NULL on failure
- * to get buffer. The buffer returned is NULL terminated.
- */
-
-char *ballocUniToAsc(char_t *unip, int ulen)
-{
- char * cp;
-
- if ((cp = balloc(B_L, ulen+1)) == NULL) {
- return NULL;
- }
- uniToAsc(cp, unip, ulen);
- cp[ulen] = '\0';
- return cp;
-}
-
-/******************************************************************************/
-/*
- * convert a hex string to an integer. The end of the string or a non-hex
- * character will indicate the end of the hex specification.
- */
-
-unsigned int hextoi(char_t *hexstring)
-{
- register char_t *h;
- register unsigned int c, v;
-
- v = 0;
- h = hexstring;
- if (*h == '0' && (*(h+1) == 'x' || *(h+1) == 'X')) {
- h += 2;
- }
- while ((c = (unsigned int)*h++) != 0) {
- if (c >= '0' && c <= '9') {
- c -= '0';
- } else if (c >= 'a' && c <= 'f') {
- c = (c - 'a') + 10;
- } else if (c >= 'A' && c <= 'F') {
- c = (c - 'A') + 10;
- } else {
- break;
- }
- v = (v * 0x10) + c;
- }
- return v;
-}
-
-/******************************************************************************/
-/*
- * convert a string to an integer. If the string starts with "0x" or "0X"
- * a hexidecimal conversion is done.
- */
-
-unsigned int gstrtoi(char_t *s)
-{
- if (*s == '0' && (*(s+1) == 'x' || *(s+1) == 'X')) {
- s += 2;
- return hextoi(s);
- }
- return gatoi(s);
-}
-
-/******************************************************************************/
-
-
diff --git a/xbmc/lib/libGoAhead/src/mocana_ssl.c b/xbmc/lib/libGoAhead/src/mocana_ssl.c deleted file mode 100644 index f06f740d77..0000000000 --- a/xbmc/lib/libGoAhead/src/mocana_ssl.c +++ /dev/null @@ -1,539 +0,0 @@ -/*
- * mocana_ssl.c
- *
- * Mocana Embedded SSL Server
- * GoAhead integration layer
- *
- * Copyright Mocana Corp 2003. All Rights Reserved.
- *
- */
-
-
-/******************************** Description *********************************/
-
-/*
- * This module implements a patch into the Mocana Embedded SSL Server.
- *
- */
-
-#ifdef __ENABLE_MOCANA_SSL_SERVER__
-
-/********************************* Includes ***********************************/
-
-#include "mocana_ssl/common/moptions.h"
-#include "mocana_ssl/common/mdefs.h"
-#include "mocana_ssl/common/mtypes.h"
-#include "mocana_ssl/common/merrors.h"
-#include "mocana_ssl/common/mrtos.h"
-#include "mocana_ssl/common/mtcp.h"
-#include "mocana_ssl/common/mocana.h"
-#include "mocana_ssl/common/random.h"
-#include "mocana_ssl/ssl/ssl.h"
-
-#include "wsIntrn.h"
-#include "webs.h"
-#include "websSSL.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-/******************************* Definitions **********************************/
-
-#ifdef __RTOS_VXWORKS__
-#define SSL_CERTIFICATE_DER_FILE "NVRAM:/ssl.der"
-#define SSL_RSA_HOST_KEYS "NVRAM:/sslkey.dat"
-#else
-#define SSL_CERTIFICATE_DER_FILE "ssl.der"
-#define SSL_RSA_HOST_KEYS "sslkey.dat"
-#endif
-
-#define SSL_PORT SSL_DEFAULT_TCPIP_PORT
-#define MAX_SSL_CONNECTIONS_ALLOWED (10)
-#define SSL_HELLO_TIMEOUT (15000)
-#define SSL_RECV_TIMEOUT (300000)
-
-#define SSL_EXAMPLE_KEY_SIZE (1024 + 256)
-
-static int sslListenSock = -1; /* Listen socket */
-static char* pCertificate = NULL;
-static char* pRsaKeyBlob = NULL;
-
-
-/******************************* Prototypes **********************************/
-
-int websSSLAccept(int sid, char *ipaddr, int port, int listenSid);
-static void websSSLSocketEvent(int sid, int mask, int iwp);
-static int websSSLReadEvent(webs_t wp);
-static int mocana_SSL_computeHostKeys(char** ppCertificate, unsigned int *pCertLength,
- char** ppRsaKeyBlob, unsigned int *pKeyBlobLength);
-static int mocana_SSL_releaseHostKeys(char **ppCertificate, char **ppRsaKeyBlob);
-
-
-
-/******************************************************************************/
-/*
- * Start up the SSL Context for the application, and start a listen on the
- * SSL port (usually 443, and defined by SSL_PORT)
- * Return 0 on success, -1 on failure.
- */
-
-int websSSLOpen()
-{
- unsigned int certLength;
- unsigned int rsaKeyBlobLength;
-
- if (0 > MOCANA_initMocana())
- return -1;
-
- if (0 > mocana_SSL_computeHostKeys(&pCertificate, &certLength, &pRsaKeyBlob, &rsaKeyBlobLength))
- return -1;
-
- if (0 > SSL_init(pCertificate, certLength, pRsaKeyBlob, rsaKeyBlobLength, MAX_SSL_CONNECTIONS_ALLOWED))
- return -1;
-
- SSL_sslSettings()->sslTimeOutHello = SSL_HELLO_TIMEOUT;
- SSL_sslSettings()->sslTimeOutReceive = SSL_RECV_TIMEOUT;
-
- sslListenSock = socketOpenConnection(NULL, SSL_PORT, websSSLAccept, SOCKET_BLOCK);
-
- if (sslListenSock < 0) {
- trace(2, T("SSL: Unable to open SSL socket on port <%d>!\n"),
- SSL_PORT);
- return -1;
- }
-
- return 0;
-}
-
-
-/******************************************************************************/
-/*
- * Accept a connection
- */
-
-int websSSLAccept(int sid, char *ipaddr, int port, int listenSid)
-{
- webs_t wp;
- int wid;
-
- a_assert(ipaddr && *ipaddr);
- a_assert(sid >= 0);
- a_assert(port >= 0);
-
-/*
- * Allocate a new handle for this accepted connection. This will allocate
- * a webs_t structure in the webs[] list
- */
- if ((wid = websAlloc(sid)) < 0) {
- return -1;
- }
- wp = webs[wid];
- a_assert(wp);
- wp->listenSid = listenSid;
-
- ascToUni(wp->ipaddr, ipaddr, min(sizeof(wp->ipaddr), strlen(ipaddr)+1));
-
-/*
- * Check if this is a request from a browser on this system. This is useful
- * to know for permitting administrative operations only for local access
- */
- if (gstrcmp(wp->ipaddr, T("127.0.0.1")) == 0 ||
- gstrcmp(wp->ipaddr, websIpaddr) == 0 ||
- gstrcmp(wp->ipaddr, websHost) == 0) {
- wp->flags |= WEBS_LOCAL_REQUEST;
- }
-/*
- * Since the acceptance came in on this channel, it must be secure
- */
- wp->flags |= WEBS_SECURE;
-
-/*
- * Arrange for websSocketEvent to be called when read data is available
- */
- socketCreateHandler(sid, SOCKET_READABLE, websSSLSocketEvent, (int) wp);
-
-/*
- * Arrange for a timeout to kill hung requests
- */
- wp->timeout = emfSchedCallback(WEBS_TIMEOUT, websTimeout, (void *) wp);
- trace(8, T("webs: accept request\n"));
- return 0;
-}
-
-
-/******************************************************************************/
-/*
- * Perform a read of the SSL socket
- */
-
-int websSSLRead(websSSL_t *wsp, char_t *buf, int len)
-{
- int numBytesReceived;
- int rc;
-
- a_assert(wsp);
- a_assert(buf);
-
- if ((rc = SSL_recv(wsp->mocanaConnectionInstance, buf, len, &numBytesReceived)) < 0)
- {
- if (0 > rc)
- rc = -1;
-
- return rc;
- }
-
- return numBytesReceived;
-}
-
-
-/******************************************************************************/
-/*
- * The webs socket handler. Called in response to I/O. We just pass control
- * to the relevant read or write handler. A pointer to the webs structure
- * is passed as an (int) in iwp.
- */
-
-static void websSSLSocketEvent(int sid, int mask, int iwp)
-{
- webs_t wp;
-
- wp = (webs_t) iwp;
- a_assert(wp);
-
- if (! websValid(wp)) {
- return;
- }
-
- if (mask & SOCKET_READABLE) {
- websSSLReadEvent(wp);
- }
- if (mask & SOCKET_WRITABLE) {
- if (wp->writeSocket) {
- (*wp->writeSocket)(wp);
- }
- }
-}
-
-
-/******************************************************************************/
-/*
- * Handler for SSL Read Events
- */
-
-static int websSSLReadEvent (webs_t wp)
-{
- int ret = 07, sock;
- socket_t *sptr;
- int connectionInstance;
-
- a_assert (wp);
- a_assert(websValid(wp));
-
- sptr = socketPtr(wp->sid);
- a_assert(sptr);
-
- sock = sptr->sock;
-
-/*
- * Create a new SSL session for this web request
- */
-
- connectionInstance = SSL_acceptConnection(sock);
-
- if (0 > connectionInstance)
- {
-#ifdef __ENABLE_ALL_DEBUGGING__
- printf("websSSLReadEvent: SSL_acceptConnection failed. %d\n", connectionInstance);
-#endif
-
- /* SSL error: cleanup */
- websTimeoutCancel(wp);
- socketCloseConnection(wp->sid);
- websFree(wp);
-
- return -1;
- }
-
-/*
- * Create the SSL data structure in the wp.
- */
- wp->wsp = balloc(B_L, sizeof(websSSL_t));
- a_assert (wp->wsp);
-
- (wp->wsp)->mocanaConnectionInstance = connectionInstance;
- (wp->wsp)->wp = wp;
-
-/*
- * Call the default Read Event
- */
- websReadEvent(wp);
-
- return ret;
-}
-
-
-/******************************************************************************/
-/*
- * Return TRUE if websSSL has been opened
- */
-
-int websSSLIsOpen()
-{
- return (sslListenSock != -1);
-}
-
-
-/******************************************************************************/
-/*
- * Perform a gets of the SSL socket, returning an balloc'ed string
- *
- * Get a string from a socket. This returns data in *buf in a malloced string
- * after trimming the '\n'. If there is zero bytes returned, *buf will be set
- * to NULL. If doing non-blocking I/O, it returns -1 for error, EOF or when
- * no complete line yet read. If doing blocking I/O, it will block until an
- * entire line is read. If a partial line is read socketInputBuffered or
- * socketEof can be used to distinguish between EOF and partial line still
- * buffered. This routine eats and ignores carriage returns.
- */
-
-int websSSLGets(websSSL_t *wsp, char_t **buf)
-{
- socket_t *sp;
- ringq_t *lq;
- char c;
- int rc, len;
- webs_t wp;
- int sid;
- int mci;
- int numBytesReceived;
-
- a_assert(wsp);
- a_assert(buf);
-
- *buf = NULL;
-
- wp = wsp->wp;
- sid = wp->sid;
- mci = wsp->mocanaConnectionInstance;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
- lq = &sp->lineBuf;
-
- while (1) {
-
- if ((rc = SSL_recv(mci, &c, 1, &numBytesReceived)) < 0)
- {
- if (0 > rc)
- rc = -1;
-
- return rc;
- }
-
- if (numBytesReceived == 0) {
-/*
- * If there is a partial line and we are at EOF, pretend we saw a '\n'
- */
- if (ringqLen(lq) > 0 && (sp->flags & SOCKET_EOF)) {
- c = '\n';
- } else {
- continue;
- }
- }
-/*
- * If a newline is seen, return the data excluding the new line to the
- * caller. If carriage return is seen, just eat it.
- */
- if (c == '\n') {
- len = ringqLen(lq);
- if (len > 0) {
- *buf = ballocAscToUni((char *)lq->servp, len);
- } else {
- *buf = NULL;
- }
- ringqFlush(lq);
- return len;
-
- } else if (c == '\r') {
- continue;
- }
- ringqPutcA(lq, c);
- }
- return 0;
-}
-
-
-/******************************************************************************/
-/*
- * Perform a write to the SSL socket
- */
-
-int websSSLWrite(websSSL_t *wsp, char_t *buf, int len)
-{
- int sslBytesSent;
-
- a_assert(wsp);
- a_assert(buf);
-
- if (wsp == NULL) {
- return -1;
- }
-
- sslBytesSent = SSL_send(wsp->mocanaConnectionInstance, buf, len);
-
- if (0 > sslBytesSent)
- sslBytesSent = -1;
-
- return sslBytesSent;
-}
-
-
-/******************************************************************************/
-/*
- * Return Eof for the underlying socket
- */
-
-int websSSLEof(websSSL_t *wsp)
-{
- webs_t wp;
- int sid;
-
- a_assert(wsp);
-
- wp = wsp->wp;
- sid = wp->sid;
-
- return socketEof(sid);
-}
-
-
-/******************************************************************************/
-/*
- * Flush stub for compatibility
- */
-int websSSLFlush(websSSL_t *wsp)
-{
- a_assert(wsp);
-
- /* Autoflush - do nothing */
- return 0;
-}
-
-
-/******************************************************************************/
-/*
- * Free SSL resources
- */
-
-int websSSLFree(websSSL_t *wsp)
-{
- int status;
- if (NULL != wsp)
- {
- int mci;
-
- mci = wsp->mocanaConnectionInstance;
-
- status = SSL_closeConnection(mci);
-
- if (0 > status)
- status = -1;
-
- /* Free memory here.... */
- bfree(B_L, wsp);
- }
-
- return status;
-}
-
-
-/******************************************************************************/
-/*
- * Stops the SSL system
- */
-
-void websSSLClose()
-{
- SSL_shutdown();
- mocana_SSL_releaseHostKeys(&pCertificate, &pRsaKeyBlob);
- SSL_releaseTables();
- MOCANA_freeMocana();
-}
-
-
-/******************************************************************************/
-
-static int
-mocana_SSL_testHostKeys(char** ppCertificate, unsigned int *pCertLength,
- char** ppRsaKeyBlob, unsigned int *pKeyBlobLength)
-{
- int status;
-
- if (0 > (status = MOCANA_readFile(SSL_CERTIFICATE_DER_FILE, ppCertificate, pCertLength)))
- goto exit;
-
- status = MOCANA_readFile(SSL_RSA_HOST_KEYS, ppRsaKeyBlob, pKeyBlobLength);
-
-exit:
- return status;
-}
-
-
-/******************************************************************************/
-
-static int
-mocana_SSL_releaseHostKeys(char **ppCertificate, char **ppRsaKeyBlob)
-{
- MOCANA_freeReadFile(ppCertificate);
- MOCANA_freeReadFile(ppRsaKeyBlob);
-
- return 0;
-}
-
-
-/******************************************************************************/
-
-static int
-mocana_SSL_computeHostKeys(char** ppCertificate, unsigned int *pCertLength,
- char** ppRsaKeyBlob, unsigned int *pKeyBlobLength)
-{
- int status;
-
- *ppCertificate = NULL;
- *ppRsaKeyBlob = NULL;
-
- /* check for pre-existing set of host keys */
- if (0 > (status = mocana_SSL_testHostKeys(ppCertificate, pCertLength, ppRsaKeyBlob, pKeyBlobLength)))
- {
-#ifdef __ENABLE_ALL_DEBUGGING__
- printf("mocana_SSL_computeHostKeys: host keys do not exist, computing new key pair.\n");
-#endif
-
- /* if not, compute new host keys */
- if (0 > (status = SSL_generateCertificate(ppCertificate, pCertLength, ppRsaKeyBlob, pKeyBlobLength, SSL_EXAMPLE_KEY_SIZE)))
- goto exit;
-
- if (0 > (status = MOCANA_writeFile(SSL_CERTIFICATE_DER_FILE, *ppCertificate, *pCertLength)))
- goto exit;
-
- status = MOCANA_writeFile(SSL_RSA_HOST_KEYS, *ppRsaKeyBlob, *pKeyBlobLength);
-
-#ifdef __ENABLE_ALL_DEBUGGING__
- printf("mocana_SSL_computeHostKeys: host key computation completed.\n");
-#endif
- }
-
-exit:
- if (0 > status)
- SSL_freeCertificate(ppCertificate, ppRsaKeyBlob);
-
- return status;
-}
-
-
-/******************************************************************************/
-
-#endif
diff --git a/xbmc/lib/libGoAhead/src/page.c b/xbmc/lib/libGoAhead/src/page.c deleted file mode 100644 index 62e7486db9..0000000000 --- a/xbmc/lib/libGoAhead/src/page.c +++ /dev/null @@ -1,143 +0,0 @@ -/*
- * Page.c -- Support for page retrieval.
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: page.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module provides page retrieval handling. It provides support for
- * reading web pages from file systems and has expansion for ROMed web
- * pages.
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-
-/*********************************** Code *************************************/
-/*
- * Open a web page. lpath is the local filename. path is the URL path name.
- */
-
-int websPageOpen(webs_t wp, char_t *lpath, char_t *path, int mode, int perm)
-{
- a_assert(websValid(wp));
-
-#ifdef WEBS_PAGE_ROM
- return websRomPageOpen(wp, path, mode, perm);
-#else
- return (wp->docfd = gopen(lpath, mode, perm));
-#endif /* WEBS_PAGE_ROM */
-}
-
-/******************************************************************************/
-/*
- * Close a web page
- */
-
-void websPageClose(webs_t wp)
-{
- a_assert(websValid(wp));
-
-#ifdef WEBS_PAGE_ROM
- websRomPageClose(wp->docfd);
-#else
- if (wp->docfd >= 0) {
- close(wp->docfd);
- wp->docfd = -1;
- }
-#endif
-}
-
-/******************************************************************************/
-/*
- * Stat a web page lpath is the local filename. path is the URL path name.
- */
-
-int websPageStat(webs_t wp, char_t *lpath, char_t *path, websStatType* sbuf)
-{
-#ifdef WEBS_PAGE_ROM
- return websRomPageStat(path, sbuf);
-#else
- gstat_t s;
-
- if (gstat(lpath, &s) < 0) {
- return -1;
- }
- sbuf->size = s.st_size;
- sbuf->mtime = s.st_mtime;
- sbuf->isDir = s.st_mode & S_IFDIR;
- return 0;
-#endif
-}
-
-/******************************************************************************/
-/*
- * Is this file a directory?
- */
-
-int websPageIsDirectory(char_t *lpath)
-{
-#ifdef WEBS_PAGE_ROM
- websStatType sbuf;
-
- if (websRomPageStat(lpath, &sbuf) >= 0) {
- return(sbuf.isDir);
- } else {
- return 0;
- }
-#else
- gstat_t sbuf;
-
- if (gstat(lpath, &sbuf) >= 0) {
- return(sbuf.st_mode & S_IFDIR);
- } else {
- return 0;
- }
-#endif
-}
-
-
-/******************************************************************************/
-/*
- * Read a web page. Returns the number of _bytes_ read.
- * len is the size of buf, in bytes.
- */
-
-int websPageReadData(webs_t wp, char *buf, int nBytes)
-{
-
-#ifdef WEBS_PAGE_ROM
- a_assert(websValid(wp));
- return websRomPageReadData(wp, buf, nBytes);
-#else
- a_assert(websValid(wp));
- return read(wp->docfd, buf, nBytes);
-#endif
-}
-
-/******************************************************************************/
-/*
- * Move file pointer offset bytes.
- */
-
-void websPageSeek(webs_t wp, long offset)
-{
- a_assert(websValid(wp));
-
-#ifdef WEBS_PAGE_ROM
- websRomPageSeek(wp, offset, SEEK_CUR);
-#else
- lseek(wp->docfd, offset, SEEK_CUR);
-#endif
-}
-
-/******************************************************************************/
-
-
diff --git a/xbmc/lib/libGoAhead/src/ringq.c b/xbmc/lib/libGoAhead/src/ringq.c deleted file mode 100644 index 58733e8c06..0000000000 --- a/xbmc/lib/libGoAhead/src/ringq.c +++ /dev/null @@ -1,595 +0,0 @@ -/*
- * ringq.c -- Ring queue buffering module
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: ringq.c,v 1.4 2003/09/17 14:45:03 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * A ring queue allows maximum utilization of memory for data storage and is
- * ideal for input/output buffering. This module provides a highly efficient
- * implementation and a vehicle for dynamic strings.
- *
- * WARNING: This is a public implementation and callers have full access to
- * the queue structure and pointers. Change this module very carefully.
- *
- * This module follows the open/close model.
- *
- * Operation of a ringq where rq is a pointer to a ringq :
- *
- * rq->buflen contains the size of the buffer.
- * rq->buf will point to the start of the buffer.
- * rq->servp will point to the first (un-consumed) data byte.
- * rq->endp will point to the next free location to which new data is added
- * rq->endbuf will point to one past the end of the buffer.
- *
- * Eg. If the ringq contains the data "abcdef", it might look like :
- *
- * +-------------------------------------------------------------------+
- * | | | | | | | | a | b | c | d | e | f | | | | |
- * +-------------------------------------------------------------------+
- * ^ ^ ^ ^
- * | | | |
- * rq->buf rq->servp rq->endp rq->enduf
- *
- * The queue is empty when servp == endp. This means that the queue will hold
- * at most rq->buflen -1 bytes. It is the filler's responsibility to ensure
- * the ringq is never filled such that servp == endp.
- *
- * It is the filler's responsibility to "wrap" the endp back to point to
- * rq->buf when the pointer steps past the end. Correspondingly it is the
- * consumers responsibility to "wrap" the servp when it steps to rq->endbuf.
- * The ringqPutc and ringqGetc routines will do this automatically.
- */
-
-/********************************* Includes ***********************************/
-
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include "basic/basicInternal.h"
-#endif
-
-/*********************************** Defines **********************************/
-/*
- * Faster than a function call
- */
-
-#define RINGQ_LEN(rq) \
- ((rq->servp > rq->endp) ? \
- (rq->buflen + (rq->endp - rq->servp)) : \
- (rq->endp - rq->servp))
-
-/***************************** Forward Declarations ***************************/
-
-static int ringqGrow(ringq_t *rq);
-static int getBinBlockSize(int size);
-
-int ringqGrowCalls = 0;
-
-/*********************************** Code *************************************/
-/*
- * Create a new ringq. "increment" is the amount to increase the size of the
- * ringq should it need to grow to accomodate data being added. "maxsize" is
- * an upper limit (sanity level) beyond which the q must not grow. Set maxsize
- * to -1 to imply no upper limit. The buffer for the ringq is always
- * dynamically allocated. Set maxsize
- */
-
-int ringqOpen(ringq_t *rq, int initSize, int maxsize)
-{
- int increment;
-
- a_assert(rq);
- a_assert(initSize >= 0);
-
- increment = getBinBlockSize(initSize);
- if ((rq->buf = balloc(B_L, (increment))) == NULL) {
- return -1;
- }
- rq->maxsize = maxsize;
- rq->buflen = increment;
- rq->increment = increment;
- rq->endbuf = &rq->buf[rq->buflen];
- rq->servp = rq->buf;
- rq->endp = rq->buf;
- *rq->servp = '\0';
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Delete a ringq and free the ringq buffer.
- */
-
-void ringqClose(ringq_t *rq)
-{
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- if (rq == NULL) {
- return;
- }
-
- ringqFlush(rq);
- bfree(B_L, (char*) rq->buf);
- rq->buf = NULL;
-}
-
-/******************************************************************************/
-/*
- * Return the length of the data in the ringq. Users must fill the queue to
- * a high water mark of at most one less than the queue size.
- */
-
-int ringqLen(ringq_t *rq)
-{
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- if (rq->servp > rq->endp) {
- return rq->buflen + rq->endp - rq->servp;
- } else {
- return rq->endp - rq->servp;
- }
-}
-
-/******************************************************************************/
-/*
- * Get a byte from the queue
- */
-
-int ringqGetc(ringq_t *rq)
-{
- char_t c;
- char_t* cp;
-
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- if (rq->servp == rq->endp) {
- return -1;
- }
-
- cp = (char_t*) rq->servp;
- c = *cp++;
- rq->servp = (unsigned char *) cp;
- if (rq->servp >= rq->endbuf) {
- rq->servp = rq->buf;
- }
- /*
- * 17 Sep 03 BgP -- using the implicit conversion from signed char to
- * signed int in the return below makes this function work incorrectly when
- * dealing with UTF-8 encoded text. UTF-8 may include characters that are >
- * 127, which a signed char treats as negative. When we return a 'negative'
- * value from this function, it gets converted to a negative
- * integer, instead of a small positive integer, which is what we want.
- * So, we cast to (unsigned char) before returning, and the problem goes
- * away...
- */
- return (int) ((unsigned char) c);
-}
-
-/******************************************************************************/
-/*
- * Add a char to the queue. Note if being used to store wide strings
- * this does not add a trailing '\0'. Grow the q as required.
- */
-
-int ringqPutc(ringq_t *rq, char_t c)
-{
- char_t *cp;
-
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- if ((ringqPutBlkMax(rq) < (int) sizeof(char_t)) && !ringqGrow(rq)) {
- return -1;
- }
-
- cp = (char_t*) rq->endp;
- *cp++ = (char_t) c;
- rq->endp = (unsigned char *) cp;
- if (rq->endp >= rq->endbuf) {
- rq->endp = rq->buf;
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Insert a wide character at the front of the queue
- */
-
-int ringqInsertc(ringq_t *rq, char_t c)
-{
- char_t *cp;
-
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- if (ringqPutBlkMax(rq) < (int) sizeof(char_t) && !ringqGrow(rq)) {
- return -1;
- }
- if (rq->servp <= rq->buf) {
- rq->servp = rq->endbuf;
- }
- cp = (char_t*) rq->servp;
- *--cp = (char_t) c;
- rq->servp = (unsigned char *) cp;
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Add a string to the queue. Add a trailing null (maybe two nulls)
- */
-
-int ringqPutStr(ringq_t *rq, char_t *str)
-{
- int rc;
-
- a_assert(rq);
- a_assert(str);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- rc = ringqPutBlk(rq, (unsigned char*) str, gstrlen(str) * sizeof(char_t));
- *((char_t*) rq->endp) = (char_t) '\0';
- return rc;
-}
-
-/******************************************************************************/
-/*
- * Add a null terminator. This does NOT increase the size of the queue
- */
-
-void ringqAddNull(ringq_t *rq)
-{
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- *((char_t*) rq->endp) = (char_t) '\0';
-}
-
-/******************************************************************************/
-#ifdef UNICODE
-/*
- * Get a byte from the queue
- */
-
-int ringqGetcA(ringq_t *rq)
-{
- unsigned char c;
-
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- if (rq->servp == rq->endp) {
- return -1;
- }
-
- c = *rq->servp++;
- if (rq->servp >= rq->endbuf) {
- rq->servp = rq->buf;
- }
- return c;
-}
-
-/******************************************************************************/
-/*
- * Add a byte to the queue. Note if being used to store strings this does not
- * add a trailing '\0'. Grow the q as required.
- */
-
-int ringqPutcA(ringq_t *rq, char c)
-{
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- if (ringqPutBlkMax(rq) == 0 && !ringqGrow(rq)) {
- return -1;
- }
-
- *rq->endp++ = (unsigned char) c;
- if (rq->endp >= rq->endbuf) {
- rq->endp = rq->buf;
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Insert a byte at the front of the queue
- */
-
-int ringqInsertcA(ringq_t *rq, char c)
-{
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- if (ringqPutBlkMax(rq) == 0 && !ringqGrow(rq)) {
- return -1;
- }
- if (rq->servp <= rq->buf) {
- rq->servp = rq->endbuf;
- }
- *--rq->servp = (unsigned char) c;
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Add a string to the queue. Add a trailing null (not really in the q).
- * ie. beyond the last valid byte.
- */
-
-int ringqPutStrA(ringq_t *rq, char *str)
-{
- int rc;
-
- a_assert(rq);
- a_assert(str);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- rc = ringqPutBlk(rq, (unsigned char*) str, strlen(str));
- rq->endp[0] = '\0';
- return rc;
-}
-
-#endif /* UNICODE */
-/******************************************************************************/
-/*
- * Add a block of data to the ringq. Return the number of bytes added.
- * Grow the q as required.
- */
-
-int ringqPutBlk(ringq_t *rq, unsigned char *buf, int size)
-{
- int this, bytes_put;
-
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
- a_assert(buf);
- a_assert(0 <= size);
-
-/*
- * Loop adding the maximum bytes we can add in a single straight line copy
- */
- bytes_put = 0;
- while (size > 0) {
- this = min(ringqPutBlkMax(rq), size);
- if (this <= 0) {
- if (! ringqGrow(rq)) {
- break;
- }
- this = min(ringqPutBlkMax(rq), size);
- }
-
- memcpy(rq->endp, buf, this);
- buf += this;
- rq->endp += this;
- size -= this;
- bytes_put += this;
-
- if (rq->endp >= rq->endbuf) {
- rq->endp = rq->buf;
- }
- }
- return bytes_put;
-}
-
-/******************************************************************************/
-/*
- * Get a block of data from the ringq. Return the number of bytes returned.
- */
-
-int ringqGetBlk(ringq_t *rq, unsigned char *buf, int size)
-{
- int this, bytes_read;
-
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
- a_assert(buf);
- a_assert(0 <= size && size < rq->buflen);
-
-/*
- * Loop getting the maximum bytes we can get in a single straight line copy
- */
- bytes_read = 0;
- while (size > 0) {
- this = ringqGetBlkMax(rq);
- this = min(this, size);
- if (this <= 0) {
- break;
- }
-
- memcpy(buf, rq->servp, this);
- buf += this;
- rq->servp += this;
- size -= this;
- bytes_read += this;
-
- if (rq->servp >= rq->endbuf) {
- rq->servp = rq->buf;
- }
- }
- return bytes_read;
-}
-
-/******************************************************************************/
-/*
- * Return the maximum number of bytes the ring q can accept via a single
- * block copy. Useful if the user is doing their own data insertion.
- */
-
-int ringqPutBlkMax(ringq_t *rq)
-{
- int space, in_a_line;
-
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- space = rq->buflen - RINGQ_LEN(rq) - 1;
- in_a_line = rq->endbuf - rq->endp;
-
- return min(in_a_line, space);
-}
-
-/******************************************************************************/
-/*
- * Return the maximum number of bytes the ring q can provide via a single
- * block copy. Useful if the user is doing their own data retrieval.
- */
-
-int ringqGetBlkMax(ringq_t *rq)
-{
- int len, in_a_line;
-
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
-
- len = RINGQ_LEN(rq);
- in_a_line = rq->endbuf - rq->servp;
-
- return min(in_a_line, len);
-}
-
-/******************************************************************************/
-/*
- * Adjust the endp pointer after the user has copied data into the queue.
- */
-
-void ringqPutBlkAdj(ringq_t *rq, int size)
-{
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
- a_assert(0 <= size && size < rq->buflen);
-
- rq->endp += size;
- if (rq->endp >= rq->endbuf) {
- rq->endp -= rq->buflen;
- }
-/*
- * Flush the queue if the endp pointer is corrupted via a bad size
- */
- if (rq->endp >= rq->endbuf) {
- error(E_L, E_LOG, T("Bad end pointer"));
- ringqFlush(rq);
- }
-}
-
-/******************************************************************************/
-/*
- * Adjust the servp pointer after the user has copied data from the queue.
- */
-
-void ringqGetBlkAdj(ringq_t *rq, int size)
-{
- a_assert(rq);
- a_assert(rq->buflen == (rq->endbuf - rq->buf));
- a_assert(0 < size && size < rq->buflen);
-
- rq->servp += size;
- if (rq->servp >= rq->endbuf) {
- rq->servp -= rq->buflen;
- }
-/*
- * Flush the queue if the servp pointer is corrupted via a bad size
- */
- if (rq->servp >= rq->endbuf) {
- error(E_L, E_LOG, T("Bad serv pointer"));
- ringqFlush(rq);
- }
-}
-
-/******************************************************************************/
-/*
- * Flush all data in a ring q. Reset the pointers.
- */
-
-void ringqFlush(ringq_t *rq)
-{
- a_assert(rq);
- a_assert(rq->servp);
-
- rq->servp = rq->buf;
- rq->endp = rq->buf;
- if (rq->servp) {
- *rq->servp = '\0';
- }
-}
-
-/******************************************************************************/
-/*
- * Grow the buffer. Return true if the buffer can be grown. Grow using
- * the increment size specified when opening the ringq. Don't grow beyond
- * the maximum possible size.
- */
-
-static int ringqGrow(ringq_t *rq)
-{
- unsigned char *newbuf;
- int len;
-
- a_assert(rq);
-
- if (rq->maxsize >= 0 && rq->buflen >= rq->maxsize) {
- return 0;
- }
-
- len = ringqLen(rq);
-
- if ((newbuf = balloc(B_L, rq->buflen + rq->increment)) == NULL) {
- return 0;
- }
- ringqGetBlk(rq, newbuf, ringqLen(rq));
- bfree(B_L, (char*) rq->buf);
-
-#ifdef OLD
- rq->endp = &newbuf[endp];
- rq->servp = &newbuf[servp];
- rq->endbuf = &newbuf[rq->buflen];
- rq->buf = newbuf;
-#endif
-
- rq->buflen += rq->increment;
- rq->endp = newbuf;
- rq->servp = newbuf;
- rq->buf = newbuf;
- rq->endbuf = &rq->buf[rq->buflen];
-
- ringqPutBlk(rq, newbuf, len);
-
-/*
- * Double the increment so the next grow will line up with balloc'ed memory
- */
- rq->increment = getBinBlockSize(2 * rq->increment);
-
- return 1;
-}
-
-/******************************************************************************/
-/*
- * Find the smallest binary memory size that "size" will fit into. This
- * makes the ringq and ringqGrow routines much more efficient. The balloc
- * routine likes powers of 2 minus 1.
- */
-
-static int getBinBlockSize(int size)
-{
- int q;
-
- size = size >> B_SHIFT;
- for (q = 0; size; size >>= 1) {
- q++;
- }
- return (1 << (B_SHIFT + q));
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/rom.c b/xbmc/lib/libGoAhead/src/rom.c deleted file mode 100644 index d2346d672b..0000000000 --- a/xbmc/lib/libGoAhead/src/rom.c +++ /dev/null @@ -1,194 +0,0 @@ -/*
- * rom.c -- Support for ROMed page retrieval.
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: rom.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module provides web page retrieval from compiled web pages. Use the
- * webcomp program to compile web pages and link into the GoAhead WebServer.
- * This module uses a hashed symbol table for fast page lookup.
- *
- * Usage: webcomp -f webPageFileList -p Prefix >webrom.c
- */
-
-/********************************* Includes ***********************************/
-
-#include <stdlib.h>
-
-#include "wsIntrn.h"
-
-/******************************** Local Data **********************************/
-
-#ifdef WEBS_PAGE_ROM
-
-sym_fd_t romTab; /* Symbol table for web pages */
-
-/*********************************** Code *************************************/
-/*
- * Open the ROM module
- */
-
-int websRomOpen()
-{
- websRomPageIndexType *wip;
- int nchars;
- char_t name[SYM_MAX];
-
- romTab = symOpen(WEBS_SYM_INIT);
-
- for (wip = websRomPageIndex; wip->path; wip++) {
- gstrncpy(name, wip->path, SYM_MAX);
- nchars = gstrlen(name) - 1;
- if (nchars > 0 &&
- (name[nchars] == '/' || name[nchars] == '\\')) {
- name[nchars] = '\0';
- }
- symEnter(romTab, name, valueInteger((int) wip), 0);
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Close the ROM module
- */
-
-void websRomClose()
-{
- symClose(romTab);
-}
-
-/******************************************************************************/
-/*
- * Open a web page
- */
-
-int websRomPageOpen(webs_t wp, char_t *path, int mode, int perm)
-{
- websRomPageIndexType *wip;
- sym_t *sp;
-
- a_assert(websValid(wp));
- a_assert(path && *path);
-
- if ((sp = symLookup(romTab, path)) == NULL) {
- return -1;
- }
- wip = (websRomPageIndexType*) sp->content.value.integer;
- wip->pos = 0;
- return (wp->docfd = wip - websRomPageIndex);
-}
-
-/******************************************************************************/
-/*
- * Close a web page
- */
-
-void websRomPageClose(int fd)
-{
-}
-
-/******************************************************************************/
-/*
- * Stat a web page
- */
-
-int websRomPageStat(char_t *path, websStatType *sbuf)
-{
- websRomPageIndexType *wip;
- sym_t *sp;
-
- a_assert(path && *path);
-
- if ((sp = symLookup(romTab, path)) == NULL) {
- return -1;
- }
- wip = (websRomPageIndexType*) sp->content.value.integer;
-
- memset(sbuf, 0, sizeof(websStatType));
- sbuf->size = wip->size;
- if (wip->page == NULL) {
- sbuf->isDir = 1;
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Read a web page
- */
-
-int websRomPageReadData(webs_t wp, char *buf, int nBytes)
-{
- websRomPageIndexType *wip;
- int len;
-
- a_assert(websValid(wp));
- a_assert(buf);
- a_assert(wp->docfd >= 0);
-
- wip = &websRomPageIndex[wp->docfd];
-
- len = min(wip->size - wip->pos, nBytes);
- memcpy(buf, &wip->page[wip->pos], len);
- wip->pos += len;
- return len;
-}
-
-/******************************************************************************/
-/*
- * Position a web page
- */
-
-long websRomPageSeek(webs_t wp, long offset, int origin)
-{
- websRomPageIndexType *wip;
- long pos;
-
- a_assert(websValid(wp));
- a_assert(origin == SEEK_SET || origin == SEEK_CUR || origin == SEEK_END);
- a_assert(wp->docfd >= 0);
-
- wip = &websRomPageIndex[wp->docfd];
-
- if (origin != SEEK_SET && origin != SEEK_CUR && origin != SEEK_END) {
- errno = EINVAL;
- return -1;
- }
-
- if (wp->docfd < 0) {
- errno = EBADF;
- return -1;
- }
-
- pos = offset;
- switch (origin) {
- case SEEK_CUR:
- pos = wip->pos + offset;
- break;
- case SEEK_END:
- pos = wip->size + offset;
- break;
- default:
- break;
- }
-
- if (pos < 0) {
- errno = EBADF;
- return -1;
- }
-
- return (wip->pos = pos);
-}
-
-#endif /* WEBS_PAGE_ROM */
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/security.c b/xbmc/lib/libGoAhead/src/security.c deleted file mode 100644 index c92fff856b..0000000000 --- a/xbmc/lib/libGoAhead/src/security.c +++ /dev/null @@ -1,240 +0,0 @@ -/*
- * security.c -- Security handler
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: security.c,v 1.9 2003/09/19 17:04:44 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module provides a basic security policy.
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-#include "um.h"
-#ifdef DIGEST_ACCESS_SUPPORT
-#include "websda.h"
-#endif
-
-/********************************** Defines ***********************************/
-/*
- * The following #defines change the behaviour of security in the absence
- * of User Management.
- * Note that use of User management functions require prior calling of
- * umInit() to behave correctly
- */
-
-#ifndef USER_MANAGEMENT_SUPPORT
-#define umGetAccessMethodForURL(url) AM_FULL
-#define umUserExists(userid) 0
-#define umUserCanAccessURL(userid, url) 1
-#define umGetUserPassword(userid) websGetPassword()
-#define umGetAccessLimitSecure(accessLimit) 0
-#define umGetAccessLimit(url) NULL
-#endif
-
-/******************************** Local Data **********************************/
-
-static char_t websPassword[WEBS_MAX_PASS]; /* Access password (decoded) */
-#ifdef _DEBUG
-static int debugSecurity = 1;
-#else
-static int debugSecurity = 0;
-#endif
-
-/*********************************** Code *************************************/
-/*
- * Determine if this request should be honored
- */
-
-int websSecurityHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg,
- char_t *url, char_t *path, char_t *query)
-{
- char_t *type, *userid, *password, *accessLimit;
- int flags, nRet;
- accessMeth_t am;
-
- a_assert(websValid(wp));
- a_assert(url && *url);
- a_assert(path && *path);
-/*
- * Get the critical request details
- */
- type = websGetRequestType(wp);
- password = websGetRequestPassword(wp);
- userid = websGetRequestUserName(wp);
- flags = websGetRequestFlags(wp);
-/*
- * Get the access limit for the URL. Exit if none found.
- */
- accessLimit = umGetAccessLimit(path);
- if (accessLimit == NULL) {
- return 0;
- }
-
-/*
- * Check to see if URL must be encrypted
- */
-#ifdef WEBS_SSL_SUPPORT
- nRet = umGetAccessLimitSecure(accessLimit);
- if (nRet && ((flags & WEBS_SECURE) == 0)) {
- websStats.access++;
- websError(wp, 405, T("Access Denied\nSecure access is required."));
- trace(3, T("SEC: Non-secure access attempted on <%s>\n"), path);
- /* bugfix 5/24/02 -- we were leaking the memory pointed to by
- * 'accessLimit'. Thanks to Simon Byholm.
- */
- bfree(B_L, accessLimit);
- return 1;
- }
-#endif
-
-/*
- * Get the access limit for the URL
- */
- am = umGetAccessMethodForURL(accessLimit);
-
- nRet = 0;
- if ((flags & WEBS_LOCAL_REQUEST) && (debugSecurity == 0)) {
-/*
- * Local access is always allowed (defeat when debugging)
- */
- } else if (am == AM_NONE) {
-/*
- * URL is supposed to be hidden! Make like it wasn't found.
- */
- websStats.access++;
- websError(wp, 404, T("Page Not Found"));
- nRet = 1;
- } else if (userid && *userid) {
- if (!umUserExists(userid)) {
- websStats.access++;
- websError(wp, 401, T("Access Denied\nUnknown User"));
- trace(3, T("SEC: Unknown user <%s> attempted to access <%s>\n"),
- userid, path);
- nRet = 1;
- } else if (!umUserCanAccessURL(userid, accessLimit)) {
- websStats.access++;
- websError(wp, 403, T("Access Denied\nProhibited User"));
- nRet = 1;
- } else if (password && * password) {
- char_t * userpass = umGetUserPassword(userid);
- if (userpass) {
- if (gstrcmp(password, userpass) != 0) {
- websStats.access++;
- websError(wp, 401, T("Access Denied\nWrong Password"));
- trace(3, T("SEC: Password fail for user <%s>")
- T("attempt to access <%s>\n"), userid, path);
- nRet = 1;
- } else {
-/*
- * User and password check out.
- */
- }
-
- bfree (B_L, userpass);
- }
-#ifdef DIGEST_ACCESS_SUPPORT
- } else if (flags & WEBS_AUTH_DIGEST) {
-
- char_t *digestCalc;
-
-/*
- * Check digest for equivalence
- */
- wp->password = umGetUserPassword(userid);
-
- a_assert(wp->digest);
- a_assert(wp->nonce);
- a_assert(wp->password);
-
- digestCalc = websCalcDigest(wp);
- a_assert(digestCalc);
-
- if (gstrcmp(wp->digest, digestCalc) != 0) {
- websStats.access++;
- /* 16 Jun 03 -- error code changed from 405 to 401 -- thanks to
- * Jay Chalfant.
- */
- websError(wp, 401, T("Access Denied\nWrong Password"));
- nRet = 1;
- }
-
- bfree (B_L, digestCalc);
-#endif
- } else {
-/*
- * No password has been specified
- */
-#ifdef DIGEST_ACCESS_SUPPORT
- if (am == AM_DIGEST) {
- wp->flags |= WEBS_AUTH_DIGEST;
- }
-#endif
- websStats.errors++;
- websError(wp, 401,
- T("Access to this document requires a password"));
- nRet = 1;
- }
- } else if (am != AM_FULL) {
-/*
- * This will cause the browser to display a password / username
- * dialog
- */
-#ifdef DIGEST_ACCESS_SUPPORT
- if (am == AM_DIGEST) {
- wp->flags |= WEBS_AUTH_DIGEST;
- }
-#endif
- websStats.errors++;
- websError(wp, 401, T("Access to this document requires a User ID"));
- nRet = 1;
- }
-
- bfree(B_L, accessLimit);
-
- return nRet;
-}
-
-/******************************************************************************/
-/*
- * Delete the default security handler
- */
-
-void websSecurityDelete()
-{
- websUrlHandlerDelete(websSecurityHandler);
-}
-
-/******************************************************************************/
-/*
- * Store the new password, expect a decoded password. Store in websPassword in
- * the decoded form.
- */
-
-void websSetPassword(char_t *password)
-{
- a_assert(password);
-
- gstrncpy(websPassword, password, TSZ(websPassword));
-}
-
-/******************************************************************************/
-/*
- * Get password, return the decoded form
- */
-
-char_t *websGetPassword()
-{
- return bstrdup(B_L, websPassword);
-}
-
-/******************************************************************************/
-
-
diff --git a/xbmc/lib/libGoAhead/src/sock.c b/xbmc/lib/libGoAhead/src/sock.c deleted file mode 100644 index 940a02d477..0000000000 --- a/xbmc/lib/libGoAhead/src/sock.c +++ /dev/null @@ -1,798 +0,0 @@ -/*
- * sock.c -- Posix Socket upper layer support module for general posix use
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * $Id: sock.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * Posix Socket Module. This supports blocking and non-blocking buffered
- * socket I/O.
- */
-
-/********************************** Includes **********************************/
-
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include <socket.h>
- #include <types.h>
- #include <unistd.h>
- #include "emfInternal.h"
-#endif
-
-#ifdef _XBOX
- #define FD_WRITE 0x02
- #define FD_CONNECT 0x10
-#endif //_XBOX
-/************************************ Locals **********************************/
-
-socket_t **socketList; /* List of open sockets */
-int socketMax; /* Maximum size of socket */
-int socketHighestFd = -1; /* Highest socket fd opened */
-
-/***************************** Forward Declarations ***************************/
-
-static int socketDoOutput(socket_t *sp, char *buf, int toWrite, int *errCode);
-static int tryAlternateSendTo(int sock, char *buf, int toWrite, int i,
- struct sockaddr *server);
-
-/*********************************** Code *************************************/
-/*
- * Write to a socket. Absorb as much data as the socket can buffer. Block if
- * the socket is in blocking mode. Returns -1 on error, otherwise the number
- * of bytes written.
- */
-
-int socketWrite(int sid, char *buf, int bufsize)
-{
- socket_t *sp;
- ringq_t *rq;
- int len, bytesWritten, room;
-
- a_assert(buf);
- a_assert(bufsize >= 0);
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
-
-/*
- * Loop adding as much data to the output ringq as we can absorb. Initiate a
- * flush when the ringq is too full and continue. Block in socketFlush if the
- * socket is in blocking mode.
- */
- rq = &sp->outBuf;
- for (bytesWritten = 0; bufsize > 0; ) {
- if ((room = ringqPutBlkMax(rq)) == 0) {
- if (socketFlush(sid) < 0) {
- return -1;
- }
- if ((room = ringqPutBlkMax(rq)) == 0) {
- if (sp->flags & SOCKET_BLOCK) {
-#if (defined (WIN) || defined (CE))
- int errCode;
- if (! socketWaitForEvent(sp, FD_WRITE | SOCKET_WRITABLE,
- &errCode)) {
- return -1;
- }
-#endif
- continue;
- }
- break;
- }
- continue;
- }
- len = min(room, bufsize);
- ringqPutBlk(rq, (unsigned char *) buf, len);
- bytesWritten += len;
- bufsize -= len;
- buf += len;
- }
- return bytesWritten;
-}
-
-/******************************************************************************/
-/*
- * Write a string to a socket
- */
-
-int socketWriteString(int sid, char_t *buf)
-{
- #ifdef UNICODE
- char *byteBuf;
- int r, len;
-
- len = gstrlen(buf);
- byteBuf = ballocUniToAsc(buf, len);
- r = socketWrite(sid, byteBuf, len);
- bfreeSafe(B_L, byteBuf);
- return r;
- #else
- return socketWrite(sid, buf, strlen(buf));
- #endif /* UNICODE */
-}
-
-/******************************************************************************/
-/*
- * Read from a socket. Return the number of bytes read if successful. This
- * may be less than the requested "bufsize" and may be zero. Return -1 for
- * errors. Return 0 for EOF. Otherwise return the number of bytes read.
- * If this routine returns zero it indicates an EOF condition.
- * which can be verified with socketEof()
-
- * Note: this ignores the line buffer, so a previous socketGets
- * which read a partial line may cause a subsequent socketRead to miss some
- * data. This routine may block if the socket is in blocking mode.
- *
- */
-
-int socketRead(int sid, char *buf, int bufsize)
-{
- socket_t *sp;
- ringq_t *rq;
- int len, room, errCode, bytesRead;
-
- a_assert(buf);
- a_assert(bufsize > 0);
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
-
- if (sp->flags & SOCKET_EOF) {
- return 0;
- }
-
- rq = &sp->inBuf;
- for (bytesRead = 0; bufsize > 0; ) {
- len = min(ringqLen(rq), bufsize);
- if (len <= 0) {
-/*
- * if blocking mode and already have data, exit now or it may block
- * forever.
- */
- if ((sp->flags & SOCKET_BLOCK) &&
- (bytesRead > 0)) {
- break;
- }
-/*
- * This flush is critical for readers of datagram packets. If the
- * buffer is not big enough to read the whole datagram in one hit,
- * the recvfrom call will fail.
- */
- ringqFlush(rq);
- room = ringqPutBlkMax(rq);
- len = socketGetInput(sid, (char *) rq->endp, room, &errCode);
- if (len < 0) {
- if (errCode == EWOULDBLOCK) {
- if ((sp->flags & SOCKET_BLOCK) &&
- (bytesRead == 0)) {
- continue;
- }
- if (bytesRead >= 0) {
- return bytesRead;
- }
- }
- return -1;
-
- } else if (len == 0) {
-/*
- * If bytesRead is 0, this is EOF since socketRead should never
- * be called unless there is data yet to be read. Set the flag.
- * Then pass back the number of bytes read.
- */
- if (bytesRead == 0) {
- sp->flags |= SOCKET_EOF;
- }
- return bytesRead;
- }
- ringqPutBlkAdj(rq, len);
- len = min(len, bufsize);
- }
- memcpy(&buf[bytesRead], rq->servp, len);
- ringqGetBlkAdj(rq, len);
- bufsize -= len;
- bytesRead += len;
- }
- return bytesRead;
-}
-
-/******************************************************************************/
-/*
- * Get a string from a socket. This returns data in *buf in a malloced string
- * after trimming the '\n'. If there is zero bytes returned, *buf will be set
- * to NULL. If doing non-blocking I/O, it returns -1 for error, EOF or when
- * no complete line yet read. If doing blocking I/O, it will block until an
- * entire line is read. If a partial line is read socketInputBuffered or
- * socketEof can be used to distinguish between EOF and partial line still
- * buffered. This routine eats and ignores carriage returns.
- */
-
-int socketGets(int sid, char_t **buf)
-{
- socket_t *sp;
- ringq_t *lq;
- char c;
- int rc, len;
-
- a_assert(buf);
- *buf = NULL;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
- lq = &sp->lineBuf;
-
- while (1) {
-
- if ((rc = socketRead(sid, &c, 1)) < 0) {
- return rc;
- }
-
- if (rc == 0) {
-/*
- * If there is a partial line and we are at EOF, pretend we saw a '\n'
- */
- if (ringqLen(lq) > 0 && (sp->flags & SOCKET_EOF)) {
- c = '\n';
- } else {
- return -1;
- }
- }
-/*
- * If a newline is seen, return the data excluding the new line to the
- * caller. If carriage return is seen, just eat it.
- */
- if (c == '\n') {
- len = ringqLen(lq);
- if (len > 0) {
- *buf = ballocAscToUni((char *)lq->servp, len);
- } else {
- *buf = NULL;
- }
- ringqFlush(lq);
- return len;
-
- } else if (c == '\r') {
- continue;
- }
- ringqPutcA(lq, c);
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Flush the socket. Block if the socket is in blocking mode.
- * This will return -1 on errors and 0 if successful.
- */
-
-int socketFlush(int sid)
-{
- socket_t *sp;
- ringq_t *rq;
- int len, bytesWritten, errCode;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
- rq = &sp->outBuf;
-
-/*
- * Set the background flushing flag which socketEventProc will check to
- * continue the flush.
- */
- if (! (sp->flags & SOCKET_BLOCK)) {
- sp->flags |= SOCKET_FLUSHING;
- }
-
-/*
- * Break from loop if not blocking after initiating output. If we are blocking
- * we wait for a write event.
- */
- while (ringqLen(rq) > 0) {
- len = ringqGetBlkMax(&sp->outBuf);
- bytesWritten = socketDoOutput(sp, (char*) rq->servp, len, &errCode);
- if (bytesWritten < 0) {
- if (errCode == EINTR) {
- continue;
- } else if (errCode == EWOULDBLOCK || errCode == EAGAIN) {
-#if (defined (WIN) || defined (CE))
- if (sp->flags & SOCKET_BLOCK) {
- int errCode;
- if (! socketWaitForEvent(sp, FD_WRITE | SOCKET_WRITABLE,
- &errCode)) {
- return -1;
- }
- continue;
- }
-#endif
-/*
- * Ensure we get a FD_WRITE message when the socket can absorb
- * more data (non-blocking only.) Store the user's mask if we
- * haven't done it already.
- */
- if (sp->saveMask < 0 ) {
- sp->saveMask = sp->handlerMask;
- socketRegisterInterest(sp,
- sp->handlerMask | SOCKET_WRITABLE);
- }
- return 0;
- }
- return -1;
- }
- ringqGetBlkAdj(rq, bytesWritten);
- }
-/*
- * If the buffer is empty, reset the ringq pointers to point to the start
- * of the buffer. This is essential to ensure that datagrams get written
- * in one single I/O operation.
- */
- if (ringqLen(rq) == 0) {
- ringqFlush(rq);
- }
-/*
- * Restore the users mask if it was saved by the non-blocking code above.
- * Note: saveMask = -1 if empty. socketRegisterInterest will set handlerMask
- */
- if (sp->saveMask >= 0) {
- socketRegisterInterest(sp, sp->saveMask);
- sp->saveMask = -1;
- }
- sp->flags &= ~SOCKET_FLUSHING;
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Return the count of input characters buffered. We look at both the line
- * buffer and the input (raw) buffer. Return -1 on error or EOF.
- */
-
-int socketInputBuffered(int sid)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
- if (socketEof(sid)) {
- return -1;
- }
- return ringqLen(&sp->lineBuf) + ringqLen(&sp->inBuf);
-}
-
-/******************************************************************************/
-/*
- * Return true if EOF
- */
-
-int socketEof(int sid)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
- return sp->flags & SOCKET_EOF;
-}
-
-/******************************************************************************/
-/*
- * Return the number of bytes the socket can absorb without blocking
- */
-
-int socketCanWrite(int sid)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
- return sp->outBuf.buflen - ringqLen(&sp->outBuf) - 1;
-}
-
-/******************************************************************************/
-/*
- * Add one to allow the user to write exactly SOCKET_BUFSIZ
- */
-
-void socketSetBufferSize(int sid, int in, int line, int out)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return;
- }
-
- if (in >= 0) {
- ringqClose(&sp->inBuf);
- in++;
- ringqOpen(&sp->inBuf, in, in);
- }
-
- if (line >= 0) {
- ringqClose(&sp->lineBuf);
- line++;
- ringqOpen(&sp->lineBuf, line, line);
- }
-
- if (out >= 0) {
- ringqClose(&sp->outBuf);
- out++;
- ringqOpen(&sp->outBuf, out, out);
- }
-}
-
-/******************************************************************************/
-/*
- * Create a user handler for this socket. The handler called whenever there
- * is an event of interest as defined by handlerMask (SOCKET_READABLE, ...)
- */
-
-void socketCreateHandler(int sid, int handlerMask, socketHandler_t handler,
- void* data)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return;
- }
- sp->handler = handler;
- sp->handler_data = data;
- socketRegisterInterest(sp, handlerMask);
-}
-
-/******************************************************************************/
-/*
- * Delete a handler
- */
-
-void socketDeleteHandler(int sid)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return;
- }
- sp->handler = NULL;
- socketRegisterInterest(sp, 0);
-}
-
-/******************************************************************************/
-/*
- * Socket output procedure. Return -1 on errors otherwise return the number
- * of bytes written.
- */
-
-static int socketDoOutput(socket_t *sp, char *buf, int toWrite, int *errCode)
-{
- struct sockaddr_in server;
- int bytes;
-
- a_assert(sp);
- a_assert(buf);
- a_assert(toWrite > 0);
- a_assert(errCode);
-
- *errCode = 0;
-
-#if (defined (WIN) || defined (CE))
- if ((sp->flags & SOCKET_ASYNC)
- && ! socketWaitForEvent(sp, FD_CONNECT, errCode)) {
- return -1;
- }
-#endif
-
-/*
- * Write the data
- */
- if (sp->flags & SOCKET_BROADCAST) {
- server.sin_family = AF_INET;
-#if (defined (UEMF) || defined (LITTLEFOOT))
- server.sin_addr.s_addr = INADDR_BROADCAST;
-#else
- server.sin_addr.s_addr = inet_addr(basicGetBroadcastAddress());
-#endif
- server.sin_port = htons((short)(sp->port & 0xFFFF));
- if ((bytes = sendto(sp->sock, buf, toWrite, 0,
- (struct sockaddr *) &server, sizeof(server))) < 0) {
- bytes = tryAlternateSendTo(sp->sock, buf, toWrite, 0,
- (struct sockaddr *) &server);
- }
- } else if (sp->flags & SOCKET_DATAGRAM) {
- server.sin_family = AF_INET;
- server.sin_addr.s_addr = inet_addr(sp->host);
- server.sin_port = htons((short)(sp->port & 0xFFFF));
- bytes = sendto(sp->sock, buf, toWrite, 0,
- (struct sockaddr *) &server, sizeof(server));
-
- } else {
- bytes = send(sp->sock, buf, toWrite, 0);
- }
-
- if (bytes < 0) {
- *errCode = socketGetError();
-#if (defined (WIN) || defined (CE))
- sp->currentEvents &= ~FD_WRITE;
-#endif
-
- return -1;
-
- } else if (bytes == 0 && bytes != toWrite) {
- *errCode = EWOULDBLOCK;
-#if (defined (WIN) || defined (CE))
- sp->currentEvents &= ~FD_WRITE;
-#endif
- return -1;
- }
-
-/*
- * Ensure we get to write some more data real soon if the socket can absorb
- * more data
- */
-#ifndef UEMF
-#ifdef WIN
- if (sp->interestEvents & FD_WRITE) {
- emfTime_t blockTime = { 0, 0 };
- emfSetMaxBlockTime(&blockTime);
- }
-#endif /* WIN */
-#endif
- return bytes;
-}
-
-/******************************************************************************/
-/*
- * If the sendto failed, swap the first two bytes in the
- * sockaddr structure. This is a kludge due to a change in
- * VxWorks between versions 5.3 and 5.4, but we want the
- * product to run on either.
- */
-static int tryAlternateSendTo(int sock, char *buf, int toWrite, int i,
- struct sockaddr *server)
-{
-#ifdef VXWORKS
- char *ptr;
-
- ptr = (char *)server;
- *ptr = *(ptr+1);
- *(ptr+1) = 0;
- return sendto(sock, buf, toWrite, i, server, sizeof(struct sockaddr));
-#else
- return -1;
-#endif /* VXWORKS */
-}
-
-/******************************************************************************/
-/*
- * Allocate a new socket structure
- */
-
-int socketAlloc(char *host, int port, socketAccept_t accept, int flags)
-{
- socket_t *sp;
- int sid;
-
- if ((sid = hAllocEntry((void***) &socketList, &socketMax,
- sizeof(socket_t))) < 0) {
- return -1;
- }
- sp = socketList[sid];
-
- sp->sid = sid;
- sp->accept = accept;
- sp->port = port;
- sp->fileHandle = -1;
- sp->saveMask = -1;
-
- if (host) {
- strncpy(sp->host, host, sizeof(sp->host));
- }
-
-/*
- * Preserve only specified flags from the callers open
- */
- a_assert((flags & ~(SOCKET_BROADCAST|SOCKET_DATAGRAM|SOCKET_BLOCK|
- SOCKET_LISTENING)) == 0);
- sp->flags = flags & (SOCKET_BROADCAST | SOCKET_DATAGRAM | SOCKET_BLOCK|
- SOCKET_LISTENING);
-
-/*
- * Add one to allow the user to write exactly SOCKET_BUFSIZ
- */
- ringqOpen(&sp->inBuf, SOCKET_BUFSIZ, SOCKET_BUFSIZ);
- ringqOpen(&sp->outBuf, SOCKET_BUFSIZ + 1, SOCKET_BUFSIZ + 1);
- ringqOpen(&sp->lineBuf, SOCKET_BUFSIZ, -1);
-
- return sid;
-}
-
-/******************************************************************************/
-/*
- * Free a socket structure
- */
-
-void socketFree(int sid)
-{
- socket_t *sp;
- char_t buf[256];
- int i;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return;
- }
-
-/*
- * To close a socket, remove any registered interests, set it to
- * non-blocking so that the recv which follows won't block, do a
- * shutdown on it so peers on the other end will receive a FIN,
- * then read any data not yet retrieved from the receive buffer,
- * and finally close it. If these steps are not all performed
- * RESETs may be sent to the other end causing problems.
- */
- socketRegisterInterest(sp, 0);
- // QS - changed from >= 0 to != SOCKET_ERROR
- if (sp->sock != SOCKET_ERROR) {
- socketSetBlock(sid, 0);
- // QS - changed from >= 0 to != SOCKET_ERROR
- if (shutdown(sp->sock, 1) != SOCKET_ERROR) {
- recv(sp->sock, buf, sizeof(buf), 0);
- }
-#if (defined (WIN) || defined (CE))
- closesocket(sp->sock);
-#else
- close(sp->sock);
-#endif
- }
-
- ringqClose(&sp->inBuf);
- ringqClose(&sp->outBuf);
- ringqClose(&sp->lineBuf);
-
- bfree(B_L, sp);
- socketMax = hFree((void***) &socketList, sid);
-
-/*
- * Calculate the new highest socket number
- */
- socketHighestFd = -1;
- for (i = 0; i < socketMax; i++) {
- if ((sp = socketList[i]) == NULL) {
- continue;
- }
- socketHighestFd = max(socketHighestFd, sp->sock);
- }
-}
-
-/******************************************************************************/
-/*
- * Validate a socket handle
- */
-
-socket_t *socketPtr(int sid)
-{
- if (sid < 0 || sid >= socketMax || socketList[sid] == NULL) {
- a_assert(NULL);
- errno = EBADF;
- return NULL;
- }
-
- a_assert(socketList[sid]);
- return socketList[sid];
-}
-
-/******************************************************************************/
-/*
- * Get the operating system error code
- */
-
-int socketGetError()
-{
-#if (defined (WIN) || defined (CE))
- switch (WSAGetLastError()) {
- case WSAEWOULDBLOCK:
- return EWOULDBLOCK;
- case WSAECONNRESET:
- return ECONNRESET;
- case WSAENETDOWN:
- return ENETDOWN;
- case WSAEPROCLIM:
- return EAGAIN;
- case WSAEINTR:
- return EINTR;
- default:
- return EINVAL;
- }
-#else
- return errno;
-#endif
-}
-
-/******************************************************************************/
-/*
- * Return the underlying socket handle
- */
-
-int socketGetHandle(int sid)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
- return sp->sock;
-}
-
-/******************************************************************************/
-/*
- * Get blocking mode
- */
-
-int socketGetBlock(int sid)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- a_assert(0);
- return 0;
- }
- return (sp->flags & SOCKET_BLOCK);
-}
-
-/******************************************************************************/
-/*
- * Get mode
- */
-
-int socketGetMode(int sid)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- a_assert(0);
- return 0;
- }
- return sp->flags;
-}
-
-/******************************************************************************/
-/*
- * Set mode
- */
-
-void socketSetMode(int sid, int mode)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- a_assert(0);
- return;
- }
- sp->flags = mode;
-}
-
-/******************************************************************************/
-/*
- * Get port.
- */
-
-int socketGetPort(int sid)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
- return sp->port;
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/sockGen.c b/xbmc/lib/libGoAhead/src/sockGen.c deleted file mode 100644 index 22816f229d..0000000000 --- a/xbmc/lib/libGoAhead/src/sockGen.c +++ /dev/null @@ -1,1048 +0,0 @@ -
-/*
- * sockGen.c -- Posix Socket support module for general posix use
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * $Id: sockGen.c,v 1.6 2003/04/11 18:00:12 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * Posix Socket Module. This supports blocking and non-blocking buffered
- * socket I/O.
- */
-
-#if (!defined (WIN) || defined (LITTLEFOOT) || defined (WEBS))
-
-/********************************** Includes **********************************/
-#ifndef CE
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#endif
-
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include <socket.h>
- #include <types.h>
- #include <unistd.h>
- #include "emfInternal.h"
-#endif
-
-#ifdef VXWORKS
- #include <hostLib.h>
-#endif
- -#include "socketutil.h" -
-/************************************ Locals **********************************/
-
-extern socket_t **socketList; /* List of open sockets */
-extern int socketMax; /* Maximum size of socket */
-extern int socketHighestFd; /* Highest socket fd opened */
-static int socketOpenCount = 0; /* Number of task using sockets */
-
-/***************************** Forward Declarations ***************************/
-
-static void socketAccept(socket_t *sp);
-static int socketDoEvent(socket_t *sp);
-static int tryAlternateConnect(int sock, struct sockaddr *sockaddr);
-
-/*********************************** Code *************************************/
-/*
- * Open socket module
- */
-
-int socketOpen()
-{
-#if (defined (CE) || defined (WIN))
- WSADATA wsaData;
-#endif
-
- if (++socketOpenCount > 1) {
- return 0;
- }
-
-#if (defined (CE) || defined (WIN))
- if (WSAStartup(MAKEWORD(1,1), &wsaData) != 0) {
- return -1;
- }
- if (wsaData.wVersion != MAKEWORD(1,1)) {
- WSACleanup();
- return -1;
- }
-#endif
-
- socketList = NULL;
- socketMax = 0;
- socketHighestFd = -1;
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Close the socket module, by closing all open connections
- */
-
-void socketClose()
-{
- int i;
-
- if (--socketOpenCount <= 0) {
- for (i = socketMax; i >= 0; i--) {
- if (socketList && socketList[i]) {
- socketCloseConnection(i);
- }
- }
- socketOpenCount = 0;
- }
-}
-
-/******************************************************************************/
-/*
- * Open a client or server socket. Host is NULL if we want server capability.
- */
-
-int socketOpenConnection(char *host, int port, socketAccept_t accept, int flags)
-{
-#if (!defined (NO_gethostbyname) && !defined (VXWORKS))
- struct hostent *hostent; /* Host database entry */
-#endif /* ! (NO_gethostbyname || VXWORKS) */
- socket_t *sp;
- struct sockaddr_in sockaddr;
- int sid, bcast, dgram, rc;
-
- if (port > SOCKET_PORT_MAX) {
- return -1;
- }
-/*
- * Allocate a socket structure
- */
- if ((sid = socketAlloc(host, port, accept, flags)) < 0) {
- return -1;
- }
- sp = socketList[sid];
- a_assert(sp);
-
-/*
- * Create the socket address structure
- */
- memset((char *) &sockaddr, '\0', sizeof(struct sockaddr_in));
- sockaddr.sin_family = AF_INET;
- sockaddr.sin_port = htons((short) (port & 0xFFFF));
-
- if (host == NULL) {
- sockaddr.sin_addr.s_addr = INADDR_ANY;
- } else {
- sockaddr.sin_addr.s_addr = inet_addr(host);
- if (sockaddr.sin_addr.s_addr == INADDR_NONE) {
-/*
- * If the OS does not support gethostbyname functionality, the macro:
- * NO_gethostbyname should be defined to skip the use of gethostbyname.
- * Unfortunatly there is no easy way to recover, the following code
- * simply uses the basicGetHost IP for the sockaddr.
- */
-
-#ifdef NO_gethostbyname
- if (strcmp(host, basicGetHost()) == 0) {
- sockaddr.sin_addr.s_addr = inet_addr(basicGetAddress());
- }
- if (sockaddr.sin_addr.s_addr == INADDR_NONE) {
- socketFree(sid);
- return -1;
- }
-#elif (defined (VXWORKS))
- sockaddr.sin_addr.s_addr = (unsigned long) hostGetByName(host);
- if (sockaddr.sin_addr.s_addr == NULL) {
- errno = ENXIO;
- socketFree(sid);
- return -1;
- }
-#else
- hostent = webs_gethostbyname(host);
- if (hostent != NULL) {
- memcpy((char *) &sockaddr.sin_addr,
- (char *) hostent->h_addr_list[0],
- (size_t) hostent->h_length);
- } else {
- char *asciiAddress;
- char_t *address;
-
- address = basicGetAddress();
- asciiAddress = ballocUniToAsc(address, gstrlen(address));
- sockaddr.sin_addr.s_addr = inet_addr(asciiAddress);
- bfree(B_L, asciiAddress);
- if (sockaddr.sin_addr.s_addr == INADDR_NONE) {
- errno = ENXIO;
- socketFree(sid);
- return -1;
- }
- }
-#endif /* (NO_gethostbyname || VXWORKS) */
- }
- }
-
- bcast = sp->flags & SOCKET_BROADCAST;
- if (bcast) {
- sp->flags |= SOCKET_DATAGRAM;
- }
- dgram = sp->flags & SOCKET_DATAGRAM;
-
-/*
- * Create the socket. Support for datagram sockets. Set the close on
- * exec flag so children don't inherit the socket.
- */
- sp->sock = socket(AF_INET, dgram ? SOCK_DGRAM: SOCK_STREAM, 0);
- if (sp->sock == SOCKET_ERROR) {
- socketFree(sid);
- return -1;
- }
-#ifndef __NO_FCNTL
- fcntl(sp->sock, F_SETFD, FD_CLOEXEC);
-#endif
- socketHighestFd = max(socketHighestFd, sp->sock);
-
-/*
- * If broadcast, we need to turn on broadcast capability.
- */
- if (bcast) {
- int broadcastFlag = 1;
- if (setsockopt(sp->sock, SOL_SOCKET, SO_BROADCAST,
- (char *) &broadcastFlag, sizeof(broadcastFlag)) == SOCKET_ERROR) {
- socketFree(sid);
- return -1;
- }
- }
-
-/*
- * Host is set if we are the client
- */
- if (host) {
-/*
- * Connect to the remote server in blocking mode, then go into
- * non-blocking mode if desired.
- */
- if (!dgram) {
- if (! (sp->flags & SOCKET_BLOCK)) {
-/*
- * sockGen.c is only used for Windows products when blocking
- * connects are expected. This applies to FieldUpgrader
- * agents and open source webserver connectws. Therefore the
- * asynchronous connect code here is not compiled.
- */
-#if (defined (WIN) || defined (CE)) && (!defined (LITTLEFOOT) && !defined (WEBS))
- int flag;
-
- sp->flags |= SOCKET_ASYNC;
-/*
- * Set to non-blocking for an async connect
- */
- flag = 1;
- if (ioctlsocket(sp->sock, FIONBIO, &flag) == SOCKET_ERROR) {
- socketFree(sid);
- return -1;
- }
-#else
- socketSetBlock(sid, 1);
-#endif /* #if (WIN || CE) && !(LITTLEFOOT || WEBS) */
-
- }
- if ((rc = connect(sp->sock, (struct sockaddr *) &sockaddr,
- sizeof(sockaddr))) == SOCKET_ERROR &&
- (rc = tryAlternateConnect(sp->sock,
- (struct sockaddr *) &sockaddr)) < 0) {
-#if (defined (WIN) || defined (CE))
- if (socketGetError() != EWOULDBLOCK) {
- socketFree(sid);
- return -1;
- }
-#else
- socketFree(sid);
- return -1;
-
-#endif /* WIN || CE */
-
- }
- }
- } else {
-/*
- * Bind to the socket endpoint and the call listen() to start listening
- */
- rc = 1;
- setsockopt(sp->sock, SOL_SOCKET, SO_REUSEADDR, (char *)&rc, sizeof(rc));
- if (bind(sp->sock, (struct sockaddr *) &sockaddr,
- sizeof(sockaddr)) == SOCKET_ERROR) {
- socketFree(sid);
- return -1;
- }
-
- if (! dgram) {
- if (listen(sp->sock, SOMAXCONN) == SOCKET_ERROR) {
- socketFree(sid);
- return -1;
- }
-#ifndef UEMF
- sp->fileHandle = emfCreateFileHandler(sp->sock, SOCKET_READABLE,
- (emfFileProc *) socketAccept, (void *) sp);
-#else
- sp->flags |= SOCKET_LISTENING;
-#endif
- }
- sp->handlerMask |= SOCKET_READABLE;
- }
-
-/*
- * Set the blocking mode
- */
-
- if (flags & SOCKET_BLOCK) {
- socketSetBlock(sid, 1);
- } else {
- socketSetBlock(sid, 0);
- }
- return sid;
-}
-
-
-/******************************************************************************/
-/*
- * If the connection failed, swap the first two bytes in the
- * sockaddr structure. This is a kludge due to a change in
- * VxWorks between versions 5.3 and 5.4, but we want the
- * product to run on either.
- */
-
-static int tryAlternateConnect(int sock, struct sockaddr *sockaddr)
-{
-#ifdef VXWORKS
- char *ptr;
-
- ptr = (char *)sockaddr;
- *ptr = *(ptr+1);
- *(ptr+1) = 0;
- return connect(sock, sockaddr, sizeof(struct sockaddr));
-#else
- return -1;
-#endif /* VXWORKS */
-}
-
-/******************************************************************************/
-/*
- * Close a socket
- */
-
-void socketCloseConnection(int sid)
-{
- socket_t *sp;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return;
- }
- socketFree(sid);
-}
-
-/******************************************************************************/
-/*
- * Accept a connection. Called as a callback on incoming connection.
- */
-
-static void socketAccept(socket_t *sp)
-{
- struct sockaddr_in addr;
- socket_t *nsp;
- size_t len;
- char *pString;
- int newSock, nid;
-
-
-#ifdef NW
- NETINET_DEFINE_CONTEXT;
-#endif
-
- a_assert(sp);
-
-/*
- * Accept the connection and prevent inheriting by children (F_SETFD)
- */
- len = sizeof(struct sockaddr_in);
- if ((newSock = accept(sp->sock, (struct sockaddr *) &addr, (unsigned int *) &len)) == -1) {
- return;
- }
-#ifndef __NO_FCNTL
- fcntl(newSock, F_SETFD, FD_CLOEXEC);
-#endif
- socketHighestFd = max(socketHighestFd, newSock);
-
-/*
- * Create a socket structure and insert into the socket list
- */
- nid = socketAlloc(sp->host, sp->port, sp->accept, sp->flags);
- nsp = socketList[nid];
- a_assert(nsp);
- nsp->sock = newSock;
- nsp->flags &= ~SOCKET_LISTENING;
-
- if (nsp == NULL) {
- return;
- }
-/*
- * Set the blocking mode before calling the accept callback.
- */
-
- socketSetBlock(nid, (nsp->flags & SOCKET_BLOCK) ? 1: 0);
-/*
- * Call the user accept callback. The user must call socketCreateHandler
- * to register for further events of interest.
- */
- if (sp->accept != NULL) {
- pString = webs_inet_ntoa(addr.sin_addr);
- if ((sp->accept)(nid, pString, ntohs(addr.sin_port), sp->sid) < 0) {
- socketFree(nid);
- }
-#ifdef VXWORKS
- free(pString);
-#endif
- }
-}
-
-/******************************************************************************/
-/*
- * Get more input from the socket and return in buf.
- * Returns 0 for EOF, -1 for errors and otherwise the number of bytes read.
- */
-
-int socketGetInput(int sid, char *buf, int toRead, int *errCode)
-{
- struct sockaddr_in server;
- socket_t *sp;
- int len, bytesRead;
-
- a_assert(buf);
- a_assert(errCode);
-
- *errCode = 0;
-
- if ((sp = socketPtr(sid)) == NULL) {
- return -1;
- }
-
-/*
- * If we have previously seen an EOF condition, then just return
- */
- if (sp->flags & SOCKET_EOF) {
- return 0;
- }
-#if ((defined (WIN) || defined (CE)) && (!defined (LITTLEFOOT) && !defined (WEBS)))
- if ( !(sp->flags & SOCKET_BLOCK)
- && ! socketWaitForEvent(sp, FD_CONNECT, errCode)) {
- return -1;
- }
-#endif
-
-/*
- * Read the data
- */
- if (sp->flags & SOCKET_DATAGRAM) {
- len = sizeof(server);
- bytesRead = recvfrom(sp->sock, buf, toRead, 0,
- (struct sockaddr *) &server, (unsigned int*) &len);
- } else {
- bytesRead = recv(sp->sock, buf, toRead, 0);
- }
-
- /*
- * BUG 01865 -- CPU utilization hangs on Windows. The original code used
- * the 'errno' global variable, which is not set by the winsock functions
- * as it is under *nix platforms. We use the platform independent
- * socketGetError() function instead, which does handle Windows correctly.
- * Other, *nix compatible platforms should work as well, since on those
- * platforms, socketGetError() just returns the value of errno.
- * Thanks to Jonathan Burgoyne for the fix.
- */
- if (bytesRead < 0)
- {
- *errCode = socketGetError();
- if (*errCode == ECONNRESET)
- {
- sp->flags |= SOCKET_CONNRESET;
- return 0;
- }
- return -1;
- }
- return bytesRead;
-}
-
-/******************************************************************************/
-/*
- * Process an event on the event queue
- */
-
-#ifndef UEMF
-
-static int socketEventProc(void *data, int mask)
-{
- socket_t *sp;
- ringq_t *rq;
- int sid;
-
- sid = (int) data;
-
- a_assert(sid >= 0 && sid < socketMax);
- a_assert(socketList[sid]);
-
- if ((sp = socketPtr(sid)) == NULL) {
- return 1;
- }
-
-/*
- * If now writable and flushing in the background, continue flushing
- */
- if (mask & SOCKET_WRITABLE) {
- if (sp->flags & SOCKET_FLUSHING) {
- rq = &sp->outBuf;
- if (ringqLen(rq) > 0) {
- socketFlush(sp->sid);
- } else {
- sp->flags &= ~SOCKET_FLUSHING;
- }
- }
- }
-
-/*
- * Now invoke the users socket handler. NOTE: the handler may delete the
- * socket, so we must be very careful after calling the handler.
- */
- if (sp->handler && (sp->handlerMask & mask)) {
- (sp->handler)(sid, mask & sp->handlerMask, sp->handler_data);
- }
- if (socketList && sid < socketMax && socketList[sid] == sp) {
- socketRegisterInterest(sp, sp->handlerMask);
- }
- return 1;
-}
-#endif /* ! UEMF */
-
-/******************************************************************************/
-/*
- * Define the events of interest
- */
-
-void socketRegisterInterest(socket_t *sp, int handlerMask)
-{
- a_assert(sp);
-
- sp->handlerMask = handlerMask;
-#ifndef UEMF
- if (handlerMask) {
- sp->fileHandle = emfCreateFileHandler(sp->sock, handlerMask,
- (emfFileProc *) socketEventProc, (void *) sp->sid);
- } else {
- emfDeleteFileHandler(sp->fileHandle);
- sp->fileHandle = -1;
- }
-#endif /* ! UEMF */
-}
-
-/******************************************************************************/
-/*
- * Wait until an event occurs on a socket. Return 1 on success, 0 on failure.
- * or -1 on exception (UEMF only)
- */
-
-int socketWaitForEvent(socket_t *sp, int handlerMask, int *errCode)
-{
- int mask;
-
- a_assert(sp);
-
- mask = sp->handlerMask;
- sp->handlerMask |= handlerMask;
- while (socketSelect(sp->sid, 1000)) {
- if (sp->currentEvents & (handlerMask | SOCKET_EXCEPTION)) {
- break;
- }
- }
- sp->handlerMask = mask;
- if (sp->currentEvents & SOCKET_EXCEPTION) {
- return -1;
- } else if (sp->currentEvents & handlerMask) {
- return 1;
- }
- if (errCode) {
- *errCode = errno = EWOULDBLOCK;
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Return TRUE if there is a socket with an event ready to process,
- */
-
-int socketReady(int sid)
-{
- socket_t *sp;
- int all;
-
- all = 0;
- if (sid < 0) {
- sid = 0;
- all = 1;
- }
-
- for (; sid < socketMax; sid++) {
- if ((sp = socketList[sid]) == NULL) {
- if (! all) {
- break;
- } else {
- continue;
- }
- }
- if (sp->flags & SOCKET_CONNRESET) {
- socketCloseConnection(sid);
- return 0;
- }
- if (sp->currentEvents & sp->handlerMask) {
- return 1;
- }
-/*
- * If there is input data, also call select to test for new events
- */
- if (sp->handlerMask & SOCKET_READABLE && socketInputBuffered(sid) > 0) {
- socketSelect(sid, 0);
- return 1;
- }
- if (! all) {
- break;
- }
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Wait for a handle to become readable or writable and return a number of
- * noticed events. Timeout is in milliseconds.
- */
-
-#if (defined (WIN) || defined (CE) || defined (NW))
-
-int socketSelect(int sid, int timeout)
-{
- struct timeval tv;
- socket_t *sp;
- fd_set readFds, writeFds, exceptFds;
- int nEvents;
- int all, socketHighestFd; /* Highest socket fd opened */
-
- FD_ZERO(&readFds);
- FD_ZERO(&writeFds);
- FD_ZERO(&exceptFds);
- socketHighestFd = -1;
-
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
-
-/*
- * Set the select event masks for events to watch
- */
- all = nEvents = 0;
-
- if (sid < 0) {
- all++;
- sid = 0;
- }
-
- for (; sid < socketMax; sid++) {
- if ((sp = socketList[sid]) == NULL) {
- continue;
- }
- a_assert(sp);
-/*
- * Set the appropriate bit in the ready masks for the sp->sock.
- */
- if (sp->handlerMask & SOCKET_READABLE) {
- FD_SET(sp->sock, &readFds);
- nEvents++;
- if (socketInputBuffered(sid) > 0) {
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- }
- }
- if (sp->handlerMask & SOCKET_WRITABLE) {
- FD_SET(sp->sock, &writeFds);
- nEvents++;
- }
- if (sp->handlerMask & SOCKET_EXCEPTION) {
- FD_SET(sp->sock, &exceptFds);
- nEvents++;
- }
- if (! all) {
- break;
- }
- }
-
-/*
- * Windows select() fails if no descriptors are set, instead of just sleeping
- * like other, nice select() calls. So, if WIN, sleep.
- */
- if (nEvents == 0) {
- Sleep(timeout);
- return 0;
- }
-
-/*
- * Wait for the event or a timeout.
- */
- nEvents = select(socketHighestFd+1, &readFds, &writeFds, &exceptFds, &tv);
-
- if (all) {
- sid = 0;
- }
- for (; sid < socketMax; sid++) {
- if ((sp = socketList[sid]) == NULL) {
- continue;
- }
-
- if (FD_ISSET(sp->sock, &readFds) || socketInputBuffered(sid) > 0) {
- sp->currentEvents |= SOCKET_READABLE;
- }
- if (FD_ISSET(sp->sock, &writeFds)) {
- sp->currentEvents |= SOCKET_WRITABLE;
- }
- if (FD_ISSET(sp->sock, &exceptFds)) {
- sp->currentEvents |= SOCKET_EXCEPTION;
- }
- if (! all) {
- break;
- }
- }
-
- return nEvents;
-}
-
-#else /* not WIN || CE || NW */
-
-int socketSelect(int sid, int timeout)
-{
- socket_t *sp;
- struct timeval tv;
- fd_mask *readFds, *writeFds, *exceptFds;
- int all, len, nwords, index, bit, nEvents;
-
-/*
- * Allocate and zero the select masks
- */
- nwords = (socketHighestFd + NFDBITS) / NFDBITS;
- len = nwords * sizeof(fd_mask);
-
- readFds = balloc(B_L, len);
- memset(readFds, 0, len);
- writeFds = balloc(B_L, len);
- memset(writeFds, 0, len);
- exceptFds = balloc(B_L, len);
- memset(exceptFds, 0, len);
-
- tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout % 1000) * 1000;
-
-/*
- * Set the select event masks for events to watch
- */
- all = nEvents = 0;
-
- if (sid < 0) {
- all++;
- sid = 0;
- }
-
- for (; sid < socketMax; sid++) {
- if ((sp = socketList[sid]) == NULL) {
- if (all == 0) {
- break;
- } else {
- continue;
- }
- }
- a_assert(sp);
-
-/*
- * Initialize the ready masks and compute the mask offsets.
- */
- index = sp->sock / (NBBY * sizeof(fd_mask));
- bit = 1 << (sp->sock % (NBBY * sizeof(fd_mask)));
-
-/*
- * Set the appropriate bit in the ready masks for the sp->sock.
- */
- if (sp->handlerMask & SOCKET_READABLE) {
- readFds[index] |= bit;
- nEvents++;
- if (socketInputBuffered(sid) > 0) {
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- }
- }
- if (sp->handlerMask & SOCKET_WRITABLE) {
- writeFds[index] |= bit;
- nEvents++;
- }
- if (sp->handlerMask & SOCKET_EXCEPTION) {
- exceptFds[index] |= bit;
- nEvents++;
- }
- if (! all) {
- break;
- }
- }
-
-/*
- * Wait for the event or a timeout. Reset nEvents to be the number of actual
- * events now.
- */
- nEvents = select(socketHighestFd + 1, (fd_set *) readFds,
- (fd_set *) writeFds, (fd_set *) exceptFds, &tv);
-
- if (nEvents > 0) {
- if (all) {
- sid = 0;
- }
- for (; sid < socketMax; sid++) {
- if ((sp = socketList[sid]) == NULL) {
- if (all == 0) {
- break;
- } else {
- continue;
- }
- }
-
- index = sp->sock / (NBBY * sizeof(fd_mask));
- bit = 1 << (sp->sock % (NBBY * sizeof(fd_mask)));
-
- if (readFds[index] & bit || socketInputBuffered(sid) > 0) {
- sp->currentEvents |= SOCKET_READABLE;
- }
- if (writeFds[index] & bit) {
- sp->currentEvents |= SOCKET_WRITABLE;
- }
- if (exceptFds[index] & bit) {
- sp->currentEvents |= SOCKET_EXCEPTION;
- }
- if (! all) {
- break;
- }
- }
- }
-
- bfree(B_L, readFds);
- bfree(B_L, writeFds);
- bfree(B_L, exceptFds);
-
- return nEvents;
-}
-#endif /* WIN || CE */
-
-/******************************************************************************/
-/*
- * Process socket events
- */
-
-void socketProcess(int sid)
-{
- socket_t *sp;
- int all;
-
- all = 0;
- if (sid < 0) {
- all = 1;
- sid = 0;
- }
-/*
- * Process each socket
- */
- for (; sid < socketMax; sid++) {
- if ((sp = socketList[sid]) == NULL) {
- if (! all) {
- break;
- } else {
- continue;
- }
- }
- if (socketReady(sid)) {
- socketDoEvent(sp);
- }
- if (! all) {
- break;
- }
- }
-}
-
-/******************************************************************************/
-/*
- * Process an event on the event queue
- */
-
-static int socketDoEvent(socket_t *sp)
-{
- ringq_t *rq;
- int sid;
-
- a_assert(sp);
-
- sid = sp->sid;
- if (sp->currentEvents & SOCKET_READABLE) {
- if (sp->flags & SOCKET_LISTENING) {
- socketAccept(sp);
- sp->currentEvents = 0;
- return 1;
- }
-
- } else {
-/*
- * If there is still read data in the buffers, trigger the read handler
- * NOTE: this may busy spin if the read handler doesn't read the data
- */
- if (sp->handlerMask & SOCKET_READABLE && socketInputBuffered(sid) > 0) {
- sp->currentEvents |= SOCKET_READABLE;
- }
- }
-
-
-/*
- * If now writable and flushing in the background, continue flushing
- */
- if (sp->currentEvents & SOCKET_WRITABLE) {
- if (sp->flags & SOCKET_FLUSHING) {
- rq = &sp->outBuf;
- if (ringqLen(rq) > 0) {
- socketFlush(sp->sid);
- } else {
- sp->flags &= ~SOCKET_FLUSHING;
- }
- }
- }
-
-/*
- * Now invoke the users socket handler. NOTE: the handler may delete the
- * socket, so we must be very careful after calling the handler.
- */
- if (sp->handler && (sp->handlerMask & sp->currentEvents)) {
- (sp->handler)(sid, sp->handlerMask & sp->currentEvents,
- sp->handler_data);
-/*
- * Make sure socket pointer is still valid, then reset the currentEvents.
- */
- if (socketList && sid < socketMax && socketList[sid] == sp) {
- sp->currentEvents = 0;
- }
- }
- return 1;
-}
-
-/******************************************************************************/
-/*
- * Set the socket blocking mode
- */
-
-int socketSetBlock(int sid, int on)
-{
- socket_t *sp;
- unsigned long flag;
- int iflag;
- int oldBlock;
-
- flag = iflag = !on;
-
- if ((sp = socketPtr(sid)) == NULL) {
- a_assert(0);
- return 0;
- }
- oldBlock = (sp->flags & SOCKET_BLOCK);
- sp->flags &= ~(SOCKET_BLOCK);
- if (on) {
- sp->flags |= SOCKET_BLOCK;
- }
-
-/*
- * Put the socket into block / non-blocking mode
- */
- if (sp->flags & SOCKET_BLOCK) {
-#if (defined (CE) || defined (WIN))
- ioctlsocket(sp->sock, FIONBIO, &flag);
-#elif (defined (ECOS))
- int off;
- off = 0;
- ioctl(sp->sock, FIONBIO, &off);
-#elif (defined (VXWORKS) || defined (NW))
- ioctl(sp->sock, FIONBIO, (int)&iflag);
-#else
- fcntl(sp->sock, F_SETFL, fcntl(sp->sock, F_GETFL) & ~O_NONBLOCK);
-#endif
-
- } else {
-#if (defined (CE) || defined (WIN))
- ioctlsocket(sp->sock, FIONBIO, &flag);
-#elif (defined (ECOS))
- int on;
- on = 1;
- ioctl(sp->sock, FIONBIO, &on);
-#elif (defined (VXWORKS) || defined (NW))
- ioctl(sp->sock, FIONBIO, (int)&iflag);
-#else
- fcntl(sp->sock, F_SETFL, fcntl(sp->sock, F_GETFL) | O_NONBLOCK);
-#endif
- }
- return oldBlock;
-}
-
-/******************************************************************************/
-/*
- * Return true if a readable socket has buffered data. - not public
- */
-
-int socketDontBlock()
-{
- socket_t *sp;
- int i;
-
- for (i = 0; i < socketMax; i++) {
- if ((sp = socketList[i]) == NULL ||
- (sp->handlerMask & SOCKET_READABLE) == 0) {
- continue;
- }
- if (socketInputBuffered(i) > 0) {
- return 1;
- }
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Return true if a particular socket buffered data. - not public
- */
-
-int socketSockBuffered(int sock)
-{
- socket_t *sp;
- int i;
-
- for (i = 0; i < socketMax; i++) {
- if ((sp = socketList[i]) == NULL || sp->sock != sock) {
- continue;
- }
- return socketInputBuffered(i);
- }
- return 0;
-}
-
-#endif /* (!WIN) | LITTLEFOOT | WEBS */
-
-/******************************************************************************/
-
-
diff --git a/xbmc/lib/libGoAhead/src/socketutil.cpp b/xbmc/lib/libGoAhead/src/socketutil.cpp deleted file mode 100644 index e97abd88b5..0000000000 --- a/xbmc/lib/libGoAhead/src/socketutil.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include <stdio.h>
-#include "socketutil.h"
-
-#ifdef _XBOX
-char* webs_inet_ntoa (struct in_addr in)
-{
- static char _inetaddress[32];
- sprintf(_inetaddress, "%d.%d.%d.%d", in.S_un.S_un_b.s_b1, in.S_un.S_un_b.s_b2, in.S_un.S_un_b.s_b3, in.S_un.S_un_b.s_b4);
- return _inetaddress;
-}
-
-struct hostent* webs_gethostbyname(const char* _name)
-{
- HostEnt* server = new HostEnt;
-
- strcpy(server->name, "xbox");
- if(!strcmp(server->name, _name))
- {
- XNADDR xna;
- DWORD dwState;
- do
- {
- dwState = XNetGetTitleXnAddr(&xna);
- } while (dwState==XNET_GET_XNADDR_PENDING);
-
- server->addr_list[0] = server->addr;
- memcpy(server->addr, &(xna.ina.s_addr), 4);
- server->server.h_name = server->name;
- server->server.h_aliases = 0;
- server->server.h_addrtype = AF_INET;
- server->server.h_length = 4;
- server->server.h_addr_list = new char*[4];
- server->server.h_addr_list[0] = server->addr_list[0];
- server->server.h_addr_list[1] = 0;
- return (struct hostent*)server;
- }
-
- WSAEVENT hEvent = WSACreateEvent();
- XNDNS* pDns = NULL;
- INT err = XNetDnsLookup(_name, hEvent, &pDns);
- WaitForSingleObject(hEvent, INFINITE);
- if( pDns && pDns->iStatus == 0 )
- {
- strcpy(server->name, _name);
- server->addr_list[0] = server->addr;
- memcpy(server->addr, &(pDns->aina[0].s_addr), 4);
- server->server.h_name = server->name;
- server->server.h_aliases = 0;
- server->server.h_addrtype = AF_INET;
- server->server.h_length = 4;
- server->server.h_addr_list = new char*[4];
-
- server->server.h_addr_list[0] = server->addr_list[0];
- server->server.h_addr_list[1] = 0;
- XNetDnsRelease(pDns);
- return (struct hostent*)server;
- }
- if( pDns )
- XNetDnsRelease(pDns);
- delete server;
- return 0;
-}
-#endif
\ No newline at end of file diff --git a/xbmc/lib/libGoAhead/src/socketutil.h b/xbmc/lib/libGoAhead/src/socketutil.h deleted file mode 100644 index b2c4b90f47..0000000000 --- a/xbmc/lib/libGoAhead/src/socketutil.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef SOCKETUTIL_H_ -#define SOCKETUTIL_H_ - -#ifdef _XBOX -#include <xtl.h> - -struct hostent {
- char FAR * h_name; /* official name of host */
- char FAR * FAR * h_aliases; /* alias list */
- short h_addrtype; /* host address type */
- short h_length; /* length of address */
- char FAR * FAR * h_addr_list; /* list of addresses */
-#define h_addr h_addr_list[0] /* address, for backward compat */
-}; - -typedef struct {
- struct hostent server;
- char name[128];
- char addr[16];
- char* addr_list[4];
-} HostEnt; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef _XBOX
-struct hostent* FAR webs_gethostbyname(const char* _name);
-char* webs_inet_ntoa (struct in_addr in); -#else
-#define webs_inet_ntoa inet_ntoa
-#define webs_gethostbyname gethostbyname
-#endif
-
-#ifdef __cplusplus -} -#endif
-
-#endif // SOCKETUTIL_H_ - diff --git a/xbmc/lib/libGoAhead/src/spy.c b/xbmc/lib/libGoAhead/src/spy.c deleted file mode 100644 index 79ca73f7c7..0000000000 --- a/xbmc/lib/libGoAhead/src/spy.c +++ /dev/null @@ -1,67 +0,0 @@ -/*
- * spy.c -- Spyce Support
- */
-
-/******************************** Description *********************************/
-
-/*
- * The SPY module processes SPY pages and executes embedded scripts.
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-
-/********************************** Locals ************************************/
-
-int (*websSpyOpenCallback)() = NULL;
-void (*websSpyCloseCallback)() = NULL;
-int (*websSpyRequestCallback)(webs_t wp, char_t *lpath) = NULL;
-/************************************* Code ***********************************/
-
-void setSpyOpenCallback(int (*callback)())
-{
- websSpyOpenCallback = callback;
-}
-
-void setSpyCloseCallback(void (*callback)())
-{
- websSpyCloseCallback = callback;
-}
-
-void setSpyRequestCallback(int (*callback)(webs_t wp, char_t *lpath))
-{
- websSpyRequestCallback = callback;
-}
-
-int websSpyOpen()
-{
- if (websSpyOpenCallback == NULL) return 0;
- return websSpyOpenCallback();
-}
-
-/************************************* Code ***********************************/
-/*
- * Close Asp symbol table.
- */
-
-void websSpyClose()
-{
- if (websSpyCloseCallback != NULL)
- websSpyCloseCallback();
-}
-
-/******************************************************************************/
-/*
- * Process SPY requests and expand all scripting commands. We read the
- * entire SPY page into memory and then process.
- */
-
-int websSpyRequest(webs_t wp, char_t *lpath)
-{
- if (websSpyRequestCallback == NULL) return 0;
- return websSpyRequestCallback(wp, lpath);
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/sym.c b/xbmc/lib/libGoAhead/src/sym.c deleted file mode 100644 index 7b0a6b3d7c..0000000000 --- a/xbmc/lib/libGoAhead/src/sym.c +++ /dev/null @@ -1,476 +0,0 @@ -/*
- * sym.c -- Symbol Table module
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: sym.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-/*
- * This module implements a highly efficient generic symbol table with
- * update and access routines. Symbols are simple character strings and
- * the values they take can be flexible types as defined by value_t.
- * This modules allows multiple symbol tables to be created.
- */
-
-/********************************* Includes ***********************************/
-
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include "basic/basicInternal.h"
-#endif
-
-/********************************* Defines ************************************/
-
-typedef struct { /* Symbol table descriptor */
- int inuse; /* Is this entry in use */
- int hash_size; /* Size of the table below */
- sym_t **hash_table; /* Allocated at run time */
-} sym_tabent_t;
-
-/********************************* Globals ************************************/
-
-static sym_tabent_t **sym; /* List of symbol tables */
-static int symMax; /* One past the max symbol table */
-static int symOpenCount = 0; /* Count of apps using sym */
-
-static int htIndex; /* Current location in table */
-static sym_t* next; /* Next symbol in iteration */
-
-/**************************** Forward Declarations ****************************/
-
-static int hashIndex(sym_tabent_t *tp, char_t *name);
-static sym_t *hash(sym_tabent_t *tp, char_t *name);
-static int calcPrime(int size);
-
-/*********************************** Code *************************************/
-/*
- * Open the symbol table subSystem.
- */
-
-int symSubOpen()
-{
- if (++symOpenCount == 1) {
- symMax = 0;
- sym = NULL;
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Close the symbol table subSystem.
- */
-
-void symSubClose()
-{
- if (--symOpenCount <= 0) {
- symOpenCount = 0;
- }
-}
-
-/******************************************************************************/
-/*
- * Create a symbol table.
- */
-
-sym_fd_t symOpen(int hash_size)
-{
- sym_fd_t sd;
- sym_tabent_t *tp;
-
- a_assert(hash_size > 2);
-
-/*
- * Create a new handle for this symbol table
- */
- if ((sd = hAlloc((void***) &sym)) < 0) {
- return -1;
- }
-
-/*
- * Create a new symbol table structure and zero
- */
- if ((tp = (sym_tabent_t*) balloc(B_L, sizeof(sym_tabent_t))) == NULL) {
- symMax = hFree((void***) &sym, sd);
- return -1;
- }
- memset(tp, 0, sizeof(sym_tabent_t));
- if (sd >= symMax) {
- symMax = sd + 1;
- }
- a_assert(0 <= sd && sd < symMax);
- sym[sd] = tp;
-
-/*
- * Now create the hash table for fast indexing.
- */
- tp->hash_size = calcPrime(hash_size);
- tp->hash_table = (sym_t**) balloc(B_L, tp->hash_size * sizeof(sym_t*));
- a_assert(tp->hash_table);
- memset(tp->hash_table, 0, tp->hash_size * sizeof(sym_t*));
-
- return sd;
-}
-
-/******************************************************************************/
-/*
- * Close this symbol table. Call a cleanup function to allow the caller
- * to free resources associated with each symbol table entry.
- */
-
-void symClose(sym_fd_t sd)
-{
- sym_tabent_t *tp;
- sym_t *sp, *forw;
- int i;
-
- a_assert(0 <= sd && sd < symMax);
- tp = sym[sd];
- a_assert(tp);
-
-/*
- * Free all symbols in the hash table, then the hash table itself.
- */
- for (i = 0; i < tp->hash_size; i++) {
- for (sp = tp->hash_table[i]; sp; sp = forw) {
- forw = sp->forw;
- valueFree(&sp->name);
- valueFree(&sp->content);
- bfree(B_L, (void*) sp);
- sp = forw;
- }
- }
- bfree(B_L, (void*) tp->hash_table);
-
- symMax = hFree((void***) &sym, sd);
- bfree(B_L, (void*) tp);
-}
-
-/******************************************************************************/
-/*
- * Return the first symbol in the hashtable if there is one. This call is used
- * as the first step in traversing the table. A call to symFirst should be
- * followed by calls to symNext to get all the rest of the entries.
- */
-
-sym_t* symFirst(sym_fd_t sd)
-{
- sym_tabent_t *tp;
- sym_t *sp, *forw;
- int i;
-
- a_assert(0 <= sd && sd < symMax);
- tp = sym[sd];
- a_assert(tp);
-
-/*
- * Find the first symbol in the hashtable and return a pointer to it.
- */
- for (i = 0; i < tp->hash_size; i++) {
- for (sp = tp->hash_table[i]; sp; sp = forw) {
- forw = sp->forw;
-
- if (forw == NULL) {
- htIndex = i + 1;
- next = tp->hash_table[htIndex];
- } else {
- htIndex = i;
- next = forw;
- }
- return sp;
- }
- }
- return NULL;
-}
-
-/******************************************************************************/
-/*
- * Return the next symbol in the hashtable if there is one. See symFirst.
- */
-
-sym_t* symNext(sym_fd_t sd)
-{
- sym_tabent_t *tp;
- sym_t *sp, *forw;
- int i;
-
- a_assert(0 <= sd && sd < symMax);
- tp = sym[sd];
- a_assert(tp);
-
-/*
- * Find the first symbol in the hashtable and return a pointer to it.
- */
- for (i = htIndex; i < tp->hash_size; i++) {
- for (sp = next; sp; sp = forw) {
- forw = sp->forw;
-
- if (forw == NULL) {
- htIndex = i + 1;
- next = tp->hash_table[htIndex];
- } else {
- htIndex = i;
- next = forw;
- }
- return sp;
- }
- next = tp->hash_table[i + 1];
- }
- return NULL;
-}
-
-/******************************************************************************/
-/*
- * Lookup a symbol and return a pointer to the symbol entry. If not present
- * then return a NULL.
- */
-
-sym_t *symLookup(sym_fd_t sd, char_t *name)
-{
- sym_tabent_t *tp;
- sym_t *sp;
- char_t *cp;
-
- a_assert(0 <= sd && sd < symMax);
- if ((tp = sym[sd]) == NULL) {
- return NULL;
- }
-
- if (name == NULL || *name == '\0') {
- return NULL;
- }
-
-/*
- * Do an initial hash and then follow the link chain to find the right entry
- */
- for (sp = hash(tp, name); sp; sp = sp->forw) {
- cp = sp->name.value.string;
- if (cp[0] == name[0] && gstrcmp(cp, name) == 0) {
- break;
- }
- }
- return sp;
-}
-
-/******************************************************************************/
-/*
- * Enter a symbol into the table. If already there, update its value.
- * Always succeeds if memory available. We allocate a copy of "name" here
- * so it can be a volatile variable. The value "v" is just a copy of the
- * passed in value, so it MUST be persistent.
- */
-
-sym_t *symEnter(sym_fd_t sd, char_t *name, value_t v, int arg)
-{
- sym_tabent_t *tp;
- sym_t *sp, *last;
- char_t *cp;
- int hindex;
-
- a_assert(name);
- a_assert(0 <= sd && sd < symMax);
- tp = sym[sd];
- a_assert(tp);
-
-/*
- * Calculate the first daisy-chain from the hash table. If non-zero, then
- * we have daisy-chain, so scan it and look for the symbol.
- */
- last = NULL;
- hindex = hashIndex(tp, name);
- if ((sp = tp->hash_table[hindex]) != NULL) {
- for (; sp; sp = sp->forw) {
- cp = sp->name.value.string;
- if (cp[0] == name[0] && gstrcmp(cp, name) == 0) {
- break;
- }
- last = sp;
- }
- if (sp) {
-/*
- * Found, so update the value
- * If the caller stores handles which require freeing, they
- * will be lost here. It is the callers responsibility to free
- * resources before overwriting existing contents. We will here
- * free allocated strings which occur due to value_instring().
- * We should consider providing the cleanup function on the open rather
- * than the close and then we could call it here and solve the problem.
- */
- if (sp->content.valid) {
- valueFree(&sp->content);
- }
- sp->content = v;
- sp->arg = arg;
- return sp;
- }
-/*
- * Not found so allocate and append to the daisy-chain
- */
- sp = (sym_t*) balloc(B_L, sizeof(sym_t));
- if (sp == NULL) {
- return NULL;
- }
- sp->name = valueString(name, VALUE_ALLOCATE);
- sp->content = v;
- sp->forw = (sym_t*) NULL;
- sp->arg = arg;
- last->forw = sp;
-
- } else {
-/*
- * Daisy chain is empty so we need to start the chain
- */
- sp = (sym_t*) balloc(B_L, sizeof(sym_t));
- if (sp == NULL) {
- return NULL;
- }
- tp->hash_table[hindex] = sp;
- tp->hash_table[hashIndex(tp, name)] = sp;
-
- sp->forw = (sym_t*) NULL;
- sp->content = v;
- sp->arg = arg;
- sp->name = valueString(name, VALUE_ALLOCATE);
- }
- return sp;
-}
-
-/******************************************************************************/
-/*
- * Delete a symbol from a table
- */
-
-int symDelete(sym_fd_t sd, char_t *name)
-{
- sym_tabent_t *tp;
- sym_t *sp, *last;
- char_t *cp;
- int hindex;
-
- a_assert(name && *name);
- a_assert(0 <= sd && sd < symMax);
- tp = sym[sd];
- a_assert(tp);
-
-/*
- * Calculate the first daisy-chain from the hash table. If non-zero, then
- * we have daisy-chain, so scan it and look for the symbol.
- */
- last = NULL;
- hindex = hashIndex(tp, name);
- if ((sp = tp->hash_table[hindex]) != NULL) {
- for ( ; sp; sp = sp->forw) {
- cp = sp->name.value.string;
- if (cp[0] == name[0] && gstrcmp(cp, name) == 0) {
- break;
- }
- last = sp;
- }
- }
- if (sp == (sym_t*) NULL) { /* Not Found */
- return -1;
- }
-
-/*
- * Unlink and free the symbol. Last will be set if the element to be deleted
- * is not first in the chain.
- */
- if (last) {
- last->forw = sp->forw;
- } else {
- tp->hash_table[hindex] = sp->forw;
- }
- valueFree(&sp->name);
- valueFree(&sp->content);
- bfree(B_L, (void*) sp);
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Hash a symbol and return a pointer to the hash daisy-chain list
- * All symbols reside on the chain (ie. none stored in the hash table itself)
- */
-
-static sym_t *hash(sym_tabent_t *tp, char_t *name)
-{
- a_assert(tp);
-
- return tp->hash_table[hashIndex(tp, name)];
-}
-
-/******************************************************************************/
-/*
- * Compute the hash function and return an index into the hash table
- * We use a basic additive function that is then made modulo the size of the
- * table.
- */
-
-static int hashIndex(sym_tabent_t *tp, char_t *name)
-{
- unsigned int sum;
- int i;
-
- a_assert(tp);
-/*
- * Add in each character shifted up progressively by 7 bits. The shift
- * amount is rounded so as to not shift too far. It thus cycles with each
- * new cycle placing character shifted up by one bit.
- */
- i = 0;
- sum = 0;
- while (*name) {
- sum += (((int) *name++) << i);
- i = (i + 7) % (BITS(int) - BITSPERBYTE);
- }
- return sum % tp->hash_size;
-}
-
-/******************************************************************************/
-/*
- * Check if this number is a prime
- */
-
-static int isPrime(int n)
-{
- int i, max;
-
- a_assert(n > 0);
-
- max = n / 2;
- for (i = 2; i <= max; i++) {
- if (n % i == 0) {
- return 0;
- }
- }
- return 1;
-}
-
-/******************************************************************************/
-/*
- * Calculate the largest prime smaller than size.
- */
-
-static int calcPrime(int size)
-{
- int count;
-
- a_assert(size > 0);
-
- for (count = size; count > 0; count--) {
- if (isPrime(count)) {
- return count;
- }
- }
- return 1;
-}
-
-/******************************************************************************/
-
-
diff --git a/xbmc/lib/libGoAhead/src/uemf.c b/xbmc/lib/libGoAhead/src/uemf.c deleted file mode 100644 index 9b30d847b5..0000000000 --- a/xbmc/lib/libGoAhead/src/uemf.c +++ /dev/null @@ -1,294 +0,0 @@ -/*
- * uemf.c -- GoAhead Micro Embedded Management Framework
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: uemf.c,v 1.4 2002/10/24 14:44:50 bporter Exp $
- */
-
-/********************************** Description *******************************/
-
-/*
- * This module provides compatibility with the full GoAhead EMF.
- * It is a collection of routines which permits the GoAhead WebServer to
- * run stand-alone and to also load as a solution pack under the GoAhead EMF.
- */
-
-/*********************************** Includes *********************************/
-
-#include "uemf.h"
-
-/********************************** Local Data ********************************/
-
-int emfInst; /* Application instance handle */
-
-/****************************** Forward Declarations **************************/
-
-extern void defaultErrorHandler(int etype, char_t *buf);
-static void (*errorHandler)(int etype, char_t *msg) = defaultErrorHandler;
-
-extern void defaultTraceHandler(int level, char_t *buf);
-static void (*traceHandler)(int level, char_t *buf) = defaultTraceHandler;
-
-/************************************* Code ***********************************/
-/*
- * Error message that doesn't need user attention. Customize this code
- * to direct error messages to wherever the developer wishes
- */
-
-void error(E_ARGS_DEC, int etype, char_t *fmt, ...)
-{
- va_list args;
- char_t *fmtBuf, *buf;
-
- va_start(args, fmt);
- fmtValloc(&fmtBuf, E_MAX_ERROR, fmt, args);
-
- if (etype == E_LOG) {
- fmtAlloc(&buf, E_MAX_ERROR, T("%s\n"), fmtBuf);
-/*#ifdef DEV*/
- } else if (etype == E_ASSERT) {
- fmtAlloc(&buf, E_MAX_ERROR,
- T("Assertion %s, failed at %s %d\n"), fmtBuf, E_ARGS);
-/*#endif*/
- } else if (etype == E_USER) {
- fmtAlloc(&buf, E_MAX_ERROR, T("%s\n"), fmtBuf);
- }
- /*
- * bugfix -- if etype is not E_LOG, E_ASSERT, or E_USER, the call to
- * bfreeSafe(B_L, buf) below will fail, because 'buf' is randomly
- * initialized. To be nice, we format a message saying that this is an
- * unknown message type, and in doing so give buf a valid value. Thanks
- * to Simon Byholm.
- */
- else {
- fmtAlloc(&buf, E_MAX_ERROR, T("Unknown error"));
- }
- va_end(args);
-
- bfree(B_L, fmtBuf);
-
- if (errorHandler) {
- errorHandler(etype, buf);
- }
-
- bfreeSafe(B_L, buf);
-}
-
-/******************************************************************************/
-/*
- * Replace the default error handler. Return pointer to old error handler.
- */
-
-void (*errorSetHandler(void (*function)(int etype, char_t *msg))) \
- (int etype, char_t *msg)
-{
- void (*oldHandler)(int etype, char_t *buf);
-
- oldHandler = errorHandler;
- errorHandler = function;
- return oldHandler;
-}
-
-/******************************************************************************/
-/*
- * Trace log. Customize this function to log trace output
- */
-
-void trace(int level, char_t *fmt, ...)
-{
- va_list args;
- char_t *buf;
-
- va_start(args, fmt);
- fmtValloc(&buf, VALUE_MAX_STRING, fmt, args);
-
- if (traceHandler) {
- traceHandler(level, buf);
- }
- bfreeSafe(B_L, buf);
- va_end(args);
-}
-
-/******************************************************************************/
-/*
- * Trace log. Customize this function to log trace output
- */
-
-void traceRaw(char_t *buf)
-{
- if (traceHandler) {
- traceHandler(0, buf);
- }
-}
-
-/******************************************************************************/
-/*
- * Replace the default trace handler. Return a pointer to the old handler.
- */
-
-void (*traceSetHandler(void (*function)(int level, char_t *buf)))
- (int level, char *buf)
-{
- void (*oldHandler)(int level, char_t *buf);
-
- oldHandler = traceHandler;
- if (function) {
- traceHandler = function;
- }
- return oldHandler;
-}
-
-/******************************************************************************/
-/*
- * Save the instance handle
- */
-
-void emfInstSet(int inst)
-{
- emfInst = inst;
-}
-
-/******************************************************************************/
-/*
- * Get the instance handle
- */
-
-int emfInstGet()
-{
- return emfInst;
-}
-
-/******************************************************************************/
-/*
- * Convert a string to lower case
- */
-
-char_t *webs_strlower(char_t *string)
-{
- char_t *s;
-
- a_assert(string);
-
- if (string == NULL) {
- return NULL;
- }
-
- s = string;
- while (*s) {
- if (gisupper(*s)) {
- *s = (char_t) gtolower(*s);
- }
- s++;
- }
- *s = '\0';
- return string;
-}
-
-/******************************************************************************/
-/*
- * Convert a string to upper case
- */
-
-char_t *webs_strupper(char_t *string)
-{
- char_t *s;
-
- a_assert(string);
- if (string == NULL) {
- return NULL;
- }
-
- s = string;
- while (*s) {
- if (gislower(*s)) {
- *s = (char_t) gtoupper(*s);
- }
- s++;
- }
- *s = '\0';
- return string;
-}
-
-/******************************************************************************/
-/*
- * Convert integer to ascii string. Allow a NULL string in which case we
- * allocate a dynamic buffer.
- */
-
-char_t *webs_stritoa(int n, char_t *string, int width)
-{
- char_t *cp, *lim, *s;
- char_t buf[16]; /* Just temp to hold number */
- int next, minus;
-
- a_assert(string && width > 0);
-
- if (string == NULL) {
- if (width == 0) {
- width = 10;
- }
- if ((string = balloc(B_L, width + 1)) == NULL) {
- return NULL;
- }
- }
- if (n < 0) {
- minus = 1;
- n = -n;
- width--;
- } else {
- minus = 0;
- }
-
- cp = buf;
- lim = &buf[width - 1];
- while (n > 9 && cp < lim) {
- next = n;
- n /= 10;
- *cp++ = (char_t) (next - n * 10 + '0');
- }
- if (cp < lim) {
- *cp++ = (char_t) (n + '0');
- }
-
- s = string;
- if (minus) {
- *s++ = '-';
- }
-
- while (cp > buf) {
- *s++ = *--cp;
- }
-
- *s++ = '\0';
- return string;
-}
-
-/******************************************************************************/
-/*
- * Stubs
- */
-
-char_t *basicGetProduct()
-{
- return T("uemf");
-}
-
-char_t *basicGetAddress()
-{
- return T("localhost");
-}
-
-int errorOpen(char_t *pname)
-{
- return 0;
-}
-
-void errorClose()
-{
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/uemf.h b/xbmc/lib/libGoAhead/src/uemf.h deleted file mode 100644 index 5c0258a041..0000000000 --- a/xbmc/lib/libGoAhead/src/uemf.h +++ /dev/null @@ -1,1099 +0,0 @@ -/*
- * uemf.h -- GoAhead Micro Embedded Management Framework Header
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: uemf.h,v 1.7 2003/04/11 17:59:49 bporter Exp $
- */
-
-#ifndef _h_UEMF
-#define _h_UEMF 1
-
-/******************************** Description *********************************/
-
-/*
- * GoAhead Web Server header. This defines the Web public APIs
- */
-
-/******************************* Per O/S Includes *****************************/
-
-#ifdef WIN
- #include <direct.h>
- #include <io.h>
- #include <sys/stat.h>
- #include <limits.h>
- #include <tchar.h>
-#ifdef _XBOX
- #include <xtl.h>
- #include "socketutil.h"
-#else
- #include <windows.h>
- #include <winnls.h>
- #include "socketutil.h"
-#endif
-
- #include <time.h>
- #include <sys/types.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <fcntl.h>
- #include <errno.h>
-#endif /* WIN */
-
-#ifdef CE
- /*#include <errno.h>*/
- #include <limits.h>
- #include <tchar.h>
- #include <windows.h>
- #include <winsock.h>
- #include <winnls.h>
- #include "CE/wincompat.h"
- #include <winsock.h>
-#endif /* CE */
-
-#ifdef NW
- #include <direct.h>
- #include <io.h>
- #include <sys/stat.h>
- #include <time.h>
- #include <sys/types.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <fcntl.h>
- #include <errno.h>
- #include <niterror.h>
- #define EINTR EINUSE
- #define WEBS 1
- #include <limits.h>
- #include <netdb.h>
- #include <process.h>
- #include <tiuser.h>
- #include <sys/time.h>
- #include <arpa/inet.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/filio.h>
- #include <netinet/in.h>
-#endif /* NW */
-
-#ifdef SCOV5
- #include <sys/types.h>
- #include <stdio.h>
- #include "sys/socket.h"
- #include "sys/select.h"
- #include "netinet/in.h"
- #include "arpa/inet.h"
- #include "netdb.h"
-#endif /* SCOV5 */
-
-#ifdef UNIX
- #include <stdio.h>
-#endif /* UNIX */
-
-#ifdef LINUX
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/param.h>
- #include <limits.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <sys/socket.h>
- #include <sys/select.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- #include <time.h>
- #include <fcntl.h>
- #include <errno.h>
-#endif /* LINUX */
-
-#ifdef LYNX
- #include <limits.h>
- #include <stdarg.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- #include <time.h>
- #include <fcntl.h>
- #include <errno.h>
-#endif /* LYNX */
-
-#ifdef MACOSX
- #include <sys/stat.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- #include <fcntl.h>
- #include <errno.h>
-#endif /* MACOSX */
-
-#ifdef UW
- #include <stdio.h>
-#endif /* UW */
-
-#ifdef VXWORKS
- #include <vxWorks.h>
- #include <sockLib.h>
- #include <selectLib.h>
- #include <inetLib.h>
- #include <ioLib.h>
- #include <stdio.h>
- #include <stat.h>
- #include <time.h>
- #include <usrLib.h>
- #include <fcntl.h>
- #include <errno.h>
-#endif /* VXWORKS */
-
-#ifdef sparc
-# define __NO_PACK
-#endif /* sparc */
-
-#ifdef SOLARIS
- #include <sys/types.h>
- #include <limits.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <socket.h>
- #include <sys/select.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- #include <time.h>
- #include <fcntl.h>
- #include <errno.h>
-#endif /* SOLARIS */
-
-#ifdef QNX4
- #include <sys/types.h>
- #include <stdio.h>
- #include <sys/socket.h>
- #include <sys/select.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <sys/uio.h>
- #include <sys/wait.h>
-#endif /* QNX4 */
-
-#ifdef ECOS
- #include <limits.h>
- #include <cyg/infra/cyg_type.h>
- #include <cyg/kernel/kapi.h>
- #include <time.h>
- #include <network.h>
- #include <errno.h>
-#endif /* ECOS */
-
-/********************************** Includes **********************************/
-
-#include <ctype.h>
-#include <stdarg.h>
-#include <string.h>
-
-#ifndef WEBS
-#include "messages.h"
-#endif /* ! WEBS */
-
-/******************************* Per O/S Defines *****************************/
-
-#ifdef UW
- #define __NO_PACK 1
-#endif /* UW */
-
-#if (defined (SCOV5) || defined (VXWORKS) || defined (LINUX) || defined (LYNX) || defined (MACOSX))
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif /* O_BINARY */
-#ifndef SOCKET_ERROR
-#define SOCKET_ERROR -1
-#endif
-#endif /* SCOV5 || VXWORKS || LINUX || LYNX || MACOSX */
-
-#if (defined (WIN) || defined (CE))
-/*
- * __NO_FCNTL means can't access fcntl function. Fcntl.h is still available.
- */
-#define __NO_FCNTL 1
-
-#undef R_OK
-#define R_OK 4
-#undef W_OK
-#define W_OK 2
-#undef X_OK
-#define X_OK 1
-#undef F_OK
-#define F_OK 0
-#endif /* WIN || CE */
-
-#if (defined (LINUX) && !(defined (_STRUCT_TIMEVAL) || defined (_TIMEVAL) ) )
-struct timeval
-{
- time_t tv_sec; /* Seconds. */
- time_t tv_usec; /* Microseconds. */
-};
-#define _STRUCT_TIMEVAL 1
-#endif /* LINUX && ! _STRUCT_TIMEVAL */
-
-#ifdef ECOS
- #define O_RDONLY 1
- #define O_BINARY 2
-
- #define __NO_PACK 1
- #define __NO_EJ_FILE 1
- #define __NO_CGI_BIN 1
- #define __NO_FCNTL 1
-
-/*
- * #define LIBKERN_INLINE to avoid kernel inline functions
- */
- #define LIBKERN_INLINE
-
-#endif /* ECOS */
-
-#ifdef QNX4
- typedef long fd_mask;
- #define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
-#endif /* QNX4 */
-
-#ifdef NW
- #define fd_mask fd_set
- #define INADDR_NONE -1l
- #define Sleep delay
-
- #define __NO_FCNTL 1
-
- #undef R_OK
- #define R_OK 4
- #undef W_OK
- #define W_OK 2
- #undef X_OK
- #define X_OK 1
- #undef F_OK
- #define F_OK 0
-#endif /* NW */
-
-/********************************** Unicode ***********************************/
-/*
- * Constants and limits. Also FNAMESIZE and PATHSIZE are currently defined
- * in param.h to be 128 and 512
- */
-#define TRACE_MAX (4096 - 48)
-#define VALUE_MAX_STRING (4096 - 48)
-#define SYM_MAX (512)
-#define XML_MAX 4096 /* Maximum size for tags/tokens */
-#define BUF_MAX 4096 /* General sanity check for bufs */
-#define FMT_STATIC_MAX 256 /* Maximum for fmtStatic calls */
-
-#if (defined (LITTLEFOOT) || defined (WEBS))
-#define LF_BUF_MAX (510)
-#define LF_PATHSIZE LF_BUF_MAX
-#else
-#define LF_BUF_MAX BUF_MAX
-#define LF_PATHSIZE PATHSIZE
-#define UPPATHSIZE PATHSIZE
-#endif /* LITTLEFOOT || WEBS */
-
-#ifndef CHAR_T_DEFINED
-#define CHAR_T_DEFINED 1
-#ifdef UNICODE
-/*
- * To convert strings to UNICODE. We have a level of indirection so things
- * like T(__FILE__) will expand properly.
- */
-#define T(x) __TXT(x)
-#define __TXT(s) L ## s
-typedef unsigned short char_t;
-typedef unsigned short uchar_t;
-
-/*
- * Text size of buffer macro. A buffer bytes will hold (size / char size)
- * characters.
- */
-#define TSZ(x) (sizeof(x) / sizeof(char_t))
-
-/*
- * How many ASCII bytes are required to represent this UNICODE string?
- */
-#define TASTRL(x) ((wcslen(x) + 1) * sizeof(char_t))
-
-#else
-#define T(s) s
-typedef char char_t;
-#define TSZ(x) (sizeof(x))
-#define TASTRL(x) (strlen(x) + 1)
-#ifdef WIN
-typedef unsigned char uchar_t;
-#endif /* WIN */
-
-#endif /* UNICODE */
-
-#endif /* ! CHAR_T_DEFINED */
-
-/*
- * "Boolean" constants
- */
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-/*
- * GoAhead Copyright.
- */
-#define GOAHEAD_COPYRIGHT \
- T("Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.")
-
-/*
- * The following include has to be after the unicode defines. By putting it
- * here, many modules in various parts of the tree are cleaner.
- */
-#if (defined (LITTLEFOOT) && defined (INMEM))
- #include "lf/inmem.h"
-#endif /* LITTLEFOOT && INMEM */
-
-/*
- * Type for unicode systems
- */
-#ifdef UNICODE
-
-#define gmain wmain
-
-#define gasctime _wasctime
-#define gsprintf swprintf
-#define gprintf wprintf
-#define gfprintf fwprintf
-#define gsscanf swscanf
-#define gvsprintf vswprintf
-
-#define gstrcpy wcscpy
-#define gstrncpy wcsncpy
-#define gstrncat wcsncat
-#define gstrlen wcslen
-#define gstrcat wcscat
-#define gstrcmp wcscmp
-#define gstrncmp wcsncmp
-#define gstricmp wcsicmp
-#define gstrchr wcschr
-#define gstrrchr wcsrchr
-#define gstrtok wcstok
-#define gstrnset wcsnset
-#define gstrrchr wcsrchr
-#define gstrstr wcsstr
-#define gstrtol wcstol
-
-#define gfopen _wfopen
-#define gopen _wopen
-#define gclose close
-#define gcreat _wcreat
-#define gfgets fgetws
-#define gfputs fputws
-#define gfscanf fwscanf
-#define ggets _getws
-#define glseek lseek
-#define gunlink _wunlink
-#define gread read
-#define grename _wrename
-#define gwrite write
-#define gtmpnam _wtmpnam
-#define gtempnam _wtempnam
-#define gfindfirst _wfindfirst
-#define gfinddata_t _wfinddata_t
-#define gfindnext _wfindnext
-#define gfindclose _findclose
-#define gstat _wstat
-#define gaccess _waccess
-#define gchmod _wchmod
-
-typedef struct _stat gstat_t;
-
-#define gmkdir _wmkdir
-#define gchdir _wchdir
-#define grmdir _wrmdir
-#define ggetcwd _wgetcwd
-
-#define gtolower towlower
-#define gtoupper towupper
-#ifdef CE
-#define gisspace isspace
-#define gisdigit isdigit
-#define gisxdigit isxdigit
-#define gisupper isupper
-#define gislower islower
-#define gisprint isprint
-#else
-#define gremove _wremove
-#define gisspace iswspace
-#define gisdigit iswdigit
-#define gisxdigit iswxdigit
-#define gisupper iswupper
-#define gislower iswlower
-#endif /* if CE */
-#define gisalnum iswalnum
-#define gisalpha iswalpha
-#define gatoi(s) wcstol(s, NULL, 10)
-
-#define gctime _wctime
-#define ggetenv _wgetenv
-#define gexecvp _wexecvp
-
-#else /* ! UNICODE */
-
-#ifdef VXWORKS
-#define gchdir vxchdir
-#define gmkdir vxmkdir
-#define grmdir vxrmdir
-#elif (defined (LYNX) || defined (LINUX) || defined (MACOSX) || defined (SOLARIS))
-#define gchdir chdir
-#define gmkdir(s) mkdir(s,0755)
-#define grmdir rmdir
-#else
-#define gchdir chdir
-#define gmkdir mkdir
-#define grmdir rmdir
-#endif /* VXWORKS #elif LYNX || LINUX || MACOSX || SOLARIS*/
-
-#define gclose close
-#define gclosedir closedir
-#define gchmod chmod
-#define ggetcwd getcwd
-#define glseek lseek
-#define gloadModule loadModule
-#define gopen open
-#define gopendir opendir
-#define gread read
-#define greaddir readdir
-#define grename rename
-#define gstat stat
-#define gunlink unlink
-#define gwrite write
-
-#define gasctime asctime
-#define gsprintf sprintf
-#define gprintf printf
-#define gfprintf fprintf
-#define gsscanf sscanf
-#define gvsprintf vsprintf
-
-#define gstrcpy strcpy
-#define gstrncpy strncpy
-#define gstrncat strncat
-#define gstrlen strlen
-#define gstrcat strcat
-#define gstrcmp strcmp
-#define gstrncmp strncmp
-#define gstricmp strcmpci
-#define gstrchr strchr
-#define gstrrchr strrchr
-#define gstrtok strtok
-#define gstrnset strnset
-#define gstrrchr strrchr
-#define gstrstr strstr
-#define gstrtol strtol
-
-#define gfopen fopen
-#define gcreat creat
-#define gfgets fgets
-#define gfputs fputs
-#define gfscanf fscanf
-#define ggets gets
-#define gtmpnam tmpnam
-#define gtempnam tempnam
-#define gfindfirst _findfirst
-#define gfinddata_t _finddata_t
-#define gfindnext _findnext
-#define gfindclose _findclose
-#define gaccess access
-
-typedef struct stat gstat_t;
-
-#define gremove remove
-
-#define gtolower tolower
-#define gtoupper toupper
-#define gisspace isspace
-#define gisdigit isdigit
-#define gisxdigit isxdigit
-#define gisalnum isalnum
-#define gisalpha isalpha
-#define gisupper isupper
-#define gislower islower
-#define gatoi atoi
-
-#define gctime ctime
-#define ggetenv getenv
-#define gexecvp execvp
-#ifndef VXWORKS
-#define gmain main
-#endif /* ! VXWORKS */
-#ifdef VXWORKS
-#define fcntl(a, b, c)
-#endif /* VXWORKS */
-#endif /* ! UNICODE */
-
-/*
- * Include inmem.h here because it redefines many of the file access fucntions.
- * Otherwise there would be lots more #if-#elif-#else-#endif ugliness.
- */
-#ifdef INMEM
- #include "lf/inmem.h"
-#endif
-
-/********************************** Defines ***********************************/
-
-#ifndef FNAMESIZE
-#define FNAMESIZE 254 /* Max length of file names */
-#endif /* FNAMESIZE */
-
-#define E_MAX_ERROR 4096
-#define URL_MAX 4096
-
-/*
- * Error types
- */
-#define E_ASSERT 0x1 /* Assertion error */
-#define E_LOG 0x2 /* Log error to log file */
-#define E_USER 0x3 /* Error that must be displayed */
-
-#define E_L T(__FILE__), __LINE__
-#define E_ARGS_DEC char_t *file, int line
-#define E_ARGS file, line
-
-#if (defined (ASSERT) || defined (ASSERT_CE))
- #define a_assert(C) if (C) ; else error(E_L, E_ASSERT, T("%s"), T(#C))
-#else
- #define a_assert(C) if (1) ; else
-#endif /* ASSERT || ASSERT_CE */
-
-/******************************************************************************/
-/* VALUE */
-/******************************************************************************/
-/*
- * These values are not prefixed so as to aid code readability
- */
-
-typedef enum {
- undefined = 0,
- byteint = 1,
- shortint = 2,
- integer = 3,
- hex = 4,
- percent = 5,
- octal = 6,
- big = 7,
- flag = 8,
- floating = 9,
- vtype_string = 10,
- bytes = 11,
- symbol = 12,
- errmsg = 13
-} vtype_t;
-
-#ifndef __NO_PACK
-#pragma pack(2)
-#endif /* _NO_PACK */
-
-typedef struct {
-
- union {
- char flag;
- char byteint;
- short shortint;
- char percent;
- long integer;
- long hex;
- long octal;
- long big[2];
-#ifdef FLOATING_POINT_SUPPORT
- double floating;
-#endif /* FLOATING_POINT_SUPPORT */
- char_t *string;
- char *bytes;
- char_t *errmsg;
- void *symbol;
- } value;
-
- vtype_t type;
- unsigned int valid : 8;
- unsigned int allocated : 8; /* String was balloced */
-} value_t;
-
-#ifndef __NO_PACK
-#pragma pack()
-#endif /* __NO_PACK */
-
-/*
- * Allocation flags
- */
-#define VALUE_ALLOCATE 0x1
-
-#define value_numeric(t) (t >= byteint && t <= big)
-#define value_str(t) (t >= string && t <= bytes)
-#define value_ok(t) (t > undefined && t <= symbol)
-
-#define VALUE_VALID { {0}, integer, 1 }
-#define VALUE_INVALID { {0}, undefined, 0 }
-
-/******************************************************************************/
-/*
- * A ring queue allows maximum utilization of memory for data storage and is
- * ideal for input/output buffering. This module provides a highly effecient
- * implementation and a vehicle for dynamic strings.
- *
- * WARNING: This is a public implementation and callers have full access to
- * the queue structure and pointers. Change this module very carefully.
- *
- * This module follows the open/close model.
- *
- * Operation of a ringq where rq is a pointer to a ringq :
- *
- * rq->buflen contains the size of the buffer.
- * rq->buf will point to the start of the buffer.
- * rq->servp will point to the first (un-consumed) data byte.
- * rq->endp will point to the next free location to which new data is added
- * rq->endbuf will point to one past the end of the buffer.
- *
- * Eg. If the ringq contains the data "abcdef", it might look like :
- *
- * +-------------------------------------------------------------------+
- * | | | | | | | | a | b | c | d | e | f | | | | |
- * +-------------------------------------------------------------------+
- * ^ ^ ^ ^
- * | | | |
- * rq->buf rq->servp rq->endp rq->enduf
- *
- * The queue is empty when servp == endp. This means that the queue will hold
- * at most rq->buflen -1 bytes. It is the fillers responsibility to ensure
- * the ringq is never filled such that servp == endp.
- *
- * It is the fillers responsibility to "wrap" the endp back to point to
- * rq->buf when the pointer steps past the end. Correspondingly it is the
- * consumers responsibility to "wrap" the servp when it steps to rq->endbuf.
- * The ringqPutc and ringqGetc routines will do this automatically.
- */
-
-/*
- * Ring queue buffer structure
- */
-typedef struct {
- unsigned char *buf; /* Holding buffer for data */
- unsigned char *servp; /* Pointer to start of data */
- unsigned char *endp; /* Pointer to end of data */
- unsigned char *endbuf; /* Pointer to end of buffer */
- int buflen; /* Length of ring queue */
- int maxsize; /* Maximum size */
- int increment; /* Growth increment */
-} ringq_t;
-
-/*
- * Block allocation (balloc) definitions
- */
-#ifdef B_STATS
-#ifndef B_L
-#define B_L T(__FILE__), __LINE__
-#define B_ARGS_DEC char_t *file, int line
-#define B_ARGS file, line
-#endif /* B_L */
-#endif /* B_STATS */
-
-/*
- * Block classes are: 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192,
- * 16384, 32768, 65536
- */
-typedef struct {
- union {
- void *next; /* Pointer to next in q */
- int size; /* Actual requested size */
- } u;
- int flags; /* Per block allocation flags */
-} bType;
-
-#define B_SHIFT 4 /* Convert size to class */
-#define B_ROUND ((1 << (B_SHIFT)) - 1)
-#define B_MAX_CLASS 13 /* Maximum class number + 1 */
-#define B_MALLOCED 0x80000000 /* Block was malloced */
-#define B_DEFAULT_MEM (64 * 1024) /* Default memory allocation */
-#define B_MAX_FILES (512) /* Maximum number of files */
-#define B_FILL_CHAR (0x77) /* Fill byte for buffers */
-#define B_FILL_WORD (0x77777777) /* Fill word for buffers */
-#define B_MAX_BLOCKS (64 * 1024) /* Maximum allocated blocks */
-
-/*
- * Flags. The integrity value is used as an arbitrary value to fill the flags.
- */
-#define B_INTEGRITY 0x8124000 /* Integrity value */
-#define B_INTEGRITY_MASK 0xFFFF000 /* Integrity mask */
-#define B_USE_MALLOC 0x1 /* Okay to use malloc if required */
-#define B_USER_BUF 0x2 /* User supplied buffer for mem */
-
-/*
- * The symbol table record for each symbol entry
- */
-
-typedef struct sym_t {
- struct sym_t *forw; /* Pointer to next hash list */
- value_t name; /* Name of symbol */
- value_t content; /* Value of symbol */
- int arg; /* Parameter value */
-} sym_t;
-
-typedef int sym_fd_t; /* Returned by symOpen */
-
-/*
- * Script engines
- */
-#define EMF_SCRIPT_JSCRIPT 0 /* javascript */
-#define EMF_SCRIPT_TCL 1 /* tcl */
-#define EMF_SCRIPT_EJSCRIPT 2 /* Ejscript */
-#define EMF_SCRIPT_MAX 3
-
-#define MAXINT INT_MAX
-#define BITSPERBYTE 8
-#define BITS(type) (BITSPERBYTE * (int) sizeof(type))
-#define STRSPACE T("\t \n\r\t")
-
-#ifndef max
-#define max(a,b) (((a) > (b)) ? (a) : (b))
-#endif /* max */
-
-#ifndef min
-#define min(a,b) (((a) < (b)) ? (a) : (b))
-#endif /* min */
-
-/******************************************************************************/
-/* CRON */
-/******************************************************************************/
-
-typedef struct {
- char_t *minute;
- char_t *hour;
- char_t *day;
- char_t *month;
- char_t *dayofweek;
-} cron_t;
-
-extern long cronUntil(cron_t *cp, int period, time_t testTime);
-extern int cronAlloc(cron_t *cp, char_t *str);
-extern int cronFree(cron_t *cp);
-
-/******************************************************************************/
-/* SOCKET */
-/******************************************************************************/
-/*
- * Socket flags
- */
-
-#if ((defined (WIN) || defined (CE)) && defined (WEBS))
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#define ENETDOWN WSAENETDOWN
-#define ECONNRESET WSAECONNRESET
-#endif /* (WIN || CE) && WEBS) */
-
-#define SOCKET_EOF 0x1 /* Seen end of file */
-#define SOCKET_CONNECTING 0x2 /* Connect in progress */
-#define SOCKET_BROADCAST 0x4 /* Broadcast mode */
-#define SOCKET_PENDING 0x8 /* Message pending on this socket */
-#define SOCKET_FLUSHING 0x10 /* Background flushing */
-#define SOCKET_DATAGRAM 0x20 /* Use datagrams */
-#define SOCKET_ASYNC 0x40 /* Use async connect */
-#define SOCKET_BLOCK 0x80 /* Use blocking I/O */
-#define SOCKET_LISTENING 0x100 /* Socket is server listener */
-#define SOCKET_CLOSING 0x200 /* Socket is closing */
-#define SOCKET_CONNRESET 0x400 /* Socket connection was reset */
-
-#define SOCKET_PORT_MAX 0xffff /* Max Port size */
-
-/*
- * Socket error values
- */
-#define SOCKET_WOULDBLOCK 1 /* Socket would block on I/O */
-#define SOCKET_RESET 2 /* Socket has been reset */
-#define SOCKET_NETDOWN 3 /* Network is down */
-#define SOCKET_AGAIN 4 /* Issue the request again */
-#define SOCKET_INTR 5 /* Call was interrupted */
-#define SOCKET_INVAL 6 /* Invalid */
-
-/*
- * Handler event masks
- */
-#define SOCKET_READABLE 0x2 /* Make socket readable */
-#define SOCKET_WRITABLE 0x4 /* Make socket writable */
-#define SOCKET_EXCEPTION 0x8 /* Interested in exceptions */
-#define EMF_SOCKET_MESSAGE (WM_USER+13)
-
-#ifdef LITTLEFOOT
-#define SOCKET_BUFSIZ 510 /* Underlying buffer size */
-#else
-#define SOCKET_BUFSIZ 1024 /* Underlying buffer size */
-#endif /* LITTLEFOOT */
-
-typedef void (*socketHandler_t)(int sid, int mask, void* data);
-typedef int (*socketAccept_t)(int sid, char *ipaddr, int port,
- int listenSid);
-typedef struct {
- char host[64]; /* Host name */
- ringq_t inBuf; /* Input ring queue */
- ringq_t outBuf; /* Output ring queue */
- ringq_t lineBuf; /* Line ring queue */
- socketAccept_t accept; /* Accept handler */
- socketHandler_t handler; /* User I/O handler */
- void* handler_data; /* User handler data */
- int handlerMask; /* Handler events of interest */
- int sid; /* Index into socket[] */
- int port; /* Port to listen on */
- int flags; /* Current state flags */
- int sock; /* Actual socket handle */
- int fileHandle; /* ID of the file handler */
- int interestEvents; /* Mask of events to watch for */
- int currentEvents; /* Mask of ready events (FD_xx) */
- int selectEvents; /* Events being selected */
- int saveMask; /* saved Mask for socketFlush */
- int error; /* Last error */
-} socket_t;
-
-/********************************* Prototypes *********************************/
-/*
- * Balloc module
- *
- */
-
-extern void bclose();
-extern int bopen(void *buf, int bufsize, int flags);
-
-/*
- * Define NO_BALLOC to turn off our balloc module altogether
- * #define NO_BALLOC 1
- */
-
-#ifdef NO_BALLOC
-#define balloc(B_ARGS, num) malloc(num)
-#define bfree(B_ARGS, p) free(p)
-#define bfreeSafe(B_ARGS, p) \
- if (p) { free(p); } else
-#define brealloc(B_ARGS, p, num) realloc(p, num)
-extern char_t *bstrdupNoBalloc(char_t *s);
-extern char *bstrdupANoBalloc(char *s);
-#define bstrdup(B_ARGS, s) bstrdupNoBalloc(s)
-#define bstrdupA(B_ARGS, s) bstrdupANoBalloc(s)
-#define gstrdup(B_ARGS, s) bstrdupNoBalloc(s)
-
-#else /* BALLOC */
-
-#ifndef B_STATS
-#define balloc(B_ARGS, num) balloc(num)
-#define bfree(B_ARGS, p) bfree(p)
-#define bfreeSafe(B_ARGS, p) bfreeSafe(p)
-#define brealloc(B_ARGS, p, size) brealloc(p, size)
-#define bstrdup(B_ARGS, p) bstrdup(p)
-
-#ifdef UNICODE
-#define bstrdupA(B_ARGS, p) bstrdupA(p)
-#else /* UNICODE */
-#define bstrdupA bstrdup
-#endif /* UNICODE */
-
-#endif /* B_STATS */
-
-#define gstrdup bstrdup
-extern void *balloc(B_ARGS_DEC, int size);
-extern void bfree(B_ARGS_DEC, void *mp);
-extern void bfreeSafe(B_ARGS_DEC, void *mp);
-extern void *brealloc(B_ARGS_DEC, void *buf, int newsize);
-extern char_t *bstrdup(B_ARGS_DEC, char_t *s);
-
-#ifdef UNICODE
-extern char *bstrdupA(B_ARGS_DEC, char *s);
-#else /* UNICODE */
-#define bstrdupA bstrdup
-#endif /* UNICODE */
-#endif /* BALLOC */
-
-extern void bstats(int handle, void (*writefn)(int handle, char_t *fmt, ...));
-
-/*
- * Flags. The integrity value is used as an arbitrary value to fill the flags.
- */
-#define B_USE_MALLOC 0x1 /* Okay to use malloc if required */
-#define B_USER_BUF 0x2 /* User supplied buffer for mem */
-
-
-#ifndef LINUX
-extern char_t *basename(char_t *name);
-#endif /* !LINUX */
-
-#if (defined (UEMF) && defined (WEBS))
-/*
- * The open source webserver uses a different callback/timer mechanism
- * than other emf derivative products such as FieldUpgrader agents
- * so redefine those API for webserver so that they can coexist in the
- * same address space as the others.
- */
-#define emfSchedCallback websSchedCallBack
-#define emfUnschedCallback websUnschedCallBack
-#define emfReschedCallback websReschedCallBack
-#endif /* UEMF && WEBS */
-
-typedef void (emfSchedProc)(void *data, int id);
-extern int emfSchedCallback(int delay, emfSchedProc *proc, void *arg);
-extern void emfUnschedCallback(int id);
-extern void emfReschedCallback(int id, int delay);
-extern void emfSchedProcess();
-extern int emfInstGet();
-extern void emfInstSet(int inst);
-extern void error(E_ARGS_DEC, int flags, char_t *fmt, ...);
-extern void (*errorSetHandler(void (*function)(int etype, char_t *msg))) \
- (int etype, char_t *msg);
-
-#ifdef B_STATS
-#define hAlloc(x) HALLOC(B_L, x)
-#define hAllocEntry(x, y, z) HALLOCENTRY(B_L, x, y, z)
-extern int HALLOC(B_ARGS_DEC, void ***map);
-extern int HALLOCENTRY(B_ARGS_DEC, void ***list, int *max, int size);
-#else
-extern int hAlloc(void ***map);
-extern int hAllocEntry(void ***list, int *max, int size);
-#endif /* B_STATS */
-
-extern int hFree(void ***map, int handle);
-
-extern int ringqOpen(ringq_t *rq, int increment, int maxsize);
-extern void ringqClose(ringq_t *rq);
-extern int ringqLen(ringq_t *rq);
-
-extern int ringqPutc(ringq_t *rq, char_t c);
-extern int ringqInsertc(ringq_t *rq, char_t c);
-extern int ringqPutStr(ringq_t *rq, char_t *str);
-extern int ringqGetc(ringq_t *rq);
-
-extern int fmtValloc(char_t **s, int n, char_t *fmt, va_list arg);
-extern int fmtAlloc(char_t **s, int n, char_t *fmt, ...);
-extern int fmtStatic(char_t *s, int n, char_t *fmt, ...);
-
-#ifdef UNICODE
-extern int ringqPutcA(ringq_t *rq, char c);
-extern int ringqInsertcA(ringq_t *rq, char c);
-extern int ringqPutStrA(ringq_t *rq, char *str);
-extern int ringqGetcA(ringq_t *rq);
-#else
-#define ringqPutcA ringqPutc
-#define ringqInsertcA ringqInsertc
-#define ringqPutStrA ringqPutStr
-#define ringqGetcA ringqGetc
-#endif /* UNICODE */
-
-extern int ringqPutBlk(ringq_t *rq, unsigned char *buf, int len);
-extern int ringqPutBlkMax(ringq_t *rq);
-extern void ringqPutBlkAdj(ringq_t *rq, int size);
-extern int ringqGetBlk(ringq_t *rq, unsigned char *buf, int len);
-extern int ringqGetBlkMax(ringq_t *rq);
-extern void ringqGetBlkAdj(ringq_t *rq, int size);
-extern void ringqFlush(ringq_t *rq);
-extern void ringqAddNull(ringq_t *rq);
-
-extern int scriptSetVar(int engine, char_t *var, char_t *value);
-extern int scriptEval(int engine, char_t *cmd, char_t **rslt, void* chan);
-
-extern void socketClose();
-extern void socketCloseConnection(int sid);
-extern void socketCreateHandler(int sid, int mask, socketHandler_t
- handler, void* arg);
-extern void socketDeleteHandler(int sid);
-extern int socketEof(int sid);
-extern int socketCanWrite(int sid);
-extern void socketSetBufferSize(int sid, int in, int line, int out);
-extern int socketFlush(int sid);
-extern int socketGets(int sid, char_t **buf);
-extern int socketGetPort(int sid);
-extern int socketInputBuffered(int sid);
-extern int socketOpen();
-extern int socketOpenConnection(char *host, int port,
- socketAccept_t accept, int flags);
-extern void socketProcess(int hid);
-extern int socketRead(int sid, char *buf, int len);
-extern int socketReady(int hid);
-extern int socketWrite(int sid, char *buf, int len);
-extern int socketWriteString(int sid, char_t *buf);
-extern int socketSelect(int hid, int timeout);
-extern int socketGetHandle(int sid);
-extern int socketSetBlock(int sid, int flags);
-extern int socketGetBlock(int sid);
-extern int socketAlloc(char *host, int port, socketAccept_t accept,
- int flags);
-extern void socketFree(int sid);
-extern int socketGetError();
-extern socket_t *socketPtr(int sid);
-extern int socketWaitForEvent(socket_t *sp, int events, int *errCode);
-extern void socketRegisterInterest(socket_t *sp, int handlerMask);
-extern int socketGetInput(int sid, char *buf, int toRead, int *errCode);
-
-extern char_t *webs_strlower(char_t *string);
-extern char_t *webs_strupper(char_t *string);
-
-extern char_t *webs_stritoa(int n, char_t *string, int width);
-
-extern sym_fd_t symOpen(int hash_size);
-extern void symClose(sym_fd_t sd);
-extern sym_t *symLookup(sym_fd_t sd, char_t *name);
-extern sym_t *symEnter(sym_fd_t sd, char_t *name, value_t v, int arg);
-extern int symDelete(sym_fd_t sd, char_t *name);
-extern void symWalk(sym_fd_t sd, void (*fn)(sym_t *symp));
-extern sym_t *symFirst(sym_fd_t sd);
-extern sym_t *symNext(sym_fd_t sd);
-extern int symSubOpen();
-extern void symSubClose();
-
-extern void trace(int lev, char_t *fmt, ...);
-extern void traceRaw(char_t *buf);
-extern void (*traceSetHandler(void (*function)(int level, char_t *buf)))
- (int level, char_t *buf);
-
-extern value_t valueInteger(long value);
-extern value_t valueString(char_t *value, int flags);
-extern value_t valueErrmsg(char_t *value);
-extern void valueFree(value_t *v);
-extern int vxchdir(char *dirname);
-
-extern unsigned int hextoi(char_t *hexstring);
-extern unsigned int gstrtoi(char_t *s);
-extern time_t timeMsec();
-
-extern char_t *ascToUni(char_t *ubuf, char *str, int nBytes);
-extern char *uniToAsc(char *buf, char_t *ustr, int nBytes);
-extern char_t *ballocAscToUni(char *cp, int alen);
-extern char *ballocUniToAsc(char_t *unip, int ulen);
-
-extern char_t *basicGetHost();
-extern char_t *basicGetAddress();
-extern char_t *basicGetProduct();
-extern void basicSetHost(char_t *host);
-extern void basicSetAddress(char_t *addr);
-
-extern int harnessOpen(char_t **argv);
-extern void harnessClose(int status);
-extern void harnessTesting(char_t *msg, ...);
-extern void harnessPassed();
-extern void harnessFailed(int line);
-extern int harnessLevel();
-
-#endif /* _h_UEMF */
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/um.c b/xbmc/lib/libGoAhead/src/um.c deleted file mode 100644 index 09323f7f84..0000000000 --- a/xbmc/lib/libGoAhead/src/um.c +++ /dev/null @@ -1,1436 +0,0 @@ -/*
- * um.c -- User Management
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: um.c,v 1.5 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-/*
- * User Management routines for adding/deleting/changing users and groups
- * Also, routines for determining user access
- */
-
-/********************************* Includes ***********************************/
-
-#include "um.h"
-#include "emfdb.h"
-#include "webs.h"
-
-/********************************** Defines ***********************************/
-
-#define UM_DB_FILENAME T("um.xml")
-#define UM_TXT_FILENAME T("umconfig.txt")
-
-/*
- * Table names
- */
-#define UM_USER_TABLENAME T("users")
-#define UM_GROUP_TABLENAME T("groups")
-#define UM_ACCESS_TABLENAME T("access")
-
-/*
- * Column names
- */
-#define UM_NAME T("name")
-#define UM_PASS T("password")
-#define UM_GROUP T("group")
-#define UM_PROT T("prot")
-#define UM_DISABLE T("disable")
-#define UM_METHOD T("method")
-#define UM_PRIVILEGE T("priv")
-#define UM_SECURE T("secure")
-
-/*
- * XOR encryption mask
- * Note: This string should be modified for individual sites
- * in order to enhance user password security.
- */
-#define UM_XOR_ENCRYPT T("*j7a(L#yZ98sSd5HfSgGjMj8;Ss;d)(*&^#@$a2s0i3g")
-
-/******************************** Local Data **********************************/
-
-#ifdef qHierarchicalAccess
-/*
- * user-provided function to allow hierarchical access protection. See below.
- * for details.
- */
-extern bool_t dmfCanAccess(const char_t* usergroup, const char_t* group);
-#endif
-#ifdef UEMF
-/*
- * User table definition
- */
-#define NUMBER_OF_USER_COLUMNS 5
-
-char_t *userColumnNames[NUMBER_OF_USER_COLUMNS] = {
- UM_NAME, UM_PASS, UM_GROUP, UM_PROT, UM_DISABLE
-};
-
-int userColumnTypes[NUMBER_OF_USER_COLUMNS] = {
- T_STRING, T_STRING, T_STRING, T_INT, T_INT
-};
-
-dbTable_t userTable = {
- UM_USER_TABLENAME,
- NUMBER_OF_USER_COLUMNS,
- userColumnNames,
- userColumnTypes,
- 0,
- NULL
-};
-
-/*
- * Group table definition
- */
-#define NUMBER_OF_GROUP_COLUMNS 5
-
-char_t *groupColumnNames[NUMBER_OF_GROUP_COLUMNS] = {
- UM_NAME, UM_PRIVILEGE, UM_METHOD, UM_PROT, UM_DISABLE
-};
-
-int groupColumnTypes[NUMBER_OF_GROUP_COLUMNS] = {
- T_STRING, T_INT, T_INT, T_INT, T_INT
-};
-
-dbTable_t groupTable = {
- UM_GROUP_TABLENAME,
- NUMBER_OF_GROUP_COLUMNS,
- groupColumnNames,
- groupColumnTypes,
- 0,
- NULL
-};
-
-/*
- * Access Limit table definition
- */
-#define NUMBER_OF_ACCESS_COLUMNS 4
-
-char_t *accessColumnNames[NUMBER_OF_ACCESS_COLUMNS] = {
- UM_NAME, UM_METHOD, UM_SECURE, UM_GROUP
-};
-
-int accessColumnTypes[NUMBER_OF_ACCESS_COLUMNS] = {
- T_STRING, T_INT, T_INT, T_STRING
-};
-
-dbTable_t accessTable = {
- UM_ACCESS_TABLENAME,
- NUMBER_OF_ACCESS_COLUMNS,
- accessColumnNames,
- accessColumnTypes,
- 0,
- NULL
-};
-#endif /* #ifdef UEMF */
-
-/*
- * Database Identifier returned from dbOpen()
- */
-static int didUM = -1;
-
-/*
- * Configuration database persist filename
- */
-static char_t *saveFilename = NULL;
-
-static int umOpenCount = 0; /* count of apps using this module */
-
-/*************************** Forward Declarations *****************************/
-
-static bool_t umCheckName(char_t *name);
-
-/*********************************** Code *************************************/
-/*
- * umOpen() registers the UM tables in the fake emf-database
- */
-
-int umOpen()
-{
- if (++umOpenCount != 1) {
- return didUM;
- }
-/*
- * Do not initialize if intialization has already taken place
- */
- if (didUM == -1) {
- didUM = dbOpen(UM_USER_TABLENAME, UM_DB_FILENAME, NULL, 0);
-#ifdef UEMF
- dbRegisterDBSchema(&userTable);
- dbRegisterDBSchema(&groupTable);
- dbRegisterDBSchema(&accessTable);
-#endif
- }
-
- if (saveFilename == NULL) {
- saveFilename = bstrdup(B_L, UM_TXT_FILENAME);
- }
-
- return didUM;
-}
-
-/******************************************************************************/
-/*
- * umClose() frees up the UM tables in the fake emf-database
- */
-
-void umClose()
-{
- if (--umOpenCount > 0) {
- return;
- }
-/*
- * Do not close if intialization has not taken place
- */
- if (didUM != -1) {
- dbClose(didUM);
- didUM = -1;
- }
-
- if (saveFilename != NULL) {
- bfree(B_L, saveFilename);
- saveFilename = NULL;
- }
-}
-
-/******************************************************************************/
-/*
- * umCommit() persists all of the UM tables
- */
-
-int umCommit(char_t *filename)
-{
- if (filename && *filename) {
- if (saveFilename != NULL) {
- bfree(B_L, saveFilename);
- }
-
- saveFilename = bstrdup(B_L, filename);
- }
-
- a_assert (saveFilename && *saveFilename);
- trace(3, T("UM: Writing User Configuration to file <%s>\n"),
- saveFilename);
-
- return dbSave(didUM, saveFilename, 0);
-}
-
-/******************************************************************************/
-/*
- * umRestore() loads up the UM tables with persisted data
- */
-
-int umRestore(char_t *filename)
-{
- if (filename && *filename) {
- if (saveFilename != NULL) {
- bfree(B_L, saveFilename);
- }
-
- saveFilename = bstrdup(B_L, filename);
- }
-
- a_assert(saveFilename && *saveFilename);
-
- trace(3, T("UM: Loading User Configuration from file <%s>\n"),
- saveFilename);
-
-/*
- * First empty the database, otherwise we wind up with duplicates!
- */
- dbZero(didUM);
- return dbLoad(didUM, saveFilename, 0);
-}
-
-/******************************************************************************/
-/*
- * Encrypt/Decrypt a text string.
- * Returns the number of characters encrypted.
- */
-
-static int umEncryptString(char_t *textString)
-{
- char_t *enMask;
- char_t enChar;
- int numChars;
-
- a_assert(textString);
-
- enMask = UM_XOR_ENCRYPT;
- numChars = 0;
-
- while (*textString) {
- enChar = *textString ^ *enMask;
-/*
- * Do not produce encrypted text with embedded linefeeds or tabs.
- * Simply use existing character.
- */
- if (enChar && !gisspace(enChar))
- *textString = enChar;
-/*
- * Increment all pointers.
- */
- enMask++;
- textString++;
- numChars++;
-/*
- * Wrap encryption mask pointer if at end of length.
- */
- if (*enMask == '\0') {
- enMask = UM_XOR_ENCRYPT;
- }
- }
-
- return numChars;
-}
-
-/******************************************************************************/
-/*
- * umGetFirstRowData() - return a pointer to the first non-blank key value
- * in the given column for the given table.
- */
-
-static char_t *umGetFirstRowData(char_t *tableName, char_t *columnName)
-{
- char_t *columnData;
- int row;
- int check;
-
- a_assert(tableName && *tableName);
- a_assert(columnName && *columnName);
-
- row = 0;
-/*
- * Move through table until we retrieve the first row with non-null
- * column data.
- */
- columnData = NULL;
- while ((check = dbReadStr(didUM, tableName, columnName, row++,
- &columnData)) == 0 || (check == DB_ERR_ROW_DELETED)) {
- if (columnData && *columnData) {
- return columnData;
- }
- }
-
- return NULL;
-}
-
-/******************************************************************************/
-/*
- * umGetNextRowData() - return a pointer to the first non-blank
- * key value following the given one.
- */
-
-static char_t *umGetNextRowData(char_t *tableName, char_t *columnName,
- char_t *keyLast)
-{
- char_t *key;
- int row;
- int check;
-
- a_assert(tableName && *tableName);
- a_assert(columnName && *columnName);
- a_assert(keyLast && *keyLast);
-/*
- * Position row counter to row where the given key value was found
- */
- row = 0;
- key = NULL;
-
- while ((((check = dbReadStr(didUM, tableName, columnName, row++,
- &key)) == 0) || (check == DB_ERR_ROW_DELETED)) &&
- ((key == NULL) || (gstrcmp(key, keyLast) != 0))) {
- }
-/*
- * If the last key value was not found, return NULL
- */
- if (!key || gstrcmp(key, keyLast) != 0) {
- return NULL;
- }
-/*
- * Move through table until we retrieve the next row with a non-null key
- */
- while (((check = dbReadStr(didUM, tableName, columnName, row++, &key))
- == 0) || (check == DB_ERR_ROW_DELETED)) {
- if (key && *key && (gstrcmp(key, keyLast) != 0)) {
- return key;
- }
- }
-
- return NULL;
-}
-
-/******************************************************************************/
-/*
- * umAddUser() - Adds a user to the "users" table.
- */
-
-int umAddUser(char_t *user, char_t *pass, char_t *group,
- bool_t prot, bool_t disabled)
-{
- int row;
- char_t *password;
-
- a_assert(user && *user);
- a_assert(pass && *pass);
- a_assert(group && *group);
-
- trace(3, T("UM: Adding User <%s>\n"), user);
-
-/*
- * Do not allow duplicates
- */
- if (umUserExists(user)) {
- return UM_ERR_DUPLICATE;
- }
-
-/*
- * Make sure user name and password contain valid characters
- */
- if (!umCheckName(user)) {
- return UM_ERR_BAD_NAME;
- }
-
- if (!umCheckName(pass)) {
- return UM_ERR_BAD_PASSWORD;
- }
-
-/*
- * Make sure group exists
- */
- if (!umGroupExists(group)) {
- return UM_ERR_NOT_FOUND;
- }
-
-/*
- * Now create the user record
- */
- row = dbAddRow(didUM, UM_USER_TABLENAME);
-
- if (row < 0) {
- return UM_ERR_GENERAL;
- }
-
- if (dbWriteStr(didUM, UM_USER_TABLENAME, UM_NAME, row, user) != 0) {
- return UM_ERR_GENERAL;
- }
-
- password = bstrdup(B_L, pass);
- umEncryptString(password);
- dbWriteStr(didUM, UM_USER_TABLENAME, UM_PASS, row, password);
- bfree(B_L, password);
- dbWriteStr(didUM, UM_USER_TABLENAME, UM_GROUP, row, group);
- dbWriteInt(didUM, UM_USER_TABLENAME, UM_PROT, row, prot);
- dbWriteInt(didUM, UM_USER_TABLENAME, UM_DISABLE, row, disabled);
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * umDeleteUser() - remove a user from the "users" table
- */
-
-int umDeleteUser(char_t *user)
-{
- int row;
-
- a_assert(user && *user);
- trace(3, T("UM: Deleting User <%s>\n"), user);
-/*
- * Check to see if user is delete-protected
- */
- if (umGetUserProtected(user)) {
- return UM_ERR_PROTECTED;
- }
-
-/*
- * If found, delete the user from the database
- */
- if ((row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0)) >= 0) {
- return dbDeleteRow(didUM, UM_USER_TABLENAME, row);
- }
-
- return UM_ERR_NOT_FOUND;
-}
-
-/******************************************************************************/
-/*
- * umGetFirstUser() - Returns the user ID of the first user found in the
- * "users" table.
- */
-
-char_t *umGetFirstUser()
-{
- return umGetFirstRowData(UM_USER_TABLENAME, UM_NAME);
-}
-
-/******************************************************************************/
-/*
- * umGetNextUser() Returns the next user found in the "users" table after
- * the given user.
- */
-
-char_t *umGetNextUser(char_t *userLast)
-{
- return umGetNextRowData(UM_USER_TABLENAME, UM_NAME, userLast);
-}
-
-/******************************************************************************/
-/*
- * umUserExists() Returns TRUE if userid exists.
- */
-
-bool_t umUserExists(char_t *user)
-{
- a_assert(user && *user);
-
- if (dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0) >= 0) {
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-/******************************************************************************/
-/*
- * umGetUserPassword() returns a de-crypted copy of the user password
- */
-
-char_t *umGetUserPassword(char_t *user)
-{
- char_t *password;
- int row;
-
- a_assert(user && *user);
-
- password = NULL;
- row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0);
-
- if (row >= 0) {
- char_t *pass = NULL;
- dbReadStr(didUM, UM_USER_TABLENAME, UM_PASS, row, &pass);
-/*
- * Decrypt password
- * Note, this function returns a copy of the password, which must
- * be deleted at some time in the future.
- */
- password = bstrdup(B_L, pass);
- umEncryptString(password);
- }
-
- return password;
-}
-
-/******************************************************************************/
-/*
- * umSetUserPassword() updates the user password in the user "table" after
- * encrypting the given password
- */
-
-int umSetUserPassword(char_t *user, char_t *pass)
-{
- int row, nRet;
- char_t *password;
-
- a_assert(user && *user);
- a_assert(pass && *pass);
- trace(3, T("UM: Attempting to change the password for user <%s>\n"), user);
-/*
- * Find the row of the user
- */
- if ((row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0)) < 0) {
- return UM_ERR_NOT_FOUND;
- }
-
- password = bstrdup(B_L, pass);
- umEncryptString(password);
- nRet = dbWriteStr(didUM, UM_USER_TABLENAME, UM_PASS, row, password);
- bfree(B_L, password);
-
- return nRet;
-}
-
-/******************************************************************************/
-/*
- * umGetUserGroup() returns the name of the user group
- */
-
-char_t *umGetUserGroup(char_t *user)
-{
- char_t *group;
- int row;
-
- a_assert(user && *user);
- group = NULL;
-/*
- * Find the row of the user
- */
- row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0);
-
- if (row >= 0) {
- dbReadStr(didUM, UM_USER_TABLENAME, UM_GROUP, row, &group);
- }
-
- return group;
-}
-
-/******************************************************************************/
-/*
- * umSetUserGroup() Sets the name of the user group for the user
- */
-
-int umSetUserGroup(char_t *user, char_t *group)
-{
- int row;
-
- a_assert(user && *user);
- a_assert(group && *group);
-/*
- * Find the row of the user
- */
- row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0);
-
- if (row >= 0) {
- return dbWriteStr(didUM, UM_USER_TABLENAME, UM_GROUP, row, group);
- } else {
- return UM_ERR_NOT_FOUND;
- }
-}
-
-/******************************************************************************/
-/*
- * umGetUserEnabled() - returns if the user is enabled
- * Returns FALSE if the user is not found.
- */
-
-bool_t umGetUserEnabled(char_t *user)
-{
- int disabled, row;
-
- a_assert(user && *user);
-
- disabled = 1;
-/*
- * Find the row of the user
- */
- row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0);
-
- if (row >= 0) {
- dbReadInt(didUM, UM_USER_TABLENAME, UM_DISABLE, row, &disabled);
- }
-
- return (bool_t)!disabled;
-}
-
-/******************************************************************************/
-/*
- * umSetUserEnabled() Enables/disables the user
- */
-int umSetUserEnabled(char_t *user, bool_t enabled)
-{
- int row;
-
- a_assert(user && *user);
-/*
- * Find the row of the user
- */
- row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0);
- if (row >= 0) {
- return dbWriteInt(didUM, UM_USER_TABLENAME, UM_DISABLE, row, !enabled);
- } else {
- return UM_ERR_NOT_FOUND;
- }
-}
-
-/******************************************************************************/
-/*
- * umGetUserProtected() - determine deletability of user
- */
-
-bool_t umGetUserProtected(char_t *user)
-{
- int protect, row;
-
- a_assert(user && *user);
-/*
- * Find the row of the user
- */
- row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0);
- protect = FALSE;
-
- if (row >= 0) {
- dbReadInt(didUM, UM_USER_TABLENAME, UM_PROT, row, &protect);
- }
-
- return (bool_t)protect;
-}
-
-/******************************************************************************/
-/*
- * umSetUserProtected() sets the delete protection for the user
- */
-int umSetUserProtected(char_t *user, bool_t protect)
-{
- int row;
-
- a_assert(user && *user);
-/*
- * Find the row of the user
- */
- row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0);
-
- if (row >= 0) {
- return dbWriteInt(didUM, UM_USER_TABLENAME, UM_PROT, row, protect);
- } else {
- return UM_ERR_NOT_FOUND;
- }
-}
-
-
-/******************************************************************************/
-/*
- * umAddGroup() adds a group to the "Group" table
- */
-
-int umAddGroup(char_t *group, short priv, accessMeth_t am,
- bool_t prot, bool_t disabled)
-{
- int row;
-
- a_assert(group && *group);
- trace(3, T("UM: Adding group <%s>\n"), group);
-
-/*
- * Do not allow duplicates
- */
- if (umGroupExists(group)) {
- return UM_ERR_DUPLICATE;
- }
-
-/*
- * Only allow valid characters in key field
- */
- if (!umCheckName(group)) {
- return UM_ERR_BAD_NAME;
- }
-
-/*
- * Add a new row to the table
- */
- if ((row = dbAddRow(didUM, UM_GROUP_TABLENAME)) < 0) {
- return UM_ERR_GENERAL;
- }
-
-/*
- * Write the key field
- */
- if (dbWriteStr(didUM, UM_GROUP_TABLENAME, UM_NAME, row, group) != 0) {
- return UM_ERR_GENERAL;
- }
-
-/*
- * Write the remaining fields
- */
- dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_PRIVILEGE, row, priv);
- dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_METHOD, row, (int) am);
- dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_PROT, row, prot);
- dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_DISABLE, row, disabled);
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * umDeleteGroup() - Delete a user group, if not protected
- */
-
-int umDeleteGroup(char_t *group)
-{
- int row;
-
- a_assert(group && *group);
- trace(3, T("UM: Deleting Group <%s>\n"), group);
-
-/*
- * Check to see if the group is in use
- */
- if (umGetGroupInUse(group)) {
- return UM_ERR_IN_USE;
- }
-
-/*
- * Check to see if the group is delete-protected
- */
- if (umGetGroupProtected(group)) {
- return UM_ERR_PROTECTED;
- }
-
-/*
- * Find the row of the group to delete
- */
- if ((row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0)) < 0) {
- return UM_ERR_NOT_FOUND;
- }
-
- return dbDeleteRow(didUM, UM_GROUP_TABLENAME, row);
-}
-
-/******************************************************************************/
-/*
- * umGroupExists() returns TRUE if group exists, FALSE otherwise
- */
-
-bool_t umGroupExists(char_t *group)
-{
- a_assert(group && *group);
-
- if (dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0) >= 0) {
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-
-/******************************************************************************/
-/*
- * umGetGroupInUse() returns TRUE if the group is referenced by a user or by
- * an access limit.
- */
-
-bool_t umGetGroupInUse(char_t *group)
-{
- a_assert(group && *group);
-
-/*
- * First, check the user table
- */
- if (dbSearchStr(didUM, UM_USER_TABLENAME, UM_GROUP, group, 0) >= 0) {
- return TRUE;
- }
-
-/*
- * Second, check the access limit table
- */
- if (dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_GROUP, group, 0) >= 0) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-/******************************************************************************/
-/*
- * umGetFirstGroup() - return a pointer to the first non-blank group name
- */
-
-char_t *umGetFirstGroup()
-{
- return umGetFirstRowData(UM_GROUP_TABLENAME, UM_NAME);
-}
-
-/******************************************************************************/
-/*
- * umGetNextGroup() - return a pointer to the first non-blank group name
- * following the given group name
- */
-
-char_t *umGetNextGroup(char_t *groupLast)
-{
- return umGetNextRowData(UM_GROUP_TABLENAME, UM_NAME, groupLast);
-}
-
-/******************************************************************************/
-/*
- * Returns the default access method to use for a given group
- */
-
-accessMeth_t umGetGroupAccessMethod(char_t *group)
-{
- int am, row;
-
- a_assert(group && *group);
- row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0);
-
- if (row >= 0) {
- dbReadInt(didUM, UM_GROUP_TABLENAME, UM_METHOD, row, (int *)&am);
- } else {
- am = AM_INVALID;
- }
-
- return (accessMeth_t) am;
-}
-
-/******************************************************************************/
-/*
- * Set the default access method to use for a given group
- */
-
-int umSetGroupAccessMethod(char_t *group, accessMeth_t am)
-{
- int row;
-
- a_assert(group && *group);
- row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0);
-
- if (row >= 0) {
- return dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_METHOD, row, (int) am);
- } else {
- return UM_ERR_NOT_FOUND;
- }
-}
-
-/******************************************************************************/
-/*
- * Returns the privilege mask for a given group
- */
-
-short umGetGroupPrivilege(char_t *group)
-{
- int privilege, row;
-
- a_assert(group && *group);
- privilege = -1;
- row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0);
-
- if (row >= 0) {
- dbReadInt(didUM, UM_GROUP_TABLENAME, UM_PRIVILEGE, row, &privilege);
- }
-
- return (short) privilege;
-}
-
-/******************************************************************************/
-/*
- * Set the privilege mask for a given group
- */
-
-int umSetGroupPrivilege(char_t *group, short privilege)
-{
- int row;
-
- a_assert(group && *group);
- row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0);
-
- if (row >= 0) {
- return dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_PRIVILEGE, row,
- (int)privilege);
- } else {
- return UM_ERR_NOT_FOUND;
- }
-}
-
-/******************************************************************************/
-/*
- * Returns the enabled setting for a given group.
- * Returns FALSE if group is not found.
- */
-
-bool_t umGetGroupEnabled(char_t *group)
-{
- int disabled, row;
-
- a_assert(group && *group);
- row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0);
- disabled = 1;
-
- if (row >= 0) {
- dbReadInt(didUM, UM_GROUP_TABLENAME, UM_DISABLE, row, &disabled);
- }
-
- return (bool_t) !disabled;
-}
-
-/******************************************************************************/
-/*
- * Sets the enabled setting for a given group.
- */
-
-int umSetGroupEnabled(char_t *group, bool_t enabled)
-{
- int row;
-
- a_assert(group && *group);
- row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0);
-
- if (row >= 0) {
- return dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_DISABLE, row,
- (int) !enabled);
- } else {
- return UM_ERR_NOT_FOUND;
- }
-}
-
-/******************************************************************************/
-/*
- * Returns the protected setting for a given group
- * Returns FALSE if user is not found
- */
-
-bool_t umGetGroupProtected(char_t *group)
-{
- int protect, row;
-
- a_assert(group && *group);
-
- protect = 0;
- row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0);
- if (row >= 0) {
- dbReadInt(didUM, UM_GROUP_TABLENAME, UM_PROT, row, &protect);
- }
-
- return (bool_t) protect;
-}
-
-/******************************************************************************/
-/*
- * Sets the protected setting for a given group
- */
-
-int umSetGroupProtected(char_t *group, bool_t protect)
-{
- int row;
-
- a_assert(group && *group);
- row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0);
-
- if (row >= 0) {
- return dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_PROT, row,
- (int) protect);
- } else {
- return UM_ERR_NOT_FOUND;
- }
-}
-
-
-/******************************************************************************/
-/*
- * umAddAccessLimit() adds an access limit to the "access" table
- */
-
-int umAddAccessLimit(char_t *url, accessMeth_t am, short secure, char_t *group)
-{
- int row;
-
- a_assert(url && *url);
- trace(3, T("UM: Adding Access Limit for <%s>\n"), url);
-
-/*
- * Do not allow duplicates
- */
- if (umAccessLimitExists(url)) {
- return UM_ERR_DUPLICATE;
- }
-
-/*
- * Add a new row to the table
- */
- if ((row = dbAddRow(didUM, UM_ACCESS_TABLENAME)) < 0) {
- return UM_ERR_GENERAL;
- }
-
-/*
- * Write the key field
- */
- if(dbWriteStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, row, url) < 0) {
- return UM_ERR_GENERAL;
- }
-
-/*
- * Write the remaining fields
- */
- dbWriteInt(didUM, UM_ACCESS_TABLENAME, UM_METHOD, row, (int)am);
- dbWriteInt(didUM, UM_ACCESS_TABLENAME, UM_SECURE, row, (int)secure);
- dbWriteStr(didUM, UM_ACCESS_TABLENAME, UM_GROUP, row, group);
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * umDeleteAccessLimit()
- */
-
-int umDeleteAccessLimit(char_t *url)
-{
- int row;
-
- a_assert(url && *url);
- trace(3, T("UM: Deleting Access Limit for <%s>\n"), url);
-/*
- * Find the row of the access limit to delete
- */
- if ((row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0)) < 0) {
- return UM_ERR_NOT_FOUND;
- }
-
- return dbDeleteRow(didUM, UM_ACCESS_TABLENAME, row);
-}
-
-/******************************************************************************/
-/*
- * umGetFirstGroup() - return a pointer to the first non-blank access limit
- */
-
-char_t *umGetFirstAccessLimit()
-{
- return umGetFirstRowData(UM_ACCESS_TABLENAME, UM_NAME);
-}
-
-/******************************************************************************/
-/*
- * umGetNextAccessLimit() - return a pointer to the first non-blank
- * access limit following the given one
- */
-
-char_t *umGetNextAccessLimit(char_t *urlLast)
-{
- return umGetNextRowData(UM_ACCESS_TABLENAME, UM_NAME, urlLast);
-}
-
-/******************************************************************************/
-/*
- * umAccessLimitExists() returns TRUE if this access limit exists
- */
-
-bool_t umAccessLimitExists(char_t *url)
-{
- a_assert(url && *url);
-
- if (dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0) < 0) {
- return FALSE;
- } else {
- return TRUE;
- }
-}
-
-/******************************************************************************/
-/*
- * umGetAccessLimit() returns the Access Method for the URL
- */
-
-accessMeth_t umGetAccessLimitMethod(char_t *url)
-{
- int am, row;
-
- am = (int) AM_INVALID;
- row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0);
-
- if (row >= 0) {
- dbReadInt(didUM, UM_ACCESS_TABLENAME, UM_METHOD, row, &am);
- }
-
- return (accessMeth_t) am;
-}
-
-/******************************************************************************/
-/*
- * umSetAccessLimitMethod() - set Access Method for Access Limit
- */
-
-int umSetAccessLimitMethod(char_t *url, accessMeth_t am)
-{
- int row;
-
- a_assert(url && *url);
- row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0);
-
- if (row >= 0) {
- return dbWriteInt(didUM, UM_ACCESS_TABLENAME, UM_METHOD, row, (int) am);
- } else {
- return UM_ERR_NOT_FOUND;
- }
-}
-
-/******************************************************************************/
-/*
- * umGetAccessLimitSecure() - returns secure switch for access limit
- */
-
-short umGetAccessLimitSecure(char_t *url)
-{
- int secure, row;
-
- a_assert(url && *url);
- secure = -1;
- row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0);
-
- if (row >= 0) {
- dbReadInt(didUM, UM_ACCESS_TABLENAME, UM_SECURE, row, &secure);
- }
-
- return (short)secure;
-}
-
-/******************************************************************************/
-/*
- * umSetAccessLimitSecure() - sets the secure flag for the URL
- */
-
-int umSetAccessLimitSecure(char_t *url, short secure)
-{
- int row;
-
- a_assert(url && *url);
- row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0);
-
- if (row >= 0) {
- return dbWriteInt(didUM, UM_ACCESS_TABLENAME, UM_SECURE, row,
- (int)secure);
- } else {
- return UM_ERR_NOT_FOUND;
- }
-}
-
-/******************************************************************************/
-/*
- * umGetAccessLimitGroup() - returns the user group of the access limit
- */
-
-char_t *umGetAccessLimitGroup(char_t *url)
-{
- char_t *group;
- int row;
-
- a_assert(url && *url);
- group = NULL;
- row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0);
-
- if (row >= 0) {
- dbReadStr(didUM, UM_ACCESS_TABLENAME, UM_GROUP, row, &group);
- }
-
- return group;
-}
-
-/******************************************************************************/
-/*
- * umSetAccessLimitGroup() - sets the user group for the access limit.
- */
-
-int umSetAccessLimitGroup(char_t *url, char_t *group)
-{
- int row;
-
- a_assert(url && *url);
- row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0);
-
- if (row >= 0) {
- return dbWriteStr(didUM, UM_ACCESS_TABLENAME, UM_GROUP, row, group);
- } else {
- return UM_ERR_NOT_FOUND;
- }
-}
-
-/******************************************************************************/
-/*
- * Returns the access limit to use for a given URL, by checking for URLs up
- * the directory tree. Creates a new string that must be deleted.
- */
-
-char_t *umGetAccessLimit(char_t *url)
-{
- char_t *urlRet, *urlCheck, *lastChar;
- int len;
-
- a_assert(url && *url);
- urlRet = NULL;
- urlCheck = bstrdup(B_L, url);
- a_assert(urlCheck);
- len = gstrlen(urlCheck);
-/*
- * Scan back through URL to see if there is a "parent" access limit
- */
- while (len && !urlRet) {
- if (umAccessLimitExists(urlCheck)) {
- urlRet = bstrdup(B_L, urlCheck);
- } else {
-/*
- * Trim the end portion of the URL to the previous directory marker
- */
- lastChar = urlCheck + len;
- lastChar--;
-
- while ((lastChar >= urlCheck) && ((*lastChar == '/') ||
- (*lastChar == '\\'))) {
- *lastChar = 0;
- lastChar--;
- }
-
- while ((lastChar >= urlCheck) && (*lastChar != '/') &&
- (*lastChar != '\\')) {
- *lastChar = 0;
- lastChar--;
- }
-
- len = gstrlen(urlCheck);
- }
- }
- bfree (B_L, urlCheck);
-
- return urlRet;
-}
-
-/******************************************************************************/
-/*
- * Returns the access method to use for a given URL
- */
-
-accessMeth_t umGetAccessMethodForURL(char_t *url)
-{
- accessMeth_t amRet;
- char_t *urlHavingLimit, *group;
-
- urlHavingLimit = umGetAccessLimit(url);
- if (urlHavingLimit) {
- group = umGetAccessLimitGroup(urlHavingLimit);
-
- if (group && *group) {
- amRet = umGetGroupAccessMethod(group);
- } else {
- amRet = umGetAccessLimitMethod(urlHavingLimit);
- }
-
- bfree(B_L, urlHavingLimit);
- } else {
- amRet = AM_FULL;
- }
-
- return amRet;
-}
-
-/******************************************************************************/
-/*
- * Returns TRUE if user can access URL
- */
-
-bool_t umUserCanAccessURL(char_t *user, char_t *url)
-{
- accessMeth_t amURL;
- char_t *group, *usergroup, *urlHavingLimit;
- short priv;
-
- a_assert(user && *user);
- a_assert(url && *url);
-
-/*
- * Make sure user exists
- */
- if (!umUserExists(user)) {
- return FALSE;
- }
-
-/*
- * Make sure user is enabled
- */
- if (!umGetUserEnabled(user)) {
- return FALSE;
- }
-
-/*
- * Make sure user has sufficient privileges (any will do)
- */
- usergroup = umGetUserGroup(user);
- priv = umGetGroupPrivilege(usergroup);
- if (priv == 0) {
- return FALSE;
- }
-
-/*
- * Make sure user's group is enabled
- */
- if (!umGetGroupEnabled(usergroup)) {
- return FALSE;
- }
-
-/*
- * The access method of the user group must not be AM_NONE
- */
- if (umGetGroupAccessMethod(usergroup) == AM_NONE) {
- return FALSE;
- }
-
-/*
- * Check to see if there is an Access Limit for this URL
- */
- urlHavingLimit = umGetAccessLimit(url);
- if (urlHavingLimit) {
- amURL = umGetAccessLimitMethod(urlHavingLimit);
- group = umGetAccessLimitGroup(urlHavingLimit);
- bfree(B_L, urlHavingLimit);
- } else {
-/*
- * If there isn't an access limit for the URL, user has full access
- */
- return TRUE;
- }
-
-/*
- * If the access method for the URL is AM_NONE then
- * the file "doesn't exist".
- */
- if (amURL == AM_NONE) {
- return FALSE;
- }
-
-/*
- * If Access Limit has a group specified, then the user must be a
- * member of that group
- */
- if (group && *group) {
-#ifdef qHierarchicalAccess
- /*
- * If we are compiling with the hierarchical access extensions, we
- * instead call the user-provided function that checks to see whether
- * the current user's access level is greater than or equal to the
- * access level required for this URL.
- */
- return dmfCanAccess(usergroup, group);
-
-#else
- if (usergroup && (gstrcmp(group, usergroup) != 0)) {
- return FALSE;
-
- }
-#endif
- }
-
-/*
- * Otherwise, user can access the URL
- */
- return TRUE;
-
-}
-
-/******************************************************************************/
-/*
- * Returns TRUE if given name has only valid chars
- */
-
-static bool_t umCheckName(char_t *name)
-{
- a_assert(name && *name);
-
- if (name && *name) {
- while (*name) {
- if (gisspace(*name)) {
- return FALSE;
- }
-
- name++;
- }
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/um.h b/xbmc/lib/libGoAhead/src/um.h deleted file mode 100644 index 22fbb99a1b..0000000000 --- a/xbmc/lib/libGoAhead/src/um.h +++ /dev/null @@ -1,185 +0,0 @@ -/*
- * um.h -- GoAhead User Management public header
- *
- * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved.
- *
- * See the file "license.txt" for information on usage and redistribution
- *
- * $Id: um.h,v 1.2 2002/10/24 14:44:50 bporter Exp $
- */
-
-#ifndef _h_UM
-#define _h_UM 1
-
-/******************************** Description *********************************/
-
-/*
- * GoAhead User Management header. This defines the User Management
- * public APIs. Include this header for files that contain access to
- * user inquiry or management.
- */
-
-/********************************* Includes ***********************************/
-
-#ifndef UEMF
- #include "basic/basic.h"
- #include "emf/emf.h"
-#else
- #include "uemf.h"
-#endif
-
-/********************************** Defines ***********************************/
-
-/*
- * Error Return Flags
- */
-#define UM_OK 0
-#define UM_ERR_GENERAL -1
-#define UM_ERR_NOT_FOUND -2
-#define UM_ERR_PROTECTED -3
-#define UM_ERR_DUPLICATE -4
-#define UM_ERR_IN_USE -5
-#define UM_ERR_BAD_NAME -6
-#define UM_ERR_BAD_PASSWORD -7
-
-/*
- * Privilege Masks
- */
-#define PRIV_NONE 0x00
-#define PRIV_READ 0x01
-#define PRIV_WRITE 0x02
-#define PRIV_ADMIN 0x04
-
-/*
- * User classes
- */
-typedef short bool_t;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-typedef enum {
- AM_NONE = 0,
- AM_FULL,
- AM_BASIC,
- AM_DIGEST,
- AM_INVALID
-} accessMeth_t;
-
-/********************************** Prototypes ********************************/
-
-/*
- * umOpen() must be called before accessing User Management functions
- */
-extern int umOpen();
-
-/*
- * umClose() should be called before shutdown to free memory
- */
-extern void umClose();
-
-/*
- * umCommit() persists the user management database
- */
-extern int umCommit(char_t *filename);
-
-/*
- * umRestore() loads the user management database
- */
-extern int umRestore(char_t *filename);
-
-/*
- * umUser functions use a user ID for a key
- */
-extern int umAddUser(char_t *user, char_t *password,
- char_t *group, bool_t protect, bool_t disabled);
-
-extern int umDeleteUser(char_t *user);
-
-extern char_t *umGetFirstUser();
-extern char_t *umGetNextUser(char_t *lastUser);
-
-extern bool_t umUserExists(char_t *user);
-
-extern char_t *umGetUserPassword(char_t *user);
-extern int umSetUserPassword(char_t *user, char_t *password);
-
-extern char_t *umGetUserGroup(char_t *user);
-extern int umSetUserGroup(char_t *user, char_t *password);
-
-extern bool_t umGetUserEnabled(char_t *user);
-extern int umSetUserEnabled(char_t *user, bool_t enabled);
-
-extern bool_t umGetUserProtected(char_t *user);
-extern int umSetUserProtected(char_t *user, bool_t protect);
-
-/*
- * umGroup functions use a group name for a key
- */
-extern int umAddGroup(char_t *group, short privilege,
- accessMeth_t am, bool_t protect, bool_t disabled);
-
-extern int umDeleteGroup(char_t *group);
-
-extern char_t *umGetFirstGroup();
-extern char_t *umGetNextGroup(char_t *lastUser);
-
-extern bool_t umGroupExists(char_t *group);
-extern bool_t umGetGroupInUse(char_t *group);
-
-extern accessMeth_t umGetGroupAccessMethod(char_t *group);
-extern int umSetGroupAccessMethod(char_t *group, accessMeth_t am);
-
-extern bool_t umGetGroupEnabled(char_t *group);
-extern int umSetGroupEnabled(char_t *group, bool_t enabled);
-
-extern short umGetGroupPrivilege(char_t *group);
-extern int umSetGroupPrivilege(char_t *group, short privileges);
-
-extern bool_t umGetGroupProtected(char_t *group);
-extern int umSetGroupProtected(char_t *group, bool_t protect);
-
-/*
- * umAccessLimit functions use a URL as a key
- */
-extern int umAddAccessLimit(char_t *url, accessMeth_t am,
- short secure, char_t *group);
-
-extern int umDeleteAccessLimit(char_t *url);
-
-extern char_t *umGetFirstAccessLimit();
-extern char_t *umGetNextAccessLimit(char_t *lastUser);
-
-/*
- * Returns the name of an ancestor access limit if
- */
-extern char_t *umGetAccessLimit(char_t *url);
-
-extern bool_t umAccessLimitExists(char_t *url);
-
-extern accessMeth_t umGetAccessLimitMethod(char_t *url);
-extern int umSetAccessLimitMethod(char_t *url, accessMeth_t am);
-
-extern short umGetAccessLimitSecure(char_t *url);
-extern int umSetAccessLimitSecure(char_t *url, short secure);
-
-extern char_t *umGetAccessLimitGroup(char_t *url);
-extern int umSetAccessLimitGroup(char_t *url, char_t *group);
-
-/*
- * Convenience Functions
- */
-
-extern accessMeth_t umGetAccessMethodForURL(char_t *url);
-extern bool_t umUserCanAccessURL(char_t *user, char_t *url);
-
-#endif /* _h_UM */
-
-/******************************************************************************/
-
-
diff --git a/xbmc/lib/libGoAhead/src/umui.c b/xbmc/lib/libGoAhead/src/umui.c deleted file mode 100644 index f447d7928b..0000000000 --- a/xbmc/lib/libGoAhead/src/umui.c +++ /dev/null @@ -1,642 +0,0 @@ -/*
- * umui.c -- User Management GoForm Processing
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: umui.c,v 1.2 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module provides GoForm functions for User management
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-#include "um.h"
-
-/********************************* Defines ************************************/
-
-#define NONE_OPTION T("<NONE>")
-#define MSG_START T("<body><h2>")
-#define MSG_END T("</h2></body>")
-
-/**************************** Forward Declarations ****************************/
-
-static void formAddUser(webs_t wp, char_t *path, char_t *query);
-static void formDeleteUser(webs_t wp, char_t *path, char_t *query);
-static void formDisplayUser(webs_t wp, char_t *path, char_t *query);
-static int aspGenerateUserList(int eid, webs_t wp,
- int argc, char_t **argv);
-
-static void formAddGroup(webs_t wp, char_t *path, char_t *query);
-static void formDeleteGroup(webs_t wp, char_t *path, char_t *query);
-static int aspGenerateGroupList(int eid, webs_t wp,
- int argc, char_t **argv);
-
-static void formAddAccessLimit(webs_t wp, char_t *path, char_t *query);
-static void formDeleteAccessLimit(webs_t wp, char_t *path, char_t *query);
-static int aspGenerateAccessLimitList(int eid, webs_t wp,
- int argc, char_t **argv);
-
-static int aspGenerateAccessMethodList(int eid, webs_t wp,
- int argc, char_t **argv);
-static int aspGeneratePrivilegeList(int eid, webs_t wp,
- int argc, char_t **argv);
-
-static void formSaveUserManagement(webs_t wp, char_t *path, char_t *query);
-static void formLoadUserManagement(webs_t wp, char_t *path, char_t *query);
-
-static void websMsgStart(webs_t wp);
-static void websMsgEnd(webs_t wp);
-
-/*********************************** Code *************************************/
-/*
- * Set up the User Management form handlers
- */
-
-void formDefineUserMgmt(void)
-{
- websAspDefine(T("MakeGroupList"), aspGenerateGroupList);
- websAspDefine(T("MakeUserList"), aspGenerateUserList);
- websAspDefine(T("MakeAccessLimitList"), aspGenerateAccessLimitList);
- websAspDefine(T("MakeAccessMethodList"), aspGenerateAccessMethodList);
- websAspDefine(T("MakePrivilegeList"), aspGeneratePrivilegeList);
-
- websFormDefine(T("AddUser"), formAddUser);
- websFormDefine(T("DeleteUser"), formDeleteUser);
- websFormDefine(T("DisplayUser"), formDisplayUser);
- websFormDefine(T("AddGroup"), formAddGroup);
- websFormDefine(T("DeleteGroup"), formDeleteGroup);
- websFormDefine(T("AddAccessLimit"), formAddAccessLimit);
- websFormDefine(T("DeleteAccessLimit"), formDeleteAccessLimit);
-
- websFormDefine(T("SaveUserManagement"), formSaveUserManagement);
- websFormDefine(T("LoadUserManagement"), formLoadUserManagement);
-}
-
-/******************************************************************************/
-/*
- * Add a user
- */
-
-static void formAddUser(webs_t wp, char_t *path, char_t *query)
-{
- char_t *userid, *pass1, *pass2, *group, *enabled, *ok;
- bool_t bDisable;
- int nCheck;
-
- a_assert(wp);
-
- userid = websGetVar(wp, T("user"), T(""));
- pass1 = websGetVar(wp, T("password"), T(""));
- pass2 = websGetVar(wp, T("passconf"), T(""));
- group = websGetVar(wp, T("group"), T(""));
- enabled = websGetVar(wp, T("enabled"), T(""));
- ok = websGetVar(wp, T("ok"), T(""));
-
- websHeader(wp);
- websMsgStart(wp);
-
- if (gstricmp(ok, T("ok")) != 0) {
- websWrite(wp, T("Add User Cancelled"));
- } else if (gstrcmp(pass1, pass2) != 0) {
- websWrite(wp, T("Confirmation Password did not match."));
- } else {
- if (enabled && *enabled && (gstrcmp(enabled, T("on")) == 0)) {
- bDisable = FALSE;
- } else {
- bDisable = TRUE;
- }
-
- nCheck = umAddUser(userid, pass1, group, 0, bDisable);
- if (nCheck != 0) {
- char_t * strError;
-
- switch (nCheck) {
- case UM_ERR_DUPLICATE:
- strError = T("User already exists.");
- break;
-
- case UM_ERR_BAD_NAME:
- strError = T("Invalid user name.");
- break;
-
- case UM_ERR_BAD_PASSWORD:
- strError = T("Invalid password.");
- break;
-
- case UM_ERR_NOT_FOUND:
- strError = T("Invalid or unselected group.");
- break;
-
- default:
- strError = T("Error writing user record.");
- break;
- }
-
- websWrite(wp, T("Unable to add user, \"%s\". %s"),
- userid, strError);
- } else {
- websWrite(wp, T("User, \"%s\" was successfully added."),
- userid);
- }
- }
-
- websMsgEnd(wp);
- websFooter(wp);
- websDone(wp, 200);
-}
-
-/******************************************************************************/
-/*
- * Delete a user
- */
-
-static void formDeleteUser(webs_t wp, char_t *path, char_t *query)
-{
- char_t *userid, *ok;
-
- a_assert(wp);
-
- userid = websGetVar(wp, T("user"), T(""));
- ok = websGetVar(wp, T("ok"), T(""));
-
- websHeader(wp);
- websMsgStart(wp);
-
- if (gstricmp(ok, T("ok")) != 0) {
- websWrite(wp, T("Delete User Cancelled"));
- } else if (umUserExists(userid) == FALSE) {
- websWrite(wp, T("ERROR: User \"%s\" not found"), userid);
- } else if (umGetUserProtected(userid)) {
- websWrite(wp, T("ERROR: User, \"%s\" is delete-protected."), userid);
- } else if (umDeleteUser(userid) != 0) {
- websWrite(wp, T("ERROR: Unable to delete user, \"%s\" "), userid);
- } else {
- websWrite(wp, T("User, \"%s\" was successfully deleted."), userid);
- }
-
- websMsgEnd(wp);
- websFooter(wp);
- websDone(wp, 200);
-}
-
-/******************************************************************************/
-/*
- * Display the user info
- */
-
-static void formDisplayUser(webs_t wp, char_t *path, char_t *query)
-{
- char_t *userid, *ok, *temp;
- bool_t enabled;
-
- a_assert(wp);
-
- userid = websGetVar(wp, T("user"), T(""));
- ok = websGetVar(wp, T("ok"), T(""));
-
- websHeader(wp);
- websWrite(wp, T("<body>"));
-
- if (gstricmp(ok, T("ok")) != 0) {
- websWrite(wp, T("Display User Cancelled"));
- } else if (umUserExists(userid) == FALSE) {
- websWrite(wp, T("ERROR: User <b>%s</b> not found.\n"), userid);
- } else {
- websWrite(wp, T("<h2>User ID: <b>%s</b></h2>\n"), userid);
- temp = umGetUserGroup(userid);
- websWrite(wp, T("<h3>User Group: <b>%s</b></h3>\n"), temp);
- enabled = umGetUserEnabled(userid);
- websWrite(wp, T("<h3>Enabled: <b>%d</b></h3>\n"), enabled);
- }
-
- websWrite(wp, T("</body>\n"));
- websFooter(wp);
- websDone(wp, 200);
-}
-
-
-/******************************************************************************/
-/*
- * Generate HTML to create a list box containing the users
- */
-
-static int aspGenerateUserList(int eid, webs_t wp, int argc, char_t **argv)
-{
- char_t *userid;
- int row, nBytesSent, nBytes;
-
- a_assert(wp);
-
- nBytes = websWrite(wp,
- T("<SELECT NAME=\"user\" SIZE=\"3\" TITLE=\"Select a User\">"));
- row = 0;
- userid = umGetFirstUser();
- nBytesSent = 0;
-
- while (userid && (nBytes > 0)) {
- nBytes = websWrite(wp, T("<OPTION VALUE=\"%s\">%s\n"),
- userid, userid);
- userid = umGetNextUser(userid);
- nBytesSent += nBytes;
- }
-
- nBytesSent += websWrite(wp, T("</SELECT>"));
-
- return nBytesSent;
-}
-
-/******************************************************************************/
-/*
- * Add a group
- */
-
-static void formAddGroup(webs_t wp, char_t *path, char_t *query)
-{
- char_t *group, *enabled, *privilege, *method, *ok, *pChar;
- int nCheck;
- short priv;
- accessMeth_t am;
- bool_t bDisable;
-
- a_assert(wp);
-
- group = websGetVar(wp, T("group"), T(""));
- method = websGetVar(wp, T("method"), T(""));
- enabled = websGetVar(wp, T("enabled"), T(""));
- privilege = websGetVar(wp, T("privilege"), T(""));
- ok = websGetVar(wp, T("ok"), T(""));
-
- websHeader(wp);
- websMsgStart(wp);
-
- if (gstricmp(ok, T("ok")) != 0) {
- websWrite(wp, T("Add Group Cancelled."));
- } else if ((group == NULL) || (*group == 0)) {
- websWrite(wp, T("No Group Name was entered."));
- } else if (umGroupExists(group)) {
- websWrite(wp, T("ERROR: Group, \"%s\" already exists."), group);
- } else {
- if (privilege && *privilege) {
-/*
- * privilege is a mulitple <SELECT> var, and must be parsed.
- * Values for these variables are space delimited.
- */
- priv = 0;
- for (pChar = privilege; *pChar; pChar++) {
- if (*pChar == ' ') {
- *pChar = '\0';
- priv |= gatoi(privilege);
- *pChar = ' ';
- privilege = pChar + 1;
- }
- }
- priv |= gatoi(privilege);
- } else {
- priv = 0;
- }
-
- if (method && *method) {
- am = (accessMeth_t) gatoi(method);
- } else {
- am = AM_FULL;
- }
-
- if (enabled && *enabled && (gstrcmp(enabled, T("on")) == 0)) {
- bDisable = FALSE;
- } else {
- bDisable = TRUE;
- }
-
- nCheck = umAddGroup(group, priv, am, 0, bDisable);
- if (nCheck != 0) {
- websWrite(wp, T("Unable to add group, \"%s\", code: %d "),
- group, nCheck);
- } else {
- websWrite(wp, T("Group, \"%s\" was successfully added."),
- group);
- }
- }
-
- websMsgEnd(wp);
- websFooter(wp);
- websDone(wp, 200);
-}
-
-/******************************************************************************/
-/*
- * Delete a group
- */
-
-static void formDeleteGroup(webs_t wp, char_t *path, char_t *query)
-{
- char_t *group, *ok;
-
- a_assert(wp);
-
- group = websGetVar(wp, T("group"), T(""));
- ok = websGetVar(wp, T("ok"), T(""));
-
- websHeader(wp);
- websMsgStart(wp);
-
- if (gstricmp(ok, T("ok")) != 0) {
- websWrite(wp, T("Delete Group Cancelled."));
- } else if ((group == NULL) || (*group == '\0')) {
- websWrite(wp, T("ERROR: No group was selected."));
- } else if (umGetGroupProtected(group)) {
- websWrite(wp, T("ERROR: Group, \"%s\" is delete-protected."), group);
- } else if (umGetGroupInUse(group)) {
- websWrite(wp, T("ERROR: Group, \"%s\" is being used."), group);
- } else if (umDeleteGroup(group) != 0) {
- websWrite(wp, T("ERROR: Unable to delete group, \"%s\" "), group);
- } else {
- websWrite(wp, T("Group, \"%s\" was successfully deleted."), group);
- }
-
- websMsgEnd(wp);
- websFooter(wp);
- websDone(wp, 200);
-}
-
-/******************************************************************************/
-/*
- * Generate HTML to create a list box containing the groups
- */
-
-static int aspGenerateGroupList(int eid, webs_t wp, int argc, char_t **argv)
-{
- char_t *group;
- int row, nBytesSent, nBytes;
-
- a_assert(wp);
-
- row = 0;
- nBytesSent = 0;
- nBytes = websWrite(wp,
- T("<SELECT NAME=\"group\" SIZE=\"3\" TITLE=\"Select a Group\">"));
-/*
- * Add a special "<NONE>" element to allow de-selection
- */
- nBytes = websWrite(wp, T("<OPTION VALUE=\"\">[NONE]\n"));
-
- group = umGetFirstGroup();
- while (group && (nBytes > 0)) {
- nBytes = websWrite(wp, T("<OPTION VALUE=\"%s\">%s\n"), group, group);
- group = umGetNextGroup(group);
- nBytesSent += nBytes;
- }
-
- nBytesSent += websWrite(wp, T("</SELECT>"));
-
- return nBytesSent;
-}
-
-/******************************************************************************/
-/*
- * Add an access limit
- */
-
-static void formAddAccessLimit(webs_t wp, char_t *path, char_t *query)
-{
- char_t *url, *method, *group, *secure, *ok;
- int nCheck;
- accessMeth_t am;
- short nSecure;
-
- a_assert(wp);
-
- url = websGetVar(wp, T("url"), T(""));
- group = websGetVar(wp, T("group"), T(""));
- method = websGetVar(wp, T("method"), T(""));
- secure = websGetVar(wp, T("secure"), T(""));
- ok = websGetVar(wp, T("ok"), T(""));
-
- websHeader(wp);
- websMsgStart(wp);
-
- if (gstricmp(ok, T("ok")) != 0) {
- websWrite(wp, T("Add Access Limit Cancelled."));
- } else if ((url == NULL) || (*url == 0)) {
- websWrite(wp, T("ERROR: No URL was entered."));
- } else if (umAccessLimitExists(url)) {
- websWrite(wp, T("ERROR: An Access Limit for [%s] already exists."),
- url);
- } else {
- if (method && *method) {
- am = (accessMeth_t) gatoi(method);
- } else {
- am = AM_FULL;
- }
-
- if (secure && *secure) {
- nSecure = (short) gatoi(secure);
- } else {
- nSecure = 0;
- }
-
- nCheck = umAddAccessLimit(url, am, nSecure, group);
- if (nCheck != 0) {
- websWrite(wp, T("Unable to add Access Limit for [%s]"), url);
- } else {
- websWrite(wp, T("Access limit for [%s], was successfully added."),
- url);
- }
- }
-
- websMsgEnd(wp);
- websFooter(wp);
- websDone(wp, 200);
-}
-
-/******************************************************************************/
-/*
- * Delete an Access Limit
- */
-
-static void formDeleteAccessLimit(webs_t wp, char_t *path, char_t *query)
-{
- char_t *url, *ok;
-
- a_assert(wp);
-
- url = websGetVar(wp, T("url"), T(""));
- ok = websGetVar(wp, T("ok"), T(""));
-
- websHeader(wp);
- websMsgStart(wp);
-
- if (gstricmp(ok, T("ok")) != 0) {
- websWrite(wp, T("Delete Access Limit Cancelled"));
- } else if (umDeleteAccessLimit(url) != 0) {
- websWrite(wp, T("ERROR: Unable to delete Access Limit for [%s]"),
- url);
- } else {
- websWrite(wp, T("Access Limit for [%s], was successfully deleted."),
- url);
- }
-
- websMsgEnd(wp);
- websFooter(wp);
- websDone(wp, 200);
-}
-
-/******************************************************************************/
-/*
- * Generate HTML to create a list box containing the access limits
- */
-
-static int aspGenerateAccessLimitList(int eid, webs_t wp,
- int argc, char_t **argv)
-{
- char_t *url;
- int row, nBytesSent, nBytes;
-
- a_assert(wp);
-
- row = nBytesSent = 0;
- url = umGetFirstAccessLimit();
- nBytes = websWrite(wp,
- T("<SELECT NAME=\"url\" SIZE=\"3\" TITLE=\"Select a URL\">"));
-
- while (url && (nBytes > 0)) {
- nBytes = websWrite(wp, T("<OPTION VALUE=\"%s\">%s\n"), url, url);
- url = umGetNextAccessLimit(url);
- nBytesSent += nBytes;
- }
-
- nBytesSent += websWrite(wp, T("</SELECT>"));
-
- return nBytesSent;
-}
-
-/******************************************************************************/
-/*
- * Generate HTML to create a list box containing the access methods
- */
-
-static int aspGenerateAccessMethodList(int eid, webs_t wp,
- int argc, char_t **argv)
-{
- int nBytes;
-
- a_assert(wp);
-
- nBytes = websWrite(wp,
- T("<SELECT NAME=\"method\" SIZE=\"3\" TITLE=\"Select a Method\">"));
- nBytes += websWrite(wp, T("<OPTION VALUE=\"%d\">FULL ACCESS\n"),
- AM_FULL);
- nBytes += websWrite(wp, T("<OPTION VALUE=\"%d\">BASIC ACCESS\n"),
- AM_BASIC);
- nBytes += websWrite(wp, T("<OPTION VALUE=\"%d\" SELECTED>DIGEST ACCESS\n"),
- AM_DIGEST);
- nBytes += websWrite(wp, T("<OPTION VALUE=\"%d\">NO ACCESS\n"),
- AM_NONE);
- nBytes += websWrite(wp, T("</SELECT>"));
-
- return nBytes;
-}
-/******************************************************************************/
-/*
- * Generate HTML to create a list box containing privileges
- */
-
-static int aspGeneratePrivilegeList(int eid, webs_t wp,
- int argc, char_t **argv)
-{
- int nBytes;
-
- a_assert(wp);
-
- nBytes = websWrite(wp, T("<SELECT NAME=\"privilege\" SIZE=\"3\" "));
- nBytes += websWrite(wp, T("MULTIPLE TITLE=\"Choose Privileges\">"));
- nBytes += websWrite(wp, T("<OPTION VALUE=\"%d\">READ\n"), PRIV_READ);
- nBytes += websWrite(wp, T("<OPTION VALUE=\"%d\">EXECUTE\n"), PRIV_WRITE);
- nBytes += websWrite(wp, T("<OPTION VALUE=\"%d\">ADMINISTRATE\n"),
- PRIV_ADMIN);
- nBytes += websWrite(wp, T("</SELECT>"));
-
- return nBytes;
-}
-
-/******************************************************************************/
-/*
- * Save the user management configuration to a file
- */
-
-static void formSaveUserManagement(webs_t wp, char_t *path, char_t *query)
-{
- char_t *ok;
-
- a_assert(wp);
-
- ok = websGetVar(wp, T("ok"), T(""));
-
- websHeader(wp);
- websMsgStart(wp);
-
- if (gstricmp(ok, T("ok")) != 0) {
- websWrite(wp, T("Save Cancelled."));
- } else if (umCommit(NULL) != 0) {
- websWrite(wp, T("ERROR: Unable to save user configuration."));
- } else {
- websWrite(wp, T("User configuration was saved successfully."));
- }
-
- websMsgEnd(wp);
- websFooter(wp);
- websDone(wp, 200);
-}
-
-/******************************************************************************/
-/*
- * Load the user management configuration from a file
- */
-
-static void formLoadUserManagement(webs_t wp, char_t *path, char_t *query)
-{
- char_t *ok;
-
- a_assert(wp);
-
- ok = websGetVar(wp, T("ok"), T(""));
-
- websHeader(wp);
- websMsgStart(wp);
-
- if (gstricmp(ok, T("ok")) != 0) {
- websWrite(wp, T("Load Cancelled."));
- } else if (umRestore(NULL) != 0) {
- websWrite(wp, T("ERROR: Unable to load user configuration."));
- } else {
- websWrite(wp, T("User configuration was re-loaded successfully."));
- }
-
- websMsgEnd(wp);
- websFooter(wp);
- websDone(wp, 200);
-}
-
-/******************************************************************************/
-/*
- * Message start and end convenience functions
- */
-
-static void websMsgStart(webs_t wp)
-{
- websWrite(wp, MSG_START);
-}
-
-static void websMsgEnd(webs_t wp)
-{
- websWrite(wp, MSG_END);
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/url.c b/xbmc/lib/libGoAhead/src/url.c deleted file mode 100644 index 315598f483..0000000000 --- a/xbmc/lib/libGoAhead/src/url.c +++ /dev/null @@ -1,213 +0,0 @@ -/*
- * url.c -- Parse URLs
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: url.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module parses URLs into their components.
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-
-/********************************* Statics ************************************/
-/*
- * htmExt is declared in this way to avoid a Linux and Solaris segmentation
- * fault when a constant string is passed to webs_strlower which could change its
- * argument.
- */
-
-char_t htmExt[] = T(".htm");
-
-
-/*********************************** Code *************************************/
-/*
- * Return the mime type for the given URL given a URL.
- * The caller supplies the buffer to hold the result.
- * charCnt is the number of characters the buffer will hold, ascii or UNICODE.
- */
-
-char_t *websUrlType(char_t *url, char_t *buf, int charCnt)
-{
- sym_t *sp;
- char_t *ext, *parsebuf;
-
- a_assert(url && *url);
- a_assert(buf && charCnt > 0);
-
- if (url == NULL || *url == '\0') {
- gstrcpy(buf, T("text/plain"));
- return buf;
- }
- if (websUrlParse(url, &parsebuf, NULL, NULL, NULL, NULL, NULL,
- NULL, &ext) < 0) {
- gstrcpy(buf, T("text/plain"));
- return buf;
- }
- webs_strlower(ext);
-
-/*
- * Lookup the mime type symbol table to find the relevant content type
- */
- if ((sp = symLookup(websMime, ext)) != NULL) {
- gstrncpy(buf, sp->content.value.string, charCnt);
- } else {
- gstrcpy(buf, T("text/plain"));
- }
- bfree(B_L, parsebuf);
- return buf;
-}
-
-/******************************************************************************/
-/*
- * Parse the URL. A buffer is allocated to store the parsed URL in *pbuf.
- * This must be freed by the caller. NOTE: tag is not yet fully supported.
- */
-
-int websUrlParse(char_t *url, char_t **pbuf, char_t **phost, char_t **ppath,
- char_t **pport, char_t **pquery, char_t **pproto, char_t **ptag,
- char_t **pext)
-{
- char_t *tok, *cp, *host, *path, *port, *proto, *tag, *query, *ext;
- char_t *last_delim, *hostbuf, *portbuf, *buf;
- int c, len, ulen;
-
- a_assert(url);
- a_assert(pbuf);
-
- ulen = gstrlen(url);
-/*
- * We allocate enough to store separate hostname and port number fields.
- * As there are 3 strings in the one buffer, we need room for 3 null chars.
- * We allocate MAX_PORT_LEN char_t's for the port number.
- */
- len = ulen * 2 + MAX_PORT_LEN + 3;
- if ((buf = balloc(B_L, len * sizeof(char_t))) == NULL) {
- return -1;
- }
- portbuf = &buf[len - MAX_PORT_LEN - 1];
- hostbuf = &buf[ulen+1];
- gstrcpy(buf, url);
- url = buf;
-
-/*
- * Convert the current listen port to a string. We use this if the URL has
- * no explicit port setting
- */
- webs_stritoa(websGetPort(), portbuf, MAX_PORT_LEN);
- port = portbuf;
- path = T("/");
- proto = T("http");
- host = T("localhost");
- query = T("");
- ext = htmExt;
- tag = T("");
-
- if (gstrncmp(url, T("http://"), 7) == 0) {
- tok = &url[7];
- tok[-3] = '\0';
- proto = url;
- host = tok;
- for (cp = tok; *cp; cp++) {
- if (*cp == '/') {
- break;
- }
- if (*cp == ':') {
- *cp++ = '\0';
- port = cp;
- tok = cp;
- }
- }
- if ((cp = gstrchr(tok, '/')) != NULL) {
-/*
- * If a full URL is supplied, we need to copy the host and port
- * portions into static buffers.
- */
- c = *cp;
- *cp = '\0';
- gstrncpy(hostbuf, host, ulen);
- gstrncpy(portbuf, port, MAX_PORT_LEN);
- *cp = c;
- host = hostbuf;
- port = portbuf;
- path = cp;
- tok = cp;
- }
-
- } else {
- path = url;
- tok = url;
- }
-
-/*
- * Parse the query string
- */
- if ((cp = gstrchr(tok, '?')) != NULL) {
- *cp++ = '\0';
- query = cp;
- path = tok;
- tok = query;
- }
-
-/*
- * Parse the fragment identifier
- */
- if ((cp = gstrchr(tok, '#')) != NULL) {
- *cp++ = '\0';
- if (*query == 0) {
- path = tok;
- }
- }
-
-/*
- * Only do the following if asked for the extension
- */
- if (pext) {
- if ((cp = gstrrchr(path, '.')) != NULL) {
- if ((last_delim = gstrrchr(path, '/')) != NULL) {
- if (last_delim > cp) {
- ext = htmExt;
- } else {
- ext = cp;
- }
- } else {
- ext = cp;
- }
- } else {
- if (path[gstrlen(path) - 1] == '/') {
- ext = htmExt;
- }
- }
- }
-
-/*
- * Pass back the fields requested (if not NULL)
- */
- if (phost)
- *phost = host;
- if (ppath)
- *ppath = path;
- if (pport)
- *pport = port;
- if (pproto)
- *pproto = proto;
- if (pquery)
- *pquery = query;
- if (ptag)
- *ptag = tag;
- if (pext)
- *pext = ext;
- *pbuf = buf;
- return 0;
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/value.c b/xbmc/lib/libGoAhead/src/value.c deleted file mode 100644 index 1c799a3303..0000000000 --- a/xbmc/lib/libGoAhead/src/value.c +++ /dev/null @@ -1,1214 +0,0 @@ -/*
- * value.c -- Generic type (holds all types)
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * $Id: value.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module provides a generic type that can hold all possible types.
- * It is designed to provide maximum effeciency.
- */
-
-/********************************* Includes ***********************************/
-
-#ifdef UEMF
- #include "uemf.h"
-#else
- #include "basic/basicInternal.h"
-#endif
-
-/*********************************** Locals ***********************************/
-#ifndef UEMF
-static value_t value_null; /* All zeros */
-
-/***************************** Forward Declarations ***************************/
-
-static void coerce_types(value_t* v1, value_t* v2);
-static int value_to_integer(value_t* vp);
-#endif /*!UEMF*/
-/*********************************** Code *************************************/
-/*
- * Initialize a integer value.
- */
-
-value_t valueInteger(long value)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = integer;
- v.value.integer = value;
- return v;
-}
-
-/******************************************************************************/
-/*
- * Initialize a string value.
- */
-
-value_t valueString(char_t* value, int flags)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = vtype_string;
- if (flags & VALUE_ALLOCATE) {
- v.allocated = 1;
- v.value.string = gstrdup(B_L, value);
- } else {
- v.allocated = 0;
- v.value.string = value;
- }
- return v;
-}
-
-/******************************************************************************/
-/*
- * Free any storage allocated for a value.
- */
-
-void valueFree(value_t* v)
-{
- if (v->valid && v->allocated && v->type == vtype_string &&
- v->value.string != NULL) {
- bfree(B_L, v->value.string);
- }
-#ifndef UEMF
- if (v->valid && v->type == symbol && v->value.symbol.data != NULL &&
- v->value.symbol.freeCb !=NULL) {
- v->value.symbol.freeCb(v->value.symbol.data);
- }
-#endif
- v->type = undefined;
- v->valid = 0;
- v->allocated = 0;
-}
-
-#ifndef UEMF
-
-/******************************************************************************/
-/*
- * Initialize an invalid value.
- */
-
-value_t valueInvalid()
-{
- value_t v;
- v.valid = 0;
- v.type = undefined;
- return v;
-}
-
-/******************************************************************************/
-/*
- * Initialize a flag value.
- */
-
-value_t valueBool(int value)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.type = flag;
- v.valid = 1;
- v.value.flag = (char) value;
- return v;
-}
-
-/******************************************************************************/
-/*
- * Initialize a byteint value.
- */
-
-value_t valueByteint(char value)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = byteint;
- v.value.byteint = value;
- return v;
-}
-
-/******************************************************************************/
-/*
- * Initialize a shortint value.
- */
-
-value_t valueShortint(short value)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = shortint;
- v.value.shortint = value;
- return v;
-}
-
-#ifdef FLOATING_POINT_SUPPORT
-/******************************************************************************/
-/*
- * Initialize a floating value.
- */
-
-value_t valueFloating(double value)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = floating;
- v.value.floating = value;
- return v;
-}
-#endif /* FLOATING_POINT_SUPPORT */
-
-/******************************************************************************/
-/*
- * Initialize a big value.
- */
-
-value_t valueBig(long high_word, long low_word)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = big;
- v.value.big[BLOW] = low_word;
- v.value.big[BHIGH] = high_word;
- return v;
-}
-
-/******************************************************************************/
-/*
- * Initialize a hex value.
- */
-
-value_t valueHex(int value)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = hex;
- v.value.integer = value;
- return v;
-}
-
-/******************************************************************************/
-/*
- * Initialize a octal value.
- */
-
-value_t valueOctal(int value)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = octal;
- v.value.integer = value;
- return v;
-}
-
-/******************************************************************************/
-/*
- * Initialize a percent value.
- */
-
-value_t valuePercent(int value)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = percent;
- v.value.percent = (char) value;
- return v;
-}
-
-/******************************************************************************/
-/*
- * Initialize an byte array. Note: no allocation, just store the ptr
- */
-
-value_t valueBytes(char* value, int flags)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = bytes;
- if (flags & VALUE_ALLOCATE) {
- v.allocated = 1;
- v.value.bytes = bstrdupA(B_L, value);
- } else {
- v.allocated = 0;
- v.value.bytes = value;
- }
- return v;
-}
-
-/******************************************************************************/
-/*
- * Initialize a symbol value.
- * Value parameter can hold a pointer to any type of value
- * Free parameter can be NULL, or a function pointer to a function that will
- * free the value
- */
-
-value_t valueSymbol(void *value, freeCallback freeCb)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = symbol;
- v.value.symbol.data = value;
- v.value.symbol.freeCb = freeCb;
- return v;
-}
-
-/******************************************************************************/
-/*
- * Initialize an error message value.
- */
-
-value_t valueErrmsg(char_t* value)
-{
- value_t v;
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
- v.type = errmsg;
- v.value.errmsg = value;
- return v;
-}
-
-/******************************************************************************/
-/*
- * Copy a value. If the type is 'string' then allocate another string.
- * Note: we allow the copy of a null value.
- */
-
-value_t valueCopy(value_t v2)
-{
- value_t v1;
-
- v1 = v2;
- if (v2.valid && v2.type == string && v2.value.string != NULL) {
- v1.value.string = gstrdup(B_L, v2.value.string);
- v1.allocated = 1;
- }
- return v1;
-}
-
-
-/******************************************************************************/
-/*
- * Add a value.
- */
-
-value_t valueAdd(value_t v1, value_t v2)
-{
- value_t v;
-
- a_assert(v1.valid);
- a_assert(v2.valid);
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
-
- if (v1.type != v2.type)
- coerce_types(&v1, &v2);
-
- switch (v1.type) {
- default:
- case string:
- case bytes:
- a_assert(0);
- break;
-
-#ifdef FLOATING_POINT_SUPPORT
- case floating:
- v1.value.floating += v2.value.floating;
- return v1;
-#endif
-
- case flag:
- v1.value.bool |= v2.value.flag;
- return v1;
-
- case byteint:
- case percent:
- v1.value.byteint += v2.value.byteint;
- return v1;
-
- case shortint:
- v1.value.shortint += v2.value.shortint;
- return v1;
-
- case hex:
- case integer:
- case octal:
- v1.value.integer += v2.value.integer;
- return v1;
-
- case big:
- v.type = big;
- badd(v.value.big, v1.value.big, v2.value.big);
- return v;
- }
-
- return v1;
-}
-
-
-/******************************************************************************/
-/*
- * Subtract a value.
- */
-
-value_t valueSub(value_t v1, value_t v2)
-{
- value_t v;
-
- a_assert(v1.valid);
- a_assert(v2.valid);
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
-
- if (v1.type != v2.type)
- coerce_types(&v1, &v2);
- switch (v1.type) {
- default:
- a_assert(0);
- break;
-
-#ifdef FLOATING_POINT_SUPPORT
- case floating:
- v1.value.floating -= v2.value.floating;
- return v1;
-#endif
-
- case flag:
- v1.value.flag &= v2.value.flag;
- return v1;
-
- case byteint:
- case percent:
- v1.value.byteint -= v2.value.byteint;
- return v1;
-
- case shortint:
- v1.value.shortint -= v2.value.shortint;
- return v1;
-
- case hex:
- case integer:
- case octal:
- v1.value.integer -= v2.value.integer;
- return v1;
-
- case big:
- v.type = big;
- bsub(v.value.big, v1.value.big, v2.value.big);
- return v;
- }
-
- return v1;
-}
-
-
-/******************************************************************************/
-/*
- * Multiply a value.
- */
-
-value_t valueMul(value_t v1, value_t v2)
-{
- value_t v;
-
- a_assert(v1.valid);
- a_assert(v2.valid);
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
-
- if (v1.type != v2.type)
- coerce_types(&v1, &v2);
- switch (v1.type) {
- default:
- a_assert(0);
- break;
-
- case flag:
- a_assert(v1.type != flag);
- break;
-
-#ifdef FLOATING_POINT_SUPPORT
- case floating:
- v1.value.floating *= v2.value.floating;
- return v1;
-#endif
-
- case byteint:
- case percent:
- v1.value.byteint *= v2.value.byteint;
- return v1;
-
- case shortint:
- v1.value.shortint *= v2.value.shortint;
- return v1;
-
- case hex:
- case integer:
- case octal:
- v1.value.integer *= v2.value.integer;
- return v1;
-
- case big:
- v.type = big;
- bmul(v.value.big, v1.value.big, v2.value.big);
- return v;
- }
-
- return v1;
-}
-
-
-/******************************************************************************/
-/*
- * Divide a value.
- */
-
-value_t valueDiv(value_t v1, value_t v2)
-{
- value_t v;
-
- a_assert(v1.valid);
- a_assert(v2.valid);
-
- memset(&v, 0x0, sizeof(v));
- v.valid = 1;
-
- if (v1.type != v2.type)
- coerce_types(&v1, &v2);
- switch (v1.type) {
- default:
- a_assert(0);
- break;
-
- case flag:
- a_assert(v1.type != flag);
- break;
-
-#ifdef FLOATING_POINT_SUPPORT
- case floating:
- v1.value.floating /= v2.value.floating;
- return v1;
-#endif
-
- case byteint:
- case percent:
- v1.value.byteint /= v2.value.byteint;
- return v1;
-
- case shortint:
- v1.value.shortint /= v2.value.shortint;
- return v1;
-
- case hex:
- case integer:
- case octal:
- v1.value.integer /= v2.value.integer;
- return v1;
-
- case big:
- v.type = big;
- bdiv(v.value.big, v1.value.big, v2.value.big);
- return v;
- }
-
- return v1;
-}
-
-
-/******************************************************************************/
-/*
- * Compare a value.
- */
-
-int valueCmp(value_t v1, value_t v2)
-{
- a_assert(v1.valid);
- a_assert(v2.valid);
-
- if (v1.type != v2.type)
- coerce_types(&v1, &v2);
- if (v1.type != v2.type) {
-/*
- * Make v2 == v1
- */
- a_assert(v1.type == v2.type);
- v2 = v1;
- return 0;
- }
- switch (v1.type) {
- case string:
- if (v1.value.string == NULL && v2.value.string == NULL) {
- return 0;
- } else if (v1.value.string == NULL) {
- return -1;
- } else if (v2.value.string == NULL) {
- return 1;
- } else {
- return gstrcmp(v1.value.string, v2.value.string);
- }
- /* Nobody here */
-
- case flag:
- if (v1.value.flag < v2.value.flag)
- return -1;
- else if (v1.value.flag == v2.value.flag)
- return 0;
- else return 1;
-
-#ifdef FLOATING_POINT_SUPPORT
- case floating:
- if (v1.value.floating < v2.value.floating)
- return -1;
- else if (v1.value.floating == v2.value.floating)
- return 0;
- else return 1;
-#endif
-
- case byteint:
- case percent:
- if (v1.value.byteint < v2.value.byteint)
- return -1;
- else if (v1.value.byteint == v2.value.byteint)
- return 0;
- else return 1;
-
- case shortint:
- if (v1.value.shortint < v2.value.shortint)
- return -1;
- else if (v1.value.shortint == v2.value.shortint)
- return 0;
- else return 1;
-
- case hex:
- case integer:
- case octal:
- if (v1.value.integer < v2.value.integer)
- return -1;
- else if (v1.value.integer == v2.value.integer)
- return 0;
- else return 1;
-
- case big:
- return bcompare(v1.value.big, v2.value.big);
-
- default:
- a_assert(0);
- return 0;
- }
-}
-
-
-/******************************************************************************/
-/*
- * If type mismatch, then coerce types to big.
- * Note: Known bug, casting of negative bigs to floats doesn't work.
- */
-
-static void coerce_types(register value_t* v1, register value_t* v2)
-{
-#ifdef FLOATING_POINT_SUPPORT
- if (v1->type == floating) {
- v2->type = floating;
- v2->value.floating = (double) v2->value.integer;
- if (v2->type == big)
- v2->value.floating = (double) v2->value.big[BLOW] +
- (double) v2->value.big[BHIGH] * (double) MAXINT;
-
- } else if (v2->type == floating) {
- v1->type = floating;
- v1->value.floating = (double) v1->value.integer;
- if (v1->type == big)
- v1->value.floating = (double) v1->value.big[BLOW] +
- (double) v1->value.big[BHIGH] * (double) MAXINT;
-
- } else if (v1->type == big) {
-#else
- if (v1->type == big) {
-#endif /* FLOATING_POINT_SUPPORT */
- v2->value.big[BLOW] = value_to_integer(v2);
- if (valueNegative(v2))
- v2->value.big[BHIGH] = -1;
- else
- v2->value.big[BHIGH] = 0;
- v2->type = big;
-
- } else if (v2->type == big) {
- if (valueNegative(v1))
- v1->value.big[BHIGH] = -1;
- else
- v1->value.big[BHIGH] = 0;
- v1->value.big[BLOW] = value_to_integer(v1);
- v1->type = big;
-
-
- } else if (v1->type == integer) {
- v2->value.integer = value_to_integer(v2);
- v2->type = integer;
-
- } else if (v2->type == integer) {
- v1->value.integer = value_to_integer(v1);
- v1->type = integer;
-
- } else if (v1->type != integer) {
- v2->type = v1->type;
-
- } else if (v2->type != integer) {
- v1->type = v2->type;
-
- }
- a_assert(v1->type == v2->type);
-}
-
-
-/******************************************************************************/
-/*
- * Return true if the value is numeric and negative. Otherwise return 0.
- */
-
-int valueNegative(value_t* vp)
-{
- switch (vp->type) {
- default:
- case string:
- case bytes:
- return 0;
-
-#ifdef FLOATING_POINT_SUPPORT
- case floating:
- if (vp->value.floating < 0)
- return 1;
- return 0;
-#endif
-
- case flag:
- if ((signed char)vp->value.flag < 0)
- return 1;
- return 0;
-
- case byteint:
- case percent:
- if ((signed char)vp->value.byteint < 0)
- return 1;
- return 0;
-
- case shortint:
- if (vp->value.shortint < 0)
- return 1;
- return 0;
-
- case hex:
- case integer:
- case octal:
- if (vp->value.integer < 0)
- return 1;
- return 0;
-
- case big:
- if (vp->value.big[BHIGH] < 0)
- return 1;
- return 0;
- }
-}
-
-/******************************************************************************/
-/*
- * Return true if the value is numeric and zero. Otherwise return 0.
- */
-
-int valueZero(value_t* vp)
-{
- switch (vp->type) {
- default:
- case string:
- case bytes:
- return 0;
-
-#ifdef FLOATING_POINT_SUPPORT
- case floating:
- if (vp->value.floating == 0)
- return 1;
- return 0;
-#endif
-
- case flag:
- if (vp->value.flag == 0)
- return 1;
- return 0;
-
- case byteint:
- case percent:
- if (vp->value.byteint == 0)
- return 1;
- return 0;
-
- case shortint:
- if (vp->value.shortint == 0)
- return 1;
- return 0;
-
- case hex:
- case integer:
- case octal:
- if (vp->value.integer == 0)
- return 1;
- return 0;
-
- case big:
- if (vp->value.big[BHIGH] == 0 && vp->value.big[BLOW] == 0)
- return 1;
- return 0;
- }
-}
-
-
-/******************************************************************************/
-/*
- * Cast a value to an integer. Cannot be called for floating, non-numerics
- * or bigs.
- */
-
-static int value_to_integer(value_t* vp)
-{
- switch (vp->type) {
- default:
- case string:
- case bytes:
- case big:
-#ifdef FLOATING_POINT_SUPPORT
- case floating:
- a_assert(0);
- return -1;
-#endif
-
- case flag:
- return (int) vp->value.flag;
-
- case byteint:
- case percent:
- return (int) vp->value.byteint;
-
- case shortint:
- return (int) vp->value.shortint;
-
- case hex:
- case integer:
- case octal:
- return (int) vp->value.integer;
- }
-}
-
-
-/******************************************************************************/
-/*
- * Convert a value to a text based representation of its value
- */
-
-void valueSprintf(char_t** out, int size, char_t* fmt, value_t vp)
-{
- char_t *src, *dst, *tmp, *dst_start;
-
- a_assert(out);
-
- *out = NULL;
-
- if (! vp.valid) {
- *out = bstrdup(B_L, T("Invalid"));
- return;
- }
-
- switch (vp.type) {
- case flag:
- if (fmt == NULL || *fmt == '\0') {
- *out = bstrdup(B_L, (vp.value.flag) ? T("true") : T("false"));
- } else {
- fmtAlloc(out, size, fmt, (vp.value.flag) ? T("true") : T("false"));
- }
- break;
-
-#ifdef FLOATING_POINT_SUPPORT
- case floating:
- if (fmt == NULL || *fmt == '\0') {
- fmtAlloc(out, size, T("%f"), vp.value.floating);
- } else {
- fmtAlloc(out, size, fmt, vp.value.floating);
- }
- break;
-#endif
-
- case hex:
- if (fmt == NULL || *fmt == '\0') {
- fmtAlloc(out, size, T("0x%lx"), vp.value.hex);
- } else {
- fmtAlloc(out, size, fmt, vp.value.hex);
- }
- break;
-
- case big:
- if (*out == NULL) {
- *out = btoa(vp.value.big, NULL, 0);
- } else {
- btoa(vp.value.big, *out, size);
- }
- break;
-
- case integer:
- if (fmt == NULL || *fmt == '\0') {
- fmtAlloc(out, size, T("%ld"), vp.value.integer);
- } else {
- fmtAlloc(out, size, fmt, vp.value.integer);
- }
- break;
-
- case octal:
- if (fmt == NULL || *fmt == '\0') {
- fmtAlloc(out, size, T("0%lo"), vp.value.octal);
- } else {
- fmtAlloc(out, size, fmt, vp.value.octal);
- }
- break;
-
- case percent:
- if (fmt == NULL || *fmt == '\0') {
- fmtAlloc(out, size, T("%d%%"), vp.value.percent);
- } else {
- fmtAlloc(out, size, fmt, vp.value.percent);
- }
- break;
-
- case byteint:
- if (fmt == NULL || *fmt == '\0') {
- fmtAlloc(out, size, T("%d"), (int) vp.value.byteint);
- } else {
- fmtAlloc(out, size, fmt, (int) vp.value.byteint);
- }
- break;
-
- case shortint:
- if (fmt == NULL || *fmt == '\0') {
- fmtAlloc(out, size, T("%d"), (int) vp.value.shortint);
- } else {
- fmtAlloc(out, size, fmt, (int) vp.value.shortint);
- }
- break;
-
- case string:
- case errmsg:
- src = vp.value.string;
-
- if (src == NULL) {
- *out = bstrdup(B_L, T("NULL"));
- } else if (fmt && *fmt) {
- fmtAlloc(out, size, fmt, src);
-
- } else {
-
- *out = balloc(B_L, size);
- dst_start = dst = *out;
- for (; *src != '\0'; src++) {
- if (dst >= &dst_start[VALUE_MAX_STRING - 5])
- break;
- switch (*src) {
- case '\a': *dst++ = '\\'; *dst++ = 'a'; break;
- case '\b': *dst++ = '\\'; *dst++ = 'b'; break;
- case '\f': *dst++ = '\\'; *dst++ = 'f'; break;
- case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
- case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
- case '\t': *dst++ = '\\'; *dst++ = 't'; break;
- case '\v': *dst++ = '\\'; *dst++ = 'v'; break;
- case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
- case '"': *dst++ = '\\'; *dst++ = '\"'; break;
- default:
- if (gisprint(*src)) {
- *dst++ = *src;
- } else {
- fmtAlloc(&tmp, size, T("\\x%02x"),
- (unsigned int) *src);
- gstrcpy(dst, tmp);
- bfreeSafe(B_L, tmp);
- dst += 4;
- }
- break;
- }
- }
- *dst++ = '\0';
- }
- break;
-
-#ifdef UNUSED
- case bytes:
- asrc = vp.value.bytes;
-
- if (asrc == NULL) {
- *out = bstrdup(B_L, T("NULL"));
-
- } else if (fmt && *fmt) {
- fmtAlloc(out, size, fmt, asrc);
-
- } else {
-
- dst_start = dst;
- for (; *asrc != '\0'; asrc++) {
- if (dst >= &dst_start[VALUE_MAX_STRING - 5])
- break;
- switch (*asrc) {
- case '\a': *dst++ = '\\'; *dst++ = 'a'; break;
- case '\b': *dst++ = '\\'; *dst++ = 'b'; break;
- case '\f': *dst++ = '\\'; *dst++ = 'f'; break;
- case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
- case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
- case '\t': *dst++ = '\\'; *dst++ = 't'; break;
- case '\v': *dst++ = '\\'; *dst++ = 'v'; break;
- case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
- case '"': *dst++ = '\\'; *dst++ = '\"'; break;
- default:
- if (gisprint(*asrc)) {
- *dst++ = *asrc;
- } else {
- fmtAlloc(dst, size,
- T("\\x%02x"), (unsigned int) *asrc);
- dst += 4;
- }
- break;
- }
- }
- *dst++ = '\0';
- }
- break;
-#endif
-
- default:
- a_assert(0);
- }
-}
-
-/******************************************************************************/
-/*
- * Print a value to the named file descriptor
- */
-
-void valueFprintf(FILE* fp, char_t* fmt, value_t vp)
-{
- char_t *buf;
-
- buf = NULL;
- valueSprintf(&buf, VALUE_MAX_STRING, fmt, vp);
- gfputs(buf, fp);
- bfreeSafe(B_L, buf);
- fflush(fp);
-}
-
-/******************************************************************************/
-/*
- * Ascii to value conversion
- */
-
-value_t valueAtov(char_t* s, int pref_type)
-{
- vtype_t type;
- value_t v;
- long tmp[2], tmp2[2], base[2];
- int i, len, num;
-
- a_assert(0 <= pref_type && pref_type < 99); /* Sanity check */
- a_assert(s);
-
- v = value_null;
- if (s == NULL) {
- return value_null;
- }
-
- base[BLOW] = 10;
- base[BHIGH] = 0;
- len = gstrlen(s);
-
-/*
- * Determine the value type
- */
- type = undefined;
- if (pref_type <= 0) {
- if (gisdigit(*s)) {
- base[BHIGH] = 0;
- if (s[len - 1] == '%') {
- type = percent;
- len --;
- base[BLOW] = 10;
- } else if (*s == '0') {
- if (s[1] == 'x') {
- type = hex;
- s += 2;
- len -= 2;
- base[BLOW] = 16;
- } else if (s[1] == '\0') {
- type = integer;
- base[BLOW] = 10;
- } else {
- type = octal;
- s++;
- len--;
- base[BLOW] = 8;
- }
- } else {
- type = integer;
- base[BLOW] = 10;
- }
-
- } else {
- if (gstrcmp(s, T("true")) == 0 || gstrcmp(s, T("false")) == 0) {
- type = flag;
- } else if (*s == '\'' && s[len - 1] == '\'') {
- type = string;
- s++;
- len -= 2;
- } else if (*s == '\"' && s[len - 1] == '\"') {
- type = string;
- s++;
- len -= 2;
- } else {
- type = string;
- }
- }
- v.type = type;
-
- } else
- v.type = pref_type;
- v.valid = 1;
-
-/*
- * Do the conversion. Always use big arithmetic
- */
- switch (v.type) {
- case hex:
- if (!isdigit(s[0])) {
- if (gtolower(s[0]) >= 'a' || gtolower(s[0]) <= 'f') {
- v.value.big[BLOW] = 10 + gtolower(s[0]) - 'a';
- } else {
- v.value.big[BLOW] = 0;
- }
- } else {
- v.value.big[BLOW] = s[0] - '0';
- }
- v.value.big[BHIGH] = 0;
- for (i = 1; i < len; i++) {
- if (!isdigit(s[i])) {
- if (gtolower(s[i]) < 'a' || gtolower(s[i]) > 'f') {
- break;
- }
- num = 10 + gtolower(s[i]) - 'a';
- } else {
- num = s[i] - '0';
- }
- bmul(tmp, v.value.big, base);
- binit(tmp2, 0, num);
- badd(v.value.big, tmp, tmp2);
- }
- v.value.hex = v.value.big[BLOW];
- break;
-
- case shortint:
- case byteint:
- case integer:
- case percent:
- case octal:
- case big:
- v.value.big[BHIGH] = 0;
- if (gisdigit(s[0]))
- v.value.big[BLOW] = s[0] - '0';
- else
- v.value.big[BLOW] = 0;
- for (i = 1; i < len && gisdigit(s[i]); i++) {
- bmul(tmp, v.value.big, base);
- binit(tmp2, 0, s[i] - '0');
- badd(v.value.big, tmp, tmp2);
- }
- switch (v.type) {
- case shortint:
- v.value.shortint = (short) v.value.big[BLOW];
- break;
- case byteint:
- v.value.byteint = (char) v.value.big[BLOW];
- break;
- case integer:
- v.value.integer = (int) v.value.big[BLOW];
- break;
- case percent:
- v.value.percent = (char) v.value.big[BLOW];
- break;
- case octal:
- v.value.octal = (int) v.value.big[BLOW];
- break;
- default:
- break;
- }
- break;
-
-#ifdef FLOATING_POINT_SUPPORT
- case floating:
- gsscanf(s, T("%f"), &v.value.floating);
- break;
-#endif
-
- case flag:
- if (*s == 't')
- v.value.flag = 1;
- else v.value.flag = 0;
- break;
-
- case string:
-/*
- * Note this always ballocs a string
- */
- v = valueString(s, VALUE_ALLOCATE);
- break;
-
- case bytes:
- v = valueBytes((char*) s, VALUE_ALLOCATE);
- break;
-
-#ifdef UNUSED
- case literal:
- v = value_literal(bstrdup(B_L, s));
- v.value.literal[len] = '\0';
- break;
-#endif
-
- case undefined:
- case symbol:
- default:
- v.valid = 0;
- a_assert(0);
- }
- return v;
-}
-
-#endif /* !UEMF */
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/webcomp.c b/xbmc/lib/libGoAhead/src/webcomp.c deleted file mode 100644 index 2612348086..0000000000 --- a/xbmc/lib/libGoAhead/src/webcomp.c +++ /dev/null @@ -1,189 +0,0 @@ -/*
- * webcomp -- Compile web pages into C source
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: webcomp.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * Usage: webcomp prefix filelist >webrom.c
- *
- * filelist is a file containing the pathnames of all web pages
- * prefix is a path prefix to remove from all the web page pathnames
- * webrom.c is the resulting C source file to compile and link.
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-
-/**************************** Forward Declarations ****************************/
-
-static int compile(char_t *fileList, char_t *prefix);
-static void usage();
-
-/*********************************** Code *************************************/
-/*
- * Main program for webpack test harness
- */
-
-int gmain(int argc, char_t* argv[])
-{
- char_t *fileList, *prefix;
-
- fileList = NULL;
-
- if (argc != 3) {
- usage();
- }
-
- prefix = argv[1];
- fileList = argv[2];
-
- if (compile(fileList, prefix) < 0) {
- return -1;
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Output usage message
- */
-
-static void usage()
-{
- fprintf(stderr, "usage: webcomp prefix filelist >output.c\n");
- exit(2);
-}
-
-/******************************************************************************/
-/*
- * Compile the web pages
- */
-
-static int compile(char_t *fileList, char_t *prefix)
-{
- gstat_t sbuf;
- FILE *lp;
- time_t now;
- char_t file[FNAMESIZE];
- char_t *cp, *sl;
- char buf[512];
- unsigned char *p;
- int j, i, len, fd, nFile;
-
-/*
- * Open list of files
- */
- if ((lp = fopen(fileList, "r")) == NULL) {
- fprintf(stderr, "Can't open file list %s\n", fileList);
- return -1;
- }
-
- time(&now);
- fprintf(stdout, "/*\n * webrom.c -- Compiled Web Pages\n *\n");
- fprintf(stdout, " * Compiled by GoAhead WebCompile: %s */\n\n",
- gctime(&now));
- fprintf(stdout, "#include \"wsIntrn.h\"\n\n");
- fprintf(stdout, "#ifndef WEBS_PAGE_ROM\n");
- fprintf(stdout, "websRomPageIndexType websRomPageIndex[] = {\n");
- fprintf(stdout, " { 0, 0, 0 },\n};\n");
- fprintf(stdout, "#else\n");
-
-/*
- * Open each input file and compile each web page
- */
- nFile = 0;
- while (fgets(file, sizeof(file), lp) != NULL) {
- if ((p = strchr(file, '\n')) || (p = strchr(file, '\r'))) {
- *p = '\0';
- }
- if (*file == '\0') {
- continue;
- }
- if (gstat(file, &sbuf) == 0 && sbuf.st_mode & S_IFDIR) {
- continue;
- }
- if ((fd = gopen(file, O_RDONLY | O_BINARY)) < 0) {
- fprintf(stderr, "Can't open file %s\n", file);
- return -1;
- }
- fprintf(stdout, "static unsigned char page_%d[] = {\n", nFile);
-
- while ((len = read(fd, buf, sizeof(buf))) > 0) {
- p = buf;
- for (i = 0; i < len; ) {
- fprintf(stdout, " ");
- for (j = 0; p < &buf[len] && j < 16; j++, p++) {
- fprintf(stdout, "%3d,", *p);
- }
- i += j;
- fprintf(stdout, "\n");
- }
- }
- fprintf(stdout, " 0 };\n\n");
-
- close(fd);
- nFile++;
- }
- fclose(lp);
-
-/*
- * Now output the page index
- */
- fprintf(stdout, "websRomPageIndexType websRomPageIndex[] = {\n");
-
- if ((lp = fopen(fileList, "r")) == NULL) {
- fprintf(stderr, "Can't open file list %s\n", fileList);
- return -1;
- }
- nFile = 0;
- while (fgets(file, sizeof(file), lp) != NULL) {
- if ((p = strchr(file, '\n')) || (p = strchr(file, '\r'))) {
- *p = '\0';
- }
- if (*file == '\0') {
- continue;
- }
-/*
- * Remove the prefix and add a leading "/" when we print the path
- */
- if (strncmp(file, prefix, gstrlen(prefix)) == 0) {
- cp = &file[gstrlen(prefix)];
- } else {
- cp = file;
- }
- while((sl = strchr(file, '\\')) != NULL) {
- *sl = '/';
- }
- if (*cp == '/') {
- cp++;
- }
-
- if (gstat(file, &sbuf) == 0 && sbuf.st_mode & S_IFDIR) {
- fprintf(stdout, " { T(\"/%s\"), 0, 0 },\n", cp);
- continue;
- }
- fprintf(stdout, " { T(\"/%s\"), page_%d, %d },\n", cp, nFile,
- sbuf.st_size);
- nFile++;
- }
- fclose(lp);
-
- fprintf(stdout, " { 0, 0, 0 },\n");
- fprintf(stdout, "};\n");
- fprintf(stdout, "#endif /* WEBS_PAGE_ROM */\n");
-
- fclose(lp);
- fflush(stdout);
- return 0;
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/webrom.c b/xbmc/lib/libGoAhead/src/webrom.c deleted file mode 100644 index 43610329fa..0000000000 --- a/xbmc/lib/libGoAhead/src/webrom.c +++ /dev/null @@ -1,16 +0,0 @@ -/*
- * webrom.c -- Compiled Web Pages
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: webrom.c,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-#include "wsIntrn.h"
-
-websRomPageIndexType websRomPageIndex[] = {
- { 0, 0, 0 },
-};
-
diff --git a/xbmc/lib/libGoAhead/src/webs.c b/xbmc/lib/libGoAhead/src/webs.c deleted file mode 100644 index af87468c9a..0000000000 --- a/xbmc/lib/libGoAhead/src/webs.c +++ /dev/null @@ -1,3082 +0,0 @@ -/*
- * webs.c -- GoAhead Embedded HTTP webs server
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: webs.c,v 1.16 2003/04/11 18:02:02 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module implements an embedded HTTP/1.1 web server. It supports
- * loadable URL handlers that define the nature of URL processing performed.
- */
-
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-#ifdef DIGEST_ACCESS_SUPPORT
- #include "websda.h"
-#endif
-
-/******************************** Global Data *********************************/
-
-websStatsType websStats; /* Web access stats */
-webs_t *webs; /* Open connection list head */
-sym_fd_t websMime; /* Set of mime types */
-int websMax; /* List size */
-int websPort; /* Listen port for server */
-char_t websHost[64]; /* Host name for the server */
-char_t websIpaddr[64]; /* IP address for the server */
-char_t *websHostUrl = NULL; /* URL to access server */
-char_t *websIpaddrUrl = NULL; /* URL to access server */
-
-/*********************************** Locals ***********************************/
-/*
- * Standard HTTP error codes
- */
-
-websErrorType websErrors[] = {
- { 200, T("Data follows") },
- { 204, T("No Content") },
- { 301, T("Redirect") },
- { 302, T("Redirect") },
- { 304, T("Use local copy") },
- { 400, T("Page not found") },
- { 401, T("Unauthorized") },
- { 403, T("Forbidden") },
- { 404, T("Site or Page Not Found") },
- { 405, T("Access Denied") },
- { 500, T("Web Error") },
- { 501, T("Not Implemented") },
- { 503, T("Site Temporarily Unavailable. Try again.") },
- { 0, NULL }
-};
-
-#ifdef WEBS_LOG_SUPPORT
-static char_t websLogname[64] = T("log.txt"); /* Log filename */
-static int websLogFd; /* Log file handle */
-#endif
-
-static int websListenSock; /* Listen socket */
-static char_t websRealm[64] = T("GoAhead"); /* Realm name */
-
-static int websOpenCount = 0; /* count of apps using this module */
-
-/**************************** Forward Declarations ****************************/
-
-
-/*static char_t *websErrorMsg(int code);*/
-static int websGetInput(webs_t wp, char_t **ptext, int *nbytes);
-static int websParseFirst(webs_t wp, char_t *text);
-static void websParseRequest(webs_t wp);
-static void websSocketEvent(int sid, int mask, void* data);
-static int websGetTimeSinceMark(webs_t wp);
-
-#ifdef WEBS_LOG_SUPPORT
-static void websLog(webs_t wp, int code);
-#endif
-#ifdef WEBS_IF_MODIFIED_SUPPORT
-static time_t dateParse(time_t tip, char_t *cmd);
-#endif
-
-/*********************************** Code *************************************/
-/*
- * Open the GoAhead WebServer
- */
-
-int websOpenServer(int port, int retries)
-{
- websMimeType *mt;
-
- if (++websOpenCount != 1) {
- return websPort;
- }
-
- a_assert(port > 0);
- a_assert(retries >= 0);
-
-#ifdef WEBS_PAGE_ROM
- websRomOpen();
-#endif
-
- webs = NULL;
- websMax = 0;
-/*
- * Create a mime type lookup table for quickly determining the content type
- */
- websMime = symOpen(WEBS_SYM_INIT * 4);
- a_assert(websMime >= 0);
- for (mt = websMimeList; mt->type; mt++) {
- symEnter(websMime, mt->ext, valueString(mt->type, 0), 0);
- }
-
-/*
- * Open the URL handler module. The caller should create the required
- * URL handlers after calling this function.
- */
- if (websUrlHandlerOpen() < 0) {
- return -1;
- }
- websFormOpen();
-
-#ifdef WEBS_LOG_SUPPORT
-/*
- * Optional request log support
- */
- websLogFd = gopen(websLogname, O_CREAT | O_TRUNC | O_APPEND | O_WRONLY,
- 0666);
- a_assert(websLogFd >= 0);
-#endif
-
- return websOpenListen(port, retries);
-}
-
-/******************************************************************************/
-/*
- * Close the GoAhead WebServer
- */
-
-void websCloseServer()
-{
- webs_t wp;
- int wid;
-
- if (--websOpenCount > 0) {
- return;
- }
-
-/*
- * Close the listen handle first then all open connections.
- */
- websCloseListen();
-
-/*
- * Close each open browser connection and free all resources
- */
- for (wid = websMax; webs && wid >= 0; wid--) {
- if ((wp = webs[wid]) == NULL) {
- continue;
- }
- socketCloseConnection(wp->sid);
- websFree(wp);
- }
-
-#ifdef WEBS_LOG_SUPPORT
- if (websLogFd >= 0) {
- close(websLogFd);
- websLogFd = -1;
- }
-#endif
-
-#ifdef WEBS_PAGE_ROM
- websRomClose();
-#endif
- symClose(websMime);
- websFormClose();
- websUrlHandlerClose();
-}
-
-/******************************************************************************/
-/*
- * Open the GoAhead WebServer listen port
- */
-
-int websOpenListen(int port, int retries)
-{
- int i, orig;
-
- a_assert(port > 0);
- a_assert(retries >= 0);
-
- orig = port;
-/*
- * Open the webs webs listen port. If we fail, try the next port.
- */
- for (i = 0; i <= retries; i++) {
- websListenSock = socketOpenConnection(NULL, port, websAccept, 0);
- if (websListenSock >= 0) {
- break;
- }
- port++;
- }
- if (i > retries) {
- error(E_L, E_USER, T("Couldn't open a socket on ports %d - %d"),
- orig, port - 1);
- return -1;
- }
-
-/*
- * Determine the full URL address to access the home page for this web server
- */
- websPort = port;
- bfreeSafe(B_L, websHostUrl);
- bfreeSafe(B_L, websIpaddrUrl);
- websIpaddrUrl = websHostUrl = NULL;
-
- if (port == 80) {
- websHostUrl = bstrdup(B_L, websHost);
- websIpaddrUrl = bstrdup(B_L, websIpaddr);
- } else {
- fmtAlloc(&websHostUrl, WEBS_MAX_URL + 80, T("%s:%d"), websHost, port);
- fmtAlloc(&websIpaddrUrl, WEBS_MAX_URL + 80, T("%s:%d"),
- websIpaddr, port);
- }
- trace(0, T("webs: Listening for HTTP requests at address %s\n"),
- websIpaddrUrl);
-
- return port;
-}
-
-/******************************************************************************/
-/*
- * Close webs listen port
- */
-
-void websCloseListen()
-{
- if (websListenSock >= 0) {
- socketCloseConnection(websListenSock);
- websListenSock = -1;
- }
- bfreeSafe(B_L, websHostUrl);
- bfreeSafe(B_L, websIpaddrUrl);
- websIpaddrUrl = websHostUrl = NULL;
-}
-
-/******************************************************************************/
-/*
- * Accept a connection
- */
-
-int websAccept(int sid, char *ipaddr, int port, int listenSid)
-{
- webs_t wp;
- int wid;
-
- a_assert(ipaddr && *ipaddr);
- a_assert(sid >= 0);
- a_assert(port >= 0);
-
-/*
- * Allocate a new handle for this accepted connection. This will allocate
- * a webs_t structure in the webs[] list
- */
- if ((wid = websAlloc(sid)) < 0) {
- return -1;
- }
- wp = webs[wid];
- a_assert(wp);
- wp->listenSid = listenSid;
-
- ascToUni(wp->ipaddr, ipaddr, min(sizeof(wp->ipaddr), strlen(ipaddr) + 1));
-
-/*
- * Check if this is a request from a browser on this system. This is useful
- * to know for permitting administrative operations only for local access
- */
- if (gstrcmp(wp->ipaddr, T("127.0.0.1")) == 0 ||
- gstrcmp(wp->ipaddr, websIpaddr) == 0 ||
- gstrcmp(wp->ipaddr, websHost) == 0) {
- wp->flags |= WEBS_LOCAL_REQUEST;
- }
-
-/*
- * Arrange for websSocketEvent to be called when read data is available
- */
- socketCreateHandler(sid, SOCKET_READABLE, websSocketEvent, wp);
-
-/*
- * Arrange for a timeout to kill hung requests
- */
- wp->timeout = emfSchedCallback(WEBS_TIMEOUT, websTimeout, (void *) wp);
- trace(8, T("webs: accept request\n"));
- return 0;
-}
-
-/******************************************************************************/
-/*
- * The webs socket handler. Called in response to I/O. We just pass control
- * to the relevant read or write handler. A pointer to the webs structure
- * is passed as an (void*) in iwp.
- */
-
-static void websSocketEvent(int sid, int mask, void* iwp)
-{
- webs_t wp;
-
- wp = (webs_t) iwp;
- a_assert(wp);
-
- if (! websValid(wp)) {
- return;
- }
-
- if (mask & SOCKET_READABLE) {
- websReadEvent(wp);
- }
- if (mask & SOCKET_WRITABLE) {
- if (websValid(wp) && wp->writeSocket) {
- (*wp->writeSocket)(wp);
- }
- }
-}
-
-/******************************************************************************/
-/*
- * The webs read handler. This is the primary read event loop. It uses a
- * state machine to track progress while parsing the HTTP request.
- * Note: we never block as the socket is always in non-blocking mode.
- */
-
-void websReadEvent(webs_t wp)
-{
- char_t *text;
- int rc, nbytes, len, done, fd;
-
- a_assert(wp);
- a_assert(websValid(wp));
-
- websSetTimeMark(wp);
-
-/*
- * Read as many lines as possible. socketGets is called to read the header
- * and socketRead is called to read posted data.
- */
- text = NULL;
- fd = -1;
- for (done = 0; !done; ) {
- if (text) {
- bfree(B_L, text);
- text = NULL;
- }
-
-/*
- * Get more input into "text". Returns 0, if more data is needed
- * to continue, -1 if finished with the request, or 1 if all
- * required data is available for current state.
- */
- while ((rc = websGetInput(wp, &text, &nbytes)) == 0) {
- ;
- }
-
-/*
- * websGetInput returns -1 if it finishes with the request
- */
- if (rc < 0) {
- break;
- }
-
-/*
- * This is the state machine for the web server.
- */
- switch(wp->state) {
- case WEBS_BEGIN:
-/*
- * Parse the first line of the Http header
- */
- if (websParseFirst(wp, text) < 0) {
- done++;
- break;
- }
- wp->state = WEBS_HEADER;
- break;
-
- case WEBS_HEADER:
-/*
- * Store more of the HTTP header. As we are doing line reads, we
- * need to separate the lines with '\n'
- */
- if (ringqLen(&wp->header) > 0) {
- ringqPutStr(&wp->header, T("\n"));
- }
- ringqPutStr(&wp->header, text);
- break;
-
- case WEBS_POST_CLEN:
-/*
- * POST request with content specified by a content length.
- * If this is a CGI request, write the data to the cgi stdin.
- * socketGets was used to get the data and it strips \n's so
- * add them back in here.
- */
-#ifndef __NO_CGI_BIN
- if (wp->flags & WEBS_CGI_REQUEST) {
- if (fd == -1) {
- fd = gopen(wp->cgiStdin, O_CREAT | O_WRONLY | O_BINARY,
- 0666);
- }
- gwrite(fd, text, gstrlen(text));
- /*
- * NOTE that the above comment is wrong -- if the content length
- * is set, websGetInput() does NOT use socketGets(), it uses
- * socketRead(), so the line below that adds an additional newline
- * is destructive.
- */
- /*gwrite(fd, T("\n"), sizeof(char_t));*/
-/*
- * Line removed as per BUG02488
- *
- nbytes += 1;
- */
- } else
-#endif
- if (wp->query) {
- if (wp->query[0] && !(wp->flags & WEBS_POST_DATA)) {
-/*
- * Special case where the POST request also had query data
- * specified in the URL, ie. url?query_data. In this case
- * the URL query data is separated by a '&' from the posted
- * query data.
- */
- len = gstrlen(wp->query);
- wp->query = brealloc(B_L, wp->query, (len + gstrlen(text) +
- 2) * sizeof(char_t));
- wp->query[len++] = '&';
- gstrcpy(&wp->query[len], text);
-
- } else {
-/*
- * The existing query data came from the POST request so just
- * append it.
- */
- if (text != NULL)
- {
- len = gstrlen(wp->query);
- wp->query = brealloc(B_L, wp->query, (len + gstrlen(text) +
- 1) * sizeof(char_t));
- if (wp->query) {
- gstrcpy(&wp->query[len], text);
- }
- }
- }
-
- } else {
- wp->query = bstrdup(B_L, text);
- }
-/*
- * Calculate how much more post data is to be read.
- */
- wp->flags |= WEBS_POST_DATA;
- wp->clen -= nbytes;
- if (wp->clen > 0) {
- if (nbytes > 0) {
- break;
- }
- done++;
- break;
- }
-/*
- * No more data so process the request, (but be sure to close
- * the input file first!).
- */
- if (fd != -1) {
- gclose (fd);
- fd = -1;
- }
- websUrlHandlerRequest(wp);
- done++;
- break;
-
- case WEBS_POST:
-/*
- * POST without content-length specification
- * If this is a CGI request, write the data to the cgi stdin.
- * socketGets was used to get the data and it strips \n's so
- * add them back in here.
- */
-
-#ifndef __NO_CGI_BIN
- if (wp->flags & WEBS_CGI_REQUEST) {
- if (fd == -1) {
- fd = gopen(wp->cgiStdin, O_CREAT | O_WRONLY | O_BINARY,
- 0666);
- }
- gwrite(fd, text, gstrlen(text));
- gwrite(fd, T("\n"), sizeof(char_t));
- } else
-#endif
- if (wp->query && *wp->query && !(wp->flags & WEBS_POST_DATA)) {
- len = gstrlen(wp->query);
- wp->query = brealloc(B_L, wp->query, (len + gstrlen(text) +
- 2) * sizeof(char_t));
- if (wp->query) {
- wp->query[len++] = '&';
- gstrcpy(&wp->query[len], text);
- }
-
- } else {
- wp->query = bstrdup(B_L, text);
- }
- wp->flags |= WEBS_POST_DATA;
- done++;
- break;
-
- default:
- websError(wp, 404, T("Bad state"));
- done++;
- break;
- }
- }
-
- if (fd != -1) {
- fd = gclose (fd);
- }
-
- if (text) {
- bfree(B_L, text);
- }
-}
-
-/******************************************************************************/
-/*
- * Get input from the browser. Return TRUE (!0) if the request has been
- * handled. Return -1 on errors or if the request has been processed,
- * 1 if input read, and 0 to instruct the caller to call again for more input.
- *
- * Note: socketRead will Return the number of bytes read if successful. This
- * may be less than the requested "bufsize" and may be zero. It returns -1 for
- * errors. It returns 0 for EOF. Otherwise it returns the number of bytes
- * read. Since this may be zero, callers should use socketEof() to
- * distinguish between this and EOF.
- */
-
-static int websGetInput(webs_t wp, char_t **ptext, int *pnbytes)
-{
- char_t *text;
- char buf[WEBS_SOCKET_BUFSIZ+1];
- int nbytes, len, clen;
-
- a_assert(websValid(wp));
- a_assert(ptext);
- a_assert(pnbytes);
-
- *ptext = text = NULL;
- *pnbytes = 0;
-
-/*
- * If this request is a POST with a content length, we know the number
- * of bytes to read so we use socketRead().
- */
- if (wp->state == WEBS_POST_CLEN) {
- len = (wp->clen > WEBS_SOCKET_BUFSIZ) ? WEBS_SOCKET_BUFSIZ : wp->clen;
- } else {
- len = 0;
- }
-
- if (len > 0) {
-
-#ifdef WEBS_SSL_SUPPORT
- if (wp->flags & WEBS_SECURE) {
- nbytes = websSSLRead(wp->wsp, buf, len);
- } else {
- nbytes = socketRead(wp->sid, buf, len);
- }
-#else
- nbytes = socketRead(wp->sid, buf, len);
-#endif
- if (nbytes < 0) { /* Error */
- websDone(wp, 0);
- return -1;
-
- } else if (nbytes == 0) { /* EOF or No data available */
- return -1;
-
- } else { /* Valid data */
-/*
- * Convert to UNICODE if necessary. First be sure the string
- * is NULL terminated.
- */
- buf[nbytes] = '\0';
- if ((text = ballocAscToUni(buf, nbytes)) == NULL) {
- websError(wp, 503, T("Insufficient memory"));
- return -1;
- }
- }
-
- } else {
-#ifdef WEBS_SSL_SUPPORT
- if (wp->flags & WEBS_SECURE) {
- nbytes = websSSLGets(wp->wsp, &text);
- } else {
- nbytes = socketGets(wp->sid, &text);
- }
-#else
- nbytes = socketGets(wp->sid, &text);
-#endif
-
- if (nbytes < 0) {
- int eof;
-/*
- * Error, EOF or incomplete
- */
-#ifdef WEBS_SSL_SUPPORT
- if (wp->flags & WEBS_SECURE) {
-/*
- * If state is WEBS_BEGIN and the request is secure, a -1 will
- * usually indicate SSL negotiation
- */
- if (wp->state == WEBS_BEGIN) {
- eof = 1;
- } else {
- eof = websSSLEof(wp->wsp);
- }
- } else {
- eof = socketEof(wp->sid);
- }
-#else
- eof = socketEof(wp->sid);
-#endif
-
- if (eof) {
-/*
- * If this is a post request without content length, process
- * the request as we now have all the data. Otherwise just
- * close the connection.
- */
- if (wp->state == WEBS_POST) {
- websUrlHandlerRequest(wp);
- } else {
- websDone(wp, 0);
- }
- } else {
-/*
- * If an error occurred and it wasn't an eof, close the connection
- */
-#ifdef HP_FIX
- websDone(wp, 0);
-#endif /*HP_FIX*/
-
- }
-/*
- * If state is WEBS_HEADER and the ringq is empty, then this is a
- * simple request with no additional header fields to process and
- * no empty line terminator.
- */
-/*
- * NOTE: this fix for earlier versions of browsers is troublesome
- * because if we don't receive the entire header in the first pass
- * this code assumes we were only expecting a one line header, which
- * is not necessarily the case. So we weren't processing the whole
- * header and weren't fufilling requests properly.
- */
-#ifdef UNUSED
- if (wp->state == WEBS_HEADER && ringqLen(&wp->header) <= 0) {
- websParseRequest(wp);
- websUrlHandlerRequest(wp);
- }
-#endif
- return -1;
-
- } else if (nbytes == 0) {
- if (wp->state == WEBS_HEADER) {
-/*
- * Valid empty line, now finished with header
- */
- websParseRequest(wp);
- if (wp->flags & WEBS_POST_REQUEST) {
- if (wp->flags & WEBS_CLEN) {
- wp->state = WEBS_POST_CLEN;
- clen = wp->clen;
- } else {
- wp->state = WEBS_POST;
- clen = 1;
- }
- if (clen > 0) {
-/*
- * Return 0 to get more data.
- */
- return 0;
- }
- return 1;
- }
-/*
- * We've read the header so go and handle the request
- */
- websUrlHandlerRequest(wp);
- }
- return -1;
- }
- }
- a_assert(text);
- a_assert(nbytes > 0);
- *ptext = text;
- *pnbytes = nbytes;
- return 1;
-}
-
-/******************************************************************************/
-/*
- * Parse the first line of a HTTP request
- */
-
-static int websParseFirst(webs_t wp, char_t *text)
-{
- char_t *op, *proto, *protoVer, *url, *host, *query, *path, *port, *ext;
- char_t *buf;
- int testPort;
-
- a_assert(websValid(wp));
- a_assert(text && *text);
-
-/*
- * Determine the request type: GET, HEAD or POST
- */
- op = gstrtok(text, T(" \t"));
- if (op == NULL || *op == '\0') {
- websError(wp, 400, T("Bad HTTP request"));
- return -1;
- }
- if (gstrcmp(op, T("GET")) != 0) {
- if (gstrcmp(op, T("POST")) == 0) {
- wp->flags |= WEBS_POST_REQUEST;
- } else if (gstrcmp(op, T("HEAD")) == 0) {
- wp->flags |= WEBS_HEAD_REQUEST;
- } else {
- websError(wp, 400, T("Bad request type"));
- return -1;
- }
- }
-
-/*
- * Store result in the form (CGI) variable store
- */
- websSetVar(wp, T("REQUEST_METHOD"), op);
-
- url = gstrtok(NULL, T(" \t\n"));
- if (url == NULL || *url == '\0') {
- websError(wp, 400, T("Bad HTTP request"));
- return -1;
- }
- protoVer = gstrtok(NULL, T(" \t\n"));
-
-/*
- * Parse the URL and store all the various URL components. websUrlParse
- * returns an allocated buffer in buf which we must free. We support both
- * proxied and non-proxied requests. Proxied requests will have http://host/
- * at the start of the URL. Non-proxied will just be local path names.
- */
- host = path = port = proto = query = ext = NULL;
- if (websUrlParse(url, &buf, &host, &path, &port, &query, &proto,
- NULL, &ext) < 0) {
- websError(wp, 400, T("Bad URL format"));
- return -1;
- }
-
- wp->url = bstrdup(B_L, url);
-
-#ifndef __NO_CGI_BIN
- if (gstrstr(url, CGI_BIN) != NULL) {
- wp->flags |= WEBS_CGI_REQUEST;
- if (wp->flags & WEBS_POST_REQUEST) {
- wp->cgiStdin = websGetCgiCommName();
- }
- }
-#endif
-
- wp->query = bstrdup(B_L, query);
- wp->host = bstrdup(B_L, host);
- wp->path = bstrdup(B_L, path);
- wp->protocol = bstrdup(B_L, proto);
- wp->protoVersion = bstrdup(B_L, protoVer);
-
- if ((testPort = socketGetPort(wp->listenSid)) >= 0) {
- wp->port = testPort;
- } else {
- wp->port = gatoi(port);
- }
-
- if (gstrcmp(ext, T(".asp")) == 0) {
- wp->flags |= WEBS_ASP;
- }
-
- if (gstrcmp(ext, T(".spy")) == 0) {
- wp->flags |= WEBS_SPY;
- }
- bfree(B_L, buf);
-
- websUrlType(url, wp->type, TSZ(wp->type));
-
-#ifdef WEBS_PROXY_SUPPORT
-/*
- * Determine if this is a request for local webs data. If it is not a proxied
- * request from the browser, we won't see the "http://" or the system name, so
- * we assume it must be talking to us directly for local webs data.
- * Note: not fully implemented yet.
- */
- if (gstrstr(wp->url, T("http://")) == NULL ||
- ((gstrcmp(wp->host, T("localhost")) == 0 ||
- gstrcmp(wp->host, websHost) == 0) && (wp->port == websPort))) {
- wp->flags |= WEBS_LOCAL_PAGE;
- if (gstrcmp(wp->path, T("/")) == 0) {
- wp->flags |= WEBS_HOME_PAGE;
- }
- }
-#endif
-
- ringqFlush(&wp->header);
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Parse a full request
- */
-
-#define isgoodchar(s) (gisalnum((s)) || ((s) == '/') || ((s) == '_') || \
- ((s) == '.') || ((s) == '-') )
-
-static void websParseRequest(webs_t wp)
-{
- char_t *authType, *upperKey, *cp, *browser, *lp, *key, *value;
-
- a_assert(websValid(wp));
-
-/*
- * Define default CGI values
- */
- websSetVar(wp, T("HTTP_AUTHORIZATION"), T(""));
-
-/*
- * Parse the header and create the Http header keyword variables
- * We rewrite the header as we go for non-local requests. NOTE: this
- * modifies the header string directly and tokenizes each line with '\0'.
- */
- browser = NULL;
- for (lp = (char_t*) wp->header.servp; lp && *lp; ) {
- cp = lp;
- if ((lp = gstrchr(lp, '\n')) != NULL) {
- lp++;
- }
-
- if ((key = gstrtok(cp, T(": \t\n"))) == NULL) {
- continue;
- }
-
- if ((value = gstrtok(NULL, T("\n"))) == NULL) {
- value = T("");
- }
-
- while (gisspace(*value)) {
- value++;
- }
- webs_strlower(key);
-
-/*
- * Create a variable (CGI) for each line in the header
- */
- fmtAlloc(&upperKey, (gstrlen(key) + 6), T("HTTP_%s"), key);
- for (cp = upperKey; *cp; cp++) {
- if (*cp == '-')
- *cp = '_';
- }
- webs_strupper(upperKey);
- websSetVar(wp, upperKey, value);
- bfree(B_L, upperKey);
-
-/*
- * Track the requesting agent (browser) type
- */
- if (gstrcmp(key, T("user-agent")) == 0) {
- wp->userAgent = bstrdup(B_L, value);
-
-/*
- * Parse the user authorization. ie. password
- */
- } else if (gstricmp(key, T("authorization")) == 0) {
-/*
- * Determine the type of Authorization Request
- */
- authType = bstrdup (B_L, value);
- a_assert (authType);
-/*
- * Truncate authType at the next non-alpha character
- */
- cp = authType;
- while (gisalpha(*cp)) {
- cp++;
- }
- *cp = '\0';
-
- wp->authType = bstrdup(B_L, authType);
- bfree(B_L, authType);
-
- if (gstricmp(wp->authType, T("basic")) == 0) {
- char_t userAuth[FNAMESIZE];
-/*
- * The incoming value is username:password (Basic authentication)
- */
- if ((cp = gstrchr(value, ' ')) != NULL) {
- *cp = '\0';
- /*
- * bugfix 5/24/02 -- we were leaking the memory pointed to by
- * wp->authType that was allocated just before the if()
- * statement that we are currently in. Thanks to Simon Byholm.
- */
- bfree(B_L, wp->authType);
- wp->authType = bstrdup(B_L, value);
- websDecode64(userAuth, ++cp, sizeof(userAuth));
- } else {
- websDecode64(userAuth, value, sizeof(userAuth));
- }
-/*
- * Split userAuth into userid and password
- */
- if ((cp = gstrchr(userAuth, ':')) != NULL) {
- *cp++ = '\0';
- }
- if (cp) {
- wp->userName = bstrdup(B_L, userAuth);
- wp->password = bstrdup(B_L, cp);
- } else {
- wp->userName = bstrdup(B_L, T(""));
- wp->password = bstrdup(B_L, T(""));
- }
-/*
- * Set the flags to indicate digest authentication
- */
- wp->flags |= WEBS_AUTH_BASIC;
- } else {
-#ifdef DIGEST_ACCESS_SUPPORT
-/*
- * The incoming value is slightly more complicated (Digest)
- */
- char_t *np; /* pointer to end of tag name */
- char_t tp; /* temporary character holding space */
- char_t *vp; /* pointer to value */
- char_t *npv; /* pointer to end of value, "next" pointer */
- char_t tpv; /* temporary character holding space */
-/*
- * Set the flags to indicate digest authentication
- */
- wp->flags |= WEBS_AUTH_DIGEST;
-/*
- * Move cp to Next word beyond "Digest",
- * vp to first char after '='.
- */
- cp = value;
- while (isgoodchar(*cp)) {
- cp++;
- }
- while (!isgoodchar(*cp)) {
- cp++;
- }
-
-/*
- * Find beginning of value
- */
- vp = gstrchr(cp, '=');
- while (vp) {
-/*
- * Zero-terminate tag name
- */
- np = cp;
- while (isgoodchar(*np)) {
- np++;
- }
- tp = *np;
- *np = 0;
-/*
- * Advance value pointer to first legit character
- */
- vp++;
- while (!isgoodchar(*vp)) {
- vp++;
- }
-/*
- * Zero-terminate value
- */
- npv = vp;
- while (isgoodchar(*npv)) {
- npv++;
- }
- tpv = *npv;
- *npv = 0;
-/*
- * Extract the fields
- */
- if (gstricmp(cp, T("username")) == 0) {
- wp->userName = bstrdup(B_L, vp);
- } else if (gstricmp(cp, T("response")) == 0) {
- wp->digest = bstrdup(B_L, vp);
- } else if (gstricmp(cp, T("opaque")) == 0) {
- wp->opaque = bstrdup(B_L, vp);
- } else if (gstricmp(cp, T("uri")) == 0) {
- wp->uri = bstrdup(B_L, vp);
- } else if (gstricmp(cp, T("realm")) == 0) {
- wp->realm = bstrdup(B_L, vp);
- } else if (gstricmp(cp, T("nonce")) == 0) {
- wp->nonce = bstrdup(B_L, vp);
- } else if (gstricmp(cp, T("nc")) == 0) {
- wp->nc = bstrdup(B_L, vp);
- } else if (gstricmp(cp, T("cnonce")) == 0) {
- wp->cnonce = bstrdup(B_L, vp);
- } else if (gstricmp(cp, T("qop")) == 0) {
- wp->qop = bstrdup(B_L, vp);
- }
-/*
- * Restore tag name and value zero-terminations
- */
- *np = tp;
- *npv = tpv;
-/*
- * Advance tag name and value pointers
- */
- cp = npv;
- while (*cp && isgoodchar(*cp)) {
- cp++;
- }
- while (*cp && !isgoodchar(*cp)) {
- cp++;
- }
-
- if (*cp) {
- vp = gstrchr(cp, '=');
- } else {
- vp = NULL;
- }
- }
-#endif /* DIGEST_ACCESS_SUPPORT */
- } /* if (gstrcmp(wp->authType)) */
-/*
- * Parse the content length
- */
- } else if (gstrcmp(key, T("content-length")) == 0) {
- /*
- * 11 Oct 02 BgP -- The server would crash if an attacker sent a POST
- * message with a content-length value <= 0. We assume that anyone
- * sending this is malicious, and the POST is read from the socket,
- * but it is ignored, and the socket is closed.
- */
- wp->clen = gatoi(value);
- if (wp->clen > 0)
- {
- wp->flags |= WEBS_CLEN;
- websSetVar(wp, T("CONTENT_LENGTH"), value);
- }
- else
- {
- wp->clen = 0;
- }
-
-/*
- * Parse the content type
- */
- } else if (gstrcmp(key, T("content-type")) == 0) {
- websSetVar(wp, T("CONTENT_TYPE"), value);
-
-#ifdef WEBS_KEEP_ALIVE_SUPPORT
- } else if (gstrcmp(key, T("connection")) == 0) {
- webs_strlower(value);
- if (gstrcmp(value, T("keep-alive")) == 0) {
- wp->flags |= WEBS_KEEP_ALIVE;
- }
-#endif
-
-#ifdef WEBS_PROXY_SUPPORT
-/*
- * This may be useful if you wish to keep a local cache of web pages
- * for proxied requests.
- */
- } else if (gstrcmp(key, T("pragma")) == 0) {
- char_t tmp[256];
- gstrncpy(tmp, value, TSZ(tmp));
- webs_strlower(tmp);
- if (gstrstr(tmp, T("no-cache"))) {
- wp->flags |= WEBS_DONT_USE_CACHE;
- }
-#endif /* WEBS_PROXY_SUPPORT */
-
-/*
- * Store the cookie
- */
- } else if (gstrcmp(key, T("cookie")) == 0) {
- wp->flags |= WEBS_COOKIE;
- wp->cookie = bstrdup(B_L, value);
-
-#ifdef WEBS_IF_MODIFIED_SUPPORT
-/*
- * See if the local page has been modified since the browser last
- * requested this document. If not, just return a 302
- */
- } else if (gstrcmp(key, T("if-modified-since")) == 0) {
- char_t *cmd;
- time_t tip = 0;
-
- if ((cp = gstrchr(value, ';')) != NULL) {
- *cp = '\0';
- }
-
- fmtAlloc(&cmd, 64, T("%s"), value);
-
- if ((wp->since = dateParse(tip, cmd)) != 0) {
- wp->flags |= WEBS_IF_MODIFIED;
- }
-
- bfreeSafe(B_L, cmd);
-#endif /* WEBS_IF_MODIFIED_SUPPORT */
- }
- }
-}
-
-/******************************************************************************/
-/*
- * Set the variable (CGI) environment for this request. Create variables
- * for all standard CGI variables. Also decode the query string and create
- * a variable for each name=value pair.
- */
-
-void websSetEnv(webs_t wp)
-{
- char_t portBuf[8];
- char_t *keyword, *value, *valCheck, *valNew;
-
- a_assert(websValid(wp));
-
- websSetVar(wp, T("QUERY_STRING"), wp->query);
- websSetVar(wp, T("GATEWAY_INTERFACE"), T("CGI/1.1"));
- websSetVar(wp, T("SERVER_HOST"), websHost);
- websSetVar(wp, T("SERVER_NAME"), websHost);
- websSetVar(wp, T("SERVER_URL"), websHostUrl);
- websSetVar(wp, T("REMOTE_HOST"), wp->ipaddr);
- websSetVar(wp, T("REMOTE_ADDR"), wp->ipaddr);
- websSetVar(wp, T("PATH_INFO"), wp->path);
- webs_stritoa(websPort, portBuf, sizeof(portBuf));
- websSetVar(wp, T("SERVER_PORT"), portBuf);
- websSetVar(wp, T("SERVER_ADDR"), websIpaddr);
- fmtAlloc(&value, FNAMESIZE, T("%s/%s"), WEBS_NAME, WEBS_VERSION);
- websSetVar(wp, T("SERVER_SOFTWARE"), value);
- bfreeSafe(B_L, value);
- websSetVar(wp, T("SERVER_PROTOCOL"), wp->protoVersion);
-
-/*
- * Decode and create an environment query variable for each query keyword.
- * We split into pairs at each '&', then split pairs at the '='.
- * Note: we rely on wp->decodedQuery preserving the decoded values in the
- * symbol table.
- */
- wp->decodedQuery = bstrdup(B_L, wp->query);
- keyword = gstrtok(wp->decodedQuery, T("&"));
- while (keyword != NULL) {
- if ((value = gstrchr(keyword, '=')) != NULL) {
- *value++ = '\0';
- websDecodeUrl(keyword, keyword, gstrlen(keyword));
- websDecodeUrl(value, value, gstrlen(value));
- } else {
- value = T("");
- }
-
- if (*keyword) {
-/*
- * If keyword has already been set, append the new value to what has
- * been stored.
- */
- if ((valCheck = websGetVar(wp, keyword, NULL)) != 0) {
- fmtAlloc(&valNew, 256, T("%s %s"), valCheck, value);
- websSetVar(wp, keyword, valNew);
- bfreeSafe(B_L, valNew);
- } else {
- websSetVar(wp, keyword, value);
- }
- }
- keyword = gstrtok(NULL, T("&"));
- }
-
-#ifdef EMF
-/*
- * Add GoAhead Embedded Management Framework defines
- */
- websSetEmfEnvironment(wp);
-#endif
-}
-
-/******************************************************************************/
-/*
- * Define a webs (CGI) variable for this connection. Also create in relevant
- * scripting engines. Note: the incoming value may be volatile.
- */
-
-void websSetVar(webs_t wp, char_t *var, char_t *value)
-{
- value_t v;
-
- a_assert(websValid(wp));
-
-/*
- * value_instring will allocate the string if required.
- */
- if (value) {
- v = valueString(value, VALUE_ALLOCATE);
- } else {
- v = valueString(T(""), VALUE_ALLOCATE);
- }
- symEnter(wp->cgiVars, var, v, 0);
-}
-
-/******************************************************************************/
-/*
- * Return TRUE if a webs variable exists for this connection.
- */
-
-int websTestVar(webs_t wp, char_t *var)
-{
- sym_t *sp;
-
- a_assert(websValid(wp));
-
- if (var == NULL || *var == '\0') {
- return 0;
- }
-
- if ((sp = symLookup(wp->cgiVars, var)) == NULL) {
- return 0;
- }
- return 1;
-}
-
-/******************************************************************************/
-/*
- * Get a webs variable but return a default value if string not found.
- * Note, defaultGetValue can be NULL to permit testing existence.
- */
-
-char_t *websGetVar(webs_t wp, char_t *var, char_t *defaultGetValue)
-{
- sym_t *sp;
-
- a_assert(websValid(wp));
- a_assert(var && *var);
-
- if ((sp = symLookup(wp->cgiVars, var)) != NULL) {
- a_assert(sp->content.type == string);
- if (sp->content.value.string) {
- return sp->content.value.string;
- } else {
- return T("");
- }
- }
- return defaultGetValue;
-}
-
-/******************************************************************************/
-/*
- * Return TRUE if a webs variable is set to a given value
- */
-
-int websCompareVar(webs_t wp, char_t *var, char_t *value)
-{
- a_assert(websValid(wp));
- a_assert(var && *var);
-
- if (gstrcmp(value, websGetVar(wp, var, T(" __UNDEF__ "))) == 0) {
- return 1;
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Cancel the request timeout. Note may be called multiple times.
- */
-
-void websTimeoutCancel(webs_t wp)
-{
- a_assert(websValid(wp));
-
- if (wp->timeout >= 0) {
- emfUnschedCallback(wp->timeout);
- wp->timeout = -1;
- }
-}
-
-/******************************************************************************/
-/*
- * Output a HTTP response back to the browser. If redirect is set to a
- * URL, the browser will be sent to this location.
- */
-
-void websResponse(webs_t wp, int code, char_t *message, char_t *redirect)
-{
- char_t *date;
-
- a_assert(websValid(wp));
-
-/*
- * IE3.0 needs no Keep Alive for some return codes.
- */
- wp->flags &= ~WEBS_KEEP_ALIVE;
-
-/*
- * Only output the header if a header has not already been output.
- */
- if ( !(wp->flags & WEBS_HEADER_DONE)) {
- wp->flags |= WEBS_HEADER_DONE;
-/*
- * Redirect behaves much better when sent with HTTP/1.0
- */
- if (redirect != NULL) {
- websWrite(wp, T("HTTP/1.0 %d %s\r\n"), code, websErrorMsg(code));
- } else {
- websWrite(wp, T("HTTP/1.1 %d %s\r\n"), code, websErrorMsg(code));
- }
-
-/*
- * By license terms the following line of code must not be modified.
- */
- websWrite(wp, T("Server: %s\r\n"), WEBS_NAME);
-
-/*
- * Timestamp/Date is usually the next to go
- */
- if ((date = websGetDateString(NULL)) != NULL) {
- websWrite(wp, T("Date: %s\r\n"), date);
- bfree(B_L, date);
- }
-/*
- * If authentication is required, send the auth header info
- */
- if (code == 401) {
- if (!(wp->flags & WEBS_AUTH_DIGEST)) {
- websWrite(wp, T("WWW-Authenticate: Basic realm=\"%s\"\r\n"),
- websGetRealm());
-#ifdef DIGEST_ACCESS_SUPPORT
- } else {
- char_t *nonce, *opaque;
-
- /* $$$ before... (note commas instead of semicolons...)
- nonce = websCalcNonce(wp),
- opaque = websCalcOpaque(wp),
- $$$ after */
- nonce = websCalcNonce(wp);
- opaque = websCalcOpaque(wp);
- /* ...$$$ end */
- websWrite(wp,
- T("WWW-Authenticate: Digest realm=\"%s\", domain=\"%s\",")
- T("qop=\"%s\", nonce=\"%s\", opaque=\"%s\",")
- T("algorithm=\"%s\", stale=\"%s\"\r\n"),
- websGetRealm(),
- websGetHostUrl(),
- T("auth"),
- nonce,
- opaque, T("MD5"), T("FALSE"));
- bfree(B_L, nonce);
- bfree(B_L, opaque);
-#endif
- }
- }
-
- if (wp->flags & WEBS_KEEP_ALIVE) {
- websWrite(wp, T("Connection: keep-alive\r\n"));
- }
-
- websWrite(wp, T("Pragma: no-cache\r\nCache-Control: no-cache\r\n"));
- websWrite(wp, T("Content-Type: text/html\r\n"));
-/*
- * We don't do a string length here as the message may be multi-line.
- * Ie. <CR><LF> will count as only one and we will have a content-length
- * that is too short.
- *
- * websWrite(wp, T("Content-Length: %s\r\n"), message);
- */
- if (redirect) {
- websWrite(wp, T("Location: %s\r\n"), redirect);
- }
- websWrite(wp, T("\r\n"));
- }
-
-/*
- * If the browser didn't do a HEAD only request, send the message as well.
- */
- if ((wp->flags & WEBS_HEAD_REQUEST) == 0 && message && *message) {
- websWrite(wp, T("%s\r\n"), message);
- }
- websDone(wp, code);
-}
-
-/******************************************************************************/
-/*
- * Redirect the user to another webs page
- */
-
-void websRedirect(webs_t wp, char_t *url)
-{
- char_t *msgbuf, *urlbuf, *redirectFmt;
-
- a_assert(websValid(wp));
- a_assert(url);
-
- websStats.redirects++;
- msgbuf = urlbuf = NULL;
-
-/*
- * Some browsers require a http://host qualified URL for redirection
- */
- if (gstrstr(url, T("http://")) == NULL) {
- if (*url == '/') {
- url++;
- }
-
- redirectFmt = T("http://%s/%s");
-
-#ifdef WEBS_SSL_SUPPORT
- if (wp->flags & WEBS_SECURE) {
- redirectFmt = T("https://%s/%s");
- }
-#endif
-
- fmtAlloc(&urlbuf, WEBS_MAX_URL + 80, redirectFmt,
- websGetVar(wp, T("HTTP_HOST"), websHostUrl), url);
- url = urlbuf;
- }
-
-/*
- * Add human readable message for completeness. Should not be required.
- */
- fmtAlloc(&msgbuf, WEBS_MAX_URL + 80,
- T("<html><head></head><body>\r\n\
- This document has moved to a new <a href=\"%s\">location</a>.\r\n\
- Please update your documents to reflect the new location.\r\n\
- </body></html>\r\n"), url);
-
- websResponse(wp, 302, msgbuf, url);
-
- bfreeSafe(B_L, msgbuf);
- bfreeSafe(B_L, urlbuf);
-}
-
-
-/*
- * websSafeUrl -- utility function to clean up URLs that will be printed by
- * the websError() function, below. To prevent problems with the 'cross-site
- * scripting exploit', where attackers request an URL containing embedded
- * JavaScript code, we replace all '<' and '>' characters with HTML entities
- * so that the user's browser will not interpret the URL as JavaScript.
- */
-
-#define kLt '<'
-#define kLessThan T("<")
-#define kGt '>'
-#define kGreaterThan T(">")
-
-
-
-
-static int charCount(const char_t* str, char_t ch)
-{
- int count = 0;
- char_t* p = (char_t*) str;
-
- if (NULL == str)
- {
- return 0;
- }
-
- while (1)
- {
- p = gstrchr(p, ch);
- if (NULL == p)
- {
- break;
- }
- /*
- * increment the count, and begin looking at the next character
- */
- ++count;
- ++p;
- }
- return count;
-}
-
-
-
-static char_t* websSafeUrl(const char_t* url)
-{
-
- int ltCount = charCount(url, kLt);
- int gtCount = charCount(url, kGt);
- int safeLen = 0;
- char_t* safeUrl = NULL;
- char_t* src = NULL;
- char_t* dest = NULL;
-
- if (NULL != url)
- {
- safeLen = gstrlen(url);
- if (ltCount == 0 && gtCount == 0)
- {
- safeUrl = bstrdup(B_L, (char_t*) url);
- }
- else
- {
- safeLen += (ltCount * 4);
- safeLen += (gtCount * 4);
-
- safeUrl = balloc(B_L, safeLen);
- if (safeUrl != NULL)
- {
- src = (char_t*) url;
- dest = safeUrl;
- while (*src)
- {
- if (*src == kLt)
- {
- gstrcpy(dest, kLessThan);
- dest += gstrlen(kLessThan);
- }
- else if (*src == kGt)
- {
- gstrcpy(dest, kGreaterThan);
- dest += gstrlen(kGreaterThan);
- }
- else
- {
- *dest++ = *src;
- }
- ++src;
- }
- /* don't forget to terminate the string...*/
- *dest = '\0';
- }
- }
- }
- return safeUrl;
-}
-
-
-/******************************************************************************/
-/*
- * Output an error message and cleanup
- */
-
-#ifdef qRichErrorPage
-extern int dmfRichError(webs_t wp, int code, char_t* userMsg);
-#endif
-void websError(webs_t wp, int code, char_t *fmt, ...)
-{
- va_list args;
- char_t *msg, *userMsg, *buf;
- char_t* safeUrl = NULL;
- char_t* safeMsg = NULL;
-#ifdef qRichErrorPage
- static int reEntry = 0;
- int errorOk;
-#endif
-
- a_assert(websValid(wp));
- a_assert(fmt);
-
- websStats.errors++;
-
- /* remove any dangerous characters in the url, and replace the string in the
- * wp structure. The webs_t cleanup code will free this memory for us.
- */
- safeUrl = websSafeUrl(wp->url);
- bfreeSafe(B_L, wp->url);
- wp->url = safeUrl;
-
- va_start(args, fmt);
- userMsg = NULL;
- fmtValloc(&userMsg, WEBS_BUFSIZE, fmt, args);
- va_end(args);
- safeMsg = websSafeUrl(userMsg);
- bfreeSafe(B_L, userMsg);
- userMsg = safeMsg;
- safeMsg = NULL;
-
-
-
-#ifdef qRichErrorPage
- if (!reEntry)
- {
- /*
- * The dmfRichError function that we're about to call may very well call
- * websError() as part of its work. If that happens, we do NOT want to
- * get into a never-ending recursive call chain. When we get back here
- * in a call from inside dmfRichError(), we check to see if we're
- * already trying to call dmfRichError. If we are, we just revert to the
- * old non-rich behavior and display a black on white error page.
- */
-
- reEntry = 1;
- errorOk = dmfRichError(wp, code, userMsg);
- reEntry = 0;
- if (errorOk)
- {
- bfreeSafe(B_L, userMsg);
- return;
- }
- /* ...else we need to fall through and execute the simple error page. */
- }
- /* implicit else... */
-#endif
-
- msg = T("<html><head><title>Document Error: %s</title></head>\r\n\
- <body><h2>Access Error: %s</h2>\r\n\
- <p>%s</p></body></html>\r\n");
-/*
- * Ensure we have plenty of room
- */
-
- buf = NULL;
- fmtAlloc(&buf, WEBS_BUFSIZE, msg, websErrorMsg(code),
- websErrorMsg(code), userMsg);
-
- websResponse(wp, code, buf, NULL);
- bfreeSafe(B_L, buf);
- bfreeSafe(B_L, userMsg);
-}
-
-/******************************************************************************/
-/*
- * Return the error message for a given code
- */
-
-/*static char_t *websErrorMsg(int code)*/
-char_t *websErrorMsg(int code)
-{
- websErrorType *ep;
-
- for (ep = websErrors; ep->code; ep++) {
- if (code == ep->code) {
- return ep->msg;
- }
- }
- a_assert(0);
- return T("");
-}
-
-/******************************************************************************/
-/*
- * Do formatted output to the browser. This is the public ASP and form
- * write procedure.
- */
-
-int websWrite(webs_t wp, char_t *fmt, ...)
-{
- va_list vargs;
- char_t *buf;
- int rc;
-
- a_assert(websValid(wp));
-
- va_start(vargs, fmt);
-
- buf = NULL;
- rc = 0;
-
- if (fmtValloc(&buf, WEBS_BUFSIZE, fmt, vargs) >= WEBS_BUFSIZE) {
- trace(0, T("webs: websWrite lost data, buffer overflow\n"));
- }
-
- va_end(vargs);
- a_assert(buf);
- if (buf) {
- rc = websWriteBlock(wp, buf, gstrlen(buf));
- bfree(B_L, buf);
- }
- return rc;
-}
-
-/******************************************************************************/
-/*
- * Write a block of data of length "nChars" to the user's browser. Public
- * write block procedure. If unicode is turned on this function expects
- * buf to be a unicode string and it converts it to ASCII before writing.
- * See websWriteDataNonBlock to always write binary or ASCII data with no
- * unicode conversion. This returns the number of char_t's processed.
- * It spins until nChars are flushed to the socket. For non-blocking
- * behavior, use websWriteDataNonBlock.
- */
-
-int websWriteBlock(webs_t wp, char_t *buf, int nChars)
-{
- int len, done;
- char *asciiBuf, *pBuf;
-
- a_assert(wp);
- a_assert(websValid(wp));
- a_assert(buf);
- a_assert(nChars >= 0);
-
- done = len = 0;
-
-/*
- * ballocUniToAsc will convert Unicode to strings to Ascii. If Unicode is
- * not turned on then ballocUniToAsc will not do the conversion.
- */
- pBuf = asciiBuf = ballocUniToAsc(buf, nChars);
-
- while (nChars > 0) {
-#ifdef WEBS_SSL_SUPPORT
- if (wp->flags & WEBS_SECURE) {
- if ((len = websSSLWrite(wp->wsp, pBuf, nChars)) < 0) {
- bfree(B_L, asciiBuf);
- return -1;
- }
- websSSLFlush(wp->wsp);
- } else {
- if ((len = socketWrite(wp->sid, pBuf, nChars)) < 0) {
- bfree(B_L, asciiBuf);
- return -1;
- }
- socketFlush(wp->sid);
- }
-#else /* ! WEBS_SSL_SUPPORT */
- if ((len = socketWrite(wp->sid, pBuf, nChars)) < 0) {
- bfree(B_L, asciiBuf);
- return -1;
- }
- socketFlush(wp->sid);
-#endif /* WEBS_SSL_SUPPORT */
- nChars -= len;
- pBuf += len;
- done += len;
- }
-
- bfree(B_L, asciiBuf);
- return done;
-}
-
-/******************************************************************************/
-/*
- * Write a block of data of length "nChars" to the user's browser. Same as
- * websWriteBlock except that it expects straight ASCII or binary and does no
- * unicode conversion before writing the data. If the socket cannot hold all
- * the data, it will return the number of bytes flushed to the socket before
- * it would have blocked. This returns the number of chars processed or -1
- * if socketWrite fails.
- */
-
-int websWriteDataNonBlock(webs_t wp, char *buf, int nChars)
-{
- int r;
-
- a_assert(wp);
- a_assert(websValid(wp));
- a_assert(buf);
- a_assert(nChars >= 0);
-
-#ifdef WEBS_SSL_SUPPORT
- if (wp->flags & WEBS_SECURE) {
- r = websSSLWrite(wp->wsp, buf, nChars);
- websSSLFlush(wp->wsp);
- } else {
- r = socketWrite(wp->sid, buf, nChars);
- socketFlush(wp->sid);
- }
-#else
- r = socketWrite(wp->sid, buf, nChars);
- socketFlush(wp->sid);
-#endif
-
- return r;
-}
-
-/******************************************************************************/
-/*
- * Decode a URL (or part thereof). Allows insitu decoding.
- */
-
-void websDecodeUrl(char_t *decoded, char_t *token, int len)
-{
- char_t *ip, *op;
- int num, i, c;
-
- a_assert(decoded);
- a_assert(token);
-
- op = decoded;
- for (ip = token; *ip && len > 0; ip++, op++) {
- if (*ip == '+') {
- *op = ' ';
- } else if (*ip == '%' && gisxdigit(ip[1]) && gisxdigit(ip[2])) {
-
-/*
- * Convert %nn to a single character
- */
- ip++;
- for (i = 0, num = 0; i < 2; i++, ip++) {
- c = tolower(*ip);
- if (c >= 'a' && c <= 'f') {
- num = (num * 16) + 10 + c - 'a';
- } else {
- num = (num * 16) + c - '0';
- }
- }
- *op = (char_t) num;
- ip--;
-
- } else {
- *op = *ip;
- }
- len--;
- }
- *op = '\0';
-}
-
-/******************************************************************************/
-#ifdef WEBS_LOG_SUPPORT
-/*
- * Output a log message
- */
-
-static void websLog(webs_t wp, int code)
-{
- char_t *buf;
- char *abuf;
- int len;
-#define qAnlLog 1
-#if (defined(qAnlLog) && !defined(CE))
- time_t timer;
- char_t* newLine = NULL;
- char_t* timeStr = NULL;
-#endif
- a_assert(websValid(wp));
-
- buf = NULL;
-
-#if (defined(qAnlLog) && !defined(CE))
- time(&timer);
- timeStr = ctime(&timer);
- newLine = gstrchr(timeStr, '\n');
- if (newLine)
- {
- *newLine = '\0';
- }
- fmtAlloc(&buf, WEBS_MAX_URL + 80, T("%s\t%s\t%s\tcode = %d\n"),
- timeStr, wp->ipaddr, wp->url, code);
-#else
- fmtAlloc(&buf, WEBS_MAX_URL + 80, T("%d %s %d %d\n"), time(0),
- wp->url, code, wp->written);
-#endif
- len = gstrlen(buf);
- abuf = ballocUniToAsc(buf, len+1);
- write(websLogFd, abuf, len);
- bfreeSafe(B_L, buf);
- bfreeSafe(B_L, abuf);
-}
-
-#endif /* WEBS_LOG_SUPPORT */
-
-/******************************************************************************/
-/*
- * Request timeout. The timeout triggers if we have not read any data from
- * the users browser in the last WEBS_TIMEOUT period. If we have heard from
- * the browser, simply re-issue the timeout.
- */
-
-void websTimeout(void *arg, int id)
-{
- webs_t wp;
- int delay, tm;
-
- wp = (webs_t) arg;
- a_assert(websValid(wp));
-
- tm = websGetTimeSinceMark(wp) * 1000;
- if (tm >= WEBS_TIMEOUT) {
- websStats.timeouts++;
- emfUnschedCallback(id);
-
-/*
- * Clear the timeout id
- */
- wp->timeout = -1;
- websDone(wp, 404);
- } else {
- delay = WEBS_TIMEOUT - tm;
- a_assert(delay > 0);
- emfReschedCallback(id, delay);
- }
-}
-
-/******************************************************************************/
-/*
- * Called when the request is done.
- */
-
-void websDone(webs_t wp, int code)
-{
- a_assert(websValid(wp));
-
-/*
- * Disable socket handler in case keep alive set.
- */
- socketDeleteHandler(wp->sid);
-
- if (code != 200) {
- wp->flags &= ~WEBS_KEEP_ALIVE;
- }
-
-#ifdef WEBS_PROXY_SUPPORT
- if (! (wp->flags & WEBS_LOCAL_PAGE)) {
- websStats.activeNetRequests--;
- }
-#endif
-
-#ifdef WEBS_LOG_SUPPORT
- if (! (wp->flags & WEBS_REQUEST_DONE)) {
- websLog(wp, code);
- }
-#endif
-
-/*
- * Close any opened document by a handler
- */
- websPageClose(wp);
-
-/*
- * Exit if secure.
- */
-#ifdef WEBS_SSL_SUPPORT
- if (wp->flags & WEBS_SECURE) {
- websTimeoutCancel(wp);
- websSSLFlush(wp->wsp);
- socketCloseConnection(wp->sid);
- websFree(wp);
- return;
- }
-#endif
-
-/*
- * If using Keep Alive (HTTP/1.1) we keep the socket open for a period
- * while waiting for another request on the socket.
- */
- if (wp->flags & WEBS_KEEP_ALIVE) {
- if (socketFlush(wp->sid) == 0) {
- wp->state = WEBS_BEGIN;
- wp->flags |= WEBS_REQUEST_DONE;
- if (wp->header.buf) {
- ringqFlush(&wp->header);
- }
- socketCreateHandler(wp->sid, SOCKET_READABLE, websSocketEvent,
- wp);
- websTimeoutCancel(wp);
- wp->timeout = emfSchedCallback(WEBS_TIMEOUT, websTimeout,
- (void *) wp);
- return;
- }
- } else {
- websTimeoutCancel(wp);
- socketSetBlock(wp->sid, 1);
- socketFlush(wp->sid);
- socketCloseConnection(wp->sid);
- }
- websFree(wp);
-}
-
-/******************************************************************************/
-/*
- * Allocate a new webs structure
- */
-
-int websAlloc(int sid)
-{
- webs_t wp;
- int wid;
-
-/*
- * Allocate a new handle for this connection
- */
- if ((wid = hAllocEntry((void***) &webs, &websMax,
- sizeof(struct websRec))) < 0) {
- return -1;
- }
- wp = webs[wid];
-
- wp->wid = wid;
- wp->sid = sid;
- wp->state = WEBS_BEGIN;
- wp->docfd = -1;
- wp->timeout = -1;
- wp->dir = NULL;
- wp->authType = NULL;
- wp->protocol = NULL;
- wp->protoVersion = NULL;
- wp->password = NULL;
- wp->userName = NULL;
-#ifdef DIGEST_ACCESS_SUPPORT
- wp->realm = NULL;
- wp->nonce = NULL;
- wp->digest = NULL;
- wp->uri = NULL;
- wp->opaque = NULL;
- wp->nc = NULL;
- wp->cnonce = NULL;
- wp->qop = NULL;
-#endif
-#ifdef WEBS_SSL_SUPPORT
- wp->wsp = NULL;
-#endif
-
- ringqOpen(&wp->header, WEBS_HEADER_BUFINC, WEBS_MAX_HEADER);
-
-/*
- * Create storage for the CGI variables. We supply the symbol tables for
- * both the CGI variables and for the global functions. The function table
- * is common to all webs instances (ie. all browsers)
- */
- wp->cgiVars = symOpen(WEBS_SYM_INIT);
-
- return wid;
-}
-
-/******************************************************************************/
-/*
- * Free a webs structure
- */
-
-void websFree(webs_t wp)
-{
- a_assert(websValid(wp));
-
- if (wp->path)
- bfree(B_L, wp->path);
- if (wp->url)
- bfree(B_L, wp->url);
- if (wp->host)
- bfree(B_L, wp->host);
- if (wp->lpath)
- bfree(B_L, wp->lpath);
- if (wp->query)
- bfree(B_L, wp->query);
- if (wp->decodedQuery)
- bfree(B_L, wp->decodedQuery);
- if (wp->authType)
- bfree(B_L, wp->authType);
- if (wp->password)
- bfree(B_L, wp->password);
- if (wp->userName)
- bfree(B_L, wp->userName);
- if (wp->cookie)
- bfree(B_L, wp->cookie);
- if (wp->userAgent)
- bfree(B_L, wp->userAgent);
- if (wp->dir)
- bfree(B_L, wp->dir);
- if (wp->protocol)
- bfree(B_L, wp->protocol);
- if (wp->protoVersion)
- bfree(B_L, wp->protoVersion);
- if (wp->cgiStdin)
- bfree(B_L, wp->cgiStdin);
-
-
-#ifdef DIGEST_ACCESS_SUPPORT
- if (wp->realm)
- bfree(B_L, wp->realm);
- if (wp->uri)
- bfree(B_L, wp->uri);
- if (wp->digest)
- bfree(B_L, wp->digest);
- if (wp->opaque)
- bfree(B_L, wp->opaque);
- if (wp->nonce)
- bfree(B_L, wp->nonce);
- if (wp->nc)
- bfree(B_L, wp->nc);
- if (wp->cnonce)
- bfree(B_L, wp->cnonce);
- if (wp->qop)
- bfree(B_L, wp->qop);
-#endif
-#ifdef WEBS_SSL_SUPPORT
- websSSLFree(wp->wsp);
-#endif
- symClose(wp->cgiVars);
-
- if (wp->header.buf) {
- ringqClose(&wp->header);
- }
-
- websMax = hFree((void***) &webs, wp->wid);
- bfree(B_L, wp);
- a_assert(websMax >= 0);
-}
-
-/******************************************************************************/
-/*
- * Return the server address
- */
-
-char_t *websGetHost()
-{
- return websHost;
-}
-
-/******************************************************************************/
-/*
- * Return the the url to access the server. (ip address)
- */
-
-char_t *websGetIpaddrUrl()
-{
- return websIpaddrUrl;
-}
-
-/******************************************************************************/
-/*
- * Return the server address
- */
-
-char_t *websGetHostUrl()
-{
- return websHostUrl;
-}
-
-/******************************************************************************/
-/*
- * Return the listen port
- */
-
-int websGetPort()
-{
- return websPort;
-}
-
-/******************************************************************************/
-/*
- * Get the number of bytes to write
- */
-
-int websGetRequestBytes(webs_t wp)
-{
- a_assert(websValid(wp));
-
- return wp->numbytes;
-}
-
-/******************************************************************************/
-/*
- * Get the directory for this request
- */
-
-char_t *websGetRequestDir(webs_t wp)
-{
- a_assert(websValid(wp));
-
- if (wp->dir == NULL) {
- return T("");
- }
-
- return wp->dir;
-}
-
-/******************************************************************************/
-/*
- * Get the flags for this request
- */
-
-int websGetRequestFlags(webs_t wp)
-{
- a_assert(websValid(wp));
-
- return wp->flags;
-}
-
-/******************************************************************************/
-/*
- * Return the IP address
- */
-
-char_t *websGetRequestIpaddr(webs_t wp)
-{
- a_assert(websValid(wp));
-
- return wp->ipaddr;
-}
-
-/******************************************************************************/
-/*
- * Set the local path for the request
- */
-
-char_t *websGetRequestLpath(webs_t wp)
-{
- a_assert(websValid(wp));
-
-#ifdef WEBS_PAGE_ROM
- return wp->path;
-#else
- return wp->lpath;
-#endif
-}
-
-/******************************************************************************/
-/*
- * Get the path for this request
- */
-
-char_t *websGetRequestPath(webs_t wp)
-{
- a_assert(websValid(wp));
-
- if (wp->path == NULL) {
- return T("");
- }
-
- return wp->path;
-}
-
-/******************************************************************************/
-/*
- * Return the password
- */
-
-char_t *websGetRequestPassword(webs_t wp)
-{
- a_assert(websValid(wp));
-
- return wp->password;
-}
-
-/******************************************************************************/
-/*
- * Return the request type
- */
-
-char_t *websGetRequestType(webs_t wp)
-{
- a_assert(websValid(wp));
-
- return wp->type;
-}
-
-/******************************************************************************/
-/*
- * Return the username
- */
-
-char_t *websGetRequestUserName(webs_t wp)
-{
- a_assert(websValid(wp));
-
- return wp->userName;
-}
-
-/******************************************************************************/
-/*
- * Get the number of bytes written
- */
-
-int websGetRequestWritten(webs_t wp)
-{
- a_assert(websValid(wp));
-
- return wp->written;
-}
-
-/******************************************************************************/
-/*
- * Set the hostname
- */
-
-void websSetHost(char_t *host)
-{
- gstrncpy(websHost, host, TSZ(websHost));
-}
-
-/******************************************************************************/
-/*
- * Set the host URL
- */
-
-void websSetHostUrl(char_t *url)
-{
- a_assert(url && *url);
-
- bfreeSafe(B_L, websHostUrl);
- websHostUrl = gstrdup(B_L, url);
-}
-
-/******************************************************************************/
-/*
- * Set the IP address
- */
-
-void websSetIpaddr(char_t *ipaddr)
-{
- a_assert(ipaddr && *ipaddr);
-
- gstrncpy(websIpaddr, ipaddr, TSZ(websIpaddr));
-}
-
-/******************************************************************************/
-/*
- * Set the number of bytes to write
- */
-
-void websSetRequestBytes(webs_t wp, int bytes)
-{
- a_assert(websValid(wp));
- a_assert(bytes >= 0);
-
- wp->numbytes = bytes;
-}
-
-/******************************************************************************/
-/*
- * Set the flags for this request
- */
-
-void websSetRequestFlags(webs_t wp, int flags)
-{
- a_assert(websValid(wp));
-
- wp->flags = flags;
-}
-
-/******************************************************************************/
-/*
- * Set the local path for the request
- */
-
-void websSetRequestLpath(webs_t wp, char_t *lpath)
-{
- a_assert(websValid(wp));
- a_assert(lpath && *lpath);
-
- if (wp->lpath) {
- bfree(B_L, wp->lpath);
- }
- wp->lpath = bstrdup(B_L, lpath);
- websSetVar(wp, T("PATH_TRANSLATED"), wp->lpath);
-}
-
-/******************************************************************************/
-/*
- * Update the URL path and the directory containing the web page
- */
-
-void websSetRequestPath(webs_t wp, char_t *dir, char_t *path)
-{
- char_t *tmp;
-
- a_assert(websValid(wp));
-
- if (dir) {
- tmp = wp->dir;
- wp->dir = bstrdup(B_L, dir);
- if (tmp) {
- bfree(B_L, tmp);
- }
- }
- if (path) {
- tmp = wp->path;
- wp->path = bstrdup(B_L, path);
- websSetVar(wp, T("PATH_INFO"), wp->path);
- if (tmp) {
- bfree(B_L, tmp);
- }
- }
-}
-
-/******************************************************************************/
-/*
- * Set the Write handler for this socket
- */
-
-void websSetRequestSocketHandler(webs_t wp, int mask, void (*fn)(webs_t wp))
-{
- a_assert(websValid(wp));
-
- wp->writeSocket = fn;
- socketCreateHandler(wp->sid, SOCKET_WRITABLE, websSocketEvent, wp);
-}
-
-/******************************************************************************/
-/*
- * Set the number of bytes written
- */
-
-void websSetRequestWritten(webs_t wp, int written)
-{
- a_assert(websValid(wp));
-
- wp->written = written;
-}
-
-/******************************************************************************/
-/*
- * Reurn true if the webs handle is valid
- */
-
-int websValid(webs_t wp)
-{
- int wid;
-
- for (wid = 0; wid < websMax; wid++) {
- if (wp == webs[wid]) {
- return 1;
- }
- }
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Build an ASCII time string. If sbuf is NULL we use the current time,
- * else we use the last modified time of sbuf;
- */
-
-char_t *websGetDateString(websStatType *sbuf)
-{
- char_t* cp, *r;
- time_t now;
-
- if (sbuf == NULL) {
- time(&now);
- } else {
- now = sbuf->mtime;
- }
- if ((cp = gctime(&now)) != NULL) {
- cp[gstrlen(cp) - 1] = '\0';
- r = bstrdup(B_L, cp);
- return r;
- }
- return NULL;
-}
-
-/******************************************************************************/
-/*
- * Mark time. Set a timestamp so that, later, we can return the number of
- * seconds since we made the mark. Note that the mark my not be a
- * "real" time, but rather a relative marker.
- */
-
-void websSetTimeMark(webs_t wp)
-{
- wp->timestamp = time(0);
-}
-
-/******************************************************************************/
-/*
- * Get the number of seconds since the last mark.
- */
-
-static int websGetTimeSinceMark(webs_t wp)
-{
- return time(0) - wp->timestamp;
-}
-
-/******************************************************************************/
-/*
- * Store the new realm name
- */
-
-void websSetRealm(char_t *realmName)
-{
- a_assert(realmName);
-
- gstrncpy(websRealm, realmName, TSZ(websRealm));
-}
-
-/******************************************************************************/
-/*
- * Return the realm name (used for authorization)
- */
-
-char_t *websGetRealm()
-{
- return websRealm;
-}
-
-
-#ifdef WEBS_IF_MODIFIED_SUPPORT
-/******************************************************************************/
-/*
- * These functions are intended to closely mirror the syntax for HTTP-date
- * from RFC 2616 (HTTP/1.1 spec). This code was submitted by Pete Bergstrom.
- */
-
-/*
- * RFC1123Date = wkday "," SP date1 SP time SP "GMT"
- * RFC850Date = weekday "," SP date2 SP time SP "GMT"
- * ASCTimeDate = wkday SP date3 SP time SP 4DIGIT
- *
- * Each of these functions tries to parse the value and update the index to
- * the point it leaves off parsing.
- */
-
-typedef enum { JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC } MonthEnumeration;
-typedef enum { SUN, MON, TUE, WED, THU, FRI, SAT } WeekdayEnumeration;
-
-/******************************************************************************/
-/*
- * Parse an N-digit value
- */
-
-static int parseNDIGIT(char_t *buf, int digits, int *index)
-{
- int tmpIndex, returnValue;
-
- returnValue = 0;
-
- for (tmpIndex = *index; tmpIndex < *index+digits; tmpIndex++) {
- if (gisdigit(buf[tmpIndex])) {
- returnValue = returnValue * 10 + (buf[tmpIndex] - T('0'));
- }
- }
- *index = tmpIndex;
-
- return returnValue;
-}
-
-/******************************************************************************/
-/*
- * Return an index into the month array
- */
-
-static int parseMonth(char_t *buf, int *index)
-{
-/*
- * "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" |
- * "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec"
- */
- int tmpIndex, returnValue;
-
- returnValue = -1;
- tmpIndex = *index;
-
- switch (buf[tmpIndex]) {
- case 'A':
- switch (buf[tmpIndex+1]) {
- case 'p':
- returnValue = APR;
- break;
- case 'u':
- returnValue = AUG;
- break;
- }
- break;
- case 'D':
- returnValue = DEC;
- break;
- case 'F':
- returnValue = FEB;
- break;
- case 'J':
- switch (buf[tmpIndex+1]) {
- case 'a':
- returnValue = JAN;
- break;
- case 'u':
- switch (buf[tmpIndex+2]) {
- case 'l':
- returnValue = JUL;
- break;
- case 'n':
- returnValue = JUN;
- break;
- }
- break;
- }
- break;
- case 'M':
- switch (buf[tmpIndex+1]) {
- case 'a':
- switch (buf[tmpIndex+2]) {
- case 'r':
- returnValue = MAR;
- break;
- case 'y':
- returnValue = MAY;
- break;
- }
- break;
- }
- break;
- case 'N':
- returnValue = NOV;
- break;
- case 'O':
- returnValue = OCT;
- break;
- case 'S':
- returnValue = SEP;
- break;
- }
-
- if (returnValue >= 0) {
- *index += 3;
- }
-
- return returnValue;
-}
-
-/******************************************************************************/
-/*
- * Parse a year value (either 2 or 4 digits)
- */
-
-static int parseYear(char_t *buf, int *index)
-{
- int tmpIndex, returnValue;
-
- tmpIndex = *index;
- returnValue = parseNDIGIT(buf, 4, &tmpIndex);
-
- if (returnValue >= 0) {
- *index = tmpIndex;
- } else {
- returnValue = parseNDIGIT(buf, 2, &tmpIndex);
- if (returnValue >= 0) {
-/*
- * Assume that any year earlier than the start of the
- * epoch for time_t (1970) specifies 20xx
- */
- if (returnValue < 70) {
- returnValue += 2000;
- } else {
- returnValue += 1900;
- }
-
- *index = tmpIndex;
- }
- }
-
- return returnValue;
-}
-
-/******************************************************************************/
-/*
- * The formulas used to build these functions are from "Calendrical Calculations",
- * by Nachum Dershowitz, Edward M. Reingold, Cambridge University Press, 1997.
- */
-
-#include <math.h>
-
-const int GregorianEpoch = 1;
-
-/******************************************************************************/
-/*
- * Determine if year is a leap year
- */
-
-int GregorianLeapYearP(long year)
-{
- int result;
- long tmp;
-
- tmp = year % 400;
-
- if ((year % 4 == 0) &&
- (tmp != 100) &&
- (tmp != 200) &&
- (tmp != 300)) {
- result = TRUE;
- } else {
- result = FALSE;
- }
-
- return result;
-}
-
-/******************************************************************************/
-/*
- * Return the fixed date from the gregorian date
- */
-
-long FixedFromGregorian(long month, long day, long year)
-{
- long fixedDate;
-
- fixedDate = (long)(GregorianEpoch - 1 + 365 * (year - 1) +
- floor((year - 1) / 4.0) -
- floor((double)(year - 1) / 100.0) +
- floor((double)(year - 1) / 400.0) +
- floor((367.0 * ((double)month) - 362.0) / 12.0));
-
- if (month <= 2) {
- fixedDate += 0;
- } else if (TRUE == GregorianLeapYearP(year)) {
- fixedDate += -1;
- } else {
- fixedDate += -2;
- }
-
- fixedDate += day;
-
- return fixedDate;
-}
-
-/******************************************************************************/
-/*
- * Return the gregorian year from a fixed date
- */
-
-long GregorianYearFromFixed(long fixedDate)
-{
- long result, d0, n400, d1, n100, d2, n4, d3, n1, d4, year;
-
- d0 = fixedDate - GregorianEpoch;
- n400 = (long)(floor((double)d0 / (double)146097));
- d1 = d0 % 146097;
- n100 = (long)(floor((double)d1 / (double)36524));
- d2 = d1 % 36524;
- n4 = (long)(floor((double)d2 / (double)1461));
- d3 = d2 % 1461;
- n1 = (long)(floor((double)d3 / (double)365));
- d4 = (d3 % 365) + 1;
- year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
-
- if ((n100 == 4) || (n1 == 4)) {
- result = year;
- } else {
- result = year + 1;
- }
-
- return result;
-}
-
-/******************************************************************************/
-/*
- * Returns the Gregorian date from a fixed date
- * (not needed for this use, but included for completeness
- */
-
-#if 0
-GregorianFromFixed(long fixedDate, long *month, long *day, long *year)
-{
- long priorDays, correction;
-
- *year = GregorianYearFromFixed(fixedDate);
- priorDays = fixedDate - FixedFromGregorian(1, 1, *year);
-
- if (fixedDate < FixedFromGregorian(3,1,*year)) {
- correction = 0;
- } else if (true == GregorianLeapYearP(*year)) {
- correction = 1;
- } else {
- correction = 2;
- }
-
- *month = (long)(floor((12.0 * (double)(priorDays + correction) + 373.0) / 367.0));
- *day = fixedDate - FixedFromGregorian(*month, 1, *year);
-}
-#endif
-
-/******************************************************************************/
-/*
- * Returns the difference between two Gregorian dates
- */
-
-long GregorianDateDifference( long month1, long day1, long year1,
- long month2, long day2, long year2)
-{
- return FixedFromGregorian(month2, day2, year2) -
- FixedFromGregorian(month1, day1, year1);
-}
-
-
-/******************************************************************************/
-/*
- * Return the number of seconds into the current day
- */
-
-#define SECONDS_PER_DAY 24*60*60
-
-static int parseTime(char_t *buf, int *index)
-{
-/*
- * Format of buf is - 2DIGIT ":" 2DIGIT ":" 2DIGIT
- */
- int returnValue, tmpIndex, hourValue, minuteValue, secondValue;
-
- hourValue = minuteValue = secondValue = -1;
- returnValue = -1;
- tmpIndex = *index;
-
- hourValue = parseNDIGIT(buf, 2, &tmpIndex);
-
- if (hourValue >= 0) {
- tmpIndex++;
- minuteValue = parseNDIGIT(buf, 2, &tmpIndex);
- if (minuteValue >= 0) {
- tmpIndex++;
- secondValue = parseNDIGIT(buf, 2, &tmpIndex);
- }
- }
-
- if ((hourValue >= 0) &&
- (minuteValue >= 0) &&
- (secondValue >= 0)) {
- returnValue = (((hourValue * 60) + minuteValue) * 60) + secondValue;
- *index = tmpIndex;
- }
-
- return returnValue;
-}
-
-/******************************************************************************/
-/*
- * Return the equivalent of time() given a gregorian date
- */
-
-static time_t dateToTimet(int year, int month, int day)
-{
- long dayDifference;
-
- /*
- * Bug fix by Jeff Reeder (Jun 14, 2002): The 'month' parameter is
- * numbered from 0 (Jan == 0), but FixedFromGregorian() takes
- * months numbered from 1 (January == 1). We need to add 1
- * to the month
- */
- dayDifference = FixedFromGregorian(month + 1, day, year) -
- FixedFromGregorian(1, 1, 1970);
-
- return dayDifference * SECONDS_PER_DAY;
-}
-
-/******************************************************************************/
-/*
- * Return the number of seconds between Jan 1, 1970 and the parsed date
- * (corresponds to documentation for time() function)
- */
-
-static time_t parseDate1or2(char_t *buf, int *index)
-{
-/*
- * Format of buf is either
- * 2DIGIT SP month SP 4DIGIT
- * or
- * 2DIGIT "-" month "-" 2DIGIT
- */
- int dayValue, monthValue, yearValue, tmpIndex;
- time_t returnValue;
-
- returnValue = (time_t) -1;
- tmpIndex = *index;
-
- dayValue = monthValue = yearValue = -1;
-
- if (buf[tmpIndex] == T(',')) {
-/*
- * Skip over the ", "
- */
- tmpIndex += 2;
-
- dayValue = parseNDIGIT(buf, 2, &tmpIndex);
- if (dayValue >= 0) {
-/*
- * Skip over the space or hyphen
- */
- tmpIndex++;
- monthValue = parseMonth(buf, &tmpIndex);
- if (monthValue >= 0) {
-/*
- * Skip over the space or hyphen
- */
- tmpIndex++;
- yearValue = parseYear(buf, &tmpIndex);
- }
- }
-
- if ((dayValue >= 0) &&
- (monthValue >= 0) &&
- (yearValue >= 0)) {
- if (yearValue < 1970) {
-/*
- * Allow for Microsoft IE's year 1601 dates
- */
- returnValue = 0;
- } else {
- returnValue = dateToTimet(yearValue, monthValue, dayValue);
- }
- *index = tmpIndex;
- }
- }
-
- return returnValue;
-}
-
-/******************************************************************************/
-/*
- * Return the number of seconds between Jan 1, 1970 and the parsed date
- */
-
-static time_t parseDate3Time(char_t *buf, int *index)
-{
-/*
- * Format of buf is month SP ( 2DIGIT | ( SP 1DIGIT ))
- */
- int dayValue, monthValue, yearValue, timeValue, tmpIndex;
- time_t returnValue;
-
- returnValue = (time_t) -1;
- tmpIndex = *index;
-
- dayValue = monthValue = yearValue = timeValue = -1;
-
- monthValue = parseMonth(buf, &tmpIndex);
- if (monthValue >= 0) {
-/*
- * Skip over the space
- */
- tmpIndex++;
- if (buf[tmpIndex] == T(' ')) {
-/*
- * Skip over this space too
- */
- tmpIndex++;
- dayValue = parseNDIGIT(buf, 1, &tmpIndex);
- } else {
- dayValue = parseNDIGIT(buf, 2, &tmpIndex);
- }
-/*
- * Now get the time and time SP 4DIGIT
- */
- timeValue = parseTime(buf, &tmpIndex);
- if (timeValue >= 0) {
-/*
- * Now grab the 4DIGIT year value
- */
- yearValue = parseYear(buf, &tmpIndex);
- }
- }
-
- if ((dayValue >= 0) &&
- (monthValue >= 0) &&
- (yearValue >= 0)) {
- returnValue = dateToTimet(yearValue, monthValue, dayValue);
- returnValue += timeValue;
- *index = tmpIndex;
- }
-
- return returnValue;
-}
-
-
-/******************************************************************************/
-/*
- * Although this looks like a trivial function, I found I was replicating the implementation
- * seven times in the parseWeekday function. In the interests of minimizing code size
- * and redundancy, it is broken out into a separate function. The cost of an extra
- * function call I can live with given that it should only be called once per HTTP request.
- */
-
-static int bufferIndexIncrementGivenNTest(char_t *buf, int testIndex, char_t testChar,
- int foundIncrement, int notfoundIncrement)
-{
- if (buf[testIndex] == testChar) {
- return foundIncrement;
- }
-
- return notfoundIncrement;
-}
-
-/******************************************************************************/
-/*
- * Return an index into a logical weekday array
- */
-
-static int parseWeekday(char_t *buf, int *index)
-{
-/*
- * Format of buf is either
- * "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun"
- * or
- * "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday"
- */
- int tmpIndex, returnValue;
-
- returnValue = -1;
- tmpIndex = *index;
-
- switch (buf[tmpIndex]) {
- case 'F':
- returnValue = FRI;
- *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'd', sizeof("Friday"), 3);
- break;
- case 'M':
- returnValue = MON;
- *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'd', sizeof("Monday"), 3);
- break;
- case 'S':
- switch (buf[tmpIndex+1]) {
- case 'a':
- returnValue = SAT;
- *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'u', sizeof("Saturday"), 3);
- break;
- case 'u':
- returnValue = SUN;
- *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'd', sizeof("Sunday"), 3);
- break;
- }
- break;
- case 'T':
- switch (buf[tmpIndex+1]) {
- case 'h':
- returnValue = THU;
- *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'r', sizeof("Thursday"), 3);
- break;
- case 'u':
- returnValue = TUE;
- *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 's', sizeof("Tuesday"), 3);
- break;
- }
- break;
- case 'W':
- returnValue = WED;
- *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'n', sizeof("Wednesday"), 3);
- break;
- }
- return returnValue;
-}
-
-/******************************************************************************/
-/*
- * Parse the date and time string.
- */
-
-static time_t dateParse(time_t tip, char_t *cmd)
-{
- int index, tmpIndex, weekday, timeValue;
- time_t parsedValue, dateValue;
-
- parsedValue = (time_t) 0;
- index = timeValue = 0;
- weekday = parseWeekday(cmd, &index);
-
- if (weekday >= 0) {
- tmpIndex = index;
- dateValue = parseDate1or2(cmd, &tmpIndex);
- if (dateValue >= 0) {
- index = tmpIndex + 1;
-/*
- * One of these two forms is being used
- * wkday "," SP date1 SP time SP "GMT"
- * weekday "," SP date2 SP time SP "GMT"
- */
- timeValue = parseTime(cmd, &index);
- if (timeValue >= 0) {
-/*
- * Now match up that "GMT" string for completeness
- * Compute the final value if there were no problems in the parse
- */
- if ((weekday >= 0) &&
- (dateValue >= 0) &&
- (timeValue >= 0)) {
- parsedValue = dateValue + timeValue;
- }
- }
- } else {
-/*
- * Try the other form - wkday SP date3 SP time SP 4DIGIT
- */
- tmpIndex = index;
- parsedValue = parseDate3Time(cmd, &tmpIndex);
- }
- }
-
- return parsedValue;
-}
-
-#endif /* WEBS_IF_MODIFIED_SUPPORT */
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/webs.h b/xbmc/lib/libGoAhead/src/webs.h deleted file mode 100644 index f356eaa498..0000000000 --- a/xbmc/lib/libGoAhead/src/webs.h +++ /dev/null @@ -1,235 +0,0 @@ -/*
- * webs.h -- GoAhead Web public header
- *
- * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved.
- *
- * See the file "license.txt" for information on usage and redistribution
- *
- * $Id: webs.h,v 1.9 2003/09/29 20:02:19 bporter Exp $
- */
-
-#ifndef _h_WEBS
-#define _h_WEBS 1
-
-/******************************** Description *********************************/
-
-/*
- * GoAhead Web Server header. This defines the Web public APIs.
- * Include this header for files that contain ASP or Form procedures.
- * Include wsIntrn.h when creating URL handlers.
- */
-
-/********************************* Includes ***********************************/
-
-#include "ej.h"
-#ifdef WEBS_SSL_SUPPORT
- #include "websSSL.h"
-#endif
-
-/********************************** Defines ***********************************/
-/*
- * By license terms the server software name defined in the following line of
- * code must not be modified.
- */
-#define WEBS_NAME T("GoAhead-Webs")
-#define WEBS_VERSION T("2.1.7")
-
-#define WEBS_HEADER_BUFINC 512 /* Header buffer size */
-#define WEBS_ASP_BUFINC 512 /* Asp expansion increment */
-#define WEBS_MAX_PASS 32 /* Size of password */
-#define WEBS_BUFSIZE 1000 /* websWrite max output string */
-#define WEBS_MAX_HEADER (5 * 1024) /* Sanity check header */
-#define WEBS_MAX_URL 4096 /* Maximum URL size for sanity */
-#define WEBS_SOCKET_BUFSIZ 256 /* Bytes read from socket */
-
-#define WEBS_HTTP_PORT T("httpPort")
-#define CGI_BIN T("cgi-bin")
-
-/*
- * Request flags. Also returned by websGetRequestFlags().
- */
-#define WEBS_LOCAL_PAGE 0x1 /* Request for local webs page */
-#define WEBS_KEEP_ALIVE 0x2 /* HTTP/1.1 keep alive */
-#define WEBS_DONT_USE_CACHE 0x4 /* Not implemented cache support */
-#define WEBS_COOKIE 0x8 /* Cookie supplied in request */
-#define WEBS_IF_MODIFIED 0x10 /* If-modified-since in request */
-#define WEBS_POST_REQUEST 0x20 /* Post request operation */
-#define WEBS_LOCAL_REQUEST 0x40 /* Request from this system */
-#define WEBS_HOME_PAGE 0x80 /* Request for the home page */
-#define WEBS_ASP 0x100 /* ASP request */
-#define WEBS_HEAD_REQUEST 0x200 /* Head request */
-#define WEBS_CLEN 0x400 /* Request had a content length */
-#define WEBS_FORM 0x800 /* Request is a form */
-#define WEBS_REQUEST_DONE 0x1000 /* Request complete */
-#define WEBS_POST_DATA 0x2000 /* Already appended post data */
-#define WEBS_CGI_REQUEST 0x4000 /* cgi-bin request */
-#define WEBS_SECURE 0x8000 /* connection uses SSL */
-#define WEBS_AUTH_BASIC 0x10000 /* Basic authentication request */
-#define WEBS_AUTH_DIGEST 0x20000 /* Digest authentication request */
-#define WEBS_HEADER_DONE 0x40000 /* Already output the HTTP header */
-#define WEBS_SPY 0x80000 /* Spyce request */
-/*
- * URL handler flags
- */
-#define WEBS_HANDLER_FIRST 0x1 /* Process this handler first */
-#define WEBS_HANDLER_LAST 0x2 /* Process this handler last */
-
-/*
- * Per socket connection webs structure
- */
-typedef struct websRec {
- ringq_t header; /* Header dynamic string */
- time_t since; /* Parsed if-modified-since time */
- sym_fd_t cgiVars; /* CGI standard variables */
- sym_fd_t cgiQuery; /* CGI decoded query string */
- time_t timestamp; /* Last transaction with browser */
- int timeout; /* Timeout handle */
- char_t ipaddr[32]; /* Connecting ipaddress */
- char_t type[64]; /* Mime type */
- char_t *dir; /* Directory containing the page */
- char_t *path; /* Path name without query */
- char_t *url; /* Full request url */
- char_t *host; /* Requested host */
- char_t *lpath; /* Cache local path name */
- char_t *query; /* Request query */
- char_t *decodedQuery; /* Decoded request query */
- char_t *authType; /* Authorization type (Basic/DAA) */
- char_t *password; /* Authorization password */
- char_t *userName; /* Authorization username */
- char_t *cookie; /* Cookie string */
- char_t *userAgent; /* User agent (browser) */
- char_t *protocol; /* Protocol (normally HTTP) */
- char_t *protoVersion; /* Protocol version */
- int sid; /* Socket id (handler) */
- int listenSid; /* Listen Socket id */
- int port; /* Request port number */
- int state; /* Current state */
- int flags; /* Current flags -- see above */
- int code; /* Request result code */
- int clen; /* Content length */
- int wid; /* Index into webs */
- char_t *cgiStdin; /* filename for CGI stdin */
- int docfd; /* Document file descriptor */
- int numbytes; /* Bytes to transfer to browser */
- int written; /* Bytes actually transferred */
- void (*writeSocket)(struct websRec *wp);
-#ifdef DIGEST_ACCESS_SUPPORT
- char_t *realm; /* usually the same as "host" from websRec */
- char_t *nonce; /* opaque-to-client string sent by server */
- char_t *digest; /* digest form of user password */
- char_t *uri; /* URI found in DAA header */
- char_t *opaque; /* opaque value passed from server */
- char_t *nc; /* nonce count */
- char_t *cnonce; /* check nonce */
- char_t *qop; /* quality operator */
-#endif
-#ifdef WEBS_SSL_SUPPORT
- websSSL_t *wsp; /* SSL data structure */
-#endif
-} websRec;
-
-typedef websRec *webs_t;
-typedef websRec websType;
-
-/******************************** Prototypes **********************************/
-extern int websAccept(int sid, char *ipaddr, int port, int listenSid);
-extern int websAspDefine(char_t *name,
- int (*fn)(int ejid, webs_t wp, int argc, char_t **argv));
-extern int websAspRequest(webs_t wp, char_t *lpath);
-extern int websSpyRequest(webs_t wp, char_t *lpath);
-extern void websCloseListen();
-extern int websDecode64(char_t *outbuf, char_t *string, int buflen);
-extern void websDecodeUrl(char_t *token, char_t *decoded, int len);
-extern void websDone(webs_t wp, int code);
-extern void websEncode64(char_t *outbuf, char_t *string, int buflen);
-extern void websError(webs_t wp, int code, char_t *msg, ...);
-/* function websErrorMsg() made extern 03 Jun 02 BgP */
-extern char_t *websErrorMsg(int code);
-extern void websFooter(webs_t wp);
-extern int websFormDefine(char_t *name, void (*fn)(webs_t wp,
- char_t *path, char_t *query));
-extern char_t *websGetDefaultDir();
-extern char_t *websGetDefaultPage();
-extern char_t *websGetHostUrl();
-extern char_t *websGetIpaddrUrl();
-extern char_t *websGetPassword();
-extern int websGetPort();
-extern char_t *websGetPublishDir(char_t *path, char_t **urlPrefix);
-extern char_t *websGetRealm();
-extern int websGetRequestBytes(webs_t wp);
-extern char_t *websGetRequestDir(webs_t wp);
-extern int websGetRequestFlags(webs_t wp);
-extern char_t *websGetRequestIpaddr(webs_t wp);
-extern char_t *websGetRequestLpath(webs_t wp);
-extern char_t *websGetRequestPath(webs_t wp);
-extern char_t *websGetRequestPassword(webs_t wp);
-extern char_t *websGetRequestType(webs_t wp);
-extern int websGetRequestWritten(webs_t wp);
-extern char_t *websGetVar(webs_t wp, char_t *var, char_t *def);
-extern int websCompareVar(webs_t wp, char_t *var, char_t *value);
-extern void websHeader(webs_t wp);
-extern int websOpenListen(int port, int retries);
-extern int websPageOpen(webs_t wp, char_t *lpath, char_t *path,
- int mode, int perm);
-extern void websPageClose(webs_t wp);
-extern int websPublish(char_t *urlPrefix, char_t *path);
-extern void websRedirect(webs_t wp, char_t *url);
-extern void websSecurityDelete();
-extern int websSecurityHandler(webs_t wp, char_t *urlPrefix,
- char_t *webDir, int arg, char_t *url, char_t *path,
- char_t *query);
-extern void websSetDefaultDir(char_t *dir);
-extern void websSetDefaultPage(char_t *page);
-extern void websSetEnv(webs_t wp);
-extern void websSetHost(char_t *host);
-extern void websSetIpaddr(char_t *ipaddr);
-extern void websSetPassword(char_t *password);
-extern void websSetRealm(char_t *realmName);
-extern void websSetRequestBytes(webs_t wp, int bytes);
-extern void websSetRequestFlags(webs_t wp, int flags);
-extern void websSetRequestLpath(webs_t wp, char_t *lpath);
-extern void websSetRequestPath(webs_t wp, char_t *dir, char_t *path);
-extern char_t *websGetRequestUserName(webs_t wp);
-extern void websSetRequestWritten(webs_t wp, int written);
-extern void websSetVar(webs_t wp, char_t *var, char_t *value);
-extern int websTestVar(webs_t wp, char_t *var);
-extern void websTimeoutCancel(webs_t wp);
-extern int websUrlHandlerDefine(char_t *urlPrefix, char_t *webDir,
- int arg, int (*fn)(webs_t wp, char_t *urlPrefix,
- char_t *webDir, int arg, char_t *url, char_t *path,
- char_t *query), int flags);
-extern int websUrlHandlerDelete(int (*fn)(webs_t wp, char_t *urlPrefix,
- char_t *webDir, int arg, char_t *url, char_t *path,
- char_t *query));
-extern int websUrlHandlerRequest(webs_t wp);
-extern int websUrlParse(char_t *url, char_t **buf, char_t **host,
- char_t **path, char_t **port, char_t **query,
- char_t **proto, char_t **tag, char_t **ext);
-extern char_t *websUrlType(char_t *webs, char_t *buf, int charCnt);
-extern int websWrite(webs_t wp, char_t* fmt, ...);
-extern int websWriteBlock(webs_t wp, char_t *buf, int nChars);
-extern int websWriteDataNonBlock(webs_t wp, char *buf, int nChars);
-extern int websValid(webs_t wp);
-extern int websValidateUrl(webs_t wp, char_t *path);
-extern void websSetTimeMark(webs_t wp);
-
-/*
- * The following prototypes are used by the SSL patch found in websSSL.c
- */
-extern int websAlloc(int sid);
-extern void websFree(webs_t wp);
-extern void websTimeout(void *arg, int id);
-extern void websReadEvent(webs_t wp);
-
-/*
- * Prototypes for functions available when running as part of the
- * GoAhead Embedded Management Framework (EMF)
- */
-#ifdef EMF
-extern void websFormExplain(webs_t wp, char_t *path, char_t *query);
-#endif
-
-#endif /* _h_WEBS */
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/websSSL.c b/xbmc/lib/libGoAhead/src/websSSL.c deleted file mode 100644 index 7fa537a6ff..0000000000 --- a/xbmc/lib/libGoAhead/src/websSSL.c +++ /dev/null @@ -1,709 +0,0 @@ -/*
- * websSSL.c -- SSL envrionment creation
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: websSSL.c,v 1.3 2003/09/29 20:30:48 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * This module implements a patch into SSL implementations for the webs
- * module.
- */
-
-#ifndef __ENABLE_MOCANA_SSL_SERVER__
-/********************************* Includes ***********************************/
-
-#include "wsIntrn.h"
-#include "webs.h"
-#include "websSSL.h"
-
-/******************************* Definitions **********************************/
-
-#define DEFAULT_CERT_FILE "./server.pem"
-#define DEFAULT_KEY_FILE "./certs/cakey.pem"
-#define DEFAULT_CA_FILE "./certs/cacert.pem"
-#define DEFAULT_CA_PATH "./certs/"
-#define SSL_PORT 443
-
-/*
- * Define the components of the apps_startup() macro
- */
-
-#ifdef SIGPIPE
-#define do_pipe_sig() signal(SIGPIPE,SIG_IGN)
-#else
-#define do_pipe_sig()
-#endif
-
-#ifdef OPENSSL
-#define SSLC_add_all_algorithms() SSLeay_add_all_algorithms()
-#else
-extern void SSLC_add_all_algorithms(void);
-#endif
-
-/*
- * Define the apps_startup() macro
- */
-
-# if defined(MSDOS) || defined(WIN16) || defined(WIN32)
-# ifdef _O_BINARY
-# define apps_startup() \
- _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
- SSLC_add_all_algorithms()
-# else
-# define apps_startup() \
- _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
- SSLC_add_all_algorithms()
-# endif
-# else
-# define apps_startup() do_pipe_sig(); SSLC_add_all_algorithms();
-# endif
-
-/*************************** Forward Declarations *****************************/
-
-static int websSSLSetCertStuff(SSL_CTX *ctx,
- char *cert_file,
- char *key_file);
-static int websSSLVerifyCallback(int ok, X509_STORE_CTX *ctx);
-static RSA *websSSLTempRSACallback(SSL *s, int is_export, int keylength);
-
-static int websSSLReadEvent (webs_t wp);
-static int websSSLAccept(int sid, char *ipaddr, int port, int listenSid);
-static void websSSLSocketEvent(int sid, int mask, void* data);
-
-/*********************************** Locals ***********************************/
-
-static int sslListenSock = -1; /* Listen socket */
-static SSL_CTX *sslctx = NULL;
-
-/******************************************************************************/
-/*
- * Start up the SSL Context for the application, and start a listen on the
- * SSL port (usually 443, and defined by SSL_PORT)
- * Return 0 on success, -1 on failure.
- */
-
-int websSSLOpen()
-{
- char *certFile, *keyFile, *CApath, *CAfile;
- SSL_METHOD *meth;
-
-/*
- * Install and initialize the SSL library
- */
- apps_startup();
- trace(7, T("SSL: Initializing SSL\n"));
-
-#ifdef SSLC
- SSL_library_init();
-#endif
-
- SSL_load_error_strings();
-
-#ifdef OPENSSL
- SSLeay_add_ssl_algorithms();
-#endif
-
-/*
- * Important! Enable both SSL versions 2 and 3
- */
- meth = SSLv23_server_method();
- sslctx = SSL_CTX_new(meth);
-
- a_assert(sslctx);
-
- if (sslctx == NULL) {
- trace(2, T("SSL: Unable to create SSL context!\n"));
- return -1;
- }
-
-/*
- * Adjust some SSL Context variables
- */
- SSL_CTX_set_quiet_shutdown(sslctx, 1);
- SSL_CTX_set_options(sslctx, 0);
- SSL_CTX_sess_set_cache_size(sslctx, 128);
-
-/*
- * Set the certificate verification locations
- */
- CApath = DEFAULT_CA_PATH;
- CAfile = DEFAULT_CA_FILE;
- if ((!SSL_CTX_load_verify_locations(sslctx, CAfile, CApath)) ||
- (!SSL_CTX_set_default_verify_paths(sslctx))) {
- trace(2, T("SSL: Unable to set cert verification locations!\n"));
- websSSLClose();
- return -1;
- }
-
-/*
- * Set the certificate and key files for the SSL context
- */
- certFile = DEFAULT_CERT_FILE;
- keyFile = NULL;
- if (websSSLSetCertStuff(sslctx, certFile, keyFile) != 0) {
- websSSLClose();
- return -1;
- }
-
-/*
- * Set the RSA callback for the SSL context
- */
- SSL_CTX_set_tmp_rsa_callback(sslctx, websSSLTempRSACallback);
-
-/*
- * Set the verification callback for the SSL context
- */
- SSL_CTX_set_verify(sslctx, SSL_VERIFY_NONE, websSSLVerifyCallback);
-
-/*
- * Set the certificate authority list for the client
- */
- SSL_CTX_set_client_CA_list(sslctx, SSL_load_client_CA_file(CAfile));
-
-/*
- * Open the socket
- */
- sslListenSock = socketOpenConnection(NULL, SSL_PORT,
- websSSLAccept, SOCKET_BLOCK);
-
- if (sslListenSock < 0) {
- trace(2, T("SSL: Unable to open SSL socket on port <%d>!\n"),
- SSL_PORT);
- return -1;
- }
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Return TRUE if websSSL has been opened
- */
-
-int websSSLIsOpen()
-{
- return (sslListenSock != -1);
-}
-
-/******************************************************************************/
-/*
- * Stops the SSL
- */
-
-void websSSLClose()
-{
- trace(7, T("SSL: Closing SSL\n"));
-
- if (sslctx != NULL) {
- SSL_CTX_free(sslctx);
- sslctx = NULL;
- }
-
- if (sslListenSock != -1) {
- socketCloseConnection(sslListenSock);
- sslListenSock = -1;
- }
-
-#ifdef SSLC
- SSL_library_cleanup();
-#endif
-}
-
-/******************************************************************************/
-/*
- * Accept a connection
- */
-
-int websSSLAccept(int sid, char *ipaddr, int port, int listenSid)
-{
- webs_t wp;
- int wid;
-
- a_assert(ipaddr && *ipaddr);
- a_assert(sid >= 0);
- a_assert(port >= 0);
-
-/*
- * Allocate a new handle for this accepted connection. This will allocate
- * a webs_t structure in the webs[] list
- */
- if ((wid = websAlloc(sid)) < 0) {
- return -1;
- }
- wp = webs[wid];
- a_assert(wp);
- wp->listenSid = listenSid;
-
- ascToUni(wp->ipaddr, ipaddr, min(sizeof(wp->ipaddr), strlen(ipaddr)+1));
-
-/*
- * Check if this is a request from a browser on this system. This is useful
- * to know for permitting administrative operations only for local access
- */
- if (gstrcmp(wp->ipaddr, T("127.0.0.1")) == 0 ||
- gstrcmp(wp->ipaddr, websIpaddr) == 0 ||
- gstrcmp(wp->ipaddr, websHost) == 0) {
- wp->flags |= WEBS_LOCAL_REQUEST;
- }
-/*
- * Since the acceptance came in on this channel, it must be secure
- */
- wp->flags |= WEBS_SECURE;
-
-/*
- * Arrange for websSocketEvent to be called when read data is available
- */
- socketCreateHandler(sid, SOCKET_READABLE, websSSLSocketEvent, wp);
-
-/*
- * Arrange for a timeout to kill hung requests
- */
- wp->timeout = emfSchedCallback(WEBS_TIMEOUT, websTimeout, (void *) wp);
- trace(8, T("webs: accept request\n"));
- return 0;
-}
-
-/******************************************************************************/
-/*
- * The webs socket handler. Called in response to I/O. We just pass control
- * to the relevant read or write handler. A pointer to the webs structure
- * is passed as an (void*) in iwp.
- */
-
-static void websSSLSocketEvent(int sid, int mask, void* iwp)
-{
- webs_t wp;
-
- wp = (webs_t) iwp;
- a_assert(wp);
-
- if (! websValid(wp)) {
- return;
- }
-
- if (mask & SOCKET_READABLE) {
- websSSLReadEvent(wp);
- }
- if (mask & SOCKET_WRITABLE) {
- if (wp->writeSocket) {
- (*wp->writeSocket)(wp);
- }
- }
-}
-
-/******************************************************************************/
-/*
- * Handler for SSL Read Events
- */
-
-static int websSSLReadEvent (webs_t wp)
-{
- int ret, sock;
- socket_t *sptr;
- SSL *ssl;
- BIO *bio, *bioSSL, *bioSock;
-#ifdef DEV
- const char *ciphers;
-#endif
-
- a_assert (wp);
- a_assert(websValid(wp));
-
- sptr = socketPtr(wp->sid);
- a_assert(sptr);
-
- sock = sptr->sock;
-
-/*
- * Create a new BIO and SSL session for this web request
- */
- bio = BIO_new(BIO_f_buffer());
- a_assert(bio);
-
- if (!BIO_set_write_buffer_size(bio, 128)) {
- return -1;
- }
-
- ssl = (SSL *) SSL_new(sslctx);
- a_assert(ssl);
-
- if (ssl == NULL) {
- return -1;
- }
-
- SSL_set_session(ssl, NULL);
-
- bioSSL = BIO_new(BIO_f_ssl());
- a_assert(bioSSL);
-
- bioSock = BIO_new_socket(sock, BIO_NOCLOSE);
- a_assert(bioSock);
-
- SSL_set_bio(ssl, bioSock, bioSock);
- SSL_set_accept_state(ssl);
-
- ret = BIO_set_ssl(bioSSL, ssl, BIO_CLOSE);
- BIO_push(bio, bioSSL);
-
-#ifdef DEV
- ciphers = SSL_get_cipher_list(ssl, 10);
-#endif
-
-/*
- * Create the SSL data structure in the wp.
- */
-#ifdef WEBS_SSL_SUPPORT
- wp->wsp = balloc(B_L, sizeof(websSSL_t));
- a_assert (wp->wsp);
- (wp->wsp)->bio = bio;
- (wp->wsp)->ssl = ssl;
-#endif
-
-/*
- * Call the default Read Event
- */
- websReadEvent(wp);
-
- return ret;
-}
-
-
-/******************************************************************************/
-/*
- * SSL Verification Callback
- */
-
-static int sslVerifyDepth = 0;
-static int sslVerifyError = X509_V_OK;
-
-int websSSLVerifyCallback(int ok, X509_STORE_CTX *ctx)
-{
- char buf[256];
- X509 *errCert;
- int err;
- int depth;
-
- errCert = X509_STORE_CTX_get_current_cert(ctx);
- err = X509_STORE_CTX_get_error(ctx);
- depth = X509_STORE_CTX_get_error_depth(ctx);
-
- X509_NAME_oneline(X509_get_subject_name(errCert), buf, 256);
-
- if (!ok) {
- if (sslVerifyDepth >= depth) {
- ok = 1;
- sslVerifyError = X509_V_OK;
- } else {
- ok=0;
- sslVerifyError = X509_V_ERR_CERT_CHAIN_TOO_LONG;
- }
- }
-
- switch (err) {
- case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
-#ifdef OPENSSL
- X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), buf, 256);
-#endif
- break;
-
- case X509_V_ERR_CERT_NOT_YET_VALID:
- case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
- case X509_V_ERR_CERT_HAS_EXPIRED:
- case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
- break;
- }
-
- return ok;
-}
-
-/******************************************************************************/
-/*
- * Set the SSL certificate and key for the SSL context
- */
-
-int websSSLSetCertStuff(SSL_CTX *ctx, char *certFile, char *keyFile)
-{
- a_assert (ctx);
- a_assert (certFile);
-
- if (certFile != NULL) {
- if (SSL_CTX_use_certificate_file(ctx, certFile,
- SSL_FILETYPE_PEM) <= 0) {
- trace(2, T("SSL: Unable to set certificate file <%s>\n"),
- certFile);
- return -1;
- }
-
- if (keyFile == NULL) {
- keyFile = certFile;
- }
-
- if (SSL_CTX_use_PrivateKey_file(ctx, keyFile, SSL_FILETYPE_PEM) <= 0) {
- trace(2, T("SSL: Unable to set private key file <%s>\n"),
- keyFile);
- return -1;
- }
-
-/*
- * Now we know that a key and cert have been set against
- * the SSL context
- */
- if (!SSL_CTX_check_private_key(ctx)) {
- trace(2, T("SSL: Check of private key file <%s> FAILED!\n"),
- keyFile);
- return -1;
- }
- }
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Set certificate file for SSL context
- */
-
-int websSSLSetCertFile(char_t *certFile)
-{
- a_assert (sslctx);
- a_assert (certFile);
-
- if (sslctx == NULL) {
- return -1;
- }
-
- if (SSL_CTX_use_certificate_file(sslctx, certFile,
- SSL_FILETYPE_PEM) <= 0) {
- return -1;
- }
-/*
- * Confirm that the certificate and the private key jive.
- */
- if (!SSL_CTX_check_private_key(sslctx)) {
- return -1;
- }
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Set key file for SSL context
- */
-
-int websSSLSetKeyFile(char_t *keyFile)
-{
- a_assert (sslctx);
- a_assert (keyFile);
-
- if (sslctx == NULL) {
- return -1;
- }
-
- if (SSL_CTX_use_PrivateKey_file(sslctx, keyFile, SSL_FILETYPE_PEM) <= 0) {
- return -1;
- }
-/*
- * Confirm that the certificate and the private key jive.
- */
- if (!SSL_CTX_check_private_key(sslctx)) {
- return -1;
- }
-
- return 0;
-}
-
-#ifdef SSLC
-extern RSA *RSA_new(void);
-#endif
-
-/******************************************************************************/
-/*
- * the Temporary RSA callback
- */
-
-static RSA *websSSLTempRSACallback(SSL *ssl, int isExport, int keyLength)
-{
- static RSA *rsaTemp = NULL;
-
- if (rsaTemp == NULL) {
-
-#ifdef OPENSSL
- rsaTemp = RSA_generate_key(keyLength, RSA_F4, NULL, NULL);
-#endif
-
-#ifdef SSLC
- rsaTemp = RSA_new();
-#endif
-
- }
-
- return rsaTemp;
-}
-
-/******************************************************************************/
-/*
- * Free SSL resources
- */
-
-int websSSLFree(websSSL_t *wsp)
-{
- if (wsp == NULL) {
- return -1;
- }
-
-/*
- * Make sure we re-use sessions
- */
- if (wsp->ssl != NULL) {
- SSL_set_shutdown(wsp->ssl, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
- }
-
- if (wsp->bio != NULL) {
- BIO_free_all(wsp->bio);
- }
-
- bfree(B_L, wsp);
-
- return 0;
-}
-
-/******************************************************************************/
-/*
- * Return Eof for the SSL BIO
- */
-
-int websSSLEof(websSSL_t *wsp)
-{
- a_assert(wsp);
-
- if ((wsp == NULL) || (wsp->bio == NULL)) {
- return -1;
- }
-
- return BIO_eof(wsp->bio);
-}
-
-/******************************************************************************/
-/*
- * Perform a read of the SSL BIO
- */
-
-int websSSLRead(websSSL_t *wsp, char_t *buf, int len)
-{
- a_assert(wsp);
- a_assert(buf);
-
- if ((wsp == NULL) || (wsp->bio == NULL)) {
- return -1;
- }
-
- return BIO_read(wsp->bio, buf, len);
-}
-
-/******************************************************************************/
-/*
- * Perform a gets of the SSL BIO, returning an balloc'ed string
- */
-
-#define BUF_BLOCK 256
-
-int websSSLGets(websSSL_t *wsp, char_t **buf)
-{
- int rc, len, lenBuf;
- char c;
-
- a_assert(wsp);
- a_assert(buf);
-
- lenBuf = 0;
- len = 0;
-
- if ((wsp == NULL) || (wsp->bio == NULL)) {
- return -1;
- }
-
- while (1) {
-
- if ((rc = BIO_read(wsp->bio, &c, 1)) < 0) {
- return rc;
- }
-
- if (rc == 0) {
-/*
- * If there is a partial line and we are at EOF, pretend we saw a '\n'
- */
- if (len > 0 && BIO_eof(wsp->bio)) {
- c = '\n';
- } else {
- return -1;
- }
- }
-/*
- * If a newline is seen, return the data excluding the new line to the
- * caller. If carriage return is seen, just eat it.
- */
- if (c == '\n') {
- if ((len > 0) && (len < lenBuf)) {
- (*buf)[len] = 0;
- }
- return len;
- } else if (c == '\r') {
- continue;
- }
-/*
- * Append character to buf
- */
- if (len >= lenBuf) {
- lenBuf += BUF_BLOCK;
- *buf = brealloc(B_L, *buf, lenBuf);
- }
-
- a_assert(*buf);
- (*buf)[len] = c;
- len++;
- }
-}
-
-/******************************************************************************/
-/*
- * Perform a write to the SSL BIO
- */
-
-int websSSLWrite(websSSL_t *wsp, char_t *buf, int len)
-{
- a_assert(wsp);
- a_assert(buf);
-
- if ((wsp == NULL) || (wsp->bio == NULL)) {
- return -1;
- }
-
- return BIO_write(wsp->bio, buf, len);
-}
-
-/******************************************************************************/
-/*
- * Perform a flush of the SSL BIO
- */
-
-int websSSLFlush(websSSL_t *wsp)
-{
- a_assert(wsp);
-
- if ((wsp == NULL) || (wsp->bio == NULL)) {
- return -1;
- }
-
- return BIO_flush(wsp->bio);
-}
-
-/******************************************************************************/
-
-#endif
diff --git a/xbmc/lib/libGoAhead/src/websSSL.h b/xbmc/lib/libGoAhead/src/websSSL.h deleted file mode 100644 index e72ce168be..0000000000 --- a/xbmc/lib/libGoAhead/src/websSSL.h +++ /dev/null @@ -1,66 +0,0 @@ -/*
- * websSSL.h -- SSL Patch header
- *
- * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved.
- *
- * See the file "license.txt" for information on usage and redistribution
- *
- * $Id: websSSL.h,v 1.3 2003/09/29 19:50:50 bporter Exp $
- */
-
-#ifndef _h_websSSL
-#define _h_websSSL 1
-
-/******************************** Description *********************************/
-
-/*
- * Header file for the GoAhead Patch for SSL. This defines the interface to
- * integrate SSL into the GoAhead Webserver.
- */
-
-/********************************* Includes ***********************************/
-
-#define OPENSSL
-#ifdef OPENSSL
-#define SSLEAY /* turn off a few special case MONOLITH macros */
-#define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */
-#include <openssl/ssl.h>
-#else
-#include <sslc.h>
-#endif
-
-#ifndef UEMF
- #include "basic/basic.h"
- #include "emf/emf.h"
-#else
- #include "uemf.h"
-#endif
-
-/********************************** Defines ***********************************/
-typedef struct {
- SSL *ssl;
- BIO *bio;
-} websSSL_t;
-
-/******************************** Prototypes **********************************/
-
-extern int websSSLOpen();
-extern int websSSLIsOpen();
-extern void websSSLClose();
-
-extern int websSSLWrite(websSSL_t *wsp, char_t *buf, int nChars);
-extern int websSSLGets(websSSL_t *wsp, char_t **buf);
-extern int websSSLRead(websSSL_t *wsp, char_t *buf, int nChars);
-extern int websSSLEof(websSSL_t *wsp);
-
-extern int websSSLFree(websSSL_t *wsp);
-extern int websSSLFlush(websSSL_t *wsp);
-
-extern int websSSLSetKeyFile(char_t *keyFile);
-extern int websSSLSetCertFile(char_t *certFile);
-
-
-#endif /* _h_websSSL */
-
-/*****************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/websda.c b/xbmc/lib/libGoAhead/src/websda.c deleted file mode 100644 index 203d7129f1..0000000000 --- a/xbmc/lib/libGoAhead/src/websda.c +++ /dev/null @@ -1,245 +0,0 @@ -/*
- * websda.c -- Digest Access Authentication routines
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: websda.c,v 1.2 2002/10/24 14:44:50 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * Routines for generating DAA data. The module uses the
- * "RSA Data Security, Inc. MD5 Message-Digest Algorithm" found in md5c.c
- */
-
-/********************************* Includes ***********************************/
-
-#ifndef CE
-#include <time.h>
-#endif
-#include "websda.h"
-#include "md5.h"
-
-/******************************** Local Data **********************************/
-
-#define RANDOMKEY T("onceuponatimeinparadise")
-#define NONCE_SIZE 34
-#define HASH_SIZE 16
-
-/*********************************** Code *************************************/
-/*
- * websMD5binary returns the MD5 hash
- */
-
-char *websMD5binary(unsigned char *buf, int length)
-{
- const char *hex = "0123456789abcdef";
- MD5_CONTEXT md5ctx;
- unsigned char hash[HASH_SIZE];
- char *r, *strReturn;
- char result[(HASH_SIZE * 2) + 1];
- int i;
-
-/*
- * Take the MD5 hash of the string argument.
- */
- MD5Init(&md5ctx);
- MD5Update(&md5ctx, buf, (unsigned int)length);
- MD5Final(hash, &md5ctx);
-
-/*
- * Prepare the resulting hash string
- */
- for (i = 0, r = result; i < 16; i++) {
- *r++ = hex[hash[i] >> 4];
- *r++ = hex[hash[i] & 0xF];
- }
-
-/*
- * Zero terminate the hash string
- */
- *r = '\0';
-
-/*
- * Allocate a new copy of the hash string
- */
- strReturn = balloc(B_L, sizeof(result));
- strcpy(strReturn, result);
-
- return strReturn;
-}
-
-/*****************************************************************************/
-/*
- * Convenience call to websMD5binary
- * (Performs char_t to char conversion and back)
- */
-
-char_t *websMD5(char_t *string)
-{
- char_t *strReturn;
-
- a_assert(string && *string);
-
- if (string && *string) {
- char *strTemp, *strHash;
- int nLen;
-/*
- * Convert input char_t string to char string
- */
- nLen = gstrlen(string);
- strTemp = ballocUniToAsc(string, nLen + 1);
-/*
- * Execute the digest calculation
- */
- strHash = websMD5binary((unsigned char *)strTemp, nLen);
-/*
- * Convert the returned char string digest to a char_t string
- */
- nLen = strlen(strHash);
- strReturn = ballocAscToUni(strHash, nLen);
-/*
- * Free up the temporary allocated resources
- */
- bfree(B_L, strTemp);
- bfree(B_L, strHash);
- } else {
- strReturn = NULL;
- }
-
- return strReturn;
-}
-
-/******************************************************************************/
-/*
- * Get a Nonce value for passing along to the client. This function
- * composes the string "RANDOMKEY:timestamp:myrealm" and
- * calculates the MD5 digest placing it in output.
- */
-
-char_t *websCalcNonce(webs_t wp)
-{
- char_t *nonce, *prenonce;
- struct tm *newtime;
- time_t longTime;
-
- a_assert(wp);
-/*
- * Get time as long integer.
- */
- time(&longTime);
-/*
- * Convert to local time.
- */
- newtime = localtime(&longTime);
-/*
- * Create prenonce string.
- */
- prenonce = NULL;
-#ifdef DIGEST_ACCESS_SUPPORT
- fmtAlloc(&prenonce, 256, T("%s:%s:%s"), RANDOMKEY, gasctime(newtime),
- wp->realm);
-#else
- fmtAlloc(&prenonce, 256, T("%s:%s:%s"), RANDOMKEY, gasctime(newtime),
- RANDOMKEY);
-#endif
- a_assert(prenonce);
-/*
- * Create the nonce
- */
- nonce = websMD5(prenonce);
-/*
- * Cleanup
- */
- bfreeSafe(B_L, prenonce);
-
- return nonce;
-}
-
-/******************************************************************************/
-/*
- * Get an Opaque value for passing along to the client
- */
-
-char_t *websCalcOpaque(webs_t wp)
-{
- char_t *opaque;
- a_assert(wp);
-/*
- * Temporary stub!
- */
- opaque = bstrdup(B_L, T("5ccc069c403ebaf9f0171e9517f40e41"));
-
- return opaque;
-}
-
-/******************************************************************************/
-/*
- * Get a Digest value using the MD5 algorithm
- */
-
-char_t *websCalcDigest(webs_t wp)
-{
-#ifdef DIGEST_ACCESS_SUPPORT
- char_t *digest, *a1, *a1prime, *a2, *a2prime, *preDigest, *method;
-
- a_assert(wp);
- digest = NULL;
-
-/*
- * Calculate first portion of digest H(A1)
- */
- a1 = NULL;
- fmtAlloc(&a1, 255, T("%s:%s:%s"), wp->userName, wp->realm, wp->password);
- a_assert(a1);
- a1prime = websMD5(a1);
- bfreeSafe(B_L, a1);
-/*
- * Calculate second portion of digest H(A2)
- */
- method = websGetVar(wp, T("REQUEST_METHOD"), NULL);
- a_assert(method);
- a2 = NULL;
- fmtAlloc(&a2, 255, T("%s:%s"), method, wp->uri);
- a_assert(a2);
- a2prime = websMD5(a2);
- bfreeSafe(B_L, a2);
-/*
- * Construct final digest KD(H(A1):nonce:H(A2))
- */
- a_assert(a1prime);
- a_assert(a2prime);
- a_assert(wp->nonce);
-
- preDigest = NULL;
- if (!wp->qop) {
- fmtAlloc(&preDigest, 255, T("%s:%s:%s"), a1prime, wp->nonce, a2prime);
- } else {
- fmtAlloc(&preDigest, 255, T("%s:%s:%s:%s:%s:%s"),
- a1prime,
- wp->nonce,
- wp->nc,
- wp->cnonce,
- wp->qop,
- a2prime);
- }
-
- a_assert(preDigest);
- digest = websMD5(preDigest);
-/*
- * Now clean up
- */
- bfreeSafe(B_L, a1prime);
- bfreeSafe(B_L, a2prime);
- bfreeSafe(B_L, preDigest);
- return digest;
-#else
- return NULL;
-#endif /* DIGEST_ACCESS_SUPPORT */
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/websda.h b/xbmc/lib/libGoAhead/src/websda.h deleted file mode 100644 index f17300eba9..0000000000 --- a/xbmc/lib/libGoAhead/src/websda.h +++ /dev/null @@ -1,42 +0,0 @@ -/*
- * websda.h -- GoAhead Digest Access Authentication public header
- *
- * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved.
- *
- * See the file "license.txt" for information on usage and redistribution
- *
- * $Id: websda.h,v 1.3 2002/10/24 14:44:50 bporter Exp $
- */
-
-#ifndef _h_WEBSDA
-#define _h_WEBSDA 1
-
-/******************************** Description *********************************/
-
-/*
- * GoAhead Digest Access Authentication header. This defines the Digest
- * access authentication public APIs. Include this header for files that
- * use DAA functions
- */
-
-/********************************* Includes ***********************************/
-
-#ifndef UEMF
- #include "basic/basic.h"
- #include "emf/emf.h"
-#else
- #include "uemf.h"
-#endif
-
-#include "webs.h"
-
-/****************************** Definitions ***********************************/
-
-extern char_t *websCalcNonce(webs_t wp);
-extern char_t *websCalcOpaque(webs_t wp);
-extern char_t *websCalcDigest(webs_t wp);
-
-#endif /* _h_WEBSDA */
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/websuemf.c b/xbmc/lib/libGoAhead/src/websuemf.c deleted file mode 100644 index 84d7677ea7..0000000000 --- a/xbmc/lib/libGoAhead/src/websuemf.c +++ /dev/null @@ -1,218 +0,0 @@ -/*
- * websuemf.c -- GoAhead Micro Embedded Management Framework
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: websuemf.c,v 1.4 2002/10/24 14:44:50 bporter Exp $
- */
-
-/********************************** Description *******************************/
-
-/*
- * This modules provides compatibility with the full GoAhead EMF.
- */
-
-/*********************************** Includes *********************************/
-
-#include "ejIntrn.h"
-#include "wsIntrn.h"
-
-/*********************************** Defines **********************************/
-
-/*
- * This structure stores scheduled events.
- */
-typedef struct {
- void (*routine)(void *arg, int id);
- void *arg;
- time_t at;
- int schedid;
-} sched_t;
-
-/*********************************** Locals ***********************************/
-
-static sched_t **sched;
-static int schedMax;
-
-/************************************* Code ***********************************/
-/*
- * Evaluate a script
- */
-
-int scriptEval(int engine, char_t *cmd, char_t **result, void* chan)
-{
- int ejid;
-
- if (engine == EMF_SCRIPT_EJSCRIPT) {
- ejid = (int) chan;
- /*
- * NOTE -- to disable better reporting of ASP errors, change the
- * following line of code to
- * if (ejEval(ejid, cmd, NULL) ) {
- */
- if (ejEval(ejid, cmd, result) ) {
- return 0;
- } else {
- return -1;
- }
- }
- return -1;
-}
-
-/******************************************************************************/
-/*
- * Compare strings, ignoring case: normal strcmp return codes.
- *
- * WARNING: It is not good form to increment or decrement pointers inside a
- * "call" to tolower et al. These can be MACROS, and have undesired side
- * effects.
- */
-
-int strcmpci(char_t *s1, char_t *s2)
-{
- int rc;
-
- a_assert(s1 && s2);
- if (s1 == NULL || s2 == NULL) {
- return 0;
- }
-
- if (s1 == s2) {
- return 0;
- }
-
- do {
- rc = gtolower(*s1) - gtolower(*s2);
- if (*s1 == '\0') {
- break;
- }
- s1++;
- s2++;
- } while (rc == 0);
- return rc;
-}
-
-/******************************************************************************/
-/*
- * This function is called when a scheduled process time has come.
- */
-
-void TimerProc(int schedid)
-{
- sched_t *s;
-
- a_assert(0 <= schedid && schedid < schedMax);
- s = sched[schedid];
- a_assert(s);
-
- (s->routine)(s->arg, s->schedid);
-}
-
-/******************************************************************************/
-/*
- * Schedule an event in delay milliseconds time. We will use 1 second
- * granularity for webServer.
- */
-
-int emfSchedCallback(int delay, emfSchedProc *proc, void *arg)
-{
- sched_t *s;
- int schedid;
-
- if ((schedid = hAllocEntry((void***) &sched, &schedMax,
- sizeof(sched_t))) < 0) {
- return -1;
- }
- s = sched[schedid];
- s->routine = proc;
- s->arg = arg;
- s->schedid = schedid;
-
-/*
- * Round the delay up to seconds.
- */
- s->at = ((delay + 500) / 1000) + time(0);
-
- return schedid;
-}
-
-/******************************************************************************/
-/*
- * Reschedule to a new delay.
- */
-
-void emfReschedCallback(int schedid, int delay)
-{
- sched_t *s;
-
- if (sched == NULL || schedid == -1 || schedid >= schedMax ||
- (s = sched[schedid]) == NULL) {
- return;
- }
- s->at = ((delay + 500) / 1000) + time(0);
-}
-
-/******************************************************************************/
-
-void emfUnschedCallback(int schedid)
-{
- sched_t *s;
-
- if (sched == NULL || schedid == -1 || schedid >= schedMax ||
- (s = sched[schedid]) == NULL) {
- return;
- }
- bfree(B_L, s);
- schedMax = hFree((void***) &sched, schedid);
-}
-
-/******************************************************************************/
-/*
- * Take the tasks off the queue in a round robin fashion.
- */
-
-void emfSchedProcess()
-{
- sched_t *s;
- int schedid;
- static int next = 0;
-
-/*
- * If schedMax is 0, there are no tasks scheduled, so just return.
- */
- if (schedMax <= 0) {
- return;
- }
-
-/*
- * If next >= schedMax, the schedule queue was reduced in our absence
- * so reset next to 0 to start from the begining of the queue again.
- */
- if (next >= schedMax) {
- next = 0;
- }
-
- schedid = next;
- for (;;) {
- if ((s = sched[schedid]) != NULL && (int)s->at <= (int)time(0)) {
- TimerProc(schedid);
- next = schedid + 1;
- return;
- }
- if (++schedid >= schedMax) {
- schedid = 0;
- }
- if (schedid == next) {
-/*
- * We've gone all the way through the queue without finding
- * anything to do so just return.
- */
- return;
- }
- }
-}
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/src/wsIntrn.h b/xbmc/lib/libGoAhead/src/wsIntrn.h deleted file mode 100644 index c2b4160883..0000000000 --- a/xbmc/lib/libGoAhead/src/wsIntrn.h +++ /dev/null @@ -1,318 +0,0 @@ -/*
- * wsIntrn.h -- Internal GoAhead Web server header
- *
- * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved.
- *
- * See the file "license.txt" for information on usage and redistribution
- *
- * $Id: wsIntrn.h,v 1.4 2002/10/24 14:44:50 bporter Exp $
- */
-
-#ifndef _h_WEBS_INTERNAL
-#define _h_WEBS_INTERNAL 1
-
-/******************************** Description *********************************/
-
-/*
- * Internal GoAhead Web Server header. This defines the Web private APIs
- * Include this header when you want to create URL handlers.
- */
-
-/*********************************** Defines **********************************/
-
-/*
- * Define this to enable logging of web accesses to a file
- * #define WEBS_LOG_SUPPORT 1
- *
- * Define this to enable HTTP/1.1 keep alive support
- * #define WEBS_KEEP_ALIVE_SUPPORT 1
- *
- * Define this to enable if-modified-since support
- * #define WEBS_IF_MODIFIED_SUPPORT 1
- *
- * Define this to support proxy capability and track local vs remote request
- * Note: this is not yet fully implemented.
- * #define WEBS_PROXY_SUPPORT 1
- *
- * Define this to support reading pages from ROM
- * #define WEBS_PAGE_ROM 1
- *
- * Define this to enable memory allocation and stack usage tracking
- * #define B_STATS 1
- */
-
-/********************************** Includes **********************************/
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-#ifdef NETWARE
- #include <fcntl.h>
- #include <sys/stat.h>
- #include <signal.h>
- #include <io.h>
-#endif
-
-#ifdef WIN
- #include <fcntl.h>
- #include <sys/stat.h>
- #include <io.h>
-#endif
-
-#ifdef CE
-#ifndef UEMF
- #include <io.h>
-#endif
-#endif
-
-#ifdef NW
- #include <fcntl.h>
- #include <sys/stat.h>
-#endif
-
-#ifdef SCOV5
- #include <fcntl.h>
- #include <sys/stat.h>
- #include <signal.h>
- #include <unistd.h>
-#endif
-
-#ifdef LYNX
- #include <fcntl.h>
- #include <sys/stat.h>
- #include <signal.h>
- #include <unistd.h>
-#endif
-
-#ifdef UNIX
- #include <fcntl.h>
- #include <sys/stat.h>
- #include <signal.h>
- #include <unistd.h>
-#endif
-
-#ifdef QNX4
- #include <fcntl.h>
- #include <sys/stat.h>
- #include <signal.h>
- #include <unistd.h>
- #include <unix.h>
-#endif
-
-#ifdef UW
- #include <fcntl.h>
- #include <sys/stat.h>
-#endif
-
-#ifdef VXWORKS
- #include <vxWorks.h>
- #include <fcntl.h>
- #include <sys/stat.h>
-#endif
-
-#ifdef SOLARIS
- #include <macros.h>
- #include <fcntl.h>
- #include <sys/stat.h>
-#endif
-
-#ifdef UEMF
- #include "uemf.h"
- #include "ejIntrn.h"
-#else
- #include "emf/emfInternal.h"
- #include "ej/ejIntrn.h"
-#endif
-
-#include "webs.h"
-
-/********************************** Defines ***********************************/
-/*
- * Read handler flags and state
- */
-#define WEBS_BEGIN 0x1 /* Beginning state */
-#define WEBS_HEADER 0x2 /* Ready to read first line */
-#define WEBS_POST 0x4 /* POST without content */
-#define WEBS_POST_CLEN 0x8 /* Ready to read content for POST */
-#define WEBS_PROCESSING 0x10 /* Processing request */
-#define WEBS_KEEP_TIMEOUT 15000 /* Keep-alive timeout (15 secs) */
-#define WEBS_TIMEOUT 60000 /* General request timeout (60) */
-
-#define PAGE_READ_BUFSIZE 512 /* bytes read from page files */
-#define MAX_PORT_LEN 10 /* max digits in port number */
-#define WEBS_SYM_INIT 64 /* initial # of sym table entries */
-
-/*
- * URL handler structure. Stores the leading URL path and the handler
- * function to call when the URL path is seen.
- */
-typedef struct {
- int (*handler)(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg,
- char_t *url, char_t *path,
- char_t *query); /* Callback URL handler function */
- char_t *webDir; /* Web directory if required */
- char_t *urlPrefix; /* URL leading prefix */
- int len; /* Length of urlPrefix for speed */
- int arg; /* Argument to provide to handler */
- int flags; /* Flags */
-} websUrlHandlerType;
-
-/*
- * Webs statistics
- */
-typedef struct {
- long errors; /* General errors */
- long redirects;
- long net_requests;
- long activeNetRequests;
- long activeBrowserRequests;
- long timeouts;
- long access; /* Access violations */
- long localHits;
- long remoteHits;
- long formHits;
- long cgiHits;
- long handlerHits;
-} websStatsType;
-
-extern websStatsType websStats; /* Web access stats */
-
-/*
- * Error code list
- */
-typedef struct {
- int code; /* HTTP error code */
- char_t *msg; /* HTTP error message */
-} websErrorType;
-
-/*
- * Mime type list
- */
-typedef struct {
- char_t *type; /* Mime type */
- char_t *ext; /* File extension */
-} websMimeType;
-
-/*
- * File information structure.
- */
-typedef struct {
- unsigned long size; /* File length */
- int isDir; /* Set if directory */
- time_t mtime; /* Modified time */
-} websStatType;
-
-/*
- * Compiled Rom Page Index
- */
-typedef struct {
- char_t *path; /* Web page URL path */
- unsigned char *page; /* Web page data */
- int size; /* Size of web page in bytes */
- int pos; /* Current read position */
-} websRomPageIndexType;
-
-/*
- * Defines for file open.
- */
-#ifndef CE
-#define SOCKET_RDONLY O_RDONLY
-#define SOCKET_BINARY O_BINARY
-#else /* CE */
-#define SOCKET_RDONLY 0x1
-#define SOCKET_BINARY 0x2
-#endif /* CE */
-
-extern websRomPageIndexType websRomPageIndex[];
-extern websMimeType websMimeList[]; /* List of mime types */
-extern sym_fd_t websMime; /* Set of mime types */
-extern webs_t* webs; /* Session list head */
-extern int websMax; /* List size */
-extern char_t websHost[64]; /* Name of this host */
-extern char_t websIpaddr[64]; /* IP address of this host */
-extern char_t *websHostUrl; /* URL for this host */
-extern char_t *websIpaddrUrl; /* URL for this host */
-extern int websPort; /* Port number */
-
-/******************************** Prototypes **********************************/
-
-extern int websAspOpen();
-extern void websAspClose();
-
-extern int websSpyOpen();
-extern void websSpyClose();
-extern void setSpyOpenCallback(int (*)());
-extern void setSpyCloseCallback(void (*)());
-extern void setSpyRequestCallback(int (*)(webs_t wp, char_t *lpath));
-
-extern void websFormOpen();
-extern void websFormClose();
-extern int websAspWrite(int ejid, webs_t wp, int argc, char_t **argv);
-extern int websAspIsSet(int ejid, webs_t wp, int argc, char_t **argv);
-extern void websDefaultClose();
-extern int websDefaultHandler(webs_t wp, char_t *urlPrefix,
- char_t *webDir, int arg, char_t *url, char_t *path,
- char_t *query);
-extern int websFormHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
- int arg, char_t *url, char_t *path, char_t *query);
-extern int websCgiHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
- int arg, char_t *url, char_t *path, char_t *query);
-extern void websCgiCleanup();
-extern int websCheckCgiProc(int handle);
-extern char_t *websGetCgiCommName();
-
-extern int websLaunchCgiProc(char_t *cgiPath, char_t **argp,
- char_t **envp, char_t *stdIn, char_t *stdOut);
-extern int websOpen(int sid);
-extern void websResponse(webs_t wp, int code, char_t *msg,
- char_t *redirect);
-extern int websJavaScriptEval(webs_t wp, char_t *script);
-extern int websPageReadData(webs_t wp, char *buf, int nBytes);
-extern int websPageOpen(webs_t wp, char_t *lpath, char_t *path, int mode,
- int perm);
-extern void websPageClose(webs_t wp);
-extern void websPageSeek(webs_t wp, long offset);
-extern int websPageStat(webs_t wp, char_t *lpath, char_t *path,
- websStatType *sbuf);
-extern int websPageIsDirectory(char_t *lpath);
-extern int websRomOpen();
-extern void websRomClose();
-extern int websRomPageOpen(webs_t wp, char_t *path, int mode, int perm);
-extern void websRomPageClose(int fd);
-extern int websRomPageReadData(webs_t wp, char *buf, int len);
-extern int websRomPageStat(char_t *path, websStatType *sbuf);
-extern long websRomPageSeek(webs_t wp, long offset, int origin);
-extern void websSetRequestSocketHandler(webs_t wp, int mask,
- void (*fn)(webs_t wp));
-extern int websSolutionHandler(webs_t wp, char_t *urlPrefix,
- char_t *webDir, int arg, char_t *url, char_t *path,
- char_t *query);
-extern void websUrlHandlerClose();
-extern int websUrlHandlerOpen();
-extern int websOpenServer(int port, int retries);
-extern void websCloseServer();
-extern char_t* websGetDateString(websStatType* sbuf);
-
-extern int strcmpci(char_t* s1, char_t* s2);
-
-/*
- * Prototypes for functions available when running as part of the
- * GoAhead Embedded Management Framework (EMF)
- */
-#ifdef EMF
-extern int websEmfOpen();
-extern void websEmfClose();
-extern void websSetEmfEnvironment(webs_t wp);
-#endif
-
-#ifdef CE
-extern int writeUniToAsc(int fid, void *buf, unsigned int len);
-extern int readAscToUni(int fid, void **buf, unsigned int len);
-#endif
-
-#endif /* _h_WEBS_INTERNAL */
-
-/******************************************************************************/
-
diff --git a/xbmc/lib/libGoAhead/web/FAQ.htm b/xbmc/lib/libGoAhead/web/FAQ.htm deleted file mode 100644 index 9ffccbe115..0000000000 --- a/xbmc/lib/libGoAhead/web/FAQ.htm +++ /dev/null @@ -1,181 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>Untitled Document</TITLE>
-<link rel="stylesheet" href="style/normal_ws.css">
-</HEAD>
-
-<BODY>
-
-<table width="550"> <tr><td>
-<H1>Frequently Asked Questions</H1><P>The most common FAQs concerning GoAhead WebServer are provided here. For additional sources of WebServer information, please visit both the GoAhead on-line <A HREF="http://goahead.custhelp.com/cgi-bin/goahead" TARGET="new">support center</a> and the <A HREF="news://news.goahead.com/goahead.public.webserver" TARGET ="new"> GoAhead WebServer newsgroup</a>.
-<H3>WebServer FAQs
-
-</H3><P><A HREF="#1">Why
- is GoAhead Software distributing royalty free embedded web server
- source code? </A><BR>
- <A HREF="#2">What is the GoAhead WebServer?</A> <BR>
- <A HREF="#3">Why use the GoAhead WebServer? </A><BR>
- <A HREF="#4">What is included with the source code? </A><BR>
- <A HREF="#5">What standards does the GoAhead WebServer conform to?
- </A><BR>
- <A HREF="#6">How fast is it? </A><BR>
- <A HREF="#7">How big is the code? </A><BR>
- <A HREF="#8">Does the GoAhead WebServer support dynamic pages? </A><BR>
- <A HREF="#9">What are the benefits of Active Server Pages? </A><BR>
- <A HREF="#10">Does the GoAhead WebServer have any level of security?
- </A><BR>
- <A HREF="#11">Are tools available to help the development and integration
- process? </A><BR>
- <A HREF="#12">What are the licensing terms?</A><BR>
- <A HREF="#13">How is the GoAhead WebServer supported? </A><BR>
- <A HREF="#14">Which platforms are supported? </A><BR>
- <A HREF="#15">What are the features of GoAhead WebServer? </A> </P><P> <I><B>Why
- is GoAhead Software distributing royalty free embedded web server
- source code?</B> <A NAME="1"></A></I><BR>
- Our goal in releasing GoAhead WebServer under an open source license
- is to help put a Web server in every device, harness the pool of
- talented developers, and enhance the reliability of GoAhead WebServer
- by leveraging the test and debugging efforts of thousands of companies.
- </P><P> <I><B>What
- is the GoAhead WebServer?</B></I> <A NAME="2"></A><BR>
- The GoAhead WebServer is a fully functional, standards-based embedded
- web server designed for cross-platform support. Its functionality
- includes Active Server Pages (ASP) for delivering dynamic HTML pages,
- in-process CGI, embedded JavaScript and an open, extensible scripting
- architecture. </P><P> <I><B>Why
- use the GoAhead WebServer?</B></I> <A NAME="3"></A><BR>
- Not only is GoAhead WebServer a fast, efficient, high-end Web server,
- but it is also based on industry standards and royalty free. Many
- companies have developed Web servers that range in price from a
- few thousand dollars to nearly $100,000 when the royalty fees are
- incurred. Most commercial Web servers also define proprietary tags
- which require you to use their development tools or learn new languages.
- GoAhead WebServer uses industry standards like JavaScript and ASP
- so you don't have to change the way you work. </P><P> <I><B>What
- is included with the source code?</B></I> <A NAME="4"></A><BR>
- The distribution includes GoAhead WebServer source code written
- in C, makefiles, and reference platforms for Windows CE, Wind River
- VxWorks, Linux, Lynx, eCos, and Windows 95/98/NT. </P><P> <I><B>What
- standards does the the GoAhead WebServer conform to?</B> </I><A NAME="5"></A><BR>
- The GoAhead WebServer conforms to HTTP 1.0 and includes some performance
- enhancements of HTTP 1.1 including persistent connections. The architecture
- is also compatible with the GoAhead Embedded Management Framework.
- </P><P> <I><B>How
- fast is it?</B></I> <A NAME="6"></A><BR>
- GoAhead WebServer can service 20 requests per second on a 24MHz
- 68040, 50/sec on 266 MHz Pentium and draws on GoAhead's PC Magazine
- Editor's Choice award winning internet accelerator technology. </P><P> <I><B>How
- big is the code?</B></I> <A NAME="7"></A><BR>
- The footprint of the compiled version of the embedded server in
- a Windows CE environment is less than 60K of code. </P><P> <I><B>Does
- the GoAhead WebServer support dynamic pages?</B></I> <A NAME="8"></A><BR>
- Yes, utilizing embedded JavaScript, Active Server Pages, and in-process
- CGI. </P><P> <I><B>What
- are the benefits of Active Server Pages?</B></I> <A NAME="9"></A><BR>
- An Active Server Page (ASP) is an HTML page that is processed on
- the web server before the page is sent to the user. The script
- in the web page accesses data or a designated API and then builds
- or customizes the page "on the fly" before sending it to the requester.
- Active Server Pages is an open technology framework and can use
- scripts written in C++, Visual Basic, and Java. Active Server Pages
- is the premier standards based method for creating dynamic web pages.
- Rather than using a proprietary method of integrating dynamic data
- into a page, ASP is a pervasive 2nd generation standard pioneered
- by Microsoft. </P><P> <I><B>Does
- the GoAhead WebServer have any level of security?</B> </I><A NAME="10"></A><BR>
- Yes, security for the GoAhead WebServer is supported via the basic
- encoding HTTP/1.0 standard. </P><P> <I><B>Are
- tools available to help the development and integration process?</B></I>
- <A NAME="11"></A><BR>
- Yes, GoAhead’s Embedded Management Framework integrated development
- environment provides a rapid application development environment.
- </P><P> <I><B>What
- are the licensing terms?</B> </I><A NAME="12"></A><BR>
- View the license. All GoAhead asks is that you notify GoAhead before
- you ship product, help promote the Web server by placing the GoAhead
- WebServer logo on your device's home page, agree to act as a reference
- customer, and submit any enhancements of the code back to GoAhead.
- </P>
- <P> <I><B>How is the GoAhead WebServer supported?</B></I> <A NAME="13"></A><BR>
- Support is available through a collaborative Usenet news group, <a href="news://news.goahead.com/goahead.public.webserver">news://news.goahead.com</a>.
- The news group is monitored by Art & Logic, GoAhead’s WebServer
- support partner. Paid support and development services are also available
- through <a href="http://www.artlogic.com/goahead">Art & Logic</a>.
- </P>
- <P> <I><B>Which
- platforms are supported?</B></I> <A NAME="14"></A><BR>
- GoAhead provides the GoAhead WebServer source code for six reference
- platforms, Windows CE, Wind River Systems VxWorks, Linux, Lynx,
- eCos, and Windows 95/98/NT. The code has been tested on a number of
- different platforms and is easily adaptable to most processors by
- licensees. </P><P> <I><B>What
- are the main features of GoAhead WebServer?</B></I><B><I></I></B><A NAME="15"></A> <table width="52%" border="0">
- <tr valign="top">
- <td height="8" width="64%">
- <p> <b>
- <br>
- </b> </p></td><td height="8" width="36%"> </td></tr>
- <tr valign="top">
- <td width="64%"> Royalty
- free </td><td width="36%"> </td></tr>
- <tr valign="top">
- <td width="64%"> Open
- scripting architecture </td><td width="36%"> </td></tr>
- <tr valign="top">
- <td width="64%"> Standards
- compliant </td><td width="36%"> </td></tr>
- <tr valign="top">
- <td width="64%"> Embedded
- web server </td><td width="36%"> </td></tr>
- <tr valign="top">
- <td width="64%">
- Embedded JavaScript </td><td width="36%"> </td></tr>
- <tr valign="top">
- <td width="64%"> Active
- Server Pages Support </td><td width="36%"> </td></tr>
- <tr valign="top">
- <td width="64%"> HTTP/1.0
- Basic Encoding Security </td><td width="36%"> </td></tr>
- <tr valign="top">
- <td width="64%"> </td><td width="36%"> </td></tr>
- <tr>
- <td width="64%"> </td><td width="36%"> </td></tr>
- </table></td></tr></table>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/Support/support.htm b/xbmc/lib/libGoAhead/web/Support/support.htm deleted file mode 100644 index c4e7611d1a..0000000000 --- a/xbmc/lib/libGoAhead/web/Support/support.htm +++ /dev/null @@ -1,31 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>WebServer Support</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-
-
-<body bgcolor="#FFFFFF">
-<table width="550"> <tr><td>
-
- <h1>GoAhead WebServer Customer Services<br>
- </h1>
- <UL>
- <UL>
- <UL>
- <li>To post messages for other users of GoAhead WebServer, visit <a href="news://news.goahead.com/goahead.public.webserver" target="new">news://news.goahead.com/goahead.public.webserver</a>.<br>
- <br>
- </li>
- <LI>To obtain for-fee support services, including platform-specific
- problem resolution, OS porting services, application-specific WebServer
- enhancements, or embedded web application development, see <a href="http://www.artlogic.com/goahead">http://www.artlogic.com/goahead</a>.<br>
- </LI>
- </UL>
- </UL>
- </UL>
- <P> </P><p> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/about.htm b/xbmc/lib/libGoAhead/web/about.htm deleted file mode 100644 index df1d4587c9..0000000000 --- a/xbmc/lib/libGoAhead/web/about.htm +++ /dev/null @@ -1,68 +0,0 @@ -<html>
-<head>
-<title>Company Overview</title>
-<link rel="stylesheet" href="style/normal_ws.css">
-</head>
-
-<BODY>
-<H1>Company Overview </H1><P>GoAhead
- Software is the leading provider of off-the-shelf
- management software for Internet infrastructure devices. GoAhead
- provides solutions that accelerate time-to-market, increase customer
- satisfaction and reduce support costs. GoAhead delivers these
- benefits by making Internet infrastructure devices self-reliant -
- dependable, available, and easy to manage.</P><P>With
- the explosion of the Internet and e-commerce transactions, the
- network and devices that carry the Internet traffic and information
- must be self-reliant and highly available. GoAhead
- products provide remote access and control, configuration
- management, remote upgrading capabilities, fault detection and
- correction, and automatic switchover to enable self-reliance and
- 99.999 percent availability. In addition, GoAhead enables a variety
- of Internet appliances and embedded devices to manage themselves by
- incorporating some of the same technologies including remote
- upgrading, access and control. <P> GoAhead
- Software improves user experiences with technology by making device
- fixes and upgrades transparent and outages a thing of the past. For
- manufacturers, GoAhead products reduce device support costs and
- time-to-market. Devices with GoAhead software do their jobs without
- interruption, don't rely on human intervention, and are less likely
- to become outdated.
-
-<H1>
-Company History</H1><P>GoAhead
- Software, headquartered in Bellevue, Wash., was founded by CEO Michael
- O'Brien in 1995 to develop software for managing complex
- infrastructure devices. His work with system performance and
- monitoring products revealed a critical need for management tools
- that could solve device-specific problems without user intervention.
- GoAhead
- is well positioned for growth with investment backing from Columbia
- Capital, Voyager Capital, Intel and Cedar Grove Investments.
- <H1><B>Products </B></H1><P>GoAhead
- takes a systems approach to self-reliant devices. The suite of
- management software solutions coordinates management across platform
- hardware, operating system, applications, cards and other
- peripherals in a tightly integrated manner. </P><P><B><FONT SIZE="2">GoAhead
- HighAvailability</FONT> </B>enables devices and appliances to provide
- 99.999 percent availability, managing faults so as not to cause
- downtime. Devices quickly and automatically detect and diagnose
- faults and initiate user-defined recovery actions. If necessary,
- devices will automatically transfer operation from active
- components to redundant standby components. </P><P><FONT
- SIZE=2><B>GoAhead
- FieldUpgrader</B> provides the ability to upgrade the software
- inside a device or appliance remotely. This allows the product to
- be fully supported within its embedded environment without direct
- human contact. </FONT>
- </P><P><FONT
- SIZE=2><B>GoAhead
- WebServer</B>, an open source application, enables a device or
- appliance to be accessed from a remote browser for status and control. </FONT></P><P><FONT SIZE=2>GoAhead
- provides development and consulting support for creating and
- integrating software solutions into specific products.</FONT><FONT SIZE=2>GoAhead
- foresees a future that will require Internet infrastructure devices
- to be far more intelligent and self-reliant.GoAhead will remain at
- the leading edge by steadily building upon its technologies to add
- more predictive and learning capabilities to its products.</FONT> </P>
-</BODY></HTML>
diff --git a/xbmc/lib/libGoAhead/web/addgroup.asp b/xbmc/lib/libGoAhead/web/addgroup.asp deleted file mode 100644 index 2dbac5e2fe..0000000000 --- a/xbmc/lib/libGoAhead/web/addgroup.asp +++ /dev/null @@ -1,43 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 2000-2000. All Rights Reserved. ->
-<head>
-<title>Add a User Group</title>
-<meta http-equiv="Pragma" content="no-cache">
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-<h1>Add a User Group</h1>
-<form action=/goform/AddGroup method=POST>
-
-<table>
-<tr>
- <td>Group Name:</td>
-<td>
- <input type=text name=group title="Group Name" size=40 value="">
-</td>
-</tr>
-<tr>
- <td>Privilege:</td><td><% MakePrivilegeList(); %></td>
-</tr>
-<tr>
- <td>Access Method:</td><td><% MakeAccessMethodList(); %></td>
-</tr>
-<tr>
- <td>Enabled:</td>
-<td>
- <INPUT TYPE=checkbox CHECKED name=enabled title="Enabled">
-</td>
-</tr>
-<tr>
- <td></td>
- <td ALIGN="CENTER">
- <input type=submit name=ok value="OK"> <input type=submit name=ok value="Cancel"></td>
-</tr>
-</table>
-
-</form>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/addlimit.asp b/xbmc/lib/libGoAhead/web/addlimit.asp deleted file mode 100644 index 2c278fffdf..0000000000 --- a/xbmc/lib/libGoAhead/web/addlimit.asp +++ /dev/null @@ -1,37 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 2000-2000. All Rights Reserved. ->
-<head>
-<title>Add an Access Limit</title>
-<meta http-equiv="Pragma" content="no-cache">
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-<h1>Add an Access Limit</h1>
-<form action=/goform/AddAccessLimit method=POST>
-
-<table>
-<tr>
- <td>URL:</td><td><input type=text name=url title="URL" size=40 value=""></td>
-</tr>
-<tr>
- <td>Group:</td><td><% MakeGroupList(); %></td>
-</tr>
-<tr>
- <td>Access Method:</td><td><% MakeAccessMethodList(); %></td>
-</tr>
-<tr>
- <td>Secure:</td><td><INPUT TYPE=checkbox name=secure" title="Secure"></td>
-</tr>
-<tr>
- <td></td>
- <td ALIGN="CENTER">
- <input type=submit name=ok value="OK"> <input type=submit name=ok value="Cancel"></td>
-</tr>
-</table>
-
-</form>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/adduser.asp b/xbmc/lib/libGoAhead/web/adduser.asp deleted file mode 100644 index 8c4dc9b1c1..0000000000 --- a/xbmc/lib/libGoAhead/web/adduser.asp +++ /dev/null @@ -1,51 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 2000-2000. All Rights Reserved. ->
-<head>
-<title>Add a User</title>
-<meta http-equiv="Pragma" content="no-cache">
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-<h1>Add a User</h1>
-<form action=/goform/AddUser method=POST>
-<table>
-<tr>
- <td>User ID:</td>
-<td>
- <input type=text name=user title="User ID" size=40 value="">
-</td>
-</tr>
-<tr>
- <td>Group:</td><td><% MakeGroupList(); %></td>
-</tr>
-<tr>
- <td>Enabled:</td>
-<td>
- <INPUT TYPE=checkbox CHECKED name=enabled title="Enabled">
-</td>
-</tr>
-<tr>
- <td>Password:</td>
-<td>
- <input type=password name=password size=40 title="Enter Password" value="">
-</td>
-</tr>
-<tr>
- <td>Confirm:</td>
-<td>
- <input type=password name=passconf size=40 title="Confirm Password" value="">
-</td>
-</tr>
-<tr>
- <td></td>
- <td ALIGN="CENTER">
- <input type=submit name=ok value="OK"> <input type=submit name=ok value="Cancel"></td>
-</tr>
-</table>
-
-</form>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/asp.asp b/xbmc/lib/libGoAhead/web/asp.asp deleted file mode 100644 index eecbb2dbb0..0000000000 --- a/xbmc/lib/libGoAhead/web/asp.asp +++ /dev/null @@ -1,30 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 1999-2000. All Rights Reserved. ->
-<head>
-<title>ASP Test Page</title>
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-
-<h1>ASP / JavaScript™ Test</h1>
-<h2>Expanded ASP data: <% aspTest("Peter Smith", "112 Merry Way"); %></h2>
-
-<P>
-<% var z; \
- for (z=0; z<5; z=z+1) \
- { \
- if (z<=2) \
- write(z+" is less than 3<br>"); \
- else if (z==3) \
- write(z+" is equal to 3<br>"); \
- else \
- write(z+" is greater than 3<br>"); \
- } \
-%>
-</P>
-
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/bogus.asp b/xbmc/lib/libGoAhead/web/bogus.asp deleted file mode 100644 index 3363bcbd2a..0000000000 --- a/xbmc/lib/libGoAhead/web/bogus.asp +++ /dev/null @@ -1,13 +0,0 @@ -
-<html>
-<head>
-<title>Test</title>
-</head>
-<body>
-
-<meta http-equiv="refresh" content="2; URL=bogus.asp">
-<%
-aspTest("OnlyOneParameter");
-%>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/cgi-bin/cgitest.c b/xbmc/lib/libGoAhead/web/cgi-bin/cgitest.c deleted file mode 100644 index 9949807489..0000000000 --- a/xbmc/lib/libGoAhead/web/cgi-bin/cgitest.c +++ /dev/null @@ -1,328 +0,0 @@ -/*
- * cgitest.c -- CGI Test example for the GoAhead WebServer
- *
- * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
- *
- * See the file "license.txt" for usage and redistribution license requirements
- *
- * $Id: cgitest.c,v 1.2 2001/12/06 16:28:24 bporter Exp $
- */
-
-/******************************** Description *********************************/
-
-/*
- * Tests the CGI environment variables generated by the GoAhead Webserver
- */
-
-/********************************* Includes ***********************************/
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-
-/******************************************************************************/
-/*
- * Compare strings, ignoring case: normal strcmp return codes.
- *
- * WARNING: It is not good form to increment or decrement pointers inside a
- * "call" to tolower et al. These can be MACROS, and have undesired side
- * effects.
- */
-
-int strcmpci(char *s1, char *s2)
-{
- int rc;
-
- if (s1 == NULL || s2 == NULL) {
- return 0;
- }
-
- if (s1 == s2) {
- return 0;
- }
-
- do {
- rc = tolower(*s1) - tolower(*s2);
- if (*s1 == '\0') {
- break;
- }
- s1++;
- s2++;
- } while (rc == 0);
-
- return rc;
-}
-
-/*************************************************************************/
-/*
- * gogetenv wraps getenv so that (NULL) is returned if the string is
- * NULL.
- */
-
-char *gogetenv(char *varname)
-{
- char *result;
-
- if ((result = getenv(varname)) == NULL) {
- result = "(NULL)";
- }
- return result;
-}
-
-/*************************************************************************/
-/*
- * Convert a two-char hex string into the char it represents
- */
-
-char x2c(char *what)
-{
- register char digit;
-
- digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0'));
- digit *= 16;
- digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10 : (what[1] - '0'));
-
- return digit;
-}
-
-/*************************************************************************/
-/*
- * Reduce any %xx escape sequences to the characters they represent
- */
-
-void unescape_url(char *url)
-{
- register int i,j;
-
- for(i = 0, j = 0; url[j]; ++i,++j) {
- if((url[i] = url[j]) == '%') {
- url[i] = x2c(&url[j + 1]) ;
- j += 2 ;
- }
- }
-
- url[i] = '\0' ;
-}
-
-/*************************************************************************/
-/*
- * getCGIvars() Routine to read CGI input variables into an
- * array of strings.
- *
- * Written in 1996 by James Marshall, james@jmarshall.com, except
- * that the x2c() and unescape_url() routines were lifted directly
- * from NCSA's sample program util.c, packaged with their HTTPD.
- *
- * For the latest, see http://www.jmarshall.com/easy/cgi/ .
- *
- * Read the CGI input and place all name/val pairs into list.
- * Returns list containing name1, value1, name2, value2, ... , NULL
- */
-
-char **getCGIvars()
-{
- register int i;
- char *request_method, *cgiinput, *nvpair, *eqpos;
- int content_length, paircount;
- char **cgivars, **pairlist;
-
-/*
- * Depending on the request method, read all CGI input into cgiinput
- * (really should produce HTML error messages, instead of exit()ing)
- */
- request_method = gogetenv("REQUEST_METHOD") ;
-
- if (!request_method) {
- request_method = "NOT-CGI";
- }
-
- if (!strcmp(request_method, "GET") || !strcmp(request_method, "HEAD")) {
- cgiinput= strdup(gogetenv("QUERY_STRING"));
- } else if (!strcmp(request_method, "POST")) {
- if (strcmpci(gogetenv("CONTENT_TYPE"), "application/x-www-form-urlencoded")) {
- printf("getcgivars(): Unsupported Content-Type.\n");
- return NULL;
- }
-
- if (!(content_length = atoi(gogetenv("CONTENT_LENGTH")))) {
- printf("getcgivars(): No Content-Length was sent with the POST request.\n");
- return NULL;
- }
-
- if (!(cgiinput = (char *) malloc(content_length + 1))) {
- printf("getcgivars(): Could not malloc for cgiinput.\n") ;
- return NULL;
- }
-
- if (!fread(cgiinput, content_length, 1, stdin)) {
- printf("Couldn't read CGI input from STDIN.\n");
- return NULL;
- }
-
- cgiinput[content_length] = '\0' ;
- } else {
- printf("getcgivars(): unsupported REQUEST_METHOD\n") ;
- return NULL;
- }
-
-/*
- * Change all plusses back to spaces
- */
- for (i = 0; cgiinput[i]; i++) {
- if (cgiinput[i] == '+') {
- cgiinput[i] = ' ';
- }
- }
-
-/*
- * First, split on "&" to extract the name-value pairs into pairlist
- */
- pairlist = (char **) malloc(256 * sizeof(char **));
- paircount = 0 ;
- nvpair = strtok(cgiinput, "&");
-
- while (nvpair) {
- pairlist[paircount++] = strdup(nvpair);
- if (!(paircount % 256)) {
- pairlist= (char **) realloc(pairlist, (paircount + 256)
- * sizeof(char **));
- }
-
- nvpair = strtok(NULL, "&") ;
- }
-
-/*
- * Terminate the pair list with NULL
- */
- pairlist[paircount] = 0;
-
-/*
- * Then, from the list of pairs, extract the names and values
- */
- cgivars = (char **) malloc((paircount * 2 + 1) * sizeof(char **));
- for (i = 0; i < paircount; i++) {
- if (eqpos = strchr(pairlist[i], '=')) {
- *eqpos = '\0' ;
- unescape_url(cgivars[i * 2 + 1] = strdup(eqpos + 1));
- } else {
- unescape_url(cgivars[i * 2 + 1] = strdup(""));
- }
- unescape_url(cgivars[i * 2] = strdup(pairlist[i]));
- }
-
-/*
- * Terminate the cgi var list with NULL
- */
- cgivars[paircount * 2] = 0;
-
-/*
- * Free anything that needs to be freed
- */
- free(cgiinput);
-
- for (i = 0; pairlist[i]; i++) {
- free(pairlist[i]);
- }
-
- free(pairlist);
-
-/*
- * Return the list of name-value strings
- */
- return cgivars;
-
-}
-
-/*************************************************************************/
-/*
- * Test program entry point
- */
-
-int main(int argc, char *argv[])
-{
- char **pVars;
- int loopCount = 1000;
- time_t second;
-
-/*
- * Print the CGI response header, required for all HTML output.
- * Note the extra \n, to send the blank line.
- */
- printf("Content-type: text/html\n\n") ;
-/*
- * Print the HTML header to STDOUT.
- */
- printf("<html>\n");
- printf("<head><title>CGI Output</title></head>\n");
- printf("<body>\n");
-
- printf("<H1>CGI Test Program</H1>\n");
- printf("<P>This program displays the CGI Enviroment</P>\n");
-
-/*
- * Print the CGI environment variables
- */
- printf("<H2>Environment Variables<A NAME=\"env\"></A></H2>\n");
- printf("<P>REQUEST METHOD = %s</P>\n", gogetenv("REQUEST_METHOD"));
- printf("<P>QUERY STRING = %s</P>\n", gogetenv("QUERY_STRING"));
- printf("<P>GATEWAY INTERFACE = %s</P>\n", gogetenv("GATEWAY_INTERFACE"));
- printf("<P>SCRIPT NAME = %s</P>\n", gogetenv("SCRIPT_NAME"));
-
- printf("<P>PATH TRANSLATED = %s</P>\n", gogetenv("PATH_TRANSLATED"));
- printf("<P>PATH INFO = %s</P>\n", gogetenv("PATH_INFO"));
-
- printf("<P>HTTP HOST = %s</P>\n", gogetenv("HTTP_HOST"));
- printf("<P>HTTP ACCEPT = %s</P>\n", gogetenv("HTTP_ACCEPT"));
- printf("<P>HTTP CONNECTION = %s</P>\n", gogetenv("HTTP_CONNECTION"));
-
- printf("<P>REMOTE USER = %s</P>\n", gogetenv("REMOTE_USER"));
- printf("<P>REMOTE HOST = %s</P>\n", gogetenv("REMOTE_HOST"));
- printf("<P>REMOTE ADDR = %s</P>\n", gogetenv("REMOTE_ADDR"));
-
- printf("<P>SERVER NAME = %s</P>\n", gogetenv("SERVER_NAME"));
- printf("<P>SERVER PORT = %s</P>\n", gogetenv("SERVER_PORT"));
- printf("<P>SERVER HOST = %s</P>\n", gogetenv("SERVER_HOST"));
- printf("<P>SERVER PROTOCOL = %s</P>\n", gogetenv("SERVER_PROTOCOL"));
- printf("<P>SERVER ADDR = %s</P>\n", gogetenv("SERVER_ADDR"));
- printf("<P>SERVER URL = %s</P>\n", gogetenv("SERVER_URL"));
- printf("<P>SERVER SOFTWARE = %s</P>\n", gogetenv("SERVER_SOFTWARE"));
-
-/*
- * Print the parsed query string variables
- */
- printf("<H2>Query String Variables<A NAME=\"query\"></A></H2>\n");
- pVars = getCGIvars();
- if (pVars) {
- while (*pVars && *(pVars + 1)) {
- printf("<p>%s = <b>%s</b></p>\n", *pVars, *(pVars + 1));
- pVars += 2;
- }
- } else {
- printf("<P>No query variables found</P>\n");
- }
-
-/*
- * Print 1000 lines of text, 100 lines at a time.
- * Pause for 5 seconds every 100 line chunk
- */
-#ifdef PRINT_BIG_CHUNK_SLOWLY
- printf("<H2>Large chunk of meaningless text<A NAME=\"chunk\"></A></H2>\n");
- while (loopCount) {
- printf("<p>Meaningless line of text number %d.</p>\n", loopCount);
- if ((loopCount % 100) == 0) {
- second = time(NULL);
- while ((time(NULL) - second) < 5) {
- }
- }
- loopCount--;
- }
-#endif
-
- printf("</body>\n");
- printf("</html>\n");
-
- return 0;
-}
-
-/*************************************************************************/
diff --git a/xbmc/lib/libGoAhead/web/classes/Status.jar b/xbmc/lib/libGoAhead/web/classes/Status.jar Binary files differdeleted file mode 100644 index d1f4b71210..0000000000 --- a/xbmc/lib/libGoAhead/web/classes/Status.jar +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/classes/doctor.jar b/xbmc/lib/libGoAhead/web/classes/doctor.jar Binary files differdeleted file mode 100644 index 8903971284..0000000000 --- a/xbmc/lib/libGoAhead/web/classes/doctor.jar +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/classes/tabs.jar b/xbmc/lib/libGoAhead/web/classes/tabs.jar Binary files differdeleted file mode 100644 index e0e4a35f64..0000000000 --- a/xbmc/lib/libGoAhead/web/classes/tabs.jar +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/classes/treeapp.jar b/xbmc/lib/libGoAhead/web/classes/treeapp.jar Binary files differdeleted file mode 100644 index 9a01967953..0000000000 --- a/xbmc/lib/libGoAhead/web/classes/treeapp.jar +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/contents.asp b/xbmc/lib/libGoAhead/web/contents.asp deleted file mode 100644 index bc04c4da17..0000000000 --- a/xbmc/lib/libGoAhead/web/contents.asp +++ /dev/null @@ -1,65 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 1994-2000. All Rights Reserved. ->
-
-<head>
-<title>Contents for Tech Ref Menu Applet</title>
-</head>
-<body>
-<BLOCKQUOTE>
- <pre>
-
-{0} {WebServer Overview} {overview.htm}
-
- {1} {WebServer Licensing} {docs/license.htm}
- {1} {Architecture} {over/architecture.htm}
- {1} {Active Server Pages} {over/asp.htm}
- {1} {Embedded JavaScript} {over/ejs.htm}
- {1} {GoForms} {over/goforms.htm}
- {1} {URL Handlers} {over/urlhandles.htm}
- {1} {CGI Implementation} {over/cgi.htm}
- {1} {Security} {over/security.htm}
- {2} {DAA} {over/digestauth.htm}
- {2} {SSL} {over/ssl.htm}
- {2} {User Management} {over/usermanagement.htm}
-{0} {On-line Documents} {docs.htm}
- {1} {Getting Started Guide} {docs/usersguide.htm}
- {2} {Installing} {docs/user/install.htm}
-
- {2} {Configuring} {docs/user/configure.htm}
- {2} {Accessing} {docs/user/running.htm}
- {2} {RSA Security} {docs/user/RSA.htm}
- {2} {Managing Users} {docs/user/manage.htm}
- {2} {Troubleshooting} {docs/user/trouble.htm}
- {1} {Technical Reference} {docs/techref.htm}
- {2} {WebServer APIs} {docs/techref/wsapi.htm}
- {2} {User Management APIs} {docs/techref/umapi.htm}
- {2} {DAA APIs} {docs/techref/da_api.htm}
- {2} {Database APIs} {docs/techref/dbapi.htm}
- {2} {JavaScript APIs} {docs/techref/ejsapi.htm}
- {2} {Basic APIs} {docs/techref/basicapi.htm}
- {1} {Release Notes} {docs/release.htm}
- {1} {License Agreement} {docs/license.txt}
- {1} {WebServer File List} {docs/files21.txt}
-{0} {User Management} {um.htm}
- {1} {Add a User} {adduser.asp}
- {1} {Delete a User} {deluser.asp}
- {1} {Add a Group} {addgroup.asp}
- {1} {Delete a Group} {delgroup.asp}
- {1} {Add an Access Limit} {addlimit.asp}
- {1} {Delete Access Limit} {dellimit.asp}
- {1} {Save User Config} {savecfg.asp}
- {1} {Load User Config} {loadcfg.asp}
-
-{0} {WebServer Tests} {tests.htm}
-
- {1} {JavaScript} {asp.asp}
-
- {1} {GoForms} {forms.asp}
-
- {1} {HTML} {small.htm}
-{0} {FAQs} {FAQ.htm}
-{0} {Customer Services} {support/support.htm}
-{0} {WebServer Glossary} {glossary/wsglossary.htm}
-</pre></BLOCKQUOTE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/delgroup.asp b/xbmc/lib/libGoAhead/web/delgroup.asp deleted file mode 100644 index 7fbe2f8d43..0000000000 --- a/xbmc/lib/libGoAhead/web/delgroup.asp +++ /dev/null @@ -1,28 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 2000-2000. All Rights Reserved. ->
-<head>
-<title>Delete a User Group</title>
-<meta http-equiv="Pragma" content="no-cache">
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-<h1>Delete a User Group</h1>
-<form action=/goform/DeleteGroup method=POST>
-
-<table>
-<tr>
-<% MakeGroupList(); %>
-</tr>
-<tr>
- <td></td>
- <td ALIGN="CENTER">
- <input type=submit name=ok value="OK"> <input type=submit name=ok value="Cancel"></td>
-</tr>
-</table>
-
-</form>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/dellimit.asp b/xbmc/lib/libGoAhead/web/dellimit.asp deleted file mode 100644 index 27966e3b39..0000000000 --- a/xbmc/lib/libGoAhead/web/dellimit.asp +++ /dev/null @@ -1,28 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 2000-2000. All Rights Reserved. ->
-<head>
-<title>Delete an Access Limit</title>
-<meta http-equiv="Pragma" content="no-cache">
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-<h1>Delete an Access Limit</h1>
-<form action=/goform/DeleteAccessLimit method=POST>
-
-<table>
-<tr>
-<% MakeAccessLimitList(); %>
-</tr>
-<tr>
- <td></td>
- <td ALIGN="CENTER">
- <input type=submit name=ok value="OK"> <input type=submit name=ok value="Cancel"></td>
-</tr>
-</table>
-
-</form>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/deluser.asp b/xbmc/lib/libGoAhead/web/deluser.asp deleted file mode 100644 index 96c62c5add..0000000000 --- a/xbmc/lib/libGoAhead/web/deluser.asp +++ /dev/null @@ -1,28 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 2000-2000. All Rights Reserved. ->
-<head>
-<title>Delete a User</title>
-<meta http-equiv="Pragma" content="no-cache">
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-<h1>Delete a User</h1>
-<form action=/goform/DeleteUser method=POST>
-
-<table>
-<tr>
-<% MakeUserList(); %>
-</tr>
-<tr>
- <td></td>
- <td ALIGN="CENTER">
- <input type=submit name=ok value="OK" title="Delete the User"> <input type=submit name=ok value="Cancel"></td>
-</tr>
-</table>
-
-</form>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs.htm b/xbmc/lib/libGoAhead/web/docs.htm deleted file mode 100644 index 7048c00def..0000000000 --- a/xbmc/lib/libGoAhead/web/docs.htm +++ /dev/null @@ -1,22 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>About This Documentation</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<TABLE WIDTH="550" BORDER="0"><TR><TD>
-
-<h1>WebServer On-line Documents</h1>
-
-
-
-<P>The following on-line documents are included with WebServer 2.1:</P><UL><LI><A HREF="docs/usersguide.htm">Getting Started Guide</A><BR>Provides instructions on installing and using WebServer.</LI><LI><A HREF="docs/techref.htm">Technical Reference</A><BR>Describes each API included with this release of WebServer. These APIs are grouped according to their function: <A HREF="docs/techref/wsapi.htm">WebServer</A>, <A HREF="docs/techref/umapi.htm">User Management</A>, <A HREF="docs/techref/dbapi.htm">Database</A>, <A HREF="docs/techref/da_api.htm">Digest Authentication</A>, <A HREF="docs/techref/ejsapi.htm">JavaScript</A> and <A HREF="docs/techref/basicapi.htm">Basic</A>. </LI><LI><A HREF="docs/release.htm">Release Notes</A><BR>Contains current information about this release of WebServer.</LI><LI><A HREF="docs/readme.txt">Readme File</A><BR>Provides general information about WebServer as well as last-minute information that did not make it into the documentation.</LI><LI><A HREF="docs/license.htm">License Agreement</A><BR>PLEASE CAREFULLY READ THIS AGREEMENT AS CERTIFIES THAT YOU WILL USE THE SOFTWARE
- ONLY IN THE MANNER PERMITTED.</LI><LI>List of Included <A HREF="docs/files21.txt">Files</A><BR>Identifies important files included with this release of WebServer.</LI></UL><BLOCKQUOTE><P> </P></BLOCKQUOTE>
-
-</TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/files.txt b/xbmc/lib/libGoAhead/web/docs/files.txt deleted file mode 100644 index 0107a7faa1..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/files.txt +++ /dev/null @@ -1,346 +0,0 @@ -GoAhead WebServer 2.1 Alpha Release 2
-File Distribution List -- files.txt
-------------------------------------
-
-Listed below are the files included in the distribution of
-GoAhead WebServer 2.1 Alpha Release 2.
-
-====================================
-
-.\files.txt = This file
-
-.\CE\main.c
-.\CE\make.dep
-.\CE\Makefile
-.\CE\webs.dsp
-.\CE\webs.dsw
-.\CE\webs.mak
-.\CE\wincompat.c
-.\CE\wincompat.h
-.\LINUX\main.c
-.\LINUX\make.dep
-.\LINUX\Makefile
-.\LYNX\main.c
-.\LYNX\make.dep
-.\LYNX\Makefile
-.\QNX4\main.c
-.\QNX4\make.dep
-.\QNX4\Makefile
-.\QNX4\socket.c
-.\test\cgitest.c
-.\test\comment.js
-.\test\expression.js
-.\test\function.js
-.\test\harness.c
-.\test\if.js
-.\test\logical.js
-.\test\test.dsp
-.\test\umtest.c
-.\VXWORKS\main.c
-.\VXWORKS\Makefile
-.\VXWORKS\setpath.bat
-.\web\about_files\b_arrowcl.gif
-.\web\about_files\company.gif
-.\web\about_files\contact.gif
-.\web\about_files\header_theco.gif
-.\web\about_files\home.gif
-.\web\about_files\products.gif
-.\web\about_files\sharecss.css
-.\web\about_files\sidebar_bckgrd.jpeg
-.\web\about_files\sidebar_bottom2.gif
-.\web\about_files\sidebar_logo.gif
-.\web\about_files\site.gif
-.\web\about_files\technologies.gif
-.\web\about_files\topEnd.gif
-.\web\about_files\topRepeater.gif
-.\web\cgi-bin\cgitest.exe
-.\web\classes\doctor.jar
-.\web\classes\Status.jar
-.\web\classes\tabs.jar
-.\web\classes\treeapp.jar
-.\web\docs\images\ws_button1.gif
-.\web\docs\images\ws_button2.gif
-.\web\docs\images\ws_button3.gif
-.\web\docs\techref\basicapi\balloc.htm
-.\web\docs\techref\basicapi\bclose.htm
-.\web\docs\techref\basicapi\bfree.htm
-.\web\docs\techref\basicapi\bfreeSafe.htm
-.\web\docs\techref\basicapi\bopen.htm
-.\web\docs\techref\basicapi\brealloc.htm
-.\web\docs\techref\basicapi\ringqOpen.htm
-.\web\docs\techref\basicapi\ringqPutBlk.htm
-.\web\docs\techref\basicapi\ringqPutStr.htm
-.\web\docs\techref\basicapi\symClose.htm
-.\web\docs\techref\basicapi\symDelete.htm
-.\web\docs\techref\basicapi\symEnter.htm
-.\web\docs\techref\basicapi\symFirst.htm
-.\web\docs\techref\basicapi\symLookup.htm
-.\web\docs\techref\basicapi\symNext.htm
-.\web\docs\techref\basicapi\symOpen.htm
-.\web\docs\techref\da_api\websCalcDigest.htm
-.\web\docs\techref\da_api\websCalcNonce.htm
-.\web\docs\techref\da_api\websCalcOpaque.htm
-.\web\docs\techref\dbapi\dbClose.htm
-.\web\docs\techref\dbapi\dbDeleteRow.htm
-.\web\docs\techref\dbapi\dbGetTableId.htm
-.\web\docs\techref\dbapi\dbGetTableName.htm
-.\web\docs\techref\dbapi\dbGetTableNrow.htm
-.\web\docs\techref\dbapi\dbLoad.htm
-.\web\docs\techref\dbapi\dbOpen.htm
-.\web\docs\techref\dbapi\dbReadInt.htm
-.\web\docs\techref\dbapi\dbReadStr.htm
-.\web\docs\techref\dbapi\dbRegisterDBSchema.htm
-.\web\docs\techref\dbapi\dbSave.htm
-.\web\docs\techref\dbapi\dbSearchStr.htm
-.\web\docs\techref\dbapi\dbSetTableNrow.htm
-.\web\docs\techref\dbapi\dbWriteInt.htm
-.\web\docs\techref\dbapi\dbWriteStr.htm
-.\web\docs\techref\jsapi\ejArgs.htm
-.\web\docs\techref\jsapi\ejClose.htm
-.\web\docs\techref\jsapi\ejCloseEngine.htm
-.\web\docs\techref\jsapi\ejEval.htm
-.\web\docs\techref\jsapi\ejGetVar.htm
-.\web\docs\techref\jsapi\ejOpen.htm
-.\web\docs\techref\jsapi\ejOpenEngine.htm
-.\web\docs\techref\jsapi\ejSetGlobalFunction.htm
-.\web\docs\techref\jsapi\ejSetVar.htm
-.\web\docs\techref\umapi\umAccessLimitExists.htm
-.\web\docs\techref\umapi\umAddAccessLimit.htm
-.\web\docs\techref\umapi\umAddGroup.htm
-.\web\docs\techref\umapi\umAddUser.htm
-.\web\docs\techref\umapi\umClose.htm
-.\web\docs\techref\umapi\umCommit.htm
-.\web\docs\techref\umapi\umDeleteAccessLimit.htm
-.\web\docs\techref\umapi\umDeleteGroup.htm
-.\web\docs\techref\umapi\umDeleteUser.htm
-.\web\docs\techref\umapi\umGetAccessLimit.htm
-.\web\docs\techref\umapi\umGetAccessLimitGroup.htm
-.\web\docs\techref\umapi\umGetAccessLimitMethod.htm
-.\web\docs\techref\umapi\umGetAccessLimitSecure.htm
-.\web\docs\techref\umapi\umGetAccessMethodForURL.htm
-.\web\docs\techref\umapi\umGetFirstAccessLimit.htm
-.\web\docs\techref\umapi\umGetFirstGroup.htm
-.\web\docs\techref\umapi\umGetFirstUser.htm
-.\web\docs\techref\umapi\umGetGroupAccessMethod.htm
-.\web\docs\techref\umapi\umGetGroupEnabled.htm
-.\web\docs\techref\umapi\umGetGroupPrivilege.htm
-.\web\docs\techref\umapi\umGetNextAccessLimit.htm
-.\web\docs\techref\umapi\umGetNextGroup.htm
-.\web\docs\techref\umapi\umGetNextUser.htm
-.\web\docs\techref\umapi\umGetUserEnabled.htm
-.\web\docs\techref\umapi\umGetUserGroup.htm
-.\web\docs\techref\umapi\umGetUserPassword.htm
-.\web\docs\techref\umapi\umGroupExists.htm
-.\web\docs\techref\umapi\umOpen.htm
-.\web\docs\techref\umapi\umRestore.htm
-.\web\docs\techref\umapi\umSetAccessLimitGroup.htm
-.\web\docs\techref\umapi\umSetAccessLimitMethod.htm
-.\web\docs\techref\umapi\umSetAccessLimitSecure.htm
-.\web\docs\techref\umapi\umSetGroupAccessMethod.htm
-.\web\docs\techref\umapi\umSetGroupEnabled.htm
-.\web\docs\techref\umapi\umSetGroupPrivilege.htm
-.\web\docs\techref\umapi\umSEtUserEnabled.htm
-.\web\docs\techref\umapi\umSetUserGroup.htm
-.\web\docs\techref\umapi\umSetUserPassword.htm
-.\web\docs\techref\umapi\umUserCanAccessURL.htm
-.\web\docs\techref\umapi\umUserExists.htm
-.\web\docs\techref\wsapi\addUser.htm
-.\web\docs\techref\wsapi\balloc.htm
-.\web\docs\techref\wsapi\bfree.htm
-.\web\docs\techref\wsapi\bopen.htm
-.\web\docs\techref\wsapi\deleteUser.htm
-.\web\docs\techref\wsapi\getPassword.htm
-.\web\docs\techref\wsapi\new.htm
-.\web\docs\techref\wsapi\websAspDefine.htm
-.\web\docs\techref\wsapi\websClose.htm
-.\web\docs\techref\wsapi\websCloseListen.htm
-.\web\docs\techref\wsapi\websDecode64.htm
-.\web\docs\techref\wsapi\websDone.htm
-.\web\docs\techref\wsapi\websEncode64.htm
-.\web\docs\techref\wsapi\websError.htm
-.\web\docs\techref\wsapi\websExpand.htm
-.\web\docs\techref\wsapi\websFooter.htm
-.\web\docs\techref\wsapi\websFormDefine.htm
-.\web\docs\techref\wsapi\websGetDefaultDir.htm
-.\web\docs\techref\wsapi\websGetDefaultHome.htm
-.\web\docs\techref\wsapi\websGetDefaultPage.htm
-.\web\docs\techref\wsapi\websGetHost.htm
-.\web\docs\techref\wsapi\websGetHostUrl.htm
-.\web\docs\techref\wsapi\websGetIpaddr.htm
-.\web\docs\techref\wsapi\websGetPassword.htm
-.\web\docs\techref\wsapi\websGetPort.htm
-.\web\docs\techref\wsapi\websGetRequestBytes.htm
-.\web\docs\techref\wsapi\websGetRequestDir.htm
-.\web\docs\techref\wsapi\websGetRequestDocFd.htm
-.\web\docs\techref\wsapi\websGetRequestFlags.htm
-.\web\docs\techref\wsapi\websGetRequestIpaddr.htm
-.\web\docs\techref\wsapi\websGetRequestLpath.htm
-.\web\docs\techref\wsapi\websGetRequestPassword.htm
-.\web\docs\techref\wsapi\websGetRequestPath.htm
-.\web\docs\techref\wsapi\websGetRequestType.htm
-.\web\docs\techref\wsapi\websGetRequestUserName.htm
-.\web\docs\techref\wsapi\websGetRequestWritten.htm
-.\web\docs\techref\wsapi\websGetVar.htm
-.\web\docs\techref\wsapi\websHeader.htm
-.\web\docs\techref\wsapi\websOpen.htm
-.\web\docs\techref\wsapi\websOpenListen.htm
-.\web\docs\techref\wsapi\websRedirect.htm
-.\web\docs\techref\wsapi\websSecurityHandler.htm
-.\web\docs\techref\wsapi\websSetDefaultDir.htm
-.\web\docs\techref\wsapi\websSetDefaultPage.htm
-.\web\docs\techref\wsapi\websSetEnv.htm
-.\web\docs\techref\wsapi\websSetHost.htm
-.\web\docs\techref\wsapi\websSetIpaddr.htm
-.\web\docs\techref\wsapi\websSetPassword.htm
-.\web\docs\techref\wsapi\websSetRequestBytes.htm
-.\web\docs\techref\wsapi\websSetRequestDocFd.htm
-.\web\docs\techref\wsapi\websSetRequestFlags.htm
-.\web\docs\techref\wsapi\websSetRequestLpath.htm
-.\web\docs\techref\wsapi\websSetRequestPath.htm
-.\web\docs\techref\wsapi\websSetRequestWritten.htm
-.\web\docs\techref\wsapi\websSetVar.htm
-.\web\docs\techref\wsapi\websTestVar.htm
-.\web\docs\techref\wsapi\websUrlHandlerDefine.htm
-.\web\docs\techref\wsapi\websUrlHandlerDelete.htm
-.\web\docs\techref\wsapi\websUrlParse.htm
-.\web\docs\techref\wsapi\websUrlType.htm
-.\web\docs\techref\wsapi\websValid.htm
-.\web\docs\techref\wsapi\websVar.htm
-.\web\docs\techref\wsapi\websWrite.htm
-.\web\docs\techref\wsapi\websWriteBlock.htm
-.\web\docs\techref\wsapi\websWriteBlockData.htm
-.\web\docs\techref\basicapi.htm
-.\web\docs\techref\da_api.htm
-.\web\docs\techref\dbapi.htm
-.\web\docs\techref\ejsapi.htm
-.\web\docs\techref\umapi.htm
-.\web\docs\techref\wsapi.htm
-.\web\docs\user\management\configFile.htm
-.\web\docs\user\management\overview.htm
-.\web\docs\user\management\setup.htm
-.\web\docs\user\management\webInterface.htm
-.\web\docs\user\cgi.htm
-.\web\docs\user\configure.htm
-.\web\docs\user\install.htm
-.\web\docs\user\manage.htm
-.\web\docs\user\management
-.\web\docs\user\RSA.htm
-.\web\docs\user\running.htm
-.\web\docs\user\trouble.htm
-.\web\docs\files.txt
-.\web\docs\files21.txt
-.\web\docs\images
-.\web\docs\license.htm
-.\web\docs\license.txt
-.\web\docs\logos.htm
-.\web\docs\readme.txt
-.\web\docs\release.htm
-.\web\docs\suggested.htm
-.\web\docs\techref.htm
-.\web\docs\usersguide.htm
-.\web\glossary\wsglossary.htm
-.\web\graphics\sidebar.gif
-.\web\graphics\topbar.gif
-.\web\graphics\webserver_logo1.gif
-.\web\graphics\webserver_logo2.gif
-.\web\over\architecture.htm
-.\web\over\asp.htm
-.\web\over\blockdiagram.htm
-.\web\over\cgi.htm
-.\web\over\digestauth.htm
-.\web\over\ejs.htm
-.\web\over\goforms.htm
-.\web\over\readme.asp
-.\web\over\security.htm
-.\web\over\ssl.htm
-.\web\over\urlhandles.htm
-.\web\over\usermanagement.htm
-.\web\over\webs_block.jpg
-.\web\style\doc.css
-.\web\style\help.htm
-.\web\style\menu.htm
-.\web\style\normal_ws.css
-.\web\style\option.htm
-.\web\Support\support.htm
-.\web\about.htm
-.\web\about_files
-.\web\addgroup.asp
-.\web\addlimit.asp
-.\web\adduser.asp
-.\web\asp.asp
-.\web\big.asp
-.\web\big.htm
-.\web\contents.asp
-.\web\deletegroup.asp
-.\web\deletelimit.asp
-.\web\deleteuser.asp
-.\web\displayuser.asp
-.\web\docs.htm
-.\web\FAQ.htm
-.\web\forms.asp
-.\web\glossary
-.\web\graphics
-.\web\home.asp
-.\web\loadconfig.asp
-.\web\overview.htm
-.\web\saveconfig.asp
-.\web\small.htm
-.\web\title.htm
-.\web\treeapp.asp
-.\web\um.htm
-.\WIN\main.c
-.\WIN\setpath.bat
-.\WIN\webcomp.dsp
-.\WIN\webcomp.dsw
-.\WIN\webcomp.mak
-.\WIN\webs.dsp
-.\WIN\webs.dsw
-.\WIN\webs.mak
-.\asp.c
-.\balloc.c
-.\base64.c
-.\cgi.c
-.\default.c
-.\ej.h
-.\ejIntrn.h
-.\ejlex.c
-.\ejparse.c
-.\emfdb.c
-.\emfdb.h
-.\form.c
-.\h.c
-.\handler.c
-.\license.txt
-.\make.dep
-.\Makefile
-.\md5.h
-.\md5c.c
-.\mime.c
-.\misc.c
-.\page.c
-.\readme.txt
-.\release2_1.htm
-.\ringq.c
-.\rom.c
-.\security.c
-.\sock.c
-.\sockGen.c
-.\sym.c
-.\uemf.c
-.\uemf.h
-.\um.c
-.\um.h
-.\umui.c
-.\url.c
-.\value.c
-.\webcomp.c
-.\webrom.c
-.\webromtest.c
-.\webs.c
-.\webs.h
-.\websda.c
-.\websda.h
-.\websSSL.c
-.\websSSL.h
-.\websuemf.c
-.\wsIntrn.h
diff --git a/xbmc/lib/libGoAhead/web/docs/files21.txt b/xbmc/lib/libGoAhead/web/docs/files21.txt deleted file mode 100644 index 962e131f64..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/files21.txt +++ /dev/null @@ -1,94 +0,0 @@ -GoAhead WebServer 2.1 Release files.txt
-
-files21.txt This file
-license.txt License terms and details
-asp.c Active Server Page support
-balloc.c Fast block memory allocator
-base64.c Base 64 Mime encoding and decoding
-cgi.c Standard CGI support
-default.c Default URL handler. Handle normal file types and ASP
-ej.h Embedded JavaScript Supplementary API Header
-ejIntrn.h Embedded JavaScript Structures and API Header
-ejlex.c Embedded JavaScript lexical analyser
-ejparse.c Embedded JavaScript parser and API
-emfdb.h EMF-clone database header
-emfdb.c EMF-clone database support
-form.c In-memory forms processor with CGI support
-h.c Handle allocator for per browser connection handles
-handler.c URL handler support
-md5.h MD5 algorithm support header
-md5c.c MD5 algorithm
-mime.c Mime types
-misc.c Some POSIX compatibility routines (sprintf)
-page.c Web page I/O module. Support for file systems and ROM
-ringq.c Ring queue and dynamic string module
-rom.c ROM web pages access module. When not using a file system
-security.c Security URL handler. Implements a basic security policy
-sock.c Generic socket support
-sockGen.c Platform-independent (except Windows) socket support
-sym.c Symbol table. Implements a hashing symbol table
-uemf.c GoAhead Micro Embedded Management Framework layer
-uemf.h GoAhead Micro EMF header
-um.c User Management
-um.h User Managment Header
-umui.c User Management GoForms and ASP routines
-url.c URL parsing and utility url routines
-value.c Store strings and numbers in a single convenient structure
-webcomp.c Web page compiler. Not linked with GoAhead WebServer
-webrom.c Compiled web pages for ROM access. Generated by webcompile
-webs.c Primary GoAhead WebServer code. Includes state machine
-webs.h Public header for extension ASP and Forms procedures
-websda.c Digest Access Authorization support routines
-websda.h Digest Access Authorization support header
-websuemf.c Linkage with the GoAhead Micro EMF
-websSSL.c SSL patch implementation
-websSSL.h SSL patch implementation header
-wsIntrn.h Private header for inclusion by new URL handlers
-CE/build.bat webs builder batch file for CE
-CE/main.c Main program and startup for CE
-CE/webs.dsp Visual C++ project
-CE/webs.dsw Visual C++ workspace
-CE/wincompat.c Generic Platform compatibility module for CE
-CE/wincompat.h Generic Platform compatibility module header
-ECOS/main.c Main program and startup for ECOS
-ECOS/Makefile Makefile for ECOS
-LINUX/main.c Main program and startup for LINUX
-LINUX/Makefile Makefile for LINUX
-LYNX/main.c Main program and startup for LYNX
-LYNX/Makefile Makefile for LYNX
-QNX4/main.c Main program and startup for QNX OS
-QNX4/Makefile Makefile for QNX OS
-VXWORKS/main.c Main program and startup for VxWorks
-VXWORKS/Makefile Makefile for VxWorks
-VXWORKS/setpath.bat Compiler configuration batch file for Tornado on VxWorks
-VXWORKS/Makefile.ppc Makefile for VxWorks on PPC
-VXWORKS/ppcpath.bat Configuration batch file for Tornado on VxWorks (PPC)
-WIN/main.c Main program for Windows
-WIN/setpath.bat Compiler configuration batch file for VC++ on Windows NT
-WIN/webcomp.dsp Visual C++ project for webcompile program
-WIN/webcomp.dsw Visual C++ workspace for webcompile program
-WIN/webs.dsp Visual C++ project
-WIN/webs.dsw Visual C++ workspace
-WIN/webs.mak Make file for Windows NT/2000
-web/about.htm Web Site About page
-web/adduser.asp Add a user form
-web/addgroup.asp Add a user group form
-web/addlimit.asp Add a URL access limit form
-web/asp.asp Test web page
-web/contents.asp Data page for the Table of Contents tree applet
-web/delgroup.asp Delete a user group form
-web/dellimit.asp Delete a URL access limit form
-web/deluser.asp Delete a user form
-web/FAQ.htm Frequently asked questions web page
-web/forms.asp GoForms test page
-web/home.asp Master home page for testing
-web/loadcfg.asp Load User Management Configuration form
-web/overview.htm Product overview page
-web/small.htm Test web page
-web/tests.htm Overview of test pages
-web/title.htm WebServer Title frame
-web/treeapp.asp WebServer Table of Contents Frame
-web/um.htm User Management page
-web/cgi-bin/ Folder to be used for CGI scripts
-web/style/ Style sheet folder
-
diff --git a/xbmc/lib/libGoAhead/web/docs/images/ws_button1.1.eps b/xbmc/lib/libGoAhead/web/docs/images/ws_button1.1.eps Binary files differdeleted file mode 100644 index 0865bafc6f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/images/ws_button1.1.eps +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/docs/images/ws_button1.gif b/xbmc/lib/libGoAhead/web/docs/images/ws_button1.gif Binary files differdeleted file mode 100644 index b3bc1ece42..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/images/ws_button1.gif +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/docs/images/ws_button2.1.eps b/xbmc/lib/libGoAhead/web/docs/images/ws_button2.1.eps Binary files differdeleted file mode 100644 index 3be57cab26..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/images/ws_button2.1.eps +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/docs/images/ws_button2.gif b/xbmc/lib/libGoAhead/web/docs/images/ws_button2.gif Binary files differdeleted file mode 100644 index 8dd2d1dc60..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/images/ws_button2.gif +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/docs/images/ws_button3.1.eps b/xbmc/lib/libGoAhead/web/docs/images/ws_button3.1.eps Binary files differdeleted file mode 100644 index 047915d71f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/images/ws_button3.1.eps +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/docs/images/ws_button3.gif b/xbmc/lib/libGoAhead/web/docs/images/ws_button3.gif Binary files differdeleted file mode 100644 index e729f2c70c..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/images/ws_button3.gif +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/docs/license.htm b/xbmc/lib/libGoAhead/web/docs/license.htm deleted file mode 100644 index 20dfeaadfc..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/license.htm +++ /dev/null @@ -1,26 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>WebServer Licensing</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<H1>GoAhead WebServer Licensing</H1><P>Use of the GoAhead WebServer is subject to the terms specified in the GoAhead <A HREF="license.txt">License Agreement</A>. Basically, this license agreement has these simple requirements:
-</P><BLOCKQUOTE><OL><LI>
-
-You submit any modifications, enhancements, or improvements made to the existing code files to <A HREF="../support/support.htm">GoAhead</A>.
-</LI><LI>You provide project information to <A HREF="../support/support.htm">GoAhead</A> before shipping products that include GoAhead WebServer.</LI><LI>You place the GoAhead WebServer <A HREF="logos.htm">logo</A> on the initial page of your product website to promote the web server.
-</LI><LI>You must include GoAhead copyright notice in your product code, and on the title pages of all documentation.
-</LI><LI>The "Server Identification Field" contained in the "Response Header" must not be removed or modified. </LI><LI>Allow GoAhead Software to identify your company as a user of GoAhead WebServer.
-
-</LI></OL></BLOCKQUOTE><p>The above information is provided as a lay-person's
- license overview only. It is not a substitute for the actual License Agreement contained in the <A HREF="license.txt">license.txt</A> file. </p><p>If you have any
- questions or need additional information about the WebServer licensing agreement, please contact <A HREF="../support/support.htm">GoAhead Software</A>. </p></TD></TR></TABLE>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/license.txt b/xbmc/lib/libGoAhead/web/docs/license.txt deleted file mode 100644 index 0633d4d30f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/license.txt +++ /dev/null @@ -1,124 +0,0 @@ -License Agreement
-
-THIS LICENSE ALLOWS ONLY THE LIMITED USE OF GO AHEAD SOFTWARE, INC. PROPRIETARY CODE. PLEASE CAREFULLY READ THIS AGREEMENT AS IT PERTAINS TO THIS LICENSE, YOU CERTIFY THAT YOU WILL USE THE SOFTWARE ONLY IN THE MANNER PERMITTED HEREIN.
-
-1. Definitions.
-
-1.1 "Documentation" means any documentation GoAhead includes with the Original Code.
-
-1.2 "GoAhead" means Go Ahead Software, Inc.
-
-1.3 "Intellectual Property Rights" means all rights, whether now existing or hereinafter acquired, in and to trade secrets, patents, copyrights, trademarks, know-how, as well as moral rights and similar rights of any type under the laws of any governmental authority, domestic or foreign, including rights in and to all applications and registrations relating to any of the foregoing.
-
-1.4 "License" or "Agreement" means this document.
-
-1.5 "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications.
-
-1.6 "Original Code" means the Source Code to GoAhead’s proprietary computer software entitled GoAhead WebServer.
-
-1.7 "Response Header" means the first portion of the response message output by the GoAhead WebServer, containing but not limited to, header fields for date, content-type, server identification and cache control.
-
-1.8 "Server Identification Field" means the field in the Response Header which contains the text "Server: GoAhead-Webs".
-
-1.9 "You" means an individual or a legal entity exercising rights under, and complying with all of the terms of, this license or a future version of this license. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
-
-2. Source Code License.
-
-2.1 Limited Source Code Grant.
-
-GoAhead hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims, to use, reproduce, modify, copy and distribute the Original Code.
-
-2.2 Binary Code.
-
-GoAhead hereby grants You a world-wide, royalty-free, non-exclusive license to copy and distribute the binary code versions of the Original Code together with Your Modifications.
-
-2.3 License Back to GoAhead.
-
-You hereby grant in both source code and binary code to GoAhead a world-wide, royalty-free, non-exclusive license to copy, modify, display, use and sublicense any Modifications You make that are distributed or planned for distribution. Within 30 days of either such event, You agree to ship to GoAhead a file containing the Modifications (in a media to be determined by the parties), including any programmers’ notes and other programmers’ materials. Additionally, You will provide to GoAhead a complete description of the product, the product code or model number, the date on which the product is initially shipped, and a contact name, phone number and e-mail address for future correspondence. GoAhead will keep confidential all data specifically marked as such.
-
-2.4 Restrictions on Use.
-
-You may sublicense Modifications to third parties such as subcontractors or OEM's provided that You enter into license agreements with such third parties that bind such third parties to all the obligations under this Agreement applicable to you and that are otherwise substantially similar in scope and application to this Agreement.
-
-3. Term.
-
-This Agreement and license are effective from the time You accept the terms of this Agreement until this Agreement is terminated. You may terminate this Agreement at any time by uninstalling or destroying all copies of the Original Code including any and all binary versions and removing any Modifications to the Original Code existing in any products. This Agreement will terminate immediately and without further notice if You fail to comply with any provision of this Agreement. All restrictions on use, and all other provisions that may reasonably be interpreted to survive termination of this Agreement, will survive termination of this Agreement for any reason. Upon termination, You agree to uninstall or destroy all copies of the Original Code, Modifications, and Documentation.
-
-4. Trademarks and Brand.
-
-4.1 License and Use.
-
-GoAhead hereby grants to You a limited world-wide, royalty-free, non-exclusive license to use the GoAhead trade names, trademarks, logos, service marks and product designations posted in Exhibit A (collectively, the "GoAhead Marks") in connection with the activities by You under this Agreement. Additionally, GoAhead grants You a license under the terms above to such GoAhead trademarks as shall be identified at a URL (the "URL") provided by GoAhead. The use by You of GoAhead Marks shall be in accordance with GoAhead’s trademark policies regarding trademark usage as established at the web site designated by the URL, or as otherwise communicated to You by GoAhead at its sole discretion. You understand and agree that any use of GoAhead Marks in connection with this Agreement shall not create any right, title or interest in or to such GoAhead Marks and that all such use and goodwill associated with GoAhead Marks will inure to the benefit of GoAhead.
-
-4.2 Promotion by You of GoAhead WebServer Mark.
-
-In consideration for the licenses granted by GoAhead to You herein, You agree to notify GoAhead when You incorporate the GoAhead WebServer in Your product and to inform GoAhead when such product begins to ship. You agree to promote the Original Code by prominently and visibly displaying a graphic of the GoAhead WebServer mark on the initial web page of Your product that is displayed each time a user connects to it. You also agree that GoAhead may identify your company as a user of the GoAhead WebServer by placing your company logo on it's web site. You may further promote the Original Code by displaying the GoAhead WebServer mark in marketing and promotional materials such as the home page of your web site or web pages promoting the product.
-
-4.3 Placement of Copyright Notice by You.
-
-You agree to include copies of the following notice (the "Notice") regarding proprietary rights in all copies of the products that You distribute, as follows: (i) embedded in the object code; and (ii) on the title pages of all documentation. Furthermore, You agree to use commercially reasonable efforts to cause any licensees of your products to embed the Notice in object code and on the title pages or relevant documentation. The Notice is as follows: Copyright (c) 19xx GoAhead Software, Inc. All Rights Reserved. Unless GoAhead otherwise instructs, the year 19xx is to be replaced with the year during which the release of the Original Code containing the notice is issued by GoAhead. If this year is not supplied with Documentation, GoAhead will supply it upon request.
-
-4.4 No Modifications to Server Identification Field.
-
-You agree not to remove or modify the Server identification Field contained in the Response Header as defined in Section 1.6 and 1.7.
-
-5. Warranty Disclaimers.
-
-THE ORIGINAL CODE, THE DOCUMENTATION AND THE MEDIA UPON WHICH THE ORIGINAL CODE IS RECORDED (IF ANY) ARE PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS, STATUTORY OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-The entire risk as to the quality and performance of the Original Code (including any Modifications You make) and the Documentation is with You. Should the Original Code or the Documentation prove defective, You (and not GoAhead or its distributors, licensors or dealers) assume the entire cost of all necessary servicing or repair. GoAhead does not warrant that the functions contained in the Original Code will meet your requirements or operate in the combination that You may select for use, that the operation of the Original Code will be uninterrupted or error free, or that defects in the Original Code will be corrected. No oral or written statement by GoAhead or by a representative of GoAhead shall create a warranty or increase the scope of this warranty.
-
-GOAHEAD DOES NOT WARRANT THE ORIGINAL CODE AGAINST INFRINGEMENT OR THE LIKE WITH RESPECT TO ANY COPYRIGHT, PATENT, TRADE SECRET, TRADEMARK OR OTHER PROPRIETARY RIGHT OF ANY THIRD PARTY AND DOES NOT WARRANT THAT THE ORIGINAL CODE DOES NOT INCLUDE ANY VIRUS, SOFTWARE ROUTINE OR OTHER SOFTWARE DESIGNED TO PERMIT UNAUTHORIZED ACCESS, TO DISABLE, ERASE OR OTHERWISE HARM SOFTWARE, HARDWARE OR DATA, OR TO PERFORM ANY OTHER SUCH ACTIONS.
-
-Any warranties that by law survive the foregoing disclaimers shall terminate ninety (90) days from the date You received the Original Code.
-
-6. Limitation of Liability.
-
-YOUR SOLE REMEDIES AND GOAHEAD'S ENTIRE LIABILITY ARE SET FORTH ABOVE. IN NO EVENT WILL GOAHEAD OR ITS DISTRIBUTORS OR DEALERS BE LIABLE FOR DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OF THE ORIGINAL CODE, THE INABILITY TO USE THE ORIGINAL CODE, OR ANY DEFECT IN THE ORIGINAL CODE, INCLUDING ANY LOST PROFITS, EVEN IF THEY HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-You agree that GoAhead and its distributors and dealers will not be LIABLE for defense or indemnity with respect to any claim against You by any third party arising from your possession or use of the Original Code or the Documentation.
-
-In no event will GoAhead’s total liability to You for all damages, losses, and causes of action (whether in contract, tort, including negligence, or otherwise) exceed the amount You paid for this product.
-
-SOME STATES DO NOT ALLOW LIMITATIONS ON HOW LONG AN IMPLIED WARRANTY LASTS, AND SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY FROM STATE TO STATE.
-
-7. Indemnification by You.
-
-You agree to indemnify and hold GoAhead harmless against any and all claims, losses, damages and costs (including legal expenses and reasonable counsel fees) arising out of any claim of a third party with respect to the contents of the Your products, and any intellectual property rights or other rights or interests related thereto.
-
-8. High Risk Activities.
-
-The Original Code is not fault-tolerant and is not designed , manufactured or intended for use or resale as online control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines or weapons systems, in which the failure of the Original Code could lead directly to death, personal injury, or severe physical or environmental damage. GoAhead and its suppliers specifically disclaim any express or implied warranty of fitness for any high risk uses listed above.
-
-9. Government Restricted Rights.
-
-For units of the Department of Defense, use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013. Contractor/manufacturer is GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004.
-
-If the Commercial Computer Software Restricted rights clause at FAR 52.227-19 or its successors apply, the Software and Documentation constitute restricted computer software as defined in that clause and the Government shall not have the license for published software set forth in subparagraph (c)(3) of that clause.
-
-The Original Code (i) was developed at private expense, and no part of it was developed with governmental funds; (ii) is a trade secret of GoAhead (or its licensor(s)) for all purposes of the Freedom of Information Act; (iii) is "restricted computer software" subject to limited utilization as provided in the contract between the vendor and the governmental entity; and (iv) in all respects is proprietary data belonging solely to GoAhead (or its licensor(s)).
-
-10. Governing Law and Interpretation.
-
-This Agreement shall be interpreted under and governed by the laws of the State of Washington, without regard to its rules governing the conflict of laws. If any provision of this Agreement is held illegal or unenforceable by a court or tribunal of competent jurisdiction, the remaining provisions of this Agreement shall remain in effect and the invalid provision deemed modified to the least degree necessary to remedy such invalidity.
-
-11. Entire Agreement.
-
-This Agreement is the complete agreement between GoAhead and You and supersedes all prior agreements, oral or written, with respect to the subject matter hereof.
-
-If You have any questions concerning this Agreement, You may write to GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004 or send e-mail to info@goahead.com.
-
-BY CLICKING ON THE "Register" BUTTON ON THE REGISTRATION FORM, YOU ACCEPT AND AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS SET FORTH IN THIS AGREEMENT. IF YOU DO NOT WISH TO ACCEPT THIS LICENSE OR YOU DO NOT QUALIFY FOR A LICENSE BASED ON THE TERMS SET FORTH ABOVE, YOU MUST NOT CLICK THE "Register" BUTTON.
-
-Exhibit A
-
-GoAhead Trademarks, Logos, and Product Designation Information
-
-
-
-
-
-
-
-
-
diff --git a/xbmc/lib/libGoAhead/web/docs/logos.htm b/xbmc/lib/libGoAhead/web/docs/logos.htm deleted file mode 100644 index 45b2603fff..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/logos.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>GoAhead Trademarks & Logos</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<H1>GoAhead WebServer Trademarks</H1><p>In exchange for using GoAhead WebServer, we require that you help promote it by using the GoAhead WebServer logo on your product's initial web page and in your product's literature. The use of these logos are governed by the GoAhead <A HREF="license.txt">License Agreement</A> and should only be used in conjunction with the use of GoAhead WebServer. </p><p> GoAhead WebServer Logo is graphic that includes the GoAhead WebServer name. This logo should be placed on the initial web page of your device so that it is prominently visible each time a user access your device via WebServer. We also ask that you use this logo in your marketing and promotional materials, such as product brochures and any web pages on your web site that describe the product. </p><p><img src="images/ws_button1.gif" width="155" height="31"></p><p> Download the GoAhead WebServer Logo in <a href="images/ws_button1.gif">gif</a>
- or <a href="images/ws_button1.1.eps">eps</a> format.</p><p> <img src="images/ws_button2.gif" width="155" height="31"> </p><p> Download the GoAhead WebServer Logo in <a href="images/ws_button2.gif">gif</a>
- or <a href="images/ws_button2.1.eps">eps</a> format. </p><p> <img src="images/ws_button3.gif" width="155" height="31"> </p><p> Download the GoAhead WebServer Logo in <a href="images/ws_button3.gif">gif
- </a>or <a href="images/ws_button3.1.eps">eps</a> format. </p>
-
-
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/readme.txt b/xbmc/lib/libGoAhead/web/docs/readme.txt deleted file mode 100644 index 46ee98594d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -For current WebServer startup instructions and other information
-specific to Release 2.1, please refer to the release.htm file
-(Release Notes).
diff --git a/xbmc/lib/libGoAhead/web/docs/release.htm b/xbmc/lib/libGoAhead/web/docs/release.htm deleted file mode 100644 index 9c8e8b3008..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/release.htm +++ /dev/null @@ -1,151 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<HTML><HEAD><TITLE>GoAhead WebServer 2.11 Release Notes</TITLE>
-<style>
-<!--
-BODY {FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 9pt}
-P {COLOR: #333333; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 9pt; MARGIN-LEFT: 10px}
-H1 {COLOR: #0066cc; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 14pt; FONT-WEIGHT: bold; MARGIN-LEFT: 10px}
-H2 {COLOR: #0066cc; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 12pt; FONT-WEIGHT: bold; MARGIN-LEFT: 10px}
-H3 {COLOR: #0066cc; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 10pt; FONT-WEIGHT: bold; MARGIN-LEFT: 10px}
-PRE {BACKGROUND-COLOR: #eeeeee; COLOR: #0a0a8c; FONT-FAMILY: "Courier New", Courier, mono; FONT-SIZE: 9pt; LINE-HEIGHT: normal; MARGIN-LEFT: 10px; PADDING-BOTTOM: 5px; PADDING-LEFT: 20px; PADDING-RIGHT: 20px; PADDING-TOP: 5px}
-TD {COLOR: #333333; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 9pt}
-TABLE {MARGIN-LEFT: 10px}
-OL {COLOR: #333333; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 9pt; MARGIN-LEFT: 40px}
-UL {COLOR: #333333; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 9pt; MARGIN-LEFT: 30px}
-H4 {COLOR: #0066cc; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 9pt; FONT-WEIGHT: bold; MARGIN-LEFT: 10px}
--->
-</style>
-</HEAD>
-<BODY bgColor=#ffffff>
-
-<H1> GoAhead® WebServer 2.1.1-HP Release Notes </H1>
-
-<P><B>Release Date:</B> 03/02/2001<BR>
- <B>File: </B>release.htm<BR>
- <B>Part Number:</B> 1-53-03</P>
- <H2>1. What's New in This Release?<A name=what></A> </H2>
-
-<BLOCKQUOTE>
- <UL>
- <LI><a href="#bugs">Bug Fixes </a></LI>
- <LI><A HREF="#novell">Support for Novell Netware </A> </LI>
- </UL>
-</BLOCKQUOTE>
-<h2><font face="Arial, Helvetica, sans-serif">2. Bug Fixes for Version 2.1.1<a
-name=bugs></a></font> </h2>
-<BLOCKQUOTE>
- <p><b> Intermittent Access Error for CGI Scripts (BUG01937)</b></p>
- <blockquote>
- <p><b>Summary</b>:<br>
- Pages were occasionally replaced with the message, "Access Error: Data
- follows when trying to obtain CGI generated no output". </p>
- <p><b>Fix</b>:<br>
- On multiple CPU systems, it is possible for a CGI application to exit before
- its output is flushed to disk. The change for this release locates the code
- that collects the output from the CGI application in a separate routine.
- In addition to calling that routine from within the CGI application processing
- loop, it is also called in a brief loop after the CGI application has exited.
- This extra loop runs for only up to one second while the collected output
- remains empty. If, after 1 second, the output remains empty, the original
- course of action is followed ("Access Error" is reported).</p>
- </blockquote>
- <p><br>
- <b>CPU Utilization Hangs at 100% on a Socket Disconnect (BUG01865)</b></p>
- <blockquote>
- <p><b>Summary:</b><br>
- This error occurs whenever a user terminates a request before the server
- has had ample time to service it. This can be simulated by quickly hitting
- the refresh button on the browser twice in a row, causing the first request
- to be terminated. The server then enters into a tight loop that utilizes
- all of its time.</p>
- <p><b>Fix:</b><br>
- Always close the socket prior to a disconnect.</p>
- </blockquote>
- <p><br>
- <b>Security Features can be Bypassed by Adding an Extra Slash in the URL (BUG01518)</b></p>
- <blockquote>
- <p><b>Summary</b>:<br>
- By adding an extra slash in a URL, password prompting is bypassed, allowing
- unrestricted access to secured pages. </p>
- <p><b>Fix</b>:<br>
- Remove multiple adjacent occurrences of slashes in the URL before passing
- it to the security handler.</p>
- </blockquote>
- <p><br>
- <b>Call to websSetVar causes a crash (BUG01938)</b></p>
- <blockquote>
- <p><b>Summary</b>:<br>
- Whenever a request is not completed while being processed by websGetInput(),
- a call to websDone is made, followed by an attempt to process the partial
- request data.</p>
- <p><b>Fix</b>:<br>
- Return immediately after closing the socket.</p>
- </blockquote>
- <p><br>
- <b>Remove stray semicolon in emfdb.c (BUG01820)</b></p>
- <blockquote>
- <p><b>Summary and Fix</b>:<br>
- A stray semicolon was removed from this file.</p>
- </blockquote>
-</BLOCKQUOTE>
-<h2><font face="Arial, Helvetica, sans-serif">3. Novell Netware Support<a
-name=novell></a></font> </h2>
-<blockquote>
- <p> With the addition of Novell Netware in this 2.11 release, WebServer now
- supports these platforms:</p>
- <UL>
- <LI>LINUX</LI>
- <LI> LynxOS</LI>
- <LI><b><font face="Arial, Helvetica, sans-serif">Novell Netware </font>4.2,
- 5.1</b></LI>
- <LI>UNIX - SCO OpenServer 3.2V5.0.0</LI>
- <LI>VxWorks 5.3.1</LI>
- <LI>Windows 2000</LI>
- <LI>Windows 98</LI>
- <LI>Windows 95 </LI>
- <LI>Windows NT</LI>
- <LI>Windows CE</LI>
- </UL>
- <h3>To make a Novell Netware target file (webs.nlm):<font face="Arial"><strong>
- </strong></font></h3>
-</blockquote>
-<blockquote>
- <PRE>
-cd NW
-wmake webs.nlm
-load <path> \webs.nlm
-webs</PRE>
- <p><b>Note:</b> This makefile lacks a valid default rule. In addition, an environment
- variable (QMKVER) controls the amount of debug information that is compiled
- and linked into the nlm file. If this variable is set to "P", it
- produces a production version. All other settings (or the omission of the
- variable) results in a debug version.</p>
- <p> For other platforms supported by WebServer, please refer to your WebServer
- 2.1 documentation for appropriate instructions. </p>
- </blockquote>
-<h2>4. Copyright Information </h2>
-<blockquote>
- <H3>Trademarks </H3>
- <p>GoAhead and GoAhead WebServer are registered trademarks of GoAhead Software.
- All other brand or product names are the trademarks or registered trademarks
- of their respective holders. </p>
- <H3>Copyright </H3>
- <p>Copyright © 2000, 2001 GoAhead Software, Inc. All rights reserved. </p>
- <p>Product and technical information in this document is subject to change without
- notice and does not represent a commitment on the part of GoAhead Software,
- Inc. </p>
- <H3>Copy Restrictions </H3>
- <p>The software described in this document may be used and copied only in accordance
- with the terms of the accompanying license agreement. </p>
- <p>GoAhead Software, Inc. <BR>
- 10900 NE 8th Street<BR>
- Suite 750 <BR>
- Bellevue, WA 98004 <BR>
- +1 ( 425) 453-1900 <BR>
- www.goahead.com <BR>
- info@goahead.com </p>
- <p>1-53-03</p>
-</blockquote>
-<P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P>
-</BODY></HTML>
diff --git a/xbmc/lib/libGoAhead/web/docs/suggested.htm b/xbmc/lib/libGoAhead/web/docs/suggested.htm deleted file mode 100644 index 9beb7be92f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/suggested.htm +++ /dev/null @@ -1,23 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>WebServer Cookbook</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<h1>Suggested Background Reading for Embedded WebServers </h1><H3>Active Server Pages</H3><P>There are numerous excellent resource books on Active Server Pages. Try searching at <a href="http://www.amazon.com/" target="new">http://www.amazon.com</a> for "Active Server Pages".</P><P> Two recommended
-titles are:
-
- </P><UL><LI>Professional Active Server Pages,
- Alex Homer, et al / Paperback / Published 1997
- Wrox Press Inc; ISBN: 1861000723
-
- </LI><LI>Beginning Active Server Pages 2.0,
- Brian Francis, et al / Mass Market Paperback
- Wrox Press Inc; ISBN: 1861001347
-
-</LI></UL>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref.htm b/xbmc/lib/libGoAhead/web/docs/techref.htm deleted file mode 100644 index f2f7247208..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref.htm +++ /dev/null @@ -1,15 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>Technical Reference Manual</TITLE>
-<LINK REL="stylesheet" HREF="../style/normal_ws.css" TYPE="text/css">
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-</HEAD>
-
-
-<BODY BGCOLOR="#FFFFFF">
-<table width="550"><tr><td>
-<H1>WebServer Technical Reference
-</H1><P> This WebServer Technical Reference documents each application programmable interface (API) included with GoAhead WebServer 2.1. These APIs allow developers to add their own application specific code to customize and extend WebServer operation. </P><P>APIs are grouped according to their function:</P><UL><LI> <A HREF="techref/basicapi.htm">Basic APIs</A> </LI><LI> <A HREF="techref/wsapi.htm">WebServer APIs</A></LI><LI><A HREF="techref/ejsapi.htm">JavaScript APIs</A> </LI><LI><A HREF="techref/dbapi.htm">Database APIs</A></LI><LI><A HREF="techref/umapi.htm">User Management APIs</A></LI><LI><A HREF="techref/da_api.htm">Digest Access Authentication APIs
-</A></LI></UL></td></tr> </table>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi.htm deleted file mode 100644 index 198bf78cb4..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi.htm +++ /dev/null @@ -1,33 +0,0 @@ -<html>
-
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>WebServer Basic APIs</title>
-<link rel="stylesheet" href="../../style/normal_ws.css" type="text/css">
-</head>
-
-<body>
-<table width="550"><tr><td>
-
-<h1>Basic Source Code Module APIs</h1><p>These APIs are available to WebServer for memory management functions.
- They form part of the GoAhead Embedded Management Framework (EMF) basic
- module, from which all EMF applications obtain their lowest-level functionality.</p><TABLE WIDTH="48%" BORDER="0"><TR valign=top><TD WIDTH="30%"><P><A HREF="basicapi/balloc.htm">balloc</A><BR>
-<A HREF="basicapi/bclose.htm">bclose</A><BR>
-<A HREF="basicapi/bfree.htm">bfree</A><BR>
-<A HREF="basicapi/bfreeSafe.htm">bfreeSafe</A><BR>
-<A HREF="basicapi/bopen.htm">bopen</A><BR>
-<A HREF="basicapi/brealloc.htm">brealloc</A><BR><BR></P></TD><TD WIDTH="34%"><P><A HREF="basicapi/ringqOpen.htm">ringqOpen</A><BR>
-<A HREF="basicapi/ringqPutBlk.htm">ringqPutBlk</A><BR>
- <A HREF="basicapi/ringqPutStr.htm">ringqPutStr</A><BR><A HREF="basicapi/symClose.htm">symClose</A><BR>
-<A HREF="basicapi/symDelete.htm">symDelete</A><BR>
-<A HREF="basicapi/symEnter.htm">symEnter</A><BR><BR></P></TD><TD WIDTH="36%"><P>
-<A HREF="basicapi/symFirst.htm">symFirst</A><BR>
-<A HREF="basicapi/symLookup.htm">symLookup</A><BR>
-<A HREF="basicapi/symNext.htm">symNext</A><BR>
-<A HREF="basicapi/symOpen.htm">symOpen</A><BR><A HREF="basicapi/value_t.htm">value_t</A><BR><A HREF="basicapi/valueFree.htm">valueFree</A><BR><BR></P></TD></TR></TABLE><p> </p><p>
-
-
- </p></td></tr></table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/balloc.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/balloc.htm deleted file mode 100644 index 59f2c47a28..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/balloc.htm +++ /dev/null @@ -1,52 +0,0 @@ -<html>
-
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>balloc - basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-
-<table border="0" width="100%" cellspacing="0" cellpadding="0" CLASS="apiTitle">
- <tr>
- <td class="titleLeft" align=left width="33%"><b>balloc</b></td><td class="titleCenter" align=center width="33%"><b>basic</b></td><td class="titleRight" align=right width="33%"><b>EMF</b></td></tr>
-</table><hr>
-
-<h2>Synopsis</h2><p>Allocate a dynamic block of memory.</p><h2>Prototypes</h2><pre>
- #include "uemf.h"
-
- void *<b>balloc</b>(B_ARGS_DEC, int size);
-</pre><h2>Parameters</h2><table width="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
- <tr>
- <td VALIGN="TOP" width="14%">B_ARGS_DEC</td><td width="86%">Caller's source file name and line number. Really two arguments.
- </td></tr>
- <tr>
- <td VALIGN="TOP" width="14%">size</td><td width="86%">Size of the block to allocate.</td></tr>
-</table><h2>Description</h2><p>The balloc procedure creates and allocates a block of dynamic memory for use
- by the caller. When finished, you should use <a href="bfree.htm">bfree</a> to
- release the block. Balloc is a very efficient memory allocation that uses binary
- queues to store blocks of memory. It does not do block coalescing, nor does
- it attempt to eliminate fragmentation. Once released by bfree, memory is not
- actually freed to the operating system, but is kept on the relevant binary queue
- for future use by the application. Use B_L as the first argument to bfree to
- provide the source file name and line number arguments.</p><p>The goal of the balloc memory allocator is to provide guaranteed, rapid allocation.
- By calling <a href="bopen.htm">bopen</a> with the application memory requirements,
- memory can be defined or allocated upfront and subsequent calls to balloc are
- more likely to succeed. Balloc is not perfect. You can still get free memory
- on one class queue while memory requests for a large size cannot be satisfied.
- However, in practice, many embedded applications tend to allocate memory in
- a pattern and the balloc memory allocator works well in such environments. The
- memory usage of the GoAhead WebServer has been optimized to allocate from the
- fixed pool defined by bopen, and it should be very predictable in its requirements.
- The bstats procedure may be used to print out current memory statistics include
- per file usage information.</p><h2>Return Value</h2><p>Pointer to the allocated buffer. If memory cannot be provided, NULL is
-returned.</p><h2>Example</h2><pre>
-buf = balloc(B_L, 1024);
-gstrncpy(buf, "Hello World", sizeof(buf));
-bfree(B_L, buf);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2>See Also</h2><p><a href="bopen.htm">bopen</a>, <a href="bfree.htm">bfree</a></p></td></tr></table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bclose.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bclose.htm deleted file mode 100644 index f4e9943ca8..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bclose.htm +++ /dev/null @@ -1,27 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>bclose -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> bclose</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Close down the balloc module and free all malloced memory.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- void <b>bclose</b>();
-</pre><h2>Parameters</h2><p>
-<p>None</p><h2>Description</h2><P>Closes down the balloc module and frees all malloc'ed memory.</P><p> </p><h2>Return Value</h2><p> No return value.</p><h2>Example</h2><pre>
-void bclose();
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="bopen.htm">bopen</a>,
-<a href="balloc.htm">balloc</a>
-</p></tr></td></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bfree.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bfree.htm deleted file mode 100644 index 29c5210389..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bfree.htm +++ /dev/null @@ -1,35 +0,0 @@ -<html>
-
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>bfree - basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-
-<table border="0" width="100%" cellspacing="0" cellpadding="0" CLASS="apiTitle">
- <tr>
- <td class="titleLeft" align=left width="33%"><b>bfree</b></td><td class="titleCenter" align=center width="33%"><b>basic</b></td><td class="titleRight" align=right width="33%"><b>EMF</b></td></tr>
-</table><hr>
-
-<h2>Synopsis</h2><p>Free a dynamic block of memory allocated with balloc.</p><h2>Prototypes</h2><pre>
- #include "uemf.h"
-
- void <b>bfree</b>(B_ARGS_DEC, void *buf);
-</pre><h2>Parameters</h2><table width="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0">
- <tr VALIGN="TOP">
- <td width="14%">B_ARGS_DEC </td><td width="86%">Callers source file name and line number. Really two arguments.
- </td></tr>
- <tr VALIGN="TOP">
- <td width="14%">buf </td><td width="86%">Pointer to buffer to free.</td></tr>
-</table><p></p><h2>Description</h2><p>The bfree procedure releases a block of memory back to the
-<a href="balloc.htm">balloc</a> free queues. Memory is not actually freed to
-the operating system, but is kept locally for future use.</p><p></p><p>Use B_L as the first argument to bfree to provide the source file name and
-line number arguments.</p><h2>Return Value</h2><p>No return value.</p><h2>Example</h2><pre>
-bfree(B_L, buf);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2>See Also</h2><p><a href="balloc.htm">balloc</a>, <a href="bopen.htm">bopen</a></p></td></tr></table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bfreeSafe.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bfreeSafe.htm deleted file mode 100644 index 387d9ac903..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bfreeSafe.htm +++ /dev/null @@ -1,41 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>bfreeSafe -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-
-<table width="550"> <tr><td>
-
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> bfreeSafe</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Safe version of <a href="bfree.htm">bfree</a>.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- void <b>bfreeSafe</b>(B_ARGS_DEC, void *mp);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
- <TR>
- <TD VALIGN="TOP" width="13%">B_ARGS_DEC</TD><TD width="87%">Caller's source file name and line number. Really two arguments.
- </TD></TR>
- <tr>
- <td width="13%">mp</td><td width="87%">Pointer to the memory that is being freed.</td></tr>
-</table><p></p><h2>Description</h2><p> This "safe" version verifies that the pointer is not NULL before
- doing the free. </p><h2>Return Value</h2><p>No return value.</p><h2>Example</h2><pre>
-char_t* buf;
-
-buf = NULL;
-fmtAlloc(buf, FNAMSIZE, T("%s %d"), string, integer);
-
-...
-
-bfreeSafe(B_L, buf);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="balloc.htm">balloc</a>,
-<a href="bfree.htm">bfree</a>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bopen.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bopen.htm deleted file mode 100644 index ab5c13bcbf..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/bopen.htm +++ /dev/null @@ -1,52 +0,0 @@ -<html>
-
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>bopen - basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<table border="0" width="100%" cellspacing="0" cellpadding="0" CLASS="apiTitle">
- <tr>
- <td class="titleLeft" align=left width="33%"><b>bopen</b></td><td class="titleCenter" align=center width="33%"><b>basic</b></td><td class="titleRight" align=right width="33%"><b>EMF</b></td></tr>
-</table><hr>
-
-<h2>Synopsis</h2><p>Initialize the GoAhead block memory allocator.</p><h2>Prototypes</h2><pre>
- #include "uemf.h"
-
- int <b>bopen</b>(char *buf, int bufsize, int flags);
-</pre><h2>Parameters</h2><table width="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
- <tr>
- <td>buf </td><td>Pointer to buffer to use for initial memory allocation.</td></tr>
- <tr>
- <td>bufsize </td><td>Size of buf. </td></tr>
- <tr>
- <td>flags </td><td>Open mode flags.</td></tr>
-</table><h2>Description</h2><p>The bopen procedure initializes the GoAhead block memory allocator. The block
- allocator is a very efficient memory allocator that uses binary queues to store
- blocks of memory. It does not do block coalescing, nor does it attempt to eliminate
- fragmentation. Once released by bfree, memory is not actually freed to the operating
- system, but is kept on the relevant binary queue for future use by the application.</p><p></p><p>The goal of the block allocator is to provide guaranteed, rapid allocation.
- By calling bopen with the application memory requirements, memory can be defined
- or allocated upfront and subsequent calls to <a href="balloc.htm">balloc</a>
- are more likely to succeed. The block allocator is not perfect; you can still
- get free memory of one class queue while memory requests for a large size cannot
- be satisfied. However, in practice, many embedded applications tend to allocate
- memory in a pattern and the balloc memory allocator works well in such environments.
- The memory usage of the GoAhead WebServer has been optimized to allocate from
- the fixed pool defined by bopen and it should be very predictable in its requirements.
- The bstats procedure may be used to print out current memory statistics, including
- per file usage information.</p><p></p><p>If you wish to supply a static buffer for the block allocator to use, set the
- <em>buf </em>argument to a buffer of your choice and set <em>bufsize to </em>specify
- the size of the buffer. You must also set <em>flags </em>to be B_USER_BUF. The
- block allocated can also use the operating system's <em>malloc </em>call to
- get memory if the <em>flags</em> argument is set to B_USE_MALLOC.</p><h2>Return Value</h2><p>Returns 0 on success. Returns -1 if memory cannot be provided.</p><h2>Example</h2><pre>
-if (bopen(NULL, B_DEFAULT_MEM, 0) < 0) {
- return NULL;
- }
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2>See Also</h2><p><a href="balloc.htm">balloc</a>, <a href="bfree.htm">bfree</a></p></td></tr></table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/brealloc.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/brealloc.htm deleted file mode 100644 index 96d94afb23..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/brealloc.htm +++ /dev/null @@ -1,66 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>brealloc -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> brealloc</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Reallocate a block of memory.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- void *<b>brealloc</b>(B_ARGS_DEC, void* mp, int newsize);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
-
- <td width="11%">B_ARGS_DEC</td><td width="89%">Callers source file name and line number. Really two arguments.</td></tr>
- <tr>
-
- <td width="11%">mp</td><td width="89%">Pointer to a previously allocated memory block using balloc.</td></tr>
- <tr>
-
- <td width="11%">newsize</td><td width="89%">New size in bytes.</td></tr>
-</table><h2>Description</h2><p>
-The GoAhead equivalent of realloc.
-</p><p><B>Note:</B> Allows NULL pointers. Will just do a balloc on the size if
- that is the case.</p><h2>Return Value</h2><p>
-Return pointer to newly allocated block. If the realloc fails, NULL is returned
-and the previous buffer is preserved.
-</p><h2>Example</h2><pre>
-/***********************************************************************/
-/*
- * Add a character to a string buffer
- */
-
-static void put_char(strbuf_t *buf, char_t c)
-{
- if (buf->count >= buf->size) {
- if (! (buf->flags & STR_REALLOC)) {
- return;
- }
- buf->size += STR_INC;
- if (buf->size > buf->max && buf->size > STR_INC) {
- a_assert(buf->size <= buf->max);
- buf->size -= STR_INC;
- return;
- }
- if (buf->s == NULL) {
- buf->s = balloc(B_L, buf->size * sizeof(char_t));
- } else {
- buf->s = brealloc(B_L, buf->s, buf->size * sizeof(char_t));
- }
- }
- buf->s[buf->count] = c;
- ++buf->count;
-}
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="balloc.htm">balloc</a>,
-<a href="bfree.htm">bfree</a></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/ringqOpen.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/ringqOpen.htm deleted file mode 100644 index c2f01b9a5d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/ringqOpen.htm +++ /dev/null @@ -1,67 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>ringqOpen -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> ringqOpen</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Create a new ring queue for dynamic strings.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- int <b>ringqOpen</b>(ringq_t *rq, int increment, int maxsize);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
-
- <td width="9%">rq</td><td width="91%">Pointer to a ringq_t struct that receives the new ring queue.</td></tr>
- <tr>
-
- <td width="9%">increment</td><td width="91%">The amount to increase the size of the ringq should it need
- to grow.</td></tr>
- <tr>
-
- <td width="9%">maxsize</td><td width="91%">The upper limit beyond which the queue must not grow.</td></tr>
-</table><h2>Description</h2><p> A ring queue allows maximum utilization of memory for data storage and is
- ideal for input/output buffering. This module provides a highly efficient implementation
- and a vehicle for dynamic strings. </p><p> <b>Caution</b>: This is a public implementation and callers have full access
- to the queue structure and pointers. Change this module very carefully. </p><p>
-This module follows the open/close model.
-</p><p>
-Operation of a ringq where rq is a pointer to a ringq:
-</p><p>
-rq->buflen contains the size of the buffer.<br>
-rq->buf will point to the start of the buffer.<br>
-rq->servp will point to the first (un-consumed) data byte.<br>
- rq->endp will point to the next free location to which new data is added.<br>
-rq->endbuf will point to one past the end of the buffer.
-</p><p> E.g.: If the ringq contains the data "abcdef", it might look like: </p><pre>
-+-------------------------------------------------------------------+
- | | | | | | | | a | b | c | d | e | f | | | | |
-+-------------------------------------------------------------------+
- ^ ^ ^ ^
- | | | |
- rq->buf rq->servp rq->endp rq->enduf
-</pre><p> The queue is empty when servp == endp. This means that the queue will hold
- at most rq->buflen -1 bytes. It is the filler's responsibility to ensure that
- the ringq is never filled such that servp == endp. </p><p> It is the filler's responsibility to "wrap" the endp back to point to rq->buf
- when the pointer steps past the end. Correspondingly, it is the consumers responsibility
- to "wrap" the servp when it steps to rq->endbuf. The ringqPutc and ringqGetc
- routines will do this automatically. </p><h2>Return Value</h2><p>
-0 on success, -1 on error.
-</p><h2>Example</h2><pre>
-if (ringqOpen(&p.tagbuf, XML_INC, XML_MAX) < 0) {
- return -1;
-}
-</pre><h2>Stability Classification</h2><p>Evolving.</p><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="ringqPutBlk.htm">ringqPutBlk</a>,
-<a href="ringqPutStr.htm">ringqPutStr</a>
-</p></td></tr></table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/ringqPutBlk.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/ringqPutBlk.htm deleted file mode 100644 index a5f4b7ac3e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/ringqPutBlk.htm +++ /dev/null @@ -1,36 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>ringqPutBlk -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> ringqPutBlk</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Add a block of data to the ring queue.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- int <b>ringqPutBlk</b>(ringq_t *rq, unsigned char *buf, int size);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
- <td>rq</td><td>The ring queue where the block is added.</td></tr>
- <tr>
- <td>buf</td><td>Data to put on the end of the queue.</td></tr>
- <tr>
- <td>size</td><td>Length of the data buf that is incrementally added to the queue.</td></tr>
-</table><h2>Description</h2><p>
-Will grow the queue as required.
-</p><h2>Return Value</h2><p>
-Returns the number of bytes written to the queue.
-</p><h2>Example</h2><pre>
-ringqPutBlk(rq, newbuf, len);
-</pre><h2>Stability Classification</h2><p>Evolving.</p><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="ringqOpen.htm">ringqOpen</a>,
-<a href="ringqPutStr.htm">ringqPutStr</a></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/ringqPutStr.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/ringqPutStr.htm deleted file mode 100644 index f92bf292d8..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/ringqPutStr.htm +++ /dev/null @@ -1,39 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>ringqPutstr -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
-
- <td class="titleLeft" align=left width="33%"><b> ringqPutStr</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Add a string to the queue.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- int <b>ringqPutStr</b>(ringq_t *rq, char_t *str);,
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
-
- <td width="6%">rq</td><td width="94%">The ringq returned from a previous call to ringqOpen.</td></tr>
- <tr>
-
- <td width="6%">str</td><td width="94%">String to add to the queue.</td></tr>
-</table><h2>Description</h2><p> If dealing in wide strings, you must explicitly put the trailing two nulls.
- This routine will grow the queue as required and correctly set endbuf and buf.
-</p><h2>Return Value</h2><p>
-Returns the number of bytes successfully added.
-</p><h2>Example</h2><pre>
-ringqPutStr(&p.tagbuf, (char_t*) p.tokbuf.servp);
-</pre><h2>Stability Classification</h2><p>Evolving.</p><h2></h2><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="ringqOpen.htm">ringqOpen</a>,
-
-<a href="ringqPutBlk.htm">ringqPutBlk</a>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symClose.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symClose.htm deleted file mode 100644 index ff76414dd3..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symClose.htm +++ /dev/null @@ -1,41 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>symClose -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> symClose</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Closes and frees a symbol table and all symbols within it.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- void <b>symClose</b>(sym_fd_t sd);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
-
- <td width="10%">sd</td><td width="90%">Table handle.</td></tr>
-</table><P></p><h2>Description</h2><p> This module implements a highly efficient generic symbol table with update
- and access routines. Symbols are simple character strings and the values they
- take can be flexible types as defined by<A HREF="value_t.htm"> value_t</A>.
- This module allows multiple symbol tables to be created. </p><p>Frees all symbols in the hash table, then the hash table itself.
-<a href=valueFree.htm>valueFree</a> is called for each symbol that is
-deleted.</p><h2>Return Value</h2><p> No return value.</p><h2>Example</h2><pre>
-sym_fd_t id;
-
-symClose(id);
-</pre><h2>Stability Classification</h2><p>Evolving.</p><h2></h2><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="symDelete.htm">symDelete</a>,
-<a href="symEnter.htm">symEnter</a>,
-<a href="symFirst.htm">symFirst</a>,
-<a href="symLookup.htm">symLookup</a>,
-<a href="symNext.htm">symNext</a>,
-<a href="symOpen.htm">symOpen</a>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symDelete.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symDelete.htm deleted file mode 100644 index 98be979c37..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symDelete.htm +++ /dev/null @@ -1,43 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>symDelete -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> symDelete</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Deletes a lookup-value pair from a symbol table.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- int <b>symDelete</b>(sym_fd_t sd, char_t* name);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
- <td>sd</td><td>Handle to the table created from a previous call to <a href="symOpen.htm">symOpen</a>.</td></tr>
- <tr>
- <td>name</td><td>The string lookup key for the value to be deleted.</td></tr>
-</table><h2>Description</h2><p> This module implements a highly efficient generic symbol table with update
- and access routines. Symbols are simple character strings and the values they
- take can be flexible types as defined by <a href="value_t.htm">value_t</a>.
- This module allows multiple symbol tables to be created. </p><p>
-Frees and deletes an existing symbol from the table.
-<a href=valueFree.htm> </a> is called for each symbol that is
-deleted.
-</p><h2>Return Value</h2><p>
-Returns 0 on success or -1 on error.
-</p><h2>Example</h2><pre>
-int symDelete(id, "lookup");
-</pre><h2>Stability Classification</h2><p>Evolving.</p><h2></h2><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="symClose.htm">symClose</a>,
-<a href="symFirst.htm">symFirst</a>,
-<a href="symLookup.htm">symLookup</a>,
-<a href="symNext.htm">symNext</a>,
-<a href="symOpen.htm">symOpen</a>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symEnter.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symEnter.htm deleted file mode 100644 index 833ba8e01d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symEnter.htm +++ /dev/null @@ -1,56 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>symEnter -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> symEnter</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Adds a lookup-value pair to a symbol table.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- sym_t *<b>symEnter</b>(sym_fd_t sd, char_t* name, value_t v,
- int args);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
- <td>sd</td><td>Handle to the table created from a previous call to symOpen.</td></tr>
- <tr>
- <td>name</td><td>The string lookup key for future calls to <a href="symLookup.htm"> symLookup</a>.</td></tr>
- <tr>
- <td>v</td><td>The value to be stored in the symbol table.</td></tr>
- <tr>
- <td>args</td><td>Args.</td></tr>
-</table><h2>Description</h2><p> This module implements a highly efficient generic symbol table with update
- and access routines. Symbols are simple character strings, and the values they
- take can be flexible types as defined by <a href="value_t.htm">value_t</a>.
- This module allows multiple symbol tables to be created. </p><p> Enters a new or existing symbol into the table. If the symbol is already there,
- it updates the value and the previous value is freed by <a href=valueFree.htm>valueFree
- </a> . Always succeeds if enough memory is available. </p><h2>Return Value</h2><p>
-Returns a pointer to a sym_t structure that contains the new entry.
-</p><h2>Example</h2><pre>
-sym_fd_t id;
-sym_t* sp;
-
-id = symOpen(64);
-...
-
-symEnter(id, "lookup", valueString("value"), 0);
-...
-
-sp = symLookup(id, "lookup");
-</pre><h2>Stability Classification</h2><p>Evolving.</p><h2></h2><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="symClose.htm">symClose</a>,
-<a href="symDelete.htm">symDelete</a>,
-<a href="symFirst.htm">symFirst</a>,
-<a href="symLookup.htm">symLookup</a>,
-<a href="symNext.htm">symNext</a>,
-<a href="symOpen.htm">symOpen</a>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symFirst.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symFirst.htm deleted file mode 100644 index 63404fdb27..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symFirst.htm +++ /dev/null @@ -1,50 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>symFirst -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> symFirst</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Finds the first value for a given symbol table.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- sym_t *<b>symFirst</b>(sym_fd_t sd);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
- <td>sd</td><td>Handle to the table created from a previous call to <a href="symOpen.htm">symOpen</a>.</td></tr>
-</table><h2>Description</h2><p> This module implements a highly efficient generic symbol table with update
- and access routines. Symbols are simple character strings, and the values they
- take can be flexible types as defined by <a href="value_t.htm">value_t</a>.
- This module allows multiple symbol tables to be created. </p><p> Return the first symbol in the hashtable if there is one. This call is used
- as the first step in traversing the table. A call to symFirst should be followed
- by calls to <a href="symNext.htm">symNext</a> to get the remaining entries.
-</p><h2>Return Value</h2><p>
-Returns a pointer to a sym_t structure which contains the value.
-NULL if not found.
-</p><h2>Example</h2><pre>
-sym_fd_t data;
-sym_t* elem;
-
-elem = symFirst(data);
-
-while (elem != NULL) {
- ejSetVar(0, elem->name.value.string, elem->content.value.string);
- elem = symNext(data);
-}
-</pre><h2>Stability Classification</h2><p>Evolving.</p><h2></h2><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="symClose.htm">symClose</a>,
-<a href="symDelete.htm">symDelete</a>,
-<a href="symEnter.htm">symEnter</a>,
-<a href="symLookup.htm">symLookup</a>,
-<a href="symNext.htm">symNext</a>,
-<a href="symOpen.htm">symOpen</a>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symLookup.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symLookup.htm deleted file mode 100644 index 5b098422a6..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symLookup.htm +++ /dev/null @@ -1,50 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>symLookup -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> symLookup</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Finds a value from a symbol table given the lookup key.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- sym_t *<b>symLookup</b>(sym_fd_t sd, char_t* aname);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
- <td>sd</td><td>Handle to the table created from a previous call to <a href="symOpen.htm">symOpen</a>.</td></tr>
- <tr>
- <td>aname</td><td>The string lookup key that was set by <a href="symEnter.htm"> symEnter</a>.</td></tr>
-</table><h2>Description</h2><p> This module implements a highly efficient generic symbol table with update
- and access routines. Symbols are simple character strings and the values they
- take can be flexible types as defined by <a href="value_t.htm">value_t</a>.
- This module allows multiple symbol tables to be created. </p><h2>Return Value</h2><p>
-Returns a pointer to a sym_t structure which contains the value.
-NULL if not found.
-</p><h2>Example</h2><pre>
-sym_fd_t id;
-sym_t* sp;
-
-id = symOpen(64);
-...
-
-symEnter(id, "lookup", valueString("value"), 0);
-...
-
-sp = symLookup(id, "lookup");
-</pre><h2>Stability Classification</h2><p>Evolving.</p><h2></h2><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="symClose.htm">symClose</a>,
-<a href="symDelete.htm">symDelete</a>,
-<a href="symEnter.htm">symEnter</a>,
-<a href="symFirst.htm">symFirst</a>,
-<a href="symNext.htm">symNext</a>,
-<a href="symOpen.htm">symOpen</a>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symNext.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symNext.htm deleted file mode 100644 index d4d9984680..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symNext.htm +++ /dev/null @@ -1,51 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>symNext -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> symNext</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Finds the next value for a given symbol table after <a href="symFirst.htm">symFirst</a>
- is called.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- sym_t *<b>symNext</b>(sym_fd_t sd);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
- <td>sd</td><td>Handle to the table that was passed to <a href="symFirst.htm"> symFirst</a>.</td></tr>
-</table><h2>Description</h2><p> This module implements a highly efficient generic symbol table with update
- and access routines. Symbols are simple character strings and the values they
- take can be flexible types as defined by <a href="value_t.htm">value_t</a>.
- This module allows multiple symbol tables to be created. </p><p>Return the next symbol in the hashtable if there is one. This call is used
- as the loop body in traversing the table. A call to <a href="symFirst.htm">symFirst</a>
- must be performed followed by calls to <a href="symNext.htm">symNext</a> to
- receive the remaining entries. </p><h2>Return Value</h2><p>
-Returns a pointer to a sym_t structure which contains the value.
-NULL if not found.
-</p><h2>Example</h2><pre>
-sym_fd_t data;
-sym_t* elem;
-
-elem = symFirst(data);
-
-while (elem != NULL) {
- ejSetVar(0, elem->name.value.string, elem->content.value.string);
- elem = symNext(data);
-}
-</pre><h2>Stability Classification</h2><p>Evolving.</p><h2></h2><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="symClose.htm">symClose</a>,
-<a href="symDelete.htm">symDelete</a>,
-<a href="symEnter.htm">symEnter</a>,
-<a href="symFirst.htm">symFirst</a>,
-<a href="symLookup.htm">symLookup</a>,
-<a href="symOpen.htm">symOpen</a>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symOpen.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symOpen.htm deleted file mode 100644 index b1b372441e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/symOpen.htm +++ /dev/null @@ -1,53 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>symOpen -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> symOpen</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Creates a symbol table for fast indexing.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- sym_fd_t <b>symOpen</b>(int hash_size);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
- <td>hash_size</td><td>Table size. Nearest prime number is actually used.</td></tr>
-</table><h2>Description</h2><p> This module implements a highly efficient generic symbol table with update
- and access routines. Symbols are simple character strings, and the values they
- take can be flexible types as defined by <a href="value_t.htm">value_t</a>.
- This module allows multiple symbol tables to be created. </p><p>
-The function allocates a table structure (sym_tabent_t) which consists of
-the table size, a flag for whether the table is in use, and the actual table
-itself. The structure is stored in a global sym array that can be accessed by
-the returned sym_fd_t handle.
-</p><h2>Return Value</h2><p>
-Returns an integer (sym_fd_t) to be used as the handle for subsequent calls to
-the symbol table access functions. Returns -1 on error.
-</p><h2>Example</h2><pre>
-sym_fd_t id;
-sym_t* sp;
-
-id = symOpen(64);
-...
-
-symEnter(id, "lookup", valueString("value"), 0);
-...
-
-sp = symLookup(id, "lookup");
-</pre><h2>Stability Classification</h2><p>Evolving.</p><h2></h2><h2></h2><h2></h2><h2>See Also</h2><p>
-<a href="symClose.htm">symClose</a>,
-<a href="symDelete.htm">symDelete</a>,
-<a href="symEnter.htm">symEnter</a>,
-<a href="symFirst.htm">symFirst</a>,
-<a href="symLookup.htm">symLookup</a>,
-<a href="symNext.htm">symNext</a>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/valueFree.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/valueFree.htm deleted file mode 100644 index feccc56f94..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/valueFree.htm +++ /dev/null @@ -1,46 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>valueFree -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> valueFree</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Frees any storage allocated for a <a href="value_t.htm">value_t</a> variable.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- void <b>valueFree</b>(value_t* v);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <tr>
-
- <td width="4%"> </td><td width="96%">Pointer to the string or symbol type <A HREF="symClose.htm">symClose</A><BR>
-<A HREF="symDelete.htm">symDelete</A><BR>
-<A HREF="symEnter.htm">symEnter</A><BR>
- variable.</td></tr>
-</table><h2>Description</h2><p> The <A HREF="symClose.htm">symClose</A><BR>
-<A HREF="symDelete.htm">symDelete</A><BR>
-<A HREF="symEnter.htm">symEnter</A><BR><a href="value_t.htm">value_t</a> module provides a generic type that
- can hold all possible data types. It is designed to provide maximum efficiency.
-</p><p> This function either calls <a href="bfree.htm">bFree</a> for a string type
- or initiates the call back function for a symbol type. </p><h2>Return Value</h2><p>
-none
-</p><h2>Example</h2><pre>
-statemachine_t *sm;
-value_t v;
-
-v = valueSymbol((void *)sm, &fmFreeStateMachine);
-
-symEnter(smTable, instanceName, v, 0);
-
-valueFree(&v);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2></h2><h2></h2><h2>See Also</h2><p>
-<A HREF="value_t.htm">value_t</A></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/value_t.htm b/xbmc/lib/libGoAhead/web/docs/techref/basicapi/value_t.htm deleted file mode 100644 index f1e0f1fb5e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/basicapi/value_t.htm +++ /dev/null @@ -1,78 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>value_t -- basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-
-<table border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<tr>
- <td class="titleLeft" align=left width="33%"><b> value_t</b></td><td class="titleCenter" align=center width="33%"><b> basic</b></td><td class="titleRight" align=right width="33%"><B> EMF</B></td></tr>
-</table><hr>
-<h2>Synopsis</h2><p>Structure used to store all possible data types.</p><h2>Prototype</h2><pre>
- #include "uemf.h"
-
- typedef struct {
-
- union {
- char bool;
- char byteint;
- short shortint;
- char percent;
- long integer;
- long hex;
- long octal;
- long big[2];
- double floating;
- char_t *string;
- char *bytes;
- char_t *errmsg;
- void *symbol;
- } value;
-
- value_type_t type;
-
- unsigned int valid;
- unsigned int allocated; /* String was balloced */
-
-} value_t;
-
-
-typedef enum {
- undefined = 0,
- byteint = 1,
- shortint = 2,
- integer = 3,
- hex = 4,
- percent = 5,
- octal = 6,
- big = 7,
- bool = 8,
- floating = 9,
- string = 10,
- bytes = 11,
- symbol = 12,
- errmsg = 13
-} value_type_t;
-
-</pre><h2>Description</h2><p> The value_t type is used heavily in the GoAhead EMF database API. </p><H2>Example</H2><PRE>
-/********************************************/
-/*
- * Initialize a boolean value.
- */
-
-value_t valueBool(int value)
-{
- value_t v = VALUE_VALID;
-
- v.type = bool;
- v.value.bool = (char) value;
- return v;
-}
-</PRE><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2></h2><h2></h2><h2>See Also</h2><p>
-<A HREF="valueFree.htm">valueFree</A></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/da_api.htm b/xbmc/lib/libGoAhead/web/docs/techref/da_api.htm deleted file mode 100644 index 5cf3890c40..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/da_api.htm +++ /dev/null @@ -1,14 +0,0 @@ -<html>
-<head>
-<title>WebServer Digest Access Authentication APIs</title>
-<LINK REL="stylesheet" HREF="../../style/normal_ws.css" TYPE="text/css">
-</head>
-
-<body>
-<h1>The GoAhead WebServer Digest Access Authentication APIs</h1><blockquote>
-<P><A HREF="da_api/websCalcNonce.htm">websCalcNonce</A>
-<BR><A HREF="da_api/websCalcOpaque.htm">websCalcOpaque</A>
-<BR><A HREF="da_api/websCalcDigest.htm">websCalcDigest</A> <BR></P><P>
-</P></blockquote>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/da_api/websCalcDigest.htm b/xbmc/lib/libGoAhead/web/docs/techref/da_api/websCalcDigest.htm deleted file mode 100644 index d34c9c3526..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/da_api/websCalcDigest.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websCalcDigest -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">websCalcDigest</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Generate an RSA Data Security, Inc. MD5 Message-Digest Algorithm digest for digest authentication purposes.</P><H2><B>Prototype</B></H2><PRE> #include "websda.h"
-
- char_t *websCalcDigest(webs_t wp);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD WIDTH="5%">wp</TD><TD WIDTH="95%">pointer to a websRec data structure</TD></TR></TABLE><H2><B>Description</B></H2><P> The returned string must be deleted using <A HREF="../wsapi/bfree.htm">bfree</A>.</P><H2><B>Return Value</B></H2><P> websCalcDigest returns a pointer to a new copy of a digest string, or NULL on an error.</P><H2><B>Example</B></H2><PRE>char_t * digest = websCalcDigest(wp);</PRE><H2><B>See Also</B></H2><P> <A HREF="websCalcNonce.htm">websCalcNonce</A>(), <A HREF="../wsapi/bfree.htm">bfree</A>() </P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/da_api/websCalcNonce.htm b/xbmc/lib/libGoAhead/web/docs/techref/da_api/websCalcNonce.htm deleted file mode 100644 index 50d6831339..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/da_api/websCalcNonce.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websCalcNonce -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">websCalcNonce</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Generate a nonce string for digest authentication purposes.</P><H2><B>Prototype</B></H2><PRE> #include "websda.h"
-
- char_t alcNonce(webs_t wp);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD>wp</TD><TD>pointer to a websRec data structure</TD></TR></TABLE><H2><B>Description</B></H2><P> The returned string must be deleted using <A HREF="../wsapi/bfree.htm">bfree</A>.</P><H2><B>Return Value</B></H2><P> websCalcNonce returns a pointer to a new copy of a nonce string, or a NULL on an error.</P><H2><B>Example</B></H2><PRE>char_t * nonce = websCalcNonce(wp);</PRE><H2><B>See Also</B></H2><P> <A HREF="websCalcOpaque.htm">websCalcOpaque</A>(), <A HREF="websCalcDigest.htm">websCalcDigest</A>(), <A HREF="../wsapi/bfree.htm">bfree</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/da_api/websCalcOpaque.htm b/xbmc/lib/libGoAhead/web/docs/techref/da_api/websCalcOpaque.htm deleted file mode 100644 index 88d61a9e4f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/da_api/websCalcOpaque.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websCalcOpaque -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">websCalcOpaque</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Generate an opaque string for digest authentication purposes.</P><H2><B>Prototype</B></H2><PRE> #include "websda.h"
-
- char_t alcOpaque(webs_t wp);</PRE><H2><B>Parameters</B></H2><TABLE WIDTH="48%" BORDER="0"><TR><TD>wp</TD><TD>pointer to a websRec data structure</TD></TR></TABLE><H2><B>Description</B></H2><P> The returned string must be deleted using <A HREF="../wsapi/bfree.htm">bfree</A>.</P><H2><B>Return Value</B></H2><P> websCalcOpaque returns a pointer to a new copy of an opaque string, or a NULL on an error.</P><H2><B>Example</B></H2><PRE>char_t * opaque = websCalcOpaque(wp);</PRE><H2><B>See Also</B></H2><P> <A HREF="websCalcNonce.htm">websCalcNonce</A>(), <A HREF="../wsapi/bfree.htm">bfree</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi.htm deleted file mode 100644 index c31fb57864..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi.htm +++ /dev/null @@ -1,25 +0,0 @@ -<html>
-<head>
-<title>WebServer Database APIs</title>
-<LINK REL="stylesheet" HREF="../../style/normal_ws.css" TYPE="text/css">
-</head>
-
-<body>
-<h1>The GoAhead WebServer Database APIs</h1><blockquote>
-<P><A HREF="dbapi/dbAddRow.htm">dbAddRow<BR></A><A HREF="dbapi/dbClose.htm">dbClose</A>
-<BR><A HREF="dbapi/dbDeleteRow.htm">dbDeleteRow</A>
-<BR><A HREF="dbapi/dbGetTableId.htm">dbGetTableId</A>
-<BR><A HREF="dbapi/dbGetTableNrow.htm">dbGetTableNrow</A><BR><A HREF="dbapi/dbGetTableName.htm">dbGetTableName</A>
-<BR><A HREF="dbapi/dbLoad.htm">dbLoad</A>
-<BR><A HREF="dbapi/dbOpen.htm">dbOpen</A>
-<BR><A HREF="dbapi/dbReadInt.htm">dbReadInt</A>
-<BR><A HREF="dbapi/dbReadStr.htm">dbReadStr</A>
-<BR><A HREF="dbapi/dbRegisterDBSchema.htm">dbRegisterDBSchema</A>
-<BR><A HREF="dbapi/dbSave.htm">dbSave</A>
-<BR><A HREF="dbapi/dbSearchStr.htm">dbSearchStr</A>
-<BR><A HREF="dbapi/dbSetTableNrow.htm">dbSetTableNrow</A>
-<BR><A HREF="dbapi/dbWriteInt.htm">dbWriteInt</A>
-<BR><A HREF="dbapi/dbWriteStr.htm">dbWriteStr</A> <BR><A HREF="dbapi/dbZero.htm">dbZero</A><BR></P></blockquote><P><B>Database API Return Codes</B></P><blockquote><P>DB_OK (0): No error condition. <BR>DB_ERR_GENERAL (-1): A general error occurred in the database function. <BR>DB_ERR_COL_NOT_FOUND (-2): The specified column was not found. <BR>DB_ERR_COL_DELETED (-3): Attempt to access a deleted column. <BR>DB_ERR_ROW_NOT_FOUND (-4): The specified row ID is out of range. <BR>DB_ERR_ROW_DELETED (-5): Attempt to access a deleted row. <BR>DB_ERR_TABLE_NOT_FOUND (-6): The specified table name was not found. <BR>DB_ERR_TABLE_DELETED (-7): Attempt to access a deleted table. <BR>DB_ERR_BAD_FORMAT (-8): Attempt to access an integer as a string or vice versa. </P><P></P><P>
-</P></blockquote>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbAddRow.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbAddRow.htm deleted file mode 100644 index 12e4df16ec..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbAddRow.htm +++ /dev/null @@ -1,21 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbDeleteRow -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width="100%" cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="22%">dbAddRow</td><td class="titleCenter" align=middle width="44%"><b>GoAhead
-WebServer API</b></td><td class="titleRight" align=right width="34%"><B>GoAhead
-EMF</B></td></TR> </TABLE><HR> <H2><B>Synopsis</B></H2><P> Adds a row to a database table.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbAddRow(int did, char_t* table);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="80%" BORDER="0"><TR>
- <TD>did</TD><TD>database id returned from a previous dbOpen</TD></TR><TR><TD>table</TD><TD>table name that will contain the row being added</TD></TR></TABLE><H2><B>Description</B></H2><P> Adds and zeroes one row to the given database table.</P><H2><B>Return Value</B></H2><P>dbAddRow returns the row id of the new row upon success, or a negative number upon error.</P><H2><B>Example</B></H2><PRE>if ((rid = dbAdd(did, "detector")) < 0) { Error(wp,
- 200, "Cant add a detector row");
- return;
-}</PRE><H2><B>See Also</B></H2><P><A HREF="dbDeleteRow.htm">dbDeleteRow</A>, <A HREF="dbSetTableNrow.htm">dbSetTableNrow</A></P><P> </P></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbClose.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbClose.htm deleted file mode 100644 index b5939f829a..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbClose.htm +++ /dev/null @@ -1,25 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbClose -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbClose</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P>Closes an open database.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- void dbClose(int did); </PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD>did</TD><TD> Database ID returned from previous <A HREF="dbOpen.htm">dbOpen</A></TD></TR></TABLE><H2><B>Description</B></H2><P>Close the DB by freeing all allocated structures.<BR>Calls to dbClose are important when the program exits so that the allocated memory may be freed. </P><H2><B>Return Value</B></H2><P>No return value.</P><H2><B>Example</B></H2><PRE>static int testDbClose()
-{
- int dbid;
- dbid = dbGetId(DATABASE);
- harnessTesting(T("dbClose"));
- dbClose(dbid);
- ...
-}</PRE><H2><B>See Also</B></H2><P><A HREF="dbOpen.htm">dbOpen</A>, <A HREF="dbRegisterDBSchema.htm">dbRegisterDBSchema</A></P><P> </P></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbDeleteRow.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbDeleteRow.htm deleted file mode 100644 index 5c066a9f7b..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbDeleteRow.htm +++ /dev/null @@ -1,20 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbDeleteRow -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="22%">dbDeleteRow</TD><td class="titleCenter" align=center width="44%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="34%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis</B></H2><P>Removes a given row from a database table.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbDeleteRow(int did, char_t* table, int rid);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="43%" BORDER="0"><TR><TD>did</TD><TD>database id returned from a previous dbOpen</TD></TR><TR><TD>table</TD><TD>table name that contains the row being deleted</TD></TR><TR><TD>rid</TD><TD>row number that will be deleted from the table</TD></TR></TABLE><H2><B>Description</B></H2><P>Deletes and frees one row. All rows shift accordingly to the deletion. <BR>Note: Does not actually delete the row; only the contents of the row are deleted.</P><H2><B>Return Value</B></H2><P>dbDeleteRow returns 0 upon success, or -1 upon error.</P><H2><B>Example</B></H2><PRE>if (dbDeleteRow(did, "detector", row) < 0) {
- Error(wp, 200, "Cant delete detector row");
- return;
-}</PRE><H2><B>See Also</B></H2><P> </P></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbGetTableId.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbGetTableId.htm deleted file mode 100644 index 761e4f40c5..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbGetTableId.htm +++ /dev/null @@ -1,17 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbGetTableId -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbGetTableId</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Return the Table Identifier corresponding to the given table name.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbGetTableId(int did, char_t * tname);</PRE><H2><B>Parameters</B></H2><P> did - Database Identifier <BR> tname - the name of the table</P><H2><B>Description</B></H2><P> The database module defines the table identifier internally.</P><H2><B>Return Value</B></H2><P> dbGetTableId returns the table id if successful, or -1 if not found.</P><H2><B>Example</B></H2><PRE>int tableID = dbGetTableId(0, T("USERS"));</PRE><H2><B>See Also</B></H2><P> <A HREF="dbGetTableName.htm">dbGetTableName</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbGetTableName.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbGetTableName.htm deleted file mode 100644 index d4a6d5fc69..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbGetTableName.htm +++ /dev/null @@ -1,17 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbGetTableName -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbGetTableName</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis</B></H2><P> Returns a pointer to the name of the table corresponding to the table id.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- char_t * dbGetTableName(int did, int tid);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="28%" BORDER="0"><TR><TD WIDTH="20%">did</TD><TD WIDTH="80%">database Identifier</TD></TR><TR><TD WIDTH="20%">tid</TD><TD WIDTH="80%">table identifier</TD></TR></TABLE><H2><B>Description</B></H2><P> The database module defines the table identifier internally.</P><H2><B>Return Value</B></H2><P> dbGetTableName returns a pointer to the table name if successful, or NULL if not found.</P><H2><B>Example</B></H2><PRE>const char_t * pTableName = dbGetTableName(0, 1);</PRE><H2><B>See Also</B></H2><P> <A HREF="dbGetTableId.htm">dbGetTableId</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbGetTableNrow.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbGetTableNrow.htm deleted file mode 100644 index c25810e17c..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbGetTableNrow.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbGetTableNrow -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbGetTableNrow</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Get the number of rows in the table.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbGetTableNrow(int did, char_t *table);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD WIDTH="14%">did</TD><TD WIDTH="86%">database Identifier</TD></TR><TR><TD WIDTH="14%">table</TD><TD WIDTH="86%">name of the table</TD></TR></TABLE><H2><B>Description</B></H2><P> The number of usable rows in the table may be less than the actual number of rows in the table, since only the contents of deleted rows are deleted by dbDeleteRow, not the row itself.</P><H2><B>Return Value</B></H2><P> dbGetTableNrow returns the number of rows in the table if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>numRows = dbGetTableNrow(0, T("USERS"));</PRE><H2><B>See Also</B></H2><P> <A HREF="dbSetTableNrow.htm">dbSetTableNRow</A>(), <A HREF="dbDeleteRow.htm">dbDeleteRow</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbLoad.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbLoad.htm deleted file mode 100644 index 3fbbf0cd82..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbLoad.htm +++ /dev/null @@ -1,17 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbLoad -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbLoad</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P>Load the contents of a database to file. </P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbLoad(int did, char_t * filename, int flags);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="34%" BORDER="0"><TR><TD WIDTH="24%">did</TD><TD WIDTH="76%">database Identifier</TD></TR><TR><TD WIDTH="24%">filename</TD><TD WIDTH="76%">name of file to load</TD></TR><TR><TD WIDTH="24%">flags</TD><TD WIDTH="76%">flags - reserved for future use</TD></TR></TABLE><BLOCKQUOTE></BLOCKQUOTE><H2><B>Description</B></H2><P>int dbLoad(int did, char_t * filename, int flags);</P><H2><B>Return Value</B></H2><P> dbLoad returns 0 if successful, or -1 if an error.</P><H2><B>Example</B></H2><PRE>int nCheck = dbLoad(0, T("config.txt"), 0);</PRE><H2><B>See Also</B></H2><P> <A HREF="dbSave.htm">dbSave</A>(), <A HREF="dbOpen.htm">dbOpen</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbOpen.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbOpen.htm deleted file mode 100644 index f14f8374af..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbOpen.htm +++ /dev/null @@ -1,17 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbOpen -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbOpen</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><P>All parameters are ignored. This function is provided for compatibility only. </P><H2><B>See also</B> </H2><P><A HREF="dbRegisterDBSchema.htm">dbRegisterDBSchema</A></P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE>
-
-</td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbReadInt.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbReadInt.htm deleted file mode 100644 index 466ba2e647..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbReadInt.htm +++ /dev/null @@ -1,21 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbReadInt -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbReadInt</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis</B></H2><P>Retrieves integer values from the databases.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbReadInt(int did, char_t* table, char_t* column,
- int row, int *returnValue); </PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="54%" BORDER="0"><TR><TD WIDTH="16%">did</TD><TD WIDTH="83%">returned database ID</TD></TR><TR><TD WIDTH="16%">table</TD><TD WIDTH="83%">table name in the database</TD></TR><TR><TD WIDTH="16%">column</TD><TD WIDTH="83%">column name in the table</TD></TR><TR><TD WIDTH="16%">row</TD><TD WIDTH="83%">row number in the column</TD></TR><TR><TD WIDTH="16%">returnValue</TD><TD WIDTH="83%">pointer to an integer to contain the value read from the database</TD></TR></TABLE><H2><B>Description</B></H2><P>Read an integer from the database.</P><H2><B>Return Value</B></H2><P>dbReadInt returns the integer database element in returnValue. It returns 0 if successful, or -1 on errors.</P><H2><B>Example</B></H2><PRE>int driveno;
-if (dbReadInt(smd, "base_fs_static", "disk", row, &driveno) < 0) {
- /* Error */
-}</PRE><H2><B>See Also</B></H2><P> <A HREF="dbReadStr.htm">dbReadStr</A></P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></tr></td></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbReadStr.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbReadStr.htm deleted file mode 100644 index ad3cc2821d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbReadStr.htm +++ /dev/null @@ -1,22 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbReadStr -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbReadStr</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P>Retrieves string values from the databases.</P><H2><B>Prototype</B></H2><PRE>
- #include "emfdb.h"
-
- int dbReadStr(ind did, char_t* table, char_t* column, int row,
- char_t **returnValue); </PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="40%" BORDER="0"><TR><TD WIDTH="26%">did</TD><TD WIDTH="74%">database id</TD></TR><TR><TD WIDTH="26%">table</TD><TD WIDTH="74%">table name in the database</TD></TR><TR><TD WIDTH="26%">column</TD><TD WIDTH="74%">column name in the table</TD></TR><TR><TD WIDTH="26%">row</TD><TD WIDTH="74%">row number in the column</TD></TR><TR><TD WIDTH="26%">returnValue</TD><TD WIDTH="74%">returns the string database element</TD></TR></TABLE><H2><B>Description</B></H2><P>Read a string from the database.</P><H2><B>Return Value</B></H2><P>dbReadStr returns 0 if success, or -1 if an error occurred.</P><H2><B>Example</B></H2><PRE>char_t* fsname;
-dbReadStr(smd, "base_fs_static", "name", row, &fsname);
-</PRE><H2><B>See Also</B></H2><P> <A HREF="dbReadInt.htm">dbReadInt</A> </P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbRegisterDBSchema.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbRegisterDBSchema.htm deleted file mode 100644 index edfcaf807e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbRegisterDBSchema.htm +++ /dev/null @@ -1,30 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbRegisterDBSchema -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbRegisterDBSchema</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Add a schema to the module-internal schema database.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbRegisterDBSchema(char_t * tablename, schemaTable_t * sTable);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="63%" BORDER="0"><TR><TD WIDTH="16%">tablename</TD><TD WIDTH="84%">name of the table to add to the database</TD></TR><TR><TD WIDTH="16%">sTable</TD><TD WIDTH="84%">schema for the table being added</TD></TR></TABLE><H2><B>Description</B></H2><P> This function creates an empty table in the web server database module. Tables are defined by means of the following schema structure:</P><PRE>
-typedef struct schemaTable_s {
- int nColumns;
- char_t **columnNames;
- int *columnTypes;
- int nRows;
- int **rows;
-} schemaTable_t;</PRE><P> nColumns - the number of columns in the table<BR> columnName - a list of strings defining the column names<BR> columnTypes - a list of integers defining the column type (can be T_STRING or T_INT)<BR> nRows - indicates the number of rows in the table. Initialized to 0.<BR> rows - a list of pointers to a number (nColumns) of data items</P><P>This function does NOT exist in the EMF database module.</P><H2><B>Return Value</B></H2><P> dbRegisterDBSchema returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>schemaTable_t stable;
-sTable.nColumns = 3;
-sTable.columnNames = {T("USERID"), T("PASSWORD"), T("GROUP")};
-sTable.columnTypes = {T_STRING, T_STRING, T_INT};
-/* The remaining elements of the schema table are not used */
-nCheck = dbRegisterSchema(T("USERS"), &sTable);
- </PRE><H2><B>See Also</B></H2><P> <A HREF="dbOpen.htm">dbOpen()</A>, <A HREF="dbClose.htm">dbClose</A>(), <A HREF="dbLoad.htm">dbLoad</A>(), <A HREF="dbSave.htm">dbSave</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbSave.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbSave.htm deleted file mode 100644 index 0caf9614ac..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbSave.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbSave -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbSave</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis</B></H2><P> Dump the contents of a database to file.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbSave(int did, char_t * filename, int flags);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="57%" BORDER="0"><TR><TD WIDTH="15%">did</TD><TD WIDTH="85%">database Identifier</TD></TR><TR><TD WIDTH="15%">filename</TD><TD WIDTH="85%">name of the file to write to</TD></TR><TR><TD WIDTH="15%">flags</TD><TD WIDTH="85%">unused, provided for compatibility with earlier versions</TD></TR></TABLE><H2><B>Description</B></H2><P>Write the contents of the database (i.e., ALL tables) to a text file.</P><H2><B>Return Value</B></H2><P> dbSave returns 0 if successful, or -1 if an error.</P><H2><B>Example</B></H2><PRE>int nCheck = dbSave(0, T("config.txt"), 0);</PRE><H2><B>See Also</B></H2><P> <A HREF="dbOpen.htm">dbOpen</A>(), <A HREF="dbLoad.htm">dbLoad</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE><td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbSearchStr.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbSearchStr.htm deleted file mode 100644 index 22f4aaeb5d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbSearchStr.htm +++ /dev/null @@ -1,23 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbSearchStr -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbSearchStr</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P>Search for a string in a given column.</P><H2><B>Prototype</B></H2><PRE>
- #include "emfdb.h"
-
- int dbSearchStr(int did,
- char_t* table,
- char_t* column,
- char_t* value,
- int flags);
-</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="80%" BORDER="0"><TR><TD WIDTH="16%">did</TD><TD WIDTH="84%">database identifier</TD></TR><TR><TD WIDTH="16%">table</TD><TD WIDTH="84%">name of the table</TD></TR><TR><TD WIDTH="16%">column</TD><TD WIDTH="84%">name of the column of the table to search</TD></TR><TR><TD WIDTH="16%">value</TD><TD WIDTH="84%">string to search for</TD></TR><TR><TD WIDTH="16%">flags</TD><TD WIDTH="84%">unused, provided for compatibility with earlier versions</TD></TR></TABLE><H2><B>Description</B></H2><P> The row id returned by this function can be used by the various dbRead and dbWrite functions.</P><H2><B>Return Value</B></H2><P> dbSearchStr returns the row id of the found record if successful, or -1 if an error.</P><H2><B>Example</B></H2><PRE>int nCheck = dbSearchStr(0, T("USERS"), T("USER"), T("misterripley"), 0); </PRE><H2><B>See Also</B></H2><P> <A HREF="dbReadStr.htm">dbReadStr</A>(), <A HREF="dbWriteStr.htm">dbWriteStr</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbSetTableNrow.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbSetTableNrow.htm deleted file mode 100644 index 0e8674a90f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbSetTableNrow.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbSetTabelNrow -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbSetTabelNrow</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Set the number of row in the table.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbSetTableNrow(int did, char_t* table, int nNewRows);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="55%" BORDER="0"><TR><TD>did</TD><TD>database Identifier tname - the name of the table</TD></TR><TR><TD>nNewRows</TD><TD>total number of rows to allocate for the database</TD></TR><TR><TD>table</TD><TD>the name of the table</TD></TR></TABLE><H2><B>Description</B></H2><P>This function is used to grow the size of the table. If the number of rows requested by this function is less than the actual number of rows, the function returns without doing anything.</P><H2><B>Return Value</B></H2><P> dbSetTabelNrow returns 0 if successful, or -1 if an error.</P><H2><B>Example</B></H2><PRE>int dbSetTableNrow(int did, char_t* table, int nNewRows);</PRE><H2><B>See Also</B></H2><P> <A HREF="dbGetTableNrow.htm">dbGetTableNrow</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbWriteInt.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbWriteInt.htm deleted file mode 100644 index 67fb877f1e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbWriteInt.htm +++ /dev/null @@ -1,17 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbWriteInt -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbWriteInt</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P>Updates integer values to the designated cell.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbWriteInt(int did, char_t* table, char_t* column, int row, int i); </PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="68%" BORDER="0"><TR><TD WIDTH="15%">did</TD><TD WIDTH="85%">database ID returned when the database was created</TD></TR><TR><TD WIDTH="15%">table</TD><TD WIDTH="85%">table name in the database</TD></TR><TR><TD WIDTH="15%">column</TD><TD WIDTH="85%">column name in the table</TD></TR><TR><TD WIDTH="15%">row</TD><TD WIDTH="85%">row number in the column</TD></TR><TR><TD WIDTH="15%">i</TD><TD WIDTH="85%">integer value to be written to the cell</TD></TR></TABLE><H2><B>Description</B></H2><P>Write an integer to the database.</P><H2><B>Return Value</B></H2><P>dbWriteInt returns 0 on success, or a -1 if a failure.</P><H2><B>Example</B></H2><PRE>dbWriteInt(smd, "base_os", "swap_free", 0, value_integer(1000)); </PRE><H2><B>See Also</B></H2><P><A HREF="dbWriteInt.htm">dbWriteInt</A>, <A HREF="dbWriteStr.htm">dbWriteStr</A> </P><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbWriteStr.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbWriteStr.htm deleted file mode 100644 index ea276c7524..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbWriteStr.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbWriteStr -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbWriteStr</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis</B></H2><P>Updates string values to the designated cell.</P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbWriteStr(int did, char_t* table, char_t* column,
- int row, char_t* s); </PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="67%" BORDER="0"><TR><TD>did</TD><TD>database id returned when the database was created</TD></TR><TR><TD>table</TD><TD>table name in the database</TD></TR><TR><TD>column</TD><TD>column name in the table</TD></TR><TR><TD>row</TD><TD>row number in the column</TD></TR><TR><TD>s</TD><TD>string value to be written to the cell</TD></TR></TABLE><H2><B>Description</B></H2><P>Write a string to the database.</P><P>Note: The database will automatically insert a backslash in front of any double quote character written to a database cell. This may result in the value returned by dbRead to be different from the value written with dbWrite. </P><H2><B>Return Value</B></H2><P>dbWriteStr returns 0 on successful write, or -1 if otherwise. </P><H2><B>Example</B></H2><PRE>dbWriteStr(dbid, TABLE, T("description"), row, T("Foosball Master")) </PRE><H1><B>See Also</B></H1><P><A HREF="dbWriteStr.htm">dbWriteStr</A>, <A HREF="dbWriteInt.htm">dbWriteInt</A> </P><P> </P></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbZero.htm b/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbZero.htm deleted file mode 100644 index f1b313bd7b..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/dbapi/dbZero.htm +++ /dev/null @@ -1,17 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>dbLoad -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width="100%" cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">dbZero</td><td class="titleCenter" align=middle width="33%"><b>GoAhead
-WebServer API</b></td><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></td></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P>Empties the contents of all tables in a database. </P><H2><B>Prototype</B></H2><PRE> #include "emfdb.h"
-
- int dbZero(int did);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="34%" BORDER="0"><TR><TD WIDTH="24%">did</TD><TD WIDTH="76%">database Identifier</TD></TABLE><BLOCKQUOTE></BLOCKQUOTE><H2><B>Description</B></H2><P>Deletes all the rows in the all the tables in the database.</P><H2><B>Return Value</B></H2><P> dbZero returns 0 if successful, or -1 if an error.</P><H2><B>Example</B></H2><PRE>int nCheck = dbZero(0);</PRE><H2><B>See Also</B></H2><P> <A href="dbSave.htm">dbSave</A>(), <A href="dbOpen.htm">dbOpen</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/ejsapi.htm b/xbmc/lib/libGoAhead/web/docs/techref/ejsapi.htm deleted file mode 100644 index 935554915d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/ejsapi.htm +++ /dev/null @@ -1,20 +0,0 @@ -<html>
-<head>
-<title>WebServer Javascript APIs</title>
-<LINK REL="stylesheet" HREF="../../style/normal_ws.css" TYPE="text/css">
-</head>
-
-<body>
-<h1>The GoAhead Embedded JavaScript APIs</h1><blockquote>
-<P><A href="jsapi/ejArgs.htm" >ejArgs</a><br>
-<A href="jsapi/ejClose.htm" >ejClose</a><br>
-<A HREF="jsapi/ejCloseEngine.htm">ejCloseEngine</A><BR>
-<A href="jsapi/ejEval.htm" >ejEval</a><br>
-<A href="jsapi/ejGetVar.htm" >ejGetVar</a><br>
-<A href="jsapi/ejOpen.htm" >ejOpen</a><br>
-<A HREF="jsapi/ejOpenEngine.htm">ejOpenEngine</A><BR>
-<A href="jsapi/ejSetGlobalFunction.htm" >ejSetGlobalFunction</a><br><A HREF="jsapi/ejSetResult.htm">ejSetResult</A><BR>
-<A href="jsapi/ejSetVar.htm" >ejSetVar</a><br>
-</P></blockquote>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejArgs.htm b/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejArgs.htm deleted file mode 100644 index 11cdef353c..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejArgs.htm +++ /dev/null @@ -1,42 +0,0 @@ -<html>
-<head>
-<title>ejArgs -- GoAhead Embedded JavaScript</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0>
-<TR>
-
-<td class="titleLeft" align=left width="33%">ejArgs</TD><td class="titleCenter" align=center width="33%"><b>GoAhead JavaScript API</b></TD><td class="titleRight" align=right><B>GoAhead EMF</B></TD></TABLE><HR>
-
-
-
-<h2>Synopsis</h2><p>Crack the arguments given to an JavaScript script procedure.</p><h2>Prototype</h2><pre>
- #include "ej.h"
-
- int <b>ejArgs</b>(int argc, char_t **argv, char_t *fmt, ...);
-</pre><h2>Parameters</h2><p><table width=90%>
-
- <TR>
- <TD width=40>argc
- <TD>Number of arguments in argv
- <TR>
- <TD width=40>argv
- <TD> List of arguments
- <TR>
- <TD width=40>fmt
- <TD>Sprintf style format string with %s and %d parameters<tr>
- <td width=40 cellpadding = 20>...</td><td cellpadding = 20>Pointers to variables to store %s and %d parameters</td></tr></table><h2>Description</h2><P style="LEFT: -7798249px; TOP: 503px"> The ejArgv procedure is used by JavaScript procedures to crack their ASP scripting
-arguments. It parses the <i>argv</i>parameter and stores the arguments in individual variables
-passed to ejArgs. The <EM>fmt</EM> parameter provides a sprintf style argument specification. Only %s and
-%d specifiers are supported. </P><h2>Return Value</h2><p>Returns the number of arguments found in
-<EM>args</EM> .</p><h2>Example</h2><pre>
-if (ejArgs(argc, argv, "%s %d", &name, &age) < 2) {
- websError(wp, 400, "Insufficient args\n");
- return -1;
-}
-</pre><h2>See Also</h2><p><A href="../../../over/ejs.htm">JavaScript</A>, <A href="../../../over/asp.htm">Active Server Pages</A></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejClose.htm b/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejClose.htm deleted file mode 100644 index b7d429aeb6..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejClose.htm +++ /dev/null @@ -1,35 +0,0 @@ -<html>
-<head>
-<title>ejClose -- GoAhead Embedded JavaScript</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0>
-<TR>
- <td class="titleLeft" align=left width="33%"><B>ejClose</B></TD><td class="titleCenter" align=center width="33%"><b>GoAhead JavaScript API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead EMF</B></TD></TR>
-
-</TABLE><HR>
-
-<h2>Synopsis</h2><p>Close a JavaScript interpreter session.</p><h2>Prototype</h2><pre>
- #include "ej.h"
-
- void <b>ejClose</b>(int eid);
-</pre><h2>Parameters</h2><p><table width=90%>
-
- <TR>
- <TD width=40>eid
- <TD> JavaScript interpreter handle</TR></table><h2>Description</h2><P><b>ejClose</b> closes a JavaScript interpreter that has been opened
-vi <b>ejOpen</b>.
-
-<h2>Return Value</h2><p>None.</p><h2>Example</h2><pre>
-ejClose(eid);
-</pre><h2>See Also</h2><p>
-<A href="../../../over/ejs.htm">JavaScript</A>,
-<A href="../../../over/asp.htm">Active Server Pages</A>
-<A href="ejOpen.htm">ejOpen</A>
-<A href="ejEval.htm">ejEval</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejCloseEngine.htm b/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejCloseEngine.htm deleted file mode 100644 index fea23c123e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejCloseEngine.htm +++ /dev/null @@ -1,37 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>ejCloseEngine -- GoAhead Embedded JavaScript</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<TR>
-
-<td class="titleLeft" align=left width="33%"><B>ejCloseEngine</B></TD><td class="titleCenter" align=center width="33%"><b>GoAhead JavaScript API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead EMF</B></TD></TR>
-</TABLE><HR>
-
-<h2>Synopsis</h2><p>Close a JavaScript interpreter session.</p><h2>Prototype</h2><pre>
-#include "ej.h"
-
-void <b>ejCloseEngine</b>(int eid);
-</pre>
-
-<h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-
- <TR>
-
- <TD VALIGN="TOP" width="6%">eid
- <TD width="94%"> JavaScript interpreter handle.
- </TR></table><h2>Description</h2><P><b>ejCloseEngine</b> closes a JavaScript interpreter that has been opened via
- <b>ejOpenEngine</b>.
-<h2>Return Value</h2><p>None.</p><h2>Example</h2><pre>
-ejCloseEngine(eid);
-</pre>
-<h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="../../../over/ejs.htm">JavaScript</A>, <A href="../../../over/asp.htm">Active
- Server Pages</A> <A href="ejOpenEngine.htm">ejOpenEngine</A> <A href="ejEval.htm">ejEval</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejEval.htm b/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejEval.htm deleted file mode 100644 index a4208c1b5a..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejEval.htm +++ /dev/null @@ -1,52 +0,0 @@ -<html>
-<head>
-<title>ejEval -- GoAhead Embedded JavaScript</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<TR>
-
-<td class="titleLeft" align=left width="33%"><B>ejEval</B></TD><td class="titleCenter" align=center width="33%"><b>GoAhead JavaScript API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead EMF</B></TD></TR>
-</TABLE><HR>
-
-
-<h2>Synopsis</h2><p>Set the value of a JavaScript variable</p><h2>Prototype</h2><pre>
-#include "ej.h"
-
-int <b>ejEval</b>(int eid, char_t *script, char_t **errorMessage);
-</pre>
-
-<h2>Parameters</h2><p><table width=90%>
-
- <TR>
- <TD width=40>eid
- <TD>JavaScript interpreter handle
- <TR>
- <TD width=40>script
- <TD> JavaScript to evaluate
-
- <TR>
- <TD width=40>errorMessage
- <TD> Error
-message</TD></TR></table><h2>Description</h2><P>The ejEval procedure evaluates a JavaScript script. If
-the script fails, a text message describing the error
-is returned in <i>errorMessage</i>. This message is dynamically
-allocated and must be freed using <i>bfree</i>.
-
-<h2>Return Value</h2><p>Returns 0 if successful. Returns -1 on errors.</p><h2>Example</h2><pre>char_t *emsg;
-
-ejEval(eid, "write('Hello World');", &emsg);
-</pre>
-<h2>See Also</h2><p>
-<A href="../../../over/ejs.htm">JavaScript</A>,
-<A href="../../../over/asp.htm">Active Server Pages</A>,
-<A href="ejOpen.htm">ejOpen</A>,
-<A href="ejGetVar.htm">ejGetVar</A>
-</p></td></tr></table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejGetVar.htm b/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejGetVar.htm deleted file mode 100644 index 38cdd60975..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejGetVar.htm +++ /dev/null @@ -1,46 +0,0 @@ -<html>
-<head>
-<title>ejGetVar -- GoAhead Embedded JavaScript</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<TR>
-
-<td class="titleLeft" align=left width="33%"><B>ejGetVar</B></TD><td class="titleCenter" align=center width="33%"><b>GoAhead JavaScript API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead EMF</B></TD></TR>
-</TABLE><HR>
-
-
-<h2>Synopsis</h2><p>Get the value of a JavaScript variable</p><h2>Prototype</h2><pre>
-#include "ej.h"
-
-char_t* <b>ejGetVar</b>(int eid, char_t *variable);
-</pre>
-
-<h2>Parameters</h2><p><table width=90%>
-
- <TR>
- <TD width=40>eid
- <TD>JavaScript interpreter handle
-
- <TR>
- <TD width=40>variable
- <TD>Name of JavaScript
-variable</TD></TR></table><h2>Description</h2><P>The ejGetVar procedure returns the current value of the JavaScript
-variable. </p>.
-
-<h2>Return Value</h2><p>Returns a pointer to the current value. Returns NULL if the
-variable does not exist.</p><h2>Example</h2><pre>
-ejGetVar(eid);
-</pre>
-<h2>See Also</h2><p>
-<A href="../../../over/ejs.htm">JavaScript</A>,
-<A href="../../../over/asp.htm">Active Server Pages</A>,
-<A href="ejSetVar.htm">ejSetVar</A>,
-<A href="ejEval.htm">ejEval</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejOpen.htm b/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejOpen.htm deleted file mode 100644 index 4435c229df..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejOpen.htm +++ /dev/null @@ -1,48 +0,0 @@ -<html>
-<head>
-<title>ejOpen -- GoAhead Embedded JavaScript</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-
-<table width="550"> <tr><td>
- <TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<TR>
-
-<td class="titleLeft" align=left width="33%"><B>ejOpen</B></TD><td class="titleCenter" align=center width="33%"><b>GoAhead JavaScript API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead EMF</B></TD></TR>
-</TABLE><HR>
-
-
-<h2>Synopsis</h2><p>Open a JavaScript interpreter session.</p><h2>Prototype</h2><pre>
-#include "ej.h"
-
-int <b>ejOpen</b>(sym_fd_t variables, sym_fd_t functions);
-</pre><h2>Parameters</h2><p><table width=90%>
-
- <TR>
- <TD width=40>variables
- <TD> Symbol table for variables
- <TR>
- <TD width=40>functions
- <TD>Symbol table for functions</TR></table><h2>Description</h2><P>To use JavaScript, you must first open an interpreter session
-with <i>ejOpen</i>. JavaScript interpreters usually have their own
-variable and global function name space. To share variable or function
-name space, pass a symbol table into <b>ejOpen</b> in the <i>variable</i>
-or <i>function</i> parameters. If either of these parameters are set
-to NULL, the symbol table will be created automatically.</P><p>Use <b>ejClose</b> to close the interpreter when finished.
-
-
-<h2>Return Value</h2><p>Handle for the JavaScript interpreter.</p><h2>Example</h2><pre>
-if (ejOpen(NULL, NULL)< 0) {
- /* Cant open interpreter */
- return -1;
-}
-</pre><h2>See Also</h2><p>
-<A href="../../../over/ejs.htm">JavaScript</A>,
-<A href="../../../over/asp.htm">Active Server Pages</A>
-<A href="ejClose.htm">ejClose</A>
-<A href="ejEval.htm">ejEval</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejOpenEngine.htm b/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejOpenEngine.htm deleted file mode 100644 index 9987cabce8..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejOpenEngine.htm +++ /dev/null @@ -1,45 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>ejOpenEngine -- GoAhead Embedded JavaScript</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
- <table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<TR>
- <td class="titleLeft" align=left width="33%">ejOpenEngine</TD><td class="titleCenter" align=center width="33%"><b>GoAhead JavaScript API</b></TD><td class="titleRight" align=right><B>GoAhead EMF</B></TD></TR>
-</TABLE><HR>
-
-<h2>Synopsis</h2><p>Open a JavaScript interpreter session.</p><h2>Prototype</h2><pre>
-#include "ej.h"
-
-int <b>ejOpenEngine</b>(sym_fd_t variables, sym_fd_t functions);
-</pre>
-
-<h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
- <TR>
-
- <TD VALIGN="TOP" width="8%">variables</TD><TD width="92%"> Symbol table for variables.</TD></TR><TR>
-
- <TD VALIGN="TOP" width="8%">functions</TD><TD width="92%">Symbol table for functions.</TD></TR>
-</table><h2>Description</h2><P>To use JavaScript, you must first open an interpreter session with <i>ejOpenEngine</i>.
- JavaScript interpreters usually have their own variable and global function
- name space. To share a variable or function name space, pass a symbol table
- into <b>ejOpenEngine</b> in the <i>variable</i> or <i>function</i> parameters.
- If either of these parameters are set to NULL, the symbol table will be created
- automatically.</P><p>Use <b>ejCloseEngine</b> to close the interpreter when finished.
-
-<h2>Return Value</h2><p>Handle for the JavaScript interpreter.</p><h2>Example</h2><pre>
-if (ejOpenEngine(NULL, NULL)< 0) {
- /* Can't open interpreter */
- return -1;
-}
-</pre>
-<h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="../../../over/ejs.htm">JavaScript</A>, <A href="../../../over/asp.htm">Active
- Server Pages</A> <A href="ejCloseEngine.htm">ejCloseEngine</A> <A href="ejEval.htm">ejEval</A>
-</p></td></tr></table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejSetGlobalFunction.htm b/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejSetGlobalFunction.htm deleted file mode 100644 index c85b268911..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejSetGlobalFunction.htm +++ /dev/null @@ -1,54 +0,0 @@ -<html>
-<head>
-<title>ejSetGlobalFunction -- GoAhead Embedded JavaScript</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
- <TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<TR>
-
-<td class="titleLeft" align=left width="33%"><B>ejSetGlobalFunction</B></TD><td class="titleCenter" align=center width="33%"><b>GoAhead JavaScript API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead EMF</B></TD></TR>
-</TABLE><HR>
-
-
-<h2>Synopsis</h2><p>Define a JavaScript global function.</p><h2>Prototype</h2><pre>
-#include "ej.h"
-
-int <b>ejSetGlobalFunction</b>(int eid, char_t *name,
- int (*fn)(int eid, void *handle, int argc, char_t **argv));
-</pre>
-
-<h2>Parameters</h2><p><table width=90%>
-
- <TR>
- <TD width=40>eid
- <TD>JavaScript interpreter handle
- <TR>
- <TD width=40>name
- <TD> Name of the function to define
-
- <TR>
- <TD width=40>fn
- <TD>C function to
-invoke</TD></TR></table>
-<h2>Description</h2><P>The ejSetGlobalFunction procedure defines a JavaScript
-function. When the function named by <i>name</i> is called,
-the function defined by <i>fn</i> is called.</p><p> </p><P>When <i>fn</i> is called, the JavaScript parameters are
-passed in via <i>argc</i> and <i>argv</i> as a list of
-pointers to arguments. Use <A href="ejArgs.htm">ejArgs</A>
-to parse the arguments array.</p><h2>Return Value</h2><p>Returns 0 if successful. Returns -1 on errors.</p><h2>Example</h2><pre>char_t *emsg;
-
-int fn(int eid, void *handle, int argc, char_t **argv);
-
-ejSetGlobalFunction(int eid, "myfunc", myfunc);
-</pre>
-<h2>See Also</h2><p>
-<A href="../../../over/ejs.htm">JavaScript</A>,
-<A href="../../../over/asp.htm">Active Server Pages</A>,
-<A href="ejOpen.htm">ejOpen</A>,
-<A href="ejSetVar.htm">ejSetVar</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejSetResult.htm b/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejSetResult.htm deleted file mode 100644 index 9f70d6575f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejSetResult.htm +++ /dev/null @@ -1,49 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>ejSetResult -- GoAhead Embedded JavaScript</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<TR>
- <td class="titleLeft" align=left width="33%">ejSetResult</TD><td class="titleCenter" align=center width="33%"><b>GoAhead JavaScript API</b></TD><td class="titleRight" align=right><B>GoAhead EMF</B></TD></TR>
-</TABLE><HR>
-
-<h2>Synopsis</h2><p>Set the value of a JavaScript return variable.</p><h2>Prototype</h2><pre>
-#include "ej.h"
-
-void <b>ejSetResult</b>(int eid, char_t *s)
-</pre><h2>Parameters</h2><TABLE WIDTH=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
- <TR>
- <TD VALIGN="TOP" WIDTH="5%">eid</TD><TD WIDTH="95%">JavaScript interpreter handle.</TD></TR><TR>
- <TD VALIGN="TOP" WIDTH="5%">s</TD><TD WIDTH="95%">String representing the EJ function return.</TD></TR>
-</TABLE><h2>Description</h2><P>The ejSetResult procedure is used for C functions which have been mapped as
- an ej function returning some value. By making this call, the corresponding
- ej function will be passed to the result. All JavaScript variables are stored
- as strings. </P><h2>Return Value</h2><p>
- None
-</p><h2>EJ Example</h2><pre>
- Color = getColor();
-</pre><h2>C Example</h2><pre>
-init
- ...
- ejSetGlobalFunction(eid, T("getColor"), ejGetColor);
-
-
-
-int ejGetColor(int eid, void *handle, int argc, char_t **argv)
-{
-
- ...
- ejSetResult(eid, "blue");
- ...
- return 0;
-}
-</pre><h2>See Also</h2><p> <A href="../../../over/ejs.htm">JavaScript</A>, <A href="../../../over/asp.htm">Active
- Server Pages</A>, <A href="ejGetVar.htm">ejGetVar</A>, <A href="ejEval.htm">ejEval</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejSetVar.htm b/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejSetVar.htm deleted file mode 100644 index 5b4ec2dfcd..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/jsapi/ejSetVar.htm +++ /dev/null @@ -1,49 +0,0 @@ -<html>
-<head>
-<title>ejSetVar -- GoAhead Embedded JavaScript</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
- <TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle">
-<TR>
-
-<td class="titleLeft" align=left width="33%"><B>ejSetVar</B></TD><td class="titleCenter" align=center width="33%"><b>GoAhead JavaScript API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead EMF</B></TD></TR>
-</TABLE><HR>
-
-
-<h2>Synopsis</h2><p>Set the value of a JavaScript variable</p><h2>Prototype</h2><pre>
-#include "ej.h"
-
-void <b>ejSetVar</b>(int eid, char_t *variable, char_t *value);
-</pre>
-
-<h2>Parameters</h2><p><table width=90%>
-
- <TR>
- <TD width=40>eid
- <TD>JavaScript interpreter handle
- <TR>
- <TD width=40>variable
- <TD>Name of the JavaScript variable
-
- <TR>
- <TD width=40>value
- <TD> Value to
-set</TD></TR></table><h2>Description</h2><P>The ejSetVar procedure defines the current value of the JavaScript variable. All JavaScript variables are stored as
-strings. </P>.
-
-<h2>Return Value</h2><p>
- None</p><h2>Example</h2><pre>
-ejSetVar(eid, "name", "John
-Smith");
-</pre>
-<h2>See Also</h2><p>
-<A href="../../../over/ejs.htm">JavaScript</A>,
-<A href="../../../over/asp.htm">Active Server Pages</A>,
-<A href="ejGetVar.htm">ejGetVar</A>,
-<A href="ejEval.htm">ejEval</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi.htm deleted file mode 100644 index fc3874bfa5..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi.htm +++ /dev/null @@ -1,42 +0,0 @@ -<html>
-<head>
-<title>WebServer User Management APIs</title>
-<LINK REL="stylesheet" HREF="../../style/normal_ws.css" TYPE="text/css">
-</head>
-
-<body>
-<h1>The GoAhead WebServer User Management APIs</h1><TABLE WIDTH="50%" BORDER="0"><TR valign=top><TD WIDTH="47%"><A HREF="umapi/umAccessLimitExists.htm">umAccessLimitExists</A>
-<BR><A HREF="umapi/umAddAccessLimit.htm">umAddAccessLimit</A>
-<BR><A HREF="umapi/umAddGroup.htm">umAddGroup</A>
-<BR><A HREF="umapi/umAddUser.htm">umAddUser</A>
-<BR><A HREF="umapi/umClose.htm">umClose</A>
-<BR><A HREF="umapi/umCommit.htm">umCommit</A>
-<BR><A HREF="umapi/umDeleteAccessLimit.htm">umDeleteAccessLimit</A>
-<BR><A HREF="umapi/umDeleteGroup.htm">umDeleteGroup</A>
-<BR><A HREF="umapi/umDeleteUser.htm">umDeleteUser</A>
-<BR><A HREF="umapi/umGetAccessLimit.htm">umGetAccessLimit</A><BR><A HREF="umapi/umGetAccessLimitGroup.htm">umGetAccessLimitGroup</A>
-<BR><A HREF="umapi/umGetAccessLimitMethod.htm">umGetAccessLimitMethod</A>
-<BR><A HREF="umapi/umGetAccessLimitSecure.htm">umGetAccessLimitSecure</A>
-<BR><A HREF="umapi/umGetAccessMethodForURL.htm">umGetAccessMethodForURL</A>
-<BR><A HREF="umapi/umGetFirstAccessLimit.htm">umGetFirstAccessLimit</A><BR><A HREF="umapi/umGetFirstGroup.htm">umGetFirstGroup</A><BR><A HREF="umapi/umGetFirstUser.htm">umGetFirstUser</A><BR><A HREF="umapi/umGetGroupAccessMethod.htm">umGetGroupAccessMethod</A>
-<BR><A HREF="umapi/umGetGroupEnabled.htm">umGetGroupEnabled</A>
-<BR><A HREF="umapi/umGetGroupPrivilege.htm">umGetGroupPrivilege</A>
-<BR></TD><TD WIDTH="53%"><A HREF="umapi/umGetNextAccessLimit.htm">umGetNextAccessLimit</A><BR><A HREF="umapi/umGetNextGroup.htm">umGetNextGroup</A><BR><A HREF="umapi/umGetNextUser.htm">umGetNextUser<BR></A><A HREF="umapi/umGetUserEnabled.htm">umGetUserEnabled</A>
-<BR><A HREF="umapi/umGetUserGroup.htm">umGetUserGroup</A> <BR><A HREF="umapi/umGetUserPassword.htm">umGetUserPassword</A>
-<BR><A HREF="umapi/umGroupExists.htm">umGroupExists</A>
-<BR><A HREF="umapi/umOpen.htm">umOpen</A>
-<BR><A HREF="umapi/umRestore.htm">umRestore</A>
-<BR><A HREF="umapi/umSetAccessLimitGroup.htm">umSetAccessLimitGroup</A>
-<BR><A HREF="umapi/umSetAccessLimitMethod.htm">umSetAccessLimitMethod</A>
-<BR><A HREF="umapi/umSetAccessLimitSecure.htm">umSetAccessLimitSecure</A>
-<BR><A HREF="umapi/umSetGroupAccessMethod.htm">umSetGroupAccessMethod</A>
-<BR><A HREF="umapi/umSetGroupEnabled.htm">umSetGroupEnabled</A>
-<BR><A HREF="umapi/umSetGroupPrivilege.htm">umSetGroupPrivilege</A>
-<BR><A HREF="umapi/umSetUserEnabled.htm">umSetUserEnabled</A>
-<BR><A HREF="umapi/umSetUserGroup.htm">umSetUserGroup</A>
-<BR><A HREF="umapi/umSetUserPassword.htm">umSetUserPassword</A>
-<BR><A HREF="umapi/umUserExists.htm">umUserExists</A>
-<BR><A HREF="umapi/umUserCanAccessURL.htm">umUserCanAccessURL</A>
-</TD></TR></TABLE><H3>User Management API Return Codes</H3><TABLE WIDTH="68%" BORDER="0"><TR><TD WIDTH="42%">UM_OK (0): </TD><TD WIDTH="58%">No error condition. </TD></TR><TR><TD WIDTH="42%" HEIGHT="20">UM_ERR_GENERAL (-1):</TD><TD WIDTH="58%" HEIGHT="20">A general error occurred in the User Management function.</TD></TR><TR><TD WIDTH="42%">UM_ERR_NOT_FOUND (-2):</TD><TD WIDTH="58%">The specified data item was not found.</TD></TR><TR><TD WIDTH="42%">UM_ERR_PROTECTED (-3):</TD><TD WIDTH="58%">The data item could not be deleted because it was protected.</TD></TR><TR><TD WIDTH="42%">UM_ERR_DUPLICATE (-4):</TD><TD WIDTH="58%">The data item could not be added because one already exists with the same name.</TD></TR><TR><TD WIDTH="42%">UM_ERR_IN_USE (-5): </TD><TD WIDTH="58%">The data item could not be deleted because it is in active use.</TD></TR></TABLE><P><B>Notes:</B></P><P>UM_ERR_DUPLICATE pertains only to the various umAdd<object> functions.<BR>UM_ERR_PROTECTED and UM_ERR_IN_USE pertain only to the various umDelete<object> functions.</P>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAccessLimitExists.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAccessLimitExists.htm deleted file mode 100644 index cc487909a5..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAccessLimitExists.htm +++ /dev/null @@ -1,20 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umAccessLimitExists -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umAccessLimitExists</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Determine if an access limit exists for the given URL.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- bool_t umAccessLimitExists(char_t * url);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="34%" BORDER="0"><TR><TD>url</TD><TD>URL name</TD></TR></TABLE><H2><B>Description</B></H2><P>Access limits apply to URLs, upon which they are keyed. URLs can specify directories or filenames. If an access limit specifies a user group, then only members of that user group can have access to the URL.</P><H2><B>Return Value</B></H2><P> umAccessLimitExists returns TRUE if there is an access limit for the URL or returns FALSE if otherwise.</P><H2><B>Example</B></H2><PRE>bool_t bExists = umAccessLimitExists(T("home.html")); </PRE><H2><B>See Also</B></H2><P> <A HREF="umAddAccessLimit.htm">umAddAccessLimit</A>()</P><H2> </H2><BLOCKQUOTE><P> </P></BLOCKQUOTE></TD></TR></TABLE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAddAccessLimit.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAddAccessLimit.htm deleted file mode 100644 index cd83fb35ee..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAddAccessLimit.htm +++ /dev/null @@ -1,28 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umAddAccessLimit -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="530" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umAddAccessLimit</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis</B></H2><P> Add an access limit to the User Management database in the Access Limit table.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
-
- int umAddAccessLimit(char_t * url,
- accessMeth_t am,
- short secure,
- char_t * group);</PRE><H2><B>Parameters</B></H2><TABLE WIDTH=100% BORDER=0 CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="13%">url</TD><TD WIDTH="87%">URL name</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="13%">am</TD><TD WIDTH="87%"> access method</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="13%">secure</TD><TD WIDTH="87%">security flag (reserved for future use)</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="13%">group</TD><TD WIDTH="87%">user group to use</TD></TR>
-</TABLE><H2><B>Description</B></H2><P> Access method can be one of:<BR> AM_NONE - URL may not be accessed<BR> AM_FULL - no authorization is required for the URL<BR> AM_BASIC - URL requires at least basic authentication,<BR> AM_DIGEST - URL requires at least digest authentication,<BR> AM_INVALID - not a valid access method</P><P> Access limits apply to URLs, upon which they are keyed. URLs can specify directories or filenames. If an access limit specifies a user group, then only members of that user group can have access to the URL.</P><H2><B>Return Value</B></H2><P> umAddAccessLimit returns 0 if successful or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umAddAccessLimit(T("/cgi-bin"), AM_DIGEST, 0, T("users"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umDeleteAccessLimit.htm">umDeleteAccessLimit</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAddGroup.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAddGroup.htm deleted file mode 100644 index 17771140b8..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAddGroup.htm +++ /dev/null @@ -1,24 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umAddGroup -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umAddGroup</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Add a group to the User Management database in the group table.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
-
- int umAddGroup( char_t * group,
- short privilege,
- accessMeth_t am,
- bool_t protect,
- bool_t disabled);</PRE><H2><B>Parameters</B></H2><blockquote><TABLE WIDTH="89%" BORDER="0"><TR><TD HEIGHT="21" WIDTH="17%">group</TD><TD HEIGHT="21" WIDTH="83%">group name</TD></TR><TR><TD WIDTH="17%" HEIGHT="16">privilege</TD><TD WIDTH="83%" HEIGHT="16">bit mask for privilege as noted below</TD></TR><TR><TD WIDTH="17%">am</TD><TD WIDTH="83%">access method as noted below</TD></TR><TR><TD WIDTH="17%">protect</TD><TD WIDTH="83%">delete protection; value is TRUE if protected</TD></TR><TR><TD WIDTH="17%">disabled</TD><TD WIDTH="83%">TRUE if group is disabled; FALSE if group is enabled</TD></TR></TABLE></blockquote><H2><B>Description</B></H2><P> Privileges are determined by bit-masking the following constants:<BR>PRIV_NONE - user has no privileges<BR>PRIV_READ - user can read files<BR>PRIV_WRITE - user can execute CGIs<BR>PRIV_ADMIN - user can administrate </P><P> Access method can be one of:<BR> AM_NONE - Group has no access to anything<BR> AM_FULL - Group has access to all pages; no authorization required<BR> AM_BASIC - group requires at least basic authentication<BR> AM_DIGEST - group requires at least digest authentication<BR> AM_INVALID - not a valid access method</P><H2><B>Return Value</B></H2><P> umAddGroup returns 0 if successful or -1 on error.</P><H2><B>Example</B></H2><PRE>Int nCheck = umAddGroup(T("users"), 0x07, AM_DIGEST, TRUE, FALSE);</PRE><H2><B>See Also</B></H2><P> <A HREF="umDeleteGroup.htm">umDeleteGroup</A>()</P><H2> </H2><P> </P></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAddUser.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAddUser.htm deleted file mode 100644 index 13ee50319b..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umAddUser.htm +++ /dev/null @@ -1,28 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umAddUser -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umAddUser</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis</B></H2><P> Add a user to the user database.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
-
- int umAddUser (char_t * user,
- char_t * password,
- char_t * group,
- int prot,
- int enable)</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD HEIGHT="16" WIDTH="20%">user</TD><TD HEIGHT="16" WIDTH="76%">user ID</TD></TR><TR><TD WIDTH="20%">password </TD><TD WIDTH="76%">password</TD></TR><TR><TD WIDTH="20%">group</TD><TD WIDTH="76%">user group</TD></TR><TR><TD WIDTH="20%">prot </TD><TD WIDTH="76%">delete protection; TRUE if protected</TD></TR><TR><TD WIDTH="20%">disabled</TD><TD WIDTH="76%">TRUE if user is disabled; FALSE if user is enabled</TD></TR></TABLE><H2><B>Description</B></H2><P> User is added. The password, which is passed to this function in clear text, is XOR encrypted before persisting.</P><H2><B>Return Value</B></H2><P> 0 if successful or -1 on error.</P><H2><B>Example</B></H2><PRE>nCheck = AddUser(T("misterripley"),
- T("talented"),
- T("admin"),
- FALSE, TRUE);
- </PRE><H2><B>See Als</B>o</H2><P> <A HREF="umDeleteUser.htm">umDeleteUser</A>()</P><H2> </H2><P> </P></TD></TR><TR BORDERCOLOR="#FFFFFF"><TD> </TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umClose.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umClose.htm deleted file mode 100644 index 8c3a1f9afa..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umClose.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umClose -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umClose</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Frees memory used by User Management.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- void umClose();</PRE><H2><B>Parameters</B></H2><P> none</P><H2><B>Description</B></H2><P> umClose() should be called before shutdown to free memory.</P><H2><B>Return Value</B></H2><P> None</P><H2><B>Example</B></H2><PRE>umClose();</PRE><H2><B>See Also</B></H2><P><A HREF="umOpen.htm">umOpen</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umCommit.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umCommit.htm deleted file mode 100644 index 577deeaac7..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umCommit.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umCommit -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umCommit</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Persists the User Management database.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- int umCommit(char_t * filename);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="83%" BORDER="0"><TR><TD WIDTH="18%">filename</TD><TD WIDTH="82%">name of file containing the persist configuration data</TD></TR></TABLE><H2><B>Description</B></H2><P>int umCommit(char_t * filename);</P><H2><B>Return Value</B></H2><P> umCommit returns 0 if successful; -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umCommit(T("config.txt"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umRestore.htm">umRestore</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umDeleteAccessLimit.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umDeleteAccessLimit.htm deleted file mode 100644 index 557739b990..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umDeleteAccessLimit.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umDeleteAccessLimit -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umDeleteAccessLimit</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Delete an access limit.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- int umDeleteAccessLimit(char_t * url);</PRE><H2><B>Parameters</B></H2><P><TABLE WIDTH="42%" BORDER="0"><TR><TD WIDTH="20%">url</TD><TD WIDTH="80%">URL name</TD></TR></TABLE><H2><B>Description</B></H2><P>int umDeleteAccessLimit(char_t * url)</P><H2><B>Return Value</B></H2><P> umDeleteAccessLimit returns 0 if successful; -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umDeleteAccessLimit(T("index.html"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umAddAccessLimit.htm">umAddAccessLimit</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umDeleteGroup.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umDeleteGroup.htm deleted file mode 100644 index 7c8d0e31eb..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umDeleteGroup.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umDeleteGroup -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umDeleteGroup</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Delete a user group.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- int umDeleteGroup(char_t * group);</PRE><H2><B>Parameters</B></H2><P><TABLE WIDTH="42%" BORDER="0"><TR><TD WIDTH="20%">group</TD><TD WIDTH="80%">group name</TD></TR></TABLE><H2><B>Description</B></H2><P>int umDeleteGroup(char_t * group);</P><H2><B>Return Value</B></H2><P> umDeleteGroup returns 0 if successful or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umDeleteGroup(T("users"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umAddGroup.htm">umAddGroup</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umDeleteUser.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umDeleteUser.htm deleted file mode 100644 index 941ff3e9ea..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umDeleteUser.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umDeleteUser -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umDeleteUser</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Remove a user from the user database.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- int DeleteUser(char_t * user)</PRE><H2><B>Parameters </B></H2><P><TABLE WIDTH="42%" BORDER="0"><TR><TD WIDTH="20%">user</TD><TD WIDTH="80%">user ID</TD></TR></TABLE><H2><B>Description</B></H2><P> umDeleteUser deletes a user record from the USER table.</P><H2><B>Return Value</B></H2><P> 0 if successful or -1 on error.</P><H2><B>Example</B></H2><PRE>nCheck = DeleteUser("misterripley"); </PRE><H2><B>See Also</B></H2><P> <A HREF="umAddUser.htm">umAddUser</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimit.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimit.htm deleted file mode 100644 index ffb15e21f8..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimit.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetAccessLimit -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetAccessLimit</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2>Synopsis</H2><P> Returns the URL or ancestral URL for an access limit table.</P><H2>Prototype</H2><PRE>
- #include "um.h"
-
- char_t *umGetAccessLimit(char_t * url);</PRE><H2>Parameters</H2><P><TABLE WIDTH="66%" BORDER="0"><TR><TD WIDTH="14%">url</TD><TD WIDTH="86%">URL to check against the access limit table</TD></TR></TABLE><H2>Description</H2><P> The returned pointer points to a copy of a URL string that has an associated access limit. This string must eventually be deleted by a call to the <A HREF="../basicapi/bfree.htm">bfree</A>() function. </P><H2>Return Value</H2><P> umGetAccessLimit returns a pointer to a new URL string, or a NULL on error.</P><H2>Example</H2><PRE>char_t *url = umGetAccessLimit(T("/cgi-bin/status.exe"));</PRE><H2>See Also</H2><P> <A HREF="umGetFirstAccessLimit.htm">umGetFirstAccessLimit</A>(), <A HREF="../basicapi/bfree.htm">bfree</A>()</P><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimitGroup.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimitGroup.htm deleted file mode 100644 index c87c66a5e6..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimitGroup.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetAccessLimitGroup -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetAccessLimitGroup</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Get the user group for the URL.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- char_t *umGetAccessLimitGroup(char_t * url);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="30%" BORDER="0"><TR><TD WIDTH="20%">url</TD><TD WIDTH="80%"> URL name</TD></TR></TABLE><H2><B>Description</B></H2><P>char_t *umGetAccessLimitGroup(char_t * url);</P><H2><B>Return Value</B></H2><P> umGetAccessLimitGroup returns a pointer to the URL's user group if one exists, or NULL if otherwise.</P><H2><B>Example</B></H2><PRE>char_t *groupname = umGetAccessLimitGroup(T("home.htm"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umSetAccessLimitGroup.htm">umSetAccessLimitGroup</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimitMethod.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimitMethod.htm deleted file mode 100644 index d1c899ac2b..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimitMethod.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetAccessLimitMethod -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetAccessLimitMethod</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Retrieve the access method for the Access Limit.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- accessMeth_t umGetAccessLimitMethod(char_t * url);</PRE><H2><B>Parameters</B></H2><P> url - URL name</P><H2><B>Description</B></H2><P>accessMeth_t umGetAccessLimitMethod(char_t * url);</P><H2><B>Return Value</B></H2><P> umGetAccessLimitMethod returns the access method for the URL, or AM_INVALID on error.</P><H2><B>Example</B></H2><PRE>accessMeth_t am = umGetAccessLimitMethod(T("pic.jpg"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umAddAccessLimit.htm">umAddAccessLimit</A>(), <A HREF="umSetAccessLimitMethod.htm">umSetAccessLimitMethod</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimitSecure.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimitSecure.htm deleted file mode 100644 index 28c3469a4f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessLimitSecure.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetAccessLimitSecure -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetAccessLimitSecure</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Retrieve the security setting for the URL.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- short umGetAccessLimitSecure(char_t * url);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="40%" BORDER="0"><TR><TD>url</TD><TD>URL name</TD></TR></TABLE><H2><B>Description</B></H2><P>short umGetAccessLimitSecure(char_t * url)</P><H2><B>Return Value</B></H2><P> umGetAccessLimitSecure returns the security level if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>short secure = umGetAccessLimitSecure(T("trojanhorse.cgi"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umSetAccessLimitSecure.htm">umSetAccessLimitSecure</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessMethodForURL.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessMethodForURL.htm deleted file mode 100644 index 29325c7c12..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetAccessMethodForURL.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetAccessMethodForURL -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetAccessMethodForURL</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Determines the method for accessing a URL.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- accessMeth_t umGetAccessMethodForURL(char_t * url);</PRE><H2><B>Parameters</B></H2><P><TABLE WIDTH="40%" BORDER="0"><TR><TD>url</TD><TD>URL name</TD></TR></TABLE><H2><B>Description</B></H2><P> Checks the access limit table for the URL </P><H2><B>Return Value</B></H2><P> umGetAccessMethodForURL returns the access method for the URL, or AM_FULL if one is not found.</P><H2><B>Example</B></H2><PRE>accessMeth_t umGetAccessMethodForURL(char_t * url);</PRE><H2><B>See Also</B></H2><P> <A HREF="umAddAccessLimit.htm">umAddAccessLimit</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetFirstAccessLimit.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetFirstAccessLimit.htm deleted file mode 100644 index 6337e71621..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetFirstAccessLimit.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetFirstAccessLimit -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetFirstAccessLimit</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2>Synopsis</H2><P> Returns the URL for the first access limit found in the access limit table.</P><H2>Prototype</H2><PRE>
- #include "um.h"
-
- char_t *umGetFirstAccessLimit();</PRE><H2>Parameters</H2><P> None</P><H2>Description</H2><P> The returned string is a pointer to the data stored in the access limit table. Use this function with <A HREF="umGetNextAccessLimit.htm">umGetNextAccessLimit</A> to retrieve a list of URLs contained in the access limit table.</P><H2>Return Value</H2><P> umGetFirstAccessLimit returns a pointer to the URL or NULL on error.</P><H2>Example</H2><PRE>char_t *url = umGetFirstAccessLimit();</PRE><H2>See Also</H2><P> <A HREF="umGetNextAccessLimit.htm">umGetNextAccessLimit</A>()</P><P></P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetFirstGroup.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetFirstGroup.htm deleted file mode 100644 index 6d1bb417ba..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetFirstGroup.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetFirstGroup -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetFirstGroup</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2>Synopsis</H2><P> Returns the first group name found in the group table.</P><H2>Prototype</H2><PRE>
- #include "um.h"
-
- char_t *umGetFirstGroup();</PRE><H2>Parameters</H2><P> None</P><H2>Description</H2><P> The returned string is a pointer to the data stored in the group table. Use this function with <A HREF="umGetNextGroup.htm">umGetNextGroup</A> to retrieve a list of group names contained in the group table.</P><H2>Return Value</H2><P> umGetFirstGroup returns a pointer to the group name or NULL on error.</P><H2>Example</H2><PRE>char_t *group = umGetFirstGroup();</PRE><H2>See Also</H2><P> <A HREF="umGetNextGroup.htm">umGetNextGroup</A>()</P><P></P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetFirstUser.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetFirstUser.htm deleted file mode 100644 index 57a2fef904..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetFirstUser.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetFirstUser -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetFirstUser</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2>Synopsis</H2><P> Returns the first user ID found in the user table.</P><H2>Prototype</H2><PRE>
- #include "um.h"
-
- char_t *umGetFirstUser();</PRE><H2>Parameters</H2><P> None</P><H2>Description</H2><P> The returned string is a pointer to the data stored in the user table. Use this function with <A HREF="umGetNextUser.htm">umGetNextUser</A> to retrieve a list of user IDs contained in the user table.</P><H2>Return Value</H2><P> umGetFirstUser returns a pointer to the user ID, or a NULL on error.</P><H2>Example</H2><PRE>char_t *userid = umGetFirstUser();</PRE><H2>See Also</H2><P> <A HREF="umGetNextUser.htm">umGetNextUser</A>()</P><P></P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetGroupAccessMethod.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetGroupAccessMethod.htm deleted file mode 100644 index 886bf0aacf..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetGroupAccessMethod.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetGroupAccessMethod -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetGroupAccessMethod</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Retrieve the default access method for the group.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- accessMeth_t umGetGroupAccessMethod(char_t * group);</PRE><H2><B>Parameters</B></H2><P><TABLE WIDTH="40%" BORDER="0"><TR><TD>group</TD><TD>group name</TD></TR></TABLE><H2><B>Description</B></H2><P>accessMeth_t umGetGroupAccessMethod(char_t * group);</P><H2><B>Return Value</B></H2><P> umGetGroupAccessMethod returns the access method for the group, or AM_INVALID if there is an error.</P><H2><B>Example</B></H2><PRE>accessMeth_t am = umGetGroupAccessMethod(T("users"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umAddGroup.htm">umAddGroup</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetGroupEnabled.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetGroupEnabled.htm deleted file mode 100644 index 869253e5b6..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetGroupEnabled.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetGroupEnabled -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetGroupEnabled</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Get the enabled state of the user group.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- bool_t umGetGroupEnabled(char_t * group);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="30%" BORDER="0"><TR><TD WIDTH="12%">group</TD><TD WIDTH="82%">group name</TD></TR></TABLE><H2><B>Description</B></H2><P>bool_t umGetGroupEnabled(char_t * group);</P><H2><B>Return Value</B></H2><P> umGetGroupEnabled returns TRUE if the group is enabled, or FALSE otherwise.</P><H2><B>Example</B></H2><PRE>bool_t bEnabled = umGetGroupEnabled(T("users"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umSetGroupEnabled.htm">umSetGroupEnabled</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetGroupPrivilege.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetGroupPrivilege.htm deleted file mode 100644 index 7d36afddbe..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetGroupPrivilege.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetGroupPrivilege -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetGroupPrivilege</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Get the privilege mask for the user group.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- short umGetGroupPrivilege(char_t * group);</PRE><H2><B>Parameters</B></H2><P><TABLE WIDTH="40%" BORDER="0"><TR><TD>group</TD><TD>group name</TD></TR></TABLE><H2><B>Description</B></H2><P> Privileges are determined by bit-masking the following constants:<BR>PRIV_NONE - user has no privileges<BR>PRIV_READ - user can read files<BR>PRIV_WRITE - user can execute CGIs<BR>PRIV_ADMIN - user can administrate </P><H2><B>Return Value</B></H2><P> umGetGroupPrivilege returns the privilege mask for the group, or -1 on error.</P><H2><B>Example</B></H2><PRE>short privMask = umGetGroupPrivilege(T("users"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umSetGroupPrivilege.htm">umSetGroupPrivilege</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetNextAccessLimit.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetNextAccessLimit.htm deleted file mode 100644 index 2cf7c5248d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetNextAccessLimit.htm +++ /dev/null @@ -1,22 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetNextAccessLimit -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetNextAccessLimit</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2>Synopsis</H2><P> Returns the next URL found in the access limit table after the given URL.</P><H2>Prototype</H2><PRE>
- #include "um.h"
-
- char_t *umGetNextAccessLimit(char_t * lastAccessLimit);</PRE><H2>Parameters</H2><p><TABLE WIDTH="84%" BORDER="0"><TR><TD WIDTH="23%">lastAccessLimit</TD><TD WIDTH="77%">URL returned from the previous call to this function</TD></TR></TABLE><H2>Description</H2><P> The returned string is a pointer to the data stored in the access limit table.</P><H2>Return Value</H2><P> umGetNextAccessLimit returns a pointer to the URL, or a NULL on error.</P><H2>Example</H2><PRE>char_t *url = umGetFirstAccessLimit();
-while (url) {
- url = umGetNextAccessLimit(url);
-}</PRE><H2>See Also</H2><P> <A HREF="umGetFirstAccessLimit.htm">umGetFirstAccessLimit</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetNextGroup.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetNextGroup.htm deleted file mode 100644 index a79710bd54..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetNextGroup.htm +++ /dev/null @@ -1,22 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetNextGroup -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetNextGroup</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2>Synopsis</H2><P> Returns the next group name found in the group table after the given group name.</P><H2>Prototype</H2><PRE>
- #include "um.h"
-
- char_t *umGetNextGroup(char_t * lastGroup);</PRE><H2>Parameters</H2><p><TABLE WIDTH="76%" BORDER="0"><TR><TD WIDTH="15%">lastGroup</TD><TD WIDTH="85%">group name returned from the previous call to this function</TD></TR></TABLE><H2>Description</H2><P> The returned string is a pointer to the data stored in the group table.</P><H2>Return Value</H2><P> umGetNextGroup returns a pointer to the group name, or a NULL on error.</P><H2>Example</H2><PRE>char_t *group = umGetFirstName();
-while (group) {
- group = umGetNextGroup(group);
-}</PRE><H2>See Also</H2><P> <A HREF="umGetFirstGroup.htm">umGetFirstGroup</A>()</P><P></P><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetNextUser.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetNextUser.htm deleted file mode 100644 index 538be39d05..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetNextUser.htm +++ /dev/null @@ -1,22 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetNextUser -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetNextUser</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2>Synopsis</H2><P> Returns the next user ID listed in the user table after the given user ID.</P><H2>Prototype</H2><PRE>
- #include "um.h"
-
- char_t *umGetNextUser(char_t * lastUser);</PRE><H2>Parameters</H2><P><TABLE WIDTH="76%" BORDER="0"><TR><TD WIDTH="15%">lastUser</TD><TD WIDTH="85%">user ID returned from the previous call to this function</TD></TR></TABLE><H2>Description</H2><P> The returned string is a pointer to the data stored in the user table.</P><H2>Return Value</H2><P> umGetNextUser returns a pointer to the user ID, or a NULL on error.</P><H2>Example</H2><PRE>char_t *userid = umGetFirstUser();
-while (userid) {
- userid = umGetNextUser(userid);
-}</PRE><H2>See Also</H2><P> <A HREF="umGetFirstUser.htm">umGetFirstUser</A>()</P><P></P><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetUserEnabled.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetUserEnabled.htm deleted file mode 100644 index 7d6a83c5ba..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetUserEnabled.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetUserEnabled -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetUserEnabled</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Get the enabled state of a given user.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- bool_t umGetUserEnabled(char_t * user);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="26%" BORDER="0"><TR><TD WIDTH="44%">user</TD><TD WIDTH="56%">User ID</TD></TR></TABLE><H2><B>Description</B></H2><P>bool_t umGetUserEnabled(char_t * user)</P><H2><B>Return Value</B></H2><P> umGetUserEnabled returns TRUE if user is enabled, or FALSE if otherwise.</P><H2><B>Example</B></H2><PRE>bool_t bEnabled = umGetUserEnabled(T("gumby"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umSetUserEnabled.htm">umSetUserEnabled</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetUserGroup.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetUserGroup.htm deleted file mode 100644 index c7b230062d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetUserGroup.htm +++ /dev/null @@ -1,20 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetUserGroup -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetUserGroup</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Return the group name of the user.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- char_t *umGetUserGroup(char_t * user);</PRE><H2><B>Parameters</B></H2><p>
-<TABLE WIDTH="40%" BORDER="0"><TR><TD WIDTH="34%">user</TD><TD WIDTH="66%">User ID</TD></TR></TABLE><H2><B>Description</B></H2><P>char_t *umGetUserGroup(char_t * user)</P><H2><B>Return Value</B></H2><P> umGetUserGroup returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>char_t * groupname = umGetUserGroup(T("hortense"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umSetUserGroup.htm">umSetUserGroup</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetUserPassword.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetUserPassword.htm deleted file mode 100644 index 2080bafe49..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGetUserPassword.htm +++ /dev/null @@ -1,19 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGetUserPassword -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGetUserPassword</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Obtain a pointer to the user password.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- char_t* umGetUserPassword(char_t * user)</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="36%" BORDER="0"><TR><TD WIDTH="27%">user</TD><TD WIDTH="73%"> user ID</TD></TR></TABLE><H2><B>Description</B></H2><P> Persisted password is decrypted before being returned by the function. Returned password must be deleted by the bfree function.</P><H2><B>Return Value</B></H2><P> umGetUserPassword returns NULL if there is an error, or a pointer to a new copy of the password on success.</P><H2><B>Example</B></H2><PRE>char_t * pwd = umGetUserPassword("misterripley");</PRE><H2><B>See Also</B></H2><P> <A HREF="umSetUserPassword.htm">umSetUserPassword</A>, <A HREF="umAddUser.htm">umAddUser</A>, <A HREF="../wsapi/bfree.htm">bfree</A></P><H2> </H2><P> </P></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGroupExists.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGroupExists.htm deleted file mode 100644 index 4e1cce12f6..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umGroupExists.htm +++ /dev/null @@ -1,20 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umGroupExists -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umGroupExists</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Determine the existence of a user group.</P><H2><B>Prototype</B></H2><PRE>
- #include "um.h"
-
- bool_t umGroupExists(char_t * group);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="38%" BORDER="0"><TR><TD WIDTH="33%">group</TD><TD WIDTH="67%">group name
-</TD></TR></TABLE><H2><B>Description</B></H2><P>bool_t umGroupExists(char_t * group)</P><H2><B>Return Value</B></H2><P> umGroupExists returns TRUE if the group is found, or FALSE if otherwise.</P><H2><B>Example</B></H2><PRE>bool_t bFound = umGroupExists(T("users"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umAddGroup.htm">umAddGroup</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umOpen.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umOpen.htm deleted file mode 100644 index 4ed91b5a16..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umOpen.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umOpen -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umOpen</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis</B></H2><P> Initializes User Management module.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umOpen();</PRE><H2><B>Parameters</B></H2><P> none</P><H2><B>Description</B></H2><P>umOpen() must be called before accessing User Management functions. </P><H2><B>Return Value</B></H2><P> umOpen returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umOpen();</PRE><H2><B>See Also</B></H2><P> <A HREF="umClose.htm">umClose</A>(), <A HREF="umRestore.htm">umRestore</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umRestore.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umRestore.htm deleted file mode 100644 index 06f1f72588..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umRestore.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umRestore -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umRestore</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Load the user management database.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umRestore(char_t * filename);</PRE><H2><B>Parameters</B></H2><TABLE WIDTH="75%" BORDER="0"><TR><TD WIDTH="20%">filename</TD><TD WIDTH="80%"> filename persisted to</TD></TR></TABLE><H2><B>Description</B></H2><P>int umRestore(char_t * filename);</P><H2><B>Return Value</B></H2><P> umRestore returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umRestore(T("config.txt"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umCommit.htm">umCommit</A>(), <A HREF="umOpen.htm">umOpen</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSEtUserEnabled.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSEtUserEnabled.htm deleted file mode 100644 index dd9875d811..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSEtUserEnabled.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umSetUserEnabled -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umSetUserEnabled</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B> </H2><P>Set the enabled state of a given user.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umSetUserEnabled(char_t * user, bool_t enabled);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="54%" BORDER="0"><TR><TD WIDTH="27%" HEIGHT="20">user</TD><TD WIDTH="73%" HEIGHT="20">user ID</TD></TR><TR><TD WIDTH="27%">enabled</TD><TD WIDTH="73%">enabled state</TD></TR></TABLE><H2><B>Description</B></H2><P>int umSetUserEnabled(char_t * user, bool_t enabled);</P><H2><B>Return Value</B></H2><P> This function returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umSetUserEnabled(T("Mortimer"), TRUE);</PRE><H2><B>See Also</B></H2><P> <A HREF="umGetUserEnabled.htm">umGetUserEnabled</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetAccessLimitGroup.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetAccessLimitGroup.htm deleted file mode 100644 index 7f6bee1417..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetAccessLimitGroup.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umSetAccessLimitGroup -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umSetAccessLimitGroup</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Set the user group for the Access Limit.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umSetAccessLimitGroup(char_t * url, char_t * group);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="49%" BORDER="0"><TR><TD WIDTH="16%">url</TD><TD WIDTH="78%">URL name</TD></TR><TR><TD WIDTH="16%">group</TD><TD WIDTH="78%">group name</TD></TR></TABLE><H2><B>Description</B></H2><P>int umSetAccessLimitGroup(char_t * url, char_t * group);</P><H2><B>Return Value</B></H2><P> umSetAccessLimitGroup returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umSetAccessLimitGroup(T("index.html"), T("users"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umGetAccessLimitGroup.htm">umGetAccessLimitGroup</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetAccessLimitMethod.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetAccessLimitMethod.htm deleted file mode 100644 index 0517b6a845..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetAccessLimitMethod.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umSetAccessLimitMethod -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umSetAccessLimitMethod</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Set the access method for the URL.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umSetAccessLimitMethod(char_t * url, accessMeth_t am);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD>url</TD><TD>URL name</TD></TR><TR><TD>am</TD><TD>access method as described below</TD></TR></TABLE><H2><B>Description</B></H2><P> Access method can be one of:<BR> AM_NONE - URL may not be accessed<BR> AM_FULL - no authorization is required for the URL<BR> AM_BASIC - URL requires at least basic authentication,<BR> AM_DIGEST - URL requires at least digest authentication,<BR> AM_INVALID - not a valid access method</P><H2><B>Return Value</B></H2><P> umSetAccessLimitMethod returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umSetAccessLimitMethod(T("picture.gif"), AM_NONE);</PRE><H2><B>See Also</B></H2><P> <A HREF="umGetAccessLimitMethod.htm">umGetAccessLimitMethod</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetAccessLimitSecure.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetAccessLimitSecure.htm deleted file mode 100644 index d56a106585..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetAccessLimitSecure.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umSetAccessLimitSecure -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umSetAccessLimitSecure</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Set the security setting for the URL.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umSetAccessLimitSecure(char_t * url, short secure);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD>url </TD><TD>URL name</TD></TR><TR><TD>secure</TD><TD>security setting (reserved for future use)</TD></TR></TABLE><H2><B>Description</B></H2><P>int umSetAccessLimitSecure(char_t * url, short secure);</P><P>"1" = secure<BR>"0" = not secure</P><H2><B>Return Value</B></H2><P> umSetAccessLimitSecure returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umSetAccessLimitSecure(T("admin.exe"), 1);</PRE><H2><B>See Also</B></H2><P><A HREF="umGetAccessLimitSecure.htm">umGetAccessLimitSecure</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetGroupAccessMethod.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetGroupAccessMethod.htm deleted file mode 100644 index c4596241c9..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetGroupAccessMethod.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umSetGroupAccessMethod -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umSetGroupAccessMethod</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Set the default access method for the group.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umSetGroupAccessMethod(char_t * group, accessMeth_t am);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD WIDTH="19%">group</TD><TD WIDTH="81%">group name</TD></TR><TR><TD WIDTH="19%">am</TD><TD WIDTH="81%">access method</TD></TR></TABLE><H2><B>Description</B></H2><P> Access method can be one of:<BR> AM_NONE - Group has no access to anything at all<BR> AM_FULL - Group has access all pages, no authorization required<BR> AM_BASIC - group requires at least basic authentication,<BR> AM_DIGEST - group requires at least digest authentication,<BR> AM_INVALID - not a valid access method</P><H2><B>Return Value</B></H2><P> This function returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umSetGroupAccessMethod(T("users"), AM_DIGEST);</PRE><H2><B>See Also</B></H2><P> <A HREF="umGetAccessMethodForURL.htm">umGetAccessMethodForURL</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetGroupEnabled.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetGroupEnabled.htm deleted file mode 100644 index 5db22930e6..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetGroupEnabled.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umSetGroupEnabled -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<H4></H4><P><B></B></P><TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umSetGroupEnabled</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Set the enabled state of the user group.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umSetGroupEnabled(char_t * group, bool_t enabled);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="56%" BORDER="0"><TR><TD WIDTH="23%">group</TD><TD WIDTH="77%">group name</TD></TR><TR><TD WIDTH="23%">enabled</TD><TD WIDTH="77%">enabled flag</TD></TR></TABLE><H2><B>Description</B></H2><P>int umSetGroupEnabled(char_t * group, bool_t enabled);</P><H2><B>Return Value</B></H2><P> umSetGroupEnabled returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umSetGroupEnabled(T("users"), TRUE);</PRE><H2><B>See Also</B></H2><P> <A HREF="umGetGroupEnabled.htm">umGetGroupEnabled</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetGroupPrivilege.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetGroupPrivilege.htm deleted file mode 100644 index 51d9282841..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetGroupPrivilege.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umSetGroupPrivilege -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umSetGroupPrivilege</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis</B></H2><P> Get the privilege mask for the user group.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umSetGroupPrivilege(char_t * group, short privileges);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD WIDTH="20%">group</TD><TD WIDTH="80%">group name</TD></TR><TR><TD WIDTH="20%">privileges</TD><TD WIDTH="80%">privilege mask for the user group</TD></TR></TABLE><H2><B>Description</B></H2><P>int umSetGroupPrivilege(char_t * group, short privileges);</P><H2><B>Return Value</B></H2><P> umSetGroupPrivilege returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umSetGroupPrivilege(T("users"), PRIV_READ | PRIV_WRITE );</PRE><H3><B>See Also</B></H3><P> <A HREF="umGetGroupPrivilege.htm">umGetGroupPrivilege</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetUserGroup.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetUserGroup.htm deleted file mode 100644 index 5e767ea73e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetUserGroup.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umSetUserGroup -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umSetUserGroup</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Set the group name for the user.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umSetUserGroup(char_t * user, char_t * groupname);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD WIDTH="24%">user</TD><TD WIDTH="76%">user ID</TD></TR><TR><TD WIDTH="24%">groupname</TD><TD WIDTH="76%">name of the user group</TD></TR></TABLE><H2><B>Description</B></H2><P>int umSetUserGroup(char_t * user, char_t * groupname);</P><H2><B>Return Value</B></H2><P> This function returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umSetUserGroup(T("spanky"), T("administrators"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umGetUserGroup.htm">umGetUserGroup</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetUserPassword.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetUserPassword.htm deleted file mode 100644 index fe414fec2f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umSetUserPassword.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umSetUserPassword -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umSetUserPassword</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Set the user password.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- int umSetUserPassword(char_t * user, char_t * password);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="60%" BORDER="0"><TR><TD WIDTH="23%">user</TD><TD WIDTH="77%">user ID</TD></TR><TR><TD WIDTH="23%">password</TD><TD WIDTH="77%">unencrypted user password</TD></TR></TABLE><H2><B>Description</B></H2><P> Password is stored in database in an encrypted form.</P><H2><B>Return Value</B></H2><P> umSetUserPassword returns 0 if successful, or -1 on error.</P><H2><B>Example</B></H2><PRE>int nCheck = umSetUserPassword(T("gilbert"), T("grape"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umGetUserPassword.htm">umGetUserPassword</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umUserCanAccessURL.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umUserCanAccessURL.htm deleted file mode 100644 index 4e4490762f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umUserCanAccessURL.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umUserCanAccessURL -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE BORDER=0 WIDTH=100% CELLSPACING=0 CELLPADDING=0 CLASS="apiTitle"> <TR>
-<TD CLASS="titleLeft" ALIGN=left WIDTH="33%">umUserCanAccessURL</TD><TD CLASS="titleCenter" ALIGN=center WIDTH="33%"><B>GoAhead
-WebServer API</B></TD><TD CLASS="titleRight" ALIGN=right WIDTH="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Determine if the user is allowed to access URL.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- bool_t umUserCanAccessURL(char_t * user, char_t * url);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="75%" BORDER="0"><TR><TD WIDTH="20%">user</TD><TD WIDTH="80%">user ID</TD></TR><TR><TD WIDTH="20%">url</TD><TD WIDTH="80%">URL name</TD></TR></TABLE><H2><B>Description</B></H2><P>bool_t umUserCanAccessURL(char_t * user, char_t * url);</P><H2><B>Return Value</B></H2><P> umUserCanAccessURL returns TRUE if successful, allowing the user to access the URL, or FALSE if otherwise.</P><H2><B>Example</B></H2><PRE>bool_t bOK = umUserCanAccessURL(T("squiggy"), T("adminform.exe"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umAddAccessLimit.htm">umAddAccessLimit</A>(), <A HREF="umAddUser.htm">umAddUser</A>()</P><H2> </H2><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umUserExists.htm b/xbmc/lib/libGoAhead/web/docs/techref/umapi/umUserExists.htm deleted file mode 100644 index ee797f8671..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/umapi/umUserExists.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>umUserExists -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">umUserExists</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR><H2><B>Synopsis</B></H2><P> Determine existence of given user.</P><H2><B>Prototype</B></H2><PRE> #include "um.h"
-
- bool_t umUserExists(char_t * user);</PRE><H2><B>Parameters</B></H2><p><TABLE WIDTH="49%" BORDER="0"><TR><TD WIDTH="22%">user</TD><TD WIDTH="78%">user ID</TD></TR></TABLE><H2><B>Description</B></H2><P> bool_t umUserExists(char_t * user);</P><H2><B>Return Value</B></H2><P> umUserExists returns TRUE if a user is found, or FALSE if not.</P><H2><B>Example</B></H2><PRE>bool_t bExists = umUserExists(T("misterripley"));</PRE><H2><B>See Also</B></H2><P> <A HREF="umAddUser.htm">umAddUser</A>()</P><H2> </H2><BLOCKQUOTE> </BLOCKQUOTE></TD></TR></TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi.htm deleted file mode 100644 index 01c9a979c9..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi.htm +++ /dev/null @@ -1,68 +0,0 @@ -<html>
-<head>
-<title>WebServer APIs</title>
-<LINK REL="stylesheet" HREF="../../style/normal_ws.css" TYPE="text/css">
-</head>
-
-<body>
-<h1>The GoAhead WebServer APIs</h1><TABLE WIDTH="67%" BORDER="0"><TR valign=top><TD WIDTH="19%"><A HREF=wsapi/bfree.htm>bfree</A><BR>
- <A HREF=wsapi/balloc.htm>balloc</A><BR>
- <A HREF=basicapi/bopen.htm>bopen</A><BR>
-<A HREF=wsapi/websAspDefine.htm>websAspDefine</A><BR>
-<A HREF=wsapi/websClose.htm>websClose</A><BR>
-<A HREF=wsapi/websCloseListen.htm>websCloseListen</A><BR>
-<A HREF=wsapi/websDecode64.htm>websDecode64</A><BR>
-<A HREF=wsapi/websDone.htm>websDone</A><BR>
-<A HREF=wsapi/websEncode64.htm>websEncode64</A><BR>
-<A HREF=wsapi/websError.htm>websError</A><BR>
-<A HREF=wsapi/websExpand.htm>websExpand</A><BR>
-<A HREF=wsapi/websFooter.htm>websFooter</A><BR>
-<A HREF=wsapi/websFormDefine.htm>websFormDefine</A><BR>
-<A HREF=wsapi/websGetDefaultDir.htm>websGetDefaultDir</A><BR>
-<A HREF=wsapi/websGetDefaultPage.htm>websGetDefaultPage</A><BR></TD><TD WIDTH="26%"><A HREF=wsapi/websGetHost.htm>websGetHost</A><BR>
-<A HREF=wsapi/websGetHostUrl.htm>websGetHostUrl</A><BR>
-<A HREF=wsapi/websGetPassword.htm>websGetPassword</A><BR>
-<A HREF=wsapi/websGetPort.htm>websGetPort</A><BR>
-<A HREF=wsapi/websGetRequestBytes.htm>websGetRequestBytes</A><BR>
-<A HREF=wsapi/websGetRequestDir.htm>websGetRequestDir</A><BR>
-<A HREF=wsapi/websGetRequestDocFd.htm>websGetRequestDocFd</A><BR>
-<A HREF=wsapi/websGetRequestFlags.htm>websGetRequestFlags</A><BR>
-<A HREF=wsapi/websGetRequestIpaddr.htm>websGetRequestIpaddr</A><BR>
-<A HREF=wsapi/websGetRequestLpath.htm>websGetRequestLpath</A><BR>
-<A HREF=wsapi/websGetRequestPassword.htm>websGetRequestPassword</A><BR>
-<A HREF=wsapi/websGetRequestPath.htm>websGetRequestPath</A><BR>
-<A HREF=wsapi/websGetRequestType.htm>websGetRequestType</A><BR>
-<A HREF=wsapi/websGetRequestUserName.htm>websGetRequestUserName</A><BR></TD><TD WIDTH="22%"><A HREF=wsapi/websGetRequestWritten.htm>websGetRequestWritten</A><BR>
-<A HREF=wsapi/websGetVar.htm>websGetVar</A><BR>
-<A HREF=wsapi/websHeader.htm>websHeader</A><BR>
-<A HREF=wsapi/websOpen.htm>websOpen</A><BR>
-<A HREF=wsapi/websOpenListen.htm>websOpenListen</A><BR>
-<A HREF=wsapi/websRedirect.htm>websRedirect</A><BR>
-<A HREF=wsapi/websSecurityHandler.htm>websSecurityHandler</A><BR>
-<A HREF=wsapi/websSetDefaultDir.htm>websSetDefaultDir</A><BR>
-<A HREF=wsapi/websSetDefaultPage.htm>websSetDefaultPage</A><BR>
-<A HREF=wsapi/websSetEnv.htm>websSetEnv</A><BR>
-<A HREF=wsapi/websSetHost.htm>websSetHost</A><BR>
-<A HREF=wsapi/websSetIpaddr.htm>websSetIpaddr</A><BR>
-<A HREF=wsapi/websSetPassword.htm>websSetPassword</A><BR>
-<A HREF=wsapi/websSetRequestBytes.htm>websSetRequestBytes</A><BR>
-<A HREF=wsapi/websSetRequestDocFd.htm>websSetRequestDocFd</A><BR></TD><TD WIDTH="33%"><A HREF=wsapi/websSetRequestFlags.htm>websSetRequestFlags</A><BR>
-<A HREF=wsapi/websSetRequestLpath.htm>websSetRequestLpath</A><BR>
-<A HREF=wsapi/websSetRequestPath.htm>websSetRequestPath</A><BR>
-<A HREF=wsapi/websSetRequestWritten.htm>websSetRequestWritten</A><BR>
-<A HREF=wsapi/websSetVar.htm>websSetVar</A><BR>
-<A HREF=wsapi/websTestVar.htm>websTestVar</A><BR>
-<A HREF=wsapi/websUrlHandlerDefine.htm>websUrlHandlerDefine</A><BR>
-<A HREF=wsapi/websUrlHandlerDelete.htm>websUrlHandlerDelete</A><BR>
-<A HREF=wsapi/websUrlParse.htm>websUrlParse</A><BR>
-<A HREF=wsapi/websUrlType.htm>websUrlType</A><BR>
-<A HREF=wsapi/websValid.htm>websValid</A><BR>
-<A HREF=wsapi/websWrite.htm>websWrite</A><BR>
-<A HREF=wsapi/websWriteBlock.htm>websWriteBlock</A><BR>
-<A HREF=wsapi/websWriteBlockData.htm>websWriteBlockData</A><BR></TD></TR></TABLE><p> </p><p> </p><blockquote>
-
-
-
-</blockquote>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/addUser.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/addUser.htm deleted file mode 100644 index c246e160c3..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/addUser.htm +++ /dev/null @@ -1,36 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>addUser -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">addUser</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis
- </B></H2><BLOCKQUOTE><P> Persist a user to the user database.
-
-</P></BLOCKQUOTE><H2><B>Prototype</B>
- </H2><PRE>Int AddUser(char_t * user, char_t * password, char_t * group,
- char_t * dir, int prot, int enable) </PRE><H2><B>Parameters</B> </H2><TABLE WIDTH=100% BORDER=0 CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="13%">User </TD><TD WIDTH="87%"> User ID </TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="13%">Password </TD><TD WIDTH="87%">password </TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="13%">Group </TD><TD WIDTH="87%">user group </TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="13%">Dir </TD><TD WIDTH="87%">home directory </TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="13%">Prot </TD><TD WIDTH="87%">protection </TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="13%">Enable </TD><TD WIDTH="87%">enabled </TD></TR>
-</TABLE><H2><B>Description</B>
- </H2><P>User added. Password is passed in clear text, then XOR encrypted before persisting.
-
-</P><H2><B>Return Valu</B>e
- </H2><P>0 if successful; -1 if error. </P><H2><B>Example</B>
- </H2><PRE>nCheck = AddUser("misterripley", "talented",
- "superusers", "/home/ripley", 1, 1); </PRE><H2><B>See Also</B>
- </H2><BLOCKQUOTE><P><A HREF="../umapi/umDeleteUser.htm">deleteUser
-
-</A></P></BLOCKQUOTE></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/balloc.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/balloc.htm deleted file mode 100644 index aa67c22f98..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/balloc.htm +++ /dev/null @@ -1,51 +0,0 @@ -<html>
-
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>balloc - basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<table border="0" width="100%" cellspacing="0" cellpadding="0" CLASS="apiTitle">
- <tr>
- <td class="titleLeft" align=left width="33%"><b>balloc</b></td><td class="titleCenter" align=center width="33%"><b>basic</b></td><td class="titleRight" align=right width="33%"><b>EMF</b></td></tr>
-</table><hr>
-
-<h2>Synopsis</h2><p>Allocate a dynamic block of memory.</p><h2>Prototypes</h2><pre>
- #include "webs.h"
-
- void *<b>balloc</b>(B_ARGS_DEC, int size);
-</pre><h2>Parameters</h2><table width="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
- <tr>
- <td VALIGN="TOP" width="14%">B_ARGS_DEC</td><td width="86%">Caller's source file name and line number. Really two arguments.
- </td></tr>
- <tr>
- <td VALIGN="TOP" width="14%">size</td><td width="86%">Size of the block to allocate.</td></tr>
-</table><h2>Description</h2><p>The balloc procedure creates and allocates a block of dynamic memory for use
- by the caller. When finished, you should use <a href="bfree.htm">bfree</a> to
- release the block. Balloc is a very efficient memory allocation that uses binary
- queues to store blocks of memory. It does not do block coalescing, nor does
- it attempt to eliminate fragmentation. Once released by bfree, memory is not
- actually freed to the operating system, but is kept on the relevant binary queue
- for future use by the application. Use B_L as the first argument to bfree to
- provide the source file name and line number arguments.</p><p>The goal of the balloc memory allocator is to provide guaranteed, rapid allocation.
- By calling <a href="bopen.htm">bopen</a> with the application memory requirements,
- memory can be defined or allocated upfront and subsequent calls to balloc are
- more likely to succeed. Balloc is not perfect. You can still get free memory
- on one class queue while memory requests for a large size cannot be satisfied.
- However, in practice, many embedded applications tend to allocate memory in
- a pattern and the balloc memory allocator works well in such environments. The
- memory usage of the GoAhead WebServer has been optimized to allocate from the
- fixed pool defined by bopen, and it should be very predictable in its requirements.
- The bstats procedure may be used to print current memory statistics include
- per file usage information.</p><h2>Return Value</h2><p>Pointer to the allocated buffer. If memory cannot be provided, NULL is
-returned.</p><h2>Example</h2><pre>
-buf = balloc(B_L, 1024);
-gstrncpy(buf, "Hello World", sizeof(buf));
-bfree(B_L, buf);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2>See Also</h2><p><a href="bopen.htm">bopen</a>, <a href="bfree.htm">bfree</a></p></td></tr></table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/bfree.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/bfree.htm deleted file mode 100644 index b100c5361b..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/bfree.htm +++ /dev/null @@ -1,33 +0,0 @@ -<html>
-
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>bfree - basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<table border="0" width="100%" cellspacing="0" cellpadding="0" CLASS="apiTitle">
- <tr>
- <td class="titleLeft" align=left width="33%"><b>bfree</b></td><td class="titleCenter" align=center width="33%"><b>basic</b></td><td class="titleRight" align=right width="33%"><b>EMF</b></td></tr>
-</table><hr>
-
-<h2>Synopsis</h2><p>Free a dynamic block of memory allocated with balloc.</p><h2>Prototypes</h2><pre>
- #include "webs.h"
-
- void <b>bfree</b>(B_ARGS_DEC, void *buf);
-</pre><h2>Parameters</h2><table width="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0">
- <tr VALIGN="TOP">
- <td width="14%">B_ARGS_DEC </td><td width="86%">Callers source file name and line number. Really two arguments.
- </td></tr>
- <tr VALIGN="TOP">
- <td width="14%">buf </td><td width="86%">Pointer to buffer to free.</td></tr>
-</table><p></p><h2>Description</h2><p>The bfree procedure releases a block of memory back to the
-<a href="balloc.htm">balloc</a> free queues. Memory is not actually freed to
-the operating system, but is kept locally for future use.</p><p></p><p>Use B_L as the first argument to bfree to provide the source file name and
-line number arguments.</p><h2>Return Value</h2><p>No return value.</p><h2>Example</h2><pre>
-bfree(B_L, buf);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2>See Also</h2><p><a href="balloc.htm">balloc</a>, <a href="bopen.htm">bopen</a></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/bopen.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/bopen.htm deleted file mode 100644 index 2ce1c9df1b..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/bopen.htm +++ /dev/null @@ -1,51 +0,0 @@ -<html>
-
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>bopen - basic</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<table border="0" width="100%" cellspacing="0" cellpadding="0" CLASS="apiTitle">
- <tr>
- <td class="titleLeft" align=left width="33%"><b>bopen</b></td><td class="titleCenter" align=center width="33%"><b>basic</b></td><td class="titleRight" align=right width="33%"><b>EMF</b></td></tr>
-</table><hr>
-
-<h2>Synopsis</h2><p>Initialize the GoAhead block memory allocator.</p><h2>Prototypes</h2><pre>
- #include "webs.h"
-
- int <b>bopen</b>(char *buf, int bufsize, int flags);
-</pre><h2>Parameters</h2><table width="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
- <tr>
- <td>buf </td><td>Pointer to buffer to use for initial memory allocation.</td></tr>
- <tr>
- <td>bufsize </td><td>Size of buf. </td></tr>
- <tr>
- <td>flags </td><td>Open mode flags.</td></tr>
-</table><h2>Description</h2><p>The bopen procedure initializes the GoAhead block memory allocator. The block
- allocator is a very efficient memory allocator that uses binary queues to store
- blocks of memory. It does not do block coalescing, nor does it attempt to eliminate
- fragmentation. Once released by bfree, memory is not actually freed to the operating
- system, but is kept on the relevant binary queue for future use by the application.</p><p></p><p>The goal of the block allocator is to provide guaranteed, rapid allocation.
- By calling bopen with the application memory requirements, memory can be defined
- or allocated upfront and subsequent calls to <a href="balloc.htm">balloc</a>
- are more likely to succeed. The block allocator is not perfect; you can still
- get free memory of one class queue while memory requests for a large size cannot
- be satisfied. However, in practice, many embedded applications tend to allocate
- memory in a pattern and the balloc memory allocator works well in such environments.
- The memory usage of the GoAhead WebServer has been optimized to allocate from
- the fixed pool defined by bopen and it should be very predictable in its requirements.
- The bstats procedure may be used to print out current memory statistics, including
- per file usage information.</p><p></p><p>If you wish to supply a static buffer for the block allocator to use, set the
- <em>buf </em>argument to a buffer of your choice and set <em>bufsize to </em>specify
- the size of the buffer. You must also set <em>flags </em>to be B_USER_BUF. The
- block allocated can also use the operating system's <em>malloc </em>call to
- get memory if the <em>flags</em> argument is set to B_USE_MALLOC.</p><h2>Return Value</h2><p>Returns 0 on success. Returns -1 if memory cannot be provided.</p><h2>Example</h2><pre>
-if (bopen(NULL, B_DEFAULT_MEM, 0) < 0) {
- return NULL;
- }
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2></h2><h2></h2><h2>See Also</h2><p><a href="balloc.htm">balloc</a>, <a href="bfree.htm">bfree</a></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/deleteUser.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/deleteUser.htm deleted file mode 100644 index 8e701497f6..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/deleteUser.htm +++ /dev/null @@ -1,32 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>deleteUser -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">deleteUser</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis
-</B> </H2><P>Remove a user from the user database.
-
-</P><H2><B>Prototype
-</B> </H2><PRE>Int DeleteUser(char_t * user) </PRE><H2><B>Parameters
-</B></H2><TABLE WIDTH=100% BORDER=0 CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="13%">User </TD><TD WIDTH="87%"> User ID </TD></TR>
-</TABLE><H2><B>Description</B>
- </H2><P>User deleted.
-
-</P><H2><B>Return Value
- </B></H2><P>0 if successful
- -1 on error.
-
-</P><H2><B>Example
-</B> </H2><PRE>nCheck = DeleteUser("misterripley"); </PRE><H2><B>See Also:
- </B></H2><P><A HREF="addUser.htm">addUser
-</A></P></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/getPassword.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/getPassword.htm deleted file mode 100644 index 992736b013..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/getPassword.htm +++ /dev/null @@ -1,32 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>getPassword -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">getPassword</TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <H2><B>Synopsis
-</B> </H2><P>Get the password.
-
-</P><H2><B>Prototype</B>
- </H2><PRE>Char_t* GetPassword(char_t * user) </PRE><H2><B>Parameters
-</B> </H2><P>User - User ID
-
-</P><H2><B>Description
-</B> </H2><P>Persisted password is decrypted before being returned by the function.
-
-</P><H2><B>Return Value
- </B></H2><P>NULL if error
- Password on success.
-
-</P><H2><B>Example
-</B> </H2><PRE>Char_t * pwd = GetPassword("misterripley"); </PRE><H2><B>See Also:
- </B></H2><P><A HREF="addUser.htm">addUser
-</A></P></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websAspDefine.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websAspDefine.htm deleted file mode 100644 index acf8c86c27..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websAspDefine.htm +++ /dev/null @@ -1,36 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websApiDefine -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websAspDefine</b></TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Define an ASP script procedure.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websAspDefine</b>(char_t *name, int (*fn)
- (int ejid, webs_t wp, int argc, char_t **argv)); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="8%">name</TD><TD WIDTH="92%">Name of ASP command
-to define.</TD></TR><TR> <TD VALIGN="TOP" WIDTH="8%">fn</TD><TD WIDTH="92%">Pointer
-to function to call when the script <EM>name</EM> is invoked in an ASP page.</TD></TR></table><h2>Description</h2><P>
-websAspDefine creates an ASP JavaScript procedure that can be called from within
-an ASP page. The <i>function</i> supplied will be called whenever the <EM>name</EM>
-procedure is executed in the ASP page. The <i>name</i> must be unique. </P><P>The
-<EM>name</EM> procedure is provided a wp handle to the browser connection. This
-can be used to call many other GoAhead WebServer functions. The <EM>argv</EM>
-parameter includes any script arguments provided in the ASP page when calling
-the <EM>name</EM> script. </P><P><I>Fn</I> must meet the prototype requirement shown above, i.e., it must accept the four arguments <I>ejid</I>, <I>wp</I>, <I>argc</I>, and <I>argv</I>. <I>ejid</I> is the JavaScript interpreter handle used when calling JavaScript related functions such as <I>ejGetVar</I> or <I>ejSetResult</I>. <I>wp</I> is the WebServer handle to the browser connection used when calling webs related functions such as <I>websDone</I>. <I>arcg</I> and <I>argv</I> contain the count and content of the script arguments to name. </P><h2>Return Value</h2><p>Returns 0 if successful;
-returns -1 on errors.</p><h2>Example</h2><pre>int outputMyTable(int ejid, webs_t wp, int argc, char_t **argv)
-{
- websWrite(wp, "Add HTML code to create a table for %s", argv[0]);
-}
-
-websAspDefine("outputTable", outputMyTable); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p><A href="../../../over/ejs.htm">JavaScript</A>, <A href="../../../over/asp.htm">Active
-Server Pages</A></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websClose.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websClose.htm deleted file mode 100644 index 21eeec8e7a..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websClose.htm +++ /dev/null @@ -1,25 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websClose -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websClose</b></TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Shutdown the GoAhead WebServer.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websClose</b>(); </pre><h2>Parameters</h2><table width=100% border=0 CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP">none</TD><TD> </TD></TR> </table><h2>Description</h2><P>The
-websClose procedure is the main termination procedure for the GoAhead WebServer.
-It closes the primary TCP/IP port on which the GoAhead WebServer is listening
-and frees all resources. You should call websClose before you exit your application.</P><h2>Return
-Value</h2><p> None</p><h2>Example</h2><pre> websClose(); </pre><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websCloseListen.htm">websCloseListen</A>,
-<A href="websOpen.htm">websOpen</A>, <A href="websOpenListen.htm">websOpenListen</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websCloseListen.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websCloseListen.htm deleted file mode 100644 index fe86f96227..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websCloseListen.htm +++ /dev/null @@ -1,26 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websCloseListen -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websCloseListen</b></TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Close the TCP/IP port used
-by the web server.</p><h2>Prototype</h2><pre> #include "webs.h"<BR>
- int <b>websCloseListen</b>(); </pre><h2>Parameters</h2><table width=100% border=0 CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP">none</TD><TD> </TD></TR> </table><h2>Description</h2><P>The
-websCloseListen procedure closes the TCP/IP port on which the GoAhead WebServer
-is listening. This will not affect any currently open browser connections. This
-procedure is sometimes used when changing the listening port at run-time. </P><h2>Return
-Value</h2><p> None.</p><h2>Example</h2><pre> websCloseListen();
-websOpenListen(port,retries);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websClose.htm">websClose</A>,
-<A href="websOpen.htm">websOpen</A>, <A href="websOpenListen.htm">websOpenListen</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websDecode64.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websDecode64.htm deleted file mode 100644 index f7e114443f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websDecode64.htm +++ /dev/null @@ -1,28 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websDecode64 -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websDecode64</b></TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Decode a string using the basic
-encoding scheme (base 64).</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websDecode64</b>(char_t *outbuf, char_t *string, int outlen); </pre><h2>Parameters</h2><table width=100% border=0 CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" width="5%">outbuf</TD><TD width="95%">Output buffer.</TD></TR>
-<TR> <TD VALIGN="TOP" width="5%">string</TD><TD width="95%">Input string.</TD></TR>
-<TR> <TD VALIGN="TOP" width="5%">outlen</TD><TD width="95%">Output buffer length.</TD></TR>
-</table><h2>Description</h2><P>The websDecode64 procedure decodes the <EM>string</EM>
-argument into the supplied <EM>outbuf</EM> buffer. websDecode64 can decode in-situ,
-i.e., <EM>outbuf</EM> and <EM>string</EM> can be the same. </P><h2>Return Value</h2><p>
-Returns 0 if successful; returns -1 if the <EM>string</EM> was not a valid base
-64 encoded string.</p><h2>Example</h2><pre> websEncode64(encoded, "String with special characters \" %", sizeof(encoded));
- websDecode64(decoded, encoded, sizeof(decoded)); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p><A href="websEncode64.htm">websEncode64</A></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websDone.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websDone.htm deleted file mode 100644 index e5c5277a7e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websDone.htm +++ /dev/null @@ -1,32 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websDone -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websDone</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Close the connection
-to the browser when completing a Form request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websDone</b>(webs_t wp, int code); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">wp <TD WIDTH="95%">Web server handle to the browser
-connection. <TR> <TD VALIGN="TOP" WIDTH="5%">code <TD WIDTH="95%">HTTP completion
-code.</TD></TR></table><h2>Description</h2><P>The websDone procedure is called
-by Form procedures when completing processing. websDone closes the browser connection
-and frees all connection resources. websDone must be called only once per browser
-connection. </P><P>The <EM>code</EM> parameter is a standard HTTP response code.
-Some of the more common codes include: </P><P> <UL> <LI>200 "Data follows"
-<LI>204 "No Content" <LI>301 "Redirect" <LI>302 "Redirect"
-<LI>304 "User local copy" <LI>400 "Page not found" <LI>401
-"Password Required" <LI>404 "Site or Page Not Found" <LI>405
-"Access Denied" <LI>500 "Web Error" <LI>503 "Site Temporarily
-Unavailable. Try again"</LI></UL><h2>Return Value</h2><p>None</p><h2>Example</h2><pre>
-websDone(wp, 200); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p><A href="websWrite.htm">websWrite</A></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websEncode64.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websEncode64.htm deleted file mode 100644 index 96e470360a..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websEncode64.htm +++ /dev/null @@ -1,27 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websEncode64 -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websEncode64</b></TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Encode a string using the basic
-encoding scheme (base 64).</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websEncode64</b>(char_t *outbuf, char_t *string, int outlen); </pre><h2>Parameters</h2><table width=100% border=0 CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" width="7%">outbuf</TD><TD width="93%">Output buffer.</TD></TR>
-<TR> <TD VALIGN="TOP" width="7%">string</TD><TD width="93%">Input string.</TD></TR>
-<TR> <TD VALIGN="TOP" width="7%">outlen</TD><TD width="93%">Output buffer length.</TD></TR>
-</table><h2>Description</h2><P>The websEncode64 procedure encodes the <EM>string</EM>
-argument into the supplied <EM>outbuf</EM> buffer. websEncode64 can work in-situ,
-i.e., <EM>outbuf</EM> and <EM>string</EM> can be the same. </P><h2>Return Value</h2><p>
-None</p><h2>Example</h2><pre> websEncode64(encoded, "String with special characters \" %", sizeof(encoded));
- websDecode64(decoded, encoded, sizeof(decoded));
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p><A href="websDecode64.htm">websDecode64</A></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websError.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websError.htm deleted file mode 100644 index 4ba005d029..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websError.htm +++ /dev/null @@ -1,28 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websError-- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websError</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return an error message
-to the requesting browser.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websError</b>(webs_t wp, int code, char_t *msg, ...); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">wp <TD WIDTH="95%"> Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="5%">code <TD WIDTH="95%">HTTP response code (see
-<A href="websDone.htm">websDone</A> for codes). <TR> <TD VALIGN="TOP" WIDTH="5%">msg
-<TD WIDTH="95%"> Message format string with %s and %d parameters.<tr> <td cellpadding = 20 VALIGN="TOP" WIDTH="5%">...</td><td cellpadding = 20 WIDTH="95%">
-Parameters for %s and %d directives.</td></tr></table><h2>Description</h2><P>The
-websError procedure can be used to return a request response to the user's browser
-and then close the connection. It internally calls <STRONG><A HREF="websDone.htm">websDone</A></STRONG>
-to close the connection. You can use it as you would a printf call with a message
-format string. </P><h2>Return Value</h2><p> None</p><h2>Example</h2><pre> websError(wp, 200, "Can't open %s", filename); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p><A href="websDone.htm">websDone</A></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websExpand.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websExpand.htm deleted file mode 100644 index 7736fd20a3..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websExpand.htm +++ /dev/null @@ -1,53 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websExpand -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%">websExpand</TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Expand dollar variables
-in a string.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websExpand</b>
- (webs_t wp, char_t *buf, char_t *string, int bufsize); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">wp <TD WIDTH="95%"> Web server connection handle
-<TR> <TD VALIGN="TOP" WIDTH="5%">buf <TD WIDTH="95%">Output buffer <TR> <TD VALIGN="TOP" WIDTH="5%">string
-<TD WIDTH="95%"> Input string<tr> <td cellpadding = 20 VALIGN="TOP" WIDTH="5%">len</td><td cellpadding = 20 WIDTH="95%">
-Size of output buffer</td></tr></table><h2>Description</h2><P>The websExpand procedure
-can be used to expand all dollar variables. These include all the standard CGI
-variables, extended GoAhead WebServer variables and all current per request variables.
-In addition to the standard set below, all request header variables are stored
-as "HTTP_name" where name is request header keyword mapped to lower
-case. If a particular dollar variable is not found, the original text for that
-variable is unchanged. </P><P>If the <EM>buffer</EM> is NULL, the expanded string
-is returned in a dynamically allocated buffer. Use <STRONG>bfree</STRONG> to free
-the buffer when you are finished. </P><P> The standard variable set includes:
-</P><table width="100%" border="1" CELLPADDING="0" CELLSPACING="0"> <tr><td>COMPANY</td><td>Defined
-company name</td></tr> <tr><td>CONTENT_LENGTH</td><td>Length of posted content</td></tr>
-<tr><td>DBNAME</td><td>Primary database name "primary"</td></tr> <tr><td>DESCRIPTION</td><td>Product
-description</td></tr> <tr><td>D_OS</td><td>Operating system name</td></tr> <tr><td>D_PROD</td><td>Home
-directory for the product</td></tr> <tr><td>D_SOLUTION</td><td>Home directory
-for solution packs</td></tr> <tr><td>GATEWAY_INTERFACE</td><td>Version of this
-gateway interface</td></tr> <TR> <TD>HTTP_AUTHORIZATION <TD>Password supplied
-by the browser <TR> <TD>HTTP_name <TD>Where name is any key name in the browser
-request <tr><td>OS</td><td>Operating system</td></tr> <tr><td>PATH_INFO</td><td>URL
-path information after /form</td></tr> <tr><td>PATH_TRANSLATED</td><td>File system
-path name for URL document</td></tr> <tr><td>PRODUCT</td><td>Product name</td></tr>
-<tr><td>QUERY_STRING</td><td>Complete query string</td></tr> <tr><td>REMOTE_ADDR</td><td>Requesting
-browsers IP address</td></tr> <tr><td>REMOTE_HOST</td><td>Requesting browsers
-host name</td></tr> <tr><td>REQUEST_METHOD</td><td>Request operation type</td></tr>
-<tr><td>SERVER_HOST</td><td>Host name for this web server</td></tr> <tr><td>SERVER_PORT</td><td>TCP/IP
-port used by this web server</td></tr> <tr><td>SERVER_URL</td><td>URL to address
-the home page for this web server</td></tr> <tr><td>VERSION</td><td>Version number
-(n.n) for this product</td></tr> <tr><td>VERSION_FULL</td><td>Full version number
-(n.n.n)</td></tr> </table><h2>Return Value</h2><p> Returns the <i>buffer</i> supplied
-or dynamically allocated buffer if <i>buffer</i> was NULL. Return NULL on errors.</p><h2>Example</h2><pre>
-websExpand(wp, NULL, "$COMPANY $SERVER_PORT", -1); </pre><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p><A href="../basicapi/bfree.htm">bfree</A></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websFooter.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websFooter.htm deleted file mode 100644 index 6f6379ad78..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websFooter.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websFooter-- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websFooter</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Output the common HTML
-tags to close out a web page.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websFooter</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websFooter procedure outputs the standard HTML tags to finish a web page. It outputs
-the following HTML code: </P><P> </html> </P><h2>Return Value</h2><p> None</p><h2>Example</h2><pre>
-websHeader(wp);
-websWrite(wp, "Great Day Today");
-websFooter(wp);
-websDone(wp);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p><A href="websDone.htm">websDone</A>,
-<A href="websHeader.htm">websHeader</A>, <A href="websWrite.htm">websWrite</A>
-</p></td></tr></table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websFormDefine.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websFormDefine.htm deleted file mode 100644 index 81ce1c2e23..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websFormDefine.htm +++ /dev/null @@ -1,58 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websFormDefine -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websFormDefine</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Create a <A HREF="../../../over/goforms.htm">GoForm</A>™
-procedure.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websFormDefine</b>(char_t *urlPrefix,
- void (*formHandler)(webs_t wp, char_t *path, char_t *query)); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="9%">wp <TD WIDTH="91%"> Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="9%">urlPrefix <TD WIDTH="91%">URL prefix to use when
-matching URLs for this handler. <TR> <TD VALIGN="TOP" WIDTH="9%">formHandler <TD WIDTH="91%">URL
-handler procedure.</TD></TR></table><h2>Description</h2><P>The websFormDefine
-procedure is used to create a <A href="../../../over/goforms.htm">GoForm</A>™ procedure.</P><P>It
-establishes the nominated <EM>formHandler </EM>procedure as the handler for all
-URLs that begin with "/goform/ <EM>urlPrefix". </EM> The GoForm processor</P><P>GoForms
-provide a standard Common Gateway Interface (CGI) implemented as an in-memory
-forms processor. </P><P>GoForms procedures run in-memory without creating a new
-process for each browser connection. By sharing the address space with the GoAhead
-WebServer, GoForms procedures can directly access the full request context.</P><P>The
-GoForm handler also automatically decodes and parses all POST and query data for
-easy access. A convenient API (see <A href="websGetVar.htm" >websGetVar</A>) permits
-easy access to CGI variables. In addition to POST and query data, the <A href="websExpand.htm" >standard
-CGI variables</A> are also defined.</P><P>GoForm procedures can access the URL
-path via the <i>path</i> parameter which holds URL segment after the host name
-and port number. The full POST data or query string is passed in the <i>query</i>
-variable from conform to the following prototype:</P><pre> void myForm(webs_t wp, char_t *path, char_t *query){ websHeader(wp);
-websWrite(wp, "Name %s", websGetVar(wp, "name", ""));
-websWrite(wp, "Age %s", websGetVar(wp, "age", ""));
-websFooter(wp);
-websDone(wp, 200);
-} </pre><P>The GoForm procedure is responsible for writing the HTTP header and
-HTML document contents back to the user's browser. <A href="websHeader.htm" >websHeader</A>
-creates a standard HTTP header with initial HTML tags. <A href="websFooter.htm" >websFooter</A>
-closes the document with a closing HTML tag. Inside the GoForm procedure, <A href="websGetVar.htm" >websGetVar</A>,
-<A href="websRedirect.htm" >websRedirect</A>, <A href="websWrite.htm" >websWrite</A>,
-and <A href="websWriteBlock.htm" >websWriteBlock</A> are some of the most useful
-API calls. </P><h2>Return Value</h2><p> Returns 0 if the GoForm procedure is successfully
-defined, otherwise -1 is returned.</p><h2>Example</h2><pre> void myForm(webs_t
-wp, char_t *path, char_t *query) { websHeader(wp); websWrite(wp, "Name is
-%s, Address %s", websGetVar(wp, "name", "")); websDone(wp,
-200); websFooter(wp); } websFormDefine("myForm", myForm); </pre><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="../../../over/asp.htm">Active
-Server Pages</A>, <A href="../../../over/ejs.htm">JavaScript</A>, <A href="../../../over/urlhandles.htm" >URL
-Handlers</A>, <A href="websDone.htm">websDone</A>, <A href="websFooter.htm">websFooter</A>,
-<A href="websGetVar.htm">websGetVar</A>, <A href="websHeader.htm">websHeader</A>,
-<A href="websSecurityHandler.htm" >websSecurityHandler</A>, <A href="websUrlHandlerDefine.htm" >websUrlHandlerDefine</A>,
-<A href="websWrite.htm">websWrite</A></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetDefaultDir.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetDefaultDir.htm deleted file mode 100644 index 42d4d7ad0c..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetDefaultDir.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetDefaultDir-- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetDefaultDir</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the path of
-the default web page directory.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetDefaultDir</b>(); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP">None <TD></TD></TR></table><h2>Description</h2><P>The websGetDefaultDir
-procedure returns a local pathname for the default web directory. The default
-web directory is set by the <B>websSetDir</B> procedure. Although many web page
-directories can be configured by using <A href="../../../over/urlhandles.htm">URL Handlers</A>,
-the web page directory configured via <b>websSetDir</b> is designated as the default.
-<p> <h2>Return Value</h2><p>Pointer to a static buffer containing a pathname.
-Do not call <A href="../basicapi/bfree.htm">bfree</A> on the result.</p><h2>Example</h2><pre>
-dir = websGetDefaultDir(); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetDefaultPage.htm">websGetDefaultPage</A>, <A href="websUrlHandlerDefine.htm">websUrlHandlerDefine</A>,
-<A href="websSetDefaultDir.htm">websSetDefaultDir</A>, <A href="websSetDefaultPage.htm">websSetDefaultPage</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetDefaultHome.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetDefaultHome.htm deleted file mode 100644 index c694cb9d42..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetDefaultHome.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetDefaultDir-- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetDefaultDir</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the path of
-the default web page directory.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetDefaultDir</b>(); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP">none <TD></TD></TR></table><h2>Description</h2><P>The websGetDefaultDir
-procedure returns a local pathname for the default web directory. The default
-web directory is set by the <b>websSetDir</b> procedure. Although many web page
-directories can be configured by using <A href="../../../over/urlhandles.htm">URL Handlers</A>,
-the web page directory configured via <b>websSetDir</b> is designated as the default.<p>
-<h2>Return Value</h2><p>Pointer to a static buffer containing a pathname. Do not
-call <A href="../basicapi/bfree.htm">bfree</A> on the result.</p><h2>Example</h2><pre>
-dir = websGetDefaultDir(); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetDefaultPage.htm">websGetDefaultPage</A>, <A href="websUrlHandlerDefine.htm">websHandlerDefine</A>,
-<A href="websSetDefaultDir.htm">websSetDefaultDir</A>, <A href="websSetDefaultPage.htm">websSetDefaultPage</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetDefaultPage.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetDefaultPage.htm deleted file mode 100644 index 8aa7a88a7c..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetDefaultPage.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetDefaultPage -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetDefaultPage</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Get the name of the
-default web page when a URL requests a directory.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetDefaultPage</b>(); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP">None <TD> </TD></TR></table><h2>Description</h2><P>The websGetDefaultPage
-procedure returns the default page name to be returned when a URL is requested
-that specifies a directory rather than a web page. HTTP uses this convention frequently.
-For example, a request to <A href="http://www.goahead.com" TARGET="new">http://www.goahead.com</A>
-will be translated into a request to the web page default.htm in the top level
-web directory. The default URL handler will automatically redirect the user's
-browser toward the default page if the initial URL nominated a directory.</P><h2>Return
-Value</h2><p> None</p><h2>Example</h2><pre> fname = websGetDefaultPage(); </pre><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetDefaultDir.htm">websGetDefaultDir</A>,
-<A href="websSetDefaultDir.htm">websSetDefaultDir</A>, <A href="websSetDefaultPage.htm">websSetDefaultPage</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetHost.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetHost.htm deleted file mode 100644 index 64f8111f46..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetHost.htm +++ /dev/null @@ -1,24 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetHostUrl -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetHost</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Returns the hostname
-for the web server.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetHost</b>(); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP">None <TD></TD></TR></table><h2>Description</h2><P> The websGetHost
-procedure returns a string containing the local server host name on which WebServer is running. </P><h2>Return Value</h2><p> Pointer to a statically allocated
-string containing the hostname. Do not call bfree.</p><h2>Example</h2><pre>
-host = websGetHost(); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetPort.htm">websGetPort</A>, <A href="websGetHostUrl.htm">websGetHostUrl</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetHostUrl.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetHostUrl.htm deleted file mode 100644 index a32e811599..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetHostUrl.htm +++ /dev/null @@ -1,26 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetHostUrl -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetHostUrl</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Returns the hostname
-and port as a string suitable for creating URLs.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetHostUrl</b>(); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP">None <TD></TD></TR></table><h2>Description</h2><P>The websGetHostUrl
-procedure returns a string containing the local server name and port number on
-which the web server is running. This can be used to create fully qualified URLs.
-</P><h2>Return Value</h2><p> Pointer to a static string containing the hostname
-and port. If port is 80, the port is omitted.</p><h2>Example</h2><pre> fmtAlloc(path, "http://%s/mypage.htm", websGetHostUrl());
-websRedirect(wp, path); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetPort.htm">websGetPort</A>,
-<A href="websGetHost.htm">websGetHost</A>, <A href="websRedirect.htm">websRedirect</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetPassword.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetPassword.htm deleted file mode 100644 index 3c21966e44..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetPassword.htm +++ /dev/null @@ -1,30 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetPassword -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetPassword</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the currently
-configured password for the entire web site.</p><h2>Prototype</h2><pre> #include "webs.h";
-
- char_t *<b>websGetPassword</b>(); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP">None <TD></TD></TR></table><h2>Description</h2><P> The websGetPassword
-procedure returns the decoded form of the current security password. The password
-is defined by calling <A href="websSetPassword.htm">websSetPassword</a>. To use
-the password feature, the <a href="websSecurityHandler.htm">security handler</a>
-must be installed by calling <A href="websUrlHandlerDefine.htm">websUrlHandlerDefine</a>
-for websSecurityHandler. This in done automatically in the GoAhead EMF. If you
-are using the GoAhead WebServer, this should be done in your main program. See
-main.c for examples.</P><h2>Return Value</h2><p> Returns a pointer to a statically
-allocated string containing the current security password.</p><h2>Example</h2><pre>
-password = websGetPassword(); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websSetPassword.htm">websSetPassword</A>, <A href="websSecurityHandler.htm">websSecurityHandler</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetPort.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetPort.htm deleted file mode 100644 index 7fdcd3cc2e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetPort.htm +++ /dev/null @@ -1,27 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetPort -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetPort</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Returns the TCP/IP
-port number on which the web server is listening for requests.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websGetPort</b>(); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP">None <TD></TD></TR></table><h2>Description</h2><P>The websGetPort
-procedure returns the TCP/IP port number on which the web server is listening
-for browser requests. The port is configured when the web server is opened via
-<A href="websOpen.htm">websOpen</A> or reopened via <A href="websOpenListen.htm">websOpenListen</A>.
-</P><h2>Return Value</h2><p> Returns an integer value > 0 containing the port
-number. Returns 0 if the port is not opened.</p><h2>Example</h2><pre> port = websGetPort();
-websWrite(wp, "The port number is %d", port); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetHost.htm">websGetHost</A>, <A href="websGetHostUrl.htm">websGetHostUrl</A>,
-<A href="websWrite.htm">websWrite</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestBytes.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestBytes.htm deleted file mode 100644 index 5062542fdc..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestBytes.htm +++ /dev/null @@ -1,27 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetRequestBytes -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestBytes</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the size of
-the web page being returned to the browser.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websGetRequestBytes</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">wp <TD WIDTH="95%"> Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websGetRequestBytes procedure returns the size of the current web page being returned
-to the browser in bytes. This is used by handlers that need to use background
-copy handlers. Use <A href="websSetRequestBytes.htm">websSetRequestBytes</A> to
-define the byte count. </P><h2>Return Value</h2><p>Integer containing the size
-of the web page in bytes. Returns zero if the size has not been defined.</p><h2>Example</h2><pre>
-bytes = websGetRequestBytes(wp); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websSetRequestBytes.htm">websSetRequestBytes</A>, <A href="websSetRequestWritten.htm">websSetRequestWritten</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestDir.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestDir.htm deleted file mode 100644 index c6070b8e63..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestDir.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetRequestDir -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestDir</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Return the base directory
-containing the web request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetRequestDir</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%"> Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websGetRequestDir procedure returns a base directory containing the requested
-web page. The request directory and the request path define the location of the
-web page. Use <a href="websSetRequestPath.htm">websSetRequestPath</a> to define
-a new directory and path for a request. This is most often used by <A href="../../../over/urlhandles.htm">URL
-Handlers</A> when rewriting a request for later processing by other URL handlers.</P><h2>Return
-Value</h2><p>Integer containing the size of the web page in bytes. Returns zero
-if the size has not been defined.</p><h2>Example</h2><pre> dir = websGetRequestDir(wp);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetRequestPath.htm">websGetRequestPath</A>,
-<A href="websGetRequestPassword.htm">websGetRequestPassword</A>, <A href="websGetRequestType.htm">websGetRequestType</A>,
-<A href="websSetRequestPath.htm">websSetRequestPath</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestDocFd.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestDocFd.htm deleted file mode 100644 index 82020cffcc..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestDocFd.htm +++ /dev/null @@ -1,27 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetRequestDocFd -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestDocFd</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the document
-file handle for the current web page.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websGetRequestDocFd</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">wp <TD WIDTH="95%"> Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websGetRequestDocFd procedure returns the web page file handle defined for this
-browser connection. This is only defined if a <A href="../../../over/urlhandles.htm">URL Handler</A>
-has set the handle via <A href="websSetRequestDocFd.htm">websSetRequestDocFd</A>. <h2>Return
-Value</h2><p>Returns -1 if there is no document handle defined, otherwise the
-handle is returned.</p><h2>Example</h2><pre> fd = websGetRequestDocFd(wp);
-read(fd, buf, sizeof(buf); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetRequestBytes.htm">websGetRequestBytes</A>, <A href="websSetRequestPath.htm">websSetRequestPath</A>,
-<A href="websSetRequestDocFd.htm">websSetRequestDocFd</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestFlags.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestFlags.htm deleted file mode 100644 index e53d4824c6..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestFlags.htm +++ /dev/null @@ -1,40 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetRequestFlags -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestFlags</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Return the flags word
-associated with a browser request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websGetRequestFlags</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="3%">wp <TD WIDTH="97%"> Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websGetRequestFlags procedure returns the flags word for a given browser request.
-</P><P> The following flags are defined: </P><table border=0 width=100% ALIGN="CENTER" CELLPADDING="0" CELLSPACING="0">
-<tr><td WIDTH="24%">WEBS_LOCAL_PAGE</td><td WIDTH="76%">Request for local webs
-page.</td></tr> <tr><td WIDTH="24%">WEBS_KEEP_ALIVE</td><td WIDTH="76%">HTTP/1.1
-keep alive.</td></tr> <tr><td WIDTH="24%">WEBS_DONT_USE_CACHE</td><td WIDTH="76%">Not
-implemented cache support.</td></tr> <tr><td WIDTH="24%">WEBS_COOKIE</td><td WIDTH="76%">Cookie
-supplied in request.</td></tr> <tr><td WIDTH="24%">WEBS_IF_MODIFIED</td><td WIDTH="76%">If-modified-since
-in request.</td></tr> <tr><td WIDTH="24%">WEBS_POST_REQUEST</td><td WIDTH="76%">Post
-request operation.</td></tr> <tr><td WIDTH="24%">WEBS_LOCAL_REQUEST</td><td WIDTH="76%">Request
-from this system.</td></tr> <tr><td WIDTH="24%">WEBS_HOME_PAGE</td><td WIDTH="76%">Request
-for the home page.</td></tr> <tr><td WIDTH="24%">WEBS_ASP</td><td WIDTH="76%">ASP
-request.</td></tr> <tr><td WIDTH="24%">WEBS_HEAD_REQUEST</td><td WIDTH="76%">Head
-request.</td></tr> <tr><td WIDTH="24%">WEBS_CLEN</td><td WIDTH="76%">Request had
-a content length.</td></tr> <tr><td WIDTH="24%">WEBS_FORM</td><td WIDTH="76%">Request
-is a form.</td></tr> <tr><td WIDTH="24%">WEBS_REQUEST_DONE</td><td WIDTH="76%">Request
-complete.</td></tr> <tr><td WIDTH="24%">WEBS_POST_DATA</td><td WIDTH="76%">Already
-appended post data.</td></tr> <tr><td WIDTH="24%">WEBS_HEADER_DONE</td><td WIDTH="76%">Already
-output the HTTP header.</td></tr> </table><h2>Return Value</h2><p> Integer containing
-the request flags.</p><h2>Example</h2><pre> websSetRequestFlags(wp, websGetRequestFlags(wp, flags) | WEBS_HEADER_DONE)); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websSetRequestBytes.htm">websSetRequestBytes</A>, <A href="websSetRequestFlags.htm">websSetRequestFlags</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestIpaddr.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestIpaddr.htm deleted file mode 100644 index c56c641c38..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestIpaddr.htm +++ /dev/null @@ -1,27 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetRequestIpaddr -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestIpaddr</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the IP address
-of the requesting browser.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetRequestIpaddr</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websGetRequestIpaddr procedure returns the IP address of the requesting browser.</P><h2>Return
-Value</h2><p> Pointer to a statically allocated string containing the IP address.
-Do not call <A href="../basicapi/bfree.htm">bfree</A>.</p><h2>Example</h2><pre>
-char_t *ipaddr;
-ipaddr = websGetRequestIpaddr(wp); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetRequestDir.htm">websGetRequestDir</A>, <A href="websGetRequestPassword.htm">websGetRequestPassword</A>,
-<A href="websGetRequestPath.htm">websGetRequestPath</A>, <A href="websGetRequestType.htm">websGetRequestType</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestLpath.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestLpath.htm deleted file mode 100644 index b9bdbc5b76..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestLpath.htm +++ /dev/null @@ -1,27 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetRequestLpath -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestLpath</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the validated
-local pathname for a given request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetRequestLpath</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websGetRequestLpath procedure returns the validated local path for the current
-request. The local path is a combination of the request directory and request
-path and is created by the default URL handler. The local path is fully validated
-with all "." and ".." path segments interpreted and eliminated.</P><h2>Return
-Value</h2><p> Pointer to a statically allocated string. Do not call <A href="../basicapi/bfree.htm">bfree</A>.</p><h2>Example</h2><pre>
-websGetRequestLpath(wp); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetRequestDir.htm">websGetRequestDir</A>, <A href="websGetRequestPath.htm">websGetRequestPath</A>,
-<A href="websSetRequestPath.htm">websSetRequestPath</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestPassword.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestPassword.htm deleted file mode 100644 index f52d6e9b32..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestPassword.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetRequestPassword -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestPassword</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the password
-specified by the browser with the current request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetRequestPassword</b>(webs_t wp);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websGetRequestPassword procedure returns the password supplied by the browser.
-After a user has entered a username and password to access a secured web page,
-the browser will continue to provide that username and password with every request
-for web documents under that point in the URL hierarchy. websGetRequestPassword
-and <a href="websGetRequestUserName.htm">websGetRequestUsername</a> return decoded
-strings. </P><h2>Return Value</h2><p>Pointer to a statically allocated string
-containing the decoded password. Do not call <A href="../basicapi/bfree.htm">bfree</A>.</p><h2>Example</h2><pre>
-path = websGetRequestPath(wp); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetRequestUserName.htm">websGetRequestUsername</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestPath.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestPath.htm deleted file mode 100644 index ae0f64d55c..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestPath.htm +++ /dev/null @@ -1,24 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetRequestPath -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestPath</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the URL path
-portion of the request URL.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetRequestPath</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websGetRequestPath procedure returns the URL path. The URL path is the portion
-of the URL after the hostname and port have been stripped off. </P><h2>Return
-Value</h2><p>Pointer to a statically allocated string. Do not call <A href="../basicapi/bfree.htm">bfree</A>.</p><h2>Example</h2><pre>
-path = websGetRequestPath(wp); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websSetRequestPath.htm">websSetRequestPath</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestType.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestType.htm deleted file mode 100644 index aba4d2aa76..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestType.htm +++ /dev/null @@ -1,28 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websUrlType-- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestType</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Return the Mime type
-of the request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetRequestType</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websGetRequestType procedure returns the Mime type of the web page document. The
-Mime type is automatically determined by the GoAhead WebServer by examining the
-URL extension. For example, URLs with a ".htm" extension have a mime
-type of "text/html".</P><P>For users of the GoAhead WebServer, mime
-types can be defined in the mime.c source file.</P><h2>Return Value</h2><p> Pointer
-to a statically allocated string containing the mime type string. Do not call
-<A href="../basicapi/bfree.htm">bfree</A>.</p><h2>Example</h2><pre> type = websGetRequestType(wp); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetRequestDir.htm">websGetRequestDir</A>, <A href="websGetRequestPassword.htm">websGetRequestPassword</A>,
-<A href="websGetRequestPath.htm">websGetRequestPath</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestUserName.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestUserName.htm deleted file mode 100644 index 4f6633f217..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestUserName.htm +++ /dev/null @@ -1,31 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetRequestUserName -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestUserName</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the user name
-specified by the browser with the current request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetRequestUserName</b>(webs_t wp);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" width="5%">wp <TD width="95%">Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websGetRequestUserName procedure returns the user name supplied by the browser.
-After a user has entered a username and password to access a secured web page,
-the browser will continue to provide that username and password with every request
-for web documents under that point in the URL hierarchy. <A HREF="websGetRequestPassword.htm">websGetRequestPassword</A>
-and websGetRequestUsername return decoded
-strings. </P><P> Note: The <A href="websSecurityHandler.htm">websSecurityHandler</a>
-currently ignores the user name. </P><h2>Return Value</h2><p>Pointer to a statically
-allocated string containing the decoded password. Do not call <A href="../basicapi/bfree.htm">bfree</A>.</p><h2>Example</h2><pre>
-path = websGetRequestUserName(wp); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <a href="websGetRequestPassword.htm">websGetRequestPassword</a>,
-<a href="websSecurityHandler.htm">WebsSecurityHandler</a></p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestWritten.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestWritten.htm deleted file mode 100644 index c787b8b09f..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetRequestWritten.htm +++ /dev/null @@ -1,24 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetRequestWritten -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetRequestWritten</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Returns the number
-of bytes written to the requesting browser.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websGetRequestWritten</b>(); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP">None <TD></TD></TR></table><h2>Description</h2><P>The websGetRequestWritten
-procedure returns the number of bytes written to the requesting browser. </P><h2>Return
-Value</h2><p> Returns an integer value containing the number of bytes written.
-If no bytes were written, 0 is returned.</p><h2>Example</h2><pre> nbytes = websGetRequestWritten();
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetRequestBytes.htm">websGetRequestBytes</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetVar.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetVar.htm deleted file mode 100644 index 42ae88af0e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websGetVar.htm +++ /dev/null @@ -1,31 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websGetVar -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websGetVar</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the value of
-a Form variable.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websGetVar</b>(webs_t wp, char_t *var, char_t *default); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="6%">wp <TD WIDTH="94%">Web server connection handle.</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="6%">var <TD WIDTH="94%">The form variable to be returned.</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="6%">default <TD WIDTH="94%">The variable to be returned
-if none is defined in var.</TD></TR> </table><h2>Description</h2><P>The websGetVar
-procedure looks up <i>var</i> in the Form table of variables. If the variable
-is not defined, the value of the default is returned. If default is NULL and the
-variable is not found, NULL will be returned. Form variables are created for each
-<input> form tag. The <A href="websExpand.htm">standard form variables</A>
-are also defined.</P><h2>Return Value</h2><p> Returns a pointer to a statically
-allocated string. Do not call <A href="../basicapi/bfree.htm">bfree</A>.</p><h2>Example</h2><pre>
-name = websGetVar(wp, "Name", "Peter Smith"); </pre><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websSetVar.htm">websSetVar</A>,
-<A href="websTestVar.htm">websTestVar</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websHeader.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websHeader.htm deleted file mode 100644 index ae7a6400a6..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websHeader.htm +++ /dev/null @@ -1,37 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websHeader -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websHeader</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Output the common HTTP
-header and HTML tags to begin request response.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <B>websFooter</B>(webs_t wp);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websHeader procedure is used by Form procedures to output the standard HTTP response
-header and HTML tags to begin a response to the browser's request. It outputs
-the following code: </P><PRE>
-HTTP/1.0 200 OK
-Pragma: no-cache
-Cache-control: no-cache
-Content-Type: text/html
-<html>
-</PRE><h2>Return Value</h2><p>
-None</p><h2>Example</h2><pre>
-websHeader(wp);
-websWrite(wp, "Great Day Today");
-websFooter(wp);
-websDone(wp);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p><A href="websDone.htm">websDone</A>, <A href="websWrite.htm">websWrite</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websOpen.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websOpen.htm deleted file mode 100644 index 9eb37dfd14..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websOpen.htm +++ /dev/null @@ -1,34 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websOpen -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websOpen</b></TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Open and initialize the GoAhead
-WebServer.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websOpen</b>(int port, int retries); </pre><h2>Parameters</h2><table width=100% border=0 CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">port</TD><TD WIDTH="95%">The port to open for
-GoAhead WebServer to listen on.</TD></TR> <TR> <TD VALIGN="TOP" WIDTH="5%">retries</TD><TD WIDTH="95%">The
-number of times websOpen will try to open the next available port if <I>port</I>
-is not available.</TD></TR> </table><h2>Description</h2><P>websOpen is the main
-initialization procedure for the GoAhead WebServer. It creates all the URL handlers,
-initializes the mime type table and finally calls <A href="websOpenListen.htm">websOpenListen</A>
-to open the primary TCP/IP port on which the GoAhead WebServer will listen. You
-should call <A href="websClose.htm">websClose</A> when you wish to shutdown the
-GoAhead WebServer.</P><P>The <EM> port </EM>parameter specifies the TCP/IP to
-open. If this cannot be opened and <EM > retries</EM> is greater than zero, the
-next port in sequence will be opened for up to <EM> retries </EM>times until a
-port is successfully opened. To determine the port number actually opened, call
-<A href="websGetPort.htm" > websGetPort </a> .</P><h2>Return Value</h2><p>Returns
-0 if the open succeeds, otherwise -1 is returned.</p><h2>Example</h2><pre> websOpen(80, 5); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p>
-<A href="websClose.htm">websClose</A>, <A href="websCloseListen.htm">websCloseListen</A>,
-<A href="websOpenListen.htm">websOpenListen</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websOpenListen.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websOpenListen.htm deleted file mode 100644 index 8773b943cd..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websOpenListen.htm +++ /dev/null @@ -1,35 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websOpenListen -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websOpenListen</b></TD><td class="titleCenter" align=center width="33%"><b>GoAhead
-WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>GoAhead
-EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Open the TCP/IP port used by
-the web server to listen for browser requests.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websOpenListen</b>(int port, int retries); </pre><h2>Parameters</h2><TABLE WIDTH=100% BORDER=0 CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="6%">port</TD><TD WIDTH="94%">The port to open for
-GoAhead WebServer to listen on.</TD></TR> <TR> <TD VALIGN="TOP" WIDTH="6%">retries</TD><TD WIDTH="94%">The
-number of times websOpen will try to open the next available port if <I>port</I>
-is not available.</TD></TR> </TABLE><h2>Description</h2><P>The websOpenListen
-procedure opens the TCP/IP port on which the GoAhead WebServer listens for browser
-requests. You should call <A href="websCloseListen.htm">websCloseListen</A> to
-close the existing listen port before calling websOpenListen. Normally websOpenListen
-is called automatically when you call <A href="websOpen.htm">websOpen</A> .</P><P>The
-<EM>port </EM>parameter specifies the TCP/IP to open. If this cannot be opened
-and <EM>retries </EM>is greater than zero, the next port in sequence will be opened
-for up to <EM>retries </EM>times until a port is successfully opened. To determine
-the port number actually opened, call <a href="websGetPort.htm">websGetPort</a>.</P><h2>Return
-Value</h2><p>Returns 0 if the open succeeds, otherwise -1 is returned.</p><h2>Example</h2><pre>
-websCloseListen();
-websOpenListen(80, 5); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websClose.htm">websClose</A>, <A href="websCloseListen.htm">websCloseListen</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websRedirect.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websRedirect.htm deleted file mode 100644 index 34e9129390..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websRedirect.htm +++ /dev/null @@ -1,26 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websRedirect -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websRedirect</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Redirect the user's
-browser to a new location.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websRedirect</b>(webs_t wp, char_t *url); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="4%">url <TD WIDTH="96%">The URL to redirect to.</TD></TR>
-</table><h2>Description</h2><P>The websRedirect procedure sends the user's browser
-to a new location. websRedirect sets the "Location" HTTP response header
-to the nominated url.</P><h2>Return Value</h2><p>None</p><h2>Example</h2><pre> gnssprintf(path, "http://%s/mypage.htm", websGetHostUrl());
- websRedirect(wp, path); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p>
-<A href="websDone.htm">websDone</A> </p></td></tr></table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSecurityHandler.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSecurityHandler.htm deleted file mode 100644 index 7b4bd71a9c..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSecurityHandler.htm +++ /dev/null @@ -1,44 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSecurityHandler -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSecurityHandler</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> URL handler for the
-default security policy.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websSecurityHandler</b>(webs_t wp, char_t *url, char_t *path, char_t *query);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">wp <TD WIDTH="95%">Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="5%">url <TD WIDTH="95%">Request URL. <TR> <TD VALIGN="TOP" WIDTH="5%">path
-<TD WIDTH="95%">Request path portion of the URL. <TR> <TD VALIGN="TOP" WIDTH="5%">query
-<TD WIDTH="95%">Query string portion of the URL.</TD></TR></table><h2>Description</h2><P>websSecurityHandler
-implements the default security policy. It operates as a URL handler and is installed
-to run as the very first URL handler. If you require a replacement security policy,
-delete the websSecurityHandler and install your own with <A href="websUrlHandlerDefine.htm">websUrlHandlerDefine</A>.</P><P>
-The <A href="websSetPassword.htm">websSetPassword</a> procedure defines the security
-password. The security handler will require all non-local requests (those from
-a remote system) to supply this password. The user name is ignored. To use the
-password feature, the <A href="websSecurityHandler.htm" >Security Handler</A>
-must be installed by calling <A href="websUrlHandlerDefine.htm" >websHandlerDefine</A>
-for websSecurityHandler. This in done automatically in the GoAhead EMF. If you
-are using the GoAhead WebServer, this should be done in your main program. See
-main.c for examples.</P><P>The security handler should return 0 if the request
-is acceptable. It should return 1 to deny the request. When websSecurityHandler
-denies a request, it first returns a 401 response code to cause the user's browser
-to prompt for a username and password.</P><p> <p>Use <A href="websGetRequestPassword.htm">websGetRequestPassword</A>
-to get the password supplied with the current request.</p><h2>Return Value</h2><p>
-Returns 0 if the request is acceptable. Returns 1 if the request is denied.</p><h2>Example</h2><p>The
-following code will install a new security handler:</p><pre> websSecurityDelete();
-websUrlHandlerDefine("", mySecurityHandler, WEBS_HANDLER_FIRST); </pre><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetRequestFlags.htm">websGetRequestFlags</A>,
-<A href="websGetRequestIpaddr.htm">websGetRequestIpaddr</A>, <A href="websGetRequestPassword.htm">websGetRequestPassword</A>,
-<A href="websGetRequestType.htm">websGetRequestType</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetDefaultDir.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetDefaultDir.htm deleted file mode 100644 index 4b01ed061e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetDefaultDir.htm +++ /dev/null @@ -1,27 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetDefaultDir -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetDefaultDir</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Define the default
-web page directory.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetDefaultDir</b>(char_t *dir); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">dir <TD WIDTH="96%">Directory path containing
-the web pages.</TD></TR></table><h2>Description</h2><P>The websSetDefaultDir procedure
-defines the primary web page repository. The default URL handler will look in
-the default directory and subdirectories to locate requested web pages. The <i>dir</i>
-parameter should contain only "/" path delimiters and not "\"
-separators.</P><h2>Return Value</h2><p> None</p><h2>Example</h2><pre> websSetDefaultDir("/mydir");
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetDefaultDir.htm">websGetDefaultDir</A>,
-<A href="websGetDefaultPage.htm">websGetDefaultPage</A>, <A href="websSetDefaultPage.htm">websSetDefaultPage</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetDefaultPage.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetDefaultPage.htm deleted file mode 100644 index 8e9d4af81a..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetDefaultPage.htm +++ /dev/null @@ -1,30 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetDefaultPage -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetDefaultPage</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Define the default
-web page name when a URL nominates a directory.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetDefaultPage</b>(char_t *page); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">page <TD WIDTH="95%">Filename specifying the
-default page name.</TD></TR></table><h2>Description</h2><P>The websSetDefaultPage
-procedure defines the default page name to be returned when a URL is requested
-that specifies a directory rather than a web page. HTTP uses this convention frequently.
-For example, a request to <A href="http://www.goahead.com" TARGET="new">http://www.goahead.com</A>
-will be translated into a request to the web page default.htm in the top level
-web directory. The default URL handler will automatically redirect the user's
-browser toward the default page if the inital URL nominated a directory.</P><h2>Return
-Value</h2><p> None</p><h2>Example</h2><pre> websSetDefaultPage("default.htm");
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetDefaultDir.htm">websGetDefaultDir</A>,
-<A href="websGetDefaultPage.htm">websGetDefaultPage</A>, <A href="websSetDefaultDir.htm">websSetDefaultDir</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetEnv.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetEnv.htm deleted file mode 100644 index fe168693a1..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetEnv.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetEnv -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetEnv</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Set the Form variable
-environment for a request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetEnv</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">wp <TD WIDTH="95%">Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websSetEnv procedure creates the Form variable environment for a request. It is
-called automatically by the URL handler manager before calling the URL handlers.
-URL handlers may wish to call websSetEnv after modifying certain request values.
-For example, after modifying the request path via <A href="websSetRequestPath.htm">websSetPath</A>,
-websSetEnv must be called to redfine the PATH_INFO variable.</P><p>See <A href="websExpand.htm">websExpand</A>
-for a list of form environment variables.</p><h2>Return Value</h2><p> None</p><h2>Example</h2><pre>
-websSetEnv(wp); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p>
-<A href="websExpand.htm">Standard form variables</A>, <A href="websGetVar.htm">websGetVar</A>,
-<A href="websSetVar.htm">websSetVar</A>, <A href="websTestVar.htm">websTestVar</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetHost.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetHost.htm deleted file mode 100644 index 658e4b1082..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetHost.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetHost -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetHost</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Define the host name
-for the web server.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetHost</b>(char_t *host); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="6%">host <TD WIDTH="94%"> Fully qualified host name.
-</TD></TR></table><h2>Description</h2><P>The websSetHost procedure defines the
-host name for the web server. The <EM>host</EM> parameter should be a fully qualified
-host name with domain specifiers. If you do not have a host name defined, use
-your IP address.</P><P> If you are using the GoAhead WebServer, you should call
-this procedure in your main.c. If you are using the GoAhead EMF, it will be called
-automatically for you.</P><h2>Return Value</h2><p> None</p><h2>Example</h2><pre>
-myhost = getHostNameSomeHow();
-websSetHost(myhost); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetHost.htm">websGetHost</A>,
-<A href="websSetIpaddr.htm">websSetIpaddr</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetIpaddr.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetIpaddr.htm deleted file mode 100644 index eaf7f1919d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetIpaddr.htm +++ /dev/null @@ -1,26 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetIpaddr -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetIpaddr</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Define the IP address
-for the web server.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetIpaddr</b>(char_t *ipaddr); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="7%">ipaddr <TD WIDTH="93%">IP address for the server
-running the web server. </TD></TR></table><h2>Description</h2><P> The websSetIpaddr
-procedure defines the IP address for the web server.</P><P> If you are using the
-GoAhead WebServer, you should call this procedure in your main.c. If you are using
-the GoAhead EMF, it will be called automatically for you.</P><h2>Return Value</h2><p>
-None</p><h2>Example</h2><pre> ipaddr = getIpaddr();
-websSetIpaddr(ipaddr); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetHost.htm">websGetHost</A>, <A href="websSetHost.htm">websSetHost</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetPassword.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetPassword.htm deleted file mode 100644 index 11d9503b8d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetPassword.htm +++ /dev/null @@ -1,30 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetPassword -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetPassword</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Define the password
-to use for implementing the default security policy.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetPassword</b>(char_t *password); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" width="8%">password <TD width="92%">Global password to use
-granting access.</TD></TR></table><h2>Description</h2><P> The websSetPassword
-procedure defines the current security password. The default security handler
-will require all non-local requests (those from a remote system) to supply the
-password. The user name is ignored. To use the password feature, the <a href="websSecurityHandler.htm">security
-handler</a> must be installed by calling <A href="websUrlHandlerDefine.htm">websHandlerDefine</A>
-for <A HREF="websSecurityHandler.htm">websSecurityHandler</A>. This in done automatically
-in the GoAhead EMF. If you are using the GoAhead WebServer, this should be done
-in your main program. See main.c for examples.</P><h2>Return Value</h2><p> None</p><h2>Example</h2><pre>
-websSetPassword("2much!"); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetPassword.htm">websGetPassword</A>, <A href="websSecurityHandler.htm">websSecurityHandler</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestBytes.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestBytes.htm deleted file mode 100644 index 5e53de2297..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestBytes.htm +++ /dev/null @@ -1,24 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetRequestBytes -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetRequestBytes</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Set the size of the
-web page being returned to the browser.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetRequestBytes</b>(webs_t wp, int bytes); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="4%">bytes <TD WIDTH="96%">Number of bytes in page
-to be returned to the browser.</TD></TR></table><h2>Description</h2><P>The websSetRequestBytes
-procedure defines the size of the current web page being returned to the browser
-in bytes. </P><h2>Return Value</h2><p> None</p><h2>Example</h2><pre> websSetRequestBytes(wp, 1024); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p>
-<A href="websGetRequestBytes.htm">websGetRequestBytes</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestDocFd.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestDocFd.htm deleted file mode 100644 index d8264125de..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestDocFd.htm +++ /dev/null @@ -1,28 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetRequestDocFd -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetRequestDocFd</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><h2>Synopsis</h2><HR><p>Return the document
-file handle for the current web page.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websSetRequestDocFd</b>(webs_t wp, int fd); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="4%">fd <TD WIDTH="96%"> File handle to define.</TD></TR></table><h2>Description</h2><P>The
-websSetRequestDocFd procedure defines a file handle from which to read the web
-page for this browser connection. <h2>Return Value</h2><p>Returns -1 if there
-is no document handle defined, otherwise the handle is returned.</p><h2>Example</h2><pre>
-fd = open("filename", mode, perm);
-websSetRequestDocFd(wp, fd); </PRE><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetRequestBytes.htm">websGetRequestBytes</A>,
-<A href="websGetRequestDocFd.htm">websGetRequestDocFd</A>, <A href="websSetRequestPath.htm">websSetRequestPath</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestFlags.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestFlags.htm deleted file mode 100644 index b770b656d7..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestFlags.htm +++ /dev/null @@ -1,30 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetRequestFlags -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetRequestFlags</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the flags word
-associated with a browser request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetRequestFlags</b>(webs_t wp, int flags); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle
-. <TR> <TD VALIGN="TOP" WIDTH="4%">flags <TD WIDTH="96%"> Flags to define.</TD></TR></table><h2>Description</h2><P>The
-websSetRequestFlags procedure modifies the flags word for a given browser request.
-You must be very careful when defining the flags word for a request. If you need
-to modify a particular flag value, use <A href="websGetRequestFlags.htm">websGetRequestFlags</A>
-to retrieve the current flags word and clear or set specific bits.</P><p>See <A href="websGetRequestFlags.htm">websGetRequestFlags</A>
-for a list of all available flags which are defined in webs.h.</p><h2>Return Value</h2><p>
-None</p><h2>Example</h2><pre>
-websSetRequestFlags(wp,
- websGetRequestFlags(wp, flags) | WEBS_HEADER_DONE));
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websGetRequestFlags.htm">websGetRequestFlags</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestLpath.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestLpath.htm deleted file mode 100644 index d01edee3a1..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestLpath.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetRequestLpath -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetRequestLpath</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Define the local pathname
-to retrieve the web document for the current browser request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetRequestLpath</b>(webs_t wp, char_t *path); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">wp <TD WIDTH="95%">Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="5%">path <TD WIDTH="95%">Local file path name for
-this request.</TD></TR></table><h2>Description</h2><P> The websSetRequestLpath
-procedure defines the local path for the current request. The local path is normally
-a combination of the request directory and the request path and is created by
-the default URL handler.</P><h2>Return Value</h2><p>None</p><h2>Example</h2><pre>
-fmtAlloc(path, "/mydir/%s", websGetRequestPath(wp));
-websSetRequestLpath(wp, path); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p>
-<A href="websGetRequestDir.htm">websGetRequestDir</A>, <A href="websGetRequestPath.htm">websGetRequestPath</A>,
-<A href="websGetRequestLpath.htm">websGetRequestLpath</A>, <A href="websSetRequestPath.htm">websSetRequestPath</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestPath.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestPath.htm deleted file mode 100644 index 68621183cd..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestPath.htm +++ /dev/null @@ -1,30 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetRequestPath -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetRequestPath</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR><h2>Synopsis</h2><p>Set the directory and
-path fields for a request.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetRequestPath</b>(webs_t wp, char_t *dir, char_t *path); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="4%">dir <TD WIDTH="96%">The directory for the request.</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="4%">path <TD WIDTH="96%">The path for the request.</TD></TR>
-</table><h2>Description</h2><P> The websSetRequestPath procedure sets the URL
-directory and path fields which define the location of the web document. Always
-use "/" delimiters in both the directory and path parameters. Do not
-use the "\" path specifier even if your native operating system (e.g.,
-Windows) uses this path separator. </P><h2>Return Value</h2><p>None</p><h2>Example</h2><pre>
-websSetRequestPath(wp, "C:/webdir", "/doc/mypage.htm"); </pre><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetRequestDir.htm">websGetRequestDir</A>,
-<A href="websGetRequestPath.htm">websGetRequestPath</A>, <A href="websGetRequestLpath.htm">websGetRequestLpath</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestWritten.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestWritten.htm deleted file mode 100644 index 83f94229ec..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetRequestWritten.htm +++ /dev/null @@ -1,26 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetRequestWritten -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetRequestWritten</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Set the number of
-bytes written to the browser.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetRequestWritten</b>(webs_t wp, int bytes); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="5%">wp <TD WIDTH="95%">Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="5%">bytes <TD WIDTH="95%"> Number of bytes in page
-written to the browser.</TD></TR></table><h2>Description</h2><P> The websSetRequestWritten
-procedure defines the number of bytes that have been returned to the browser.
-This is used only for record keeping by background write handlers, including the
-default handler. </P><h2>Return Value</h2><p> None</p><h2>Example</h2><pre> websSetRequestWritten(wp,1024);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetRequestBytes.htm">websGetRequestBytes</A>,
-<A href="websSetRequestBytes.htm">websSetRequestBytes</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetVar.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetVar.htm deleted file mode 100644 index 872b39ec41..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websSetVar.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websSetVar -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websSetVar</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Set the value of a
-Form variable.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- void <b>websSetVar</b>(webs_t wp, char_t *var, char_t *value); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="6%">wp <TD WIDTH="94%">Web server connection handle.</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="6%">var <TD WIDTH="94%">The Form variable.</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="6%">value <TD WIDTH="94%">The value for setting the
-variable. </TD></TR> </table><h2>Description</h2><P>The websSetVar procedure defines
-the value of a Form variable. If the variable is already defined, the value is
-updated. The variable is defined only for this web browser connection and its
-<EM>value</EM> must be non-NULL. Values are stored in a fast access symbol table
-using a hash lookup mechanism.</P><h2>Return Value</h2><p>None</p><h2>Example</h2><pre>
-websSetVar(wp, "Name", "Peter Smith"); </pre><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websGetVar.htm">websGetVar</A>,
-<A href="websTestVar.htm">websTestVar</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websTestVar.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websTestVar.htm deleted file mode 100644 index 8e436fa2d8..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websTestVar.htm +++ /dev/null @@ -1,26 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websTestVar -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websTestVar</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Test to see if a Form
-variable is defined.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websTestVar</b>(webs_t wp, char_t *variable); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="6%">wp <TD WIDTH="94%">Web server connection handle.</TD></TR>
-<TR> <TD VALIGN="TOP" WIDTH="6%">variable <TD WIDTH="94%">The variable to test.</TD></TR>
-</table><h2>Description</h2><P>The websTestVar procedure returns TRUE if the specified
-variable is defined in the Form environment table. If the variable is not defined,
-the value of the default is returned.</P><h2>Return Value</h2><p> Returns 1 if
-the variable is defined, otherwise 0 is returned.</p><h2>Example</h2><pre> if (websTestVar(wp, "Wizard") { /* Running as a wizard */ } </pre><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="websExpand.htm">Standard
-form variables</A>, <A href="websSetVar.htm">websSetVar</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlHandlerDefine.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlHandlerDefine.htm deleted file mode 100644 index 5e0d361278..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlHandlerDefine.htm +++ /dev/null @@ -1,47 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websUrlHandlerDefine -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websUrlHandlerDefine</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Define a new URL handler.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websUrlHandlerDefine</b>(char_t *path, int (*fn)(webs_t wp,
- char_t *url, char_t *path, char_t *query), int flags); </pre><h2>Parameters</h2><TABLE WIDTH=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="6%">wp <TD WIDTH="94%">Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="6%">url <TD WIDTH="94%">Request URL. <TR> <TD VALIGN="TOP" WIDTH="6%">path
-<TD WIDTH="94%">Request path portion of the URL. <TR> <TD VALIGN="TOP" WIDTH="6%">query
-<TD WIDTH="94%">Query string portion of the URL.</TD></TR> <TR> <TD VALIGN="TOP" WIDTH="6%">flags
-<TD WIDTH="94%">Specify a sorting value to modify the calling order of the handler.</TD></TR>
-</TABLE><h2>Description</h2><P> The websUrlHandlerDefine procedure adds a new
-URL handler by associating a URL path segment with a processing function. URL
-handlers are called in sorted order beginning with the handlers with longer path
-segments. For example, the handler for "/myUrl" would be called before
-the handler for "/my".</P><P> The flags parameter can specify two special
-sorting values:</P><ul><li>WEBS_HANDLER_FIRST<li>WEBS_HANDLER_LAST</li></ul><P>
-If specified, the flags modify the calling order of the handler. Multiple handlers
-may specify these flags, in which case the order of all the handlers specifying
-WEBS_HANDLER_FIRST is undefined. This is the same for multiple handlers using
-WEBS_HANDLER_LAST.</P><p>A URL handler is a C procedure according to the following
-prototype:</p><pre> int myHandler(webs_t wp, char_t *url, char_t *path, char_t *query); </pre><P>The <i>url</i> parameter contains the entire URL. The <i> path</i>
-parameter holds the URL portion after the hostname and port number. The <i>query</i>
-parameter holds any optional query.</P><p>The URL handler must return 1 if it
-elects to process the URL. Otherwise, it should return 0 to indicate that a later
-URL handler should process the URL. A handler may modify the URL request using
-any of the websSetRequest APIs. In this case, if it returns 0, a subsequent URL
-handler will process the modified request.</p><h2>Return Value</h2><p> Returns
-0 if successful, otherwise it returns -1.</p><h2>Example</h2><pre> int myHandler(webs_t
- wp, char_t *url, char_t *path, char_t *query)
- { /* * Processing here */ return 1; }
- websUrlHandlerDefine("", myHandler,
- WEBS_HANDLER_FIRST); websUrlHandlerDefine
- ("/mypath", myOtherHandler, 0); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websSecurityHandler.htm">websSecurityHandler</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlHandlerDelete.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlHandlerDelete.htm deleted file mode 100644 index 265d7a3f5c..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlHandlerDelete.htm +++ /dev/null @@ -1,42 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websUrlHandlerDelete -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websUrlHandlerDelete</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Delete an existing
-URL handler.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <B>websUrlHandlerDelete</B>(int (*handler)(webs_t wp, char_t *urlPrefix,
- char_t *webDir, int arg, char_t *url, char_t *path, char_t *query)) </pre><h2>Parameters</h2><TABLE WIDTH=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="6%">wp <TD WIDTH="94%">Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="6%">url <TD WIDTH="94%">Request URL. <TR> <TD VALIGN="TOP" WIDTH="6%">path
-<TD WIDTH="94%">Request path portion of the URL.<TR> <TD VALIGN="TOP" WIDTH="6%">query
-<TD WIDTH="94%">Query string portion of the URL.</TD></TR> <TR> <TD VALIGN="TOP" WIDTH="6%">flags
-<TD WIDTH="94%">Specify a sorting value to modify the calling order of the handler.</TD></TR>
-</TABLE><h2>Description</h2><P> The websUrlHandlerDelete procedure deletes existing
-URL handlers. This is useful when you wish to replace a URL handler with a new
-version, such as replacing the security handler.</P><p>If multiple handlers have
-been defined for one function, only the first encountered will be removed.</p><h2>Return
-Value</h2><p> Returns 0 if successful, otherwise returns -1 if the handler was
-not found.</p><h2>Example</h2><pre>
-int myHandler(webs_t wp, char_t *url, char_t *path, char_t *query){
-
-/*
- * Processing here
- */
- return 1;
-}
-
-websUrlHandlerDelete("", myHandler, WEBS_HANDLER_FIRST);
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A HREF="websUrlHandlerDefine.htm">websUrlHandlerDefine</A>, <A href="websSecurityHandler.htm">websSecurityHandler</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlParse.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlParse.htm deleted file mode 100644 index 6a3438b195..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlParse.htm +++ /dev/null @@ -1,43 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websUrlParse -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websUrlParse</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Parse a URL into its
-component parts.</p><h2>Prototype</h2><pre>
- #include "webs.h"
-
- int <B>websUrlParse</B>(char_t *url, char_t **buf, char_t **host,
- char_t **path, char_t **port, char_t **query,
- char_t **proto, char_t **tag, char_t **ext);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="6%">url <TD WIDTH="94%">Source URL to parse.<TR>
-<TD VALIGN="TOP" WIDTH="6%">buf <TD WIDTH="94%">Pointer to buffer used to hold
-the parsed components.<TR> <TD VALIGN="TOP" WIDTH="6%">host <TD WIDTH="94%">Host
-name. <TR> <TD VALIGN="TOP" WIDTH="6%">path <TD WIDTH="94%">URL path portion after
-the host name and optional port. <TR> <TD VALIGN="TOP" WIDTH="6%">query <TD WIDTH="94%">Optional
-query string portion after "?" .<TR> <TD VALIGN="TOP" WIDTH="6%">proto
-<TD WIDTH="94%">Protocol. Usually "http".<TR> <TD VALIGN="TOP" WIDTH="6%">tag
-<TD WIDTH="94%">Optional tag portion after "#".<TR> <TD VALIGN="TOP" WIDTH="6%">ext
-<TD WIDTH="94%">Document file name extension.</TD></TR></table><h2>Description</h2><P>
-The websUrlParse procedure cracks the URL into its constituent components. To
-store the parts, websUrlParse allocates a dynamic buffer. This must eventually
-be freed via <A href="../basicapi/bfree.htm">bfree</A> by the caller.</P><P>websUrlParse
-stores pointers to the URL components in <EM>host, path, port, query, proto, tag
-</EM>and <EM>ext. </EM>If any of these parameters contains NULL, that component
-is ignored.</P><P> <B>Note:</B> Tag parsing is not fully supported.</P><h2>Return
-Value</h2><p> Returns 0 if successful. Returns -1 if memory cannot be allocated
-to hold the results.</p><h2>Example</h2><pre> char_t *host, *port, *buf;
-websUrlParse(url, &buf, &host, NULL, &port, NULL, NULL, NULL, NULL); </pre><h2>Stability
-Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="../basicapi/balloc.htm">balloc</A>,
-<A href="../basicapi/bfree.htm">bfree</A>, <A href="websUrlType.htm">websUrlType</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlType.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlType.htm deleted file mode 100644 index 3f4003648b..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websUrlType.htm +++ /dev/null @@ -1,31 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websUrlType -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websUrlType</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Return the MIME type
-for a given URL.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- char_t *<b>websUrlType</b>(char_t *url, char_t *buf, int bufsize); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="7%">url <TD WIDTH="93%">Source URL to parse.<TR>
-<TD VALIGN="TOP" WIDTH="7%">buf <TD WIDTH="93%"> User supplied buffer to hold
-the mime type. <TR> <TD VALIGN="TOP" WIDTH="7%">bufsize <TD WIDTH="93%">Size of
-buf.</TD></TR></table><h2>Description</h2><P>The websUrlType procedure returns
-the mime type for a given URL by examining the URL document name extension. If
-the mime type is unknown, "text/plain" will be returned.</P><P>When
-using the GoAhead WebServer, the mime types are defined in mime.c. When using
-the GoAhead EMF, they are automatically defined.</P><h2>Return Value</h2><p> Returns
-a pointer to the user supplied buffer in <EM>buf</EM> .</p><h2>Example</h2><pre>
-char_t mimeType[80];
-websUrlType(url, mimeType, sizeof(mimeType));
-if (strcmp(mimeType, "text/plain") == 0) { } </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="websUrlParse.htm">websUrlParse</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websValid.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websValid.htm deleted file mode 100644 index 62f4f30588..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websValid.htm +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websValid -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websValid</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p>Determine if the web
-server connection handle is still open.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websValid</b>(webs_t wp); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.</TD></TR></table><h2>Description</h2><P>The
-websValid procedure returns TRUE if the web server connection handle is valid.
-This is useful for code which runs after an ASP or Form procedure that may close
-the connection by calling <a href="websError.htm">websError</a>. </P><h2>Return
-Value</h2><p> Pointer to a statically allocated string. Do not call <A href="../basicapi/bfree.htm">bfree</A>.</p><h2>Example</h2><pre>
-if (websValid(wp)) { websWrite(wp, "More output");
- } </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="../../../over/asp.htm">Active Server Pages</A>, <A href="../../../over/goforms.htm">GoForms</A>,
-<A href="websDone.htm">websDone</A>, <A href="websFooter.htm">websFooter</A>,
-<A href="websHeader.htm">websHeader</A>, <A href="websWrite.htm">websWrite</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websVar.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websVar.htm deleted file mode 100644 index b35f20dc22..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websVar.htm +++ /dev/null @@ -1,84 +0,0 @@ -<html>
-<head>
-<title>websExpand -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websExpand</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR>
-
-<h2>Synopsis</h2><p>Expand dollar variables in a string.</p><h2>Prototype</h2><pre>
- #include "webs.h"
-
- char_t *<b>websExpand</b>(webs_t wp, char_t *buf, char_t *string, int bufsize);
-</pre><h2>Parameters</h2><p><table width=90%>
- <TR>
- <TD width=40>wp
- <TD> Web server connection handle
- <TR>
- <TD width=40>buf
- <TD>Output buffer
- <TR>
- <TD width=40>string
- <TD> Input string<tr>
- <td width=40 cellpadding = 20>len</td><td cellpadding = 20> Size of output buffer</td></tr></table><h2>Description</h2><P>The websExpand procedure can be used to expand all
-dollar variables. These include all the standard CGI variables, extended GoAhead WebServer variables and all current
-per request variables. In addition to the standard set below, all
-request header variables are stored as "HTTP_name" where name is request header keyword mapped
-to lower case. If a particular dollar variable is not found,
-the original text for that variable is unchanged. </P><P>
-
-
-
- </P><P>If the <EM>buffer</EM> is NULL, the expanded string is
-returned in a dynamically allocated buffer. Use <STRONG>bfree</STRONG>
-
-
-
-to free the buffer when you are finished. </P><P>
-
-
-
- </P><P>
-
- The standard variable set includes: </P><P>
-
- </P><p><table width="90%" border="1">
-<tr><td>COMPANY</td><td>Defined company name</td></tr>
-<tr><td>CONTENT_LENGTH</td><td>Length of posted content</td></tr>
-<tr><td>DBNAME</td><td>Primary database name "primary"</td></tr>
-<tr><td>DESCRIPTION</td><td>Product description</td></tr>
-<tr><td>D_OS</td><td>Operating system name</td></tr>
-<tr><td>D_PROD</td><td>Home directory for the product</td></tr>
-<tr><td>D_SOLUTION</td><td>Home directory for solution packs</td></tr>
-<tr><td>GATEWAY_INTERFACE</td><td>Version of this gateway interface</td></tr>
- <TR>
- <TD>HTTP_AUTHORIZATION
- <TD>Password supplied by the browser
- <TR>
- <TD>HTTP_name
- <TD>Where name is any key name in the browser request
-
-<tr><td>OS</td><td>Operating system</td></tr>
-<tr><td>PATH_INFO</td><td>URL path information after /form</td></tr>
-<tr><td>PATH_TRANSLATED</td><td>File system path name for URL document</td></tr>
-<tr><td>PRODUCT</td><td>Product name</td></tr>
-<tr><td>QUERY_STRING</td><td>Complete query string</td></tr>
-<tr><td>REMOTE_ADDR</td><td>Requesting browsers IP address</td></tr>
-<tr><td>REMOTE_HOST</td><td>Requesting browsers host name</td></tr>
-<tr><td>REQUEST_METHOD</td><td>Request operation type</td></tr>
-<tr><td>SERVER_HOST</td><td>Host name for this web server</td></tr>
-<tr><td>SERVER_PORT</td><td>TCP/IP port used by this web server</td></tr>
-<tr><td>SERVER_URL</td><td>URL to address the home page for this web server</td></tr>
-<tr><td>VERSION</td><td>Version number (n.n) for this product</td></tr>
-<tr><td>VERSION_FULL</td><td>Full version number (n.n.n)</td></tr>
-</table><h2>Return Value</h2><p> Returns the <i>buffer</i> supplied or dynamically allocated
-buffer if <i>buffer</i> was NULL. Return NULL on errors.</p><h2>Example</h2><pre>
-websExpand(wp, NULL, "$COMPANY $SERVER_PORT", -1);
-</pre><h2>See Also</h2><p>bfree</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websWrite.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websWrite.htm deleted file mode 100644 index ce44ec3628..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websWrite.htm +++ /dev/null @@ -1,30 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websWrite -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websWrite</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Write formatted data
-to the user's browser.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websWrite</b>(webs_t wp, char_t *fmt, ...); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="4%">fmt <TD WIDTH="96%">Output format string.<TR>
-<TD VALIGN="TOP" WIDTH="4%">... <TD WIDTH="96%">Variable arguments to supply data
-for the format string.</TD></TR></table><h2>Description</h2><P>The websWrite procedure
-is the primary routine to write formatted data back to the user's browser. It
-can be used within both ASP procedures and Form procedures. It uses a <EM>printf
-</EM>style format string with a variable number of arguments. Data will be immediately
-flushed to the user's browser.</P><h2>Return Value</h2><p> The number of bytes
-actually written.</p><h2>Example</h2><pre> websWrite(wp, "Name %s, Address %s", name, address); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See
-Also</h2><p> <A href="../../../over/asp.htm">Active Server Pages</A>, <A href="../../../over/goforms.htm">GoForms</A>,
-<A href="websDone.htm">websDone</A>, <A href="websFooter.htm">websFooter</A>,
-<A href="websHeader.htm">websHeader</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websWriteBlock.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websWriteBlock.htm deleted file mode 100644 index 294b2952c2..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websWriteBlock.htm +++ /dev/null @@ -1,33 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websWriteBlock -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websWriteBlock</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Write a block of data
-to the user's browser.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websWriteBlock</b>(webs_t wp, char_t *buf, int len); </pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.<TR>
-<TD VALIGN="TOP" WIDTH="4%">buf <TD WIDTH="96%">Buffer containing data to write
-to the browser. <TR> <TD VALIGN="TOP" WIDTH="4%">len <TD WIDTH="96%"> Number of
-characters to write.</TD></TR></table><p></p><h2>Description</h2><P>The websWriteBlock
-procedure writes a block of data back to the user's browser. It can be used within
-both ASP procedures and Form procedures. Data will be immediately flushed to the
-user's browser. (If UNICODE is turned on, buf is expected to contain unicoded
-strings. See <A HREF="websWriteBlockData.htm">websWriteBlockData</A> for writing
-ASCII data in a Unicode environment.) </P><h2>Return Value</h2><p> The number
-of bytes actually written.</p><h2>Example</h2><pre> websWriteBlock(wp, buf, sizeof(buf));
-</pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p> <A href="../../../over/asp.htm">Active
-Server Pages</A>, <A href="../../../over/goforms.htm">GoForms</A>, <A href="websDone.htm">websDone</A>,
-<A href="websFooter.htm">websFooter</A>, <A href="websHeader.htm">websHeader</A>,
-<A href="websWrite.htm">websWrite</A>, <A href="websWriteBlockData.htm">websWriteBlockData</A>
-</p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websWriteBlockData.htm b/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websWriteBlockData.htm deleted file mode 100644 index c35f3c75e7..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/techref/wsapi/websWriteBlockData.htm +++ /dev/null @@ -1,32 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>websWriteBlock -- GoAhead WebServer API</title>
-<link rel="stylesheet" href="../../../style/doc.css" type="text/css">
-</head>
-
-<body>
-<table width="550"> <tr><td>
-<TABLE border=0 width=100% cellspacing=0 cellpadding=0 CLASS="apiTitle"> <TR>
-<td class="titleLeft" align=left width="33%"><b>websWriteBlockData</b></TD><td class="titleCenter" align=center width="33%"><b>
-GoAhead WebServer API</b></TD><td class="titleRight" align=right width="33%"><B>
-GoAhead EMF</B></TD></TR> </TABLE><HR> <h2>Synopsis</h2><p> Write a block of raw
-ASCII or binary data to the user's browser.</p><h2>Prototype</h2><pre> #include "webs.h"
-
- int <b>websWriteBlockData</b>(webs_t wp, char_t *buf, int len);
-</pre><h2>Parameters</h2><table width=100% BORDER="0" CELLPADDING="0" CELLSPACING="0">
-<TR> <TD VALIGN="TOP" WIDTH="4%">wp <TD WIDTH="96%">Web server connection handle.
-<TR> <TD VALIGN="TOP" WIDTH="4%">buf <TD WIDTH="96%">Buffer containing data to
-write to the browser. <TR> <TD VALIGN="TOP" WIDTH="4%">len <TD WIDTH="96%"> Number
-of bytes of data to write.</TD></TR></table><p></p><h2>Description</h2><P>The
-websWriteBlockData procedure writes a block of raw data back to the user's browser.
-It can be used within both ASP procedures and Form procedures. Data will be immediately
-flushed to the user's browser. (See <A HREF="websWriteBlock.htm">websWriteBlock</A>
-if Unicode strings need to be written.) </P><h2>Return Value</h2><p> The number
-of bytes actually written.</p><h2>Example</h2><pre> websWriteBlockData(wp, buf, sizeof(buf)); </pre><h2>Stability Classification</h2><p>Stable.</p><h2>See Also</h2><p>
-<A href="websWriteBlockData.htm">Active Server Pages</A>, <A href="../../../over/goforms.htm">GoForms</A>,
-<A href="websDone.htm">websDone</A>, <A href="websFooter.htm">websFooter</A>,
-<A href="websHeader.htm">websHeader</A>, <A href="websWrite.htm">websWrite</A>,
-<A href="websWriteBlock.htm">websWriteBlock</A> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/RSA.htm b/xbmc/lib/libGoAhead/web/docs/user/RSA.htm deleted file mode 100644 index e4e1e7fa50..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/RSA.htm +++ /dev/null @@ -1,34 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>Incorporating RSA Security</TITLE>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../../style/normal_ws.css">
-</head>
-
-<BODY BGCOLOR="#FFFFFF">
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-<H1>Incorporating RSA Security into WebServer 2.1
-</H1><P> <A HREF="http://rsasecurity.com/" TARGET="new">RSA Security Inc.</A> is a company that specializes in providing e-security solutions. The RSA developer toolkit called, <B>BSAFE SSL-C</B> is a C language interface to an implementation of the SSL protocol. This toolkit also includes patented encryption algorithms used in SSL and can be purchased directly through RSA Security Inc. GoAhead Software does not support the BSAFE toolkit, however, WebServer 2.1 does provide an interface to this toolkit through a file called <B>webSSL.c</B>.</P><P>Once the BSAFE SSL-C toolkit has been installed, the following changes to the platform-specific make file are required:</P><P>1. Add the BSAFE SSL-C include path to the C compiler switches.<BR>2. Define the symbol, WEBS_SSL_SUPPORT in your C compiler switches.<BR>3. Add the websSSL.c file to the list of objects to include in the executable.<BR>4. Add the BSAFE SSL-C library in the list of libraries to link.</P><P>According to the four requirements listed above, the following changes must be made to the Linux-platform make file:</P><PRE># Create the include path:
-SSLINC = /RSASSL/library/include</PRE><PRE># Create the SSL switches
-SSLSW = -DWEBS_SSL_SUPPORT -I$(SSLINC)</PRE>
-<PRE># Create the SSL library link
-SSLLIB = /RSASSL/library/lib/libsslc.a</PRE><PRE># Create the SSL patch file
-SSLPATCHFILE = ../websSSL.c</PRE><PRE># Create the C Flags
-CFLAGS = -DWEBS -DUEMF -DOS="LINUX" -DLINUX $(UMSW) $(DASW) $(SSLSW) </PRE><PRE># Create the Link Flags
-LDFLAGS = $(SSLLIB)</PRE><PRE># Dependency definition for the libwebs.a module archive
-DEPEND_FILES = ../asp.o ../balloc.o ../base64.o ../cgi.o ../default.o \
- ../ejlex.o ../ejparse.o ../form.o \
- ../h.o ../handler.o ../mime.o ../misc.o ../page.o \
- ../ringq.o ../rom.o \
- ../sock.o ../sockGen.o $(SSLPATCHFILE) \
- ../security.o ../sym.o ../uemf.o ../url.o ../value.o \
- ../md5c.o ../um.o ../umui.o ../websda.o ../emfdb.o \
- ../webrom.o ../webs.o ../websuemf.o main.o</PRE>
-<PRE># Dependency definition for websSSL.c
-../websSSL.o: ../websSSL.c ../websSSL.h ../wsIntrn.h ../uemf.h</PRE>
-
-<P>The websSSL.C patch file requires that a support file, <B>server.pem</B>, be located in the run-directory of the WebServer executable. An example of server.pem is included with the BSAFE toolkit. This file contains certificate information used by SSL.</P><P>
-
-</P></TD></TR></TABLE>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/cgi.htm b/xbmc/lib/libGoAhead/web/docs/user/cgi.htm deleted file mode 100644 index 28e2a76698..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/cgi.htm +++ /dev/null @@ -1,19 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>Untitled Document</TITLE>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../../style/normal_ws.css">
-</head>
-
-<BODY BGCOLOR="#FFFFFF">
-<H1>Writing CGI scripts to process Web forms
-</H1><P>CGI is a simple protocol used to
-communicate between Web forms and your program. A CGI script can be
-written in any language that can read STDIN, write to STDOUT, and read
-environment variables. This includes virtually any programming language, including
-C, Perl, or even shell scripting.
-
-</P> The following sites are excellent sources for writing CGI scripts:
-
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/configure.htm b/xbmc/lib/libGoAhead/web/docs/user/configure.htm deleted file mode 100644 index 97b3a9c28d..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/configure.htm +++ /dev/null @@ -1,101 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>Configuring WebServer</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<h1>Configuring GoAhead WebServer</h1><p>To change the default settings and configuration of GoAhead WebServer,
- you will need to modify the Makefile and main program file (main.c) for
- your target operating system (OS). To find out the name of the Makefile
- for your target OS, read your operating system's compile instructions provided in <A HREF="install.htm">Installing GoAhead WebServer</A>. The table below outlines the settings
- and configuration operations available in the current release, as well as
- the file you need to edit to make the change. When editing source files, set your tab stop setting to 4.</p><TABLE WIDTH="550" BORDER="0" ALIGN=Left>
- <TR BGCOLOR="#0066CC" ALIGN="NONE">
- <TD WIDTH="22%" ALIGN="NONE"><B><FONT COLOR='#FFFFFF'>Item</FONT></B></TD><TD WIDTH="66%"><B><FONT COLOR='#FFFFFF'>Description</FONT></B></TD><TD WIDTH="12%"><B><FONT COLOR='#FFFFFF'>File</FONT></B></TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Document Root Directory</B></TD><TD WIDTH="66%">The directory on the server in which Web documents will
- be stored. For example, if you define /web/doc/ as the directory, and
- the URL http://www.yourhost.com/myfile.htm is requested, the Web server
- will return the file myfile.htm located in /web/doc/ (unless the file
- does not exist).</TD><TD WIDTH="12%">main.c</TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Default Server Home Page</B></TD><TD WIDTH="66%">The Web page that is returned when the server is accessed
- by its hostname (e.g., http://www.yourhost.com).</TD><TD WIDTH="12%">main.c</TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Default Directory Index File</B></TD><TD WIDTH="66%">The name of the file that will be returned by default
- when the URL requested is a directory path. For example, if the index
- file is home.htm and the URL requested is http://www.yourhost.com/directory,
- the server will return the file /directory/home.htm.</TD><TD WIDTH="12%">main.c</TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Password</B></TD><TD WIDTH="66%">The password required to access your server</TD><TD WIDTH="12%">main.c</TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Port</B></TD><TD WIDTH="66%">The port that the server will run on.</TD><TD WIDTH="12%">main.c</TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Retries</B></TD><TD WIDTH="66%">The number of times the system will try a different port
- if the specified port is not available.</TD><TD WIDTH="12%">main.c</TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Retrieve from ROM</B></TD><TD WIDTH="66%">Forces GoAhead WebServer to retrieve files from ROM.</TD><TD WIDTH="12%">Makefile</TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Enable Access Logging</B></TD><TD WIDTH="66%">Enables logging of access to your server.</TD><TD WIDTH="12%">Makefile</TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Enable Keep-Alive</B></TD><TD WIDTH="66%">Enables the HTTP 1.1 Keep-Alive feature (persistent connections)</TD><TD WIDTH="12%">Makefile</TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Enable If-Modified-Since</B></TD><TD WIDTH="66%">Enables the HTTP If-Modified-Since request header field.</TD><TD WIDTH="12%">Makefile</TD></TR>
- <TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Enable Memory Leak Logging</B></TD><TD WIDTH="66%">Enables logging of memory and stack statistics for debugging
- purposes. </TD><TD WIDTH="12%">Makefile</TD></TR>
-<TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>User Management </B></TD><TD WIDTH="66%">Enables enhanced password and security features.</TD><TD WIDTH="12%">Makefile</TD></TR>
-<TR BGCOLOR="#FFFFCA" VALIGN="TOP">
- <TD WIDTH="22%" ALIGN="NONE"><B>Digest Access Authentication</B></TD><TD WIDTH="66%">Enables the use of Digest Access Authentication.</TD><TD WIDTH="12%">Makefile</TD></TR>
-</TABLE></td></tr> </table><TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD><H2>User Management </H2><P>To enable the User Management API, which provides the user and security database, set the following compiler define in the Makefile for your target operating system.</P><BLOCKQUOTE><BLOCKQUOTE><P>USER_MANAGEMENT_SUPPORT</P></BLOCKQUOTE></BLOCKQUOTE><P>The code for the user management functions reside in these files: </P><BLOCKQUOTE><P>Um.c, um.h: User management API<BR>Emfdb.c emfdb.h: Database routines</P></BLOCKQUOTE><H2>Digest Access Authentication</H2><P>To enable the use of Digest Access Authentication, which provides encrypted password authentication, set the following compiler define in the Makefile for your target operating system:</P><BLOCKQUOTE><P>DIGEST_ACCESS_SUPPORT</P></BLOCKQUOTE><P>The source code files, websda.c and md5c.c, contain the digest calculation routines. The files, webs.c, webs.h and security.c contain code that is activated when this compiler switch is defined. </P><H2>Document Root Directory</H2><P>The GoAhead WebServer default document root directory is "web", which is
- created under webserver/ when GoAhead WebServer is installed and compiled. To change
- the directory, edit the following portion of code in the Web server's main program
- file (main.c).</P><PRE> *rootWeb = T("web");</PRE><P>Change <TT>web</TT> to the new directory name.</P><H2>Default Server Home Page</H2><P>The GoAhead WebServer default home page is "home.asp". To change the page,
- edit the following portion of code in the Home page handler function located
- in the server's main program file (main.c):</P><PRE> websRedirect(wp, T("home.asp"));</PRE><P>Change <TT>home.asp</TT> to the name of file you want to use as the home page
- and make sure to save the file in the document root directory.</P><H2>Default Directory Index File</H2><P>The GoAhead WebServer default directory index file is set to "default.asp".
- To change the file, edit the following portion of code in the Home page handler
- function located in the server's main program file (main.c):</P><PRE> websSetDefaultPage(T("default.asp"));</PRE><P>Change <TT>default.asp</TT> to the file name you want to use. Note that, if
- a "default.asp" is not found in the directory requested by the browser,
- the server will return a 404 Document Not Found error.</P><H2>Password</H2><P>The default GoAhead WebServer password is blank. In other words, no password is required
- to access the server. To password-protect your server, edit the following portion
- of code in the Home page handler function located in the server's main program
- file (main.c):</P><PRE> *password = T("");</PRE><P>Insert the password you want to use inside the quotation marks.</P><H2>Port</H2><P>GoAhead WebServer runs on port 80 by default. To change the server port, edit the following
- portion of code in the Home page handler function located in the server's main
- program file (main.c):</P><PRE> port = 80;</PRE><H2>Retries</H2><P>By default, GoAhead WebServer retries five times to find an alternative port when the
- default port is not available. To change the number of retries, edit the following
- portion of code in the Home page handler function located in the server's main
- program file (main.c):</P><PRE> retries = 5;</PRE><H2>Retrieve From ROM</H2><P>By default, GoAhead WebServer retrieves Web pages from a file system. To force GoAhead WebServer
- to retrieve Web pages from ROM, set the following compiler define in the Makefile
- for your target operating system.</P><PRE> WEBS_PAGE_ROM</PRE><P><B>Note:</B> This release of GoAhead GoAhead WebServer includes WebCompiler, which
- creates ROMable C source code for a set of Web documents. See the Readme (readme.txt)
- for information on using the compiler.</P><H2>Enable Access Logging</H2><P>To enable logging of access to your server, set the following compiler define
- in the Makefile of your target operating system.</P><PRE> WEBS_LOG_SUPPORT</PRE><P><B>Note:</B> The content and format of the information logged is found in a
- gsnprintf function call within the function websLog located in webs.c.</P><H2>Enable Keep-Alive</H2><P>To enable HTTP 1.1 Keep-Alive support, set the following compiler define in
- the Makefile for your target operating system.</P><PRE> WEBS_KEEP_ALIVE_SUPPORT</PRE><P>The code for this feature has not been fully tested in this release so it may
- required some debugging.</P><H2>Enable If-Modified-Since</H2><P>To enable support for the HTTP If-Modified-Since request header field, set
- the following compiler define in the Makefile for your target operating system.</P><PRE> WEBS_IF_MODIFIED_SUPPORT</PRE><H2>Enable Memory Leak Logging</H2><P>To enable the logging of memory and stack statistics for debugging purposes,
- set the following compiler define in the Makefile for your target operating
- system.</P><PRE> B_STATS</PRE><P>If B_STATS is defined, the memLeaks function, when called, will output the
- balloc (basic allocation) statistics to a file called "leak.txt" in
- the directory from which the GoAhead WebServer executable was launched (webs). In the
- current release, the only call to memLeaks occurs in the main program (main.c)
- when the program does a normal exit. Developers can add the function to other
- appropriate locations to aid in the debugging process.</P><H2>Additional Configuration Notes</H2><H3>UEMF Symbolic Constant</H3><P>Make sure the symbolic constant UEMF is defined in the command line arguments
- to the compiler in the Makefile of the target operating system.</P><H3>Windows CE and UNICODE</H3><P>The symbolic constant UNICODE needs to be defined in the Makefile for Windows
- CE compilations or any other builds that need to use unicoded character strings.</P><H3>Windows 95/98/NT</H3><P>When you run GoAhead WebServer, an icon is added to your Windows Taskbar. You can set
- the title and name of the icon's window by modifying the following two portions
- of code in the main program (main.c).</P><PRE> *title = T("GoAhead GoAhead WebServer");
- *name = T("gowebs");</PRE><H3>VXWORKS</H3><P>You may need to change the CC (compiler), AR (archiver) and LD (linker/loader)
- definitions in the VXWORKS Makefile if you are using a different BSP (Board
- Support Package).</P><P>You will need to change the variable ROOT_DIR in the main program (main.c)
- to reflect the name of the root directory for your file system.</P><P> </P></td></tr><TR BORDERCOLOR="#FFFFFF"><TD> </td></tr> </table>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/install.htm b/xbmc/lib/libGoAhead/web/docs/user/install.htm deleted file mode 100644 index 22494a56de..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/install.htm +++ /dev/null @@ -1,63 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>Installing WebServer</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-
-<h1>Installing GoAhead WebServer
-</h1><P>WebServer 2.1 contains everything needed to compile and run the GoAhead WebServer under WindRiver VxWorks, Windows 95, 98, 2000, NT, CE, LynxOS, LINUX and eCos. </P><P>Before trying to build the GoAhead WebServer, ensure that you have the latest version from GoAhead by checking <A HREF="http://www.goahead.com/webserver" TARGET="new">http://www.goahead.com/webserver</A>. Each supported platform has an operating system subdirectory, which includes a Makefile for building, and a main program for invoking and initializing the GoAhead WebServer.</P><P>To build and run WebServer, change to the relevant operating system directory and use "make" to initiate the build. Some of the make or batch files may need to be modified for the configuration of your system or the target system. See <A HREF="configure.htm">Configuring the GoAhead WebServer</A> for more information.</P><H3>VxWorks</H3><PRE> cd VXWORKS
- setpath
- make</PRE><P>The above commands build for an x86 platform. If you are building for a Power PC 604 platform, use "ppcpath" and "make -f Makefile.ppc" instead. For other platforms, modify setpath.bat to set the PATH environment variable for your development environment and target device. Modify the compiler flags and options in Makefile to build for your specific target device. </P><P>Load webs.o onto the target system and use standard VxWorks procedures to load the program into memory and execute it (load module and task spawn).</P><P>To terminate WebServer on VxWorks so that it can be restarted without being reloaded, send a SIGTERM or SIGKILL signal to the WebServer task by using the "kill" API with signal numbers 15 or 9 respectively. Never use the taskDelete or td APIs when you plan on restarting WebServer.</P><H3>Windows NT</H3><PRE> cd WIN
- nmake /f webs.mak
- webs</PRE><P>To stop the web server, right click on the taskbar icon for the GoAhead WebServer
- and select "Close".</P><H3>Windows 95, 98, and 2000</H3><PRE> cd WIN
- setpath ( NOTE: Users of Visual Studio 6.0 may not
- need to use this command to set
- their environment path. )
- nmake /f webs.mak
- webs</PRE><BLOCKQUOTE><P>Modify setpath.bat to set PATH environment variable for your development environment.</P><P>To stop WebServer, right click on the taskbar icon for the
-GoAhead WebServer and select "Close".</P></BLOCKQUOTE><P><FONT FACE="Arial"><B>For users of Microsoft Visual Studio:</B></FONT></P><BLOCKQUOTE><OL><LI><FONT FACE="Arial">Open MS C++.</FONT></LI><LI><FONT FACE="Arial">Open the provided workspace and select File|Open Workspace.</FONT></LI><LI><FONT FACE="Arial">Navigate to the directory where you unzipped the WebServer files (i.e., E:\webserver\win\webs.dsw).</FONT></LI><LI><FONT FACE="Arial">Click the 'Open' button.</FONT></LI><LI><FONT FACE="Arial">Select 'build webs.exe' from the Build Menu. </FONT></LI><LI> The following should appear in the bottom window:<BR><BR><P>--------------------Configuration: webs - Win32<BR>Debug-------------------------------<BR>webs.exe - 0 errors(s), 0 warning(s)</P></LI><LI><BLOCKQUOTE><P></P></BLOCKQUOTE><OL START="7"><LI>From the Build Menu, select 'Execute webs.exe' . The 'GoAhead WebServer' button should now appear on the taskbar. </LI><LI>Follow the instructions provided in "<A HREF="running.htm">Accessing the WebServer Home Page</A>". </LI><LI>If SSL support is required, these additional steps are necessary:</LI></OL><BLOCKQUOTE><OL><LI TYPE="a">Add the webSSL.c file to the list of program files.</LI><LI>Add WEBS.SSL_SUPPORT to the preprocessor definitions of the project settings.</LI><LI>Add the include path of the RSA package to the additional include directories.</LI><LI>Add the library path of the RSA package to the additional library paths.</LI><LI>Add the RSA library file name to the library modules. </LI></OL><BLOCKQUOTE><P> </P></BLOCKQUOTE></BLOCKQUOTE></LI></OL></BLOCKQUOTE><P><B>Note for users of Microsoft Visual C++:</B></P><BLOCKQUOTE><P>If you see the following Setup Environment Variables message after
-installing Visual C++, use the Visual C++ instructions provided below <B>BEFORE</B> building and running GoAhead
-WebServer. </P><P><B>Setup Environment Variables message:</B></P><BLOCKQUOTE><P>"For your convenience, the environment variables required to
- run build tools from a command prompt are saved in the VCVARS32.BAT file in your BIN
- directory."</P></BLOCKQUOTE><P><B>Visual C++ Instructions:</B></P><P>1. Copy the VCVARS32.BAT file to your root directory (usually C:\).<BR>
-2. Add the file's path name to your AUTOEXEC.BAT file.<BR>
-3. Reboot your System.</P></BLOCKQUOTE><H3>Windows CE</H3><P>Either of two different methods may be used to build the Windows CE WebServer: </P><BLOCKQUOTE><P>Using build.bat:</P><OL><LI>In the WebServer build.bat file (CE/build.bat), ensure that the "set PATH" statement is correct, and that both the include and library files paths are correct.</LI><LI>Ensure that all compiler flags are set correctly.<BR><BR><B>Note</B>: You can get the correct flag settings for each processor from within Visual C++. Set your project to build against the target SDK. Access the compiler settings from the menu bar. Choose Project, Settings, and the C/C++ tab. The textbox labeled "Preprocessor definitions" lists the compiler settings. </LI><LI>Run the build.bat file. </LI><LI>Load webs.exe and your web pages on to your CE device
- using your normal procedures to transfer files to the device. The default location for the
- web pages is in the \web directory. This can be modified in main.c. Using precompiled and
- linked pages (see WEBS_PAGE_ROM and WebCompiler below) makes it easy to load the
- application and its pages to the system in one step. </LI></OL></BLOCKQUOTE><BLOCKQUOTE><P>Using Microsoft's C++ Visual Studio: </P></BLOCKQUOTE><OL><OL><LI>In Microsoft Visual C++, Visual Studio, open the workspace webs.dsw in
- the CE subdirectory.</LI><LI>Set the include and library paths properly for your device. <BR>Be sure
- the symbolic constants CE, UEMF, WEBS, and UNICODE are defined. </LI><LI>Use the build facilities of
- Visual Studio to generate webs.exe. </LI><LI>Load webs.exe and your web pages on to your CE device
- using your normal procedures to transfer files to the device. The default location for the
- web pages is in the \web directory. This can be modified in main.c. Using precompiled and
- linked pages (see WEBS_PAGE_ROM and WebCompiler below) make it easy to load the
- application and its pages to the system in one step. </LI></OL></OL><BLOCKQUOTE><P><B>Note:</B> By default, user management and digest access are not added when WebServer compiles. If these features are desired, set the proper flags in the build.bat file.</P></BLOCKQUOTE><H3>UNIX (SCO OpenServer V)</H3><PRE> CD SCOV5
- make
- su ;# As super user
- webs</PRE><H3>LINUX</H3><PRE> CD LINUX
- make
- su ;# As super user
- ./webs</PRE><H3>LYNX</H3><PRE> CD LYNX
- make
- su ;# As super user
- ./webs</PRE><H3>eCos</H3><PRE> CD ECOS
- make
- su ;# As super user
- webs</PRE><H3>QNX</H3><PRE> CD QNX4
- make
- su ;# As super user
- webs
-</PRE><H2>SSL Installation</H2><P>For SSL installation information, refer to <A HREF="RSA.htm">Incorporation RSA Security into WebServer 2.1</A> in the Getting Started Guide. </P><OL></OL><H2>User Management</H2><P>The user management and access limit configuration is stored in a file called umconfig.txt. This file is created when the user management configuration is saved by exercising the "SaveUserManagement" GoForm through the savecfg.asp web page. The umconfig.txt file is not provided in this distribution.</P><P>In order to provide the out-of the-box user management forms in a web-site, the following files may be included:</P><TABLE WIDTH="96%" BORDER="1"><TR><TD><B>File</B></TD><TD><B>Calls GoForm</B></TD><TD><B>Description</B></TD></TR><TR><TD>adduser.asp</TD><TD>AddUser</TD><TD>Add a user</TD></TR><TR><TD>deluser.asp</TD><TD>DeleteUser</TD><TD>Delete a user</TD></TR><TR><TD>addgroup.asp</TD><TD>AddGroup</TD><TD>Add a user group</TD></TR><TR><TD>delgroup.asp</TD><TD>DeleteGroup</TD><TD>Delete a user group</TD></TR><TR><TD>addlimit.asp</TD><TD>AddAccessLimit</TD><TD>Add a URL Access Limit</TD></TR><TR><TD>dellimit.asp</TD><TD>DeleteAccessLimit</TD><TD>Delete a URL Access Limit
-
-savecfg</TD></TR><TR><TD>savecfg.asp</TD><TD>SaveUserManagement</TD><TD>Save the user configuration to the umconfig.txt file.</TD></TR><TR><TD>loadcfg.asp</TD><TD>LoadUserManagement</TD><TD>Load the user configuration from the umconfig.txt file.</TD></TR></TABLE><P>The GoForms described above can be found in the source file, "umui.c". This source file is compiled into the webs executable by default.</P><H2>Standard CGI Implementation</H2><P>The cgitest.c file is a sample CGI program that creates and HTML page that displays the CGI environment variables. This source-code module is stand-alone, meaning that no other source files are required to generate an executable (with the exception of "stdio.h").</P><P> </P></TD></TR><TR BORDERCOLOR="#FFFFFF"><TD> </TD></TR></TABLE>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/manage.htm b/xbmc/lib/libGoAhead/web/docs/user/manage.htm deleted file mode 100644 index 77b9daddc5..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/manage.htm +++ /dev/null @@ -1,17 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>Managing Users</TITLE>
-<LINK REL="stylesheet" HREF="../../style/normal_ws.css" TYPE="text/css">
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-</HEAD>
-
-<BODY BGCOLOR="#FFFFFF">
-
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-
-<H1>Managing Users
-</H1><BLOCKQUOTE><UL><LI><A HREF="management/overview.htm">User Management Overview</A></LI><LI><A HREF="management/setup.htm">Configuring User Profiles</A></LI><LI><A HREF="management/webInterface.htm">Using the Web Interface </A></LI><LI><A HREF="management/configFile.htm">Editing the Configuration File</A></LI></UL><P> </P></BLOCKQUOTE><P> </P><P></P><P>
-</P></TD></TR></TABLE>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/management/configFile.htm b/xbmc/lib/libGoAhead/web/docs/user/management/configFile.htm deleted file mode 100644 index 0fd6c496b2..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/management/configFile.htm +++ /dev/null @@ -1,48 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>User Management Configuration File</TITLE>
-<LINK REL="stylesheet" HREF="../../../style/normal_ws.css" TYPE="text/css">
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-</HEAD>
-
-<BODY BGCOLOR="#FFFFFF">
-
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-
-<H1>Editing the User Configuration File
-</H1><P>The data for User Management configuration is stored by default in a file called "umconfig.txt". Although it is not recommended, you can use a text editor to modify this file; however, you should use the User Management C function set of the Web Server application, or the web-based user interface supplied as an example, for manipulating the user configuration data.</P><H2>The Key-Value Pair</H2><P>Data is stored in the text file as Key-Value pairs with the following format:</P><BLOCKQUOTE><BLOCKQUOTE><PRE>KEY=VALUE</PRE></BLOCKQUOTE></BLOCKQUOTE><P>Where <FONT FACE="Courier New, Courier, mono">KEY</FONT> is the name of the data element, and <FONT FACE="Courier New, Courier, mono">VALUE</FONT> is the data for the data element. Each Key-Value pair is on its own line, and contains an equals-sign character ("=") to separate the key and the value.</P><H2>The TABLE Directive</H2><P>The <FONT FACE="Courier New, Courier, mono">TABLE</FONT> key-value pair indicates a new data table. The value for <FONT FACE="Courier New, Courier, mono">TABLE</FONT> is the table name. All data in the text file following the <FONT FACE="Courier New, Courier, mono">TABLE</FONT> directive pertains to the table defined in the table name, until either another <FONT FACE="Courier New, Courier, mono">TABLE</FONT> directive or the end of the file is found.</P><H2>The ROW Directive</H2><P>The <FONT FACE="Courier New, Courier, mono">ROW</FONT> key-value pair indicates the beginning of row data for a new data record. The value for <FONT FACE="Courier New, Courier, mono">ROW</FONT> is the row number, although these are not used by the database. All data in the text file following the <FONT FACE="Courier New, Courier, mono">ROW</FONT> directive pertains to the new row that is created by the <FONT FACE="Courier New, Courier, mono">ROW</FONT> directive, until either another <FONT FACE="Courier New, Courier, mono">ROW</FONT> directive or the end of the file is found.</P><H2> Raw User Configuration Data Example</H2><BLOCKQUOTE><PRE>TABLE=users
-ROW=0
-name=admin
-password=KZasF
-group=administrators
-prot=0
-disable=0
-ROW=1
-name=user
-password=qwerty
-group=users
-prot=0
-disable=0
-TABLE=groups
-ROW=0
-name=administrators
-priv=4
-method=3
-prot=0
-disable=0
-ROW=1
-name=users
-priv=1
-method=1
-prot=0
-disable=0
-TABLE=access
-ROW=0
-name=/adduser.asp
-method=3
-secure=0
-group=administrators</PRE></BLOCKQUOTE><P></P><P>
-</P></TD></TR></TABLE>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/management/overview.htm b/xbmc/lib/libGoAhead/web/docs/user/management/overview.htm deleted file mode 100644 index 7b354bd433..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/management/overview.htm +++ /dev/null @@ -1,17 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>User Management Overview</TITLE>
-<LINK REL="stylesheet" HREF="../../../style/normal_ws.css" TYPE="text/css">
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-</HEAD>
-
-<BODY BGCOLOR="#FFFFFF">
-
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-
-<H1>User Management Overview
-</H1><P>For a totally password protected site ( typical for remote management applications), it is desirable to have multiple user IDs with multiple security levels. The web server would have known users, who would enter passwords to obtain web server access. In addition, individual pages or groups of pages on the web server may have special security requirements.</P><H2>Access Authentication</H2><P>Whenever a web browser attempts to access a page on a server that requires a user ID and password, a browser and server dialog begins that is called "Access Authentication". Two kinds of Access Authentication are used: Basic (BAA) and Digest (DAA). </P><P>The web browser presentation for Digest Access Authentication is the same as for Basic Access Authentication: the user typically is prompted for a user ID and password before obtaining access to a URL. The difference between the two is behind the scenes. In the case of Basic Access, passwords are sent as clear text. Digest Access is different in that a "digest" is sent, typically created by the RSA Data Security, Inc. MD5 Message-Digest Algorithm that takes the user ID, the password and a "realm value" as arguments.</P><P>In WebServer 2.1, both types of Access Authentication are supported. URL pages can have an "Access Method" associated with them that determines how the page is accessed. These are as follows:</P><BLOCKQUOTE><P> <B>NONE</B> - the URL page cannot be accessed.<BR> <B>FULL</B> - the URL can always be accessed, without authentication.<BR> <B>BASIC</B> - BAA is required before the page can be accessed.<BR> <B>DIGEST</B> - DAA is required before the page can be accessed.</P></BLOCKQUOTE><H2>Users </H2><P>The user management configuration database contains a user table containing user records with these data elements:</P><BLOCKQUOTE><P> <B>User ID</B> - uniquely identifies a user<BR> <B>User Password</B> - encrypted in local storage<BR> <B>User Group</B> - determines a user's access rights<BR> <B>Protected</B> - determines if the user record can be deleted<BR> <B>Enabled</B> - determines if the user record can be used</P></BLOCKQUOTE><H2> User Groups </H2><P>The user management configuration database contains a table for user groups with the following data elements:</P><BLOCKQUOTE><P><B>Group Name</B> - uniquely identifies a group (e.g.; "administrators" or "guests").<BR><B>Privileges</B> - can be one or more of none, read-files, execute-files, and administrate<BR><B>Default Access Method</B> - determines the access method for members of this group<BR><B>Protected</B> - determines if the user record can be deleted<BR><B>Enabled</B> - determines if the user record can be used</P></BLOCKQUOTE><H2>URL Access Limits</H2><P>The user management configuration database contains a table for URL access limits. Access Limits are used when certain directories or URL pages on the web site have exceptionally secure access limits. If a directory has an access limit associated with it, its contents will have the same access limit as the directory, unless there is a specific access limit for a specific page.</P><P>Access Limits have these data elements:</P><P><B>URL Name</B> - defines the file path of the web page or directory<BR><B>Default Access Method</B> - determines how the page should be accessed<BR><B>Encryption Required</B> - determines if the page should be transmitted encrypted<BR><B>User Group</B> - optionally limits access to the page to a specific user group</P><H2>User Management and Access to URLs</H2><P>When a page is requested, WebServer will check to see if there is a URL Access Limit assigned for the requested page. If an Access Limit is found, then the following checks are made:</P><P>If no user group is assigned to the access limit, then the default access method takes effect. In this case, the web server takes these actions:</P><BLOCKQUOTE><P> If Default Access Method is NONE, respond with a File not Found header.<BR> If Default Access Method is FULL, returns the requested page.<BR> If Default Access Method is BASIC or DIGEST and there is a user ID and password in the request that check out, returns the requested page. Otherwise, it returns an Authenticate Response Header.</P></BLOCKQUOTE><P>If there is a user group assigned to the access limit, then the previous actions would be taken, but would use the group's access method for the requested page.</P><P>
-</P></TD></TR></TABLE>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/management/setup.htm b/xbmc/lib/libGoAhead/web/docs/user/management/setup.htm deleted file mode 100644 index 75fcbc28d4..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/management/setup.htm +++ /dev/null @@ -1,16 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>User Management Setup</TITLE>
-<LINK REL="stylesheet" HREF="../../../style/normal_ws.css" TYPE="text/css">
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-</HEAD>
-
-<BODY BGCOLOR="#FFFFFF">
-
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-
-<H1>User Management Setup</H1><H2>Creating the Administrator</H2><P>An Administrator has access rights to create and administer users and security. It is best to create and configure the administrator before performing user management. By default, the WebServer has no security data. The user configuration data can be created using the <A HREF="webInterface.htm">Web Interface</A> or using the <A HREF="configFile.htm">User Management C function API</A>.</P><P> To create an administrator user:</P><OL><OL><LI>Create an "Administrators" User Group. <BR>Give this group all privileges and the default access method of <B>DIGEST</B>.</LI><LI>Create an "Admin" user. <BR>This user must belong to the "Administrators" group created in the previous step. The "Admin" must also be enabled and protected (the web Interface does not permit adding delete-protected users).</LI></OL></OL><H2>Creating Access Limits</H2><P>Once you have created the administrator user and user groups, it is a good idea to create Access Limits for the user management web pages. Use the Add Access Limit function (either with the Web Interface menu item, or using the User Management C API) to create Access Limits. </P><H2> Creating Users </H2><P>Once you have created the administrator user, user groups and access limits, you can use the Add User function (either through the Web Interface menu , or using the User Management C API) to create users.</P><P>
-</P></TD></TR></TABLE>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/management/webInterface.htm b/xbmc/lib/libGoAhead/web/docs/user/management/webInterface.htm deleted file mode 100644 index 204df662cf..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/management/webInterface.htm +++ /dev/null @@ -1,17 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>User Management Web Interface</TITLE>
-<LINK REL="stylesheet" HREF="../../../style/normal_ws.css" TYPE="text/css">
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-</HEAD>
-
-<BODY BGCOLOR="#FFFFFF">
-
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-
-<H1>User Management Interface
-</H1><P>The password protected User Administration page for WebServer contains a <B>data area</B> and a <B>menu bar</B>. The data area may contain documentation, but it may also contain a data entry pane. Selecting User Configuration menu items in the menu bar accesses the User Management data entry panes.</P><P> Data-entry panes have two operation buttons: <B>OK</B> and <B>Cancel</B>. </P><UL><UL><LI>The OK button affects any changes entered by the user and then displays a confirmation message. </LI><LI>The Cancel button indicates that an action was cancelled.</LI></UL></UL><P>All user configuration menu options call up active server pages (".asp" files) that call GoAhead WebServer GoForm functions.</P><H2> Add User </H2><P>The Add User option calls up the URL, "adduser.asp". This Add User data entry pane contains these fields:</P><BLOCKQUOTE><P> <B>Name</B> - enter the ID of the user in this text field<BR><B>Group</B> - select a user group from this list for the user<BR><B>Enabled</B> -ensure that the Check box is checked to enable the user<BR><B>Password</B> - secure text field (displays asterisks)<BR><B>Confirm Password</B> - secure text field</P></BLOCKQUOTE><H2>Delete User </H2><P>The Delete User option calls up the URL, "deleteuser.asp". The Delete User data entry pane provides this field:</P><BLOCKQUOTE><P> <B>Name</B> - Select from this list the user to be deleted</P></BLOCKQUOTE><P>Pressing the OK button deletes the selected user and the list of existing users is updated.</P><H2>Add Group </H2><P>The Add Group option calls up the URL, "addgroup.asp". The Add Group data entry pane contains these fields:</P><BLOCKQUOTE><P> <B>Name</B> - enter the name of the group in this text field.<BR> <B>Privileges</B> - select privileges from this list to assign to the group<BR> <B>Access Method</B> - select the default access method from this list to assign to the group<BR> <B>Enabled</B> - ensure that the Check box is selected to enable the user group</P></BLOCKQUOTE><H2>Delete Group </H2><P>The Delete Group option calls up the URL, "deletegroup.asp". The Delete Group data-entry pane provides this field:</P><BLOCKQUOTE><P> Name - use the provided list to select a user group for deletion</P></BLOCKQUOTE><P> Pressing the OK button deletes the selected user group then updates the user group list.</P><H2> Add Access Limit </H2><P>The Add Access Limit option calls up the URL, "addlimit.asp". The Add Access Limit data entry pane box provides the following fields:</P><BLOCKQUOTE><P> <B>URL</B> - enter the URL path to the page or the directory in this text field<BR> <B>Access Method</B> - select the default access method from this list to assign to the group<BR> <B>Privileges</B> - select the group (optional) to assign to the URL<BR> <B>Secure</B> - select this check box if you require data encryption for this URL</P></BLOCKQUOTE><H2>Delete Access Limit </H2><P>The Delete Access Limit option calls up the URL, "deletelimit.asp". The Delete Group data entry pane provides this field:</P><BLOCKQUOTE><P> <B>URL</B> - select an access limit for the given URL to be deleted.</P></BLOCKQUOTE><P>Pressing the OK button deletes the selected URL then updates the list of existing access limits.</P><H2> Restore the User Configuration</H2><P>This menu option calls up the URL, "restoreconfig.asp". The Restore User Configuration data entry pane contains no data fields. Pressing the OK button replaces the current User Management configuration with the user configuration data previously saved. If no data has been saved, then the user configuration data will be deleted. Data is persisted to the file named "umconfig.txt".</P><H2> Save the User Configuration</H2><P>This menu option calls up the URL, "restoreconfig.asp". The Restore User Configuration data entry pane contains no data fields. Pressing the OK button replaces the current User Management configuration with the user configuration data previously saved. If no data has been saved, then the user configuration data will be deleted. Data is persisted to the file named "umconfig.txt".</P><P>
-</P></TD></TR></TABLE>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/running.htm b/xbmc/lib/libGoAhead/web/docs/user/running.htm deleted file mode 100644 index 1b4990ec07..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/running.htm +++ /dev/null @@ -1,13 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>Building and Running WebServer</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<table width="550"><tr><td>
-<h1>Accessing the GoAhead WebServer</h1><P>To access the GoAhead WebServer home page:</P><BLOCKQUOTE><P>1. Launch your browser on the same system as WebServer.</P><P>2. Launch GoAhead WebServer using web.exe (located in folder for your OS, i.e., WIN).</P><P> <B>Note</B>: WebServer icon should now appear in the taskbar.</P><P>3. In the browser address field enter "http://<yourhostname>" or <BR> "http://<yourIPaddress>".</P><P> <B>Note</B>: defaults to port 80. Otherwise use "http://xxxxxxx:yy" where "yy" is <BR> the correct port number.</P><P>To determine your system's host name or IP address, at the command prompt type<BR>either "hostname" <enter> or "ipconfig" <enter> (for Win95, instead use "winipcfg" to see the IP address). </P><P>4. The server's default home page is home.asp. </P><P> </P></BLOCKQUOTE><P> </P><P> </P></td></tr> </table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/user/trouble.htm b/xbmc/lib/libGoAhead/web/docs/user/trouble.htm deleted file mode 100644 index f70adb628e..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/user/trouble.htm +++ /dev/null @@ -1,13 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>Troubleshooting WebServer</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<table width="550"><tr><td>
-<h1>Troubleshooting GoAhead WebServer</h1><p>For assistance with any WebServer problem or question, please contact GoAhead's on-line customer support center at <A HREF="http://goahead.custhelp.com/cgi-bin/goahead" TARGET="new">http://goahead.custhelp.com/cgi-bin/goahead</A>. Here you can access GoAhead's collection of WebServer FAQs or search through GoAhead's solution database and see how similar issues were resolved. Additional help can also be obtained by contacting the GoAhead WebServer User Group at <A HREF="news://news.goahead.com/goahead.public.webserver" TARGET="new">news://news.goahead.com/goahead.public.webserver</A>. If , after contacting these two sources, your issue remains unresolved, please email GoAhead at <A HREF="mailto:webserver@goahead.com">webserver@goahead.com</A>. </p><P> </P><p> </p></td></tr> </table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/docs/usersguide.htm b/xbmc/lib/libGoAhead/web/docs/usersguide.htm deleted file mode 100644 index 570fff3d51..0000000000 --- a/xbmc/lib/libGoAhead/web/docs/usersguide.htm +++ /dev/null @@ -1,36 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>Getting Started Guide</TITLE>
-<LINK REL="stylesheet" HREF="../style/normal_ws.css" TYPE="text/css">
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-</HEAD>
-
-<BODY BGCOLOR="#FFFFFF">
-
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-
-<H1>WebServer Getting Started Guide
-</H1><P>The GoAhead WebServer is an open standard web server that is compliant with all
- necessary standards to be an effective embedded web server. GoAhead WebServer, release 2.1, supports the following platforms:
-</P><BLOCKQUOTE><UL><LI>Windows 2000
-</LI><LI>Windows 98
-</LI><LI>Windows 95 </LI><LI>
-Windows NT</LI><LI>
-Windows CE
-</LI><LI>VxWorks 5.3.1
-</LI><LI>VxWorks 5.4</LI><LI>LynxOS
-</LI><LI>LINUX
-UNIX - SCO OpenServer 3.2V5.0.0</LI><LI>eCos</LI></UL></BLOCKQUOTE><P>The latest release of GoAhead WebServer is always available as a ZIP file for download on GoAhead's Website at
- <A HREF="http://www.goahead.com/webserver/wsregister.htm" TARGET="new">http://www.goahead.com/webserver/wsregister.htm</A>. In order to download the file you must first fill out our online
- registration form. Please provide complete and accurate information.
-
- After downloading the file, unzip it to a local drive on your system. Unzipping the file creates a root directory, "webserver",
- and sub-directories for each supported platform.</P><P>
-
- Read the GoAhead WebServer Readme (<A HREF="readme.txt">readme.txt</A>), Release Notes (<A HREF="release.htm">release.htm</A>) and License (<A HREF="license.txt">license.txt</A>) for the latest
- information on the release. For aditional information on installing GoAhead WebServer,
- refer to the following sections of this Getting Started Guide:</P><UL><LI><A HREF="user/install.htm">Installing GoAhead WebServer</A></LI><LI><A HREF="user/configure.htm">Configuring GoAhead WebServer</A></LI><LI><A HREF="user/running.htm">Accessing Your GoAhead WebServer</A></LI><LI><A HREF="user/RSA.htm">Incorporation RSA Security BSAFE SSL-C</A> </LI><LI><A HREF="user/manage.htm">Managing Users </A></LI><LI><A HREF="user/trouble.htm">Troubleshooting GoAhead WebServer</A></LI></UL><P> </P><P> </P><P></P><P>
-</P></TD></TR></TABLE>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/dspuser.asp b/xbmc/lib/libGoAhead/web/dspuser.asp deleted file mode 100644 index 3e38424ffa..0000000000 --- a/xbmc/lib/libGoAhead/web/dspuser.asp +++ /dev/null @@ -1,28 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 2000-2000. All Rights Reserved. ->
-<head>
-<title>Display a User</title>
-<meta http-equiv="Pragma" content="no-cache">
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-<h1>Display a User</h1>
-<form action=/goform/DisplayUser method=POST>
-
-<table>
-<tr>
-<% MakeUserList(); %>
-</tr>
-<tr>
- <td></td>
- <td ALIGN="CENTER">
- <input type=submit name=ok value="OK" title="Display the User"> <input type=submit name=ok value="Cancel"></td>
-</tr>
-</table>
-
-</form>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/forms.asp b/xbmc/lib/libGoAhead/web/forms.asp deleted file mode 100644 index ee275f9cb4..0000000000 --- a/xbmc/lib/libGoAhead/web/forms.asp +++ /dev/null @@ -1,30 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 2000-2000. All Rights Reserved. ->
-<head>
-<title>GoForm Test</title>
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-<h1>GoForm Test</h1>
-<form action=/goform/formTest method=POST>
-
-<table>
-<tr>
- <td>Name:</td><td><input type=text name=name size=50 value=""></td>
-</tr>
-<tr>
- <td>Address:</td><td><input type=text name=address size=50 value=""></td>
-</tr>
-<tr>
- <td></td>
- <td ALIGN="CENTER">
- <input type=submit name=ok value="OK"> <input type=submit name=ok value="Cancel"></td>
-</tr>
-</table>
-
-</form>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/glossary/wsglossary.htm b/xbmc/lib/libGoAhead/web/glossary/wsglossary.htm deleted file mode 100644 index 4fcc7cac0e..0000000000 --- a/xbmc/lib/libGoAhead/web/glossary/wsglossary.htm +++ /dev/null @@ -1,240 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>WebServer Glossary</TITLE>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-
-</HEAD>
-
-<BODY>
-
-<TABLE WIDTH="550" BORDER="0"><TR><TD>
-<H1>WebServer Glossary<A NAME="top"></A></H1><TABLE BORDER="0" WIDTH="456">
-<TR valign=top><TD><DL compact>
-
-<DT><A HREF="#asp">active server pages</A></DT><DT> <A HREF="#algorithm">algorithm</A> </DT><DT><A HREF="#ASCII">ASCII</A></DT><DT><A HREF="#authentication">authentication</A></DT><DT><A HREF="#basicauthentication">basic authentication</A></DT><DT><A HREF="#bandwidth">bandwidth</A></DT><DT><A HREF="#browser">browser</A> </DT><DT><A HREF="#certificate">certificate</A></DT><DT><A HREF="#cipher">cipher</A></DT><DT><A HREF="#ciphertext">ciphertext</A></DT><DT><A HREF="#client-server">client-server</A>
-</DT><DT><A HREF="#CGI">CGI</A></DT><DT><A HREF="#digestauthentication">digest access</A></DT><DT><A HREF="#digestauthentication"> authentication </A><A HREF="#digestauthentication">(DAA)</A></DT><DT><A HREF="#domainname">domain name</A> </DT><DT><A HREF="#DNS">DNS</A></DT></DL></TD><TD>
-
-<DL compact><DT><A HREF="#embeddedwebserver">embedded web server</A> </DT><DT><A HREF="#encryption">encryption</A></DT><DT><A HREF="#FAQ">FAQ</A>
-</DT><DT><A HREF="#FTP">FTP</A></DT><DT><A HREF="#gateway">gateway</A></DT><DT><A HREF="#host">host</A></DT><DT><A HREF="#hostname">hostname</A></DT><DT><A HREF="#HTML">HTML</A></DT><DT><A HREF="#HTTP">HTTP</A></DT><DT><A HREF="#HTTPS">HTTPS</A></DT><DT><A HREF="#hypertext">hypertext</A></DT><DT><A HREF="#InternetExplorer">Internet Explorer</A>
-</DT><DT><A HREF="#Intranet">Intranet</A></DT><DT><A HREF="#IP">IP</A></DT><DT><A HREF="#IPaddress">IP address</A> </DT><DT><A HREF="#ISP">ISP</A></DT></DL></TD><TD><DL compact><DT><A HREF="#Javascript">Javascript</A></DT><DT><A HREF="#Javascript"></A><A HREF="#LAN">LAN</A></DT><DT><A HREF="#NetscapeNavigator">Netscape Navigator</A></DT><DT><A HREF="#proxyserver">proxy server</A> </DT><DT><A HREF="#router">router</A></DT><DT><A HREF="#securitycertificate">security certificate</A> </DT><DT><A HREF="#server">server</A></DT><DT><A HREF="#SSI">SSI</A></DT><DT><A HREF="#SSL">SSL</A></DT><DT><A HREF="#TCPIP">TCP/IP</A> </DT><DT><A HREF="#TLS">TLS</A></DT><DT><A HREF="#URL">URL</A></DT><DT><A HREF="#WebPage">Web Page</A></DT><DT><A HREF="#WebServer">Web Server</A></DT><DT><A HREF="#WWW">WWW</A></DT></DL></TD></TR>
-</TABLE><P><B>active server pages</B> (ASP)<A NAME="asp"></A><BR>A standard developed by Microsoft to serve web pages with dynamic content. An ASP document has a ".asp" extension and uses embedded scripting to insert dynamic data into the page before it is sent to the user's browser.
-</P><BLOCKQUOTE><P><A HREF="#top">return</A>
-</P></BLOCKQUOTE><P><B>algorithm<A NAME="algorithm"></A></B><BR>
-A formula or set of rules for solving a problem in a finite number of steps. Algorithms for encryption are called ciphers. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>ASCII</B>
- <A NAME="ASCII"></A>(American standard code for information interchange)<BR>The defacto worldwide standard for code
-
-numbers that represent all of the upper and lowercase Latin letters,
-
-numbers, punctuation, and other characters. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>authentication<A NAME="authentication"></A>
-</B><BR>The positive identification of a network entity such as a server, client, or user. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>basic authentication<A NAME="basicauthentication"></A></B><BR>A method for a server to verify the identity of a client making a request for a document. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>bandwidth<A NAME="bandwidth"></A></B><BR>
-Indicates the transmission or processing capacity of a system. Network systems need higher bandwidth for audio or video than for e-mail or other services.
-
-The two types of bandwidth are <I>broadband</I>, used for complex
-
-telecommunications, and <I>narrowband</I>, which is slower and used for voice and fax
-
-communications.
-</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>browser</B><A NAME="browser"></A>
-
-<BR>A client program that retrieves, displays, and prints information and HTML documents from the
-
-World Wide Web. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>certificate</B><A NAME="certificate"></A><BR>A file used for authenticating network entities under the SSL protocol. A certificate
-
-contains information about its owner (called the subject) and its issuer, plus the owner's
-
-public key and a signature made by a Certification Authority (CA). Network entities verify
-
-these signatures using CA certificates. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>cipher<A NAME="cipher"></A></B>
-<BR>A system of encryption. </P><BLOCKQUOTE><P><A HREF="#top">return</A>
-
-
-
-
-</P></BLOCKQUOTE><P><B>ciphertext<A NAME="ciphertext"></A></B>
-<BR>Encrypted data. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>client</B><A NAME="client"></A>
-<BR>A software program that contacts and obtains data from a server software program on another
-
-computer. Each client program is designed to work with one or
-
-more specific kinds of server programs. Each server required a specific kind of client. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>client-server</B><A NAME="client-server"></A><BR>The model of interaction in a distributed system in which a program at one
-
-site sends a request to a program at another site and then waits for a response. The requesting
-
-program is called a <I>client</I>; the program satisfying the request is called a <I>server</I>. </P><BLOCKQUOTE><P><A HREF="#top">return</A>
-
-</P></BLOCKQUOTE><P><B>CGI</B><A NAME="CGI"></A> (common gateway interface)<BR>A standard interface between a web server and other programs. CGI consists of a set of rules that describe how a Web Server communicates
-
-with another piece of software on the same machine, and how the other piece of software (the
-
-"CGI program") talks to the web server. Any piece of software can be a CGI program if it
-
-handles input and output according to the CGI standard. CGI-scripts are usually written in the PERL or C programming languages. </P><BLOCKQUOTE><P><A HREF="#top">return</A> </P></BLOCKQUOTE><P><B>digest access authentication</B> (DAA)<B><A NAME="digestauthentication"></A></B>
-<BR>Digest access authentication is an authentication scheme for HTTP that is more secure than the basic authentication scheme. Its primary advantage is that passwords are never transmitted across the Internet in an unencrypted form. A second advantage is that the integrity of the URL data is certified. </P><BLOCKQUOTE><P><A HREF="#top">return</A> </P></BLOCKQUOTE><P><B>domain name</B><A NAME="domainname"></A>
-
-<BR>The unique name that identifies an Internet site.</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>DNS<A NAME="DNS"></A></B> (Domain Name System) <BR>The on-line distributed database system that maps
-
-human-readable machine names into IP addresses.
-</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>embedded web server<A NAME="embeddedwebserver"></A>
-
- </B><BR>Web server software embedded within a hardware device such as a print server.
- It is widely used in a number of devices, because it allows access to the software
- via any web browser, typically for configuring the device or obtaining reports.
-Using a web server as a common
- software engine enables access to the device via any web browser. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>encryption<A NAME="encryption"></A></B>
-<BR>The encoding of data in order to hide its content from everyone except its intended viewer.
-
-Encryption converts readable data (plain text ) into a seemingly random sequence of characters
-
-(ciphertext). </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>FAQ</B><A NAME="FAQ"></A>
-
-(Frequently Asked Questions)<BR> FAQs are documents that provide answers the most common
-
-questions on specific subjects.</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>FTP<A NAME="FTP"></A></B>(File Transfer Protocol)<BR>A client-server protocol that allows a user to login to another Internet site and transfer files over a TCP/IP network. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>gateway<A NAME="gateway"></A></B>
-
-<BR>A hardware or software setup that translates between two
-
-dissimilar protocols.</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>host</B><A NAME="host"></A>
-<BR>A networked computer that provides services that other computers or terminals can access.</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P>
-
-
-
-
-<B>hostname</B><A NAME="hostname"></A>
-<BR>A unique name that identifies a single host within a network domain. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>HTML</B><A NAME="HTML"></A>
-
-(HyperText Markup Language)<BR> A coding language used to create hypertext documents for use
-
-on the World Wide Web. HTML is a language specification for the transfer of
-
-text, menus, and graphical images between a Web server and a client such as Netscape Navigator or Internet Explorer. HTML supports the inclusion of graphical,
-
-video and audio elements into the document, either inline or as a hypertext resource. GIF
-
-and X-bitmap images are supported for images residing within the document, but through
-
-separate programs called Helpers, various types of multimedia files such as Quick-Time, MPEG
-
-movies, JPEG images, and AU audio files can be accessed. </P><BLOCKQUOTE><P><A HREF="#top">return</A>
-
-</P></BLOCKQUOTE><P><B>HTTP</B><A NAME="HTTP"></A> (hypertext transmission protocol) <BR>The standard language that World Wide Web clients
-
-and servers use to communicate. Also called HyperText Transfer Protocol. Used as an Internet
-
-protocol intended for the retrieval of hypertext information from a WWW server. It splits
-
-tasks between client and server. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>HTTPS</B><A NAME="HTTPS"></A> (hypertext transport protocol, secure)
-<BR>The standard SSL communication mechanism of the
-
-World Wide Web. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>hypertext<A NAME="hypertext"></A></B><BR>
-Words or phrases in a document that contains link to other documents. When chosen by a reader, cause the linked document to be retrieved and
-
-displayed. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>Internet Explorer<A NAME="InternetExplorer"></A></B><BR>A graphical World Wide Web browser developed and distributed by
-
-Microsoft. Internet Explorer allows Web pages to incorporate sound, graphics, movies and
-
-Java applets along with text. The Internet Explorer is very similar to Netscape Navigator.</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>Intranet</B><A NAME="Intranet"></A>
-
-<BR>A private network inside a company or organization. </P><BLOCKQUOTE><P><A HREF="#top">return</A>
-</P></BLOCKQUOTE><P><B>IP</B><A NAME="IP"></A> (Internet protocol)<BR> The TCP/IP standard protocol that defines the IP datagram as
-
-the unit of information passed across an Internet and provides the basis for
-
-connection-less, best-effort packet delivery service. The IP provides the addressing
-
-routers needed to move packets across networks to their destinations.</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>IP address<A NAME="IPaddress"></A>
-</B><BR>A 32-bit, dotted decimal address, such as 240.17.233.16, that is assigned to each host participating in a TCP/IP Internet and uniquely identifies a network
-
-domain and is usually bound to a fully-qualified domain name. Each IP address is divided into
-
-a network portion and a host portion. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>ISP<A NAME="ISP"></A></B>
-
-(Internet Service Provider)<BR> An institution that provides access to the Internet , usually for a fee.</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>Javascript<A NAME="Javascript"></A></B><BR>JavaScript is a programmable API that allows cross-platform scripting of events, objects, and actions. It allows the designer to access events such as startups, exits, and users' mouse clicks. JavaScript extends the programmatic capabilities of browsers such as Netscape Navigator and Internet Explorer.</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>LAN</B><A NAME="LAN"></A> (Local Area Network<BR> A private network located within a building or complex
-
-of buildings, such as a campus, that links computers together for transferring of digital
-
-data. This allows resources to be shared, like hard drives and laser printers. </P><BLOCKQUOTE><P><A HREF="#top">return</A>
-</P></BLOCKQUOTE><P><B>Netscape
-
-Navigator<A NAME="NetscapeNavigator"></A></B><BR>A WWW browser originally based on
-
-the Mosaic program developed at the National Center for Supercomputing Applications (NCSA). </P><BLOCKQUOTE><P><A HREF="#top">return</A>
-</P></BLOCKQUOTE><P><B>proxy server</B><A NAME="proxyserver"></A>
-<BR>A server that relays requests and responses between clients and other servers. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>router</B><A NAME="router"></A>
-<BR>A special-purpose computer (or software package) that handles the connection between two or
-
-more networks. </P><BLOCKQUOTE><P><A HREF="#top">return</A>
-</P></BLOCKQUOTE><P><B>security certificate</B><A NAME="securitycertificate"></A>
-
-<BR>A chunk of information (often stored as a text file) that is used by the SSL protocol to
-
-establish a secure connection. Security certificates contain information about who it
-
-belongs to, who it was issued by, a unique serial number or other unique identification,
-
-valid dates, and an encrypted fingerprint that can verify the contents of the
-
-certificate. In order for an SSL connection to be created, both sides must have a valid
-
-security certificate.</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>server<A NAME="server"></A></B><BR> A computer that serves information and software to the Internet community and, in
-
-general terms, a machine that makes services available on a network. A file server makes
-
-files available. The server includes the computer and software that put information on the
-
-Web so a browser program on your computer can read it. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>SSI</B><A NAME="SSI"></A> (server-side includes)
-<BR>HTML-embedded commands executed by the server before sending the HTML file to the client. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>SSL</B><A NAME="SSL"></A> (secure sockets layer)<BR>
-A protocol created by <A HREF="http://www.netscape.com/eng/ssl3/" TARGET="new">Netscape Communications Corporation</A> for authentication and encryption over TCP/IP networks.
-
-over TCP/IP networks, including the web. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>TCP/IP<A NAME="TCPIP"></A>
-
-</B>(Transmission Control Protocol/Internet Protocol) -<BR> The suite of Internet protocols upon which HTTP, HTTPS, FTP, TELNET, and GOPHER are based. Originally designed for the UNIX operating system, TCP/IP software is
-
-now available for every major kind of computer operating system. </P><BLOCKQUOTE><P><A HREF="#top">return</A>
-
-
-</P></BLOCKQUOTE><P><B>TLS</B><A NAME="TLS"></A> (Transport Layer Security)<BR>
-A protocol for authentication and encryption over TCP/IP networks, including the Web. TLS is
-
-the successor to SSL version 3 and is nearly identical. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>URL</B><A NAME="URL"></A>
-
-(Uniform Resource Locator)<BR>The address of any resource on the
-
-Internet that is part of the World Wide Web (WWW).
-</P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>Web Page</B><A NAME="WebPage"></A>
-<BR>An HTML document on the Web, usually one of many that together make up a Web site. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>Web Server<A NAME="WebServer"></A></B><BR>
-A system capable of continuous access to the Internet (or an internal network) through
-
-retrieving and displaying documents via hypertext transfer protocol (HTTP). Files can be
-
-audio clips, video, graphics, or text. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P></BLOCKQUOTE><P><B>WWW</B><A NAME="WWW"></A>
-
-(World Wide Web)<BR> Can be thought of as the whole constellation of resources
-
-that can be accessed using Gopher, FTP, HTTP, telnet, USENET, WAIS and some other tools. </P><BLOCKQUOTE><P><A HREF="#top">return</A></P><P> </P></BLOCKQUOTE><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-</P><P> </P><P> </P><P> </P><P>
-
-
-
-</P></TR><TD></TABLE>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/graphics/sidebar.gif b/xbmc/lib/libGoAhead/web/graphics/sidebar.gif Binary files differdeleted file mode 100644 index 5c2247ca68..0000000000 --- a/xbmc/lib/libGoAhead/web/graphics/sidebar.gif +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/graphics/topbar.gif b/xbmc/lib/libGoAhead/web/graphics/topbar.gif Binary files differdeleted file mode 100644 index 87f7e62c3c..0000000000 --- a/xbmc/lib/libGoAhead/web/graphics/topbar.gif +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/graphics/webserver_logo1.gif b/xbmc/lib/libGoAhead/web/graphics/webserver_logo1.gif Binary files differdeleted file mode 100644 index 562ce40175..0000000000 --- a/xbmc/lib/libGoAhead/web/graphics/webserver_logo1.gif +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/graphics/webserver_logo2.gif b/xbmc/lib/libGoAhead/web/graphics/webserver_logo2.gif Binary files differdeleted file mode 100644 index 21b584d908..0000000000 --- a/xbmc/lib/libGoAhead/web/graphics/webserver_logo2.gif +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/home.asp b/xbmc/lib/libGoAhead/web/home.asp deleted file mode 100644 index 2724251897..0000000000 --- a/xbmc/lib/libGoAhead/web/home.asp +++ /dev/null @@ -1,24 +0,0 @@ -<HTML>
-<!- Copyright (c) Go Ahead Software Inc., 1994-2000. All Rights Reserved. ->
-<HEAD>
-<TITLE>GoAhead WebServer</TITLE>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html">
-</HEAD>
-
-<FRAMESET ROWS="70,1*" COLS="*" BORDER="0" FRAMESPACING="0" FRAMEBORDER="NO">
-
- <FRAME SRC="title.htm" NAME="title" FRAMEBORDER="NO" SCROLLING="NO" MARGINWIDTH="0" MARGINHEIGHT="0">
-
- <FRAMESET COLS="180,1*">
-
- <FRAME SRC="treeapp.asp" NAME="menu" MARGINWIDTH="0" MARGINHEIGHT="0" scrolling="AUTO" FRAMEBORDER="NO" >
-
- <FRAME SRC="overview.htm" NAME="view" SCROLLING="AUTO" MARGINWIDTH="0" TOPMARGIN="0" MARGINHEIGHT="0" FRAMEBORDER="NO">
-
- </FRAMESET>
-</FRAMESET>
-<NOFRAMES>
-<BODY BGCOLOR="#FFFFFF">
-
-</BODY></NOFRAMES>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/loadcfg.asp b/xbmc/lib/libGoAhead/web/loadcfg.asp deleted file mode 100644 index 5ca5b8ff3c..0000000000 --- a/xbmc/lib/libGoAhead/web/loadcfg.asp +++ /dev/null @@ -1,24 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 2000-2000. All Rights Reserved. ->
-<head>
-<title>Load the User Configuration</title>
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-<h1>Re-load the permanently stored user configuration</h1>
-<form action=/goform/LoadUserManagement method=POST>
-
-<table>
-<tr>
- <td></td>
- <td ALIGN="CENTER">
- <input type=submit name=ok value="OK" title="Load Configuration"> <input type=submit name=ok value="Cancel"></td>
-</tr>
-</table>
-
-</form>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/architecture.htm b/xbmc/lib/libGoAhead/web/over/architecture.htm deleted file mode 100644 index c4870175f5..0000000000 --- a/xbmc/lib/libGoAhead/web/over/architecture.htm +++ /dev/null @@ -1,47 +0,0 @@ -<HTML>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<TITLE>WebServer Architecture</TITLE>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-<LINK REL="stylesheet" HREF="../style/normal_ws.css">
-<BODY BGCOLOR="#FFFFFF">
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-
-<H1>GoAhead WebServer Architecture<A NAME="top"></A></H1><P>The following diagram is provided to illustrate major WebServer functionality, showing function relationships and identifying associated files. Refer to the list following this illustration for <A HREF="#descriptions">descriptions</A> of these files. </P><P><IMG SRC="webs_block.jpg" WIDTH="534" HEIGHT="520" BORDER="0" USEMAP="#wsblock"></P><BLOCKQUOTE><BLOCKQUOTE><BLOCKQUOTE><BLOCKQUOTE><P><B>WebServer Architecture</B> (<A HREF="blockdiagram.htm">large view</A>) </P><BLOCKQUOTE><BLOCKQUOTE><P> </P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE><H2><B>WebServer File Descriptions<A NAME="descriptions"></A></B></H2><TABLE WIDTH="92%" BORDER="0">
-
-<TR><TD WIDTH="21%">asp.c <A NAME="asp"></A></TD><TD WIDTH="79%">active server page support </TD></TR>
-
-<TR><TD WIDTH="21%">cgi.c<A NAME="cgi"></A></TD><TD WIDTH="79%">standard CGI support</TD></TR>
-
-<TR><TD WIDTH="21%">ejlex.c<A NAME="ejlex"></A></TD><TD WIDTH="79%">embedded JavaScript lexical analyser</TD></TR>
-
-<TR><TD WIDTH="21%">ejparse.c <A NAME="ejparse"></A></TD><TD WIDTH="79%">embedded JavaScript parser and API </TD></TR>
-
-<TR><TD WIDTH="21%">emfdb.c<A NAME="emfdb"></A></TD><TD WIDTH="79%">WebServer database</TD></TR>
-
-<TR><TD WIDTH="21%">form.c<A NAME="form"></A></TD><TD WIDTH="79%">in-memory forms processor with GCI support</TD></TR>
-
-<TR><TD WIDTH="21%">handler.c<A NAME="handler"></A></TD><TD WIDTH="79%">URL handler support</TD></TR>
-
-<TR><TD WIDTH="21%">main.c<A NAME="main"></A></TD><TD WIDTH="79%">main program and startup for operating system</TD></TR>
-
-<TR><TD WIDTH="21%">rom.c<A NAME="rom"></A></TD><TD WIDTH="79%">ROM web pages access module when not using a file system.</TD></TR>
-
-<TR><TD WIDTH="21%">security.c<A NAME="security"></A></TD><TD WIDTH="79%">security URL handler. Implements a basic security policy</TD></TR>
-
-<TR><TD WIDTH="21%">sock.c<A NAME="sock"></A></TD><TD WIDTH="79%">generic socket support</TD></TR>
-
-<TR><TD WIDTH="21%">sockGen.c<A NAME="sockGen"></A></TD><TD WIDTH="79%">platform-independent socket support</TD></TR>
-
-<TR><TD WIDTH="21%">um.c<A NAME="umc"></A></TD><TD WIDTH="79%">user management</TD></TR>
-
-<TR><TD WIDTH="21%">webs.c<A NAME="webs"></A></TD><TD WIDTH="79%">primary GoAhead WebServer code. Includes state machine.</TD></TR>
-
-
-
-</TABLE><P><A HREF="#top">return to top</A></P><P>Refer to<A HREF="../docs/files21.txt"> files21.txt</A> for a complete file list. </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><MAP NAME="wsblock"><AREA SHAPE="rect" COORDS="411,438,465,462" HREF="#asp"><AREA SHAPE="rect" COORDS="271,439,326,459" HREF="#rom"><AREA SHAPE="rect" COORDS="481,150,533,170" HREF="#emfdb"><AREA SHAPE="rect" COORDS="476,450,535,460" HREF="#ejparse"><AREA SHAPE="rect" COORDS="475,436,532,450" HREF="#ejlex"><AREA SHAPE="rect" COORDS="324,323,378,348" HREF="#webs"><AREA SHAPE="rect" COORDS="323,240,377,260" HREF="#cgi"><AREA SHAPE="rect" COORDS="412,70,459,95" HREF="#umc"><AREA SHAPE="rect" COORDS="324,137,378,160" HREF="#form"><AREA SHAPE="rect" COORDS="324,36,379,61" HREF="#security"><AREA SHAPE="rect" COORDS="200,40,265,61" HREF="#handler"><AREA SHAPE="rect" COORDS="103,237,161,259" HREF="#sockGen"><AREA SHAPE="rect" COORDS="51,237,98,259" HREF="#sock"><AREA SHAPE="rect" COORDS="37,6,136,27" HREF="#main"></MAP>
-
-</TD></TR></TABLE>
-
-
-
-</HTML>
\ No newline at end of file diff --git a/xbmc/lib/libGoAhead/web/over/asp.htm b/xbmc/lib/libGoAhead/web/over/asp.htm deleted file mode 100644 index 90553eaafc..0000000000 --- a/xbmc/lib/libGoAhead/web/over/asp.htm +++ /dev/null @@ -1,47 +0,0 @@ -<html>
-<head>
-<title>Active Server Pages -- GoAhead WebServer</title>
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body>
-<TABLE WIDTH="535" BORDER="0" HEIGHT="60"><TR BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TD><H1>Active Server Pages</H1><P> Active Server Pages (ASP) is a standard developed by Microsoft to serve
-web pages with dynamic content. An ASP document has an ".asp"
-extension and uses embedded scripting to insert dynamic data into the page
-before it is sent to the user's browser. The GoAhead WebServer supports an open scripting
-architecture where scripting engines can be selected at run-time. Individual pages can use multiple scripting engines if required.</P><P>To create an ASP script field in an ASP document, use the
-<STRONG><%</STRONG>
-and <STRONG>%></STRONG> ASP delimiters. For example, the following
-JavaScript will output "Hello World" in place of the ASP delimited field:</P><P>
-<PRE><h1>Today is <% write("Hello World"); %></h1></PRE><P></P><H3> Scripting Execution</H3><P>When a user's browser requests an ASP document, the
-default URL handler determines if the page is an ASP document by examining the
-document's file extension. An ".asp" extension indicates that ASP
-processing is required. The document is read from the file system or ROM store
-in a one-pass operation. Text before the ASP delimiters is copied directly to
-the requesting browser. If ASP delimiters are found, the text between the
-delimiters is passed to the relevant scripting engine for execution. The
-resulting text is immediately passed back to the browser and the process
-continues until the end of the document. This may differ a little to the
-processing provided by other ASP implementations. Some systems buffer all ASP
-output and permit scripted iteration over HTML tags. This is not supported as it
-requires complete in-memory storage of the entire ASP document before returning to
-the browser. </P><H3>Scripting Engine Selection</H3><P>To specify the scripting engine, use the
-"language=" specifier at the beginning of the ASP script. The language
-selection is <I>sticky</I>, meaning the language will remain
-the default language until another "language=" keyword is encountered
-at the start of an ASP script later in the page. For example:
-<P>
-<PRE>
-<% language=javascript write("Query String: " + QUERY_STRING) %>
-<% write("JavaScript is still the selected language"): %>
-
-</PRE><P></P><P>If no "language=" is specified, the default
-language is JavaScript. You should always specify the language in the
-<HEAD></HEAD> section of your page for good practice.</P><H2> See Also</H2><P>
-<A HREF="ejs.htm">JavaScript</A>,
-<A HREF="goforms.htm">GoForms</A>™,
-<A HREF="../docs/techref/wsapi/websSecurityHandler.htm">websSecurityHandler</A>,
-<A HREF="../docs/techref/wsapi/websUrlHandlerDefine.htm">websUrlHandlerDefine</A> </P></TD></TR></TABLE><h1>
-</h1>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/blockdiagram.htm b/xbmc/lib/libGoAhead/web/over/blockdiagram.htm deleted file mode 100644 index 4461d82d9b..0000000000 --- a/xbmc/lib/libGoAhead/web/over/blockdiagram.htm +++ /dev/null @@ -1,12 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>WebServer Architecture</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<H2><B>WebServer Architecture (large view)</B></H2><P>Return to <A HREF="architecture.htm">Architecture</A> page</P><p><IMG SRC="webs_block.jpg" WIDTH="842" HEIGHT="722"></p><p>WebServer 2.1 list of <A HREF="../docs/files21.txt">files</A>.</p><p> </p><p> </p><p> </p><p> </p>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/cgi.htm b/xbmc/lib/libGoAhead/web/over/cgi.htm deleted file mode 100644 index 99f0867026..0000000000 --- a/xbmc/lib/libGoAhead/web/over/cgi.htm +++ /dev/null @@ -1,41 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>Standard CGI Implementation</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD><H2>Standard CGI Implementation<A NAME="CGI"></A> </H2><P>The Common Gateway Interface (CGI) is a standard for interfacing external applications with information servers, such as HTTP or Web servers. A plain HTML document retrieved by a Web daemon is a static text file that doesn't change. A CGI program, on the other hand, is executed in real-time and able to output dynamic content.</P><P> CGI script are written in any language that can read STDIN, write to STDOUT, and read environment variables. This means that virtually any programming language can be used, including C, Perl, or even shell scripting. </P><P><B>Note:</B> this WebServer documentation does not provide instructions on how to write CGI scripts for processing Web forms; however, numerous books and Websites are readily available that do an excellent job in covering this basic information. </P><P>In WebServer 2.0, GoForms CGI processing was accomplished by instructing the webs module to treat all URLs beginning with "/goform" as <A HREF="goforms.htm">GoForms</A>. Using a similar mechanism, WebServer 2.1 has a new "handler" that is called when URL requests are received for URLs beginning with <BR>"/cgi-bin". CGI executable processes must be located in the WebServer's <FONT FACE="Courier New, Courier, mono">cgi-bin</FONT> subdirectory. Separate processes will be created for each CGI request.
-</P><H3>CGI for VxWorks<A NAME="cgi"></A></H3><P>CGI's standard implementation requires that standalone processes be executed and their outputs returned to the browser via the WebServer. In VxWorks, processes are not implemented, but rather tasks are. In addition to understanding the mechanisms used in the implementation of VxWorks CGI tasks, developers of CGI processes must be aware of the differences between processes on other operating systems and tasks on VxWorks.</P><OL><OL><LI>VxWorks tasks can be spawned using code already loaded in memory. On VxWorks systems with no file system, the CGI task code can be included in the OS image and is not necessarily contained in a file.</LI><LI>If the CGI code is contained in a file, a browser request for it will cause it to be loaded into memory prior to its execution. It will be unloaded and reloaded each time it is invoked, which allows the upgrading to a new version between invocation.</LI><LI>The VxWorks taskSpawn API is used to spawn the CGI task.</LI><LI>An entry point symbol name must be used to spawn the task. The request for the CGI process can define this entry point name in the request by including the query string keyword=value pair "cgientry=symbolname", where symbolname is a function name in the CGI code that is to be executed. If cgientry is not defined in this way, a default entry name will be searched for in the loaded code. The default name is "basename_cgientry", where basename is the name of the requested CGI process minus any file extension or path info (e.g., if the request is for "cgi-bin/cgitest.out", the default entry point symbol name will be "cgitest_cgientry"). If the entry point symbol name is not found or if the requested module cannot be loaded, the CGI request will fail.</LI><LI>The priority of the spawned task will be the same priority at which WebServer is running. </LI><LI>The stack size of the spawned task is 20,000 bytes.</LI><LI>The task name will be the same as the entry point name.</LI><LI>The standard CGI environment variables are copied to the task environment. They can be retrieved/modified by the getenv/putenv APIs.</LI><LI>Command line arguments (if any) are passed to the user's entry point via an (int argc, char **argv) standard convention, where argc is the number of arguments and argv is an array of strings.</LI><LI>As in standard CGI processes, the VxWorks CGI task can retrieve additional POST data from standard input device and must write any output to be returned to the client to the standard output device. These devices are actually temporary files where stdin and stdout have been redirected.</LI><LI>User-defined CGI task codes should always be terminated with a return rather than an exit API. This allows environment space and redirected I/O files used by the task to be cleaned up and released back to the operating system appropriately. </LI></OL></OL><P></P><H3>Environment Variables</H3><P>Input to Standard CGIs is accomplished mainly through these environment variables:</P><P>
-
-SERVER_SOFTWARE<BR> The name and version of the information server software answering the request (and running the gateway). <BR>Format: name/version
-</P><P>SERVER_NAME<BR> The server's hostname, DNS alias, or IP address as it would appear in self-referencing URLs.</P><P>
-GATEWAY_INTERFACE<BR>The revision of the CGI specification used by this server. <BR>Format: CGI/revision
-</P><P>SERVER_PROTOCOL<BR>The name and revision of the information protocol used by this request. <BR>Format: protocol/revision
-</P><P>SERVER_PORT<BR>The port number receiving the request.
-</P><P>REQUEST_METHOD<BR>The method used to make the request. For HTTP, this is "GET", "HEAD", "POST", etc.
-</P><P>PATH_INFO<BR>The extra path information, as given by the client. In other words, scripts can be accessed by their virtual pathname, followed by extra information at the end of this path. The extra information is sent as PATH_INFO. The server decodes this information before it is passed to the CGI script.
-</P><P>PATH_TRANSLATED<BR>The server provides a translated version of PATH_INFO, which completes a virtual-to-physical mapping of the path as required.
-</P><P>SCRIPT_NAME<BR>A virtual path to the script being executed for self-referencing URLs.
-</P><P>QUERY_STRING<BR>The information which follows the "?" in the URL which referenced this script. This is the query information. It is not decoded in any fashion. This variable is always set when there is query information, regardless of command line decoding.
-</P><P>REMOTE_HOST<BR>The hostname making the request. If the server does not have this information, it will set REMOTE_ADDR and leave this unset.
-</P><P>REMOTE_ADDR<BR>The IP address of the remote host making the request.
-</P><P>AUTH_TYPE<BR>If the script is protected, this is the protocol-specific authentication method used to validate the user.
-</P><P>REMOTE_USER<BR>If the script is protected, this is the authenticated username.
-</P><P>REMOTE_IDENT<BR>This variable is set to the remote user name retrieved from the server. Use of this variable should be limited to logging only.
-</P><P>CONTENT_TYPE<BR>For queries having attached information, such as HTTP POST and PUT, this identifies the content type of the data.
-</P><P>CONTENT_LENGTH<BR>The length of the said content as given by the client.
-
-</P><P>HTTP_ACCEPT<BR>The MIME types accepted by the client, as given by HTTP headers. Other protocols may need to receive this information from elsewhere. Each item in this list should be separated by commas as specified by HTTP. <BR>Format: type/subtype, type/subtype.
-</P><P>HTTP_USER_AGENT<BR>The browser being used by the client to send the request. General format: software/version library/version.
-</P><H3>Standard CGI Implementation Data Structures</H3><P>
-
-
-
-The data structures provided for GoForms function for standard CGI implementation.</P></TD></TR></TABLE>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/digestauth.htm b/xbmc/lib/libGoAhead/web/over/digestauth.htm deleted file mode 100644 index 52a2f145c7..0000000000 --- a/xbmc/lib/libGoAhead/web/over/digestauth.htm +++ /dev/null @@ -1,17 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>WebServer Architecture</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-<h1>Digest Access Authentication</h1><p>WebServer 2.1 supports digest access authentication (DAA), which is an authentication scheme for HTTP that is more secure than the basic access authentication scheme. The primary advantage of DAA is, unlike basic access authentication, passwords are never transmitted across the Internet in an unencrypted form. </p><P>The web browser presentation for DAA is essentially the same as for basic access authentication. The user typically is prompted for a user ID and password before being allowed access to a URL. In basic access, passwords are sent as clear text. In digest access, the user ID and password are encrypted using the RSA Data Security, Inc. MD5 Message-Digest Algorithm before being sent. </P><P> The following shows the interaction going on between the <B>client</B> (browser) and <B>server</B> (web) using DAA. </P><TABLE WIDTH="89%" BORDER="0"><TR><TD WIDTH="86"><DIV ALIGN="CENTER"><B>Sequence</B></DIV></TD><TD WIDTH="579"><B></B></TD><TD WIDTH="2"> </TD></TR>
-<TR><TD BORDERCOLOR="#000000" BGCOLOR="#CCCCCC"><DIV ALIGN="CENTER"><B>1</B></DIV></TD><TD BORDERCOLOR="#000000" BGCOLOR="#CCCCCC"><B>Client</B> requests a page.</TD><TD WIDTH="2"> </TD></TR><TR valign=top><TD WIDTH="86"> <DIV ALIGN="CENTER"><B>2</B> </DIV></TD><TD WIDTH="579"><B>Server</B> checks if page is password protected (by accessing the AccessLimit file), and if DAA is required. If so, responds with 401 and WWW-Authenticate Response header, which includes a portion of data to be encrypted, the "realm-value", the encryption algorithm to use, and a timed "nonce".</TD><TD WIDTH="2"> </TD></TR><TR valign=top><TD WIDTH="86" BGCOLOR="#CCCCCC"><DIV ALIGN="CENTER"><B>3</B></DIV></TD><TD WIDTH="579" BGCOLOR="#CCCCCC"><B>Client</B> prompts user for id and password, then sends the user name and encrypted digest to the server. Digest is calculated with User ID password and realm-value. Returns to the server an Authorization Request Header which contains the user id, the digest, the requested page, and the "nonce".</TD><TD WIDTH="2"> </TD></TR>
-<TR valign=top><TD WIDTH="86"><DIV ALIGN="CENTER"><B>4</B></DIV></TD><TD WIDTH="579"><DIV ALIGN="LEFT"><B>Server</B> retrieves User ID record from storage, which contains the password. Digest is calculated, and compared to client's version. Nonce is also evaluated. If successful, an Authentication Info header is sent, which contains the next "nonce" value so that the client can continue to access protected pages without prompting the user. </DIV></TD><TD WIDTH="2"> </TD></TR><TR>
-<TD WIDTH="86" BGCOLOR="#CCCCCC"><DIV ALIGN="CENTER"><B>5</B></DIV></TD><TD WIDTH="579" BGCOLOR="#CCCCCC"><DIV ALIGN="LEFT"><B>Client</B> receives requested page.</DIV></TD></TR>
-</TABLE><H4> </H4></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/ejs.htm b/xbmc/lib/libGoAhead/web/over/ejs.htm deleted file mode 100644 index 268d3fc807..0000000000 --- a/xbmc/lib/libGoAhead/web/over/ejs.htm +++ /dev/null @@ -1,22 +0,0 @@ -<HTML>
-<HEAD>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
-<META NAME="Generator" CONTENT="Microsoft Word 97">
-<TITLE>JavaScript -- GoAhead WebServer </TITLE>
-<META NAME="Template" CONTENT="C:\Program Files\MSOffice\Office\html.dot">
-<link rel="stylesheet" href="../style/normal_ws.css"></HEAD>
-<BODY LINK="#0000ff" VLINK="#800080">
-
-<TABLE WIDTH="539" BORDER="00000" HEIGHT="75"><TR><TD><H1>Embedded JavaScript</H1><P>GoAhead developed an embedded version of JavaScript called Ejscript™. As JavaScript 1.2 is now quite a large language, its size prohibits its use in most embedded devices. GoAhead's embedded JavaScript is designed to solve this dilemma. Ejscript™ is a strict subset of JavaScript and implements the essential elements of the language. Ejscript also interfaces to Active Server Pages (ASP) to allow the easy creation of dynamic web pages. </P><P>When JavaScript is used inside an ASP web page, it consists of a script within ASP delimiters. The basic format is: </P><PRE> <% function(arguments, ...); %></PRE><P>JavaScript functions are created by the <A HREF="../docs/techref/jsapi/ejSetGlobalFunction.htm">ejSetGlobalFunction</A>. When the function is evaluated, the corresponding C procedure that implements the JavaScript function is called. </P><P>Ejscript implements the following JavaScript elements: </P><UL>
-<LI>Case sensitivity </LI><LI>White space </LI><LI>Semicolons </LI><LI>Comments </LI><LI>Identifiers </LI><LI>Data types including numbers, booleans, strings with backslash characters </LI><LI>Full expressions </LI><LI>If/else, for, return </LI><LI>Global function calls </LI></UL><P>The following language elements are not implemented:</P><UL>
-<LI>Arrays </LI><LI>Objects </LI><LI>Labeled statements </LI><LI>Control flow statements including: break, case, continue, default, do/while, export, for/in, function, import, switch, var, while, with </LI><LI>Regular expressions </LI></UL><P>JavaScript scripts can span multiple lines by using "\" as the last character on the preceding line. When used in ASP pages, function arguments can contain any query variable defined in either the URL query string or the <A HREF="../docs/techref/wsapi/websVar.htm">standard variable set</A>. URL query strings are automatically decoded, and JavaScript variables are defined to the decoded query value. For example, to parse the name and address encoded as a query string in a URL, use the following code: </P><PRE>
-http://localhost/mypage?name=smith&age=35
-
-int myAspProcedure(webs_t wp, int argc, char_t **argv) {
-	char_t *name = websGetVar(wp, "name", "undefined");
-	char_t *age = websGetVar(wp, "age", "undefined");
- websWrite(wp, "Name %s, Age", args);
-}</PRE><P>JavaScript procedures are registered by using the <A HREF="../docs/techref/wsapi/websAspDefine.htm">websAspDefine</A> API. This publishes a C procedure as a JavaScript global function. For example:</P><PRE>extern int outputMyTable(int ejid, webs_t wp, int argc, char_t **argv);
- websAspDefine("outputTable", outputMyTable);</PRE><P>The websAspDefine call publishes the JavaScript command "outputTable" and links it to the outputMyTable C procedure. When an ASP page is requested by the user's browser, any ASP JavaScript which uses the <I>outputTable c</I>ommand will cause the <I>outputMyTable</I> to be called with the relevant arguments. </P><H2>See Also</H2><P><A HREF="asp.htm">Active Server Pages</A>, <A HREF="goforms.htm">GoForms</A>™, <A HREF="../docs/techref/wsapi/websSecurityHandler.htm">websSecurityHandler</A>, <A HREF="../docs/techref/wsapi/websUrlHandlerDefine.htm">websUrlHandlerDefine</A> </P></TD></TR></TABLE><H1> </H1>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/over/goforms.htm b/xbmc/lib/libGoAhead/web/over/goforms.htm deleted file mode 100644 index 3b8f53a3c9..0000000000 --- a/xbmc/lib/libGoAhead/web/over/goforms.htm +++ /dev/null @@ -1,68 +0,0 @@ -<html>
-<head>
-<title>GoForms -- GoAhead WebServer™</title>
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body>
-
-<TABLE WIDTH="550" BORDER="0"><TR><TD><H1>GoForms™</H1><P>The GoAhead WebServer implements the standard Common
-Gateway Interface (CGI) as an in-memory forms processor called GoForms™. Old style CGI processing results in the creation of a
-new process for every request to a CGI Url.
-As CGI is often the primary means of implementing user input, this is
-slow and cumbersome. GoForms is a more suitable solution for
-embedded systems that demand compact, high performance solutions.</P><P> GoForm procedures run in-memory without creating a new
-process for each browser connection. By sharing the address space with
-the GoAhead WebServer, GoForms procedures can directly access the full request context. The GoForm
-handler also automatically decodes and parses all POST and query
-data for easy access. A convenient API (see <A HREF="../docs/techref/wsapi/websGetVar.htm">websGetVar</A>)
-permits easy access to CGI variables.</P><P>GoForms is implemented as a
-<A HREF="urlhandles.htm">URL Handler</A> which
-
- interprets URLs that begin with "/goform".
-The URL segment following "goform" defines the form name with
-query details appended to the URL. For example:</P><P>
-<PRE>
-/goform/myForm?name=John&age=30
-</PRE><P> This will call the GoForm procedure "myForm" and
-automatically decode the querystring "name=John&age=30" and
-define GoForm variables called "name" and "age". In addition to POST and query data, the <A HREF="../docs/techref/wsapi/websVar.htm">
- standard CGI variables</A>
-
-
-
- are also defined.</P><P>
-
-
-
-GoForm procedures are defined by the
-<A HREF="../docs/techref/wsapi/websFormDefine.htm">websFormDefine</A> API call and conform to the following
-prototype:</P><PRE>
-void myForm(webs_t wp, char_t *path, char_t *query)
-{
- websHeader(wp);
- websWrite(wp, "Name %s", websGetVar(wp, "name", ""));
- websWrite(wp, "Age %s", websGetVar(wp, "age", ""));
- websFooter(wp);
- websDone(wp, 200);
-}
-</PRE><P>The GoForm procedure is responsible for writing the HTTP
-header and HTML document contents back to the user's browser.
-<A HREF="../docs/techref/wsapi/websHeader.htm">websHeader</A> creates a standard HTTP
-header with initial HTML tags.
-<A HREF="../docs/techref/wsapi/websFooter.htm">websFooter</A> closes the document with a
-closing HTML tag. Inside the GoForm procedure,
-<A HREF="../docs/techref/wsapi/websGetVar.htm">websGetVar</A>,
-<A HREF="../docs/techref/wsapi/websRedirect.htm">websRedirect</A>,
-<A HREF="../docs/techref/wsapi/websWrite.htm">websWrite</A>,
-and <A HREF="../docs/techref/wsapi/websWriteBlock.htm">websWriteBlock</A> are some of the most
-useful API calls.
-</P><H2> See Also</H2><P>
-<A HREF="asp.htm">Active Server Pages</A>,
-<A HREF="ejs.htm">JavaScript</A>,
-<A HREF="urlhandles.htm">URL Handlers</A>,
-<A HREF="../docs/techref/wsapi/websSecurityHandler.htm">websSecurityHandler</A>,
-<A HREF="../docs/techref/wsapi/websUrlHandlerDefine.htm">websUrlHandlerDefine</A> </P></TD></TR></TABLE><h1>
-</h1>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/readme.asp b/xbmc/lib/libGoAhead/web/over/readme.asp deleted file mode 100644 index d08e87fafd..0000000000 --- a/xbmc/lib/libGoAhead/web/over/readme.asp +++ /dev/null @@ -1,16 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 1999-2000. All Rights Reserved. ->
-<head>
-<title>GoAhead Web Server Test Page</title>
-</head>
-
-<body>
-
-C compiler defined
- - WEBS
- - WEBS_LOG
-Edit
- - Tab stops every 4
- - Tabs in file not spaces
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/security.htm b/xbmc/lib/libGoAhead/web/over/security.htm deleted file mode 100644 index 62c56f213e..0000000000 --- a/xbmc/lib/libGoAhead/web/over/security.htm +++ /dev/null @@ -1,12 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>WebServer Architecture</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<h1>GoAhead WebServer Security Features</h1><BLOCKQUOTE><P>The following security features are supported in WebServer 2.1:</P><UL><LI><A HREF="digestauth.htm">Digest Access Authentication</A> (DAA)</LI><LI><A HREF="ssl.htm">Secure Sockets Layer</A> (SSL)</LI><LI><A HREF="usermanagement.htm">User Management</A></LI></UL><P> </P></BLOCKQUOTE><P> </P><P> </P>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/ssl.htm b/xbmc/lib/libGoAhead/web/over/ssl.htm deleted file mode 100644 index 308dee9f58..0000000000 --- a/xbmc/lib/libGoAhead/web/over/ssl.htm +++ /dev/null @@ -1,41 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>WebServer Architecture</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-<h1>Secure Sockets Layer</h1><p>The Secure Sockets Layer (SSL) is a protocol created by <A HREF="http://www.netscape.com/eng/ssl3/" TARGET="new">Netscape Communications Corporation</A> for authentication and encryption over TCP/IP networks. SSL is, for the most part, invisible to the end user. The web browser may notify the user that they are about to enter a secure web page, and perhaps use a visual cue to indicate the duration that SSL is active. The HTTPS prefix on the URL (<B>https</B>://www.goahead.com) indicates that the SSL protocol will be used. </p><p>WebServer 2.1 provides a code patch file (websSSL.c) that implements SSL via a toolkit provided by <A HREF="http://rsasecurity.com/" TARGET="new">RSA Security</A> called RSA BSAFE SSL-C. This product is required to enable SSL on WebServer 2.1 and can be acquired directly from RSA Security. Refer to <A HREF="../docs/user/RSA.htm">Incorporating RSA Security</A> for additional information. </p><P>
-
-SSL uses two layers: the <B>SSL Message Layer</B> and the <B>SSL Record Layer</B>. The Message Layer constructs and sends user data, handshake messages, alert messages, and change cipher specification messages. Its primary task is to set up the mutual understanding required by both client and server for the SSL Record Layer, which is responsible for sending SSL data records.
-
-
-
-</P><P>The sequence of events for Secure Socket Layer is as follows:
-</P><OL><OL><LI>Client sends a ClientHello message (a part of the HTTPS request).
-</LI><LI>Server sends a ServerHello message.
-</LI><LI>Server sends its certificate.</LI><LI>Server sends ServerKeyExchange message.
-</LI><LI>Server sends CertificateRequest message.</LI><LI>Client sends its certificate.
-</LI><LI>Client sends a ClientKeyExchange.
-</LI><LI>Client sends a CertificateVerify.</LI><LI>Client and server both send ChangeCipherSpec messages.</LI><LI>Client and server both send Finished messages.
-</LI><LI>Application data can now flow via SSL Record Layer.
-
-
- </LI></OL></OL><H4>SSL Record Layer
-
-</H4><P>The SSL Record Layer sends blocks of data called "records" between client and server. The maximum number of bytes that a block can contain is 16,383. </P><P>Each record layer message contains the following:
-</P><UL><LI>Content type
-</LI><LI>Protocol version number
-</LI><LI>Length
-</LI><LI>Data payload (optionally compressed and encrypted)
-
-</LI></UL><P>The SSL protocol begins with the compression function CompressionMethod.null and encryption method of SSL_NULL_WITH_NULL_NULL. This can change during an SSL session.
-
-
-
-</P><p> </p></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/urlhandles.htm b/xbmc/lib/libGoAhead/web/over/urlhandles.htm deleted file mode 100644 index c7eb39f32e..0000000000 --- a/xbmc/lib/libGoAhead/web/over/urlhandles.htm +++ /dev/null @@ -1,49 +0,0 @@ -<html>
-<head>
-<title>URL Handlers -- GoAhead WebServer™</title>
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body>
-<TABLE WIDTH="550" BORDER="0"><TR><TD>
-
-<TABLE WIDTH="78%" BORDER="0"><TR><TD><H1>GoAhead WebServer URL Handlers</H1><P> The GoAhead WebServer implements a flexible URL handler
-where the semantics of a URL may be interpreted at run-time by multiple
-URL handlers. URL handlers are given the URL and the option of accepting
-it for processing. If a handler accepts the URL, no further
-URL handlers will be called.</P><P>A URL handler specifies a path prefix, a processing function and a order option. The
-path prefix nominates the URLs of interest. Any URL that matches this URL prefix is
-given to the handler for processing. A match is deemed to occur if
-the URL exactly matches the prefix for the length of the prefix. If
-more than one handler matches, the longest matching URL handler will be called
-first and so-on in decreasing length order. For example, the following
-all match the prefix "/my":</P><P><PRE>
-/myCar?model= ford
-/myPath/model/ford
-/my/car/model/ford
-</PRE><P></P><P>A URL handler may supply the empty URL prefix
-"" and thus match all URLs. The order option enables a URL handler to
-specify that it wishes to be processed first or last regardless of the URL
-match. This is specified by the <I>flags</I>parameter to the
-<A HREF="../docs/techref/wsapi/websUrlHandlerDefine.htm">websUrlHandlerDefine</A> API call. If multiple
-handlers may specify these flags, the order of evaluation for the handlers
-specifiying the same flag is undefined.</P><P>A URL handler is a C procedure according to the
-following prototype:</P><PRE>
-int myHandler(webs_t wp, char_t *url, char_t *path,
- char_t *query);
-</PRE><P></P><P>The <I>url</I> parameter contains the entire URL. The <I>path</I> parameter
-holds the URL portion after the hostname and port number. The <I>query</I>
-parameter holds any optional query. The URL handler must return 1 if it elects
-to process the URL. Otherwise it should return 0 to indicate that a later URL
-handler should process the URL.</P><P>A URL handler may modify the settings of a request but
-delay handling of the URL to another handler. The security handler is one
-example of this. Request settings, form variables and URL details may be
-modified by a handler to affect the processing by other handlers.</P><H2> See Also</H2><P>
-<A HREF="asp.htm">Active Server Pages</A>,
-<A HREF="ejs.htm">JavaScript</A>™,
-<A HREF="goforms.htm">GoForms</A>™,
-<A HREF="../docs/techref/wsapi/websSecurityHandler.htm">websSecurityHandler</A>,
-<A HREF="../docs/techref/wsapi/websUrlHandlerDefine.htm">websUrlHandlerDefine</A> </P></TD></TR></TABLE><h1>
-</h1></TD></TR> </TABLE>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/usermanagement.htm b/xbmc/lib/libGoAhead/web/over/usermanagement.htm deleted file mode 100644 index cfc8fc7112..0000000000 --- a/xbmc/lib/libGoAhead/web/over/usermanagement.htm +++ /dev/null @@ -1,53 +0,0 @@ -<html>
-<head>
-<!- Copyright (c) Go Ahead Software Inc., 1995-2000. All Rights Reserved. ->
-<title>WebServer Architecture</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../style/normal_ws.css">
-</head>
-
-<body bgcolor="#FFFFFF">
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD>
-<h1>User Management</h1><p> In password protected sites, multiple user ids with multiple levels of security may be necessary. In WebServer 2.1, these include:
-</p><BLOCKQUOTE><UL><LI>User IDs</LI><LI>User Groups</LI><LI>URL Access Limits
-</LI></UL></BLOCKQUOTE><P>A <B>User ID</B> contains these data elements:
-</P><OL><OL><LI>User Name</LI><LI>User Password
-</LI><LI>User Group (determines access rights of user)
-</LI><LI>Protect</LI><LI>Enabled </LI></OL></OL><P><B>User Groups</B> contain these data elements:
-</P><OL><OL><LI>Group Name (i.e., administrator, user, guest)
-</LI><LI>Privileges (none, read files, administrate users)
-</LI><LI>Protect </LI><LI>Enabled
-</LI></OL></OL><P>URL Access Limits are used when certain directories or URL pages on the web site have exceptionally secure access limits. If a directory has an access limit associated with it, its contents default to the directories access limit. </P><P><B>URL Access Limits</B> have the following data elements:
-</P><BLOCKQUOTE><OL><LI>URL name (name of the web page or directory)
-</LI><LI>Access Method (one of NONE, FULL, BASIC, or DIGEST)</LI><LI>Encryption Required
-</LI><LI>User Group (currently limited to one user group for simplicity)
-
-</LI></OL></BLOCKQUOTE><P>Users having administration privileges can manage the following Users IDs and Access Limits:</P><BLOCKQUOTE><OL><LI>
-
-Add User
-</LI><LI>Delete User
-</LI><LI>Change Password
-</LI><LI>Change User Class
-</LI><LI>Add User Group
-</LI><LI>Delete User Group
-</LI><LI>Change Privileges
-</LI><LI>Add Access Limit
-</LI><LI>Delete Access Limit
-</LI><LI>Change Privilege
-</LI><LI>Change User Group
-</LI></OL></BLOCKQUOTE><H4>
-
- User Management Page Access
-
-</H4><P>Whenever a browser requests a page, WebServer checks to see if there is an AccessLimit assigned to the requested page. Access Limits are usually stored in support files contained in the same directory as the requested page. If no user group is assigned to the access limit, then the default privilege takes effect with WebServer taking the following actions:
-
-</P><BLOCKQUOTE><UL><LI>If the default Privilege is "none", WebServer responds with the "File not Found" header.
-</LI><LI>If the default Privilege is not "none", WebServer returns the page.</LI></UL></BLOCKQUOTE><P>If a user group is assigned to the access limit, then WebServer:</P><OL><OL><LI>Sends an Authenticate response header (DAA if enabled).
-</LI><LI>Waits for the receipt of Authorization Request Header from the client.</LI><LI>Compares the user id and password with those stored in the registered context.
-</LI><LI>Sends the page to the client if the user is authorized.
-
-
-
-</LI></OL></OL><H4> </H4></td></tr></table>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/over/webs_block.jpg b/xbmc/lib/libGoAhead/web/over/webs_block.jpg Binary files differdeleted file mode 100644 index cfb5dd1a1b..0000000000 --- a/xbmc/lib/libGoAhead/web/over/webs_block.jpg +++ /dev/null diff --git a/xbmc/lib/libGoAhead/web/overview.htm b/xbmc/lib/libGoAhead/web/overview.htm deleted file mode 100644 index 4f7c288682..0000000000 --- a/xbmc/lib/libGoAhead/web/overview.htm +++ /dev/null @@ -1,26 +0,0 @@ -<HTML>
-<!- Copyright (c) Go Ahead Software Inc., 1999-2000. All Rights Reserved. ->
-<HEAD>
-<TITLE>GoAhead Web Server Overview</TITLE>
-<LINK REL="stylesheet" HREF="style/normal_ws.css" TYPE="text/css">
-</HEAD>
-
-<BODY>
-<TABLE WIDTH="550" BORDER="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#FFFFFF"><TR BORDERCOLOR="#FFFFFF"><TD><H1>WebServer 2.1 Overview</H1><P>GoAhead WebServer 2.1 is a fully-featured, open-source embedded Web server that leverages Active Server Pages, embedded JavaScript, and in-process CGI forms processing (GoForms™) to deliver highly efficient and effective dynamic web page creation. Its source code is available free on the GoAhead website (<A HREF="http://www.goahead.com/webserver/wsregister.htm" TARGET="new">http://www.goahead.com/webserver/wsregister.htm</A>) to developers without royalties or proprietary lock-ins and is subject to the terms specified in the GoAhead <A HREF="docs/license.htm">License Agreement</A>. </P><H2>Main Features</H2><UL>
- <LI><A HREF="over/asp.htm">Active Server Pages</A>
- <LI><A HREF="over/ejs.htm">Embedded JavaScript</A></LI><LI><A HREF="over/cgi.htm">Standard CGI Implementation</A></LI><LI><A HREF="over/goforms.htm">GoForms</A>™ (in-memory CGI processing)
- <LI><A HREF="over/security.htm">Security</A>
- <LI><A HREF="over/urlhandles.htm">URL Handlers</A>
- <LI><A HREF="docs/techref.htm">Extensive API Documentation</A>
- <LI>Small Footprint -- 50K RAM
- <LI>Fast -- over 50 requests per second
- <LI>Fully standards compliant</LI></UL><H2>Specifications</H2><H4>Memory Requirements </H4><UL><LI>60K RAM without SSI; 500K with SSI implimented (based upon VxWorks OS)</LI><LI>Web pages can be stored in ROM or filesystem </LI></UL><H4> System Requirements</H4><UL>
-<LI>TCP/IP stack </LI><LI>Event timer</LI></UL><H4>Operating System Suppport </H4><H2></H2><UL>
- <LI>eCos</LI><LI>LINUX </LI><LI>LynxOS</LI><LI>QNX</LI><LI>VxWorks 5.3.1</LI><LI>VxWorks 5.4</LI><LI>Windows 2000</LI><LI>Windows 98</LI><LI>Windows 95 </LI><LI>Windows NT</LI><LI>Windows CE</LI></UL><H2><FONT FACE="Arial, Helvetica, sans-serif">Copyright Information</FONT> </H2><H3>Trademarks </H3><P>GoAhead and GoAhead WebServer are registered trademarks of GoAhead Software. All other brand or product names are the trademarks or
-registered trademarks of their respective holders. </P><H3>Copyright </H3><P>Copyright © 1999, 2000 GoAhead Software, Inc. All rights reserved. </P><P>Product and technical information in this document is subject to change
-without notice and does not represent a commitment on the part of GoAhead
-Software, Inc. </P><H3>Copy Restrictions </H3><P>The software described in this document may be used and copied only in
-accordance with the terms of the accompanying license agreement. </P><P>GoAhead Software, Inc. <BR>10900 NE 8th Street<BR>Suite 750 <BR>Bellevue, WA
-98004<BR>(425) 453-1900 <BR>www.goahead.com <BR>info@goahead.com </P><P> </P><H2></H2><H4></H4><P> </P></TD></TR></TABLE><H2> </H2>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/savecfg.asp b/xbmc/lib/libGoAhead/web/savecfg.asp deleted file mode 100644 index 515c444ee3..0000000000 --- a/xbmc/lib/libGoAhead/web/savecfg.asp +++ /dev/null @@ -1,24 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 2000-2000. All Rights Reserved. ->
-<head>
-<title>Save the User Configuration</title>
-<link rel="stylesheet" href="style/normal_ws.css" type="text/css">
-<% language=javascript %>
-</head>
-
-<body>
-<h1>Permanently save the user configuration</h1>
-<form action=/goform/SaveUserManagement method=POST>
-
-<table>
-<tr>
- <td></td>
- <td ALIGN="CENTER">
- <input type=submit name=ok value="OK" title="Save Configuration"> <input type=submit name=ok value="Cancel"></td>
-</tr>
-</table>
-
-</form>
-
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/small.htm b/xbmc/lib/libGoAhead/web/small.htm deleted file mode 100644 index 0e9c02772a..0000000000 --- a/xbmc/lib/libGoAhead/web/small.htm +++ /dev/null @@ -1,18 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 1999-2000. All Rights Reserved. ->
-<body>
-<pre>
- 0 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 3 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 4 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 5 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 6 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 8 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 9 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 10 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-</pre>
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/style/doc.css b/xbmc/lib/libGoAhead/web/style/doc.css deleted file mode 100644 index 3fc11a79bb..0000000000 --- a/xbmc/lib/libGoAhead/web/style/doc.css +++ /dev/null @@ -1,42 +0,0 @@ -body {
- font-family: Arial, Helvetica, sans-serif; font-size: 9pt;
-; margin-right: 5px; margin-left: 10px
-}
-p {
-; margin-left: 30px
-; font-family: Arial, Helvetica, sans-serif; color: #333333
-; font-size: 9pt
-}
-h3 {
- font-size: 10pt; font-weight: bold;
-; margin-top: 8pt
-; font-family: Arial, Helvetica, sans-serif; color: #0066CC
-}
-h2 {
- font-size: 11pt; font-weight: bold;
-; margin-top: 8pt
-; font-family: Arial, Helvetica, sans-serif; color: #0066CC
-}
-h1 {
- font-size: 16pt; font-weight: bold;
-; font-family: Arial, Helvetica, sans-serif; color: #0066CC
-}
-pre {
- background-color: #EEEEEE;
-; color: #0A0A8C; font-family: "Courier New", Courier, mono; font-size: 9pt
-; padding-left: 31px
-; padding-top: 5px; padding-right: 20px; padding-bottom: 5px
-}
-li {
-; font-family: Arial, Helvetica, sans-serif; color: #333333
-; margin-left: 30px
-; font-size: 9pt
-}
-td { font-family: Arial, Helvetica, sans-serif; font-size: 9pt; color: #333333; vertical-align: top}
-
-ul { ; font-family: Arial, Helvetica, sans-serif; color: #333333; margin-left: 30px; font-size: 9pt }
-.titleLeft { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; width: 33%; color: #0066CC; text-align: left}
-.titleCenter { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; width: 33%; color: #0066CC; text-align: center}
-.titleRight { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; width: 33%; color: #0066CC; text-align: right}
-table { padding-left: 30px}
-.apiTitle { padding-left: 0px}
diff --git a/xbmc/lib/libGoAhead/web/style/help.htm b/xbmc/lib/libGoAhead/web/style/help.htm deleted file mode 100644 index 6bdd66b173..0000000000 --- a/xbmc/lib/libGoAhead/web/style/help.htm +++ /dev/null @@ -1,40 +0,0 @@ -<style>
-<!- Copyright (c) Go Ahead Software Inc., 1999-2000. All Rights Reserved. ->
-<!--
- body {
- font-family: Veranda, Arial, Helvetica;
- font-size: 12pt;
- color: #0000A0;
- }
- p {
- font-family: Arial, Helvetica;
- font-size: 12pt;
- color: #0000A0;
- }
- h2 {
- font-family: Arial, Helvetica;
- font-size: 14pt;
- font-weight: bold;
- color: #0000A0;
- margin: 8pt 0pt 0pt 0pt;
- padding: 0 0 0 0;
- }
- h1 {
- font-family: Arial, Helvetica;
- font-size: 16pt;
- font-weight: bold;
- color: #0000A0;
- margin: 8pt 0pt 0pt 0pt;
- padding: 0 0 0 0;
- }
- td {
- font-family: Arial, Helvetica;
- font-size: 9pt;
- color: #0000A0;
- }
- a:link {
- text-decoration: underline;
- color: #0000A0;
- }
--->
-</style>
diff --git a/xbmc/lib/libGoAhead/web/style/menu.htm b/xbmc/lib/libGoAhead/web/style/menu.htm deleted file mode 100644 index cc1dd5a057..0000000000 --- a/xbmc/lib/libGoAhead/web/style/menu.htm +++ /dev/null @@ -1,55 +0,0 @@ -<style>
-<!- Copyright (c) Go Ahead Software Inc., 1999-2000. All Rights Reserved. ->
-<!--
- body {
- font-family: Veranda, Arial, Helvetica;
- font-size: 9pt;
- color: #ffffff;
- background-graphic: graphics/stripe.jpg;
- }
- p {
- font-family: Arial, Helvetica;
- font-size: 9pt;
- color: #ffffff;
- }
- h1 {
- font-family: Arial, Helvetica;
- font-size: 11pt;
- font-weight: bold;
- color: #ffffff;
- margin-top: 8pt;
- margin-bottom: 4pt
- }
- h2 {
- font-family: Arial, Helvetica;
- font-size: 9pt;
- font-weight: bold;
- color: #ffffff;
- margin-top: 8pt;
- margin-bottom: 4pt;
- padding-left: 12
- }
- h3 {
- font-family: Arial, Helvetica;
- font-size: 9pt;
- font-weight: normal;
- color: #ffffff;
- margin: 0pt 0pt 0pt 0pt;
- padding: 0 0 0 30;
- }
-h4 { font-family: Arial, Helvetica; font-size: 9pt; font-weight: normal; color: #ffffff; ; margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 15px; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 30}
- a:link {
- text-decoration: underline;
- color: #33ccff;
- }
- a:visited {
- text-decoration: underline;
- color: #3399ff;
- }
- a:active {
- text-decoration: underline;
- color: #ccffff;
- }
--->
-</style>
-
diff --git a/xbmc/lib/libGoAhead/web/style/normal_ws.css b/xbmc/lib/libGoAhead/web/style/normal_ws.css deleted file mode 100644 index 3d86c39750..0000000000 --- a/xbmc/lib/libGoAhead/web/style/normal_ws.css +++ /dev/null @@ -1,37 +0,0 @@ -body {
- font-family: Arial, Helvetica, sans-serif; font-size: 9pt;
-}
-p {
- font-size: 9pt;
-; margin-left: 10px
-; font-family: Arial, Helvetica, sans-serif; color: #333333
-}
-h1 {
- font-size: 14pt; font-weight: bold;
-; margin-left: 10px
-; font-family: Arial, Helvetica, sans-serif; color: #0066CC
-}
-h2 {
- font-size: 12pt; font-weight: bold;
-; margin-left: 10px
-; font-family: Arial, Helvetica, sans-serif; color: #0066CC
-}
-h3 {
- font-size: 10pt; font-weight: bold;
-; margin-left: 10px
-; font-family: Arial, Helvetica, sans-serif; color: #0066CC
-}
-pre {
-line-height: normal;
-; color: #0A0A8C
-; font-family: "Courier New", Courier, mono; font-size: 9pt; margin-left: 10px; background-color: #EEEEEE; padding-left: 20px
-; padding-top: 5px; padding-bottom: 5px; padding-right: 20px
-}
-td {
- font-size: 9pt;
-; font-family: Arial, Helvetica, sans-serif; color: #333333
-}
-table { margin-left: 10px}
-ol { margin-left: 40px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 9pt}
-ul { font-size: 9pt; ; margin-left: 30px; font-family: Arial, Helvetica, sans-serif; color: #333333}
-h4 { font-size: 9pt; font-weight: bold; ; margin-left: 10px ; font-family: Arial, Helvetica, sans-serif; color: #0066CC}
diff --git a/xbmc/lib/libGoAhead/web/style/option.htm b/xbmc/lib/libGoAhead/web/style/option.htm deleted file mode 100644 index 9b1b23d712..0000000000 --- a/xbmc/lib/libGoAhead/web/style/option.htm +++ /dev/null @@ -1,28 +0,0 @@ -<style>
-<!- Copyright (c) Go Ahead Software Inc., 1999-2000. All Rights Reserved. ->
-<!--
- body {
- font-family: MS Sans Serif, Arial, Helvetica;
- font-size: 9pt;
- color: #0000A0;
- }
- p {
- font-family: MS Sans Serif, Arial, Helvetica;
- font-size: 9pt;
- color: #0000A0;
- }
- h2 {
- font-family: Arial, Helvetica;
- font-size: 9pt;
- font-weight: bold;
- color: #0000A0;
- margin: 0pt 0pt 0pt 0pt;
- padding: 0 0 0 0;
- }
- td {
- font-family: MS Sans Serif, Arial, Helvetica;
- font-size: 9pt;
- color: #0000A0;
- }
--->
-</style>
diff --git a/xbmc/lib/libGoAhead/web/tests.htm b/xbmc/lib/libGoAhead/web/tests.htm deleted file mode 100644 index 5a4ccbd4f0..0000000000 --- a/xbmc/lib/libGoAhead/web/tests.htm +++ /dev/null @@ -1,13 +0,0 @@ -<HTML>
-<HEAD>
-<TITLE>Testing WebServer</TITLE>
-<LINK REL="stylesheet" HREF="style/normal_ws.css" TYPE="text/css">
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-</HEAD>
-
-<BODY BGCOLOR="#FFFFFF">
-<H1>WebServer Tests </H1><P>The following tests are provided to verify WebServer functionality:</P><UL><BLOCKQUOTE><P><A HREF="asp.asp">JavaScript Test</A><BR><A HREF="forms.asp">GoForm Test</A><BR><A HREF="small.htm">HTML Test
-</A>
-</P></BLOCKQUOTE></UL>
-</BODY>
-</HTML>
diff --git a/xbmc/lib/libGoAhead/web/title.htm b/xbmc/lib/libGoAhead/web/title.htm deleted file mode 100644 index e7c426bd36..0000000000 --- a/xbmc/lib/libGoAhead/web/title.htm +++ /dev/null @@ -1,18 +0,0 @@ -
-<html>
-<!- Copyright (c) Go Ahead Software Inc., 1994-2000. All Rights Reserved. ->
-<head>
-<title>GoAhead WebServer</title>
-<meta http-equiv="Content-Type" content="text/html">
-
-
-
-
-
-</head>
-
-
-<body bgcolor="#ffffff">
-<img src="graphics/topbar.gif" width="900" height="70" border="0">
-</body>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/treeapp.asp b/xbmc/lib/libGoAhead/web/treeapp.asp deleted file mode 100644 index 2e78437502..0000000000 --- a/xbmc/lib/libGoAhead/web/treeapp.asp +++ /dev/null @@ -1,29 +0,0 @@ -<html>
-<!- Copyright (c) Go Ahead Software Inc., 1994-2000. All Rights Reserved. ->
-
-<head>
-<TITLE>GoAhead Embedded Management Framework Technical Reference</TITLE>
-<BASE TARGET="view">
-<% language=javascript %>
-<STYLE TYPE="TEXT/CSS">
-<!--
-body { background-color: #FFFFFF; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px}
--->
-</STYLE></head>
-
-<body background="graphics/sidebar.gif">
-
-<APPLET align=left code=treeApp.class codebase="/classes"
- height=100% id=TreeObject width=180 valign=top archive=treeapp.jar VSPACE="0" HSPACE="0">
- <PARAM NAME="authorization" VALUE="<% write(HTTP_AUTHORIZATION); %>">
- <PARAM NAME="fontcolor" VALUE="FFFFFF">
- <PARAM NAME="linecolor" VALUE="FFFFFF">
- <PARAM NAME="backgroundcolor" VALUE="000000">
- <PARAM NAME="datascript" VALUE="contents.asp">
- <PARAM NAME="port" VALUE="<% write(SERVER_PORT); %>">
- <PARAM NAME="hilightfontcolor" VALUE="FFF000">
- <PARAM NAME="system" VALUE="<% write(SERVER_ADDR); %>">
- <PARAM NAME="font" VALUE="Ariel,Helvetica bold 10">
-</APPLET>
-</BODY>
-</html>
diff --git a/xbmc/lib/libGoAhead/web/um.htm b/xbmc/lib/libGoAhead/web/um.htm deleted file mode 100644 index 40aca50603..0000000000 --- a/xbmc/lib/libGoAhead/web/um.htm +++ /dev/null @@ -1,10 +0,0 @@ -<html>
-<head>
-<title>Company Overview</title>
-<link rel="stylesheet" href="style/normal_ws.css">
-</head>
-
-<BODY>
-<table Width="550"><tr><td>
-<H1>User Management Functions</H1><H2>Add User </H2><P>The Add a User option calls up the URL, "<A HREF="adduser.asp">adduser.asp</A>". This Add a User data entry pane contains these fields:</P><BLOCKQUOTE><P> <B>User ID</B> - enter the ID of the user in this text field<BR><B>Group</B> - select a user group from this list for the user<BR><B>Enabled</B> -ensure that the Check box is checked to enable the user<BR><B>Password</B> - secure text field (displays asterisks)<BR><B>Confirm </B>- secure text field </P></BLOCKQUOTE><H2>Delete User </H2><P>The Delete a User option calls up the URL, <A HREF="deluser.asp">"deluser.asp</A>". The Delete a User data entry pane provides a list of all added users. Use this list to select the user you wish to delete.</P><P>Clicking OK deletes the selected user and updates the user list accordingly.</P><H2>Add Group </H2><P>The Add a User Group option calls up the URL, "<A HREF="addgroup.asp">addgroup.asp</A>". The Add Group data entry pane contains these fields:</P><BLOCKQUOTE><P> <B>Group Name</B> - enter the name of the group in this text field.<BR> <B>Privilege</B> - select privileges from this list to assign to the group (holding down the control key allows you to select multiple privileges)<BR> <B>Access Method</B> - select the default access method from the provided list that will be assigned to the group<BR> <B>Enabled</B> - ensure that the check box is selected to enable the user group</P></BLOCKQUOTE><H2>Delete Group </H2><P>The Delete a User Group option calls up the URL, "<A HREF="delgroup.asp">delgroup.asp</A>". The Delete Group data-entry pane provides a list of all added user groups. Use this list to select the user group you wish to delete. </P><P> Clicking the OK button deletes the selected user group then updates the user group list accordingly.</P><H2> Add Access Limit </H2><P>The Add an Access Limit option calls up the URL, "<A HREF="addlimit.asp">addlimit.asp</A>". The Add Access Limit data entry pane box provides the following fields:</P><BLOCKQUOTE><P> <B>URL</B> - enter the URL path to the page or the directory in this text field<BR><B>Group</B> - select the group (optional) to assign to the URL<BR> <B>Access Method</B> - select the access method from this list to assign to the URL. If a group is selected, this item is ignored. <BR> <B>Secure</B> - select this check box if you require data encryption for this URL. This item will be ignored unless SSL is installed. </P></BLOCKQUOTE><H2>Delete Access Limit </H2><P>The Delete an Access Limit option calls up the URL, "<A HREF="dellimit.asp">dellimit.asp</A>". The Delete Group data entry pane provides a list of all access limit that have been assigned to this URL. Use this list to select the access limit you wish to delete <B> </B></P><P>Clicking OK deletes the selected access limits then updates the list of existing access limits.</P><H2>Save the User Configuration</H2><P>This option calls up the URL, “<A HREF="savecfg.asp">savecfg.asp</A>”. The Permanently Save the User Configuration data entry pane contains no data fields. Clicking OK saves the current User Management configuration. If the user configuration data had been saved previously, it will be overwritten. Data is saved in the file “umconfig.txt”. </P><H2>Restore the User Configuration</H2><P>This option calls up the URL, "<A HREF="loadcfg.asp">loadcfg.asp</A>". The Re-load the Permanently Stored User Configuration data entry pane contains no data fields. Clicking OK replaces the current User Management configuration with the user configuration data previously saved. If no data has been saved, then the user configuration data will be deleted. Data is saved in the file "umconfig.txt".</P><H2> </H2></td></tr></table>
-</BODY></HTML>
diff --git a/xbmc/lib/libPython/xbmcmodule/xbmcmodule.cpp b/xbmc/lib/libPython/xbmcmodule/xbmcmodule.cpp index 936a71dd63..bc5e8a4b8d 100644 --- a/xbmc/lib/libPython/xbmcmodule/xbmcmodule.cpp +++ b/xbmc/lib/libPython/xbmcmodule/xbmcmodule.cpp @@ -46,7 +46,8 @@ #include "infotagvideo.h" #include "infotagmusic.h" #ifdef HAS_WEB_SERVER -#include "lib/libGoAhead/XBMChttp.h" +#include "lib/libhttpapi/XBMChttp.h" +#include "lib/libhttpapi/HttpApi.h" #endif #include "utils/GUIInfoManager.h" #include "GUIWindowManager.h" @@ -284,6 +285,7 @@ namespace PYXBMC return Py_None; } +#ifdef HAS_HTTPAPI // executehttpapi() method PyDoc_STRVAR(executeHttpApi__doc__, "executehttpapi(httpcommand) -- Execute an HTTP API command.\n" @@ -302,21 +304,16 @@ namespace PYXBMC CStdString ret; if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) return NULL; if (!m_pXbmcHttp) - { - CSectionLoader::Load("LIBHTTP"); m_pXbmcHttp = new CXbmcHttp(); - } - if (!pXbmcHttpShim) - { - pXbmcHttpShim = new CXbmcHttpShim(); - if (!pXbmcHttpShim) - return NULL; - } - ret=pXbmcHttpShim->xbmcExternalCall(cLine); + + CStdString method = cLine, parameter; + + ret = CHttpApi::MethodCall(method, parameter); return PyString_FromString(ret.c_str()); #endif } +#endif // sleep() method PyDoc_STRVAR(sleep__doc__, @@ -870,7 +867,9 @@ namespace PYXBMC {(char*)"getFreeMem", (PyCFunction)XBMC_GetFreeMem, METH_VARARGS, getFreeMem__doc__}, //{(char*)"getCpuTemp", (PyCFunction)XBMC_GetCpuTemp, METH_VARARGS, getCpuTemp__doc__}, +#ifdef HAS_HTTPAPI {(char*)"executehttpapi", (PyCFunction)XBMC_ExecuteHttpApi, METH_VARARGS, executeHttpApi__doc__}, +#endif {(char*)"getInfoLabel", (PyCFunction)XBMC_GetInfoLabel, METH_VARARGS, getInfoLabel__doc__}, {(char*)"getInfoImage", (PyCFunction)XBMC_GetInfoImage, METH_VARARGS, getInfoImage__doc__}, {(char*)"getCondVisibility", (PyCFunction)XBMC_GetCondVisibility, METH_VARARGS, getCondVisibility__doc__}, diff --git a/xbmc/lib/libhttpapi/HttpApi.cpp b/xbmc/lib/libhttpapi/HttpApi.cpp new file mode 100644 index 0000000000..5145537e4e --- /dev/null +++ b/xbmc/lib/libhttpapi/HttpApi.cpp @@ -0,0 +1,59 @@ +#include "HttpApi.h" +#include "log.h" +#include "XBMChttp.h" +#include "Application.h" +#include "ApplicationMessenger.h" + +#define MAX_PARAS 20 + +CStdString CHttpApi::MethodCall(CStdString &command, CStdString ¶meter) +{ + command = command.ToLower(); + parameter = parameter.ToLower(); + + if (parameter.IsEmpty()) + checkForFunctionTypeParas(command, parameter); + + int cnt=0; + + if (!parameter.IsEmpty()) + g_application.getApplicationMessenger().HttpApi(command + "; " + parameter, true); + else + g_application.getApplicationMessenger().HttpApi(command, true); + + //wait for response - max 20s + Sleep(0); + CStdString response = g_application.getApplicationMessenger().GetResponse(); + + while (response=="[No response yet]" && cnt++<200) + { + response=g_application.getApplicationMessenger().GetResponse(); + CLog::Log(LOGDEBUG, "HttpApi: waiting %d", cnt); + Sleep(100); + } + return response; +} + +bool CHttpApi::checkForFunctionTypeParas(CStdString &cmd, CStdString ¶s) +{ + int open, close; + open = cmd.Find("("); + if (open>0) + { + close=cmd.length(); + while (close>open && cmd.Mid(close,1)!=")") + close--; + if (close>open) + { + paras = cmd.Mid(open + 1, close - open - 1); + cmd = cmd.Left(open); + return (close-open)>1; + } + } + return false; +} + +int CHttpApi::xbmcCommand(const CStdString ¶meter) +{ + return m_pXbmcHttp->xbmcCommand(parameter); +} diff --git a/xbmc/lib/libhttpapi/HttpApi.h b/xbmc/lib/libhttpapi/HttpApi.h new file mode 100644 index 0000000000..a06103107e --- /dev/null +++ b/xbmc/lib/libhttpapi/HttpApi.h @@ -0,0 +1,10 @@ +#pragma once +#include "StdString.h" + +class CHttpApi +{ +public: + static CStdString MethodCall(CStdString &command, CStdString ¶meter); + static bool checkForFunctionTypeParas(CStdString &cmd, CStdString ¶s); + static int xbmcCommand(const CStdString ¶meter); +}; diff --git a/xbmc/lib/libhttpapi/Makefile.in b/xbmc/lib/libhttpapi/Makefile.in new file mode 100755 index 0000000000..b7f2aa0851 --- /dev/null +++ b/xbmc/lib/libhttpapi/Makefile.in @@ -0,0 +1,8 @@ +INCLUDES=-I. -I../ -I../../ -I../../../ -I../../utils -I../../FileSystem -I../../linux -I../../cores -I../../../guilib + +SRCS=HttpApi.cpp XBMChttp.cpp + +LIB= libhttpapi.a + +include ../../../Makefile.include + diff --git a/xbmc/lib/libGoAhead/XBMCConfiguration.cpp b/xbmc/lib/libhttpapi/XBMCConfiguration.cpp index 555a9292f1..a2bc84b249 100644 --- a/xbmc/lib/libGoAhead/XBMCConfiguration.cpp +++ b/xbmc/lib/libhttpapi/XBMCConfiguration.cpp @@ -22,16 +22,8 @@ #include "Settings.h" #include "XBMCConfiguration.h" #include "Util.h" -#include "includes.h" #include "URL.h" -#ifndef __GNUC__ -#pragma code_seg("WEB_TEXT") -#pragma data_seg("WEB_DATA") -#pragma bss_seg("WEB_BSS") -#pragma const_seg("WEB_RD") -#endif - CXbmcConfiguration::CXbmcConfiguration() { xbmcCfgLoaded = false; @@ -673,3 +665,32 @@ bool CXbmcConfiguration::IsValidOption(char* option) if (!strcmp("screenshots", option)) return true; return false; } + +bool XbmcWebConfigInit() +{ + if (!pXbmcWebConfig) { + pXbmcWebConfig = new CXbmcConfiguration(); + return true; + } + else + return false; +} + +void XbmcWebConfigRelease() +{ + if (pXbmcWebConfig) + { + delete pXbmcWebConfig; + pXbmcWebConfig=NULL; + } +} + +int XbmcWebsHttpAPIConfigBookmarkSize(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->BookmarkSize(-1, NULL, response, argc, argv) : -1; } +int XbmcWebsHttpAPIConfigGetBookmark(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->GetBookmark(-1, NULL, response, argc, argv) : -1; } +int XbmcWebsHttpAPIConfigAddBookmark(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->AddBookmark(-1, NULL, response, argc, argv) : -1; } +int XbmcWebsHttpAPIConfigSaveBookmark(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->SaveBookmark(-1, NULL, response, argc, argv) : -1; } +int XbmcWebsHttpAPIConfigRemoveBookmark(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->RemoveBookmark(-1, NULL, response, argc, argv) : -1; } +int XbmcWebsHttpAPIConfigSaveConfiguration(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->SaveConfiguration(-1, NULL, response, argc, argv) : -1; } +int XbmcWebsHttpAPIConfigGetOption(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->GetOption(-1, NULL, response, argc, argv) : -1; } +int XbmcWebsHttpAPIConfigSetOption(CStdString& response, int argc, char_t **argv) { return pXbmcWebConfig ? pXbmcWebConfig->SetOption(-1, NULL, response, argc, argv) : -1; } + diff --git a/xbmc/lib/libGoAhead/XBMCConfiguration.h b/xbmc/lib/libhttpapi/XBMCConfiguration.h index 9cce39a657..59b79eca5a 100644 --- a/xbmc/lib/libGoAhead/XBMCConfiguration.h +++ b/xbmc/lib/libhttpapi/XBMCConfiguration.h @@ -22,7 +22,6 @@ public: int SaveConfiguration( int eid, webs_t wp, CStdString& response, int argc, char_t **argv); int GetOption( int eid, webs_t wp, CStdString& response, int argc, char_t **argv); int SetOption( int eid, webs_t wp, CStdString& response, int argc, char_t **argv); - private: int Load(); bool IsValidOption(char* option); @@ -31,3 +30,15 @@ private: bool xbmcCfgLoaded; }; + + bool XbmcWebConfigInit(); + void XbmcWebConfigRelease(); + + int XbmcWebsHttpAPIConfigBookmarkSize(CStdString& response, int argc, char_t **argv); + int XbmcWebsHttpAPIConfigGetBookmark(CStdString& response, int argc, char_t **argv); + int XbmcWebsHttpAPIConfigAddBookmark(CStdString& response, int argc, char_t **argv); + int XbmcWebsHttpAPIConfigSaveBookmark(CStdString& response, int argc, char_t **argv); + int XbmcWebsHttpAPIConfigRemoveBookmark(CStdString& response, int argc, char_t **argv); + int XbmcWebsHttpAPIConfigSaveConfiguration(CStdString& response, int argc, char_t **argv); + int XbmcWebsHttpAPIConfigGetOption(CStdString& response, int argc, char_t **argv); + int XbmcWebsHttpAPIConfigSetOption(CStdString& response, int argc, char_t **argv); diff --git a/xbmc/lib/libGoAhead/XBMChttp.cpp b/xbmc/lib/libhttpapi/XBMChttp.cpp index 4fffdc3f3d..97820e3224 100644 --- a/xbmc/lib/libGoAhead/XBMChttp.cpp +++ b/xbmc/lib/libhttpapi/XBMChttp.cpp @@ -10,9 +10,9 @@ /********************************* Includes ***********************************/ #include "Application.h" -#include "WebServer.h" +#include "XBMCConfiguration.h" #include "XBMChttp.h" -#include "includes.h" +//#include "includes.h" #include "GUIWindowManager.h" #include "PlayListFactory.h" @@ -67,7 +67,6 @@ using namespace MUSIC_INFO; #define NO_EID -1 CXbmcHttp* m_pXbmcHttp; -CXbmcHttpShim* pXbmcHttpShim; CUdpBroadcast::CUdpBroadcast() : CUdpClient() @@ -396,7 +395,7 @@ int CXbmcHttp::displayDir(int numParas, CStdString paras[]) numLines = atoi(paras[4]); if (!CDirectory::GetDirectory(folder, dirItems, mask)) { - return SetResponse(openTag+"Error:Not folder"); + return SetResponse(openTag+"Error: " + folder + "Not folder"); } if (option=="size") { @@ -1207,33 +1206,6 @@ int CXbmcHttp::xbmcClearPlayList(int numParas, CStdString paras[]) return SetResponse(openTag+"OK"); } -int CXbmcHttp::xbmcSwapPlayListItems(int numParas, CStdString paras[]) -{ - int iPlayList ; - if (numParas < 3) - return SetResponse(openTag+"Error: Not enough parameters"); - iPlayList=g_playlistPlayer.GetCurrentPlaylist(); - if (numParas > 2) - iPlayList = atoi(paras[2]); - CPlayList& playlist = g_playlistPlayer.GetPlaylist(iPlayList); - - int item1; - if (StringUtils::IsNaturalNumber(paras[0])) - item1 = atoi(paras[0]); - else - item1=FindPathInPlayList(iPlayList,paras[0]); - int item2; - if (StringUtils::IsNaturalNumber(paras[1])) - item2 = atoi(paras[1]); - else - item2=FindPathInPlayList(iPlayList,paras[1]); - - if (playlist.Swap(item1,item2)) - return SetResponse(openTag+"OK"); - - return SetResponse(openTag+"Error swapping items"); -} - int CXbmcHttp::xbmcGetDirectory(int numParas, CStdString paras[]) { if (numParas>0) @@ -1388,7 +1360,7 @@ int CXbmcHttp::xbmcGetCurrentlyPlaying(int numParas, CStdString paras[]) { output = openTag + "Filename:" + fileItem.m_strPath; // currently playing item filename if (g_application.IsPlaying()) - if (!g_application.m_pPlayer->IsPaused()) + if (!g_application.m_pPlayer->IsPaused()) output+=closeTag+openTag+"PlayStatus:Playing"; else output+=closeTag+openTag+"PlayStatus:Paused"; @@ -1833,20 +1805,6 @@ int CXbmcHttp::xbmcGetThumb(int numParas, CStdString paras[], bool bGetThumb) thumb+=paras[0]; thumb+="\">"; } - if (tempSkipWebFooterHeader) - { - CStdString strHttpResponseHeaders; - strHttpResponseHeaders.Format( - "HTTP/1.0 200 OK\r\n" - "Pragma: no-cache\r\n" - "Cache-control: no-cache\r\n" - "Content-Length: %i\r\n" - "Content-Type: text/plain\r\n" - "\r\n" - ,thumb.length() - ); - return SetResponse( strHttpResponseHeaders + thumb); - } return SetResponse(thumb) ; } @@ -2427,20 +2385,6 @@ int CXbmcHttp::xbmcDownloadInternetFile(int numParas, CStdString paras[]) { if (dest=="special://temp/xbmcDownloadInternetFile.tmp") CFile::Delete(dest); - if (tempSkipWebFooterHeader) - { - CStdString strHttpResponseHeaders; - strHttpResponseHeaders.Format( - "HTTP/1.0 200 OK\r\n" - "Pragma: no-cache\r\n" - "Cache-control: no-cache\r\n" - "Content-Length: %i\r\n" - "Content-Type: text/plain\r\n" - "\r\n" - ,encoded.length() - ); - return SetResponse( strHttpResponseHeaders + encoded); - } return SetResponse(encoded) ; } } @@ -2745,7 +2689,7 @@ int CXbmcHttp::xbmcSTSetting(int numParas, CStdString paras[]) int CXbmcHttp::xbmcConfig(int numParas, CStdString paras[]) { - int argc=0, ret=-1; +/* int argc=0, ret=-1; char_t* argv[20]; CStdString response=""; @@ -2757,7 +2701,7 @@ int CXbmcHttp::xbmcConfig(int numParas, CStdString paras[]) argv[argc]=(char_t*)paras[argc+1].c_str(); } argv[argc]=NULL; - bool createdWebConfigObj=XbmcWebConfigInit(); + bool createdWebConfigObj = XbmcWebConfigInit(); if (paras[0]=="bookmarksize") { ret=XbmcWebsHttpAPIConfigBookmarkSize(response, argc, argv); @@ -2801,12 +2745,12 @@ int CXbmcHttp::xbmcConfig(int numParas, CStdString paras[]) } if (createdWebConfigObj) XbmcWebConfigRelease(); - if (ret==-1) - return SetResponse(openTag+"Error:WebServer needs to be running - is it?"); - else + if (ret==-1)*/ + return SetResponse(openTag+"Error:Deprecated"); +/* else { return SetResponse(openTag+response); - } + }*/ } int CXbmcHttp::xbmcGetSystemInfo(int numParas, CStdString paras[]) @@ -2861,10 +2805,10 @@ bool CXbmcHttp::xbmcBroadcast(CStdString message, int level) { if (!pUdpBroadcast) pUdpBroadcast = new CUdpBroadcast(); - CStdString LocalAddress = g_application.getNetwork().GetFirstConnectedInterface()->GetCurrentIPAddress(); + CStdString LocalAddress = g_application.getNetwork().GetFirstConnectedInterface()->GetCurrentIPAddress(); CStdString msg; - if ((g_settings.m_HttpApiBroadcastLevel & 128)==128) - message += ";"+g_application.getNetwork().GetFirstConnectedInterface()->GetCurrentIPAddress(); + if ((g_settings.m_HttpApiBroadcastLevel & 128)==128) + message += ";"+g_application.getNetwork().GetFirstConnectedInterface()->GetCurrentIPAddress(); msg.Format(openBroadcast+message+";%i"+closeBroadcast, level); return pUdpBroadcast->broadcast(msg, g_settings.m_HttpApiBroadcastPort); } @@ -2898,7 +2842,7 @@ int CXbmcHttp::xbmcSetBroadcast(int numParas, CStdString paras[]) { g_settings.m_HttpApiBroadcastLevel=atoi(paras[0]); if (g_settings.m_HttpApiBroadcastLevel==128) - g_settings.m_HttpApiBroadcastLevel=0; + g_settings.m_HttpApiBroadcastLevel=0; if (numParas>1) g_settings.m_HttpApiBroadcastPort=atoi(paras[1]); return SetResponse(openTag+"OK"); @@ -2958,7 +2902,7 @@ int CXbmcHttp::xbmcTakeScreenshot(int numParas, CStdString paras[]) filepath = paras[0]; if (numParas>5) { - CStdString tmpFile = "special://temp/temp.png"; + CStdString tmpFile = "special://temp/temp.bmp"; CUtil::TakeScreenshot(tmpFile, true); int height, width; if (paras[4]=="") @@ -3079,7 +3023,7 @@ int CXbmcHttp::xbmcSetLogLevel(int numParas, CStdString paras[]) int CXbmcHttp::xbmcWebServerStatus(int numParas, CStdString paras[]) { - if (numParas==0) +/* if (numParas==0) { if (g_application.m_pWebServer) return SetResponse(openTag+"On"); @@ -3106,7 +3050,8 @@ int CXbmcHttp::xbmcWebServerStatus(int numParas, CStdString paras[]) return SetResponse(openTag+"OK"); } else - return SetResponse(openTag+"Error:Unknown parameter"); + return SetResponse(openTag+"Error:Unknown parameter");*/ + return false; } int CXbmcHttp::xbmcSetResponseFormat(int numParas, CStdString paras[]) @@ -3192,7 +3137,6 @@ int CXbmcHttp::xbmcCommand(const CStdString ¶meter) if (command == "clearplaylist") retVal = xbmcClearPlayList(numParas, paras); else if (command == "addtoplaylist") retVal = xbmcAddToPlayList(numParas, paras); else if (command == "addtoplaylistfromdb") retVal = xbmcAddToPlayListFromDB(numParas, paras); - else if (command == "swapplaylistitems") retVal = xbmcSwapPlayListItems(numParas, paras); else if (command == "playfile") retVal = xbmcPlayerPlayFile(numParas, paras); else if (command == "pause") retVal = xbmcAction(numParas, paras,1); else if (command == "stop") retVal = xbmcAction(numParas, paras,2); @@ -3310,173 +3254,3 @@ int CXbmcHttp::xbmcCommand(const CStdString ¶meter) //CLog::Log(LOGDEBUG, "HttpApi Finished command: %s", command.c_str()); return retVal; } - -CXbmcHttpShim::CXbmcHttpShim() -{ - CLog::Log(LOGDEBUG, "xbmcHttpShim starts"); -} - -CXbmcHttpShim::~CXbmcHttpShim() -{ -CLog::Log(LOGDEBUG, "xbmcHttpShim ends"); -} - -bool CXbmcHttpShim::checkForFunctionTypeParas(CStdString &cmd, CStdString ¶s) -{ - int open, close; - open = cmd.Find("("); - if (open>0) - { - close=cmd.length(); - while (close>open && cmd.Mid(close,1)!=")") - close--; - if (close>open) - { - paras = cmd.Mid(open + 1, close - open - 1); - cmd = cmd.Left(open); - return (close-open)>1; - } - } - return false; -} - -CStdString CXbmcHttpShim::flushResult(int eid, webs_t wp, const CStdString &output) -{ - if (output!="") - { - if (eid==NO_EID && wp!=NULL) - websWriteBlock(wp, (char_t *) output.c_str(), output.length()) ; - else if (eid!=NO_EID) - ejSetResult( eid, (char_t *)output.c_str()); - else - return output; - } - return ""; -} - -CStdString CXbmcHttpShim::xbmcExternalCall(char *command) -{ - if (m_pXbmcHttp && m_pXbmcHttp->shuttingDown) - return ""; - int open, close; - CStdString parameter="", cmd=command, execute; - open = cmd.Find("("); - if (open>0) - { - close=cmd.length(); - while (close>open && cmd.Mid(close,1)!=")") - close--; - if (close>open) - { - parameter = cmd.Mid(open + 1, close - open - 1); - parameter.Replace(",",";"); - execute = cmd.Left(open); - } - else //open bracket but no close - return ""; - } - else //no parameters - execute = cmd; - CUtil::URLDecode(parameter); - return xbmcProcessCommand(NO_EID, NULL, (char_t *) execute.c_str(), (char_t *) parameter.c_str()); -} - -/* Parse an XBMC HTTP API command */ -CStdString CXbmcHttpShim::xbmcProcessCommand( int eid, webs_t wp, char_t *command, char_t *parameter) -{ - if (m_pXbmcHttp && m_pXbmcHttp->shuttingDown) - return ""; - CStdString cmd=command, paras=parameter, response="[No response yet]", retVal; - bool legalCmd=true; - //CLog::Log(LOGDEBUG, "XBMCHTTPShim: Received command %s (%s)", cmd.c_str(), paras.c_str()); - int cnt=0; - - checkForFunctionTypeParas(cmd, paras); - if (wp!=NULL) - { - //we are being called via the webserver (rather than Python) so add any specific checks here - if ((cmd=="webserverstatus") && (paras!=""))//(strcmp(parameter,XBMC_NONE))) - { - response=m_pXbmcHttp->GetOpenTag()+"Error:Can't turn off/on WebServer via a web call"; - legalCmd=false; - } - } - if (legalCmd) - { - if (paras!="") - g_application.getApplicationMessenger().HttpApi(cmd+"; "+paras, true); - else - g_application.getApplicationMessenger().HttpApi(cmd, true); - //wait for response - max 20s - Sleep(0); - response=g_application.getApplicationMessenger().GetResponse(); - while (response=="[No response yet]" && cnt++<200) - { - response=g_application.getApplicationMessenger().GetResponse(); - CLog::Log(LOGDEBUG, "XBMCHTTPShim: waiting %d", cnt); - Sleep(100); - } - if (cnt>199) - { - response=m_pXbmcHttp->GetOpenTag()+"Error:Timed out"; - CLog::Log(LOGDEBUG, "HttpApi Timed out"); - } - } - //flushresult - if (wp!=NULL) - { - if (eid==NO_EID && m_pXbmcHttp && !m_pXbmcHttp->tempSkipWebFooterHeader) - { - if (m_pXbmcHttp->incWebHeader) - websHeader(wp); - } - } - retVal=flushResult(eid, wp, m_pXbmcHttp->userHeader+response+m_pXbmcHttp->userFooter); - if (m_pXbmcHttp) //this should always be true unless something is very wrong - if ((wp!=NULL) && (m_pXbmcHttp->incWebFooter) && eid==NO_EID && !m_pXbmcHttp->tempSkipWebFooterHeader) - websFooter(wp); - return retVal; -} - - -/* XBMC Javascript binding for ASP. This will be invoked when "APICommand" is - * embedded in an ASP page. - */ -int CXbmcHttpShim::xbmcCommand( int eid, webs_t wp, int argc, char_t **argv) -{ - char_t *command, *parameter; - if (m_pXbmcHttp && m_pXbmcHttp->shuttingDown) - return -1; - - int parameters = ejArgs(argc, argv, T((char*)"%s %s"), &command, ¶meter); - if (parameters < 1) - { - websError(wp, 500, T((char*)"Error:Insufficient args")); - return -1; - } - else if (parameters < 2) - parameter = (char*)""; - xbmcProcessCommand( eid, wp, command, parameter); - return 0; -} - -/* XBMC form for posted data (in-memory CGI). - */ -void CXbmcHttpShim::xbmcForm(webs_t wp, char_t *path, char_t *query) -{ - char_t *command, *parameter; - - if (m_pXbmcHttp && m_pXbmcHttp->shuttingDown) - return; - command = websGetVar(wp, (char*)WEB_COMMAND, (char*)""); - parameter = websGetVar(wp, (char*)WEB_PARAMETER, (char*)""); - - // do the command - - xbmcProcessCommand( NO_EID, wp, command, parameter); - - if (wp->timeout!=-1) - websDone(wp, 200); - else - CLog::Log(LOGERROR, "HttpApi Timeout command: %s", query); -} diff --git a/xbmc/lib/libGoAhead/XBMChttp.h b/xbmc/lib/libhttpapi/XBMChttp.h index d765b07161..22d522f24a 100644 --- a/xbmc/lib/libGoAhead/XBMChttp.h +++ b/xbmc/lib/libhttpapi/XBMChttp.h @@ -15,24 +15,10 @@ /********************************* Includes ***********************************/ typedef char char_t; -typedef struct websRec *webs_t; class CFileItem; typedef boost::shared_ptr<CFileItem> CFileItemPtr; -class CXbmcHttpShim -{ -public: - CXbmcHttpShim(); - ~CXbmcHttpShim(); - - void xbmcForm(webs_t wp, char_t *path, char_t *query); - int xbmcCommand( int eid, webs_t wp, int argc, char_t **argv); - CStdString xbmcProcessCommand( int eid, webs_t wp, char_t *command, char_t *parameter); - CStdString xbmcExternalCall(char *command); - bool checkForFunctionTypeParas(CStdString &cmd, CStdString ¶s); -private: - CStdString flushResult(int eid, webs_t wp, const CStdString &output); -}; + class CUdpBroadcast : public CUdpClient { @@ -70,7 +56,6 @@ public: int xbmcRemoveFromPlayList(int numParas, CStdString paras[]); int xbmcSetPlayListSong(int numParas, CStdString paras[]); int xbmcGetPlayListSong(int numParas, CStdString paras[]); - int xbmcSwapPlayListItems(int numParas, CStdString paras[]); int xbmcSetPlaySpeed(int numParas, CStdString paras[]); int xbmcGetPlaySpeed(); int xbmcPlayListNext(); @@ -157,7 +142,6 @@ private: int splitParameter(const CStdString ¶meter, CStdString& command, CStdString paras[], const CStdString &sep); bool playableFile(const CStdString &filename); int SetResponse(const CStdString &response); - CStdString flushResult(int eid, webs_t wp, const CStdString &output); int displayDir(int numParas, CStdString paras[]); void SetCurrentMediaItem(CFileItem& newItem); void AddItemToPlayList(const CFileItemPtr &pItem, int playList, int sortMethod, CStdString mask, bool recursive); @@ -174,4 +158,3 @@ private: #define WEB_PARAMETER T("parameter") extern CXbmcHttp* m_pXbmcHttp; //make it global so Application.cpp can access it for key/button messages -extern CXbmcHttpShim* pXbmcHttpShim; diff --git a/xbmc/lib/libjsonrpc/AVPlayerOperations.cpp b/xbmc/lib/libjsonrpc/AVPlayerOperations.cpp new file mode 100644 index 0000000000..586903a0ee --- /dev/null +++ b/xbmc/lib/libjsonrpc/AVPlayerOperations.cpp @@ -0,0 +1,200 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "AVPlayerOperations.h" +#include "Application.h" +#include "Builtins.h" +#include "Util.h" +#include "PlayListPlayer.h" + +using namespace Json; +using namespace JSONRPC; + +JSON_STATUS CAVPlayerOperations::PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CBuiltins::Execute("playercontrol(play)"); + result["playing"] = g_application.IsPlaying(); + result["paused"] = g_application.IsPaused(); + return OK; +} + +JSON_STATUS CAVPlayerOperations::Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CAction action; + action.actionId = ACTION_STOP; + g_application.getApplicationMessenger().SendAction(action); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CAction action; + action.actionId = ACTION_PREV_ITEM; + g_application.getApplicationMessenger().SendAction(action); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CAction action; + action.actionId = ACTION_NEXT_ITEM; + g_application.getApplicationMessenger().SendAction(action); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::BigSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CBuiltins::Execute("playercontrol(bigskipbackward)"); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::BigSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CBuiltins::Execute("playercontrol(bigskipforward)"); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::SmallSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CBuiltins::Execute("playercontrol(smallskipbackward)"); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::SmallSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CBuiltins::Execute("playercontrol(smallskipforward)"); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::Rewind(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CAction action; + action.actionId = ACTION_PLAYER_REWIND; + g_application.getApplicationMessenger().SendAction(action); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::Forward(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CAction action; + action.actionId = ACTION_PLAYER_FORWARD; + g_application.getApplicationMessenger().SendAction(action); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::Record(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + CBuiltins::Execute("playercontrol(record)"); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::GetTime(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + result["time"] = (int)g_application.GetTime(); + result["total"] = (int)g_application.GetTotalTime(); + return OK; +} + +JSON_STATUS CAVPlayerOperations::GetTimeMS(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + result["time"] = (int)(g_application.GetTime() * 1000.0); + result["total"] = (int)(g_application.GetTotalTime() * 1000.0); + return OK; +} + +JSON_STATUS CAVPlayerOperations::GetPercentage(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + Value val = g_application.GetPercentage(); + result.swap(val); + return OK; +} + +JSON_STATUS CAVPlayerOperations::SeekTime(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!parameterObject.isInt()) + return InvalidParams; + if (!IsCorrectPlayer(method)) + return FailedToExecute; + + g_application.SeekTime(parameterObject.asInt()); + return ACK; +} + +JSON_STATUS CAVPlayerOperations::GetPlaylist(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + int playlist = PLAYLIST_NONE; + if (method.Left(5).Equals("music")) + playlist = PLAYLIST_MUSIC; + else if (method.Left(5).Equals("video")) + playlist = PLAYLIST_VIDEO; + + Value val = playlist; + result.swap(val); + + return OK; +} + +bool CAVPlayerOperations::IsCorrectPlayer(const CStdString &method) +{ + return (method.Left(5).Equals("music") && g_application.IsPlayingAudio()) || (method.Left(5).Equals("video") && g_application.IsPlayingVideo()); +} diff --git a/xbmc/lib/libjsonrpc/AVPlayerOperations.h b/xbmc/lib/libjsonrpc/AVPlayerOperations.h new file mode 100644 index 0000000000..cbcf848643 --- /dev/null +++ b/xbmc/lib/libjsonrpc/AVPlayerOperations.h @@ -0,0 +1,55 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "StdString.h" +#include "JSONRPC.h" + +namespace JSONRPC +{ + class CAVPlayerOperations + { + public: + static JSON_STATUS PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS BigSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS BigSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS SmallSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS SmallSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS Rewind(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Forward(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS Record(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS GetTime(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetTimeMS(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetPercentage(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS SeekTime(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS GetPlaylist(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + private: + static inline bool IsCorrectPlayer(const CStdString &method); + }; +} diff --git a/xbmc/lib/libjsonrpc/FileItemHandler.cpp b/xbmc/lib/libjsonrpc/FileItemHandler.cpp new file mode 100644 index 0000000000..7586fa439a --- /dev/null +++ b/xbmc/lib/libjsonrpc/FileItemHandler.cpp @@ -0,0 +1,268 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "FileItemHandler.h" +#include "../Util.h" + +using namespace MUSIC_INFO; +using namespace Json; +using namespace JSONRPC; + +void CFileItemHandler::FillVideoDetails(const CVideoInfoTag *videoInfo, const Value& parameterObject, Value &result) +{ + if (videoInfo->IsEmpty()) + return; + + if (!videoInfo->m_strTitle.IsEmpty()) + result["title"] = videoInfo->m_strTitle.c_str(); + + if (!videoInfo->m_strFileNameAndPath.IsEmpty()) + result["file"] = videoInfo->m_strFileNameAndPath.c_str(); + + const Value fields = parameterObject.isMember("fields") && parameterObject["fields"].isArray() ? parameterObject["fields"] : Value(arrayValue); + for (unsigned int i = 0; i < fields.size(); i++) + { + if (!fields[i].isString()) + continue; + + CStdString field = fields[i].asString(); + + if (field.Equals("genre") && !videoInfo->m_strGenre.IsEmpty()) + result["genre"] = videoInfo->m_strGenre.c_str(); + if (field.Equals("tagline") && !videoInfo->m_strTagLine.IsEmpty()) + result["tagline"] = videoInfo->m_strTagLine.c_str(); + if (field.Equals("plot") && !videoInfo->m_strPlot.IsEmpty()) + result["plot"] = videoInfo->m_strPlot.c_str(); + + if (field.Equals("runtime") && !videoInfo->m_strRuntime.IsEmpty()) + result["runtime"] = videoInfo->m_strRuntime.c_str(); + } +} + +void CFileItemHandler::FillMusicDetails(const CMusicInfoTag *musicInfo, const Value& parameterObject, Value &result) +{ + if (!musicInfo->GetTitle().IsEmpty()) + result["title"] = musicInfo->GetTitle().c_str(); + else if (!musicInfo->GetAlbum().IsEmpty()) + result["album"] = musicInfo->GetAlbum().c_str(); + else if (!musicInfo->GetArtist().IsEmpty()) + result["artist"] = musicInfo->GetArtist().c_str(); + + if (!musicInfo->GetURL().IsEmpty()) + result["file"] = musicInfo->GetURL().c_str(); + const Json::Value fields = parameterObject.isMember("fields") && parameterObject["fields"].isArray() ? parameterObject["fields"] : Value(arrayValue); + + for (unsigned int i = 0; i < fields.size(); i++) + { + if (!fields[i].isString()) + continue; + + CStdString field = fields[i].asString(); + + if (field.Equals("title") && !musicInfo->GetTitle().IsEmpty()) + result["title"] = musicInfo->GetTitle().c_str(); + if (field.Equals("album") && !musicInfo->GetAlbum().IsEmpty()) + result["album"] = musicInfo->GetAlbum().c_str(); + if (field.Equals("artist") && !musicInfo->GetArtist().IsEmpty()) + result["artist"] = musicInfo->GetArtist().c_str(); + if (field.Equals("albumartist") && !musicInfo->GetAlbumArtist().IsEmpty()) + result["albumartist"] = musicInfo->GetAlbumArtist().c_str(); + + if (field.Equals("genre") && !musicInfo->GetGenre().IsEmpty()) + result["genre"] = musicInfo->GetGenre().c_str(); + + if (field.Equals("tracknumber")) + result["tracknumber"] = (int)musicInfo->GetTrackNumber(); + if (field.Equals("discnumber")) + result["discnumber"] = (int)musicInfo->GetDiscNumber(); + if (field.Equals("trackanddiscnumber")) + result["trackanddiscnumber"] = (int)musicInfo->GetTrackAndDiskNumber(); + if (field.Equals("duration")) + result["duration"] = (int)musicInfo->GetDuration(); + if (field.Equals("year")) + result["year"] = (int)musicInfo->GetYear(); + +// void GetReleaseDate(SYSTEMTIME& dateTime) const; + if (field.Equals("albumartist") && !musicInfo->GetYearString().IsEmpty()) + result["albumartist"] = musicInfo->GetYearString().c_str(); + + if (field.Equals("musicbrainztrackid") && !musicInfo->GetMusicBrainzTrackID().IsEmpty()) + result["musicbrainztrackid"] = musicInfo->GetMusicBrainzTrackID().c_str(); + if (field.Equals("musicbrainzartistid") && !musicInfo->GetMusicBrainzArtistID().IsEmpty()) + result["musicbrainzartistid"] = musicInfo->GetMusicBrainzArtistID().c_str(); + if (field.Equals("musicbrainzalbumid") && !musicInfo->GetMusicBrainzAlbumID().IsEmpty()) + result["musicbrainzalbumid"] = musicInfo->GetMusicBrainzAlbumID().c_str(); + if (field.Equals("musicbrainzalbumartistid") && !musicInfo->GetMusicBrainzAlbumArtistID().IsEmpty()) + result["musicbrainzalbumartistid"] = musicInfo->GetMusicBrainzAlbumArtistID().c_str(); + if (field.Equals("musicbrainztrmidid") && !musicInfo->GetMusicBrainzTRMID().IsEmpty()) + result["musicbrainztrmidid"] = musicInfo->GetMusicBrainzTRMID().c_str(); + + if (field.Equals("comment") && !musicInfo->GetComment().IsEmpty()) + result["comment"] = musicInfo->GetComment().c_str(); + if (field.Equals("lyrics") && !musicInfo->GetLyrics().IsEmpty()) + result["lyrics"] = musicInfo->GetLyrics().c_str(); + + if (field.Equals("rating")) + result["rating"] = (int)musicInfo->GetRating(); + } +} + +void CFileItemHandler::HandleFileItemList(const char *id, const char *resultname, CFileItemList &items, const Value& parameterObject, Value &result) +{ + const Value param = parameterObject.isObject() ? parameterObject : Value(objectValue); + + unsigned int size = (unsigned int)items.Size(); + unsigned int start = param.get("start", 0).asUInt(); + unsigned int end = param.get("end", size).asUInt(); + end = end > size ? size : end; + + Sort(items, param); + + result["start"] = start; + result["end"] = end; + result["total"] = size; + + for (unsigned int i = start; i < end; i++) + { + Value object; + CFileItemPtr item = items.Get(i); + + if (id) + { + if (item->HasMusicInfoTag() && item->GetMusicInfoTag()->GetDatabaseId() > 0) + object[id] = (int)item->GetMusicInfoTag()->GetDatabaseId(); + else if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_iDbId > 0) + object[id] = item->GetVideoInfoTag()->m_iDbId; + } + + if (!item->GetThumbnailImage().IsEmpty()) + object["thumbnail"] = item->GetThumbnailImage().c_str(); + + if (item->HasVideoInfoTag()) + FillVideoDetails(item->GetVideoInfoTag(), param, object); + if (item->HasMusicInfoTag()) + FillMusicDetails(item->GetMusicInfoTag(), param, object); + + if (!item->HasVideoInfoTag() && !item->HasMusicInfoTag() && !object.isMember("file")) + object["file"] = item->m_strPath.c_str(); + + if (resultname) + result[resultname].append(object); + } +} + +bool CFileItemHandler::ParseSortMethods(const CStdString &method, const CStdString &order, SORT_METHOD &sortmethod, SORT_ORDER &sortorder) +{ + if (order.Equals("ascending")) + sortorder = SORT_ORDER_ASC; + else if (order.Equals("descending")) + sortorder = SORT_ORDER_DESC; + else + return false; + + if (method.Equals("none")) + sortmethod = SORT_METHOD_NONE; + else if (method.Equals("label")) + sortmethod = SORT_METHOD_LABEL; + else if (method.Equals("labelignorethe")) + sortmethod = SORT_METHOD_LABEL_IGNORE_THE; + else if (method.Equals("date")) + sortmethod = SORT_METHOD_DATE; + else if (method.Equals("size")) + sortmethod = SORT_METHOD_SIZE; + else if (method.Equals("file")) + sortmethod = SORT_METHOD_FILE; + else if (method.Equals("drivetype")) + sortmethod = SORT_METHOD_DRIVE_TYPE; + else if (method.Equals("track")) + sortmethod = SORT_METHOD_TRACKNUM; + else if (method.Equals("duration")) + sortmethod = SORT_METHOD_DURATION; + else if (method.Equals("title")) + sortmethod = SORT_METHOD_TITLE; + else if (method.Equals("titleignorethe")) + sortmethod = SORT_METHOD_TITLE_IGNORE_THE; + else if (method.Equals("artist")) + sortmethod = SORT_METHOD_ARTIST; + else if (method.Equals("artistignorethe")) + sortmethod = SORT_METHOD_ARTIST_IGNORE_THE; + else if (method.Equals("album")) + sortmethod = SORT_METHOD_ALBUM; + else if (method.Equals("albumignorethe")) + sortmethod = SORT_METHOD_ALBUM_IGNORE_THE; + else if (method.Equals("genre")) + sortmethod = SORT_METHOD_GENRE; + else if (method.Equals("year")) + sortmethod = SORT_METHOD_YEAR; + else if (method.Equals("videorating")) + sortmethod = SORT_METHOD_VIDEO_RATING; + else if (method.Equals("programcount")) + sortmethod = SORT_METHOD_PROGRAM_COUNT; + else if (method.Equals("playlist")) + sortmethod = SORT_METHOD_PLAYLIST_ORDER; + else if (method.Equals("episode")) + sortmethod = SORT_METHOD_EPISODE; + else if (method.Equals("title")) + sortmethod = SORT_METHOD_VIDEO_TITLE; + else if (method.Equals("sorttitle")) + sortmethod = SORT_METHOD_VIDEO_SORT_TITLE; + else if (method.Equals("sorttitleignorethe")) + sortmethod = SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE; + else if (method.Equals("productioncode")) + sortmethod = SORT_METHOD_PRODUCTIONCODE; + else if (method.Equals("songrating")) + sortmethod = SORT_METHOD_SONG_RATING; + else if (method.Equals("mpaarating")) + sortmethod = SORT_METHOD_MPAA_RATING; + else if (method.Equals("videoruntime")) + sortmethod = SORT_METHOD_VIDEO_RUNTIME; + else if (method.Equals("studio")) + sortmethod = SORT_METHOD_STUDIO; + else if (method.Equals("studioignorethe")) + sortmethod = SORT_METHOD_STUDIO_IGNORE_THE; + else if (method.Equals("fullpath")) + sortmethod = SORT_METHOD_FULLPATH; + else if (method.Equals("unsorted")) + sortmethod = SORT_METHOD_UNSORTED; + else if (method.Equals("max")) + sortmethod = SORT_METHOD_MAX; + else + return false; + + return true; +} + +void CFileItemHandler::Sort(CFileItemList &items, const Value& parameterObject) +{ + if (parameterObject.isMember("sortmethod") && parameterObject.isMember("sortorder")) + { + CStdString method = parameterObject.get("sortmethod", "none").asString(); + CStdString order = parameterObject.get("sortorder", "ascending").asString(); + method = method.ToLower(); + order = order.ToLower(); + + SORT_METHOD sortmethod; + SORT_ORDER sortorder; + + if (ParseSortMethods(method, order, sortmethod, sortorder)) + items.Sort(sortmethod, sortorder); + } +} diff --git a/xbmc/lib/libjsonrpc/FileItemHandler.h b/xbmc/lib/libjsonrpc/FileItemHandler.h new file mode 100644 index 0000000000..30a12aadb7 --- /dev/null +++ b/xbmc/lib/libjsonrpc/FileItemHandler.h @@ -0,0 +1,41 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "StdString.h" +#include "JSONRPC.h" +#include "../FileItem.h" +#include "../VideoInfoTag.h" +#include "../MusicInfoTag.h" + +namespace JSONRPC +{ + class CFileItemHandler + { + protected: + static void FillVideoDetails(const CVideoInfoTag *videoInfo, const Json::Value& parameterObject, Json::Value &result); + static void FillMusicDetails(const MUSIC_INFO::CMusicInfoTag *musicInfo, const Json::Value& parameterObject, Json::Value &result); + static void HandleFileItemList(const char *id, const char *resultname, CFileItemList &items, const Json::Value& parameterObject, Json::Value &result); + private: + static bool ParseSortMethods(const CStdString &method, const CStdString &order, SORT_METHOD &sortmethod, SORT_ORDER &sortorder); + static void Sort(CFileItemList &items, const Json::Value& parameterObject); + }; +} diff --git a/xbmc/lib/libjsonrpc/FileOperations.cpp b/xbmc/lib/libjsonrpc/FileOperations.cpp new file mode 100644 index 0000000000..864ba85462 --- /dev/null +++ b/xbmc/lib/libjsonrpc/FileOperations.cpp @@ -0,0 +1,112 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "FileOperations.h" +#include "Settings.h" +#include "MediaSource.h" +#include "../FileSystem/Directory.h" +#include "FileItem.h" +#include "AdvancedSettings.h" +#include "../Util.h" + +using namespace XFILE; +using namespace Json; +using namespace JSONRPC; + +JSON_STATUS CFileOperations::GetRootDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + const Value param = parameterObject.isObject() ? parameterObject : Value(objectValue); + CStdString type = param.get("type", "null").asString(); + type = type.ToLower(); + + if (type.Equals("video") || type.Equals("music") || type.Equals("pictures") || type.Equals("files") || type.Equals("programs")) + { + VECSOURCES *sources = g_settings.GetSourcesFromType(type); + if (sources) + { + unsigned int start = param.get("start", 0).asUInt(); + unsigned int end = param.get("end", (unsigned int)sources->size()).asUInt(); + end = end > sources->size() ? sources->size() : end; + + result["start"] = start; + result["end"] = end; + result["total"] = (unsigned int)sources->size(); + for (unsigned int i = start; i < end; i++) + { + CMediaSource &testShare = sources->at(i); + result["shares"].append(testShare.strPath); + } + } + + return OK; + } + else + return InvalidParams; +} + +JSON_STATUS CFileOperations::GetDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (parameterObject.isObject() && parameterObject.isMember("type") && parameterObject.isMember("directory")) + { + CStdString type = parameterObject.get("type", "files").asString(); + type = type.ToLower(); + + if (type.Equals("video") || type.Equals("music") || type.Equals("pictures") || type.Equals("files") || type.Equals("programs")) + { + CDirectory directory; + CFileItemList items; + CStdString strPath = parameterObject["directory"].asString(); + + if (directory.GetDirectory(strPath, items)) + { + CStdStringArray regexps; + + if (type.Equals("video")) + regexps = g_advancedSettings.m_videoExcludeFromListingRegExps; + else if (type.Equals("music")) + regexps = g_advancedSettings.m_audioExcludeFromListingRegExps; + else if (type.Equals("pictures")) + regexps = g_advancedSettings.m_pictureExcludeFromListingRegExps; + + CFileItemList filtereditems; + for (unsigned int i = 0; i < (unsigned int)items.Size(); i++) + { + if (regexps.size() == 0 || !CUtil::ExcludeFileOrFolder(items[i]->m_strPath, regexps)) + filtereditems.Add(items[i]); + } + + HandleFileItemList(NULL, "directories", filtereditems, parameterObject, result); + + return OK; + } + } + } + + return InvalidParams; +} + +JSON_STATUS CFileOperations::Download(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!parameterObject.isString()) + return InvalidParams; + + return transport->Download(parameterObject.asString().c_str(), &result) ? OK : BadPermission; +} diff --git a/xbmc/lib/libjsonrpc/FileOperations.h b/xbmc/lib/libjsonrpc/FileOperations.h new file mode 100644 index 0000000000..a8caee88c7 --- /dev/null +++ b/xbmc/lib/libjsonrpc/FileOperations.h @@ -0,0 +1,36 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "StdString.h" +#include "JSONRPC.h" +#include "FileItemHandler.h" + +namespace JSONRPC +{ + class CFileOperations : public CFileItemHandler + { + public: + static JSON_STATUS GetRootDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Download(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + }; +} diff --git a/xbmc/lib/libjsonrpc/IClient.h b/xbmc/lib/libjsonrpc/IClient.h new file mode 100644 index 0000000000..71c3ba4a88 --- /dev/null +++ b/xbmc/lib/libjsonrpc/IClient.h @@ -0,0 +1,11 @@ +namespace JSONRPC +{ + class IClient + { + public: + virtual ~IClient() { }; + virtual int GetPermissionFlags() = 0; + virtual int GetAnnouncementFlags() = 0; + virtual bool SetAnnouncementFlags(int flags) = 0; + }; +} diff --git a/xbmc/lib/libjsonrpc/ITransportLayer.h b/xbmc/lib/libjsonrpc/ITransportLayer.h new file mode 100644 index 0000000000..1cd72062f3 --- /dev/null +++ b/xbmc/lib/libjsonrpc/ITransportLayer.h @@ -0,0 +1,49 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include <string> +#include "IClient.h" + +namespace Json +{ + class Value; +} + +namespace JSONRPC +{ + enum TransportLayerCapability + { + Response = 0x1, + Announcing = 0x2, + FileDownload = 0x4, + }; + + #define TRANSPORT_LAYER_CAPABILITY_ALL (Response | Announcing | FileDownload) + + class ITransportLayer + { + public: + virtual ~ITransportLayer() { }; + virtual bool Download(const char *path, Json::Value *result) = 0; + virtual int GetCapabilities() = 0; + }; +} diff --git a/xbmc/lib/libjsonrpc/JSONRPC.cpp b/xbmc/lib/libjsonrpc/JSONRPC.cpp new file mode 100644 index 0000000000..75ee903dc2 --- /dev/null +++ b/xbmc/lib/libjsonrpc/JSONRPC.cpp @@ -0,0 +1,406 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "JSONRPC.h" +#include "PlayerOperations.h" +#include "AVPlayerOperations.h" +#include "PicturePlayerOperations.h" +#include "PlaylistOperations.h" +#include "FileOperations.h" +#include "MusicLibrary.h" +#include "VideoLibrary.h" +#include "SystemOperations.h" +#include "XBMCOperations.h" +#include "AnnouncementManager.h" +#include <string.h> + +using namespace ANNOUNCEMENT; +using namespace JSONRPC; +using namespace Json; +using namespace std; + +Command CJSONRPC::m_commands[] = { +// JSON-RPC + { "JSONRPC.Introspect", CJSONRPC::Introspect, Response, ReadData, "Enumerates all actions and descriptions. Parameter example {\"getdescriptions\": true, \"getpermissions\": true, \"filterbytransport\": true }. All parameters optional" }, + { "JSONRPC.Version", CJSONRPC::Version, Response, ReadData, "Retrieve the jsonrpc protocol version" }, + { "JSONRPC.Permission", CJSONRPC::Permission, Response, ReadData, "Retrieve the clients permissions" }, + { "JSONRPC.Ping", CJSONRPC::Ping, Response, ReadData, "Ping responder" }, + { "JSONRPC.GetAnnouncementFlags", CJSONRPC::GetAnnouncementFlags, Announcing, ReadData, "Get announcement flags" }, + { "JSONRPC.SetAnnouncementFlags", CJSONRPC::SetAnnouncementFlags, Announcing, ControlAnnounce, "Change the announcement flags. Parameter example {\"playback\": true, \"gui\": false }" }, + { "JSONRPC.Announce", CJSONRPC::Announce, Response, ReadData, "Announce to other connected clients. Parameter example {\"sender\": \"foo\", \"message\": \"bar\", \"data\": \"somedata\" }. data is optional" }, + +// Player + { "Player.GetActivePlayers", CPlayerOperations::GetActivePlayers, Response, ReadData, "Returns all active players IDs"}, + +// Music player + { "MusicPlayer.PlayPause", CAVPlayerOperations::PlayPause, Response, ControlPlayback, "Pauses or unpause playback" }, + { "MusicPlayer.Stop", CAVPlayerOperations::Stop, Response, ControlPlayback, "Stops playback" }, + { "MusicPlayer.SkipPrevious", CAVPlayerOperations::SkipPrevious, Response, ControlPlayback, "Skips to previous item on the playlist" }, + { "MusicPlayer.SkipNext", CAVPlayerOperations::SkipNext, Response, ControlPlayback, "Skips to next item on the playlist" }, + + { "MusicPlayer.BigSkipBackward", CAVPlayerOperations::BigSkipBackward, Response, ControlPlayback, "" }, + { "MusicPlayer.BigSkipForward", CAVPlayerOperations::BigSkipForward, Response, ControlPlayback, "" }, + { "MusicPlayer.SmallSkipBackward", CAVPlayerOperations::SmallSkipBackward, Response, ControlPlayback, "" }, + { "MusicPlayer.SmallSkipForward", CAVPlayerOperations::SmallSkipForward, Response, ControlPlayback, "" }, + + { "MusicPlayer.Rewind", CAVPlayerOperations::Rewind, Response, ControlPlayback, "Rewind current playback" }, + { "MusicPlayer.Forward", CAVPlayerOperations::Forward, Response, ControlPlayback, "Forward current playback" }, + + { "MusicPlayer.GetTime", CAVPlayerOperations::GetTime, Response, ReadData, "Retrieve time" }, + { "MusicPlayer.GetTimeMS", CAVPlayerOperations::GetTimeMS, Response, ReadData, "Retrieve time in MS" }, + { "MusicPlayer.GetPercentage", CAVPlayerOperations::GetPercentage, Response, ReadData, "Retrieve percentage" }, + { "MusicPlayer.SeekTime", CAVPlayerOperations::SeekTime, Response, ControlPlayback, "Seek to a specific time. Parameter integer in MS" }, + + { "MusicPlayer.GetPlaylist", CAVPlayerOperations::GetPlaylist, Response, ReadData, "Retrieve active playlist" }, + + { "MusicPlayer.Record", CAVPlayerOperations::Record, Response, ControlPlayback, "" }, + +// Video player + { "VideoPlayer.PlayPause", CAVPlayerOperations::PlayPause, Response, ControlPlayback, "Pauses or unpause playback" }, + { "VideoPlayer.Stop", CAVPlayerOperations::Stop, Response, ControlPlayback, "Stops playback" }, + { "VideoPlayer.SkipPrevious", CAVPlayerOperations::SkipPrevious, Response, ControlPlayback, "Skips to previous item on the playlist" }, + { "VideoPlayer.SkipNext", CAVPlayerOperations::SkipNext, Response, ControlPlayback, "Skips to next item on the playlist" }, + + { "VideoPlayer.BigSkipBackward", CAVPlayerOperations::BigSkipBackward, Response, ControlPlayback, "" }, + { "VideoPlayer.BigSkipForward", CAVPlayerOperations::BigSkipForward, Response, ControlPlayback, "" }, + { "VideoPlayer.SmallSkipBackward", CAVPlayerOperations::SmallSkipBackward, Response, ControlPlayback, "" }, + { "VideoPlayer.SmallSkipForward", CAVPlayerOperations::SmallSkipForward, Response, ControlPlayback, "" }, + + { "VideoPlayer.Rewind", CAVPlayerOperations::Rewind, Response, ControlPlayback, "Rewind current playback" }, + { "VideoPlayer.Forward", CAVPlayerOperations::Forward, Response, ControlPlayback, "Forward current playback" }, + + { "VideoPlayer.GetTime", CAVPlayerOperations::GetTime, Response, ReadData, "Retrieve time" }, + { "VideoPlayer.GetTimeMS", CAVPlayerOperations::GetTimeMS, Response, ReadData, "Retrieve time in MS" }, + { "VideoPlayer.GetPercentage", CAVPlayerOperations::GetPercentage, Response, ReadData, "Retrieve percentage" }, + { "VideoPlayer.SeekTime", CAVPlayerOperations::SeekTime, Response, ControlPlayback, "Seek to a specific time. Parameter integer in MS" }, + + { "VideoPlayer.GetPlaylist", CAVPlayerOperations::GetPlaylist, Response, ReadData, "Retrieve active playlist" }, + +// Picture player + { "PicturePlayer.PlayPause", CPicturePlayerOperations::PlayPause, Response, ControlPlayback, "Pauses or unpause slideshow" }, + { "PicturePlayer.Stop", CPicturePlayerOperations::Stop, Response, ControlPlayback, "Stops slideshow" }, + { "PicturePlayer.SkipPrevious", CPicturePlayerOperations::SkipPrevious, Response, ControlPlayback, "Skips to previous picture in the slideshow" }, + { "PicturePlayer.SkipNext", CPicturePlayerOperations::SkipNext, Response, ControlPlayback, "Skips to next picture in the slideshow" }, + + { "PicturePlayer.MoveLeft", CPicturePlayerOperations::MoveLeft, Response, ControlPlayback, "If picture is zoomed move viewport left otherwise skip previous" }, + { "PicturePlayer.MoveRight", CPicturePlayerOperations::MoveRight, Response, ControlPlayback, "If picture is zoomed move viewport right otherwise skip previous" }, + { "PicturePlayer.MoveDown", CPicturePlayerOperations::MoveDown, Response, ControlPlayback, "If picture is zoomed move viewport down" }, + { "PicturePlayer.MoveUp", CPicturePlayerOperations::MoveUp, Response, ControlPlayback, "If picture is zoomed move viewport up" }, + + { "PicturePlayer.ZoomOut", CPicturePlayerOperations::ZoomOut, Response, ControlPlayback, "Zoom out once" }, + { "PicturePlayer.ZoomIn", CPicturePlayerOperations::ZoomIn, Response, ControlPlayback, "Zoom in once" }, + { "PicturePlayer.Zoom", CPicturePlayerOperations::Zoom, Response, ControlPlayback, "Zooms current picture. Parameter integer of zoom level" }, + { "PicturePlayer.Rotate", CPicturePlayerOperations::Rotate, Response, ControlPlayback, "Rotates current picture" }, + +// Playlist + { "Playlist.GetItems", CPlaylistOperations::GetItems, Response, ReadData, "Retrieve items in the playlist. Parameter example {\"playlist\": \"music\" }. playlist optional." }, + { "Playlist.Add", CPlaylistOperations::Add, Response, ControlPlayback, "Add items to the playlist. Parameter example {\"playlist\": \"music\", \"file\": \"/foo/bar.mp3\" }. playlist optional." }, + { "Playlist.Remove", CPlaylistOperations::Remove, Response, ControlPlayback, "Remove items in the playlist. Parameter example {\"playlist\": \"music\", \"item\": 0 }. playlist optional." }, + { "Playlist.Swap", CPlaylistOperations::Swap, Response, ControlPlayback, "Swap items in the playlist. Parameter example {\"playlist\": \"music\", \"item1\": 0, \"item2\": 1 }. playlist optional." }, + { "Playlist.Shuffle", CPlaylistOperations::Shuffle, Response, ControlPlayback, "Shuffle playlist" }, + +// File + { "Files.GetShares", CFileOperations::GetRootDirectory, Response, ReadData, "Get the root directory of the media windows" }, + { "Files.Download", CFileOperations::Download, FileDownload, ReadData, "Specify a file to download to get info about how to download it, i.e a proper URL" }, + + { "Files.GetDirectory", CFileOperations::GetDirectory, Response, ReadData, "Retrieve the specified directory" }, + +// Music library + { "MusicLibrary.GetArtists", CMusicLibrary::GetArtists, Response, ReadData, "Retrieve all artists" }, + { "MusicLibrary.GetAlbums", CMusicLibrary::GetAlbums, Response, ReadData, "Retrieve all albums from specified artist or genre" }, + { "MusicLibrary.GetSongs", CMusicLibrary::GetSongs, Response, ReadData, "Retrieve all songs from specified album, artist or genre" }, + + { "MusicLibrary.GetSongInfo", CMusicLibrary::GetSongInfo, Response, ReadData, "Retrieve the wanted info from the specified song" }, + +// Video library + { "VideoLibrary.GetMovies", CVideoLibrary::GetMovies, Response, ReadData, "Retrieve all movies. Parameter example { \"fields\": [\"plot\"], \"sortmethod\": \"title\", \"sortorder\": \"ascending\", \"start\": 0, \"end\": 3}. fields, sortorder, sortmethod, start and end are optional" }, + + { "VideoLibrary.GetTVShows", CVideoLibrary::GetTVShows, Response, ReadData, "Parameter example { \"fields\": [\"plot\"], \"sortmethod\": \"artistignorethe\", \"sortorder\": \"ascending\", \"start\": 0, \"end\": 3}. sortorder, sortmethod, start and end are optional" }, + { "VideoLibrary.GetSeasons", CVideoLibrary::GetSeasons, Response, ReadData, "Parameter example { \"tvshowid\": 0, \"fields\": [\"plot\"], \"sortmethod\": \"artistignorethe\", \"sortorder\": \"ascending\", \"start\": 0, \"end\": 3}. sortorder, sortmethod, start and end are optional" }, + { "VideoLibrary.GetEpisodes", CVideoLibrary::GetEpisodes, Response, ReadData, "Parameter example { \"tvshowid\": 0, \"seasonid\": 0, \"fields\": [\"plot\"], \"sortmethod\": \"artistignorethe\", \"sortorder\": \"ascending\", \"start\": 0, \"end\": 3}. sortorder, sortmethod, start and end are optional" }, + + { "VideoLibrary.GetMusicVideoAlbums", CVideoLibrary::GetMusicVideoAlbums, Response, ReadData, "" }, + { "VideoLibrary.GetMusicVideos", CVideoLibrary::GetMusicVideos, Response, ReadData, "Parameter example { \"artistid\": 0, \"albumid\": 0, \"fields\": [\"plot\"], \"sortmethod\": \"artistignorethe\", \"sortorder\": \"ascending\", \"start\": 0, \"end\": 3}. sortorder, sortmethod, start and end are optional" }, + + { "VideoLibrary.GetMovieInfo", CVideoLibrary::GetMovieInfo, Response, ReadData, "Parameter example { \"movieid\": 0, \"fields\": [\"plot\"] }" }, + { "VideoLibrary.GetTVShowInfo", CVideoLibrary::GetTVShowInfo, Response, ReadData, "Parameter example { \"tvshowid\": 0, \"fields\": [\"plot\"] }" }, + { "VideoLibrary.GetEpisodeInfo", CVideoLibrary::GetEpisodeInfo, Response, ReadData, "Parameter example { \"episodeinfo\": 0, \"fields\": [\"plot\"] }" }, + { "VideoLibrary.GetMusicVideoInfo", CVideoLibrary::GetMusicVideoInfo, Response, ReadData, "Parameter example { \"musicvideoid\": 0, \"fields\": [\"plot\"] }" }, + +// System operations + { "System.Shutdown", CSystemOperations::Shutdown, Response, ControlPower, "" }, + { "System.Suspend", CSystemOperations::Suspend, Response, ControlPower, "" }, + { "System.Hibernate", CSystemOperations::Hibernate, Response, ControlPower, "" }, + { "System.Reboot", CSystemOperations::Reboot, Response, ControlPower, "" }, + + { "System.GetInfo", CSystemOperations::GetInfo, Response, ReadData, "Retrieve info about the system" }, + +// XBMC Operations + { "XBMC.GetVolume", CXBMCOperations::GetVolume, Response, ReadData, "Retrieve the current volume" }, + { "XBMC.SetVolume", CXBMCOperations::SetVolume, Response, ControlPlayback, "Set volume. Parameter integer between 0 amd 100" }, + { "XBMC.ToggleMute", CXBMCOperations::ToggleMute, Response, ControlPlayback, "Toggle mute" }, + + { "XBMC.Play", CXBMCOperations::Play, Response, ControlPlayback, "Starts playback" }, + { "XBMC.StartSlideshow", CXBMCOperations::StartSlideshow, Response, ControlPlayback, "Starts slideshow. Parameter example {\"directory\": \"/foo/\", \"random\": true, \"recursive\": true} or just string to recursively and random run directory" }, + + { "XBMC.Log", CXBMCOperations::Log, Response, Logging, "Logs a line in the xbmc.log. Parameter example {\"message\": \"foo\", \"level\": \"info\"} or just a string to log message with level debug" }, + + { "XBMC.Quit", CXBMCOperations::Quit, Response, ControlPower, "Quit xbmc" } +}; + +CJSONRPC::CActionMap CJSONRPC::m_actionMap(m_commands, sizeof(m_commands) / sizeof(m_commands[0]) ); + +JSON_STATUS CJSONRPC::Introspect(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!(parameterObject.isObject() || parameterObject.isNull())) + return InvalidParams; + + const Value param = parameterObject.isObject() ? parameterObject : Value(objectValue); + bool getDescriptions = param.get("getdescriptions", true).asBool(); + bool getPermissions = param.get("getpermissions", true).asBool(); + bool filterByTransport = param.get("filterbytransport", true).asBool(); + + int length = sizeof(m_commands) / sizeof(Command); + int clientflags = client->GetPermissionFlags(); + for (int i = 0; i < length; i++) + { + if ((transport->GetCapabilities() & m_commands[i].transportneed) == 0 && filterByTransport) + continue; + + Value val; + + val["command"] = m_commands[i].command; + val["executable"] = (clientflags & m_commands[i].permission) > 0 ? true : false; + if (getDescriptions && m_commands[i].description) + val["description"] = m_commands[i].description; + if (getPermissions) + val["permission"] = PermissionToString(m_commands[i].permission); + + result["commands"].append(val); + } + + return OK; +} + +JSON_STATUS CJSONRPC::Version(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + result["version"] = 1; + + return OK; +} + +JSON_STATUS CJSONRPC::Permission(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + int flags = client->GetPermissionFlags(); + + for (int i = 1; i <= OPERATION_PERMISSION_ALL; i *= 2) + { + if (flags & i) + result["permission"].append(PermissionToString((OperationPermission)(flags & i))); + } + + return OK; +} + +JSON_STATUS CJSONRPC::Ping(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + Value temp = "pong"; + result.swap(temp); + return OK; +} + +JSON_STATUS CJSONRPC::GetAnnouncementFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + int flags = client->GetAnnouncementFlags(); + + for (int i = 1; i <= ANNOUNCE_ALL; i *= 2) + { + if (flags & i) + result["permission"].append(AnnouncementFlagToString((EAnnouncementFlag)(flags & i))); + } + + return OK; +} + +JSON_STATUS CJSONRPC::SetAnnouncementFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!parameterObject.isObject()) + return InvalidParams; + + int flags = 0; + + if (parameterObject.get("playback", false).asBool()) + flags |= Playback; + else if (parameterObject.get("gui", false).asBool()) + flags |= GUI; + else if (parameterObject.get("system", false).asBool()) + flags |= System; + else if (parameterObject.get("other", false).asBool()) + flags |= Other; + + if (client->SetAnnouncementFlags(flags)) + return GetAnnouncementFlags(method, transport, client, parameterObject, result); + + return BadPermission; +} + +JSON_STATUS CJSONRPC::Announce(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!parameterObject.isObject() || !parameterObject.isMember("sender") || !parameterObject.isMember("message")) + return InvalidParams; + + CAnnouncementManager::Announce(Other, parameterObject["sender"].asString().c_str(), parameterObject["message"].asString().c_str(), parameterObject.isMember("data") ? parameterObject["sender"].asString().c_str() : NULL); + + return ACK; +} + +CStdString CJSONRPC::MethodCall(const CStdString &inputString, ITransportLayer *transport, IClient *client) +{ + Value inputroot, outputroot, result; + + JSON_STATUS errorCode = OK; + Reader reader; + + if (reader.parse(inputString, inputroot) && IsProperJSONRPC(inputroot)) + { + CStdString method = inputroot.get("method", "").asString(); + method = method.ToLower(); + errorCode = InternalMethodCall(method, inputroot, result, transport, client); + } + else + errorCode = ParseError; + + outputroot["jsonrpc"] = "2.0"; + outputroot["id"] = inputroot.get("id", 0); + + switch (errorCode) + { + case OK: + outputroot["result"] = result; + break; + case ACK: + outputroot["result"] = "OK"; + break; + case InvalidParams: + outputroot["error"]["code"] = InvalidParams; + outputroot["error"]["message"] = "Invalid params."; + break; + case MethodNotFound: + outputroot["error"]["code"] = MethodNotFound; + outputroot["error"]["message"] = "Method not found."; + break; + case ParseError: + outputroot["error"]["code"] = ParseError; + outputroot["error"]["message"] = "Parse error."; + break; + case BadPermission: + outputroot["error"]["code"] = BadPermission; + outputroot["error"]["message"] = "Bad client permission."; + break; + case FailedToExecute: + outputroot["error"]["code"] = FailedToExecute; + outputroot["error"]["message"] = "Failed to execute method."; + break; + default: + outputroot["error"]["code"] = InternalError; + outputroot["error"]["message"] = "Internal error."; + break; + } + + StyledWriter writer; + CStdString str = writer.write(outputroot); + return str; +} + +JSON_STATUS CJSONRPC::InternalMethodCall(const CStdString& method, Value& o, Value &result, ITransportLayer *transport, IClient *client) +{ + CActionMap::const_iterator iter = m_actionMap.find(method); + if( iter != m_actionMap.end() ) + { + if (client->GetPermissionFlags() & iter->second.permission) + return iter->second.method(method, transport, client, o["params"], result); + else + return BadPermission; + } + else + return MethodNotFound; +} + +inline bool CJSONRPC::IsProperJSONRPC(const Json::Value& inputroot) +{ + return inputroot.isObject() && inputroot.isMember("jsonrpc") && inputroot["jsonrpc"].isString() && inputroot.get("jsonrpc", "-1").asString() == "2.0" && inputroot.isMember("method") && inputroot["method"].isString() && inputroot.isMember("id"); +} + +inline const char *CJSONRPC::PermissionToString(const OperationPermission &permission) +{ + switch (permission) + { + case ReadData: + return "ReadData"; + case ControlPlayback: + return "ControlPlayback"; + case ControlAnnounce: + return "ControlAnnounce"; + case ControlPower: + return "ControlPower"; + case Logging: + return "Logging"; + default: + return "Unkown"; + } +} + +inline const char *CJSONRPC::AnnouncementFlagToString(const EAnnouncementFlag &announcement) +{ + switch (announcement) + { + case Playback: + return "Playback"; + case GUI: + return "GUI"; + case System: + return "System"; + case Other: + return "Other"; + default: + return "Unkown"; + } +} + +CJSONRPC::CActionMap::CActionMap(const Command commands[], int length) +{ + for (int i = 0; i < length; i++) + { + CStdString command = commands[i].command; + command = command.ToLower(); + m_actionmap[command] = commands[i]; + } +} + +CJSONRPC::CActionMap::const_iterator CJSONRPC::CActionMap::find(const CStdString& key) const +{ + return m_actionmap.find(key); +} + +CJSONRPC::CActionMap::const_iterator CJSONRPC::CActionMap::end() const +{ + return m_actionmap.end(); +} diff --git a/xbmc/lib/libjsonrpc/JSONRPC.h b/xbmc/lib/libjsonrpc/JSONRPC.h new file mode 100644 index 0000000000..8fcf0e4de5 --- /dev/null +++ b/xbmc/lib/libjsonrpc/JSONRPC.h @@ -0,0 +1,108 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include <features.h> +//#include "system.h" +#include "StdString.h" +#include <map> +#include <stdio.h>
+#include <string>
+#include <iostream> +#include "ITransportLayer.h" +#include "IAnnouncer.h" +#include "json/json.h" + +namespace JSONRPC +{ + enum JSON_STATUS + { + OK = 0, + ACK = -1, + MethodNotFound = -32601, + InvalidParams = -32602, + InternalError = -32603, + ParseError = -32700, + //-32099..-32000 Reserved for implementation-defined server-errors. + BadPermission = -32099, + FailedToExecute = -32100 + }; + + /* The method call needs to be perfectly threadsafe + The method will only be called if parameterObject contains data as specified. So if method doesn't support parameters it won't be called with parameters and vice versa. + */ + typedef JSON_STATUS (*MethodCall) (const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + enum OperationPermission + { + ReadData = 0x1, + ControlPlayback = 0x2, + ControlAnnounce = 0x4, + ControlPower = 0x8, + Logging = 0x10, + }; + + #define OPERATION_PERMISSION_ALL (ReadData | ControlPlayback | ControlAnnounce | ControlPower | Logging) + + typedef struct + { + const char* command; + MethodCall method; + TransportLayerCapability transportneed; + OperationPermission permission; + const char* description; + } Command; + + class CJSONRPC + { + public: + static CStdString MethodCall(const CStdString &inputString, ITransportLayer *transport, IClient *client); + + static JSON_STATUS Introspect(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Version(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Permission(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Ping(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetAnnouncementFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS SetAnnouncementFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Announce(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + private: + static JSON_STATUS InternalMethodCall(const CStdString& method, Json::Value& o, Json::Value &result, ITransportLayer *transport, IClient *client); + static inline bool IsProperJSONRPC(const Json::Value& inputroot); + + inline static const char *PermissionToString(const OperationPermission &permission); + inline static const char *AnnouncementFlagToString(const ANNOUNCEMENT::EAnnouncementFlag &announcement); + + class CActionMap + { + public: + CActionMap(const Command commands[], int length); + + typedef std::map<CStdString, Command>::const_iterator const_iterator; + const_iterator find(const CStdString& key) const; + const_iterator end() const; + private: + std::map<CStdString, Command> m_actionmap; + }; + + static Command m_commands[]; + static CActionMap m_actionMap; + }; +} diff --git a/xbmc/lib/libjsonrpc/Makefile b/xbmc/lib/libjsonrpc/Makefile new file mode 100644 index 0000000000..a94bfd4544 --- /dev/null +++ b/xbmc/lib/libjsonrpc/Makefile @@ -0,0 +1,8 @@ +INCLUDES=-I. -I../ -I../../ -I../../../ -I../../utils -I../../FileSystem -I../../linux -I../../cores -I../../../guilib -I../../../lib/jsoncpp/jsoncpp/include + +SRCS=JSONRPC.cpp PlayerOperations.cpp AVPlayerOperations.cpp PicturePlayerOperations.cpp PlaylistOperations.cpp FileOperations.cpp MusicLibrary.cpp VideoLibrary.cpp FileItemHandler.cpp SystemOperations.cpp XBMCOperations.cpp TCPServer.cpp + +LIB= libjsonrpc.a + +include ../../../Makefile.include + diff --git a/xbmc/lib/libjsonrpc/Makefile.in b/xbmc/lib/libjsonrpc/Makefile.in new file mode 100644 index 0000000000..a94bfd4544 --- /dev/null +++ b/xbmc/lib/libjsonrpc/Makefile.in @@ -0,0 +1,8 @@ +INCLUDES=-I. -I../ -I../../ -I../../../ -I../../utils -I../../FileSystem -I../../linux -I../../cores -I../../../guilib -I../../../lib/jsoncpp/jsoncpp/include + +SRCS=JSONRPC.cpp PlayerOperations.cpp AVPlayerOperations.cpp PicturePlayerOperations.cpp PlaylistOperations.cpp FileOperations.cpp MusicLibrary.cpp VideoLibrary.cpp FileItemHandler.cpp SystemOperations.cpp XBMCOperations.cpp TCPServer.cpp + +LIB= libjsonrpc.a + +include ../../../Makefile.include + diff --git a/xbmc/lib/libjsonrpc/MusicLibrary.cpp b/xbmc/lib/libjsonrpc/MusicLibrary.cpp new file mode 100644 index 0000000000..f6ffdecf34 --- /dev/null +++ b/xbmc/lib/libjsonrpc/MusicLibrary.cpp @@ -0,0 +1,139 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "MusicLibrary.h" +#include "../MusicDatabase.h" +#include "../FileItem.h" +#include "../Util.h" +#include "../MusicInfoTag.h" +#include "../Song.h" + +using namespace MUSIC_INFO; +using namespace Json; +using namespace JSONRPC; + +JSON_STATUS CMusicLibrary::GetArtists(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!(parameterObject.isObject() || parameterObject.isNull())) + return InvalidParams; + + CMusicDatabase musicdatabase; + if (!musicdatabase.Open()) + return InternalError; + + const Value param = parameterObject.isObject() ? parameterObject : Value(objectValue); + int genreID = param.get("genreid", -1).asInt(); + + CFileItemList items; + if (musicdatabase.GetArtistsNav("", items, genreID, false)) + HandleFileItemList("artistid", "artists", items, param, result); + + musicdatabase.Close(); + return OK; +} + +JSON_STATUS CMusicLibrary::GetAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!(parameterObject.isObject() || parameterObject.isNull())) + return InvalidParams; + + CMusicDatabase musicdatabase; + if (!musicdatabase.Open()) + return InternalError; + + const Value param = parameterObject.isObject() ? parameterObject : Value(objectValue); + int artistID = param.get("artistid", -1).asInt(); + int genreID = param.get("genreid", -1).asInt(); + + CFileItemList items; + if (musicdatabase.GetAlbumsNav("", items, genreID, artistID)) + HandleFileItemList("albumid", "albums", items, param, result); + + musicdatabase.Close(); + return OK; +} + +JSON_STATUS CMusicLibrary::GetSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!(parameterObject.isObject() || parameterObject.isNull())) + return InvalidParams; + + CMusicDatabase musicdatabase; + if (!musicdatabase.Open()) + return InternalError; + + const Value param = parameterObject.isObject() ? parameterObject : Value(objectValue); + int artistID = param.get("artistid", -1).asInt(); + int albumID = param.get("albumid", -1).asInt(); + int genreID = param.get("genreid", -1).asInt(); + + CFileItemList items; + if (musicdatabase.GetSongsNav("", items, genreID, artistID, albumID)) + HandleFileItemList("songid", "songs", items, param, result); + + musicdatabase.Close(); + return OK; +} + +JSON_STATUS CMusicLibrary::GetSongInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!parameterObject.isObject()) + return InvalidParams; + int songID = parameterObject.get("songid", -1).asInt(); + + if (songID < 0) + return InvalidParams; + + CMusicDatabase musicdatabase; + if (!musicdatabase.Open()) + return InternalError; + + CSong songInfo; + if (musicdatabase.GetSongById(songID, songInfo)) + { + if (!songInfo.strTitle.IsEmpty()) + result["title"] = songInfo.strTitle.c_str(); + if (!songInfo.strArtist.IsEmpty()) + result["artist"] = songInfo.strArtist.c_str(); + if (!songInfo.strAlbum.IsEmpty()) + result["album"] = songInfo.strAlbum.c_str(); + if (!songInfo.strAlbumArtist.IsEmpty()) + result["albumartist"] = songInfo.strAlbumArtist.c_str(); + if (!songInfo.strGenre.IsEmpty()) + result["genre"] = songInfo.strGenre.c_str(); + if (!songInfo.strThumb.IsEmpty()) + result["thumbnail"] = songInfo.strThumb.c_str(); + if (!songInfo.strComment.IsEmpty()) + result["comment"] = songInfo.strComment.c_str(); + + if (!songInfo.iTrack > 0) + result["track"] = songInfo.iTrack; + if (!songInfo.iDuration > 0) + result["duration"] = songInfo.iDuration; + + result["rating"] = songInfo.rating; + result["year"] = songInfo.iYear; + result["timesplayed"] = songInfo.iTimesPlayed; + } + + musicdatabase.Close(); + return OK; +} diff --git a/xbmc/lib/libjsonrpc/MusicLibrary.h b/xbmc/lib/libjsonrpc/MusicLibrary.h new file mode 100644 index 0000000000..0a149e8a94 --- /dev/null +++ b/xbmc/lib/libjsonrpc/MusicLibrary.h @@ -0,0 +1,37 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "StdString.h" +#include "JSONRPC.h" +#include "FileItemHandler.h" + +namespace JSONRPC +{ + class CMusicLibrary : public CFileItemHandler + { + public: + static JSON_STATUS GetArtists(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetSongInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + }; +} diff --git a/xbmc/lib/libjsonrpc/PicturePlayerOperations.cpp b/xbmc/lib/libjsonrpc/PicturePlayerOperations.cpp new file mode 100644 index 0000000000..3487ba35d0 --- /dev/null +++ b/xbmc/lib/libjsonrpc/PicturePlayerOperations.cpp @@ -0,0 +1,127 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "PicturePlayerOperations.h" +#include "Application.h" +#include "Key.h" + +using namespace Json; +using namespace JSONRPC; + + +JSON_STATUS CPicturePlayerOperations::PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_PAUSE); +} + +JSON_STATUS CPicturePlayerOperations::Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_STOP); +} + +JSON_STATUS CPicturePlayerOperations::SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_PREV_PICTURE); +} + +JSON_STATUS CPicturePlayerOperations::SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_NEXT_PICTURE); +} + +JSON_STATUS CPicturePlayerOperations::MoveLeft(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_MOVE_LEFT); +} + +JSON_STATUS CPicturePlayerOperations::MoveRight(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_MOVE_RIGHT); +} + +JSON_STATUS CPicturePlayerOperations::MoveDown(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_MOVE_DOWN); +} + +JSON_STATUS CPicturePlayerOperations::MoveUp(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_MOVE_UP); +} + +JSON_STATUS CPicturePlayerOperations::ZoomOut(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_ZOOM_OUT); +} + +JSON_STATUS CPicturePlayerOperations::ZoomIn(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_ZOOM_IN); +} + +JSON_STATUS CPicturePlayerOperations::Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!(parameterObject.isInt() || parameterObject.isNull())) + return InvalidParams; + + int zoom = parameterObject.isInt() ? parameterObject.asInt() : 1; + if (zoom > 10 || zoom <= 0) + return InvalidParams; + + return SendAction(ACTION_ZOOM_LEVEL_NORMAL + (zoom - 1)); +} + +JSON_STATUS CPicturePlayerOperations::Rotate(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + return SendAction(ACTION_ROTATE_PICTURE); +} + +/*JSON_STATUS Move(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW); + if (pSlideShow) { + CAction action; + action.id = ACTION_ANALOG_MOVE; + action.amount1=(float) atof(paras[0]); + action.amount2=(float) atof(paras[1]); + pSlideShow->OnAction(action); +}*/ + +JSON_STATUS CPicturePlayerOperations::SendAction(int actionID) +{ + CAction action; + action.actionId = actionID; + g_application.getApplicationMessenger().SendAction(action, WINDOW_SLIDESHOW); + + return ACK; +} + + + + + + + + + + + + diff --git a/xbmc/lib/libjsonrpc/PicturePlayerOperations.h b/xbmc/lib/libjsonrpc/PicturePlayerOperations.h new file mode 100644 index 0000000000..951e582765 --- /dev/null +++ b/xbmc/lib/libjsonrpc/PicturePlayerOperations.h @@ -0,0 +1,50 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "StdString.h" +#include "JSONRPC.h" + +namespace JSONRPC +{ + class CPicturePlayerOperations + { + public: + static JSON_STATUS PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS MoveLeft(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS MoveRight(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS MoveDown(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS MoveUp(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS ZoomOut(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS ZoomIn(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Rotate(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + private: + static inline JSON_STATUS SendAction(int actionID); +// static JSON_STATUS Move(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + }; +} diff --git a/xbmc/lib/libjsonrpc/PlayerOperations.cpp b/xbmc/lib/libjsonrpc/PlayerOperations.cpp new file mode 100644 index 0000000000..8239b79d16 --- /dev/null +++ b/xbmc/lib/libjsonrpc/PlayerOperations.cpp @@ -0,0 +1,45 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "PlayerOperations.h" +#include "Application.h" +#include "Builtins.h" +#include "Util.h" +#include "PlayListPlayer.h" +#include "GUIWindowManager.h" + +using namespace Json; +using namespace JSONRPC; + +JSON_STATUS CPlayerOperations::GetActivePlayers(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + result["players"] = arrayValue; + + if (g_application.IsPlayingVideo()) + result["players"].append("video"); + else if (g_application.IsPlayingAudio()) + result["players"].append("music"); + + if (g_windowManager.IsWindowActive(WINDOW_SLIDESHOW)) + result["players"].append("picture"); + + return OK; +} diff --git a/xbmc/lib/libjsonrpc/PlaylistOperations.cpp b/xbmc/lib/libjsonrpc/PlaylistOperations.cpp new file mode 100644 index 0000000000..85a9ab4414 --- /dev/null +++ b/xbmc/lib/libjsonrpc/PlaylistOperations.cpp @@ -0,0 +1,194 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "PlaylistOperations.h" +#include "PlayListPlayer.h" +#include "PlayListFactory.h" +#include "Util.h" +#include "GUIWindowManager.h" +#include "GUIUserMessages.h" + +using namespace Json; +using namespace JSONRPC; +using namespace PLAYLIST; +using namespace std; + +JSON_STATUS CPlaylistOperations::GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + CPlayList *playlist = NULL; + bool current; + if (!GetPlaylist(parameterObject, &playlist, current)) + return InvalidParams; + + CFileItemList items; + if (playlist) + { + for (unsigned int i = 0; i < playlist->size(); i++) + items.Add((*playlist)[i]); + + CStdString name = playlist->GetName(); + if (!name.IsEmpty()) + result["name"] = playlist->GetName(); + } + + HandleFileItemList(NULL, "items", items, parameterObject, result); + + if (current) + result["current"] = g_playlistPlayer.GetCurrentSong(); + + return OK; +} + +JSON_STATUS CPlaylistOperations::Add(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!parameterObject.isMember("file")) + return InvalidParams; + + CPlayList *playlist = NULL; + bool current; + if (!GetPlaylist(parameterObject, &playlist, current)) + return InvalidParams; + + if (parameterObject["file"].isString()) + { + CStdString file = parameterObject["file"].asString(); + CFileItemPtr item = CFileItemPtr(new CFileItem(file, CUtil::HasSlashAtEnd(file))); + playlist->Add(item); + } + else + return InvalidParams; + + NotifyAll(); + return ACK; +} + +JSON_STATUS CPlaylistOperations::Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!parameterObject.isMember("item")) + return InvalidParams; + + CPlayList *playlist = NULL; + bool current; + if (!GetPlaylist(parameterObject, &playlist, current)) + return InvalidParams; + + if (parameterObject["item"].isInt()) + playlist->Remove(parameterObject["item"].asInt()); + else if (parameterObject["item"].isString()) + playlist->Remove(parameterObject["item"].asString()); + else + return InvalidParams; + + NotifyAll(); + return ACK; +} + +JSON_STATUS CPlaylistOperations::Swap(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!parameterObject.isMember("item1") && !parameterObject.isMember("item2")) + return InvalidParams; + + CPlayList *playlist = NULL; + bool current; + if (!GetPlaylist(parameterObject, &playlist, current)) + return InvalidParams; + + if (parameterObject["item1"].isInt() && parameterObject["item2"].isInt()) + playlist->Swap(parameterObject["item1"].asInt(), parameterObject["item1"].asInt()); + else + return InvalidParams; + + NotifyAll(); + return ACK; +} + +JSON_STATUS CPlaylistOperations::Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + CPlayList *playlist = NULL; + bool current; + if (!GetPlaylist(parameterObject, &playlist, current)) + return InvalidParams; + + playlist->Clear(); + + NotifyAll(); + return ACK; +} + +JSON_STATUS CPlaylistOperations::Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + CPlayList *playlist = NULL; + bool current; + if (!GetPlaylist(parameterObject, &playlist, current)) + return InvalidParams; + + playlist->Shuffle(); + + NotifyAll(); + return ACK; +} + +JSON_STATUS CPlaylistOperations::UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + CPlayList *playlist = NULL; + bool current; + if (!GetPlaylist(parameterObject, &playlist, current)) + return InvalidParams; + + playlist->UnShuffle(); + + NotifyAll(); + return ACK; +} + +int CPlaylistOperations::PlaylistFromString(const string &id) +{ + CStdString tempID = id; + tempID = tempID.ToLower(); + if (tempID.Equals("video")) + return PLAYLIST_VIDEO; + else if (tempID.Equals("music")) + return PLAYLIST_MUSIC; + else + return PLAYLIST_NONE; +} + +bool CPlaylistOperations::GetPlaylist(const Value& parameterObject, CPlayList **playlist, bool ¤t) +{ + const Value id = (parameterObject.isObject() && parameterObject.isMember("playlist")) ? parameterObject["playlist"] : Value(nullValue); + int nbr; + if (id.isNull() || id.isString()) + { + nbr = id.isNull() ? g_playlistPlayer.GetCurrentPlaylist() : PlaylistFromString(id.asString()); + *playlist = &g_playlistPlayer.GetPlaylist(nbr); + + current = g_playlistPlayer.GetCurrentPlaylist() == nbr; + return *playlist != NULL; + } + else + return false; +} + +void CPlaylistOperations::NotifyAll() +{ + CGUIMessage msg(GUI_MSG_PLAYLIST_CHANGED, 0, 0); + g_windowManager.SendThreadMessage( msg ); +} diff --git a/xbmc/lib/libjsonrpc/PlaylistOperations.h b/xbmc/lib/libjsonrpc/PlaylistOperations.h new file mode 100644 index 0000000000..e3a53668c4 --- /dev/null +++ b/xbmc/lib/libjsonrpc/PlaylistOperations.h @@ -0,0 +1,45 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "StdString.h" +#include "JSONRPC.h" +#include "FileItemHandler.h" +#include "PlayList.h" + +namespace JSONRPC +{ + class CPlaylistOperations : public CFileItemHandler + { + public: + static JSON_STATUS GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Add(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Swap(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + private: + static inline int PlaylistFromString(const std::string &id); + static inline bool GetPlaylist(const Json::Value& parameterObject, PLAYLIST::CPlayList **playlist, bool ¤t); + static inline void NotifyAll(); + }; +} diff --git a/xbmc/lib/libjsonrpc/SystemOperations.cpp b/xbmc/lib/libjsonrpc/SystemOperations.cpp new file mode 100644 index 0000000000..df33cd83dc --- /dev/null +++ b/xbmc/lib/libjsonrpc/SystemOperations.cpp @@ -0,0 +1,99 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "SystemOperations.h" +#include "Application.h" +#include "PowerManager.h" + +using namespace Json; +using namespace JSONRPC; + +JSON_STATUS CSystemOperations::Shutdown(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (g_powerManager.CanPowerdown()) + { + g_application.getApplicationMessenger().Powerdown(); + return ACK; + } + else + return FailedToExecute; +} + +JSON_STATUS CSystemOperations::Suspend(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (g_powerManager.CanSuspend()) + { + g_application.getApplicationMessenger().Suspend(); + return ACK; + } + else + return FailedToExecute; +} + +JSON_STATUS CSystemOperations::Hibernate(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (g_powerManager.CanHibernate()) + { + g_application.getApplicationMessenger().Hibernate(); + return ACK; + } + else + return FailedToExecute; +} + +JSON_STATUS CSystemOperations::Reboot(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (g_powerManager.CanReboot()) + { + g_application.getApplicationMessenger().Restart(); + return ACK; + } + else + return FailedToExecute; +} + +JSON_STATUS CSystemOperations::GetInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!parameterObject.isArray()) + return InvalidParams; + + bool CanControlPower = (client->GetPermissionFlags() & ControlPower) > 0; + + for (unsigned int i = 0; i < parameterObject.size(); i++) + { + if (!parameterObject[i].isString()) + continue; + + CStdString field = parameterObject[i].asString(); + field = field.ToLower(); + + if (field.Equals("canshutdown")) + result["CanShutdown"] = (g_powerManager.CanPowerdown() && CanControlPower); + else if (field.Equals("cansuspend")) + result["CanSuspend"] = (g_powerManager.CanSuspend() && CanControlPower); + else if (field.Equals("canhibernate")) + result["CanHibernate"] = (g_powerManager.CanHibernate() && CanControlPower); + else if (field.Equals("canreboot")) + result["CanReboot"] = (g_powerManager.CanReboot() && CanControlPower); + } + + return OK; +} diff --git a/xbmc/lib/libjsonrpc/SystemOperations.h b/xbmc/lib/libjsonrpc/SystemOperations.h new file mode 100644 index 0000000000..93e760ee7a --- /dev/null +++ b/xbmc/lib/libjsonrpc/SystemOperations.h @@ -0,0 +1,38 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "StdString.h" +#include "JSONRPC.h" + +namespace JSONRPC +{ + class CSystemOperations + { + public: + static JSON_STATUS Shutdown(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Suspend(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Hibernate(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS Reboot(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS GetInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + }; +} diff --git a/xbmc/lib/libjsonrpc/TCPServer.cpp b/xbmc/lib/libjsonrpc/TCPServer.cpp new file mode 100644 index 0000000000..02c89e217e --- /dev/null +++ b/xbmc/lib/libjsonrpc/TCPServer.cpp @@ -0,0 +1,270 @@ +#include "TCPServer.h" +#include <stdio.h> +#include <stdlib.h> +#include <memory.h> +#include "JSONRPC.h" +#include "json/json.h" +#include "AnnouncementManager.h" +#include "log.h" +#include "SingleLock.h" + +using namespace JSONRPC; +using namespace ANNOUNCEMENT; +using namespace std; +using namespace Json; + +#define RECEIVEBUFFER 1024 + +CTCPServer *CTCPServer::ServerInstance = NULL; + +void CTCPServer::StartServer(int port, bool nonlocal) +{ + StopServer(true); + + ServerInstance = new CTCPServer(port, nonlocal); + ServerInstance->Create(); +} + +void CTCPServer::StopServer(bool bWait) +{ + if (ServerInstance) + { + ServerInstance->StopThread(bWait); + if (bWait) + { + delete ServerInstance; + ServerInstance = NULL; + } + } +} + +CTCPServer::CTCPServer(int port, bool nonlocal) +{ + m_port = port; + m_nonlocal = nonlocal; + m_ServerSocket = -1; +} + +void CTCPServer::Process() +{ + m_bStop = !Initialize(); + + while (!m_bStop) + { + int max_fd = 0; + fd_set rfds; + struct timeval to = {1, 0}; + FD_ZERO(&rfds); + + FD_SET(m_ServerSocket, &rfds); + max_fd = m_ServerSocket; + + for (unsigned int i = 0; i < m_connections.size(); i++) + { + FD_SET(m_connections[i].m_socket, &rfds); + if (m_connections[i].m_socket > max_fd) + max_fd = m_connections[i].m_socket; + } + + int res = select(max_fd+1, &rfds, NULL, NULL, &to); + if (res < 0) + { + CLog::Log(LOGERROR, "JSONRPC Server: Select failed"); + m_bStop = false; + } + else if (res > 0) + { + for (int i = m_connections.size() - 1; i >= 0; i--) + { + int socket = m_connections[i].m_socket; + if (FD_ISSET(socket, &rfds)) + { + char buffer[RECEIVEBUFFER] = {}; + int nread = 0; + nread = recv(socket, &buffer, RECEIVEBUFFER, 0); + if (nread > 0) + { + printf("recieved %d bytes from client %d (%*s)\n", nread, socket, nread, buffer); + m_connections[i].PushBuffer(this, buffer, nread); + } + if (nread <= 0) + { + CLog::Log(LOGINFO, "JSONRPC Server: Disconnection detected"); + m_connections[i].Disconnect(); + m_connections.erase(m_connections.begin() + i); + } + } + } + + if (FD_ISSET(m_ServerSocket, &rfds)) + { + CLog::Log(LOGDEBUG, "JSONRPC Server: New connection detected"); + CTCPClient newconnection; + newconnection.m_socket = accept(m_ServerSocket, &newconnection.m_cliaddr, &newconnection.m_addrlen); + + if (newconnection.m_socket < 0) + CLog::Log(LOGERROR, "JSONRPC Server: Accept of new connection failed"); + else + { + CLog::Log(LOGINFO, "JSONRPC Server: New connection added"); + m_connections.push_back(newconnection); + } + } + } + } + + Deinitialize(); +} + +bool CTCPServer::Download(const char *path, Json::Value *result) +{ + return false; +} + +int CTCPServer::GetCapabilities() +{ + return Response | Announcing; +} + +void CTCPServer::Announce(EAnnouncementFlag flag, const char *sender, const char *message, const char *data) +{ + Value root; + root["jsonrpc"] = "2.0"; + root["method"] = "Announcement"; + root["params"]["sender"] = sender; + root["params"]["message"] = message; + if (data) + root["params"]["data"] = data; + + StyledWriter writer; + string str = writer.write(root); + + printf("Announce %s\n", str.c_str()); + + for (unsigned int i = 0; i < m_connections.size(); i++) + { + unsigned int sent = 0; + do + { + CSingleLock lock (m_connections[i].m_critSection); + sent += send(m_connections[i].m_socket, str.c_str(), str.size() - sent, sent); + } while (sent < str.size()); + } +} + +bool CTCPServer::Initialize() +{ + Deinitialize(); + + struct sockaddr_in myaddr; + + myaddr.sin_family = AF_INET; + myaddr.sin_port = htons(m_port); + + if (m_nonlocal) + myaddr.sin_addr.s_addr = INADDR_ANY; + else + inet_pton(AF_INET, "127.0.0.1", &myaddr.sin_addr.s_addr); + + m_ServerSocket = socket(PF_INET, SOCK_STREAM, 0); + + if (m_ServerSocket < 0) + { + CLog::Log(LOGERROR, "JSONRPC Server: Failed to create serversocket"); + return false; + } + + if (bind(m_ServerSocket, (struct sockaddr*)&myaddr, sizeof myaddr) < 0) + { + CLog::Log(LOGERROR, "JSONRPC Server: Failed to bind serversocket"); + close(m_ServerSocket); + return false; + } + + if (listen(m_ServerSocket, 10) < 0) + { + CLog::Log(LOGERROR, "JSONRPC Server: Failed to set listen"); + close(m_ServerSocket); + return false; + } + + CAnnouncementManager::AddAnnouncer(this); + + CLog::Log(LOGINFO, "JSONRPC Server: Successfully initialized"); + return true; +} + +void CTCPServer::Deinitialize() +{ + for (unsigned int i = 0; i < m_connections.size(); i++) + m_connections[i].Disconnect(); + + m_connections.clear(); + + if (m_ServerSocket > 0) + { + shutdown(m_ServerSocket, SHUT_RDWR); + close(m_ServerSocket); + m_ServerSocket = -1; + } + + CAnnouncementManager::RemoveAnnouncer(this); +} + +CTCPServer::CTCPClient::CTCPClient() +{ + m_announcementflags = 0; + m_socket = -1; + m_beginBrackets = 0; + m_endBrackets = 0; + + m_addrlen = sizeof(struct sockaddr); +} + +int CTCPServer::CTCPClient::GetPermissionFlags() +{ + return OPERATION_PERMISSION_ALL; +} + +int CTCPServer::CTCPClient::GetAnnouncementFlags() +{ + return m_announcementflags; +} + +bool CTCPServer::CTCPClient::SetAnnouncementFlags(int flags) +{ + m_announcementflags = flags; + return true; +} + +void CTCPServer::CTCPClient::PushBuffer(CTCPServer *host, const char *buffer, int length) +{ + for (int i = 0; i < length; i++) + { + char c = buffer[i]; + m_buffer.push_back(c); + if (c == '{') + m_beginBrackets++; + else if (c == '}') + m_endBrackets++; + if (m_beginBrackets > 0 && m_endBrackets > 0 && m_beginBrackets == m_endBrackets) + { + CSingleLock lock (m_critSection); + string line = CJSONRPC::MethodCall(m_buffer, host, this); + send(m_socket, line.c_str(), line.size(), 0); + m_beginBrackets = m_endBrackets = 0; + m_buffer.clear(); + } + } +} + +void CTCPServer::CTCPClient::Disconnect() +{ + if (m_socket > 0) + { + CSingleLock lock (m_critSection); + shutdown(m_socket, SHUT_RDWR); + close(m_socket); + m_socket = -1; + } +} diff --git a/xbmc/lib/libjsonrpc/TCPServer.h b/xbmc/lib/libjsonrpc/TCPServer.h new file mode 100644 index 0000000000..b7e5e32932 --- /dev/null +++ b/xbmc/lib/libjsonrpc/TCPServer.h @@ -0,0 +1,60 @@ +#pragma once +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <string> +#include <vector> +#include "IAnnouncer.h" +#include "ITransportLayer.h" +#include "Thread.h" +#include "CriticalSection.h" + +namespace JSONRPC +{ + class CTCPServer : public ITransportLayer, public ANNOUNCEMENT::IAnnouncer, public CThread + { + public: + static void StartServer(int port, bool nonlocal); + static void StopServer(bool bWait); + + virtual bool Download(const char *path, Json::Value *result); + virtual int GetCapabilities(); + + virtual void Announce(ANNOUNCEMENT::EAnnouncementFlag flag, const char *sender, const char *message, const char *data); + protected: + void Process(); + private: + CTCPServer(int port, bool nonlocal); + bool Initialize(); + void Deinitialize(); + + class CTCPClient : public IClient + { + public: + CTCPClient(); + virtual int GetPermissionFlags(); + virtual int GetAnnouncementFlags(); + virtual bool SetAnnouncementFlags(int flags); + void PushBuffer(CTCPServer *host, const char *buffer, int length); + void Disconnect(); + + int m_socket; + struct sockaddr m_cliaddr; + socklen_t m_addrlen; + CCriticalSection m_critSection; + + private: + int m_announcementflags; + int m_beginBrackets, m_endBrackets; + std::string m_buffer; + }; + + std::vector<CTCPClient> m_connections; + int m_ServerSocket; + int m_port; + bool m_nonlocal; + + static CTCPServer *ServerInstance; + }; +} diff --git a/xbmc/lib/libjsonrpc/VideoLibrary.cpp b/xbmc/lib/libjsonrpc/VideoLibrary.cpp new file mode 100644 index 0000000000..e7f7e0d61e --- /dev/null +++ b/xbmc/lib/libjsonrpc/VideoLibrary.cpp @@ -0,0 +1,225 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "VideoLibrary.h" +#include "../VideoDatabase.h" +#include "../Util.h" + +using namespace Json; +using namespace JSONRPC; + +JSON_STATUS CVideoLibrary::GetMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!(parameterObject.isObject() || parameterObject.isNull())) + return InvalidParams; + + CVideoDatabase videodatabase; + if (!videodatabase.Open()) + return InternalError; + +// int genreID = parameterObject.get("genreid", -1).asInt(); + + CFileItemList items; + if (videodatabase.GetMoviesNav("", items)) + HandleFileItemList("movieid", "movies", items, parameterObject, result); + + videodatabase.Close(); + return OK; +} + +JSON_STATUS CVideoLibrary::GetTVShows(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!(parameterObject.isObject() || parameterObject.isNull())) + return InvalidParams; + + CVideoDatabase videodatabase; + if (!videodatabase.Open()) + return InternalError; + +// int genreID = parameterObject.get("genreid", -1).asInt(); + + CFileItemList items; + if (videodatabase.GetTvShowsNav("", items)) + HandleFileItemList("tvshowid", "tvshows", items, parameterObject, result); + + videodatabase.Close(); + return OK; +} + +JSON_STATUS CVideoLibrary::GetSeasons(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!(parameterObject.isObject() || parameterObject.isNull())) + return InvalidParams; + + CVideoDatabase videodatabase; + if (!videodatabase.Open()) + return InternalError; + + const Value param = parameterObject.isObject() ? parameterObject : Value(objectValue); + int tvshowID = param.get("tvshowid", -1).asInt(); + + CFileItemList items; + if (videodatabase.GetSeasonsNav("", items, -1, -1, -1, -1, tvshowID)) + HandleFileItemList("seasonid", "seasons", items, param, result); + + videodatabase.Close(); + return OK; +} + +JSON_STATUS CVideoLibrary::GetEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!(parameterObject.isObject() || parameterObject.isNull())) + return InvalidParams; + + CVideoDatabase videodatabase; + if (!videodatabase.Open()) + return InternalError; + + const Value param = parameterObject.isObject() ? parameterObject : Value(objectValue); + int tvshowID = param.get("tvshowid", -1).asInt(); + int seasonID = param.get("seasonid", -1).asInt(); + + CFileItemList items; + if (videodatabase.GetEpisodesNav("", items, -1, -1, -1, -1, tvshowID, seasonID)) + HandleFileItemList("episodeid", "episodes", items, param, result); + + videodatabase.Close(); + return OK; +} + +JSON_STATUS CVideoLibrary::GetMusicVideoAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ +/* CVideoDatabase videodatabase; + if (!videodatabase.Open()) + return InternalError; + + int artistID = parameterObject.get("artistid", -1).asInt(); +// bool GetMusicVideosNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idArtist=-1, int idDirector=-1, int idStudio=-1, int idAlbum=-1); + CFileItemList items; +// bool GetMusicVideosNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idArtist=-1, int idDirector=-1, int idStudio=-1, int idAlbum=-1); + if (videodatabase.GetMusicVideoAlbumsNav("", items, -1, -1, artistID, -1, -1, -1, -1)) + HandleFileItemList("albumid", "albums", items, parameterObject, result); + + videodatabase.Close();*/ + return OK; +} + +JSON_STATUS CVideoLibrary::GetMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!(parameterObject.isObject() || parameterObject.isNull())) + return InvalidParams; + + CVideoDatabase videodatabase; + if (!videodatabase.Open()) + return InternalError; + + const Value param = parameterObject.isObject() ? parameterObject : Value(objectValue); + int artistID = param.get("artistid", -1).asInt(); + int albumID = param.get("albumid", -1).asInt(); + + CFileItemList items; + if (videodatabase.GetMusicVideosNav("", items, -1, -1, artistID, -1, -1, albumID)) + HandleFileItemList("musicvideoid", "musicvideos", items, param, result); + + videodatabase.Close(); + return OK; +} + +JSON_STATUS CVideoLibrary::GetMovieInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ + if (!parameterObject.isObject() || !parameterObject.isMember("movieid") || parameterObject.get("movieid", -1).asInt() < 0 || !parameterObject.isMember("fields")) + return InvalidParams; + + int movieID = parameterObject.get("movieid", -1).asInt(); + + CVideoDatabase videodatabase; + if (!videodatabase.Open()) + return InternalError; + + CStdString filepath; + CVideoInfoTag videoInfo; + videodatabase.GetMovieInfo(filepath, videoInfo, movieID); + FillVideoDetails(&videoInfo, parameterObject, result); + + videodatabase.Close(); + return OK; +} + +JSON_STATUS CVideoLibrary::GetTVShowInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ +/* if (!parameterObject.isMember("tvshowid") || parameterObject.get("tvshowid", -1).asInt() < 0 || !parameterObject.isMember("fields")) + return InvalidParams; + + int tvshowID = parameterObject.get("tvshowid", -1).asInt(); + + CVideoDatabase videodatabase; + if (!videodatabase.Open()) + return InternalError; + + CStdString filepath; + CVideoInfoTag videoInfo; + videodatabase.GetTvShowInfo(filepath, videoInfo, tvshowID); + FillVideoDetails(&videoInfo, parameterObject, result); + + videodatabase.Close();*/ + return OK; +} + +JSON_STATUS CVideoLibrary::GetEpisodeInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ +/* if (!parameterObject.has<long>("episodeid") || parameterObject.get<long>("episodeid") < 0 || !parameterObject.has<Array>("fields")) + if (!parameterObject.isMember("episodeid") || parameterObject.get("episodeid", -1).asInt() < 0 || !parameterObject.isMember("fields")) + return InvalidParams; + + int episodeID = (int)parameterObject.get<long>("episodeid"); + + CVideoDatabase videodatabase; + if (!videodatabase.Open()) + return InternalError; + + CStdString filepath; + CVideoInfoTag videoInfo; + videodatabase.GetEpisodeInfo(filepath, videoInfo, episodeID); + FillVideoDetails(&videoInfo, parameterObject, result); + + videodatabase.Close();*/ + return OK; +} + +JSON_STATUS CVideoLibrary::GetMusicVideoInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result) +{ +/* if (!parameterObject.has<long>("musicvideoid") || parameterObject.get<long>("musicvideoid") < 0 || !parameterObject.has<Array>("fields")) + return InvalidParams; + + int musicID = (int)parameterObject.get<long>("musicvideoid"); + + CVideoDatabase videodatabase; + if (!videodatabase.Open()) + return InternalError; + + CStdString filepath; + CVideoInfoTag videoInfo; + videodatabase.GetMusicVideoInfo(filepath, videoInfo, musicID); + FillVideoDetails(&videoInfo, parameterObject, result); + + videodatabase.Close();*/ + return OK; +} diff --git a/xbmc/lib/libjsonrpc/VideoLibrary.h b/xbmc/lib/libjsonrpc/VideoLibrary.h new file mode 100644 index 0000000000..aaa5105456 --- /dev/null +++ b/xbmc/lib/libjsonrpc/VideoLibrary.h @@ -0,0 +1,67 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "StdString.h" +#include "JSONRPC.h" +#include "FileItemHandler.h" + +/* + bool GetGenresNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1); + bool GetStudiosNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1); + bool GetActorsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1); + bool GetDirectorsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1); + bool GetWritersNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1); + bool GetYearsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1); + bool GetSetsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const CStdString &where = ""); + bool GetMusicVideoAlbumsNav(const CStdString& strBaseDir, CFileItemList& items, int idArtist); + + bool GetMoviesNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idStudio=-1, int idSet=-1); + bool GetTvShowsNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idStudio=-1); + bool GetSeasonsNav(const CStdString& strBaseDir, CFileItemList& items, int idActor=-1, int idDirector=-1, int idGenre=-1, int idYear=-1, int idShow=-1); + bool GetEpisodesNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idShow=-1, int idSeason=-1); + bool GetMusicVideosNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idArtist=-1, int idDirector=-1, int idStudio=-1, int idAlbum=-1); + + bool GetRecentlyAddedMoviesNav(const CStdString& strBaseDir, CFileItemList& items); + bool GetRecentlyAddedEpisodesNav(const CStdString& strBaseDir, CFileItemList& items); + bool GetRecentlyAddedMusicVideosNav(const CStdString& strBaseDir, CFileItemList& items); +*/ + +namespace JSONRPC +{ + class CVideoLibrary : public CFileItemHandler + { + public: + static JSON_STATUS GetMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS GetTVShows(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetSeasons(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS GetMusicVideoAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS GetMovieInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetTVShowInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetEpisodeInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS GetMusicVideoInfo(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + }; +} diff --git a/xbmc/lib/libjsonrpc/XBMCOperations.cpp b/xbmc/lib/libjsonrpc/XBMCOperations.cpp new file mode 100644 index 0000000000..309a4fc1b8 --- /dev/null +++ b/xbmc/lib/libjsonrpc/XBMCOperations.cpp @@ -0,0 +1,138 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "XBMCOperations.h" +#include "Application.h" +#include "ApplicationMessenger.h" +#include "FileItem.h" +#include "Util.h" +#include "log.h" + +using namespace Json; +using namespace JSONRPC; + +JSON_STATUS CXBMCOperations::GetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + Value val = g_application.GetVolume(); + result.swap(val); + return OK; +} + +JSON_STATUS CXBMCOperations::SetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!parameterObject.isInt()) + return InvalidParams; + + int percentage = parameterObject.asInt(); + g_application.SetVolume(percentage); + return GetVolume(method, transport, client, parameterObject, result); +} + +JSON_STATUS CXBMCOperations::ToggleMute(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + CAction action; + action.actionId = ACTION_MUTE; + g_application.getApplicationMessenger().SendAction(action); + return GetVolume(method, transport, client, parameterObject, result); +} + +JSON_STATUS CXBMCOperations::Play(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (!parameterObject.isString()) + return InvalidParams; + + g_application.getApplicationMessenger().MediaPlay(parameterObject.asString()); + return ACK; +} + +JSON_STATUS CXBMCOperations::StartSlideshow(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + CStdString exec = "slideShow("; + + if (parameterObject.isString()) + exec += parameterObject.asString(); + else if (parameterObject.isObject() && parameterObject.isMember("directory") && parameterObject["directory"].isString()) + { + exec += parameterObject["directory"].asString(); + + if (parameterObject.get("random", true).asBool()) + exec += ", random"; + else + exec += ", notrandom"; + + if (parameterObject.get("recursive", true).asBool()) + exec += ", recursive"; + } + else + return InvalidParams; + + exec += ")"; + ThreadMessage msg = { TMSG_EXECUTE_BUILT_IN, (DWORD)0, (DWORD)0, exec }; + g_application.getApplicationMessenger().SendMessage(msg); + + return ACK; +} + +JSON_STATUS CXBMCOperations::Log(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + if (parameterObject.isString()) + CLog::Log(LOGDEBUG, parameterObject.asString().c_str()); + else if (parameterObject.isObject() && parameterObject.isMember("message") && parameterObject["message"].isString()) + { + if (parameterObject.isMember("level") && !parameterObject["level"].isString()) + return InvalidParams; + + CStdString strlevel = parameterObject.get("level", "debug").asString(); + int level = ParseLogLevel(strlevel.ToLower().c_str()); + + CLog::Log(level, parameterObject["message"].asString().c_str()); + } + else + return InvalidParams; + + return ACK; +} + +JSON_STATUS CXBMCOperations::Quit(const CStdString &method, ITransportLayer *transport, IClient *client, const Value& parameterObject, Value &result) +{ + g_application.getApplicationMessenger().Quit(); + return ACK; +} + +int CXBMCOperations::ParseLogLevel(const char *level) +{ + if (strcmp(level, "debug") == 0) + return LOGDEBUG; + else if (strcmp(level, "info") == 0) + return LOGINFO; + else if (strcmp(level, "notice") == 0) + return LOGNOTICE; + else if (strcmp(level, "warning") == 0) + return LOGWARNING; + else if (strcmp(level, "error") == 0) + return LOGERROR; + else if (strcmp(level, "severe") == 0) + return LOGSEVERE; + else if (strcmp(level, "fatal") == 0) + return LOGFATAL; + else if (strcmp(level, "none") == 0) + return LOGNONE; +} diff --git a/xbmc/lib/libjsonrpc/XBMCOperations.h b/xbmc/lib/libjsonrpc/XBMCOperations.h new file mode 100644 index 0000000000..99ea6c1ae2 --- /dev/null +++ b/xbmc/lib/libjsonrpc/XBMCOperations.h @@ -0,0 +1,44 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "StdString.h" +#include "JSONRPC.h" + +namespace JSONRPC +{ + class CXBMCOperations + { + public: + static JSON_STATUS GetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS SetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS ToggleMute(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS Play(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + static JSON_STATUS StartSlideshow(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS Log(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + + static JSON_STATUS Quit(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result); + private: + inline static int ParseLogLevel(const char *level); + }; +} diff --git a/xbmc/utils/AnnouncementManager.cpp b/xbmc/utils/AnnouncementManager.cpp new file mode 100644 index 0000000000..c64e2b033d --- /dev/null +++ b/xbmc/utils/AnnouncementManager.cpp @@ -0,0 +1,59 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "AnnouncementManager.h" +#include "SingleLock.h" +#include <stdio.h> +#include "log.h" + +using namespace std; +using namespace ANNOUNCEMENT; + +CCriticalSection CAnnouncementManager::m_critSection; +vector<IAnnouncer *> CAnnouncementManager::m_announcers; + +void CAnnouncementManager::AddAnnouncer(IAnnouncer *listener) +{ + CSingleLock lock (m_critSection); + m_announcers.push_back(listener); +} + +void CAnnouncementManager::RemoveAnnouncer(IAnnouncer *listener) +{ + CSingleLock lock (m_critSection); + for (unsigned int i = 0; i < m_announcers.size(); i++) + { + if (m_announcers[i] == listener) + { + m_announcers.erase(m_announcers.begin() + i); + return; + } + } +} + +void CAnnouncementManager::Announce(EAnnouncementFlag flag, const char *sender, const char *message, const char *data) +{ + CLog::Log(LOGDEBUG, "CAnnouncementManager - Announcment: %s from %s", message, sender); + printf("CAnnouncementManager - Announcment: %s from %s\n", message, sender); + CSingleLock lock (m_critSection); + for (unsigned int i = 0; i < m_announcers.size(); i++) + m_announcers[i]->Announce(flag, sender, message, data); +} diff --git a/xbmc/utils/AnnouncementManager.h b/xbmc/utils/AnnouncementManager.h new file mode 100644 index 0000000000..93370ed7e0 --- /dev/null +++ b/xbmc/utils/AnnouncementManager.h @@ -0,0 +1,39 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "IAnnouncer.h" +#include "CriticalSection.h" +#include <vector> + +namespace ANNOUNCEMENT +{ + class CAnnouncementManager + { + public: + static void AddAnnouncer(IAnnouncer *listener); + static void RemoveAnnouncer(IAnnouncer *listener); + static void Announce(EAnnouncementFlag flag, const char *sender, const char *message, const char *data = NULL); + private: + static std::vector<IAnnouncer *> m_announcers; + static CCriticalSection m_critSection; + }; +} diff --git a/xbmc/utils/Builtins.cpp b/xbmc/utils/Builtins.cpp index 263ab1a1b9..0d1148b979 100644 --- a/xbmc/utils/Builtins.cpp +++ b/xbmc/utils/Builtins.cpp @@ -70,11 +70,6 @@ #include "lib/libPython/XBPython.h" #endif -#ifdef HAS_WEB_SERVER -#include "lib/libGoAhead/XBMChttp.h" -#include "lib/libGoAhead/WebServer.h" -#endif - #if defined(__APPLE__) #include "FileSystem/SpecialProtocol.h" #include "CocoaInterface.h" @@ -610,7 +605,7 @@ int CBuiltins::Execute(const CStdString& execString) { if( g_application.IsPlaying() && g_application.m_pPlayer && g_application.m_pPlayer->CanRecord()) { -#ifdef HAS_WEB_SERVER +#ifdef HAS_WEB_SERVER_BROADCAST if (m_pXbmcHttp && g_settings.m_HttpApiBroadcastLevel>=1) g_application.getApplicationMessenger().HttpApi(g_application.m_pPlayer->IsRecording()?"broadcastlevel; RecordStopping;1":"broadcastlevel; RecordStarting;1"); #endif diff --git a/xbmc/utils/IAnnouncer.h b/xbmc/utils/IAnnouncer.h new file mode 100644 index 0000000000..610abf29f4 --- /dev/null +++ b/xbmc/utils/IAnnouncer.h @@ -0,0 +1,42 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +namespace ANNOUNCEMENT +{ + enum EAnnouncementFlag + { + Playback = 0x1, + GUI = 0x2, + System = 0x4, + Other = 0x8 + }; + + #define ANNOUNCE_ALL (Playback | GUI | System | Other) + + class IAnnouncer + { + public: + IAnnouncer() { }; + virtual ~IAnnouncer() { }; + virtual void Announce(EAnnouncementFlag flag, const char *sender, const char *message, const char *data) = 0; + }; +} diff --git a/xbmc/utils/Makefile b/xbmc/utils/Makefile index 905e69be48..d280a38773 100644 --- a/xbmc/utils/Makefile +++ b/xbmc/utils/Makefile @@ -1,4 +1,4 @@ -INCLUDES=-I. -I.. -I../../ -I../linux -I../cores -I../../guilib -I../posix +INCLUDES=-I. -I.. -I../../ -I../linux -I../cores -I../../guilib -I../posix -I../../lib/jsoncpp/jsoncpp/include SRCS=AlarmClock.cpp \ Archive.cpp \ @@ -61,8 +61,10 @@ SRCS=AlarmClock.cpp \ fastmemcpy.c \ PasswordManager.cpp \ AliasShortcutUtils.cpp \ - RingBuffer.cpp \ + WebServer.cpp \ + AnnouncementManager.cpp \ Semaphore.cpp \ + RingBuffer.cpp \ FileOperationJob.cpp \ FileUtils.cpp \ Variant.cpp \ diff --git a/xbmc/utils/Network.cpp b/xbmc/utils/Network.cpp index ce22cbe916..4784212428 100644 --- a/xbmc/utils/Network.cpp +++ b/xbmc/utils/Network.cpp @@ -283,6 +283,9 @@ void CNetwork::StartServices() #ifdef HAS_DBUS_SERVER g_application.StartDbusServer(); #endif +#ifdef HAS_JSONRPC + g_application.StartJSONRPCServer(); +#endif #ifdef HAS_ZEROCONF g_application.StartZeroconf(); #endif @@ -320,4 +323,7 @@ void CNetwork::StopServices(bool bWait) #ifdef HAS_DBUS_SERVER g_application.StopDbusServer(bWait); #endif +#ifdef HAS_JSONRPC + g_application.StopJSONRPCServer(bWait); +#endif } diff --git a/xbmc/utils/WebServer.cpp b/xbmc/utils/WebServer.cpp new file mode 100644 index 0000000000..b51c5bc28b --- /dev/null +++ b/xbmc/utils/WebServer.cpp @@ -0,0 +1,378 @@ +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "WebServer.h" +#ifdef HAS_WEB_SERVER +#include "../lib/libjsonrpc/JSONRPC.h" +#include "../lib/libhttpapi/HttpApi.h" +#include "../FileSystem/File.h" +#include "../Util.h" +#include "log.h" +#include "SingleLock.h" + +using namespace XFILE; +using namespace std; +using namespace JSONRPC; + +CWebServer::CWebServer() +{ + m_running = false; + m_daemon = NULL; + m_needcredentials = true; + m_Credentials64Encoded = "eGJtYzp4Ym1j"; // xbmc:xbmc +} + +int CWebServer::FillArgumentMap(void *cls, enum MHD_ValueKind kind, const char *key, const char *value) +{ + map<CStdString, CStdString> *arguments = (map<CStdString, CStdString> *)cls; + arguments->insert( pair<CStdString,CStdString>(key,value) ); + + return MHD_YES; +} + +int CWebServer::AskForAuthentication (struct MHD_Connection *connection) +{ + int ret; + struct MHD_Response *response; + + response = MHD_create_response_from_data (0, NULL, MHD_NO, MHD_NO); + if (!response) + return MHD_NO; + + ret = MHD_add_response_header (response, "WWW-Authenticate", "Basic realm=XBMC"); + if (!ret) + { + MHD_destroy_response (response); + return MHD_NO; + } + + ret = MHD_queue_response (connection, MHD_HTTP_UNAUTHORIZED, response); + + MHD_destroy_response (response); + + return ret; +} + +bool CWebServer::IsAuthenticated (CWebServer *server, struct MHD_Connection *connection) +{ + CSingleLock lock (server->m_critSection); + if (!server->m_needcredentials) + return true; + + const char *strbase = "Basic "; + const char *headervalue = MHD_lookup_connection_value(connection, MHD_HEADER_KIND, "Authorization"); + if (NULL == headervalue) + return false; + if (strncmp (headervalue, strbase, strlen(strbase))) + return false; + + return server->m_Credentials64Encoded.Equals(headervalue + strlen(strbase)); +} + +int CWebServer::AnswerToConnection(void *cls, struct MHD_Connection *connection, + const char *url, const char *method, + const char *version, const char *upload_data, + size_t *upload_data_size, void **con_cls) +{ + CWebServer *server = (CWebServer *)cls; + + if (!IsAuthenticated(server, connection)) + return AskForAuthentication(connection); + + CLog::Log(LOGNOTICE, "WebServer: %s | %s", method, url); + + CStdString strURL = url; + + if (strURL.Equals("/jsonrpc") && strcmp (method, "POST") == 0) + return JSONRPC(server, connection, upload_data, upload_data_size); + + if (strcmp(method, "GET") == 0) + { + if (strURL.Left(18).Equals("/xbmcCmds/xbmcHttp")) + return HttpApi(connection); + else if (strURL.Left(6).Equals("/thumb")) + { + strURL = strURL.Right(strURL.length() - 7); + strURL = strURL.Left(strURL.length() - 4); + } + else if (strURL.Left(4).Equals("/vfs")) + { + strURL = strURL.Right(strURL.length() - 5); + CUtil::URLDecode(strURL); + } +#ifdef HAS_WEB_INTERFACE + else if (strURL.Equals("/")) + strURL = "special://home/web/index.html"; + else + strURL.Format("special://home/web%s", strURL.c_str()); +#endif + CFile *file = new CFile(); + if (file->Open(strURL)) + { + struct MHD_Response *response = MHD_create_response_from_callback ( file->GetLength(), + 2048, + &CWebServer::ContentReaderCallback, file, + &CWebServer::ContentReaderFreeCallback); + + CStdString ext = CUtil::GetExtension(strURL); + ext = ext.ToLower(); + const char *mime = CreateMimeTypeFromExtension(ext.c_str()); + if (mime) + MHD_add_response_header(response, "Content-Type", mime); + + int ret = MHD_queue_response(connection, MHD_HTTP_OK, response); + MHD_destroy_response(response); + return ret; + } + else + { + CLog::Log(LOGERROR, "WebServer: Failed to open %s", strURL.c_str()); + delete file; + } + } + + return MHD_NO; +} + +int CWebServer::JSONRPC(CWebServer *server, struct MHD_Connection *connection, const char *upload_data, size_t *upload_data_size) +{ +#ifdef HAS_JSONRPC + CStdString jsoncall; + jsoncall.assign(upload_data, *upload_data_size); + if (*upload_data_size > 204800) + CLog::Log(LOGINFO, "JSONRPC: Recieved a jsonrpc call wich is bigger than 200KiB, skipping logging it"); + else + CLog::Log(LOGINFO, "JSONRPC: Recieved a jsonrpc call - %s", jsoncall.c_str()); + printf("%s\n", jsoncall.c_str()); + CHTTPClient client; + CStdString jsonresponse = CJSONRPC::MethodCall(jsoncall, server, &client); + + struct MHD_Response *response = MHD_create_response_from_data(jsonresponse.length(), (void *) jsonresponse.c_str(), MHD_NO, MHD_YES); + int ret = MHD_queue_response(connection, MHD_HTTP_OK, response); + MHD_add_response_header(response, "Content-Type", "application/json"); + MHD_destroy_response(response); + + return ret; +#else + return MHD_NO; +#endif +} + +int CWebServer::HttpApi(struct MHD_Connection *connection) +{ +#ifdef HAS_HTTPAPI + map<CStdString, CStdString> arguments; + if (MHD_get_connection_values(connection, MHD_GET_ARGUMENT_KIND, FillArgumentMap, &arguments) > 0) + { + CStdString httpapiresponse = CHttpApi::MethodCall(arguments["command"], arguments["parameter"]); + + struct MHD_Response *response = MHD_create_response_from_data(httpapiresponse.length(), (void *) httpapiresponse.c_str(), MHD_NO, MHD_YES); + int ret = MHD_queue_response(connection, MHD_HTTP_OK, response); + MHD_destroy_response(response); + + return ret; + } +#endif + return MHD_NO; +} + +int CWebServer::ContentReaderCallback(void *cls, uint64_t pos, char *buf, int max) +{ + CFile *file = (CFile *)cls; + file->Seek(pos); + return file->Read(buf, max); +} + +void CWebServer::ContentReaderFreeCallback(void *cls) +{ + CFile *file = (CFile *)cls; + file->Close(); + + delete file; +} + +bool CWebServer::Start(const char *ip, int port) +{ + if (!m_running) + { + // To stream perfectly we should probably have MHD_USE_THREAD_PER_CONNECTION instead of MHD_USE_SELECT_INTERNALLY as it provides multiple clients concurrently + m_daemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_IPv6, port, NULL, NULL, &CWebServer::AnswerToConnection, this, MHD_OPTION_END); + m_running = m_daemon != NULL; + CLog::Log(LOGNOTICE, "WebServer: Started the webserver"); + } + return m_running; +} + +bool CWebServer::Stop() +{ + if (m_running) + { + MHD_stop_daemon(m_daemon); + m_running = false; + CLog::Log(LOGNOTICE, "WebServer: Stopped the webserver"); + } + + return !m_running; +} + +bool CWebServer::IsStarted() +{ + return m_running; +} + +void CWebServer::StringToBase64(const char *input, CStdString &output) +{ + const char *lookup = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + unsigned long l; + size_t length = strlen (input); + output = ""; + + for (int i = 0; i < length; i += 3) + { + l = (((unsigned long) input[i]) << 16) + | (((i + 1) < length) ? (((unsigned long) input[i + 1]) << 8) : 0) + | (((i + 2) < length) ? ((unsigned long) input[i + 2]) : 0); + + + output.push_back(lookup[(l >> 18) & 0x3F]); + output.push_back(lookup[(l >> 12) & 0x3F]); + + if (i + 1 < length) + output.push_back(lookup[(l >> 6) & 0x3F]); + if (i + 2 < length) + output.push_back(lookup[l & 0x3F]); + } + + int left = 3 - (length % 3); + + if (length % 3) + { + for (int i = 0; i < left; i++) + output.push_back('='); + } +} + +void CWebServer::SetCredentials(const CStdString &username, const CStdString &password) +{ + CSingleLock lock (m_critSection); + CStdString str = username + ":" + password; + + StringToBase64(str.c_str(), m_Credentials64Encoded); + m_needcredentials = !password.IsEmpty(); +} + +bool CWebServer::Download(const char *path, Json::Value *result) +{ + bool exists = false; + CFile *file = new CFile(); + if (file->Open(path)) + { + exists = true; + file->Close(); + } + + delete file; + + if (exists) + { + string str = "vfs/"; + str += path; + (*result)["path"] = str; + } + + return exists; +} + +int CWebServer::GetCapabilities() +{ + return Response | FileDownload; +} + +const char *CWebServer::CreateMimeTypeFromExtension(const char *ext) +{ + if (strcmp(ext, ".aif") == 0) return "audio/aiff"; + else if (strcmp(ext, ".aiff") == 0) return "audio/aiff"; + else if (strcmp(ext, ".asf") == 0) return "video/x-ms-asf"; + else if (strcmp(ext, ".asx") == 0) return "video/x-ms-asf"; + else if (strcmp(ext, ".avi") == 0) return "video/avi"; + else if (strcmp(ext, ".avs") == 0) return "video/avs-video"; + else if (strcmp(ext, ".bin") == 0) return "application/octet-stream"; + else if (strcmp(ext, ".bmp") == 0) return "image/bmp"; + else if (strcmp(ext, ".dv") == 0) return "video/x-dv"; + else if (strcmp(ext, ".fli") == 0) return "video/fli"; + else if (strcmp(ext, ".gif") == 0) return "image/gif"; + else if (strcmp(ext, ".htm") == 0) return "text/html"; + else if (strcmp(ext, ".html") == 0) return "text/html"; + else if (strcmp(ext, ".htmls") == 0) return "text/html"; + else if (strcmp(ext, ".ico") == 0) return "image/x-icon"; + else if (strcmp(ext, ".it") == 0) return "audio/it"; + else if (strcmp(ext, ".jpeg") == 0) return "image/jpeg"; + else if (strcmp(ext, ".jpg") == 0) return "image/jpeg"; + else if (strcmp(ext, ".json") == 0) return "application/json"; + else if (strcmp(ext, ".kar") == 0) return "audio/midi"; + else if (strcmp(ext, ".list") == 0) return "text/plain"; + else if (strcmp(ext, ".log") == 0) return "text/plain"; + else if (strcmp(ext, ".lst") == 0) return "text/plain"; + else if (strcmp(ext, ".m2v") == 0) return "video/mpeg"; + else if (strcmp(ext, ".m3u") == 0) return "audio/x-mpequrl"; + else if (strcmp(ext, ".mid") == 0) return "audio/midi"; + else if (strcmp(ext, ".midi") == 0) return "audio/midi"; + else if (strcmp(ext, ".mod") == 0) return "audio/mod"; + else if (strcmp(ext, ".mov") == 0) return "video/quicktime"; + else if (strcmp(ext, ".mp2") == 0) return "audio/mpeg"; + else if (strcmp(ext, ".mp3") == 0) return "audio/mpeg3"; + else if (strcmp(ext, ".mpa") == 0) return "audio/mpeg"; + else if (strcmp(ext, ".mpeg") == 0) return "video/mpeg"; + else if (strcmp(ext, ".mpg") == 0) return "video/mpeg"; + else if (strcmp(ext, ".mpga") == 0) return "audio/mpeg"; + else if (strcmp(ext, ".pcx") == 0) return "image/x-pcx"; + else if (strcmp(ext, ".png") == 0) return "image/png"; + else if (strcmp(ext, ".rm") == 0) return "audio/x-pn-realaudio"; + else if (strcmp(ext, ".s3m") == 0) return "audio/s3m"; + else if (strcmp(ext, ".sid") == 0) return "audio/x-psid"; + else if (strcmp(ext, ".tif") == 0) return "image/tiff"; + else if (strcmp(ext, ".tiff") == 0) return "image/tiff"; + else if (strcmp(ext, ".txt") == 0) return "text/plain"; + else if (strcmp(ext, ".uni") == 0) return "text/uri-list"; + else if (strcmp(ext, ".viv") == 0) return "video/vivo"; + else if (strcmp(ext, ".wav") == 0) return "audio/wav"; + else if (strcmp(ext, ".xm") == 0) return "audio/xm"; + else if (strcmp(ext, ".xml") == 0) return "text/xml"; + else if (strcmp(ext, ".zip") == 0) return "application/zip"; + else return NULL; +} + +int CWebServer::CHTTPClient::GetPermissionFlags() +{ + return OPERATION_PERMISSION_ALL; +} + +int CWebServer::CHTTPClient::GetAnnouncementFlags() +{ + // Does not support broadcast + return 0; +} + +bool CWebServer::CHTTPClient::SetAnnouncementFlags(int flags) +{ + return false; +} +#endif diff --git a/xbmc/utils/WebServer.h b/xbmc/utils/WebServer.h new file mode 100644 index 0000000000..84ee0c4219 --- /dev/null +++ b/xbmc/utils/WebServer.h @@ -0,0 +1,79 @@ +#pragma once +/*
+ * Copyright (C) 2005-2010 Team XBMC
+ * http://www.xbmc.org
+ *
+ * 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, 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 XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */ + +#include "system.h" +#ifdef HAS_WEB_SERVER +#include "StdString.h" +#include <sys/types.h> +#include <sys/select.h> +#include <sys/socket.h> +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <stdint.h> +#include <microhttpd.h> +#include "../lib/libjsonrpc/ITransportLayer.h" +#include "CriticalSection.h" + +class CWebServer : public JSONRPC::ITransportLayer +{ +public: + CWebServer(); + + bool Start(const char *ip, int port); + bool Stop(); + bool IsStarted(); + void SetCredentials(const CStdString &username, const CStdString &password); + virtual bool Download(const char *path, Json::Value *result); + virtual int GetCapabilities(); +private: + static int AskForAuthentication (struct MHD_Connection *connection); + static bool IsAuthenticated (CWebServer *server, struct MHD_Connection *connection); + static int AnswerToConnection (void *cls, struct MHD_Connection *connection, + const char *url, const char *method, + const char *version, const char *upload_data, + size_t *upload_data_size, void **con_cls); + + static int ContentReaderCallback (void *cls, uint64_t pos, char *buf, int max); + static void ContentReaderFreeCallback (void *cls); + static int JSONRPC(CWebServer *server, struct MHD_Connection *connection, const char *upload_data, size_t *upload_data_size); + static int HttpApi(struct MHD_Connection *connection); + + static int FillArgumentMap(void *cls, enum MHD_ValueKind kind, const char *key, const char *value); + static void StringToBase64(const char *input, CStdString &output); + + static const char *CreateMimeTypeFromExtension(const char *ext); + + struct MHD_Daemon *m_daemon; + bool m_running, m_needcredentials; + CStdString m_Credentials64Encoded; + CCriticalSection m_critSection; + + class CHTTPClient : public JSONRPC::IClient + { + public: + virtual int GetPermissionFlags(); + virtual int GetAnnouncementFlags(); + virtual bool SetAnnouncementFlags(int flags); + }; +}; +#endif |