Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

firestring_snprintf(3) [debian man page]

firestring_snprintf(3)					     Library Functions Manual					    firestring_snprintf(3)

NAME
firestring_snprintf - snprintf(3) provided as a replacement so programs can maintain ANSI C compliance SYNOPSIS
#include <firestring.h> -lfirestring long firestring_snprintf(char * out, const size_t size, const char * const format, ...) DESCRIPTION
firestring_snprintf() writes a maximum of size bytes to out based on the formatting rules specified in format and the further arguments provided. As snprintf(3) is not a ANSI C function, firestring_snprintf() is provided as a replacement for programs wishing to maintain ANSI C compli- ance. It acts much like snprintf(3), except that it only uses single-letter format tags, and only supports a subset of the common formats. Formats supported: %s - char * %d - int %l - long %u - unsigned int %y - unsigned long %g - signed long long %o - unsigned long long %f - double %t - time_t (printed in ISO format) %e - struct firestring_estr_t * The %s type handles NULL values by displaying the string "(null)". All numeric types support zero padding through the standard %02d for- mat. RETURN VALUE
Returns the number of bytes written to out not including the trailing nil. AUTHOR
Ian Gulliver <ian@penguinhosting.net> SEE ALSO
libfirestring(3) 2003-05-15 firestring_snprintf(3)

Check Out this Related Man Page

explain_snprintf_or_die(3)				     Library Functions Manual					explain_snprintf_or_die(3)

NAME
explain_snprintf_or_die - formatted output conversion and report errors SYNOPSIS
#include <libexplain/snprintf.h> int explain_snprintf_or_die(char *data, size_t data_size, const char *format); int explain_snprintf_on_error(char *data, size_t data_size, const char *format); DESCRIPTION
The explain_snprintf_or_die function is used to call the snprintf(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_snprintf(3) function, and then the process terminates by calling exit(EXIT_FAILURE). The explain_snprintf_on_error function is used to call the snprintf(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_snprintf(3) function, but still returns to the caller. data The data, exactly as to be passed to the snprintf(3) system call. data_size The data_size, exactly as to be passed to the snprintf(3) system call. format The format, exactly as to be passed to the snprintf(3) system call. RETURN VALUE
The explain_snprintf_or_die function only returns on success, see snprintf(3) for more information. On failure, prints an explanation and exits, it does not return. The explain_snprintf_on_error function always returns the value return by the wrapped snprintf(3) system call. EXAMPLE
The explain_snprintf_or_die function is intended to be used in a fashion similar to the following example: int result = explain_snprintf_or_die(data, data_size, format); SEE ALSO
snprintf(3) formatted output conversion explain_snprintf(3) explain snprintf(3) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2010 Peter Miller explain_snprintf_or_die(3)
Man Page

6 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Convert UTF8 Format file to ANSI format

:) Hi i am trying to convert a file which is in UTF8 format to ANSI format i tried to use the function ICONV but it is throwing error Function i used it as $ iconv -f UTF8 -t ANSI filename Error iam getting is NOT Supported UTF8 to ANSI please some help me out on this.........Let me... (1 Reply)
Discussion started by: rajreddy
1 Replies

2. UNIX for Dummies Questions & Answers

Convert UTF8 Format file to ANSI format

:confused: Hi i am trying to convert a file which is in UTF8 format to ANSI format i tried to use the function ICONV but it is throwing error Function i used it as $ iconv -f UTF8 -t ANSI filename Error iam getting is NOT Supported UTF8 to ANSI please some help me out on... (9 Replies)
Discussion started by: rajreddy
9 Replies

3. Shell Programming and Scripting

Convert file from Unix - ANSI to PC - ANSI

Hi, I am creating a file in Unix using a shell script. The file is getting created in the Unix - ANSI format. My requirement is to convert it to the PC - ANSI format. Can anyone tell me how to do this? Thanks, Sunil (0 Replies)
Discussion started by: ssmallya
0 Replies

4. UNIX for Dummies Questions & Answers

File conversion from Unix to ANSI

1. I have a shell script which creates a file using cat command. How can i find what encoding the file follows (e.g. UTF8, ANSI)? 2. I want to convert that file to PC-ANSI format. How can i achieve that? I tried using the echo $LANG command to find the default encoding. It says parameter not... (2 Replies)
Discussion started by: ssmallya
2 Replies

5. HP-UX

Unix_ANSI to PC-ANSI

I want to convert a file from Unix-ANSI to PC-ANSI format. How can i achieve that? (0 Replies)
Discussion started by: ssmallya
0 Replies

6. Programming

does snprintf guarantee null termination?

Hi All, I was reading the man page of snprintf function and it saids that snprintf adds a null terminator at the end of the string, but I remember once someone told me that snprintf doesn't guarantee the insertion of a null terminator character. What do you think? Does anyone have experience... (4 Replies)
Discussion started by: lagigliaivan
4 Replies