1 /*
2  * The contents of this file is dual-licensed under 2
3  * alternative Open Source/Free licenses: LGPL 2.1 or later and
4  * Apache License 2.0. (starting with JNA version 4.0.0).
5  *
6  * You can freely decide which license you want to apply to
7  * the project.
8  *
9  * You may obtain a copy of the LGPL License at:
10  *
11  * http://www.gnu.org/licenses/licenses.html
12  *
13  * A copy is also included in the downloadable source code package
14  * containing JNA, in file "LGPL2.1".
15  *
16  * You may obtain a copy of the Apache License at:
17  *
18  * http://www.apache.org/licenses/
19  *
20  * A copy is also included in the downloadable source code package
21  * containing JNA, in file "AL2.0".
22  */
23 package com.sun.jna.win32;
24 
25 import java.util.Collections;
26 import java.util.HashMap;
27 import java.util.Map;
28 
29 public interface W32APIOptions extends StdCallLibrary {
30     /** Standard options to use the unicode version of a w32 API. */
31     Map<String, Object> UNICODE_OPTIONS = Collections.unmodifiableMap(new HashMap<String, Object>() {
32         private static final long serialVersionUID = 1L;    // we're not serializing it
33 
34         {
35             put(OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
36             put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);
37         }
38     });
39 
40     /** Standard options to use the ASCII/MBCS version of a w32 API. */
41     Map<String, Object> ASCII_OPTIONS = Collections.unmodifiableMap(new HashMap<String, Object>() {
42         private static final long serialVersionUID = 1L;    // we're not serializing it
43         {
44             put(OPTION_TYPE_MAPPER, W32APITypeMapper.ASCII);
45             put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.ASCII);
46         }
47     });
48 
49     /** Default options to use - depends on the value of {@code w32.ascii} system property */
50     Map<String, Object> DEFAULT_OPTIONS = Boolean.getBoolean("w32.ascii") ? ASCII_OPTIONS : UNICODE_OPTIONS;
51 }
52