/ Check-in [49c3c86c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix compilation problem in test5.c (CVS 1318)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 49c3c86c17bcd8132216791d7a1a17e2c6256206
User & Date: danielk1977 2004-05-07 01:50:37
Context
2004-05-07
02:26
Trying to synchronize the test3.c module with the new btree.c code. (CVS 1319) check-in: 7fd1a660 user: drh tags: trunk
01:50
Fix compilation problem in test5.c (CVS 1318) check-in: 49c3c86c user: danielk1977 tags: trunk
2004-05-06
23:37
Add code to convert between the various supported unicode encoding schemes. Untested at this point. (CVS 1315) check-in: 71260ff7 user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/test5.c.

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
..
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
    Tcl_AppendResult(interp, "wrong # args: should be \"",
        Tcl_GetStringFromObj(objv[0], 0), "<utf-8 encoded-string>", 0);
    return TCL_ERROR;
  }

  in = Tcl_GetByteArrayFromObj(objv[1], 0);
  out = (unsigned char *)sqlite3utf8to16le(in, -1);
  res = Tcl_NewByteArrayObj(out, utf16_length(ret));
  sqliteFree(out);

  Tcl_SetObjResult(interp, res);

  return TCL_OK;
}

................................................................................
    Tcl_AppendResult(interp, "wrong # args: should be \"",
        Tcl_GetStringFromObj(objv[0], 0), "<utf-8 encoded-string>", 0);
    return TCL_ERROR;
  }

  in = Tcl_GetByteArrayFromObj(objv[1], 0);
  out = (unsigned char *)sqlite3utf8to16be(in, -1);
  res = Tcl_NewByteArrayObj(out, utf16_length(ret));
  sqliteFree(out);

  Tcl_SetObjResult(interp, res);

  return TCL_OK;
}

................................................................................
  }

  in = Tcl_GetByteArrayFromObj(objv[1], &in_len);
  out = (unsigned char *)sqliteMalloc(in_len);
  memcpy(out, in, in_len);
  
  sqlite3utf16to16le(out, -1);
  res = Tcl_NewByteArrayObj(out, utf16_length(ret));
  sqliteFree(out);

  Tcl_SetObjResult(interp, res);

  return TCL_OK;
}

................................................................................
  }

  in = Tcl_GetByteArrayFromObj(objv[1], &in_len);
  out = (unsigned char *)sqliteMalloc(in_len);
  memcpy(out, in, in_len);
  
  sqlite3utf16to16be(out, -1);
  res = Tcl_NewByteArrayObj(out, utf16_length(ret));
  sqliteFree(out);

  Tcl_SetObjResult(interp, res);

  return TCL_OK;
}

................................................................................
    Tcl_AppendResult(interp, "wrong # args: should be \"",
        Tcl_GetStringFromObj(objv[0], 0), "<utf-16 encoded-string>", 0);
    return TCL_ERROR;
  }

  in = Tcl_GetByteArrayFromObj(objv[1], 0);
  out = sqlite3utf16to8(in, -1);
  res = Tcl_NewByteArrayObj(out, strlen(ret));
  sqliteFree(out);

  Tcl_SetObjResult(interp, res);

  return TCL_OK;
}








|







 







|







 







|







 







|







 







|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
..
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
    Tcl_AppendResult(interp, "wrong # args: should be \"",
        Tcl_GetStringFromObj(objv[0], 0), "<utf-8 encoded-string>", 0);
    return TCL_ERROR;
  }

  in = Tcl_GetByteArrayFromObj(objv[1], 0);
  out = (unsigned char *)sqlite3utf8to16le(in, -1);
  res = Tcl_NewByteArrayObj(out, utf16_length(out));
  sqliteFree(out);

  Tcl_SetObjResult(interp, res);

  return TCL_OK;
}

................................................................................
    Tcl_AppendResult(interp, "wrong # args: should be \"",
        Tcl_GetStringFromObj(objv[0], 0), "<utf-8 encoded-string>", 0);
    return TCL_ERROR;
  }

  in = Tcl_GetByteArrayFromObj(objv[1], 0);
  out = (unsigned char *)sqlite3utf8to16be(in, -1);
  res = Tcl_NewByteArrayObj(out, utf16_length(out));
  sqliteFree(out);

  Tcl_SetObjResult(interp, res);

  return TCL_OK;
}

................................................................................
  }

  in = Tcl_GetByteArrayFromObj(objv[1], &in_len);
  out = (unsigned char *)sqliteMalloc(in_len);
  memcpy(out, in, in_len);
  
  sqlite3utf16to16le(out, -1);
  res = Tcl_NewByteArrayObj(out, utf16_length(out));
  sqliteFree(out);

  Tcl_SetObjResult(interp, res);

  return TCL_OK;
}

................................................................................
  }

  in = Tcl_GetByteArrayFromObj(objv[1], &in_len);
  out = (unsigned char *)sqliteMalloc(in_len);
  memcpy(out, in, in_len);
  
  sqlite3utf16to16be(out, -1);
  res = Tcl_NewByteArrayObj(out, utf16_length(out));
  sqliteFree(out);

  Tcl_SetObjResult(interp, res);

  return TCL_OK;
}

................................................................................
    Tcl_AppendResult(interp, "wrong # args: should be \"",
        Tcl_GetStringFromObj(objv[0], 0), "<utf-16 encoded-string>", 0);
    return TCL_ERROR;
  }

  in = Tcl_GetByteArrayFromObj(objv[1], 0);
  out = sqlite3utf16to8(in, -1);
  res = Tcl_NewByteArrayObj(out, strlen(out));
  sqliteFree(out);

  Tcl_SetObjResult(interp, res);

  return TCL_OK;
}