From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101158 invoked by alias); 1 Apr 2017 20:20:03 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 100785 invoked by uid 89); 1 Apr 2017 20:20:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Hx-languages-length:687, world!, World, World! X-HELO: homiemail-a76.g.dreamhost.com Received: from sub3.mail.dreamhost.com (HELO homiemail-a76.g.dreamhost.com) (69.163.253.7) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Apr 2017 20:20:01 +0000 Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id 30E3D458081; Sat, 1 Apr 2017 13:20:01 -0700 (PDT) Received: from vereq.eip10.org (cpe-74-75-122-130.maine.res.rr.com [74.75.122.130]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: chaw@eip10.org) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPSA id 0F9F5458080; Sat, 1 Apr 2017 13:20:01 -0700 (PDT) Received: from chaw by vereq.eip10.org with local (Exim 4.84_2) (envelope-from ) id 1cuPVA-0007jo-2B; Sat, 01 Apr 2017 16:20:00 -0400 To: Vasantha Ganesh cc: kawa@sourceware.org Subject: Re: Help, writing kawa equivalent of java program From: "Sudarshan S Chawathe" Reply-To: "Sudarshan S Chawathe" In-reply-to: Your message of "Sun, 02 Apr 2017 01:30:45 +0530." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29746.1491078000.1@vereq.eip10.org> Date: Sat, 01 Apr 2017 20:20:00 -0000 Message-ID: <29747.1491078000@vereq.eip10.org> X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00012.txt.bz2 > (define-alias library com.sun.jna.Library) > (define-alias native com.sun.jna.Native) > > (define-simple-class libc (library) > interface: #t > (getpid::long)) > > (define inst::libc (native:loadLibrary "c" libc:class)) > (display (inst:getpid)) I think you need to define the interface to have a getpid method with the proper signature. Here is a small example, somewhat similar to your code, that I tried a while back and that works: (define-simple-class clib (com.sun.jna.Library) interface: #t ((puts (s ::String)) ::void #!abstract)) ((as clib (com.sun.jna.Native:loadLibrary "c" clib)):puts "Hello, World!") Regards, -chaw