aboutsummaryrefslogtreecommitdiff
path: root/src/tool_main.c
AgeCommit message (Collapse)Author
2020-05-14tool: support UTF-16 command line on WindowsMarcel Raad
- use `wmain` instead of `main` when `_UNICODE` is defined [0] - define `argv_item_t` as `wchar_t *` in this case - use the curl_multibyte gear to convert the command-line arguments to UTF-8 This makes it possible to pass parameters with characters outside of the current locale on Windows, which is required for some tests, e.g. the IDN tests. Out of the box, this currently only works with the Visual Studio project files, which default to Unicode, and winbuild with the `ENABLE_UNICODE` option. [0] https://devblogs.microsoft.com/oldnewthing/?p=40643 Ref: https://github.com/curl/curl/issues/3747 Closes https://github.com/curl/curl/pull/3784
2020-02-19nit: Copyright year out of dateDaniel Stenberg
Follow-up to 1fc0617dcc
2020-02-18tool_util: Improve Windows version of tvnow()Jay Satiro
- Change tool_util.c tvnow() for Windows to match more closely to timeval.c Curl_now(). - Create a win32 init function for the tool, since some initialization is required for the tvnow() changes. Prior to this change the monotonic time function used by curl in Windows was determined at build-time and not runtime. That was a problem because when curl was built targeted for compatibility with old versions of Windows (eg _WIN32_WINNT < 0x0600) it would use GetTickCount which wraps every 49.7 days that Windows has been running. This change makes curl behave similar to libcurl's tvnow function, which determines at runtime whether the OS is Vista+ and if so calls QueryPerformanceCounter instead. (Note QueryPerformanceCounter is used because it has higher resolution than the more obvious candidate GetTickCount64). The changes to tvnow are basically a copy and paste but the types in some cases are different. Ref: https://github.com/curl/curl/issues/3309 Closes https://github.com/curl/curl/pull/4847
2019-12-10curl: use errorf() betterDaniel Stenberg
Change series of error outputs to use errorf(). Only errors that are due to mistakes in command line option usage should use helpf(), other types of errors in the tool should rather use errorf(). Closes #4691
2019-08-08cleanup: s/curl_debug/curl_dbg_debug in comments and docsDaniel Stenberg
Leftovers from the function rename back in 76b63489495 Reported-by: Gisle Vanem Bug: https://github.com/curl/curl/commit/f3e0f071b14fcb46a453f69bdf4e062bcaacf362#com mitcomment-34601751 Closes #4203
2019-07-20curl: support parallel transfersDaniel Stenberg
This is done by making sure each individual transfer is first added to a linked list as then they can be performed serially, or at will, in parallel. Closes #3804
2019-04-11build: fix Codacy/CppCheck warningsMarcel Raad
- remove unused variables - declare conditionally used variables conditionally - suppress unused variable warnings in the CMake tests - remove dead variable stores - consistently use WIN32 macro to detect Windows Closes https://github.com/curl/curl/pull/3739
2019-03-08memdebug: make debug-specific functions use curl_dbg_ prefixDaniel Stenberg
To not "collide" or use up the regular curl_ name space. Also makes them easier to detect in helper scripts. Closes #3656
2018-11-30tool_main: rename function to make it unique and betterDaniel Stenberg
... there's already another function in the curl tool named free_config_fields!
2018-11-06tool: add undocumented option --dump-module-paths for win32Jay Satiro
- Add an undocumented diagnostic option for Windows to show the full paths of all loaded modules regardless of whether or not libcurl initialization succeeds. This is needed so that in the CI we can get a list of all DLL dependencies after initialization (when they're most likely to have finished loading) and then package them as artifacts so that a functioning build can be downloaded. Also I imagine it may have some use as a diagnostic for help requests. Ref: https://github.com/curl/curl/pull/3103 Closes https://github.com/curl/curl/pull/3208
2018-11-05curl: fixed UTF-8 in current console code page (Windows)Yasuhiro Matsumoto
Fixes #3211 Fixes #3175 Closes #3212
2018-10-26tool_main: make TerminalSettings staticDaniel Stenberg
Reported-by: Gisle Vanem Bug: https://github.com/curl/curl/commit/becfe1233ff2b6b0c3e1b6a10048b55b68c2539f#commitcomment-31008819 Closes #3161
2018-09-29curl: enabled Windows VT Support and UTF-8 outputRich Turner
Enabled Console VT support (if running OS supports VT) in tool_main.c. Fixes #3008 Closes #3011
2018-05-21curl: added --styled-outputDaniel Stenberg
It is enabled by default, so --no-styled-output will switch off the detection/use of bold headers. Closes #2538
2017-08-22tool_main: turn off MinGW CRT's globbingMarcel Raad
By default, the MinGW CRT globs command-line arguments. This prevents getting a single asterisk into an argument as test 1299 does. Turn off globbing by setting the global variable _CRT_glob to 0 for MinGW. Fixes https://github.com/curl/curl/issues/1751 Closes https://github.com/curl/curl/pull/1813
2017-06-16curl: prevent binary output spewed to terminalDaniel Stenberg
... unless "--output -" is used. Binary detection is done by simply checking for a binary zero in early data. Added test 1425 1426 to verify. Closes #1512
2016-02-03URLs: change all http:// URLs to https://Daniel Stenberg
2014-12-21VMS: Updates for 0740-0D1220John E. Malmberg
lib/setup-vms.h : VAX HP OpenSSL port is ancient, needs help. More defines to set symbols to uppercase. src/tool_main.c : Fix parameter to vms_special_exit() call. packages/vms/ : backup_gnv_curl_src.com : Fix the error message to have the correct package. build_curl-config_script.com : Rewrite to be more accurate. build_libcurl_pc.com : Use tool_version.h now. build_vms.com : Fix to handle lib/vtls directory. curl_gnv_build_steps.txt : Updated build procedure documentation. generate_config_vms_h_curl.com : * VAX does not support 64 bit ints, so no NTLM support for now. * VAX HP SSL port is ancient, needs some help. * Disable NGHTTP2 for now, not ported to VMS. * Disable UNIX_SOCKETS, not available on VMS yet. * HP GSSAPI port does not have gss_nt_service_name. gnv_link_curl.com : Update for new curl structure. pcsi_product_gnv_curl.com : Set up to optionally do a complete build.
2014-07-03tool: oops, forgot to include <plarenas.h>Kamil Dudka
... that contains the declaration of PL_ArenaFinish()
2014-07-03tool: call PL_ArenaFinish() on exit if NSPR is usedKamil Dudka
This prevents valgrind from reporting still reachable memory allocated by NSPR arenas (mainly the freelist). Reported-by: Hubert Kario
2014-07-02tool: call PR_Cleanup() on exit if NSPR is usedKamil Dudka
This prevents valgrind from reporting possibly lost memory that NSPR uses for file descriptor cache and other globally allocated internal data structures.
2014-03-01tool: Moved --libcurl to the global configSteve Holme
2014-03-01tool: Moved --stderr to the global configSteve Holme
2014-02-28tool_main: Fixed a memory leak on main_init errorDan Fandrich
2014-02-27tool: Moved --trace and --verbose to the global configSteve Holme
2014-02-27tool_main: Forgot to initialise the first operation's global pointerSteve Holme
2014-02-25tool: Moved --showerror to the global configSteve Holme
Other global options such as --libcurl, --trace and --verbose to follow.
2014-02-24tool_operate: Moved easy handle cleanup into tool_mainSteve Holme
2014-02-24tool_main: Moved easy handle into global config structureSteve Holme
2014-02-23tool_main: Corrected typo from commit d6b9f054e9 in Symbian codeSteve Holme
2014-02-23tool_main: Moved OperateConfig cleanup into main_free()Steve Holme
2014-02-23tool_main: Moved initial OperateConfig creation into main_init()Steve Holme
2014-02-23tool_cfgable: Added global config structureSteve Holme
2014-02-23tool_cfgable: Renamed Configurable structure to OperationConfigSteve Holme
To allow for the addition of a global config structure and prevent confusion between the two.
2014-02-22tool_operate: Start to use CURLcode rather than int for return codesSteve Holme
To help assist with the detection of incorrect return codes, as per commits ee23d13a79, 33b8960dc8 and aba98991a5, updated the operate based functions to return CURLcode error codes.
2014-02-08tool_getparam: Added support for parsing of specific URL optionsSteve Holme
2014-02-07tool_cfgable: For consistency renamed init_config() to config_init()Steve Holme
2014-02-07tool_cfgable: Introduced config_free() functionSteve Holme
2014-02-03tool_operate: Moved libcurl information gathering to tool_mainSteve Holme
2014-02-03tool_operate: Moved main initialisation and cleanup code into tool_mainSteve Holme
2014-02-03tool_main: Fixed compilation warning from commit 0104678c79Steve Holme
no previous prototype for function 'memory_tracking_init'
2014-02-03tool_main: Changed stack based config struct to be heap basedSteve Holme
2014-02-02tool_operate: Moved memory tracking initialisation into tool_mainSteve Holme
2014-02-01tool_main: Moved config struct initialisation into a separate functionSteve Holme
In preparation for adding URL specific options moved the initialisation of the Configurable structure into a separate function in tool_cfgable.
2013-05-06src/Makefile.am: build static lib for unit tests if enabledKamil Dudka
2013-03-13tool_main.c: remove redundant vms_show storage-class specifierYang Tse
vms_show 'extern' storage-class specifier removed from tool_main.c due to... - Advice from Tor Arntsen: http://curl.haxx.se/mail/lib-2013-03/0164.html - HP OpenVMS docs stating that 'Extern is the default storage class for variables declared outside a function.' http://h71000.www7.hp.com/commercial/c/docs/dec_c_help_5.html (Storage_Classes section)
2013-03-13tool_main.c: fix VMS global variable storage-class specifierTom Grace
An extern submits a psect and a global reference to the linker to point to it. Using "extern int vms_show = 0" also creates a globaldef. The use of the extern by itself does declare a psect but does not declare a globalsymbol. It does declare a globalref. But the linker needs one and only one globaldef or there is an error.
2013-02-06vms_show: post VMS patch cleanup - IIYang Tse
- remove multiple declarations of vms_show and add comments
2013-02-06tool_main.c: post VMS patch cleanup - IYang Tse
- remove header inclusion already done in curl_setup_once.h
2013-02-05VMS: fix and generate the VMS build configJohn E. Malmberg
config_h.com is a new file that generates a config.h file based on the curl_config.h.in file and a quick scan of the configure script. This is actually a generic procedure that is shared with other VMS packages. The existing pre-built config-vms.h had over 100 entries that were not correct and in some cases conflicted with the build options available in the build_vms.com. generate_config_vms_h_curl.com is a helper procedure to the config_h.com. It covers the cases that the generic config_h.com is not able to figure out, and accepts input from the build_vms.com procedure. build_curlbuild_h.com is a new file to generate the curlbuild.h file that Curl is now using when it is using a curl_config.h file. post-config-vms.h is a new file that is needed to provide VMS specific definitions, and most of them need to be set before the system header files are included. The VMS build procedure is fixed: 1. Fixed to link in the correct HP ssl library. 2. Fixed to detect if HP Kerberos is installed. 3. Fixed to detect if HP LDAP is installed. 4. Fixed to detect if gnv$libzshr is installed. 5. Simplified the input parameter parsing to not use a loop. 6. Warn that 64 bit pointer option support is not complete in comments. 7. Default to IEEE floating if platform supports it so resulting libcurl will be compatible with other open source projects on VMS. 8. Default to LARGEFILE if platform supports it. 9. Default to enable SSL, LDAP, Kerberos, libz if the libraries are present. 10. Build with exact case global symbols for libcurl. 11. Generate linker option file needed. 12. Compiler list option only commonly needed items. 13. fulllist option for those who really want it. 14. Create debug symbol file on Alpha, IA64.