[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C-string to KCL-string



Hi,
maybe this is an old question but I am new to the mailing list.

I am running A/KCL and I want to transfer a string from C to A/KCL. At the
I solve the problem the following way:

(defCfun "..." 1
% char buffer[1024];
% char c, *p;
% strcpy(buffer, "teststring")
% while ((c = *p) != '\0')
% {
    ((cons (char c) "vs[0]") "vs[0]")
%   p++;
% }
  ((reverse "vs[0]") "vs[0]")
% Creturn(vs[0]);
)

The result of this function is then transfered to a string in Lisp. It's not
very nice and I want to know if there is an easier direct way to achieve my
goal.

  Thanks a lot
    Manfred

------------------------------------------------------------------
|NET: delta@cs.uni-sb.de
|----------------------------------------------------------------|
|POST: Manfred Weichel           	                         |
|      FB 10 - Informatik IV		                         |
|      Universitaet des Saarlandes	                         |
|      Im Stadtwald 15			                         |
|    D-6600 Saarbruecken 11		                         |
|      Federal Republic of Germany	                         |
------------------------------------------------------------------