diff options
| author | ruki <[email protected]> | 2026-03-28 15:46:11 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-28 15:46:11 +0800 |
| commit | 1df5ac2921a800c766fc64d4db6a85975c171e32 (patch) | |
| tree | feb30c468c4e89a5c8338b4a90786d97ceed481e | |
| parent | c86b161f6b27040289c75f3cafe7a863dea737bc (diff) | |
| parent | c08081788e880f32f1835eab49aae5806cb19721 (diff) | |
Merge pull request #7424 from xmake-io/comments
improve comments
37 files changed, 686 insertions, 89 deletions
diff --git a/xmake/core/base/binutils.lua b/xmake/core/base/binutils.lua index 7e08ac317..7adfe6efa 100644 --- a/xmake/core/base/binutils.lua +++ b/xmake/core/base/binutils.lua @@ -36,7 +36,12 @@ binutils._rpath_clean = binutils._rpath_clean or binutils.rpath_clean binutils._extractlib = binutils._extractlib or binutils.extractlib binutils._format = binutils._format or binutils.format --- generate c/c++ code from the binary file +-- generate c/c++ header with binary data from the binary file +-- +-- @param binaryfile the input binary file path +-- @param outputfile the output header file path +-- @param opt the options, e.g. {nozeroend = true} +-- function binutils.bin2c(binaryfile, outputfile, opt) opt = opt or {} if binutils._bin2c then @@ -95,7 +100,11 @@ function binutils.bin2obj(binaryfile, outputfile, opt) end end --- get binary file format (auto-detect format: coff, elf, macho, ar, pe, unknown) +-- get binary file format (auto-detect: coff, elf, macho, ar, pe, unknown) +-- +-- @param binaryfile the binary file path +-- @return the format string +-- function binutils.format(binaryfile) if binutils._format then return binutils._format(binaryfile) @@ -105,7 +114,11 @@ function binutils.format(binaryfile) end --- read symbols from object file (auto-detect format: COFF, ELF, or Mach-O) +-- read symbols from object file (auto-detect: COFF, ELF, or Mach-O) +-- +-- @param binaryfile the binary file path +-- @return the symbols table, or nil and error info +-- function binutils.readsyms(binaryfile) if binutils._readsyms then return binutils._readsyms(binaryfile) @@ -114,7 +127,11 @@ function binutils.readsyms(binaryfile) end end --- get dependent libraries from binary file (auto-detect format: COFF, ELF, or Mach-O) +-- get dependent libraries from binary file (auto-detect: COFF, ELF, or Mach-O) +-- +-- @param binaryfile the binary file path +-- @return the dependent libraries table, or nil and error info +-- function binutils.deplibs(binaryfile) if binutils._deplibs then return binutils._deplibs(binaryfile) @@ -123,7 +140,11 @@ function binutils.deplibs(binaryfile) end end --- get rpath list from binary file (auto-detect format: ELF or Mach-O) +-- get rpath list from binary file (auto-detect: ELF or Mach-O) +-- +-- @param binaryfile the binary file path +-- @return the rpath list table, or nil and error info +-- function binutils.rpath_list(binaryfile) if binutils._rpath_list then return binutils._rpath_list(binaryfile) @@ -134,7 +155,11 @@ end -- insert rpath to binary file (auto-detect format: ELF or Mach-O) --- clean rpaths from binary file (auto-detect format: ELF or Mach-O) +-- clean rpaths from binary file (auto-detect: ELF or Mach-O) +-- +-- @param binaryfile the binary file path +-- @return true on success, or false and error info +-- function binutils.rpath_clean(binaryfile) if binutils._rpath_clean then return binutils._rpath_clean(binaryfile) diff --git a/xmake/core/base/bloom_filter.lua b/xmake/core/base/bloom_filter.lua index d7e6eb0e3..d82618be9 100644 --- a/xmake/core/base/bloom_filter.lua +++ b/xmake/core/base/bloom_filter.lua @@ -175,7 +175,14 @@ function _instance:__gc() end end --- new a bloom filter, e.g. {probability = 0.001, hash_count = 3, item_maxn = 1000000} +-- create a new bloom filter +-- +-- @param opt the options +-- - probability: false positive rate (default: 0.001), supports 0.1 ~ 0.000001 +-- - hash_count: the hash function count (default: 3) +-- - item_maxn: the maximum item count (default: 1000000) +-- @return the bloom filter instance, or nil and error info +-- function bloom_filter.new(opt) opt = opt or {} local probability = opt.probability or 0.001 diff --git a/xmake/core/base/bytes.lua b/xmake/core/base/bytes.lua index f249096bf..35ccf8998 100644 --- a/xmake/core/base/bytes.lua +++ b/xmake/core/base/bytes.lua @@ -583,12 +583,20 @@ function _instance:__gc() end end --- new an bytes instance +-- create a new bytes instance +-- +-- @param ... the data (string, number/size, cdata + size, or another bytes) +-- @return the bytes instance +-- function bytes.new(...) return _instance.new(...) end --- is instance of bytes? +-- is the data an instance of bytes? +-- +-- @param data the data to check +-- @return true if it is a bytes instance +-- function bytes.instance_of(data) if type(data) == "table" and data.cdata and data.size then return true diff --git a/xmake/core/base/cli.lua b/xmake/core/base/cli.lua index fb1274537..7c2840b96 100644 --- a/xmake/core/base/cli.lua +++ b/xmake/core/base/cli.lua @@ -61,14 +61,24 @@ function cli._make_option(key, value, short, argv, argi) return cli._make_segment("option", short and ("-" .. key .. " " .. value) or ("--" .. key .. "=" .. value), argv, argi, { key = key, value = value, short = short or false }) end --- parse a argv string, command & sub-command should be omitted before calling this function +-- parse a command line string into structured segments +-- +-- @param args the command line string +-- @param flags the short flags set (optional), e.g. {v = true, f = true} +-- @return the parsed segments array [{type, key, value, short}, ...] -- @see https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html +-- function cli.parse(args, flags) return cli.parsev(os.argv(args), flags) end --- parse a argv array, command & sub-command should be omitted before calling this function +-- parse an argv array into structured segments +-- +-- @param argv the arguments array +-- @param flags the short flags set (optional), e.g. {v = true, f = true} +-- @return the parsed segments array [{type, key, value, short}, ...] -- @see https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html +-- function cli.parsev(argv, flags) local parsed = {} diff --git a/xmake/core/base/colors.lua b/xmake/core/base/colors.lua index 48318413e..3d3d1d0bf 100644 --- a/xmake/core/base/colors.lua +++ b/xmake/core/base/colors.lua @@ -233,6 +233,10 @@ end -- "${hello xmake}" -- "${hello xmake $beer}" -- +-- @param str the string with color/emoji markup +-- @param opt the options, e.g. {patch_reset = true, ignore = false} +-- @return the translated string with ANSI escape codes +-- function colors.translate(str, opt) -- check string @@ -359,7 +363,11 @@ function colors.translate(str, opt) return str end --- ignore all colors +-- ignore all colors, strip color markup from string +-- +-- @param str the string with color markup +-- @return the plain string without colors +-- function colors.ignore(str) if str then -- strip "${red}" and "${theme color}" diff --git a/xmake/core/base/cpu.lua b/xmake/core/base/cpu.lua index 56d424f4a..d5ec3fffb 100644 --- a/xmake/core/base/cpu.lua +++ b/xmake/core/base/cpu.lua @@ -281,34 +281,53 @@ function cpu._statinfo(name) end end --- get vendor id +-- get cpu vendor id, e.g. "GenuineIntel", "AuthenticAMD" +-- +-- @return the vendor id string +-- function cpu.vendor() return cpu._info().vendor_id end --- get cpu model +-- get cpu model number +-- +-- @return the model number +-- function cpu.model() local cpu_model = cpu._info().cpu_model return cpu_model and tonumber(cpu_model) end --- get cpu model name +-- get cpu model name, e.g. "Intel(R) Core(TM) i7-10700K" +-- +-- @return the model name string +-- function cpu.model_name() return cpu._info().cpu_model_name end --- get cpu family +-- get cpu family number +-- +-- @return the family number +-- function cpu.family() local cpu_family = cpu._info().cpu_family return cpu_family and tonumber(cpu_family) end --- get cpu features +-- get cpu features string, e.g. "sse sse2 avx avx2" +-- +-- @return the features string (space separated) +-- function cpu.features() return cpu._info().cpu_features end --- has the given feature? +-- has the given cpu feature? +-- +-- @param name the feature name, e.g. "avx2", "sse4_2" +-- @return true if supported +-- function cpu.has_feature(name) local features = cpu._FEATURES if not features then @@ -321,7 +340,10 @@ function cpu.has_feature(name) return features:has(name) end --- get cpu micro architecture +-- get cpu micro architecture, e.g. "skylake", "zen3" +-- +-- @return the micro architecture name, or nil if unknown +-- function cpu.march() local march = cpu._MARCH if march == nil then @@ -336,17 +358,27 @@ function cpu.march() return march end --- get cpu number +-- get cpu core count +-- +-- @return the number of cpu cores +-- function cpu.number() return cpu._statinfo("ncpu") end -- get cpu usage rate +-- +-- @return the usage rate (0.0 ~ 1.0) +-- function cpu.usagerate() return cpu._statinfo("usagerate") end --- get cpu info +-- get all cpu info as a table +-- +-- @param name the specific info name (optional), e.g. "march", "ncpu" +-- @return the cpu info table or specific value +-- function cpu.info(name) local cpuinfo = {} cpuinfo.vendor = cpu.vendor() diff --git a/xmake/core/base/emoji.lua b/xmake/core/base/emoji.lua index 972b5e0cf..98ee6a720 100644 --- a/xmake/core/base/emoji.lua +++ b/xmake/core/base/emoji.lua @@ -31,7 +31,11 @@ emoji.keys = four="4โฃ",kiss_ww="๐ฉโค๐๐ฉ",maple_leaf="๐",waxing_gibbous_moon="๐",bike="๐ฒ",recycle="โป",family_mwgb="๐จ๐ฉ๐ง๐ฆ",flag_dk="๐ฉ๐ฐ",thought_balloon="๐ญ",oncoming_automobile="๐",guardsman_tone5="๐๐ฟ",tickets="๐",school="๐ซ",house_abandoned="๐",blue_book="๐",video_game="๐ฎ",triumph="๐ค",suspension_railway="๐",umbrella="โ",levitate="๐ด",cactus="๐ต",monorail="๐",stars="๐ ",new="๐",herb="๐ฟ",pouting_cat="๐พ",blue_heart="๐",["100"]="๐ฏ",leaves="๐",family_mwbb="๐จ๐ฉ๐ฆ๐ฆ",information_desk_person_tone2="๐๐ผ",dragon_face="๐ฒ",track_next="โญ",cloud_snow="๐จ",flag_jp="๐ฏ๐ต",children_crossing="๐ธ",information_desk_person_tone1="๐๐ป",arrow_up_down="โ",mount_fuji="๐ป",massage_tone1="๐๐ป",flag_mq="๐ฒ๐ถ",massage_tone3="๐๐ฝ",massage_tone2="๐๐ผ",massage_tone5="๐๐ฟ",flag_je="๐ฏ๐ช",flag_jm="๐ฏ๐ฒ",flag_jo="๐ฏ๐ด",red_car="๐",hospital="๐ฅ",red_circle="๐ด",princess="๐ธ",tm="โข",curly_loop="โฐ",boy_tone5="๐ฆ๐ฟ",pouch="๐",boy_tone3="๐ฆ๐ฝ",boy_tone1="๐ฆ๐ป",izakaya_lantern="๐ฎ",fist_tone5="โ๐ฟ",fist_tone4="โ๐พ",fist_tone1="โ๐ป",fist_tone3="โ๐ฝ",fist_tone2="โ๐ผ",arrow_lower_left="โ",game_die="๐ฒ",pushpin="๐",dividers="๐",dolphin="๐ฌ",night_with_stars="๐",cruise_ship="๐ณ",white_medium_small_square="โฝ",kissing_closed_eyes="๐",earth_americas="๐",["end"]="๐",mouse="๐ญ",rewind="โช",beach="๐",pizza="๐",briefcase="๐ผ",customs="๐",heartpulse="๐",sparkler="๐",sparkles="โจ",hand_splayed_tone1="๐๐ป",snowman2="โ",tulip="๐ท",speaking_head="๐ฃ",ambulance="๐",office="๐ข",clapper="๐ฌ",keyboard="โจ",japan="๐พ",post_office="๐ฃ",dizzy_face="๐ต",imp="๐ฟ",flag_ve="๐ป๐ช",coffee="โ",flag_vg="๐ป๐ฌ",flag_va="๐ป๐ฆ",flag_vc="๐ป๐จ",flag_vn="๐ป๐ณ",flag_vi="๐ป๐ฎ",open_mouth="๐ฎ",flag_vu="๐ป๐บ",page_with_curl="๐",bank="๐ฆ",bread="๐",oncoming_police_car="๐",capricorn="โ",point_left="๐",tokyo_tower="๐ผ",fishing_pole_and_fish="๐ฃ",thumbsdown="๐",telescope="๐ญ",spider="๐ท",u7121="๐",camera_with_flash="๐ธ",lifter="๐",sweet_potato="๐ ",lock_with_ink_pen="๐",ok_woman_tone2="๐๐ผ",ok_woman_tone3="๐๐ฝ",smirk="๐",baggage_claim="๐",cherry_blossom="๐ธ",sparkle="โ",zap="โก",construction_site="๐",dancers="๐ฏ",flower_playing_cards="๐ด",hatching_chick="๐ฃ",free="๐",bullettrain_side="๐",poultry_leg="๐",grapes="๐",smirk_cat="๐ผ",lollipop="๐ญ",water_buffalo="๐",black_medium_small_square="โพ",atm="๐ง",gift_heart="๐",older_woman_tone5="๐ต๐ฟ",older_woman_tone4="๐ต๐พ",older_woman_tone1="๐ต๐ป",older_woman_tone3="๐ต๐ฝ",older_woman_tone2="๐ต๐ผ",scissors="โ",woman_tone2="๐ฉ๐ผ",basketball="๐",hammer_pick="โ",top="๐",clock630="๐ก",raising_hand_tone5="๐๐ฟ",railway_track="๐ค",nail_care="๐
",crossed_flags="๐",minibus="๐",white_sun_cloud="๐ฅ",shower="๐ฟ",smile_cat="๐ธ",dog2="๐",loud_sound="๐",kaaba="๐",runner="๐",ram="๐",writing_hand="โ",rat="๐",rice_scene="๐",milky_way="๐",vulcan_tone5="๐๐ฟ",necktie="๐",kissing_cat="๐ฝ",snowflake="โ",paintbrush="๐",crystal_ball="๐ฎ",mountain_bicyclist_tone4="๐ต๐พ",mountain_bicyclist_tone3="๐ต๐ฝ",mountain_bicyclist_tone2="๐ต๐ผ",mountain_bicyclist_tone1="๐ต๐ป",koko="๐",flag_it="๐ฎ๐น",flag_iq="๐ฎ๐ถ",flag_is="๐ฎ๐ธ",flag_ir="๐ฎ๐ท",flag_im="๐ฎ๐ฒ",flag_il="๐ฎ๐ฑ",flag_io="๐ฎ๐ด",flag_in="๐ฎ๐ณ",flag_ie="๐ฎ๐ช",flag_id="๐ฎ๐ฉ",flag_ic="๐ฎ๐จ",ballot_box_with_check="โ",mountain_bicyclist_tone5="๐ต๐ฟ",metal="๐ค",dog="๐ถ",pineapple="๐",no_good_tone3="๐
๐ฝ",no_good_tone2="๐
๐ผ",no_good_tone1="๐
๐ป",scream="๐ฑ",no_good_tone5="๐
๐ฟ",no_good_tone4="๐
๐พ",flag_ua="๐บ๐ฆ",bomb="๐ฃ",flag_ug="๐บ๐ฌ",flag_um="๐บ๐ฒ",flag_us="๐บ๐ธ",construction_worker_tone1="๐ท๐ป",radio="๐ป",flag_uy="๐บ๐พ",flag_uz="๐บ๐ฟ",person_with_blond_hair_tone1="๐ฑ๐ป",cupid="๐",mens="๐น",rice="๐",point_right_tone1="๐๐ป",point_right_tone3="๐๐ฝ",point_right_tone2="๐๐ผ",sunglasses="๐",point_right_tone4="๐๐พ",watch="โ",frowning="๐ฆ",watermelon="๐",wedding="๐",person_frowning_tone4="๐๐พ",person_frowning_tone5="๐๐ฟ",person_frowning_tone2="๐๐ผ",person_frowning_tone3="๐๐ฝ",person_frowning_tone1="๐๐ป",flag_gw="๐ฌ๐ผ",flag_gu="๐ฌ๐บ",flag_gt="๐ฌ๐น",flag_gs="๐ฌ๐ธ",flag_gr="๐ฌ๐ท",flag_gq="๐ฌ๐ถ",flag_gp="๐ฌ๐ต",flag_gy="๐ฌ๐พ",flag_gg="๐ฌ๐ฌ",flag_gf="๐ฌ๐ซ",microscope="๐ฌ",flag_gd="๐ฌ๐ฉ",flag_gb="๐ฌ๐ง",flag_ga="๐ฌ๐ฆ",flag_gn="๐ฌ๐ณ",flag_gm="๐ฌ๐ฒ",flag_gl="๐ฌ๐ฑ",japanese_ogre="๐น",flag_gi="๐ฌ๐ฎ",flag_gh="๐ฌ๐ญ",man_with_turban="๐ณ",star_and_crescent="โช",writing_hand_tone3="โ๐ฝ",dromedary_camel="๐ช",hash="#โฃ",hammer="๐จ",hourglass="โ",postbox="๐ฎ",writing_hand_tone5="โ๐ฟ",writing_hand_tone4="โ๐พ",wc="๐พ",aquarius="โ",couple_with_heart="๐",ok_woman="๐",raised_hands_tone4="๐๐พ",cop="๐ฎ",raised_hands_tone1="๐๐ป",cow="๐ฎ",raised_hands_tone3="๐๐ฝ",white_large_square="โฌ",pig_nose="๐ฝ",ice_skate="โธ",hotsprings="โจ",tone5="๐ฟ",three="3โฃ",beer="๐บ",stadium="๐",airplane_departure="๐ซ",heavy_division_sign="โ",flag_black="๐ด",mushroom="๐",record_button="โบ",vulcan="๐",dash="๐จ",wind_chime="๐",anchor="โ",seven="7โฃ",flag_hr="๐ญ๐ท",roller_coaster="๐ข",pen_ballpoint="๐",sushi="๐ฃ",flag_ht="๐ญ๐น",flag_hu="๐ญ๐บ",flag_hk="๐ญ๐ฐ",dizzy="๐ซ",flag_hn="๐ญ๐ณ",flag_hm="๐ญ๐ฒ",arrow_forward="โถ",violin="๐ป",orthodox_cross="โฆ",id="๐",heart_decoration="๐",first_quarter_moon="๐",satellite="๐ก",tone3="๐ฝ",christmas_tree="๐",unicorn="๐ฆ",broken_heart="๐",ocean="๐",hearts="โฅ",snowman="โ",person_with_blond_hair_tone4="๐ฑ๐พ",person_with_blond_hair_tone5="๐ฑ๐ฟ",person_with_blond_hair_tone2="๐ฑ๐ผ",person_with_blond_hair_tone3="๐ฑ๐ฝ",yen="๐ด",straight_ruler="๐",sleepy="๐ช",green_apple="๐",white_medium_square="โป",flag_fr="๐ซ๐ท",grey_exclamation="โ",innocent="๐",flag_fm="๐ซ๐ฒ",flag_fo="๐ซ๐ด",flag_fi="๐ซ๐ฎ",flag_fj="๐ซ๐ฏ",flag_fk="๐ซ๐ฐ",menorah="๐",yin_yang="โฏ",clock130="๐",gift="๐",prayer_beads="๐ฟ",stuck_out_tongue="๐",om_symbol="๐",city_dusk="๐",massage_tone4="๐๐พ",couple_ww="๐ฉโค๐ฉ",crown="๐",sparkling_heart="๐",clubs="โฃ",person_with_pouting_face="๐",newspaper2="๐",fog="๐ซ",dango="๐ก",large_orange_diamond="๐ถ",flag_tn="๐น๐ณ",flag_to="๐น๐ด",point_up="โ",flag_tm="๐น๐ฒ",flag_tj="๐น๐ฏ",flag_tk="๐น๐ฐ",flag_th="๐น๐ญ",flag_tf="๐น๐ซ",flag_tg="๐น๐ฌ",corn="๐ฝ",flag_tc="๐น๐จ",flag_ta="๐น๐ฆ",flag_tz="๐น๐ฟ",flag_tv="๐น๐ป",flag_tw="๐น๐ผ",flag_tt="๐น๐น",flag_tr="๐น๐ท",eight_spoked_asterisk="โณ",trophy="๐",black_small_square="โช",o="โญ",no_bell="๐",curry="๐",alembic="โ",sob="๐ญ",waxing_crescent_moon="๐",tiger2="๐
",two="2โฃ",sos="๐",compression="๐",heavy_multiplication_x="โ",tennis="๐พ",fireworks="๐",skull_crossbones="โ ",astonished="๐ฒ",congratulations="ใ",grey_question="โ",arrow_upper_left="โ",arrow_double_up="โซ",triangular_flag_on_post="๐ฉ",gemini="โ",door="๐ช",ship="๐ข",point_down_tone3="๐๐ฝ",point_down_tone4="๐๐พ",point_down_tone5="๐๐ฟ",movie_camera="๐ฅ",ng="๐",couple_mm="๐จโค๐จ",football="๐",asterisk="*โฃ",taurus="โ",articulated_lorry="๐",police_car="๐",flushed="๐ณ",spades="โ ",cloud_lightning="๐ฉ",wine_glass="๐ท",clock830="๐ฃ",punch_tone2="๐๐ผ",punch_tone3="๐๐ฝ",punch_tone1="๐๐ป",department_store="๐ฌ",punch_tone4="๐๐พ",punch_tone5="๐๐ฟ",crocodile="๐",white_square_button="๐ณ",hole="๐ณ",boy_tone2="๐ฆ๐ผ",mountain_cableway="๐ ",melon="๐",persevere="๐ฃ",trident="๐ฑ",head_bandage="๐ค",u7a7a="๐ณ",cool="๐",high_brightness="๐",deciduous_tree="๐ณ",white_flower="๐ฎ",gun="๐ซ",flag_sk="๐ธ๐ฐ",flag_sj="๐ธ๐ฏ",flag_si="๐ธ๐ฎ",flag_sh="๐ธ๐ญ",flag_so="๐ธ๐ด",flag_sn="๐ธ๐ณ",flag_sm="๐ธ๐ฒ",flag_sl="๐ธ๐ฑ",flag_sc="๐ธ๐จ",flag_sb="๐ธ๐ง",flag_sa="๐ธ๐ฆ",flag_sg="๐ธ๐ฌ",flag_tl="๐น๐ฑ",flag_se="๐ธ๐ช",arrow_left="โฌ
",flag_sz="๐ธ๐ฟ",flag_sy="๐ธ๐พ",small_orange_diamond="๐ธ",flag_ss="๐ธ๐ธ",flag_sr="๐ธ๐ท",flag_sv="๐ธ๐ป",flag_st="๐ธ๐น",file_folder="๐",flag_td="๐น๐ฉ",["1234"]="๐ข",smiling_imp="๐",surfer_tone2="๐๐ผ",surfer_tone3="๐๐ฝ",surfer_tone4="๐๐พ",surfer_tone5="๐๐ฟ",amphora="๐บ",baseball="โพ",boy="๐ฆ",flag_es="๐ช๐ธ",raised_hands="๐",flag_eu="๐ช๐บ",flag_et="๐ช๐น",heavy_plus_sign="โ",bow="๐",flag_ea="๐ช๐ฆ",flag_ec="๐ช๐จ",flag_ee="๐ช๐ช",light_rail="๐",flag_eg="๐ช๐ฌ",flag_eh="๐ช๐ญ",massage="๐",man_with_gua_pi_mao_tone4="๐ฒ๐พ",man_with_gua_pi_mao_tone3="๐ฒ๐ฝ",outbox_tray="๐ค",clock330="๐",projector="๐ฝ",sake="๐ถ",confounded="๐",angry="๐ ",iphone="๐ฑ",sweat_smile="๐
",aries="โ",ear_of_rice="๐พ",mouse2="๐",bicyclist_tone4="๐ด๐พ",bicyclist_tone5="๐ด๐ฟ",guardsman="๐",bicyclist_tone1="๐ด๐ป",bicyclist_tone2="๐ด๐ผ",bicyclist_tone3="๐ด๐ฝ",envelope="โ",money_with_wings="๐ธ",beers="๐ป",heart_exclamation="โฃ",notepad_spiral="๐",cat="๐ฑ",running_shirt_with_sash="๐ฝ",ferry="โด",spy="๐ต",chart_with_upwards_trend="๐",green_heart="๐",confused="๐",angel_tone4="๐ผ๐พ",scorpius="โ",sailboat="โต",elephant="๐",map="๐บ",disappointed_relieved="๐ฅ",flag_xk="๐ฝ๐ฐ",motorway="๐ฃ",sun_with_face="๐",birthday="๐",mag="๐",date="๐
",dove="๐",man="๐จ",octopus="๐",wheelchair="โฟ",truck="๐",sa="๐",shield="๐ก",haircut="๐",last_quarter_moon_with_face="๐",rosette="๐ต",currency_exchange="๐ฑ",mailbox_with_no_mail="๐ญ",bath="๐",clock930="๐ค",bowling="๐ณ",turtle="๐ข",pause_button="โธ",construction_worker="๐ท",unlock="๐",anger_right="๐ฏ",beetle="๐",girl="๐ง",sunrise="๐
",exclamation="โ",flag_dz="๐ฉ๐ฟ",family_mmgg="๐จ๐จ๐ง๐ง",factory="๐ญ",flag_do="๐ฉ๐ด",flag_dm="๐ฉ๐ฒ",flag_dj="๐ฉ๐ฏ",mouse_three_button="๐ฑ",flag_dg="๐ฉ๐ฌ",flag_de="๐ฉ๐ช",star_of_david="โก",reminder_ribbon="๐",grimacing="๐ฌ",thumbsup_tone3="๐๐ฝ",thumbsup_tone2="๐๐ผ",thumbsup_tone1="๐๐ป",musical_note="๐ต",thumbsup_tone5="๐๐ฟ",thumbsup_tone4="๐๐พ",high_heel="๐ ",green_book="๐",headphones="๐ง",flag_aw="๐ฆ๐ผ",stop_button="โน",yum="๐",flag_aq="๐ฆ๐ถ",warning="โ ",cheese="๐ง",ophiuchus="โ",revolving_hearts="๐",one="1โฃ",ring="๐",point_right="๐",sheep="๐",bookmark="๐",spider_web="๐ธ",eyes="๐",flag_ro="๐ท๐ด",flag_re="๐ท๐ช",flag_rs="๐ท๐ธ",sweat_drops="๐ฆ",flag_ru="๐ท๐บ",flag_rw="๐ท๐ผ",middle_finger="๐",race_car="๐",evergreen_tree="๐ฒ",biohazard="โฃ",girl_tone3="๐ง๐ฝ",scream_cat="๐",computer="๐ป",hourglass_flowing_sand="โณ",flag_lb="๐ฑ๐ง",tophat="๐ฉ",clock1230="๐ง",tractor="๐",u6709="๐ถ",u6708="๐ท",crying_cat_face="๐ฟ",angel="๐ผ",ant="๐",information_desk_person="๐",anger="๐ข",mailbox_with_mail="๐ฌ",pencil2="โ",wink="๐",thermometer="๐ก",relaxed="โบ",printer="๐จ",credit_card="๐ณ",checkered_flag="๐",family_mmg="๐จ๐จ๐ง",pager="๐",family_mmb="๐จ๐จ๐ฆ",radioactive="โข",fried_shrimp="๐ค",link="๐",walking="๐ถ",city_sunset="๐",shopping_bags="๐",hockey="๐",arrow_up="โฌ",gem="๐",negative_squared_cross_mark="โ",worried="๐",walking_tone5="๐ถ๐ฟ",walking_tone1="๐ถ๐ป",hear_no_evil="๐",convenience_store="๐ช",seat="๐บ",girl_tone1="๐ง๐ป",cloud_rain="๐ง",girl_tone2="๐ง๐ผ",girl_tone5="๐ง๐ฟ",girl_tone4="๐ง๐พ",parking="๐
ฟ",pisces="โ",calendar="๐",loudspeaker="๐ข",camping="๐",bicyclist="๐ด",label="๐ท",diamonds="โฆ",older_man_tone1="๐ด๐ป",older_man_tone3="๐ด๐ฝ",older_man_tone2="๐ด๐ผ",older_man_tone5="๐ด๐ฟ",older_man_tone4="๐ด๐พ",microphone2="๐",raising_hand="๐",hot_pepper="๐ถ",guitar="๐ธ",tropical_drink="๐น",upside_down="๐",restroom="๐ป",pen_fountain="๐",comet="โ",cancer="โ",jeans="๐",flag_qa="๐ถ๐ฆ",boar="๐",turkey="๐ฆ",person_with_blond_hair="๐ฑ",oden="๐ข",stuck_out_tongue_closed_eyes="๐",helicopter="๐",control_knobs="๐",performing_arts="๐ญ",tiger="๐ฏ",foggy="๐",sound="๐",flag_cz="๐จ๐ฟ",flag_cy="๐จ๐พ",flag_cx="๐จ๐ฝ",speech_balloon="๐ฌ",seedling="๐ฑ",flag_cr="๐จ๐ท",envelope_with_arrow="๐ฉ",flag_cp="๐จ๐ต",flag_cw="๐จ๐ผ",flag_cv="๐จ๐ป",flag_cu="๐จ๐บ",flag_ck="๐จ๐ฐ",flag_ci="๐จ๐ฎ",flag_ch="๐จ๐ญ",flag_co="๐จ๐ด",flag_cn="๐จ๐ณ",flag_cm="๐จ๐ฒ",u5408="๐ด",flag_cc="๐จ๐จ",flag_ca="๐จ๐ฆ",flag_cg="๐จ๐ฌ",flag_cf="๐จ๐ซ",flag_cd="๐จ๐ฉ",purse="๐",telephone="โ",sleeping="๐ด",point_down_tone1="๐๐ป",frowning2="โน",point_down_tone2="๐๐ผ",muscle_tone4="๐ช๐พ",muscle_tone5="๐ช๐ฟ",synagogue="๐",muscle_tone1="๐ช๐ป",muscle_tone2="๐ช๐ผ",muscle_tone3="๐ช๐ฝ",clap_tone5="๐๐ฟ",clap_tone4="๐๐พ",clap_tone1="๐๐ป",train2="๐",clap_tone2="๐๐ผ",oil="๐ข",diamond_shape_with_a_dot_inside="๐ ",barber="๐",metal_tone3="๐ค๐ฝ",ice_cream="๐จ",rowboat_tone4="๐ฃ๐พ",burrito="๐ฏ",metal_tone1="๐ค๐ป",joystick="๐น",rowboat_tone1="๐ฃ๐ป",taxi="๐",u7533="๐ธ",racehorse="๐",snowboarder="๐",thinking="๐ค",wave_tone1="๐๐ป",wave_tone2="๐๐ผ",wave_tone3="๐๐ฝ",wave_tone4="๐๐พ",wave_tone5="๐๐ฟ",desktop="๐ฅ",stopwatch="โฑ",pill="๐",skier="โท",orange_book="๐",dart="๐ฏ",disappointed="๐",grin="๐",place_of_worship="๐",japanese_goblin="๐บ",arrows_counterclockwise="๐",laughing="๐",clap="๐",left_right_arrow="โ",japanese_castle="๐ฏ",nail_care_tone4="๐
๐พ",nail_care_tone5="๐
๐ฟ",nail_care_tone2="๐
๐ผ",nail_care_tone3="๐
๐ฝ",nail_care_tone1="๐
๐ป",raised_hand_tone4="โ๐พ",raised_hand_tone5="โ๐ฟ",raised_hand_tone1="โ๐ป",raised_hand_tone2="โ๐ผ",raised_hand_tone3="โ๐ฝ",point_left_tone3="๐๐ฝ",point_left_tone2="๐๐ผ",tanabata_tree="๐",point_left_tone5="๐๐ฟ",point_left_tone4="๐๐พ",o2="๐
พ",knife="๐ช",volcano="๐",kissing_heart="๐",on="๐",ok="๐",package="๐ฆ",island="๐",arrow_right="โก",chart_with_downwards_trend="๐",haircut_tone3="๐๐ฝ",wolf="๐บ",ox="๐",dagger="๐ก",full_moon_with_face="๐",syringe="๐",flag_by="๐ง๐พ",flag_bz="๐ง๐ฟ",flag_bq="๐ง๐ถ",flag_br="๐ง๐ท",flag_bs="๐ง๐ธ",flag_bt="๐ง๐น",flag_bv="๐ง๐ป",flag_bw="๐ง๐ผ",flag_bh="๐ง๐ญ",flag_bi="๐ง๐ฎ",flag_bj="๐ง๐ฏ",flag_bl="๐ง๐ฑ",flag_bm="๐ง๐ฒ",flag_bn="๐ง๐ณ",flag_bo="๐ง๐ด",flag_ba="๐ง๐ฆ",flag_bb="๐ง๐ง",flag_bd="๐ง๐ฉ",flag_be="๐ง๐ช",flag_bf="๐ง๐ซ",flag_bg="๐ง๐ฌ",satellite_orbital="๐ฐ",radio_button="๐",arrow_heading_down="โคต",rage="๐ก",whale2="๐",vhs="๐ผ",hand_splayed_tone3="๐๐ฝ",strawberry="๐",["non-potable_water"]="๐ฑ",hand_splayed_tone5="๐๐ฟ",star2="๐",toilet="๐ฝ",ab="๐",cinema="๐ฆ",floppy_disk="๐พ",princess_tone4="๐ธ๐พ",princess_tone5="๐ธ๐ฟ",princess_tone2="๐ธ๐ผ",nerd="๐ค",telephone_receiver="๐",princess_tone1="๐ธ๐ป",arrow_double_down="โฌ",clock1030="๐ฅ",flag_pr="๐ต๐ท",flag_ps="๐ต๐ธ",poop="๐ฉ",flag_pw="๐ต๐ผ",flag_pt="๐ต๐น",flag_py="๐ต๐พ",pear="๐",m="โ",flag_pa="๐ต๐ฆ",flag_pf="๐ต๐ซ",flag_pg="๐ต๐ฌ",flag_pe="๐ต๐ช",flag_pk="๐ต๐ฐ",flag_ph="๐ต๐ญ",flag_pn="๐ต๐ณ",flag_pl="๐ต๐ฑ",flag_pm="๐ต๐ฒ",mask="๐ท",hushed="๐ฏ",sunrise_over_mountains="๐",partly_sunny="โ
",dollar="๐ต",helmet_with_cross="โ",smoking="๐ฌ",no_bicycles="๐ณ",man_with_gua_pi_mao="๐ฒ",tv="๐บ",open_hands="๐",rotating_light="๐จ",information_desk_person_tone4="๐๐พ",information_desk_person_tone5="๐๐ฟ",part_alternation_mark="ใฝ",pray_tone5="๐๐ฟ",pray_tone4="๐๐พ",pray_tone3="๐๐ฝ",pray_tone2="๐๐ผ",pray_tone1="๐๐ป",smile="๐",large_blue_circle="๐ต",man_tone4="๐จ๐พ",man_tone5="๐จ๐ฟ",fax="๐ ",woman="๐ฉ",man_tone1="๐จ๐ป",man_tone2="๐จ๐ผ",man_tone3="๐จ๐ฝ",eye_in_speech_bubble="๐๐จ",blowfish="๐ก",card_box="๐",ticket="๐ซ",ramen="๐",twisted_rightwards_arrows="๐",swimmer_tone4="๐๐พ",swimmer_tone5="๐๐ฟ",swimmer_tone1="๐๐ป",swimmer_tone2="๐๐ผ",swimmer_tone3="๐๐ฝ",saxophone="๐ท",bath_tone1="๐๐ป",notebook_with_decorative_cover="๐",bath_tone3="๐๐ฝ",ten="๐",raising_hand_tone4="๐๐พ",tea="๐ต",raising_hand_tone1="๐๐ป",raising_hand_tone2="๐๐ผ",raising_hand_tone3="๐๐ฝ",zero="0โฃ",ribbon="๐",santa_tone1="๐
๐ป",abc="๐ค",clock="๐ฐ",purple_heart="๐",bow_tone1="๐๐ป",no_smoking="๐ญ",flag_cl="๐จ๐ฑ",surfer="๐",newspaper="๐ฐ",busstop="๐",new_moon="๐",traffic_light="๐ฅ",thumbsup="๐",no_entry="โ",name_badge="๐",classical_building="๐",hamster="๐น",pick="โ",two_women_holding_hands="๐ญ",family_mmbb="๐จ๐จ๐ฆ๐ฆ",family="๐ช",rice_cracker="๐",wind_blowing_face="๐ฌ",inbox_tray="๐ฅ",tired_face="๐ซ",carousel_horse="๐ ",eye="๐",poodle="๐ฉ",chestnut="๐ฐ",slight_smile="๐",mailbox_closed="๐ช",cloud_tornado="๐ช",jack_o_lantern="๐",lifter_tone3="๐๐ฝ",lifter_tone2="๐๐ผ",lifter_tone1="๐๐ป",lifter_tone5="๐๐ฟ",lifter_tone4="๐๐พ",nine="9โฃ",chocolate_bar="๐ซ",v="โ",man_with_turban_tone4="๐ณ๐พ",man_with_turban_tone5="๐ณ๐ฟ",man_with_turban_tone2="๐ณ๐ผ",man_with_turban_tone3="๐ณ๐ฝ",man_with_turban_tone1="๐ณ๐ป",family_wwbb="๐ฉ๐ฉ๐ฆ๐ฆ",hamburger="๐",accept="๐",airplane="โ",dress="๐",speedboat="๐ค",ledger="๐",goat="๐",flag_ae="๐ฆ๐ช",flag_ad="๐ฆ๐ฉ",flag_ag="๐ฆ๐ฌ",flag_af="๐ฆ๐ซ",flag_ac="๐ฆ๐จ",flag_am="๐ฆ๐ฒ",flag_al="๐ฆ๐ฑ",flag_ao="๐ฆ๐ด",flag_ai="๐ฆ๐ฎ",flag_au="๐ฆ๐บ",flag_at="๐ฆ๐น",fork_and_knife="๐ด",fast_forward="โฉ",flag_as="๐ฆ๐ธ",flag_ar="๐ฆ๐ท",cow2="๐",flag_ax="๐ฆ๐ฝ",flag_az="๐ฆ๐ฟ",a="๐
ฐ",volleyball="๐",dragon="๐",wrench="๐ง",point_up_2="๐",egg="๐ณ",small_red_triangle="๐บ",soon="๐",bow_tone4="๐๐พ",joy_cat="๐น",pray="๐",dark_sunglasses="๐ถ",rugby_football="๐",soccer="โฝ",dolls="๐",monkey_face="๐ต",clap_tone3="๐๐ฝ",bar_chart="๐",european_castle="๐ฐ",military_medal="๐",frame_photo="๐ผ",rice_ball="๐",trolleybus="๐",older_woman="๐ต",information_source="โน",postal_horn="๐ฏ",house="๐ ",fish="๐",bride_with_veil="๐ฐ",fist="โ",lipstick="๐",fountain="โฒ",cyclone="๐",thumbsdown_tone2="๐๐ผ",thumbsdown_tone3="๐๐ฝ",thumbsdown_tone1="๐๐ป",thumbsdown_tone4="๐๐พ",thumbsdown_tone5="๐๐ฟ",cookie="๐ช",heartbeat="๐",blush="๐",fire_engine="๐",feet="๐พ",horse="๐ด",blossom="๐ผ",crossed_swords="โ",station="๐",clock730="๐ข",banana="๐",relieved="๐",hotel="๐จ",park="๐",aerial_tramway="๐ก",flag_sd="๐ธ๐ฉ",panda_face="๐ผ",b="๐
ฑ",flag_sx="๐ธ๐ฝ",six_pointed_star="๐ฏ",shaved_ice="๐ง",chipmunk="๐ฟ",mountain="โฐ",koala="๐จ",white_small_square="โซ",open_hands_tone2="๐๐ผ",open_hands_tone3="๐๐ฝ",u55b6="๐บ",open_hands_tone1="๐๐ป",open_hands_tone4="๐๐พ",open_hands_tone5="๐๐ฟ",baby_tone5="๐ถ๐ฟ",baby_tone4="๐ถ๐พ",baby_tone3="๐ถ๐ฝ",baby_tone2="๐ถ๐ผ",baby_tone1="๐ถ๐ป",chart="๐น",beach_umbrella="โฑ",basketball_player_tone5="โน๐ฟ",basketball_player_tone4="โน๐พ",basketball_player_tone1="โน๐ป",basketball_player_tone3="โน๐ฝ",basketball_player_tone2="โน๐ผ",mans_shoe="๐",shinto_shrine="โฉ",ideograph_advantage="๐",airplane_arriving="๐ฌ",golf="โณ",minidisc="๐ฝ",hugging="๐ค",crayon="๐",point_down="๐",copyright="ยฉ",person_with_pouting_face_tone2="๐๐ผ",person_with_pouting_face_tone3="๐๐ฝ",person_with_pouting_face_tone1="๐๐ป",person_with_pouting_face_tone4="๐๐พ",person_with_pouting_face_tone5="๐๐ฟ",busts_in_silhouette="๐ฅ",alarm_clock="โฐ",couplekiss="๐",circus_tent="๐ช",sunny="โ",incoming_envelope="๐จ",yellow_heart="๐",cry="๐ข",x="โ",arrow_up_small="๐ผ",art="๐จ",surfer_tone1="๐๐ป",bride_with_veil_tone4="๐ฐ๐พ",bride_with_veil_tone5="๐ฐ๐ฟ",bride_with_veil_tone2="๐ฐ๐ผ",bride_with_veil_tone3="๐ฐ๐ฝ",bride_with_veil_tone1="๐ฐ๐ป",hibiscus="๐บ",black_joker="๐",raised_hand="โ",no_mouth="๐ถ",basketball_player="โน",champagne="๐พ",no_entry_sign="๐ซ",older_man="๐ด",moyai="๐ฟ",mailbox="๐ซ",slight_frown="๐",statue_of_liberty="๐ฝ",mega="๐ฃ",eggplant="๐",rose="๐น",bell="๐",battery="๐",wastebasket="๐",dancer="๐",page_facing_up="๐",church="โช",underage="๐",secret="ใ",clock430="๐",fork_knife_plate="๐ฝ",u7981="๐ฒ",fire="๐ฅ",cold_sweat="๐ฐ",flag_er="๐ช๐ท",family_mwgg="๐จ๐ฉ๐ง๐ง",heart_eyes="๐",guardsman_tone1="๐๐ป",guardsman_tone2="๐๐ผ",guardsman_tone3="๐๐ฝ",guardsman_tone4="๐๐พ",earth_africa="๐",arrow_right_hook="โช",spy_tone2="๐ต๐ผ",closed_umbrella="๐",bikini="๐",vertical_traffic_light="๐ฆ",kissing="๐",loop="โฟ",potable_water="๐ฐ",pound="๐ท",["fleur-de-lis"]="โ",key2="๐",heavy_dollar_sign="๐ฒ",shamrock="โ",boy_tone4="๐ฆ๐พ",shirt="๐",kimono="๐",left_luggage="๐
",meat_on_bone="๐",ok_woman_tone4="๐๐พ",ok_woman_tone5="๐๐ฟ",arrow_heading_up="โคด",calendar_spiral="๐",snail="๐",ok_woman_tone1="๐๐ป",arrow_down_small="๐ฝ",leopard="๐",paperclips="๐",cityscape="๐",woman_tone1="๐ฉ๐ป",slot_machine="๐ฐ",woman_tone3="๐ฉ๐ฝ",woman_tone4="๐ฉ๐พ",woman_tone5="๐ฉ๐ฟ",euro="๐ถ",musical_score="๐ผ",triangular_ruler="๐",flags="๐",five="5โฃ",love_hotel="๐ฉ",hotdog="๐ญ",speak_no_evil="๐",eyeglasses="๐",dancer_tone4="๐๐พ",dancer_tone5="๐๐ฟ",vulcan_tone4="๐๐พ",bridge_at_night="๐",writing_hand_tone1="โ๐ป",couch="๐",vulcan_tone1="๐๐ป",vulcan_tone2="๐๐ผ",vulcan_tone3="๐๐ฝ",womans_hat="๐",sandal="๐ก",cherries="๐",full_moon="๐",flag_om="๐ด๐ฒ",play_pause="โฏ",couple="๐ซ",money_mouth="๐ค",womans_clothes="๐",globe_with_meridians="๐",bath_tone5="๐๐ฟ",bangbang="โผ",stuck_out_tongue_winking_eye="๐",heart="โค",bamboo="๐",mahjong="๐",waning_gibbous_moon="๐",back="๐",point_up_2_tone4="๐๐พ",point_up_2_tone5="๐๐ฟ",lips="๐",point_up_2_tone1="๐๐ป",point_up_2_tone2="๐๐ผ",point_up_2_tone3="๐๐ฝ",candle="๐ฏ",middle_finger_tone3="๐๐ฝ",middle_finger_tone2="๐๐ผ",middle_finger_tone1="๐๐ป",middle_finger_tone5="๐๐ฟ",middle_finger_tone4="๐๐พ",heavy_minus_sign="โ",nose="๐",zzz="๐ค",stew="๐ฒ",santa="๐
",tropical_fish="๐ ",point_up_tone1="โ๐ป",point_up_tone3="โ๐ฝ",point_up_tone2="โ๐ผ",point_up_tone5="โ๐ฟ",point_up_tone4="โ๐พ",field_hockey="๐",school_satchel="๐",womens="๐บ",baby_symbol="๐ผ",baby_chick="๐ค",ok_hand_tone2="๐๐ผ",ok_hand_tone3="๐๐ฝ",ok_hand_tone1="๐๐ป",ok_hand_tone4="๐๐พ",ok_hand_tone5="๐๐ฟ",family_mmgb="๐จ๐จ๐ง๐ฆ",last_quarter_moon="๐",tada="๐",clock530="๐ ",question="โ",registered="ยฎ",level_slider="๐",black_circle="โซ",atom="โ",penguin="๐ง",electric_plug="๐",skull="๐",kiss_mm="๐จโค๐๐จ",walking_tone4="๐ถ๐พ",fries="๐",up="๐",walking_tone3="๐ถ๐ฝ",walking_tone2="๐ถ๐ผ",athletic_shoe="๐",hatched_chick="๐ฅ",black_nib="โ",black_large_square="โฌ",bow_and_arrow="๐น",rainbow="๐",metal_tone5="๐ค๐ฟ",metal_tone4="๐ค๐พ",lemon="๐",metal_tone2="๐ค๐ผ",peach="๐",peace="โฎ",steam_locomotive="๐",oncoming_bus="๐",heart_eyes_cat="๐ป",smiley="๐",haircut_tone1="๐๐ป",haircut_tone2="๐๐ผ",u6e80="๐ต",haircut_tone4="๐๐พ",haircut_tone5="๐๐ฟ",black_medium_square="โผ",closed_book="๐",desert="๐",expressionless="๐",dvd="๐",construction_worker_tone2="๐ท๐ผ",construction_worker_tone3="๐ท๐ฝ",construction_worker_tone4="๐ท๐พ",construction_worker_tone5="๐ท๐ฟ",mag_right="๐",bento="๐ฑ",scroll="๐",flag_nl="๐ณ๐ฑ",flag_no="๐ณ๐ด",flag_ni="๐ณ๐ฎ",european_post_office="๐ค",flag_ne="๐ณ๐ช",flag_nf="๐ณ๐ซ",flag_ng="๐ณ๐ฌ",flag_na="๐ณ๐ฆ",flag_nc="๐ณ๐จ",alien="๐ฝ",first_quarter_moon_with_face="๐",flag_nz="๐ณ๐ฟ",flag_nu="๐ณ๐บ",golfer="๐",flag_np="๐ณ๐ต",flag_nr="๐ณ๐ท",anguished="๐ง",mosque="๐",point_left_tone1="๐๐ป",ear_tone1="๐๐ป",ear_tone2="๐๐ผ",ear_tone3="๐๐ฝ",ear_tone4="๐๐พ",ear_tone5="๐๐ฟ",eight_pointed_black_star="โด",wave="๐",runner_tone5="๐๐ฟ",runner_tone4="๐๐พ",runner_tone3="๐๐ฝ",runner_tone2="๐๐ผ",runner_tone1="๐๐ป",railway_car="๐",notes="๐ถ",no_good="๐
",trackball="๐ฒ",spaghetti="๐",love_letter="๐",clipboard="๐",baby_bottle="๐ผ",bird="๐ฆ",card_index="๐",punch="๐",leo="โ",house_with_garden="๐ก",family_wwgg="๐ฉ๐ฉ๐ง๐ง",family_wwgb="๐ฉ๐ฉ๐ง๐ฆ",see_no_evil="๐",metro="๐",popcorn="๐ฟ",apple="๐",scales="โ",sleeping_accommodation="๐",clock230="๐",tools="๐ ",cloud="โ",honey_pot="๐ฏ",ballot_box="๐ณ",frog="๐ธ",camera="๐ท",crab="๐ฆ",video_camera="๐น",pencil="๐",thunder_cloud_rain="โ",mountain_bicyclist="๐ต",tangerine="๐",train="๐",rabbit="๐ฐ",baby="๐ถ",palm_tree="๐ด",capital_abcd="๐ ",put_litter_in_its_place="๐ฎ",coffin="โฐ",abcd="๐ก",lock="๐",pig2="๐",family_mwg="๐จ๐ฉ๐ง",point_right_tone5="๐๐ฟ",trumpet="๐บ",film_frames="๐",six="6โฃ",leftwards_arrow_with_hook="โฉ",earth_asia="๐",heavy_check_mark="โ",notebook="๐",taco="๐ฎ",tomato="๐
",robot="๐ค",mute="๐",symbols="๐ฃ",motorcycle="๐",thermometer_face="๐ค",paperclip="๐",moneybag="๐ฐ",neutral_face="๐",white_sun_rain_cloud="๐ฆ",snake="๐",kiss="๐",blue_car="๐",confetti_ball="๐",tram="๐",repeat_one="๐",smiley_cat="๐บ",beginner="๐ฐ",mobile_phone_off="๐ด",books="๐",["8ball"]="๐ฑ",cocktail="๐ธ",flag_ge="๐ฌ๐ช",horse_racing_tone2="๐๐ผ",flag_mh="๐ฒ๐ญ",flag_mk="๐ฒ๐ฐ",flag_mm="๐ฒ๐ฒ",flag_ml="๐ฒ๐ฑ",flag_mo="๐ฒ๐ด",flag_mn="๐ฒ๐ณ",flag_ma="๐ฒ๐ฆ",flag_mc="๐ฒ๐จ",flag_me="๐ฒ๐ช",flag_md="๐ฒ๐ฉ",flag_mg="๐ฒ๐ฌ",flag_mf="๐ฒ๐ซ",flag_my="๐ฒ๐พ",flag_mx="๐ฒ๐ฝ",flag_mz="๐ฒ๐ฟ",mountain_snow="๐",flag_mp="๐ฒ๐ต",flag_ms="๐ฒ๐ธ",flag_mr="๐ฒ๐ท",flag_mu="๐ฒ๐บ",flag_mt="๐ฒ๐น",flag_mw="๐ฒ๐ผ",flag_mv="๐ฒ๐ป",timer="โฒ",passport_control="๐",small_blue_diamond="๐น",lion_face="๐ฆ",white_check_mark="โ
",bouquet="๐",track_previous="โฎ",monkey="๐",tone4="๐พ",closed_lock_with_key="๐",family_wwb="๐ฉ๐ฉ๐ฆ",family_wwg="๐ฉ๐ฉ๐ง",tone1="๐ป",crescent_moon="๐",shell="๐",gear="โ",tone2="๐ผ",small_red_triangle_down="๐ป",nut_and_bolt="๐ฉ",umbrella2="โ",unamused="๐",fuelpump="โฝ",bed="๐",bee="๐",round_pushpin="๐",flag_white="๐ณ",microphone="๐ค",bus="๐",eight="8โฃ",handbag="๐",medal="๐
",arrows_clockwise="๐",urn="โฑ",bookmark_tabs="๐",new_moon_with_face="๐",fallen_leaf="๐",horse_racing="๐",chicken="๐",ear="๐",wheel_of_dharma="โธ",arrow_lower_right="โ",man_with_gua_pi_mao_tone5="๐ฒ๐ฟ",scorpion="๐ฆ",waning_crescent_moon="๐",man_with_gua_pi_mao_tone2="๐ฒ๐ผ",man_with_gua_pi_mao_tone1="๐ฒ๐ป",bug="๐",virgo="โ",libra="โ",angel_tone1="๐ผ๐ป",angel_tone3="๐ผ๐ฝ",angel_tone2="๐ผ๐ผ",angel_tone5="๐ผ๐ฟ",sagittarius="โ",bear="๐ป",information_desk_person_tone3="๐๐ฝ",no_mobile_phones="๐ต",hand_splayed="๐",motorboat="๐ฅ",calling="๐ฒ",interrobang="โ",oncoming_taxi="๐",flag_lt="๐ฑ๐น",flag_lu="๐ฑ๐บ",flag_lr="๐ฑ๐ท",flag_ls="๐ฑ๐ธ",flag_ly="๐ฑ๐พ",bellhop="๐",arrow_down="โฌ",flag_lc="๐ฑ๐จ",flag_la="๐ฑ๐ฆ",flag_lk="๐ฑ๐ฐ",flag_li="๐ฑ๐ฎ",ferris_wheel="๐ก",hand_splayed_tone2="๐๐ผ",large_blue_diamond="๐ท",cat2="๐",icecream="๐ฆ",tent="โบ",joy="๐",hand_splayed_tone4="๐๐พ",file_cabinet="๐",key="๐",weary="๐ฉ",bath_tone2="๐๐ผ",flag_lv="๐ฑ๐ป",low_brightness="๐
",rowboat_tone5="๐ฃ๐ฟ",rowboat_tone2="๐ฃ๐ผ",rowboat_tone3="๐ฃ๐ฝ",four_leaf_clover="๐",space_invader="๐พ",cl="๐",cd="๐ฟ",bath_tone4="๐๐พ",flag_za="๐ฟ๐ฆ",swimmer="๐",wavy_dash="ใฐ",flag_zm="๐ฟ๐ฒ",flag_zw="๐ฟ๐ผ",raised_hands_tone5="๐๐ฟ",two_hearts="๐",bulb="๐ก",cop_tone4="๐ฎ๐พ",cop_tone5="๐ฎ๐ฟ",cop_tone2="๐ฎ๐ผ",cop_tone3="๐ฎ๐ฝ",cop_tone1="๐ฎ๐ป",open_file_folder="๐",homes="๐",raised_hands_tone2="๐๐ผ",fearful="๐จ",grinning="๐",bow_tone5="๐๐ฟ",santa_tone3="๐
๐ฝ",santa_tone2="๐
๐ผ",santa_tone5="๐
๐ฟ",santa_tone4="๐
๐พ",bow_tone2="๐๐ผ",bow_tone3="๐๐ฝ",bathtub="๐",ping_pong="๐",u5272="๐น",rooster="๐",vs="๐",bullettrain_front="๐
",airplane_small="๐ฉ",white_circle="โช",balloon="๐",cross="โ",princess_tone3="๐ธ๐ฝ",speaker="๐",zipper_mouth="๐ค",u6307="๐ฏ",whale="๐ณ",pensive="๐",signal_strength="๐ถ",muscle="๐ช",rocket="๐",camel="๐ซ",boot="๐ข",flashlight="๐ฆ",spy_tone4="๐ต๐พ",spy_tone5="๐ต๐ฟ",ski="๐ฟ",spy_tone3="๐ต๐ฝ",musical_keyboard="๐น",spy_tone1="๐ต๐ป",rolling_eyes="๐",clock1="๐",clock2="๐",clock3="๐",clock4="๐",clock5="๐",clock6="๐",clock7="๐",clock8="๐",clock9="๐",doughnut="๐ฉ",dancer_tone1="๐๐ป",dancer_tone2="๐๐ผ",dancer_tone3="๐๐ฝ",candy="๐ฌ",two_men_holding_hands="๐ฌ",badminton="๐ธ",bust_in_silhouette="๐ค",writing_hand_tone2="โ๐ผ",sunflower="๐ป",["e-mail"]="๐ง",chains="โ",kissing_smiling_eyes="๐",fish_cake="๐ฅ",no_pedestrians="๐ท",v_tone4="โ๐พ",v_tone5="โ๐ฟ",v_tone1="โ๐ป",v_tone2="โ๐ผ",v_tone3="โ๐ฝ",arrow_backward="โ",clock12="๐",clock10="๐",clock11="๐",sweat="๐",mountain_railway="๐",tongue="๐
",black_square_button="๐ฒ",do_not_litter="๐ฏ",nose_tone4="๐๐พ",nose_tone5="๐๐ฟ",nose_tone2="๐๐ผ",nose_tone3="๐๐ฝ",nose_tone1="๐๐ป",horse_racing_tone5="๐๐ฟ",horse_racing_tone4="๐๐พ",horse_racing_tone3="๐๐ฝ",ok_hand="๐",horse_racing_tone1="๐๐ป",custard="๐ฎ",rowboat="๐ฃ",white_sun_small_cloud="๐ค",flag_kr="๐ฐ๐ท",cricket="๐",flag_kp="๐ฐ๐ต",flag_kw="๐ฐ๐ผ",flag_kz="๐ฐ๐ฟ",flag_ky="๐ฐ๐พ",construction="๐ง",flag_kg="๐ฐ๐ฌ",flag_ke="๐ฐ๐ช",flag_ki="๐ฐ๐ฎ",flag_kh="๐ฐ๐ญ",flag_kn="๐ฐ๐ณ",flag_km="๐ฐ๐ฒ",cake="๐ฐ",flag_wf="๐ผ๐ซ",mortar_board="๐",pig="๐ท",flag_ws="๐ผ๐ธ",person_frowning="๐",arrow_upper_right="โ",book="๐",clock1130="๐ฆ",boom="๐ฅ",["repeat"]="๐",star="โญ",rabbit2="๐",footprints="๐ฃ",ghost="๐ป",droplet="๐ง",vibration_mode="๐ณ",flag_ye="๐พ๐ช",flag_yt="๐พ๐น", } --- translate the string to emoji +-- translate emoji tags in the string, e.g. "${beer}" => unicode emoji +-- +-- @param str the string with emoji tags +-- @return the translated string +-- function emoji.translate(str) -- translate it diff --git a/xmake/core/base/fwatcher.lua b/xmake/core/base/fwatcher.lua index 3844f5877..9fc04722e 100644 --- a/xmake/core/base/fwatcher.lua +++ b/xmake/core/base/fwatcher.lua @@ -153,17 +153,30 @@ function _instance:_ensure_opened() return true end --- add watchdir +-- add a directory to watch +-- +-- @param watchdir the directory path to watch +-- @param opt the options, e.g. {recursion = true} +-- @return true on success, or false and error info +-- function fwatcher.add(watchdir, opt) return _instance:add(watchdir, opt) end --- remove watchdir +-- remove a directory from watch +-- +-- @param watchdir the directory path to remove +-- @return true on success, or false and error info +-- function fwatcher.remove(watchdir) return _instance:remove(watchdir) end --- wait event +-- wait for file system event +-- +-- @param timeout the timeout in milliseconds, -1 for infinite +-- @return the event, or nil on timeout +-- function fwatcher.wait(timeout) return _instance:wait(timeout) end diff --git a/xmake/core/base/global.lua b/xmake/core/base/global.lua index c8284b8a0..e2a5aeb25 100644 --- a/xmake/core/base/global.lua +++ b/xmake/core/base/global.lua @@ -28,7 +28,11 @@ local path = require("base/path") local utils = require("base/utils") local option = require("base/option") --- get the current given configure +-- get the global configuration value +-- +-- @param name the configuration name +-- @return the configuration value +-- function global.get(name) local value = nil if global._CONFIGS then @@ -91,7 +95,10 @@ function global.filepath() return path.join(global.directory(), xmake._NAME .. ".conf") end --- get the global configure directory +-- get the global configuration directory, e.g. "~/.xmake" +-- +-- @return the global directory path +-- function global.directory() if global._DIRECTORY == nil then local name = "." .. xmake._NAME @@ -115,7 +122,10 @@ function global.cachedir() return global.get("cachedir") or path.join(global.directory(), "cache") end --- load the global configuration +-- load the global configuration from file +-- +-- @return true on success +-- function global.load() -- load configure from the file first @@ -138,7 +148,10 @@ function global.load() return true end --- save the global configure +-- save the global configuration to file +-- +-- @return true on success, or false and error info +-- function global.save() -- the options diff --git a/xmake/core/base/graph.lua b/xmake/core/base/graph.lua index be0035394..bbaee4d58 100644 --- a/xmake/core/base/graph.lua +++ b/xmake/core/base/graph.lua @@ -549,7 +549,11 @@ function graph:_partial_topo_sort_recompute_dirty() self._partial_topo_dirty = false end --- new graph +-- create a new graph +-- +-- @param directed create a directed graph if true, undirected if false +-- @return the graph instance +-- function graph.new(directed) local gh = graph {directed} gh:clear() diff --git a/xmake/core/base/hash.lua b/xmake/core/base/hash.lua index d08a7d93b..4b37946e8 100644 --- a/xmake/core/base/hash.lua +++ b/xmake/core/base/hash.lua @@ -35,7 +35,11 @@ hash._rand32 = hash._rand32 or hash.rand32 hash._rand64 = hash._rand64 or hash.rand64 hash._rand128 = hash._rand128 or hash.rand128 --- generate md5 from the given file or data +-- generate md5 hash from the given file or data +-- +-- @param file_or_data the file path, data string, or bytes object +-- @return the hash hex string, or nil and error info +-- function hash.md5(file_or_data) local hashstr, errors if bytes.instance_of(file_or_data) then @@ -48,7 +52,11 @@ function hash.md5(file_or_data) return hashstr, errors end --- generate sha1 from the given file or data +-- generate sha1 hash from the given file or data +-- +-- @param file_or_data the file path, data string, or bytes object +-- @return the hash hex string, or nil and error info +-- function hash.sha1(file_or_data) local hashstr, errors if bytes.instance_of(file_or_data) then @@ -61,7 +69,11 @@ function hash.sha1(file_or_data) return hashstr, errors end --- generate sha256 from the given file or data +-- generate sha256 hash from the given file or data +-- +-- @param file_or_data the file path, data string, or bytes object +-- @return the hash hex string, or nil and error info +-- function hash.sha256(file_or_data) local hashstr, errors if bytes.instance_of(file_or_data) then @@ -75,11 +87,19 @@ function hash.sha256(file_or_data) end -- generate uuid, e.g "91E8ECF1-417F-4EDF-A574-E22D7D8D204A" +-- +-- @param str the seed string (optional, random if nil) +-- @return the uuid string +-- function hash.uuid(str) return hash.uuid4(str) end -- generate xxhash32 from the given file or data +-- +-- @param file_or_data the file path, data string, or bytes object +-- @return the hash hex string, or nil and error info +-- function hash.xxhash32(file_or_data) local hashstr, errors if bytes.instance_of(file_or_data) then @@ -93,6 +113,10 @@ function hash.xxhash32(file_or_data) end -- generate xxhash64 from the given file or data +-- +-- @param file_or_data the file path, data string, or bytes object +-- @return the hash hex string, or nil and error info +-- function hash.xxhash64(file_or_data) local hashstr, errors if bytes.instance_of(file_or_data) then @@ -106,6 +130,10 @@ function hash.xxhash64(file_or_data) end -- generate xxhash128 from the given file or data +-- +-- @param file_or_data the file path, data string, or bytes object +-- @return the hash hex string, or nil and error info +-- function hash.xxhash128(file_or_data) local hashstr, errors if bytes.instance_of(file_or_data) then @@ -119,6 +147,10 @@ function hash.xxhash128(file_or_data) end -- generate hash32 from string, e.g. "91e8ecf1" +-- +-- @param str the input string +-- @return the 32-bit hash hex string +-- function hash.strhash32(str) if hash._rand32 then local data = libc.ptraddr(libc.dataptr(str)) @@ -131,6 +163,10 @@ function hash.strhash32(str) end -- generate hash64 from string, e.g. "91e8ecf191e8ecf1" +-- +-- @param str the input string +-- @return the 64-bit hash hex string +-- function hash.strhash64(str) local data = libc.ptraddr(libc.dataptr(str)) local size = #str @@ -138,14 +174,21 @@ function hash.strhash64(str) end -- generate hash128 from string, e.g. "91e8ecf1417f4edfa574e22d7d8d204a" +-- +-- @param str the input string +-- @return the 128-bit hash hex string +-- function hash.strhash128(str) local data = libc.ptraddr(libc.dataptr(str)) local size = #str return hash._xxhash(128, data, size) end --- generate random32 hash --- @note it is easy to trigger hash conflicts +-- generate random 32-bit hash +-- +-- @return the random hash hex string +-- @note it is easy to trigger hash conflicts +-- function hash.rand32() if hash._rand32 then return hash._rand32() diff --git a/xmake/core/base/hashset.lua b/xmake/core/base/hashset.lua index 3342a0e60..c052d36ee 100644 --- a/xmake/core/base/hashset.lua +++ b/xmake/core/base/hashset.lua @@ -252,6 +252,10 @@ function hashset:clone() end -- construct from list of items +-- +-- @param ... the items to insert +-- @return the new hashset +-- function hashset.of(...) local result = hashset.new() local data = table.pack(...) @@ -262,6 +266,10 @@ function hashset.of(...) end -- construct from an array +-- +-- @param array the array of items to insert +-- @return the new hashset +-- function hashset.from(array) local result = hashset.new() for i = 1, #array do @@ -270,7 +278,10 @@ function hashset.from(array) return result end --- new hashset +-- create a new empty hashset +-- +-- @return the new hashset +-- function hashset.new() return hashset {{}, 0} end diff --git a/xmake/core/base/heap.lua b/xmake/core/base/heap.lua index 9b002533e..ac090c4b9 100644 --- a/xmake/core/base/heap.lua +++ b/xmake/core/base/heap.lua @@ -62,7 +62,11 @@ function heap._make(add, remove, swap, length, cmp) return push, pop, rebalance end --- cdata heap working over a cdata array +-- create a heap working over a cdata array (FFI) +-- +-- @param h the options {size = N, ctype = "int", cmp = function(a, b), data = cdata, length = 0} +-- @return push(val), pop() -> val, rebalance(index) functions +-- function heap.cdataheap(h) ffi = ffi or require("ffi") assert(h and h.size, "size expected") @@ -110,7 +114,11 @@ function heap.cdataheap(h) return h end --- value heap working over a Lua table +-- create a heap working over a Lua table +-- +-- @param h the options (optional) {cmp = function(a, b)} +-- @return the heap table with push(val), pop() -> val, rebalance(index) +-- function heap.valueheap(h) h = h or {} local t, n = h, #h diff --git a/xmake/core/base/io.lua b/xmake/core/base/io.lua index 3afd187d8..fd1350261 100644 --- a/xmake/core/base/io.lua +++ b/xmake/core/base/io.lua @@ -476,6 +476,11 @@ function _filelock:__gc() end -- read all lines from file +-- +-- @param filepath the file path +-- @param opt the options, e.g. {encoding = "utf8", continuation = "\\"} +-- @return the lines iterator +-- function io.lines(filepath, opt) opt = opt or {} if opt.close_on_finished == nil then @@ -489,6 +494,11 @@ function io.lines(filepath, opt) end -- read all data from file +-- +-- @param filepath the file path +-- @param opt the options, e.g. {encoding = "utf8"} +-- @return the file content string +-- function io.readfile(filepath, opt) opt = opt or {} local file, errors = io.open(tostring(filepath), "r", opt) @@ -525,6 +535,12 @@ function io.flush() end -- write data to file +-- +-- @param filepath the file path +-- @param data the data string +-- @param opt the options, e.g. {encoding = "utf8"} +-- @return true on success, or false and error info +-- function io.writefile(filepath, data, opt) opt = opt or {} local file, errors = io.open(tostring(filepath), "w", opt) @@ -583,6 +599,10 @@ function io.open(filepath, mode, opt) end -- open a filelock +-- +-- @param filepath the lock file path +-- @return the filelock object +-- function io.openlock(filepath) filepath = tostring(filepath) local lock = io.filelock_open(filepath) @@ -625,7 +645,13 @@ function io.convert(inputfile, outputfile, opt) return io.writefile(outputfile, content, {encoding = to}) end --- save object the the given filepath +-- save object to the given filepath +-- +-- @param filepath the file path +-- @param object the object to serialize (table, string, number, boolean) +-- @param opt the options, e.g. {orderkeys = true} +-- @return true on success, or false and error info +-- function io.save(filepath, object, opt) opt = opt or {} assert(filepath and object) @@ -659,6 +685,11 @@ function io.save(filepath, object, opt) end -- load object from the given file +-- +-- @param filepath the file path +-- @param opt the options, e.g. {encoding = "utf8"} +-- @return the deserialized object, or nil and error info +-- function io.load(filepath, opt) assert(filepath) @@ -674,6 +705,13 @@ function io.load(filepath, opt) end -- gsub the given file and return replaced data +-- +-- @param filepath the file path +-- @param pattern the lua pattern string +-- @param replace the replacement string or function +-- @param opt the options, e.g. {encoding = "utf8"} +-- @return the replaced data string, the replacement count +-- function io.gsub(filepath, pattern, replace, opt) -- read all data from file @@ -699,6 +737,13 @@ function io.gsub(filepath, pattern, replace, opt) end -- replace text of the given file and return new file data +-- +-- @param filepath the file path +-- @param pattern the plain text or lua pattern to search +-- @param replace the replacement string +-- @param opt the options, e.g. {plain = true, encoding = "utf8"} +-- @return the replaced data string, the replacement count +-- function io.replace(filepath, pattern, replace, opt) opt = opt or {} local data, errors = io.readfile(filepath, opt) @@ -745,6 +790,12 @@ function io.insert(filepath, lineidx, text, opt) end -- cat the given file +-- +-- @param filepath the file path +-- @param linecount the line count to read (optional, read all if nil) +-- @param opt the options, e.g. {encoding = "utf8"} +-- @return the file content string +-- function io.cat(filepath, linecount, opt) opt = opt or {} local file = io.open(filepath, "r", opt) diff --git a/xmake/core/base/linuxos.lua b/xmake/core/base/linuxos.lua index d9e018a36..32af1ccad 100644 --- a/xmake/core/base/linuxos.lua +++ b/xmake/core/base/linuxos.lua @@ -66,17 +66,10 @@ function linuxos._uname_r() return uname_r or nil end --- get system name +-- get linux distribution name +-- +-- @return the distribution name string, e.g. "ubuntu", "debian", "archlinux", "fedora" -- --- e.g. --- - ubuntu --- - debian --- - archlinux --- - rhel --- - centos --- - fedora --- - opensuse --- - ... function linuxos.name() local name = linuxos._NAME if name == nil then @@ -138,7 +131,10 @@ function linuxos.name() return name end --- get system version +-- get linux distribution version +-- +-- @return the semver version object +-- function linuxos.version() local version = linuxos._VERSION if version == nil then @@ -198,6 +194,9 @@ function linuxos.version() end -- get linux kernel version +-- +-- @return the semver version object +-- function linuxos.kernelver() local version = linuxos._KERNELVER if version == nil then diff --git a/xmake/core/base/list.lua b/xmake/core/base/list.lua index 5b8c43325..671d17be8 100644 --- a/xmake/core/base/list.lua +++ b/xmake/core/base/list.lua @@ -217,7 +217,10 @@ function list:ritems() return iter, self, nil end --- new list +-- create a new doubly-linked list +-- +-- @return the list instance +-- function list.new() return list() end diff --git a/xmake/core/base/macos.lua b/xmake/core/base/macos.lua index a1539061c..7afdbea8b 100644 --- a/xmake/core/base/macos.lua +++ b/xmake/core/base/macos.lua @@ -25,7 +25,10 @@ local macos = macos or {} local os = require("base/os") local semver = require("base/semver") --- get system version +-- get macOS system version +-- +-- @return the semver version object, e.g. macos.version():ge("14.0") +-- function macos.version() -- get it from cache first diff --git a/xmake/core/base/memory.lua b/xmake/core/base/memory.lua index ff52658e5..5225a3c8a 100644 --- a/xmake/core/base/memory.lua +++ b/xmake/core/base/memory.lua @@ -25,6 +25,10 @@ local memory = memory or {} local os = require("base/os") -- get memory info +-- +-- @param name the specific info name (optional), e.g. "totalsize", "availsize", "usagerate" +-- @return the memory info table or specific value (sizes in bytes, usagerate in 0.0 ~ 1.0) +-- function memory.info(name) local meminfo = memory._MEMINFO local memtime = memory._MEMTIME diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 142ddd338..9ba469505 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -577,6 +577,12 @@ function os.cp(srcpath, dstpath, opt) end -- move files or directories +-- +-- @param srcpath the source file/directory path, pattern is supported, e.g. "src/**.h" +-- @param dstpath the destination file/directory path +-- @param opt the options, e.g. {rootdir = "src"} +-- @return true on success, or false and error info +-- function os.mv(srcpath, dstpath, opt) -- check arguments @@ -602,6 +608,11 @@ function os.mv(srcpath, dstpath, opt) end -- remove files or directories +-- +-- @param filepath the file/directory path, pattern is supported, e.g. "src/**.o" +-- @param opt the options, e.g. {emptydirs = true} +-- @return true on success, or false and error info +-- function os.rm(filepath, opt) opt = opt or {} @@ -658,6 +669,10 @@ function os.ln(srcpath, dstpath, opt) end -- change to directory +-- +-- @param dir the directory path +-- @return the previous directory +-- function os.cd(dir) assert(dir) @@ -711,6 +726,10 @@ function os.touch(filepath, opt) end -- create directories +-- +-- @param dir the directory path, will create parent directories automatically +-- @return true on success, or false and error info +-- function os.mkdir(dir) -- check arguments @@ -732,6 +751,11 @@ function os.mkdir(dir) end -- remove directories +-- +-- @param dir the directory path +-- @param opt the options, e.g. {emptydirs = true} +-- @return true on success, or false and error info +-- function os.rmdir(dir, opt) -- check arguments @@ -758,6 +782,9 @@ function os.rmdir(dir, opt) end -- get the current directory +-- +-- @return the current working directory +-- function os.curdir() local curdir = os._CURDIR if curdir == nil then @@ -768,6 +795,10 @@ function os.curdir() end -- get the temporary directory +-- +-- @param opt the options, e.g. {ramdisk = false} +-- @return the temporary directory path +-- function os.tmpdir(opt) -- is in fakeroot? @note: uid always be 0 in root and fakeroot @@ -866,6 +897,11 @@ function os.run(cmd) end -- run command with arguments list +-- +-- @param program the program path or name +-- @param argv the arguments list +-- @param opt the options, e.g. {envs = {}, curdir = "", detach = false} +-- function os.runv(program, argv, opt) -- init options @@ -1101,6 +1137,12 @@ function os.iorun(cmd) end -- run command with arguments and return output and error data +-- +-- @param program the program path or name +-- @param argv the arguments list +-- @param opt the options, e.g. {envs = {}, curdir = "", stdin = ""} +-- @return the stdout data, the stderr data +-- function os.iorunv(program, argv, opt) -- make temporary output and error file @@ -1264,6 +1306,10 @@ function os.is_subarch(...) end -- get the system null device +-- +-- @param input use as input device if true, otherwise as output device +-- @return the null device path, e.g. "/dev/null" or "nul" +-- function os.nuldev(input) if input then diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua index 5af6daec9..0d2dadfba 100644 --- a/xmake/core/base/path.lua +++ b/xmake/core/base/path.lua @@ -165,8 +165,12 @@ function _instance:__todisplay() return "<path: " .. (self:empty() and "empty" or self:str()) .. ">" end --- get unix-style path, it is usually used on windows +-- get unix-style path (forward slashes), it is usually used on windows +-- +-- @param p the path +-- @return the unix-style path with forward slashes -- @see https://github.com/xmake-io/xmake/issues/4731 +-- function path.unix(p) return (tostring(p):gsub(path.sep(), "/")) end @@ -202,6 +206,11 @@ function path.normalize(p) end -- get the directory of the path +-- +-- @param p the path +-- @param sep the path separator (optional, auto-detect if nil) +-- @return the directory part, e.g. path.directory("/tmp/file.txt") => "/tmp" +-- function path.directory(p, sep) p = tostring(p) if path._directory then @@ -225,6 +234,11 @@ function path.directory(p, sep) end -- get absolute path +-- +-- @param p the path +-- @param rootdir the root directory (optional, default is os.curdir()) +-- @return the absolute path +-- function path.absolute(p, rootdir) if rootdir then rootdir = tostring(rootdir) @@ -233,6 +247,11 @@ function path.absolute(p, rootdir) end -- get relative path +-- +-- @param p the path +-- @param rootdir the root directory (optional, default is os.curdir()) +-- @return the relative path +-- function path.relative(p, rootdir) if rootdir then rootdir = tostring(rootdir) @@ -241,6 +260,11 @@ function path.relative(p, rootdir) end -- get the filename of the path +-- +-- @param p the path +-- @param sep the path separator (optional) +-- @return the filename with extension, e.g. path.filename("/tmp/file.txt") => "file.txt" +-- function path.filename(p, sep) p = tostring(p) local i = 0 @@ -257,7 +281,11 @@ function path.filename(p, sep) end end --- get the basename of the path +-- get the basename of the path (filename without extension) +-- +-- @param p the path +-- @return the basename, e.g. path.basename("/tmp/file.txt") => "file" +-- function path.basename(p) p = tostring(p) local name = path.filename(p) @@ -269,7 +297,13 @@ function path.basename(p) end end --- get the file extension of the path: .xxx +-- get the file extension of the path +-- +-- @param p the path +-- @param level the extension level (optional, default is 1) +-- @return the extension, e.g. path.extension("file.txt") => ".txt" +-- path.extension("file.tar.gz", 2) => ".tar.gz" +-- function path.extension(p, level) p = tostring(p) local i = p:lastof(".", true) @@ -288,12 +322,21 @@ function path.extension(p, level) end -- join path +-- +-- @param p the first path component +-- @param ... the remaining path components +-- @return the joined path +-- function path.join(p, ...) p = tostring(p) return path.translate(p .. path.sep() .. table.concat({...}, path.sep())) end -- split path by the separator +-- +-- @param p the path +-- @return the path components table +-- function path.split(p) p = tostring(p) return p:split("[/\\]") @@ -319,8 +362,11 @@ function path.envsep() return envsep end --- split environment variable with `path.envsep()`, --- also handles more speical cases such as posix flags and windows quoted paths +-- split environment variable with `path.envsep()` +-- +-- @param env_path the environment variable value, e.g. "/usr/bin:/usr/local/bin" +-- @return the paths table +-- function path.splitenv(env_path) local result = {} if xmake._HOST == "windows" then @@ -356,8 +402,12 @@ function path.splitenv(env_path) return result end --- concat environment variable with `path.envsep()`, --- also handles more speical cases such as posix flags and windows quoted paths +-- concat environment variable with `path.envsep()` +-- +-- @param paths the paths table +-- @param envsep the separator (optional, default is path.envsep()) +-- @return the joined environment variable string +-- function path.joinenv(paths, envsep) if not paths or #paths == 0 then return "" diff --git a/xmake/core/base/privilege.lua b/xmake/core/base/privilege.lua index f99fac573..c00a82e3c 100644 --- a/xmake/core/base/privilege.lua +++ b/xmake/core/base/privilege.lua @@ -24,7 +24,10 @@ local privilege = privilege or {} -- load modules local os = require("base/os") --- store privilege +-- store current privilege by dropping root to original user +-- +-- @return true if privilege was stored, false if not root +-- function privilege.store() -- check if root @@ -73,10 +76,17 @@ function privilege.store() end -- check if has stored privilege +-- +-- @return true if privilege was previously stored +-- function privilege.has() return privilege._HAS_PRIVILEGE or false end +-- restore root privilege temporarily +-- +-- @return true if privilege was restored +-- function privilege.get() -- has? diff --git a/xmake/core/base/queue.lua b/xmake/core/base/queue.lua index e5b6980d1..e7f306c11 100644 --- a/xmake/core/base/queue.lua +++ b/xmake/core/base/queue.lua @@ -116,7 +116,10 @@ function queue:clone() return q end --- new queue +-- create a new FIFO queue +-- +-- @return the queue instance +-- function queue.new() return queue() end diff --git a/xmake/core/base/semver.lua b/xmake/core/base/semver.lua index 5858ef7c2..7c2b6ea8d 100644 --- a/xmake/core/base/semver.lua +++ b/xmake/core/base/semver.lua @@ -191,7 +191,11 @@ function _instance.__concat(op1, op2) end end --- new an instance +-- create a new semver instance +-- +-- @param version the version string, e.g. "1.2.3", ">=1.0 <2.0" +-- @return the semver instance, or nil and error info +-- function semver.new(version) -- parse version first @@ -207,6 +211,12 @@ function semver.new(version) end -- try to match valid version from string +-- +-- @param str the input string +-- @param pos the start position (optional, default is 1) +-- @param pattern the match patterns (optional) +-- @return the semver instance, or nil if not found +-- function semver.match(str, pos, pattern) local patterns = pattern or {"%d+[.]%d+[-+.%w]*", "%d+[.]%d+[.]%d+", "%d+[.]%d+"} for _, pattern in ipairs(table.wrap(patterns)) do diff --git a/xmake/core/base/signal.lua b/xmake/core/base/signal.lua index ee1094c52..a647204ef 100644 --- a/xmake/core/base/signal.lua +++ b/xmake/core/base/signal.lua @@ -28,16 +28,26 @@ local os = require("base/os") signal.SIGINT = 2 -- register signal handler +-- +-- @param signo the signal number, e.g. signal.SIGINT +-- @param handler the handler function +-- function signal.register(signo, handler) os.signal(signo, handler) end --- reset signal, SIGDFL +-- reset signal to default handler (SIGDFL) +-- +-- @param signo the signal number +-- function signal.reset(signo) os.signal(signo, 1) end --- ignore signal, SIGIGN +-- ignore signal (SIGIGN) +-- +-- @param signo the signal number +-- function signal.ignore(signo) os.signal(signo, 2) end diff --git a/xmake/core/base/singleton.lua b/xmake/core/base/singleton.lua index 92be76664..2b4db4494 100644 --- a/xmake/core/base/singleton.lua +++ b/xmake/core/base/singleton.lua @@ -45,6 +45,10 @@ local singleton = singleton or {} -- return instance -- end -- +-- @param key the singleton key (string or function) +-- @param init the initializer function (optional) +-- @return the singleton instance, inited (true if already initialized) +-- function singleton.get(key, init) -- get key diff --git a/xmake/core/base/socket.lua b/xmake/core/base/socket.lua index 901226ec9..fb4536e24 100644 --- a/xmake/core/base/socket.lua +++ b/xmake/core/base/socket.lua @@ -744,23 +744,40 @@ function socket.open(socktype, family) end -- open tcp socket +-- +-- @param opt the options, e.g. {family = socket.IPV6} +-- @return the socket instance, or nil and error info +-- function socket.tcp(opt) opt = opt or {} return socket.open(socket.TCP, opt.family or socket.IPV4) end -- open udp socket +-- +-- @param opt the options, e.g. {family = socket.IPV6} +-- @return the socket instance, or nil and error info +-- function socket.udp(opt) opt = opt or {} return socket.open(socket.UDP, opt.family or socket.IPV4) end --- open unix socket +-- open unix domain socket +-- +-- @return the socket instance, or nil and error info +-- function socket.unix(opt) return socket.open(socket.TCP, socket.UNIX) end -- open and bind tcp socket +-- +-- @param addr the bind address, e.g. "0.0.0.0", "127.0.0.1" +-- @param port the bind port +-- @param opt the options (optional) +-- @return the bound socket, or nil and error info +-- function socket.bind(addr, port, opt) local sock, errors = socket.tcp(opt) if not sock then @@ -775,6 +792,11 @@ function socket.bind(addr, port, opt) end -- open and bind tcp socket from the unix address +-- +-- @param addr the unix socket path +-- @param opt the options (optional) +-- @return the bound socket, or nil and error info +-- function socket.bind_unix(addr, opt) local sock, errors = socket.unix(opt) if not sock then @@ -789,6 +811,12 @@ function socket.bind_unix(addr, opt) end -- open and connect tcp socket +-- +-- @param addr the server address +-- @param port the server port +-- @param opt the options (optional) +-- @return the connected socket, or nil and error info +-- function socket.connect(addr, port, opt) local sock, errors = socket.tcp(opt) if not sock then @@ -803,6 +831,11 @@ function socket.connect(addr, port, opt) end -- open and connect tcp socket from the unix address +-- +-- @param addr the unix socket path +-- @param opt the options (optional) +-- @return the connected socket, or nil and error info +-- function socket.connect_unix(addr, opt) local sock, errors = socket.unix(opt) if not sock then diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua index 45cb4f23d..6be5893d6 100644 --- a/xmake/core/base/table.lua +++ b/xmake/core/base/table.lua @@ -89,7 +89,11 @@ if xmake._ARCH:startswith("arm") then end end --- join all objects and tables +-- join all objects and tables into a new table +-- +-- @param ... the tables or values to join +-- @return the new joined table +-- function table.join(...) local result = {} for _, t in ipairs({...}) do @@ -105,7 +109,12 @@ function table.join(...) return result end --- join all objects and tables to self +-- join all objects and tables to self (in-place) +-- +-- @param self the destination table +-- @param ... the tables or values to append +-- @return the destination table +-- function table.join2(self, ...) for _, t in ipairs({...}) do if type(t) == "table" and not t.__wrap_locked__ then @@ -189,6 +198,10 @@ function table.copy2(self, copied) end -- inherit interfaces and create a new instance +-- +-- @param ... the base classes to inherit from +-- @return the new instance with inherited interfaces +-- function table.inherit(...) local classes = {...} local instance = {} @@ -240,6 +253,13 @@ function table.inherit2(self, ...) end -- slice table array +-- +-- @param self the source array +-- @param first the start index (default: 1) +-- @param last the end index (default: #self) +-- @param step the step (default: 1) +-- @return the sliced array +-- function table.slice(self, first, last, step) local sliced = {} for i = first or 1, last or #self, step or 1 do @@ -258,8 +278,12 @@ function table.is_dictionary(dict) return type(dict) == "table" and dict[1] == nil end --- does contain the given values in table? --- contains arg1 or arg2 ... +-- does the table contain any of the given values? +-- +-- @param t the table +-- @param ... the values to check (returns true if any is found) +-- @return true if any value is found +-- function table.contains(t, arg1, arg2, ...) local found = false if arg2 == nil then -- only one value @@ -325,7 +349,11 @@ function table.to_array(iterator, state, var) return result, count end --- unwrap array if be only one value +-- unwrap array, return the value directly if only one element +-- +-- @param array the array table +-- @return the single value, or the original array if multiple elements +-- function table.unwrap(array) if type(array) == "table" and not array.__wrap_locked__ then if #array == 1 then @@ -335,7 +363,11 @@ function table.unwrap(array) return array end --- wrap value to array +-- wrap value to array, ensure the result is always a table +-- +-- @param value the value (nil returns {}, table returns as-is, other wraps in {}) +-- @return the array table +-- function table.wrap(value) if nil == value then return {} @@ -365,7 +397,12 @@ function table.wrap_unlock(value) return value end --- remove repeat from the given array +-- remove duplicate values from the given array +-- +-- @param array the array table +-- @param barrier keep order with barrier? (optional) +-- @return the deduplicated array +-- function table.unique(array, barrier) if table.is_array(array) then if table.getn(array) ~= 1 then @@ -430,6 +467,10 @@ end table.unpack = table.unpack or unpack -- get keys of a table +-- +-- @param tbl the table +-- @return the keys array +-- function table.keys(tbl) local keyset = {} local n = 0 @@ -440,7 +481,12 @@ function table.keys(tbl) return keyset, n end --- get order keys of a table +-- get sorted keys of a table +-- +-- @param tbl the table +-- @param callback the sort comparator function (optional) +-- @return the sorted keys array +-- function table.orderkeys(tbl, callback) local callback = type(callback) == "function" and callback or nil local keys = table.keys(tbl) @@ -475,6 +521,10 @@ function table.orderpairs(t, callback) end -- get values of a table +-- +-- @param tbl the table +-- @return the values array +-- function table.values(tbl) local valueset = {} local n = 0 @@ -514,6 +564,11 @@ function table.reverse(arr) end -- remove values if predicate is matched +-- +-- @param tbl the table +-- @param pred the predicate function, e.g. function(v, k) return v == "xxx" end +-- @return the modified table +-- function table.remove_if(tbl, pred) if table.is_array(tbl) then for i = #tbl, 1, -1 do @@ -537,6 +592,11 @@ function table.empty(tbl) end -- return indices or keys for the given value +-- +-- @param tbl the table +-- @param value the value to find +-- @return the index/key, or nil if not found +-- function table.find(tbl, value) local result if table.is_array(tbl) then diff --git a/xmake/core/base/text.lua b/xmake/core/base/text.lua index ec316475e..9d4294ee6 100644 --- a/xmake/core/base/text.lua +++ b/xmake/core/base/text.lua @@ -160,7 +160,13 @@ function text._lastwbr(str, width, wordbreak) end end --- break lines +-- break text into lines at the given width with word wrapping +-- +-- @param str the text string or lines array +-- @param width the maximum line width in characters +-- @param opt the options (optional) +-- @return the wrapped lines array +-- function text.wordwrap(str, width, opt) opt = opt or {} diff --git a/xmake/core/base/thread.lua b/xmake/core/base/thread.lua index 26ac672c3..067b92f3f 100644 --- a/xmake/core/base/thread.lua +++ b/xmake/core/base/thread.lua @@ -968,11 +968,18 @@ function thread.new(callback, opt) end -- get the running thread name +-- +-- @return the current thread name +-- function thread.running() return thread._RUNNING end --- open a mutex +-- create a mutex for thread synchronization +-- +-- @param name the mutex name for debugging +-- @return the mutex instance, or nil and error info +-- function thread.mutex(name) local mutex = thread.mutex_init() if mutex then @@ -982,7 +989,11 @@ function thread.mutex(name) end end --- open a event +-- create an event for thread signaling +-- +-- @param name the event name for debugging +-- @return the event instance, or nil and error info +-- function thread.event(name) local event = thread.event_init() if event then @@ -992,7 +1003,12 @@ function thread.event(name) end end --- open a semaphore +-- create a semaphore for thread synchronization +-- +-- @param name the semaphore name for debugging +-- @param value the initial value (default: 0) +-- @return the semaphore instance, or nil and error info +-- function thread.semaphore(name, value) local semaphore = thread.semaphore_init(value or 0) if semaphore then @@ -1002,7 +1018,11 @@ function thread.semaphore(name, value) end end --- open a queue +-- create a thread-safe queue +-- +-- @param name the queue name for debugging +-- @return the queue instance, or nil and error info +-- function thread.queue(name) local queue = thread.queue_init() if queue then @@ -1012,7 +1032,11 @@ function thread.queue(name) end end --- open a sharedata +-- create a thread-safe shared data container +-- +-- @param name the sharedata name for debugging +-- @return the sharedata instance, or nil and error info +-- function thread.sharedata(name) local sharedata = thread.sharedata_init() if sharedata then diff --git a/xmake/core/base/tty.lua b/xmake/core/base/tty.lua index c3681cdd3..bd7b60277 100644 --- a/xmake/core/base/tty.lua +++ b/xmake/core/base/tty.lua @@ -355,7 +355,10 @@ function tty._find_shell_from_parent() end end --- get shell name +-- get shell name, e.g. "bash", "zsh", "powershell", "cmd", "nu" +-- +-- @return the shell name string +-- function tty.shell() local shell = tty._SHELL if shell == nil then @@ -464,7 +467,10 @@ function tty.term() return tty._TERM end --- has emoji? +-- does the terminal support emoji? +-- +-- @return true if supported +-- function tty.has_emoji() local has_emoji = tty._HAS_EMOJI if has_emoji == nil then diff --git a/xmake/core/base/winos.lua b/xmake/core/base/winos.lua index 9d786fdfc..d43f08262 100644 --- a/xmake/core/base/winos.lua +++ b/xmake/core/base/winos.lua @@ -33,6 +33,10 @@ winos._registry_keys = winos._registry_keys or winos.registry_keys winos._registry_values = winos._registry_values or winos.registry_values winos._processes = winos._processes or winos.processes +-- get the ANSI code page +-- +-- @return the code page number +-- function winos.ansi_cp() if not winos._ANSI_CP then winos._ANSI_CP = winos._ansi_cp() @@ -40,6 +44,10 @@ function winos.ansi_cp() return winos._ANSI_CP end +-- get the OEM code page +-- +-- @return the code page number +-- function winos.oem_cp() if not winos._OEM_CP then winos._OEM_CP = winos._oem_cp() @@ -114,7 +122,10 @@ function winos._version_le(self, version) end end --- get system version +-- get windows system version +-- +-- @return the version object, e.g. winos.version():major(), winos.version():eq("win10") +-- function winos.version() local winver = winos._VERSION if winver == nil then @@ -156,6 +167,11 @@ function winos.version() end -- get command arguments on windows to solve 8192 character command line length limit +-- +-- @param argv the arguments list +-- @param opt the options, e.g. {program = "cl.exe", wrapflag = "@"} +-- @return the program, the new arguments list (may use @file) +-- function winos.cmdargv(argv, opt) -- too long arguments? diff --git a/xmake/core/project/config.lua b/xmake/core/project/config.lua index 93c1ff6af..451bfe8ae 100644 --- a/xmake/core/project/config.lua +++ b/xmake/core/project/config.lua @@ -69,7 +69,11 @@ function config._is_value(value, ...) return false end --- get the current given configuration +-- get the current given configuration value +-- +-- @param name the configuration name, e.g. "plat", "arch", "mode" +-- @return the configuration value +-- function config.get(name) local value = nil if config._CONFIGS then @@ -105,17 +109,26 @@ function config.set(name, value, opt) end end --- get the current platform +-- get the current platform, e.g. "windows", "linux", "macosx" +-- +-- @return the platform name +-- function config.plat() return config.get("plat") end --- get the current architecture +-- get the current architecture, e.g. "x86_64", "arm64" +-- +-- @return the architecture name +-- function config.arch() return config.get("arch") end --- get the current mode +-- get the current build mode, e.g. "debug", "release" +-- +-- @return the mode name +-- function config.mode() return config.get("mode") end @@ -189,6 +202,9 @@ function config.cachedir() end -- get the configure directory on the current host/arch platform +-- +-- @return the configuration cache directory, e.g. ".xmake/macosx/x86_64" +-- function config.directory() if config._DIRECTORY == nil then local rootdir = os.getenv("XMAKE_CONFIGDIR") diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 7058b4190..f9e199a1b 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -818,6 +818,9 @@ function project.rcfiles() end -- get the project directory +-- +-- @return the project root directory path +-- function project.directory() return os.projectdir() end @@ -862,6 +865,9 @@ function project.extraconf(name, item, key) end -- get the project name +-- +-- @return the project name string defined by set_project() +-- function project.name() local name = project.get("project") -- TODO multi project names? we only get the first name now. @@ -987,7 +993,12 @@ function project.is_loaded() return project._memcache():get("targets_loaded") end --- get the given target +-- get the given target by name +-- +-- @param name the target name +-- @param opt the options (optional) +-- @return the target instance, or nil if not found +-- function project.target(name, opt) opt = opt or {} local targets = project.targets() @@ -1009,7 +1020,10 @@ function project.target_add(t) end end --- get targets +-- get all targets +-- +-- @return the targets table {name = target_instance, ...} +-- function project.targets() local loading = false local targets = project._memcache():get("targets") @@ -1079,6 +1093,9 @@ function project.required_package(name) end -- get required packages +-- +-- @return the required packages table {name = package_instance, ...} +-- function project.required_packages() local requires = project._memcache():get("requires") if not requires then diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua index 1afa7165e..e00505a4f 100644 --- a/xmake/core/tool/compiler.lua +++ b/xmake/core/tool/compiler.lua @@ -117,6 +117,11 @@ function compiler._load_tool(sourcekind, target) end -- load the compiler from the given source kind +-- +-- @param sourcekind the source kind, e.g. "cc", "cxx", "mm", "mxx", "as", "gc", "dc", "rc", "sc", "cs" +-- @param target the target or options table, e.g. {target = target} +-- @return the compiler instance, or nil and error info +-- function compiler.load(sourcekind, target) if not sourcekind then return nil, "unknown source kind!" @@ -204,6 +209,11 @@ function compiler.load(sourcekind, target) end -- build the source files (compile and link) +-- +-- @param sourcefiles the source file paths +-- @param targetfile the target file path +-- @param opt the options, e.g. {target = target, configs = {}} +-- function compiler:build(sourcefiles, targetfile, opt) opt = opt or {} @@ -265,6 +275,11 @@ function compiler:buildcmd(sourcefiles, targetfile, opt) end -- compile the source files +-- +-- @param sourcefiles the source file paths +-- @param objectfile the output object file path +-- @param opt the options, e.g. {target = target, compflags = {}, dependinfo = {}} +-- function compiler:compile(sourcefiles, objectfile, opt) opt = opt or {} diff --git a/xmake/core/tool/linker.lua b/xmake/core/tool/linker.lua index 443e10d43..9cdff8840 100644 --- a/xmake/core/tool/linker.lua +++ b/xmake/core/tool/linker.lua @@ -115,6 +115,12 @@ function linker._load_tool(targetkind, sourcekinds, target) end -- load the linker from the given target kind +-- +-- @param targetkind the target kind, e.g. "binary", "shared", "static" +-- @param sourcekinds the source kinds table, e.g. {"cc", "cxx"} +-- @param target the target instance +-- @return the linker instance, or nil and error info +-- function linker.load(targetkind, sourcekinds, target) assert(sourcekinds) @@ -227,6 +233,11 @@ function linker.load(targetkind, sourcekinds, target) end -- link the target file +-- +-- @param objectfiles the object file paths +-- @param targetfile the target file path +-- @param opt the options, e.g. {target = target, linkflags = {}} +-- function linker:link(objectfiles, targetfile, opt) opt = opt or {} local linkflags = opt.linkflags or self:linkflags(opt) diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua index 35be6b824..5ca360492 100644 --- a/xmake/core/tool/toolchain.lua +++ b/xmake/core/tool/toolchain.lua @@ -722,7 +722,12 @@ function toolchain.add_directories(...) toolchain._DIRS = table.unique(dirs) end --- load toolchain +-- load toolchain by name +-- +-- @param name the toolchain name, e.g. "gcc", "clang", "msvc", "dotnet" +-- @param opt the options, e.g. {plat = "linux", arch = "x86_64"} +-- @return the toolchain instance, or nil and error info +-- function toolchain.load(name, opt) opt = opt or {} diff --git a/xmake/modules/core/project/depend.lua b/xmake/modules/core/project/depend.lua index ca05dc2f4..71e50a56a 100644 --- a/xmake/modules/core/project/depend.lua +++ b/xmake/modules/core/project/depend.lua @@ -51,6 +51,11 @@ function _get_depfiles_parser(depfiles_format) end -- load dependent info from the given file (.d) +-- +-- @param dependfile the depend file path +-- @param opt the options, e.g. {target = target} +-- @return the depend info table, or nil if not found +-- function load(dependfile, opt) if os.isfile(dependfile) then -- may be the depend file has been incomplete when if the compilation process is abnormally interrupted @@ -83,6 +88,10 @@ function _is_show_diagnosis_info() end -- save dependent info to file +-- +-- @param dependinfo the depend info table {files = {}, values = {}} +-- @param dependfile the depend file path +-- function save(dependinfo, dependfile) io.save(dependfile, dependinfo) end |
