From ce97978ff034f85c2fa3979ac08450f0f3ceb12d Mon Sep 17 00:00:00 2001 From: Andrew Nguyen Date: Fri, 20 May 2011 07:43:21 -0500 Subject: [PATCH] hostname: Add an implementation of the hostname display utility. --- configure | 1 + configure.ac | 1 + po/ar.po | 14 +++ po/bg.po | 14 +++ po/ca.po | 14 +++ po/cs.po | 14 +++ po/da.po | 15 +++ po/de.po | 15 +++ po/el.po | 14 +++ po/en.po | 14 +++ po/en_US.po | 16 ++++ po/eo.po | 14 +++ po/es.po | 15 +++ po/fa.po | 14 +++ po/fi.po | 14 +++ po/fr.po | 15 +++ po/he.po | 15 +++ po/hi.po | 14 +++ po/hu.po | 15 +++ po/it.po | 15 +++ po/ja.po | 15 +++ po/ko.po | 15 +++ po/lt.po | 15 +++ po/ml.po | 14 +++ po/nb_NO.po | 15 +++ po/nl.po | 15 +++ po/or.po | 14 +++ po/pa.po | 14 +++ po/pl.po | 15 +++ po/pt_BR.po | 15 +++ po/pt_PT.po | 15 +++ po/rm.po | 14 +++ po/ro.po | 15 +++ po/ru.po | 15 +++ po/sk.po | 14 +++ po/sl.po | 15 +++ po/sr_RS@cyrillic.po | 15 +++ po/sr_RS@latin.po | 15 +++ po/sv.po | 15 +++ po/te.po | 14 +++ po/th.po | 14 +++ po/tr.po | 15 +++ po/uk.po | 15 +++ po/wa.po | 14 +++ po/wine.pot | 14 +++ po/zh_CN.po | 14 +++ po/zh_TW.po | 14 +++ programs/hostname/Makefile.in | 12 +++ programs/hostname/hostname.c | 167 ++++++++++++++++++++++++++++++++++ programs/hostname/hostname.h | 26 ++++++ programs/hostname/hostname.rc | 30 ++++++ 51 files changed, 892 insertions(+) create mode 100644 programs/hostname/Makefile.in create mode 100644 programs/hostname/hostname.c create mode 100644 programs/hostname/hostname.h create mode 100644 programs/hostname/hostname.rc diff --git a/configure b/configure index c42af81cfd5..7bd9dc6c820 100755 --- a/configure +++ b/configure @@ -15578,6 +15578,7 @@ wine_fn_config_program expand enable_expand install wine_fn_config_program explorer enable_explorer install wine_fn_config_program extrac32 enable_extrac32 install wine_fn_config_program hh enable_hh install +wine_fn_config_program hostname enable_hostname po,install wine_fn_config_program icinfo enable_icinfo install wine_fn_config_program iexplore enable_iexplore install wine_fn_config_program ipconfig enable_ipconfig po,install diff --git a/configure.ac b/configure.ac index d68ae2a0a03..bec4579855f 100644 --- a/configure.ac +++ b/configure.ac @@ -2947,6 +2947,7 @@ WINE_CONFIG_PROGRAM(expand,,[install]) WINE_CONFIG_PROGRAM(explorer,,[install]) WINE_CONFIG_PROGRAM(extrac32,,[install]) WINE_CONFIG_PROGRAM(hh,,[install]) +WINE_CONFIG_PROGRAM(hostname,,[po,install]) WINE_CONFIG_PROGRAM(icinfo,,[install]) WINE_CONFIG_PROGRAM(iexplore,,[install]) WINE_CONFIG_PROGRAM(ipconfig,,[po,install]) diff --git a/po/ar.po b/po/ar.po index 46aebaa0f50..437aa3a8880 100644 --- a/po/ar.po +++ b/po/ar.po @@ -8081,6 +8081,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/bg.po b/po/bg.po index 5459b5f179f..64a27f552f7 100644 --- a/po/bg.po +++ b/po/bg.po @@ -8256,6 +8256,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/ca.po b/po/ca.po index d2481dd8538..362bceb6fcf 100644 --- a/po/ca.po +++ b/po/ca.po @@ -8004,6 +8004,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/cs.po b/po/cs.po index b32f6358d3f..3c4a20483e8 100644 --- a/po/cs.po +++ b/po/cs.po @@ -8636,6 +8636,20 @@ msgstr "More? " msgid "The input line is too long.\n" msgstr "The input line is too long.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/da.po b/po/da.po index c6a8f3cfa22..a36be8b0760 100644 --- a/po/da.po +++ b/po/da.po @@ -8659,6 +8659,21 @@ msgstr "Mere? " msgid "The input line is too long.\n" msgstr "The input line is too long.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Fejl: Ugyldigt nøgle navn\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/de.po b/po/de.po index b66b4b912c6..2b6941ce94c 100644 --- a/po/de.po +++ b/po/de.po @@ -8648,6 +8648,21 @@ msgstr "Mehr? " msgid "The input line is too long.\n" msgstr "Die Eingabezeile ist zu lang.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Fehler: Ungültiger Schlüssel\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Gebrauch: ipconfig [ /? | /all ]\n" diff --git a/po/el.po b/po/el.po index a3575e0f405..0391f03cf53 100644 --- a/po/el.po +++ b/po/el.po @@ -8129,6 +8129,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/en.po b/po/en.po index 0e1d1683135..76c7304f3db 100644 --- a/po/en.po +++ b/po/en.po @@ -8305,6 +8305,20 @@ msgstr "More? " msgid "The input line is too long.\n" msgstr "The input line is too long.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "Error: Invalid option '%c'.\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Usage: ipconfig [ /? | /all ]\n" diff --git a/po/en_US.po b/po/en_US.po index 810e679f285..3814188c740 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -8397,6 +8397,22 @@ msgstr "More? " msgid "The input line is too long.\n" msgstr "The input line is too long.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "Usage: hostname\n" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "Error: Invalid option '%c'.\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Usage: ipconfig [ /? | /all ]\n" diff --git a/po/eo.po b/po/eo.po index 81073bc11e0..06a93a5c24c 100644 --- a/po/eo.po +++ b/po/eo.po @@ -8247,6 +8247,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/es.po b/po/es.po index e64d0fcf55e..78296cb0d49 100644 --- a/po/es.po +++ b/po/es.po @@ -8837,6 +8837,21 @@ msgstr "Más? " msgid "The input line is too long.\n" msgstr "La línea de entrada es demasiado larga.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Error: nombre de clave no válido\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/fa.po b/po/fa.po index bc7f91eedd9..c1eaebfdfb2 100644 --- a/po/fa.po +++ b/po/fa.po @@ -8083,6 +8083,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/fi.po b/po/fi.po index 4cad894e60b..54ab0c6360f 100644 --- a/po/fi.po +++ b/po/fi.po @@ -8328,6 +8328,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/fr.po b/po/fr.po index 1463345e1ff..6ac96d9048d 100644 --- a/po/fr.po +++ b/po/fr.po @@ -8478,6 +8478,21 @@ msgstr "Plus ? " msgid "The input line is too long.\n" msgstr "La ligne d'entrée est trop longue.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Erreur : nom de clé invalide\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Usage : ipconfig [ /? | /all ]\n" diff --git a/po/he.po b/po/he.po index ef1eef277f2..f60b59c0a36 100644 --- a/po/he.po +++ b/po/he.po @@ -8497,6 +8497,21 @@ msgstr "More? " msgid "The input line is too long.\n" msgstr "The input line is too long.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Error: Invalid key name\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Usage: ipconfig [ /? | /all ]\n" diff --git a/po/hi.po b/po/hi.po index 6dd12315f4f..d41e3c6ec71 100644 --- a/po/hi.po +++ b/po/hi.po @@ -8001,6 +8001,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/hu.po b/po/hu.po index cbeb2dac1a4..81c6db34f61 100644 --- a/po/hu.po +++ b/po/hu.po @@ -8522,6 +8522,21 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Érvénytelen szintakszis" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/it.po b/po/it.po index 09dca546f72..652bff9faf9 100644 --- a/po/it.po +++ b/po/it.po @@ -8742,6 +8742,21 @@ msgstr "Di più? " msgid "The input line is too long.\n" msgstr "La linea di input è troppo lunga.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Errore: nome della chiave non valido\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Uso: ipconfig [ /? | /all ]\n" diff --git a/po/ja.po b/po/ja.po index cd68ed7a32e..0d7551f1b2b 100644 --- a/po/ja.po +++ b/po/ja.po @@ -8395,6 +8395,21 @@ msgstr "More? " msgid "The input line is too long.\n" msgstr "入力行が長すぎます。\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "エラー: キー名が無効です\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "使い方: ipconfig [ /? | /all ]\n" diff --git a/po/ko.po b/po/ko.po index 8e05f4727d3..56f1616eabc 100644 --- a/po/ko.po +++ b/po/ko.po @@ -8367,6 +8367,21 @@ msgstr " 더? " msgid "The input line is too long.\n" msgstr "이 출력 줄은 너무 깁니다.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "에러: 올바르지 않은 키 이름\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "사용법: ipconfig [ /? | /all ]\n" diff --git a/po/lt.po b/po/lt.po index ae49195b8ea..ec0c5ab9868 100644 --- a/po/lt.po +++ b/po/lt.po @@ -8416,6 +8416,21 @@ msgstr "Daugiau? " msgid "The input line is too long.\n" msgstr "Įvedimo eilutė per ilga.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Klaida: Netinkamas rakto vardas\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Naudojimas: ipconfig [ /? | /all ]\n" diff --git a/po/ml.po b/po/ml.po index 001f36b7ea3..72150a96281 100644 --- a/po/ml.po +++ b/po/ml.po @@ -8001,6 +8001,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/nb_NO.po b/po/nb_NO.po index 3e603909842..2ec27f40486 100644 --- a/po/nb_NO.po +++ b/po/nb_NO.po @@ -8664,6 +8664,21 @@ msgstr "More? " msgid "The input line is too long.\n" msgstr "The input line is too long.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Feil: Ugyldig nøkkelnavn\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/nl.po b/po/nl.po index 2b1ceae7b10..043ac60dd60 100644 --- a/po/nl.po +++ b/po/nl.po @@ -8550,6 +8550,21 @@ msgstr "Meer? " msgid "The input line is too long.\n" msgstr "De invoerregel is te lang.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Fout: Foutieve sleutelnaam\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Gebruik: ipconfig [ /? | /all ]\n" diff --git a/po/or.po b/po/or.po index 3f2c160e25d..d5f275e49f6 100644 --- a/po/or.po +++ b/po/or.po @@ -8001,6 +8001,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/pa.po b/po/pa.po index d6830f24f82..4ad780ea6e5 100644 --- a/po/pa.po +++ b/po/pa.po @@ -8001,6 +8001,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/pl.po b/po/pl.po index 7c4f66edf06..2a562b433a5 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8414,6 +8414,21 @@ msgstr "Więcej? " msgid "The input line is too long.\n" msgstr "Wpisany tekst jest zbyt długi.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Błąd: Niewłaściwa nazwa klucza\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Sposób użycia: ipconfig [ /? | /all ]\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index ef9eb49dafc..a3d08f354b5 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -8689,6 +8689,21 @@ msgstr "Mais? " msgid "The input line is too long.\n" msgstr "A linha de entrada é muito longa.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Erro: Nome de chave inválido\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/pt_PT.po b/po/pt_PT.po index 957ca1e0819..804e4fbc335 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -8742,6 +8742,21 @@ msgstr "More? " msgid "The input line is too long.\n" msgstr "The input line is too long.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Erro: Nome de chave inválido\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/rm.po b/po/rm.po index 576eb3e64f1..c3692657c2e 100644 --- a/po/rm.po +++ b/po/rm.po @@ -8051,6 +8051,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/ro.po b/po/ro.po index efe2febe37a..664e164d6ba 100644 --- a/po/ro.po +++ b/po/ro.po @@ -8975,6 +8975,21 @@ msgstr "Mai mult? " msgid "The input line is too long.\n" msgstr "Șirul introdus este prea lung.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Eroare: Nume de cheie nevalid\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/ru.po b/po/ru.po index dc9956dcc5c..f26dca6644c 100644 --- a/po/ru.po +++ b/po/ru.po @@ -8411,6 +8411,21 @@ msgstr "Ещё? " msgid "The input line is too long.\n" msgstr "Введённая команда слишком длинная.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Ошибка: неправильное имя раздела\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Использование: ipconfig [ /? | /all ]\n" diff --git a/po/sk.po b/po/sk.po index 6f145fb14c5..9aeccd665ba 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8283,6 +8283,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/sl.po b/po/sl.po index b1158e44486..37c9b2564b1 100644 --- a/po/sl.po +++ b/po/sl.po @@ -8444,6 +8444,21 @@ msgstr "Več? " msgid "The input line is too long.\n" msgstr "Vrstica vhoda je predolga.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Napaka: Neveljavno ime ključa\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Uporaba: ipconfig [ /? | /all ]\n" diff --git a/po/sr_RS@cyrillic.po b/po/sr_RS@cyrillic.po index 62d11277a89..9863d8c9d80 100644 --- a/po/sr_RS@cyrillic.po +++ b/po/sr_RS@cyrillic.po @@ -8389,6 +8389,21 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Неисправна синтакса" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Употреба: ipconfig [ /? | /all ]\n" diff --git a/po/sr_RS@latin.po b/po/sr_RS@latin.po index 6b9864716a3..511314e7f2d 100644 --- a/po/sr_RS@latin.po +++ b/po/sr_RS@latin.po @@ -8443,6 +8443,21 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Neispravna sintaksa" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Upotreba: ipconfig [ /? | /all ]\n" diff --git a/po/sv.po b/po/sv.po index 66fdc6feb4f..3bc3d570335 100644 --- a/po/sv.po +++ b/po/sv.po @@ -8412,6 +8412,21 @@ msgstr "Mer? " msgid "The input line is too long.\n" msgstr "Inmatningen är för lång.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Fel: ogiltigt nyckelnamn\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Användning: ipconfig [ /? | /all ]\n" diff --git a/po/te.po b/po/te.po index 66178ad0327..75776fe6364 100644 --- a/po/te.po +++ b/po/te.po @@ -8001,6 +8001,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/th.po b/po/th.po index f46cc3d65e8..63a10f27daa 100644 --- a/po/th.po +++ b/po/th.po @@ -8137,6 +8137,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/tr.po b/po/tr.po index cbfea2d5609..c9e407ecf53 100644 --- a/po/tr.po +++ b/po/tr.po @@ -8783,6 +8783,21 @@ msgstr "More? " msgid "The input line is too long.\n" msgstr "The input line is too long.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Geçersiz Sözdizimi" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/uk.po b/po/uk.po index 05f96dfd5db..bc9e0a265cc 100644 --- a/po/uk.po +++ b/po/uk.po @@ -8421,6 +8421,21 @@ msgstr "Більше? " msgid "The input line is too long.\n" msgstr "Введений рядок задовгий.\n" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +#, fuzzy +msgid "Error: Invalid option '%c'.\n" +msgstr "Помилка: неправильне ім'я ключа\n" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "Використання: ipconfig [ /? | /all ]\n" diff --git a/po/wa.po b/po/wa.po index 6c95b149b22..57387a0e786 100644 --- a/po/wa.po +++ b/po/wa.po @@ -8099,6 +8099,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/wine.pot b/po/wine.pot index d60a89d88ba..2a5f71ad12f 100644 --- a/po/wine.pot +++ b/po/wine.pot @@ -7977,6 +7977,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/zh_CN.po b/po/zh_CN.po index 812bc50564a..e8afba0dd3d 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -8376,6 +8376,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/po/zh_TW.po b/po/zh_TW.po index 593b8d20a47..bc9b8640a57 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -8431,6 +8431,20 @@ msgstr "" msgid "The input line is too long.\n" msgstr "" +#: hostname.rc:27 +msgid "Usage: hostname\n" +msgstr "" + +#: hostname.rc:28 +msgid "Error: Invalid option '%c'.\n" +msgstr "" + +#: hostname.rc:29 +msgid "" +"Error: Setting the system hostname is not possible with the hostname " +"utility.\n" +msgstr "" + #: ipconfig.rc:27 msgid "Usage: ipconfig [ /? | /all ]\n" msgstr "" diff --git a/programs/hostname/Makefile.in b/programs/hostname/Makefile.in new file mode 100644 index 00000000000..0431b9b3e32 --- /dev/null +++ b/programs/hostname/Makefile.in @@ -0,0 +1,12 @@ +EXTRADEFS = -DWINE_NO_UNICODE_MACROS +MODULE = hostname.exe +APPMODE = -mconsole -municode +EXTRALIBS = @SOCKETLIBS@ +DELAYIMPORTS = user32 + +C_SRCS = hostname.c + +RC_SRCS = hostname.rc +PO_SRCS = hostname.rc + +@MAKE_PROG_RULES@ diff --git a/programs/hostname/hostname.c b/programs/hostname/hostname.c new file mode 100644 index 00000000000..75095df7e39 --- /dev/null +++ b/programs/hostname/hostname.c @@ -0,0 +1,167 @@ +/* + * Hostname display utility + * + * Copyright 2008 Andrew Riedi + * Copyright 2010-2011 Andrew Nguyen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include +#if defined(__MINGW32__) || defined (_MSC_VER) +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif + +#include +#include +#include +#include +#include + +#include + +#include "hostname.h" + +static int hostname_vprintfW(const WCHAR *msg, va_list va_args) +{ + int wlen; + DWORD count, ret; + WCHAR msg_buffer[8192]; + + wlen = vsprintfW(msg_buffer, msg, va_args); + + ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), msg_buffer, wlen, &count, NULL); + if (!ret) + { + DWORD len; + char *msgA; + + len = WideCharToMultiByte(GetConsoleOutputCP(), 0, msg_buffer, wlen, + NULL, 0, NULL, NULL); + msgA = HeapAlloc(GetProcessHeap(), 0, len); + if (!msgA) + return 0; + + WideCharToMultiByte(GetConsoleOutputCP(), 0, msg_buffer, wlen, msgA, len, + NULL, NULL); + WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE); + HeapFree(GetProcessHeap(), 0, msgA); + } + + return count; +} + +static int hostname_printfW(const WCHAR *msg, ...) +{ + va_list va_args; + int len; + + va_start(va_args, msg); + len = hostname_vprintfW(msg, va_args); + va_end(va_args); + + return len; +} + +static int hostname_message_printfW(int msg, ...) +{ + va_list va_args; + WCHAR msg_buffer[8192]; + int len; + + LoadStringW(GetModuleHandleW(NULL), msg, msg_buffer, + sizeof(msg_buffer)/sizeof(WCHAR)); + + va_start(va_args, msg); + len = hostname_vprintfW(msg_buffer, va_args); + va_end(va_args); + + return len; +} + +static int hostname_message(int msg) +{ + static const WCHAR formatW[] = {'%','s',0}; + WCHAR msg_buffer[8192]; + + LoadStringW(GetModuleHandleW(NULL), msg, msg_buffer, + sizeof(msg_buffer)/sizeof(WCHAR)); + + return hostname_printfW(formatW, msg_buffer); +} + +void display_computer_name(void) +{ + static const WCHAR fmtW[] = {'%','s','\n',0}; + + char nameA[256]; + WCHAR nameW[256]; + + gethostname(nameA, sizeof(nameA)); + MultiByteToWideChar(CP_UNIXCP, 0, nameA, sizeof(nameA), nameW, sizeof(nameW)/sizeof(WCHAR)); + + hostname_printfW(fmtW, nameW); +} + +int wmain(int argc, WCHAR *argv[]) +{ + if (argc > 1) + { + static const WCHAR slashHelpW[] = {'/','?',0}; + + unsigned int i; + + if (!strncmpW(argv[1], slashHelpW, sizeof(slashHelpW)/sizeof(WCHAR) - 1)) + { + hostname_message(STRING_USAGE); + return 1; + } + + for (i = 1; i < argc; i++) + { + if (argv[i][0] == '-') + { + switch (argv[i][1]) + { + case 's': + /* Ignore the option and continue processing. */ + break; + case '?': + hostname_message(STRING_USAGE); + return 1; + default: + hostname_message_printfW(STRING_INVALID_OPTION, argv[i][1]); + hostname_message(STRING_USAGE); + return 1; + } + } + else + { + hostname_message(STRING_CANNOT_SET_HOSTNAME); + hostname_message(STRING_USAGE); + return 1; + } + } + } + + display_computer_name(); + + return 0; +} diff --git a/programs/hostname/hostname.h b/programs/hostname/hostname.h new file mode 100644 index 00000000000..8d5fcfc00c1 --- /dev/null +++ b/programs/hostname/hostname.h @@ -0,0 +1,26 @@ +/* + * Private definitions for the hostname display utility + * + * Copyright 2011 Andrew Nguyen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +/* Translation IDs. */ +#define STRING_USAGE 101 +#define STRING_INVALID_OPTION 102 +#define STRING_CANNOT_SET_HOSTNAME 103 diff --git a/programs/hostname/hostname.rc b/programs/hostname/hostname.rc new file mode 100644 index 00000000000..eddb902391f --- /dev/null +++ b/programs/hostname/hostname.rc @@ -0,0 +1,30 @@ +/* + * Hostname display utility + * + * Copyright 2011 Andrew Nguyen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "hostname.h" + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +STRINGTABLE +{ + STRING_USAGE, "Usage: hostname\n" + STRING_INVALID_OPTION, "Error: Invalid option '%c'.\n" + STRING_CANNOT_SET_HOSTNAME, "Error: Setting the system hostname is not possible with the hostname utility.\n" +}