summaryrefslogtreecommitdiff
path: root/hw/kdrive/src/kinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/kdrive/src/kinfo.c')
-rw-r--r--hw/kdrive/src/kinfo.c71
1 files changed, 34 insertions, 37 deletions
diff --git a/hw/kdrive/src/kinfo.c b/hw/kdrive/src/kinfo.c
index 0055b16db..01ae1e491 100644
--- a/hw/kdrive/src/kinfo.c
+++ b/hw/kdrive/src/kinfo.c
@@ -25,17 +25,16 @@
#endif
#include "kdrive.h"
-KdCardInfo *kdCardInfo;
+KdCardInfo *kdCardInfo;
KdCardInfo *
-KdCardInfoAdd (KdCardFuncs *funcs,
- void *closure)
+KdCardInfoAdd(KdCardFuncs * funcs, void *closure)
{
- KdCardInfo *ci, **prev;
+ KdCardInfo *ci, **prev;
- ci = calloc(1, sizeof (KdCardInfo));
+ ci = calloc(1, sizeof(KdCardInfo));
if (!ci)
- return 0;
+ return 0;
for (prev = &kdCardInfo; *prev; prev = &(*prev)->next);
*prev = ci;
ci->cfuncs = funcs;
@@ -47,39 +46,38 @@ KdCardInfoAdd (KdCardFuncs *funcs,
}
KdCardInfo *
-KdCardInfoLast (void)
+KdCardInfoLast(void)
{
- KdCardInfo *ci;
+ KdCardInfo *ci;
if (!kdCardInfo)
- return 0;
+ return 0;
for (ci = kdCardInfo; ci->next; ci = ci->next);
return ci;
}
void
-KdCardInfoDispose (KdCardInfo *ci)
+KdCardInfoDispose(KdCardInfo * ci)
{
- KdCardInfo **prev;
+ KdCardInfo **prev;
for (prev = &kdCardInfo; *prev; prev = &(*prev)->next)
- if (*prev == ci)
- {
- *prev = ci->next;
- free(ci);
- break;
- }
+ if (*prev == ci) {
+ *prev = ci->next;
+ free(ci);
+ break;
+ }
}
KdScreenInfo *
-KdScreenInfoAdd (KdCardInfo *ci)
+KdScreenInfoAdd(KdCardInfo * ci)
{
- KdScreenInfo *si, **prev;
- int n;
+ KdScreenInfo *si, **prev;
+ int n;
- si = calloc(1, sizeof (KdScreenInfo));
+ si = calloc(1, sizeof(KdScreenInfo));
if (!si)
- return 0;
+ return 0;
for (prev = &ci->screenList, n = 0; *prev; prev = &(*prev)->next, n++);
*prev = si;
si->next = 0;
@@ -89,30 +87,29 @@ KdScreenInfoAdd (KdCardInfo *ci)
}
void
-KdScreenInfoDispose (KdScreenInfo *si)
+KdScreenInfoDispose(KdScreenInfo * si)
{
- KdCardInfo *ci = si->card;
- KdScreenInfo **prev;
+ KdCardInfo *ci = si->card;
+ KdScreenInfo **prev;
for (prev = &ci->screenList; *prev; prev = &(*prev)->next) {
- if (*prev == si)
- {
- *prev = si->next;
- free(si);
- if (!ci->screenList)
- KdCardInfoDispose (ci);
- break;
- }
+ if (*prev == si) {
+ *prev = si->next;
+ free(si);
+ if (!ci->screenList)
+ KdCardInfoDispose(ci);
+ break;
+ }
}
}
KdPointerInfo *
-KdNewPointer (void)
+KdNewPointer(void)
{
KdPointerInfo *pi;
int i;
- pi = (KdPointerInfo *)calloc(1, sizeof(KdPointerInfo));
+ pi = (KdPointerInfo *) calloc(1, sizeof(KdPointerInfo));
if (!pi)
return NULL;
@@ -132,7 +129,7 @@ KdNewPointer (void)
}
void
-KdFreePointer(KdPointerInfo *pi)
+KdFreePointer(KdPointerInfo * pi)
{
free(pi->name);
free(pi->path);
@@ -141,7 +138,7 @@ KdFreePointer(KdPointerInfo *pi)
}
void
-KdFreeKeyboard(KdKeyboardInfo *ki)
+KdFreeKeyboard(KdKeyboardInfo * ki)
{
free(ki->name);
free(ki->path);