misc/vim: inform the user when no results are found
[nit.git] / c_src / string_nit.c
index 747df8c..686d6be 100644 (file)
@@ -1,7 +1,5 @@
 /* This file is part of NIT ( http://www.nitlanguage.org ).
  *
- * Copyright 2012 Alexis Laferrière <alexis.laf@xymus.net>
- *
  * This file is free software, which comes along with NIT.  This software is
  * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  * without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A
  */
 
 #include "string_nit.h"
+
+// Returns the length of `recv` as a `char*` (excluding the null character)
+long native_int_length_str(long recv){
+       return snprintf(NULL, 0, "%ld", recv);
+}
+
+// Integer to NativeString method
+void native_int_to_s(long recv, char* str, long buflen){
+       snprintf(str, buflen, "%ld", recv);
+}