1*99410184Ssalo.\" $NetBSD: catgets.3,v 1.16 2003/07/26 19:24:49 salo Exp $ 27ce7ea94Scgd.\" 3*99410184Ssalo.\" Written by J.T. Conklin <jtc@NetBSD.org>. 49ae90685Sjtc.\" Public domain. 5555ef6b0Sjtc.\" 64cc7cdbcSwiz.Dd February 12, 2003 7555ef6b0Sjtc.Dt CATGETS 3 8555ef6b0Sjtc.Os 9555ef6b0Sjtc.Sh NAME 10555ef6b0Sjtc.Nm catgets 11555ef6b0Sjtc.Nd retrieve string from message catalog 12312aca53Sperry.Sh LIBRARY 13312aca53Sperry.Lb libc 14555ef6b0Sjtc.Sh SYNOPSIS 15472351e1Swiz.In nl_types.h 16be0eb1dfSjtc.Ft char * 171fc029a4Skleink.Fn catgets "nl_catd catd" "int set_id" "int msg_id" "const char *s" 18555ef6b0Sjtc.Sh DESCRIPTION 19555ef6b0SjtcThe 20555ef6b0Sjtc.Fn catgets 21555ef6b0Sjtcfunction attempts to retrieve message 22555ef6b0Sjtc.Fa msg_id 23555ef6b0Sjtcof set 24555ef6b0Sjtc.Fa set_id 25555ef6b0Sjtcfrom the message catalog referenced by the descriptor 26555ef6b0Sjtc.Fa catd . 27555ef6b0SjtcThe argument 28555ef6b0Sjtc.Fa s 29555ef6b0Sjtcpoints to a default message which is returned if the function 30555ef6b0Sjtcis unable to retrieve the specified message. 315f0cf559Swiz.Sh RETURN VALUES 32555ef6b0SjtcIf the specified message was retrieved successfully, 33555ef6b0Sjtc.Fn catgets 34555ef6b0Sjtcreturns a pointer to an internal buffer containing the message string; 35555ef6b0Sjtcotherwise it returns 36555ef6b0Sjtc.Fa s . 37f0be96e5Skleink.Sh ERRORS 38f0be96e5SkleinkThe 39f0be96e5Skleink.Fn catgets 40f0be96e5Skleinkfunction will fail if: 41f0be96e5Skleink.Bl -tag -width Er 42f0be96e5Skleink.It Bq Er EBADF 43f0be96e5SkleinkThe 44f0be96e5Skleink.Fa catd 45f0be96e5Skleinkargument is not a valid message catalog descriptor open for reading. 46f0be96e5Skleink.It Bq Er EINTR 47f0be96e5SkleinkThe operation was interrupted by a signal. 48f0be96e5Skleink.It Bq Er ENOMSG 49f0be96e5SkleinkThe message identified by 50f0be96e5Skleink.Fa set_id 51f0be96e5Skleinkand 52f0be96e5Skleink.Fa msg_id 53f0be96e5Skleinkis not in the message catalog. 54f0be96e5Skleink.El 55555ef6b0Sjtc.Sh SEE ALSO 560d72c029Sgmcgarry.Xr gencat 1 , 57555ef6b0Sjtc.Xr catclose 3 , 581b19306fSgmcgarry.Xr catopen 3 , 591b19306fSgmcgarry.Xr nls 7 606dca6010Sjtc.Sh STANDARDS 616dca6010SjtcThe 626dca6010Sjtc.Fn catgets 636dca6010Sjtcfunction conforms to 64f0be96e5Skleink.St -xpg4.2 . 651b19306fSgmcgarry.Pp 661b19306fSgmcgarryMajor Unix vendors are split over the adoption of the two most 671b19306fSgmcgarryimportant message catalog specifications: catgets or 681b19306fSgmcgarry.Xr gettext 3 . 691b19306fSgmcgarryThe primary concern with the catgets interface is that every 701b19306fSgmcgarrytranslatable string has to define a number (or a symbolic constant) 714cc7cdbcSwizwhich must correspond to the message in the catalog. 724cc7cdbcSwizDuplicate message IDs are not allowed. 734cc7cdbcSwizConstructing message catalogs is difficult. 74