#define DRD64_SRC_LIBEDITTEXT_LINECTRL
#include"drd64_libedittext.h"
+#define DRD64_SRC_LIBEDITTEXT_LINECTRL_SRCID 0x04
+#define LOCATION(n) DRD64_ERR_LOCATION( \
+ DRD64_ERROR_MODULE_LIBEDITTEXT, DRD64_ERROR_ARCH_NODEPEND, \
+ DRD64_SRC_LIBEDITTEXT_LINECTRL_SRCID, (n))
+
/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
+#define FUNCID_LibEditText_LineCtrl_DeleteLine 0x01
LIBEDITTEXT_LINECTRL_EXTERN
int
LibEditText_LineCtrl_DeleteLine(
// Remove SortChain ---
i_result = LibEditText_LineInfo_RemoveSortChain( p_tinfo, p_line );
- if( 0x00 != i_result ) { return i_result; }
+ if( 0x00 != i_result ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_CALLFUNC, 0x01, 0x01 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_DeleteLine ),
+ errno, (QWord)i_result, (QWord)0x00, __LINE__ );
+
+ return i_result;
+ }
// Add EmptyChain ---
i_result = LibEditText_LineInfo_SetEmptyLineChain( p_tinfo, p_line );
- if( 0x00 != i_result ) { return i_result; }
+ if( 0x00 != i_result ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_CALLFUNC, 0x01, 0x02 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_DeleteLine ),
+ errno, (QWord)i_result, (QWord)0x00, __LINE__ );
+
+ return i_result;
+ }
p_tinfo->dw_maxline--;
/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
+#define FUNCID_LibEditText_DeleteLine_toLine 0x02
LIBEDITTEXT_API_LINECTRL
int
LibEditText_DeleteLine_toLine(
LibEditText_TextInfo *p_tinfo;
LibEditText_LineInfo *p_line;
- if( 0 > i_tinfoid ) { return -0x01; }
+ if( 0 > i_tinfoid ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_FAILED_ARG, 0x01, 0x01 ),
+ LOCATION( FUNCID_LibEditText_DeleteLine_toLine ),
+ errno, (QWord)i_tinfoid, (QWord)dw_line, __LINE__ );
+
+ return -0x01; }
p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
- if( NULL == p_tinfo ) { return -0x02; }
+ if( NULL == p_tinfo ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_NULLPTR, 0x01, 0x02 ),
+ LOCATION( FUNCID_LibEditText_DeleteLine_toLine ),
+ errno, (QWord)i_tinfoid, (QWord)dw_line, __LINE__ );
+
+ return -0x02;
+ }
p_line = LibEditText_Section_SearchLine( p_tinfo, dw_line );
assert( NULL != p_line );
/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
+#define FUNCID_LibEditText_LineCtrl_JoinLine 0x03
LIBEDITTEXT_LINECTRL_EXTERN
int
LibEditText_LineCtrl_JoinLine(
assert( NULL != p_tinfo );
assert( NULL != p_ldest );
- if(( 1 >= p_tinfo->dw_maxline ) && ( 0 == dw_line ))
- { return 0x01; }
- if( p_tinfo->dw_line_end == p_ldest->dw_id )
- { return 0x01; }
+ if(( 1 >= p_tinfo->dw_maxline ) && ( 0 == dw_line )) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_WARNING( DRD64_ERROR_PTN_FAILED_ARG, 0x00, 0x01 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_JoinLine ),
+ errno, (QWord)p_tinfo->dw_maxline, (QWord)dw_line, __LINE__ );
+
+ return 0x01;
+ }
+ if( p_tinfo->dw_line_end == p_ldest->dw_id ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_WARNING( DRD64_ERROR_PTN_FAILED_ARG, 0x00, 0x02 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_JoinLine ),
+ errno, (QWord)p_tinfo->dw_line_end, (QWord)p_ldest->dw_id, __LINE__ );
+
+ return 0x02;
+ }
p_lsrc = LINFO(p_tinfo, p_ldest->dw_next);
assert( NULL != p_lsrc );
if((p_ldest->dw_strlen + p_lsrc->dw_strlen + 5) > p_ldest->dw_linelen ) {
i_result = LibEditText_LineInfo_ExpandLineBuffer(
p_tinfo, p_ldest, p_lsrc->dw_linelen );
- if( 0x00 != i_result ) { return -0x02; }
+ if( 0x00 != i_result ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_CALLFUNC, 0x01, 0x03 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_JoinLine ),
+ errno, (QWord)i_result, (QWord)0x00, __LINE__ );
+
+ return -0x03;
+ }
}
pb_src = p_tinfo->pb_text + p_lsrc->dw_start;
// delete line
i_result = LibEditText_LineCtrl_DeleteLine( p_tinfo, p_lsrc, dw_line + 1 );
- if( 0x00 != i_result ) { return -0x02; }
+ if( 0x00 != i_result ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_CALLFUNC, 0x01, 0x04 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_JoinLine ),
+ errno, (QWord)i_result, (QWord)0x00, __LINE__ );
+
+ return -0x04;
+ }
return 0x00;
}
/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
+#define FUNCID_LibEditText_JoinLine_toLine 0x04
LIBEDITTEXT_API_LINECTRL
int
LibEditText_JoinLine_toLine(
LibEditText_TextInfo *p_tinfo;
LibEditText_LineInfo *p_line;
- if( 0 > i_tinfoid ) { return -0x01; }
+ if( 0 > i_tinfoid ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_FAILED_ARG, 0x01, 0x01 ),
+ LOCATION( FUNCID_LibEditText_JoinLine_toLine ),
+ errno, (QWord)i_tinfoid, (QWord)0x00, __LINE__ );
+
+ return -0x01;
+ }
p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
- if( NULL == p_tinfo ) { return -0x02; }
+ if( NULL == p_tinfo ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_NULLPTR, 0x01, 0x02 ),
+ LOCATION( FUNCID_LibEditText_JoinLine_toLine ),
+ errno, (QWord)i_tinfoid, (QWord)0x00, __LINE__ );
+
+ return -0x02;
+ }
p_line = LibEditText_Section_SearchLine( p_tinfo, dw_line );
assert( NULL != p_line );
/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
+#define FUNCID_LibEditText_LineCtrl_InsertLine 0x05
LIBEDITTEXT_LINECTRL_EXTERN
int
LibEditText_LineCtrl_InsertLine(
// Get LineInfo struct
dw_buflength = dw_strlen + DRD64_LIBEDITTEXT_DEFAULT_RESERVEBUF_INLINE;
p_line = LibEditText_LineInfo_GetEmptyLineInfo( p_tinfo, dw_buflength );
- if( NULL == p_line ) { return -0x11; }
+ if( NULL == p_line ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_CALLFUNC, 0x01, 0x11 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_InsertLine ),
+ errno, (QWord)dw_buflength, (QWord)0x00, __LINE__ );
+
+ return -0x11;
+ }
p_lnext = LibEditText_Section_SearchLine( p_tinfo, dw_line );
assert( NULL != p_lnext );
// Set LineInfo to SortChain
i_result = LibEditText_LineInfo_AddSortChain( p_tinfo, p_line );
- if( 0x00 != i_result ) { return -0x12; }
+ if( 0x00 != i_result ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_CALLFUNC, 0x01, 0x12 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_InsertLine ),
+ errno, (QWord)i_result, (QWord)0x00, __LINE__ );
+
+ return -0x12;
+ }
// Set Init. TextData
p_line->dw_strlen = dw_strlen;
// Adjust LineSection
i_result = LibEditText_Section_InsertLine( p_tinfo, dw_line );
- if( 0x00 != i_result ) { return -0x13; }
+ if( 0x00 != i_result ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_CALLFUNC, 0x01, 0x13 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_InsertLine ),
+ errno, (QWord)i_result, (QWord)0x00, __LINE__ );
+
+ return -0x13;
+ }
p_tinfo->dw_maxline++;
/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
+#define FUNCID_LibEditText_InsertLine_toLine 0x06
LIBEDITTEXT_API_LINECTRL
int
LibEditText_InsertLine_toLine(
int i_result;
LibEditText_TextInfo *p_tinfo;
- if( 0 > i_tinfoid ) { return -0x01; }
+ if( NULL == pstr_text ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_FAILED_ARG, 0x01, 0x03 ),
+ LOCATION( FUNCID_LibEditText_InsertLine_toLine ),
+ errno, (QWord)0x00, (QWord)0x00, __LINE__ );
+
+ return -0x01;
+ }
+
+ if( 0 > i_tinfoid ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_FAILED_ARG, 0x01, 0x02 ),
+ LOCATION( FUNCID_LibEditText_InsertLine_toLine ),
+ errno, (QWord)i_tinfoid, (QWord)0x00, __LINE__ );
+
+ return -0x02;
+ }
p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
- if( NULL == p_tinfo ) { return -0x02; }
+ if( NULL == p_tinfo ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_FAILED_ARG, 0x01, 0x03 ),
+ LOCATION( FUNCID_LibEditText_InsertLine_toLine ),
+ errno, (QWord)i_tinfoid, (QWord)0x00, __LINE__ );
- if( NULL == pstr_text ) { return -0x03; }
+ return -0x03;
+ }
if( p_tinfo->dw_maxline < (dw_line + 1) ) {
i_result = LibEditText_LineCtrl_AppendLine(
/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
+#define FUNCID_LibEditText_LineCtrl_AppendLine 0x07
LIBEDITTEXT_LINECTRL_EXTERN
int
LibEditText_LineCtrl_AppendLine(
dw_buflength = dw_length + DRD64_LIBEDITTEXT_DEFAULT_RESERVEBUF_INLINE;
p_line = LibEditText_LineInfo_GetEmptyLineInfo( p_tinfo, dw_buflength );
- if( NULL == p_line ) { return -0x11; }
+ if( NULL == p_line ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_CALLFUNC, 0x01, 0x11 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_AppendLine ),
+ errno, (QWord)dw_buflength, (QWord)0x00, __LINE__ );
+
+ return -0x11;
+ }
/* ReSet p_before for if expand LineInfo memory in GetEmptyLineInfo() func.. */
p_before = LINFO(p_tinfo, p_tinfo->dw_line_end);
i_result = LibEditText_LineInfo_AddSortChain( p_tinfo, p_line );
if( 0x00 != i_result ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_CALLFUNC, 0x01, 0x12 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_AppendLine ),
+ errno, (QWord)i_result, (QWord)0x00, __LINE__ );
+
return -0x12;
}
/* Normal Append Mode is b_mode=0x00. */
if( 0x00 == b_mode ) {
i_result = LibEditText_Section_AddSection( p_tinfo );
- if( 0x00 > i_result ) { return i_result; }
+ if( 0x00 > i_result ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_CALLFUNC, 0x01, 0x20 ),
+ LOCATION( FUNCID_LibEditText_LineCtrl_AppendLine ),
+ errno, (QWord)i_result, (QWord)0x00, __LINE__ );
+
+ return i_result;
+ }
else if( 0x00 < i_result ) { i_result = 0x00; }
p_tinfo->dw_maxline++;
/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
+#define FUNCID_LibEditText_AppendLine 0x08
LIBEDITTEXT_API_LINECTRL
int
LibEditText_AppendLine(
int i_result;
LibEditText_TextInfo *p_tinfo;
- if( 0 > i_tinfoid ) { return -0x01; }
- p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
- if( NULL == p_tinfo ) { return -0x02; }
+ if( NULL == pstr_text ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_FAILED_ARG, 0x01, 0x01 ),
+ LOCATION( FUNCID_LibEditText_AppendLine ),
+ errno, (QWord)0x00, (QWord)0x00, __LINE__ );
- if( NULL == pstr_text ) { return -0x03; }
+ return -0x01;
+ }
+ if( 0 > i_tinfoid ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_FAILED_ARG, 0x01, 0x02 ),
+ LOCATION( FUNCID_LibEditText_AppendLine ),
+ errno, (QWord)i_tinfoid, (QWord)0x00, __LINE__ );
+
+ return -0x02;
+ }
+ p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
+ if( NULL == p_tinfo ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_NULLPTR, 0x01, 0x03 ),
+ LOCATION( FUNCID_LibEditText_AppendLine ),
+ errno, (QWord)i_tinfoid, (QWord)0x00, __LINE__ );
+
+ return -0x03;
+ }
+
i_result = LibEditText_LineCtrl_AppendLine( p_tinfo, (Byte *)pstr_text, dw_length, 0x00 );
return i_result;