HiTECNOLOGYs / cl-charms

More up-to-date version of cl-charms. Forked it because it was, apparently, abandoned by author and I couldn't contact him.
https://gitorious.org/cl-charms
Other
158 stars 29 forks source link

Fix bindings for functions taking pointer to chtype. #50

Closed knusbaum closed 5 years ago

knusbaum commented 6 years ago

I noticed while digging in the library that some functions that are supposed to take a chtype * are parameterized with chtype and, in some cases, chr-ptr

This should fix that, And I've had success testing functions that previously failed, for example, CHARMS/LL:MVWADDCHSTR

(defun write-stringch-at-point (window string x y)
  (check-status
   (let ((octets (babel:string-to-octets string)))
     (cffi:with-foreign-object (arr 'charms/ll::chtype (length octets))
       (loop for octet across octets
             for i from 0
             do (setf (cffi:mem-aref arr 'charms/ll::chtype i) octet))
       (charms/ll:mvwaddchstr (window-pointer (resolve-window window)) y x arr))))
  t)

Some C function declarations: http://invisible-island.net/ncurses/man/curs_addchstr.3x.html

knusbaum commented 5 years ago

@tarballs-are-good This has been open for quite a while. I would love it if you would take a look. If you don't think this is valuable, I can close this PR.

stylewarning commented 5 years ago

I’ll take a look tomorrow morning PST!

knusbaum commented 5 years ago

Thanks!

stylewarning commented 5 years ago

Awesome, thanks!