YAP 7.1.0
text.c File Reference

Support routines for text processing. More...

#include "Yap.h"
#include "YapEval.h"
#include "YapHeap.h"
#include "YapStreams.h"
#include "YapText.h"
#include "Yatom.h"
#include "yapio.h"
#include <string.h>
#include <wchar.h>

Go to the source code of this file.

Macros

#define wcsnlen(S, N)   min_size(N, wcslen(S))
 
#define stpcpy   __stpcpy
 
#define NAN   (0.0 / 0.0)
 
#define POPRET(x)   return pop_output_text_stack(lvl, x)
 

Functions

char_kind_t Yap_wide_chtype (int ch)
 
unsigned char * Yap_readText (seq_tv_t *inp USES_REGS)
 
void * write_buffer (unsigned char *s0, seq_tv_t *out USES_REGS)
 
bool write_Text (unsigned char *inp, seq_tv_t *out USES_REGS)
 
bool Yap_CVT_Text (seq_tv_t *inp, seq_tv_t *out USES_REGS)
 
bool Yap_Concat_Text (int tot, seq_tv_t inp[], seq_tv_t *out USES_REGS)
 
bool Yap_Splice_Text (int n, size_t cuts[], seq_tv_t *inp, seq_tv_t outv[] USES_REGS)
 
const char * Yap_PredIndicatorToUTF8String (PredEntry *ap, char *s0, size_t sz)
 Convert from a predicate structure to an UTF-8 string of the form. More...
 
Term Yap_MkTextTerm (const char *s, int guide USES_REGS)
 Convert from a text buffer (8-bit) to a term that has the same type as Tguide More...
 

Detailed Description

Support routines for text processing.

Definition in file text.c.

Macro Definition Documentation

◆ NAN

#define NAN   (0.0 / 0.0)

Definition at line 57 of file text.c.

◆ stpcpy

#define stpcpy   __stpcpy

Definition at line 53 of file text.c.

◆ wcsnlen

#define wcsnlen (   S,
 
)    min_size(N, wcslen(S))

Definition at line 46 of file text.c.

Function Documentation

◆ write_buffer()

void * write_buffer ( unsigned char *  s0,
seq_tv_t *out  USES_REGS 
)

Definition at line 647 of file text.c.

◆ write_Text()

bool write_Text ( unsigned char *  inp,
seq_tv_t *out  USES_REGS 
)

Definition at line 746 of file text.c.

◆ Yap_Concat_Text()

bool Yap_Concat_Text ( int  tot,
seq_tv_t  inp[],
seq_tv_t *out  USES_REGS 
)

Definition at line 926 of file text.c.

◆ Yap_CVT_Text()

bool Yap_CVT_Text ( seq_tv_t inp,
seq_tv_t *out  USES_REGS 
)

Definition at line 851 of file text.c.

◆ Yap_MkTextTerm()

Term Yap_MkTextTerm ( const char *  s,
int guide  USES_REGS 
)

Convert from a text buffer (8-bit) to a term that has the same type as Tguide

ā‰ˆ*

Parameters
sthe buffer ā‰ˆ *
tguidethe guide

ā‰ˆ *

Returns
the term

Definition at line 1133 of file text.c.

◆ Yap_PredIndicatorToUTF8String()

const char * Yap_PredIndicatorToUTF8String ( PredEntry ap,
char *  s0,
size_t  sz 
)

Convert from a predicate structure to an UTF-8 string of the form.

module:name/arity

The result is in very volatile memory

Parameters
sthe buffer
Returns
the temporary string

Definition at line 1068 of file text.c.

◆ Yap_readText()

unsigned char * Yap_readText ( seq_tv_t *inp  USES_REGS)

Definition at line 363 of file text.c.

◆ Yap_Splice_Text()

bool Yap_Splice_Text ( int  n,
size_t  cuts[],
seq_tv_t inp,
seq_tv_t outv[]  USES_REGS 
)

Definition at line 971 of file text.c.

◆ Yap_wide_chtype()

char_kind_t Yap_wide_chtype ( int  ch)
inline

< Other, not assigned

< Letter, uppercase

< Letter, lowercase

< Letter, titlecase

< Letter, modifier

< Letter, other

< Mark, nonspacing

< Mark, spacing combining

< Mark, enclosing

< Number, decimal digit

< Number, letter

< Number, other

< Punctuation, connector

< Punctuation, dash

< Punctuation, open

< Punctuation, close

< Punctuation, initial quote

< Punctuation, final quote

< Punctuation, other

< Symbol, math

< Symbol, currency

< Symbol, modifier

unsure in YAP, let's assume a,c us treated as aƧ

< Symbol, other

< Separator, space

< Separator, line

< Separator, paragraph

< Other, control

< Other, format

< Other, surrogate

< Other, private use

Definition at line 60 of file text.c.