misc/vim: inform the user when no results are found
[nit.git] / c_src / string_nit.c
1 /* This file is part of NIT ( http://www.nitlanguage.org ).
2 *
3 * This file is free software, which comes along with NIT. This software is
4 * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
5 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
6 * PARTICULAR PURPOSE. You can modify it is you want, provided this header
7 * is kept unaltered, and a notification of the changes is added.
8 * You are allowed to redistribute it and sell it, alone or is a part of
9 * another product.
10 */
11
12 #include "string_nit.h"
13
14 // Returns the length of `recv` as a `char*` (excluding the null character)
15 long native_int_length_str(long recv){
16 return snprintf(NULL, 0, "%ld", recv);
17 }
18
19 // Integer to NativeString method
20 void native_int_to_s(long recv, char* str, long buflen){
21 snprintf(str, buflen, "%ld", recv);
22 }