int LibEditText_AppendLine( int i_tinfoid, Byte *pstr_text, DWord dw_length );
+#ifdef DRD64_SRC_LIBEDITTEXT_LINEEDIT
+ #define LIBEDITTEXT_API_LINEEDIT
+#else
+ #define LIBEDITTEXT_API_LINEEDIT extern
+#endif
+LIBEDITTEXT_API_LINEEDIT
+ int LibEditText_InsertChar( int i_tinfoid, DWord dw_line, DWord dw_pos, Byte b_char );
+
#endif /* DRD64_HEADER_DRCC_INCLUDE */
drd64_libedittext_file.o \
drd64_libedittext_lineinfo.o \
drd64_libedittext_linectrl.o \
+ drd64_libedittext_lineedit.o \
drd64_libedittext_section.o \
drd64_libedittext_system.o
HEADER = \
drd64_libedittext_file.h \
drd64_libedittext_lineinfo.h \
drd64_libedittext_linectrl.h \
+ drd64_libedittext_lineedit.h \
drd64_libedittext_section.h \
drd64_libedittext_system.h \
drd64_libedittext_types.h \
drd64_libedittext_linectrl.o: drd64_libedittext_linectrl.c $(HEADER)
$(CC) -c -o drd64_libedittext_linectrl.o $(FLAGS_DEBUG) $(FLAGS_COMPILE) \
drd64_libedittext_linectrl.c
+drd64_libedittext_lineedit.o: drd64_libedittext_lineedit.c $(HEADER)
+ $(CC) -c -o drd64_libedittext_lineedit.o $(FLAGS_DEBUG) $(FLAGS_COMPILE) \
+ drd64_libedittext_lineedit.c
drd64_libedittext_file.o: drd64_libedittext_file.c $(HEADER)
$(CC) -c -o drd64_libedittext_file.o $(FLAGS_DEBUG) $(FLAGS_COMPILE) \
drd64_libedittext_file.c
#include"drd64_libedittext_file.h"
#include"drd64_libedittext_lineinfo.h"
#include"drd64_libedittext_linectrl.h"
+#include"drd64_libedittext_lineedit.h"
#include"drd64_libedittext_section.h"
#include"drd64_libedittext_debug.h"
{
int i_result;
DWord dw_buflength;
+ Byte str_lf[2] = { '\n', '\0'};
+ Byte *pb_tmp;
LibEditText_LineInfo *p_line;
LibEditText_LineInfo *p_before;
assert( NULL != p_tinfo );
p_before = LINFO(p_tinfo, p_tinfo->dw_line_end);
+ if( NULL == p_before )
+ { goto goto_LibEditText_LineCtrl_AppendLine_prechecked; }
+
+ if( 0 < p_before->dw_strlen ) {
+ pb_tmp = p_tinfo->pb_text + ((p_before->dw_start) + (p_before->dw_strlen) - 1);
+ if( '\n' == *pb_tmp )
+ { goto goto_LibEditText_LineCtrl_AppendLine_prechecked; }
+ }
+
+ i_result = LibEditText_LineEdit_InsertString(
+ p_tinfo, p_before, p_before->dw_strlen, str_lf, 1);
+
+goto_LibEditText_LineCtrl_AppendLine_prechecked:
+
dw_buflength = dw_length + DRD64_LIBEDITTEXT_DEFAULT_RESERVEBUF_INLINE;
p_line = LibEditText_LineInfo_GetEmptyLineInfo( p_tinfo, dw_buflength );
if( NULL == p_line ) { return -0x11; }
else
{ p_tinfo->dw_line_start = p_line->dw_id; }
- p_line->dw_strlen = dw_length;
p_line->dw_before = (NULL==p_before ? INVALID_LINE : p_before->dw_id);
+ p_line->dw_strlen = dw_length;
i_result = LibEditText_LineInfo_AddSortChain( p_tinfo, p_line );
if( 0x00 != i_result ) {
--- /dev/null
+/*DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64
+
+ D r . D e a m o n 6 4
+ for INTEL64(R), AMD64(R)
+
+ Copyright(C) 2007-2009 Koine Yuusuke(koinec). All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Koine Yuusuke(koinec) OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
+
+/* File Info -----------------------------------------------------------
+File: drd64_.c
+Function:
+Comment:
+----------------------------------------------------------------------*/
+
+#define DRD64_SRC_LIBEDITTEXT_LINEEDIT
+#include"drd64_libedittext.h"
+
+
+/*----------------------------------------------------------------------
+DeleteChar
+BackSpace (used by DeleteChar)
+----------------------------------------------------------------------*/
+
+
+/*----------------------------------------------------------------------
+----------------------------------------------------------------------*/
+LIBEDITTEXT_LINEEDIT_EXTERN
+int
+ LibEditText_LineEdit_InsertString(
+ LibEditText_TextInfo *p_tinfo,
+ LibEditText_LineInfo *p_line,
+ DWord dw_pos,
+ Byte *pb_src,
+ DWord dw_srclen )
+{
+ int i_result;
+ Byte *pb_pos;
+ DWord dw_length;
+
+ assert( NULL != p_tinfo );
+ assert( NULL != p_line );
+
+ /* Check Line Remain-Length & Swap line-buffer ---*/
+ if( p_line->dw_strlen + dw_srclen > p_line->dw_linelen ) {
+
+ }
+
+ if( p_line->dw_strlen < dw_pos )
+ { dw_pos = p_line->dw_strlen; }
+
+ pb_pos = p_tinfo->pb_text + dw_pos;
+ assert( NULL != pb_pos );
+
+ if( p_line->dw_strlen > dw_pos ) {
+ dw_length = p_line->dw_strlen - dw_pos;
+ memmove( pb_pos + dw_srclen, pb_pos, dw_length );
+ }
+
+ memcpy( pb_pos, pb_src, dw_srclen );
+ p_line->dw_strlen += dw_srclen;
+
+ return 0x00;
+}
+
+
+/*----------------------------------------------------------------------
+----------------------------------------------------------------------*/
+LIBEDITTEXT_API_LINEEDIT
+int
+ LibEditText_InsertChar(
+ int i_tinfoid,
+ DWord dw_line,
+ DWord dw_pos,
+ Byte b_char )
+{
+ int i_result;
+ LibEditText_TextInfo *p_tinfo;
+ LibEditText_LineInfo *p_line;
+
+ if( 0 > i_tinfoid ) { return -0x01; }
+ p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
+ if( NULL == p_tinfo ) { return -0x02; }
+
+ /* Check Line in TextBuffer range ---*/
+ if( p_tinfo->dw_maxline <= dw_line )
+ { return -0x03; }
+
+ p_line = LINFO(p_tinfo, dw_line);
+ if( NULL == p_line ) { return -0x03; }
+
+ i_result = LibEditText_LineEdit_InsertString( p_tinfo, p_line, dw_pos, &b_char, 1 );
+
+ return i_result;
+}
+
+
+/* EOF of drd64_.c ----------------------------------- */
--- /dev/null
+/*DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64
+
+ D r . D e a m o n 6 4
+ for INTEL64(R), AMD64(R)
+
+ Copyright(C) 2007-2009 Koine Yuusuke(koinec). All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Koine Yuusuke(koinec) OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
+
+/* File Info -----------------------------------------------------------
+File: drd64_.h
+Function: Header
+Comment:
+----------------------------------------------------------------------*/
+
+#ifndef DRD64_HEADER_LIBEDITTEXT_LINEEDIT
+#define DRD64_HEADER_LIBEDITTEXT_LINEEDIT
+
+#ifdef DRD64_SRC_LIBEDITTEXT_LINEEDIT
+ #define LIBEDITTEXT_LINEEDIT_EXTERN
+#else
+ #define LIBEDITTEXT_LINEEDIT_EXTERN extern
+#endif
+
+#if defined DRD64_SRC_LIBEDITTEXT_LINEEDIT
+ #define LIBEDITTEXT_LINEEDIT_INTERNALFUNC
+#elif defined DRD64_SRC_TEST_LIBEDITTEXT_LINEEDIT
+ #define LIBEDITTEXT_LINEEDIT_INTERNALFUNC
+#endif
+
+LIBEDITTEXT_LINEEDIT_EXTERN
+ int LibEditText_LineEdit_InsertString(
+ LibEditText_TextInfo *p_tinfo,
+ LibEditText_LineInfo *p_line,
+ DWord dw_pos, Byte *pb_src, DWord dw_srclen );
+
+
+#ifdef LIBEDITTEXT_LINEEDIT_INTERNALFUNC
+#endif
+
+#endif /* DRD64_HEADER_XXX */
+
+/* EOF of drd64_.h ----------------------------------- */