You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2013/01/03 09:10:27 UTC
svn commit: r1428206 [3/4] - in /tuscany/sca-cpp/trunk: components/cache/
components/chat/ components/constdb/ components/filedb/ components/sqldb/
hosting/server/ hosting/server/htdocs/ hosting/server/htdocs/account/
hosting/server/htdocs/app/ hosting...
Modified: tuscany/sca-cpp/trunk/modules/atom/atom.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/atom/atom.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/atom/atom.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/atom/atom.hpp Thu Jan 3 08:10:25 2013
@@ -46,22 +46,22 @@ const value entry("entry");
*/
const list<value> entryElementValues(const list<value>& e) {
const list<value> lt = elementChildren("title", e);
- const list<value> t = nilListValue + element + value("title") + (isNil(lt)? value(emptyString) : elementValue(car(lt)));
+ const list<value> t = nilListValue + element + value("title") + (isNull(lt)? value(emptyString) : elementValue(car(lt)));
const list<value> li = elementChildren("id", e);
- const list<value> i = nilListValue + element + value("id") + (isNil(li)? value(emptyString) : elementValue(car(li)));
+ const list<value> i = nilListValue + element + value("id") + (isNull(li)? value(emptyString) : elementValue(car(li)));
const list<value> la = elementChildren("author", e);
- const list<value> lan = isNil(la)? nilListValue : elementChildren("name", car(la));
- const list<value> lae = isNil(la)? nilListValue : elementChildren("email", car(la));
- const list<value> laa = isNil(lan)? lae : lan;
- const list<value> a = isNil(laa)? nilListValue : mklist<value>(nilListValue + element + value("author") + elementValue(car(laa)));
+ const list<value> lan = isNull(la)? nilListValue : elementChildren("name", car(la));
+ const list<value> lae = isNull(la)? nilListValue : elementChildren("email", car(la));
+ const list<value> laa = isNull(lan)? lae : lan;
+ const list<value> a = isNull(laa)? nilListValue : mklist<value>(nilListValue + element + value("author") + elementValue(car(laa)));
const list<value> lu = elementChildren("updated", e);
- const list<value> u = isNil(lu)? nilListValue : mklist<value>(nilListValue + element + value("updated") + elementValue(car(lu)));
+ const list<value> u = isNull(lu)? nilListValue : mklist<value>(nilListValue + element + value("updated") + elementValue(car(lu)));
const list<value> lc = elementChildren("content", e);
- const list<value> c = isNil(lc)? nilListValue : isAttribute(elementValue(car(lc)))? nilListValue :
+ const list<value> c = isNull(lc)? nilListValue : isAttribute(elementValue(car(lc)))? nilListValue :
mklist<value>(nilListValue + element + value("content") + elementValue(car(lc)));
return append<value>(append<value>(append<value>(nilListValue + element + entry + value(t) + value(i), a), u), c);
@@ -71,7 +71,7 @@ const list<value> entryElementValues(con
* Convert a list of elements to a list of element values representing ATOM entries.
*/
const list<value> entriesElementValues(const list<value>& e) {
- if (isNil(e))
+ if (isNull(e))
return e;
return cons<value>(entryElementValues(car(e)), entriesElementValues(cdr(e)));
}
@@ -99,7 +99,7 @@ const bool isATOMEntry(const list<string
*/
const failable<list<value> > readATOMEntry(const list<string>& ilist) {
const list<value> e = content(xml::readElements(ilist));
- if (isNil(e))
+ if (isNull(e))
return mkfailure<list<value> >("Empty entry");
return mklist<value>(entryElementValues(car(e)));
}
@@ -109,7 +109,7 @@ const failable<list<value> > readATOMEnt
*/
const failable<list<value> > readATOMFeed(const list<string>& ilist) {
const list<value> f = content(xml::readElements(ilist));
- if (isNil(f))
+ if (isNull(f))
return mkfailure<list<value> >("Empty feed");
const list<value> t = elementChildren("title", car(f));
const list<value> i = elementChildren("id", car(f));
@@ -136,18 +136,18 @@ const list<value> entryElement(const lis
const value title = elementChild("title", l);
const value id = elementChild("id", l);
const value author = elementChild("author", l);
- const bool email = isNil(author)? false : contains(elementValue(author), "@");
+ const bool email = isNull(author)? false : contains(elementValue(author), "@");
const value updated = elementChild("updated", l);
const value content = elementChild("content", l);
- const bool text = isNil(content)? false : elementHasValue(content);
+ const bool text = isNull(content)? false : elementHasValue(content);
return nilListValue
+ element + entry + (nilListValue + attribute + "xmlns" + "http://www.w3.org/2005/Atom")
+ (nilListValue + element + "title" + (nilListValue + attribute + "type" + "text") + elementValue(title))
+ (nilListValue + element + "id" + elementValue(id))
- + (isNil(author)? nilListValue : (nilListValue + element + "author" +
+ + (isNull(author)? nilListValue : (nilListValue + element + "author" +
(email? (nilListValue + element + "email" + elementValue(author)) : (nilListValue + element + "name" + elementValue(author)))))
- + (isNil(updated)? nilListValue : (nilListValue + element + "updated" + elementValue(updated)))
- + (isNil(content)?
+ + (isNull(updated)? nilListValue : (nilListValue + element + "updated" + elementValue(updated)))
+ + (isNull(content)?
nilListValue :
append<value>(nilListValue + element + "content" + (nilListValue + attribute + "type" + (text? "text" : "application/xml")),
text? mklist<value>(elementValue(content)) : contentElementChildren(content)))
@@ -158,7 +158,7 @@ const list<value> entryElement(const lis
* Convert a list of element values representing ATOM entries to a list of elements.
*/
const list<value> entriesElements(const list<value>& l) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons<value>(entryElement(car(l)), entriesElements(cdr(l)));
}
@@ -167,7 +167,7 @@ const list<value> entriesElements(const
* Convert a list of element values representing an ATOM entry to an ATOM entry.
*/
template<typename R> const failable<R> writeATOMEntry(const lambda<const R(const string&, const R)>& reduce, const R& initial, const list<value>& ll) {
- const list<value> l = isNil(ll)? ll : (list<value>)car(ll);
+ const list<value> l = isNull(ll)? ll : (list<value>)car(ll);
return xml::writeElements<R>(reduce, initial, mklist<value>(entryElement(l)));
}
@@ -182,11 +182,11 @@ const failable<list<string> > writeATOME
* Convert a list of element values representing an ATOM feed to an ATOM feed.
*/
template<typename R> const failable<R> writeATOMFeed(const lambda<const R(const string&, const R)>& reduce, const R& initial, const list<value>& ll) {
- const list<value> l = isNil(ll)? ll : (list<value>)car(ll);
+ const list<value> l = isNull(ll)? ll : (list<value>)car(ll);
const list<value> lt = elementChildren("title", l);
- const value t = isNil(lt)? value(emptyString) : elementValue(car(lt));
+ const value t = isNull(lt)? value(emptyString) : elementValue(car(lt));
const list<value> li = elementChildren("id", l);
- const value i = isNil(li)? value(emptyString) : elementValue(car(li));
+ const value i = isNull(li)? value(emptyString) : elementValue(car(li));
const list<value> f = nilListValue
+ element + feed + (nilListValue + attribute + "xmlns" + "http://www.w3.org/2005/Atom")
+ (nilListValue + element + "title" + (nilListValue + attribute + "type" + "text") + t)
@@ -194,11 +194,11 @@ template<typename R> const failable<R> w
// Write ATOM entries
const list<value> le = elementChildren(entry, l);
- if (isNil(le))
+ if (isNull(le))
return xml::writeElements<R>(reduce, initial, mklist<value>(f));
// Write a single ATOM entry element with a list of values
- if (!isNil(le) && !isNil(car(le)) && isList(car<value>(caddr<value>(car(le))))) {
+ if (!isNull(le) && !isNull(car(le)) && isList(car<value>(caddr<value>(car(le))))) {
const list<value> fe = append(f, entriesElements(caddr<value>(car(le))));
return xml::writeElements<R>(reduce, initial, mklist<value>(fe));
}
Modified: tuscany/sca-cpp/trunk/modules/http/http.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/http.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/http.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/http.hpp Thu Jan 3 08:10:25 2013
@@ -367,7 +367,7 @@ public:
*/
size_t readCallback(void *ptr, size_t size, size_t nmemb, void *data) {
CURLReadContext& rcx = *(CURLReadContext*)data;
- if (isNil((const list<string>)rcx.ilist))
+ if (isNull((const list<string>)rcx.ilist))
return 0;
const list<string> f(fragment(rcx.ilist, size * nmemb));
const string s = car(f);
@@ -403,7 +403,7 @@ template<typename R> size_t writeCallbac
* a reduce function used to process the response.
*/
curl_slist* headers(curl_slist* const cl, const list<string>& h) {
- if (isNil(h))
+ if (isNull(h))
return cl;
return headers(curl_slist_append(cl, c_str(string(car(h)))), cdr(h));
}
@@ -508,7 +508,7 @@ const failable<value> evalExpr(const val
* Find and return a header.
*/
const maybe<string> header(const char* const prefix, const list<string>& h) {
- if (isNil(h))
+ if (isNull(h))
return maybe<string>();
const string s = car(h);
if (find(s, prefix) != 0)
@@ -676,7 +676,7 @@ const failable<list<list<string> > > con
// Write in the format requested by the client, if any
const list<value> fmt = assoc<value>("format", nilListValue);
- if (!isNil(fmt)) {
+ if (!isNull(fmt)) {
if (cadr(fmt) == "scheme")
return writeRequest(scheme::writeValue(c), "text/x-scheme; charset=utf-8");
if (cadr(fmt) == "json")
@@ -692,26 +692,26 @@ const failable<list<list<string> > > con
}
// Write an empty list as a JSON value
- if (isNil((list<value>)c)) {
+ if (isNull((list<value>)c)) {
debug(nilListValue, "http::contentRequest::empty");
return writeRequest(json::writeValue(c), "application/json; charset=utf-8");
}
// Write content-type / content-list pair
- if (isString(car<value>(c)) && !isNil(cdr<value>(c)) && isList(cadr<value>(c)))
+ if (isString(car<value>(c)) && !isNull(cdr<value>(c)) && isList(cadr<value>(c)))
return writeRequest(convertValues<string>(cadr<value>(c)), car<value>(c));
// Write an assoc value as a JSON value
- if (isSymbol(car<value>(c)) && !isNil(cdr<value>(c))) {
+ if (isSymbol(car<value>(c)) && !isNull(cdr<value>(c))) {
debug(c, "http::contentRequest::assoc");
return writeRequest(json::writeValue(c), "application/json; charset=utf-8");
}
// Write an ATOM feed or entry
const list<value> e = valuesToElements(c);
- if (isList(car<value>(e)) && !isNil(car<value>(e))) {
+ if (isList(car<value>(e)) && !isNull(car<value>(e))) {
const list<value> el = car<value>(e);
- if (isSymbol(car<value>(el)) && car<value>(el) == element && !isNil(cdr<value>(el)) && isSymbol(cadr<value>(el)) && elementHasChildren(el) && !elementHasValue(el)) {
+ if (isSymbol(car<value>(el)) && car<value>(el) == element && !isNull(cdr<value>(el)) && isSymbol(cadr<value>(el)) && elementHasChildren(el) && !elementHasValue(el)) {
if (cadr<value>(el) == atom::feed)
return writeRequest(atom::writeATOMFeed(e), "application/atom+xml; charset=utf-8");
if (cadr<value>(el) == atom::entry)
@@ -943,14 +943,14 @@ const failable<size_t> recv(char* const
* Converts a list of key value pairs to a query string.
*/
ostringstream& queryString(const list<value>& args, ostringstream& os) {
- if (isNil(args))
+ if (isNull(args))
return os;
const list<value> arg = car(args);
debug(arg, "http::queryString::arg");
- if (isNil(arg) || isNil(cdr(arg)))
+ if (isNull(arg) || isNull(cdr(arg)))
return queryString(cdr(args), os);
os << car(arg) << "=" << c_str(cadr(arg));
- if (!isNil(cdr(args)))
+ if (!isNull(cdr(args)))
os << "&";
return queryString(cdr(args), os);
}
Modified: tuscany/sca-cpp/trunk/modules/http/httpd.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/httpd.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/httpd.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/httpd.hpp Thu Jan 3 08:10:25 2013
@@ -260,7 +260,7 @@ const string cookie(const request_rec* c
* Return the remaining part of a uri after the given path (aka the path info.)
*/
const list<value> pathInfo(const list<value>& uri, const list<value>& path) {
- if (isNil(path))
+ if (isNull(path))
return uri;
return pathInfo(cdr(uri), cdr(path));
}
@@ -347,14 +347,14 @@ const list<value> unescapeArgs(const lis
const value queryArg(const string& s) {
debug(s, "httpd::queryArg::string");
const list<string> t = tokenize("=", s);
- if (isNil(cdr(t)))
+ if (isNull(cdr(t)))
return mklist<value>(c_str(car(t)), emptyString);
return mklist<value>(c_str(car(t)), cadr(t));
}
const string fixupQueryArgs(const string& a) {
const list<string> t = tokenize("?", a);
- if (isNil(t) || isNil(cdr(t)))
+ if (isNull(t) || isNull(cdr(t)))
return a;
return join("&", t);
}
@@ -376,7 +376,7 @@ const list<value> queryArgs(const reques
* Converts the args received in a POST to a list of key value pairs.
*/
const list<value> postArgs(const list<value>& a) {
- if (isNil(a))
+ if (isNull(a))
return nilListValue;
const list<value> l = car(a);
return cons<value>(l, postArgs(cdr(a)));
Modified: tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp Thu Jan 3 08:10:25 2013
@@ -127,7 +127,7 @@ static apr_status_t (*ap_session_set_fn)
* Run the authnz hooks to authenticate a request.
*/
const failable<int> checkAuthnzProviders(const string& user, const string& pw, request_rec* const r, const list<AuthnProviderConf>& apcs) {
- if(isNil(apcs))
+ if(isNull(apcs))
return mkfailure<int>("Authentication failure for: " + user, HTTP_UNAUTHORIZED);
const AuthnProviderConf apc = car<AuthnProviderConf>(apcs);
if(apc.provider == NULL || !apc.provider->check_password)
@@ -145,7 +145,7 @@ const failable<int> checkAuthnz(const st
if(substr(user, 0, 1) == "/" && pw == "password")
return mkfailure<int>(string("Encountered FakeBasicAuth spoof: ") + user, HTTP_UNAUTHORIZED);
- if(isNil((const list<AuthnProviderConf>)dc.apcs)) {
+ if(isNull((const list<AuthnProviderConf>)dc.apcs)) {
const authn_provider* provider = (const authn_provider*)ap_lookup_provider(AUTHN_PROVIDER_GROUP, AUTHN_DEFAULT_PROVIDER, AUTHN_PROVIDER_VERSION);
return checkAuthnzProviders(user, pw, r, mklist<AuthnProviderConf>(AuthnProviderConf(AUTHN_DEFAULT_PROVIDER, provider)));
}
@@ -181,10 +181,10 @@ const failable<value> userInfoFromCookie
const list<value> info = httpd::queryArgs(sid);
debug(info, "modopenauth::userInfoFromCookie::info");
const list<value> user = assoc<value>(realm + "-user", info);
- if(isNil(user))
+ if(isNull(user))
return userInfoFromSession(realm, r);
const list<value> pw = assoc<value>(realm + "-pw", info);
- if(isNil(pw))
+ if(isNull(pw))
return mkfailure<value>("Couldn't retrieve password", HTTP_UNAUTHORIZED);
return value(mklist<value>(mklist<value>("realm", realm), mklist<value>("id", cadr(user)), mklist<value>("password", cadr(pw))));
}
@@ -217,12 +217,12 @@ const failable<int> authenticated(const
// Store user info in the request
const list<value> realm = assoc<value>("realm", info);
- if(isNil(realm) || isNil(cdr(realm)))
+ if(isNull(realm) || isNull(cdr(realm)))
return mkfailure<int>("Couldn't retrieve realm", HTTP_UNAUTHORIZED);
apr_table_set(r->subprocess_env, apr_pstrdup(r->pool, "REALM"), apr_pstrdup(r->pool, c_str(cadr(realm))));
const list<value> id = assoc<value>("id", info);
- if(isNil(id) || isNil(cdr(id)))
+ if(isNull(id) || isNull(cdr(id)))
return mkfailure<int>("Couldn't retrieve user id", HTTP_UNAUTHORIZED);
r->user = apr_pstrdup(r->pool, c_str(cadr(id)));
@@ -313,7 +313,7 @@ static int checkAuthn(request_rec* const
}
// Decline if the request is for another authentication provider
- if(!isNil(assoc<value>("openid_identifier", args)))
+ if(!isNull(assoc<value>("openid_identifier", args)))
return DECLINED;
// Redirect to the login page, unless we have a session id from another module
Modified: tuscany/sca-cpp/trunk/modules/http/openauth.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/openauth.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/openauth.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/http/openauth.hpp Thu Jan 3 08:10:25 2013
@@ -49,13 +49,13 @@ const char* const cookieName(const char*
}
const maybe<string> sessionID(const list<string>& c, const string& key) {
- if (isNil(c))
+ if (isNull(c))
return maybe<string>();
const string cn = cookieName(c_str(car(c)));
const size_t i = find(cn, "=");
if (i < length(cn)) {
const list<string> kv = mklist<string>(substr(cn, 0, i), substr(cn, i+1));
- if (!isNil(kv) && !isNil(cdr(kv))) {
+ if (!isNull(kv) && !isNull(cdr(kv))) {
if (car(kv) == key)
return cadr(kv);
}
@@ -92,10 +92,10 @@ const string cookie(const string& key, c
* Redirect to the configured login page.
*/
const failable<int> login(const string& page, const value& ref, const value& attempt, request_rec* const r) {
- const list<value> rarg = ref == string("/")? nilListValue : mklist<value>(mklist<value>("openauth_referrer", httpd::escape(httpd::url(isNil(ref)? r->uri : ref, r))));
- const list<value> aarg = isNil(attempt)? nilListValue : mklist<value>(mklist<value>("openauth_attempt", attempt));
+ const list<value> rarg = ref == string("/")? nilListValue : mklist<value>(mklist<value>("openauth_referrer", httpd::escape(httpd::url(isNull(ref)? r->uri : ref, r))));
+ const list<value> aarg = isNull(attempt)? nilListValue : mklist<value>(mklist<value>("openauth_attempt", attempt));
const list<value> largs = append(rarg, aarg);
- const string loc = isNil(largs)? httpd::url(page, r) : httpd::url(page, r) + string("?") + http::queryString(largs);
+ const string loc = isNull(largs)? httpd::url(page, r) : httpd::url(page, r) + string("?") + http::queryString(largs);
debug(loc, "openauth::login::uri");
return httpd::externalRedirect(loc, r);
}
Modified: tuscany/sca-cpp/trunk/modules/java/driver.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/java/driver.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/java/driver.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/java/driver.hpp Thu Jan 3 08:10:25 2013
@@ -38,7 +38,7 @@ namespace java {
const value evalDriverLoop(const JavaRuntime& jr, const JavaClass jc, istream& in, ostream& out) {
scheme::promptForInput(scheme::evalInputPrompt, out);
const value input = content(scheme::readValue(in));
- if (isNil(input))
+ if (isNull(input))
return input;
const failable<value> output = evalClass(jr, input, jc);
scheme::announceOutput(scheme::evalOutputPrompt, out);
Modified: tuscany/sca-cpp/trunk/modules/java/eval.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/java/eval.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/java/eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/java/eval.hpp Thu Jan 3 08:10:25 2013
@@ -132,7 +132,7 @@ public:
h.invokerLambda = h.env->GetFieldID(h.invokerClass, "lambda", "J");
h.iterableUtilClass = h.env->FindClass("org/apache/tuscany/IterableUtil");
h.iterableValueOf = h.env->GetStaticMethodID(h.iterableUtilClass, "list", "([Ljava/lang/Object;)Ljava/lang/Iterable;");
- h.iterableIsNil = h.env->GetStaticMethodID(h.iterableUtilClass, "isNil", "(Ljava/lang/Object;)Z");
+ h.iterableIsNil = h.env->GetStaticMethodID(h.iterableUtilClass, "isNull", "(Ljava/lang/Object;)Z");
h.iterableCar = h.env->GetStaticMethodID(h.iterableUtilClass, "car", "(Ljava/lang/Object;)Ljava/lang/Object;");
h.iterableCdr = h.env->GetStaticMethodID(h.iterableUtilClass, "cdr", "(Ljava/lang/Object;)Ljava/lang/Iterable;");
h.uuidClass = h.env->FindClass("org/apache/tuscany/UUIDUtil");
@@ -257,7 +257,7 @@ public:
}
const value operator()(const list<value>& expr) const {
- if (isNil(expr))
+ if (isNull(expr))
return func(expr);
const value& op(car(expr));
if (op == "equals")
@@ -331,7 +331,7 @@ const jobject mkJavaLambda(const JavaRun
* Convert a list of values to a Java jobjectArray.
*/
const jobjectArray valuesToJarrayHelper(const JavaRuntime& jr, jobjectArray a, const list<value>& v, const int i) {
- if (isNil(v))
+ if (isNull(v))
return a;
jr.h.env->SetObjectArrayElement(a, i, valueToJobject(jr, nilValue, car(v)));
return valuesToJarrayHelper(jr, a, cdr(v), i + 1);
@@ -375,7 +375,7 @@ const jobject valueToJobject(const JavaR
* Convert a list of values to an array of jvalues.
*/
const jvalue* valuesToJvaluesHelper(const JavaRuntime& jr, jvalue* const a, const list<value>& types, const list<value>& v) {
- if (isNil(v))
+ if (isNull(v))
return a;
a->l = valueToJobject(jr, car(types), car(v));
return valuesToJvaluesHelper(jr, a + 1, cdr(types), cdr(v));
@@ -542,7 +542,7 @@ const failable<value> evalClass(const Ja
// Lookup the Java function named as the expression operand
const list<value> func = assoc<value>(car<value>(expr), jc.m);
- if (isNil(func)) {
+ if (isNull(func)) {
// The start, stop, and restart functions are optional
const value fn = car<value>(expr);
Modified: tuscany/sca-cpp/trunk/modules/java/org/apache/tuscany/IterableUtil.java
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/java/org/apache/tuscany/IterableUtil.java?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/java/org/apache/tuscany/IterableUtil.java (original)
+++ tuscany/sca-cpp/trunk/modules/java/org/apache/tuscany/IterableUtil.java Thu Jan 3 08:10:25 2013
@@ -61,9 +61,9 @@ public class IterableUtil {
/**
* Return true if a list is nil (empty).
*/
- public static boolean isNil(final Object l) {
+ public static boolean isNull(final Object l) {
if(l instanceof BasicIterable<?>)
- return ((BasicIterable<?>)l).isNil();
+ return ((BasicIterable<?>)l).isNull();
if(l instanceof Collection<?>)
return ((Collection<?>)l).isEmpty();
return !((Iterable<?>)l).iterator().hasNext();
@@ -144,7 +144,7 @@ public class IterableUtil {
*/
@SuppressWarnings("unchecked")
public static <T> Iterable<T> append(final Object a, final Object b) {
- if (isNil(a))
+ if (isNull(a))
return (Iterable<T>)b;
return cons(car(a), append(cdr(a), b));
}
@@ -153,7 +153,7 @@ public class IterableUtil {
* Return the first pair matching a key from a list of key value pairs.
*/
public static <T> Iterable<T> assoc(final Object k, final Object l) {
- if(isNil(l))
+ if(isNull(l))
return list();
if(k.equals(car(car(l))))
return car(l);
@@ -168,11 +168,11 @@ public class IterableUtil {
abstract Iterable<T> cdr();
- abstract Boolean isNil();
+ abstract Boolean isNull();
@Override
public int size() {
- return this.isNil()? 0 : 1 + ((List<T>)this.cdr()).size();
+ return this.isNull()? 0 : 1 + ((List<T>)this.cdr()).size();
}
@Override
@@ -194,7 +194,7 @@ public class IterableUtil {
}
@Override
- Boolean isNil() {
+ Boolean isNull() {
return this.a.length - this.start == 0;
}
@@ -243,7 +243,7 @@ public class IterableUtil {
}
@Override
- Boolean isNil() {
+ Boolean isNull() {
return this.l.size() - this.start == 0;
}
@@ -292,7 +292,7 @@ public class IterableUtil {
}
@Override
- Boolean isNil() {
+ Boolean isNull() {
return false;
}
@@ -365,12 +365,12 @@ public class IterableUtil {
assert jl.get(2) == Integer.valueOf(2);
final Iterable<Object> n = list();
- assert isNil(n);
+ assert isNull(n);
assert n.toString().equals("[]");
final Iterable<Object> cn = cons(0, n);
- assert !isNil(cn);
- assert isNil(cdr(cn));
+ assert !isNull(cn);
+ assert isNull(cdr(cn));
assert cn.toString().equals("[0]");
final Iterable<Object> al = new ArrayList<Object>(Arrays.asList(1, 2, 3));
Modified: tuscany/sca-cpp/trunk/modules/java/test/ServerImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/java/test/ServerImpl.java?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/java/test/ServerImpl.java (original)
+++ tuscany/sca-cpp/trunk/modules/java/test/ServerImpl.java Thu Jan 3 08:10:25 2013
@@ -28,7 +28,7 @@ public class ServerImpl {
}
public Iterable<?> get(final Iterable<String> id) {
- if (isNil(id))
+ if (isNull(id))
return list(list("'feed", list("'title", "Sample Feed"), list("'id", "123456789"), list("'entry", list(
list(list("'title", "Item"), list("'id", "111"),
list("'content", list("'item", list("'name", "Apple"), list("'currencyCode", "USD"), list("'currencySymbol", "$"), list("'price", 2.99)))),
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/atomutil.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/atomutil.js?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/atomutil.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/atomutil.js Thu Jan 3 08:10:25 2013
@@ -27,22 +27,22 @@ var atom = {};
*/
atom.entryElementValues = function(e) {
var lt = filter(selector(mklist(element, "'title")), e);
- var t = mklist(element, "'title", isNil(lt)? '' : elementValue(car(lt)));
+ var t = mklist(element, "'title", isNull(lt)? '' : elementValue(car(lt)));
var li = filter(selector(mklist(element, "'id")), e);
- var i = mklist(element, "'id", isNil(li)? '' : elementValue(car(li)));
+ var i = mklist(element, "'id", isNull(li)? '' : elementValue(car(li)));
var la = filter(selector(mklist(element, "'author")), e);
- var lan = isNil(la)? mklist() : filter(selector(mklist(element, "'name")), car(la));
- var lae = isNil(la)? mklist() : filter(selector(mklist(element, "'email")), car(la));
- var laa = isNil(lan)? lae : lan;
- var a = isNil(laa)? mklist() : mklist(mklist(element, "'author", elementValue(car(laa))));
+ var lan = isNull(la)? mklist() : filter(selector(mklist(element, "'name")), car(la));
+ var lae = isNull(la)? mklist() : filter(selector(mklist(element, "'email")), car(la));
+ var laa = isNull(lan)? lae : lan;
+ var a = isNull(laa)? mklist() : mklist(mklist(element, "'author", elementValue(car(laa))));
var lu = filter(selector(mklist(element, "'updated")), e);
- var u = isNil(lu)? mklist() : mklist(mklist(element, "'updated", elementValue(car(lu))));
+ var u = isNull(lu)? mklist() : mklist(mklist(element, "'updated", elementValue(car(lu))));
var lc = filter(selector(mklist(element, "'content")), e);
- var c = isNil(lc)? mklist() : isAttribute(elementValue(car(lc)))? mklist() : mklist(mklist(element, "'content", elementValue(car(lc))));
+ var c = isNull(lc)? mklist() : isAttribute(elementValue(car(lc)))? mklist() : mklist(mklist(element, "'content", elementValue(car(lc))));
return append(append(append(mklist(element, "'entry", t, i), a), u), c);
};
@@ -51,7 +51,7 @@ atom.entryElementValues = function(e) {
* Convert a list of elements to a list of values representing ATOM entries.
*/
atom.entriesElementValues = function(e) {
- if (isNil(e))
+ if (isNull(e))
return e;
return cons(atom.entryElementValues(car(e)), atom.entriesElementValues(cdr(e)));
};
@@ -70,7 +70,7 @@ atom.isATOMEntry = function(l) {
*/
atom.readATOMEntryDocument = function(doc) {
var e = readXMLDocument(doc);
- if (isNil(e))
+ if (isNull(e))
return mklist();
return mklist(atom.entryElementValues(car(e)));
};
@@ -96,7 +96,7 @@ atom.isATOMFeed = function(l) {
*/
atom.readATOMFeedDocument = function(doc) {
var f = readXMLDocument(doc);
- if (isNil(f))
+ if (isNull(f))
return mklist();
var t = filter(selector(mklist(element, "'title")), car(f));
var i = filter(selector(mklist(element, "'id")), car(f));
@@ -120,17 +120,17 @@ atom.entryElement = function(l) {
var title = elementValue(namedElementChild("'title", l));
var id = elementValue(namedElementChild("'id", l));
var author = namedElementChild("'author", l);
- var email = isNil(author)? false : (elementValue(author).indexOf('@') != -1);
+ var email = isNull(author)? false : (elementValue(author).indexOf('@') != -1);
var updated = namedElementChild("'updated", l);
var content = namedElementChild("'content", l);
- var text = isNil(content)? false : elementHasValue(content);
+ var text = isNull(content)? false : elementHasValue(content);
return append(append(append(append(
mklist(element, "'entry", mklist(attribute, "'xmlns", "http://www.w3.org/2005/Atom"),
mklist(element, "'title", mklist(attribute, "'type", "text"), title), mklist(element, "'id", id)),
- isNil(author)? mklist() : mklist(mklist(element, "'author",
+ isNull(author)? mklist() : mklist(mklist(element, "'author",
(email? mklist(element, "'email", elementValue(author)) : mklist(element, "'name", elementValue(author)))))),
- isNil(updated)? mklist() : mklist(mklist(element, "'updated", elementValue(updated)))),
- isNil(content)? mklist() :
+ isNull(updated)? mklist() : mklist(mklist(element, "'updated", elementValue(updated)))),
+ isNull(content)? mklist() :
mklist(append(mklist(element, "'content", mklist(attribute, "'type", text? "text" : "application/xml")),
text? mklist(elementValue(content)) : elementChildren(content)))),
mklist(mklist(element, "'link", mklist(attribute, "'href", id))));
@@ -140,7 +140,7 @@ atom.entryElement = function(l) {
* Convert a list of values representing ATOM entries to a list of elements.
*/
atom.entriesElements = function(l) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons(atom.entryElement(car(l)), atom.entriesElements(cdr(l)));
};
@@ -149,7 +149,7 @@ atom.entriesElements = function(l) {
* Convert a list of values representing an ATOM entry to an ATOM entry.
*/
atom.writeATOMEntry = function(ll) {
- var l = isNil(ll)? ll : car(ll);
+ var l = isNull(ll)? ll : car(ll);
return writeXML(mklist(atom.entryElement(l)), true);
};
@@ -157,22 +157,22 @@ atom.writeATOMEntry = function(ll) {
* Convert a list of values representing an ATOM feed to an ATOM feed.
*/
atom.writeATOMFeed = function(ll) {
- var l = isNil(ll)? ll : car(ll);
+ var l = isNull(ll)? ll : car(ll);
var lt = filter(selector(mklist(element, "'title")), l);
- var t = isNil(lt)? '' : elementValue(car(lt));
+ var t = isNull(lt)? '' : elementValue(car(lt));
var li = filter(selector(mklist(element, "'id")), l);
- var i = isNil(li)? '' : elementValue(car(li));
+ var i = isNull(li)? '' : elementValue(car(li));
var f = mklist(element, "'feed", mklist(attribute, "'xmlns", "http://www.w3.org/2005/Atom"),
mklist(element, "'title", mklist(attribute, "'type", "text"), car(l)),
mklist(element, "'id", cadr(l)));
// Write ATOM entries
var le = filter(selector(mklist(element, "'entry")), l);
- if (isNil(le))
+ if (isNull(le))
return writeXML(mklist(f), true);
// Write a single ATOM entry element with a list of values
- if (!isNil(le) && !isNil(car(le)) && isList(car(caddr(car(le))))) {
+ if (!isNull(le) && !isNull(car(le)) && isList(car(caddr(car(le))))) {
var fe = append(f, atom.entriesElements(caddr(car(le))));
return writeXML(mklist(fe), true);
}
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/elemutil.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/elemutil.js?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/elemutil.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/elemutil.js Thu Jan 3 08:10:25 2013
@@ -29,14 +29,14 @@ var atsign = "'@"
* Return true if a value is an element.
*/
function isElement(v) {
- return (!(!isList(v) || isNil(v) || car(v) != element));
+ return (!(!isList(v) || isNull(v) || car(v) != element));
}
/**
* Return true if a value is an attribute.
*/
function isAttribute(v) {
- return (!(!isList(v) || isNil(v) || car(v) != attribute));
+ return (!(!isList(v) || isNull(v) || car(v) != attribute));
}
/**
@@ -58,7 +58,7 @@ elementName = cadr;
* Return true if an element has children.
*/
function elementHasChildren(l) {
- return !isNil(cddr(l));
+ return !isNull(cddr(l));
}
/**
@@ -73,7 +73,7 @@ function elementHasValue(l) {
var r = reverse(l);
if (isSymbol(car(r)))
return false;
- return (!(isList(car(r)) && !isNil(car(r)) && isSymbol(car(car(r)))))
+ return (!(isList(car(r)) && !isNull(car(r)) && isSymbol(car(car(r)))))
}
/**
@@ -89,7 +89,7 @@ function elementValue(l) {
function elementToValueIsList(v) {
if (!isList(v))
return false;
- return isNil(v) || !isSymbol(car(v));
+ return isNull(v) || !isSymbol(car(v));
}
function elementToValue(t) {
@@ -112,11 +112,11 @@ function elementToValue(t) {
* Convert a list of elements to a list of values.
*/
function elementToValueIsSymbol(v) {
- return (!(!isList(v)) || isNil(v) || !isSymbol(car(v)));
+ return (!(!isList(v)) || isNull(v) || !isSymbol(car(v)));
}
function elementToValueGroupValues(v, l) {
- if (isNil(l) || !elementToValueIsSymbol(v) || !elementToValueIsSymbol(car(l)))
+ if (isNull(l) || !elementToValueIsSymbol(v) || !elementToValueIsSymbol(car(l)))
return cons(v, l);
if (car(car(l)) != car(v))
return cons(v, l);
@@ -129,7 +129,7 @@ function elementToValueGroupValues(v, l)
}
function elementsToValues(e) {
- if (isNil(e))
+ if (isNull(e))
return e;
return elementToValueGroupValues(elementToValue(car(e)), elementsToValues(cdr(e)));
}
@@ -138,15 +138,15 @@ function elementsToValues(e) {
* Convert a value to an element.
*/
function valueToElement(t) {
- if (isList(t) && !isNil(t) && isSymbol(car(t))) {
+ if (isList(t) && !isNull(t) && isSymbol(car(t))) {
var n = car(t);
- var v = isNil(cdr(t))? mklist() : cadr(t);
+ var v = isNull(cdr(t))? mklist() : cadr(t);
if (!isList(v)) {
if (n.substring(0, 2) == atsign)
return mklist(attribute, "'" + n.substring(2), v);
return mklist(element, n, v);
}
- if (isNil(v) || !isSymbol(car(v)))
+ if (isNull(v) || !isSymbol(car(v)))
return cons(element, cons(n, mklist(valuesToElements(v))));
return cons(element, cons(n, valuesToElements(cdr(t))));
}
@@ -159,7 +159,7 @@ function valueToElement(t) {
* Convert a list of values to a list of elements.
*/
function valuesToElements(l) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons(valueToElement(car(l)), valuesToElements(cdr(l)));
}
@@ -169,9 +169,9 @@ function valuesToElements(l) {
*/
function selector(s) {
function evalSelect(s, v) {
- if (isNil(s))
+ if (isNull(s))
return true;
- if (isNil(v))
+ if (isNull(v))
return false;
if (car(s) != car(v))
return false;
@@ -187,7 +187,7 @@ function selector(s) {
function namedAttribute(name, l) {
return memo(l, name, function() {
var f = filter(function(v) { return isAttribute(v) && attributeName(v) == name; }, l);
- if (isNil(f))
+ if (isNull(f))
return null;
return car(f);
});
@@ -217,7 +217,7 @@ function namedElementChildren(name, l) {
*/
function namedElementChild(name, l) {
var f = namedElementChildren(name, l);
- if (isNil(f))
+ if (isNull(f))
return null;
return car(f);
}
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/jsonutil.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/jsonutil.js?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/jsonutil.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/jsonutil.js Thu Jan 3 08:10:25 2013
@@ -41,13 +41,13 @@ json.Exception.prototype.toString = func
* Return true if a list represents a JS array.
*/
json.isJSArray = function(l) {
- if (isNil(l))
+ if (isNull(l))
return true;
var v = car(l);
if (isSymbol(v))
return false;
if (isList(v))
- if (!isNil(v) && isSymbol(car(v)))
+ if (!isNull(v) && isSymbol(car(v)))
return false;
return true;
};
@@ -56,7 +56,7 @@ json.isJSArray = function(l) {
* Converts JSON properties to values.
*/
json.jsPropertiesToValues = function(propertiesSoFar, o, i) {
- if (isNil(i))
+ if (isNull(i))
return propertiesSoFar;
var p = car(i);
var jsv = o[p];
@@ -92,7 +92,7 @@ json.jsValToValue = function(jsv) {
* Return true if a list of strings contains a JSON document.
*/
json.isJSON = function(l) {
- if (isNil(l))
+ if (isNull(l))
return false;
var s = car(l).slice(0, 1);
return s == "[" || s == "{";
@@ -112,7 +112,7 @@ json.readJSON = function(l) {
* Convert a list of values to JSON array elements.
*/
json.valuesToJSElements = function(a, l, i) {
- if (isNil(l))
+ if (isNull(l))
return a;
var pv = json.valueToJSVal(car(l));
a[i] = pv
@@ -134,7 +134,7 @@ json.valueToJSVal = function(v) {
* Convert a list of values to JSON properties.
*/
json.valuesToJSProperties = function(o, l) {
- if (isNil(l))
+ if (isNull(l))
return o;
var token = car(l);
if (isTaggedList(token, attribute)) {
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/scdl.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/scdl.js?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/scdl.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/scdl.js Thu Jan 3 08:10:25 2013
@@ -27,7 +27,7 @@ var scdl = {};
*/
scdl.composite = function(l) {
var cs = namedElementChildren("'composite", l);
- if (isNil(cs))
+ if (isNull(cs))
return cs;
return car(cs);
};
@@ -37,7 +37,7 @@ scdl.composite = function(l) {
*/
scdl.components = function(l) {
var cs = namedElementChildren("'composite", l);
- if (isNil(cs))
+ if (isNull(cs))
return cs;
return namedElementChildren("'component", car(cs));
};
@@ -47,7 +47,7 @@ scdl.components = function(l) {
*/
scdl.promotions = function(l) {
var cs = namedElementChildren("'composite", l);
- if (isNil(cs))
+ if (isNull(cs))
return cs;
return namedElementChildren("'service", car(cs));
};
@@ -57,7 +57,7 @@ scdl.promotions = function(l) {
*/
scdl.promote = function(l) {
var puri = namedAttributeValue("'promote", l);
- if (isNil(puri))
+ if (isNull(puri))
return puri;
return car(tokens(puri));
};
@@ -74,7 +74,7 @@ scdl.name = function(l) {
*/
scdl.documentation = function(l) {
var d = namedElementChildren("'documentation", l);
- if (isNil(d))
+ if (isNull(d))
return null;
if (!elementHasValue(car(d)))
return null;
@@ -126,7 +126,7 @@ scdl.implementation = function(l) {
}
var n = filter(filterImplementation, l);
- if (isNil(n))
+ if (isNull(n))
return null;
return car(n);
};
@@ -204,21 +204,21 @@ scdl.bindingType = function(l) {
scdl.target = function(l) {
function targetURI() {
function bindingsTarget(l) {
- if (isNil(l))
+ if (isNull(l))
return null;
var u = scdl.uri(car(l));
- if (!isNil(u))
+ if (!isNull(u))
return u;
return bindingsTarget(cdr(l));
}
var t = namedAttributeValue("'target", l);
- if (!isNil(t))
+ if (!isNull(t))
return t;
return bindingsTarget(scdl.bindings(l));
}
var turi = targetURI();
- if (isNil(turi))
+ if (isNull(turi))
return turi;
return car(tokens(turi));
};
@@ -243,7 +243,7 @@ scdl.propertyValue = function(l) {
* Convert a list of elements to a name -> element assoc list.
*/
scdl.nameToElementAssoc = function(l) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons(mklist(scdl.name(car(l)), car(l)), scdl.nameToElementAssoc(cdr(l)));
};
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/ui.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/ui.js?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/ui.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/ui.js Thu Jan 3 08:10:25 2013
@@ -31,7 +31,7 @@ ui.elementByID = function(node, id) {
return null;
for (var i in node.childNodes) {
var child = node.childNodes[i];
- if (isNil(child))
+ if (isNull(child))
continue;
if (child.id == id)
return child;
@@ -275,7 +275,7 @@ ui.msieVersion = function() {
*/
ui.asyncFrame = null;
ui.async = function(f) {
- if (isNil(ui.asyncFrame))
+ if (isNull(ui.asyncFrame))
// Use requestAnimationFrame when available, fallback to setTimeout
ui.asyncFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
@@ -293,7 +293,7 @@ ui.delay = function(f, t) {
var id = window.setTimeout(function() {
delete ui.delayed[id];
return f();
- }, isNil(t)? 16 : t);
+ }, isNull(t)? 16 : t);
ui.delayed[id] = id;
return id;
};
@@ -311,12 +311,12 @@ ui.cancelDelay = function(id) {
*/
ui.animationFrame = null;
ui.animation = function(f) {
- if (isNil(ui.animationFrame))
+ if (isNull(ui.animationFrame))
// Use requestAnimationFrame when available, fallback to setInterval
ui.animationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
function(f) {
- if (!('interval' in f) || isNil(f.interval)) {
+ if (!('interval' in f) || isNull(f.interval)) {
// First call, setup the interval
f.interval = window.setInterval(function animation() {
f.clearInterval = true;
@@ -370,7 +370,7 @@ ui.onload = function() {
} else {
// Style scroll bars
var h = document.getElementsByTagName('html');
- if (!isNil(h))
+ if (!isNull(h))
h[0].className = h[0].className? h[0].classname + ' flatscrollbars' : 'flatscrollbars';
}
@@ -393,7 +393,7 @@ ui.onload = function() {
ui.onorientationchange = function(e) {
// Adjust filler height
- if (!isNil(ui.filler))
+ if (!isNull(ui.filler))
ui.filler.style.height = ui.pixpos(window.orientation == 0? screen.height : screen.width);
// Scroll to hide the address bar
@@ -524,7 +524,7 @@ ui.datatable = function(l) {
}
function rows(l, i) {
- if (isNil(l))
+ if (isNull(l))
return '';
var e = car(l);
@@ -564,7 +564,7 @@ ui.datatable = function(l) {
ui.datalist = function(l) {
function rows(l, i) {
- if (isNil(l))
+ if (isNull(l))
return '';
var e = car(l);
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/util.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/util.js?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/util.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/util.js Thu Jan 3 08:10:25 2013
@@ -81,7 +81,7 @@ function range(a, b) {
return l;
}
-function isNil(v) {
+function isNull(v) {
return (v == null || typeof v == 'undefined' || (v.constructor == Array && v.length == 0));
}
@@ -98,7 +98,7 @@ function isList(v) {
}
function isTaggedList(v, t) {
- return (isList(v) && !isNil(v) && car(v) == t);
+ return (isList(v) && !isNull(v) && car(v) == t);
}
var emptylist = new Array();
@@ -120,7 +120,7 @@ function length(l) {
* Scheme-like associations.
*/
function assoc(k, l) {
- if (isNil(l))
+ if (isNull(l))
return emptylist;
var n = l.length;
for(var i = 0; i < n; i++) {
@@ -134,7 +134,7 @@ function assoc(k, l) {
* Map, filter and reduce functions.
*/
function map(f, l) {
- if (isNil(l))
+ if (isNull(l))
return l;
var n = l.length;
var a = new Array();
@@ -145,7 +145,7 @@ function map(f, l) {
}
function filter(f, l) {
- if (isNil(l))
+ if (isNull(l))
return l;
var n = l.length;
var a = new Array();
@@ -157,7 +157,7 @@ function filter(f, l) {
}
function reduce(f, i, l) {
- if (isNil(l))
+ if (isNull(l))
return i;
return reduce(f, f(i, car(l)), cdr(l));
}
@@ -223,7 +223,7 @@ function isIE() {
* External build configuration.
*/
var config;
-if (isNil(config))
+if (isNull(config))
config = {};
/**
@@ -245,7 +245,7 @@ function assert(exp) {
* Write a list of strings.
*/
function writeStrings(l) {
- if (isNil(l))
+ if (isNull(l))
return '';
var s = '';
var n = l.length;
@@ -268,14 +268,14 @@ function writeValue(v) {
}
function writeList(l) {
- if (isNil(l))
+ if (isNull(l))
return '';
return ' ' + writeValue(car(l)) + writeList(cdr(l));
}
if (!isList(v))
return writePrimitive(v);
- if (isNil(v))
+ if (isNull(v))
return '()';
return '(' + writeValue(car(v)) + writeList(cdr(v)) + ')';
}
@@ -403,7 +403,7 @@ function domainname(host) {
if (s != -1)
return domainname(host.substring(0, s));
var h = reverse(host.split('.'));
- var d = (!isNil(cddr(h)) && caddr(h) == 'www')? mklist(car(h), cadr(h), caddr(h)) : mklist(car(h), cadr(h));
+ var d = (!isNull(cddr(h)) && caddr(h) == 'www')? mklist(car(h), cadr(h), caddr(h)) : mklist(car(h), cadr(h));
return reverse(d).join('.');
}
@@ -536,7 +536,7 @@ function setcaddr(l, v) {
* Append the elements of a list to a list.
*/
function setappend(a, b) {
- if (isNil(b))
+ if (isNull(b))
return a;
a.push(car(b));
return setappend(a, cdr(b));
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/xmlutil.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/xmlutil.js?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/xmlutil.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/xmlutil.js Thu Jan 3 08:10:25 2013
@@ -26,7 +26,7 @@
*/
function nodeList(n) {
var l = new Array();
- if (isNil(n))
+ if (isNull(n))
return l;
for (var i = 0; i < n.length; i++)
l[i] = n[i];
@@ -37,7 +37,7 @@ function nodeList(n) {
* Append a list of nodes to a parent node.
*/
function appendNodes(nodes, p) {
- if (isNil(nodes))
+ if (isNull(nodes))
return p;
p.appendChild(car(nodes));
return appendNodes(cdr(nodes), p);
@@ -71,7 +71,7 @@ function childText(e) {
* Read a list of XML attributes.
*/
function readAttributes(p, a) {
- if (isNil(a))
+ if (isNull(a))
return a;
var x = car(a);
return cons(mklist(attribute, "'" + x.nodeName, x.nodeValue), readAttributes(p, cdr(a)));
@@ -83,7 +83,7 @@ function readAttributes(p, a) {
function readElement(e, childf) {
var l = append(append(mklist(element, "'" + e.nodeName), readAttributes(e, childf(e))), readElements(childElements(e), childf));
var t = childText(e);
- if (isNil(t))
+ if (isNull(t))
return l;
return append(l, mklist(car(t).nodeValue));
}
@@ -92,7 +92,7 @@ function readElement(e, childf) {
* Read a list of XML elements.
*/
function readElements(l, childf) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons(readElement(car(l), childf), readElements(cdr(l), childf));
}
@@ -101,7 +101,7 @@ function readElements(l, childf) {
* Return true if a list of strings contains an XML document.
*/
function isXML(l) {
- if (isNil(l))
+ if (isNull(l))
return false;
return car(l).substring(0, 5) == '<?xml';
}
@@ -120,7 +120,7 @@ function parseXML(l) {
*/
function readXMLDocument(doc) {
var root = childElements(doc);
- if (isNil(root))
+ if (isNull(root))
return mklist();
return mklist(readElement(car(root), childAttributes));
}
@@ -133,7 +133,7 @@ function readXHTMLElement(xhtml) {
function ieChildAttributes(e) {
var a = filter(function(n) {
// Filter out empty and internal DOM attributes
- if (n.nodeType != 2 || isNil(n.nodeValue) || n.nodeValue == '')
+ if (n.nodeType != 2 || isNull(n.nodeValue) || n.nodeValue == '')
return false;
if (n.nodeName == 'contentEditable' || n.nodeName == 'maxLength' || n.nodeName == 'loop' || n.nodeName == 'start')
return false;
@@ -174,13 +174,13 @@ function writeXMLDocument(doc) {
* Write a list of XML element and attribute tokens.
*/
function expandElementValues(n, l) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons(cons(element, cons(n, car(l))), expandElementValues(n, cdr(l)));
}
function writeList(l, node, doc) {
- if (isNil(l))
+ if (isNull(l))
return node;
var token = car(l);
@@ -196,7 +196,7 @@ function writeList(l, node, doc) {
function mkelem(tok, doc) {
function xmlns(l) {
- if (isNil(l))
+ if (isNull(l))
return null;
var t = car(l);
if (isTaggedList(t, attribute)) {
Modified: tuscany/sca-cpp/trunk/modules/json/json.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/json/json.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/json/json.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/json/json.hpp Thu Jan 3 08:10:25 2013
@@ -58,13 +58,13 @@ public:
* Returns true if a list represents a JS array.
*/
inline const bool isJSArray(const list<value>& l) {
- if(isNil(l))
+ if(isNull(l))
return true;
const value v = car(l);
if (isSymbol(v))
return false;
if(isList(v)) {
- if(!isNil((list<value>)v) && isSymbol(car<value>(v)))
+ if(!isNull((list<value>)v) && isSymbol(car<value>(v)))
return false;
}
return true;
@@ -94,7 +94,7 @@ inline const list<value> jsPropertiesToV
const char* const name = json_object_iter_key(i);
json_t* const jsv = json_object_iter_value(i);
const value val = jsValToValue(jsv);
- if (isNil(val) && !isList(val))
+ if (isNull(val) && !isList(val))
return jsPropertiesToValues(cons<value> (mklist<value> (element, c_str(name), val), propertiesSoFar), o, json_object_iter_next(o, i));
if (substr(name, 0, 1) == atsign)
return jsPropertiesToValues(cons<value>(mklist<value>(attribute, c_str(substr(name, 1)), val), propertiesSoFar), o, json_object_iter_next(o, i));
@@ -148,7 +148,7 @@ const value jsValToValue(json_t* const j
*/
inline json_t* const valuesToJSElements(json_t* const a, const list<value>& l) {
json_t* const valueToJSVal(const value& val);
- if (isNil(l))
+ if (isNull(l))
return a;
json_t* const v = valueToJSVal(car(l));
json_array_append(a, v);
@@ -199,7 +199,7 @@ inline json_t* const valueToJSVal(const
* Converts a list of values to JS properties.
*/
inline json_t* const valuesToJSProperties(json_t* const o, const list<value>& l) {
- if (isNil(l))
+ if (isNull(l))
return o;
// Write an attribute
@@ -235,7 +235,7 @@ inline json_t* const valuesToJSPropertie
* Return true if a list of strings contains a JSON document.
*/
inline const bool isJSON(const list<string>& ls) {
- if (isNil(ls))
+ if (isNull(ls))
return false;
const string s = substr(car(ls), 0, 1);
return s == "[" || s == "{";
@@ -390,7 +390,7 @@ inline const string funcName(const strin
* of key value pairs.
*/
inline const list<value> queryParams(const list<value>& a) {
- if (isNil(a))
+ if (isNull(a))
return nilListValue;
const list<value> p = car(a);
if (car(p) == value("id") || car(p) == value("method"))
Modified: tuscany/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp Thu Jan 3 08:10:25 2013
@@ -104,7 +104,7 @@ public:
* Run the authnz hooks to authenticate a request.
*/
const failable<int> checkAuthnzProviders(const string& user, request_rec* const r, const list<AuthnProviderConf>& apcs) {
- if (isNil(apcs))
+ if (isNull(apcs))
return mkfailure<int>("Authentication failure for: " + user, HTTP_UNAUTHORIZED);
const AuthnProviderConf apc = car<AuthnProviderConf>(apcs);
if (apc.provider == NULL || !apc.provider->check_password)
@@ -122,7 +122,7 @@ const failable<int> checkAuthnz(const st
if (substr(user, 0, 1) == "/")
return mkfailure<int>(string("Encountered FakeBasicAuth spoof: ") + user, HTTP_UNAUTHORIZED);
- if (isNil(apcs)) {
+ if (isNull(apcs)) {
const authn_provider* provider = (const authn_provider*)ap_lookup_provider(AUTHN_PROVIDER_GROUP, AUTHN_DEFAULT_PROVIDER, AUTHN_PROVIDER_VERSION);
return checkAuthnzProviders(user, r, mklist<AuthnProviderConf>(AuthnProviderConf(AUTHN_DEFAULT_PROVIDER, provider)));
}
@@ -142,11 +142,11 @@ const failable<value> userInfo(const val
const failable<int> authenticated(const list<value>& userinfo, const bool check, request_rec* const r, const list<value>& scopeattrs, const list<AuthnProviderConf>& apcs) {
debug(userinfo, "modoauth2::authenticated::userinfo");
- if (isNil(scopeattrs)) {
+ if (isNull(scopeattrs)) {
// Store user id in an environment variable
const list<value> id = assoc<value>("id", userinfo);
- if (isNil(id) || isNil(cdr(id)))
+ if (isNull(id) || isNull(cdr(id)))
return mkfailure<int>("Couldn't retrieve user id", HTTP_UNAUTHORIZED);
apr_table_set(r->subprocess_env, "OAUTH2_ID", apr_pstrdup(r->pool, c_str(cadr(id))));
@@ -164,7 +164,7 @@ const failable<int> authenticated(const
// Store each configured OAuth scope attribute in an environment variable
const list<value> a = car(scopeattrs);
const list<value> v = assoc<value>(cadr(a), userinfo);
- if (!isNil(v) && !isNil(cdr(v))) {
+ if (!isNull(v) && !isNull(cdr(v))) {
// Map the REMOTE_USER attribute to the request user field
if (string(car(a)) == "REMOTE_USER")
@@ -192,7 +192,7 @@ const string header(const string& qs, co
<< "oauth_consumer_key=\"" << string(cadr(assoc<value>("oauth_consumer_key", args))) << "\", ";
const list<value> atok = assoc<value>("oauth_token", args);
- if (!isNil(atok) && !isNil(cdr(atok)))
+ if (!isNull(atok) && !isNull(cdr(atok)))
hdr << "oauth_token=\"" << string(cadr(atok)) << "\", ";
if (length(verif) != 0)
@@ -223,22 +223,22 @@ const list<string> sign(const string& ve
const failable<int> authorize(const list<value>& args, request_rec* const r, const list<value>& appkeys, const memcache::MemCached& mc) {
// Extract authorize, access_token, client ID and info URIs
const list<value> ref = assoc<value>("openauth_referrer", args);
- if (isNil(ref) || isNil(cdr(ref)))
+ if (isNull(ref) || isNull(cdr(ref)))
return mkfailure<int>("Missing openauth_referrer parameter");
const list<value> req = assoc<value>("oauth1_request_token", args);
- if (isNil(req) || isNil(cdr(req)))
+ if (isNull(req) || isNull(cdr(req)))
return mkfailure<int>("Missing oauth1_request_token parameter");
const list<value> auth = assoc<value>("oauth1_authorize", args);
- if (isNil(auth) || isNil(cdr(auth)))
+ if (isNull(auth) || isNull(cdr(auth)))
return mkfailure<int>("Missing oauth1_authorize parameter");
const list<value> tok = assoc<value>("oauth1_access_token", args);
- if (isNil(tok) || isNil(cdr(tok)))
+ if (isNull(tok) || isNull(cdr(tok)))
return mkfailure<int>("Missing oauth1_access_token parameter");
const list<value> cid = assoc<value>("oauth1_client_id", args);
- if (isNil(cid) || isNil(cdr(cid)))
+ if (isNull(cid) || isNull(cdr(cid)))
return mkfailure<int>("Missing oauth1_client_id parameter");
const list<value> info = assoc<value>("oauth1_info", args);
- if (isNil(info) || isNil(cdr(info)))
+ if (isNull(info) || isNull(cdr(info)))
return mkfailure<int>("Missing oauth1_info parameter");
// Build the redirect URI
@@ -248,7 +248,7 @@ const failable<int> authorize(const list
// Lookup client app configuration
const list<value> app = assoc<value>(cadr(cid), appkeys);
- if (isNil(app) || isNil(cdr(app)))
+ if (isNull(app) || isNull(cdr(app)))
return mkfailure<int>(string("client id not found: ") + (string)cadr(cid));
list<value> appkey = cadr(app);
@@ -271,13 +271,13 @@ const failable<int> authorize(const list
// Retrieve the request token
const list<value> conf = assoc<value>("oauth_callback_confirmed", resargs);
- if (isNil(conf) || isNil(cdr(conf)) || cadr(conf) != "true")
+ if (isNull(conf) || isNull(cdr(conf)) || cadr(conf) != "true")
return mkfailure<int>("Couldn't confirm oauth_callback");
const list<value> tv = assoc<value>("oauth_token", resargs);
- if (isNil(tv) || isNil(cdr(tv)))
+ if (isNull(tv) || isNull(cdr(tv)))
return mkfailure<int>("Couldn't retrieve oauth_token");
const list<value> sv = assoc<value>("oauth_token_secret", resargs);
- if (isNil(sv) || isNil(cdr(sv)))
+ if (isNull(sv) || isNull(cdr(sv)))
return mkfailure<int>("Couldn't retrieve oauth_token_secret");
// Store the request token in memcached
@@ -301,12 +301,12 @@ const failable<list<value> > profileUser
if (b == "[") {
// Twitter JSON profile
const list<value> infov(content(json::readValue(mklist<string>(info))));
- if (isNil(infov))
+ if (isNull(infov))
return mkfailure<list<value> >("Couldn't retrieve user info");
debug(infov, "modoauth1::access_token::info");
const list<value> uv = assoc<value>("user", car(infov));
debug(uv, "modoauth1::access_token::userInfo");
- if (isNil(uv) || isNil(cdr(uv)))
+ if (isNull(uv) || isNull(cdr(uv)))
return mkfailure<list<value> >("Couldn't retrieve user info");
const list<value> iv = cdr(uv);
return cons<value>(mklist<value>("realm", cid), iv);
@@ -314,12 +314,12 @@ const failable<list<value> > profileUser
if (b == "{") {
// Foursquare JSON profile
const list<value> infov(content(json::readValue(mklist<string>(info))));
- if (isNil(infov))
+ if (isNull(infov))
return mkfailure<list<value> >("Couldn't retrieve user info");
debug(infov, "modoauth1::access_token::info");
const list<value> uv = assoc<value>("user", infov);
debug(uv, "modoauth1::access_token::userInfo");
- if (isNil(uv) || isNil(cdr(uv)))
+ if (isNull(uv) || isNull(cdr(uv)))
return mkfailure<list<value> >("Couldn't retrieve user info");
const list<value> iv = cdr(uv);
return cons<value>(mklist<value>("realm", cid), iv);
@@ -327,12 +327,12 @@ const failable<list<value> > profileUser
if (b == "<") {
// XML profile
const list<value> infov = elementsToValues(content(xml::readElements(mklist<string>(info))));
- if (isNil(infov))
+ if (isNull(infov))
return mkfailure<list<value> >("Couldn't retrieve user info");
debug(infov, "modoauth1::access_token::info");
const list<value> pv = car(infov);
debug(pv, "modoauth1::access_token::userInfo");
- if (isNil(pv) || isNil(cdr(pv)))
+ if (isNull(pv) || isNull(cdr(pv)))
return mkfailure<list<value> >("Couldn't retrieve user info");
const list<value> iv = cdr(pv);
return cons<value>(mklist<value>("realm", cid), iv);
@@ -347,27 +347,27 @@ const failable<int> accessToken(const li
// Extract access_token URI, client ID and verification code
const list<value> ref = assoc<value>("openauth_referrer", args);
- if (isNil(ref) || isNil(cdr(ref)))
+ if (isNull(ref) || isNull(cdr(ref)))
return mkfailure<int>("Missing openauth_referrer parameter");
const list<value> tok = assoc<value>("oauth1_access_token", args);
- if (isNil(tok) || isNil(cdr(tok)))
+ if (isNull(tok) || isNull(cdr(tok)))
return mkfailure<int>("Missing oauth1_access_token parameter");
const list<value> cid = assoc<value>("oauth1_client_id", args);
- if (isNil(cid) || isNil(cdr(cid)))
+ if (isNull(cid) || isNull(cdr(cid)))
return mkfailure<int>("Missing oauth1_client_id parameter");
const list<value> info = assoc<value>("oauth1_info", args);
- if (isNil(info) || isNil(cdr(info)))
+ if (isNull(info) || isNull(cdr(info)))
return mkfailure<int>("Missing oauth1_info parameter");
const list<value> tv = assoc<value>("oauth_token", args);
- if (isNil(tv) || isNil(cdr(tv)))
+ if (isNull(tv) || isNull(cdr(tv)))
return mkfailure<int>("Missing oauth_token parameter");
const list<value> vv = assoc<value>("oauth_verifier", args);
- if (isNil(vv) || isNil(cdr(vv)))
+ if (isNull(vv) || isNull(cdr(vv)))
return mkfailure<int>("Missing oauth_verifier parameter");
// Lookup client app configuration
const list<value> app = assoc<value>(cadr(cid), appkeys);
- if (isNil(app) || isNil(cdr(app)))
+ if (isNull(app) || isNull(cdr(app)))
return mkfailure<int>(string("client id not found: ") + (string)cadr(cid));
const list<value> appkey = cadr(app);
@@ -395,10 +395,10 @@ const failable<int> accessToken(const li
// Retrieve the access token
const list<value> atv = assoc<value>("oauth_token", tokresargs);
- if (isNil(atv) || isNil(cdr(atv)))
+ if (isNull(atv) || isNull(cdr(atv)))
return mkfailure<int>("Couldn't retrieve oauth_token");
const list<value> asv = assoc<value>("oauth_token_secret", tokresargs);
- if (isNil(asv) || isNil(cdr(asv)))
+ if (isNull(asv) || isNull(cdr(asv)))
return mkfailure<int>("Couldn't retrieve oauth_token_secret");
debug(atv, "modoauth1::access_token::token");
@@ -498,7 +498,7 @@ static int checkAuthn(request_rec *r) {
hasContent(openauth::sessionID(r, "TuscanyOpenAuth")) ||
hasContent(openauth::sessionID(r, "TuscanyOAuth2")))
return DECLINED;
- if ((substr(string(r->uri), 0, 8) == "/oauth2/") || !isNil(assoc<value>("openid_identifier", args)))
+ if ((substr(string(r->uri), 0, 8) == "/oauth2/") || !isNull(assoc<value>("openid_identifier", args)))
return DECLINED;
r->ap_auth_type = const_cast<char*>(atype);
@@ -515,9 +515,9 @@ int postConfigMerge(const ServerConf& ma
debug(httpd::serverName(s), "modoauth1::postConfigMerge::serverName");
// Merge configuration from main server
- if (isNil((list<value>)sc.appkeys))
+ if (isNull((list<value>)sc.appkeys))
sc.appkeys = mainsc.appkeys;
- if (isNil((list<string>)sc.mcaddrs))
+ if (isNull((list<string>)sc.mcaddrs))
sc.mcaddrs = mainsc.mcaddrs;
sc.mc = mainsc.mc;
sc.cs = mainsc.cs;
@@ -549,7 +549,7 @@ void childInit(apr_pool_t* const p, serv
ServerConf& sc = *psc;
// Connect to Memcached
- if (isNil((list<string>)sc.mcaddrs))
+ if (isNull((list<string>)sc.mcaddrs))
sc.mc = *(new (gc_new<memcache::MemCached>()) memcache::MemCached("localhost", 11211));
else
sc.mc = *(new (gc_new<memcache::MemCached>()) memcache::MemCached(sc.mcaddrs));
Modified: tuscany/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp Thu Jan 3 08:10:25 2013
@@ -98,7 +98,7 @@ public:
* Run the authnz hooks to authenticate a request.
*/
const failable<int> checkAuthnzProviders(const string& user, request_rec* const r, const list<AuthnProviderConf>& apcs) {
- if (isNil(apcs))
+ if (isNull(apcs))
return mkfailure<int>("Authentication failure for: " + user, HTTP_UNAUTHORIZED);
const AuthnProviderConf apc = car<AuthnProviderConf>(apcs);
if (apc.provider == NULL || !apc.provider->check_password)
@@ -116,7 +116,7 @@ const failable<int> checkAuthnz(const st
if (substr(user, 0, 1) == "/")
return mkfailure<int>(string("Encountered FakeBasicAuth spoof: ") + user, HTTP_UNAUTHORIZED);
- if (isNil(apcs)) {
+ if (isNull(apcs)) {
const authn_provider* provider = (const authn_provider*)ap_lookup_provider(AUTHN_PROVIDER_GROUP, AUTHN_DEFAULT_PROVIDER, AUTHN_PROVIDER_VERSION);
return checkAuthnzProviders(user, r, mklist<AuthnProviderConf>(AuthnProviderConf(AUTHN_DEFAULT_PROVIDER, provider)));
}
@@ -136,11 +136,11 @@ const failable<value> userInfo(const val
const failable<int> authenticated(const list<value>& userinfo, const bool check, request_rec* const r, const list<value>& scopeattrs, const list<AuthnProviderConf>& apcs) {
debug(userinfo, "modoauth2::authenticated::userinfo");
- if (isNil(scopeattrs)) {
+ if (isNull(scopeattrs)) {
// Store user id in an environment variable
const list<value> id = assoc<value>("id", userinfo);
- if (isNil(id) || isNil(cdr(id)))
+ if (isNull(id) || isNull(cdr(id)))
return mkfailure<int>("Couldn't retrieve user id", HTTP_UNAUTHORIZED);
apr_table_set(r->subprocess_env, "OAUTH2_ID", apr_pstrdup(r->pool, c_str(cadr(id))));
@@ -158,7 +158,7 @@ const failable<int> authenticated(const
// Store each configured OAuth scope attribute in an environment variable
const list<value> a = car(scopeattrs);
const list<value> v = assoc<value>(cadr(a), userinfo);
- if (!isNil(v) && !isNil(cdr(v))) {
+ if (!isNull(v) && !isNull(cdr(v))) {
// Map the REMOTE_USER attribute to the request user field
if (string(car(a)) == "REMOTE_USER")
@@ -175,22 +175,22 @@ const failable<int> authenticated(const
const failable<int> authorize(const list<value>& args, request_rec* const r, const list<value>& appkeys) {
// Extract authorize, access_token, client ID and info URIs
const list<value> ref = assoc<value>("openauth_referrer", args);
- if (isNil(ref) || isNil(cdr(ref)))
+ if (isNull(ref) || isNull(cdr(ref)))
return mkfailure<int>("Missing openauth_referrer parameter");
const list<value> auth = assoc<value>("oauth2_authorize", args);
- if (isNil(auth) || isNil(cdr(auth)))
+ if (isNull(auth) || isNull(cdr(auth)))
return mkfailure<int>("Missing oauth2_authorize parameter");
const list<value> tok = assoc<value>("oauth2_access_token", args);
- if (isNil(tok) || isNil(cdr(tok)))
+ if (isNull(tok) || isNull(cdr(tok)))
return mkfailure<int>("Missing oauth2_access_token parameter");
const list<value> cid = assoc<value>("oauth2_client_id", args);
- if (isNil(cid) || isNil(cdr(cid)))
+ if (isNull(cid) || isNull(cdr(cid)))
return mkfailure<int>("Missing oauth2_client_id parameter");
const list<value> info = assoc<value>("oauth2_info", args);
- if (isNil(info) || isNil(cdr(info)))
+ if (isNull(info) || isNull(cdr(info)))
return mkfailure<int>("Missing oauth2_info parameter");
const list<value> scope = assoc<value>("oauth2_scope", args);
- if (isNil(scope) || isNil(cdr(scope)))
+ if (isNull(scope) || isNull(cdr(scope)))
return mkfailure<int>("Missing oauth2_scope parameter");
const list<value> display = assoc<value>("oauth2_display", args);
@@ -205,12 +205,12 @@ const failable<int> authorize(const list
// Lookup client app configuration
const list<value> app = assoc<value>(cadr(cid), appkeys);
- if (isNil(app) || isNil(cdr(app)))
+ if (isNull(app) || isNull(cdr(app)))
return mkfailure<int>(string("client id not found: ") + (string)cadr(cid));
list<value> appkey = cadr(app);
// Redirect to the authorize URI
- const list<value> adisplay = (isNil(display) || isNil(cdr(display)))? nilListValue : mklist<value>("display", cadr(display));
+ const list<value> adisplay = (isNull(display) || isNull(cdr(display)))? nilListValue : mklist<value>("display", cadr(display));
const list<value> aargs = mklist<value>(mklist<value>("response_type", "code"), mklist<value>("client_id", car(appkey)), mklist<value>("scope", cadr(scope)), adisplay, mklist<value>("redirect_uri", httpd::escape(redir)), mklist<value>("state", httpd::escape(state)));
const string uri = httpd::unescape(cadr(auth)) + string("?") + http::queryString(aargs);
debug(uri, "modoauth2::authorize::uri");
@@ -233,28 +233,28 @@ const failable<int> accessToken(const li
// Extract access_token URI, client ID and authorization code parameters
const list<value> state = assoc<value>("state", args);
- if (isNil(state) || isNil(cdr(state)))
+ if (isNull(state) || isNull(cdr(state)))
return mkfailure<int>("Missing state parameter");
const list<value>& stargs = httpd::queryArgs(httpd::unescape(cadr(state)));
const list<value> ref = assoc<value>("openauth_referrer", stargs);
- if (isNil(ref) || isNil(cdr(ref)))
+ if (isNull(ref) || isNull(cdr(ref)))
return mkfailure<int>("Missing openauth_referrer parameter");
const list<value> tok = assoc<value>("oauth2_access_token", stargs);
- if (isNil(tok) || isNil(cdr(tok)))
+ if (isNull(tok) || isNull(cdr(tok)))
return mkfailure<int>("Missing oauth2_access_token parameter");
const list<value> cid = assoc<value>("oauth2_client_id", stargs);
- if (isNil(cid) || isNil(cdr(cid)))
+ if (isNull(cid) || isNull(cdr(cid)))
return mkfailure<int>("Missing oauth2_client_id parameter");
const list<value> info = assoc<value>("oauth2_info", stargs);
- if (isNil(info) || isNil(cdr(info)))
+ if (isNull(info) || isNull(cdr(info)))
return mkfailure<int>("Missing oauth2_info parameter");
const list<value> code = assoc<value>("code", args);
- if (isNil(code) || isNil(cdr(code)))
+ if (isNull(code) || isNull(cdr(code)))
return mkfailure<int>("Missing code parameter");
// Lookup client app configuration
const list<value> app = assoc<value>(cadr(cid), appkeys);
- if (isNil(app) || isNil(cdr(app)))
+ if (isNull(app) || isNull(cdr(app)))
return mkfailure<int>(string("client id not found: ") + (string)cadr(cid));
list<value> appkey = cadr(app);
@@ -274,12 +274,12 @@ const failable<int> accessToken(const li
return mkfailure<int>(ftr);
const value tr = content(ftr);
debug(tr, "modoauth2::access_token::response");
- if (!isList(tr) || isNil(tr))
+ if (!isList(tr) || isNull(tr))
return mkfailure<int>("Empty access token");
const list<value> tv = isString(car<value>(tr)) ?
assoc<value>("access_token", httpd::queryArgs(join("", convertValues<string>(cadr<value>(tr))))) :
assoc<value>("access_token", tr);
- if (isNil(tv) || isNil(cdr(tv)))
+ if (isNull(tv) || isNull(cdr(tv)))
return mkfailure<int>("Couldn't retrieve access_token");
debug(tv, "modoauth2::access_token::token");
@@ -373,7 +373,7 @@ static int checkAuthn(request_rec *r) {
hasContent(openauth::sessionID(r, "TuscanyOpenAuth")) ||
hasContent(openauth::sessionID(r, "TuscanyOAuth1")))
return DECLINED;
- if ((substr(string(r->uri), 0, 8) == "/oauth1/") || !isNil(assoc<value>("openid_identifier", args)))
+ if ((substr(string(r->uri), 0, 8) == "/oauth1/") || !isNull(assoc<value>("openid_identifier", args)))
return DECLINED;
r->ap_auth_type = const_cast<char*>(atype);
@@ -390,9 +390,9 @@ int postConfigMerge(const ServerConf& ma
debug(httpd::serverName(s), "modoauth2::postConfigMerge::serverName");
// Merge configuration from main server
- if (isNil((list<value>)sc.appkeys))
+ if (isNull((list<value>)sc.appkeys))
sc.appkeys = mainsc.appkeys;
- if (isNil((list<string>)sc.mcaddrs))
+ if (isNull((list<string>)sc.mcaddrs))
sc.mcaddrs = mainsc.mcaddrs;
sc.mc = mainsc.mc;
sc.cs = mainsc.cs;
@@ -424,7 +424,7 @@ void childInit(apr_pool_t* const p, serv
ServerConf& sc = *psc;
// Connect to Memcached
- if (isNil((list<string>)sc.mcaddrs))
+ if (isNull((list<string>)sc.mcaddrs))
sc.mc = *(new (gc_new<memcache::MemCached>()) memcache::MemCached("localhost", 11211));
else
sc.mc = *(new (gc_new<memcache::MemCached>()) memcache::MemCached(sc.mcaddrs));
Modified: tuscany/sca-cpp/trunk/modules/opencl/driver.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/opencl/driver.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/opencl/driver.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/opencl/driver.hpp Thu Jan 3 08:10:25 2013
@@ -38,7 +38,7 @@ namespace opencl {
const value evalDriverLoop(const OpenCLProgram& clprog, istream& in, ostream& out, const OpenCLContext& cl) {
scheme::promptForInput(scheme::evalInputPrompt, out);
const value input = content(scheme::readValue(in));
- if (isNil(input))
+ if (isNull(input))
return input;
const failable<value> output = evalKernel(createKernel(input, clprog), input, 1, value::String, 512, cl);
scheme::announceOutput(scheme::evalOutputPrompt, out);
Modified: tuscany/sca-cpp/trunk/modules/opencl/eval.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/opencl/eval.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/opencl/eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/opencl/eval.hpp Thu Jan 3 08:10:25 2013
@@ -412,7 +412,7 @@ const failable<OpenCLBuffer> readOnlyBuf
* Fill an array of write events for a given list of buffers.
*/
const cl_uint writeBufferEvents(const list<OpenCLBuffer>& buf, cl_event* const evt) {
- if (isNil(buf))
+ if (isNull(buf))
return 0;
const cl_event e = car(buf).evt;
if (e == 0)
@@ -486,7 +486,7 @@ const failable<OpenCLBuffer> valueToKern
* Convert a list of values to kernel args.
*/
const failable<list<OpenCLBuffer>> valuesToKernelArgsListHelper(const list<value>& v, const cl_uint i, const OpenCLKernel& kernel, const OpenCLContext& cl, const cl_command_queue cq) {
- if (isNil(v))
+ if (isNull(v))
return list<OpenCLBuffer>();
const failable<OpenCLBuffer> a = valueToKernelArg(car(v), i, kernel, cl, cq);
if (!hasContent(a))
Modified: tuscany/sca-cpp/trunk/modules/python/driver.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/driver.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/driver.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/python/driver.hpp Thu Jan 3 08:10:25 2013
@@ -38,7 +38,7 @@ namespace python {
const value evalDriverLoop(PyObject* const script, istream& in, ostream& out, PythonRuntime& py) {
scheme::promptForInput(scheme::evalInputPrompt, out);
const value input = content(scheme::readValue(in));
- if (isNil(input))
+ if (isNull(input))
return input;
const failable<value> output = evalScript(input, script, py);
scheme::announceOutput(scheme::evalOutputPrompt, out);
Modified: tuscany/sca-cpp/trunk/modules/python/eval.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/eval.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/python/eval.hpp Thu Jan 3 08:10:25 2013
@@ -483,7 +483,7 @@ PyObject* const mkPyLambda(const lvvlamb
* Convert a list of values to a python list.
*/
PyObject* const valuesToPyListHelper(PyObject* const l, const list<value>& v, PythonRuntime* const py) {
- if (isNil(v))
+ if (isNull(v))
return l;
PyObject* const pyv = valueToPyObject(car(v), py);
PyList_Append(l, pyv);
Modified: tuscany/sca-cpp/trunk/modules/python/python-test.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/python-test.cpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/python-test.cpp (original)
+++ tuscany/sca-cpp/trunk/modules/python/python-test.cpp Thu Jan 3 08:10:25 2013
@@ -197,7 +197,7 @@ const list<future<bool> > submitEvals(wo
}
const bool checkEvalResults(const list<future<bool> > r) {
- if (isNil(r))
+ if (isNull(r))
return true;
assert(car(r) == true);
return checkEvalResults(cdr(r));
Modified: tuscany/sca-cpp/trunk/modules/rss/rss.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/rss/rss.hpp?rev=1428206&r1=1428205&r2=1428206&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/rss/rss.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/rss/rss.hpp Thu Jan 3 08:10:25 2013
@@ -46,14 +46,14 @@ const value entry("entry");
*/
const list<value> entryElementValues(const list<value>& e) {
const list<value> lt = elementChildren("title", e);
- const value t = isNil(lt)? value(emptyString) : elementValue(car(lt));
+ const value t = isNull(lt)? value(emptyString) : elementValue(car(lt));
const list<value> li = elementChildren("link", e);
- const value i = isNil(li)? value(emptyString) : elementValue(car(li));
+ const value i = isNull(li)? value(emptyString) : elementValue(car(li));
const list<value> ld = elementChildren("description", e);
return append<value>(nilListValue + element + entry
+ value(nilListValue + element + value("title") + t)
+ value(nilListValue + element + value("id") + i),
- isNil(ld)? nilListValue : isAttribute(elementValue(car(ld)))? nilListValue :
+ isNull(ld)? nilListValue : isAttribute(elementValue(car(ld)))? nilListValue :
mklist<value>(value(nilListValue + element + value("content") + elementValue(car(ld)))));
}
@@ -61,7 +61,7 @@ const list<value> entryElementValues(con
* Convert a list of elements to a list of element values representing ATOM entries.
*/
const list<value> entriesElementValues(const list<value>& e) {
- if (isNil(e))
+ if (isNull(e))
return e;
return cons<value>(entryElementValues(car(e)), entriesElementValues(cdr(e)));
}
@@ -80,7 +80,7 @@ const bool isRSSFeed(const list<string>&
*/
const failable<list<value> > readRSSEntry(const list<string>& ilist) {
const list<value> e = content(xml::readElements(ilist));
- if (isNil(e))
+ if (isNull(e))
return mkfailure<list<value> >("Empty entry");
return mklist<value>(entryElementValues(car(e)));
}
@@ -90,7 +90,7 @@ const failable<list<value> > readRSSEntr
*/
const failable<list<value> > readRSSFeed(const list<string>& ilist) {
const list<value> f = content(xml::readElements(ilist));
- if (isNil(f))
+ if (isNull(f))
return mkfailure<list<value> >("Empty feed");
const list<value> c = elementChildren("channel", car(f));
const list<value> t = elementChildren("title", car(c));
@@ -109,12 +109,12 @@ const list<value> entryElement(const lis
const value title = elementValue(elementChild("title", l));
const value id = elementValue(elementChild("id", l));
const value content = elementChild("content", l);
- const bool text = isNil(content)? false : elementHasValue(content);
+ const bool text = isNull(content)? false : elementHasValue(content);
return append<value>(nilListValue
+ element + "item"
+ (nilListValue + element + "title" + title)
+ (nilListValue + element + "link" + id),
- isNil(content)?
+ isNull(content)?
nilListValue :
mklist<value>(append<value>(nilListValue + element + "description",
text? mklist<value>(elementValue(content)) : elementChildren(content))));
@@ -124,7 +124,7 @@ const list<value> entryElement(const lis
* Convert a list of values representing RSS entries to a list of elements.
*/
const list<value> entriesElements(const list<value>& l) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons<value>(entryElement(car(l)), entriesElements(cdr(l)));
}
@@ -134,7 +134,7 @@ const list<value> entriesElements(const
* The first two values in the list are the entry id and title.
*/
template<typename R> const failable<R> writeRSSEntry(const lambda<const R(const string&, const R)>& reduce, const R& initial, const list<value>& ll) {
- const list<value> l = isNil(ll)? ll : (list<value>)car(ll);
+ const list<value> l = isNull(ll)? ll : (list<value>)car(ll);
return xml::writeElements<R>(reduce, initial, mklist<value>(entryElement(l)));
}
@@ -150,11 +150,11 @@ const failable<list<string> > writeRSSEn
* The first two values in the list are the feed id and title.
*/
template<typename R> const failable<R> writeRSSFeed(const lambda<const R(const string&, const R)>& reduce, const R& initial, const list<value>& ll) {
- const list<value> l = isNil(ll)? ll : (list<value>)car(ll);
+ const list<value> l = isNull(ll)? ll : (list<value>)car(ll);
const list<value> lt = elementChildren("title", l);
- const value t = isNil(lt)? value(emptyString) : elementValue(car(lt));
+ const value t = isNull(lt)? value(emptyString) : elementValue(car(lt));
const list<value> li = elementChildren("id", l);
- const value i = isNil(li)? value(emptyString) : elementValue(car(li));
+ const value i = isNull(li)? value(emptyString) : elementValue(car(li));
const list<value> c = nilListValue
+ (nilListValue + element + "title" + t)
+ (nilListValue + element + "link" + i)
@@ -162,7 +162,7 @@ template<typename R> const failable<R> w
// Write RSS entries
const list<value> le = elementChildren(entry, l);
- if (isNil(le)) {
+ if (isNull(le)) {
const list<value> fe = nilListValue
+ element + "rss" + (nilListValue + attribute + "version" + "2.0")
+ append(nilListValue + element + "channel", c);
@@ -170,7 +170,7 @@ template<typename R> const failable<R> w
}
// Write a single RSS entry element with a list of values
- if (!isNil(le) && !isNil(car(le)) && isList(car<value>(caddr<value>(car(le))))) {
+ if (!isNull(le) && !isNull(car(le)) && isList(car<value>(caddr<value>(car(le))))) {
const list<value> ce = append(c, entriesElements(caddr<value>(car(le))));
const list<value> fe = nilListValue
+ element + "rss" + (nilListValue + attribute + "version" + "2.0")