MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / describeExtdata

Function describeExtdata

scripts/3ds/universal/extdata.c:87–119  ·  view source on GitHub ↗

Report what is in an archive's root, so the user can tell one that holds a * save from one that is not there at all. Returns the number of root entries, * -1 if there is no archive under that id. */

Source from the content-addressed store, hash-verified

85 * save from one that is not there at all. Returns the number of root entries,
86 * -1 if there is no archive under that id. */
87int describeExtdata(int extdataId)
88{
89 char line[128];
90 int h;
91 int count;
92 struct directory* dir;
93 int i;
94
95 h = sav_open_extdata(extdataId);
96 if (h < 0) {
97 return -1;
98 }
99
100 dir = sav_list(h, "/");
101 if (dir == NULL) {
102 sav_close(h);
103 return 0;
104 }
105
106 count = dir->count;
107 sprintf(line, "extdata 0x%08X: %d entr(y/ies) in the root", extdataId, count);
108 script_log(line);
109 for (i = 0; i < count && i < LIST_MAX; i++) {
110 printf(" %s\n", dir->files[i]);
111 }
112 if (count > LIST_MAX) {
113 printf(" ... and %d more\n", count - LIST_MAX);
114 }
115
116 delete_directory(dir);
117 sav_close(h);
118 return count;
119}
120
121/* Turn extdata_create's return value into something the user can act on. */
122void reportCreateResult(int res, char* name, int extdataId, int defaultId)

Callers 2

inspectFlowFunction · 0.85
deleteFlowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected