bin_utils 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/bin_utils/native.c +706 -448
- data/lib/bin_utils/pure_ruby.rb +431 -260
- data/lib/bin_utils/version.rb +1 -1
- data/test/test_bin_utils.rb +137 -222
- metadata +2 -2
data/ext/bin_utils/native.c
CHANGED
@@ -1083,7 +1083,7 @@ static int
|
|
1083
1083
|
append_ber(VALUE rstr, uint64_t ber)
|
1084
1084
|
{
|
1085
1085
|
int i = 10;
|
1086
|
-
char a[
|
1086
|
+
char a[11] = {128, 128, 128, 128,
|
1087
1087
|
128, 128 ,128 ,128,
|
1088
1088
|
128, 128, 0};
|
1089
1089
|
do {
|
@@ -1097,627 +1097,920 @@ append_ber(VALUE rstr, uint64_t ber)
|
|
1097
1097
|
return 11-i;
|
1098
1098
|
}
|
1099
1099
|
|
1100
|
+
static void
|
1101
|
+
check_argc_append(int argc, int bits)
|
1102
|
+
{
|
1103
|
+
if (argc < 1) {
|
1104
|
+
rb_raise(rb_eArgError, "accepts at least 1 argument: (string[, *int%ds])", bits);
|
1105
|
+
}
|
1106
|
+
}
|
1107
|
+
|
1108
|
+
static void
|
1109
|
+
check_argc_append_2(int argc, int bits, int bits1)
|
1110
|
+
{
|
1111
|
+
if (argc <= 1) {
|
1112
|
+
rb_raise(rb_eArgError, "accepts at least 2 arguments: (string, int%d[, *int%ds])", bits, bits1);
|
1113
|
+
}
|
1114
|
+
}
|
1115
|
+
|
1100
1116
|
/*** 32BIT **/
|
1101
1117
|
static VALUE
|
1102
|
-
rb_append_int8(
|
1118
|
+
rb_append_int8(int argc, VALUE* argv, VALUE self)
|
1103
1119
|
{
|
1104
|
-
|
1120
|
+
VALUE str; int i;
|
1121
|
+
check_argc_append(argc, 8);
|
1122
|
+
str = argv[0];
|
1123
|
+
for(i = 1; i < argc; i++) {
|
1124
|
+
append_int8(str, NUM2INT(argv[i]));
|
1125
|
+
}
|
1105
1126
|
return str;
|
1106
1127
|
}
|
1107
1128
|
|
1108
1129
|
static VALUE
|
1109
|
-
rb_append_int16_le(
|
1130
|
+
rb_append_int16_le(int argc, VALUE* argv, VALUE self)
|
1110
1131
|
{
|
1111
|
-
|
1132
|
+
VALUE str; int i;
|
1133
|
+
check_argc_append(argc, 16);
|
1134
|
+
str = argv[0];
|
1135
|
+
for(i = 1; i < argc; i++) {
|
1136
|
+
append_int16_le(str, NUM2INT(argv[i]));
|
1137
|
+
}
|
1112
1138
|
return str;
|
1113
1139
|
}
|
1114
1140
|
|
1115
1141
|
static VALUE
|
1116
|
-
|
1142
|
+
rb_append_int24_le(int argc, VALUE* argv, VALUE self)
|
1117
1143
|
{
|
1118
|
-
|
1144
|
+
VALUE str; int i;
|
1145
|
+
check_argc_append(argc, 24);
|
1146
|
+
str = argv[0];
|
1147
|
+
for(i = 1; i < argc; i++) {
|
1148
|
+
append_int24_le(str, NUM2INT(argv[i]));
|
1149
|
+
}
|
1119
1150
|
return str;
|
1120
1151
|
}
|
1121
1152
|
|
1122
1153
|
static VALUE
|
1123
|
-
|
1154
|
+
rb_append_int32_le(int argc, VALUE* argv, VALUE self)
|
1124
1155
|
{
|
1125
|
-
|
1156
|
+
VALUE str = argv[0];
|
1157
|
+
int i;
|
1158
|
+
for(i = 1; i < argc; i++) {
|
1159
|
+
append_int32_le(str, (int32_t)NUM2I64(argv[i]));
|
1160
|
+
}
|
1126
1161
|
return str;
|
1127
1162
|
}
|
1128
1163
|
|
1129
1164
|
static VALUE
|
1130
|
-
|
1165
|
+
rb_append_int16_be(int argc, VALUE* argv, VALUE self)
|
1131
1166
|
{
|
1132
|
-
|
1167
|
+
VALUE str; int i;
|
1168
|
+
check_argc_append(argc, 16);
|
1169
|
+
str = argv[0];
|
1170
|
+
for(i = 1; i < argc; i++) {
|
1171
|
+
append_int16_be(str, NUM2INT(argv[i]));
|
1172
|
+
}
|
1133
1173
|
return str;
|
1134
1174
|
}
|
1135
1175
|
|
1136
1176
|
static VALUE
|
1137
|
-
|
1177
|
+
rb_append_int24_be(int argc, VALUE* argv, VALUE self)
|
1138
1178
|
{
|
1139
|
-
|
1179
|
+
VALUE str; int i;
|
1180
|
+
check_argc_append(argc, 24);
|
1181
|
+
str = argv[0];
|
1182
|
+
for(i = 1; i < argc; i++) {
|
1183
|
+
append_int24_be(str, NUM2INT(argv[i]));
|
1184
|
+
}
|
1140
1185
|
return str;
|
1141
1186
|
}
|
1142
1187
|
|
1143
1188
|
static VALUE
|
1144
|
-
rb_append_int32_be(
|
1189
|
+
rb_append_int32_be(int argc, VALUE* argv, VALUE self)
|
1145
1190
|
{
|
1146
|
-
|
1191
|
+
VALUE str = argv[0];
|
1192
|
+
int i;
|
1193
|
+
for(i = 1; i < argc; i++) {
|
1194
|
+
append_int32_be(str, (int32_t)NUM2I64(argv[i]));
|
1195
|
+
}
|
1147
1196
|
return str;
|
1148
1197
|
}
|
1149
1198
|
/*** 32BIT END ***/
|
1150
1199
|
|
1151
1200
|
/*** 64BIT ***/
|
1152
1201
|
static VALUE
|
1153
|
-
rb_append_int40_le(
|
1202
|
+
rb_append_int40_le(int argc, VALUE* argv, VALUE self)
|
1154
1203
|
{
|
1155
|
-
|
1204
|
+
VALUE str; int i;
|
1205
|
+
check_argc_append(argc, 40);
|
1206
|
+
str = argv[0];
|
1207
|
+
for(i = 1; i < argc; i++) {
|
1208
|
+
append_int40_le(str, NUM2I64(argv[i]));
|
1209
|
+
}
|
1156
1210
|
return str;
|
1157
1211
|
}
|
1158
1212
|
|
1159
1213
|
static VALUE
|
1160
|
-
|
1214
|
+
rb_append_int48_le(int argc, VALUE* argv, VALUE self)
|
1161
1215
|
{
|
1162
|
-
|
1216
|
+
VALUE str; int i;
|
1217
|
+
check_argc_append(argc, 48);
|
1218
|
+
str = argv[0];
|
1219
|
+
for(i = 1; i < argc; i++) {
|
1220
|
+
append_int48_le(str, NUM2I64(argv[i]));
|
1221
|
+
}
|
1163
1222
|
return str;
|
1164
1223
|
}
|
1165
1224
|
|
1166
1225
|
static VALUE
|
1167
|
-
|
1226
|
+
rb_append_int56_le(int argc, VALUE* argv, VALUE self)
|
1168
1227
|
{
|
1169
|
-
|
1228
|
+
VALUE str; int i;
|
1229
|
+
check_argc_append(argc, 56);
|
1230
|
+
str = argv[0];
|
1231
|
+
for(i = 1; i < argc; i++) {
|
1232
|
+
append_int56_le(str, NUM2I64(argv[i]));
|
1233
|
+
}
|
1170
1234
|
return str;
|
1171
1235
|
}
|
1172
1236
|
|
1173
1237
|
static VALUE
|
1174
|
-
|
1238
|
+
rb_append_int64_le(int argc, VALUE* argv, VALUE self)
|
1175
1239
|
{
|
1176
|
-
|
1240
|
+
VALUE str; int i;
|
1241
|
+
check_argc_append(argc, 64);
|
1242
|
+
str = argv[0];
|
1243
|
+
for(i = 1; i < argc; i++) {
|
1244
|
+
append_int64_le(str, safe_int64_t(argv[i]));
|
1245
|
+
}
|
1177
1246
|
return str;
|
1178
1247
|
}
|
1179
1248
|
|
1180
1249
|
static VALUE
|
1181
|
-
|
1250
|
+
rb_append_int40_be(int argc, VALUE* argv, VALUE self)
|
1182
1251
|
{
|
1183
|
-
|
1252
|
+
VALUE str; int i;
|
1253
|
+
check_argc_append(argc, 40);
|
1254
|
+
str = argv[0];
|
1255
|
+
for(i = 1; i < argc; i++) {
|
1256
|
+
append_int40_be(str, NUM2I64(argv[i]));
|
1257
|
+
}
|
1184
1258
|
return str;
|
1185
1259
|
}
|
1186
1260
|
|
1187
1261
|
static VALUE
|
1188
|
-
|
1262
|
+
rb_append_int48_be(int argc, VALUE* argv, VALUE self)
|
1189
1263
|
{
|
1190
|
-
|
1264
|
+
VALUE str; int i;
|
1265
|
+
check_argc_append(argc, 48);
|
1266
|
+
str = argv[0];
|
1267
|
+
for(i = 1; i < argc; i++) {
|
1268
|
+
append_int48_be(str, NUM2I64(argv[i]));
|
1269
|
+
}
|
1191
1270
|
return str;
|
1192
1271
|
}
|
1193
1272
|
|
1194
1273
|
static VALUE
|
1195
|
-
|
1274
|
+
rb_append_int56_be(int argc, VALUE* argv, VALUE self)
|
1196
1275
|
{
|
1197
|
-
|
1276
|
+
VALUE str; int i;
|
1277
|
+
check_argc_append(argc, 56);
|
1278
|
+
str = argv[0];
|
1279
|
+
for(i = 1; i < argc; i++) {
|
1280
|
+
append_int56_be(str, NUM2I64(argv[i]));
|
1281
|
+
}
|
1198
1282
|
return str;
|
1199
1283
|
}
|
1200
1284
|
|
1201
1285
|
static VALUE
|
1202
|
-
rb_append_int64_be(
|
1286
|
+
rb_append_int64_be(int argc, VALUE* argv, VALUE self)
|
1203
1287
|
{
|
1204
|
-
|
1288
|
+
VALUE str; int i;
|
1289
|
+
check_argc_append(argc, 64);
|
1290
|
+
str = argv[0];
|
1291
|
+
for(i = 1; i < argc; i++) {
|
1292
|
+
append_int64_be(str, safe_int64_t(argv[i]));
|
1293
|
+
}
|
1205
1294
|
return str;
|
1206
1295
|
}
|
1207
1296
|
/*** 64BIT END **/
|
1208
1297
|
|
1298
|
+
/** APPEND END **/
|
1299
|
+
|
1300
|
+
/** APPEND BERSIZE **/
|
1209
1301
|
static VALUE
|
1210
|
-
|
1302
|
+
rb_append_bersize_int8(int argc, VALUE* argv, VALUE self)
|
1211
1303
|
{
|
1212
|
-
|
1213
|
-
|
1304
|
+
check_argc_append(argc, 8);
|
1305
|
+
append_ber(argv[0], (argc-1));
|
1306
|
+
return rb_append_int8(argc, argv, self);
|
1214
1307
|
}
|
1215
1308
|
|
1216
|
-
|
1309
|
+
static VALUE
|
1310
|
+
rb_append_bersize_int16_le(int argc, VALUE* argv, VALUE self)
|
1311
|
+
{
|
1312
|
+
check_argc_append(argc, 16);
|
1313
|
+
append_ber(argv[0], (argc-1)*2);
|
1314
|
+
return rb_append_int16_le(argc, argv, self);
|
1315
|
+
}
|
1217
1316
|
|
1218
|
-
/** APPEND BERSIZE **/
|
1219
|
-
/*** 32BIT **/
|
1220
1317
|
static VALUE
|
1221
|
-
|
1318
|
+
rb_append_bersize_int24_le(int argc, VALUE* argv, VALUE self)
|
1222
1319
|
{
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
return str;
|
1320
|
+
check_argc_append(argc, 24);
|
1321
|
+
append_ber(argv[0], (argc-1)*3);
|
1322
|
+
return rb_append_int24_le(argc, argv, self);
|
1227
1323
|
}
|
1228
1324
|
|
1229
1325
|
static VALUE
|
1230
|
-
|
1326
|
+
rb_append_bersize_int32_le(int argc, VALUE* argv, VALUE self)
|
1231
1327
|
{
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
return str;
|
1328
|
+
check_argc_append(argc, 32);
|
1329
|
+
append_ber(argv[0], (argc-1)*4);
|
1330
|
+
return rb_append_int32_le(argc, argv, self);
|
1236
1331
|
}
|
1237
1332
|
|
1238
1333
|
static VALUE
|
1239
|
-
|
1334
|
+
rb_append_bersize_int40_le(int argc, VALUE* argv, VALUE self)
|
1240
1335
|
{
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
return str;
|
1336
|
+
check_argc_append(argc, 40);
|
1337
|
+
append_ber(argv[0], (argc-1)*5);
|
1338
|
+
return rb_append_int40_le(argc, argv, self);
|
1245
1339
|
}
|
1246
1340
|
|
1247
1341
|
static VALUE
|
1248
|
-
|
1342
|
+
rb_append_bersize_int48_le(int argc, VALUE* argv, VALUE self)
|
1249
1343
|
{
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
return str;
|
1344
|
+
check_argc_append(argc, 48);
|
1345
|
+
append_ber(argv[0], (argc-1)*6);
|
1346
|
+
return rb_append_int48_le(argc, argv, self);
|
1254
1347
|
}
|
1255
1348
|
|
1256
1349
|
static VALUE
|
1257
|
-
|
1350
|
+
rb_append_bersize_int56_le(int argc, VALUE* argv, VALUE self)
|
1258
1351
|
{
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
return str;
|
1352
|
+
check_argc_append(argc, 56);
|
1353
|
+
append_ber(argv[0], (argc-1)*7);
|
1354
|
+
return rb_append_int56_le(argc, argv, self);
|
1263
1355
|
}
|
1264
1356
|
|
1265
1357
|
static VALUE
|
1266
|
-
|
1358
|
+
rb_append_bersize_int64_le(int argc, VALUE* argv, VALUE self)
|
1267
1359
|
{
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
return str;
|
1360
|
+
check_argc_append(argc, 64);
|
1361
|
+
append_ber(argv[0], (argc-1)*8);
|
1362
|
+
return rb_append_int64_le(argc, argv, self);
|
1272
1363
|
}
|
1273
1364
|
|
1274
1365
|
static VALUE
|
1275
|
-
|
1366
|
+
rb_append_bersize_int16_be(int argc, VALUE* argv, VALUE self)
|
1276
1367
|
{
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
return str;
|
1368
|
+
check_argc_append(argc, 16);
|
1369
|
+
append_ber(argv[0], (argc-1)*2);
|
1370
|
+
return rb_append_int16_be(argc, argv, self);
|
1281
1371
|
}
|
1282
|
-
/*** 32BIT END ***/
|
1283
1372
|
|
1284
|
-
/*** 64BIT ***/
|
1285
1373
|
static VALUE
|
1286
|
-
|
1374
|
+
rb_append_bersize_int24_be(int argc, VALUE* argv, VALUE self)
|
1287
1375
|
{
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
return str;
|
1376
|
+
check_argc_append(argc, 24);
|
1377
|
+
append_ber(argv[0], (argc-1)*3);
|
1378
|
+
return rb_append_int24_be(argc, argv, self);
|
1292
1379
|
}
|
1293
1380
|
|
1294
1381
|
static VALUE
|
1295
|
-
|
1382
|
+
rb_append_bersize_int32_be(int argc, VALUE* argv, VALUE self)
|
1296
1383
|
{
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
return str;
|
1384
|
+
check_argc_append(argc, 32);
|
1385
|
+
append_ber(argv[0], (argc-1)*4);
|
1386
|
+
return rb_append_int32_be(argc, argv, self);
|
1301
1387
|
}
|
1302
1388
|
|
1303
1389
|
static VALUE
|
1304
|
-
|
1390
|
+
rb_append_bersize_int40_be(int argc, VALUE* argv, VALUE self)
|
1305
1391
|
{
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
return str;
|
1392
|
+
check_argc_append(argc, 40);
|
1393
|
+
append_ber(argv[0], (argc-1)*5);
|
1394
|
+
return rb_append_int40_be(argc, argv, self);
|
1310
1395
|
}
|
1311
1396
|
|
1312
1397
|
static VALUE
|
1313
|
-
rb_append_bersize_int48_be(
|
1398
|
+
rb_append_bersize_int48_be(int argc, VALUE* argv, VALUE self)
|
1314
1399
|
{
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
return str;
|
1400
|
+
check_argc_append(argc, 48);
|
1401
|
+
append_ber(argv[0], (argc-1)*6);
|
1402
|
+
return rb_append_int48_be(argc, argv, self);
|
1319
1403
|
}
|
1320
1404
|
|
1321
1405
|
static VALUE
|
1322
|
-
|
1406
|
+
rb_append_bersize_int56_be(int argc, VALUE* argv, VALUE self)
|
1323
1407
|
{
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
return str;
|
1408
|
+
check_argc_append(argc, 56);
|
1409
|
+
append_ber(argv[0], (argc-1)*7);
|
1410
|
+
return rb_append_int56_be(argc, argv, self);
|
1328
1411
|
}
|
1329
1412
|
|
1330
1413
|
static VALUE
|
1331
|
-
|
1414
|
+
rb_append_bersize_int64_be(int argc, VALUE* argv, VALUE self)
|
1332
1415
|
{
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
return str;
|
1416
|
+
check_argc_append(argc, 64);
|
1417
|
+
append_ber(argv[0], (argc-1)*8);
|
1418
|
+
return rb_append_int64_be(argc, argv, self);
|
1337
1419
|
}
|
1420
|
+
/** APPEND BERSIZE END **/
|
1338
1421
|
|
1422
|
+
/** APPEND INT32SIZE **/
|
1339
1423
|
static VALUE
|
1340
|
-
|
1424
|
+
rb_append_int32size_int8_le(int argc, VALUE* argv, VALUE self)
|
1341
1425
|
{
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
return str;
|
1426
|
+
check_argc_append(argc, 8);
|
1427
|
+
append_int32_le(argv[0], (argc-1));
|
1428
|
+
return rb_append_int8(argc, argv, self);
|
1346
1429
|
}
|
1347
1430
|
|
1348
1431
|
static VALUE
|
1349
|
-
|
1432
|
+
rb_append_int32size_int16_le(int argc, VALUE* argv, VALUE self)
|
1350
1433
|
{
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
return str;
|
1434
|
+
check_argc_append(argc, 16);
|
1435
|
+
append_int32_le(argv[0], (argc-1)*2);
|
1436
|
+
return rb_append_int16_le(argc, argv, self);
|
1355
1437
|
}
|
1356
|
-
/*** 64BIT END **/
|
1357
1438
|
|
1358
1439
|
static VALUE
|
1359
|
-
|
1440
|
+
rb_append_int32size_int24_le(int argc, VALUE* argv, VALUE self)
|
1360
1441
|
{
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1442
|
+
check_argc_append(argc, 24);
|
1443
|
+
append_int32_le(argv[0], (argc-1)*3);
|
1444
|
+
return rb_append_int24_le(argc, argv, self);
|
1445
|
+
}
|
1446
|
+
|
1447
|
+
static VALUE
|
1448
|
+
rb_append_int32size_int32_le(int argc, VALUE* argv, VALUE self)
|
1449
|
+
{
|
1450
|
+
check_argc_append(argc, 32);
|
1451
|
+
append_int32_le(argv[0], (argc-1)*4);
|
1452
|
+
return rb_append_int32_le(argc, argv, self);
|
1453
|
+
}
|
1454
|
+
|
1455
|
+
static VALUE
|
1456
|
+
rb_append_int32size_int40_le(int argc, VALUE* argv, VALUE self)
|
1457
|
+
{
|
1458
|
+
check_argc_append(argc, 40);
|
1459
|
+
append_int32_le(argv[0], (argc-1)*5);
|
1460
|
+
return rb_append_int40_le(argc, argv, self);
|
1368
1461
|
}
|
1369
1462
|
|
1463
|
+
static VALUE
|
1464
|
+
rb_append_int32size_int48_le(int argc, VALUE* argv, VALUE self)
|
1465
|
+
{
|
1466
|
+
check_argc_append(argc, 48);
|
1467
|
+
append_int32_le(argv[0], (argc-1)*6);
|
1468
|
+
return rb_append_int48_le(argc, argv, self);
|
1469
|
+
}
|
1470
|
+
|
1471
|
+
static VALUE
|
1472
|
+
rb_append_int32size_int56_le(int argc, VALUE* argv, VALUE self)
|
1473
|
+
{
|
1474
|
+
check_argc_append(argc, 56);
|
1475
|
+
append_int32_le(argv[0], (argc-1)*7);
|
1476
|
+
return rb_append_int56_le(argc, argv, self);
|
1477
|
+
}
|
1478
|
+
|
1479
|
+
static VALUE
|
1480
|
+
rb_append_int32size_int64_le(int argc, VALUE* argv, VALUE self)
|
1481
|
+
{
|
1482
|
+
check_argc_append(argc, 64);
|
1483
|
+
append_int32_le(argv[0], (argc-1)*8);
|
1484
|
+
return rb_append_int64_le(argc, argv, self);
|
1485
|
+
}
|
1486
|
+
|
1487
|
+
static VALUE
|
1488
|
+
rb_append_int32size_int8_be(int argc, VALUE* argv, VALUE self)
|
1489
|
+
{
|
1490
|
+
check_argc_append(argc, 8);
|
1491
|
+
append_int32_be(argv[0], (argc-1));
|
1492
|
+
return rb_append_int8(argc, argv, self);
|
1493
|
+
}
|
1494
|
+
|
1495
|
+
static VALUE
|
1496
|
+
rb_append_int32size_int16_be(int argc, VALUE* argv, VALUE self)
|
1497
|
+
{
|
1498
|
+
check_argc_append(argc, 16);
|
1499
|
+
append_int32_be(argv[0], (argc-1)*2);
|
1500
|
+
return rb_append_int16_be(argc, argv, self);
|
1501
|
+
}
|
1502
|
+
|
1503
|
+
static VALUE
|
1504
|
+
rb_append_int32size_int24_be(int argc, VALUE* argv, VALUE self)
|
1505
|
+
{
|
1506
|
+
check_argc_append(argc, 24);
|
1507
|
+
append_int32_be(argv[0], (argc-1)*3);
|
1508
|
+
return rb_append_int24_be(argc, argv, self);
|
1509
|
+
}
|
1510
|
+
|
1511
|
+
static VALUE
|
1512
|
+
rb_append_int32size_int32_be(int argc, VALUE* argv, VALUE self)
|
1513
|
+
{
|
1514
|
+
check_argc_append(argc, 32);
|
1515
|
+
append_int32_be(argv[0], (argc-1)*4);
|
1516
|
+
return rb_append_int32_be(argc, argv, self);
|
1517
|
+
}
|
1518
|
+
|
1519
|
+
static VALUE
|
1520
|
+
rb_append_int32size_int40_be(int argc, VALUE* argv, VALUE self)
|
1521
|
+
{
|
1522
|
+
check_argc_append(argc, 40);
|
1523
|
+
append_int32_be(argv[0], (argc-1)*5);
|
1524
|
+
return rb_append_int40_be(argc, argv, self);
|
1525
|
+
}
|
1526
|
+
|
1527
|
+
static VALUE
|
1528
|
+
rb_append_int32size_int48_be(int argc, VALUE* argv, VALUE self)
|
1529
|
+
{
|
1530
|
+
check_argc_append(argc, 48);
|
1531
|
+
append_int32_be(argv[0], (argc-1)*6);
|
1532
|
+
return rb_append_int48_be(argc, argv, self);
|
1533
|
+
}
|
1534
|
+
|
1535
|
+
static VALUE
|
1536
|
+
rb_append_int32size_int56_be(int argc, VALUE* argv, VALUE self)
|
1537
|
+
{
|
1538
|
+
check_argc_append(argc, 56);
|
1539
|
+
append_int32_be(argv[0], (argc-1)*7);
|
1540
|
+
return rb_append_int56_be(argc, argv, self);
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
static VALUE
|
1544
|
+
rb_append_int32size_int64_be(int argc, VALUE* argv, VALUE self)
|
1545
|
+
{
|
1546
|
+
check_argc_append(argc, 64);
|
1547
|
+
append_int32_be(argv[0], (argc-1)*8);
|
1548
|
+
return rb_append_int64_be(argc, argv, self);
|
1549
|
+
}
|
1370
1550
|
/** APPEND BERSIZE END **/
|
1551
|
+
/** APPEND INT32SIZE END **/
|
1552
|
+
|
1553
|
+
/** APPEND BER **/
|
1371
1554
|
|
1372
|
-
/** APPEND INT32LESIZE **/
|
1373
|
-
/*** 32BIT **/
|
1374
1555
|
static VALUE
|
1375
|
-
|
1556
|
+
rb_append_ber(int argc, VALUE* argv, VALUE self)
|
1376
1557
|
{
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1558
|
+
VALUE str; int i;
|
1559
|
+
check_argc_append(argc, 0);
|
1560
|
+
str = argv[0];
|
1561
|
+
for(i = 1; i < argc; i++) {
|
1562
|
+
append_ber(str, safe_int64_t(argv[i]));
|
1563
|
+
}
|
1380
1564
|
return str;
|
1381
1565
|
}
|
1382
1566
|
|
1567
|
+
static VALUE rb_append_bersize_string(VALUE self, VALUE str, VALUE add);
|
1568
|
+
|
1569
|
+
static const char zeros[4] = {0, 0, 0, 0};
|
1383
1570
|
static VALUE
|
1384
|
-
|
1571
|
+
rb_append_bersize_ber(int argc, VALUE* argv, VALUE self)
|
1385
1572
|
{
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1573
|
+
VALUE str, add_str;
|
1574
|
+
int i;
|
1575
|
+
check_argc_append(argc, 0);
|
1576
|
+
str = argv[0];
|
1577
|
+
add_str = rb_str_tmp_new(0);
|
1578
|
+
for(i = 1; i < argc; i++) {
|
1579
|
+
append_ber(add_str, safe_int64_t(argv[i]));
|
1580
|
+
}
|
1581
|
+
return rb_append_bersize_string(self, str, add_str);
|
1390
1582
|
}
|
1391
1583
|
|
1392
1584
|
static VALUE
|
1393
|
-
|
1585
|
+
rb_append_int32size_ber_le(int argc, VALUE* argv, VALUE self)
|
1394
1586
|
{
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1587
|
+
VALUE str;
|
1588
|
+
int i, bs=0, ss;
|
1589
|
+
uint8_t *ptr;
|
1590
|
+
check_argc_append(argc, 0);
|
1591
|
+
str = argv[0];
|
1592
|
+
rb_str_cat(str, zeros, 4);
|
1593
|
+
ss = RSTRING_LEN(str) - 4;
|
1594
|
+
for(i = 1; i < argc; i++) {
|
1595
|
+
bs += append_ber(str, safe_int64_t(argv[i]));
|
1596
|
+
}
|
1597
|
+
ptr = ((uint8_t*)RSTRING_PTR(str)) + ss;
|
1598
|
+
ptr[0] = bs & 255;
|
1599
|
+
ptr[1] = (bs >> 8) & 255;
|
1600
|
+
ptr[2] = (bs >> 16) & 255;
|
1601
|
+
ptr[3] = (bs >> 24) & 255;
|
1398
1602
|
return str;
|
1399
1603
|
}
|
1400
1604
|
|
1401
1605
|
static VALUE
|
1402
|
-
|
1606
|
+
rb_append_int32size_ber_be(int argc, VALUE* argv, VALUE self)
|
1403
1607
|
{
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1608
|
+
VALUE str;
|
1609
|
+
int i = 0, bs=0, ss;
|
1610
|
+
uint8_t *ptr;
|
1611
|
+
check_argc_append(argc, 0);
|
1612
|
+
str = argv[0];
|
1613
|
+
rb_str_cat(str, zeros, 4);
|
1614
|
+
ss = RSTRING_LEN(str) - 4;
|
1615
|
+
for(i = 1; i < argc; i++) {
|
1616
|
+
bs += append_ber(str, safe_int64_t(argv[i]));
|
1617
|
+
}
|
1618
|
+
ptr = ((uint8_t*)RSTRING_PTR(str)) + ss;
|
1619
|
+
ptr[3] = bs & 255;
|
1620
|
+
ptr[2] = (bs >> 8) & 255;
|
1621
|
+
ptr[1] = (bs >> 16) & 255;
|
1622
|
+
ptr[0] = (bs >> 24) & 255;
|
1407
1623
|
return str;
|
1408
1624
|
}
|
1625
|
+
/** APPEND BER END **/
|
1409
1626
|
|
1627
|
+
/** APPEND STRING **/
|
1410
1628
|
static VALUE
|
1411
|
-
|
1629
|
+
rb_append_string(VALUE self, VALUE str, VALUE add)
|
1412
1630
|
{
|
1413
|
-
|
1414
|
-
rb_str_cat(str,
|
1415
|
-
|
1631
|
+
StringValue(add);
|
1632
|
+
rb_str_cat(str, RSTRING_PTR(add), RSTRING_LEN(add));
|
1633
|
+
RB_GC_GUARD(add);
|
1416
1634
|
return str;
|
1417
1635
|
}
|
1418
1636
|
|
1419
1637
|
static VALUE
|
1420
|
-
|
1638
|
+
rb_append_bersize_string(VALUE self, VALUE str, VALUE add)
|
1421
1639
|
{
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1640
|
+
StringValue(add);
|
1641
|
+
append_ber(str, RSTRING_LEN(add));
|
1642
|
+
rb_str_cat(str, RSTRING_PTR(add), RSTRING_LEN(add));
|
1643
|
+
RB_GC_GUARD(add);
|
1425
1644
|
return str;
|
1426
1645
|
}
|
1427
1646
|
|
1428
1647
|
static VALUE
|
1429
|
-
|
1648
|
+
rb_append_int32size_string_le(VALUE self, VALUE str, VALUE add)
|
1430
1649
|
{
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1650
|
+
StringValue(add);
|
1651
|
+
append_int32_le(str, RSTRING_LEN(add));
|
1652
|
+
rb_str_cat(str, RSTRING_PTR(add), RSTRING_LEN(add));
|
1653
|
+
RB_GC_GUARD(add);
|
1434
1654
|
return str;
|
1435
1655
|
}
|
1436
|
-
/*** 32BIT END ***/
|
1437
1656
|
|
1438
|
-
/*** 64BIT ***/
|
1439
1657
|
static VALUE
|
1440
|
-
|
1658
|
+
rb_append_int32size_string_be(VALUE self, VALUE str, VALUE add)
|
1441
1659
|
{
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1660
|
+
StringValue(add);
|
1661
|
+
append_int32_be(str, RSTRING_LEN(add));
|
1662
|
+
rb_str_cat(str, RSTRING_PTR(add), RSTRING_LEN(add));
|
1663
|
+
RB_GC_GUARD(add);
|
1445
1664
|
return str;
|
1446
1665
|
}
|
1447
1666
|
|
1667
|
+
/** APPEND STRING END **/
|
1668
|
+
|
1669
|
+
/** APPEND COMPLEX **/
|
1448
1670
|
static VALUE
|
1449
|
-
|
1671
|
+
rb_append_int8_ber(int argc, VALUE *argv, VALUE self)
|
1450
1672
|
{
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
return
|
1673
|
+
check_argc_append_2(argc, 8, 0);
|
1674
|
+
rb_append_int8(2, argv, self);
|
1675
|
+
argv[1] = argv[0];
|
1676
|
+
return rb_append_ber(argc-1, argv+1, self);
|
1455
1677
|
}
|
1456
1678
|
|
1457
1679
|
static VALUE
|
1458
|
-
|
1680
|
+
rb_append_int16_ber_le(int argc, VALUE *argv, VALUE self)
|
1459
1681
|
{
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
return
|
1682
|
+
check_argc_append_2(argc, 16, 0);
|
1683
|
+
rb_append_int16_le(2, argv, self);
|
1684
|
+
argv[1] = argv[0];
|
1685
|
+
return rb_append_ber(argc-1, argv+1, self);
|
1464
1686
|
}
|
1465
1687
|
|
1466
1688
|
static VALUE
|
1467
|
-
|
1689
|
+
rb_append_int24_ber_le(int argc, VALUE *argv, VALUE self)
|
1468
1690
|
{
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
return
|
1691
|
+
check_argc_append_2(argc, 24, 0);
|
1692
|
+
rb_append_int24_le(2, argv, self);
|
1693
|
+
argv[1] = argv[0];
|
1694
|
+
return rb_append_ber(argc-1, argv+1, self);
|
1473
1695
|
}
|
1474
1696
|
|
1475
1697
|
static VALUE
|
1476
|
-
|
1698
|
+
rb_append_int32_ber_le(int argc, VALUE *argv, VALUE self)
|
1477
1699
|
{
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
return
|
1700
|
+
check_argc_append_2(argc, 32, 0);
|
1701
|
+
rb_append_int32_le(2, argv, self);
|
1702
|
+
argv[1] = argv[0];
|
1703
|
+
return rb_append_ber(argc-1, argv+1, self);
|
1482
1704
|
}
|
1483
1705
|
|
1484
1706
|
static VALUE
|
1485
|
-
|
1707
|
+
rb_append_int16_ber_be(int argc, VALUE *argv, VALUE self)
|
1486
1708
|
{
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
return
|
1709
|
+
check_argc_append_2(argc, 16, 0);
|
1710
|
+
rb_append_int16_be(2, argv, self);
|
1711
|
+
argv[1] = argv[0];
|
1712
|
+
return rb_append_ber(argc-1, argv+1, self);
|
1491
1713
|
}
|
1492
1714
|
|
1493
1715
|
static VALUE
|
1494
|
-
|
1716
|
+
rb_append_int24_ber_be(int argc, VALUE *argv, VALUE self)
|
1495
1717
|
{
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
return
|
1718
|
+
check_argc_append_2(argc, 24, 0);
|
1719
|
+
rb_append_int24_be(2, argv, self);
|
1720
|
+
argv[1] = argv[0];
|
1721
|
+
return rb_append_ber(argc-1, argv+1, self);
|
1500
1722
|
}
|
1501
1723
|
|
1502
1724
|
static VALUE
|
1503
|
-
|
1725
|
+
rb_append_int32_ber_be(int argc, VALUE *argv, VALUE self)
|
1504
1726
|
{
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
return
|
1727
|
+
check_argc_append_2(argc, 32, 0);
|
1728
|
+
rb_append_int32_be(2, argv, self);
|
1729
|
+
argv[1] = argv[0];
|
1730
|
+
return rb_append_ber(argc-1, argv+1, self);
|
1509
1731
|
}
|
1510
|
-
/*** 64BIT END **/
|
1511
1732
|
|
1512
1733
|
static VALUE
|
1513
|
-
|
1734
|
+
rb_append_int8_int16_le(int argc, VALUE *argv, VALUE self)
|
1514
1735
|
{
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
bl = append_ber(str, safe_int64_t(i));
|
1520
|
-
RSTRING_PTR(str)[sl] = bl;
|
1521
|
-
return str;
|
1736
|
+
check_argc_append_2(argc, 8, 16);
|
1737
|
+
rb_append_int8(2, argv, self);
|
1738
|
+
argv[1] = argv[0];
|
1739
|
+
return rb_append_int16_le(argc-1, argv+1, self);
|
1522
1740
|
}
|
1523
1741
|
|
1524
|
-
|
1742
|
+
static VALUE
|
1743
|
+
rb_append_int8_int24_le(int argc, VALUE *argv, VALUE self)
|
1744
|
+
{
|
1745
|
+
check_argc_append_2(argc, 8, 24);
|
1746
|
+
rb_append_int8(2, argv, self);
|
1747
|
+
argv[1] = argv[0];
|
1748
|
+
return rb_append_int24_le(argc-1, argv+1, self);
|
1749
|
+
}
|
1525
1750
|
|
1526
|
-
/** APPEND INT32BESIZE **/
|
1527
|
-
/*** 32BIT **/
|
1528
1751
|
static VALUE
|
1529
|
-
|
1752
|
+
rb_append_int8_int32_le(int argc, VALUE *argv, VALUE self)
|
1530
1753
|
{
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
return
|
1754
|
+
check_argc_append_2(argc, 8, 32);
|
1755
|
+
rb_append_int8(2, argv, self);
|
1756
|
+
argv[1] = argv[0];
|
1757
|
+
return rb_append_int32_le(argc-1, argv+1, self);
|
1535
1758
|
}
|
1536
1759
|
|
1537
1760
|
static VALUE
|
1538
|
-
|
1761
|
+
rb_append_int8_int16_be(int argc, VALUE *argv, VALUE self)
|
1539
1762
|
{
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
return
|
1763
|
+
check_argc_append_2(argc, 8, 16);
|
1764
|
+
rb_append_int8(2, argv, self);
|
1765
|
+
argv[1] = argv[0];
|
1766
|
+
return rb_append_int16_be(argc-1, argv+1, self);
|
1544
1767
|
}
|
1545
1768
|
|
1546
1769
|
static VALUE
|
1547
|
-
|
1770
|
+
rb_append_int8_int24_be(int argc, VALUE *argv, VALUE self)
|
1548
1771
|
{
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
return
|
1772
|
+
check_argc_append_2(argc, 8, 24);
|
1773
|
+
rb_append_int8(2, argv, self);
|
1774
|
+
argv[1] = argv[0];
|
1775
|
+
return rb_append_int24_be(argc-1, argv+1, self);
|
1553
1776
|
}
|
1554
1777
|
|
1555
1778
|
static VALUE
|
1556
|
-
|
1779
|
+
rb_append_int8_int32_be(int argc, VALUE *argv, VALUE self)
|
1557
1780
|
{
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
return
|
1781
|
+
check_argc_append_2(argc, 8, 32);
|
1782
|
+
rb_append_int8(2, argv, self);
|
1783
|
+
argv[1] = argv[0];
|
1784
|
+
return rb_append_int32_be(argc-1, argv+1, self);
|
1562
1785
|
}
|
1563
1786
|
|
1564
1787
|
static VALUE
|
1565
|
-
|
1788
|
+
rb_append_int16_int8_le(int argc, VALUE *argv, VALUE self)
|
1566
1789
|
{
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
return
|
1790
|
+
check_argc_append_2(argc, 16, 8);
|
1791
|
+
rb_append_int16_le(2, argv, self);
|
1792
|
+
argv[1] = argv[0];
|
1793
|
+
return rb_append_int8(argc-1, argv+1, self);
|
1571
1794
|
}
|
1572
1795
|
|
1573
1796
|
static VALUE
|
1574
|
-
|
1797
|
+
rb_append_int16_int24_le(int argc, VALUE *argv, VALUE self)
|
1575
1798
|
{
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
return
|
1799
|
+
check_argc_append_2(argc, 16, 24);
|
1800
|
+
rb_append_int16_le(2, argv, self);
|
1801
|
+
argv[1] = argv[0];
|
1802
|
+
return rb_append_int24_le(argc-1, argv+1, self);
|
1580
1803
|
}
|
1581
1804
|
|
1582
1805
|
static VALUE
|
1583
|
-
|
1806
|
+
rb_append_int16_int32_le(int argc, VALUE *argv, VALUE self)
|
1584
1807
|
{
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
return
|
1808
|
+
check_argc_append_2(argc, 16, 32);
|
1809
|
+
rb_append_int16_le(2, argv, self);
|
1810
|
+
argv[1] = argv[0];
|
1811
|
+
return rb_append_int32_le(argc-1, argv+1, self);
|
1589
1812
|
}
|
1590
|
-
/*** 32BIT END ***/
|
1591
1813
|
|
1592
|
-
/*** 64BIT ***/
|
1593
1814
|
static VALUE
|
1594
|
-
|
1815
|
+
rb_append_int16_int8_be(int argc, VALUE *argv, VALUE self)
|
1595
1816
|
{
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
return
|
1817
|
+
check_argc_append_2(argc, 16, 8);
|
1818
|
+
rb_append_int16_be(2, argv, self);
|
1819
|
+
argv[1] = argv[0];
|
1820
|
+
return rb_append_int8(argc-1, argv+1, self);
|
1600
1821
|
}
|
1601
1822
|
|
1602
1823
|
static VALUE
|
1603
|
-
|
1824
|
+
rb_append_int16_int24_be(int argc, VALUE *argv, VALUE self)
|
1604
1825
|
{
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
return
|
1826
|
+
check_argc_append_2(argc, 16, 24);
|
1827
|
+
rb_append_int16_be(2, argv, self);
|
1828
|
+
argv[1] = argv[0];
|
1829
|
+
return rb_append_int24_be(argc-1, argv+1, self);
|
1609
1830
|
}
|
1610
1831
|
|
1611
1832
|
static VALUE
|
1612
|
-
|
1833
|
+
rb_append_int16_int32_be(int argc, VALUE *argv, VALUE self)
|
1613
1834
|
{
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
return
|
1835
|
+
check_argc_append_2(argc, 16, 32);
|
1836
|
+
rb_append_int16_be(2, argv, self);
|
1837
|
+
argv[1] = argv[0];
|
1838
|
+
return rb_append_int32_be(argc-1, argv+1, self);
|
1618
1839
|
}
|
1619
1840
|
|
1620
1841
|
static VALUE
|
1621
|
-
|
1842
|
+
rb_append_int24_int16_le(int argc, VALUE *argv, VALUE self)
|
1622
1843
|
{
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
return
|
1844
|
+
check_argc_append_2(argc, 24, 16);
|
1845
|
+
rb_append_int24_le(2, argv, self);
|
1846
|
+
argv[1] = argv[0];
|
1847
|
+
return rb_append_int16_le(argc-1, argv+1, self);
|
1627
1848
|
}
|
1628
1849
|
|
1629
1850
|
static VALUE
|
1630
|
-
|
1851
|
+
rb_append_int24_int8_le(int argc, VALUE *argv, VALUE self)
|
1631
1852
|
{
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
return
|
1853
|
+
check_argc_append_2(argc, 24, 8);
|
1854
|
+
rb_append_int24_le(2, argv, self);
|
1855
|
+
argv[1] = argv[0];
|
1856
|
+
return rb_append_int8(argc-1, argv+1, self);
|
1636
1857
|
}
|
1637
1858
|
|
1638
1859
|
static VALUE
|
1639
|
-
|
1860
|
+
rb_append_int24_int32_le(int argc, VALUE *argv, VALUE self)
|
1640
1861
|
{
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
return
|
1862
|
+
check_argc_append_2(argc, 24, 32);
|
1863
|
+
rb_append_int24_le(2, argv, self);
|
1864
|
+
argv[1] = argv[0];
|
1865
|
+
return rb_append_int32_le(argc-1, argv+1, self);
|
1645
1866
|
}
|
1646
1867
|
|
1647
1868
|
static VALUE
|
1648
|
-
|
1869
|
+
rb_append_int24_int16_be(int argc, VALUE *argv, VALUE self)
|
1649
1870
|
{
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
return
|
1871
|
+
check_argc_append_2(argc, 24, 16);
|
1872
|
+
rb_append_int24_be(2, argv, self);
|
1873
|
+
argv[1] = argv[0];
|
1874
|
+
return rb_append_int16_be(argc-1, argv+1, self);
|
1654
1875
|
}
|
1655
1876
|
|
1656
1877
|
static VALUE
|
1657
|
-
|
1878
|
+
rb_append_int24_int8_be(int argc, VALUE *argv, VALUE self)
|
1658
1879
|
{
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
return
|
1880
|
+
check_argc_append_2(argc, 24, 8);
|
1881
|
+
rb_append_int24_be(2, argv, self);
|
1882
|
+
argv[1] = argv[0];
|
1883
|
+
return rb_append_int8(argc-1, argv+1, self);
|
1663
1884
|
}
|
1664
|
-
/*** 64BIT END **/
|
1665
1885
|
|
1666
1886
|
static VALUE
|
1667
|
-
|
1887
|
+
rb_append_int24_int32_be(int argc, VALUE *argv, VALUE self)
|
1668
1888
|
{
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
bl = append_ber(str, safe_int64_t(i));
|
1674
|
-
RSTRING_PTR(str)[sl] = bl;
|
1675
|
-
return str;
|
1889
|
+
check_argc_append_2(argc, 24, 32);
|
1890
|
+
rb_append_int24_be(2, argv, self);
|
1891
|
+
argv[1] = argv[0];
|
1892
|
+
return rb_append_int32_be(argc-1, argv+1, self);
|
1676
1893
|
}
|
1677
1894
|
|
1678
|
-
|
1895
|
+
static VALUE
|
1896
|
+
rb_append_int32_int16_le(int argc, VALUE *argv, VALUE self)
|
1897
|
+
{
|
1898
|
+
check_argc_append_2(argc, 32, 16);
|
1899
|
+
rb_append_int32_le(2, argv, self);
|
1900
|
+
argv[1] = argv[0];
|
1901
|
+
return rb_append_int16_le(argc-1, argv+1, self);
|
1902
|
+
}
|
1679
1903
|
|
1680
|
-
/** APPEND STRING **/
|
1681
1904
|
static VALUE
|
1682
|
-
|
1905
|
+
rb_append_int32_int24_le(int argc, VALUE *argv, VALUE self)
|
1683
1906
|
{
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
return
|
1907
|
+
check_argc_append_2(argc, 32, 24);
|
1908
|
+
rb_append_int32_le(2, argv, self);
|
1909
|
+
argv[1] = argv[0];
|
1910
|
+
return rb_append_int24_le(argc-1, argv+1, self);
|
1688
1911
|
}
|
1689
1912
|
|
1690
1913
|
static VALUE
|
1691
|
-
|
1914
|
+
rb_append_int32_int8_le(int argc, VALUE *argv, VALUE self)
|
1692
1915
|
{
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
return str;
|
1916
|
+
check_argc_append_2(argc, 32, 8);
|
1917
|
+
rb_append_int32_le(2, argv, self);
|
1918
|
+
argv[1] = argv[0];
|
1919
|
+
return rb_append_int8(argc-1, argv+1, self);
|
1698
1920
|
}
|
1699
1921
|
|
1700
1922
|
static VALUE
|
1701
|
-
|
1923
|
+
rb_append_int32_int16_be(int argc, VALUE *argv, VALUE self)
|
1702
1924
|
{
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
return str;
|
1925
|
+
check_argc_append_2(argc, 32, 16);
|
1926
|
+
rb_append_int32_be(2, argv, self);
|
1927
|
+
argv[1] = argv[0];
|
1928
|
+
return rb_append_int16_be(argc-1, argv+1, self);
|
1708
1929
|
}
|
1709
1930
|
|
1710
1931
|
static VALUE
|
1711
|
-
|
1932
|
+
rb_append_int32_int24_be(int argc, VALUE *argv, VALUE self)
|
1712
1933
|
{
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
return str;
|
1934
|
+
check_argc_append_2(argc, 32, 24);
|
1935
|
+
rb_append_int32_be(2, argv, self);
|
1936
|
+
argv[1] = argv[0];
|
1937
|
+
return rb_append_int24_be(argc-1, argv+1, self);
|
1718
1938
|
}
|
1719
1939
|
|
1720
|
-
|
1940
|
+
static VALUE
|
1941
|
+
rb_append_int32_int8_be(int argc, VALUE *argv, VALUE self)
|
1942
|
+
{
|
1943
|
+
check_argc_append_2(argc, 32, 8);
|
1944
|
+
rb_append_int32_be(2, argv, self);
|
1945
|
+
argv[1] = argv[0];
|
1946
|
+
return rb_append_int8(argc-1, argv+1, self);
|
1947
|
+
}
|
1948
|
+
|
1949
|
+
static VALUE
|
1950
|
+
rb_append_ber_int8(int argc, VALUE *argv, VALUE self)
|
1951
|
+
{
|
1952
|
+
check_argc_append_2(argc, 0, 8);
|
1953
|
+
rb_append_ber(2, argv, self);
|
1954
|
+
argv[1] = argv[0];
|
1955
|
+
return rb_append_int8(argc-1, argv+1, self);
|
1956
|
+
}
|
1957
|
+
|
1958
|
+
static VALUE
|
1959
|
+
rb_append_ber_int16_le(int argc, VALUE *argv, VALUE self)
|
1960
|
+
{
|
1961
|
+
check_argc_append_2(argc, 0, 16);
|
1962
|
+
rb_append_ber(2, argv, self);
|
1963
|
+
argv[1] = argv[0];
|
1964
|
+
return rb_append_int16_le(argc-1, argv+1, self);
|
1965
|
+
}
|
1966
|
+
|
1967
|
+
static VALUE
|
1968
|
+
rb_append_ber_int16_be(int argc, VALUE *argv, VALUE self)
|
1969
|
+
{
|
1970
|
+
check_argc_append_2(argc, 0, 16);
|
1971
|
+
rb_append_ber(2, argv, self);
|
1972
|
+
argv[1] = argv[0];
|
1973
|
+
return rb_append_int16_be(argc-1, argv+1, self);
|
1974
|
+
}
|
1975
|
+
|
1976
|
+
static VALUE
|
1977
|
+
rb_append_ber_int24_le(int argc, VALUE *argv, VALUE self)
|
1978
|
+
{
|
1979
|
+
check_argc_append_2(argc, 0, 24);
|
1980
|
+
rb_append_ber(2, argv, self);
|
1981
|
+
argv[1] = argv[0];
|
1982
|
+
return rb_append_int24_le(argc-1, argv+1, self);
|
1983
|
+
}
|
1984
|
+
|
1985
|
+
static VALUE
|
1986
|
+
rb_append_ber_int24_be(int argc, VALUE *argv, VALUE self)
|
1987
|
+
{
|
1988
|
+
check_argc_append_2(argc, 0, 24);
|
1989
|
+
rb_append_ber(2, argv, self);
|
1990
|
+
argv[1] = argv[0];
|
1991
|
+
return rb_append_int24_be(argc-1, argv+1, self);
|
1992
|
+
}
|
1993
|
+
|
1994
|
+
static VALUE
|
1995
|
+
rb_append_ber_int32_le(int argc, VALUE *argv, VALUE self)
|
1996
|
+
{
|
1997
|
+
check_argc_append_2(argc, 0, 32);
|
1998
|
+
rb_append_ber(2, argv, self);
|
1999
|
+
argv[1] = argv[0];
|
2000
|
+
return rb_append_int32_le(argc-1, argv+1, self);
|
2001
|
+
}
|
2002
|
+
|
2003
|
+
static VALUE
|
2004
|
+
rb_append_ber_int32_be(int argc, VALUE *argv, VALUE self)
|
2005
|
+
{
|
2006
|
+
check_argc_append_2(argc, 0, 32);
|
2007
|
+
rb_append_ber(2, argv, self);
|
2008
|
+
argv[1] = argv[0];
|
2009
|
+
return rb_append_int32_be(argc-1, argv+1, self);
|
2010
|
+
}
|
2011
|
+
|
2012
|
+
|
2013
|
+
/** APPEND COMPLEX END **/
|
1721
2014
|
|
1722
2015
|
void
|
1723
2016
|
Init_native_bin_utils()
|
@@ -1791,138 +2084,103 @@ Init_native_bin_utils()
|
|
1791
2084
|
rb_define_method(mod_native, "slice_int64_be!", rb_slice_int64_be, 1);
|
1792
2085
|
rb_define_method(mod_native, "slice_sint64_be!", rb_slice_sint64_be, 1);
|
1793
2086
|
|
1794
|
-
rb_define_method(mod_native, "append_ber!", rb_append_ber,
|
1795
|
-
rb_define_method(mod_native, "append_int8!", rb_append_int8,
|
1796
|
-
rb_define_method(mod_native, "
|
1797
|
-
rb_define_method(mod_native, "
|
1798
|
-
rb_define_method(mod_native, "
|
1799
|
-
rb_define_method(mod_native, "
|
1800
|
-
rb_define_method(mod_native, "
|
1801
|
-
rb_define_method(mod_native, "
|
1802
|
-
rb_define_method(mod_native, "
|
1803
|
-
rb_define_method(mod_native, "
|
1804
|
-
rb_define_method(mod_native, "
|
1805
|
-
rb_define_method(mod_native, "
|
1806
|
-
rb_define_method(mod_native, "
|
1807
|
-
rb_define_method(mod_native, "
|
1808
|
-
rb_define_method(mod_native, "
|
1809
|
-
rb_define_method(mod_native, "
|
1810
|
-
|
1811
|
-
rb_define_method(mod_native, "
|
1812
|
-
rb_define_method(mod_native, "
|
1813
|
-
rb_define_method(mod_native, "
|
1814
|
-
rb_define_method(mod_native, "
|
1815
|
-
rb_define_method(mod_native, "
|
1816
|
-
rb_define_method(mod_native, "
|
1817
|
-
rb_define_method(mod_native, "
|
1818
|
-
rb_define_method(mod_native, "
|
1819
|
-
rb_define_method(mod_native, "
|
1820
|
-
rb_define_method(mod_native, "
|
1821
|
-
rb_define_method(mod_native, "
|
1822
|
-
rb_define_method(mod_native, "
|
1823
|
-
rb_define_method(mod_native, "
|
1824
|
-
rb_define_method(mod_native, "
|
1825
|
-
|
1826
|
-
rb_define_method(mod_native, "
|
1827
|
-
|
1828
|
-
rb_define_method(mod_native, "
|
1829
|
-
rb_define_method(mod_native, "
|
1830
|
-
rb_define_method(mod_native, "
|
1831
|
-
rb_define_method(mod_native, "
|
1832
|
-
rb_define_method(mod_native, "
|
1833
|
-
rb_define_method(mod_native, "
|
1834
|
-
rb_define_method(mod_native, "
|
1835
|
-
rb_define_method(mod_native, "
|
1836
|
-
rb_define_method(mod_native, "
|
1837
|
-
|
1838
|
-
rb_define_method(mod_native, "
|
1839
|
-
rb_define_method(mod_native, "
|
1840
|
-
rb_define_method(mod_native, "
|
1841
|
-
rb_define_method(mod_native, "
|
1842
|
-
rb_define_method(mod_native, "
|
1843
|
-
rb_define_method(mod_native, "
|
1844
|
-
rb_define_method(mod_native, "
|
1845
|
-
rb_define_method(mod_native, "
|
1846
|
-
rb_define_method(mod_native, "
|
1847
|
-
rb_define_method(mod_native, "append_bersize_int48_be!", rb_append_bersize_int48_be, 2);
|
1848
|
-
rb_define_method(mod_native, "append_bersize_sint48_be!", rb_append_bersize_int48_be, 2);
|
1849
|
-
rb_define_method(mod_native, "append_bersize_int56_le!", rb_append_bersize_int56_le, 2);
|
1850
|
-
rb_define_method(mod_native, "append_bersize_sint56_le!", rb_append_bersize_int56_le, 2);
|
1851
|
-
rb_define_method(mod_native, "append_bersize_int56_be!", rb_append_bersize_int56_be, 2);
|
1852
|
-
rb_define_method(mod_native, "append_bersize_sint56_be!", rb_append_bersize_int56_be, 2);
|
1853
|
-
rb_define_method(mod_native, "append_bersize_int64_le!", rb_append_bersize_int64_le, 2);
|
1854
|
-
rb_define_method(mod_native, "append_bersize_sint64_le!", rb_append_bersize_int64_le, 2);
|
1855
|
-
rb_define_method(mod_native, "append_bersize_int64_be!", rb_append_bersize_int64_be, 2);
|
1856
|
-
rb_define_method(mod_native, "append_bersize_sint64_be!", rb_append_bersize_int64_be, 2);
|
1857
|
-
|
1858
|
-
rb_define_method(mod_native, "append_int32lesize_ber!", rb_append_int32lesize_ber, 2);
|
1859
|
-
rb_define_method(mod_native, "append_int32lesize_int8!", rb_append_int32lesize_int8, 2);
|
1860
|
-
rb_define_method(mod_native, "append_int32lesize_sint8!", rb_append_int32lesize_int8, 2);
|
1861
|
-
rb_define_method(mod_native, "append_int32lesize_int16_le!", rb_append_int32lesize_int16_le, 2);
|
1862
|
-
rb_define_method(mod_native, "append_int32lesize_sint16_le!", rb_append_int32lesize_int16_le, 2);
|
1863
|
-
rb_define_method(mod_native, "append_int32lesize_int16_be!", rb_append_int32lesize_int16_be, 2);
|
1864
|
-
rb_define_method(mod_native, "append_int32lesize_sint16_be!", rb_append_int32lesize_int16_be, 2);
|
1865
|
-
rb_define_method(mod_native, "append_int32lesize_int24_le!", rb_append_int32lesize_int24_le, 2);
|
1866
|
-
rb_define_method(mod_native, "append_int32lesize_sint24_le!", rb_append_int32lesize_int24_le, 2);
|
1867
|
-
rb_define_method(mod_native, "append_int32lesize_int24_be!", rb_append_int32lesize_int24_be, 2);
|
1868
|
-
rb_define_method(mod_native, "append_int32lesize_sint24_be!", rb_append_int32lesize_int24_be, 2);
|
1869
|
-
rb_define_method(mod_native, "append_int32lesize_int32_le!", rb_append_int32lesize_int32_le, 2);
|
1870
|
-
rb_define_method(mod_native, "append_int32lesize_sint32_le!", rb_append_int32lesize_int32_le, 2);
|
1871
|
-
rb_define_method(mod_native, "append_int32lesize_int32_be!", rb_append_int32lesize_int32_be, 2);
|
1872
|
-
rb_define_method(mod_native, "append_int32lesize_sint32_be!", rb_append_int32lesize_int32_be, 2);
|
1873
|
-
rb_define_method(mod_native, "append_int32lesize_int40_le!", rb_append_int32lesize_int40_le, 2);
|
1874
|
-
rb_define_method(mod_native, "append_int32lesize_sint40_le!", rb_append_int32lesize_int40_le, 2);
|
1875
|
-
rb_define_method(mod_native, "append_int32lesize_int40_be!", rb_append_int32lesize_int40_be, 2);
|
1876
|
-
rb_define_method(mod_native, "append_int32lesize_sint40_be!", rb_append_int32lesize_int40_be, 2);
|
1877
|
-
rb_define_method(mod_native, "append_int32lesize_int48_le!", rb_append_int32lesize_int48_le, 2);
|
1878
|
-
rb_define_method(mod_native, "append_int32lesize_sint48_le!", rb_append_int32lesize_int48_le, 2);
|
1879
|
-
rb_define_method(mod_native, "append_int32lesize_int48_be!", rb_append_int32lesize_int48_be, 2);
|
1880
|
-
rb_define_method(mod_native, "append_int32lesize_sint48_be!", rb_append_int32lesize_int48_be, 2);
|
1881
|
-
rb_define_method(mod_native, "append_int32lesize_int56_le!", rb_append_int32lesize_int56_le, 2);
|
1882
|
-
rb_define_method(mod_native, "append_int32lesize_sint56_le!", rb_append_int32lesize_int56_le, 2);
|
1883
|
-
rb_define_method(mod_native, "append_int32lesize_int56_be!", rb_append_int32lesize_int56_be, 2);
|
1884
|
-
rb_define_method(mod_native, "append_int32lesize_sint56_be!", rb_append_int32lesize_int56_be, 2);
|
1885
|
-
rb_define_method(mod_native, "append_int32lesize_int64_le!", rb_append_int32lesize_int64_le, 2);
|
1886
|
-
rb_define_method(mod_native, "append_int32lesize_sint64_le!", rb_append_int32lesize_int64_le, 2);
|
1887
|
-
rb_define_method(mod_native, "append_int32lesize_int64_be!", rb_append_int32lesize_int64_be, 2);
|
1888
|
-
rb_define_method(mod_native, "append_int32lesize_sint64_be!", rb_append_int32lesize_int64_be, 2);
|
1889
|
-
|
1890
|
-
rb_define_method(mod_native, "append_int32besize_ber!", rb_append_int32besize_ber, 2);
|
1891
|
-
rb_define_method(mod_native, "append_int32besize_int8!", rb_append_int32besize_int8, 2);
|
1892
|
-
rb_define_method(mod_native, "append_int32besize_sint8!", rb_append_int32besize_int8, 2);
|
1893
|
-
rb_define_method(mod_native, "append_int32besize_int16_le!", rb_append_int32besize_int16_le, 2);
|
1894
|
-
rb_define_method(mod_native, "append_int32besize_sint16_le!", rb_append_int32besize_int16_le, 2);
|
1895
|
-
rb_define_method(mod_native, "append_int32besize_int16_be!", rb_append_int32besize_int16_be, 2);
|
1896
|
-
rb_define_method(mod_native, "append_int32besize_sint16_be!", rb_append_int32besize_int16_be, 2);
|
1897
|
-
rb_define_method(mod_native, "append_int32besize_int24_le!", rb_append_int32besize_int24_le, 2);
|
1898
|
-
rb_define_method(mod_native, "append_int32besize_sint24_le!", rb_append_int32besize_int24_le, 2);
|
1899
|
-
rb_define_method(mod_native, "append_int32besize_int24_be!", rb_append_int32besize_int24_be, 2);
|
1900
|
-
rb_define_method(mod_native, "append_int32besize_sint24_be!", rb_append_int32besize_int24_be, 2);
|
1901
|
-
rb_define_method(mod_native, "append_int32besize_int32_le!", rb_append_int32besize_int32_le, 2);
|
1902
|
-
rb_define_method(mod_native, "append_int32besize_sint32_le!", rb_append_int32besize_int32_le, 2);
|
1903
|
-
rb_define_method(mod_native, "append_int32besize_int32_be!", rb_append_int32besize_int32_be, 2);
|
1904
|
-
rb_define_method(mod_native, "append_int32besize_sint32_be!", rb_append_int32besize_int32_be, 2);
|
1905
|
-
rb_define_method(mod_native, "append_int32besize_int40_le!", rb_append_int32besize_int40_le, 2);
|
1906
|
-
rb_define_method(mod_native, "append_int32besize_sint40_le!", rb_append_int32besize_int40_le, 2);
|
1907
|
-
rb_define_method(mod_native, "append_int32besize_int40_be!", rb_append_int32besize_int40_be, 2);
|
1908
|
-
rb_define_method(mod_native, "append_int32besize_sint40_be!", rb_append_int32besize_int40_be, 2);
|
1909
|
-
rb_define_method(mod_native, "append_int32besize_int48_le!", rb_append_int32besize_int48_le, 2);
|
1910
|
-
rb_define_method(mod_native, "append_int32besize_sint48_le!", rb_append_int32besize_int48_le, 2);
|
1911
|
-
rb_define_method(mod_native, "append_int32besize_int48_be!", rb_append_int32besize_int48_be, 2);
|
1912
|
-
rb_define_method(mod_native, "append_int32besize_sint48_be!", rb_append_int32besize_int48_be, 2);
|
1913
|
-
rb_define_method(mod_native, "append_int32besize_int56_le!", rb_append_int32besize_int56_le, 2);
|
1914
|
-
rb_define_method(mod_native, "append_int32besize_sint56_le!", rb_append_int32besize_int56_le, 2);
|
1915
|
-
rb_define_method(mod_native, "append_int32besize_int56_be!", rb_append_int32besize_int56_be, 2);
|
1916
|
-
rb_define_method(mod_native, "append_int32besize_sint56_be!", rb_append_int32besize_int56_be, 2);
|
1917
|
-
rb_define_method(mod_native, "append_int32besize_int64_le!", rb_append_int32besize_int64_le, 2);
|
1918
|
-
rb_define_method(mod_native, "append_int32besize_sint64_le!", rb_append_int32besize_int64_le, 2);
|
1919
|
-
rb_define_method(mod_native, "append_int32besize_int64_be!", rb_append_int32besize_int64_be, 2);
|
1920
|
-
rb_define_method(mod_native, "append_int32besize_sint64_be!", rb_append_int32besize_int64_be, 2);
|
2087
|
+
rb_define_method(mod_native, "append_ber!", rb_append_ber, -1);
|
2088
|
+
rb_define_method(mod_native, "append_int8!", rb_append_int8, -1);
|
2089
|
+
rb_define_method(mod_native, "append_int16_le!", rb_append_int16_le, -1);
|
2090
|
+
rb_define_method(mod_native, "append_int16_be!", rb_append_int16_be, -1);
|
2091
|
+
rb_define_method(mod_native, "append_int24_le!", rb_append_int24_le, -1);
|
2092
|
+
rb_define_method(mod_native, "append_int24_be!", rb_append_int24_be, -1);
|
2093
|
+
rb_define_method(mod_native, "append_int32_le!", rb_append_int32_le, -1);
|
2094
|
+
rb_define_method(mod_native, "append_int32_be!", rb_append_int32_be, -1);
|
2095
|
+
rb_define_method(mod_native, "append_int40_le!", rb_append_int40_le, -1);
|
2096
|
+
rb_define_method(mod_native, "append_int40_be!", rb_append_int40_be, -1);
|
2097
|
+
rb_define_method(mod_native, "append_int48_le!", rb_append_int48_le, -1);
|
2098
|
+
rb_define_method(mod_native, "append_int48_be!", rb_append_int48_be, -1);
|
2099
|
+
rb_define_method(mod_native, "append_int56_le!", rb_append_int56_le, -1);
|
2100
|
+
rb_define_method(mod_native, "append_int56_be!", rb_append_int56_be, -1);
|
2101
|
+
rb_define_method(mod_native, "append_int64_le!", rb_append_int64_le, -1);
|
2102
|
+
rb_define_method(mod_native, "append_int64_be!", rb_append_int64_be, -1);
|
2103
|
+
|
2104
|
+
rb_define_method(mod_native, "append_bersize_ber!", rb_append_bersize_ber, -1);
|
2105
|
+
rb_define_method(mod_native, "append_bersize_int8!", rb_append_bersize_int8, -1);
|
2106
|
+
rb_define_method(mod_native, "append_bersize_int16_le!", rb_append_bersize_int16_le, -1);
|
2107
|
+
rb_define_method(mod_native, "append_bersize_int16_be!", rb_append_bersize_int16_be, -1);
|
2108
|
+
rb_define_method(mod_native, "append_bersize_int24_le!", rb_append_bersize_int24_le, -1);
|
2109
|
+
rb_define_method(mod_native, "append_bersize_int24_be!", rb_append_bersize_int24_be, -1);
|
2110
|
+
rb_define_method(mod_native, "append_bersize_int32_le!", rb_append_bersize_int32_le, -1);
|
2111
|
+
rb_define_method(mod_native, "append_bersize_int32_be!", rb_append_bersize_int32_be, -1);
|
2112
|
+
rb_define_method(mod_native, "append_bersize_int40_le!", rb_append_bersize_int40_le, -1);
|
2113
|
+
rb_define_method(mod_native, "append_bersize_int40_be!", rb_append_bersize_int40_be, -1);
|
2114
|
+
rb_define_method(mod_native, "append_bersize_int48_le!", rb_append_bersize_int48_le, -1);
|
2115
|
+
rb_define_method(mod_native, "append_bersize_int48_be!", rb_append_bersize_int48_be, -1);
|
2116
|
+
rb_define_method(mod_native, "append_bersize_int56_le!", rb_append_bersize_int56_le, -1);
|
2117
|
+
rb_define_method(mod_native, "append_bersize_int56_be!", rb_append_bersize_int56_be, -1);
|
2118
|
+
rb_define_method(mod_native, "append_bersize_int64_le!", rb_append_bersize_int64_le, -1);
|
2119
|
+
rb_define_method(mod_native, "append_bersize_int64_be!", rb_append_bersize_int64_be, -1);
|
2120
|
+
|
2121
|
+
rb_define_method(mod_native, "append_int32size_ber_le!", rb_append_int32size_ber_le, -1);
|
2122
|
+
rb_define_method(mod_native, "append_int32size_int8_le!", rb_append_int32size_int8_le, -1);
|
2123
|
+
rb_define_method(mod_native, "append_int32size_int16_le!", rb_append_int32size_int16_le, -1);
|
2124
|
+
rb_define_method(mod_native, "append_int32size_int24_le!", rb_append_int32size_int24_le, -1);
|
2125
|
+
rb_define_method(mod_native, "append_int32size_int32_le!", rb_append_int32size_int32_le, -1);
|
2126
|
+
rb_define_method(mod_native, "append_int32size_int40_le!", rb_append_int32size_int40_le, -1);
|
2127
|
+
rb_define_method(mod_native, "append_int32size_int48_le!", rb_append_int32size_int48_le, -1);
|
2128
|
+
rb_define_method(mod_native, "append_int32size_int56_le!", rb_append_int32size_int56_le, -1);
|
2129
|
+
rb_define_method(mod_native, "append_int32size_int64_le!", rb_append_int32size_int64_le, -1);
|
2130
|
+
|
2131
|
+
rb_define_method(mod_native, "append_int32size_ber_be!", rb_append_int32size_ber_be, -1);
|
2132
|
+
rb_define_method(mod_native, "append_int32size_int8_be!", rb_append_int32size_int8_be, -1);
|
2133
|
+
rb_define_method(mod_native, "append_int32size_int16_be!", rb_append_int32size_int16_be, -1);
|
2134
|
+
rb_define_method(mod_native, "append_int32size_int24_be!", rb_append_int32size_int24_be, -1);
|
2135
|
+
rb_define_method(mod_native, "append_int32size_int32_be!", rb_append_int32size_int32_be, -1);
|
2136
|
+
rb_define_method(mod_native, "append_int32size_int40_be!", rb_append_int32size_int40_be, -1);
|
2137
|
+
rb_define_method(mod_native, "append_int32size_int48_be!", rb_append_int32size_int48_be, -1);
|
2138
|
+
rb_define_method(mod_native, "append_int32size_int56_be!", rb_append_int32size_int56_be, -1);
|
2139
|
+
rb_define_method(mod_native, "append_int32size_int64_be!", rb_append_int32size_int64_be, -1);
|
1921
2140
|
|
1922
2141
|
rb_define_method(mod_native, "append_string!", rb_append_string, 2);
|
1923
2142
|
rb_define_method(mod_native, "append_bersize_string!", rb_append_bersize_string, 2);
|
1924
|
-
rb_define_method(mod_native, "
|
1925
|
-
rb_define_method(mod_native, "
|
2143
|
+
rb_define_method(mod_native, "append_int32size_string_le!", rb_append_int32size_string_le, 2);
|
2144
|
+
rb_define_method(mod_native, "append_int32size_string_be!", rb_append_int32size_string_be, 2);
|
2145
|
+
|
2146
|
+
rb_define_method(mod_native, "append_int8_ber!", rb_append_int8_ber, -1);
|
2147
|
+
rb_define_method(mod_native, "append_ber_int8!", rb_append_ber_int8, -1);
|
2148
|
+
rb_define_method(mod_native, "append_int8_int16_le!", rb_append_int8_int16_le, -1);
|
2149
|
+
rb_define_method(mod_native, "append_int8_int24_le!", rb_append_int8_int24_le, -1);
|
2150
|
+
rb_define_method(mod_native, "append_int8_int32_le!", rb_append_int8_int32_le, -1);
|
2151
|
+
rb_define_method(mod_native, "append_int8_int16_be!", rb_append_int8_int16_be, -1);
|
2152
|
+
rb_define_method(mod_native, "append_int8_int24_be!", rb_append_int8_int24_be, -1);
|
2153
|
+
rb_define_method(mod_native, "append_int8_int32_be!", rb_append_int8_int32_be, -1);
|
2154
|
+
rb_define_method(mod_native, "append_int16_int8_le!", rb_append_int16_int8_le, -1);
|
2155
|
+
rb_define_method(mod_native, "append_int16_int24_le!", rb_append_int16_int24_le, -1);
|
2156
|
+
rb_define_method(mod_native, "append_int16_int32_le!", rb_append_int16_int32_le, -1);
|
2157
|
+
rb_define_method(mod_native, "append_int16_int8_be!", rb_append_int16_int8_be, -1);
|
2158
|
+
rb_define_method(mod_native, "append_int16_int24_be!", rb_append_int16_int24_be, -1);
|
2159
|
+
rb_define_method(mod_native, "append_int16_int32_be!", rb_append_int16_int32_be, -1);
|
2160
|
+
rb_define_method(mod_native, "append_int24_int16_le!", rb_append_int24_int16_le, -1);
|
2161
|
+
rb_define_method(mod_native, "append_int24_int8_le!", rb_append_int24_int8_le, -1);
|
2162
|
+
rb_define_method(mod_native, "append_int24_int32_le!", rb_append_int24_int32_le, -1);
|
2163
|
+
rb_define_method(mod_native, "append_int24_int16_be!", rb_append_int24_int16_be, -1);
|
2164
|
+
rb_define_method(mod_native, "append_int24_int8_be!", rb_append_int24_int8_be, -1);
|
2165
|
+
rb_define_method(mod_native, "append_int24_int32_be!", rb_append_int24_int32_be, -1);
|
2166
|
+
rb_define_method(mod_native, "append_int32_int16_le!", rb_append_int32_int16_le, -1);
|
2167
|
+
rb_define_method(mod_native, "append_int32_int24_le!", rb_append_int32_int24_le, -1);
|
2168
|
+
rb_define_method(mod_native, "append_int32_int8_le!", rb_append_int32_int8_le, -1);
|
2169
|
+
rb_define_method(mod_native, "append_int32_int16_be!", rb_append_int32_int16_be, -1);
|
2170
|
+
rb_define_method(mod_native, "append_int32_int24_be!", rb_append_int32_int24_be, -1);
|
2171
|
+
rb_define_method(mod_native, "append_int32_int8_be!", rb_append_int32_int8_be, -1);
|
2172
|
+
rb_define_method(mod_native, "append_ber_int16_le!", rb_append_ber_int16_le, -1);
|
2173
|
+
rb_define_method(mod_native, "append_ber_int24_le!", rb_append_ber_int24_le, -1);
|
2174
|
+
rb_define_method(mod_native, "append_ber_int32_le!", rb_append_ber_int32_le, -1);
|
2175
|
+
rb_define_method(mod_native, "append_ber_int16_be!", rb_append_ber_int16_be, -1);
|
2176
|
+
rb_define_method(mod_native, "append_ber_int24_be!", rb_append_ber_int24_be, -1);
|
2177
|
+
rb_define_method(mod_native, "append_ber_int32_be!", rb_append_ber_int32_be, -1);
|
2178
|
+
rb_define_method(mod_native, "append_int16_ber_le!", rb_append_int16_ber_le, -1);
|
2179
|
+
rb_define_method(mod_native, "append_int24_ber_le!", rb_append_int24_ber_le, -1);
|
2180
|
+
rb_define_method(mod_native, "append_int32_ber_le!", rb_append_int32_ber_le, -1);
|
2181
|
+
rb_define_method(mod_native, "append_int16_ber_be!", rb_append_int16_ber_be, -1);
|
2182
|
+
rb_define_method(mod_native, "append_int24_ber_be!", rb_append_int24_ber_be, -1);
|
2183
|
+
rb_define_method(mod_native, "append_int32_ber_be!", rb_append_int32_ber_be, -1);
|
1926
2184
|
|
1927
2185
|
rb_extend_object(mod_native, mod_native);
|
1928
2186
|
}
|