Skip to content

Commit

Permalink
ims_usrloc_scscf: clang-format for coherent indentation and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed May 18, 2023
1 parent 8598f4e commit 874e915
Show file tree
Hide file tree
Showing 30 changed files with 5,621 additions and 4,661 deletions.
943 changes: 536 additions & 407 deletions src/modules/ims_usrloc_scscf/bin_utils.c

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions src/modules/ims_usrloc_scscf/bin_utils.h
Expand Up @@ -44,56 +44,56 @@
*/

#ifndef BIN_UTILS_H
#define BIN_UTILS_H
#define BIN_UTILS_H

#include "usrloc.h"

typedef struct _bin_data {
char* s; /*string*/
typedef struct _bin_data
{
char *s; /*string*/
int len; /*string len*/
int max; /*allocated size of the buffer s*/
int max; /*allocated size of the buffer s*/
} bin_data;

/*
* Binary encoding functions
*/
/* memory allocation and initialization macros */
#define BIN_ALLOC_METHOD shm_malloc
#define BIN_REALLOC_METHOD shm_realloc
#define BIN_FREE_METHOD shm_free
#define BIN_ALLOC_METHOD shm_malloc
#define BIN_REALLOC_METHOD shm_realloc
#define BIN_FREE_METHOD shm_free

int bin_alloc(bin_data *x, int max_len);
int bin_realloc(bin_data *x, int delta);
int bin_expand(bin_data *x, int delta);
void bin_free(bin_data *x);
void bin_print(bin_data *x);

int bin_encode_char(bin_data *x,char k);
int bin_decode_char(bin_data *x,char *c);
int bin_encode_char(bin_data *x, char k);
int bin_decode_char(bin_data *x, char *c);

int bin_encode_uchar(bin_data *x,unsigned char k);
int bin_decode_uchar(bin_data *x,unsigned char *c);
int bin_encode_uchar(bin_data *x, unsigned char k);
int bin_decode_uchar(bin_data *x, unsigned char *c);

int bin_encode_short(bin_data *x,short k);
int bin_decode_short(bin_data *x,short *c);
int bin_encode_short(bin_data *x, short k);
int bin_decode_short(bin_data *x, short *c);

int bin_encode_ushort(bin_data *x,unsigned short k);
int bin_decode_ushort(bin_data *x,unsigned short *c);
int bin_encode_ushort(bin_data *x, unsigned short k);
int bin_decode_ushort(bin_data *x, unsigned short *c);

int bin_encode_int(bin_data *x,int k);
int bin_decode_int(bin_data *x,int *c);
int bin_encode_int(bin_data *x, int k);
int bin_decode_int(bin_data *x, int *c);

int bin_encode_uint(bin_data *x,unsigned int k);
int bin_decode_uint(bin_data *x,unsigned int *c);
int bin_encode_uint(bin_data *x, unsigned int k);
int bin_decode_uint(bin_data *x, unsigned int *c);

int bin_encode_time_t(bin_data *x,time_t k);
int bin_decode_time_t(bin_data *x,time_t *c);
int bin_encode_time_t(bin_data *x, time_t k);
int bin_decode_time_t(bin_data *x, time_t *c);

int bin_encode_str(bin_data *x,str *s);
int bin_decode_str(bin_data *x,str *s);
int bin_encode_str(bin_data *x, str *s);
int bin_decode_str(bin_data *x, str *s);

int bin_encode_ims_subscription(bin_data *x, ims_subscription *s);
ims_subscription *bin_decode_ims_subscription(bin_data *x);

#endif /* BIN_UTILS_H */

#endif /* BIN_UTILS_H */

0 comments on commit 874e915

Please sign in to comment.