taskrambler  0.1.9
Web server and task management solution.
update_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 update_user.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 

Functions

Uuid applicationUpdateUser (Application this, User user)
 

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

Macro Definition Documentation

#define _GNU_SOURCE

Definition at line 23 of file update_user.c.

Function Documentation

Uuid applicationUpdateUser ( Application  this,
User  user 
)

Definition at line 43 of file update_user.c.

References indexUuid(), MEM_FREE, serialize(), SPR_OK, storageUpdate(), and uuidZero.

Referenced by controllerUserUpdate().

46 {
47  char * user_serialized;
48  size_t nuser_serialized;
49  Uuid index;
50 
51  index = indexUuid(user, this->user_namespace);
52  serialize(user, (unsigned char **)&user_serialized, &nuser_serialized);
53 
54  if (SPR_OK != storageUpdate(
55  this->users,
56  (char *)(index->uuid).value,
57  sizeof((index->uuid).value),
58  user_serialized,
59  nuser_serialized))
60  {
61  return uuidZero;
62  }
63 
64  MEM_FREE(user_serialized);
65 
66  return index;
67 }
#define MEM_FREE(seg)
Definition: memory.h:28
StoragePutResult storageUpdate(Storage, char *, size_t, char *, size_t)
Uuid uuidZero
void serialize(void *, unsigned char **, size_t *)
Definition: serializable.c:32
Uuid indexUuid(void *, Uuid)
Definition: indexable.c:33

+ Here is the call graph for this function:

+ Here is the caller graph for this function: