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]

Constant strings in guile-gtk...


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 hacked:

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

But that seems not a good thing... I use 'sgtk_string_conversion'
for I did not found what "conversion" is suppose to do.
Also, I am only getting parse error when declaring something as 
'cstring' like:

(define-func e_cell_text_new
  ECell
  ((cstring fontname)
   (GtkJustification justify)))


ariel




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