This is the mail archive of the guile-gtk@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Constant strings in guile-gtk...


Ariel Rios <ariel@arcavia.com> writes:

> Hi,
> I have been wondering that guile-gtk might need
> to handle const char* since a lot of of 
> GNOME code is now declaring things like that...

I think you want to use

  (register-type 
   'cstring
   (make-type "cstring" "const char*"
	      (lambda (x)
		(@@ "(SCM_NIMP(~a) && SCM_ROSTRINGP(~a))" x x))
	      (lambda (x)
		(@@ "((~a) == SCM_BOOL_F? NULL : SCM_CHARS(~a))" x x))
	      (lambda (x copy)
		(@@ "(~a == NULL? SCM_BOOL_F : scm_take0str (~a))" x x))
	      'fit-for-list #t
	      'conversion "sgtk_string_conversion"))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]