github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/include/capi/cef_command_line_capi.h (about) 1 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 // 3 // Redistribution and use in source and binary forms, with or without 4 // modification, are permitted provided that the following conditions are 5 // met: 6 // 7 // * Redistributions of source code must retain the above copyright 8 // notice, this list of conditions and the following disclaimer. 9 // * Redistributions in binary form must reproduce the above 10 // copyright notice, this list of conditions and the following disclaimer 11 // in the documentation and/or other materials provided with the 12 // distribution. 13 // * Neither the name of Google Inc. nor the name Chromium Embedded 14 // Framework nor the names of its contributors may be used to endorse 15 // or promote products derived from this software without specific prior 16 // written permission. 17 // 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 // 30 // --------------------------------------------------------------------------- 31 // 32 // This file was generated by the CEF translator tool and should not edited 33 // by hand. See the translator.README.txt file in the tools directory for 34 // more information. 35 // 36 37 #ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ 38 #define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ 39 #pragma once 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 #include "include/capi/cef_base_capi.h" 46 47 48 /// 49 // Structure used to create and/or parse command line arguments. Arguments with 50 // '--', '-' and, on Windows, '/' prefixes are considered switches. Switches 51 // will always precede any arguments without switch prefixes. Switches can 52 // optionally have a value specified using the '=' delimiter (e.g. 53 // "-switch=value"). An argument of "--" will terminate switch parsing with all 54 // subsequent tokens, regardless of prefix, being interpreted as non-switch 55 // arguments. Switch names are considered case-insensitive. This structure can 56 // be used before cef_initialize() is called. 57 /// 58 typedef struct _cef_command_line_t { 59 /// 60 // Base structure. 61 /// 62 cef_base_t base; 63 64 /// 65 // Returns true (1) if this object is valid. Do not call any other functions 66 // if this function returns false (0). 67 /// 68 int (CEF_CALLBACK *is_valid)(struct _cef_command_line_t* self); 69 70 /// 71 // Returns true (1) if the values of this object are read-only. Some APIs may 72 // expose read-only objects. 73 /// 74 int (CEF_CALLBACK *is_read_only)(struct _cef_command_line_t* self); 75 76 /// 77 // Returns a writable copy of this object. 78 /// 79 struct _cef_command_line_t* (CEF_CALLBACK *copy)( 80 struct _cef_command_line_t* self); 81 82 /// 83 // Initialize the command line with the specified |argc| and |argv| values. 84 // The first argument must be the name of the program. This function is only 85 // supported on non-Windows platforms. 86 /// 87 void (CEF_CALLBACK *init_from_argv)(struct _cef_command_line_t* self, 88 int argc, const char* const* argv); 89 90 /// 91 // Initialize the command line with the string returned by calling 92 // GetCommandLineW(). This function is only supported on Windows. 93 /// 94 void (CEF_CALLBACK *init_from_string)(struct _cef_command_line_t* self, 95 const cef_string_t* command_line); 96 97 /// 98 // Reset the command-line switches and arguments but leave the program 99 // component unchanged. 100 /// 101 void (CEF_CALLBACK *reset)(struct _cef_command_line_t* self); 102 103 /// 104 // Retrieve the original command line string as a vector of strings. The argv 105 // array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* } 106 /// 107 void (CEF_CALLBACK *get_argv)(struct _cef_command_line_t* self, 108 cef_string_list_t argv); 109 110 /// 111 // Constructs and returns the represented command line string. Use this 112 // function cautiously because quoting behavior is unclear. 113 /// 114 // The resulting string must be freed by calling cef_string_userfree_free(). 115 cef_string_userfree_t (CEF_CALLBACK *get_command_line_string)( 116 struct _cef_command_line_t* self); 117 118 /// 119 // Get the program part of the command line string (the first item). 120 /// 121 // The resulting string must be freed by calling cef_string_userfree_free(). 122 cef_string_userfree_t (CEF_CALLBACK *get_program)( 123 struct _cef_command_line_t* self); 124 125 /// 126 // Set the program part of the command line string (the first item). 127 /// 128 void (CEF_CALLBACK *set_program)(struct _cef_command_line_t* self, 129 const cef_string_t* program); 130 131 /// 132 // Returns true (1) if the command line has switches. 133 /// 134 int (CEF_CALLBACK *has_switches)(struct _cef_command_line_t* self); 135 136 /// 137 // Returns true (1) if the command line contains the given switch. 138 /// 139 int (CEF_CALLBACK *has_switch)(struct _cef_command_line_t* self, 140 const cef_string_t* name); 141 142 /// 143 // Returns the value associated with the given switch. If the switch has no 144 // value or isn't present this function returns the NULL string. 145 /// 146 // The resulting string must be freed by calling cef_string_userfree_free(). 147 cef_string_userfree_t (CEF_CALLBACK *get_switch_value)( 148 struct _cef_command_line_t* self, const cef_string_t* name); 149 150 /// 151 // Returns the map of switch names and values. If a switch has no value an 152 // NULL string is returned. 153 /// 154 void (CEF_CALLBACK *get_switches)(struct _cef_command_line_t* self, 155 cef_string_map_t switches); 156 157 /// 158 // Add a switch to the end of the command line. If the switch has no value 159 // pass an NULL value string. 160 /// 161 void (CEF_CALLBACK *append_switch)(struct _cef_command_line_t* self, 162 const cef_string_t* name); 163 164 /// 165 // Add a switch with the specified value to the end of the command line. 166 /// 167 void (CEF_CALLBACK *append_switch_with_value)( 168 struct _cef_command_line_t* self, const cef_string_t* name, 169 const cef_string_t* value); 170 171 /// 172 // True if there are remaining command line arguments. 173 /// 174 int (CEF_CALLBACK *has_arguments)(struct _cef_command_line_t* self); 175 176 /// 177 // Get the remaining command line arguments. 178 /// 179 void (CEF_CALLBACK *get_arguments)(struct _cef_command_line_t* self, 180 cef_string_list_t arguments); 181 182 /// 183 // Add an argument to the end of the command line. 184 /// 185 void (CEF_CALLBACK *append_argument)(struct _cef_command_line_t* self, 186 const cef_string_t* argument); 187 188 /// 189 // Insert a command before the current command. Common for debuggers, like 190 // "valgrind" or "gdb --args". 191 /// 192 void (CEF_CALLBACK *prepend_wrapper)(struct _cef_command_line_t* self, 193 const cef_string_t* wrapper); 194 } cef_command_line_t; 195 196 197 /// 198 // Create a new cef_command_line_t instance. 199 /// 200 CEF_EXPORT cef_command_line_t* cef_command_line_create(); 201 202 /// 203 // Returns the singleton global cef_command_line_t object. The returned object 204 // will be read-only. 205 /// 206 CEF_EXPORT cef_command_line_t* cef_command_line_get_global(); 207 208 209 #ifdef __cplusplus 210 } 211 #endif 212 213 #endif // CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_