Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.pionier.net.pl!news.supermedia.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail From: "Borneq" Newsgroups: comp.lang.java.programmer Subject: Re: JNI and GetFieldID Date: Fri, 6 Sep 2013 23:06:09 +0200 Organization: ATMAN - ATM S.A. Lines: 41 Message-ID: References: <8bnpfa-417.ln1@s.simpson148.btinternet.com> NNTP-Posting-Host: 91.239.205.62 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=response Content-Transfer-Encoding: 8bit X-Trace: node1.news.atman.pl 1378501570 21870 91.239.205.62 (6 Sep 2013 21:06:10 GMT) X-Complaints-To: usenet@atman.pl NNTP-Posting-Date: Fri, 6 Sep 2013 21:06:10 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: csiph.com comp.lang.java.programmer:25237 Użytkownik "Steven Simpson" napisał w wiadomości news:8bnpfa-417.ln1@s.simpson148.btinternet.com... > Never learned to do that - looks too error-prone. Instead of mucking > around in JNI, creating objects, accessing fields, etc, I prefer to do as > much as I can in Java, then declare the native methods as taking the > already dismantled fields as separate arguments. But this is difficult, because I want to write JNI wrapper to UnACE - library for expanding .ace archives. There are callbacks like INT (__stdcall *StateCallbackProc) (pACEStateCallbackProcStruc State); where typedef union sACEStateCallbackProcStruc *pACEStateCallbackProcStruc; typedef union sACEStateCallbackProcStruc { ULONG StructureType; // indicates which of the fol- // lowing structures is used tACECallbackArchiveStruc Archive; tACECallbackArchivedFileStruc ArchivedFile; tACECallbackRealFileStruc RealFile; tACECallbackProgressStruc Progress; tACECallbackCRCCheckStruc CRCCheck; } tACEStateCallbackProcStruc; where for example: typedef struct sACECallbackArchiveStruc { ULONG StructureType; // is ACE_CALLBACK_TYPE_ARCHIVE ULONG Code; // see definition of // ACE_CALLBACK_TYPE_ARCHIVE ULONG Operation; // ACE_CALLBACK_OPERATION constant pACEGlobalDataStruc GlobalData; // see tACEGlobalDataStruc pACEArchiveDataStruc ArchiveData; // see tACEArchiveDataStruc } tACECallbackArchiveStruc, *pACECallbackArchiveStruc; There are structures reference inside other structures