>> I have a proposal. >> Let's say I have function print_utf8() which accepts const char * >> parameter in utf8 encoding, and I want to do Harbour wrapper >> function for this C function. >> 1) current code >> HB_FUNC( PRINT ) >> { >> const char * str; >> void * h; >> h = hb_parstr_utf8( 1, &str, NULL ); >> hb_retnl( printf_utf8( str ) ); >> hb_strfree( h ); >> } >> 2) if we change hb_parstr_ut8() to return string, and handler to be >> returned via parameter reference. >> HB_FUNC( PRINT ) >> { >> void * h; >> hb_retnl( printf_utf8( hb_parstr_utf8( 1, &h, NULL ) ) ); >> hb_strfree( h ); >> } >> The same proposal for hb_itemGetStr*(). > > These are new functions and we should choose optimal interface for them > so if such form is more flexible for users then why not. We should only > keep similar syntax in all corresponding functions to not confuse users. > Other opinions?
I like this new calling convention. Allows for more compact/smooth caller code. Brgds, Viktor _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour