/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
3 by Gustav Hartvigsson
Fixed a few things...
1
#include "SimpleTypeSystem.h"
2
3
#include <stdlib.h>
4
#include <string.h>
5
6
char * s_get_version_string () {
7
  char * ret_val = malloc ( sizeof(char) * 32);
8
  sprintf (ret_val, "Version: %d.%d.%d ", s_get_version_major (),
9
                                           s_get_version_minor (),
10
                                           s_get_version_patch ());
11
  return ret_val;
12
}
13
14
int s_get_version_major () {
15
  return SIMPLE_TYPE_SYSTEM_VERSION_MAJOR;
16
}
17
18
int s_get_version_minor () {
19
  return SIMPLE_TYPE_SYSTEM_VERSION_MINOR;
20
}
21
22
int s_get_version_patch () {
23
  return SIMPLE_TYPE_SYSTEM_VERSION_PATCH;
24
}
25
26
char * s_string_new (const char * s) {
27
  char * ret_val = malloc (strlen (s) + 1);
28
  strcpy (ret_val, s);
29
  return ret_val;
30
}
31
32
char * s_string_new_with_lenghth (const char * s, size_t len) {
33
  char * ret_val = malloc (len);
34
  strncpy (ret_val, s, len);
35
  return ret_val;
36
}
37