taskrambler  0.1.9
Web server and task management solution.
get_user.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include "class.h"
#include "auth.h"
#include "user.h"
#include "uuid.h"
#include "storage/storage.h"
#include "application/application.h"
#include "interface/serializable.h"
#include "interface/indexable.h"
#include "utils/memory.h"
#include "commons.h"
+ Include dependency graph for get_user.c:

Go to the source code of this file.

Functions

User applicationGetUser (Application this, Uuid uuid)
 

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.c.

Function Documentation

User applicationGetUser ( Application  this,
Uuid  uuid 
)

Definition at line 41 of file get_user.c.

References MEM_FREE, storageGet(), and unserialize().

Referenced by controllerUserRead().

42 {
43  char * user_serialized;
44  size_t nuser_serialized;
45  User user = NULL;
46 
47  storageGet(
48  this->users,
49  (char *)(uuid->uuid).value,
50  sizeof((uuid->uuid).value),
51  &user_serialized,
52  &nuser_serialized);
53 
54  if (NULL != user_serialized) {
56  user,
57  (unsigned char *)user_serialized,
58  nuser_serialized);
59  MEM_FREE(user_serialized);
60  }
61 
62  return user;
63 }
#define MEM_FREE(seg)
Definition: memory.h:28
void storageGet(Storage, char *, size_t, char **, size_t *)
Definition: storage/get.c:34
void unserialize(void *, const unsigned char *, size_t)
Definition: serializable.c:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function: