.\" -*- coding: UTF-8 -*- '\" t .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH asprintf 3 "21 мая 2025 г." "Справочные страницы Linux 6.15" .SH НАИМЕНОВАНИЕ asprintf, vasprintf \- выводит данные в строку, выделенную в памяти .SH БИБЛИОТЕКА Стандартная библиотека языка C (\fIlibc\fP,\ \fI\-lc\fP) .SH ОБЗОР .nf \fB#define _GNU_SOURCE\fP /* см. feature_test_macros(7) */ \fB#include \fP .P \fBint asprintf(char **restrict \fP\fIstrp\fP\fB, const char *restrict \fP\fIfmt\fP\fB, ...);\fP \fBint vasprintf(char **restrict \fP\fIstrp\fP\fB, const char *restrict \fP\fIfmt\fP\fB,\fP \fB va_list \fP\fIap\fP\fB);\fP .fi .SH ОПИСАНИЕ The functions \fBasprintf\fP() and \fBvasprintf\fP() are analogs of \fBsprintf\fP(3) and \fBvsprintf\fP(3), except that they allocate a string large enough to hold the output including the terminating null byte (\[aq]\[rs]0\[aq]), and return a pointer to it via the first argument. This pointer should be passed to \fBfree\fP(3) to release the allocated storage when it is no longer needed. .SH "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ" When successful, these functions return the number of bytes printed, just like \fBsprintf\fP(3). On error, \-1 is returned, \fIerrno\fP is set to indicate the error, and the contents of \fIstrp\fP are undefined. .SH ОШИБКИ See \fBsprintf\fP(3) and \fBmalloc\fP(3). .SH АТРИБУТЫ Описание терминов данного раздела смотрите в \fBattributes\fP(7). .TS allbox; lbx lb lb l l l. Интерфейс Атрибут Значение T{ .na .nh \fBasprintf\fP(), \fBvasprintf\fP() T} Безвредность в нитях MT\-Safe locale .TE .SH ВЕРСИИ The FreeBSD implementation sets \fIstrp\fP to NULL on error. .SH СТАНДАРТЫ GNU, BSD. .SH "СМОТРИТЕ ТАКЖЕ" \fBfree\fP(3), \fBmalloc\fP(3), \fBprintf\fP(3) .PP .SH ПЕРЕВОД Русский перевод этой страницы руководства разработал(и) Dmitry Bolkhovskikh , Yuri Kozlov и Kirill Rekhov . .PP Этот перевод является свободной программной документацией; он распространяется на условиях общедоступной лицензии GNU (GNU General Public License - GPL, .UR https://www.gnu.org/licenses/gpl-3.0.html .UE версии 3 или более поздней) в отношении авторского права, но БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ. .PP Если вы обнаружите какие-либо ошибки в переводе этой страницы руководства, пожалуйста, сообщите об этом разработчику(ам) по его(их) адресу(ам) электронной почты или по адресу .MT списка рассылки русских переводчиков .ME .