Skip to content

Commit 56006b2

Browse files
committed
Add in buf methods
1 parent 12c36b0 commit 56006b2

File tree

1 file changed

+178
-12
lines changed

1 file changed

+178
-12
lines changed

api-viewer/versions/wip.json

Lines changed: 178 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@
599599
"node_buffer.h",
600600
"../include/blob.h",
601601
"../include/repository.h",
602+
"../include/buf.h",
602603
"../include/oid.h"
603604
],
604605
"functions": [
@@ -1368,15 +1369,170 @@
13681369
"fields": []
13691370
},
13701371
{
1371-
"filename": "buffer.h",
1372-
"ignore": false,
1373-
"cppClassName": "GitBuffer",
1374-
"jsClassName": "Buffer",
13751372
"cType": "git_buf",
1373+
"functions": [
1374+
{
1375+
"cFunctionName": "git_buf_free",
1376+
"ignore": true,
1377+
"description": "<p>Free the memory referred to by the git_buf.</p>\n",
1378+
"cppFunctionName": "Free",
1379+
"jsFunctionName": "free",
1380+
"return": {
1381+
"cType": "void",
1382+
"comment": null,
1383+
"cppClassName": "void",
1384+
"jsClassName": "void"
1385+
},
1386+
"isConstructorMethod": false,
1387+
"isPrototypeMethod": true,
1388+
"args": [
1389+
{
1390+
"name": "buffer",
1391+
"cType": "git_buf *",
1392+
"cppClassName": "GitBuf",
1393+
"jsClassName": "Buf",
1394+
"comment": "The buffer to deallocate",
1395+
"isReturn": true,
1396+
"isSelf": false,
1397+
"shouldAlloc": true
1398+
}
1399+
],
1400+
"isAsync": false,
1401+
"comment": "<p>Note that this does not free the <code>git_buf</code> itself, just the memory\n pointed to by <code>buffer-&gt;ptr</code>. This will not free the memory if it looks\n like it was not allocated internally, but it will clear the buffer back\n to the empty state.</p>\n"
1402+
},
1403+
{
1404+
"cFunctionName": "git_buf_grow",
1405+
"ignore": false,
1406+
"description": "<p>Resize the buffer allocation to make more space.</p>\n",
1407+
"cppFunctionName": "Grow",
1408+
"jsFunctionName": "grow",
1409+
"return": {
1410+
"cType": "int",
1411+
"comment": " 0 on success, -1 on allocation failure",
1412+
"cppClassName": "Number",
1413+
"jsClassName": "Number",
1414+
"isErrorCode": true
1415+
},
1416+
"isConstructorMethod": false,
1417+
"isPrototypeMethod": true,
1418+
"args": [
1419+
{
1420+
"name": "buffer",
1421+
"cType": "git_buf *",
1422+
"cppClassName": "GitBuf",
1423+
"jsClassName": "Buf",
1424+
"comment": "The buffer to be resized; may or may not be allocated yet",
1425+
"isReturn": true,
1426+
"isSelf": false,
1427+
"shouldAlloc": true
1428+
},
1429+
{
1430+
"name": "target_size",
1431+
"cType": "size_t",
1432+
"cppClassName": "Uint32",
1433+
"jsClassName": "Number",
1434+
"comment": "The desired available size",
1435+
"isReturn": false,
1436+
"isSelf": false,
1437+
"shouldAlloc": false
1438+
}
1439+
],
1440+
"isAsync": true,
1441+
"comment": "<p>This will attempt to grow the buffer to accomodate the target size.</p>\n\n<p>If the buffer refers to memory that was not allocated by libgit2 (i.e.\n the <code>asize</code> field is zero), then <code>ptr</code> will be replaced with a newly\n allocated block of data. Be careful so that memory allocated by the\n caller is not lost. As a special variant, if you pass <code>target_size</code> as\n 0 and the memory is not allocated by libgit2, this will allocate a new\n buffer of size <code>size</code> and copy the external data into it.</p>\n\n<p>Currently, this will never shrink a buffer, only expand it.</p>\n\n<p>If the allocation fails, this will return an error and the buffer will be\n marked as invalid for future operations, invaliding the contents.</p>\n"
1442+
},
1443+
{
1444+
"cFunctionName": "git_buf_set",
1445+
"ignore": false,
1446+
"description": "<p>Set buffer to a copy of some raw data.</p>\n",
1447+
"cppFunctionName": "Set",
1448+
"jsFunctionName": "set",
1449+
"return": {
1450+
"cType": "int",
1451+
"comment": " 0 on success, -1 on allocation failure",
1452+
"cppClassName": "Number",
1453+
"jsClassName": "Number",
1454+
"isErrorCode": true
1455+
},
1456+
"isConstructorMethod": false,
1457+
"isPrototypeMethod": true,
1458+
"args": [
1459+
{
1460+
"name": "buffer",
1461+
"cType": "git_buf *",
1462+
"cppClassName": "GitBuf",
1463+
"jsClassName": "Buf",
1464+
"comment": "The buffer to set",
1465+
"isReturn": true,
1466+
"isSelf": false,
1467+
"shouldAlloc": true
1468+
},
1469+
{
1470+
"name": "data",
1471+
"cType": "const void *",
1472+
"cppClassName": "Buffer",
1473+
"jsClassName": "Buffer",
1474+
"comment": "The data to copy into the buffer",
1475+
"isReturn": false,
1476+
"isSelf": false,
1477+
"shouldAlloc": false
1478+
},
1479+
{
1480+
"name": "datalen",
1481+
"cType": "size_t",
1482+
"cppClassName": "Uint32",
1483+
"jsClassName": "Number",
1484+
"comment": "The length of the data to copy into the buffer",
1485+
"isReturn": false,
1486+
"isSelf": false,
1487+
"shouldAlloc": false
1488+
}
1489+
],
1490+
"isAsync": true,
1491+
"comment": ""
1492+
}
1493+
],
1494+
"filename": "buf.h",
1495+
"ignore": false,
1496+
"cppClassName": "GitBuf",
1497+
"jsClassName": "Buf",
13761498
"description": " A data buffer for exporting data from libgit2",
1377-
"dependencies": [],
1378-
"fields": [],
1379-
"functions": []
1499+
"freeFunctionName": "git_buf_free",
1500+
"hasConstructor": false,
1501+
"dependencies": [
1502+
"../include/buf.h"
1503+
],
1504+
"fields": [
1505+
{
1506+
"type": "char *",
1507+
"name": "ptr",
1508+
"comments": "",
1509+
"cType": "char *",
1510+
"cppFunctionName": "Ptr",
1511+
"jsFunctionName": "ptr",
1512+
"cppClassName": "String",
1513+
"jsClassName": "String"
1514+
},
1515+
{
1516+
"type": "size_t",
1517+
"name": "asize",
1518+
"comments": "",
1519+
"cType": "size_t",
1520+
"cppFunctionName": "Asize",
1521+
"jsFunctionName": "asize",
1522+
"cppClassName": "Uint32",
1523+
"jsClassName": "Number"
1524+
},
1525+
{
1526+
"type": "size_t",
1527+
"name": "size",
1528+
"comments": "",
1529+
"cType": "size_t",
1530+
"cppFunctionName": "Size",
1531+
"jsFunctionName": "size",
1532+
"cppClassName": "Uint32",
1533+
"jsClassName": "Number"
1534+
}
1535+
]
13801536
},
13811537
{
13821538
"cType": null,
@@ -2295,6 +2451,7 @@
22952451
"freeFunctionName": "git_config_free",
22962452
"hasConstructor": false,
22972453
"dependencies": [
2454+
"../include/buf.h",
22982455
"../include/config.h"
22992456
],
23002457
"fields": [],
@@ -2409,6 +2566,7 @@
24092566
"../include/repository.h",
24102567
"../include/tree.h",
24112568
"../include/index.h",
2569+
"../include/buf.h",
24122570
"../include/commit.h"
24132571
],
24142572
"functions": [
@@ -2812,7 +2970,8 @@
28122970
"hasConstructor": false,
28132971
"dependencies": [
28142972
"../include/repository.h",
2815-
"../include/blob.h"
2973+
"../include/blob.h",
2974+
"../include/buf.h"
28162975
],
28172976
"functions": []
28182977
},
@@ -2904,7 +3063,9 @@
29043063
"ignore": false,
29053064
"cppClassName": "GitMessage",
29063065
"jsClassName": "Message",
2907-
"dependencies": [],
3066+
"dependencies": [
3067+
"../include/buf.h"
3068+
],
29083069
"fields": [],
29093070
"functions": []
29103071
},
@@ -2943,7 +3104,8 @@
29433104
"hasConstructor": false,
29443105
"dependencies": [
29453106
"../include/object.h",
2946-
"../include/repository.h"
3107+
"../include/repository.h",
3108+
"../include/buf.h"
29473109
],
29483110
"fields": [],
29493111
"functions": []
@@ -3501,7 +3663,9 @@
35013663
"jsClassName": "Refspec",
35023664
"cType": "git_refspec",
35033665
"description": "",
3504-
"dependencies": [],
3666+
"dependencies": [
3667+
"../include/buf.h"
3668+
],
35053669
"fields": [],
35063670
"functions": []
35073671
},
@@ -3516,7 +3680,8 @@
35163680
"../include/repository.h",
35173681
"../include/strarray.h",
35183682
"../include/transport.h",
3519-
"../include/remote_callbacks.h"
3683+
"../include/remote_callbacks.h",
3684+
"../include/buf.h"
35203685
],
35213686
"functions": [
35223687
{
@@ -3872,6 +4037,7 @@
38724037
"../include/repository_init_options.h",
38734038
"../include/repository.h",
38744039
"../include/odb.h",
4040+
"../include/buf.h",
38754041
"../include/repository_init_options.h",
38764042
"../include/config.h",
38774043
"../include/refdb.h",

0 commit comments

Comments
 (0)