Line 388: |
Line 388: |
| ! Cmd || Name || Notes | | ! Cmd || Name || Notes |
| |- | | |- |
− | | 0 || Set || Takes a [[#ContentMetaKey]], a type-5 [[CNMT#Content_records|Content Records]] buffer and a u64 size. | + | | 0 || Set || Takes a [[#ContentMetaKey]], a type-5 [[CNMT#Content_Records|Content Records]] buffer and a u64 size. |
| |- | | |- |
− | | 1 || Get || Takes a [[#ContentMetaKey]], a type-6 buffer to write [[CNMT#Content_records|Content Records]] to and a u64 size. Returns the actual number of bytes read into the buffer. First 8 bytes of the data is header (u16 numExtraDataBytes, numContentRecords, numMetaRecords, padding). After the header is numExtraDataBytes of additional data, after which follow content records and content meta keys. Set takes this same data as input. | + | | 1 || Get || Takes a [[#ContentMetaKey]], a type-6 buffer to write [[CNMT#Content_Records|Content Records]] to and a u64 size. Returns the actual number of bytes read into the buffer. First 8 bytes of the data is header (u16 numExtraDataBytes, numContentRecords, numMetaRecords, padding). After the header is numExtraDataBytes of additional data, after which follow content records and content meta keys. Set takes this same data as input. |
| |- | | |- |
| | 2 || Remove || Takes a [[#ContentMetaKey]], and removes the associated record. | | | 2 || Remove || Takes a [[#ContentMetaKey]], and removes the associated record. |
Line 396: |
Line 396: |
| | 3 || GetContentIdByType || Takes a [[#ContentMetaKey]] and a u8 [[#ContentMetaType]]. Returns a [[#ContentId]]. | | | 3 || GetContentIdByType || Takes a [[#ContentMetaKey]] and a u8 [[#ContentMetaType]]. Returns a [[#ContentId]]. |
| |- | | |- |
− | | 4 || ListContentInfo || Takes a type-6 buffer to write [[CNMT#Content_records|Content Record]] entries to, a [[#ContentMetaKey]], and a s32 index into the Content Record entries to start copying from. Returns a s32 entries_read. | + | | 4 || ListContentInfo || Takes a type-6 buffer to write [[CNMT#Content_Records|Content Record]] entries to, a [[#ContentMetaKey]], and a s32 index into the Content Record entries to start copying from. Returns a s32 entries_read. |
| |- | | |- |
| | 5 || List || Takes a type-6 buffer to write [[#ContentMetaKey]]s to, a u32 [[#ContentMetaType]], a [[#ProgramId]], a u64 ProgramId_Low, and u64 ProgramId_High. Writes into the buffer all Content Meta Keys with low <= record->title_id <= high, and record->type == type. Returns s32 numEntriesTotal, numEntriesWritten. Additionally requires record->title_id == TID, if record->type is Application, Patch, Add-On, or Delta, otherwise, you can pass 0 for type to ignore the type and list them all in the range. | | | 5 || List || Takes a type-6 buffer to write [[#ContentMetaKey]]s to, a u32 [[#ContentMetaType]], a [[#ProgramId]], a u64 ProgramId_Low, and u64 ProgramId_High. Writes into the buffer all Content Meta Keys with low <= record->title_id <= high, and record->type == type. Returns s32 numEntriesTotal, numEntriesWritten. Additionally requires record->title_id == TID, if record->type is Application, Patch, Add-On, or Delta, otherwise, you can pass 0 for type to ignore the type and list them all in the range. |
Line 408: |
Line 408: |
| | 9 || HasAll || Takes a type-0x5 input buffer containing an array of [[#ContentMetaKey]], and returns whether all of those records are present in the database. | | | 9 || HasAll || Takes a type-0x5 input buffer containing an array of [[#ContentMetaKey]], and returns whether all of those records are present in the database. |
| |- | | |- |
− | | 10 || GetSize || Takes a [[#ContentMetaKey]], and returns the size of the associated [[CNMT#Content_records|Content Records]]. | + | | 10 || GetSize || Takes a [[#ContentMetaKey]], and returns the size of the associated [[CNMT#Content_Records|Content Records]]. |
| |- | | |- |
| | 11 || GetRequiredSystemVersion || Takes a [[#ContentMetaKey]], and returns u32 from ContentRecords + 16 (only if the content meta key has type Application or Patch). | | | 11 || GetRequiredSystemVersion || Takes a [[#ContentMetaKey]], and returns u32 from ContentRecords + 16 (only if the content meta key has type Application or Patch). |