Lines Matching refs:multi_src

87 #define offset(field) XtOffsetOf(MultiSrcRec, multi_src.field)
234 src->multi_src.changes = FALSE;
235 src->multi_src.allocated_string = FALSE;
237 file = InitStringOrFile(src, src->multi_src.type == XawAsciiFile);
366 if ( src->multi_src.use_string_in_place &&
367 ((src->multi_src.length - (endPos - startPos)) <
368 (src->multi_src.piece_size - 1)) )
369 start_piece->text[src->multi_src.length - (endPos - startPos)] = (wchar_t)0;
373 src->multi_src.length += text.length -(endPos - startPos);
374 /*((TextWidget)src->object.parent)->text.lastPos = src->multi_src.length;*/
391 if (src->multi_src.use_string_in_place) {
392 if (start_piece->used == (src->multi_src.piece_size - 1)) {
397 start_piece->used = src->multi_src.length =
398 src->multi_src.piece_size - 1;
399 /*((TextWidget)src->object.parent)->text.lastPos = src->multi_src.length;*/
402 start_piece->text[src->multi_src.length] = (wchar_t)0;
408 if (start_piece->used == src->multi_src.piece_size) {
413 fill = Min((int)(src->multi_src.piece_size - start_piece->used), length);
435 if (src->multi_src.use_string_in_place)
438 src->multi_src.changes = TRUE;
480 return(src->multi_src.length);
487 if (position > src->multi_src.length)
488 position = src->multi_src.length;
492 if (position == src->multi_src.length)
493 return(src->multi_src.length);
557 return(src->multi_src.length);
577 if (position >= src->multi_src.length)
578 return(src->multi_src.length);
720 if ( old_src->multi_src.use_string_in_place !=
721 src->multi_src.use_string_in_place ) {
724 src->multi_src.use_string_in_place =
725 old_src->multi_src.use_string_in_place;
734 if ( string_set || (old_src->multi_src.type != src->multi_src.type) ) {
739 /*if (old_src->multi_src.type == XawAsciiString)
740 LoadPieces(src, NULL, src->multi_src.string);
749 if ( old_src->multi_src.multi_length != src->multi_src.multi_length )
750 src->multi_src.piece_size = src->multi_src.multi_length;
752 if ( !total_reset && (old_src->multi_src.piece_size
753 != src->multi_src.piece_size) ) {
792 if (src->multi_src.type == XawAsciiString) {
795 if (src->multi_src.use_string_in_place) {
797 src->multi_src.first_piece->text;
801 *((char **) args[i].value) = src->multi_src.string;
847 /*if (src->multi_src.allocated_string&& src->multi_src.type != XawAsciiFile) {*/
848 /* ASSERT: src->multi_src.allocated_string -> we MUST free .string! */
849 if ( src->multi_src.allocated_string ) {
850 XtFree(src->multi_src.string);
851 src->multi_src.allocated_string = FALSE;
852 src->multi_src.string = NULL;
882 if (src->multi_src.use_string_in_place)
885 if (src->multi_src.type == XawAsciiFile) {
887 if (!src->multi_src.changes) /* No changes to save. */
893 if ( WriteToFile( mb_string, src->multi_src.string ) == FALSE ) {
898 src->multi_src.changes = FALSE;
924 if (src->multi_src.allocated_string == TRUE)
925 XtFree(src->multi_src.string);
927 src->multi_src.allocated_string = TRUE;
929 src->multi_src.string = mb_string;
931 src->multi_src.changes = FALSE;
987 if (checkString && src->multi_src.allocated_string) {
988 XtFree(src->multi_src.string);
989 src->multi_src.allocated_string = False;
990 src->multi_src.string = NULL;
1032 int char_count = src->multi_src.length;
1040 for (first = 0, piece = src->multi_src.first_piece ; piece != NULL;
1049 if ( src->multi_src.data_compression ) {
1081 if (src->multi_src.type == XawAsciiString) {
1083 if (src->multi_src.string == NULL)
1084 src->multi_src.length = 0;
1086 else if (! src->multi_src.use_string_in_place) {
1088 String temp = XtNewString(src->multi_src.string);
1089 if ( src->multi_src.allocated_string )
1090 XtFree( src->multi_src.string );
1091 src->multi_src.allocated_string = True;
1092 src->multi_src.string = temp;
1094 length = strlen(src->multi_src.string);
1097 (void) _XawTextMBToWC(d, src->multi_src.string, &length);
1098 src->multi_src.length = (XawTextPosition) length;
1100 src->multi_src.length = strlen(src->multi_src.string);
1102 if (src->multi_src.length > src->multi_src.multi_length)
1103 src->multi_src.multi_length = src->multi_src.length;
1105 if (src->multi_src.multi_length == MAGIC_VALUE)
1106 src->multi_src.piece_size = src->multi_src.length;
1108 src->multi_src.piece_size = src->multi_src.multi_length + 1;
1111 /*((TextWidget)src->object.parent)->text.lastPos = src->multi_src.length;*/
1119 src->multi_src.is_tempfile = FALSE;
1123 if (src->multi_src.string == NULL)
1131 if (src->multi_src.string == NULL) {
1133 if ( src->multi_src.allocated_string )
1134 XtFree( src->multi_src.string );
1135 src->multi_src.allocated_string = False;
1136 src->multi_src.string = fileName;
1138 (void) tmpnam(src->multi_src.string);
1139 src->multi_src.is_tempfile = TRUE;
1154 if (newString || src->multi_src.is_tempfile) {
1155 if ( src->multi_src.allocated_string )
1156 XtFree( src->multi_src.string );
1157 src->multi_src.string = XtNewString(src->multi_src.string);
1158 src->multi_src.allocated_string = TRUE;
1161 if (!src->multi_src.is_tempfile) {
1162 if ((file = fopen(src->multi_src.string, open_mode)) != 0) {
1164 src->multi_src.length = ftell (file);
1170 params[0] = src->multi_src.string;
1177 src->multi_src.length = 0;
1183 MB contents of string or the MB contents of src->multi_src.string and places
1186 CAUTION: You must have src->multi_src.length set to file length bytes
1187 when src->multi_src.type == XawAsciiFile. src->multi_src.length must be
1208 int local_length = src->multi_src.length;
1213 * src->multi_src.length is currently string's * byte count,
1217 src->multi_src.length = (XawTextPosition) local_length;
1218 } else if (src->multi_src.type != XawAsciiFile) {
1223 local_length = src->multi_src.string ?
1224 strlen( src->multi_src.string ) : 0;
1225 local_str = _XawTextMBToWC( d, (char*)src->multi_src.string, &local_length );
1227 if (src->multi_src.length != 0) {
1229 XtMalloc((unsigned)(src->multi_src.length + 1) * sizeof(unsigned char));
1231 src->multi_src.length = fread (temp_mb_holder,
1233 (Size_t)src->multi_src.length, file);
1234 if (src->multi_src.length <= 0)
1238 local_length = src->multi_src.length;
1240 src->multi_src.length = local_length;
1249 params[1] = src->multi_src.string;
1256 src->multi_src.length = sizeof err_text;
1257 local_length = src->multi_src.length;
1259 src->multi_src.length = local_length;
1263 temp_mb_holder[src->multi_src.length] = '\0';*/
1268 if (src->multi_src.use_string_in_place) {
1270 piece->used = Min(src->multi_src.length, src->multi_src.piece_size);
1271 piece->text = (wchar_t*)src->multi_src.string;
1281 piece->text = (wchar_t*)XtMalloc(src->multi_src.piece_size * bytes);
1282 piece->used = Min(left, src->multi_src.piece_size);
1310 src->multi_src.first_piece = piece;
1335 MultiPiece * next, * first = src->multi_src.first_piece;
1359 src->multi_src.first_piece = piece->next;
1366 if (!src->multi_src.use_string_in_place)
1385 MultiPiece * old_piece, * piece = src->multi_src.first_piece;
1405 #define HALF_PIECE (src->multi_src.piece_size/2)
1414 new->text = (wchar_t*)XtMalloc(src->multi_src.piece_size * sizeof(wchar_t));
1416 src->multi_src.piece_size - HALF_PIECE);
1418 new->used = src->multi_src.piece_size - HALF_PIECE;