i've forwarded this to the appropriate lists.
----- Original Message -----
From: "Dunford, Clifton 'Cliff'"
<Dunford_C(a)students.lynchburg.edu>
To: <ben(a)666.com>
Sent: Saturday, December 06, 2003 1:43 PM
Subject: Using C, C++, Lisp together
Sorry to bother you, but I was hoping you could help me find the
anwers to a
few quesitons.
My first queston:
I would like to popup-menu at the current cursor location(point). How do I
do that? Right now it popups at the mouse location in X, and In windows the
top left corner of the screen.
Other questions...
I have some c++ code that I'm using in my feature, I need the info it gets
to be put into the menu I created at the cursor location. So I'm not sure if
I'll be calling C from lisp, or lisp from C. I thought maybe I could write a
C callable code in C++, which will call the C++ function(s).
A lisp primitive that would call the C code (the wrapper for the C++ code),
the load lisp menu with the names I need in it. Is there and eaiser way?
Will this work?
//.c file
DEFUN("generate-menu", Fgenerate_menu, 1, UNEVALLED, 1, /*
Calls a C function parse_menu_wrapper to get the cliffpletions and placed
them
in the cliffpletion menu
*/
(name))
{
return parse_menu_wrapper(name);
}
//not sure what return types I will need, it takes a string and will return
1 or more strings
something like
.cpp
extern "C" something parse_menu_wrapper(const* str)
{
return parse_menu(str); //C++ functions
}
//C++
something parse_menu(string str)
{
//read the string
//read the parse.dat file and find the string
//write the parse_menu.dat file //data for the menu
}
Should I be passing some type of stream, I think emacs lisp uses a lstream,
but not sure how it is used.
Summary: C++ data stuctures have the names(strings) of what I need, they
need to be passed to the menus I created at cursor position when needed.