aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--po/ar.po4
-rw-r--r--po/be.po8
-rw-r--r--po/bg.po4
-rw-r--r--po/ca.po8
-rw-r--r--po/cs.po8
-rw-r--r--po/da.po8
-rw-r--r--po/de.po8
-rw-r--r--po/el.po6
-rw-r--r--po/en_GB.po8
-rw-r--r--po/eo.po4
-rw-r--r--po/es.po8
-rw-r--r--po/et.po4
-rw-r--r--po/eu.po8
-rw-r--r--po/fi.po6
-rw-r--r--po/fr.po8
-rw-r--r--po/gl.po6
-rw-r--r--po/he.po4
-rw-r--r--po/hi.po6
-rw-r--r--po/hr.po6
-rw-r--r--po/hu.po8
-rw-r--r--po/it.po8
-rw-r--r--po/ja.po8
-rw-r--r--po/ka.po4
-rw-r--r--po/lt.po8
-rw-r--r--po/nb.po8
-rw-r--r--po/nl.po8
-rw-r--r--po/oc.po4
-rw-r--r--po/pl.po8
-rw-r--r--po/pt.po8
-rw-r--r--po/pt_BR.po8
-rw-r--r--po/redshift.pot4
-rw-r--r--po/ro.po4
-rw-r--r--po/ru.po8
-rw-r--r--po/sr.po8
-rw-r--r--po/sv.po8
-rw-r--r--po/tr.po4
-rw-r--r--po/uk.po8
-rw-r--r--po/zh_CN.po8
-rw-r--r--po/zh_TW.po8
-rw-r--r--src/common.h39
-rw-r--r--src/gamma-coopgamma.c2
-rw-r--r--src/hooks.c2
-rw-r--r--src/options.c72
-rw-r--r--src/redshift.c112
-rw-r--r--src/systemtime.c2
45 files changed, 252 insertions, 239 deletions
diff --git a/po/ar.po b/po/ar.po
index c43701f..868f0b1 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -122,7 +122,7 @@ msgstr ""
#: ../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"
+msgid "Failed to set %s option."
msgstr ""
#. TRANSLATORS: `help' must not be translated.
@@ -133,7 +133,7 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/be.po b/po/be.po
index 386a0d3..e0fb1ab 100644
--- a/po/be.po
+++ b/po/be.po
@@ -131,8 +131,8 @@ 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"
+msgid "Failed to set %s option."
+msgstr "Не атрымалася задаць параметр %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -142,8 +142,8 @@ msgstr "Паспрабуйце `-l %s:help' , каб атрымаць больш
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Не атрымалася разабраць параметр `%s'.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Не атрымалася разабраць параметр `%s'."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/bg.po b/po/bg.po
index 6076672..e53828f 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -122,7 +122,7 @@ msgstr ""
#: ../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"
+msgid "Failed to set %s option."
msgstr ""
#. TRANSLATORS: `help' must not be translated.
@@ -133,7 +133,7 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/ca.po b/po/ca.po
index 2ea778c..0ab97bb 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -134,8 +134,8 @@ msgstr "La inicialització de %s ha fallat."
#: ../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 "No s'ha pogut establir l'opció %s.\n"
+msgid "Failed to set %s option."
+msgstr "No s'ha pogut establir l'opció %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -145,8 +145,8 @@ msgstr "Proveu «-l %s:help» per obtenir més informació."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "No s'ha pogut analitzar l'opció «%s».\n"
+msgid "Failed to parse option `%s'."
+msgstr "No s'ha pogut analitzar l'opció «%s»."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/cs.po b/po/cs.po
index 4c2975a..d9cec21 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -132,8 +132,8 @@ msgstr "Inicializace %s se nezdařila."
#: ../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 "Nezdařilo se nastavit volbu %s.\n"
+msgid "Failed to set %s option."
+msgstr "Nezdařilo se nastavit volbu %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -143,8 +143,8 @@ msgstr "Zkuste `-l %s:help' pro více informací."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Nezdařilo se analyzovat zadání volby %s.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Nezdařilo se analyzovat zadání volby %s."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/da.po b/po/da.po
index 267880d..f246daf 100644
--- a/po/da.po
+++ b/po/da.po
@@ -132,8 +132,8 @@ msgstr "Fejl under klargøring af %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 "Kunne ikke sætte indstilling %s.\n"
+msgid "Failed to set %s option."
+msgstr "Kunne ikke sætte indstilling %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -143,8 +143,8 @@ msgstr "Prøv `-l %s:help' for mere information."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Kunne ikke læse indstilling `%s'.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Kunne ikke læse indstilling `%s'."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/de.po b/po/de.po
index aae0a02..0d1eaab 100644
--- a/po/de.po
+++ b/po/de.po
@@ -132,8 +132,8 @@ msgstr "Starten von %s ist fehlgeschlagen."
#: ../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 "Festlegen der Option %s ist fehlgeschlagen.\n"
+msgid "Failed to set %s option."
+msgstr "Festlegen der Option %s ist fehlgeschlagen."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -143,8 +143,8 @@ msgstr "Bitte »-l %s:help« für weitere Informationen versuchen."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Analysieren von Option »%s« ist fehlgeschlagen.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Analysieren von Option »%s« ist fehlgeschlagen."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/el.po b/po/el.po
index 3f560b6..5c498b7 100644
--- a/po/el.po
+++ b/po/el.po
@@ -122,8 +122,8 @@ 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"
+msgid "Failed to set %s option."
+msgstr "Αποτυχία ορισμού της επιλογής %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -133,7 +133,7 @@ msgstr "Για περισσότερες πληροφορίες, δοκιμάστ
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/en_GB.po b/po/en_GB.po
index 78da6ca..5909e52 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -131,8 +131,8 @@ msgstr "Initialisation of %s failed."
#: ../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 "Failed to set %s option.\n"
+msgid "Failed to set %s option."
+msgstr "Failed to set %s option."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -142,8 +142,8 @@ msgstr "Try `-l %s:help' for more information."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Failed to parse option `%s'."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/eo.po b/po/eo.po
index df67aab..28a3945 100644
--- a/po/eo.po
+++ b/po/eo.po
@@ -123,7 +123,7 @@ msgstr ""
#: ../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"
+msgid "Failed to set %s option."
msgstr ""
#. TRANSLATORS: `help' must not be translated.
@@ -134,7 +134,7 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/es.po b/po/es.po
index d292575..a0dc823 100644
--- a/po/es.po
+++ b/po/es.po
@@ -134,8 +134,8 @@ msgstr "La inicialización de %s ha fallado."
#: ../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 "No se ha podido establecer la opción %s.\n"
+msgid "Failed to set %s option."
+msgstr "No se ha podido establecer la opción %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -145,8 +145,8 @@ msgstr "Pruebe «-l %s:help» para obtener más información."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "No se ha podido analizar la opción «%s».\n"
+msgid "Failed to parse option `%s'."
+msgstr "No se ha podido analizar la opción «%s»."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/et.po b/po/et.po
index ff68625..45d5cb2 100644
--- a/po/et.po
+++ b/po/et.po
@@ -122,7 +122,7 @@ msgstr ""
#: ../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"
+msgid "Failed to set %s option."
msgstr ""
#. TRANSLATORS: `help' must not be translated.
@@ -133,7 +133,7 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/eu.po b/po/eu.po
index 8cbec77..fc7e9fc 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -131,8 +131,8 @@ msgstr "%s abiarazteak huts egin du."
#: ../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 "Ezin izan da %s aukera ezarri.\n"
+msgid "Failed to set %s option."
+msgstr "Ezin izan da %s aukera ezarri."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -142,8 +142,8 @@ msgstr "Idatzi `-l %s:help' informazio gehiagorako."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Ezin izan da `%s' aukera aztertu.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Ezin izan da `%s' aukera aztertu."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/fi.po b/po/fi.po
index e8d2109..5443987 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -123,8 +123,8 @@ msgstr "%s:n käyttöönotto epäonnistui."
#: ../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 "Asetuksen %s asettaminen epäonnistui.\n"
+msgid "Failed to set %s option."
+msgstr "Asetuksen %s asettaminen epäonnistui."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -134,7 +134,7 @@ msgstr "Valitsin '-l %s:help' antaa lisätietoja."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/fr.po b/po/fr.po
index 0495a06..e8a6716 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -133,8 +133,8 @@ msgstr "L'initialisation de %s a échouée."
#: ../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 "Impossible de spécifier l'option %s.\n"
+msgid "Failed to set %s option."
+msgstr "Impossible de spécifier l'option %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -144,8 +144,8 @@ msgstr "Essayez « -l %s:help » pour plus d'informations."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Impossible d'analyser l'option « %s ».\n"
+msgid "Failed to parse option `%s'."
+msgstr "Impossible d'analyser l'option « %s »."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/gl.po b/po/gl.po
index ca94014..dee1254 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -122,8 +122,8 @@ msgstr "A inicialización de %s fallou."
#: ../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 "Produciuse un fallo ao estabelecer a opción %s\n"
+msgid "Failed to set %s option."
+msgstr "Produciuse un fallo ao estabelecer a opción %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -133,7 +133,7 @@ msgstr "Probe `-l %s:help' para máis información."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/he.po b/po/he.po
index 74540d4..05332b7 100644
--- a/po/he.po
+++ b/po/he.po
@@ -124,7 +124,7 @@ msgstr ""
#: ../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"
+msgid "Failed to set %s option."
msgstr ""
#. TRANSLATORS: `help' must not be translated.
@@ -135,7 +135,7 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/hi.po b/po/hi.po
index d564c43..9e8f5bb 100644
--- a/po/hi.po
+++ b/po/hi.po
@@ -122,8 +122,8 @@ 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"
+msgid "Failed to set %s option."
+msgstr "%s विकल्प सेट करने में विफल."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -133,7 +133,7 @@ msgstr "अधिक जानकारी के लिए `-l %s:help'."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/hr.po b/po/hr.po
index a2d0753..1e39747 100644
--- a/po/hr.po
+++ b/po/hr.po
@@ -122,8 +122,8 @@ msgstr "Učitavanje %s nije uspjelo."
#: ../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 "Postavljanje %s opcije nije uspjelo.\n"
+msgid "Failed to set %s option."
+msgstr "Postavljanje %s opcije nije uspjelo."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -133,7 +133,7 @@ msgstr "Upišite `-l %s:help' za pojedinosti."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/hu.po b/po/hu.po
index 75c6947..c8000c8 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -132,8 +132,8 @@ msgstr "%s betöltése sikertelen."
#: ../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 "A %s lehetőség beállítása sikertelen.\n"
+msgid "Failed to set %s option."
+msgstr "A %s lehetőség beállítása sikertelen."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -143,8 +143,8 @@ 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
-msgid "Failed to parse option `%s'.\n"
-msgstr "'%s' lehetőség elemzése sikertelen.\n"
+msgid "Failed to parse option `%s'."
+msgstr "'%s' lehetőség elemzése sikertelen."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/it.po b/po/it.po
index 9842cf5..42b4c48 100644
--- a/po/it.po
+++ b/po/it.po
@@ -134,8 +134,8 @@ msgstr "Inizializzazione di %s non riuscita."
#: ../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 "Impossibile impostare l'opzione %s.\n"
+msgid "Failed to set %s option."
+msgstr "Impossibile impostare l'opzione %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -145,8 +145,8 @@ msgstr "Provare \"-l %s:help\" per maggiori informazioni."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Impossibile analizzare l'opzione \"%s\".\n"
+msgid "Failed to parse option `%s'."
+msgstr "Impossibile analizzare l'opzione \"%s\"."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/ja.po b/po/ja.po
index f03dec1..7cc91ba 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -126,8 +126,8 @@ 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"
+msgid "Failed to set %s option."
+msgstr "%s のオプションの設定に失敗しました。"
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -137,8 +137,8 @@ msgstr "`-l %s:help' で詳細情報が参照できます。"
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "オプション `%s' の解析に失敗しました。\n"
+msgid "Failed to parse option `%s'."
+msgstr "オプション `%s' の解析に失敗しました。"
#: ../src/redshift.c:400
#, c-format
diff --git a/po/ka.po b/po/ka.po
index 82ae8e1..b446265 100644
--- a/po/ka.po
+++ b/po/ka.po
@@ -122,7 +122,7 @@ msgstr ""
#: ../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"
+msgid "Failed to set %s option."
msgstr ""
#. TRANSLATORS: `help' must not be translated.
@@ -133,7 +133,7 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/lt.po b/po/lt.po
index bb40f4f..9101862 100644
--- a/po/lt.po
+++ b/po/lt.po
@@ -130,8 +130,8 @@ msgstr "Nepavyko inicijuoti %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 "Nepavyko nustatyti parametro %s.\n"
+msgid "Failed to set %s option."
+msgstr "Nepavyko nustatyti parametro %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -141,8 +141,8 @@ msgstr "Norėdami gauti daugiau informacijos, mėginkite „-l %s:help“."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Nepavyko išanalizuoti parinkties \"%s\".\n"
+msgid "Failed to parse option `%s'."
+msgstr "Nepavyko išanalizuoti parinkties \"%s\"."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/nb.po b/po/nb.po
index 6598829..87787a6 100644
--- a/po/nb.po
+++ b/po/nb.po
@@ -131,8 +131,8 @@ msgstr "Igangsetting av %s mislyktes."
#: ../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 "Klarte ikke å velge %s.\n"
+msgid "Failed to set %s option."
+msgstr "Klarte ikke å velge %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -142,8 +142,8 @@ msgstr "Prøv «-l %s:help» for mer informasjon."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Klarte ikke å tolke valget «%s».\n"
+msgid "Failed to parse option `%s'."
+msgstr "Klarte ikke å tolke valget «%s»."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/nl.po b/po/nl.po
index 30c478f..8014c1e 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -133,8 +133,8 @@ msgstr "Initialisatie van %s is mislukt."
#: ../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 "Kan optie %s niet instellen.\n"
+msgid "Failed to set %s option."
+msgstr "Kan optie %s niet instellen."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -144,8 +144,8 @@ msgstr "Probeer '-l%s:help' voor meer informatie."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Kon optie '%s' niet lezen.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Kon optie '%s' niet lezen."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/oc.po b/po/oc.po
index 0f0d6ed..a6c87c3 100644
--- a/po/oc.po
+++ b/po/oc.po
@@ -117,7 +117,7 @@ msgstr "L'inicializacion de %s a fracassat."
#: ../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"
+msgid "Failed to set %s option."
msgstr ""
#. TRANSLATORS: `help' must not be translated.
@@ -128,7 +128,7 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/pl.po b/po/pl.po
index a6423da..81138c5 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -130,8 +130,8 @@ msgstr "Inicjalizacja %s nie powiodła się."
#: ../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 "Ustawienie opcji %s nie powiodło się.\n"
+msgid "Failed to set %s option."
+msgstr "Ustawienie opcji %s nie powiodło się."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -141,8 +141,8 @@ msgstr "Spróbuj `-l %s:help' aby uzyskać więcej informacji."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Nieudane parsowanie opcji \"%s\".\n"
+msgid "Failed to parse option `%s'."
+msgstr "Nieudane parsowanie opcji \"%s\"."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/pt.po b/po/pt.po
index c0d039e..3168cf5 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -122,8 +122,8 @@ msgstr "O arranque de %s falhou."
#: ../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 "Falhou a definir %s opção.\n"
+msgid "Failed to set %s option."
+msgstr "Falhou a definir %s opção."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -133,8 +133,8 @@ msgstr "Tente `-l %s:help' para mais informação."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Falhou a analisar a opção '%s'.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Falhou a analisar a opção '%s'."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/pt_BR.po b/po/pt_BR.po
index f4ef29b..f72957b 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -133,8 +133,8 @@ msgstr "Não foi possível inicializar %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 "Não foi possível definir a opção %s.\n"
+msgid "Failed to set %s option."
+msgstr "Não foi possível definir a opção %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -144,8 +144,8 @@ msgstr "Tente `-l %s:help' para maiores informações."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Falha ao analisar opção `%s'.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Falha ao analisar opção `%s'."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/redshift.pot b/po/redshift.pot
index 7dacce7..7b10639 100644
--- a/po/redshift.pot
+++ b/po/redshift.pot
@@ -118,7 +118,7 @@ msgstr ""
#: ../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"
+msgid "Failed to set %s option."
msgstr ""
#. TRANSLATORS: `help' must not be translated.
@@ -129,7 +129,7 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/ro.po b/po/ro.po
index ac52502..8550cba 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -121,7 +121,7 @@ msgstr ""
#: ../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"
+msgid "Failed to set %s option."
msgstr ""
#. TRANSLATORS: `help' must not be translated.
@@ -132,7 +132,7 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/ru.po b/po/ru.po
index 9a7e373..75ab4cb 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -131,8 +131,8 @@ 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"
+msgid "Failed to set %s option."
+msgstr "Не удалось установить опцию %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -142,8 +142,8 @@ msgstr "Попробуйте `-l %s:help' для получения дополн
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Не удалось разобрать опцию `%s'.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Не удалось разобрать опцию `%s'."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/sr.po b/po/sr.po
index 3a4447e..7a4395e 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -131,8 +131,8 @@ 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"
+msgid "Failed to set %s option."
+msgstr "Нисам успео да подесим опцију %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -142,8 +142,8 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Нисам успео да обрадим опцију „%s“.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Нисам успео да обрадим опцију „%s“."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/sv.po b/po/sv.po
index 9e40a26..e8aa30c 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -133,8 +133,8 @@ msgstr "Initiering av %s misslyckades."
#: ../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 "Det gick inte att ställa in flaggan %s.\n"
+msgid "Failed to set %s option."
+msgstr "Det gick inte att ställa in flaggan %s."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -144,8 +144,8 @@ msgstr "Försök med ”-l %s:help” för mera information."
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Det gick inte att tolka flaggan ”%s”.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Det gick inte att tolka flaggan ”%s”."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/tr.po b/po/tr.po
index 0ff4690..5f96732 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -122,7 +122,7 @@ msgstr ""
#: ../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"
+msgid "Failed to set %s option."
msgstr ""
#. TRANSLATORS: `help' must not be translated.
@@ -133,7 +133,7 @@ msgstr ""
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
+msgid "Failed to parse option `%s'."
msgstr ""
#: ../src/redshift.c:400
diff --git a/po/uk.po b/po/uk.po
index e53f2f5..2473f72 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -132,8 +132,8 @@ 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"
+msgid "Failed to set %s option."
+msgstr "Помилка при ввімкнені %s опції."
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -143,8 +143,8 @@ msgstr "Спробуйте `-l %s:help' для отримання додатко
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "Не вдалося проаналізувати параметр `% s '.\n"
+msgid "Failed to parse option `%s'."
+msgstr "Не вдалося проаналізувати параметр `%s'."
#: ../src/redshift.c:400
#, c-format
diff --git a/po/zh_CN.po b/po/zh_CN.po
index f5e3267..d1cb67c 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -122,8 +122,8 @@ 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"
+msgid "Failed to set %s option."
+msgstr "设置 %s 选项失败。"
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -133,8 +133,8 @@ msgstr "尝试“-l %s:help”来获取更多信息。"
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "解析“%s”选项失败。\n"
+msgid "Failed to parse option `%s'."
+msgstr "解析“%s”选项失败。"
#: ../src/redshift.c:400
#, c-format
diff --git a/po/zh_TW.po b/po/zh_TW.po
index c041723..f17069a 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -124,8 +124,8 @@ 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"
+msgid "Failed to set %s option."
+msgstr "設定 %s 選項失敗。"
#. TRANSLATORS: `help' must not be translated.
#: ../src/redshift.c:345 ../src/redshift.c:387
@@ -135,8 +135,8 @@ msgstr "試試 `-l %s:help' 取得更多資訊。"
#: ../src/redshift.c:373 ../src/redshift.c:453
#, c-format
-msgid "Failed to parse option `%s'.\n"
-msgstr "解析 '%s' 選項失敗\n"
+msgid "Failed to parse option `%s'."
+msgstr "解析 '%s' 選項失敗"
#: ../src/redshift.c:400
#, c-format
diff --git a/src/common.h b/src/common.h
index 7baedae..ca9e439 100644
--- a/src/common.h
+++ b/src/common.h
@@ -57,14 +57,30 @@
#include <libred.h>
+
#ifdef ENABLE_NLS
# include <libintl.h>
#else
# define gettext(s) s
#endif
+
+/**
+ * List for translation, and translate in place
+ *
+ * @param s:string-literal Translatable string
+ * @return :const char * Translation of `s`
+ */
#define _(s) gettext(s)
+
+/**
+ * List for translation without translating in place
+ *
+ * @param s:string-literal Translatable string
+ * @return :string-literal `s` as is
+ */
#define N_(s) s
+
#if defined(__GNUC__)
# define GCC_ONLY(...) __VA_ARGS__
#else
@@ -78,9 +94,6 @@
#define NEUTRAL_TEMP 6500
-#define SOLAR_CIVIL_TWILIGHT_ELEV -6.0
-
-
/**
* Truncate a value into a bounded range
*
@@ -234,6 +247,17 @@ struct location_provider {
};
+/**
+ * `NULL` terminated list of adjustment methods
+ */
+extern const struct gamma_method *gamma_methods[];
+
+/**
+ * `NULL` terminated list of location providers
+ */
+extern const struct location_provider *location_providers[];
+
+
#define LIST_RAMPS_STOP_VALUE_TYPES(X, D)\
X(u8, uint8_t, UINT8_MAX, 8) D\
X(u16, uint16_t, UINT16_MAX, 16) D\
@@ -290,12 +314,8 @@ struct config_ini_section *config_ini_get_section(struct config_ini_state *state
void options_init(struct options *options);
-void options_parse_args(struct options *options, int argc, char *argv[],
- const struct gamma_method *gamma_methods,
- const struct location_provider *location_providers);
-void options_parse_config_file(struct options *options, struct config_ini_state *config_state,
- const struct gamma_method *gamma_methods,
- const struct location_provider *location_providers);
+void options_parse_args(struct options *options, int argc, char *argv[]);
+void options_parse_config_file(struct options *options, struct config_ini_state *config_state);
void options_set_defaults(struct options *options);
@@ -326,7 +346,6 @@ extern volatile sig_atomic_t exiting;
*/
extern volatile sig_atomic_t disable;
-
/**
* Install signal handlers for the process
*/
diff --git a/src/gamma-coopgamma.c b/src/gamma-coopgamma.c
index e108e86..db0db4a 100644
--- a/src/gamma-coopgamma.c
+++ b/src/gamma-coopgamma.c
@@ -422,7 +422,7 @@ coopgamma_set_option(struct gamma_state *state, const char *key, const char *val
printf(" %s\n", state->methods[i]);
if (ferror(stdout))
eprintf("printf:");
- exit(EXIT_SUCCESS);
+ exit(0);
}
state->method = estrdup(value);
} else if (!strcasecmp(key, "display")) {
diff --git a/src/hooks.c b/src/hooks.c
index 4574742..a19c60d 100644
--- a/src/hooks.c
+++ b/src/hooks.c
@@ -105,7 +105,7 @@ hooks_signal_period_change(enum period prev_period, enum period period)
weprintf("execl %s:", hook_path);
/* Only reached on error */
- _exit(EXIT_FAILURE);
+ _exit(1);
default:
/* SIGCHLD is ignored */
break;
diff --git a/src/options.c b/src/options.c
index f115fb3..3369fe1 100644
--- a/src/options.c
+++ b/src/options.c
@@ -15,6 +15,7 @@
* 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@maandre.se>
*/
#include "common.h"
@@ -22,7 +23,7 @@
transition period starts and ends (in degress).
Transition during twilight, and while the sun is lower than
3.0 degrees above the horizon. */
-#define TRANSITION_LOW SOLAR_CIVIL_TWILIGHT_ELEV
+#define TRANSITION_LOW LIBRED_SOLAR_ELEVATION_CIVIL_DUSK_DAWN
#define TRANSITION_HIGH 3.0
/* Default values for parameters. */
@@ -130,15 +131,14 @@ parse_transition_range(const char *str, struct time_range *range)
/* Print help text. */
static void
-print_help(const char *program_name)
+print_help(void)
{
/* TRANSLATORS: help output 1
LAT is latitude, LON is longitude,
DAY is temperature at daytime,
NIGHT is temperature at night
no-wrap */
- printf(_("Usage: %s -l LAT:LON -t DAY:NIGHT [OPTIONS...]\n"),
- program_name);
+ printf(_("Usage: %s -l LAT:LON -t DAY:NIGHT [OPTIONS...]\n"), argv0);
fputs("\n", stdout);
/* TRANSLATORS: help output 2
@@ -198,13 +198,13 @@ print_help(const char *program_name)
/* Print list of adjustment methods. */
static void
-print_method_list(const struct gamma_method *gamma_methods)
+print_method_list(void)
{
size_t i;
fputs(_("Available adjustment methods:\n"), stdout);
- for (i = 0; gamma_methods[i].name != NULL; i++)
- printf(" %s\n", gamma_methods[i].name);
+ for (i = 0; gamma_methods[i]; i++)
+ printf(" %s\n", gamma_methods[i]->name);
fputs("\n", stdout);
fputs(_("Specify colon-separated options with `-m METHOD:OPTIONS'.\n"), stdout);
@@ -214,11 +214,11 @@ print_method_list(const struct gamma_method *gamma_methods)
/* Print list of location providers. */
static void
-print_provider_list(const struct location_provider *location_providers)
+print_provider_list(void)
{
fputs(_("Available location providers:\n"), stdout);
- for (int i = 0; location_providers[i].name != NULL; i++) {
- printf(" %s\n", location_providers[i].name);
+ for (int i = 0; location_providers[i]; i++) {
+ printf(" %s\n", location_providers[i]->name);
}
fputs("\n", stdout);
@@ -229,23 +229,23 @@ print_provider_list(const struct location_provider *location_providers)
/* Return the gamma method with the given name. */
static const struct gamma_method *
-find_gamma_method(const struct gamma_method *gamma_methods, const char *name)
+find_gamma_method(const char *name)
{
size_t i;
- for (i = 0; gamma_methods[i].name; i++)
- if (!strcasecmp(name, gamma_methods[i].name))
- return &gamma_methods[i];
+ for (i = 0; gamma_methods[i]; i++)
+ if (!strcasecmp(name, gamma_methods[i]->name))
+ return gamma_methods[i];
return NULL;
}
/* Return location provider with the given name. */
static const struct location_provider *
-find_location_provider(const struct location_provider *location_providers, const char *name)
+find_location_provider(const char *name)
{
size_t i;
- for (i = 0; location_providers[i].name != NULL; i++) {
- if (!strcasecmp(name, location_providers[i].name))
- return &location_providers[i];
+ for (i = 0; location_providers[i]; i++) {
+ if (!strcasecmp(name, location_providers[i]->name))
+ return location_providers[i];
}
return NULL;
}
@@ -294,8 +294,7 @@ options_init(struct options *options)
/* Parse a single option from the command-line. */
static int
-parse_command_line_option(const char option, char *value, struct options *options, const char *program_name,
- const struct gamma_method *gamma_methods, const struct location_provider *location_providers)
+parse_command_line_option(const char option, char *value, struct options *options)
{
const char *provider_name;
char *s, *end;
@@ -324,13 +323,13 @@ parse_command_line_option(const char option, char *value, struct options *option
break;
case 'h':
- print_help(program_name);
+ print_help();
exit(0);
case 'l':
/* Print list of providers if argument is `list' */
if (!strcasecmp(value, "list")) {
- print_provider_list(location_providers);
+ print_provider_list();
exit(0);
}
@@ -356,7 +355,7 @@ parse_command_line_option(const char option, char *value, struct options *option
}
/* Lookup provider from name. */
- options->provider = find_location_provider(location_providers, provider_name);
+ options->provider = find_location_provider(provider_name);
if (!options->provider) {
weprintf(_("Unknown location provider `%s'."), provider_name);
return -1;
@@ -372,7 +371,7 @@ parse_command_line_option(const char option, char *value, struct options *option
case 'm':
/* Print list of methods if argument is `list' */
if (!strcasecmp(value, "list")) {
- print_method_list(gamma_methods);
+ print_method_list();
exit(0);
}
@@ -384,7 +383,7 @@ parse_command_line_option(const char option, char *value, struct options *option
}
/* Find adjustment method by name. */
- options->method = find_gamma_method(gamma_methods, value);
+ options->method = find_gamma_method(value);
if (!options->method) {
/* TRANSLATORS: This refers to the method used to adjust colors e.g. VidMode */
weprintf(_("Unknown adjustment method `%s'."), value);
@@ -437,7 +436,7 @@ parse_command_line_option(const char option, char *value, struct options *option
case 'V':
printf("%s\n", PACKAGE_STRING);
- exit(EXIT_SUCCESS);
+ exit(0);
break;
case 'x':
@@ -454,19 +453,17 @@ parse_command_line_option(const char option, char *value, struct options *option
/* Parse command line arguments. */
void
-options_parse_args(struct options *options, int argc, char *argv[], const struct gamma_method *gamma_methods,
- const struct location_provider *location_providers)
+options_parse_args(struct options *options, int argc, char *argv[])
{
int opt;
while ((opt = getopt(argc, argv, "b:c:g:hl:m:oO:pPrt:vVx")) != -1)
- if (parse_command_line_option(opt, optarg, options, argv0, gamma_methods, location_providers) < 0)
- exit(EXIT_FAILURE);
+ if (parse_command_line_option(opt, optarg, options) < 0)
+ exit(1);
}
/* Parse a single key-value pair from the configuration file. */
static int
-parse_config_file_option(const char *key, const char *value, struct options *options,
- const struct gamma_method *gamma_methods, const struct location_provider *location_providers)
+parse_config_file_option(const char *key, const char *value, struct options *options)
{
if (!strcasecmp(key, "temp-day")) {
if (options->scheme.day.temperature < 0)
@@ -520,7 +517,7 @@ parse_config_file_option(const char *key, const char *value, struct options *opt
options->preserve_gamma = !!atoi(value);
} else if (!strcasecmp(key, "adjustment-method")) {
if (!options->method) {
- options->method = find_gamma_method(gamma_methods, value);
+ options->method = find_gamma_method(value);
if (!options->method) {
weprintf(_("Unknown adjustment method `%s'."), value);
return -1;
@@ -528,7 +525,7 @@ parse_config_file_option(const char *key, const char *value, struct options *opt
}
} else if (!strcasecmp(key, "location-provider")) {
if (!options->provider) {
- options->provider = find_location_provider(location_providers, value);
+ options->provider = find_location_provider(value);
if (!options->provider) {
weprintf(_("Unknown location provider `%s'."), value);
return -1;
@@ -557,8 +554,7 @@ parse_config_file_option(const char *key, const char *value, struct options *opt
/* Parse options defined in the config file. */
void
-options_parse_config_file(struct options *options, struct config_ini_state *config_state,
- const struct gamma_method *gamma_methods, const struct location_provider *location_providers)
+options_parse_config_file(struct options *options, struct config_ini_state *config_state)
{
struct config_ini_section *section;
struct config_ini_setting *setting;
@@ -569,8 +565,8 @@ options_parse_config_file(struct options *options, struct config_ini_state *conf
return;
for (setting = section->settings; setting; setting = setting->next)
- if (parse_config_file_option(setting->name, setting->value, options, gamma_methods, location_providers) < 0)
- exit(EXIT_FAILURE);
+ if (parse_config_file_option(setting->name, setting->value, options) < 0)
+ exit(1);
}
/* Replace unspecified options with default values. */
diff --git a/src/redshift.c b/src/redshift.c
index b149754..836a848 100644
--- a/src/redshift.c
+++ b/src/redshift.c
@@ -54,6 +54,43 @@ int poll(struct pollfd *fds, int nfds, int timeout) { abort(); return -1; }
/* Length of fade in numbers of short sleep durations. */
#define FADE_LENGTH 40
+
+const struct gamma_method *gamma_methods[] = {
+#ifdef ENABLE_COOPGAMMA
+ &coopgamma_gamma_method,
+#endif
+#ifdef ENABLE_DRM
+ &drm_gamma_method,
+#endif
+#ifdef ENABLE_RANDR
+ &randr_gamma_method,
+#endif
+#ifdef ENABLE_VIDMODE
+ &vidmode_gamma_method,
+#endif
+#ifdef ENABLE_QUARTZ
+ &quartz_gamma_method,
+#endif
+#ifdef ENABLE_WINGDI
+ &w32gdi_gamma_method,
+#endif
+ &dummy_gamma_method,
+ NULL
+};
+
+
+const struct location_provider *location_providers[] = {
+#ifdef ENABLE_GEOCLUE2
+ &geoclue2_location_provider,
+#endif
+#ifdef ENABLE_CORELOCATION
+ &corelocation_location_provider,
+#endif
+ &manual_location_provider,
+ NULL
+};
+
+
/* Names of periods of day */
static const char *period_names[] = {
/* TRANSLATORS: Name printed when period of day is unknown */
@@ -200,11 +237,11 @@ interpolate_transition_scheme(const struct transition_scheme *transition, double
static int
color_setting_diff_is_major(const struct color_setting *first, const struct color_setting *second)
{
- return (abs(first->temperature - second->temperature) > 25 ||
- fabs(first->brightness - second->brightness) > 0.1 ||
- fabs(first->gamma[0] - second->gamma[0]) > 0.1 ||
- fabs(first->gamma[1] - second->gamma[1]) > 0.1 ||
- fabs(first->gamma[2] - second->gamma[2]) > 0.1);
+ return abs(first->temperature - second->temperature) > 25 ||
+ fabs(first->brightness - second->brightness) > 0.1 ||
+ fabs(first->gamma[0] - second->gamma[0]) > 0.1 ||
+ fabs(first->gamma[1] - second->gamma[1]) > 0.1 ||
+ fabs(first->gamma[2] - second->gamma[2]) > 0.1;
}
/* Reset color setting to default values. */
@@ -329,14 +366,14 @@ method_try_start(const struct gamma_method *method, GAMMA_STATE **state,
key = args;
value = strchr(args, '=');
if (!value) {
- weprintf(_("Failed to parse option `%s'.\n"), args); /* TODO \n */
+ weprintf(_("Failed to parse option `%s'."), args);
return -1;
}
*value++ = '\0';
if (method->set_option(*state, key, value) < 0) {
method->free(*state);
- weprintf(_("Failed to set %s option.\n"), method->name); /* TODO \n */
+ 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); /* TODO missing ` and \n */
return -1;
@@ -450,12 +487,9 @@ ease_fade(double t)
current time and continuously updates the screen to the appropriate
color temperature. */
static void
-run_continual_mode(const struct location_provider *provider,
- LOCATION_STATE *location_state,
- const struct transition_scheme *scheme,
- const struct gamma_method *method,
- GAMMA_STATE *method_state,
- int use_fade, int preserve_gamma, int verbose)
+run_continual_mode(const struct location_provider *provider, LOCATION_STATE *location_state,
+ const struct transition_scheme *scheme, const struct gamma_method *method,
+ GAMMA_STATE *method_state, int use_fade, int preserve_gamma, int verbose)
{
int done = 0;
int prev_disabled = 1;
@@ -676,42 +710,6 @@ run_continual_mode(const struct location_provider *provider,
int
main(int argc, char *argv[])
{
- /* List of gamma methods. */
- const struct gamma_method gamma_methods[] = {
-#ifdef ENABLE_COOPGAMMA
- coopgamma_gamma_method,
-#endif
-#ifdef ENABLE_DRM
- drm_gamma_method,
-#endif
-#ifdef ENABLE_RANDR
- randr_gamma_method,
-#endif
-#ifdef ENABLE_VIDMODE
- vidmode_gamma_method,
-#endif
-#ifdef ENABLE_QUARTZ
- quartz_gamma_method,
-#endif
-#ifdef ENABLE_WINGDI
- w32gdi_gamma_method,
-#endif
- dummy_gamma_method,
- { NULL }
- };
-
- /* List of location providers. */
- const struct location_provider location_providers[] = {
-#ifdef ENABLE_GEOCLUE2
- geoclue2_location_provider,
-#endif
-#ifdef ENABLE_CORELOCATION
- corelocation_location_provider,
-#endif
- manual_location_provider,
- { NULL }
- };
-
struct options options;
struct config_ini_state config_state;
struct transition_scheme *scheme;
@@ -734,14 +732,14 @@ main(int argc, char *argv[])
#endif
options_init(&options);
- options_parse_args(&options, argc, argv, gamma_methods, location_providers);
+ options_parse_args(&options, argc, argv);
/* Load settings from config file. */
config_ini_init(&config_state, options.config_filepath);
free(options.config_filepath);
- options_parse_config_file(&options, &config_state, gamma_methods, location_providers);
+ options_parse_config_file(&options, &config_state);
options_set_defaults(&options);
@@ -770,11 +768,11 @@ main(int argc, char *argv[])
if (options.provider) {
/* Use provider specified on command line. */
if (provider_try_start(options.provider, &location_state, &config_state, options.provider_args) < 0)
- exit(EXIT_FAILURE);
+ exit(1);
} else {
/* Try all providers, use the first that works. */
- for (i = 0; location_providers[i].name != NULL; i++) {
- const struct location_provider *p = &location_providers[i];
+ for (i = 0; location_providers[i]; i++) {
+ const struct location_provider *p = location_providers[i];
weprintf(_("Trying location provider `%s'..."), p->name);
if (provider_try_start(p, &location_state, &config_state, NULL) < 0) {
weprintf(_("Trying next provider..."));
@@ -865,11 +863,11 @@ main(int argc, char *argv[])
r = method_try_start(options.method, &method_state, options.mode,
&config_state, options.method_args);
if (r < 0)
- exit(EXIT_FAILURE);
+ exit(1);
} else {
/* Try all methods, use the first that works. */
- for (i = 0; gamma_methods[i].name; i++) {
- const struct gamma_method *m = &gamma_methods[i];
+ for (i = 0; gamma_methods[i]; i++) {
+ const struct gamma_method *m = gamma_methods[i];
if (!m->autostart)
continue;
diff --git a/src/systemtime.c b/src/systemtime.c
index 8ca845c..17f516b 100644
--- a/src/systemtime.c
+++ b/src/systemtime.c
@@ -42,7 +42,7 @@ systemtime_get_time(void)
struct timeval now;
if (gettimeofday(&now, NULL))
eprintf("gettimeofday:");
- return = now.tv_sec + (now.tv_usec / 1000000.0);
+ return now.tv_sec + (now.tv_usec / 1000000.0);
#endif
}