001    /*******************************************************************************
002     * Copyright (C) 2009-2011 FuseSource Corp.
003     * Copyright (c) 2004, 2008 IBM Corporation and others.
004     * 
005     * All rights reserved. This program and the accompanying materials
006     * are made available under the terms of the Eclipse Public License v1.0
007     * which accompanies this distribution, and is available at
008     * http://www.eclipse.org/legal/epl-v10.html
009     *******************************************************************************/
010    package org.fusesource.hawtjni.runtime;
011    
012    /**
013     * 
014     * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
015     */
016    public enum ArgFlag {
017        
018        /**
019         * Indicate that a native method parameter is an out only variable. 
020         * This only makes sense if the parameter is a structure or an array 
021         * of primitives. It is an optimization to avoid copying the java 
022         * memory to C memory on the way in. 
023         */
024        NO_IN,
025        
026        /**
027         * Indicate that a native method parameter is an in only variable. 
028         * This only makes sense if the parameter is a structure or an array 
029         * of primitives. It is an optimization to avoid copying the C memory 
030         * from java memory on the way out.
031         */
032        NO_OUT,
033        
034        /**
035         * Indicate that GetPrimitiveArrayCritical() should be used instead 
036         * of Get<PrimitiveType>ArrayElements() when transferring array of 
037         * primitives from/to C. This is an optimization to avoid copying 
038         * memory and must be used carefully. It is ok to be used in
039         * MoveMemory() and memmove() natives. 
040         */
041        CRITICAL,
042        
043        /**
044         * Indicate that the associated C local variable for a native method 
045         * parameter should be initialized with zeros. 
046         */
047        INIT,
048        
049        /**
050         * Indicate that the parameter is a pointer.
051         */
052        POINTER_ARG,
053    
054        /**
055         * Indicate that a structure parameter should be passed by value 
056         * instead of by reference. This dereferences the parameter by 
057         * prepending *. The parameter must not be NULL.
058         */
059        BY_VALUE,
060        
061        /**
062         * Indicate that GetStringChars()should be used instead of 
063         * GetStringUTFChars() to get the characters of a java.lang.String 
064         * passed as a parameter to native methods.
065         */
066        UNICODE,
067        
068        /**
069         * Indicate that the parameter of a native method is the sentinel 
070         * (last parameter of a variable argument C function). The generated 
071         * code is always the literal NULL. Some compilers expect the sentinel 
072         * to be the literal NULL and output a warning if otherwise.
073         */
074        SENTINEL,
075            
076        /**
077         * Indicate that the native parameter is a C# managed object.
078         */
079        CS_OBJECT,
080    
081    }