unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Lisp_Object to char*
@ 2003-12-13 19:25 mr mike
  2003-12-14  5:54 ` Eli Zaretskii
  2003-12-18 22:59 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: mr mike @ 2003-12-13 19:25 UTC (permalink / raw)


Hello emacs hackers,

In the C code, how do you convert a Lisp_Object to a char* value?

I'm asking because I'm playing around with making a gtk widget
from the gtk emacs port, and I am going to pass a argument
to make-frame like this

(make-frame '((foo . "abc")))

and I need to know what the value that goes with foo.

I can get the argument with x_get_arg().  I just need the value.

mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Lisp_Object to char*
  2003-12-13 19:25 Lisp_Object to char* mr mike
@ 2003-12-14  5:54 ` Eli Zaretskii
  2003-12-18 22:59 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2003-12-14  5:54 UTC (permalink / raw)
  Cc: emacs-devel

> From: mr mike <mwingert7149@wowway.com>
> Date: Sat, 13 Dec 2003 14:25:48 -0500
> 
> In the C code, how do you convert a Lisp_Object to a char* value?
> 
> I'm asking because I'm playing around with making a gtk widget
> from the gtk emacs port, and I am going to pass a argument
> to make-frame like this
> 
> (make-frame '((foo . "abc")))
> 
> and I need to know what the value that goes with foo.
> 
> I can get the argument with x_get_arg().  I just need the value.

Is the XCDR macro what you want?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Lisp_Object to char*
  2003-12-13 19:25 Lisp_Object to char* mr mike
  2003-12-14  5:54 ` Eli Zaretskii
@ 2003-12-18 22:59 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2003-12-18 22:59 UTC (permalink / raw)
  Cc: emacs-devel

> In the C code, how do you convert a Lisp_Object to a char* value?

You can use STRINGP to check that the Lisp_Object is indeed a string and
then XSTRING will get you a Lisp_String* pointer from which you can get the
size with SSIZE and the char* content with SDATA.


        Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-12-18 22:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-13 19:25 Lisp_Object to char* mr mike
2003-12-14  5:54 ` Eli Zaretskii
2003-12-18 22:59 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).