comparison src/epoch.c @ 14:9ee227acff29 r19-15b90

Import from CVS: tag r19-15b90
author cvs
date Mon, 13 Aug 2007 08:48:42 +0200
parents 376386a54a3c
children 859a2309aef8
comparison
equal deleted inserted replaced
13:13c6d0aaafe5 14:9ee227acff29
102 atom_symbol = x_atom_to_symbol (XDEVICE (device), 102 atom_symbol = x_atom_to_symbol (XDEVICE (device),
103 XX_RESOURCE (obj)->type); 103 XX_RESOURCE (obj)->type);
104 sprintf (buf, "#<x-resource %s on ", 104 sprintf (buf, "#<x-resource %s on ",
105 (NILP (atom_symbol) 105 (NILP (atom_symbol)
106 ? default_string 106 ? default_string
107 : string_data (XSTRING (Fsymbol_name (atom_symbol))))); 107 : XSTRING_DATA (Fsymbol_name (atom_symbol))));
108 write_c_string (buf, printcharfun); 108 write_c_string (buf, printcharfun);
109 print_internal (device, printcharfun, escapeflag); 109 print_internal (device, printcharfun, escapeflag);
110 sprintf (buf, " 0x%x>",(unsigned int) XX_RESOURCE (obj)->xid); 110 sprintf (buf, " 0x%x>",(unsigned int) XX_RESOURCE (obj)->xid);
111 write_c_string (buf, printcharfun); 111 write_c_string (buf, printcharfun);
112 } 112 }
289 289
290 if (XX_RESOURCE (type)->type != XA_ATOM) 290 if (XX_RESOURCE (type)->type != XA_ATOM)
291 error ("Resource must be an atom"); 291 error ("Resource must be an atom");
292 xr = XX_RESOURCE (type); 292 xr = XX_RESOURCE (type);
293 293
294 xid = (XID) strtol ((CONST char *) string_data (XSTRING (string)), &ptr, b); 294 xid = (XID) strtol ((CONST char *) XSTRING_DATA (string), &ptr, b);
295 295
296 return ((ptr == (char *) string_data (XSTRING (string))) 296 return ((ptr == (char *) XSTRING_DATA (string))
297 ? Qnil 297 ? Qnil
298 : make_x_resource (xid, xr->xid, xr->device)); 298 : make_x_resource (xid, xr->xid, xr->device));
299 } 299 }
300 300
301 /* 301 /*
584 584
585 case Lisp_String: 585 case Lisp_String:
586 *format = BYTESIZE * sizeof (char); 586 *format = BYTESIZE * sizeof (char);
587 *type = XA_STRING; 587 *type = XA_STRING;
588 for ( i=0, size=0 ; i < length ; ++i ) 588 for ( i=0, size=0 ; i < length ; ++i )
589 size += (string_length (XSTRING (v->contents[i])) + 589 size += (XSTRING_LENGTH (v->contents[i]) +
590 1); /* include null */ 590 1); /* include null */
591 addr = (void *) xmalloc (size); 591 addr = (void *) xmalloc (size);
592 *count = size; 592 *count = size;
593 for ( i = 0 , size = 0 ; i < length ; ++i ) 593 for ( i = 0 , size = 0 ; i < length ; ++i )
594 { 594 {
595 tsize = string_length (XSTRING (v->contents[i])) + 1; 595 tsize = XSTRING_LENGTH (v->contents[i]) + 1;
596 memmove (((char *) addr), string_data (XSTRING (v->contents[i])), 596 memmove (((char *) addr), XSTRING_DATA (v->contents[i]),
597 tsize); 597 tsize);
598 size += tsize; 598 size += tsize;
599 } 599 }
600 break; 600 break;
601 601
654 654
655 case Lisp_String: 655 case Lisp_String:
656 *format = BYTESIZE * sizeof (char); 656 *format = BYTESIZE * sizeof (char);
657 *type = XA_STRING; 657 *type = XA_STRING;
658 for ( i=0, size=0 , tlist=list ; i < length ; ++i, tlist = Fcdr (tlist) ) 658 for ( i=0, size=0 , tlist=list ; i < length ; ++i, tlist = Fcdr (tlist) )
659 size += string_length (XSTRING (Fcar (tlist))) + 1; /* include null */ 659 size += XSTRING_LENGTH (Fcar (tlist)) + 1; /* include null */
660 addr = (void *) xmalloc (size); 660 addr = (void *) xmalloc (size);
661 *count = size; 661 *count = size;
662 for ( i=0, size=0, tlist=list ; i < length ; 662 for ( i=0, size=0, tlist=list ; i < length ;
663 ++i , tlist = Fcdr (tlist) ) 663 ++i , tlist = Fcdr (tlist) )
664 { 664 {
665 temp = Fcar (tlist); 665 temp = Fcar (tlist);
666 tsize = string_length (XSTRING (temp)) + 1; 666 tsize = XSTRING_LENGTH (temp) + 1;
667 memmove (((char *) addr), string_data (XSTRING (temp)), tsize); 667 memmove (((char *) addr), XSTRING_DATA (temp), tsize);
668 size += tsize; 668 size += tsize;
669 } 669 }
670 break; 670 break;
671 671
672 default: 672 default:
690 switch (XTYPE (value)) 690 switch (XTYPE (value))
691 { 691 {
692 case Lisp_String: 692 case Lisp_String:
693 *format = BYTESIZE; 693 *format = BYTESIZE;
694 *type = XA_STRING; 694 *type = XA_STRING;
695 *count = strlen ((CONST char *) string_data (XSTRING (value))) + 1; 695 *count = strlen ((CONST char *) XSTRING_DATA (value)) + 1;
696 *addr = (void *) string_data (XSTRING (value)); 696 *addr = (void *) XSTRING_DATA (value);
697 break; 697 break;
698 698
699 case Lisp_Int: 699 case Lisp_Int:
700 *type = XA_INTEGER; 700 *type = XA_INTEGER;
701 *count = 1; 701 *count = 1;