Minor cleanup, fixed warnings.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13115 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-06-14 13:27:26 +00:00
parent 43ed6aa0db
commit 494301a5aa

View File

@ -10,8 +10,12 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
typedef struct
{ #define NO_ERRORS 0
#define ARGUMENT_MISSING 1
#define WRONG_DIR_TYPE 2
typedef struct {
const char *key; const char *key;
directory_which value; directory_which value;
} directoryType; } directoryType;
@ -78,7 +82,9 @@ directoryType directoryTypes[] = {
{NULL,B_USER_DESKBAR_DIRECTORY} {NULL,B_USER_DESKBAR_DIRECTORY}
}; };
void listDirectoryWhich(void)
static void
listDirectoryWhich(void)
{ {
int i; int i;
@ -87,25 +93,27 @@ void listDirectoryWhich(void)
} }
} }
bool retrieveDirValue(directoryType *list, const char *key, directory_which *value_out)
static bool
retrieveDirValue(directoryType *list, const char *key, directory_which *value_out)
{ {
unsigned i = 0; unsigned i = 0;
while (list[i].key != NULL) while (list[i].key != NULL) {
{ if (strcmp(list[i].key, key) == 0) {
if (strcmp(list[i].key, key) == 0)
{
*value_out = list[i].value; *value_out = list[i].value;
return true; return true;
} }
i++; i++;
} }
return false; return false;
} }
void usageMsg()
static void
usageMsg()
{ {
printf("usage: /bin/finddir -l | [ -v volume ] directory_which\n"); printf("usage: /bin/finddir -l | [ -v volume ] directory_which\n");
printf("\t-l\t list valid which constants to use\n"); printf("\t-l\t list valid which constants to use\n");
@ -117,11 +125,9 @@ void usageMsg()
printf(" see the find_directory(...) documentation in the Be Book.\n"); printf(" see the find_directory(...) documentation in the Be Book.\n");
} }
#define NO_ERRORS 0
#define ARGUMENT_MISSING 1
#define WRONG_DIR_TYPE 2
int main(int argc, char *argv[]) int
main(int argc, char *argv[])
{ {
int directoryArgNr; int directoryArgNr;
int status; int status;