Browse Source
remove specialized load and save from user, add serializable and indexable interface and make user utilize both and store a user and its credentials keyed by its uuid
v0.1.8
remove specialized load and save from user, add serializable and indexable interface and make user utilize both and store a user and its credentials keyed by its uuid
v0.1.8
17 changed files with 292 additions and 108 deletions
-
7include/application/application.h
-
5include/auth/interface/auth.h
-
49include/interface/indexable.h
-
42include/interface/serializable.h
-
4src/Makefile.am
-
6src/application/application.c
-
50src/application/login.c
-
36src/application/signup.c
-
5src/auth/interface/auth.c
-
3src/auth/ldap.c
-
8src/auth/storage/storage.c
-
33src/interface/indexable.c
-
58src/interface/serializable.c
-
1src/taskrambler.c
-
2src/user/Makefile.am
-
67src/user/user.c
@ -0,0 +1,49 @@ |
|||||
|
/** |
||||
|
* \file |
||||
|
* This interface provides only one function at all. |
||||
|
* indexUuid will generate a uuid to the current object. |
||||
|
* |
||||
|
* \todo |
||||
|
* Maybe merge hashable and indexable. Thus we might get an |
||||
|
* easy way to exchange the hashing mechanism used for my |
||||
|
* associative arrays. |
||||
|
* |
||||
|
* \author Georg Hopp |
||||
|
* |
||||
|
* \copyright |
||||
|
* Copyright © 2012 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/>. |
||||
|
*/ |
||||
|
|
||||
|
#ifndef __INDEXABLE_H__ |
||||
|
#define __INDEXABLE_H__ |
||||
|
|
||||
|
#include "uuid.h" |
||||
|
|
||||
|
|
||||
|
typedef Uuid (* fptr_indexUuid)(void *, Uuid); |
||||
|
|
||||
|
extern const struct interface i_Indexable; |
||||
|
|
||||
|
struct i_Indexable { |
||||
|
const struct interface * const _; |
||||
|
fptr_indexUuid uuid; |
||||
|
}; |
||||
|
|
||||
|
extern Uuid indexUuid(void *, Uuid); |
||||
|
|
||||
|
#endif // __INDEXABLE_H__ |
||||
|
|
||||
|
// vim: set ts=4 sw=4: |
||||
@ -0,0 +1,42 @@ |
|||||
|
/** |
||||
|
* \file |
||||
|
* |
||||
|
* \author Georg Hopp |
||||
|
* |
||||
|
* \copyright |
||||
|
* Copyright © 2012 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/>. |
||||
|
*/ |
||||
|
|
||||
|
#ifndef __SERIALIZABLE_H__ |
||||
|
#define __SERIALIZABLE_H__ |
||||
|
|
||||
|
typedef void (* fptr_serialize)(void *, unsigned char **, size_t *); |
||||
|
typedef void (* fptr_unserialize)(void *, const unsigned char *, size_t); |
||||
|
|
||||
|
extern const struct interface i_Serializable; |
||||
|
|
||||
|
struct i_Serializable { |
||||
|
const struct interface * const _; |
||||
|
fptr_serialize serialize; |
||||
|
fptr_unserialize unserialize; |
||||
|
}; |
||||
|
|
||||
|
extern void serialize(void *, unsigned char **, size_t *); |
||||
|
extern void unserialize(void *, const unsigned char *, size_t); |
||||
|
|
||||
|
#endif // __SERIALIZABLE_H__ |
||||
|
|
||||
|
// vim: set ts=4 sw=4: |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue