Changeset: 015b4ec6af02 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=015b4ec6af02
Modified Files:
clients/Tests/MAL-signatures_all.stable.out
clients/Tests/MAL-signatures_fits_geom.stable.out
clients/Tests/MAL-signatures_geom.stable.out
clients/Tests/MAL-signatures_none.stable.out
clients/Tests/exports.stable.out
monetdb5/modules/atoms/inet.c
monetdb5/modules/atoms/inet.h
monetdb5/modules/atoms/inet.mal
Branch: Oct2014
Log Message:
nil:inet is not the same as nil:lng.
diffs (103 lines):
diff --git a/clients/Tests/MAL-signatures_all.stable.out
b/clients/Tests/MAL-signatures_all.stable.out
--- a/clients/Tests/MAL-signatures_all.stable.out
+++ b/clients/Tests/MAL-signatures_all.stable.out
@@ -39347,6 +39347,8 @@ command inet.new(s:str):inet
address INETnew;
comment Create an inet from a string literal
+command inet.#null():inet
+address INETnull;
command inet.setmasklen(X_1:inet,X_2:int):inet
address INETsetmasklen;
comment Set netmask length for inet value
diff --git a/clients/Tests/MAL-signatures_fits_geom.stable.out
b/clients/Tests/MAL-signatures_fits_geom.stable.out
--- a/clients/Tests/MAL-signatures_fits_geom.stable.out
+++ b/clients/Tests/MAL-signatures_fits_geom.stable.out
@@ -39264,6 +39264,8 @@ command inet.new(s:str):inet
address INETnew;
comment Create an inet from a string literal
+command inet.#null():inet
+address INETnull;
command inet.setmasklen(X_1:inet,X_2:int):inet
address INETsetmasklen;
comment Set netmask length for inet value
diff --git a/clients/Tests/MAL-signatures_geom.stable.out
b/clients/Tests/MAL-signatures_geom.stable.out
--- a/clients/Tests/MAL-signatures_geom.stable.out
+++ b/clients/Tests/MAL-signatures_geom.stable.out
@@ -39240,6 +39240,8 @@ command inet.new(s:str):inet
address INETnew;
comment Create an inet from a string literal
+command inet.#null():inet
+address INETnull;
command inet.setmasklen(X_1:inet,X_2:int):inet
address INETsetmasklen;
comment Set netmask length for inet value
diff --git a/clients/Tests/MAL-signatures_none.stable.out
b/clients/Tests/MAL-signatures_none.stable.out
--- a/clients/Tests/MAL-signatures_none.stable.out
+++ b/clients/Tests/MAL-signatures_none.stable.out
@@ -39069,6 +39069,8 @@ command inet.new(s:str):inet
address INETnew;
comment Create an inet from a string literal
+command inet.#null():inet
+address INETnull;
command inet.setmasklen(X_1:inet,X_2:int):inet
address INETsetmasklen;
comment Set netmask length for inet value
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -1314,6 +1314,7 @@ str INETmasklen(int *retval, inet *val);
str INETnetmask(inet *retval, inet *val);
str INETnetwork(inet *retval, inet *val);
str INETnew(inet *retval, str *in);
+inet *INETnull(void);
str INETsetmasklen(inet *retval, inet *val, int *mask);
str INETtext(str *retval, inet *val);
int INETtoString(str *retval, int *len, inet *handle);
diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -33,6 +33,9 @@
#include "mal.h"
#include "mal_exception.h"
#include "inet.h"
+
+static inet inet_nil = {0,0,0,0,0,0,0,1};
+
/**
* Creates a new inet from the given string.
* Warning: GDK function, does NOT pass a string by reference, and wants
@@ -715,3 +718,9 @@ INET_fromstr(inet *ret, str *s)
INETfromString(*s, &len, &ret);
return MAL_SUCCEED;
}
+
+inet *
+INETnull(void)
+{
+ return &inet_nil;
+}
diff --git a/monetdb5/modules/atoms/inet.h b/monetdb5/modules/atoms/inet.h
--- a/monetdb5/modules/atoms/inet.h
+++ b/monetdb5/modules/atoms/inet.h
@@ -77,4 +77,4 @@ inet_export str INETtext(str *retval, in
inet_export str INETabbrev(str *retval, inet *val);
inet_export str INET_inet(inet *d, inet *s);
inet_export str INET_fromstr(inet *ret, str *s);
-
+inet_export inet *INETnull(void);
diff --git a/monetdb5/modules/atoms/inet.mal b/monetdb5/modules/atoms/inet.mal
--- a/monetdb5/modules/atoms/inet.mal
+++ b/monetdb5/modules/atoms/inet.mal
@@ -17,6 +17,8 @@
atom inet:lng;
+command null() :inet
+address INETnull;
command cmp() :int
address INETcompare;
command fromstr()
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list