diff options
author | Mattias Andrée <m@maandree.se> | 2025-03-07 20:33:18 +0100 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2025-03-07 20:33:18 +0100 |
commit | 46ab347b651f869025b3c5a351bc9e944c39985c (patch) | |
tree | 9547c937d079eaa35b5683b45b43328555187f63 | |
parent | New README (diff) | |
download | redshift-ng-46ab347b651f869025b3c5a351bc9e944c39985c.tar.gz redshift-ng-46ab347b651f869025b3c5a351bc9e944c39985c.tar.bz2 redshift-ng-46ab347b651f869025b3c5a351bc9e944c39985c.tar.xz |
Misc improvements
Signed-off-by: Mattias Andrée <m@maandree.se>
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | po/ar.po | 15 | ||||
-rw-r--r-- | po/be.po | 27 | ||||
-rw-r--r-- | po/bg.po | 15 | ||||
-rw-r--r-- | po/ca.po | 24 | ||||
-rw-r--r-- | po/cs.po | 24 | ||||
-rw-r--r-- | po/da.po | 23 | ||||
-rw-r--r-- | po/de.po | 24 | ||||
-rw-r--r-- | po/el.po | 19 | ||||
-rw-r--r-- | po/en_GB.po | 23 | ||||
-rw-r--r-- | po/eo.po | 15 | ||||
-rw-r--r-- | po/es.po | 24 | ||||
-rw-r--r-- | po/et.po | 15 | ||||
-rw-r--r-- | po/eu.po | 24 | ||||
-rw-r--r-- | po/fi.po | 19 | ||||
-rw-r--r-- | po/fr.po | 24 | ||||
-rw-r--r-- | po/gl.po | 19 | ||||
-rw-r--r-- | po/he.po | 15 | ||||
-rw-r--r-- | po/hi.po | 19 | ||||
-rw-r--r-- | po/hr.po | 21 | ||||
-rw-r--r-- | po/hu.po | 23 | ||||
-rw-r--r-- | po/it.po | 21 | ||||
-rw-r--r-- | po/ja.po | 24 | ||||
-rw-r--r-- | po/ka.po | 15 | ||||
-rw-r--r-- | po/lt.po | 21 | ||||
-rw-r--r-- | po/nb.po | 21 | ||||
-rw-r--r-- | po/nl.po | 24 | ||||
-rw-r--r-- | po/oc.po | 17 | ||||
-rw-r--r-- | po/pl.po | 24 | ||||
-rw-r--r-- | po/pt.po | 21 | ||||
-rw-r--r-- | po/pt_BR.po | 21 | ||||
-rw-r--r-- | po/redshift.pot | 15 | ||||
-rw-r--r-- | po/ro.po | 15 | ||||
-rw-r--r-- | po/ru.po | 21 | ||||
-rw-r--r-- | po/sr.po | 17 | ||||
-rw-r--r-- | po/sv.po | 21 | ||||
-rw-r--r-- | po/tr.po | 15 | ||||
-rw-r--r-- | po/uk.po | 24 | ||||
-rw-r--r-- | po/zh_CN.po | 24 | ||||
-rw-r--r-- | po/zh_TW.po | 24 | ||||
-rw-r--r-- | src/colorramp.c | 40 | ||||
-rw-r--r-- | src/common.h | 98 | ||||
-rw-r--r-- | src/config-ini.c | 494 | ||||
-rw-r--r-- | src/gamma-coopgamma.c | 34 | ||||
-rw-r--r-- | src/gamma-drm.c | 45 | ||||
-rw-r--r-- | src/gamma-dummy.c | 34 | ||||
-rw-r--r-- | src/gamma-quartz.c | 36 | ||||
-rw-r--r-- | src/gamma-randr.c | 38 | ||||
-rw-r--r-- | src/gamma-vidmode.c | 36 | ||||
-rw-r--r-- | src/gamma-w32gdi.c | 36 | ||||
-rw-r--r-- | src/hooks.c | 34 | ||||
-rw-r--r-- | src/location-corelocation.m | 36 | ||||
-rw-r--r-- | src/location-geoclue2.c | 36 | ||||
-rw-r--r-- | src/location-manual.c | 36 | ||||
-rw-r--r-- | src/options.c | 34 | ||||
-rw-r--r-- | src/pipeutils.c | 40 | ||||
-rw-r--r-- | src/redshift.c | 252 | ||||
-rw-r--r-- | src/signals.c | 36 | ||||
-rw-r--r-- | src/solar.c | 42 | ||||
-rw-r--r-- | src/solar.h | 35 | ||||
-rw-r--r-- | src/systemtime.c | 68 |
61 files changed, 1059 insertions, 1280 deletions
@@ -187,10 +187,8 @@ https://github.com/jonls/redshift/issues/249 Feature request: intensity https://github.com/jonls/redshift/issues/867 Make Redshift remember the last discovered location at startup https://github.com/jonls/redshift/issues/199 Setting neutral color temperature? -Document signals in man page The term "brightness" refers to blackpoint brightness, redshift sets whitepoint brightness, so change wording to "brilliance" po/sv.po: gammaförfining[ar] -> gammatabell[er]; lost -> förlorat {wrong gender} -> försvunnen; CRTC -> CRTC[:er] -[0-%i] -> [0, %i] po/de.po: lost -> verloren -> verschwunden po/sv.po: felaktig -> ogiltig (?) po/sv.po: NBSP before units (after ° which should also be added) @@ -116,7 +116,7 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" +msgid "Initialization of %s failed." msgstr "" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 @@ -125,12 +125,10 @@ msgstr "" msgid "Failed to set %s option.\n" msgstr "" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -171,11 +169,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -475,7 +468,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -485,7 +478,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -125,23 +125,20 @@ msgstr "Мясцовасць: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Памылка падчас ініцыялізацыі %s .\n" +msgid "Initialization of %s failed." +msgstr "Памылка падчас ініцыялізацыі %s." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 #, c-format msgid "Failed to set %s option.\n" -msgstr "Не атрымалася задаць параметр %s .\n" +msgstr "Не атрымалася задаць параметр %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "" -"Паспрабуйце `-l %s:help' , каб атрымаць больш дакладную інфармацыю.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Паспрабуйце `-l %s:help' , каб атрымаць больш дакладную інфармацыю." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -182,11 +179,6 @@ msgstr "Шырата мусіць быць паміж %.1f і %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Даўгата мусіць быць паміж %.1f і %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Не атрымалася прачытаць сістэмны час" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Чаканне даступнасці першапачатковага месцазнаходжання...\n" @@ -517,8 +509,9 @@ msgstr "Прызначэнне па-за раздзелам файла канф #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "Не атрымалася адкрыць DRM прылады: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "Не атрымалася адкрыць DRM прылады `%s': %s." +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -527,8 +520,8 @@ msgstr "Не атрымалася вызначыць рэсурсы рэжыму #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i не існуе, дзейны CRTCs - гэта [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i не існуе, дзейны CRTCs - гэта [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -116,7 +116,7 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" +msgid "Initialization of %s failed." msgstr "" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 @@ -125,12 +125,10 @@ msgstr "" msgid "Failed to set %s option.\n" msgstr "" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -171,11 +169,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -475,7 +468,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -485,7 +478,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -128,8 +128,8 @@ msgstr "Ubicació: %.2f° %s, %.2f° %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "La inicialització de %s ha fallat.\n" +msgid "Initialization of %s failed." +msgstr "La inicialització de %s ha fallat." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -137,13 +137,11 @@ msgstr "La inicialització de %s ha fallat.\n" msgid "Failed to set %s option.\n" msgstr "No s'ha pogut establir l'opció %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Proveu «-l %s:help» per obtenir més informació.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Proveu «-l %s:help» per obtenir més informació." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -183,11 +181,6 @@ msgstr "La latitud ha d'estar entre %.1f i %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "La longitud ha d'estar entre %.1f i %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "No s'ha pogut llegir l'hora del sistema." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "S'està esperant que la ubicació inicial estigui disponible...\n" @@ -521,8 +514,9 @@ msgstr "L'assignació de dades al fitxer de configuració estan fora d'una secci #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "No s'ha pogut obrir el dispositiu DRM: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "No s'ha pogut obrir el dispositiu DRM «%s»: %s." +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -531,8 +525,8 @@ msgstr "No s'han pogut obtenir els recursos del mode DRM" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "El CRTC %i no existeix, els CRTC vàlids són [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "El CRTC %i no existeix, els CRTC vàlids són [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -126,8 +126,8 @@ msgstr "Poloha %.2f° %s, %.2f° %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Inicializace %s se nezdařila.\n" +msgid "Initialization of %s failed." +msgstr "Inicializace %s se nezdařila." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -135,13 +135,11 @@ msgstr "Inicializace %s se nezdařila.\n" msgid "Failed to set %s option.\n" msgstr "Nezdařilo se nastavit volbu %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Zkuste `-l %s:help' pro více informací.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Zkuste `-l %s:help' pro více informací." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -181,11 +179,6 @@ msgstr "Je třeba, aby zeměpisná šířka byla z rozsahu %.1f až %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Je třeba, aby zeměpisná délka byla z rozsahu %.1f až %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Nebylo možné načíst systémový čas." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Čekání na dostupnost úvodního umístění…\n" @@ -520,8 +513,9 @@ msgstr "Přiřazení mimo sekci v souboru s nastaveními." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "Nepodařilo se otevřít DRM zařízení: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "Nepodařilo se otevřít DRM zařízení %s: %s" +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -530,8 +524,8 @@ msgstr "Nezdařilo se získat zdroje DRM režimu" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i neexistuje, platná označení CRTC jsou [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i neexistuje, platná označení CRTC jsou [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -126,8 +126,8 @@ msgstr "Placering: %.2f° %s, %.2f° %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Fejl under klargøring af %s.\n" +msgid "Initialization of %s failed." +msgstr "Fejl under klargøring af %s." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -135,13 +135,11 @@ msgstr "Fejl under klargøring af %s.\n" msgid "Failed to set %s option.\n" msgstr "Kunne ikke sætte indstilling %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Prøv `-l %s:help' for mere information.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Prøv `-l %s:help' for mere information." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -181,11 +179,6 @@ msgstr "Breddegrad skal være mellem %.1f° og %.1f°.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Længdegrad skal være mellem %.1f° og %.1f°.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Kan ikke læse systemtid." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Venter på at indledende placering bliver tilgængelig...\n" @@ -515,8 +508,8 @@ msgstr "Variabeltildeling udenfor sektion i konfigurationsfil." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "Kunne ikke åbne DRM-enhed: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "Kunne ikke åbne DRM-enhed `%s': %s." #: ../src/gamma-drm.c:105 #, c-format @@ -525,8 +518,8 @@ msgstr "Kunne ikke få fat i DRM tilstandsressourcer" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i eksisterer ikke, gyldige CRTCer er [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i eksisterer ikke, gyldige CRTCer er [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -126,8 +126,8 @@ msgstr "Standort: %.2f° %s, %.2f° %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Starten von %s ist fehlgeschlagen.\n" +msgid "Initialization of %s failed." +msgstr "Starten von %s ist fehlgeschlagen." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -135,13 +135,11 @@ msgstr "Starten von %s ist fehlgeschlagen.\n" msgid "Failed to set %s option.\n" msgstr "Festlegen der Option %s ist fehlgeschlagen.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Bitte »-l %s:help« für weitere Informationen versuchen.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Bitte »-l %s:help« für weitere Informationen versuchen." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -181,11 +179,6 @@ msgstr "Der Breitengrad muss sich zwischen %.1f und %.1f befinden.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Der Längengrad muss sich zwischen %.1f und %.1f befinden.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Systemzeit konnte nicht ausgelesen werden." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Es wird gewartet, bis der anfängliche Standort verfügbar ist …\n" @@ -517,8 +510,9 @@ msgstr "Zuordnung außerhalb des Teils in der Konfigurationsdatei." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "Öffnen des DRM-Gerätes ist fehlgeschlagen: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "Öffnen des DRM-Gerätes „%s“ ist fehlgeschlagen: %s." +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -527,8 +521,8 @@ msgstr "Erhalt der DRM-Modus-Quellen ist fehlgeschlagen" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i ist nicht vorhanden, gültige CRTCs sind [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i ist nicht vorhanden, gültige CRTCs sind [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -116,8 +116,8 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Αποτυχία αρχικοποίησης του %s.\n" +msgid "Initialization of %s failed." +msgstr "Αποτυχία αρχικοποίησης του %s." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -125,13 +125,11 @@ msgstr "Αποτυχία αρχικοποίησης του %s.\n" msgid "Failed to set %s option.\n" msgstr "Αποτυχία ορισμού της επιλογής %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Για περισσότερες πληροφορίες, δοκιμάστε `-l %s:help'.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Για περισσότερες πληροφορίες, δοκιμάστε `-l %s:help'." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -171,11 +169,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -475,7 +468,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -485,7 +478,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 diff --git a/po/en_GB.po b/po/en_GB.po index e6c9206..78da6ca 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -125,8 +125,8 @@ msgstr "Location: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Initialisation of %s failed.\n" +msgid "Initialization of %s failed." +msgstr "Initialisation of %s failed." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -134,13 +134,11 @@ msgstr "Initialisation of %s failed.\n" msgid "Failed to set %s option.\n" msgstr "Failed to set %s option.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Try `-l %s:help' for more information." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -180,11 +178,6 @@ msgstr "Latitude must be between %.1f and %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Longitude must be between %.1f and %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Unable to read system time." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Waiting for initial location to become available...\n" @@ -516,8 +509,8 @@ msgstr "Assignment outside section in config file." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "Failed to open DRM device `%s': %s." #: ../src/gamma-drm.c:105 #, c-format @@ -526,8 +519,8 @@ msgstr "Failed to get DRM mode resources" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i does not exist, valid CRTCs are [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -117,7 +117,7 @@ msgstr "Loko: %.2fº %s, %.2fº %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" +msgid "Initialization of %s failed." msgstr "" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 @@ -126,12 +126,10 @@ msgstr "" msgid "Failed to set %s option.\n" msgstr "" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -172,11 +170,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -482,7 +475,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -492,7 +485,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -128,8 +128,8 @@ msgstr "Ubicación: %.2f° %s, %.2f° %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "La inicialización de %s ha fallado.\n" +msgid "Initialization of %s failed." +msgstr "La inicialización de %s ha fallado." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -137,13 +137,11 @@ msgstr "La inicialización de %s ha fallado.\n" msgid "Failed to set %s option.\n" msgstr "No se ha podido establecer la opción %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Pruebe «-l %s:help» para obtener más información.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Pruebe «-l %s:help» para obtener más información." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -183,11 +181,6 @@ msgstr "La latitud debe estar entre %.1f y %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "La longitud debe estar entre %.1f y %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "No se ha podido leer la hora del sistema." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "A la espera de que la ubicación inicial esté disponible...\n" @@ -525,8 +518,9 @@ msgstr "La asignación de datos en el archivo de configuración está fuera de u #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "No se ha podido abrir el dispositivo DRM: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "No se ha podido abrir el dispositivo DRM `%s': %s." +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -535,8 +529,8 @@ msgstr "No se han podido obtener los recursos del modo DRM" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "El CRTC %i no existe, los CRTC válidos son [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "El CRTC %i no existe, los CRTC válidos son [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -116,7 +116,7 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" +msgid "Initialization of %s failed." msgstr "" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 @@ -125,12 +125,10 @@ msgstr "" msgid "Failed to set %s option.\n" msgstr "" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -171,11 +169,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -475,7 +468,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -485,7 +478,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -125,8 +125,8 @@ msgstr "Kokapena: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "%s abiarazteak huts egin du.\n" +msgid "Initialization of %s failed." +msgstr "%s abiarazteak huts egin du." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -134,13 +134,11 @@ msgstr "%s abiarazteak huts egin du.\n" msgid "Failed to set %s option.\n" msgstr "Ezin izan da %s aukera ezarri.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Idatzi `-l %s:help' informazio gehiagorako.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Idatzi `-l %s:help' informazio gehiagorako." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -180,11 +178,6 @@ msgstr "Latitudea muga hauen barruan egon behar da: %.1f eta %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Longitudea muga hauen barruan egon behar da: %.1f eta %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Ezin izan da sistemaren ordua irakurri." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Hasierako kokapenaren zain...\n" @@ -513,8 +506,9 @@ msgstr "Gaizki eratutako esleipena konfigurazio fitxategian." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "DRM zerbitzuak huts egin du: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "`%s' DRM zerbitzuak huts egin du: %s." +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -523,8 +517,8 @@ msgstr "DRM moduko baliabideen eskuratzeak huts egin du" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "%i CRTCa ez da existitzen, onartutako CRTCak honakoak dira [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "%i CRTCa ez da existitzen, onartutako CRTCak honakoak dira [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -117,8 +117,8 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "%s:n käyttöönotto epäonnistui.\n" +msgid "Initialization of %s failed." +msgstr "%s:n käyttöönotto epäonnistui." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -126,13 +126,11 @@ msgstr "%s:n käyttöönotto epäonnistui.\n" msgid "Failed to set %s option.\n" msgstr "Asetuksen %s asettaminen epäonnistui.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Valitsin '-l %s:help' antaa lisätietoja.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Valitsin '-l %s:help' antaa lisätietoja." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -172,11 +170,6 @@ msgstr "Leveyspiirin on oltava väliltä %.1f - %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Pituuspiirin on oltava väliltä %.1f - %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Ei voida lukea järjestelmän aikaa." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -487,7 +480,7 @@ msgstr "Konfiguraatiotiedoston arvomääritelmä on otsikon ulkopuolella." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -497,7 +490,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "CRTC %i ei ole olemassa, kelvot CRTC:t ovat [o-%i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -127,8 +127,8 @@ msgstr "Localisation : %.2f°%s,%.2f°%s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "L'initialisation de %s a échouée.\n" +msgid "Initialization of %s failed." +msgstr "L'initialisation de %s a échouée." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -136,13 +136,11 @@ msgstr "L'initialisation de %s a échouée.\n" msgid "Failed to set %s option.\n" msgstr "Impossible de spécifier l'option %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Essayez « -l %s:help » pour plus d'informations.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Essayez « -l %s:help » pour plus d'informations." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -182,11 +180,6 @@ msgstr "La latitude doit être comprise entre %.1f et %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "La longitude doit être comprise entre %.1f et %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Impossible d'obtenir l'heure du système." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "En attente de localisation initiale...\n" @@ -529,8 +522,9 @@ msgstr "Affectation en dehors d'une section dans le fichier de configuration." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "Impossible d'ouvrir le DRM : %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "Impossible d'ouvrir le DRM « %s »: %s" +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -539,8 +533,8 @@ msgstr "Impossible d'obtenir les ressources en mode DRM" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "Le CRTC %i n'existe pas, les CRTCs valides sont [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "Le CRTC %i n'existe pas, les CRTCs valides sont [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -116,8 +116,8 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "A inicialización de %s fallou.\n" +msgid "Initialization of %s failed." +msgstr "A inicialización de %s fallou." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -125,13 +125,11 @@ msgstr "A inicialización de %s fallou.\n" msgid "Failed to set %s option.\n" msgstr "Produciuse un fallo ao estabelecer a opción %s\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Probe `-l %s:help' para máis información.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Probe `-l %s:help' para máis información." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -171,11 +169,6 @@ msgstr "A latitude debe estar entre %.1f e %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "A longitude debe estar entre %.1f e %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Imposíbele ler a hora do sistema." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -480,7 +473,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -490,7 +483,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -118,7 +118,7 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" +msgid "Initialization of %s failed." msgstr "" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 @@ -127,12 +127,10 @@ msgstr "" msgid "Failed to set %s option.\n" msgstr "" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -173,11 +171,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -477,7 +470,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -487,7 +480,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -116,8 +116,8 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "%s के प्रारंभिकीकरण असफल.\n" +msgid "Initialization of %s failed." +msgstr "%s के प्रारंभिकीकरण असफल." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -125,13 +125,11 @@ msgstr "%s के प्रारंभिकीकरण असफल.\n" msgid "Failed to set %s option.\n" msgstr "%s विकल्प सेट करने में विफल.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "अधिक जानकारी के लिए `-l %s:help'.\n" +msgid "Try `-l %s:help' for more information." +msgstr "अधिक जानकारी के लिए `-l %s:help'." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -171,11 +169,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -478,7 +471,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -488,7 +481,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -116,8 +116,8 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Učitavanje %s nije uspjelo.\n" +msgid "Initialization of %s failed." +msgstr "Učitavanje %s nije uspjelo." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -125,13 +125,11 @@ msgstr "Učitavanje %s nije uspjelo.\n" msgid "Failed to set %s option.\n" msgstr "Postavljanje %s opcije nije uspjelo.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Upišite `-l %s:help' za pojedinosti.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Upišite `-l %s:help' za pojedinosti." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -171,11 +169,6 @@ msgstr "Zemljopisna širina mora biti između %.1f i %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Zemljopisna dužina mora biti između %.1f i %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Nije moguće pročitati vrijeme na sustavu." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -485,7 +478,7 @@ msgstr "Dodjela vrijednosti izvan okvira u datoteci s postavkama." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -495,8 +488,8 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i ne postoji, valjani CRTCs su [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i ne postoji, valjani CRTCs su [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -126,8 +126,8 @@ msgstr "Helyzet: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "%s betöltése sikertelen.\n" +msgid "Initialization of %s failed." +msgstr "%s betöltése sikertelen." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -135,13 +135,11 @@ msgstr "%s betöltése sikertelen.\n" msgid "Failed to set %s option.\n" msgstr "A %s lehetőség beállítása sikertelen.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Próbálja ezt `-l %s:help' további információ eléréséhez.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Próbálja ezt `-l %s:help' további információ eléréséhez." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -181,11 +179,6 @@ msgstr "Földrajzi szélesség %.1f és %.1f közt kellene lennie.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Hosszúsági körnek %.1f és %.1f közti értéknek kell lennie.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Nem sikerült olvasni a rendszeridőt." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "A hely elsö keresése...\n" @@ -500,8 +493,8 @@ msgstr "Külső szakasz kijelölés a beállító fájlban." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "Nem lehetett a %s DRM-egséget kinyitni" +msgid "Failed to open DRM device `%s': %s." +msgstr "Nem lehetett a %s DRM-egséget kinyitni: %s." #: ../src/gamma-drm.c:105 #, c-format @@ -510,8 +503,8 @@ msgstr "Hibázott a DRM módú erőforrások meghívásánál" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i nem létezik, ezek érvényes CRTC-k [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i nem létezik, ezek érvényes CRTC-k [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -128,8 +128,8 @@ msgstr "Posizione: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Inizializzazione di %s non riuscita.\n" +msgid "Initialization of %s failed." +msgstr "Inizializzazione di %s non riuscita." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -137,13 +137,11 @@ msgstr "Inizializzazione di %s non riuscita.\n" msgid "Failed to set %s option.\n" msgstr "Impossibile impostare l'opzione %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Provare \"-l %s:help\" per maggiori informazioni.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Provare \"-l %s:help\" per maggiori informazioni." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -183,11 +181,6 @@ msgstr "La latitudine deve essere compresa tra %.1f e %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "La longitudine deve essere compresa tra %.1f e %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Impossibile leggere l'orario di sistema." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -498,7 +491,7 @@ msgstr "Sezione esterna dell'assegnamento nel file di configurazione." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -508,8 +501,8 @@ msgstr "Impossibile ottenere le risorse per la modalità DRM" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i non esiste, i CRTC validi sono [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i non esiste, i CRTC validi sono [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -120,8 +120,8 @@ msgstr "位置: %2$s %1$.2f°, %4$s %3$.2f°\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "%s の初期化に失敗しました。\n" +msgid "Initialization of %s failed." +msgstr "%s の初期化に失敗しました。" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -129,13 +129,11 @@ msgstr "%s の初期化に失敗しました。\n" msgid "Failed to set %s option.\n" msgstr "%s のオプションの設定に失敗しました。\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "`-l %s:help' で詳細情報が参照できます。\n" +msgid "Try `-l %s:help' for more information." +msgstr "`-l %s:help' で詳細情報が参照できます。" #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -175,11 +173,6 @@ msgstr "緯度は %.1f と %.1f の間でなければなりません。\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "経度は %.1f と %.1f の間でなければなりません。\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "システムの時刻を読み込めません。" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "初期位置が取得可能になるのを待機しています...\n" @@ -504,8 +497,9 @@ msgstr "設定ファイルにセクション外の代入があります。" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "DRM デバイスを開くのに失敗しました: %s\n" +msgid "Failed to open DRM device `%s': %s." +msgstr "DRM デバイス `%s' を開くのに失敗しました: %s." +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -514,8 +508,8 @@ msgstr "DRM モード リソースの取得に失敗しました" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i は存在しません、有効な CRTC は [0-%i] です。" +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i は存在しません、有効な CRTC は [0, %i] です。" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -116,7 +116,7 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" +msgid "Initialization of %s failed." msgstr "" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 @@ -125,12 +125,10 @@ msgstr "" msgid "Failed to set %s option.\n" msgstr "" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -171,11 +169,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -475,7 +468,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -485,7 +478,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -124,8 +124,8 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Nepavyko inicijuoti %s.\n" +msgid "Initialization of %s failed." +msgstr "Nepavyko inicijuoti %s." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -133,13 +133,11 @@ msgstr "Nepavyko inicijuoti %s.\n" msgid "Failed to set %s option.\n" msgstr "Nepavyko nustatyti parametro %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Norėdami gauti daugiau informacijos, mėginkite „-l %s:help“.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Norėdami gauti daugiau informacijos, mėginkite „-l %s:help“." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -179,11 +177,6 @@ msgstr "Platuma turi būti tarp %.1f ir %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Ilguma turi būti tarp %.1f ir %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Nepavyko perskaityti sistemos laiko." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -492,7 +485,7 @@ msgstr "Konfigūracijos faile paskirstymas už sekcijos ribų." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -502,8 +495,8 @@ msgstr "Nepavyko gauti DRM veiksenos išteklius" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i neegzistuoja, galimi CRTC yra [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i neegzistuoja, galimi CRTC yra [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -125,8 +125,8 @@ msgstr "Plassering: %.2f %s, %.2f° %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Igangsetting av %s mislyktes.\n" +msgid "Initialization of %s failed." +msgstr "Igangsetting av %s mislyktes." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -134,13 +134,11 @@ msgstr "Igangsetting av %s mislyktes.\n" msgid "Failed to set %s option.\n" msgstr "Klarte ikke å velge %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Prøv «-l %s:help» for mer informasjon.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Prøv «-l %s:help» for mer informasjon." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -180,11 +178,6 @@ msgstr "Breddegrad må være mellom %.1f og %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Lengdegrad må være mellom %.1f og %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Klarte ikke å lese systemtid." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -491,7 +484,7 @@ msgstr "Tildeling utenfor seksjon i oppsettsfil." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -501,8 +494,8 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i finnes ikke, gyldige CRTCs er [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i finnes ikke, gyldige CRTCs er [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -127,8 +127,8 @@ msgstr "Locatie: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Initialisatie van %s is mislukt.\n" +msgid "Initialization of %s failed." +msgstr "Initialisatie van %s is mislukt." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -136,13 +136,11 @@ msgstr "Initialisatie van %s is mislukt.\n" msgid "Failed to set %s option.\n" msgstr "Kan optie %s niet instellen.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Probeer '-l%s:help' voor meer informatie.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Probeer '-l%s:help' voor meer informatie." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -182,11 +180,6 @@ msgstr "Breedtegraad moet tussen %.1f en %.1f zijn.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Lengtegraad moet tussen %.1f en %.1f zijn.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Kan systeemtijd niet lezen." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Aan het wachten op het beschikbaar komen van de aanvangslocatie...\n" @@ -504,8 +497,9 @@ msgstr "Toewijzing buiten sectie in instellingenbestand." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "Kon DRM-apparaat niet openen: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "Kon DRM-apparaat '%s' niet openen: %s." +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -514,8 +508,8 @@ msgstr "Kon hulpbronnen voor DRM-modus niet verkrijgen" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i bestaat niet, juiste CRTC's zijn [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i bestaat niet, juiste CRTC's zijn [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -111,8 +111,8 @@ msgstr "Emplaçament : %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "L'inicializacion de %s a fracassat.\n" +msgid "Initialization of %s failed." +msgstr "L'inicializacion de %s a fracassat." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -120,12 +120,10 @@ msgstr "L'inicializacion de %s a fracassat.\n" msgid "Failed to set %s option.\n" msgstr "" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -166,11 +164,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Lectura impossibla de l'ora sistèma." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -476,7 +469,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -486,7 +479,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -124,8 +124,8 @@ msgstr "Pozycja: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Inicjalizacja %s nie powiodła się.\n" +msgid "Initialization of %s failed." +msgstr "Inicjalizacja %s nie powiodła się." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -133,13 +133,11 @@ msgstr "Inicjalizacja %s nie powiodła się.\n" msgid "Failed to set %s option.\n" msgstr "Ustawienie opcji %s nie powiodło się.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Spróbuj `-l %s:help' aby uzyskać więcej informacji.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Spróbuj `-l %s:help' aby uzyskać więcej informacji." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -179,11 +177,6 @@ msgstr "Szerokość geograficzna musi być pomiędzy %.1f i %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Długość geograficzna musi być pomiędzy %.1f i %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Nie udało się odczytać czasu systemowego." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Czekanie, aż początkowa lokalizacja będzie dostępna\n" @@ -492,8 +485,9 @@ msgstr "Przypisanie poza sekcją w pliku konfiguracyjnym." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "Nie udało się otworzyć urządzenia DRM: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "Nie udało się otworzyć urządzenia DRM `%s': %s." +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -502,8 +496,8 @@ msgstr "Nie powiodło się pobieranie zasobów DRM" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i nie istnieje, prawidłowymi CRTC są [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i nie istnieje, prawidłowymi CRTC są [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -116,8 +116,8 @@ msgstr "Localização: %.2fº%s,%.2fº%s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "O arranque de %s falhou.\n" +msgid "Initialization of %s failed." +msgstr "O arranque de %s falhou." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -125,13 +125,11 @@ msgstr "O arranque de %s falhou.\n" msgid "Failed to set %s option.\n" msgstr "Falhou a definir %s opção.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Tente `-l %s:help' para mais informação.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Tente `-l %s:help' para mais informação." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -171,11 +169,6 @@ msgstr "A latitude deve estar entre %.1f e %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "A longitude deve estar entre %.1f e %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Incapaz de ler as horas do sistema." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -486,7 +479,7 @@ msgstr "Atribuição fora da secção no ficheiro de configuração." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -496,8 +489,8 @@ msgstr "Falhou a obter recursos do modo DRM" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i não existe, CRTCs válidos são [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i não existe, CRTCs válidos são [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format diff --git a/po/pt_BR.po b/po/pt_BR.po index c5de1c3..f4ef29b 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -127,8 +127,8 @@ msgstr "Localização: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Não foi possível inicializar %s.\n" +msgid "Initialization of %s failed." +msgstr "Não foi possível inicializar %s." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -136,13 +136,11 @@ msgstr "Não foi possível inicializar %s.\n" msgid "Failed to set %s option.\n" msgstr "Não foi possível definir a opção %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Tente `-l %s:help' para maiores informações.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Tente `-l %s:help' para maiores informações." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -182,11 +180,6 @@ msgstr "Latitude deve estar entre %.1f e %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Longitude deve estar entre %.1f e %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Não foi possível determinar a hora do sistema." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Esperando que a localização inicial esteja disponível...\n" @@ -498,7 +491,7 @@ msgstr "Atribuição fora da seção no arquivo de configuração." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -508,8 +501,8 @@ msgstr "Não foi possível obter recursos do modo DRM" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i não existe, CRTCs válidos são [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i não existe, CRTCs válidos são [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format diff --git a/po/redshift.pot b/po/redshift.pot index 092baff..7dacce7 100644 --- a/po/redshift.pot +++ b/po/redshift.pot @@ -112,7 +112,7 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" +msgid "Initialization of %s failed." msgstr "" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 @@ -121,12 +121,10 @@ msgstr "" msgid "Failed to set %s option.\n" msgstr "" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -167,11 +165,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -471,7 +464,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device: `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -481,7 +474,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -115,7 +115,7 @@ msgstr "" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" +msgid "Initialization of %s failed." msgstr "" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 @@ -124,12 +124,10 @@ msgstr "" msgid "Failed to set %s option.\n" msgstr "" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -170,11 +168,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -474,7 +467,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -484,7 +477,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -125,8 +125,8 @@ msgstr "Местоположение: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Ошибка инициализации %s\n" +msgid "Initialization of %s failed." +msgstr "Ошибка инициализации %s" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -134,13 +134,11 @@ msgstr "Ошибка инициализации %s\n" msgid "Failed to set %s option.\n" msgstr "Не удалось установить опцию %s\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Попробуйте `-l %s:help' для получения дополнительной информации.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Попробуйте `-l %s:help' для получения дополнительной информации." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -180,11 +178,6 @@ msgstr "Возможные значения широты: %.1f - %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Долгота должна быть между %.1f и %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Невозможно прочесть системное время." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -490,7 +483,7 @@ msgstr "Некорректное значение за пределами сек #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -500,8 +493,8 @@ msgstr "Не удалось получить ресурсы DRM режима" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i не найден, правильный CRTCs [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i не найден, правильный CRTCs [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -125,8 +125,8 @@ msgstr "Место: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Покретање ставке „%s“ није успело.\n" +msgid "Initialization of %s failed." +msgstr "Покретање ставке „%s“ није успело." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -134,12 +134,10 @@ msgstr "Покретање ставке „%s“ није успело.\n" msgid "Failed to set %s option.\n" msgstr "Нисам успео да подесим опцију %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -180,11 +178,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Не могу да прочитам системско време." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -491,7 +484,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -501,7 +494,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -127,8 +127,8 @@ msgstr "Plats: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Initiering av %s misslyckades.\n" +msgid "Initialization of %s failed." +msgstr "Initiering av %s misslyckades." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -136,13 +136,11 @@ msgstr "Initiering av %s misslyckades.\n" msgid "Failed to set %s option.\n" msgstr "Det gick inte att ställa in flaggan %s.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Försök med ”-l %s:help” för mera information.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Försök med ”-l %s:help” för mera information." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -182,11 +180,6 @@ msgstr "Latitud måste vara mellan %.1f och %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Longitud måste vara mellan %.1f och %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Det går inte att läsa systemets tid." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Vänter på att plats blir tillgängling...\n" @@ -495,7 +488,7 @@ msgstr "Tilldelning utanför avsnitt i konfigurationsfil." #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -505,8 +498,8 @@ msgstr "Det gick inte att få DRM-läges resurser" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i existerar inte, giltiga CRTC är [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i existerar inte, giltiga CRTC är [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format @@ -116,7 +116,7 @@ msgstr "Konum: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" +msgid "Initialization of %s failed." msgstr "" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 @@ -125,12 +125,10 @@ msgstr "" msgid "Failed to set %s option.\n" msgstr "" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" +msgid "Try `-l %s:help' for more information." msgstr "" #: ../src/redshift.c:373 ../src/redshift.c:453 @@ -171,11 +169,6 @@ msgstr "" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "" @@ -475,7 +468,7 @@ msgstr "" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" +msgid "Failed to open DRM device `%s': %s." msgstr "" #: ../src/gamma-drm.c:105 @@ -485,7 +478,7 @@ msgstr "" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." msgstr "" #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 @@ -126,8 +126,8 @@ msgstr "Місце знаходження: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "Ініціалізація %s помилкова.\n" +msgid "Initialization of %s failed." +msgstr "Ініціалізація %s помилкова." #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -135,13 +135,11 @@ msgstr "Ініціалізація %s помилкова.\n" msgid "Failed to set %s option.\n" msgstr "Помилка при ввімкнені %s опції.\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "Спробуйте `-l %s:help' для отримання додаткової інформації.\n" +msgid "Try `-l %s:help' for more information." +msgstr "Спробуйте `-l %s:help' для отримання додаткової інформації." #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -181,11 +179,6 @@ msgstr "Широта повинна бути між %.1f та %.1f.\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "Довгота повинна бути між %.1f та %.1f.\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "Неможливо зчитати системний час." - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "Очікування первинного місця розташування щоб стати доступним...\n" @@ -518,8 +511,9 @@ msgstr "Призначення зовнішнього розділу в конф #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "Не вдалося відкрити DRM-пристрій:% s" +msgid "Failed to open DRM device `%s': %s." +msgstr "Не вдалося відкрити DRM-пристрій '%s': %s" +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -528,8 +522,8 @@ msgstr "Не вдалося отримати ресурси режиму DRM" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i не існує, дійсний CRTCs є [0-%i]." +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i не існує, дійсний CRTCs є [0, %i]." #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 #, c-format diff --git a/po/zh_CN.po b/po/zh_CN.po index f88ce0b..f5e3267 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -116,8 +116,8 @@ msgstr "位置:%.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "%s 初始化进程失败。\n" +msgid "Initialization of %s failed." +msgstr "%s 初始化进程失败。" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -125,13 +125,11 @@ msgstr "%s 初始化进程失败。\n" msgid "Failed to set %s option.\n" msgstr "设置 %s 选项失败。\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "尝试“-l %s:help”来获取更多信息。\n" +msgid "Try `-l %s:help' for more information." +msgstr "尝试“-l %s:help”来获取更多信息。" #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -171,11 +169,6 @@ msgstr "纬度必须介于 %.1f 和 %.1f。\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "经度必须介于 %.1f 和 %.1f。\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "无法读取系统时间。" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "正在等待初始位置可用...\n" @@ -500,8 +493,9 @@ msgstr "分配在段外存在于配置文件中。" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "无法打开 DRM 设备: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "无法打开 DRM 设备 `%s': %s。" +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -510,8 +504,8 @@ msgstr "无法获取 DRM 模式资源" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i 没有退出, 有效的 CRTCs 为 [0-%i]。" +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i 没有退出, 有效的 CRTCs 为 [0, %i]。" # TODO English pluralization of "CRTC" retained #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 diff --git a/po/zh_TW.po b/po/zh_TW.po index f29e34a..c041723 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -118,8 +118,8 @@ msgstr "位置: %.2f %s, %.2f %s\n" #: ../src/redshift.c:325 ../src/redshift.c:416 #, c-format -msgid "Initialization of %s failed.\n" -msgstr "針對 %s 初始化失敗。\n" +msgid "Initialization of %s failed." +msgstr "針對 %s 初始化失敗。" #: ../src/redshift.c:340 ../src/redshift.c:384 ../src/redshift.c:431 #: ../src/redshift.c:463 @@ -127,13 +127,11 @@ msgstr "針對 %s 初始化失敗。\n" msgid "Failed to set %s option.\n" msgstr "設定 %s 選項失敗。\n" -#. TRANSLATORS: `help' must not be -#. translated. #. TRANSLATORS: `help' must not be translated. #: ../src/redshift.c:345 ../src/redshift.c:387 #, c-format -msgid "Try `-l %s:help' for more information.\n" -msgstr "試試 `-l %s:help' 取得更多資訊。\n" +msgid "Try `-l %s:help' for more information." +msgstr "試試 `-l %s:help' 取得更多資訊。" #: ../src/redshift.c:373 ../src/redshift.c:453 #, c-format @@ -173,11 +171,6 @@ msgstr "緯度必須在 %.1f 及 %.1f 之間。\n" msgid "Longitude must be between %.1f and %.1f.\n" msgstr "經度必須在 %.1f 及 %.1f 之間。\n" -#: ../src/redshift.c:545 ../src/redshift.c:564 ../src/redshift.c:696 -#: ../src/redshift.c:1187 -msgid "Unable to read system time." -msgstr "無法讀取系統時間。" - #: ../src/redshift.c:635 msgid "Waiting for initial location to become available...\n" msgstr "等待初始化位置變成可以使用…\n" @@ -503,8 +496,9 @@ msgstr "設置檔案中分配外部段落。" #: ../src/gamma-drm.c:97 #, c-format -msgid "Failed to open DRM device: %s" -msgstr "開啟 DRM 設備失敗: %s" +msgid "Failed to open DRM device `%s': %s." +msgstr "開啟 DRM 設備失敗 `%s':%s。" +# TODO Updated from "Failed to open DRM device: %s.", could be wrong #: ../src/gamma-drm.c:105 #, c-format @@ -513,8 +507,8 @@ msgstr "取得 DRM 模式資源失敗" #: ../src/gamma-drm.c:118 ../src/gamma-randr.c:387 #, c-format -msgid "CRTC %i does not exist, valid CRTCs are [0-%i]." -msgstr "CRTC %i 不存在, 有效的 CRTCs 為 [0-%i]。" +msgid "CRTC %i does not exist, valid CRTCs are [0, %i]." +msgstr "CRTC %i 不存在, 有效的 CRTCs 為 [0, %i]。" # TODO English pluralization of "CRTC" retained #: ../src/gamma-drm.c:121 ../src/gamma-randr.c:390 diff --git a/src/colorramp.c b/src/colorramp.c index d260b2c..5cdf05f 100644 --- a/src/colorramp.c +++ b/src/colorramp.c @@ -1,23 +1,23 @@ /* colorramp.c -- color temperature calculation source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2013, 2014 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2013 Ingo Thies <ithies@astro.uni-bonn.de> [historical, no longer applies] - Copyright (c) 2016, 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2013, 2014 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2013 Ingo Thies <ithies@astro.uni-bonn.de> [historical, no longer applies] + * Copyright (c) 2016, 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" #if defined(__GNUC__) @@ -41,7 +41,7 @@ {\ size_t i;\ double v;\ - brightness /= size;\ + brightness /= (size - 1U);\ if (gamma == 1.0) {\ brightness *= (MAX);\ for (i = 0; i < size; i++)\ diff --git a/src/common.h b/src/common.h index 68fe931..37f56f0 100644 --- a/src/common.h +++ b/src/common.h @@ -1,22 +1,22 @@ /* common.h -- Common header file for Redshift source files - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2009-2017 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2014, 2015, 2016, 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2009-2017 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2014, 2015, 2016, 2025 Mattias Andrée <m@maandree.se> + */ #ifndef REDSHIFT_COMMON_H #define REDSHIFT_COMMON_H @@ -65,8 +65,16 @@ #define _(s) gettext(s) #define N_(s) s +#if defined(__GNUC__) +# define GCC_ONLY(...) __VA_ARGS__ +#else +# define GCC_ONLY(...) +#endif + -/* The color temperature when no adjustment is applied. */ +/** + * The colour temperature corresponding to no effect + */ #define NEUTRAL_TEMP 6500 @@ -238,11 +246,31 @@ LIST_RAMPS_STOP_VALUE_TYPES(X, ;); #undef X -int config_ini_init(struct config_ini_state *state, const char *filepath); +/** + * Load the configuration file + * + * @param state Output parameter for the configurations + * @param path The path to the configuration file, or `NULL` if the + * application should look for it in the default paths + */ +void config_ini_init(struct config_ini_state *state, const char *path); + +/** + * Deallocate the settings loaded + * from the configurations file + * + * @param state The configurations + */ void config_ini_free(struct config_ini_state *state); -#if defined(__GNUC__) -__attribute__((__pure__)) -#endif + +/** + * Get a section from the configuration file + * + * @param state The configurations + * @param name The name of the section + * @return The section; `NULL` if missing + */ +GCC_ONLY(__attribute__((__pure__))) struct config_ini_section *config_ini_get_section(struct config_ini_state *state, const char *name); @@ -259,6 +287,14 @@ void options_set_defaults(struct options *options); void hooks_signal_period_change(enum period prev_period, enum period period); +/** + * Create a pipe(7) where both ends have O_NONBLOCK applied + * + * @param Output parameter for the pipe's file descriptors: + * 0) reading file descriptor, and + * 1) writing file descriptor. + * @return 0 on success, -1 on failure + */ int pipeutils_create_nonblocking(int pipefds[2]); void pipeutils_signal(int write_fd); @@ -271,7 +307,21 @@ extern volatile sig_atomic_t disable; void signals_install_handlers(void); -int systemtime_get_time(double *now); +/** + * Get the current time in seconds since the Unix epoch + * + * @return The current time + */ +double systemtime_get_time(void); + +/** + * Suspend the process for a short time + * + * The process may be resumed earily, specifically + * if it receives a signal + * + * @param msecs The number of milliseconds to sleep + */ void systemtime_msleep(unsigned int msecs); diff --git a/src/config-ini.c b/src/config-ini.c index df7d1a1..db94f22 100644 --- a/src/config-ini.c +++ b/src/config-ini.c @@ -1,257 +1,332 @@ /* config-ini.c -- INI config file parser - This file is part of redshift-ng. + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2010-2018 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandree.se> + */ +#include "common.h" - redshift-ng 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. - redshift-ng 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. +/** + * Specification for a path that consists of a two parts: + * the first being defined by the environment, and the + * seocnd being a static string + */ +struct env_path { + /** + * Whether the environment variable referenced by `.prefix` + * should be split at each colon (:) into multiple paths to + * test + */ + int multidir_env; + + /** + * Environment variable to use as the first part of the path + * + * `NULL` if the user's home directory should be used + * + * The empty string if `.suffix` should be used as is + */ + const char *prefix_env; + + /** + * The second part of the path + */ + const char *suffix; +}; + + +/** + * Paths, in order of priority, to test when looking for + * the configuration file for redshift + */ +static const struct env_path paths[] = { + {0, "XDG_CONFIG_HOME", "/redshift-ng/redshift.conf"}, + {0, "XDG_CONFIG_HOME", "/redshift/redshift.conf"}, + {0, "XDG_CONFIG_HOME", "/redshift.conf"}, +#ifdef WINDOWS + {0, "localappdata", "/redshift-ng/redshift.conf"}, + {0, "localappdata", "/redshift/redshift.conf"}, + {0, "localappdata", "/redshift.conf"}, +#endif + {0, "HOME", "/.config/redshift-ng/redshift.conf"}, + {0, "HOME", "/.config/redshift/redshift.conf"}, + {0, "HOME", "/.config/redshift.conf"}, + {0, "HOME", "/.redshift.conf"}, + {0, NULL, "/.config/redshift-ng/redshift.conf"}, + {0, NULL, "/.config/redshift/redshift.conf"}, + {0, NULL, "/.config/redshift.conf"}, + {0, NULL, "/.redshift.conf"}, + {1, "XDG_CONFIG_DIRS", "/redshift-ng/redshift.conf"}, + {1, "XDG_CONFIG_DIRS", "/redshift/redshift.conf"}, + {1, "XDG_CONFIG_DIRS", "/redshift.conf"}, + {0, "", "/etc/redshift-ng/redshift.conf"}, + {0, "", "/etc/redshift/redshift.conf"}, + {0, "", "/etc/redshift.conf"} +}; + + +/** + * Remove trailing whitespace + * + * @param s The string to trim, will be truncated + * @param end The current end of `s`; will be looked up if `NULL` + * @return `s` + */ +static char * +rtrim(char *s, char *end) +{ + end = end ? end : strchr(s, '\0'); + while (end != s && (end[-1] == ' ' || end[-1] == '\t')) + end--; + *end = '\0'; + return s; +} - You should have received a copy of the GNU General Public License - along with redshift-ng. If not, see <http://www.gnu.org/licenses/>. - Copyright (c) 2010-2018 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2025 Mattias Andrée <m@maandree.se> -*/ -#include "common.h" +/** + * Remove leading whitespace + * + * @param s The string to trim (will not be modified) + * @return An offset of `s` + */ +GCC_ONLY(__attribute__((__warn_unused_result__))) +static char * +ltrim(char *s) +{ + return &s[strspn(s, " \t")]; +} + -#define MAX_CONFIG_PATH 4096 -#define MAX_LINE_LENGTH 512 +/** + * Get the user's home directory + * + * This function looks up the user's home directory + * once and caches the result, later calls to this + * function will use the cached result + * + * @param The user's home directory; the empty string if not found + */ +static const char * +get_home(void) +{ +#ifdef WINDOWS + return NULL; +#else + static const char *home = NULL; + struct passwd *pw; + if (!home) { + pw = getpwuid(getuid()); + if (pw) { + home = pw->pw_dir; + if (home && *home) + return home; + weprintf(_("Cannot determine your home directory, " + "it is from the system's user table.")); + } else if (errno) { + weprintf("getpwuid:"); + } else { + weprintf(_("Cannot determine your home directory, your" + " user ID is missing from the system's user table.")); + /* `errno` can either be set to any number of error codes, + * or be zero if the user does not have a passwd entry */ + } + home = ""; + } + return home; +#endif +} +/** + * Search for a file and open it for reading + * + * @param path_spec Specification for the path to try + * @param path_out Output parameter for the file path + * @return `FILE` object for the reading the file; `NULL` if not found + */ static FILE * -open_config_file(const char *filepath) +try_path(const struct env_path *path_spec, char **path_out) { - FILE *f = NULL; - - /* If a path is not specified (filepath is NULL) then - the configuration file is searched for in the directories - specified by the XDG Base Directory Specification - <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>. - - If HOME is not set, getpwuid() is consulted for the home directory. On - windows platforms the %localappdata% is used in place of XDG_CONFIG_HOME. - */ - - if (filepath == NULL) { - char cp[MAX_CONFIG_PATH]; - char *env; - - if (f == NULL && (env = getenv("XDG_CONFIG_HOME")) != NULL && - env[0] != '\0') { - snprintf(cp, sizeof(cp), "%s/redshift/redshift.conf", env); - f = fopen(cp, "r"); - if (f == NULL) { - /* Fall back to formerly used path. */ - snprintf(cp, sizeof(cp), "%s/redshift.conf", env); - f = fopen(cp, "r"); - } - } + const char *prefix, *p, *q; + char *path; + size_t len; + FILE *f; -#ifdef WINDOWS - if (f == NULL && (env = getenv("localappdata")) != NULL && - env[0] != '\0') { - snprintf(cp, sizeof(cp), "%s\\redshift.conf", env); - f = fopen(cp, "r"); - } + if (!path_spec->prefix_env) + prefix = get_home(); + else if (!*path_spec->prefix_env) + return fopen(path_spec->suffix, "r"); + else + prefix = getenv(path_spec->prefix_env); + if (!prefix || !*prefix) + return NULL; + + path = emalloc(strlen(prefix) + strlen(path_spec->suffix) + 1U); + + if (path_spec->multidir_env) { + for (p = prefix; *p; p = &q[!!*q]) { +#ifdef strchrnul + q = strchrnul(p, ':'); +#else + q = strchr(p, ':'); + q = q ? q : strchr(p, '\0'); #endif - if (f == NULL && (env = getenv("HOME")) != NULL && - env[0] != '\0') { - snprintf(cp, sizeof(cp), "%s/.config/redshift/redshift.conf", env); - f = fopen(cp, "r"); - if (f == NULL) { - /* Fall back to formerly used path. */ - snprintf(cp, sizeof(cp), "%s/.config/redshift.conf", env); - f = fopen(cp, "r"); - } - } -#ifndef WINDOWS - - if (f == NULL) { - struct passwd *pwd = getpwuid(getuid()); - if (pwd != NULL) { - char *home = pwd->pw_dir; - if ((home != NULL) && (*home != '\0')) { - snprintf(cp, sizeof(cp), "%s/.config/redshift/redshift.conf", home); - f = fopen(cp, "r"); - if (!f) { - /* Fall back to formerly used path. */ - snprintf(cp, sizeof(cp), "%s/.config/redshift.conf", home); - f = fopen(cp, "r"); - } - } else { - weprintf(_("Cannot determine your home directory," - " it is from the system's user table.")); - } - } else if (errno) { - weprintf("getpwuid:"); - } else { - weprintf(_("Cannot determine your home directory, your" - " user ID is missing from the system's user table.")); - /* errno can either be set to any number of error codes, - or be zero if the user does not have a passwd entry. */ + len = (size_t)(q - p); + if (!len) + continue; + + memcpy(path, p, len); + stpcpy(&path[len], path_spec->suffix); + f = fopen(path, "r"); + if (f) { + weprintf(_("Found configuration file `%s'.")); + break; + } else if (errno != ENOENT) { + eprintf("fopen %s \"%s\":", path); } } + } else { + stpcpy(stpcpy(path, prefix), path_spec->suffix); + f = fopen(path, "r"); + if (f) + weprintf(_("Found configuration file `%s'.")); + else if (errno != ENOENT) + eprintf("fopen %s \"%s\":", path); + } - if (f == NULL && (env = getenv("XDG_CONFIG_DIRS")) != NULL && *env) { - char *begin = env; - char *end; - int len; - for (;;) { - end = strchr(begin, ':'); - if (end == NULL) end = strchr(begin, '\0'); - - len = (int)(end - begin); - if (len > 0) { - snprintf(cp, sizeof(cp), "%.*s/redshift/redshift.conf", len, begin); - f = fopen(cp, "r"); - if (f == NULL) { - /* Fall back to formerly used path. */ - snprintf(cp, sizeof(cp), "%.*s/redshift.conf", len, begin); - f = fopen(cp, "r"); - } - if (f != NULL) - break; - } - - if (*end) - break; - begin = &end[1]; - } - } + if (f) { + *path_out = path; + } else { + free(path); + *path_out = NULL; + } + return f; +} - if (f == NULL) { - snprintf(cp, sizeof(cp), "%s/redshift.conf", "/etc"); - f = fopen(cp, "r"); - } -#endif + +/** + * Open the configuration file for reading + * + * @param path The path to the configuration file, or `NULL` if the + * application should look for it in the default paths + * @param path_out Output parameter for the configuration file + * @param pathbuf_out Output parameter for the memory allocation for `*path_out`; + * will be set to `NULL` unless `path` is `NULL` + * @return `FILE` object for the reading the file; `NULL` if not + * found and `path` is `NULL` + */ +static FILE * +open_config_file(const char *path, const char **path_out, char **pathbuf_out) +{ + FILE *f = NULL; + size_t i; + + if (!path) { + for (i = 0; !f && i < ELEMSOF(paths); i++) + f = try_path(&paths[i], pathbuf_out); + if (!f) + weprintf(_("No configuration file found.")); + *path_out = *pathbuf_out; } else { - f = fopen(filepath, "r"); - if (f == NULL) { - weprintf("fopen:"); - return NULL; - } + f = fopen(path, "r"); + if (!f) + eprintf("fopen %s \"r\":", path); + *path_out = path; + *pathbuf_out = NULL; } return f; } -int -config_ini_init(struct config_ini_state *state, const char *filepath) + +void +config_ini_init(struct config_ini_state *state, const char *path) { struct config_ini_section *section = NULL; - char line[MAX_LINE_LENGTH]; - char *s; + struct config_ini_setting *setting; + char *line = NULL, *s, *p, *value, *end, *pathbuf; + char *next_line = NULL, *name; + size_t size = 0; + ssize_t len; FILE *f; state->sections = NULL; - f = open_config_file(filepath); - if (f == NULL) { - /* Only a serious error if a file was explicitly requested. */ - return filepath ? 0 : -1; - } + f = open_config_file(path, &path, &pathbuf); + if (!f) + return; + while ((s = next_line) || (len = getline(&line, &size, f)) >= 0) { + if (!s && (s = line, strlen(s) != (size_t)len)) + eprintf(_("Config file contains NUL byte.")); + + s = ltrim(s); + next_line = NULL; + end = &s[strcspn(s, "\r\n")]; + if (*end) { + p = end; + do { + *p++ = '\0'; + } while (*p == '\r' || *p == '\n'); + if (*p) + next_line = p; + } + rtrim(s, end); - for (;;) { - /* Handle the file input linewise. */ - char *r = fgets(line, sizeof(line), f); - if (!r) + switch (*s) { + case ';': /* comment line */ + case '#': /* comment line */ + case '\0': /* blank line */ break; - /* Strip leading blanks and trailing newline. */ - s = line + strspn(line, " \t"); - s[strcspn(s, "\r\n")] = '\0'; - - /* Skip comments and empty lines. */ - if (s[0] == ';' || s[0] == '#' || s[0] == '\0') - continue; - - if (s[0] == '[') { - /* Read name of section. */ - const char *name = &s[1]; - char *end = strchr(s, ']'); - if (end == NULL || end[1] != '\0' || end == name) { - weprintf(_("Malformed section header in config file.")); - fclose(f); - config_ini_free(state); - return -1; - } - + case '[': /* "[%s]", section */ + end = strchr(name = &s[1], ']'); + if (!end || end[1] || end == name) + eprintf(_("Malformed section header in config file.")); *end = '\0'; - - /* Create section. */ section = emalloc(sizeof(*section)); - - /* Insert into section list. */ - section->name = NULL; + section->name = estrdup(name); section->settings = NULL; section->next = state->sections; state->sections = section; + break; - /* Copy section name. */ - section->name = malloc(end - name + 1); - if (section->name == NULL) { - fclose(f); - config_ini_free(state); - return -1; - } - - memcpy(section->name, name, end - name + 1); - } else { - char *value, *end; - size_t value_len; - struct config_ini_setting *setting; - - /* Split assignment at equals character. */ - end = strchr(s, '='); - if (!end || end == s) { - weprintf(_("Malformed assignment in config file.")); - fclose(f); - config_ini_free(state); - return -1; - } - - *end++ = '\0'; - value = end; - - if (!section) { - weprintf(_("Assignment outside section in config file.")); - fclose(f); - config_ini_free(state); - return -1; - } - - /* Create section. */ + default: /* "%s = %s", name, value */ + value = p = strchr(name = s, '='); + if (!value || value == name) + eprintf(_("Malformed assignment in config file.")); + *value++ = '\0'; + if (!section) + eprintf(_("Assignment outside section in config file.")); setting = emalloc(sizeof(*setting)); - - /* Insert into section list. */ - setting->name = NULL; - setting->value = NULL; + setting->name = estrdup(rtrim(name, p)); + setting->value = estrdup(rtrim(ltrim(value), NULL)); setting->next = section->settings; section->settings = setting; - - /* Copy name of setting. */ - setting->name = emalloc(end - s); - - memcpy(setting->name, s, end - s); - - /* Copy setting value. */ - value_len = strlen(value) + 1; - setting->value = emalloc(value_len); - - memcpy(setting->value, value, value_len); + break; } } - + if (ferror(f)) + eprintf("getline %s:", path); + free(pathbuf); + free(line); fclose(f); - - return 0; } + void config_ini_free(struct config_ini_state *state) { @@ -270,6 +345,7 @@ config_ini_free(struct config_ini_state *state) } } + struct config_ini_section * config_ini_get_section(struct config_ini_state *state, const char *name) { diff --git a/src/gamma-coopgamma.c b/src/gamma-coopgamma.c index 61494af..0dd47c5 100644 --- a/src/gamma-coopgamma.c +++ b/src/gamma-coopgamma.c @@ -1,21 +1,21 @@ /* gamma-coopgamma.h -- coopgamma gamma adjustment source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2016, 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2016, 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" #include <libcoopgamma.h> diff --git a/src/gamma-drm.c b/src/gamma-drm.c index 47edd08..877e2a9 100644 --- a/src/gamma-drm.c +++ b/src/gamma-drm.c @@ -1,22 +1,22 @@ /* gamma-drm.c -- DRM gamma adjustment source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2014, 2025 Mattias Andrée <m@maandree.se> - Copyright (c) 2017 Jon Lund Steffensen <jonlst@gmail.com> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2014, 2025 Mattias Andrée <m@maandree.se> + * Copyright (c) 2017 Jon Lund Steffensen <jonlst@gmail.com> + */ #include "common.h" #include <xf86drm.h> @@ -79,9 +79,8 @@ drm_start(struct gamma_state *state, enum program_mode mode) state->fd = open(pathname, O_RDWR | O_CLOEXEC); if (state->fd < 0) { - /* TODO check if access permissions, normally root or - membership of the video group is required. */ - weprintf(_("Failed to open DRM device `%s':"), pathname); + /* TODO check if access permissions, normally root or membership of the video group is required. */ + weprintf(_("Failed to open DRM device `%s': %s."), pathname, strerror(errno)); return -1; } @@ -99,9 +98,9 @@ drm_start(struct gamma_state *state, enum program_mode mode) if (state->crtc_num >= 0) { if (state->crtc_num >= crtc_count) { if (crtc_count > 1) - weprintf(_("CRTC %i does not exist, valid CRTCs are [0-%i].\n"), state->crtc_num, crtc_count-1); + weprintf(_("CRTC %i does not exist, valid CRTCs are [0, %i]."), state->crtc_num, crtc_count-1); else - weprintf(_("CRTC %i does not exist, only CRTC 0 exists.\n"), state->crtc_num); + weprintf(_("CRTC %i does not exist, only CRTC 0 exists."), state->crtc_num); close(state->fd); state->fd = -1; drmModeFreeResources(state->res); diff --git a/src/gamma-dummy.c b/src/gamma-dummy.c index a9aea66..cc494e4 100644 --- a/src/gamma-dummy.c +++ b/src/gamma-dummy.c @@ -1,21 +1,21 @@ /* gamma-dummy.c -- No-op gamma adjustment - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2013-2017 Jon Lund Steffensen <jonlst@gmail.com> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2013-2017 Jon Lund Steffensen <jonlst@gmail.com> + */ #include "common.h" diff --git a/src/gamma-quartz.c b/src/gamma-quartz.c index da6a57c..4645da2 100644 --- a/src/gamma-quartz.c +++ b/src/gamma-quartz.c @@ -1,22 +1,22 @@ /* gamma-quartz.c -- Quartz (OSX) gamma adjustment - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2014-2017 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2014-2017 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" #include <ApplicationServices/ApplicationServices.h> diff --git a/src/gamma-randr.c b/src/gamma-randr.c index fcb02de..1c648a9 100644 --- a/src/gamma-randr.c +++ b/src/gamma-randr.c @@ -1,22 +1,22 @@ /* gamma-randr.c -- X RANDR gamma adjustment source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2010-2017 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2010-2017 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" #include <xcb/xcb.h> @@ -338,7 +338,7 @@ randr_set_temperature_for_crtc(struct gamma_state *state, int crtc_num, if (crtc_num >= state->crtc_count || crtc_num < 0) { if (state->crtc_count > 1) - weprintf(_("CRTC %i does not exist, valid CRTCs are [0-%i]."), crtc_num, state->crtc_count-1); + weprintf(_("CRTC %i does not exist, valid CRTCs are [0, %i]."), crtc_num, state->crtc_count-1); else weprintf(_("CRTC %i does not exist, only CRTC 0 exists."), crtc_num); diff --git a/src/gamma-vidmode.c b/src/gamma-vidmode.c index 25252c6..0876f47 100644 --- a/src/gamma-vidmode.c +++ b/src/gamma-vidmode.c @@ -1,22 +1,22 @@ /* gamma-vidmode.c -- X VidMode gamma adjustment source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2010-2017 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2010-2017 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" #include <X11/Xlib.h> diff --git a/src/gamma-w32gdi.c b/src/gamma-w32gdi.c index 9c5f9ba..ef84744 100644 --- a/src/gamma-w32gdi.c +++ b/src/gamma-w32gdi.c @@ -1,22 +1,22 @@ /* gamma-w32gdi.c -- Windows GDI gamma adjustment source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2010-2017 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2010-2017 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandree.se> + */ #ifndef WINVER # define WINVER 0x0500 #endif diff --git a/src/hooks.c b/src/hooks.c index 2943eeb..4574742 100644 --- a/src/hooks.c +++ b/src/hooks.c @@ -1,21 +1,21 @@ /* hooks.c -- Hooks triggered by events - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2014 Jon Lund Steffensen <jonlst@gmail.com> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2014 Jon Lund Steffensen <jonlst@gmail.com> + */ #include "common.h" #define MAX_HOOK_PATH 4096 diff --git a/src/location-corelocation.m b/src/location-corelocation.m index caf43ce..222abe9 100644 --- a/src/location-corelocation.m +++ b/src/location-corelocation.m @@ -1,22 +1,22 @@ /* location-corelocation.m -- CoreLocation (OSX) location provider source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2014-2017 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2014-2017 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" #import <Foundation/Foundation.h> diff --git a/src/location-geoclue2.c b/src/location-geoclue2.c index c6e0d4c..f5076c5 100644 --- a/src/location-geoclue2.c +++ b/src/location-geoclue2.c @@ -1,22 +1,22 @@ /* location-geoclue2.c -- GeoClue2 location provider source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2014-2017 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2014-2017 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" #include <glib.h> diff --git a/src/location-manual.c b/src/location-manual.c index a720ff5..90f30bd 100644 --- a/src/location-manual.c +++ b/src/location-manual.c @@ -1,22 +1,22 @@ /* location-manual.c -- Manual location provider source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2010-2017 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2010-2017 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" diff --git a/src/options.c b/src/options.c index dfddeda..7629e89 100644 --- a/src/options.c +++ b/src/options.c @@ -1,21 +1,21 @@ /* options.c -- Program options - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2017 Jon Lund Steffensen <jonlst@gmail.com> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2017 Jon Lund Steffensen <jonlst@gmail.com> + */ #include "common.h" #include "solar.h" diff --git a/src/pipeutils.c b/src/pipeutils.c index e6fdf41..7f157c5 100644 --- a/src/pipeutils.c +++ b/src/pipeutils.c @@ -1,27 +1,25 @@ /* pipeutils.c -- Utilities for using pipes as signals - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2017 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2017 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" - -/* Create non-blocking set of pipe fds. */ int pipeutils_create_nonblocking(int pipefds[2]) { @@ -67,6 +65,7 @@ fail: #endif } + /* Signal on write-end of pipe. */ void pipeutils_signal(int write_fd) @@ -74,6 +73,7 @@ pipeutils_signal(int write_fd) write(write_fd, "", 1); } + /* Mark signal as handled on read-end of pipe. */ void pipeutils_handle_signal(int read_fd) diff --git a/src/redshift.c b/src/redshift.c index 70cdf38..ae92c86 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -1,28 +1,28 @@ /* redshift.c -- Main program source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2009-2017 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2025 Mattias Andrée <m@maandre.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2009-2017 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandre.se> + */ #include "common.h" #include "solar.h" /* poll.h is not available on Windows but there is no Windows location provider - using polling. On Windows, we just define some stubs to make things compile. - */ + * using polling. On Windows, we just define some stubs to make things compile. + */ #ifndef WINDOWS # include <poll.h> #else @@ -36,13 +36,13 @@ int poll(struct pollfd *fds, int nfds, int timeout) { abort(); return -1; } #endif /* pause() is not defined on windows platform but is not needed either. - Use a noop macro instead. */ + * Use a noop macro instead. */ #ifdef WINDOWS # define pause() #endif #undef CLAMP -#define CLAMP(lo,mid,up) (((lo) > (mid)) ? (lo) : (((mid) < (up)) ? (mid) : (up))) +#define CLAMP(LO, MID, UP) (((LO) > (MID)) ? (LO) : (((MID) < (UP)) ? (MID) : (UP))) /* Bounds for parameters. */ @@ -191,9 +191,7 @@ interpolate_color_settings(const struct color_setting *first, const struct color double alpha, struct color_setting *result) { int i; - alpha = CLAMP(0.0, alpha, 1.0); - result->temperature = (1.0 - alpha) * first->temperature + alpha * second->temperature; result->brightness = (1.0 - alpha) * first->brightness + alpha * second->brightness; for (i = 0; i < 3; i++) @@ -238,10 +236,12 @@ provider_try_start(const struct location_provider *provider, LOCATION_STATE **st const char *manual_keys[] = {"lat", "lon"}; struct config_ini_section *section; struct config_ini_setting *setting; + char *next_arg, *value; + const char *key; int i; if (provider->init(state) < 0) { - weprintf(_("Initialization of %s failed.\n"), provider->name); + weprintf(_("Initialization of %s failed."), provider->name); return -1; } @@ -250,9 +250,9 @@ provider_try_start(const struct location_provider *provider, LOCATION_STATE **st for (setting = section->settings; setting; setting = setting->next) { if (provider->set_option(*state, setting->name, setting->value) < 0) { provider->free(*state); - weprintf(_("Failed to set %s option.\n"), provider->name); + weprintf(_("Failed to set %s option."), provider->name); /* TRANSLATORS: `help' must not be translated. */ - weprintf(_("Try `-l %s:help' for more information.\n"), provider->name); + weprintf(_("Try `-l %s:help' for more information."), provider->name); return -1; } } @@ -260,10 +260,6 @@ provider_try_start(const struct location_provider *provider, LOCATION_STATE **st /* Set provider options from command line. */ for (i = 0; args; i++) { - char *next_arg; - const char *key; - char *value; - next_arg = strchr(args, ':'); if (next_arg) *next_arg++ = '\0'; @@ -279,7 +275,7 @@ provider_try_start(const struct location_provider *provider, LOCATION_STATE **st key = manual_keys[i]; value = args; } else { - weprintf(_("Failed to parse option `%s'.\n"), args); + weprintf(_("Failed to parse option `%s'."), args); return -1; } } else { @@ -288,9 +284,9 @@ provider_try_start(const struct location_provider *provider, LOCATION_STATE **st if (provider->set_option(*state, key, value) < 0) { provider->free(*state); - weprintf(_("Failed to set %s option.\n"), provider->name); + weprintf(_("Failed to set %s option."), provider->name); /* TRANSLATORS: `help' must not be translated. */ - weprintf(_("Try `-l %s:help' for more information.\n"), provider->name); + weprintf(_("Try `-l %s:help' for more information."), provider->name); return -1; } @@ -313,9 +309,11 @@ method_try_start(const struct gamma_method *method, GAMMA_STATE **state, { struct config_ini_section *section; struct config_ini_setting *setting; + char *next_arg, *value; + const char *key; if (method->init(state) < 0) { - weprintf(_("Initialization of %s failed.\n"), method->name); + weprintf(_("Initialization of %s failed."), method->name); return -1; } @@ -324,37 +322,33 @@ method_try_start(const struct gamma_method *method, GAMMA_STATE **state, for (setting = section->settings; setting; setting = setting->next) { if (method->set_option(*state, setting->name, setting->value) < 0) { method->free(*state); - weprintf(_("Failed to set %s option.\n"), method->name); + weprintf(_("Failed to set %s option."), method->name); /* TRANSLATORS: `help' must not be translated. */ - weprintf(_("Try `-m %s:help' for more information.\n"), method->name); + weprintf(_("Try `-m %s:help' for more information.\n"), method->name); /* TODO \n */ return -1; } } } /* Set method options from command line. */ - while (args != NULL) { - char *next_arg; - const char *key; - char *value; - + while (args) { next_arg = strchr(args, ':'); - if (next_arg != NULL) + if (next_arg) *next_arg++ = '\0'; key = args; value = strchr(args, '='); if (!value) { - weprintf(_("Failed to parse option `%s'.\n"), args); + weprintf(_("Failed to parse option `%s'.\n"), args); /* TODO \n */ return -1; } *value++ = '\0'; if (method->set_option(*state, key, value) < 0) { method->free(*state); - weprintf(_("Failed to set %s option.\n"), method->name); + weprintf(_("Failed to set %s option.\n"), method->name); /* TODO \n */ /* TRANSLATORS: `help' must not be translated. */ - weprintf(_("Try -m %s:help' for more information.\n"), method->name); + weprintf(_("Try -m %s:help' for more information.\n"), method->name); /* TODO missing ` and \n */ return -1; } @@ -364,7 +358,7 @@ method_try_start(const struct gamma_method *method, GAMMA_STATE **state, /* Start method. */ if (method->start(*state, mode) < 0) { method->free(*state); - weprintf(_("Failed to start adjustment method %s.\n"), method->name); + weprintf(_("Failed to start adjustment method %s.\n"), method->name); /* TODO \n */ return -1; } @@ -390,14 +384,14 @@ location_is_valid(const struct location *location) /* Latitude */ if (location->lat < MIN_LAT || location->lat > MAX_LAT) { /* TRANSLATORS: Append degree symbols if possible. */ - weprintf(_("Latitude must be between %.1f and %.1f.\n"), MIN_LAT, MAX_LAT); + weprintf(_("Latitude must be between %.1f and %.1f.\n"), MIN_LAT, MAX_LAT); /* TODO \n */ return 0; } /* Longitude */ if (location->lon < MIN_LON || location->lon > MAX_LON) { /* TRANSLATORS: Append degree symbols if possible. */ - weprintf(_("Longitude must be between %.1f and %.1f.\n"), MIN_LON, MAX_LON); + weprintf(_("Longitude must be between %.1f and %.1f.\n"), MIN_LON, MAX_LON); /* TODO \n */ return 0; } @@ -420,10 +414,7 @@ provider_get_location(const struct location_provider *provider, LOCATION_STATE * if (loc_fd >= 0) { /* Provider is dynamic. */ /* TODO: This should use a monotonic time source. */ - if (systemtime_get_time(&now) < 0) { - weprintf(_("Unable to read system time.\n")); - return -1; - } + now = systemtime_get_time(); /* Poll on file descriptor until ready. */ pollfds[0].fd = loc_fd; @@ -436,10 +427,7 @@ provider_get_location(const struct location_provider *provider, LOCATION_STATE * return 0; } - if (systemtime_get_time(&later) < 0) { - weprintf(_("Unable to read system time.\n")); - return -1; - } + later = systemtime_get_time(); /* Adjust timeout by elapsed time */ if (timeout >= 0) { @@ -471,7 +459,7 @@ ease_fade(double t) This is the main loop of the continual mode which keeps track of the current time and continuously updates the screen to the appropriate color temperature. */ -static int +static void run_continual_mode(const struct location_provider *provider, LOCATION_STATE *location_state, const struct transition_scheme *scheme, @@ -508,18 +496,14 @@ run_continual_mode(const struct location_provider *provider, loc = (struct location){ NAN, NAN }; need_location = !scheme->use_time; if (need_location) { - weprintf(_("Waiting for initial location to become available...\n")); + weprintf(_("Waiting for initial location to become available...\n")); /* TODO \n */ /* Get initial location from provider */ - if (provider_get_location(provider, location_state, -1, &loc) < 0) { - weprintf(_("Unable to get location from provider.\n")); - return -1; - } + if (provider_get_location(provider, location_state, -1, &loc) < 0) + eprintf(_("Unable to get location from provider.")); - if (!location_is_valid(&loc)) { - weprintf(_("Invalid location returned from provider.\n")); - return -1; - } + if (!location_is_valid(&loc)) + eprintf(_("Invalid location returned from provider.\n")); /* TODO \n */ print_location(&loc); } @@ -545,13 +529,10 @@ run_continual_mode(const struct location_provider *provider, /* Check to see if exit signal was caught */ if (exiting) { - if (done) { - /* On second signal stop the ongoing fade. */ - break; - } else { - done = 1; - disabled = 1; - } + if (done) + break; /* On second signal stop the ongoing fade. */ + done = 1; + disabled = 1; exiting = 0; } @@ -562,10 +543,7 @@ run_continual_mode(const struct location_provider *provider, prev_disabled = disabled; /* Read timestamp */ - if (systemtime_get_time(&now) < 0) { - weprintf(_("Unable to read system time.\n")); - return -1; - } + now = systemtime_get_time(); if (scheme->use_time) { int time_offset = get_seconds_since_midnight(now); @@ -629,7 +607,8 @@ run_continual_mode(const struct location_provider *provider, } /* Break loop when done and final fade is over */ - if (done && fade_length == 0) break; + if (done && fade_length == 0) + break; if (verbose) { if (prev_target_interp.temperature != target_interp.temperature) @@ -639,20 +618,15 @@ run_continual_mode(const struct location_provider *provider, } /* Adjust temperature */ - if (method->set_temperature(method_state, &interp, preserve_gamma) < 0) { - weprintf(_("Temperature adjustment failed.\n")); - return -1; - } + if (method->set_temperature(method_state, &interp, preserve_gamma) < 0) + eprintf(_("Temperature adjustment failed.")); /* Save period and target color setting as previous */ prev_period = period; prev_target_interp = target_interp; /* Sleep length depends on whether a fade is ongoing. */ - delay = SLEEP_DURATION; - if (fade_length != 0) { - delay = SLEEP_DURATION_SHORT; - } + delay = fade_length ? SLEEP_DURATION_SHORT : SLEEP_DURATION; /* Update location. */ loc_fd = need_location ? provider->get_fd(location_state) : -1; @@ -670,21 +644,18 @@ run_continual_mode(const struct location_provider *provider, if (errno == EINTR) continue; weprintf("poll:"); - weprintf(_("Unable to get location from provider.\n")); - return -1; + eprintf(_("Unable to get location from provider.")); } else if (r == 0) { continue; } /* Get new location and availability information. */ - if (provider->handle(location_state, &new_loc, &new_available) < 0) { - weprintf(_("Unable to get location from provider.\n")); - return -1; - } + if (provider->handle(location_state, &new_loc, &new_available) < 0) + eprintf(_("Unable to get location from provider.")); if (!new_available && new_available != location_available) { - weprintf(_("Location is temporarily unavailable; Using previous" + weprintf(_("Location is temporarily unavailable; Using previous" /* TODO captial U efter ; and \n*/ " location until it becomes available...\n")); } @@ -698,10 +669,8 @@ run_continual_mode(const struct location_provider *provider, location_available = new_available; - if (!location_is_valid(&loc)) { - weprintf(_("Invalid location returned from provider.\n")); - return -1; - } + if (!location_is_valid(&loc)) + eprintf(_("Invalid location returned from provider.")); } else { systemtime_msleep(delay); } @@ -709,8 +678,6 @@ run_continual_mode(const struct location_provider *provider, /* Restore saved gamma ramps */ method->restore(method_state); - - return 0; } @@ -787,8 +754,7 @@ main(int argc, char *argv[]) options_parse_args(&options, argc, argv, gamma_methods, location_providers); /* Load settings from config file. */ - if (config_ini_init(&config_state, options.config_filepath) < 0) - eprintf(_("Unable to load config file.")); + config_ini_init(&config_state, options.config_filepath); free(options.config_filepath); @@ -962,12 +928,7 @@ main(int argc, char *argv[]) print_location(&loc); } - r = systemtime_get_time(&now); - if (r < 0) { - weprintf(_("Unable to read system time.")); - options.method->free(method_state); - exit(1); - } + now = systemtime_get_time(); if (options.scheme.use_time) { int time_offset = get_seconds_since_midnight(now); @@ -994,82 +955,45 @@ main(int argc, char *argv[]) printf(_("Brightness: %.2f\n"), color.brightness); } - if (options.mode != PROGRAM_MODE_PRINT) { - /* Adjust temperature */ - if (options.method->set_temperature(method_state, &color, options.preserve_gamma) < 0) { - weprintf(_("Temperature adjustment failed.")); - options.method->free(method_state); - exit(EXIT_FAILURE); - } - - /* In Quartz (macOS) the gamma adjustments will - automatically revert when the process exits. - Therefore, we have to loop until CTRL-C is received. - */ - if (!strcmp(options.method->name, "quartz")) { - weprintf(_("Press ctrl-c to stop...")); - pause(); - } - } - break; + if (options.mode == PROGRAM_MODE_PRINT) + break; - case PROGRAM_MODE_MANUAL: - if (options.verbose) - printf(_("Color temperature: %uK\n"), options.temp_set); - - /* Adjust temperature */ - color = scheme->day; - color.temperature = options.temp_set; - r = options.method->set_temperature(method_state, &color, options.preserve_gamma); - if (r < 0) { + apply: + if (options.method->set_temperature(method_state, &color, options.preserve_gamma) < 0) { weprintf(_("Temperature adjustment failed.")); options.method->free(method_state); - exit(EXIT_FAILURE); + exit(1); } - /* In Quartz (OSX) the gamma adjustments will automatically - revert when the process exits. Therefore, we have to loop - until CTRL-C is received. */ + /* In Quartz (OSX) the gamma adjustments will automatically revert when + * the process exits. Therefore, we have to loop until CTRL-C is received. */ if (!strcmp(options.method->name, "quartz")) { weprintf(_("Press ctrl-c to stop...")); pause(); } break; + case PROGRAM_MODE_MANUAL: + if (options.verbose) + printf(_("Color temperature: %uK\n"), options.temp_set); + color = scheme->day; + color.temperature = options.temp_set; + goto apply; + case PROGRAM_MODE_RESET: - /* Reset screen */ color_setting_reset(&color); - - if (options.method->set_temperature(method_state, &color, 0) < 0) { - weprintf(_("Temperature adjustment failed.")); - options.method->free(method_state); - exit(EXIT_FAILURE); - } - - /* In Quartz (OSX) the gamma adjustments will automatically - revert when the process exits. Therefore, we have to loop - until CTRL-C is received. */ - if (!strcmp(options.method->name, "quartz")) { - weprintf(_("Press ctrl-c to stop...")); - pause(); - } - break; + options.preserve_gamma = 0; + goto apply; case PROGRAM_MODE_CONTINUAL: - r = run_continual_mode(options.provider, location_state, scheme, options.method, method_state, - options.use_fade, options.preserve_gamma, options.verbose); - if (r < 0) - exit(EXIT_FAILURE); + run_continual_mode(options.provider, location_state, scheme, options.method, method_state, + options.use_fade, options.preserve_gamma, options.verbose); break; } - /* Clean up gamma adjustment state */ if (options.mode != PROGRAM_MODE_PRINT) options.method->free(method_state); - - /* Clean up location provider state */ if (need_location) options.provider->free(location_state); - - return EXIT_SUCCESS; + return 0; } diff --git a/src/signals.c b/src/signals.c index f0d4966..dec5626 100644 --- a/src/signals.c +++ b/src/signals.c @@ -1,22 +1,22 @@ /* signals.c -- Signal processing source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2009-2015 Jon Lund Steffensen <jonlst@gmail.com> - Copyright (c) 2015, 2025 Mattias Andrée <m@maandree.se> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2009-2015 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2015, 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" diff --git a/src/solar.c b/src/solar.c index f70cdc7..784a293 100644 --- a/src/solar.c +++ b/src/solar.c @@ -1,27 +1,27 @@ /* solar.c -- Solar position source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2010 Jon Lund Steffensen <jonlst@gmail.com> + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2010 Jon Lund Steffensen <jonlst@gmail.com> */ /* Ported from javascript code by U.S. Department of Commerce, - National Oceanic & Atmospheric Administration: - http://www.srrb.noaa.gov/highlights/sunrise/calcdetails.html - It is based on equations from "Astronomical Algorithms" by - Jean Meeus. */ + * National Oceanic & Atmospheric Administration: + * http://www.srrb.noaa.gov/highlights/sunrise/calcdetails.html + * It is based on equations from "Astronomical Algorithms" by + * Jean Meeus. */ #include "common.h" #include "solar.h" @@ -313,7 +313,7 @@ solar_table_fill(double date, double lat, double lon, double *table) /* Calculate solar midnight */ table[SOLAR_TIME_MIDNIGHT] = epoch_from_jd(j_noon + 0.5); - /* Calulate absoute time of other phenomena */ + /* Calulate absolute time of other phenomena */ for (int i = 2; i < SOLAR_TIME_MAX; i++) { double angle = time_angle[i]; double offset = time_of_solar_elevation(t, t_noon, lat, lon, angle); diff --git a/src/solar.h b/src/solar.h index 2dba4d4..39ed9b5 100644 --- a/src/solar.h +++ b/src/solar.h @@ -1,22 +1,21 @@ /* solar.h -- Solar position header - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2010 Jon Lund Steffensen <jonlst@gmail.com> -*/ - + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2010 Jon Lund Steffensen <jonlst@gmail.com> + */ #ifndef REDSHIFT_SOLAR_H #define REDSHIFT_SOLAR_H diff --git a/src/systemtime.c b/src/systemtime.c index ac6d6e3..8ca845c 100644 --- a/src/systemtime.c +++ b/src/systemtime.c @@ -1,58 +1,52 @@ /* systemtime.c -- Portable system time source - This file is part of redshift-ng. - - redshift-ng 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. - - redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. - - Copyright (c) 2010-2014 Jon Lund Steffensen <jonlst@gmail.com> -*/ + * This file is part of redshift-ng. + * + * redshift-ng 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. + * + * redshift-ng 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 redshift-ng. If not, see <http://www.gnu.org/licenses/>. + * + * Copyright (c) 2010-2014 Jon Lund Steffensen <jonlst@gmail.com> + * Copyright (c) 2025 Mattias Andrée <m@maandree.se> + */ #include "common.h" -/* Return current time in T as the number of seconds since the epoch. */ -int -systemtime_get_time(double *t) +double +systemtime_get_time(void) { -#if defined(WINDOWS) /* Windows */ +#if defined(WINDOWS) FILETIME now; ULARGE_INTEGER i; GetSystemTimeAsFileTime(&now); i.LowPart = now.dwLowDateTime; i.HighPart = now.dwHighDateTime; /* FILETIME is tenths of microseconds since 1601-01-01 UTC */ - *t = (i.QuadPart / 10000000.0) - 11644473600.0; + return (i.QuadPart / 10000000.0) - 11644473600.0; -#elif defined(_POSIX_TIMERS) /* POSIX timers */ +#elif defined(_POSIX_TIMERS) struct timespec now; - if (clock_gettime(CLOCK_REALTIME, &now)) { - weprintf("clock_gettime CLOCK_REALTIME:"); - return -1; - } - *t = now.tv_sec + (now.tv_nsec / 1000000000.0); + if (clock_gettime(CLOCK_REALTIME, &now)) + eprintf("clock_gettime CLOCK_REALTIME:"); + return now.tv_sec + (now.tv_nsec / 1000000000.0); -#else /* other platforms */ +#else struct timeval now; - if (gettimeofday(&now, NULL)) { - weprintf("gettimeofday:"); - return -1; - } - *t = now.tv_sec + (now.tv_usec / 1000000.0); + if (gettimeofday(&now, NULL)) + eprintf("gettimeofday:"); + return = now.tv_sec + (now.tv_usec / 1000000.0); #endif - - return 0; } -/* Sleep for a number of milliseconds. */ + void systemtime_msleep(unsigned int msecs) { |