Tchatator413
TripEnArvor instant messaging protocol - JSON-based
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations
types.h File Reference

General types - Standalone header. More...

#include "util.h"
#include "uuid.h"
#include <limits.h>
#include <stdint.h>
#include <time.h>

Go to the source code of this file.

Data Structures

struct  user_identity_t
 Information about the identity of an user. More...
 
struct  msg_t
 Represents a message in the chat application. More...
 

Macros

#define EMAIL_LENGTH   319
 Maximum length of an user e-mail.
 
#define PSEUDO_LENGTH   255
 Maximum length of a client (member) user pseudo.
 

Typedefs

typedef uuid4_t api_key_t
 An user API key.
 
typedef int64_t token_t
 A session token.
 
typedef int32_t page_number_t
 A page number (1..2^31-1)
 
typedef int32_t serial_t
 A PosrgreSQL SERIAL primary key value starting at 1. (1..2^31-1)
 
typedef enum ATTR_FLAG_ENUM role_flags_t
 A bit flags enumeration representing the roles of an user.
 

Enumerations

enum  user_kind_t { user_kind_member , user_kind_pro_prive , user_kind_pro_public }
 The kind of an user. More...
 
enum  ATTR_FLAG_ENUM {
  role_admin = 1 << 0 , min_role = role_admin , role_membre = 1 << 1 , role_pro = 1 << 2 ,
  role_all = role_admin | role_membre | role_pro , max_role = role_all
}
 A bit flags enumeration representing the roles of an user. More...
 

Detailed Description

General types - Standalone header.

Author
Raphaƫl
Date
23/01/2025

Definition in file types.h.

Macro Definition Documentation

◆ EMAIL_LENGTH

#define EMAIL_LENGTH   319

Maximum length of an user e-mail.

Definition at line 25 of file types.h.

◆ PSEUDO_LENGTH

#define PSEUDO_LENGTH   255

Maximum length of a client (member) user pseudo.

Definition at line 27 of file types.h.

Typedef Documentation

◆ api_key_t

typedef uuid4_t api_key_t

An user API key.

Definition at line 16 of file types.h.

◆ page_number_t

typedef int32_t page_number_t

A page number (1..2^31-1)

Definition at line 20 of file types.h.

◆ serial_t

typedef int32_t serial_t

A PosrgreSQL SERIAL primary key value starting at 1. (1..2^31-1)

Definition at line 22 of file types.h.

◆ token_t

typedef int64_t token_t

A session token.

Definition at line 18 of file types.h.

Enumeration Type Documentation

◆ ATTR_FLAG_ENUM

A bit flags enumeration representing the roles of an user.

Enumerator
role_admin 

Administrator role.

min_role 

Smallest value of the enumeration.

role_membre 

Member role.

role_pro 

Professional role.

max_role 

Largest value of the enumeration.

Definition at line 37 of file types.h.

37 {
38 role_admin = 1 << 0,
40 role_membre = 1 << 1,
41 role_pro = 1 << 2,
42 role_all = role_admin | role_membre | role_pro,
43 max_role = role_all,
enum ATTR_FLAG_ENUM role_flags_t
A bit flags enumeration representing the roles of an user.
@ role_admin
Administrator role.
Definition types.h:38
@ min_role
Smallest value of the enumeration.
Definition types.h:39
@ max_role
Largest value of the enumeration.
Definition types.h:43
@ role_membre
Member role.
Definition types.h:40
@ role_pro
Professional role.
Definition types.h:41

◆ user_kind_t

The kind of an user.

Enumerator
user_kind_member 

Member (client).

user_kind_pro_prive 

Private professionnal.

user_kind_pro_public 

Public professionnal.

Definition at line 30 of file types.h.

30 {
user_kind_t
The kind of an user.
Definition types.h:30
@ user_kind_pro_public
Public professionnal.
Definition types.h:33
@ user_kind_member
Member (client).
Definition types.h:31
@ user_kind_pro_prive
Private professionnal.
Definition types.h:32