Compare commits

...
Author SHA1 Message Date
Alug 677e381a2c dont send server icon if current map is supposed to be hidden
in line with kart not sending maptitle to ms in the same case
2025-09-15 16:16:43 +02:00
Gustaf Alhäll 01b24e5417 Fix use-after-free when listing servers 2025-09-08 18:08:45 +02:00
Alug f86a99cd1b Merge branch 'Saturn-Next' into servericonpack 2025-09-03 12:33:56 +02:00
Alug 85cac497ea fixup building map title string for serverinfo
fixes numerous issues, like zonetitle not appearing on bots and serverinfo screen
and generally making this more sane by appending stuff if needed
also fixes "Zone" not displaying in serverinfo screen
2025-09-03 12:33:49 +02:00
Alug 92d6c2b7b0 make patch/pixel conversion account for padding data/no data
just set everything to transparent pixel 247 (0xf7)
so we neither write nor read garbage data and just can cut it out as transparent during pixel to patch conversion
2025-09-03 12:32:32 +02:00
Alug f67f8e7dbf cache patch width
just to avoid some cache misses in a somewhat tight lööp
2025-09-02 22:20:37 +02:00
indev 6adf39b460 Don't check for opengl in NOHW/DEDICATED builds 2025-09-02 23:01:07 +03:00
Alug e160427108 add smol comment 2025-09-02 21:38:10 +02:00
Alug 275d28c9c6 implement map icon request counter/limit
tries 5 times then gives up
this is just since vanilla clients do not send anything back to us so this would endlessly retry which is pointless
can be adjusted if needed
2025-09-02 21:27:32 +02:00
Alug 2a848e32e4 port map icon packet for serverinfo screen
based on https://codeberg.org/srb2classic/srb2classic/pulls/134

with adjustments
many thanks for the help @indev450 ! <3
2025-09-02 21:27:28 +02:00
indev 6af09bd215 Add offset for small nametags in opengl without shearing enabled 2025-09-01 19:56:42 +03:00
Gustaf Alhäll 015d9208e3 Refactor software blitting logic 2025-09-01 18:24:53 +02:00
Alug 94d01d1ee9 check clientcfg packet length to skip potential garbage data
dont think this ever broke, but better safe than sorry
2025-08-30 14:43:04 +02:00
indev 7e5acd72c1 Make replay search textbox fit on all resolutions 2025-08-28 15:37:03 +03:00
Alug 6017543666 dont try to make glpatch from nothing 2025-08-24 23:01:48 +02:00
indev 3af0009453 Fix off-by-one in M_FindFirstMap 2025-08-20 16:18:33 +03:00
Alug 145eecf8a4 move sprite reset stuff into R_ResetMobjInterpolationState
this also gets called at the start of the tic
and sets a bunch of rendering crap eitherways
so we can save another thinker loop and a bunch of checks with this
bit of perf gain, 3-4fps on that awful hadal trench timedemo
2025-08-19 11:49:29 +02:00
Alug 684a43a95c fix software extra 3d floors
lmao was a copy paste oopsie from ages ago
shoutout to phoenix´s new map making me find this
2025-08-18 16:49:36 +02:00
Alug 4fcb41f659 mark stuff for blitting loop as const and with register
gives another 5-7fps or so for me
2025-08-17 18:19:20 +02:00
Alug 8d1ef1721f port srb2classic´s sdl blitting stuff for software
all credits to hanicef
mostly from https://codeberg.org/srb2classic/srb2classic/commit/a1fa0b89dbf75ef8be17c9ca5c728cc9c1848582
and
https://codeberg.org/srb2classic/srb2classic/commit/a1cf54e66ad1cb66af99056bc940fc68dce24224

boosts my fps around 20-25 fps
2025-08-16 22:20:58 +02:00
Alug 02ffceb300 fix rotating polyobject interpolation 2025-08-16 22:20:55 +02:00
Alug 44fe156751 update comment for lightcontrast 2025-08-16 22:20:52 +02:00
Alug aca48d69cd style fixes 2025-08-16 22:20:48 +02:00
Alug 294ce055cd mark this with restrict 2025-08-16 22:20:33 +02:00
Alug 4117eb5b40 fix Paranoia compile 2025-08-16 22:20:30 +02:00
Alug a9068ee162 mark this with "noreturn"
clang kept yelling for some reason
2025-08-16 22:20:27 +02:00
indev 9549a204a5 Add tooltip for centered chat text 2025-08-15 22:57:09 +03:00
indev c276736002 Add option to center text in chat (chatcentertext) 2025-08-15 21:51:58 +03:00
Alug b5dfe74cfe add USECLANG compile flag to force building with clang 2025-08-15 08:01:58 +02:00
Alug 6c891f1146 supress align and unkown pragma warnings in clang 2025-08-15 08:01:56 +02:00
Alug 7d06f59da5 append those to LDFLAGS instead of libs
so they may be passed to other things
2025-08-15 08:01:47 +02:00
Alug 9dee0f0ea8 fix restrict being in wrong place in declaration R_DrawColumnPixel 2025-08-15 08:01:37 +02:00
Alug 9338b5b10f dont need to realloc this
didnt see when i added realloc everywhere this doesent need to keep old data
2025-08-14 16:19:17 +02:00
Gustaf Alhäll b7ecffedcd Fix pixel shift caused by negative pixel positioning in software 2025-08-13 22:44:25 +02:00
Alug 7deeb4486f port RR camera slope pitch stuff + make it toggable
"cam_pitch" this makes the camera pitch on upwards and downwards slopes a bit
2025-08-13 18:01:00 +02:00
Alug 602bd1a010 fix directional light stuff 2025-08-12 20:29:13 +02:00
Alug f57b8092fc dont need to reinit those gl vars 2025-08-12 20:29:10 +02:00
Alug ca04e084a2 link stdc++. pthread and gcclib statically on windows
fixes the game throwing super cryptic errors when you dont have the right dlls
2025-08-09 23:32:03 +01:00
Alug ff6279a406 add P_GetLocalPlayerForNum
just to get rid of ternaries lel
2025-08-09 17:21:08 +02:00
Alug c36f64e97b use memcmp for legacy sky check
just gotta know if first three letters match it
2025-08-09 17:21:05 +02:00
Alug 7b776f01bd change flow of K_drawKartStats a bit
nothing notable, just the non splitscreen path will return early now
2025-08-08 22:43:43 +02:00
Alug 43b7492300 disable pointless "Couldn't read mobj_t" warnings in replays
mobjs just cannot be unarchived in replays ever
so this will always spam those for something that WILL never work in kart
maybe if i decide to fix this for 32p or smth those become useful again
2025-08-08 22:29:29 +02:00
indev 1fe79fe236 Add -strict, -strict-soc and -strict-lua cli params
Both trigger I_Error if a warning occurs during addon load in a SOC or lua
script
2025-08-08 18:59:07 +03:00
Alug 222b63d2c3 move the windoze thing to windoze makefile 2025-08-08 17:53:25 +02:00
indev a7c41b458a Use NOLIBGME instead of NOGME 2025-08-08 18:33:24 +03:00
indev 3901c7c7da Revert "Fix makefiles checking for NOLIBGME instead of NOGME"
This reverts commit 932a08b2da.
2025-08-08 18:31:45 +03:00
indev 932a08b2da Fix makefiles checking for NOLIBGME instead of NOGME 2025-08-08 18:29:05 +03:00
indev 4c97a4f9e0 Fix potential buffer overflow in DEH_LoadDehackedFile 2025-08-08 17:53:46 +03:00
indev a1d16b4613 Update dedicated/i_sound.c I_StartSound and I_UpdateSoundParams 2025-08-08 17:43:40 +03:00
Alug 16e1e00c67 "reenable" midi support
well it was never really disabled, but like this we can atleast change its volume lel
menu entry is still disabled, i dont think theres a single map with midi music, so this would just clutter the menu
2025-08-08 00:55:06 +02:00
Alug b76fc9699a fixup midi menu stuff
i love M_DrawSkyRoom
2025-08-08 00:55:03 +02:00
indev cb3638e3ab Add SetupVote hook 2025-08-07 23:48:11 +03:00
Alug e85d91e682 save a few checks for st debug drawer
if we dont use it
2025-08-07 22:27:28 +02:00
Alug 2653b59af4 dont double free our vote patches
those may point to the same thing so uhhhh
PU_PATCH_LOWPRIORITY will ensure the memory will be freed on mapload
2025-08-07 22:26:27 +02:00
Alug caff071a1b fix spacing in Z_CheckHeap errors 2025-08-07 22:10:03 +02:00
Alug 40165fd6db make leveltitlecard be affected by colour hud 2025-08-07 19:42:39 +02:00
Alug c701e1fe7e make inputdisplay colour match the rest of colourhud better 2025-08-07 19:38:03 +02:00
Alug 525e19566e smol refactor hwr precache
not faster or anything
real time consuming thing is he actual calls to getetxture and getflat
2025-08-07 19:38:00 +02:00
Alug 27e734bde0 make music toggle/volume handling less of a mess
based on work in srb2 from sphere
this gets rid of all the duplicated midi stuff
since we dont really have a whole midi soundtrack like srb2, S_GetMusicLumpNum will always prefer non midi music
2025-08-06 19:49:35 +02:00
Alug bd53786887 fix LoadElevatorThinker interp oopsie 2025-08-06 00:12:34 +02:00
Alug ad1b1eabe4 fix levelstuff not being interpolated on netgame join or resynch
i love polyobjects
2025-08-06 00:10:47 +02:00
Alug e120907e0f make driftgauge stuff a bit more readable 2025-08-03 20:12:13 +02:00
Alug b0c217201e move flat cyan check into a function
and also limit it to software renderer only
we dont need this anywhere else, so can save a bit of work
2025-08-03 15:59:57 +02:00
Alug dac7026739 use R_GetFlat here
does the exact same thing
2025-08-03 15:59:23 +02:00
Alug 91a4646f19 dont PU_CACHE our planeflats 2025-08-03 15:51:52 +02:00
Alug eba5965220 move rainbow color calc into K_Rainbowcolor 2025-08-03 14:42:49 +02:00
Alug a9d0e2154b clamp software lightlevels before shifting it
was a little oopsie porting this over
,after shifting we only get 32 lightlevels
decided to clamp this in range aswell, just incase
2025-08-02 19:13:23 +02:00
Alug 16a0953d1d fix the "is valid for C/ObjC but not for C++" warnings
fixes https://github.com/Indev450/SRB2Kart-Saturn/issues/192
2025-08-02 01:54:57 +02:00
Alug 737ae08355 dont need to reinit those ever 2025-08-02 01:01:06 +02:00
Alug 6d83a7e187 remove usefulness and volume from sfxinfo_struct struct
those are unused anyways, hope this doesent break shit lol
2025-08-02 01:00:58 +02:00
Alug 56df9b6af3 who tf needs 999999999 sound channels
:chaobaba:
even 255 are kinda overkill lol
2025-08-02 01:00:51 +02:00
Alug 7f2435d821 add an Accessibility options menu
still a work in progress, feel free to suggest more things to add!
2025-08-01 22:26:00 +02:00
Alug b180f29fd9 readd secbright to menu
into advanced video options menu
2025-08-01 21:27:38 +02:00
Alug 32c85f96a4 remove secbright from menu
need to slot it somewhere else but little too lazy atm
2025-08-01 21:27:35 +02:00
chromaticpipe ec83c60320 Configurable sector brightness in software 2025-08-01 21:27:32 +02:00
chromaticpipe fb4a912dba Clamp the lightlevel at the start of HWR_Lighting()
Allows secbright to work without shaders
2025-08-01 21:27:29 +02:00
James R 123b2aa60b lua_hooklib.c: refactor HUD hook call 2025-08-01 21:04:30 +02:00
Logan Aerl Arias bd82a8db29 Update lauxlib.h
lauxlib.h: mark luaL_error as a REPORT function
2025-08-01 21:04:27 +02:00
Alug 6f71fc17c2 mark this as unlikely
those will never run ever after displaying once
2025-08-01 21:04:24 +02:00
Alug d8c3e9f41c fix windows being unable to link with LTO and openmpt
idk why this works but it does, mirrors how it was before the new makefiles
2025-08-01 17:55:02 +01:00
Alug e10345b4de pass "-g" again for lto and asan on windows
for some weird reason it will omit all debug symbols otherwise, which we need for crashlogs and stuff
2025-08-01 17:31:12 +01:00
Alug 2ab66b113c we dont need cv_samplerate with sdl mixer 2025-08-01 04:51:00 +02:00
Alug f64263cf6f remove some unused stuff s_sound 2025-08-01 04:50:57 +02:00
Alug 55c72f32da rename buffersize to audiobuffersize
buffersize was not a good name lel
2025-08-01 04:50:54 +02:00
Alug 53bc12baad init "lenght" in S_AddSoundFx
seems like this never init this lel
2025-08-01 03:58:41 +02:00
Alug b391e763bc fix gme 2025-08-01 03:56:47 +02:00
Alug 2bae0bdb0f indent deez 2025-07-31 23:34:29 +02:00
Alug d42df54901 fix borderless sometimes not toggling on windows
idk why windoze is like this, but gotta call this after SDL_SetWindowFullscreen here
2025-07-31 23:34:28 +02:00
Alug e6256d448f TEST: banish LUA_Step
checking stuff there never seemed to be any garbage left here
so we can just skip this
2025-07-31 21:23:33 +02:00
Alug ad1a980eb1 memset listener outside the loop S_StartSoundAtVolume
same effect, but we dont need to call it multiple times and can be sure this is never unitialized
2025-07-31 19:55:29 +02:00
Alug 1b50858fa6 add a configurable same sound limit
inspired by dsda-doom
in alot of cases the game may play a crapton of the same sound at once, becoming unbearably loud
2025-07-31 19:42:56 +02:00
Alug 3276bbb7b6 restore mumble postional sounds for displayplayers
we essentially always passed 0 before lol
2025-07-31 19:42:53 +02:00
Alug dc00fa3429 fix passing garbage to mumble outside of levels
this just deadass passed the unitialized listener array into mumble
2025-07-31 19:42:37 +02:00
indev dc9276b73c Make 'visit mb.srb2.org/addons' text fit on default resolution ('& make' bit refers more to wiki than mb anyway) 2025-07-31 13:33:48 +03:00
Alug 271d70d6f3 inline HWR_GetTexturePalette
makes ui draw slightly faster from quick test
should be in hw_glob, but cant include hw_main there Zzz...
2025-07-30 15:29:56 +02:00
Alug e52a6c430b smol changes k_hud
nothing crazy mostly just smol reordering
2025-07-30 14:55:44 +02:00
Alug d77d25acf8 use hypotf for P_SegLengthFloat
well its hypot but for floats lel
2025-07-29 19:21:34 +02:00
Alug 9898809f0a remove erronous HWR_FreeExtraSubsectors call
this will be called from within HWR_CreatePlanePolygons anyways
2025-07-29 18:48:02 +02:00
Alug 48768aa13c fix the rare infinite loop hang in ogl (sunset hill map)
use new doom-legacies PointInSeg and add a selfref check to CutOutSubsecPoly
(somewhat related, but it appears this whole file is able to mess with the actual sector planes outside of rendering, this is not really good since it may actually lead to some super hard to debug desynchs)
2025-07-29 18:40:40 +02:00
Alug b1c01a763f cleanup hw_bsp a little
mostly just get rid of debug bloat that isnt even used
adding some branching hints for the I_errors (never seen any one of them happen tbh lel)
and remove some redundant checks
2025-07-29 18:40:02 +02:00
Alug d9bcd6007c move horizonline check to hw_bsp
to where maps also get checked for portals
should speed up levelload slightly
2025-07-29 15:37:14 +02:00
Alug d1b478b3b1 oop 2025-07-29 02:36:45 +02:00
Alug 14b421f533 camera noclip sec special is effectively unused in kart
its not even in the kart zb config
so mark it with unlikely
2025-07-29 02:35:58 +02:00
Alug 7310a8e4df add slope check here
not necessary but may skip more uneeded checks and stuff
2025-07-29 01:23:01 +02:00
Alug c1c3a7dc78 remove unecessary casts for colormap 2025-07-29 00:48:26 +02:00
chromaticpipe ff10b77414 Fix OpenGL flash palettes ignoring saturation 2025-07-29 00:31:10 +02:00
chromaticpipe 4667c332b4 Fix brightness issues with blend textures in Pallette Rendering 2025-07-29 00:31:07 +02:00
Alug 4a9f6b6a22 we dont need to clamp sprite lightlevels everywhere in ogl
theyre an int32 due to the directional light system stuff and get clamped in HWR_Lighting as a result
2025-07-29 00:31:04 +02:00
indev f1d78243d0 Move setting c++ standard bit below 2025-07-27 19:45:10 +03:00
Alug 6e41c8a2a0 readd std=c++17 to cxxflags 2025-07-27 18:42:16 +02:00
Alug 9c5955feb0 Store last ticcmd in a buffer rather than in netcmd
port of https://codeberg.org/srb2classic/srb2classic/commit/fe663f799e733e9a59a95dfd561e506571838554

testing this, since the faketic calc seems a bit "off" to me
2025-07-27 18:29:55 +02:00
Alug 0764b180f7 fixup! next branch
- remove a bunch of clutter
- Fix AATtree stuff by properly balancing it
- replace getcolumn calc with modulo calc
- use strlcpy for some things
- cache wadfile start and endfolders
2025-07-27 18:28:19 +02:00
Alug b883e4e4fe Merge branch 'Saturn-Testing' into Saturn-Next 2025-07-27 18:21:07 +02:00
Alug f78688b684 Merge pull request #189 from Indev450/mmenucleanup
Cleanup m_menu a bit
2025-07-27 17:18:07 +01:00
Alug 097cd5e2ca Merge remote-tracking branch 'origin/Saturn-Next' into mmenucleanup 2025-07-27 18:17:49 +02:00
Alug cd4836ae99 Merge pull request #187 from Indev450/emotes
Add emotes support
2025-07-27 17:16:23 +01:00
Alug f0acf179c2 Merge pull request #185 from Indev450/fixupnet
Cleanup netcode a bit
2025-07-27 17:16:16 +01:00
Alug 836ad12c40 Merge pull request #180 from Indev450/fixgnu23
Make codebase C23 compliant
2025-07-27 17:16:02 +01:00
Alug a147fa3100 Merge pull request #179 from Indev450/unnestmothink
Unnest mobj thinker stuff + cleanup p_mobj
2025-07-27 17:15:55 +01:00
Alug 4f0cf44e78 Merge branch 'unnestmothink' into fixgnu23 2025-07-27 18:15:31 +02:00
Alug 2417647110 Merge branch 'Saturn-Next' into fixgnu23 2025-07-27 18:15:04 +02:00
Alug 982cd7bde2 add mobj islocal field
so we can skip the pushable trigger stuff for local mobjs for synch reasons
very sketchy
2025-07-27 18:14:27 +02:00
Alug d6bd289fcf Merge branch 'Saturn-Next' into unnestmothink 2025-07-27 18:14:17 +02:00
Alug a68a05a838 fix conflict 2025-07-27 15:18:46 +02:00
Alug 95504547df add mobj islocal field
so we can skip the pushable trigger stuff for local mobjs for synch reasons
very sketchy
2025-07-27 15:17:51 +02:00
Alug ceb2a70664 reduce netbuffer scope even further 2025-07-27 15:17:17 +02:00
Alug 8593a1975c Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-27 15:17:09 +02:00
Alug ba44e61733 Merge branch 'Saturn' into Saturn-Next 2025-07-27 15:09:58 +02:00
chromaticpipe 845652cbfe Make it a part of fullscreen cvar 2025-07-27 15:02:24 +02:00
chromaticpipe ceafa06efc Borderless window toggle 2025-07-27 15:01:47 +02:00
Alug e6f487474b register chasecam with the other cam vars
why dupe a loop
2025-07-27 14:53:31 +02:00
Alug d8461bb44f dont apply player camfade when exiting or in freecam mode
also renames it and moves the check outside
2025-07-27 14:53:07 +02:00
Alug e25d366728 add toggable player close to camera fade
similar to some other kartracers
only takes other players into account
2025-07-27 14:51:10 +02:00
Alug 2abf0b98ac dont do this in dedi
dont need to, its pointless and prob causes more issues than anything
2025-07-27 14:32:38 +02:00
Alug 0f087d13bb dont do this in dedi
dont need to, its pointless and prob causes more issues than anything
2025-07-27 14:18:41 +02:00
indev 2e914c61d1 Init displayplayers to {0} 2025-07-27 14:33:01 +03:00
indev 3f599d5a28 Fix smol typo :3 2025-07-27 14:03:35 +03:00
indev 6ef1f73d4d Init displayplayers to {0} 2025-07-27 13:54:27 +03:00
Alug 38b84baf9d Merge pull request #193 from chromaticpipe/borderlesswindowtoggle
Borderless window toggle
2025-07-26 21:42:50 +01:00
chromaticpipe fae50c0e19 Make it a part of fullscreen cvar 2025-07-26 15:18:03 -05:00
Alug 50f7e2084c seenames stuff is always unlikely 2025-07-26 21:29:25 +02:00
Alug 67cc5402cf move assignments after early returns ST_drawLevelTitle 2025-07-26 21:29:21 +02:00
Alug 2259d4f309 get rid of code dupe for fpscapping stuff 2025-07-26 21:29:16 +02:00
Alug f8d903e7d2 simplify this 2025-07-26 21:29:13 +02:00
Alug 805cde8ae8 D_CleanFile can be static 2025-07-26 21:29:09 +02:00
Alug b23906e327 update link in addon menu to "mb.srb2.org/addons"
:chonkbuncle:
2025-07-26 21:29:04 +02:00
Gustaf Alhäll 2052afdb66 Fix custom addon directory being ignored when downloading addons 2025-07-26 21:29:01 +02:00
chromaticpipe d9c7a40d4a Borderless window toggle 2025-07-26 11:58:55 -05:00
Alug 48d9b2bc98 reduce netbuffer scope even further 2025-07-26 16:19:13 +02:00
Alug 939bf588b3 Merge branch 'Saturn-Next' into fixupnet 2025-07-26 16:19:09 +02:00
Alug cb2e017bcf seenames stuff is always unlikely 2025-07-26 16:18:59 +02:00
Alug d91fbf5d36 move assignments after early returns ST_drawLevelTitle 2025-07-26 16:18:56 +02:00
Alug 9859e43be7 get rid of some redundancy R_Frame stuff
R_SetupCommonFrame already checks the actual sector for us, so we dont need to do this before
2025-07-26 16:18:52 +02:00
Alug 306fec6f9e get rid of code dupe for fpscapping stuff 2025-07-26 16:18:25 +02:00
Alug 3e8b3e868b simplify this 2025-07-26 16:18:22 +02:00
Alug 9261d9c5b2 D_CleanFile can be static 2025-07-26 16:18:20 +02:00
Alug f97941f86e update link in addon menu to "mb.srb2.org/addons"
:chonkbuncle:
2025-07-24 23:47:41 +02:00
Gustaf Alhäll a4810bd6c8 Fix custom addon directory being ignored when downloading addons 2025-07-24 23:45:55 +02:00
Alug 93cbba218a add mobj islocal field
so we can skip the pushable trigger stuff for local mobjs for synch reasons
very sketchy
2025-07-24 22:33:53 +02:00
Alug e749346f0c fix console taking minutes to open during frameskipping
prob not the best way to handle this, but its the simplest
the console should always be openable without issues unless during wipes, since in some cases you end up having to kill the game to do anything
2025-07-24 20:47:31 +02:00
Alug a658883664 fix console taking minutes to open during frameskipping
prob not the best way to handle this, but its the simplest
the console should always be openable without issues unless during wipes, since in some cases you end up having to kill the game to do anything
2025-07-24 20:47:21 +02:00
indev d94c10014f Move server search below refresh option 2025-07-24 21:20:19 +03:00
Alug 45629386bb update credits
this is super full and we need to think about something better for this X)
2025-07-24 19:03:06 +02:00
Alug ffec9d64d5 delet windoze users (winuser.h)
apparently this makes cross compile commit sudoku, need to test this on actual windoze and see if this breaks anything since idk how this file even works
thx nep for the tip!
2025-07-24 15:22:44 +01:00
Alug 3e9f17af86 raise version number to 8.3
so i dont forger before release lul
2025-07-24 17:18:57 +02:00
Alug 03ff2fc007 enable ZDEBUG by default
this is just quite useful honestly
2025-07-24 17:03:23 +02:00
Alug 4492c00840 move prints to ZDEBUG2
as it seems to be for this purpose
2025-07-24 17:03:18 +02:00
Alug e15319ac9b move this stuff behind ZDEBUG 2025-07-24 17:03:10 +02:00
Alug fa012aefe1 let Z_CheckHeap print file and line of where it occured
like its supposed to lel
2025-07-24 17:03:06 +02:00
Alug e681d2d24d remove itemamount check here
replicate vanilla
even if this becomes negative
this does not seem to crash, so id rather do whatever vanilla does
2025-07-24 16:41:28 +02:00
Alug 76e54762d8 add toggle for quake screenshake effects
TODO: make an accessability option menu for certain effects
2025-07-24 16:39:06 +02:00
GenericHeroGuy 3b7d517be2 bruh
Let's try that again, this time putting the camera in a local...
2025-07-24 16:38:55 +02:00
Alug f4da64e3fa remove prob pointless check
viewplayer will be the currently viewed displayplayer lel
2025-07-24 16:38:44 +02:00
GenericHeroGuy 384acf8e31 Fix fake floors in Donut Plains disappearing when chasecam is off
Also remove the useless R_PointInSubsector calls
2025-07-24 16:37:18 +02:00
indev a423451383 SF_HIRES is already handled via spritexscale and spriteyscale 2025-07-24 16:37:08 +02:00
indev 66cfceedaf If gamestate resend took too long, abort resynching 2025-07-24 16:36:26 +02:00
Alug fe9107fa9d fix the fov adjust check
lmao oops
2025-07-24 16:33:29 +02:00
chromaticpipe e4f2db54e7 Fix level interpolators jittering during objectplac 2025-07-24 16:33:01 +02:00
chromaticpipe 2f5fe01ae0 Truncate trailing zeroes in float CVars 2025-07-24 16:32:04 +02:00
chromaticpipe 1bb7bd0abc Fix help command for CV_FLOAT CVars 2025-07-24 16:31:57 +02:00
indev a84ec88bc3 dedi's do run got_mapcmd :p 2025-07-24 16:29:09 +02:00
Alug 4a2e78081a shut up curl im already long 2025-07-24 16:27:56 +02:00
Alug d09d2cb445 use memcmp during startup map check
prob not faster just looks a bit better tbh
2025-07-24 16:27:30 +02:00
Alug 1faa585e83 fix memoryleak in pk3 verify functions 2025-07-24 16:27:16 +02:00
Alug 7479c82691 some crap from ceepeepeecheck 2025-07-24 16:27:04 +02:00
Alug cfab2236da fix awayview join crash
player->awayviewmobj may not exist yet in some cases
2025-07-24 16:26:48 +02:00
Alug d2ee344b22 Fix underflow in consistancy checking code
https://git.srb2.org/Hanicef/SRB2Classic/-/commit/9f5686ef48956cd64ef92f737e59cbbaa27d8cf9
2025-07-24 16:25:57 +02:00
Alug b22737223e didnt mean to change this lel 2025-07-24 16:25:06 +02:00
Alug 578158c060 move HWR_GetTexturePalette calls
to after early returns/where they are used
2025-07-24 16:24:48 +02:00
Alug 8eda0f78f7 call HWR_LoadMapTextures in paletterender toggle callback
from srb2 pr
2025-07-24 16:24:45 +02:00
Alug 2c2c82dc1a add mo checks to automap stuff 2025-07-24 16:24:22 +02:00
Alug d8c9522ec9 add a bunch of checks for if G_BuildMapTitle returns NULL 2025-07-24 16:24:14 +02:00
Alug 492aef2165 no need for an else here 2025-07-24 16:23:50 +02:00
Alug fc0409e967 readd cubeapply check here 2025-07-24 16:23:32 +02:00
Alug 8a89b57e48 this memset is incorrect and does nothing 2025-07-24 16:22:45 +02:00
Alug 0f6b9ba181 remove this
prob wrong assumption, our netcode sucks massive ass
2025-07-24 16:22:23 +02:00
Alug 8f1b4004c9 fix compiler warning bout playeringame 2025-07-24 16:21:45 +02:00
Alug bee5250940 readd flexible array for softwarepatch columnofs
how did this ever work lel
2025-07-24 16:20:48 +02:00
Alug c61a2e6ba2 fix https://github.com/Indev450/SRB2Kart-Saturn/issues/191
was an oversight when i cleaned up the gamepad stuff a bit
2025-07-24 16:16:04 +02:00
Alug d293bb9672 fix https://github.com/Indev450/SRB2Kart-Saturn/issues/190
doing it like this, so potentially wonky socked maps dont show up if its disabled
2025-07-24 16:15:57 +02:00
Alug 9fb3f4c9a3 fix https://github.com/Indev450/SRB2Kart-Saturn/issues/191
was an oversight when i cleaned up the gamepad stuff a bit
2025-07-24 15:38:05 +02:00
Alug 9a60441e54 few more things for hw renderer
just moving aaround some things and declaring more stuff as const
2025-07-23 17:07:38 +02:00
Alug a61b028e97 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-22 17:35:21 +02:00
Alug 29cf728fac enable ZDEBUG by default
this is just quite useful honestly
2025-07-22 17:33:23 +02:00
Alug 3c78c5c57d ok git very cool 2025-07-22 17:33:11 +02:00
Alug 7f3f332821 Remove aligned allocation functions 2025-07-22 17:33:07 +02:00
Alug 38576082fb move prints to ZDEBUG2
as it seems to be for this purpose
2025-07-22 17:31:44 +02:00
Alug 4a4b5661f2 move this stuff behind ZDEBUG 2025-07-22 17:31:22 +02:00
Alug 1e879dc432 let Z_CheckHeap print file and line of where it occured
like its supposed to lel
2025-07-22 14:18:00 +02:00
Alug e29bdd09c5 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-21 19:45:01 +02:00
Alug f3c8ff19b9 remove redundant R_SetColumnFunc call
this would only be needed if we had brightmap support, but like this it just sets the column function to what it already is
2025-07-21 19:11:01 +02:00
Alug fdd19632bf Use R_RenderSegLoop if the back sector has any 3D floor planes
fixes issues in northern district zone
2025-07-21 19:10:58 +02:00
Alug 74b082760d abuse c++ templates for Hwr_AddSprites
test this, but we can avoid a bunch of branching and functions calls like this when drawdist is inifite
2025-07-21 11:56:00 +02:00
Alug 4460fa608b merge fix 2025-07-21 11:55:39 +02:00
Alug 949192c570 branch hints for nights and 2d stuff
gotta keep em for compat reasons Zzz..
2025-07-21 11:49:49 +02:00
Alug 4fa0ca2304 move a bunch of stuff after early returns
+ add some branching instrincts to stuff

maybe saves a bit of time if we dont need the thing
2025-07-21 11:49:44 +02:00
Alug d9d2f043fa use branch instrincts for P_MobjThinker
based on observations from kart stuff
2025-07-21 11:49:00 +02:00
Alug 1ea51f29c5 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-21 11:48:35 +02:00
Alug b0653416f6 Merge branch 'Saturn-Next' into fixupnet 2025-07-20 17:03:30 +02:00
Alug efc4a513ce Merge branch 'Saturn-Next' into fixgnu23 2025-07-20 17:02:31 +02:00
Alug b13793b2a4 Merge branch 'Saturn-Next' into unnestmothink 2025-07-20 17:00:53 +02:00
Alug e102d218ff add toggle for quake screenshake effects
TODO: make an accessability option menu for certain effects
2025-07-19 22:54:37 +02:00
Alug 20cdec33fb fix https://github.com/Indev450/SRB2Kart-Saturn/issues/190
doing it like this, so potentially wonky socked maps dont show up if its disabled
2025-07-19 22:42:37 +02:00
indev 12d4a6d291 Also add scoll into level select for displaying map source filename 2025-07-18 23:19:19 +03:00
Alug d2b1ff595d remove itemamount check here
replicate vanilla
even if this becomes negative
this does not seem to crash, so id rather do whatever vanilla does
2025-07-18 17:57:45 +02:00
indev 03d79fba16 Add filename scrolling for addons menu 2025-07-18 14:48:45 +03:00
indev 989c29f7a0 Move scrollMusicName into m_misc as M_ScrollString 2025-07-18 14:21:05 +03:00
Alug 8a79c0a4e0 simplify free block in P_RemoveMobj
should be functionally the same
2025-07-18 11:01:58 +02:00
Alug 307c333c50 use branch instrincts for P_MobjThinker
based on observations from kart stuff
2025-07-18 11:01:28 +02:00
Alug 3ce8b9f09c oop move this back
this is some global, dont wanna mess things up
2025-07-18 10:57:15 +02:00
Alug 4dbe637510 remove pointless var P_TryCameraMove 2025-07-17 00:28:22 +02:00
Alug c0e97e7f43 store sector directly P_CheckPosition
hopefully this makes pointer access faster here
2025-07-17 00:28:19 +02:00
Alug 37fc64e97d optimization K_KartUpdatePosition
this checked the distance to every single waypoint on the map always and unconditionally, but we dont need the distance unconditionally so only check if we need to
+5fps in techbatics hadal classic timedemo
2025-07-17 00:06:59 +02:00
Alug ca93f08230 use branch instricts for blua
mostly just for error handling
similar to upstream lua and bluajit
hope this speeds this up a little
2025-07-16 23:01:16 +02:00
Alug 3581ce811c cache those things 2025-07-16 23:01:12 +02:00
Alug b4570cbdaa Merge branch 'mmenucleanup' into Saturn-Testing 2025-07-16 20:42:45 +02:00
Alug f2dc344bf8 copy paste oopsie 2025-07-15 19:55:13 +02:00
Alug c0654448f0 oop this was unsigned 2025-07-15 19:18:52 +02:00
Alug 2bf3912633 unmangle localskin menu mess a bit 2025-07-15 19:17:06 +02:00
Alug 4d71fb8409 few more things i missed 2025-07-15 18:59:28 +02:00
Alug 8543a099f4 split m_menu definitions to m_menudefs
idk if this is a good idea lel
2025-07-15 18:59:25 +02:00
Alug 9c6ec02b18 do some cleanup m_menu
gets rid of a bunch of duplicated splitscreen shit
unused srb2 stuff
commented out stuff aswell
we dont need any of this
this is def still far from tidy and itll never be like this
2025-07-15 18:59:22 +02:00
Alug bb9118ee32 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-15 18:57:23 +02:00
Alug 0411c40fae discord rpc my butt 2025-07-15 17:04:32 +02:00
Alug 68cb96ab97 💀 fix menu screentex toggle lel
thx neppy!
2025-07-15 15:30:34 +02:00
Alug 0159b8d0a3 use the tooltips array in the menu_t struct for tooltips
so this was always there lel
gets rid of massively duplicated tooltip calls and is generally cleaner
2025-07-15 15:03:00 +02:00
Alug aea3b49a51 💀 fix menu screentex toggle lel
thx neppy!
2025-07-15 14:00:57 +02:00
GenericHeroGuy 1a6f775cc3 bruh
Let's try that again, this time putting the camera in a local...
2025-07-15 14:00:53 +02:00
Alug ddd192fad0 declare all the kart "time" stuff as const
as far as i can see those never get overwritten and cant be overwritten
2025-07-15 14:00:49 +02:00
Alug 2e4fb32dac dont apply player camfade when exiting or in freecam mode
also renames it and moves the check outside
2025-07-15 14:00:46 +02:00
Alug 7d6e210625 use c++ template for HWR_DrawSprites
works just as well without code dupe
2025-07-13 23:11:52 +02:00
Alug 3ca42ce42f register chasecam with the other cam vars
why dupe a loop
2025-07-13 21:52:26 +02:00
Alug e4e40cf049 remove prob pointless check
viewplayer will be the currently viewed displayplayer lel
2025-07-13 21:52:23 +02:00
Alug d4f912e3b0 add toggable player close to camera fade
similar to some other kartracers
only takes other players into account
2025-07-13 21:52:20 +02:00
Alug eec4443c95 smol stuff i missed i_video 2025-07-13 16:31:59 +02:00
Alug b938c75892 clean up i_video.c a little
what a mess
this is still far from tidy
2025-07-13 16:17:32 +02:00
Alug 455cb9ca24 delet windoze users
apparently this makes cross compile commit sudoku, need to test this on actual windoze and see if this breaks anything since idk how this file even works
thx nep for the tip!
2025-07-12 14:56:34 +02:00
Alug 24e7f5f864 readd R_PointInSubsectorFast
use it for camera, viewpoint, some precip and sound stuff and (visual) banana slope calc
after profiling it a bit, this may be 2-4x faster in a bunch cases
2025-07-12 13:39:57 +02:00
Alug 298fa36c5d uninline R_IsPointInSubsector
this gets used like once or twice, we dont need that inlined
2025-07-12 13:35:12 +02:00
indev d31e9c5b55 Strip colors from server name when searching through server list 2025-07-11 23:15:19 +03:00
Alug 30f53f398f move CopyCaretColors to m_misc 2025-07-11 21:56:10 +02:00
indev eee217deec Add server search 2025-07-11 22:43:36 +03:00
Alug 1847aac223 fix windoze for the 50 trillionth time
when do we finally remove windows support?
those two things do absolutely fucking nothing but shit dies without em for whatever reason
2025-07-08 17:06:06 +01:00
Alug 487ef6f1b9 fix windoze for the 50 trillionth time
when do we finally remove windows support?
those two things do absolutely fucking nothing but shit dies without em for whatever reason
2025-07-08 17:05:44 +01:00
Alug 14be968089 fix for non pow2 width textures in software from doom-legacy 2025-07-08 16:52:56 +01:00
Alug 9f678263d0 Merge remote-tracking branch 'origin/Saturn-Next' into Saturn-Testing 2025-07-08 16:52:32 +01:00
Alug a554b886c6 fix peeindex overflow
lelelele thx indev <3
2025-07-08 14:23:34 +02:00
Alug f2d68b075c texturewidthmask can be static 2025-07-08 13:48:18 +02:00
Alug dc24de3501 fix color translated spans lmao
oopsie
well atleast we got some extra safety with the spandata source lel
2025-07-08 13:48:14 +02:00
Alug d2c73f072e reuse "i" 2025-07-08 12:02:10 +02:00
GenericHeroGuy 96bc7f7aa6 Fix fake floors in Donut Plains disappearing when chasecam is off
Also remove the useless R_PointInSubsector calls
2025-07-08 12:01:49 +02:00
Alug bd48b24000 some micro optimize 2025-07-08 12:01:46 +02:00
indev a26867bbdb Add separate option to toggle parallel rendering in R_DrawMaskedList 2025-07-08 00:36:25 +03:00
indev 8d570b7ba3 Revert "Disable multithreading in R_DrawMaskedList"
This reverts commit 5a44afcd9f.
2025-07-08 00:10:08 +03:00
Alug 96f5a8adb3 fix for non pow2 width textures in software from doom-legacy 2025-07-07 21:47:48 +02:00
indev 3b34f0a972 Sort replays in replay hut 2025-07-06 15:48:18 +03:00
Alug fe5a0b7c64 GL_ 2025-07-05 15:51:30 +02:00
BlueStaggo 2aa5324225 Manual mipmapping + Texture padding 2025-07-05 15:51:27 +02:00
Alug 22f50402fe remove this 2025-07-05 15:51:15 +02:00
Gustaf Alhäll 4e2f1bcf2b Fix invalid formats being passed to interal texture formats
The effects that this had on the engine is unknown, but the reference
pages makes in very clear that the old behavior is wrong.
2025-07-05 15:50:48 +02:00
indev ca34b0c8d6 Add /mute chat command 2025-07-05 00:27:17 +03:00
indev 0df5ef996c (kinda) unify LookupPlayer and nametonum, rename first into D_LookupPlayer 2025-07-04 23:15:31 +03:00
Alug 4c0ea2695e remove smoothpos cvar and add it as setting for "postitionanimation" cvar 2025-07-04 12:32:49 +02:00
Alug 48556ca428 oop lmao 2025-07-04 12:23:34 +02:00
Alug cb0667921e oop lmao 2025-07-04 12:07:56 +02:00
Alug 52ab27a825 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-04 11:23:26 +02:00
NepDisk 5db50bbaff Port HEPII(I) position number scaling 2025-07-04 11:19:48 +02:00
Alug 416da7cdc8 use memset for S_ClearQueue
just simpler
2025-07-04 11:19:45 +02:00
Alug f47057e800 update credits
this is super full and we need to think about something better for this X)
2025-07-03 10:17:12 +02:00
Alug 090559a766 move this out of maptitle condition
it does not rely on it and may even fail
idk why i threw it in there
2025-07-03 00:34:19 +02:00
Alug 1a6a3de443 double fpscounter samples
slightly more readable
2025-07-03 00:32:15 +02:00
Alug 0293fbfe99 why are you still here wtf 2025-07-01 21:51:28 +02:00
Alug ecfb52eabe delet GETTEXT and translation stuff 2025-07-01 21:50:56 +02:00
Alug 999e1a525e use quickcamdist for render distance culling stuff
we do not need this to be accurate at all in these cases, so this is probably faster than doing le fixedhypot
2025-07-01 21:24:58 +02:00
Alug ef530c2f7d tiny optimizations hw_main again 2025-07-01 21:15:17 +02:00
indev 3e5d1a436c Add option for smallminimapplayers to only downscale non-displayplayers icons 2025-07-01 22:07:12 +03:00
Alug 38b89093fa Merge remote-tracking branch 'origin/emotes' into Saturn-Testing 2025-07-01 19:22:07 +02:00
Alug 224ce007e1 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-01 19:21:58 +02:00
indev 2800685cfc Merge branch 'Saturn-Next' into emotes 2025-07-01 20:15:44 +03:00
Alug 962eb531ff clamp the sprite lightlevel stuff + ensure proper type cast
this is a mess
lets hope this doesent change how the game looks lel
2025-07-01 19:12:54 +02:00
Alug 07e1ca40a4 oop dont need those 2025-07-01 19:12:32 +02:00
sphere c479d9d706 Merge branch 'allowdesync' into 'next'
Add a console variable that will allow individual demos to desync....

See merge request STJr/SRB2!2361
2025-07-01 19:06:10 +02:00
Alug 338fbfbeaf whoops those are demo related lol 2025-07-01 19:06:07 +02:00
Alug 5ca12bb421 split replay stuff into g_demo 2025-07-01 18:48:46 +02:00
Alug 6c94e0c9bf conflict moment 2025-07-01 18:29:45 +02:00
Alug 83d0f6bb50 move kart hud stuff into k_hud
hope i got everything lol
2025-07-01 18:27:39 +02:00
Alug 0241d7fe00 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-01 15:27:39 +02:00
Alug 7e06fc986f this is INT32 so cast to that lel 2025-07-01 15:26:21 +02:00
Alug 3f5328371a put interp distance stuff into a function
just some code dupe cleanup
also account for c++ so we can use the same macro lel
2025-07-01 15:26:18 +02:00
Alug 148fcc8dab friendship with constexpr started 2025-07-01 15:26:02 +02:00
Alug 72a67d306f slightly cleanup addline stuff
no clue why i just didnt do this before lel
2025-07-01 15:25:57 +02:00
Alug 0dcdcc3da1 fix hw_main compiler warning 2025-07-01 15:25:53 +02:00
Alug 729c60c9b0 thanks michaelsoft very cool 2025-07-01 15:25:26 +02:00
Alug 1b418caf6b ceepeepeefy hw_main, abuse templates for portal stuff
no idea if this is faster at all lmao
2025-07-01 15:25:23 +02:00
Alug d275db9bb4 turn TC_ stuff into enum 2025-07-01 15:25:14 +02:00
Alug 21cfd7c361 Merge pull request #186 from Indev450/softwarecrap
Give the software renderer some love!
2025-07-01 15:21:48 +02:00
indev 5d8bb3223f No need for this now 2025-07-01 15:25:48 +03:00
indev 5e1f943a38 Merge branch 'Saturn-Next' into emotes 2025-07-01 15:24:42 +03:00
Alug 612431c1f1 dont define min and max with c++ 2025-07-01 14:22:49 +02:00
indev fca7b4a837 Use std::min 2025-07-01 15:15:36 +03:00
Alug 02ce2ff5ec Merge remote-tracking branch 'origin/emotes' into Saturn-Testing 2025-07-01 10:31:58 +02:00
indev d2bab80b29 Add emote suggestions and autocompletion 2025-06-30 16:43:14 +03:00
Alug 667a8bb166 "restrict" macro for c++
since it does not have it, use __restrict instead
2025-06-30 12:18:32 +02:00
Alug 76a18d001f friendship with constexpr started 2025-06-30 12:11:45 +02:00
Alug 78ab90c1a6 "restrict" macro for c++
since it does not have it, use __restrict instead
2025-06-30 12:54:15 +03:00
Alug 45b9aeb85a slightly cleanup addline stuff
no clue why i just didnt do this before lel
2025-06-30 08:17:41 +02:00
Alug d580306b8a fix hw_main compiler warning 2025-06-30 08:17:38 +02:00
indev 102e944fd5 Preview emotes in chat input 2025-06-30 00:28:14 +03:00
Alug 04385d9700 add "songcredits" to saturn hud menu
since we have a new style for this now, want to have it in the menu instead
2025-06-29 12:02:11 +02:00
Alug 7ef2da5922 tiny cleanup hw_batching 2025-06-29 11:44:12 +02:00
Alug 5638709670 some cleanup k_kart
perhaps we could also move the saturn stuff into arrays, those massive walls of variables are kinda ugly lel
2025-06-29 11:44:04 +02:00
Alug 3748896ebc thanks michaelsoft very cool 2025-06-29 10:20:33 +01:00
Alug 79988dea3d this makes no sense lol 2025-06-29 10:13:00 +01:00
Alug 4409a5848f Merge branch 'Saturn-Next' into Saturn-Testing 2025-06-29 12:08:06 +02:00
Alug 07c13636fc ceepeepeefy hw_main, abuse templates for portal stuff
no idea if this is faster at all lmao
2025-06-29 11:49:36 +02:00
Alug 51cc706b1e Merge remote-tracking branch 'origin/emotes' into Saturn-Testing 2025-06-29 11:48:33 +02:00
Alug 54bd31c80a Merge branch 'Saturn-Next' into Saturn-Testing 2025-06-29 11:48:18 +02:00
Alug 61534d7356 Merge branch 'softwarecrap' into Saturn-Testing 2025-06-29 11:48:12 +02:00
indev 9bd4a933cf Check if text is inside chat log box for emotes 2025-06-29 00:30:24 +03:00
indev e233635783 huh? 2025-06-29 00:05:25 +03:00
indev da24ba20c7 Fix emotes having not enough 'background' rendered :chonkbunckle: 2025-06-28 22:39:44 +03:00
indev 74bdabc636 Load emotes from base wads too at boot (so it loads ones from -file wads) 2025-06-28 22:31:33 +03:00
indev 4b129314d3 Right that got removed in the end :chonkbunckle: 2025-06-28 21:04:09 +03:00
indev 3a55972997 Initial emote support 2025-06-28 21:03:15 +03:00
Alug 6e04e4171e fix the goddamn boolean 2025-06-28 19:21:45 +03:00
indev db67176eca Revert "Replace '\' symbols with '\\' in comptime.sh"
This reverts commit 0b7a4ff4e0.
2025-06-26 22:50:59 +03:00
indev 0b7a4ff4e0 Replace '\' symbols with '\\' in comptime.sh 2025-06-26 21:18:22 +03:00
Alug 02feb3ad5c Merge pull request #177 from Indev450/votebgstuff
Cleanup Votescreen stuff
2025-06-25 13:24:48 +02:00
Alug 49f13d2a59 Merge pull request #176 from Indev450/luamusicdef
Expose musicdefs to lua
2025-06-25 13:24:37 +02:00
Alug cccfaaabfd proper init enterprecise 2025-06-19 17:48:12 +02:00
Alug eadbe9c2e5 delet this 2025-06-19 17:47:57 +02:00
Alug 9bbabcee06 delet this 2025-06-19 17:47:42 +02:00
Alug 7ca6fa6772 turn translation colormaps stuff into an enum 2025-06-19 17:44:04 +02:00
Alug 6317e9c510 cleanup colormap translation stuff
needs testing
2025-06-19 17:43:56 +02:00
Alug 0a80985771 check if player is local here 2025-06-19 17:41:49 +02:00
Alug 548d52cc60 simplify R_SetupAimingFrame 2025-06-19 17:41:42 +02:00
Alug 11c6c69a00 Merge branch 'softwarecrap' into Saturn-Testing 2025-06-19 17:41:33 +02:00
Alug 08025d2da3 ok git very cool 2025-06-19 17:41:12 +02:00
Gustaf Alhäll 4169e7bd71 Remove aligned allocation functions 2025-06-19 17:41:09 +02:00
Gustaf Alhäll bfb7a6b08d Fix potential NULL deference if memory runs out during cURL request 2025-06-19 17:41:06 +02:00
Alug 58abb0d4c3 Merge remote-tracking branch 'origin/softwarecrap' into Saturn-Testing 2025-06-19 17:40:42 +02:00
Alug 9658279cb1 Merge branch 'fixupnet' into Saturn-Testing 2025-06-19 17:40:34 +02:00
Alug 83bb908ff0 Merge remote-tracking branch 'origin/Saturn-Next' into unnestmothink 2025-06-19 15:56:32 +02:00
Alug 515c18c855 Merge remote-tracking branch 'origin/Saturn-Next' into fixgnu23 2025-06-19 15:55:58 +02:00
Alug d1a6394e52 Merge remote-tracking branch 'origin/Saturn-Next' into fixupnet 2025-06-19 15:55:22 +02:00
Alug 6f4e387061 Merge branch 'softwarecrap' into Saturn-Testing 2025-06-12 21:47:29 +02:00
Alug 33ef566fd2 Merge remote-tracking branch 'origin/Saturn-Next' into Saturn-Testing 2025-06-12 21:47:26 +02:00
Alug eeecd954e2 Merge branch 'softwarecrap' into Saturn-Testing 2025-06-12 17:19:38 +02:00
Alug ccb804a4ed Merge branch 'fixupnet' into Saturn-Testing 2025-06-12 17:18:09 +02:00
Alug a21029ee9e Merge branch 'Saturn-Next' into Saturn-Testing 2025-06-12 17:17:54 +02:00
Alug ccc90842a7 move CopyCaretColors to m_misc 2025-06-12 17:10:08 +02:00
Alug dc069d7bb5 unnest HandlePacketFromPlayer
+ some cleanup
2025-06-12 00:53:47 +02:00
Alug f4a827dfc2 fix conflicts 2025-06-12 00:02:55 +02:00
Alug 4f3232b6cc Merge branch 'Saturn-Next' into fixupnet 2025-06-12 00:02:05 +02:00
Alug 7393eb728c Merge branch 'Saturn-Next' into Saturn-Testing 2025-06-07 11:56:17 +02:00
Alug 1e715f8cd7 Merge branch 'newmakefiles' into Saturn-Testing 2025-06-07 11:56:13 +02:00
Alug 7aadc77a69 Merge remote-tracking branch 'origin/luamusicdef' into Saturn-Testing 2025-05-31 19:39:39 +02:00
indev 8fb1775606 Forgot MusicCredit hook 2025-05-31 19:15:04 +03:00
indev fab7635373 Add musicdef lua stuff into LUASTUFF.md 2025-05-31 19:10:58 +03:00
indev b29ca13916 Add musicdefs table into lua 2025-05-31 18:54:07 +03:00
Alug 27e1406e6d Merge branch 'Saturn-Next' into Saturn-Testing 2025-05-31 17:44:33 +02:00
Alug 796204d376 use memcmp during startup map check
prob not faster just looks a bit better tbh
2025-05-31 17:20:46 +02:00
Alug e13ba89f1a use memcmp during startup map check
prob not faster just looks a bit better tbh
2025-05-31 17:20:38 +02:00
Alug acabd1a03e Merge branch 'votebgstuff' into Saturn-Testing 2025-05-31 17:13:58 +02:00
Alug c08aae2622 Merge branch 'Saturn-Next' into Saturn-Testing 2025-05-31 17:13:00 +02:00
indev 68ae880979 Change the way how musicdefs are stored (preparing for exposing them to lua) 2025-05-31 18:04:08 +03:00
Alug d8b2134aef dont let dedi cache vote patches lol 2025-05-31 15:32:57 +02:00
Alug c168832f8e forgor to remove this 2025-05-31 15:32:53 +02:00
Alug 448a603a56 dont let dedi free votepatches lel 2025-05-31 15:32:42 +02:00
Alug 2a95201c6d free votepatches also in ogl not just software 2025-05-31 15:32:39 +02:00
Alug a73de55f96 also put votescreen patches into votescreen struct
+ more cleanup
2025-05-31 15:32:34 +02:00
Alug e4a4496be6 rename luaVoteScreen to luaPrefix + make it static buffer
since its effectively just a prefix,
2025-05-31 15:32:18 +02:00
Alug a8f3a8dfb0 fix oopsie that caused use after free 2025-05-31 15:32:14 +02:00
Alug e19b9d1c60 fix smol mistake votescreen check 2025-05-31 15:32:11 +02:00
Alug e28ec4e7cb unnest loop stuff in P_PartialAddWadFile
may speed this up ever so slightly since we dont need to go through all wad lumps 3 times per call anymore
2025-05-31 15:31:58 +02:00
Alug d0f09b467b Put votescreen background stuff into a struct
+ some refactoring and renaming

- removed some unused and redundant variables
- renamed some variables

turns out the lua votescreens always used the animated votescreen drawer, so i renamed it to lua votescreen drawer
2025-05-31 15:30:50 +02:00
Alug 3eba512ad4 Merge branch 'newmakefiles' into Saturn-Testing 2025-05-29 19:35:34 +02:00
Alug c99115d552 thanks windoze very cool part 2 2025-05-29 17:27:38 +01:00
Alug bf6c682cc1 thanks windoze very cool 2025-05-29 17:16:51 +01:00
Alug dc2f0b5707 Merge branch 'Saturn-Next' into Saturn-Testing 2025-05-29 18:23:08 +02:00
Alug 58de672915 add comment 2025-05-29 15:31:32 +02:00
Alug 9488d98cfd Merge branch 'Saturn-Next' into Saturn-Testing 2025-05-29 12:43:04 +01:00
Alug 906b8165d3 dont use stdbool´s bool type
this badly breaks everything
apparently the code assumes boolean to be an interger type or some shit
2025-05-29 12:41:56 +01:00
Alug 16b5037486 dont use stdbool´s bool type
this badly breaks everything
apparently the code assumes boolean to be an interger type or some shit
2025-05-29 12:41:45 +01:00
indev 359befd857 Add MusicCredit lua hook 2025-05-28 23:27:30 +03:00
Alug 74c8325987 Merge branch 'updatewinlibs' into Saturn-Testing 2025-05-28 22:16:37 +02:00
Alug e30efbfe6c Revert "update lzf to 1.6"
This reverts commit 9899747a7f.
2025-05-28 22:16:30 +02:00
Alug 5d4bb0f5ce Merge branch 'Saturn-Next' into Saturn-Testing 2025-05-28 22:14:17 +02:00
Alug e63777c7d6 remove this
prob wrong assumption, our netcode sucks massive ass
2025-05-28 21:42:29 +02:00
indev 279dfcafc4 Expose S_FindMusicCredit and musiccredit_t to lua 2025-05-28 22:10:25 +03:00
Alug a34ca05bff this is testing lel 2025-05-28 20:45:26 +02:00
Alug bcec8b98f7 make the game c23 compatible properly
+ some cleanup and removal of some redundant checks
2025-05-28 18:25:07 +02:00
Alug af9ffc1f6f forgor the hw state lel 2025-05-28 16:37:37 +01:00
Alug 18816453f4 add wireframe mode for ogl 2025-05-28 18:31:21 +02:00
Alug 1eb8a75058 fix compiler warning bout playeringame 2025-05-28 18:30:26 +02:00
Alug 5abf42fe75 remove crappy memcpy redifine from md5 2025-05-28 18:29:18 +02:00
Alug 1306a233b8 Further improve sleep accuracy on UNIX systems
but not for dedis
https://git.srb2.org/STJr/SRB2/-/merge_requests/2583
2025-05-28 18:28:22 +02:00
Alug 46f8c6b7a5 remove forcing c17 from makefile 2025-05-28 18:26:47 +02:00
Alug face5cf447 Merge branch 'fixgnu23' into Saturn-Testing 2025-05-28 18:26:24 +02:00
Alug 603267b753 fix W_CheckNumForFolderStartPK3 2025-05-28 17:47:29 +02:00
Gustaf Alhäll 7cf3113d67 Fix long names using the wrong hash field 2025-05-28 17:47:25 +02:00
Alug 397fa962b1 Optimize lump searching
https://git.srb2.org/Hanicef/SRB2Classic/-/commit/dc608f084c76cf72de9fc3f3f347752f04acae42
2025-05-28 17:47:22 +02:00
Alug d2637ab71f Merge branch 'newmakefiles' into Saturn-Testing 2025-05-28 17:47:01 +02:00
Alug a6e020adeb Merge branch 'texloadstuff' into Saturn-Testing 2025-05-28 17:46:43 +02:00
Alug d50dcac0c0 Merge branch 'unnestmothink' into Saturn-Testing 2025-05-28 17:46:40 +02:00
Alug dd6bc23a8e Merge branch 'updatewinlibs' into Saturn-Testing 2025-05-28 17:46:35 +02:00
Alug 71575f5cf8 Revert "update sdl_mixer to 2.8.1"
This reverts commit b8ae656968.
2025-05-26 22:11:03 +01:00
Alug 3685502edf Revert "delet tic resending stuff"
This reverts commit 17bc8a4a36.
2025-05-26 18:10:03 +02:00
Alug 9899747a7f update lzf to 1.6 2025-05-26 18:02:21 +02:00
Alug d2a415380d oop we still need libgme.dll 2025-05-26 15:15:46 +01:00
Alug dd7ffd7dfe delet GETTEXT and translation stuff 2025-05-26 14:48:31 +01:00
Alug 770f9af5e1 cleanup some stuff 2025-05-26 14:31:53 +01:00
Alug c2ab5be8b8 Merge remote-tracking branch 'origin/winzlib-ng' into updatewinlibs 2025-05-26 13:21:03 +01:00
Alug b8ae656968 update sdl_mixer to 2.8.1
we can also get rid of a bunch of dlls now
2025-05-26 13:12:43 +01:00
Alug 553b61e1f5 update SDL2 to 2.32.6
also removes a bunch of files we dont need
2025-05-26 12:51:45 +01:00
Alug f87bcef079 try fixing some crash with bogus netxcmds 2025-05-23 16:55:47 +02:00
Alug c3458afe2b unglobalise holepunchpacket aswell 2025-05-23 16:53:42 +02:00
Alug 17bc8a4a36 delet tic resending stuff 2025-05-23 16:51:26 +02:00
Alug b04f017ab6 change ticqueue system to be more like srb 2.2
mostly just renaming lel
2025-05-23 16:51:10 +02:00
Alug 083ddb6396 Refactor netbuffer out of global namespace
https://git.do.srb2.org/Hanicef/SRB2Classic/-/commit/079fd2cef97a9cf22fb5d2b66a9b500914efbc72

+ move some things into functions
2025-05-23 16:48:34 +02:00
Alug c3129742c3 simplify cmpack 2025-05-23 16:44:52 +02:00
Alug 877bd640f3 fix destinationnode check in Processackpak 2025-05-23 16:43:52 +02:00
Alug 3233df9c6c do not resolve ipv4 in curl when using ipv6 2025-05-23 16:43:24 +02:00
Alug 9ad5f5189c split portnum retrieval into own function 2025-05-23 16:43:02 +02:00
Alug c7718dea79 fixup! i_tcp
technically make ipv6 work,, but its disabled by default
2025-05-23 16:40:38 +02:00
Alug fa3dcdb24f massive cleanup p_mobj 2025-05-23 16:31:17 +02:00
Alug 311258dda0 more unnesting for mobj think stuff 2025-05-23 16:24:50 +02:00
Alug a0f8816de7 readd itembox fuse think that was lost somehow lmao 2025-05-23 16:22:03 +02:00
Alug c546b6225c move this since it does check for fuse 2025-05-23 16:21:48 +02:00
Alug f6c6621af8 unnest and cleanup P_MobjThinker
everything was moved into seperate functions lel
2025-05-23 16:21:27 +02:00
Alug 5a0fb59b26 Do not reload every texture when adding a wad (squashed)
port of https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1725#c829d21709a4f5cd81d140271e883bc40dd00b1b
2025-05-23 16:16:10 +02:00
Alug 07c52e6af5 static link this to get rid of stinky extra dll
thx indev <3
2025-03-20 14:45:35 +01:00
Alug 405c566038 import zlib-ng in compat mode 2025-03-20 14:31:02 +01:00
Alug 78780799ea delet zlib from windoze 2025-03-20 14:15:38 +01:00
Alug 82b9457aa7 Merge branch 'Saturn-Testing' into winzlib-ng 2025-03-20 13:37:06 +01:00
Alug 4e6abb39dd Merge remote-tracking branch 'origin/rankingsrefactor' into winzlib-ng 2025-03-20 13:34:51 +01:00
237 changed files with 26019 additions and 39782 deletions

No files matched your search

+43
View File
@@ -161,6 +161,49 @@ Duration is in milliseconds and is optional to set, default value is 84ms.
Exactly same as P_CheckSight but uses cheaper algorithm, useful for things like nametags. Doesn't work exactly
like P_CheckSight so don't use it for anything gameplay-related.
## musicdef_t
Userdata structure representing a musicdef. Fields:
`musicdef.name` - song identifier ("kmap01" for example).
`musicdef.usage`, `musicdef.source` - fields from vanilla MUSICDEFS lump.
`musicdef.filename` - unused for now.
`musicdef.title`, `musicdef.alttitle`, `musicdef.authors` - fields from MUSCINFO lump.
`#musicdef` - returns integer id for musicdef (which can be used as index in `musicdefs`).
All fields are read-only.
## S_FindMusicCredit(name)
Returns musicdef corresponding to music with given identifier. For example, `S_FindMusicCredit("kmap01")` will return
musicdef for green hills music.
## musicdefs
Global table for all musicdefs, similar to mobjinfo, states, etc. Can take either integer indices,
from `0` to `#musicdefs-1`, or string indices (which is equal to calling `S_FindMusicCredit`).
## addHook("MusicCredit", function(musicdef))
Hook is called whenever `S_ShowMusicCredit` (either from game or mod) is called. Takes musicdef as only argument, returning true
will overwrite vanilla behavior (not show music credit), can be used to implement custom music credit pop-ups.
## addHook("SetupVote", function(result, gt, secondgt, prevmap))
Hook is called whenever server sets up options for vote screen. `result` is table where lua can store options to,
(for example, `result[1] = 1` will force green hills as first option), gt is current gametype, secondgt is
alternative gametype picked for 3rd entry (for example, gt can be `GT_RACE`, and secondgt can be `GT_MATCH`)
prevmap is the previous map that was played (small note - in game code, it is offset by -1, but for lua its offset back,
so if previous gamemap was 1, prevmap would also be 1. Which means you can safely do mapheaderinfo[prevmap] to get info on previous map)
Limitations: currently, game can only change gametype for 3rd option in map (meaning for example, if current gametype is race, and you
put battle map in first option, when it gets picked that map will be still run in race gametype). That means, game will only handle maps with
different gametype if it is put in 3rd vote option.
# Other changes
## P_PlayRinglossSound(source, damager)
+18
View File
@@ -30,6 +30,24 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
0-Clause BSD License
applies to:
- qs22k
Copyright (c) 2022, Raymond Gardner
--------------------------------------------------------------------------------
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
--------------------------------------------------------------------------------
curl License
applies to:
-717
View File
@@ -1,717 +0,0 @@
#! /bin/sh
#
# Copyright (C) 2002-2010 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This file is meant for authors, maintainers, co-maintainers or installers
# of packages which are internationalized with the help of GNU gettext. For
# further information how to use it consult the GNU gettext manual.
progname=$0
package=gettext-tools
version=0.18.1
# Set variables
# - gettext_dir directory where the sources are stored.
prefix="/usr/local/i686-w64-mingw32/stow/gettext-0.18.1.1"
datarootdir="${prefix}/share"
gettext_dir="${datarootdir}/gettext"
# func_tmpdir
# creates a temporary directory.
# Sets variable
# - tmp pathname of freshly created temporary directory
func_tmpdir ()
{
# Use the environment variable TMPDIR, falling back to /tmp. This allows
# users to specify a different temporary directory, for example, if their
# /tmp is filled up or too small.
: ${TMPDIR=/tmp}
{
# Use the mktemp program if available. If not available, hide the error
# message.
tmp=`(umask 077 && mktemp -d "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
# Use a simple mkdir command. It is guaranteed to fail if the directory
# already exists. $RANDOM is bash specific and expands to empty in shells
# other than bash, ksh and zsh. Its use does not increase security;
# rather, it minimizes the probability of failure in a very cluttered /tmp
# directory.
tmp=$TMPDIR/gt$$-$RANDOM
(umask 077 && mkdir "$tmp")
} ||
{
echo "$0: cannot create a temporary directory in $TMPDIR" >&2
{ (exit 1); exit 1; }
}
}
# Support for relocatability.
func_find_curr_installdir ()
{
# Determine curr_installdir, even taking into account symlinks.
curr_executable="$0"
case "$curr_executable" in
*/* | *\\*) ;;
*) # Need to look in the PATH.
if test "${PATH_SEPARATOR+set}" != set; then
func_tmpdir
{ echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh
chmod +x "$tmp"/conf.sh
if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -rf "$tmp"
fi
save_IFS="$IFS"; IFS="$PATH_SEPARATOR"
for dir in $PATH; do
IFS="$save_IFS"
test -z "$dir" && dir=.
for exec_ext in ''; do
if test -f "$dir/$curr_executable$exec_ext"; then
curr_executable="$dir/$curr_executable$exec_ext"
break 2
fi
done
done
IFS="$save_IFS"
;;
esac
# Make absolute.
case "$curr_executable" in
/* | ?:/* | ?:\\*) ;;
*) curr_executable=`pwd`/"$curr_executable" ;;
esac
# Resolve symlinks.
sed_dirname='s,/[^/]*$,,'
sed_linkdest='s,^.* -> \(.*\),\1,p'
while : ; do
lsline=`LC_ALL=C ls -l "$curr_executable"`
case "$lsline" in
*" -> "*)
linkdest=`echo "$lsline" | sed -n -e "$sed_linkdest"`
case "$linkdest" in
/* | ?:/* | ?:\\*) curr_executable="$linkdest" ;;
*) curr_executable=`echo "$curr_executable" | sed -e "$sed_dirname"`/"$linkdest" ;;
esac ;;
*) break ;;
esac
done
curr_installdir=`echo "$curr_executable" | sed -e 's,/[^/]*$,,'`
# Canonicalize.
curr_installdir=`cd "$curr_installdir" && pwd`
}
func_find_prefixes ()
{
# Compute the original/current installation prefixes by stripping the
# trailing directories off the original/current installation directories.
orig_installprefix="$orig_installdir"
curr_installprefix="$curr_installdir"
while true; do
orig_last=`echo "$orig_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
curr_last=`echo "$curr_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
if test -z "$orig_last" || test -z "$curr_last"; then
break
fi
if test "$orig_last" != "$curr_last"; then
break
fi
orig_installprefix=`echo "$orig_installprefix" | sed -e 's,/[^/]*$,,'`
curr_installprefix=`echo "$curr_installprefix" | sed -e 's,/[^/]*$,,'`
done
}
if test "no" = yes; then
exec_prefix="${prefix}"
bindir="${exec_prefix}/bin"
orig_installdir="$bindir" # see Makefile.am's *_SCRIPTS variables
func_find_curr_installdir # determine curr_installdir
func_find_prefixes
# Relocate the directory variables that we use.
gettext_dir=`echo "$gettext_dir/" | sed -e "s%^${orig_installprefix}/%${curr_installprefix}/%" | sed -e 's,/$,,'`
fi
# func_usage
# outputs to stdout the --help usage message.
func_usage ()
{
echo "\
Usage: autopoint [OPTION]...
Copies standard gettext infrastructure files into a source package.
Options:
--help print this help and exit
--version print version information and exit
-f, --force force overwriting of files that already exist
-n, --dry-run print modifications but don't perform them"
# echo "\
# -V version copy the infrastructure of the specified gettext version
# (dangerous)"
echo "
Report bugs to <bug-gnu-gettext@gnu.org>."
}
# func_version
# outputs to stdout the --version message.
func_version ()
{
echo "$progname (GNU $package) $version"
echo "Uses a versions archive in git format."
echo "Copyright (C) 2002-2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
echo "Written by" "Bruno Haible"
}
# func_fatal_error message
# outputs to stderr a fatal error message, and terminates the program.
func_fatal_error ()
{
echo "autopoint: *** $1" 1>&2
echo "autopoint: *** Stop." 1>&2
exit 1
}
# Command-line option processing.
# Removes the OPTIONS from the arguments. Sets the variables:
# - force yes if --force was given, empty otherwise
# - ver gettext version if -V was given, empty otherwise
# - doit false if --dry-run was given, : otherwise
{
force=
ver=
doit=:
while test $# -gt 0; do
case "$1" in
-n | --dry-run | --dry-ru | --dry-r | --dry- | --dry | --dr | --d )
shift
doit=false ;;
-f | --force | --forc | --for | --fo | --f )
shift
force=yes ;;
--help | --hel | --he | --h )
func_usage; exit 0 ;;
# -V ) # Some people put a space between -V and the version number.
# shift
# if test $# = 0; then
# func_usage 1>&2
# exit 1
# fi
# ver=$1;
# shift ;;
# -V*) # Some people omit the space between -V and the version number.
# ver=`echo "X$1" | sed -e 's/^X-V//'`
# shift ;;
--version | --versio | --versi | --vers | --ver | --ve | --v )
func_version
exit 0 ;;
-- ) # Stop option prcessing
shift; break ;;
-* )
echo "autopoint: unknown option $1" 1>&2
echo "Try 'autopoint --help' for more information." 1>&2
exit 1 ;;
* )
break ;;
esac
done
}
# Command-line argument processing.
# Analyzes the remaining arguments.
{
if test $# -gt 0; then
func_usage 1>&2
exit 1
fi
}
srcdir=`pwd`
# The current directory is now $srcdir.
# Check integrity of package: A configure.in/ac must be present. Sets variable
# - configure_in name of configure.in/ac file.
if test -f configure.in; then
configure_in=configure.in
else
if test -f configure.ac; then
configure_in=configure.ac
else
# KDE specific convention: configure.in.in
if test -f configure.in.in; then
configure_in=configure.in.in
else
func_fatal_error "Missing configure.in or configure.ac, please cd to your package first."
fi
fi
fi
# Check whether the -V option and the version number in configure.in match.
# At least one of the two must be given. If both are given, they must agree.
sed_extract_AM_GNU_GETTEXT_VERSION_argument='s/^AM_GNU_GETTEXT_VERSION(\([^()]*\)).*$/\1/'
sed_remove_outer_brackets='s/^\[\(.*\)\]$/\1/'
xver=`cat "$configure_in" | grep '^AM_GNU_GETTEXT_VERSION(' | sed -n -e "$sed_extract_AM_GNU_GETTEXT_VERSION_argument"p | sed -e "$sed_remove_outer_brackets" | sed -e 1q`
if test -z "$xver" && test -f intl/VERSION; then
xver=`cat intl/VERSION | LC_ALL=C sed -n -e 's/^.*gettext-\([-+_.0-9A-Za-z]*\).*$/\1/p'`
fi
if test -n "$xver"; then
if test -n "$ver"; then
if test "X$ver" != "X$xver"; then
func_fatal_error "Version mismatch: specified -V $ver but the package uses gettext version $xver"
fi
else
ver="$xver"
fi
else
if test -z "$ver"; then
func_fatal_error "Missing version: please specify in $configure_in through a line 'AM_GNU_GETTEXT_VERSION(x.yy.zz)' the gettext version the package is using"
fi
fi
# Check whether the version number is supported.
case "$ver" in
0.10.35 | 0.10.36 | 0.10.37 | 0.10.38 | 0.10.39 | 0.10.40 | \
0.11 | 0.11.1 | 0.11.2 | 0.11.3 | 0.11.4 | 0.11.5 | \
0.12 | 0.12.1 | \
0.13 | 0.13.1 | \
0.14 | 0.14.1 | 0.14.2 | 0.14.3 | 0.14.4 | 0.14.5 | 0.14.6 | \
0.15 | \
0.16 | 0.16.1 | \
0.17 | \
0.18 | 0.18.1 )
;;
*)
func_fatal_error "The AM_GNU_GETTEXT_VERSION declaration in your $configure_in
file requires the infrastructure from gettext-$ver but this version
is older. Please upgrade to gettext-$ver or newer."
;;
esac
# Check in which directory config.rpath, mkinstalldirs etc. belong.
auxdir=`cat "$configure_in" | grep '^AC_CONFIG_AUX_DIR' | sed -n -e 's/AC_CONFIG_AUX_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
if test -n "$auxdir"; then
auxdir="$auxdir/"
fi
# Check in which directory the *.m4 macros belong.
m4dir=m4
if test -f Makefile.am; then
# A package using automake.
# Extract the macro directory name from Makefile.am.
aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' Makefile.am | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
m4dir_is_next=
for arg in $aclocal_amflags; do
if test -n "$m4dir_is_next"; then
m4dir="$arg"
break
else
if test "X$arg" = "X-I"; then
m4dir_is_next=yes
else
m4dir_is_next=
fi
fi
done
fi
# Check whether to omit the intl/ directory.
omitintl=`cat "$configure_in" | grep '^AM_GNU_GETTEXT' | sed -n -e 's/^AM_GNU_GETTEXT(\([^(),]*\).*$/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
omitintl=`if test 'external' = "$omitintl"; then echo yes; fi`
# Check in which directory or directories the po/* infrastructure belongs.
sed_extract_config_files='s,#.*$,,
s,^dnl .*$,,
s, dnl .*$,,
/AC_CONFIG_FILES(/ {
ta
:a
s/)/)/
tb
s/\\$//
N
ba
:b
s,^.*AC_CONFIG_FILES([[ ]*\([^]"$`\\)]*\).*$,\1,p
}'
configfiles=`cat "$configure_in" | sed -n -e "$sed_extract_config_files"`
# PO directories have a Makefile.in generated from Makefile.in.in.
# Treat a directory as a PO directory if and only if it has a
# POTFILES.in file. This allows packages to have multiple PO
# directories under different names or in different locations.
sed_remove_Makefile_in='s,/Makefile\.in$,,'
podirs=`for f in $configfiles; do case "$f" in */Makefile.in) echo $f;; esac; done | sed -e "$sed_remove_Makefile_in"`
if test -z "$podirs"; then
# If we cannot get the list of PO directories from configure.ac, assume the
# common default.
podirs="po"
fi
# Set up a temporary checkout directory.
# Set variables
# - work_dir directory containing the temporary checkout
work_dir=tmpwrk$$
mkdir "$work_dir" || {
if test -d "$work_dir"; then
func_fatal_error "directory $work_dir already exists"
else
func_fatal_error "cannot create directory $work_dir"
fi
}
# We support three archive formats.
#
# Format | Size (KiB) for gettext-0.17 | Extra tools needed |
# -------+-----------------------------+--------------------+
# dir | 3000 | -- |
# cvs | 356 | cvs |
# git | 484 | git |
# -------+-----------------------------+--------------------+
case "git" in
dir)
# The archive of different versions is very large, but using it does not
# require special tools.
gzip -d -c < "$gettext_dir/archive.dir.tar.gz" | (cd "$work_dir" && tar xf - "gettext-$ver")
if test `find "$work_dir" -type f -print | wc -l` = 0; then
rm -rf "$work_dir"
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
fi
mv "$work_dir/gettext-$ver" "$work_dir/archive"
;;
cvs)
# We distributed the many different versions of the files in a CVS
# repository. This guaranteed a good compression rate:
#
# Including version size in KB of
# "du autopoint-files/archive"
# 0.10.35 240
# 0.10.36 428
# 0.10.37 436
# 0.10.38 488
# 0.10.39 500
# 0.10.40 528
# 0.11 720
# 0.11.1 740
# 0.11.2 748
# 0.11.3 804
# 0.11.4 864
# 0.11.5 880
# 0.12 1032
# 0.12.1 1032
# 0.13 1220
# 0.13.1 1236
# 0.14 1296
# 0.14.1 1300
# 0.14.2 1420
# 0.14.3 1428
# 0.14.4 1464
# 0.14.5 1508
# 0.14.6 1580
# 0.15 1760
# 0.16 1808
# 0.16.1 1812
# 0.17 2128
# 0.18 2656
#
# The requirement that the user must have the CVS program available is not
# a severe restrictions, because most of the people who use autopoint are
# users of CVS.
#
# But the CVS format is now deprecated, because "cvs init" does not work in
# all circumstances
# (see <http://lists.gnu.org/archive/html/bug-cvs/2010-05/msg00003.html>)
# and we are not allowed to distribute the cvs infrastructure files
# ourselves
# (see <http://lists.gnu.org/archive/html/bug-cvs/2010-06/msg00011.html>).
#
# Check availability of the CVS program.
(cvs -v) >/dev/null 2>/dev/null || func_fatal_error "cvs program not found"
# Set up a temporary CVS repository.
# We need the temporary CVS repository because any checkout needs write
# access to the CVSROOT/history file, so it cannot be under $gettext_dir.
# We need the temporary checkout directory because when --force was not
# given, we need to compare the existing files with the checked out ones.
# Set variables
# - cvs_dir directory containing the temporary repository
cvs_dir=tmpcvs$$
# Use an umask of 077, to avoid attacks that work by overwriting files in
# the "$CVSROOT"/CVSROOT directory.
(umask 077 && mkdir "$cvs_dir") || {
if test -d "$cvs_dir"; then
func_fatal_error "directory $cvs_dir already exists"
else
func_fatal_error "cannot create directory $cvs_dir"
fi
}
CVSROOT="$srcdir/$cvs_dir"
unset CVS_CLIENT_LOG
unset CVS_CLIENT_PORT
unset CVS_IGNORE_REMOTE_ROOT
unset CVS_LOCAL_BRANCH_NUM
unset CVS_NOBASES
unset CVS_PASSFILE
unset CVS_PASSWORD
unset CVS_PROXY_PORT
unset CVS_RCMD_PORT
unset CVS_RSH
unset CVS_SERVER
unset CVS_SERVER_SLEEP
CVS_SIGN_COMMITS=
export CVS_SIGN_COMMITS
unset CVS_SSH
unset CVS_VERIFY_CHECKOUTS
unset CVS_VERIFY_TEMPLATE
unset CVSIGNORE
unset CVSREAD
unset CVSREADONLYFS
unset CVSUMASK
unset CVSWRAPPERS
# Need to pass -d "$CVSROOT", because there may be a CVS directory in the
# current directory.
cvs -d "$CVSROOT" init
gzip -d -c < "$gettext_dir/archive.cvs.tar.gz" | (cd "$cvs_dir" && tar xf -)
cd "$work_dir"
cvsver=gettext-`echo "$ver" | sed -e 's/\./_/g'`
(cvs -d "$CVSROOT" checkout -r"$cvsver" archive > /dev/null) 2>&1 | grep -v '^cvs checkout: Updating'
find archive -name CVS -type d -print | xargs rm -rf
cd ..
rm -rf "$cvs_dir"
# Check that really all CVS directories are gone, otherwise we would overwrite
# the contents of the user's CVS directories.
if test `find $work_dir/archive -name CVS -type d -print | wc -l` != 0; then
rm -rf "$work_dir"
func_fatal_error "failed to remove all CVS subdirectories"
fi
if test `find $work_dir/archive -type f -print | wc -l` = 0; then
rm -rf "$work_dir"
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
fi
;;
git)
# Check availability of the git program.
(git --version) >/dev/null 2>/dev/null || func_fatal_error "git program not found"
mkdir "$work_dir/archive"
gzip -d -c < "$gettext_dir/archive.git.tar.gz" | (cd "$work_dir/archive" && tar xf -)
(cd "$work_dir/archive" && git checkout -q "gettext-$ver") || {
rm -rf "$work_dir"
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
}
(cd "$work_dir/archive" && rm -rf .git .gitignore)
;;
esac
# func_destfile file
# determines the destination file, relative to the package's top level
# directory, for a given file name, relative to archive.
# Sets variables
# - destfile relative destination file name, or
# empty if the file shall be omitted
# - sharedowner yes if the file is not only owned by GNU gettext but may
# be installed by automake or other tools, otherwise empty
# - allpodirs yes if the file is to be installed in every dir in $podirs
func_destfile ()
{
# There are five categories of files:
# ABOUT_NLS -> top level directory
# config.rpath mkinstalldirs -> $auxdir
# m4/* -> $m4dir/
# intl/* -> intl/
# po/* ->
sharedowner=
allpodirs=
case `echo "$1" | sed -e 's,[^/]*$,,'` in
"" )
case "$1" in
config.rpath ) destfile="$auxdir$1" ;;
mkinstalldirs ) destfile="$auxdir$1" sharedowner=yes ;;
* ) destfile="$1" ;;
esac
;;
m4/ ) destfile=`echo "$1" | sed -e "s,^m4/,$m4dir/,"` ;;
intl/ ) if test -n "$omitintl"; then destfile=""; else destfile="$1"; fi ;;
po/ ) destfile=`echo "$1" | sed -e "s,^po/,,"` allpodirs=yes ;;
* ) destfile="$1" ;;
esac
}
# func_compare existingfile gettextfile
# compares the existing file and the file from gettext, and decides whether the
# existing file should be overwritten with the file from gettext. Returns 0 if
# it should be overwritten, or 1 if it should be skipped.
sed_extract_serial='s/^#.* serial \([^ ]*\).*/\1/p
1q'
func_compare ()
{
if cmp -s "$1" "$2"; then
false
else
case "$2" in
*.m4)
# For interoperability with gnulib. gnulib often has newer versions of
# the *.m4 files than the latest gettext release. Don't overwrite a
# newer version from gnulib with an older version from the gettext
# release. The version can be retrieved from the first line, which
# looks like this: # file.m4 serial NN ...
existing_serial=`sed -n -e "$sed_extract_serial" < "$1"`
gettext_serial=`sed -n -e "$sed_extract_serial" < "$2"`
if test -n "$existing_serial" && test -n "$gettext_serial" \
&& test "$existing_serial" -ge "$gettext_serial" 2> /dev/null; then
false
else
true
fi
;;
*)
true
;;
esac
fi
}
# If some files have been locally modified and we have not been requested
# to overwrite them, then bail out. This is better than leaving a source
# package around where half of the files are locally modified and half are
# original - too great risk of version mismatch.
if test -z "$force"; then
mismatch=
func_tmpdir
mismatchfile="$tmp"/autopoint.diff
for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do
func_destfile "$file"
if test -n "$destfile"; then
func_compare_to_destfile ()
{
finaldestfile="$1"
if test -f "$finaldestfile"; then
if func_compare "$finaldestfile" "$work_dir/archive/$file"; then
if test -n "$sharedowner"; then
echo "autopoint: warning: File $finaldestfile has been locally modified." 1>&2
else
echo "autopoint: File $finaldestfile has been locally modified." 1>&2
mismatch=yes
diff -c "$work_dir/archive/$file" "$finaldestfile" | sed -e "1s,$work_dir/archive/,," >> "$mismatchfile"
fi
fi
fi
}
if test -n "$allpodirs"; then
for dir in $podirs; do
func_compare_to_destfile "$dir/$destfile"
done
else
func_compare_to_destfile "$destfile"
fi
fi
done
if test -n "$mismatch"; then
rm -rf "$work_dir"
func_fatal_error "Some files have been locally modified. Not overwriting them because --force has not been specified. For your convenience, you find the local modifications in the file '$mismatchfile'."
fi
rm -rf "$tmp"
fi
# func_mkdir_for to
# ensures the directory that would the given file exists.
# 'to' is a relative pathname, relative to the current directory.
func_mkdir_for ()
{
base=`echo "$1" | sed -e 's,/[^/]*$,,'`
if test "X$base" != "X$1" && test -n "$base"; then
func_mkdir_for "$base"
# Recompute base. It was clobbered by the recursive call.
base=`echo "$1" | sed -e 's,/[^/]*$,,'`
test -d "$base" || { echo "Creating directory $base"; mkdir "$base"; }
fi
}
# func_copy from to
# copies a file.
# 'from' is a relative pathname, relative to the current directory.
# 'to' is a relative pathname, relative to the current directory.
func_copy ()
{
if $doit; then
func_mkdir_for "$2"
rm -f "$2"
echo "Copying file $2"
cp "$1" "$2"
else
echo "Copy file $2"
fi
}
# func_backup to
# makes a backup of a file that is about to be overwritten or replaced.
# 'to' is a relative pathname, relative to the current directory.
func_backup ()
{
if $doit; then
if test -f "$1"; then
rm -f "$1~"
cp -p "$1" "$1~"
fi
fi
}
# Now copy the files.
for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do
func_destfile "$file"
if test -n "$destfile"; then
func_copy_to_destfile ()
{
finaldestfile="$1"
mustcopy=
if test -f "$finaldestfile"; then
if func_compare "$finaldestfile" "$work_dir/archive/$file"; then
if test -n "$force"; then
# Overwrite locally modified file.
mustcopy=yes
fi
# If --force is not specified, don't overwrite locally modified files
# for which GNU gettext is a shared owner.
fi
else
mustcopy=yes
fi
if test -n "$mustcopy"; then
func_backup "$finaldestfile"
func_copy "$work_dir/archive/$file" "$finaldestfile"
fi
}
if test -n "$allpodirs"; then
for dir in $podirs; do
func_copy_to_destfile "$dir/$destfile"
done
else
func_copy_to_destfile "$destfile"
fi
fi
done
# That's it.
rm -rf "$work_dir"
exit 0
Binary file not shown.
Binary file not shown.
-123
View File
@@ -1,123 +0,0 @@
#! /bin/sh
#
# Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# Find a way to echo strings without interpreting backslash.
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
echo='echo'
else
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
echo='printf %s\n'
else
echo_func () {
cat <<EOT
$*
EOT
}
echo='echo_func'
fi
fi
# This script is primarily a shell function library. In order for
# ". gettext.sh" to find it, we install it in $PREFIX/bin (that is usually
# contained in $PATH), rather than in some other location such as
# $PREFIX/share/sh-scripts or $PREFIX/share/gettext. In order to not violate
# the Filesystem Hierarchy Standard when doing so, this script is executable.
# Therefore it needs to support the standard --help and --version.
if test -z "$ZSH_VERSION"; then
# zsh is not POSIX compliant: By default, while ". gettext.sh" is executed,
# it sets $0 to "gettext.sh", defeating the purpose of this test. But
# fortunately we know that when running under zsh, this script is always
# being sourced, not executed, because hardly anyone is crazy enough to
# install zsh as /bin/sh.
case "$0" in
gettext.sh | */gettext.sh | *\\gettext.sh)
progname=$0
package=gettext-runtime
version=0.18.1
# func_usage
# outputs to stdout the --help usage message.
func_usage ()
{
echo "GNU gettext shell script function library version $version"
echo "Usage: . gettext.sh"
}
# func_version
# outputs to stdout the --version message.
func_version ()
{
echo "$progname (GNU $package) $version"
echo "Copyright (C) 2003-2007 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
echo "Written by" "Bruno Haible"
}
if test $# = 1; then
case "$1" in
--help | --hel | --he | --h )
func_usage; exit 0 ;;
--version | --versio | --versi | --vers | --ver | --ve | --v )
func_version; exit 0 ;;
esac
fi
func_usage 1>&2
exit 1
;;
esac
fi
# eval_gettext MSGID
# looks up the translation of MSGID and substitutes shell variables in the
# result.
eval_gettext () {
gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1")
}
# eval_ngettext MSGID MSGID-PLURAL COUNT
# looks up the translation of MSGID / MSGID-PLURAL for COUNT and substitutes
# shell variables in the result.
eval_ngettext () {
ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2")
}
# Note: This use of envsubst is much safer than using the shell built-in 'eval'
# would be.
# 1) The security problem with Chinese translations that happen to use a
# character such as \xe0\x60 is avoided.
# 2) The security problem with malevolent translators who put in command lists
# like "$(...)" or "`...`" is avoided.
# 3) The translations can only refer to shell variables that are already
# mentioned in MSGID or MSGID-PLURAL.
#
# Note: "export PATH" above is a dummy; this is for the case when
# `envsubst --variables ...` returns nothing.
#
# Note: In eval_ngettext above, "$1 $2" means a string whose variables set is
# the union of the variables set of "$1" and "$2".
#
# Note: The minimal use of backquote above ensures that trailing newlines are
# not dropped, not from the gettext invocation and not from the value of any
# shell variable.
#
# Note: Field splitting on the `envsubst --variables ...` result is desired,
# since envsubst outputs the variables, separated by newlines. Pathname
# wildcard expansion or tilde expansion has no effect here, since the words
# output by "envsubst --variables ..." consist solely of alphanumeric
# characters and underscore.
File diff suppressed because it is too large. Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-717
View File
@@ -1,717 +0,0 @@
#! /bin/sh
#
# Copyright (C) 2002-2010 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This file is meant for authors, maintainers, co-maintainers or installers
# of packages which are internationalized with the help of GNU gettext. For
# further information how to use it consult the GNU gettext manual.
progname=$0
package=gettext-tools
version=0.18.1
# Set variables
# - gettext_dir directory where the sources are stored.
prefix="/usr/local/x86_64-w64-mingw32/stow/gettext-0.18.1.1"
datarootdir="${prefix}/share"
gettext_dir="${datarootdir}/gettext"
# func_tmpdir
# creates a temporary directory.
# Sets variable
# - tmp pathname of freshly created temporary directory
func_tmpdir ()
{
# Use the environment variable TMPDIR, falling back to /tmp. This allows
# users to specify a different temporary directory, for example, if their
# /tmp is filled up or too small.
: ${TMPDIR=/tmp}
{
# Use the mktemp program if available. If not available, hide the error
# message.
tmp=`(umask 077 && mktemp -d "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
# Use a simple mkdir command. It is guaranteed to fail if the directory
# already exists. $RANDOM is bash specific and expands to empty in shells
# other than bash, ksh and zsh. Its use does not increase security;
# rather, it minimizes the probability of failure in a very cluttered /tmp
# directory.
tmp=$TMPDIR/gt$$-$RANDOM
(umask 077 && mkdir "$tmp")
} ||
{
echo "$0: cannot create a temporary directory in $TMPDIR" >&2
{ (exit 1); exit 1; }
}
}
# Support for relocatability.
func_find_curr_installdir ()
{
# Determine curr_installdir, even taking into account symlinks.
curr_executable="$0"
case "$curr_executable" in
*/* | *\\*) ;;
*) # Need to look in the PATH.
if test "${PATH_SEPARATOR+set}" != set; then
func_tmpdir
{ echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh
chmod +x "$tmp"/conf.sh
if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -rf "$tmp"
fi
save_IFS="$IFS"; IFS="$PATH_SEPARATOR"
for dir in $PATH; do
IFS="$save_IFS"
test -z "$dir" && dir=.
for exec_ext in ''; do
if test -f "$dir/$curr_executable$exec_ext"; then
curr_executable="$dir/$curr_executable$exec_ext"
break 2
fi
done
done
IFS="$save_IFS"
;;
esac
# Make absolute.
case "$curr_executable" in
/* | ?:/* | ?:\\*) ;;
*) curr_executable=`pwd`/"$curr_executable" ;;
esac
# Resolve symlinks.
sed_dirname='s,/[^/]*$,,'
sed_linkdest='s,^.* -> \(.*\),\1,p'
while : ; do
lsline=`LC_ALL=C ls -l "$curr_executable"`
case "$lsline" in
*" -> "*)
linkdest=`echo "$lsline" | sed -n -e "$sed_linkdest"`
case "$linkdest" in
/* | ?:/* | ?:\\*) curr_executable="$linkdest" ;;
*) curr_executable=`echo "$curr_executable" | sed -e "$sed_dirname"`/"$linkdest" ;;
esac ;;
*) break ;;
esac
done
curr_installdir=`echo "$curr_executable" | sed -e 's,/[^/]*$,,'`
# Canonicalize.
curr_installdir=`cd "$curr_installdir" && pwd`
}
func_find_prefixes ()
{
# Compute the original/current installation prefixes by stripping the
# trailing directories off the original/current installation directories.
orig_installprefix="$orig_installdir"
curr_installprefix="$curr_installdir"
while true; do
orig_last=`echo "$orig_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
curr_last=`echo "$curr_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
if test -z "$orig_last" || test -z "$curr_last"; then
break
fi
if test "$orig_last" != "$curr_last"; then
break
fi
orig_installprefix=`echo "$orig_installprefix" | sed -e 's,/[^/]*$,,'`
curr_installprefix=`echo "$curr_installprefix" | sed -e 's,/[^/]*$,,'`
done
}
if test "no" = yes; then
exec_prefix="${prefix}"
bindir="${exec_prefix}/bin"
orig_installdir="$bindir" # see Makefile.am's *_SCRIPTS variables
func_find_curr_installdir # determine curr_installdir
func_find_prefixes
# Relocate the directory variables that we use.
gettext_dir=`echo "$gettext_dir/" | sed -e "s%^${orig_installprefix}/%${curr_installprefix}/%" | sed -e 's,/$,,'`
fi
# func_usage
# outputs to stdout the --help usage message.
func_usage ()
{
echo "\
Usage: autopoint [OPTION]...
Copies standard gettext infrastructure files into a source package.
Options:
--help print this help and exit
--version print version information and exit
-f, --force force overwriting of files that already exist
-n, --dry-run print modifications but don't perform them"
# echo "\
# -V version copy the infrastructure of the specified gettext version
# (dangerous)"
echo "
Report bugs to <bug-gnu-gettext@gnu.org>."
}
# func_version
# outputs to stdout the --version message.
func_version ()
{
echo "$progname (GNU $package) $version"
echo "Uses a versions archive in git format."
echo "Copyright (C) 2002-2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
echo "Written by" "Bruno Haible"
}
# func_fatal_error message
# outputs to stderr a fatal error message, and terminates the program.
func_fatal_error ()
{
echo "autopoint: *** $1" 1>&2
echo "autopoint: *** Stop." 1>&2
exit 1
}
# Command-line option processing.
# Removes the OPTIONS from the arguments. Sets the variables:
# - force yes if --force was given, empty otherwise
# - ver gettext version if -V was given, empty otherwise
# - doit false if --dry-run was given, : otherwise
{
force=
ver=
doit=:
while test $# -gt 0; do
case "$1" in
-n | --dry-run | --dry-ru | --dry-r | --dry- | --dry | --dr | --d )
shift
doit=false ;;
-f | --force | --forc | --for | --fo | --f )
shift
force=yes ;;
--help | --hel | --he | --h )
func_usage; exit 0 ;;
# -V ) # Some people put a space between -V and the version number.
# shift
# if test $# = 0; then
# func_usage 1>&2
# exit 1
# fi
# ver=$1;
# shift ;;
# -V*) # Some people omit the space between -V and the version number.
# ver=`echo "X$1" | sed -e 's/^X-V//'`
# shift ;;
--version | --versio | --versi | --vers | --ver | --ve | --v )
func_version
exit 0 ;;
-- ) # Stop option prcessing
shift; break ;;
-* )
echo "autopoint: unknown option $1" 1>&2
echo "Try 'autopoint --help' for more information." 1>&2
exit 1 ;;
* )
break ;;
esac
done
}
# Command-line argument processing.
# Analyzes the remaining arguments.
{
if test $# -gt 0; then
func_usage 1>&2
exit 1
fi
}
srcdir=`pwd`
# The current directory is now $srcdir.
# Check integrity of package: A configure.in/ac must be present. Sets variable
# - configure_in name of configure.in/ac file.
if test -f configure.in; then
configure_in=configure.in
else
if test -f configure.ac; then
configure_in=configure.ac
else
# KDE specific convention: configure.in.in
if test -f configure.in.in; then
configure_in=configure.in.in
else
func_fatal_error "Missing configure.in or configure.ac, please cd to your package first."
fi
fi
fi
# Check whether the -V option and the version number in configure.in match.
# At least one of the two must be given. If both are given, they must agree.
sed_extract_AM_GNU_GETTEXT_VERSION_argument='s/^AM_GNU_GETTEXT_VERSION(\([^()]*\)).*$/\1/'
sed_remove_outer_brackets='s/^\[\(.*\)\]$/\1/'
xver=`cat "$configure_in" | grep '^AM_GNU_GETTEXT_VERSION(' | sed -n -e "$sed_extract_AM_GNU_GETTEXT_VERSION_argument"p | sed -e "$sed_remove_outer_brackets" | sed -e 1q`
if test -z "$xver" && test -f intl/VERSION; then
xver=`cat intl/VERSION | LC_ALL=C sed -n -e 's/^.*gettext-\([-+_.0-9A-Za-z]*\).*$/\1/p'`
fi
if test -n "$xver"; then
if test -n "$ver"; then
if test "X$ver" != "X$xver"; then
func_fatal_error "Version mismatch: specified -V $ver but the package uses gettext version $xver"
fi
else
ver="$xver"
fi
else
if test -z "$ver"; then
func_fatal_error "Missing version: please specify in $configure_in through a line 'AM_GNU_GETTEXT_VERSION(x.yy.zz)' the gettext version the package is using"
fi
fi
# Check whether the version number is supported.
case "$ver" in
0.10.35 | 0.10.36 | 0.10.37 | 0.10.38 | 0.10.39 | 0.10.40 | \
0.11 | 0.11.1 | 0.11.2 | 0.11.3 | 0.11.4 | 0.11.5 | \
0.12 | 0.12.1 | \
0.13 | 0.13.1 | \
0.14 | 0.14.1 | 0.14.2 | 0.14.3 | 0.14.4 | 0.14.5 | 0.14.6 | \
0.15 | \
0.16 | 0.16.1 | \
0.17 | \
0.18 | 0.18.1 )
;;
*)
func_fatal_error "The AM_GNU_GETTEXT_VERSION declaration in your $configure_in
file requires the infrastructure from gettext-$ver but this version
is older. Please upgrade to gettext-$ver or newer."
;;
esac
# Check in which directory config.rpath, mkinstalldirs etc. belong.
auxdir=`cat "$configure_in" | grep '^AC_CONFIG_AUX_DIR' | sed -n -e 's/AC_CONFIG_AUX_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
if test -n "$auxdir"; then
auxdir="$auxdir/"
fi
# Check in which directory the *.m4 macros belong.
m4dir=m4
if test -f Makefile.am; then
# A package using automake.
# Extract the macro directory name from Makefile.am.
aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' Makefile.am | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
m4dir_is_next=
for arg in $aclocal_amflags; do
if test -n "$m4dir_is_next"; then
m4dir="$arg"
break
else
if test "X$arg" = "X-I"; then
m4dir_is_next=yes
else
m4dir_is_next=
fi
fi
done
fi
# Check whether to omit the intl/ directory.
omitintl=`cat "$configure_in" | grep '^AM_GNU_GETTEXT' | sed -n -e 's/^AM_GNU_GETTEXT(\([^(),]*\).*$/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
omitintl=`if test 'external' = "$omitintl"; then echo yes; fi`
# Check in which directory or directories the po/* infrastructure belongs.
sed_extract_config_files='s,#.*$,,
s,^dnl .*$,,
s, dnl .*$,,
/AC_CONFIG_FILES(/ {
ta
:a
s/)/)/
tb
s/\\$//
N
ba
:b
s,^.*AC_CONFIG_FILES([[ ]*\([^]"$`\\)]*\).*$,\1,p
}'
configfiles=`cat "$configure_in" | sed -n -e "$sed_extract_config_files"`
# PO directories have a Makefile.in generated from Makefile.in.in.
# Treat a directory as a PO directory if and only if it has a
# POTFILES.in file. This allows packages to have multiple PO
# directories under different names or in different locations.
sed_remove_Makefile_in='s,/Makefile\.in$,,'
podirs=`for f in $configfiles; do case "$f" in */Makefile.in) echo $f;; esac; done | sed -e "$sed_remove_Makefile_in"`
if test -z "$podirs"; then
# If we cannot get the list of PO directories from configure.ac, assume the
# common default.
podirs="po"
fi
# Set up a temporary checkout directory.
# Set variables
# - work_dir directory containing the temporary checkout
work_dir=tmpwrk$$
mkdir "$work_dir" || {
if test -d "$work_dir"; then
func_fatal_error "directory $work_dir already exists"
else
func_fatal_error "cannot create directory $work_dir"
fi
}
# We support three archive formats.
#
# Format | Size (KiB) for gettext-0.17 | Extra tools needed |
# -------+-----------------------------+--------------------+
# dir | 3000 | -- |
# cvs | 356 | cvs |
# git | 484 | git |
# -------+-----------------------------+--------------------+
case "git" in
dir)
# The archive of different versions is very large, but using it does not
# require special tools.
gzip -d -c < "$gettext_dir/archive.dir.tar.gz" | (cd "$work_dir" && tar xf - "gettext-$ver")
if test `find "$work_dir" -type f -print | wc -l` = 0; then
rm -rf "$work_dir"
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
fi
mv "$work_dir/gettext-$ver" "$work_dir/archive"
;;
cvs)
# We distributed the many different versions of the files in a CVS
# repository. This guaranteed a good compression rate:
#
# Including version size in KB of
# "du autopoint-files/archive"
# 0.10.35 240
# 0.10.36 428
# 0.10.37 436
# 0.10.38 488
# 0.10.39 500
# 0.10.40 528
# 0.11 720
# 0.11.1 740
# 0.11.2 748
# 0.11.3 804
# 0.11.4 864
# 0.11.5 880
# 0.12 1032
# 0.12.1 1032
# 0.13 1220
# 0.13.1 1236
# 0.14 1296
# 0.14.1 1300
# 0.14.2 1420
# 0.14.3 1428
# 0.14.4 1464
# 0.14.5 1508
# 0.14.6 1580
# 0.15 1760
# 0.16 1808
# 0.16.1 1812
# 0.17 2128
# 0.18 2656
#
# The requirement that the user must have the CVS program available is not
# a severe restrictions, because most of the people who use autopoint are
# users of CVS.
#
# But the CVS format is now deprecated, because "cvs init" does not work in
# all circumstances
# (see <http://lists.gnu.org/archive/html/bug-cvs/2010-05/msg00003.html>)
# and we are not allowed to distribute the cvs infrastructure files
# ourselves
# (see <http://lists.gnu.org/archive/html/bug-cvs/2010-06/msg00011.html>).
#
# Check availability of the CVS program.
(cvs -v) >/dev/null 2>/dev/null || func_fatal_error "cvs program not found"
# Set up a temporary CVS repository.
# We need the temporary CVS repository because any checkout needs write
# access to the CVSROOT/history file, so it cannot be under $gettext_dir.
# We need the temporary checkout directory because when --force was not
# given, we need to compare the existing files with the checked out ones.
# Set variables
# - cvs_dir directory containing the temporary repository
cvs_dir=tmpcvs$$
# Use an umask of 077, to avoid attacks that work by overwriting files in
# the "$CVSROOT"/CVSROOT directory.
(umask 077 && mkdir "$cvs_dir") || {
if test -d "$cvs_dir"; then
func_fatal_error "directory $cvs_dir already exists"
else
func_fatal_error "cannot create directory $cvs_dir"
fi
}
CVSROOT="$srcdir/$cvs_dir"
unset CVS_CLIENT_LOG
unset CVS_CLIENT_PORT
unset CVS_IGNORE_REMOTE_ROOT
unset CVS_LOCAL_BRANCH_NUM
unset CVS_NOBASES
unset CVS_PASSFILE
unset CVS_PASSWORD
unset CVS_PROXY_PORT
unset CVS_RCMD_PORT
unset CVS_RSH
unset CVS_SERVER
unset CVS_SERVER_SLEEP
CVS_SIGN_COMMITS=
export CVS_SIGN_COMMITS
unset CVS_SSH
unset CVS_VERIFY_CHECKOUTS
unset CVS_VERIFY_TEMPLATE
unset CVSIGNORE
unset CVSREAD
unset CVSREADONLYFS
unset CVSUMASK
unset CVSWRAPPERS
# Need to pass -d "$CVSROOT", because there may be a CVS directory in the
# current directory.
cvs -d "$CVSROOT" init
gzip -d -c < "$gettext_dir/archive.cvs.tar.gz" | (cd "$cvs_dir" && tar xf -)
cd "$work_dir"
cvsver=gettext-`echo "$ver" | sed -e 's/\./_/g'`
(cvs -d "$CVSROOT" checkout -r"$cvsver" archive > /dev/null) 2>&1 | grep -v '^cvs checkout: Updating'
find archive -name CVS -type d -print | xargs rm -rf
cd ..
rm -rf "$cvs_dir"
# Check that really all CVS directories are gone, otherwise we would overwrite
# the contents of the user's CVS directories.
if test `find $work_dir/archive -name CVS -type d -print | wc -l` != 0; then
rm -rf "$work_dir"
func_fatal_error "failed to remove all CVS subdirectories"
fi
if test `find $work_dir/archive -type f -print | wc -l` = 0; then
rm -rf "$work_dir"
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
fi
;;
git)
# Check availability of the git program.
(git --version) >/dev/null 2>/dev/null || func_fatal_error "git program not found"
mkdir "$work_dir/archive"
gzip -d -c < "$gettext_dir/archive.git.tar.gz" | (cd "$work_dir/archive" && tar xf -)
(cd "$work_dir/archive" && git checkout -q "gettext-$ver") || {
rm -rf "$work_dir"
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
}
(cd "$work_dir/archive" && rm -rf .git .gitignore)
;;
esac
# func_destfile file
# determines the destination file, relative to the package's top level
# directory, for a given file name, relative to archive.
# Sets variables
# - destfile relative destination file name, or
# empty if the file shall be omitted
# - sharedowner yes if the file is not only owned by GNU gettext but may
# be installed by automake or other tools, otherwise empty
# - allpodirs yes if the file is to be installed in every dir in $podirs
func_destfile ()
{
# There are five categories of files:
# ABOUT_NLS -> top level directory
# config.rpath mkinstalldirs -> $auxdir
# m4/* -> $m4dir/
# intl/* -> intl/
# po/* ->
sharedowner=
allpodirs=
case `echo "$1" | sed -e 's,[^/]*$,,'` in
"" )
case "$1" in
config.rpath ) destfile="$auxdir$1" ;;
mkinstalldirs ) destfile="$auxdir$1" sharedowner=yes ;;
* ) destfile="$1" ;;
esac
;;
m4/ ) destfile=`echo "$1" | sed -e "s,^m4/,$m4dir/,"` ;;
intl/ ) if test -n "$omitintl"; then destfile=""; else destfile="$1"; fi ;;
po/ ) destfile=`echo "$1" | sed -e "s,^po/,,"` allpodirs=yes ;;
* ) destfile="$1" ;;
esac
}
# func_compare existingfile gettextfile
# compares the existing file and the file from gettext, and decides whether the
# existing file should be overwritten with the file from gettext. Returns 0 if
# it should be overwritten, or 1 if it should be skipped.
sed_extract_serial='s/^#.* serial \([^ ]*\).*/\1/p
1q'
func_compare ()
{
if cmp -s "$1" "$2"; then
false
else
case "$2" in
*.m4)
# For interoperability with gnulib. gnulib often has newer versions of
# the *.m4 files than the latest gettext release. Don't overwrite a
# newer version from gnulib with an older version from the gettext
# release. The version can be retrieved from the first line, which
# looks like this: # file.m4 serial NN ...
existing_serial=`sed -n -e "$sed_extract_serial" < "$1"`
gettext_serial=`sed -n -e "$sed_extract_serial" < "$2"`
if test -n "$existing_serial" && test -n "$gettext_serial" \
&& test "$existing_serial" -ge "$gettext_serial" 2> /dev/null; then
false
else
true
fi
;;
*)
true
;;
esac
fi
}
# If some files have been locally modified and we have not been requested
# to overwrite them, then bail out. This is better than leaving a source
# package around where half of the files are locally modified and half are
# original - too great risk of version mismatch.
if test -z "$force"; then
mismatch=
func_tmpdir
mismatchfile="$tmp"/autopoint.diff
for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do
func_destfile "$file"
if test -n "$destfile"; then
func_compare_to_destfile ()
{
finaldestfile="$1"
if test -f "$finaldestfile"; then
if func_compare "$finaldestfile" "$work_dir/archive/$file"; then
if test -n "$sharedowner"; then
echo "autopoint: warning: File $finaldestfile has been locally modified." 1>&2
else
echo "autopoint: File $finaldestfile has been locally modified." 1>&2
mismatch=yes
diff -c "$work_dir/archive/$file" "$finaldestfile" | sed -e "1s,$work_dir/archive/,," >> "$mismatchfile"
fi
fi
fi
}
if test -n "$allpodirs"; then
for dir in $podirs; do
func_compare_to_destfile "$dir/$destfile"
done
else
func_compare_to_destfile "$destfile"
fi
fi
done
if test -n "$mismatch"; then
rm -rf "$work_dir"
func_fatal_error "Some files have been locally modified. Not overwriting them because --force has not been specified. For your convenience, you find the local modifications in the file '$mismatchfile'."
fi
rm -rf "$tmp"
fi
# func_mkdir_for to
# ensures the directory that would the given file exists.
# 'to' is a relative pathname, relative to the current directory.
func_mkdir_for ()
{
base=`echo "$1" | sed -e 's,/[^/]*$,,'`
if test "X$base" != "X$1" && test -n "$base"; then
func_mkdir_for "$base"
# Recompute base. It was clobbered by the recursive call.
base=`echo "$1" | sed -e 's,/[^/]*$,,'`
test -d "$base" || { echo "Creating directory $base"; mkdir "$base"; }
fi
}
# func_copy from to
# copies a file.
# 'from' is a relative pathname, relative to the current directory.
# 'to' is a relative pathname, relative to the current directory.
func_copy ()
{
if $doit; then
func_mkdir_for "$2"
rm -f "$2"
echo "Copying file $2"
cp "$1" "$2"
else
echo "Copy file $2"
fi
}
# func_backup to
# makes a backup of a file that is about to be overwritten or replaced.
# 'to' is a relative pathname, relative to the current directory.
func_backup ()
{
if $doit; then
if test -f "$1"; then
rm -f "$1~"
cp -p "$1" "$1~"
fi
fi
}
# Now copy the files.
for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do
func_destfile "$file"
if test -n "$destfile"; then
func_copy_to_destfile ()
{
finaldestfile="$1"
mustcopy=
if test -f "$finaldestfile"; then
if func_compare "$finaldestfile" "$work_dir/archive/$file"; then
if test -n "$force"; then
# Overwrite locally modified file.
mustcopy=yes
fi
# If --force is not specified, don't overwrite locally modified files
# for which GNU gettext is a shared owner.
fi
else
mustcopy=yes
fi
if test -n "$mustcopy"; then
func_backup "$finaldestfile"
func_copy "$work_dir/archive/$file" "$finaldestfile"
fi
}
if test -n "$allpodirs"; then
for dir in $podirs; do
func_copy_to_destfile "$dir/$destfile"
done
else
func_copy_to_destfile "$destfile"
fi
fi
done
# That's it.
rm -rf "$work_dir"
exit 0
Binary file not shown.
Binary file not shown.
-123
View File
@@ -1,123 +0,0 @@
#! /bin/sh
#
# Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# Find a way to echo strings without interpreting backslash.
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
echo='echo'
else
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
echo='printf %s\n'
else
echo_func () {
cat <<EOT
$*
EOT
}
echo='echo_func'
fi
fi
# This script is primarily a shell function library. In order for
# ". gettext.sh" to find it, we install it in $PREFIX/bin (that is usually
# contained in $PATH), rather than in some other location such as
# $PREFIX/share/sh-scripts or $PREFIX/share/gettext. In order to not violate
# the Filesystem Hierarchy Standard when doing so, this script is executable.
# Therefore it needs to support the standard --help and --version.
if test -z "$ZSH_VERSION"; then
# zsh is not POSIX compliant: By default, while ". gettext.sh" is executed,
# it sets $0 to "gettext.sh", defeating the purpose of this test. But
# fortunately we know that when running under zsh, this script is always
# being sourced, not executed, because hardly anyone is crazy enough to
# install zsh as /bin/sh.
case "$0" in
gettext.sh | */gettext.sh | *\\gettext.sh)
progname=$0
package=gettext-runtime
version=0.18.1
# func_usage
# outputs to stdout the --help usage message.
func_usage ()
{
echo "GNU gettext shell script function library version $version"
echo "Usage: . gettext.sh"
}
# func_version
# outputs to stdout the --version message.
func_version ()
{
echo "$progname (GNU $package) $version"
echo "Copyright (C) 2003-2007 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
echo "Written by" "Bruno Haible"
}
if test $# = 1; then
case "$1" in
--help | --hel | --he | --h )
func_usage; exit 0 ;;
--version | --versio | --versi | --vers | --ver | --ve | --v )
func_version; exit 0 ;;
esac
fi
func_usage 1>&2
exit 1
;;
esac
fi
# eval_gettext MSGID
# looks up the translation of MSGID and substitutes shell variables in the
# result.
eval_gettext () {
gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1")
}
# eval_ngettext MSGID MSGID-PLURAL COUNT
# looks up the translation of MSGID / MSGID-PLURAL for COUNT and substitutes
# shell variables in the result.
eval_ngettext () {
ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2")
}
# Note: This use of envsubst is much safer than using the shell built-in 'eval'
# would be.
# 1) The security problem with Chinese translations that happen to use a
# character such as \xe0\x60 is avoided.
# 2) The security problem with malevolent translators who put in command lists
# like "$(...)" or "`...`" is avoided.
# 3) The translations can only refer to shell variables that are already
# mentioned in MSGID or MSGID-PLURAL.
#
# Note: "export PATH" above is a dummy; this is for the case when
# `envsubst --variables ...` returns nothing.
#
# Note: In eval_ngettext above, "$1 $2" means a string whose variables set is
# the union of the variables set of "$1" and "$2".
#
# Note: The minimal use of backquote above ensures that trailing newlines are
# not dropped, not from the gettext invocation and not from the value of any
# shell variable.
#
# Note: Field splitting on the `envsubst --variables ...` result is desired,
# since envsubst outputs the variables, separated by newlines. Pathname
# wildcard expansion or tilde expansion has no effect here, since the words
# output by "envsubst --variables ..." consist solely of alphanumeric
# characters and underscore.
File diff suppressed because it is too large. Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-177
View File
@@ -1,177 +0,0 @@
--- gettext-runtime/intl/printf.c
+++ gettext-runtime/intl/printf.c
@@ -69,7 +69,7 @@
#define STATIC static
/* This needs to be consistent with libgnuintl.h.in. */
-#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
+#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__
/* Don't break __attribute__((format(printf,M,N))).
This redefinition is only possible because the libc in NetBSD, Cygwin,
mingw does not have a function __printf__. */
--- gettext-runtime/intl/libgnuintl.h.in
+++ gettext-runtime/intl/libgnuintl.h.in
@@ -330,7 +330,7 @@
#if !(defined printf && defined _GL_STDIO_H) /* don't override gnulib */
#undef printf
-#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
+#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__
/* Don't break __attribute__((format(printf,M,N))).
This redefinition is only possible because the libc in NetBSD, Cygwin,
mingw does not have a function __printf__.
---- gettext-tools/gnulib-lib/clean-temp.c
+++ gettext-tools/gnulib-lib/clean-temp.c
@@ -66,9 +66,11 @@
# endif
#endif
+#ifndef _WIN64
#ifndef uintptr_t
# define uintptr_t unsigned long
#endif
+#endif
#if !GNULIB_FCNTL_SAFER
/* The results of open() in this file are not used with fchdir,
--- gettext-tools/gnulib-lib/fstrcmp.c
+++ gettext-tools/gnulib-lib/fstrcmp.c
@@ -55,9 +55,11 @@
#include "minmax.h"
#include "xalloc.h"
+#ifndef _WIN64
#ifndef uintptr_t
# define uintptr_t unsigned long
#endif
+#endif
#define ELEMENT char
--- gettext-tools/gnulib-lib/gl_array_list.c
+++ gettext-tools/gnulib-lib/gl_array_list.c
@@ -55,9 +55,11 @@
/* Checked size_t computations. */
#include "xsize.h"
+#ifndef _WIN64
#ifndef uintptr_t
# define uintptr_t unsigned long
#endif
+#endif
/* -------------------------- gl_list_t Data Type -------------------------- */
--- gettext-tools/gnulib-lib/gl_linkedhash_list.c
+++ gettext-tools/gnulib-lib/gl_linkedhash_list.c
@@ -55,9 +55,11 @@
#include "xsize.h"
+#ifndef _WIN64
#ifndef uintptr_t
# define uintptr_t unsigned long
#endif
+#endif
#define WITH_HASHTABLE 1
--- gettext-tools/gnulib-lib/stdio.in.h
+++ gettext-tools/gnulib-lib/stdio.in.h
@@ -642,10 +642,6 @@
# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
|| (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
# if defined __GNUC__
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-/* Don't break __attribute__((format(printf,M,N))). */
-# define printf __printf__
-# endif
_GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *format, ...)
__asm__ (@ASM_SYMBOL_PREFIX@
--- gettext-tools/gnulib-lib/tempname.c
+++ gettext-tools/gnulib-lib/tempname.c
@@ -54,6 +54,10 @@
#include <stdint.h>
#include <unistd.h>
+#ifdef _WIN32
+# include <direct.h>
+#endif
+
#include <sys/stat.h>
#if _LIBC
@@ -73,6 +73,10 @@
# define __xstat64(version, file, buf) stat (file, buf)
#endif
+#ifdef _WIN32
+# define mkdir(path,mode) _mkdir(path)
+#endif
+
#if ! (HAVE___SECURE_GETENV || _LIBC)
# define __secure_getenv getenv
#endif
--- gettext-tools/src/write-java.c
+++ gettext-tools/src/write-java.c
@@ -30,6 +30,10 @@
#include <stdio.h>
#include <string.h>
+#ifdef _WIN32
+# include <direct.h>
+#endif
+
#include <sys/stat.h>
#if !defined S_ISDIR && defined S_IFDIR
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
@@ -53,6 +53,10 @@
# define S_IXUSR 00100
#endif
+#ifdef _WIN32
+# define mkdir(path,mode) _mkdir(path)
+#endif
+
#include "c-ctype.h"
#include "error.h"
#include "xerror.h"
--- gettext-tools/src/write-csharp.c
+++ gettext-tools/src/write-csharp.c
@@ -29,6 +29,10 @@
#include <stdio.h>
#include <string.h>
+#ifdef _WIN32
+# include <direct.h>
+#endif
+
#include <sys/stat.h>
#if !defined S_ISDIR && defined S_IFDIR
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
@@ -70,6 +70,10 @@
# define S_IXOTH (S_IXUSR >> 6)
#endif
+#ifdef _WIN32
+# define mkdir(path,mode) _mkdir(path)
+#endif
+
#include "c-ctype.h"
#include "relocatable.h"
#include "error.h"
--- gettext-tools/woe32dll/export.h
+++ gettext-tools/woe32dll/export.h
@@ -90,7 +90,11 @@
--export-all-symbols is used. */
/* IMP(x) is a symbol that contains the address of x. */
+#ifdef _WIN64
+#define IMP(x) __imp_##x
+#else
#define IMP(x) _imp__##x
+#endif
/* Ensure that the variable x is exported from the library, and that a
pseudo-variable IMP(x) is available. */
-66
View File
@@ -1,66 +0,0 @@
/* Class autosprintf - formatted output to an ostream.
Copyright (C) 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _AUTOSPRINTF_H
#define _AUTOSPRINTF_H
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(Spec) /* empty */
# endif
/* The __-protected variants of `format' and `printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
# define __printf__ printf
# endif
#endif
#include <string>
#include <iostream>
namespace gnu
{
/* A temporary object, usually allocated on the stack, representing
the result of an asprintf() call. */
class autosprintf
{
public:
/* Constructor: takes a format string and the printf arguments. */
autosprintf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
/* Copy constructor. */
autosprintf (const autosprintf& src);
/* Destructor: frees the temporarily allocated string. */
~autosprintf ();
/* Conversion to string. */
operator char * () const;
operator std::string () const;
/* Output to an ostream. */
friend inline std::ostream& operator<< (std::ostream& stream, const autosprintf& tmp)
{
stream << (tmp.str ? tmp.str : "(error in autosprintf)");
return stream;
}
private:
char *str;
};
}
#endif /* _AUTOSPRINTF_H */
-357
View File
@@ -1,357 +0,0 @@
/* Public API for GNU gettext PO files - contained in libgettextpo.
Copyright (C) 2003-2008, 2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _GETTEXT_PO_H
#define _GETTEXT_PO_H 1
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* =========================== Meta Information ============================ */
/* Version number: (major<<16) + (minor<<8) + subminor */
#define LIBGETTEXTPO_VERSION 0x001201
extern __declspec (dllimport) int libgettextpo_version;
/* ================================= Types ================================= */
/* A po_file_t represents the contents of a PO file. */
typedef struct po_file *po_file_t;
/* A po_message_iterator_t represents an iterator through a domain of a
PO file. */
typedef struct po_message_iterator *po_message_iterator_t;
/* A po_message_t represents a message in a PO file. */
typedef struct po_message *po_message_t;
/* A po_filepos_t represents a string's position within a source file. */
typedef struct po_filepos *po_filepos_t;
/* A po_error_handler handles error situations. */
struct po_error_handler
{
/* Signal an error. The error message is built from FORMAT and the following
arguments. ERRNUM, if nonzero, is an errno value.
Must increment the error_message_count variable declared in error.h.
Must not return if STATUS is nonzero. */
void (*error) (int status, int errnum,
const char *format, ...)
#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
__attribute__ ((__format__ (__printf__, 3, 4)))
#endif
;
/* Signal an error. The error message is built from FORMAT and the following
arguments. The error location is at FILENAME line LINENO. ERRNUM, if
nonzero, is an errno value.
Must increment the error_message_count variable declared in error.h.
Must not return if STATUS is nonzero. */
void (*error_at_line) (int status, int errnum,
const char *filename, unsigned int lineno,
const char *format, ...)
#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
__attribute__ ((__format__ (__printf__, 5, 6)))
#endif
;
/* Signal a multiline warning. The PREFIX applies to all lines of the
MESSAGE. Free the PREFIX and MESSAGE when done. */
void (*multiline_warning) (char *prefix, char *message);
/* Signal a multiline error. The PREFIX applies to all lines of the
MESSAGE. Free the PREFIX and MESSAGE when done.
Must increment the error_message_count variable declared in error.h if
PREFIX is non-NULL. */
void (*multiline_error) (char *prefix, char *message);
};
typedef const struct po_error_handler *po_error_handler_t;
/* A po_xerror_handler handles warnings, error and fatal error situations. */
#define PO_SEVERITY_WARNING 0 /* just a warning, tell the user */
#define PO_SEVERITY_ERROR 1 /* an error, the operation cannot complete */
#define PO_SEVERITY_FATAL_ERROR 2 /* an error, the operation must be aborted */
struct po_xerror_handler
{
/* Signal a problem of the given severity.
MESSAGE and/or FILENAME + LINENO indicate where the problem occurred.
If FILENAME is NULL, FILENAME and LINENO and COLUMN should be ignored.
If LINENO is (size_t)(-1), LINENO and COLUMN should be ignored.
If COLUMN is (size_t)(-1), it should be ignored.
MESSAGE_TEXT is the problem description (if MULTILINE_P is true,
multiple lines of text, each terminated with a newline, otherwise
usually a single line).
Must not return if SEVERITY is PO_SEVERITY_FATAL_ERROR. */
void (*xerror) (int severity,
po_message_t message,
const char *filename, size_t lineno, size_t column,
int multiline_p, const char *message_text);
/* Signal a problem that refers to two messages.
Similar to two calls to xerror.
If possible, a "..." can be appended to MESSAGE_TEXT1 and prepended to
MESSAGE_TEXT2. */
void (*xerror2) (int severity,
po_message_t message1,
const char *filename1, size_t lineno1, size_t column1,
int multiline_p1, const char *message_text1,
po_message_t message2,
const char *filename2, size_t lineno2, size_t column2,
int multiline_p2, const char *message_text2);
};
typedef const struct po_xerror_handler *po_xerror_handler_t;
/* Memory allocation:
The memory allocations performed by these functions use xmalloc(),
therefore will cause a program exit if memory is exhausted.
The memory allocated by po_file_read, and implicitly returned through
the po_message_* functions, lasts until freed with po_file_free. */
/* ============================= po_file_t API ============================= */
/* Create an empty PO file representation in memory. */
extern po_file_t po_file_create (void);
/* Read a PO file into memory.
Return its contents. Upon failure, return NULL and set errno. */
#define po_file_read po_file_read_v3
extern po_file_t po_file_read (const char *filename,
po_xerror_handler_t handler);
/* Write an in-memory PO file to a file.
Upon failure, return NULL and set errno. */
#define po_file_write po_file_write_v2
extern po_file_t po_file_write (po_file_t file, const char *filename,
po_xerror_handler_t handler);
/* Free a PO file from memory. */
extern void po_file_free (po_file_t file);
/* Return the names of the domains covered by a PO file in memory. */
extern const char * const * po_file_domains (po_file_t file);
/* =========================== Header entry API ============================ */
/* Return the header entry of a domain of a PO file in memory.
The domain NULL denotes the default domain.
Return NULL if there is no header entry. */
extern const char * po_file_domain_header (po_file_t file, const char *domain);
/* Return the value of a field in a header entry.
The return value is either a freshly allocated string, to be freed by the
caller, or NULL. */
extern char * po_header_field (const char *header, const char *field);
/* Return the header entry with a given field set to a given value. The field
is added if necessary.
The return value is a freshly allocated string. */
extern char * po_header_set_field (const char *header, const char *field, const char *value);
/* ======================= po_message_iterator_t API ======================= */
/* Create an iterator for traversing a domain of a PO file in memory.
The domain NULL denotes the default domain. */
extern po_message_iterator_t po_message_iterator (po_file_t file, const char *domain);
/* Free an iterator. */
extern void po_message_iterator_free (po_message_iterator_t iterator);
/* Return the next message, and advance the iterator.
Return NULL at the end of the message list. */
extern po_message_t po_next_message (po_message_iterator_t iterator);
/* Insert a message in a PO file in memory, in the domain and at the position
indicated by the iterator. The iterator thereby advances past the freshly
inserted message. */
extern void po_message_insert (po_message_iterator_t iterator, po_message_t message);
/* =========================== po_message_t API ============================ */
/* Return a freshly constructed message.
To finish initializing the message, you must set the msgid and msgstr. */
extern po_message_t po_message_create (void);
/* Return the context of a message, or NULL for a message not restricted to a
context. */
extern const char * po_message_msgctxt (po_message_t message);
/* Change the context of a message. NULL means a message not restricted to a
context. */
extern void po_message_set_msgctxt (po_message_t message, const char *msgctxt);
/* Return the msgid (untranslated English string) of a message. */
extern const char * po_message_msgid (po_message_t message);
/* Change the msgid (untranslated English string) of a message. */
extern void po_message_set_msgid (po_message_t message, const char *msgid);
/* Return the msgid_plural (untranslated English plural string) of a message,
or NULL for a message without plural. */
extern const char * po_message_msgid_plural (po_message_t message);
/* Change the msgid_plural (untranslated English plural string) of a message.
NULL means a message without plural. */
extern void po_message_set_msgid_plural (po_message_t message, const char *msgid_plural);
/* Return the msgstr (translation) of a message.
Return the empty string for an untranslated message. */
extern const char * po_message_msgstr (po_message_t message);
/* Change the msgstr (translation) of a message.
Use an empty string to denote an untranslated message. */
extern void po_message_set_msgstr (po_message_t message, const char *msgstr);
/* Return the msgstr[index] for a message with plural handling, or
NULL when the index is out of range or for a message without plural. */
extern const char * po_message_msgstr_plural (po_message_t message, int index);
/* Change the msgstr[index] for a message with plural handling.
Use a NULL value at the end to reduce the number of plural forms. */
extern void po_message_set_msgstr_plural (po_message_t message, int index, const char *msgstr);
/* Return the comments for a message. */
extern const char * po_message_comments (po_message_t message);
/* Change the comments for a message.
comments should be a multiline string, ending in a newline, or empty. */
extern void po_message_set_comments (po_message_t message, const char *comments);
/* Return the extracted comments for a message. */
extern const char * po_message_extracted_comments (po_message_t message);
/* Change the extracted comments for a message.
comments should be a multiline string, ending in a newline, or empty. */
extern void po_message_set_extracted_comments (po_message_t message, const char *comments);
/* Return the i-th file position for a message, or NULL if i is out of
range. */
extern po_filepos_t po_message_filepos (po_message_t message, int i);
/* Remove the i-th file position from a message.
The indices of all following file positions for the message are decremented
by one. */
extern void po_message_remove_filepos (po_message_t message, int i);
/* Add a file position to a message, if it is not already present for the
message.
file is the file name.
start_line is the line number where the string starts, or (size_t)(-1) if no
line number is available. */
extern void po_message_add_filepos (po_message_t message, const char *file, size_t start_line);
/* Return the previous context of a message, or NULL for none. */
extern const char * po_message_prev_msgctxt (po_message_t message);
/* Change the previous context of a message. NULL is allowed. */
extern void po_message_set_prev_msgctxt (po_message_t message, const char *prev_msgctxt);
/* Return the previous msgid (untranslated English string) of a message, or
NULL for none. */
extern const char * po_message_prev_msgid (po_message_t message);
/* Change the previous msgid (untranslated English string) of a message.
NULL is allowed. */
extern void po_message_set_prev_msgid (po_message_t message, const char *prev_msgid);
/* Return the previous msgid_plural (untranslated English plural string) of a
message, or NULL for none. */
extern const char * po_message_prev_msgid_plural (po_message_t message);
/* Change the previous msgid_plural (untranslated English plural string) of a
message. NULL is allowed. */
extern void po_message_set_prev_msgid_plural (po_message_t message, const char *prev_msgid_plural);
/* Return true if the message is marked obsolete. */
extern int po_message_is_obsolete (po_message_t message);
/* Change the obsolete mark of a message. */
extern void po_message_set_obsolete (po_message_t message, int obsolete);
/* Return true if the message is marked fuzzy. */
extern int po_message_is_fuzzy (po_message_t message);
/* Change the fuzzy mark of a message. */
extern void po_message_set_fuzzy (po_message_t message, int fuzzy);
/* Return true if the message is marked as being a format string of the given
type (e.g. "c-format"). */
extern int po_message_is_format (po_message_t message, const char *format_type);
/* Change the format string mark for a given type of a message. */
extern void po_message_set_format (po_message_t message, const char *format_type, /*bool*/int value);
/* If a numeric range of a message is set, return true and store the minimum
and maximum value in *MINP and *MAXP. */
extern int po_message_is_range (po_message_t message, int *minp, int *maxp);
/* Change the numeric range of a message. MIN and MAX must be non-negative,
with MIN < MAX. Use MIN = MAX = -1 to remove the numeric range of a
message. */
extern void po_message_set_range (po_message_t message, int min, int max);
/* =========================== po_filepos_t API ============================ */
/* Return the file name. */
extern const char * po_filepos_file (po_filepos_t filepos);
/* Return the line number where the string starts, or (size_t)(-1) if no line
number is available. */
extern size_t po_filepos_start_line (po_filepos_t filepos);
/* ============================ Format type API ============================= */
/* Return a NULL terminated array of the supported format types. */
extern const char * const * po_format_list (void);
/* Return the pretty name associated with a format type.
For example, for "csharp-format", return "C#".
Return NULL if the argument is not a supported format type. */
extern const char * po_format_pretty_name (const char *format_type);
/* ============================= Checking API ============================== */
/* Test whether an entire file PO file is valid, like msgfmt does it.
If it is invalid, pass the reasons to the handler. */
extern void po_file_check_all (po_file_t file, po_xerror_handler_t handler);
/* Test a single message, to be inserted in a PO file in memory, like msgfmt
does it. If it is invalid, pass the reasons to the handler. The iterator
is not modified by this call; it only specifies the file and the domain. */
extern void po_message_check_all (po_message_t message, po_message_iterator_t iterator, po_xerror_handler_t handler);
/* Test whether the message translation is a valid format string if the message
is marked as being a format string. If it is invalid, pass the reasons to
the handler. */
#define po_message_check_format po_message_check_format_v2
extern void po_message_check_format (po_message_t message, po_xerror_handler_t handler);
#ifdef __cplusplus
}
#endif
#endif /* _GETTEXT_PO_H */
-464
View File
@@ -1,464 +0,0 @@
/* Message catalogs for internationalization.
Copyright (C) 1995-1997, 2000-2010 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _LIBINTL_H
#define _LIBINTL_H 1
#include <locale.h>
#if (defined __APPLE__ && defined __MACH__) && 0
# include <xlocale.h>
#endif
/* The LC_MESSAGES locale category is the category used by the functions
gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
On systems that don't define it, use an arbitrary value instead.
On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
then includes <libintl.h> (i.e. this file!) and then only defines
LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
in this case. */
#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
# define LC_MESSAGES 1729
#endif
/* We define an additional symbol to signal that we use the GNU
implementation of gettext. */
#define __USE_GNU_GETTEXT 1
/* Provide information about the supported file formats. Returns the
maximum minor revision number supported for a given major revision. */
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
((major) == 0 || (major) == 1 ? 1 : -1)
/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
precedence over _conio_gettext. */
#ifdef __DJGPP__
# undef gettext
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Version number: (major<<16) + (minor<<8) + subminor */
#define LIBINTL_VERSION 0x001201
extern int libintl_version;
/* We redirect the functions to those prefixed with "libintl_". This is
necessary, because some systems define gettext/textdomain/... in the C
library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
If we used the unprefixed names, there would be cases where the
definition in the C library would override the one in the libintl.so
shared library. Recall that on ELF systems, the symbols are looked
up in the following order:
1. in the executable,
2. in the shared libraries specified on the link command line, in order,
3. in the dependencies of the shared libraries specified on the link
command line,
4. in the dlopen()ed shared libraries, in the order in which they were
dlopen()ed.
The definition in the C library would override the one in libintl.so if
either
* -lc is given on the link command line and -lintl isn't, or
* -lc is given on the link command line before -lintl, or
* libintl.so is a dependency of a dlopen()ed shared library but not
linked to the executable at link time.
Since Solaris gettext() behaves differently than GNU gettext(), this
would be unacceptable.
The redirection happens by default through macros in C, so that &gettext
is independent of the compilation unit, but through inline functions in
C++, in order not to interfere with the name mangling of class fields or
class methods called 'gettext'. */
/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
If he doesn't, we choose the method. A third possible method is
_INTL_REDIRECT_ASM, supported only by GCC. */
#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
# if defined __GNUC__ && __GNUC__ >= 2 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
# define _INTL_REDIRECT_ASM
# else
# ifdef __cplusplus
# define _INTL_REDIRECT_INLINE
# else
# define _INTL_REDIRECT_MACROS
# endif
# endif
#endif
/* Auxiliary macros. */
#ifdef _INTL_REDIRECT_ASM
# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
# define _INTL_STRINGIFY(prefix) #prefix
#else
# define _INTL_ASM(cname)
#endif
/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
its n-th argument literally. This enables GCC to warn for example about
printf (gettext ("foo %y")). */
#if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus)
# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
#else
# define _INTL_MAY_RETURN_STRING_ARG(n)
#endif
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
text). */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_gettext (const char *__msgid)
_INTL_MAY_RETURN_STRING_ARG (1);
static inline char *gettext (const char *__msgid)
{
return libintl_gettext (__msgid);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define gettext libintl_gettext
#endif
extern char *gettext (const char *__msgid)
_INTL_ASM (libintl_gettext)
_INTL_MAY_RETURN_STRING_ARG (1);
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current
LC_MESSAGES locale. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dgettext (const char *__domainname, const char *__msgid)
_INTL_MAY_RETURN_STRING_ARG (2);
static inline char *dgettext (const char *__domainname, const char *__msgid)
{
return libintl_dgettext (__domainname, __msgid);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dgettext libintl_dgettext
#endif
extern char *dgettext (const char *__domainname, const char *__msgid)
_INTL_ASM (libintl_dgettext)
_INTL_MAY_RETURN_STRING_ARG (2);
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
locale. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
int __category)
_INTL_MAY_RETURN_STRING_ARG (2);
static inline char *dcgettext (const char *__domainname, const char *__msgid,
int __category)
{
return libintl_dcgettext (__domainname, __msgid, __category);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dcgettext libintl_dcgettext
#endif
extern char *dcgettext (const char *__domainname, const char *__msgid,
int __category)
_INTL_ASM (libintl_dcgettext)
_INTL_MAY_RETURN_STRING_ARG (2);
#endif
/* Similar to `gettext' but select the plural form corresponding to the
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
static inline char *ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
{
return libintl_ngettext (__msgid1, __msgid2, __n);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define ngettext libintl_ngettext
#endif
extern char *ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
_INTL_ASM (libintl_ngettext)
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
#endif
/* Similar to `dgettext' but select the plural form corresponding to the
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
const char *__msgid2, unsigned long int __n)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
static inline char *dngettext (const char *__domainname, const char *__msgid1,
const char *__msgid2, unsigned long int __n)
{
return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dngettext libintl_dngettext
#endif
extern char *dngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n)
_INTL_ASM (libintl_dngettext)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
#endif
/* Similar to `dcgettext' but select the plural form corresponding to the
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
static inline char *dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
{
return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dcngettext libintl_dcngettext
#endif
extern char *dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
_INTL_ASM (libintl_dcngettext)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
#endif
/* Set the current default message catalog to DOMAINNAME.
If DOMAINNAME is null, return the current default.
If DOMAINNAME is "", reset to the default of "messages". */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_textdomain (const char *__domainname);
static inline char *textdomain (const char *__domainname)
{
return libintl_textdomain (__domainname);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define textdomain libintl_textdomain
#endif
extern char *textdomain (const char *__domainname)
_INTL_ASM (libintl_textdomain);
#endif
/* Specify that the DOMAINNAME message catalog will be found
in DIRNAME rather than in the system locale data base. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_bindtextdomain (const char *__domainname,
const char *__dirname);
static inline char *bindtextdomain (const char *__domainname,
const char *__dirname)
{
return libintl_bindtextdomain (__domainname, __dirname);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define bindtextdomain libintl_bindtextdomain
#endif
extern char *bindtextdomain (const char *__domainname, const char *__dirname)
_INTL_ASM (libintl_bindtextdomain);
#endif
/* Specify the character encoding in which the messages from the
DOMAINNAME message catalog will be returned. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_bind_textdomain_codeset (const char *__domainname,
const char *__codeset);
static inline char *bind_textdomain_codeset (const char *__domainname,
const char *__codeset)
{
return libintl_bind_textdomain_codeset (__domainname, __codeset);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define bind_textdomain_codeset libintl_bind_textdomain_codeset
#endif
extern char *bind_textdomain_codeset (const char *__domainname,
const char *__codeset)
_INTL_ASM (libintl_bind_textdomain_codeset);
#endif
/* Support for format strings with positions in *printf(), following the
POSIX/XSI specification.
Note: These replacements for the *printf() functions are visible only
in source files that #include <libintl.h> or #include "gettext.h".
Packages that use *printf() in source files that don't refer to _()
or gettext() but for which the format string could be the return value
of _() or gettext() need to add this #include. Oh well. */
#if !0
#include <stdio.h>
#include <stddef.h>
/* Get va_list. */
#if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#if !(defined fprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef fprintf
#define fprintf libintl_fprintf
extern int fprintf (FILE *, const char *, ...);
#endif
#if !(defined vfprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vfprintf
#define vfprintf libintl_vfprintf
extern int vfprintf (FILE *, const char *, va_list);
#endif
#if !(defined printf && defined _GL_STDIO_H) /* don't override gnulib */
#undef printf
#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
/* Don't break __attribute__((format(printf,M,N))).
This redefinition is only possible because the libc in NetBSD, Cygwin,
mingw does not have a function __printf__.
Alternatively, we could have done this redirection only when compiling with
__GNUC__, together with a symbol redirection:
extern int printf (const char *, ...)
__asm__ (#__USER_LABEL_PREFIX__ "libintl_printf");
But doing it now would introduce a binary incompatibility with already
distributed versions of libintl on these systems. */
# define libintl_printf __printf__
#endif
#define printf libintl_printf
extern int printf (const char *, ...);
#endif
#if !(defined vprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vprintf
#define vprintf libintl_vprintf
extern int vprintf (const char *, va_list);
#endif
#if !(defined sprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef sprintf
#define sprintf libintl_sprintf
extern int sprintf (char *, const char *, ...);
#endif
#if !(defined vsprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vsprintf
#define vsprintf libintl_vsprintf
extern int vsprintf (char *, const char *, va_list);
#endif
#if 1
#if !(defined snprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef snprintf
#define snprintf libintl_snprintf
extern int snprintf (char *, size_t, const char *, ...);
#endif
#if !(defined vsnprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vsnprintf
#define vsnprintf libintl_vsnprintf
extern int vsnprintf (char *, size_t, const char *, va_list);
#endif
#endif
#if 0
#if !(defined asprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef asprintf
#define asprintf libintl_asprintf
extern int asprintf (char **, const char *, ...);
#endif
#if !(defined vasprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vasprintf
#define vasprintf libintl_vasprintf
extern int vasprintf (char **, const char *, va_list);
#endif
#endif
#if 0
#undef fwprintf
#define fwprintf libintl_fwprintf
extern int fwprintf (FILE *, const wchar_t *, ...);
#undef vfwprintf
#define vfwprintf libintl_vfwprintf
extern int vfwprintf (FILE *, const wchar_t *, va_list);
#undef wprintf
#define wprintf libintl_wprintf
extern int wprintf (const wchar_t *, ...);
#undef vwprintf
#define vwprintf libintl_vwprintf
extern int vwprintf (const wchar_t *, va_list);
#undef swprintf
#define swprintf libintl_swprintf
extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
#undef vswprintf
#define vswprintf libintl_vswprintf
extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
#endif
#endif
/* Support for the locale chosen by the user. */
#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
#undef setlocale
#define setlocale libintl_setlocale
extern char *setlocale (int, const char *);
#if 0
#undef newlocale
#define newlocale libintl_newlocale
extern locale_t newlocale (int, const char *, locale_t);
#endif
#endif
/* Support for relocatable packages. */
/* Sets the original and the current installation prefix of the package.
Relocation simply replaces a pathname starting with the original prefix
by the corresponding pathname with the current prefix instead. Both
prefixes should be directory names without trailing slash (i.e. use ""
instead of "/"). */
#define libintl_set_relocation_prefix libintl_set_relocation_prefix
extern void
libintl_set_relocation_prefix (const char *orig_prefix,
const char *curr_prefix);
#ifdef __cplusplus
}
#endif
#endif /* libintl.h */
-66
View File
@@ -1,66 +0,0 @@
/* Class autosprintf - formatted output to an ostream.
Copyright (C) 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _AUTOSPRINTF_H
#define _AUTOSPRINTF_H
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(Spec) /* empty */
# endif
/* The __-protected variants of `format' and `printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
# define __printf__ printf
# endif
#endif
#include <string>
#include <iostream>
namespace gnu
{
/* A temporary object, usually allocated on the stack, representing
the result of an asprintf() call. */
class autosprintf
{
public:
/* Constructor: takes a format string and the printf arguments. */
autosprintf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
/* Copy constructor. */
autosprintf (const autosprintf& src);
/* Destructor: frees the temporarily allocated string. */
~autosprintf ();
/* Conversion to string. */
operator char * () const;
operator std::string () const;
/* Output to an ostream. */
friend inline std::ostream& operator<< (std::ostream& stream, const autosprintf& tmp)
{
stream << (tmp.str ? tmp.str : "(error in autosprintf)");
return stream;
}
private:
char *str;
};
}
#endif /* _AUTOSPRINTF_H */
-357
View File
@@ -1,357 +0,0 @@
/* Public API for GNU gettext PO files - contained in libgettextpo.
Copyright (C) 2003-2008, 2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _GETTEXT_PO_H
#define _GETTEXT_PO_H 1
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* =========================== Meta Information ============================ */
/* Version number: (major<<16) + (minor<<8) + subminor */
#define LIBGETTEXTPO_VERSION 0x001201
extern int libgettextpo_version;
/* ================================= Types ================================= */
/* A po_file_t represents the contents of a PO file. */
typedef struct po_file *po_file_t;
/* A po_message_iterator_t represents an iterator through a domain of a
PO file. */
typedef struct po_message_iterator *po_message_iterator_t;
/* A po_message_t represents a message in a PO file. */
typedef struct po_message *po_message_t;
/* A po_filepos_t represents a string's position within a source file. */
typedef struct po_filepos *po_filepos_t;
/* A po_error_handler handles error situations. */
struct po_error_handler
{
/* Signal an error. The error message is built from FORMAT and the following
arguments. ERRNUM, if nonzero, is an errno value.
Must increment the error_message_count variable declared in error.h.
Must not return if STATUS is nonzero. */
void (*error) (int status, int errnum,
const char *format, ...)
#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
__attribute__ ((__format__ (__printf__, 3, 4)))
#endif
;
/* Signal an error. The error message is built from FORMAT and the following
arguments. The error location is at FILENAME line LINENO. ERRNUM, if
nonzero, is an errno value.
Must increment the error_message_count variable declared in error.h.
Must not return if STATUS is nonzero. */
void (*error_at_line) (int status, int errnum,
const char *filename, unsigned int lineno,
const char *format, ...)
#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
__attribute__ ((__format__ (__printf__, 5, 6)))
#endif
;
/* Signal a multiline warning. The PREFIX applies to all lines of the
MESSAGE. Free the PREFIX and MESSAGE when done. */
void (*multiline_warning) (char *prefix, char *message);
/* Signal a multiline error. The PREFIX applies to all lines of the
MESSAGE. Free the PREFIX and MESSAGE when done.
Must increment the error_message_count variable declared in error.h if
PREFIX is non-NULL. */
void (*multiline_error) (char *prefix, char *message);
};
typedef const struct po_error_handler *po_error_handler_t;
/* A po_xerror_handler handles warnings, error and fatal error situations. */
#define PO_SEVERITY_WARNING 0 /* just a warning, tell the user */
#define PO_SEVERITY_ERROR 1 /* an error, the operation cannot complete */
#define PO_SEVERITY_FATAL_ERROR 2 /* an error, the operation must be aborted */
struct po_xerror_handler
{
/* Signal a problem of the given severity.
MESSAGE and/or FILENAME + LINENO indicate where the problem occurred.
If FILENAME is NULL, FILENAME and LINENO and COLUMN should be ignored.
If LINENO is (size_t)(-1), LINENO and COLUMN should be ignored.
If COLUMN is (size_t)(-1), it should be ignored.
MESSAGE_TEXT is the problem description (if MULTILINE_P is true,
multiple lines of text, each terminated with a newline, otherwise
usually a single line).
Must not return if SEVERITY is PO_SEVERITY_FATAL_ERROR. */
void (*xerror) (int severity,
po_message_t message,
const char *filename, size_t lineno, size_t column,
int multiline_p, const char *message_text);
/* Signal a problem that refers to two messages.
Similar to two calls to xerror.
If possible, a "..." can be appended to MESSAGE_TEXT1 and prepended to
MESSAGE_TEXT2. */
void (*xerror2) (int severity,
po_message_t message1,
const char *filename1, size_t lineno1, size_t column1,
int multiline_p1, const char *message_text1,
po_message_t message2,
const char *filename2, size_t lineno2, size_t column2,
int multiline_p2, const char *message_text2);
};
typedef const struct po_xerror_handler *po_xerror_handler_t;
/* Memory allocation:
The memory allocations performed by these functions use xmalloc(),
therefore will cause a program exit if memory is exhausted.
The memory allocated by po_file_read, and implicitly returned through
the po_message_* functions, lasts until freed with po_file_free. */
/* ============================= po_file_t API ============================= */
/* Create an empty PO file representation in memory. */
extern po_file_t po_file_create (void);
/* Read a PO file into memory.
Return its contents. Upon failure, return NULL and set errno. */
#define po_file_read po_file_read_v3
extern po_file_t po_file_read (const char *filename,
po_xerror_handler_t handler);
/* Write an in-memory PO file to a file.
Upon failure, return NULL and set errno. */
#define po_file_write po_file_write_v2
extern po_file_t po_file_write (po_file_t file, const char *filename,
po_xerror_handler_t handler);
/* Free a PO file from memory. */
extern void po_file_free (po_file_t file);
/* Return the names of the domains covered by a PO file in memory. */
extern const char * const * po_file_domains (po_file_t file);
/* =========================== Header entry API ============================ */
/* Return the header entry of a domain of a PO file in memory.
The domain NULL denotes the default domain.
Return NULL if there is no header entry. */
extern const char * po_file_domain_header (po_file_t file, const char *domain);
/* Return the value of a field in a header entry.
The return value is either a freshly allocated string, to be freed by the
caller, or NULL. */
extern char * po_header_field (const char *header, const char *field);
/* Return the header entry with a given field set to a given value. The field
is added if necessary.
The return value is a freshly allocated string. */
extern char * po_header_set_field (const char *header, const char *field, const char *value);
/* ======================= po_message_iterator_t API ======================= */
/* Create an iterator for traversing a domain of a PO file in memory.
The domain NULL denotes the default domain. */
extern po_message_iterator_t po_message_iterator (po_file_t file, const char *domain);
/* Free an iterator. */
extern void po_message_iterator_free (po_message_iterator_t iterator);
/* Return the next message, and advance the iterator.
Return NULL at the end of the message list. */
extern po_message_t po_next_message (po_message_iterator_t iterator);
/* Insert a message in a PO file in memory, in the domain and at the position
indicated by the iterator. The iterator thereby advances past the freshly
inserted message. */
extern void po_message_insert (po_message_iterator_t iterator, po_message_t message);
/* =========================== po_message_t API ============================ */
/* Return a freshly constructed message.
To finish initializing the message, you must set the msgid and msgstr. */
extern po_message_t po_message_create (void);
/* Return the context of a message, or NULL for a message not restricted to a
context. */
extern const char * po_message_msgctxt (po_message_t message);
/* Change the context of a message. NULL means a message not restricted to a
context. */
extern void po_message_set_msgctxt (po_message_t message, const char *msgctxt);
/* Return the msgid (untranslated English string) of a message. */
extern const char * po_message_msgid (po_message_t message);
/* Change the msgid (untranslated English string) of a message. */
extern void po_message_set_msgid (po_message_t message, const char *msgid);
/* Return the msgid_plural (untranslated English plural string) of a message,
or NULL for a message without plural. */
extern const char * po_message_msgid_plural (po_message_t message);
/* Change the msgid_plural (untranslated English plural string) of a message.
NULL means a message without plural. */
extern void po_message_set_msgid_plural (po_message_t message, const char *msgid_plural);
/* Return the msgstr (translation) of a message.
Return the empty string for an untranslated message. */
extern const char * po_message_msgstr (po_message_t message);
/* Change the msgstr (translation) of a message.
Use an empty string to denote an untranslated message. */
extern void po_message_set_msgstr (po_message_t message, const char *msgstr);
/* Return the msgstr[index] for a message with plural handling, or
NULL when the index is out of range or for a message without plural. */
extern const char * po_message_msgstr_plural (po_message_t message, int index);
/* Change the msgstr[index] for a message with plural handling.
Use a NULL value at the end to reduce the number of plural forms. */
extern void po_message_set_msgstr_plural (po_message_t message, int index, const char *msgstr);
/* Return the comments for a message. */
extern const char * po_message_comments (po_message_t message);
/* Change the comments for a message.
comments should be a multiline string, ending in a newline, or empty. */
extern void po_message_set_comments (po_message_t message, const char *comments);
/* Return the extracted comments for a message. */
extern const char * po_message_extracted_comments (po_message_t message);
/* Change the extracted comments for a message.
comments should be a multiline string, ending in a newline, or empty. */
extern void po_message_set_extracted_comments (po_message_t message, const char *comments);
/* Return the i-th file position for a message, or NULL if i is out of
range. */
extern po_filepos_t po_message_filepos (po_message_t message, int i);
/* Remove the i-th file position from a message.
The indices of all following file positions for the message are decremented
by one. */
extern void po_message_remove_filepos (po_message_t message, int i);
/* Add a file position to a message, if it is not already present for the
message.
file is the file name.
start_line is the line number where the string starts, or (size_t)(-1) if no
line number is available. */
extern void po_message_add_filepos (po_message_t message, const char *file, size_t start_line);
/* Return the previous context of a message, or NULL for none. */
extern const char * po_message_prev_msgctxt (po_message_t message);
/* Change the previous context of a message. NULL is allowed. */
extern void po_message_set_prev_msgctxt (po_message_t message, const char *prev_msgctxt);
/* Return the previous msgid (untranslated English string) of a message, or
NULL for none. */
extern const char * po_message_prev_msgid (po_message_t message);
/* Change the previous msgid (untranslated English string) of a message.
NULL is allowed. */
extern void po_message_set_prev_msgid (po_message_t message, const char *prev_msgid);
/* Return the previous msgid_plural (untranslated English plural string) of a
message, or NULL for none. */
extern const char * po_message_prev_msgid_plural (po_message_t message);
/* Change the previous msgid_plural (untranslated English plural string) of a
message. NULL is allowed. */
extern void po_message_set_prev_msgid_plural (po_message_t message, const char *prev_msgid_plural);
/* Return true if the message is marked obsolete. */
extern int po_message_is_obsolete (po_message_t message);
/* Change the obsolete mark of a message. */
extern void po_message_set_obsolete (po_message_t message, int obsolete);
/* Return true if the message is marked fuzzy. */
extern int po_message_is_fuzzy (po_message_t message);
/* Change the fuzzy mark of a message. */
extern void po_message_set_fuzzy (po_message_t message, int fuzzy);
/* Return true if the message is marked as being a format string of the given
type (e.g. "c-format"). */
extern int po_message_is_format (po_message_t message, const char *format_type);
/* Change the format string mark for a given type of a message. */
extern void po_message_set_format (po_message_t message, const char *format_type, /*bool*/int value);
/* If a numeric range of a message is set, return true and store the minimum
and maximum value in *MINP and *MAXP. */
extern int po_message_is_range (po_message_t message, int *minp, int *maxp);
/* Change the numeric range of a message. MIN and MAX must be non-negative,
with MIN < MAX. Use MIN = MAX = -1 to remove the numeric range of a
message. */
extern void po_message_set_range (po_message_t message, int min, int max);
/* =========================== po_filepos_t API ============================ */
/* Return the file name. */
extern const char * po_filepos_file (po_filepos_t filepos);
/* Return the line number where the string starts, or (size_t)(-1) if no line
number is available. */
extern size_t po_filepos_start_line (po_filepos_t filepos);
/* ============================ Format type API ============================= */
/* Return a NULL terminated array of the supported format types. */
extern const char * const * po_format_list (void);
/* Return the pretty name associated with a format type.
For example, for "csharp-format", return "C#".
Return NULL if the argument is not a supported format type. */
extern const char * po_format_pretty_name (const char *format_type);
/* ============================= Checking API ============================== */
/* Test whether an entire file PO file is valid, like msgfmt does it.
If it is invalid, pass the reasons to the handler. */
extern void po_file_check_all (po_file_t file, po_xerror_handler_t handler);
/* Test a single message, to be inserted in a PO file in memory, like msgfmt
does it. If it is invalid, pass the reasons to the handler. The iterator
is not modified by this call; it only specifies the file and the domain. */
extern void po_message_check_all (po_message_t message, po_message_iterator_t iterator, po_xerror_handler_t handler);
/* Test whether the message translation is a valid format string if the message
is marked as being a format string. If it is invalid, pass the reasons to
the handler. */
#define po_message_check_format po_message_check_format_v2
extern void po_message_check_format (po_message_t message, po_xerror_handler_t handler);
#ifdef __cplusplus
}
#endif
#endif /* _GETTEXT_PO_H */
-464
View File
@@ -1,464 +0,0 @@
/* Message catalogs for internationalization.
Copyright (C) 1995-1997, 2000-2010 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _LIBINTL_H
#define _LIBINTL_H 1
#include <locale.h>
#if (defined __APPLE__ && defined __MACH__) && 0
# include <xlocale.h>
#endif
/* The LC_MESSAGES locale category is the category used by the functions
gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
On systems that don't define it, use an arbitrary value instead.
On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
then includes <libintl.h> (i.e. this file!) and then only defines
LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
in this case. */
#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
# define LC_MESSAGES 1729
#endif
/* We define an additional symbol to signal that we use the GNU
implementation of gettext. */
#define __USE_GNU_GETTEXT 1
/* Provide information about the supported file formats. Returns the
maximum minor revision number supported for a given major revision. */
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
((major) == 0 || (major) == 1 ? 1 : -1)
/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
precedence over _conio_gettext. */
#ifdef __DJGPP__
# undef gettext
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Version number: (major<<16) + (minor<<8) + subminor */
#define LIBINTL_VERSION 0x001201
extern int libintl_version;
/* We redirect the functions to those prefixed with "libintl_". This is
necessary, because some systems define gettext/textdomain/... in the C
library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
If we used the unprefixed names, there would be cases where the
definition in the C library would override the one in the libintl.so
shared library. Recall that on ELF systems, the symbols are looked
up in the following order:
1. in the executable,
2. in the shared libraries specified on the link command line, in order,
3. in the dependencies of the shared libraries specified on the link
command line,
4. in the dlopen()ed shared libraries, in the order in which they were
dlopen()ed.
The definition in the C library would override the one in libintl.so if
either
* -lc is given on the link command line and -lintl isn't, or
* -lc is given on the link command line before -lintl, or
* libintl.so is a dependency of a dlopen()ed shared library but not
linked to the executable at link time.
Since Solaris gettext() behaves differently than GNU gettext(), this
would be unacceptable.
The redirection happens by default through macros in C, so that &gettext
is independent of the compilation unit, but through inline functions in
C++, in order not to interfere with the name mangling of class fields or
class methods called 'gettext'. */
/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
If he doesn't, we choose the method. A third possible method is
_INTL_REDIRECT_ASM, supported only by GCC. */
#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
# if defined __GNUC__ && __GNUC__ >= 2 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
# define _INTL_REDIRECT_ASM
# else
# ifdef __cplusplus
# define _INTL_REDIRECT_INLINE
# else
# define _INTL_REDIRECT_MACROS
# endif
# endif
#endif
/* Auxiliary macros. */
#ifdef _INTL_REDIRECT_ASM
# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
# define _INTL_STRINGIFY(prefix) #prefix
#else
# define _INTL_ASM(cname)
#endif
/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
its n-th argument literally. This enables GCC to warn for example about
printf (gettext ("foo %y")). */
#if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus)
# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
#else
# define _INTL_MAY_RETURN_STRING_ARG(n)
#endif
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
text). */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_gettext (const char *__msgid)
_INTL_MAY_RETURN_STRING_ARG (1);
static inline char *gettext (const char *__msgid)
{
return libintl_gettext (__msgid);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define gettext libintl_gettext
#endif
extern char *gettext (const char *__msgid)
_INTL_ASM (libintl_gettext)
_INTL_MAY_RETURN_STRING_ARG (1);
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current
LC_MESSAGES locale. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dgettext (const char *__domainname, const char *__msgid)
_INTL_MAY_RETURN_STRING_ARG (2);
static inline char *dgettext (const char *__domainname, const char *__msgid)
{
return libintl_dgettext (__domainname, __msgid);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dgettext libintl_dgettext
#endif
extern char *dgettext (const char *__domainname, const char *__msgid)
_INTL_ASM (libintl_dgettext)
_INTL_MAY_RETURN_STRING_ARG (2);
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
locale. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
int __category)
_INTL_MAY_RETURN_STRING_ARG (2);
static inline char *dcgettext (const char *__domainname, const char *__msgid,
int __category)
{
return libintl_dcgettext (__domainname, __msgid, __category);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dcgettext libintl_dcgettext
#endif
extern char *dcgettext (const char *__domainname, const char *__msgid,
int __category)
_INTL_ASM (libintl_dcgettext)
_INTL_MAY_RETURN_STRING_ARG (2);
#endif
/* Similar to `gettext' but select the plural form corresponding to the
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
static inline char *ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
{
return libintl_ngettext (__msgid1, __msgid2, __n);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define ngettext libintl_ngettext
#endif
extern char *ngettext (const char *__msgid1, const char *__msgid2,
unsigned long int __n)
_INTL_ASM (libintl_ngettext)
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
#endif
/* Similar to `dgettext' but select the plural form corresponding to the
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
const char *__msgid2, unsigned long int __n)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
static inline char *dngettext (const char *__domainname, const char *__msgid1,
const char *__msgid2, unsigned long int __n)
{
return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dngettext libintl_dngettext
#endif
extern char *dngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n)
_INTL_ASM (libintl_dngettext)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
#endif
/* Similar to `dcgettext' but select the plural form corresponding to the
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
static inline char *dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
{
return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define dcngettext libintl_dcngettext
#endif
extern char *dcngettext (const char *__domainname,
const char *__msgid1, const char *__msgid2,
unsigned long int __n, int __category)
_INTL_ASM (libintl_dcngettext)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
#endif
/* Set the current default message catalog to DOMAINNAME.
If DOMAINNAME is null, return the current default.
If DOMAINNAME is "", reset to the default of "messages". */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_textdomain (const char *__domainname);
static inline char *textdomain (const char *__domainname)
{
return libintl_textdomain (__domainname);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define textdomain libintl_textdomain
#endif
extern char *textdomain (const char *__domainname)
_INTL_ASM (libintl_textdomain);
#endif
/* Specify that the DOMAINNAME message catalog will be found
in DIRNAME rather than in the system locale data base. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_bindtextdomain (const char *__domainname,
const char *__dirname);
static inline char *bindtextdomain (const char *__domainname,
const char *__dirname)
{
return libintl_bindtextdomain (__domainname, __dirname);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define bindtextdomain libintl_bindtextdomain
#endif
extern char *bindtextdomain (const char *__domainname, const char *__dirname)
_INTL_ASM (libintl_bindtextdomain);
#endif
/* Specify the character encoding in which the messages from the
DOMAINNAME message catalog will be returned. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_bind_textdomain_codeset (const char *__domainname,
const char *__codeset);
static inline char *bind_textdomain_codeset (const char *__domainname,
const char *__codeset)
{
return libintl_bind_textdomain_codeset (__domainname, __codeset);
}
#else
#ifdef _INTL_REDIRECT_MACROS
# define bind_textdomain_codeset libintl_bind_textdomain_codeset
#endif
extern char *bind_textdomain_codeset (const char *__domainname,
const char *__codeset)
_INTL_ASM (libintl_bind_textdomain_codeset);
#endif
/* Support for format strings with positions in *printf(), following the
POSIX/XSI specification.
Note: These replacements for the *printf() functions are visible only
in source files that #include <libintl.h> or #include "gettext.h".
Packages that use *printf() in source files that don't refer to _()
or gettext() but for which the format string could be the return value
of _() or gettext() need to add this #include. Oh well. */
#if !0
#include <stdio.h>
#include <stddef.h>
/* Get va_list. */
#if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#if !(defined fprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef fprintf
#define fprintf libintl_fprintf
extern int fprintf (FILE *, const char *, ...);
#endif
#if !(defined vfprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vfprintf
#define vfprintf libintl_vfprintf
extern int vfprintf (FILE *, const char *, va_list);
#endif
#if !(defined printf && defined _GL_STDIO_H) /* don't override gnulib */
#undef printf
#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
/* Don't break __attribute__((format(printf,M,N))).
This redefinition is only possible because the libc in NetBSD, Cygwin,
mingw does not have a function __printf__.
Alternatively, we could have done this redirection only when compiling with
__GNUC__, together with a symbol redirection:
extern int printf (const char *, ...)
__asm__ (#__USER_LABEL_PREFIX__ "libintl_printf");
But doing it now would introduce a binary incompatibility with already
distributed versions of libintl on these systems. */
# define libintl_printf __printf__
#endif
#define printf libintl_printf
extern int printf (const char *, ...);
#endif
#if !(defined vprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vprintf
#define vprintf libintl_vprintf
extern int vprintf (const char *, va_list);
#endif
#if !(defined sprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef sprintf
#define sprintf libintl_sprintf
extern int sprintf (char *, const char *, ...);
#endif
#if !(defined vsprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vsprintf
#define vsprintf libintl_vsprintf
extern int vsprintf (char *, const char *, va_list);
#endif
#if 1
#if !(defined snprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef snprintf
#define snprintf libintl_snprintf
extern int snprintf (char *, size_t, const char *, ...);
#endif
#if !(defined vsnprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vsnprintf
#define vsnprintf libintl_vsnprintf
extern int vsnprintf (char *, size_t, const char *, va_list);
#endif
#endif
#if 0
#if !(defined asprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef asprintf
#define asprintf libintl_asprintf
extern int asprintf (char **, const char *, ...);
#endif
#if !(defined vasprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vasprintf
#define vasprintf libintl_vasprintf
extern int vasprintf (char **, const char *, va_list);
#endif
#endif
#if 0
#undef fwprintf
#define fwprintf libintl_fwprintf
extern int fwprintf (FILE *, const wchar_t *, ...);
#undef vfwprintf
#define vfwprintf libintl_vfwprintf
extern int vfwprintf (FILE *, const wchar_t *, va_list);
#undef wprintf
#define wprintf libintl_wprintf
extern int wprintf (const wchar_t *, ...);
#undef vwprintf
#define vwprintf libintl_vwprintf
extern int vwprintf (const wchar_t *, va_list);
#undef swprintf
#define swprintf libintl_swprintf
extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
#undef vswprintf
#define vswprintf libintl_vswprintf
extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
#endif
#endif
/* Support for the locale chosen by the user. */
#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
#undef setlocale
#define setlocale libintl_setlocale
extern char *setlocale (int, const char *);
#if 0
#undef newlocale
#define newlocale libintl_newlocale
extern locale_t newlocale (int, const char *, locale_t);
#endif
#endif
/* Support for relocatable packages. */
/* Sets the original and the current installation prefix of the package.
Relocation simply replaces a pathname starting with the original prefix
by the corresponding pathname with the current prefix instead. Both
prefixes should be directory names without trailing slash (i.e. use ""
instead of "/"). */
#define libintl_set_relocation_prefix libintl_set_relocation_prefix
extern void
libintl_set_relocation_prefix (const char *orig_prefix,
const char *curr_prefix);
#ifdef __cplusplus
}
#endif
#endif /* libintl.h */
Binary file not shown.
-86
View File
@@ -1,86 +0,0 @@
#!/bin/sh
# Prints a package's identification PACKAGE VERSION or PACKAGE.
#
# Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
want_version="$1"
# NLS nuisances: Letter ranges are different in the Estonian locale.
LC_ALL=C
while true; do
if test -f configure; then
package=`(grep '^PACKAGE_NAME=' configure; grep '^ *PACKAGE=' configure) | grep -v '=[ ]*$' | sed -e '1q' | sed -e 's/^[^=]*=//' | sed -e "s/^'//" -e "s/'$//"`
case "$package" in
*[\"\$\`\{\}]*)
# Some packages (gcal) retrieve the package name dynamically.
package=
;;
esac
if test -n "$package"; then
is_gnu=`LC_ALL=C grep "GNU $package" * 2>/dev/null | grep -v '^libtool:'`
if test -n "$is_gnu"; then
package="GNU $package"
fi
if test -n "$want_version"; then
version=`(grep '^PACKAGE_VERSION=' configure; grep '^ *VERSION=' configure) | grep -v '=[ ]*$' | sed -e '1q' | sed -e 's/^[^=]*=//' | sed -e "s/^'//" -e "s/'$//"`
case "$version" in
*[\"\$\`\{\}]*)
# Some packages (gcal, gcc, clisp) retrieve the version dynamically.
version=
;;
esac
if test -n "$version"; then
echo "$package $version"
else
echo "$package"
fi
else
echo "$package"
fi
exit 0
fi
fi
dir=`basename \`pwd\``
case "$dir" in
i18n)
# This directory name, used in GNU make, is not the top level directory.
;;
*[A-Za-z]*[0-9]*)
package=`echo "$dir" | sed -e 's/^\([^0-9]*\)[0-9].*$/\1/' -e 's/[-_]$//'`
if test -n "$want_version"; then
version=`echo "$dir" | sed -e 's/^[^0-9]*\([0-9].*\)$/\1/'`
echo "$package $version"
else
echo "$package"
fi
exit 0
;;
esac
# Go to parent directory
last=`/bin/pwd`
cd ..
curr=`/bin/pwd`
if test "$last" = "$curr"; then
# Oops, didn't find the package name.
if test -n "$want_version"; then
echo "PACKAGE VERSION"
else
echo "PACKAGE"
fi
exit 0
fi
done
Binary file not shown.
-436
View File
@@ -1,436 +0,0 @@
#!/bin/sh
# Prints the user's email address, with confirmation from the user.
#
# Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Prerequisites for using ${exec_prefix}/lib and ${datarootdir}/locale.
prefix="/usr/local/i686-w64-mingw32/stow/gettext-0.18.1.1"
exec_prefix="${prefix}"
datarootdir="${prefix}/share"
datadir="${datarootdir}"
# Set variables libdir, localedir.
libdir="${exec_prefix}/lib"
localedir="${datarootdir}/locale"
# Support for relocatability.
if test "no" = yes; then
orig_installdir="$libdir"/gettext # see Makefile.am's install rule
# Determine curr_installdir without caring for symlinked callers.
curr_installdir=`echo "$0" | sed -e 's,/[^/]*$,,'`
curr_installdir=`cd "$curr_installdir" && pwd`
# Compute the original/current installation prefixes by stripping the
# trailing directories off the original/current installation directories.
while true; do
orig_last=`echo "$orig_installdir" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
curr_last=`echo "$curr_installdir" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
if test -z "$orig_last" || test -z "$curr_last"; then
break
fi
if test "$orig_last" != "$curr_last"; then
break
fi
orig_installdir=`echo "$orig_installdir" | sed -e 's,/[^/]*$,,'`
curr_installdir=`echo "$curr_installdir" | sed -e 's,/[^/]*$,,'`
done
# Now relocate the directory variables that we use.
libdir=`echo "$libdir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'`
localedir=`echo "$localedir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'`
fi
# Internationalization.
. gettext.sh
TEXTDOMAIN=gettext-tools
export TEXTDOMAIN
TEXTDOMAINDIR="$localedir"
export TEXTDOMAINDIR
# Redirect fileno 3 to interactive I/O.
exec 3>/dev/tty
# Output a prompt.
if test $# != 0; then
echo "$1" 1>&3
fi
# Find the user name on the local machine.
user=`id -u -n 2>/dev/null`
if test -z "$user"; then
user="$USER"
if test -z "$user"; then
user="$LOGNAME"
if test -z "$user"; then
user=unknown
fi
fi
fi
# Find the hostname.
# hostname on some systems (SVR3.2, old Linux) returns a bogus exit status,
# so uname gets run too, so we keep only the first line of output.
#host=`(hostname || uname -n) 2>/dev/null | sed 1q`
host=`"$libdir"/gettext/hostname --short 2>/dev/null | sed 1q`
# Find the hostname.
hostfqdn=`"$libdir"/gettext/hostname --fqdn 2>/dev/null | sed 1q`
# Find a list of email addresses from various mailer configuration files.
# All mailers use configuration files under $HOME. We handle them in a
# last-modified - first-priority order.
cd $HOME
files=""
# ----------------------- BEGIN MAILER SPECIFIC CODE -----------------------
# Mozilla Thunderbird addresses
files="$files .thunderbird/*/prefs.js"
# Mozilla addresses
files="$files .mozilla/*/prefs.js"
# Netscape 4 addresses
files="$files .netscape/liprefs.js .netscape/preferences.js"
# Netscape 3 addresses
files="$files .netscape/preferences"
# Emacs/XEmacs rmail, Emacs/XEmacs gnus, XEmacs vm addresses
# XEmacs mew addresses
files="$files .emacs .emacs.el"
# KDE2 addresses
files="$files .kde2/share/config/emaildefaults"
# KDE kmail addresses
files="$files .kde2/share/config/kmailrc"
# GNOME evolution 2 addresses
files="$files .gconf/apps/evolution/mail/%gconf.xml"
# GNOME evolution 1 addresses
files="$files evolution/config.xmldb"
# GNOME balsa addresses
files="$files .gnome/balsa"
# StarOffice and OpenOffice addresses
sed_dos2unix='s/\r$//'
sed_soffice51='s,StarOffice 5\.1=\(.*\)$,\1/sofficerc,p'
sed_soffice52='s,StarOffice 5\.2=\(.*\)$,\1/user/sofficerc,p'
sed_ooffice='s,^OpenOffice[^=]*=\(.*\)$,\1/user/config/registry/instance/org/openoffice/UserProfile.xml,p'
files="$files Office51/sofficerc Office52/user/sofficerc "`sed -n -e "$sed_dos2unix" -e "$sed_soffice51" -e "$sed_soffice52" -e "$sed_ooffice" .sversionrc 2>/dev/null | sed -e 's,^file://*,/,'`
# mutt addresses
files="$files .muttrc"
# pine addresses
files="$files .pinerc"
# xfmail addresses
files="$files .xfmail/.xfmailrc"
# tkrat addresses
files="$files .ratatosk/ratatoskrc"
# ----------------------- END MAILER SPECIFIC CODE -----------------------
# Expand wildcards and remove nonexistent files from the list.
nfiles=""
for file in $files; do
if test -r "$file" && test ! -d "$file"; then
nfiles="$nfiles $file"
fi
done
files="$nfiles"
addresses=""
if test -n "$files"; then
for file in `ls -t $files`; do
case "$file" in
# ----------------------- BEGIN MAILER SPECIFIC CODE -----------------------
# Mozilla and Mozilla Thunderbird addresses
.mozilla/*/prefs.js | .thunderbird/*/prefs.js)
addresses="$addresses "`grep -h '^user_pref("mail\.identity\..*\.useremail", ".*");$' $file 2>/dev/null | sed -e 's/^user_pref("mail\.identity\..*\.useremail", "\(.*\)");$/\1/'`
;;
# Netscape 4 addresses
.netscape/liprefs.js | .netscape/preferences.js)
addresses="$addresses "`grep -h '^user_pref("mail\.identity\.useremail", ".*");$' $file 2>/dev/null | sed -e 's/^user_pref("mail\.identity\.useremail", "\(.*\)");$/\1/'`
;;
# Netscape 3 addresses
.netscape/preferences)
addresses="$addresses "`grep -h '^EMAIL_ADDRESS:' $file 2>/dev/null | sed -e 's/^EMAIL_ADDRESS:[ ]*//'`
;;
.emacs | .emacs.el)
# Emacs/XEmacs rmail, Emacs/XEmacs gnus, XEmacs vm addresses
addresses="$addresses "`grep -h '[ (]user-mail-address "[^"]*"' $file 2>/dev/null | sed -e 's/^.*[ (]user-mail-address "\([^"]*\)".*$/\1/'`
# XEmacs mew addresses
domains=`grep -h '[ (]mew-mail-domain "[^"]*"' $file 2>/dev/null | sed -e 's/^.*[ (]mew-mail-domain "\([^"]*\)".*$/\1/'`
if test -n "$domains"; then
for domain in $domains; do
addresses="$addresses ${user}@$domain"
done
fi
;;
# KDE2 addresses
.kde2/share/config/emaildefaults)
addresses="$addresses "`grep -h '^EmailAddress=' $file 2>/dev/null | sed -e 's/^EmailAddress=//'`
;;
# KDE kmail addresses
.kde2/share/config/kmailrc)
addresses="$addresses "`grep -h '^Email Address=' $file 2>/dev/null | sed -e 's/^Email Address=//'`
;;
# GNOME evolution 2 addresses
.gconf/apps/evolution/mail/%gconf.xml)
sedexpr0='s,^.*&lt;addr-spec&gt;\(.*\)&lt;/addr-spec&gt;.*$,\1,p'
addresses="$addresses "`sed -n -e "$sedexpr0" < $file`
;;
# GNOME evolution 1 addresses
evolution/config.xmldb)
sedexpr0='s/^.*<entry name="identity_address_[0-9]*" type="string" value="\([^"]*\)".*$/\1/p'
sedexpr1='s/\(..\)/\\x\1/g'
sedexpr2='s,$,\\n,'
addresses="$addresses "`sed -n -e "$sedexpr0" < $file | while read hexstring; do printf \`echo "$hexstring" | sed -e "$sedexpr1" -e "$sedexpr2"\`; done`
;;
# GNOME balsa addresses
.gnome/balsa)
addresses="$addresses "`grep -h '^Address=' $file 2>/dev/null | sed -e 's/^Address=//'`
;;
# OpenOffice addresses
*/UserProfile.xml)
addresses="$addresses "`sed -n -e 's,^.*<mail cfg:type="string">\(.*\)</mail>.*$,\1,p' $file 2>/dev/null`
;;
# StarOffice addresses
# Not a typo. They really write "Adress" with a single d.
# German orthography...
*/sofficerc)
addresses="$addresses "`grep -h '^User-Adress=' $file 2>/dev/null | sed -e 's/#[^#]*$//' -e 's/^.*#//'`
;;
# mutt addresses
.muttrc)
mutt_addresses=`grep -h '^set from="[^"]*"[ ]*$' $file 2>/dev/null | sed -e 's/^set from="\([^"]*\)"[ ]*$/\1/'`
if test -n "$mutt_addresses"; then
addresses="$addresses $mutt_addresses"
else
# mutt uses $EMAIL as fallback.
if test -n "$EMAIL"; then
addresses="$addresses $EMAIL"
fi
fi
;;
# pine addresses
.pinerc)
domains=`grep -h '^user-domain=' $file 2>/dev/null | sed -e 's/^user-domain=//'`
if test -n "$domains"; then
for domain in $domains; do
addresses="$addresses ${user}@$domain"
done
else
# The use-only-domain-name option is only used if the user-domain option is not present.
domains=`grep -h '^use-only-domain-name=' $file 2>/dev/null | sed -e 's/^use-only-domain-name=//'`
if test "Yes" = "$domains"; then
addresses="$addresses ${user}@"`echo "$hostfqdn" | sed -e 's/^[^.]*\.//'`
fi
fi
;;
# xfmail addresses
.xfmail/.xfmailrc)
addresses="$addresses "`grep -h '^from=.*<.*>' $file 2>/dev/null | sed -e 's/^.*<\([^<>]*\)>.*$/\1/'`
;;
# tkrat addresses
.ratatosk/ratatoskrc)
domains=`grep -h '^set option(masquerade_as) ' $file 2>/dev/null | sed -e 's/^set option(masquerade_as) //'`
if test -n "$domains"; then
for domain in $domains; do
addresses="$addresses ${user}@$domain"
done
else
# The domain option is used only if the masquerade_as option is not present.
domains=`grep -h '^set option(domain) ' $file 2>/dev/null | sed -e 's/^set option(domain) //'`
if test -n "$domains"; then
for domain in $domains; do
addresses="$addresses ${user}@${host}.$domain"
done
fi
fi
;;
# ----------------------- END MAILER SPECIFIC CODE -----------------------
esac
done
fi
# Some Debian systems have a file /etc/mailname.
if test -r /etc/mailname; then
hostmailname=`cat /etc/mailname`
if test -n "$hostmailname"; then
addresses="$addresses ${user}@$hostmailname"
fi
fi
# SuSE Linux >= 8.0 systems have a file /etc/sysconfig/mail.
if test -r /etc/sysconfig/mail; then
hostmailname=`. /etc/sysconfig/mail && echo "$FROM_HEADER"`
if test -n "$hostmailname"; then
addresses="$addresses ${user}@$hostmailname"
fi
fi
# elm has no user-defined addresses.
# mailx has no user-defined addresses.
# mh has no user-defined addresses.
# They use the system default.
addresses="$addresses ${user}@$hostfqdn"
# Normalize addresses: remove addresses without @, lowercase the part after @,
# and remove duplicates.
lowercase_sed='{
h
s/^[^@]*@\(.*\)$/\1/
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
x
s/^\([^@]*\)@.*/\1@/
G
s/\
//
p
}'
naddresses=""
for addr in $addresses; do
case "$addr" in
"<"*">") addr=`echo "$addr" | sed -e 's/^<//' -e 's/>$//'` ;;
esac
case "$addr" in
*@*)
addr=`echo "$addr" | sed -n -e "$lowercase_sed"`
case " $naddresses " in
*" $addr "*) ;;
*) naddresses="$naddresses $addr" ;;
esac
;;
esac
done
addresses="$naddresses"
# Now it's time to ask the user.
case "$addresses" in
" "*" "*)
# At least two addresses.
lines=""
i=0
for addr in $addresses; do
i=`expr $i + 1`
lines="${lines}${i} ${addr}
"
done
while true; do
{ gettext "Which is your email address?"; echo; } 1>&3
echo "$lines" 1>&3
{ gettext "Please choose the number, or enter your email address."; echo; } 1>&3
read answer < /dev/tty
case "$answer" in
*@*) ;;
[0-9]*)
i=0
for addr in $addresses; do
i=`expr $i + 1`
if test "$i" = "$answer"; then
break 2
fi
done
;;
esac
case "$answer" in
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
esac
case "$answer" in
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
*@*.*) ;;
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
esac
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
break
done
;;
" "*)
# One address.
while true; do
{ gettext "Is the following your email address?"; echo; } 1>&3
echo " $addresses" 1>&3
{ gettext "Please confirm by pressing Return, or enter your email address."; echo; } 1>&3
read answer < /dev/tty
if test -z "$answer"; then
addr=`echo "$addresses" | sed -e 's/^ //'`
break
fi
case "$answer" in
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
esac
case "$answer" in
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
*@*.*) ;;
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
esac
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
break
done
;;
"")
# No address.
{ gettext "Couldn't find out about your email address."; echo; } 1>&3
while true; do
{ gettext "Please enter your email address."; echo; } 1>&3
read answer < /dev/tty
case "$answer" in
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
esac
case "$answer" in
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
*@*.*) ;;
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
esac
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
break
done
;;
*) echo "internal error" 1>&3 ; exit 1 ;;
esac
# Print to standard output.
echo "$addr"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-86
View File
@@ -1,86 +0,0 @@
#!/bin/sh
# Prints a package's identification PACKAGE VERSION or PACKAGE.
#
# Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
want_version="$1"
# NLS nuisances: Letter ranges are different in the Estonian locale.
LC_ALL=C
while true; do
if test -f configure; then
package=`(grep '^PACKAGE_NAME=' configure; grep '^ *PACKAGE=' configure) | grep -v '=[ ]*$' | sed -e '1q' | sed -e 's/^[^=]*=//' | sed -e "s/^'//" -e "s/'$//"`
case "$package" in
*[\"\$\`\{\}]*)
# Some packages (gcal) retrieve the package name dynamically.
package=
;;
esac
if test -n "$package"; then
is_gnu=`LC_ALL=C grep "GNU $package" * 2>/dev/null | grep -v '^libtool:'`
if test -n "$is_gnu"; then
package="GNU $package"
fi
if test -n "$want_version"; then
version=`(grep '^PACKAGE_VERSION=' configure; grep '^ *VERSION=' configure) | grep -v '=[ ]*$' | sed -e '1q' | sed -e 's/^[^=]*=//' | sed -e "s/^'//" -e "s/'$//"`
case "$version" in
*[\"\$\`\{\}]*)
# Some packages (gcal, gcc, clisp) retrieve the version dynamically.
version=
;;
esac
if test -n "$version"; then
echo "$package $version"
else
echo "$package"
fi
else
echo "$package"
fi
exit 0
fi
fi
dir=`basename \`pwd\``
case "$dir" in
i18n)
# This directory name, used in GNU make, is not the top level directory.
;;
*[A-Za-z]*[0-9]*)
package=`echo "$dir" | sed -e 's/^\([^0-9]*\)[0-9].*$/\1/' -e 's/[-_]$//'`
if test -n "$want_version"; then
version=`echo "$dir" | sed -e 's/^[^0-9]*\([0-9].*\)$/\1/'`
echo "$package $version"
else
echo "$package"
fi
exit 0
;;
esac
# Go to parent directory
last=`/bin/pwd`
cd ..
curr=`/bin/pwd`
if test "$last" = "$curr"; then
# Oops, didn't find the package name.
if test -n "$want_version"; then
echo "PACKAGE VERSION"
else
echo "PACKAGE"
fi
exit 0
fi
done
Binary file not shown.
-436
View File
@@ -1,436 +0,0 @@
#!/bin/sh
# Prints the user's email address, with confirmation from the user.
#
# Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Prerequisites for using ${exec_prefix}/lib and ${datarootdir}/locale.
prefix="/usr/local/x86_64-w64-mingw32/stow/gettext-0.18.1.1"
exec_prefix="${prefix}"
datarootdir="${prefix}/share"
datadir="${datarootdir}"
# Set variables libdir, localedir.
libdir="${exec_prefix}/lib"
localedir="${datarootdir}/locale"
# Support for relocatability.
if test "no" = yes; then
orig_installdir="$libdir"/gettext # see Makefile.am's install rule
# Determine curr_installdir without caring for symlinked callers.
curr_installdir=`echo "$0" | sed -e 's,/[^/]*$,,'`
curr_installdir=`cd "$curr_installdir" && pwd`
# Compute the original/current installation prefixes by stripping the
# trailing directories off the original/current installation directories.
while true; do
orig_last=`echo "$orig_installdir" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
curr_last=`echo "$curr_installdir" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
if test -z "$orig_last" || test -z "$curr_last"; then
break
fi
if test "$orig_last" != "$curr_last"; then
break
fi
orig_installdir=`echo "$orig_installdir" | sed -e 's,/[^/]*$,,'`
curr_installdir=`echo "$curr_installdir" | sed -e 's,/[^/]*$,,'`
done
# Now relocate the directory variables that we use.
libdir=`echo "$libdir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'`
localedir=`echo "$localedir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'`
fi
# Internationalization.
. gettext.sh
TEXTDOMAIN=gettext-tools
export TEXTDOMAIN
TEXTDOMAINDIR="$localedir"
export TEXTDOMAINDIR
# Redirect fileno 3 to interactive I/O.
exec 3>/dev/tty
# Output a prompt.
if test $# != 0; then
echo "$1" 1>&3
fi
# Find the user name on the local machine.
user=`id -u -n 2>/dev/null`
if test -z "$user"; then
user="$USER"
if test -z "$user"; then
user="$LOGNAME"
if test -z "$user"; then
user=unknown
fi
fi
fi
# Find the hostname.
# hostname on some systems (SVR3.2, old Linux) returns a bogus exit status,
# so uname gets run too, so we keep only the first line of output.
#host=`(hostname || uname -n) 2>/dev/null | sed 1q`
host=`"$libdir"/gettext/hostname --short 2>/dev/null | sed 1q`
# Find the hostname.
hostfqdn=`"$libdir"/gettext/hostname --fqdn 2>/dev/null | sed 1q`
# Find a list of email addresses from various mailer configuration files.
# All mailers use configuration files under $HOME. We handle them in a
# last-modified - first-priority order.
cd $HOME
files=""
# ----------------------- BEGIN MAILER SPECIFIC CODE -----------------------
# Mozilla Thunderbird addresses
files="$files .thunderbird/*/prefs.js"
# Mozilla addresses
files="$files .mozilla/*/prefs.js"
# Netscape 4 addresses
files="$files .netscape/liprefs.js .netscape/preferences.js"
# Netscape 3 addresses
files="$files .netscape/preferences"
# Emacs/XEmacs rmail, Emacs/XEmacs gnus, XEmacs vm addresses
# XEmacs mew addresses
files="$files .emacs .emacs.el"
# KDE2 addresses
files="$files .kde2/share/config/emaildefaults"
# KDE kmail addresses
files="$files .kde2/share/config/kmailrc"
# GNOME evolution 2 addresses
files="$files .gconf/apps/evolution/mail/%gconf.xml"
# GNOME evolution 1 addresses
files="$files evolution/config.xmldb"
# GNOME balsa addresses
files="$files .gnome/balsa"
# StarOffice and OpenOffice addresses
sed_dos2unix='s/\r$//'
sed_soffice51='s,StarOffice 5\.1=\(.*\)$,\1/sofficerc,p'
sed_soffice52='s,StarOffice 5\.2=\(.*\)$,\1/user/sofficerc,p'
sed_ooffice='s,^OpenOffice[^=]*=\(.*\)$,\1/user/config/registry/instance/org/openoffice/UserProfile.xml,p'
files="$files Office51/sofficerc Office52/user/sofficerc "`sed -n -e "$sed_dos2unix" -e "$sed_soffice51" -e "$sed_soffice52" -e "$sed_ooffice" .sversionrc 2>/dev/null | sed -e 's,^file://*,/,'`
# mutt addresses
files="$files .muttrc"
# pine addresses
files="$files .pinerc"
# xfmail addresses
files="$files .xfmail/.xfmailrc"
# tkrat addresses
files="$files .ratatosk/ratatoskrc"
# ----------------------- END MAILER SPECIFIC CODE -----------------------
# Expand wildcards and remove nonexistent files from the list.
nfiles=""
for file in $files; do
if test -r "$file" && test ! -d "$file"; then
nfiles="$nfiles $file"
fi
done
files="$nfiles"
addresses=""
if test -n "$files"; then
for file in `ls -t $files`; do
case "$file" in
# ----------------------- BEGIN MAILER SPECIFIC CODE -----------------------
# Mozilla and Mozilla Thunderbird addresses
.mozilla/*/prefs.js | .thunderbird/*/prefs.js)
addresses="$addresses "`grep -h '^user_pref("mail\.identity\..*\.useremail", ".*");$' $file 2>/dev/null | sed -e 's/^user_pref("mail\.identity\..*\.useremail", "\(.*\)");$/\1/'`
;;
# Netscape 4 addresses
.netscape/liprefs.js | .netscape/preferences.js)
addresses="$addresses "`grep -h '^user_pref("mail\.identity\.useremail", ".*");$' $file 2>/dev/null | sed -e 's/^user_pref("mail\.identity\.useremail", "\(.*\)");$/\1/'`
;;
# Netscape 3 addresses
.netscape/preferences)
addresses="$addresses "`grep -h '^EMAIL_ADDRESS:' $file 2>/dev/null | sed -e 's/^EMAIL_ADDRESS:[ ]*//'`
;;
.emacs | .emacs.el)
# Emacs/XEmacs rmail, Emacs/XEmacs gnus, XEmacs vm addresses
addresses="$addresses "`grep -h '[ (]user-mail-address "[^"]*"' $file 2>/dev/null | sed -e 's/^.*[ (]user-mail-address "\([^"]*\)".*$/\1/'`
# XEmacs mew addresses
domains=`grep -h '[ (]mew-mail-domain "[^"]*"' $file 2>/dev/null | sed -e 's/^.*[ (]mew-mail-domain "\([^"]*\)".*$/\1/'`
if test -n "$domains"; then
for domain in $domains; do
addresses="$addresses ${user}@$domain"
done
fi
;;
# KDE2 addresses
.kde2/share/config/emaildefaults)
addresses="$addresses "`grep -h '^EmailAddress=' $file 2>/dev/null | sed -e 's/^EmailAddress=//'`
;;
# KDE kmail addresses
.kde2/share/config/kmailrc)
addresses="$addresses "`grep -h '^Email Address=' $file 2>/dev/null | sed -e 's/^Email Address=//'`
;;
# GNOME evolution 2 addresses
.gconf/apps/evolution/mail/%gconf.xml)
sedexpr0='s,^.*&lt;addr-spec&gt;\(.*\)&lt;/addr-spec&gt;.*$,\1,p'
addresses="$addresses "`sed -n -e "$sedexpr0" < $file`
;;
# GNOME evolution 1 addresses
evolution/config.xmldb)
sedexpr0='s/^.*<entry name="identity_address_[0-9]*" type="string" value="\([^"]*\)".*$/\1/p'
sedexpr1='s/\(..\)/\\x\1/g'
sedexpr2='s,$,\\n,'
addresses="$addresses "`sed -n -e "$sedexpr0" < $file | while read hexstring; do printf \`echo "$hexstring" | sed -e "$sedexpr1" -e "$sedexpr2"\`; done`
;;
# GNOME balsa addresses
.gnome/balsa)
addresses="$addresses "`grep -h '^Address=' $file 2>/dev/null | sed -e 's/^Address=//'`
;;
# OpenOffice addresses
*/UserProfile.xml)
addresses="$addresses "`sed -n -e 's,^.*<mail cfg:type="string">\(.*\)</mail>.*$,\1,p' $file 2>/dev/null`
;;
# StarOffice addresses
# Not a typo. They really write "Adress" with a single d.
# German orthography...
*/sofficerc)
addresses="$addresses "`grep -h '^User-Adress=' $file 2>/dev/null | sed -e 's/#[^#]*$//' -e 's/^.*#//'`
;;
# mutt addresses
.muttrc)
mutt_addresses=`grep -h '^set from="[^"]*"[ ]*$' $file 2>/dev/null | sed -e 's/^set from="\([^"]*\)"[ ]*$/\1/'`
if test -n "$mutt_addresses"; then
addresses="$addresses $mutt_addresses"
else
# mutt uses $EMAIL as fallback.
if test -n "$EMAIL"; then
addresses="$addresses $EMAIL"
fi
fi
;;
# pine addresses
.pinerc)
domains=`grep -h '^user-domain=' $file 2>/dev/null | sed -e 's/^user-domain=//'`
if test -n "$domains"; then
for domain in $domains; do
addresses="$addresses ${user}@$domain"
done
else
# The use-only-domain-name option is only used if the user-domain option is not present.
domains=`grep -h '^use-only-domain-name=' $file 2>/dev/null | sed -e 's/^use-only-domain-name=//'`
if test "Yes" = "$domains"; then
addresses="$addresses ${user}@"`echo "$hostfqdn" | sed -e 's/^[^.]*\.//'`
fi
fi
;;
# xfmail addresses
.xfmail/.xfmailrc)
addresses="$addresses "`grep -h '^from=.*<.*>' $file 2>/dev/null | sed -e 's/^.*<\([^<>]*\)>.*$/\1/'`
;;
# tkrat addresses
.ratatosk/ratatoskrc)
domains=`grep -h '^set option(masquerade_as) ' $file 2>/dev/null | sed -e 's/^set option(masquerade_as) //'`
if test -n "$domains"; then
for domain in $domains; do
addresses="$addresses ${user}@$domain"
done
else
# The domain option is used only if the masquerade_as option is not present.
domains=`grep -h '^set option(domain) ' $file 2>/dev/null | sed -e 's/^set option(domain) //'`
if test -n "$domains"; then
for domain in $domains; do
addresses="$addresses ${user}@${host}.$domain"
done
fi
fi
;;
# ----------------------- END MAILER SPECIFIC CODE -----------------------
esac
done
fi
# Some Debian systems have a file /etc/mailname.
if test -r /etc/mailname; then
hostmailname=`cat /etc/mailname`
if test -n "$hostmailname"; then
addresses="$addresses ${user}@$hostmailname"
fi
fi
# SuSE Linux >= 8.0 systems have a file /etc/sysconfig/mail.
if test -r /etc/sysconfig/mail; then
hostmailname=`. /etc/sysconfig/mail && echo "$FROM_HEADER"`
if test -n "$hostmailname"; then
addresses="$addresses ${user}@$hostmailname"
fi
fi
# elm has no user-defined addresses.
# mailx has no user-defined addresses.
# mh has no user-defined addresses.
# They use the system default.
addresses="$addresses ${user}@$hostfqdn"
# Normalize addresses: remove addresses without @, lowercase the part after @,
# and remove duplicates.
lowercase_sed='{
h
s/^[^@]*@\(.*\)$/\1/
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
x
s/^\([^@]*\)@.*/\1@/
G
s/\
//
p
}'
naddresses=""
for addr in $addresses; do
case "$addr" in
"<"*">") addr=`echo "$addr" | sed -e 's/^<//' -e 's/>$//'` ;;
esac
case "$addr" in
*@*)
addr=`echo "$addr" | sed -n -e "$lowercase_sed"`
case " $naddresses " in
*" $addr "*) ;;
*) naddresses="$naddresses $addr" ;;
esac
;;
esac
done
addresses="$naddresses"
# Now it's time to ask the user.
case "$addresses" in
" "*" "*)
# At least two addresses.
lines=""
i=0
for addr in $addresses; do
i=`expr $i + 1`
lines="${lines}${i} ${addr}
"
done
while true; do
{ gettext "Which is your email address?"; echo; } 1>&3
echo "$lines" 1>&3
{ gettext "Please choose the number, or enter your email address."; echo; } 1>&3
read answer < /dev/tty
case "$answer" in
*@*) ;;
[0-9]*)
i=0
for addr in $addresses; do
i=`expr $i + 1`
if test "$i" = "$answer"; then
break 2
fi
done
;;
esac
case "$answer" in
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
esac
case "$answer" in
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
*@*.*) ;;
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
esac
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
break
done
;;
" "*)
# One address.
while true; do
{ gettext "Is the following your email address?"; echo; } 1>&3
echo " $addresses" 1>&3
{ gettext "Please confirm by pressing Return, or enter your email address."; echo; } 1>&3
read answer < /dev/tty
if test -z "$answer"; then
addr=`echo "$addresses" | sed -e 's/^ //'`
break
fi
case "$answer" in
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
esac
case "$answer" in
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
*@*.*) ;;
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
esac
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
break
done
;;
"")
# No address.
{ gettext "Couldn't find out about your email address."; echo; } 1>&3
while true; do
{ gettext "Please enter your email address."; echo; } 1>&3
read answer < /dev/tty
case "$answer" in
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
esac
case "$answer" in
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
*@*.*) ;;
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
esac
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
break
done
;;
*) echo "internal error" 1>&3 ; exit 1 ;;
esac
# Print to standard output.
echo "$addr"
Binary file not shown.
Binary file not shown.
Binary file not shown.
+37 -9
View File
@@ -49,7 +49,7 @@
# Already enabled by default for 32-bit
# Windows.
# NOCURL=1 - Disable libcurl--HTTP capability.
# NOGME=1 - Disable game music emu, retro VGM support.
# NOLIBGME=1 - Disable game music emu, retro VGM support.
# NOOPENMPT=1 - Disable module (tracker) music support.
# NOMIXER=1 - Disable SDL Mixer (audio playback).
# NOTHREADS=1 - Disable multithreading.
@@ -131,9 +131,19 @@ endif
include Makefile.d/util.mk
ifdef PREFIX
ifdef USECLANG
CC:=$(PREFIX)-clang
CXX:=$(PREFIX)-clang++
else
CC:=$(PREFIX)-gcc
CXX:=$(PREFIX)-g++
endif
endif
ifdef USECLANG
CC=clang
CXX=clang++
endif
OBJDUMP_OPTS?=--wide --source --line-numbers
@@ -236,7 +246,7 @@ endif
# build with profiling information
ifdef PROFILEMODE
opts+=-pg
libs+=-pg
LDFLAGS+=-pg
endif
ifdef DEBUGMODE
@@ -246,26 +256,44 @@ debug_opts=-DNDEBUG
opts+=-O3
ifdef USELTO
# compile with LTO
ifdef MINGW
opts+=-flto=auto -g
LDFLAGS+=-flto=auto -g
else
opts+=-flto=auto
libs+=-flto=auto
LDFLAGS+=-flto=auto
endif
endif
endif
ifdef USEASAN
# compile with asan
ifdef MINGW
opts+=-fsanitize=address -g
libs+=-fsanitize=address -g
else
opts+=-fsanitize=address
libs+=-fsanitize=address
endif
endif
ifeq ($(CC),clang)
LDFLAGS+= -fuse-ld=lld
endif
# debug_opts also get passed to windres
opts+=$(debug_opts)
opts+=$(foreach v,$(passthru_opts),$(if $($(v)),-D$(v)))
opts+=$(WFLAGS) $(CPPFLAGS) $(CFLAGS)
cxxopts:=$(opts) $(CXXFLAGS) -std=c++17
CXXFLAGS+=-std=c++17 # force c17 for c++ since most vpss run older ubuntu versions with old compilers
opts+=$(WFLAGS) $(CFLAGS)
cxxopts:=$(opts) $(CXXFLAGS)
opts+=$(CWFLAGS) # warning flags that shouldnt be passed to c++ compiler
libs+=$(LDFLAGS) -lstdc++ -lpthread
asflags:=$(ASFLAGS) -x assembler-with-cpp
cc=$(CC)
@@ -375,12 +403,12 @@ ifdef Echo_name
@printf '%-20.20s\r' $$<
endif
endif
$(.)$(cc) -MM -MF $$@ -MT $(objdir)/$$*.o $(2) $$<
$(.)$(2) -MM -MF $$@ -MT $(objdir)/$$*.o $(3) $$<
endef
$(eval $(call _recipe,c))
$(eval $(call _recipe,cpp))
$(eval $(call _recipe,s,$(asflags)))
$(eval $(call _recipe,c,$(cc)))
$(eval $(call _recipe,cpp,$(cxx)))
$(eval $(call _recipe,s,$(cc),$(asflags)))
# compiling recipe template
# 1: target file suffix
-589
View File
@@ -1,589 +0,0 @@
# vim: ft=make
#
# Makefile.cfg for SRB2
#
#
# GNU compiler & tools' flags
# and other things
#
# See the following variable don't start with 'GCC'. This is
# to avoid a false positive with the version detection...
SUPPORTED_GCC_VERSIONS:=\
151 150 15\
142 141 140 14\
132 131 130 13\
123 122 121 120 12\
114 113 112 111 110 11\
105 104 103 102 101 100 10\
95 94 93 92 91 90\
85 84 83 82 81 80\
75 74 73 72 71 70\
64 63 62 61 60\
55 54 53 52 51 50\
49 48 47 46 45 44 43 42 41 40
LATEST_GCC_VERSION=14.2.1
# gcc or g++
ifdef PREFIX
CC:=$(PREFIX)-gcc
CXX:=$(PREFIX)-g++
OBJCOPY?=$(PREFIX)-objcopy
OBJDUMP?=$(PREFIX)-objdump
STRIP?=$(PREFIX)-strip
WINDRES?=$(PREFIX)-windres
else
OBJCOPY?=objcopy
OBJDUMP?=objdump
STRIP?=strip
WINDRES?=windres
endif
# because Apple screws with us on this
# need to get bintools from homebrew
ifdef MACOSX
CC=clang
CXX=clang
OBJCOPY=gobjcopy
OBJDUMP=gobjdump
endif
# Automatically set version flag, but not if one was manually set
ifeq (,$(filter GCC%,$(.VARIABLES)))
version:=$(shell $(CC) --version)
# check if this is in fact GCC
ifneq (,$(or $(findstring gcc,$(version)),$(findstring GCC,$(version))))
shellversion:=$(shell $(CC) -dumpversion)
# Try to remove "-win32"
version:=$(subst -win32,.0,$(shellversion))
# Turn version into words of major, minor
v:=$(subst ., ,$(version))
# concat. major minor
v:=$(word 1,$(v))$(word 2,$(v))
# If this version is not in the list, default to the latest supported
ifeq (,$(filter $(v),$(SUPPORTED_GCC_VERSIONS)))
$(info\
Your compiler version, GCC $(version), is not supported by the Makefile.\
The Makefile will assume GCC $(LATEST_GCC_VERSION).)
GCC$(subst .,,$(LATEST_GCC_VERSION))=1
else
$(info Detected GCC $(version) (GCC$(v)))
GCC$(v)=1
endif
endif
endif
ifdef GCC151
GCC150=1
endif
ifdef GCC15
GCC150=1
endif
ifdef GCC150
GCC142=1
endif
ifdef GCC142
GCC141=1
endif
ifdef GCC141
GCC140=1
endif
ifdef GCC14
GCC140=1
endif
ifdef GCC140
GCC132=1
endif
ifdef GCC132
GCC131=1
endif
ifdef GCC131
GCC130=1
endif
ifdef GCC13
GCC130=1
endif
ifdef GCC130
GCC123=1
endif
ifdef GCC123
GCC122=1
endif
ifdef GCC122
GCC121=1
endif
ifdef GCC121
GCC120=1
endif
ifdef GCC12
GCC120=1
endif
ifdef GCC120
GCC114=1
endif
ifdef GCC114
GCC113=1
endif
ifdef GCC113
GCC112=1
endif
ifdef GCC112
GCC111=1
endif
ifdef GCC111
GCC110=1
endif
ifdef GCC11
GCC110=1
endif
ifdef GCC110
GCC105=1
endif
ifdef GCC105
GCC104=1
endif
ifdef GCC104
GCC103=1
endif
ifdef GCC103
GCC102=1
endif
ifdef GCC102
GCC101=1
endif
ifdef GCC101
GCC100=1
endif
ifdef GCC10
GCC100=1
endif
ifdef GCC100
GCC93=1
endif
ifdef GCC95
GCC94=1
endif
ifdef GCC94
GCC93=1
endif
ifdef GCC93
GCC92=1
endif
ifdef GCC92
GCC91=1
endif
ifdef GCC91
GCC90=1
endif
ifdef GCC90
GCC85=1
endif
ifdef GCC85
GCC84=1
endif
ifdef GCC84
GCC83=1
endif
ifdef GCC83
GCC82=1
endif
ifdef GCC82
GCC81=1
endif
ifdef GCC81
GCC80=1
endif
ifdef GCC80
GCC75=1
endif
ifdef GCC75
GCC74=1
endif
ifdef GCC74
GCC73=1
endif
ifdef GCC73
GCC72=1
endif
ifdef GCC72
GCC71=1
endif
ifdef GCC71
GCC70=1
endif
ifdef GCC70
GCC64=1
endif
ifdef GCC64
GCC63=1
endif
ifdef GCC63
GCC62=1
endif
ifdef GCC62
GCC61=1
endif
ifdef GCC61
GCC60=1
endif
ifdef GCC60
GCC55=1
endif
ifdef GCC55
GCC54=1
endif
ifdef GCC54
GCC53=1
endif
ifdef GCC53
GCC52=1
endif
ifdef GCC52
GCC51=1
endif
ifdef GCC51
GCC50=1
endif
ifdef GCC50
GCC49=1
endif
ifdef GCC49
GCC48=1
endif
ifdef GCC48
GCC47=1
endif
ifdef GCC47
GCC46=1
endif
ifdef GCC46
GCC45=1
endif
ifdef GCC45
GCC44=1
endif
ifdef GCC44
GCC43=1
endif
ifdef GCC43
GCC42=1
endif
ifdef GCC42
GCC41=1
endif
ifdef GCC41
GCC40=1
VCHELP=1
endif
ifdef GCC295
GCC29=1
endif
OLDWFLAGS:=$(WFLAGS)
# -W -Wno-unused
WFLAGS=-Wall
ifndef GCC295
#WFLAGS+=-Wno-packed
endif
ifndef RELAXWARNINGS
WFLAGS+=-W
#WFLAGS+=-Wno-sign-compare
ifndef GCC295
WFLAGS+=-Wno-div-by-zero
endif
#WFLAGS+=-Wsystem-headers
WFLAGS+=-Wfloat-equal
#WFLAGS+=-Wtraditional
ifdef VCHELP
#WFLAGS+=-Wdeclaration-after-statement
WFLAGS+=-Wno-error=declaration-after-statement
endif
WFLAGS+=-Wundef
ifndef GCC295
WFLAGS+=-Wendif-labels
endif
ifdef GCC41
WFLAGS+=-Wshadow
endif
#WFLAGS+=-Wlarger-than-%len%
WFLAGS+=-Wpointer-arith -Wbad-function-cast
ifdef GCC45
#WFLAGS+=-Wc++-compat
endif
WFLAGS+=-Wcast-qual
ifndef NOCASTALIGNWARN
WFLAGS+=-Wcast-align
endif
WFLAGS+=-Wwrite-strings
ifndef ERRORMODE
#WFLAGS+=-Wconversion
ifdef GCC43
#WFLAGS+=-Wno-sign-conversion
endif
endif
WFLAGS+=-Wsign-compare
ifdef GCC45
WFLAGS+=-Wlogical-op
endif
WFLAGS+=-Waggregate-return
ifdef HAIKU
ifdef GCC41
#WFLAGS+=-Wno-attributes
endif
endif
#WFLAGS+=-Wstrict-prototypes
ifdef GCC40
WFLAGS+=-Wold-style-definition
endif
WFLAGS+=-Wmissing-prototypes -Wmissing-declarations
ifdef GCC40
WFLAGS+=-Wmissing-field-initializers
endif
WFLAGS+=-Wmissing-noreturn
#WFLAGS+=-Wmissing-format-attribute
#WFLAGS+=-Wno-multichar
#WFLAGS+=-Wno-deprecated-declarations
#WFLAGS+=-Wpacked
#WFLAGS+=-Wpadded
#WFLAGS+=-Wredundant-decls
WFLAGS+=-Wnested-externs
#WFLAGS+=-Wunreachable-code
WFLAGS+=-Winline
ifdef GCC43
WFLAGS+=-funit-at-a-time
WFLAGS+=-Wlogical-op
endif
ifndef GCC295
WFLAGS+=-Wdisabled-optimization
endif
endif
WFLAGS+=-Wformat-y2k
ifdef GCC71
WFLAGS+=-Wno-error=format-overflow=2
endif
WFLAGS+=-Wformat-security
ifndef GCC29
#WFLAGS+=-Winit-self
endif
ifdef GCC46
WFLAGS+=-Wno-suggest-attribute=noreturn
endif
ifdef NOLDWARNING
LDFLAGS+=-Wl,--as-needed
endif
ifdef ERRORMODE
WFLAGS+=-Werror
endif
WFLAGS+=$(OLDWFLAGS)
ifdef GCC43
#WFLAGS+=-Wno-error=clobbered
endif
ifdef GCC44
WFLAGS+=-Wno-error=array-bounds
endif
ifdef GCC46
WFLAGS+=-Wno-error=suggest-attribute=noreturn
endif
ifdef GCC54
WFLAGS+=-Wno-logical-op -Wno-error=logical-op
endif
ifdef GCC61
WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare
endif
ifdef GCC71
WFLAGS+=-Wno-error=implicit-fallthrough
WFLAGS+=-Wno-implicit-fallthrough
WFLAGS+=-Wno-format-truncation
endif
ifdef GCC81
WFLAGS+=-Wno-error=format-overflow
WFLAGS+=-Wno-error=stringop-truncation
WFLAGS+=-Wno-error=stringop-overflow
WFLAGS+=-Wno-format-overflow
WFLAGS+=-Wno-stringop-truncation
WFLAGS+=-Wno-stringop-overflow
WFLAGS+=-Wno-error=multistatement-macros
endif
#indicate platform and what interface use with
ifndef LINUX
ifndef FREEBSD
ifndef CYGWIN32
ifndef MINGW
ifndef MINGW64
ifndef SDL
$(error No interface or platform flag defined)
endif
endif
endif
endif
endif
endif
#determine the interface directory (where you put all i_*.c)
i_net_o=$(OBJDIR)/i_net.o
i_system_o=$(OBJDIR)/i_system.o
i_sound_o=$(OBJDIR)/i_sound.o
i_main_o=$(OBJDIR)/i_main.o
#set OBJDIR and BIN's starting place
OBJDIR=../objs
BIN=../bin
REMOVE?=rm -f
CP?=cp
MKDIR?=mkdir -p
MKISOFS?=mkisofs
DD?=dd
GZIP?=gzip
GZIP_OPTS?=-9 -f -n
GZIP_OPT2=$(GZIP_OPTS) --rsyncable
UPX?=upx
UPX_OPTS?=--best --preserve-build-id
ifndef ECHO
UPX_OPTS+=-q
endif
#Interface Setup
ifdef LINUX
SDL=1
ifdef LINUX64
OBJDIR:=$(OBJDIR)/Linux64
BIN:=$(BIN)/Linux64
else
OBJDIR:=$(OBJDIR)/Linux
BIN:=$(BIN)/Linux
endif
else
ifdef FREEBSD
INTERFACE=sdl
SDL=1
OBJDIR:=$(OBJDIR)/FreeBSD
BIN:=$(BIN)/FreeBSD
else
ifdef SOLARIS
INTERFACE=sdl
SDL=1
OBJDIR:=$(OBJDIR)/Solaris
BIN:=$(BIN)/Solaris
else
ifdef CYGWIN32
INTERFACE=sdl
SDL=1
OBJDIR:=$(OBJDIR)/cygwin
BIN:=$(BIN)/Cygwin
else
ifdef MINGW64
INTERFACE=win32
OBJDIR:=$(OBJDIR)/Mingw64
BIN:=$(BIN)/Mingw64
else
ifdef MINGW
INTERFACE=win32
OBJDIR:=$(OBJDIR)/Mingw
BIN:=$(BIN)/Mingw
endif
endif
endif
endif
endif
endif
ifdef ARCHNAME
OBJDIR:=$(OBJDIR)/$(ARCHNAME)
BIN:=$(BIN)/$(ARCHNAME)
endif
OBJDUMP_OPTS?=--wide --source --line-numbers
LD=$(CC)
ifdef SDL
INTERFACE=sdl
OBJDIR:=$(OBJDIR)/SDL
endif
ifdef DEBUGMODE
OBJDIR:=$(OBJDIR)/Debug
BIN:=$(BIN)/Debug
else
OBJDIR:=$(OBJDIR)/Release
BIN:=$(BIN)/Release
endif
+1 -1
View File
@@ -14,6 +14,6 @@ sources+=dedicated/i_threads.c
endif
NOOPENMPT=1
NOGME=1
NOLIBGME=1
NOHW=1
NOUPNP=1
+2 -10
View File
@@ -6,8 +6,7 @@ passthru_opts+=\
NOHW NOMD5 NOPOSTPROCESSING\
MOBJCONSISTANCY PACKETDROP ZDEBUG\
HAVE_MINIUPNPC\
HAVE_DISCORDRPC DEVELOP\
NOBLUAJIT
HAVE_DISCORDRPC DEVELOP
# build with debugging information
ifdef DEBUGMODE
@@ -74,13 +73,6 @@ libs+=-lbacktrace
opts+=-DHAVE_LIBBACKTRACE
endif
#windoze hack
ifdef MINGW
ifndef NODISCORDRPC
HAVE_DISCORDRPC=1
endif
endif
ifdef HAVE_DISCORDRPC
$(eval $(call Propogate_flags,DISCORDRPC))
libs+=-ldiscord-rpc
@@ -98,7 +90,7 @@ opts+=-DHAVE_VALGRIND
endif
default_packages:=\
GME/libgme/LIBGME\
LIBGME/libgme/LIBGME\
OPENMPT/libopenmpt/LIBOPENMPT\
ZLIB/zlib\
+10 -8
View File
@@ -20,10 +20,6 @@ $(foreach v,$(join $(wordlist 2,$(_n),- $(gcc_versions)),\
CXXFLAGS+= -Wno-aggregate-return
# -W -Wno-unused
ifdef GCC150
opts+=-std=gnu17
endif
WFLAGS:=-Wall -Wno-trigraphs
ifndef GCC295
#WFLAGS+=-Wno-packed
@@ -45,7 +41,8 @@ ifdef GCC41
WFLAGS+=-Wshadow
endif
#WFLAGS+=-Wlarger-than-%len%
WFLAGS+=-Wpointer-arith -Wbad-function-cast
WFLAGS+=-Wpointer-arith
CWFLAGS+=-Wbad-function-cast
ifdef GCC45
#WFLAGS+=-Wc++-compat
endif
@@ -75,9 +72,10 @@ endif
endif
#WFLAGS+=-Wstrict-prototypes
ifdef GCC40
WFLAGS+=-Wold-style-definition
CWFLAGS+=-Wold-style-definition
endif
WFLAGS+=-Wmissing-prototypes -Wmissing-declarations
WFLAGS+=-Wmissing-declarations
CWFLAGS+=-Wmissing-prototypes
ifdef GCC40
WFLAGS+=-Wmissing-field-initializers
endif
@@ -88,7 +86,7 @@ endif
#WFLAGS+=-Wpacked
#WFLAGS+=-Wpadded
#WFLAGS+=-Wredundant-decls
WFLAGS+=-Wnested-externs
CWFLAGS+=-Wnested-externs
#WFLAGS+=-Wunreachable-code
WFLAGS+=-Winline
ifdef DEBUGMODE
@@ -146,6 +144,10 @@ ifdef GCC81
WFLAGS+=-Wno-error=multistatement-macros
endif
ifeq ($(CC),clang)
WFLAGS+= -Wno-unknown-pragmas -Wno-cast-align
endif
ifdef NONX86
ifdef X86_64 # yeah that SEEMS contradictory
opts+=-march=nocona
+6 -1
View File
@@ -15,6 +15,7 @@ endif
sources+=win32/Srb2win.rc
opts+=-DSTDC_HEADERS
libs+=-Wl,-Bstatic -lstdc++ -lpthread -lgcc -Wl,-Bdynamic
libs+=-ladvapi32 -lkernel32 -lmsvcrt -luser32
ifndef DEDICATED
@@ -42,6 +43,10 @@ libs+=-Wl,--large-address-aware
NOLIBBACKTRACE=1
endif
ifndef NODISCORDRPC
HAVE_DISCORDRPC=1
endif
ifndef MINGW64
32=32
x86=x86
@@ -66,7 +71,7 @@ $(eval $(call _set,LIBGME))
lib:=../libs/libopenmpt
LIBOPENMPT_opts:=-I$(lib)/inc
LIBOPENMPT_libs:=-L$(lib)/lib/$(x86)/mingw -lopenmpt
LIBOPENMPT_libs:=-L$(lib)/lib/$(x86) -lopenmpt
$(eval $(call _set,LIBOPENMPT))
lib:=../libs/SDL2_mixer/$(mingw)
+3
View File
@@ -13,6 +13,7 @@ f_finale.c
f_wipe.c
filesrch.c
g_game.c
g_demo.c
g_input.c
hu_stuff.c
i_tcp.c
@@ -28,6 +29,7 @@ m_cond.c
m_fixed.c
m_menu.c
m_textinput.c
m_emotes.cpp
m_misc.c
m_perfstats.c
m_queue.c
@@ -78,6 +80,7 @@ p_tick.c
p_user.c
k_director.c
k_kart.c
k_hud.c
k_stats.c
lua_baselib.c
lua_blockmaplib.c
+1
View File
@@ -324,6 +324,7 @@ static void AM_initVariables(void)
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
}
AM_changeWindowLoc();
// for saving & restoring
+5 -5
View File
@@ -133,26 +133,26 @@ LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) {
LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) {
if (!lua_checkstack(L, space))
if (l_unlikely(!lua_checkstack(L, space)))
luaL_error(L, "stack overflow (%s)", mes);
}
LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) {
if (lua_type(L, narg) != t)
if (l_unlikely(lua_type(L, narg) != t))
tag_error(L, narg, t);
}
LUALIB_API void luaL_checkany (lua_State *L, int narg) {
if (lua_type(L, narg) == LUA_TNONE)
if (l_unlikely(lua_type(L, narg) == LUA_TNONE))
luaL_argerror(L, narg, "value expected");
}
LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) {
const char *s = lua_tolstring(L, narg, len);
if (!s) tag_error(L, narg, LUA_TSTRING);
if (l_unlikely(!s)) tag_error(L, narg, LUA_TSTRING);
return s;
}
@@ -170,7 +170,7 @@ LUALIB_API const char *luaL_optlstring (lua_State *L, int narg,
LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) {
lua_Number d = lua_tonumber(L, narg);
if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */
if (l_unlikely(d == 0 && !lua_isnumber(L, narg))) /* avoid extra test when d is not 0 */
tag_error(L, narg, LUA_TNUMBER);
return d;
}
+22 -2
View File
@@ -36,6 +36,26 @@ LUALIB_API void (luaL_setn) (lua_State *L, int t, int n);
/* extra error code for `luaL_load' */
#define LUA_ERRFILE (LUA_ERRERR+1)
/* Compiler-specific attributes and other macros */
#ifdef __GNUC__ // __attribute__ ((X))
#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && defined (__MINGW32__) // MinGW, >= GCC 4.1
#if 0 //defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO > 0
#define FUNCREPORT __attribute__ ((format(gnu_printf, 2, 3)))
#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) // >= GCC 4.4
#define FUNCREPORT __attribute__ ((format(ms_printf, 2, 3)))
#else
#define FUNCREPORT __attribute__ ((format(printf, 2, 3)))
#endif
#else
#define FUNCREPORT __attribute__ ((format(printf, 2, 3)))
#endif
#endif
#ifndef FUNCREPORT
#define FUNCREPORT
#endif
typedef struct luaL_Reg {
const char *name;
@@ -70,7 +90,7 @@ LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname);
LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
LUALIB_API void (luaL_where) (lua_State *L, int lvl);
LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
LUALIB_API FUNCREPORT int (luaL_error) (lua_State *L, const char *fmt, ...);
LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
const char *const lst[]);
@@ -102,7 +122,7 @@ LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,
*/
#define luaL_argcheck(L, cond,numarg,extramsg) \
((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))
((void)(l_likely(cond) || luaL_argerror(L, (numarg), (extramsg))))
#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
+9 -9
View File
@@ -106,7 +106,7 @@ static int luaB_setmetatable (lua_State *L) {
luaL_checktype(L, 1, LUA_TTABLE);
luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
"nil or table expected");
if (luaL_getmetafield(L, 1, "__metatable"))
if (l_unlikely(luaL_getmetafield(L, 1, "__metatable")))
luaL_error(L, "cannot change a protected metatable");
lua_settop(L, 2);
lua_setmetatable(L, 1);
@@ -120,10 +120,10 @@ static void getfunc (lua_State *L, int opt) {
lua_Debug ar;
int level = opt ? luaL_optint(L, 1, 1) : luaL_checkint(L, 1);
luaL_argcheck(L, level >= 0, 1, "level must be non-negative");
if (lua_getstack(L, level, &ar) == 0)
if (l_unlikely(lua_getstack(L, level, &ar) == 0))
luaL_argerror(L, 1, "invalid level");
lua_getinfo(L, "f", &ar);
if (lua_isnil(L, -1))
if (l_unlikely(lua_isnil(L, -1)))
luaL_error(L, "no function environment for tail call at level %d",
level);
}
@@ -151,7 +151,7 @@ static int luaB_setfenv (lua_State *L) {
lua_setfenv(L, -2);
return 0;
}
else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0)
else if (l_unlikely(lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0))
luaL_error(L,
LUA_QL("setfenv") " cannot change environment of given object");
return 1;
@@ -265,7 +265,7 @@ static int luaB_ipairs (lua_State *L) {
static int luaB_assert (lua_State *L) {
luaL_checkany(L, 1);
if (!lua_toboolean(L, 1))
if (l_unlikely(!lua_toboolean(L, 1)))
return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!"));
return lua_gettop(L);
}
@@ -278,7 +278,7 @@ static int luaB_unpack (lua_State *L) {
e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1));
if (i > e) return 0; /* empty range */
n = e - i + 1; /* number of elements */
if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */
if (l_unlikely(n <= 0 || !lua_checkstack(L, n))) /* n <= 0 means arith. overflow */
return luaL_error(L, "too many results to unpack");
lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */
while (i++ < e) /* push arg[i + 1...e] */
@@ -445,9 +445,9 @@ static int luaB_costatus (lua_State *L) {
static int auxresume (lua_State *L, lua_State *co, int narg) {
int status = costatus(L, co);
if (!lua_checkstack(co, narg))
if (l_unlikely(!lua_checkstack(co, narg)))
luaL_error(L, "too many arguments to resume");
if (status != CO_SUS) {
if (l_unlikely(status != CO_SUS)) {
lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]);
return -1; /* error flag */
}
@@ -456,7 +456,7 @@ static int auxresume (lua_State *L, lua_State *co, int narg) {
status = lua_resume(co, narg);
if (status == 0 || status == LUA_YIELD) {
int nres = lua_gettop(co);
if (!lua_checkstack(L, nres + 1))
if (l_unlikely(!lua_checkstack(L, nres + 1)))
luaL_error(L, "too many results to resume");
lua_xmove(co, L, nres); /* move yielded values */
return nres;
+2 -2
View File
@@ -73,7 +73,7 @@ static int db_getinfo (lua_State *L) {
}
else
return luaL_argerror(L, arg+1, "function or level expected");
if (!lua_getinfo(L1, options, &ar))
if (l_unlikely(!lua_getinfo(L1, options, &ar)))
return luaL_argerror(L, arg+2, "invalid option");
lua_createtable(L, 0, 2);
if (strchr(options, 'S')) {
@@ -104,7 +104,7 @@ static int db_getlocal (lua_State *L) {
lua_State *L1 = getthread(L, &arg);
lua_Debug ar;
const char *name;
if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */
if (l_unlikely(!lua_getstack(L1, luaL_checkint(L, arg+1), &ar))) /* out of range? */
return luaL_argerror(L, arg+1, "level out of range");
name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2));
if (name) {
+13 -13
View File
@@ -172,7 +172,7 @@ void luaD_reallocCI (lua_State *L, int newsize) {
void luaD_growstack (lua_State *L, int n) {
if (n <= L->stacksize) /* double size is enough? */
if (l_likely(n <= L->stacksize)) /* double size is enough? */
luaD_reallocstack(L, 2*L->stacksize);
else
luaD_reallocstack(L, L->stacksize + n);
@@ -180,11 +180,11 @@ void luaD_growstack (lua_State *L, int n) {
static CallInfo *growCI (lua_State *L) {
if (L->size_ci > LUAI_MAXCALLS) /* overflow while handling overflow? */
if (l_unlikely(L->size_ci > LUAI_MAXCALLS)) /* overflow while handling overflow? */
luaD_throw(L, LUA_ERRERR);
else {
luaD_reallocCI(L, 2*L->size_ci);
if (L->size_ci > LUAI_MAXCALLS)
if (l_unlikely(L->size_ci > LUAI_MAXCALLS))
luaG_runerror(L, "stack overflow");
}
return ++L->ci;
@@ -257,7 +257,7 @@ static StkId tryfuncTM (lua_State *L, StkId func) {
const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL);
StkId p;
ptrdiff_t funcr = savestack(L, func);
if (!ttisfunction(tm))
if (l_unlikely(!ttisfunction(tm)))
luaG_typeerror(L, func, "call");
/* Open a hole inside the stack at `func' */
for (p = L->top; p > func; p--) setobjs2s(L, p, p-1);
@@ -356,7 +356,7 @@ int luaD_poscall (lua_State *L, StkId firstResult) {
StkId res;
int wanted, i;
CallInfo *ci;
if (L->hookmask & LUA_MASKRET)
if (l_unlikely(L->hookmask) & LUA_MASKRET)
firstResult = callrethooks(L, firstResult);
ci = L->ci--;
res = ci->func; /* res == final position of 1st result */
@@ -380,7 +380,7 @@ int luaD_poscall (lua_State *L, StkId firstResult) {
** function position.
*/
void luaD_call (lua_State *L, StkId func, int nResults) {
if (++L->nCcalls >= LUAI_MAXCCALLS) {
if (l_unlikely(++L->nCcalls >= LUAI_MAXCCALLS)) {
if (L->nCcalls == LUAI_MAXCCALLS)
luaG_runerror(L, "C stack overflow");
else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
@@ -430,15 +430,15 @@ static int resume_error (lua_State *L, const char *msg) {
LUA_API int lua_resume (lua_State *L, int nargs) {
int status;
lua_lock(L);
if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci))
if (l_unlikely(L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci)))
return resume_error(L, "cannot resume non-suspended coroutine");
if (L->nCcalls >= LUAI_MAXCCALLS)
if (l_unlikely(L->nCcalls >= LUAI_MAXCCALLS))
return resume_error(L, "C stack overflow");
luai_userstateresume(L, nargs);
lua_assert(L->errfunc == 0);
L->baseCcalls = ++L->nCcalls;
status = luaD_rawrunprotected(L, resume, L->top - nargs);
if (status != 0) { /* error? */
if (l_unlikely(status != 0)) { /* error? */
L->status = cast_byte(status); /* mark thread as `dead' */
luaD_seterrorobj(L, status, L->top);
L->ci->top = L->top;
@@ -456,7 +456,7 @@ LUA_API int lua_resume (lua_State *L, int nargs) {
LUA_API int lua_yield (lua_State *L, int nresults) {
luai_userstateyield(L, nresults);
lua_lock(L);
if (L->nCcalls > L->baseCcalls)
if (l_unlikely(L->nCcalls > L->baseCcalls))
luaG_runerror(L, "attempt to yield across metamethod/C-call boundary");
L->base = L->top - nresults; /* protect stack slots below */
L->status = LUA_YIELD;
@@ -474,7 +474,7 @@ int luaD_pcall (lua_State *L, Pfunc func, void *u,
ptrdiff_t old_errfunc = L->errfunc;
L->errfunc = ef;
status = luaD_rawrunprotected(L, func, u);
if (status != 0) { /* an error occurred? */
if (l_unlikely(status != 0)) { /* an error occurred? */
StkId oldtop = restorestack(L, old_top);
luaF_close(L, oldtop); /* close eventual pending closures */
luaD_seterrorobj(L, status, oldtop);
@@ -511,8 +511,8 @@ static void f_parser (lua_State *L, void *ud) {
tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z,
&p->buff, p->name);
#else
if (c == LUA_SIGNATURE[0])
luaG_runerror(L, "invalid format, cannot load bytecode scripts");
if (l_unlikely(c == LUA_SIGNATURE[0]))
luaG_runerror(L, "invalid format, cannot load bytecode scripts");
tf = luaY_parser(L, p->z, &p->buff, p->name);
#endif
cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L)));
+1 -1
View File
@@ -14,7 +14,7 @@
#define luaD_checkstack(L,n) \
if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
if (l_unlikely((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue))) \
luaD_growstack(L, n); \
else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
+10 -10
View File
@@ -84,7 +84,7 @@ static int io_type (lua_State *L) {
static FILE *tofile (lua_State *L) {
FILE **f = tofilep(L);
if (*f == NULL)
if (l_unlikely(*f == NULL))
luaL_error(L, "attempt to use a closed file");
return *f;
}
@@ -184,8 +184,8 @@ static int io_open (lua_State *L) {
break;
}
}
if (strstr(filename, "..") || strchr(filename, ':') || StartsWith(filename, "\\")
|| StartsWith(filename, "/") || !pass)
if (l_unlikely(strstr(filename, "..") || strchr(filename, ':') || StartsWith(filename, "\\")
|| StartsWith(filename, "/") || !pass))
{
luaL_error(L,"access denied to %s", filename);
return pushresult(L,0,filename);
@@ -202,7 +202,7 @@ static int io_open (lua_State *L) {
{
*splitter = 0;
I_mkdir(destFilename, 0755);
*splitter = '/';
*splitter = '/';
splitter++;
forward = strchr(splitter, '/');
@@ -226,7 +226,7 @@ static FILE *getiofile (lua_State *L, int findex) {
FILE *f;
lua_rawgeti(L, LUA_ENVIRONINDEX, findex);
f = *(FILE **)lua_touserdata(L, -1);
if (f == NULL)
if (l_unlikely(f == NULL))
luaL_error(L, "standard %s file is closed", fnames[findex - 1]);
return f;
}
@@ -238,7 +238,7 @@ static int g_iofile (lua_State *L, int f, const char *mode) {
if (filename) {
FILE **pf = newfile(L);
*pf = fopen(filename, mode);
if (*pf == NULL)
if (l_unlikely(*pf == NULL))
fileerror(L, 1, filename);
}
else {
@@ -290,7 +290,7 @@ static int io_lines (lua_State *L) {
const char *filename = luaL_checkstring(L, 1);
FILE **pf = newfile(L);
*pf = fopen(filename, "r");
if (*pf == NULL)
if (l_unlikely(*pf == NULL))
fileerror(L, 1, filename);
aux_lines(L, lua_gettop(L), 1);
return 1;
@@ -307,7 +307,7 @@ static int io_lines (lua_State *L) {
static int read_number (lua_State *L, FILE *f) {
lua_Number d;
if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) {
if (l_likely(fscanf(f, LUA_NUMBER_SCAN, &d) == 1)) {
lua_pushnumber(L, d);
return 1;
}
@@ -454,7 +454,7 @@ static int g_write (lua_State *L, FILE *f, int arg) {
else {
size_t l;
const char *s = luaL_checklstring(L, arg, &l);
if (ftell(f) + l > FILELIMIT)
if (l_unlikely(ftell(f) + l > FILELIMIT))
{
luaL_error(L,"write limit bypassed in file. Changes have been discarded.");
break;
@@ -483,7 +483,7 @@ static int f_seek (lua_State *L) {
int op = luaL_checkoption(L, 2, "cur", modenames);
long offset = luaL_optlong(L, 3, 0);
op = fseek(f, offset, mode[op]);
if (op)
if (l_unlikely(op))
return pushresult(L, 0, NULL); /* error */
else {
lua_pushinteger(L, ftell(f));
+2 -2
View File
@@ -48,7 +48,7 @@ void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems,
void *newblock;
int newsize;
if (*size >= limit/2) { /* cannot double it? */
if (*size >= limit) /* cannot grow even a little? */
if (l_unlikely(*size >= limit)) /* cannot grow even a little? */
luaG_runerror(L, errormsg);
newsize = limit; /* still have at least one free place */
}
@@ -77,7 +77,7 @@ void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) {
global_State *g = G(L);
lua_assert((osize == 0) == (block == NULL));
block = (*g->frealloc)(g->ud, block, osize, nsize);
if (block == NULL && nsize > 0)
if (l_unlikely(block == NULL && nsize > 0))
luaD_throw(L, LUA_ERRMEM);
lua_assert((nsize == 0) == (block == NULL));
g->totalbytes = (g->totalbytes - osize) + nsize;
+6 -6
View File
@@ -103,7 +103,7 @@ static void checknext (LexState *ls, int c) {
static void check_match (LexState *ls, int what, int who, int where) {
if (!testnext(ls, what)) {
if (l_unlikely(!testnext(ls, what))) {
if (where == ls->linenumber)
error_expected(ls, what);
else {
@@ -275,7 +275,7 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
static void enterlevel (LexState *ls) {
if (++ls->L->nCcalls > LUAI_MAXCCALLS)
if (l_unlikely(++ls->L->nCcalls > LUAI_MAXCCALLS))
luaX_lexerror(ls, "chunk has too many syntax levels", 0);
}
@@ -643,7 +643,7 @@ static void funcargs (LexState *ls, expdesc *f) {
int line = ls->linenumber;
switch (ls->t.token) {
case '(': { /* funcargs -> `(' [ explist1 ] `)' */
if (line != ls->lastline)
if (l_unlikely(line != ls->lastline))
luaX_syntaxerror(ls,"ambiguous syntax (function call x new statement)");
luaX_next(ls);
if (ls->t.token == ')') /* arg list is empty? */
@@ -712,7 +712,7 @@ static void prefixexp (LexState *ls, expdesc *v) {
case '$': {
lua_Number i = ls->t.seminfo.r;
if (i == 0) i = ls->fs->nrhs;
if (i <= 0 || i > ls->fs->nlhs)
if (l_unlikely(i <= 0 || i > ls->fs->nlhs))
luaX_syntaxerror(ls, "pseudo-variable out of range or not in assignment");
else {
expdesc_list *lhs = ls->fs->lhs;
@@ -1105,7 +1105,7 @@ static void breakstat (LexState *ls, lua_Number n) {
upval |= bl->upval;
bl = bl->previous;
}
if (!bl)
if (l_unlikely(!bl))
luaX_syntaxerror(ls, "no loop to break");
if (upval)
luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);
@@ -1124,7 +1124,7 @@ static void continuestat (LexState *ls) {
//upval |= bl->upval; // AK: ADDITION (would this fix forbody probs?)
bl = bl->previous;
}
if (!bl)
if (l_unlikely(!bl))
luaX_syntaxerror(ls, "no loop to continue");
//if (upval) //AK: experimental
+2 -2
View File
@@ -83,7 +83,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
o != NULL;
o = o->gch.next) {
TString *ts = rawgco2ts(o);
if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) {
if (l_unlikely(ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0))) {
/* string may be dead */
if (isdead(G(L), o)) changewhite(o);
return ts;
@@ -95,7 +95,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
Udata *luaS_newudata (lua_State *L, size_t s, Table *e) {
Udata *u;
if (s > MAX_SIZET - sizeof(Udata))
if (l_unlikely(s > MAX_SIZET - sizeof(Udata)))
luaM_toobig(L);
u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata)));
u->uv.marked = luaC_white(G(L)); /* is not finalized */
+14 -12
View File
@@ -113,7 +113,7 @@ static int str_byte (lua_State *L) {
if ((size_t)pose > l) pose = l;
if (posi > pose) return 0; /* empty interval; return no values */
n = (int)(pose - posi + 1);
if (posi + n <= pose) /* overflow? */
if (l_unlikely(posi + n <= pose)) /* overflow? */
luaL_error(L, "string slice too long");
luaL_checkstack(L, n, "string slice too long");
for (i=0; i<n; i++)
@@ -187,7 +187,7 @@ typedef struct MatchState {
static int check_capture (MatchState *ms, int l) {
l -= '1';
if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED)
if (l_unlikely(l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED))
return luaL_error(ms->L, "invalid capture index");
return l;
}
@@ -204,14 +204,14 @@ static int capture_to_close (MatchState *ms) {
static const char *classend (MatchState *ms, const char *p) {
switch (*p++) {
case L_ESC: {
if (*p == '\0')
if (l_unlikely(*p == '\0'))
luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")");
return p+1;
}
case '[': {
if (*p == '^') p++;
do { /* look for a `]' */
if (*p == '\0')
if (l_unlikely(*p == '\0'))
luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")");
if (*(p++) == L_ESC && *p != '\0')
p++; /* skip escapes (e.g. `%]') */
@@ -282,7 +282,7 @@ static const char *match (MatchState *ms, const char *s, const char *p);
static const char *matchbalance (MatchState *ms, const char *s,
const char *p) {
if (*p == 0 || *(p+1) == 0)
if (l_unlikely(*p == 0 || *(p+1) == 0))
luaL_error(ms->L, "unbalanced pattern");
if (*s != *p) return NULL;
else {
@@ -332,7 +332,8 @@ static const char *start_capture (MatchState *ms, const char *s,
const char *p, int what) {
const char *res;
int level = ms->level;
if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures");
if (l_unlikely(level >= LUA_MAXCAPTURES))
luaL_error(ms->L, "too many captures");
ms->capture[level].init = s;
ms->capture[level].len = what;
ms->level = level+1;
@@ -386,7 +387,7 @@ static const char *match (MatchState *ms, const char *s, const char *p) {
case 'f': { /* frontier? */
const char *ep; char previous;
p += 2;
if (*p != '[')
if (l_unlikely(*p != '['))
luaL_error(ms->L, "missing " LUA_QL("[") " after "
LUA_QL("%%f") " in pattern");
ep = classend(ms, p); /* points to what is next */
@@ -468,14 +469,15 @@ static const char *lmemfind (const char *s1, size_t l1,
static void push_onecapture (MatchState *ms, int i, const char *s,
const char *e) {
if (i >= ms->level) {
if (i == 0) /* ms->level == 0, too */
if (l_likely(i == 0)) /* ms->level == 0, too */
lua_pushlstring(ms->L, s, e - s); /* add whole match */
else
luaL_error(ms->L, "invalid capture index");
}
else {
ptrdiff_t l = ms->capture[i].len;
if (l == CAP_UNFINISHED) luaL_error(ms->L, "unfinished capture");
if (l_unlikely(l == CAP_UNFINISHED))
luaL_error(ms->L, "unfinished capture");
if (l == CAP_POSITION)
lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1);
else
@@ -637,7 +639,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s,
lua_pop(L, 1);
lua_pushlstring(L, s, e - s); /* keep original text */
}
else if (!lua_isstring(L, -1))
else if (l_unlikely(!lua_isstring(L, -1)))
luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
luaL_addvalue(b); /* add result to accumulator */
}
@@ -727,7 +729,7 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) {
static const char *scanformat (lua_State *L, const char *strfrmt, char *form) {
const char *p = strfrmt;
while (*p != '\0' && strchr(FLAGS, *p) != NULL) p++; /* skip flags */
if ((size_t)(p - strfrmt) >= sizeof(FLAGS))
if (l_unlikely((size_t)(p - strfrmt) >= sizeof(FLAGS)))
luaL_error(L, "invalid format (repeated flags)");
if (isdigit(uchar(*p))) p++; /* skip width */
if (isdigit(uchar(*p))) p++; /* (2 digits at most) */
@@ -736,7 +738,7 @@ static const char *scanformat (lua_State *L, const char *strfrmt, char *form) {
if (isdigit(uchar(*p))) p++; /* skip precision */
if (isdigit(uchar(*p))) p++; /* (2 digits at most) */
}
if (isdigit(uchar(*p)))
if (l_unlikely(isdigit(uchar(*p))))
luaL_error(L, "invalid format (width or precision too long)");
*(form++) = '%';
strncpy(form, strfrmt, p - strfrmt + 1);
+4 -3
View File
@@ -278,7 +278,7 @@ static void setnodevector (lua_State *L, Table *t, int size) {
else {
int i;
lsize = ceillog2(size);
if (lsize > MAXBITS)
if (l_unlikely(lsize > MAXBITS))
luaG_runerror(L, "table overflow");
size = twoto(lsize);
t->node = luaM_newvector(L, size, Node);
@@ -498,8 +498,9 @@ TValue *luaH_set (lua_State *L, Table *t, const TValue *key) {
if (p != luaO_nilobject)
return cast(TValue *, p);
else {
if (ttisnil(key)) luaG_runerror(L, "table index is nil");
else if (ttisnumber(key) && luai_numisnan(nvalue(key)))
if (l_unlikely(ttisnil(key)))
luaG_runerror(L, "table index is nil");
else if (l_unlikely(ttisnumber(key) && luai_numisnan(nvalue(key))))
luaG_runerror(L, "table index is NaN");
return newkey(L, t, key);
}
+5 -3
View File
@@ -134,7 +134,7 @@ static int tremove (lua_State *L) {
static void addfield (lua_State *L, luaL_Buffer *b, int i) {
lua_rawgeti(L, 1, i);
if (!lua_isstring(L, -1))
if (l_unlikely(!lua_isstring(L, -1)))
luaL_error(L, "invalid value (%s) at index %d in table for "
LUA_QL("concat"), luaL_typename(L, -1), i);
luaL_addvalue(b);
@@ -224,12 +224,14 @@ static void auxsort (lua_State *L, int l, int u) {
for (;;) { /* invariant: a[l..i] <= P <= a[j..u] */
/* repeat ++i until a[i] >= P */
while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) {
if (i>u) luaL_error(L, "invalid order function for sorting");
if (l_unlikely(i>u))
luaL_error(L, "invalid order function for sorting");
lua_pop(L, 1); /* remove a[i] */
}
/* repeat --j until a[j] <= P */
while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) {
if (j<l) luaL_error(L, "invalid order function for sorting");
if (l_unlikely(j<l))
luaL_error(L, "invalid order function for sorting");
lua_pop(L, 1); /* remove a[j] */
}
if (j<i) {
+17
View File
@@ -773,6 +773,23 @@ union luai_Cast { double l_d; long l_l; };
/* =================================================================== */
/*
* * macros to improve jump prediction, used mostly for error handling
** and debug facilities.
*/
#if !defined(l_likely)
#include <stdio.h>
#if defined(__GNUC__)
#define l_likely(x) (__builtin_expect(((x) != 0), 1))
#define l_unlikely(x) (__builtin_expect(((x) != 0), 0))
#else
#define l_likely(x) (x)
#define l_unlikely(x) (x)
#endif
#endif
/*
** Local configuration. You can use this space to add your redefinitions
** without modifying the main part of the file.
+12 -11
View File
@@ -119,7 +119,7 @@ void luaV_gettable (lua_State *L, TValue *t, TValue *key, StkId val) {
}
/* else will try the tag method */
}
else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX)))
else if (l_unlikely(ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))))
luaG_typeerror(L, t, "index");
if (ttisfunction(tm)) {
callTMres(L, val, tm, t, key);
@@ -147,7 +147,7 @@ void luaV_settable (lua_State *L, TValue *t, TValue *key, StkId val) {
}
/* else will try the tag method */
}
else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX)))
else if (l_unlikely(ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))))
luaG_typeerror(L, t, "index");
if (ttisfunction(tm)) {
callTM(L, tm, t, key, val);
@@ -293,7 +293,8 @@ void luaV_concat (lua_State *L, int total, int last) {
/* collect total length */
for (n = 1; n < total && tostring(L, top-n-1); n++) {
size_t l = tsvalue(top-n-1)->len;
if (l >= MAX_SIZET - tl) luaG_runerror(L, "string length overflow");
if (l_unlikely(l >= MAX_SIZET - tl))
luaG_runerror(L, "string length overflow");
tl += l;
}
buffer = luaZ_openspace(L, &G(L)->buff, tl);
@@ -322,8 +323,8 @@ static void Arith (lua_State *L, StkId ra, TValue *rb,
case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break;
case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break;
case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break;
case TM_DIV: if (nc == 0) { luaG_runerror(L, "divide by zero error"); } else setnvalue(ra, luai_numdiv(nb, nc)); break;
case TM_MOD: if (nc == 0) { luaG_runerror(L, "modulo by zero error"); } else setnvalue(ra, luai_nummod(nb, nc)); break;
case TM_DIV: if (l_unlikely(nc == 0)) { luaG_runerror(L, "divide by zero error"); } else setnvalue(ra, luai_numdiv(nb, nc)); break;
case TM_MOD: if (l_unlikely(nc == 0)) { luaG_runerror(L, "modulo by zero error"); } else setnvalue(ra, luai_nummod(nb, nc)); break;
case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break;
case TM_UNM: setnvalue(ra, luai_numunm(nb)); break;
case TM_AND: setnvalue(ra, luai_numand(nb, nc)); break;
@@ -491,7 +492,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
TValue *rc = RKC(i);
if (ttisnumber(rb) && ttisnumber(rc)) {
lua_Number nb = nvalue(rb), nc = nvalue(rc);
if (nc == 0) {
if (l_unlikely(nc == 0)) {
luaG_runerror(L, "divide by zero error");
}
else
@@ -506,7 +507,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
TValue *rc = RKC(i);
if (ttisnumber(rb) && ttisnumber(rc)) {
lua_Number nb = nvalue(rb), nc = nvalue(rc);
if (nc == 0) {
if (l_unlikely(nc == 0)) {
luaG_runerror(L, "modulo by zero error");
}
else
@@ -580,7 +581,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
}
default: { /* try metamethod */
Protect(
if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN))
if (l_unlikely(!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN)))
luaG_typeerror(L, rb, "get length of");
)
}
@@ -724,11 +725,11 @@ void luaV_execute (lua_State *L, int nexeccalls) {
const TValue *plimit = ra+1;
const TValue *pstep = ra+2;
L->savedpc = pc; /* next steps may throw errors */
if (!tonumber(init, ra))
if (l_unlikely(!tonumber(init, ra)))
luaG_runerror(L, LUA_QL("for") " initial value must be a number");
else if (!tonumber(plimit, ra+1))
else if (l_unlikely(!tonumber(plimit, ra+1)))
luaG_runerror(L, LUA_QL("for") " limit must be a number");
else if (!tonumber(pstep, ra+2))
else if (l_unlikely(!tonumber(pstep, ra+2)))
luaG_runerror(L, LUA_QL("for") " step must be a number");
if (ra && pstep)
setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep)));
+1 -1
View File
@@ -61,7 +61,7 @@ struct SourceLocation {
class IErrorAssertHandler {
public:
static void handle(const SourceLocation& source_location, const char* expression) {
[[ noreturn ]] static void handle(const SourceLocation& source_location, const char* expression) {
I_Error("Assertion failed at %s:%u: %s != true",
source_location.file_name,
source_location.line_number,
+1140 -919
View File
File diff suppressed because it is too large. Load diff
Loaded 100 of 237 files, more files were not shown because too many files have changed in this diff. Show more