1#ifndef TEXTMATELIB_SESSION_C_API_H
2#define TEXTMATELIB_SESSION_C_API_H
29typedef uint64_t TextMateSession;
41 TextMateSessionLine* lines;
43} TextMateSessionLinesResult;
61TML_API TextMateSession textmate_session_create(
TextMateGrammar grammar);
71TML_API
void textmate_session_retain(TextMateSession session);
82TML_API
void textmate_session_release(TextMateSession session);
93TML_API
void textmate_session_dispose(TextMateSession session);
113TML_API
int textmate_session_set_lines(
114 TextMateSession session,
120TML_API int32_t textmate_session_get_line_count(TextMateSession session);
147TML_API
int textmate_session_edit(
148 TextMateSession session,
174TML_API
int textmate_session_add(
175 TextMateSession session,
199TML_API
int textmate_session_remove(
200 TextMateSession session,
223 TextMateSession session,
240 TextMateSession session,
258TML_API TextMateSessionLinesResult* textmate_session_get_tokens_range(
259 TextMateSession session,
265TML_API
void textmate_session_free_tokens_result(
270TML_API
void textmate_session_free_lines_result(
271 TextMateSessionLinesResult* result
289TML_API
void textmate_session_invalidate_range(
290 TextMateSession session,
304TML_API
void textmate_session_clear_cache(TextMateSession session);
316TML_API
void textmate_session_cleanup_expired(int32_t maxAgeMs);
322 uint64_t createdAtMs;
323 uint32_t referenceCount;
325 int32_t cachedLineCount;
326 uint64_t memoryUsageBytes;
327} TextMateSessionMetadata;
329TML_API TextMateSessionMetadata textmate_session_get_metadata(
330 TextMateSession session
void * TextMateGrammar
Handle to a grammar definition for a specific language.
void * TextMateStateStack
Handle to a parsing state stack (immutable, used for incremental tokenization)
Represents a single token in tokenized text.
Result from tokenizing a single line with decoded tokens.