GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71785
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
snprintf.c File Reference

GIS Library - snprintf() clone functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <assert.h>
#include <grass/gis.h>
Include dependency graph for snprintf.c:

Go to the source code of this file.

Functions

int G_snprintf (char *str, size_t size, const char *fmt,...)
 snprintf() clone. More...
 

Detailed Description

GIS Library - snprintf() clone functions.

Todo:
if needed, implement alternative versions for portability. potential code source:

(C) 2001-2014 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Markus Neteler
Date
2006-2008

Definition in file snprintf.c.

Function Documentation

int G_snprintf ( char *  str,
size_t  size,
const char *  fmt,
  ... 
)

snprintf() clone.

Note: The use of snprintf()/G_snprintf() is discouraged in favour of calculating how long the string will be and allocating enough memory!

Parameters
[in]strinput string
[in]sizelength of string
[in]fmt
Returns
numer of chars written

Definition at line 43 of file snprintf.c.

References count.

Referenced by clean_dir(), G_color_rules_descriptions(), G_has_vector_timestamp(), G_read_vector_timestamp(), G_remove_vector_timestamp(), G_write_vector_timestamp(), I_location_info(), M_do_remove(), tgis_get_default_database_name(), and tgis_set_default_connection().