libjodycode - shared code used by several tools written by Jody Bruchon
Contents
Description
libjodycode is a software code library containing code shared among several of the programs written by
Jody Bruchon such as imagepile, jdupes, winregfs, and zeromerge. These shared pieces of code were copied
between each program as they were updated. As the number of programs increased and keeping these pieces
of code synced became more annoying, the decision was made to combine all of them into a single reusable
shared library.
License
MIT License
Copyright (c) 2014-2025 Jody Lee Bruchon <jody@jodybruchon.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3.1 2025-03-08 LIBJODYCODE(7)
Name
libjodycode - shared code used by several tools written by Jody Bruchon
Notes
libjodycode is created and maintained by Jody Bruchon <jody@jodybruchon.com>
General information, help, and tech info: https://www.jdupes.com/
Development, source code, releases: https://codeberg.org/jbruchon/libjodycode
If you find this software useful, please consider financially supporting its development through the
author's home page:
https://www.jodybruchon.com/
Synopsis
#include<libjodycode.h>AlarmAPIintjc_alarm_ringintjc_start_alarm(constunsignedintseconds,constintrepeat)intjc_stop_alarm(void)CacheinfoAPIvoidjc_get_proc_cacheinfo(structjc_proc_cacheinfo*pci)ErrorAPIconstchar*jc_get_errname(interrnum)constchar*jc_get_errdesc(interrnum)intjc_print_error(interrnum)jodyhashAPIintjc_block_hash(jodyhash_t*data,jodyhash_t*hash,constsize_tcount)OOM(out-of-memory)APIvoidjc_oom(constchar*constrestrictmsg)voidjc_nullptr(constchar*restrictfunc)aPathsAPIintjc_collapse_dotdot(char*constpath)intjc_make_relative_link_name(constchar*constsrc,constchar*constdest,char*rel_path)SizeSuffixAPIconststructjc_size_suffixjc_size_suffix[]SortAPIintjc_numeric_sort(char*restrictc1,char*restrictc2,intsort_direction)String-to-epochAPItime_tjc_strtoepoch(constchar*constdatetime)StringAPIintjc_strncaseeq(constchar*s1,constchar*s2,size_tlen)intjc_strcaseeq(constchar*s1,constchar*s2)intjc_strneq(constchar*s1,constchar*s2,size_tlen)intjc_streq(constchar*s1,constchar*s2)VersionAPIconstchar*jc_versionconstchar*jc_verdateconstintjc_api_versionconstintjc_api_featurelevelconstintjc_jodyhash_versionconstunsignedcharjc_api_versiontable[]Windowsstat()APItime_tjc_nttime_to_unixtime(constuint64_t*constrestricttimestamp)time_tjc_unixtime_to_nttime(constuint64_t*constrestricttimestamp)intjc_win_stat(constchar*constfilename,structjc_winstat*constrestrictbuf)WindowsUnicodeAPIintjc_fwprint(FILE*constrestrictstream,constchar*constrestrictstr,constintcr)voidjc_slash_convert(char*path)voidjc_set_output_modes(unsignedintmodes)intjc_widearg_to_argv(intargc,wchar_t**wargv,char**argv)WindowsUnicodeconversionshortcutdefinitionsM2W(char*a,JC_WCHAR_T*b)
convert string a to wide string b using MultiByteToWideChar()
W2M(JC_WCHAR_T*a,char*b)
convert wide string a to normal string b using WideCharToMultiByte()
