flag
This commit is contained in:
21
flag.c
21
flag.c
@@ -53,6 +53,16 @@ static uint32 flag_get_dword_lh(uint8 *p)
|
||||
((uint32)p[3] << 24));
|
||||
}
|
||||
|
||||
static void flag_debug_bytes(char *tag, uint8 *p, int len)
|
||||
{
|
||||
int i;
|
||||
fprintf(stderr, "FLAGDBG %s len=%d", tag, len);
|
||||
if (len > 32) len = 32;
|
||||
for (i = 0; i < len; i++)
|
||||
fprintf(stderr, " %02X", p[i]);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
static int flag_get_current_drive(void)
|
||||
{
|
||||
REGS regs;
|
||||
@@ -137,6 +147,10 @@ static int flag_ncp87_obtain_attrs(char *name, uint32 *attrs)
|
||||
repl.len = sizeof(repl.data);
|
||||
|
||||
neterrno = Net_Call(0x5700, &req, &repl);
|
||||
fprintf(stderr, "FLAGDBG obtain name=%s rc=%d req.len=%u repl.len=%u\n",
|
||||
name, neterrno, req.len, repl.len);
|
||||
flag_debug_bytes("obtain-repl", repl.data, repl.len);
|
||||
|
||||
if (neterrno)
|
||||
return(-1);
|
||||
|
||||
@@ -147,6 +161,9 @@ static int flag_ncp87_obtain_attrs(char *name, uint32 *attrs)
|
||||
if (attrs)
|
||||
*attrs = flag_get_dword_lh(repl.data);
|
||||
|
||||
if (attrs)
|
||||
fprintf(stderr, "FLAGDBG obtain attrs=%08lX\n", *attrs);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -193,6 +210,10 @@ static int flag_ncp87_modify_attrs(char *name, uint32 attrs)
|
||||
repl.len = sizeof(repl.data);
|
||||
|
||||
neterrno = Net_Call(0x5700, &req, &repl);
|
||||
fprintf(stderr, "FLAGDBG modify name=%s attrs=%08lX rc=%d req.len=%u repl.len=%u\n",
|
||||
name, attrs, neterrno, req.len, repl.len);
|
||||
flag_debug_bytes("modify-repl", repl.data, repl.len);
|
||||
|
||||
if (neterrno)
|
||||
return(-1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user