universe@21: /* universe@21: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. universe@21: * universe@35: * Copyright 2016 Mike Becker. All rights reserved. universe@21: * universe@21: * Redistribution and use in source and binary forms, with or without universe@21: * modification, are permitted provided that the following conditions are met: universe@21: * universe@21: * 1. Redistributions of source code must retain the above copyright universe@21: * notice, this list of conditions and the following disclaimer. universe@21: * universe@21: * 2. Redistributions in binary form must reproduce the above copyright universe@21: * notice, this list of conditions and the following disclaimer in the universe@21: * documentation and/or other materials provided with the distribution. universe@21: * universe@21: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" universe@21: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE universe@21: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE universe@21: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE universe@21: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR universe@21: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF universe@21: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS universe@21: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN universe@21: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) universe@21: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE universe@21: * POSSIBILITY OF SUCH DAMAGE. universe@21: * universe@21: */ universe@21: universe@21: #ifndef CODEGENS_H universe@21: #define CODEGENS_H universe@21: universe@49: #include universe@21: #include universe@49: #include universe@49: #include universe@47: #include "ucx/string.h" universe@45: #include "ucx/buffer.h" universe@49: #include "ucx/utils.h" universe@21: universe@21: #ifdef __cplusplus universe@21: extern "C" { universe@21: #endif universe@51: universe@51: typedef struct { universe@51: int multiline_comment; universe@51: UcxBuffer* primary_buffer; universe@51: UcxBuffer* secondary_buffer; universe@51: } HighlighterData; universe@21: universe@51: HighlighterData* new_highlighter_data(); universe@51: void free_highlighter_data(HighlighterData*); universe@21: universe@51: typedef void(*highlighter_func)(char*,UcxBuffer*,HighlighterData*); universe@46: universe@52: void plain_highlighter(char *src, UcxBuffer *dest, HighlighterData *hd); universe@52: void c_highlighter(char *src, UcxBuffer *dest, HighlighterData *hd); universe@52: void java_highlighter(char *src, UcxBuffer *dest, HighlighterData *hd); universe@21: universe@21: #ifdef __cplusplus universe@21: } universe@21: #endif universe@21: universe@21: #endif /* CODEGENS_H */ universe@21: