smntc
an in-memory multimodal graph database
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
Words.c File Reference
#include <stdlib.h>
#include "errors.h"
#include "Graph.h"
#include "Binary.h"
#include "Utf8.h"
#include <stdio.h>
+ Include dependency graph for Words.c:

Go to the source code of this file.

Data Structures

struct  Words
 A managing object for all words in a graph. More...
 

Macros

#define WORD_CLUSTER_LENGTH   3
 
#define BUFFER_LENGTH   256
 

Functions

struct WordsWords_construct (unsigned int wordType, struct Binary *binary, struct Utf8 *utf8, struct Graph *graph, int *error)
 It constructs a new managing object for all words in a graph.
 
struct WordsWords_destruct (struct Words *this)
 It destructs a managing object for all words in a graph.
 
unsigned int Words_writeWord (struct Words *this, unsigned int length, unsigned int *characters, int *error)
 It writes one word into a graph.
 
void Words_readWord (struct Words *this, unsigned int word, unsigned int length, unsigned int *characters, int *error)
 It reads a word from a graph.
 

Macro Definition Documentation

◆ BUFFER_LENGTH

#define BUFFER_LENGTH   256

Definition at line 47 of file Words.c.

◆ WORD_CLUSTER_LENGTH

#define WORD_CLUSTER_LENGTH   3

Definition at line 46 of file Words.c.

Function Documentation

◆ Words_construct()

struct Words * Words_construct ( unsigned int  wordType,
struct Binary binary,
struct Utf8 utf8,
struct Graph graph,
int *  error 
)

It constructs a new managing object for all words in a graph.

Parameters
wordTypea vertex that all word clusters will be connected to
binarya manging object for binary character codes
utf8a UTF8 converter
grapha graph storage with needed managing objects
errorerror tracking (0 means no error)

Definition at line 57 of file Words.c.

◆ Words_destruct()

struct Words * Words_destruct ( struct Words this)

It destructs a managing object for all words in a graph.

It triggers destruction of the binary manager. Other references are left intact.

Parameters
thisa managing object for all words in a graph

Definition at line 74 of file Words.c.

+ Here is the call graph for this function:

◆ Words_readWord()

void Words_readWord ( struct Words this,
unsigned int  word,
unsigned int  length,
unsigned int *  characters,
int *  error 
)

It reads a word from a graph.

Parameters
thisa managing object for all words in a graph
wordthe type vertex of a word cluster
lengththe buffer length
charactersa buffer for the charcters to be read
errorerror tracking (0 means no error)

Definition at line 251 of file Words.c.

+ Here is the call graph for this function:

◆ Words_writeWord()

unsigned int Words_writeWord ( struct Words this,
unsigned int  length,
unsigned int *  characters,
int *  error 
)

It writes one word into a graph.

Parameters
thisa managing object for all words in a graph
lengththe number of characters in the buffer
charactersa buffer with the charcters to be written
errorerror tracking (0 means no error)

Definition at line 85 of file Words.c.

+ Here is the call graph for this function: