doc updates
[gnutls.git] / doc / common.c
blob4ceaff80cb2acd5a51910a5a3bd292a20e45d3e2
1 char* escape_string( const char* str, char* buffer, int buffer_size)
3 int i = 0, j = 0;
6 while( str[i] != 0 && j <buffer_size - 1) {
7 if (str[i]=='_') {
8 buffer[j++] = '\\';
9 buffer[j++] = '_';
10 buffer[j++] = '\\';
11 buffer[j++] = '-';
12 } else if (str[i]=='#') {
13 buffer[j++] = '\\';
14 buffer[j++] = '#';
15 } else {
16 buffer[j++] = str[i];
18 i++;
21 buffer[j] = 0;
23 return buffer;
27 char* escape_texi_string( const char* str, char* buffer, int buffer_size)
29 int i = 0, j = 0;
32 while( str[i] != 0 && j <buffer_size - 1) {
33 if (str[i]=='_') {
34 buffer[j++] = '_';
35 buffer[j++] = '@';
36 buffer[j++] = '-';
37 } else {
38 buffer[j++] = str[i];
40 i++;
43 buffer[j] = 0;
45 return buffer;