gusimplewhiteboard
wb_my_position.c File Reference
#include "wb_my_position.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>
Include dependency graph for wb_my_position.c:

Go to the source code of this file.

Macros

#define htonll(x)   bswap_64(x)
 
#define ntohll(x)   bswap_64(x)
 
#define htonl(x)   bswap_32(x)
 
#define ntohl(x)   bswap_32(x)
 
#define htons(x)   bswap_16(x)
 
#define ntohs(x)   bswap_16(x)
 

Functions

const char * wb_my_position_description (const struct wb_my_position *self, char *descString, size_t bufferSize)
 Convert to a description string. More...
 
const char * wb_my_position_to_string (const struct wb_my_position *self, char *toString, size_t bufferSize)
 Convert to a string. More...
 
struct wb_my_positionwb_my_position_from_string (struct wb_my_position *self, const char *str)
 Convert from a string. More...
 
size_t wb_my_position_to_network_serialised (const struct wb_my_position *self, char *dst)
 Convert to a compressed, serialised, network byte order byte stream. More...
 
size_t wb_my_position_from_network_serialised (const char *src, struct wb_my_position *dst)
 Convert from a compressed, serialised, network byte order byte stream. More...
 

Macro Definition Documentation

◆ htonl

#define htonl (   x)    bswap_32(x)

Definition at line 97 of file wb_my_position.c.

◆ htonll

#define htonll (   x)    bswap_64(x)

Definition at line 93 of file wb_my_position.c.

◆ htons

#define htons (   x)    bswap_16(x)

Definition at line 101 of file wb_my_position.c.

◆ ntohl

#define ntohl (   x)    bswap_32(x)

Definition at line 98 of file wb_my_position.c.

◆ ntohll

#define ntohll (   x)    bswap_64(x)

Definition at line 94 of file wb_my_position.c.

◆ ntohs

#define ntohs (   x)    bswap_16(x)

Definition at line 102 of file wb_my_position.c.

Function Documentation

◆ wb_my_position_description()

const char * wb_my_position_description ( const struct wb_my_position self,
char *  descString,
size_t  bufferSize 
)

Convert to a description string.

Definition at line 125 of file wb_my_position.c.

Referenced by guWhiteboard::MyPosition::description().

◆ wb_my_position_from_network_serialised()

size_t wb_my_position_from_network_serialised ( const char *  src,
struct wb_my_position dst 
)

Convert from a compressed, serialised, network byte order byte stream.

Network stream deserialisation.

Definition at line 352 of file wb_my_position.c.

References wb_my_position::heading, ntohs, wb_my_position::x, and wb_my_position::y.

◆ wb_my_position_from_string()

struct wb_my_position * wb_my_position_from_string ( struct wb_my_position self,
const char *  str 
)

Convert from a string.

Definition at line 189 of file wb_my_position.c.

References MY_POSITION_DESC_BUFFER_SIZE.

◆ wb_my_position_to_network_serialised()

size_t wb_my_position_to_network_serialised ( const struct wb_my_position self,
char *  dst 
)

Convert to a compressed, serialised, network byte order byte stream.

WHITEBOARD_POSTER_STRING_CONVERSION.

Definition at line 299 of file wb_my_position.c.

References htons.

◆ wb_my_position_to_string()

const char * wb_my_position_to_string ( const struct wb_my_position self,
char *  toString,
size_t  bufferSize 
)

Convert to a string.

Definition at line 157 of file wb_my_position.c.

Referenced by guWhiteboard::MyPosition::to_string().