taskrambler  0.1.9
Web server and task management solution.
_get_user_from_args.c File Reference
#include "hash.h"
#include "user.h"
#include "utils/memory.h"
#include "commons.h"
+ Include dependency graph for _get_user_from_args.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 

Functions

User _controllerGetUserFromArgs (Hash args)
 

Detailed Description

Author
Georg Hopp

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 3 of the License, 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 this program. If not, see http://www.gnu.org/licenses/.

Definition in file _get_user_from_args.c.

Macro Definition Documentation

#define _GNU_SOURCE

Definition at line 23 of file _get_user_from_args.c.

Function Documentation

User _controllerGetUserFromArgs ( Hash  args)

Definition at line 33 of file _get_user_from_args.c.

References CSTRA, FALSE, and hashGet().

Referenced by _controllerProcessUserCreateArgs().

34 {
35  HashValue email = hashGet(args, CSTRA("email"));
36  HashValue firstname = hashGet(args, CSTRA("firstname"));
37  HashValue surname = hashGet(args, CSTRA("surname"));
38 
39  if (
40  NULL == email ||
41  NULL == firstname ||
42  NULL == surname)
43  {
44  return FALSE;
45  }
46 
47  return new(User,
48  (char *)(email->value), email->nvalue,
49  (char *)(email->value), email->nvalue,
50  (char *)(firstname->value), firstname->nvalue,
51  (char *)(surname->value), surname->nvalue);
52 }
#define CSTRA(val)
Const STRing Argument.
Definition: memory.h:26
#define FALSE
Definition: commons.h:28
void * hashGet(Hash, const char *, size_t)
Definition: hash/get.c:51

+ Here is the call graph for this function:

+ Here is the caller graph for this function: