Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/extern/isocline/src/bbcode.h
2727 views
1
/* ----------------------------------------------------------------------------
2
Copyright (c) 2021, Daan Leijen
3
This is free software; you can redistribute it and/or modify it
4
under the terms of the MIT License. A copy of the license can be
5
found in the "LICENSE" file at the root of this distribution.
6
-----------------------------------------------------------------------------*/
7
#pragma once
8
#ifndef IC_BBCODE_H
9
#define IC_BBCODE_H
10
11
#include <stdarg.h>
12
#include "common.h"
13
#include "term.h"
14
15
struct bbcode_s;
16
typedef struct bbcode_s bbcode_t;
17
18
ic_private bbcode_t* bbcode_new( alloc_t* mem, term_t* term );
19
ic_private void bbcode_free( bbcode_t* bb );
20
21
ic_private void bbcode_style_add( bbcode_t* bb, const char* style_name, attr_t attr );
22
ic_private void bbcode_style_def( bbcode_t* bb, const char* style_name, const char* s );
23
ic_private void bbcode_style_open( bbcode_t* bb, const char* fmt );
24
ic_private void bbcode_style_close( bbcode_t* bb, const char* fmt );
25
ic_private attr_t bbcode_style( bbcode_t* bb, const char* style_name );
26
27
ic_private void bbcode_print( bbcode_t* bb, const char* s );
28
ic_private void bbcode_println( bbcode_t* bb, const char* s );
29
ic_private void bbcode_printf( bbcode_t* bb, const char* fmt, ... );
30
ic_private void bbcode_vprintf( bbcode_t* bb, const char* fmt, va_list args );
31
32
ic_private ssize_t bbcode_column_width( bbcode_t* bb, const char* s );
33
34
// allows `attr_out == NULL`.
35
ic_private void bbcode_append( bbcode_t* bb, const char* s, stringbuf_t* out, attrbuf_t* attr_out );
36
37
#endif // IC_BBCODE_H
38
39