SQLite

Check-in [49c3c86c17]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 49c3c86c17bcd8132216791d7a1a17e2c6256206
User & Date: danielk1977 2004-05-07 01:50:37.000
Context
2004-05-07
02:26
Trying to synchronize the test3.c module with the new btree.c code. (CVS 1319) (check-in: 7fd1a660b0 user: drh tags: trunk)
01:50
Fix compilation problem in test5.c (CVS 1318) (check-in: 49c3c86c17 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: 71260ff7f7 user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/test5.c.
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
    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;
}








|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
    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;
}

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    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;
}








|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    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;
}

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
  }

  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;
}








|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
  }

  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;
}

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
  }

  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;
}








|







134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
  }

  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;
}

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-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;
}








|







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-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;
}