]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nis/nis_print.c
Remove "Contributed by" lines
[thirdparty/glibc.git] / nis / nis_print.c
index 4ad51b23ea433e7e059e8fbd68048f38ba441955..8afe56d671085d9bb884bedb7076cff3236d0445 100644 (file)
@@ -1,48 +1,52 @@
-/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (c) 1997-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   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.
 
    The GNU C 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
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #include <time.h>
 #include <string.h>
+#include <libintl.h>
+#include <stdint.h>
 
 #include <rpcsvc/nis.h>
+#include <shlib-compat.h>
 
 static const char *
 nis_nstype2str (const nstype type)
 {
+
+/* Name service names mustn't be translated, only UNKNOWN needs it */
+
   switch (type)
     {
     case NIS:
-      return N_("NIS");
+      return "NIS";
     case SUNYP:
-      return N_("SUNYP");
+      return "SUNYP";
     case IVY:
-      return N_("IVY");
+      return "IVY";
     case DNS:
-      return N_("DNS");
+      return "DNS";
     case X500:
-      return N_("X500");
+      return "X500";
     case DNANS:
-      return N_("DNANS");
+      return "DNANS";
     case XCHS:
-      return N_("XCHS");
+      return "XCHS";
     case CDS:
-      return N_("CDS");
+      return "CDS";
     default:
       return N_("UNKNOWN");
     }
@@ -83,7 +87,7 @@ print_flags (const unsigned int flags)
     }
   else
     {
-      fputs("TEXTUAL DATA", stdout);
+      fputs ("TEXTUAL DATA", stdout);
       if (flags & TA_SEARCHABLE)
        {
          if (flags & TA_CASE)
@@ -152,6 +156,7 @@ nis_print_rights (const unsigned int access)
     }
   fputs (result, stdout);
 }
+libnsl_hidden_nolink_def (nis_print_rights, GLIBC_2_1)
 
 void
 nis_print_directory (const directory_obj *dir)
@@ -239,6 +244,7 @@ nis_print_directory (const directory_obj *dir)
        }
     }
 }
+libnsl_hidden_nolink_def (nis_print_directory, GLIBC_2_1)
 
 void
 nis_print_group (const group_obj *obj)
@@ -253,6 +259,7 @@ nis_print_group (const group_obj *obj)
   for (i = 0; i < obj->gr_members.gr_members_len; i++)
     printf ("\t%s\n", obj->gr_members.gr_members_val[i]);
 }
+libnsl_hidden_nolink_def (nis_print_group, GLIBC_2_1)
 
 void
 nis_print_table (const table_obj *obj)
@@ -275,6 +282,7 @@ nis_print_table (const table_obj *obj)
       fputc ('\n', stdout);
     }
 }
+libnsl_hidden_nolink_def (nis_print_table, GLIBC_2_1)
 
 void
 nis_print_link (const link_obj *obj)
@@ -282,8 +290,9 @@ nis_print_link (const link_obj *obj)
   fputs (_("Linked Object Type : "), stdout);
   nis_print_objtype (obj->li_rtype);
   printf (_("Linked to : %s\n"), obj->li_name);
-  /* XXX Print the attributs here, if they exists */
+  /* XXX Print the attributes here, if they exists */
 }
+libnsl_hidden_nolink_def (nis_print_link, GLIBC_2_1)
 
 void
 nis_print_entry (const entry_obj *obj)
@@ -307,10 +316,13 @@ nis_print_entry (const entry_obj *obj)
                obj->en_cols.en_cols_val[i].ec_value.ec_value_val);
     }
 }
+libnsl_hidden_nolink_def (nis_print_entry, GLIBC_2_1)
 
 void
 nis_print_object (const nis_object * obj)
 {
+  time_t buf;
+
   printf (_("Object Name   : %s\n"), obj->zo_name);
   printf (_("Directory     : %s\n"), obj->zo_domain);
   printf (_("Owner         : %s\n"), obj->zo_owner);
@@ -319,8 +331,10 @@ nis_print_object (const nis_object * obj)
   nis_print_rights (obj->zo_access);
   printf (_("\nTime to Live  : "));
   print_ttl (obj->zo_ttl);
-  printf (_("Creation Time : %s"), ctime ((time_t *)&obj->zo_oid.ctime));
-  printf (_("Mod. Time     : %s"), ctime ((time_t *)&obj->zo_oid.mtime));
+  buf = obj->zo_oid.ctime;
+  printf (_("Creation Time : %s"), ctime (&buf));
+  buf = obj->zo_oid.mtime;
+  printf (_("Mod. Time     : %s"), ctime (&buf));
   fputs (_("Object Type   : "), stdout);
   nis_print_objtype (obj->zo_data.zo_type);
   switch (obj->zo_data.zo_type)
@@ -348,6 +362,7 @@ nis_print_object (const nis_object * obj)
       break;
     }
 }
+libnsl_hidden_nolink_def (nis_print_object, GLIBC_2_1)
 
 void
 nis_print_result (const nis_result *res)
@@ -363,3 +378,4 @@ nis_print_result (const nis_result *res)
       nis_print_object (&res->objects.objects_val[i]);
     }
 }
+libnsl_hidden_nolink_def (nis_print_result, GLIBC_2_1)