}
else if (r == 1)
{
- auth = nmem_malloc(nmem_auth, sizeof(*auth));
+ auth = (Z_IdAuthentication *) nmem_malloc(nmem_auth, sizeof(*auth));
if (!strcmp(args[0], "-"))
{
auth->which = Z_IdAuthentication_anonymous;
}
else if (r == 2)
{
- auth = nmem_malloc(nmem_auth, sizeof(*auth));
+ auth = (Z_IdAuthentication *) nmem_malloc(nmem_auth, sizeof(*auth));
auth->which = Z_IdAuthentication_idPass;
- auth->u.idPass = nmem_malloc(nmem_auth, sizeof(*auth->u.idPass));
+ auth->u.idPass = (Z_IdPass *)
+ nmem_malloc(nmem_auth, sizeof(*auth->u.idPass));
auth->u.idPass->groupId = NULL;
auth->u.idPass->userId = !strcmp(args[0], "-") ? 0 : args[0];
auth->u.idPass->password = !strcmp(args[1], "-") ? 0 : args[1];
}
else if (r == 3)
{
- auth = nmem_malloc(nmem_auth, sizeof(*auth));
+ auth = (Z_IdAuthentication*) nmem_malloc(nmem_auth, sizeof(*auth));
auth->which = Z_IdAuthentication_idPass;
- auth->u.idPass = nmem_malloc(nmem_auth, sizeof(*auth->u.idPass));
+ auth->u.idPass = (Z_IdPass *)
+ nmem_malloc(nmem_auth, sizeof(*auth->u.idPass));
auth->u.idPass->groupId = args[1];
auth->u.idPass->userId = args[0];
auth->u.idPass->password = args[2];
%}
%pure_parser
-%token DOTTERM TERM AND OR NOT PROX GE LE NE EXACT
+%token DOTTERM TERM AND OR NOT PROX GE LE NE EXACT SORTBY
%%
$$.rel = cql_node_mk_sc(((CQL_parser) parm)->nmem,
"cql.serverChoice", "=", 0);
((CQL_parser) parm)->top = 0;
-} cqlQuery1 {
+} cqlQuery1 sortby {
cql_node_destroy($$.rel);
((CQL_parser) parm)->top = $2.cql;
}
;
+sortby: /* empty */
+| SORTBY sortSpec;
+
+sortSpec: sortSpec singleSpec
+| singleSpec;
+
+singleSpec: index modifiers ;
+
cqlQuery1: cqlQuery
| cqlQuery error {
cql_node_destroy($1.cql);
| OR
| NOT
| PROX
+| SORTBY
;
%%
lval->buf = "prox";
return PROX;
}
+ if (!cql_strcmp(lval->buf, "sortby"))
+ {
+ lval->buf = "sortby";
+ return SORTBY;
+ }
if (!cql_strcmp(lval->buf, "all"))
relation_like = 1;
if (!cql_strcmp(lval->buf, "any"))
if (l < n)
return xstrdup_f(s, file, line);
{
- char *a = xmalloc_f(n+1, file, line);
+ char *a = (char*) xmalloc_f(n+1, file, line);
memcpy(a, s, n);
a[n] = '\0';
return a;