Lines Matching refs:ascii_src

120 #define offset(field) XtOffsetOf(AsciiSrcRec, ascii_src.field)
251 /* ascii_src */
311 src->ascii_src.type = XawAsciiFile;
312 src->ascii_src.string = src->ascii_src.filename;
318 src->ascii_src.use_string_in_place = True;
319 src->ascii_src.type = XawAsciiString;
324 src->ascii_src.changes = False;
328 src->ascii_src.allocated_string = False;
330 if (src->ascii_src.use_string_in_place && src->ascii_src.string == NULL)
331 src->ascii_src.use_string_in_place = False;
333 file = InitStringOrFile(src, src->ascii_src.type == XawAsciiFile);
368 end = XawMin(end, src->ascii_src.length);
555 if (src->ascii_src.use_string_in_place
556 && src->ascii_src.length - (endPos - startPos)
557 < src->ascii_src.piece_size - 1)
558 start_piece->text[src->ascii_src.length - (endPos - startPos)] =
563 src->ascii_src.length += -(endPos - startPos) + text->length;
578 if (src->ascii_src.use_string_in_place) {
579 if (start_piece->used == src->ascii_src.piece_size - 1) {
584 start_piece->used = src->ascii_src.length =
585 src->ascii_src.piece_size - 1;
586 start_piece->text[src->ascii_src.length] = '\0';
591 if (start_piece->used == src->ascii_src.piece_size) {
596 fill = Min((int)(src->ascii_src.piece_size - start_piece->used),
611 if (src->ascii_src.use_string_in_place)
615 src->ascii_src.changes = True;
662 else if (position >= src->ascii_src.length)
663 return (src->ascii_src.length);
686 return (src->ascii_src.length);
731 return (position < src->ascii_src.length ?
732 position : src->ascii_src.length);
734 return (src->ascii_src.length);
988 if (old_src->ascii_src.use_string_in_place
989 != src->ascii_src.use_string_in_place) {
993 src->ascii_src.use_string_in_place =
994 old_src->ascii_src.use_string_in_place;
1003 if (string_set || (old_src->ascii_src.type != src->ascii_src.type)) {
1021 if (old_src->ascii_src.ascii_length != src->ascii_src.ascii_length)
1022 src->ascii_src.piece_size = src->ascii_src.ascii_length + 1;
1025 old_src->ascii_src.piece_size != src->ascii_src.piece_size) {
1055 if (src->ascii_src.type == XawAsciiString) {
1058 if (src->ascii_src.use_string_in_place)
1059 *((char **)args[i].value) = src->ascii_src.first_piece->text;
1061 *((char **)args[i].value) = src->ascii_src.string;
1114 if (src->ascii_src.allocated_string && src->ascii_src.type != XawAsciiFile) {
1115 src->ascii_src.allocated_string = False;
1116 XtFree(src->ascii_src.string);
1117 src->ascii_src.string = NULL;
1152 if (src->ascii_src.use_string_in_place)
1155 if (src->ascii_src.type == XawAsciiFile) {
1157 if (!src->ascii_src.changes)
1163 if (WritePiecesToFile(src, src->ascii_src.string) == False)
1167 if (src->ascii_src.allocated_string == True)
1168 XtFree(src->ascii_src.string);
1170 src->ascii_src.allocated_string = True;
1172 src->ascii_src.string = StorePiecesInString(src);
1175 src->ascii_src.changes = False;
1214 if (src->ascii_src.type == XawAsciiFile)
1219 ret = WriteToFile(string, (String)name, (unsigned)src->ascii_src.length);
1247 return (((AsciiSrcObject)w)->ascii_src.changes);
1268 if (checkString && src->ascii_src.allocated_string) {
1269 XtFree(src->ascii_src.string);
1270 src->ascii_src.allocated_string = False;
1271 src->ascii_src.string = NULL;
1330 if (src->ascii_src.data_compression) {
1331 piece = src->ascii_src.first_piece;
1333 int bytes = (int)(src->ascii_src.piece_size - piece->used);
1353 for (piece = src->ascii_src.first_piece; piece; piece = piece->next)
1382 string = XtMalloc((unsigned)(src->ascii_src.length + 1));
1384 for (first = 0, piece = src->ascii_src.first_piece ; piece != NULL;
1388 string[src->ascii_src.length] = '\0';
1393 if (src->ascii_src.data_compression) {
1417 if (src->ascii_src.type == XawAsciiString) {
1418 if (src->ascii_src.string == NULL)
1419 src->ascii_src.length = 0;
1421 else if (!src->ascii_src.use_string_in_place) {
1422 src->ascii_src.string = XtNewString(src->ascii_src.string);
1423 src->ascii_src.allocated_string = True;
1424 src->ascii_src.length = (XawTextPosition)strlen(src->ascii_src.string);
1427 if (src->ascii_src.use_string_in_place) {
1428 if (src->ascii_src.string != NULL)
1429 src->ascii_src.length = (XawTextPosition)strlen(src->ascii_src.string);
1431 if (src->ascii_src.length > src->ascii_src.ascii_length)
1432 src->ascii_src.ascii_length = (int)src->ascii_src.length;
1434 if (src->ascii_src.ascii_length == MAGIC_VALUE)
1435 src->ascii_src.piece_size = src->ascii_src.length;
1437 src->ascii_src.piece_size = src->ascii_src.ascii_length + 1;
1446 src->ascii_src.is_tempfile = False;
1450 if (src->ascii_src.string == NULL)
1459 if (src->ascii_src.string == NULL) {
1460 src->ascii_src.string = (char*)"*ascii-src*";
1461 src->ascii_src.is_tempfile = True;
1482 if (newString || src->ascii_src.is_tempfile) {
1483 src->ascii_src.string = XtNewString(src->ascii_src.string);
1484 src->ascii_src.allocated_string = True;
1487 if (!src->ascii_src.is_tempfile) {
1488 int fd = open(src->ascii_src.string, (int)open_mode, 0666);
1495 src->ascii_src.length = (XawTextPosition)ftell(file);
1505 params[0] = src->ascii_src.string;
1512 src->ascii_src.length = 0;
1524 if (src->ascii_src.type == XawAsciiFile) {
1525 if (src->ascii_src.length != 0) {
1528 while (left < src->ascii_src.length) {
1531 ptr = XtMalloc((unsigned)src->ascii_src.piece_size);
1533 (size_t)src->ascii_src.piece_size, file)) < 0)
1538 piece->used = XawMin(len, src->ascii_src.piece_size);
1544 piece->text = XtMalloc((unsigned)src->ascii_src.piece_size);
1550 string = src->ascii_src.string;
1553 if (src->ascii_src.use_string_in_place) {
1555 piece->used = XawMin(src->ascii_src.length, src->ascii_src.piece_size);
1556 piece->text = src->ascii_src.string;
1561 left = src->ascii_src.length;
1565 piece->text = XtMalloc((unsigned)src->ascii_src.piece_size);
1566 piece->used = XawMin(left, src->ascii_src.piece_size);
1595 src->ascii_src.first_piece = piece;
1623 Piece *next, * first = src->ascii_src.first_piece;
1650 src->ascii_src.first_piece = piece->next;
1657 if (!src->ascii_src.use_string_in_place)
1684 for (old_piece = NULL, piece = src->ascii_src.first_piece, temp = 0;
1707 #define HALF_PIECE (src->ascii_src.piece_size >> 1)
1713 cnew->text = XtMalloc((unsigned)src->ascii_src.piece_size);
1715 (unsigned)(src->ascii_src.piece_size - HALF_PIECE));
1717 cnew->used = src->ascii_src.piece_size - HALF_PIECE;
1851 src->ascii_src.piece_size = lastPos;