init: Move prototypes for util.c into util.h

Change-Id: I46a91849ce5297eb2597dd6134412f817564ec24
diff --git a/init/builtins.c b/init/builtins.c
index 8e5eed8..7696954 100644
--- a/init/builtins.c
+++ b/init/builtins.c
@@ -36,6 +36,7 @@
 #include "property_service.h"
 #include "devices.h"
 #include "parser.h"
+#include "util.h"
 
 #include <private/android_filesystem_config.h>
 
diff --git a/init/init.c b/init/init.c
index b76fa66..3d619b9 100755
--- a/init/init.c
+++ b/init/init.c
@@ -45,6 +45,7 @@
 #include "signal_handler.h"
 #include "keychords.h"
 #include "parser.h"
+#include "util.h"
 
 static int property_triggers_enabled = 0;
 
diff --git a/init/init.h b/init/init.h
index 4d0593d..1ebdbac 100644
--- a/init/init.h
+++ b/init/init.h
@@ -17,16 +17,8 @@
 #ifndef _INIT_INIT_H
 #define _INIT_INIT_H
 
-int mtd_name_to_number(const char *name);
-
 void handle_control_message(const char *msg, const char *arg);
 
-int create_socket(const char *name, int type, mode_t perm,
-                  uid_t uid, gid_t gid);
-
-void *read_file(const char *fn, unsigned *_sz);
-time_t gettime(void);
-
 void log_init(void);
 void log_set_level(int level);
 void log_close(void);
@@ -40,8 +32,6 @@
 #define LOG_DEFAULT_LEVEL  3  /* messages <= this level are logged */
 #define LOG_UEVENTS        0  /* log uevent messages if 1. verbose */
 
-unsigned int decode_uid(const char *s);
-
 struct listnode
 {
     struct listnode *next;
diff --git a/init/parser.c b/init/parser.c
index 9ea9274..9424e7e 100644
--- a/init/parser.c
+++ b/init/parser.c
@@ -10,6 +10,7 @@
 #include "init.h"
 #include "property_service.h"
 #include "parser.h"
+#include "util.h"
 
 #include <cutils/iosched_policy.h>
 
diff --git a/init/property_service.c b/init/property_service.c
index 28160f8..b1c6552 100644
--- a/init/property_service.c
+++ b/init/property_service.c
@@ -43,6 +43,7 @@
 
 #include "property_service.h"
 #include "init.h"
+#include "util.h"
 
 #define PERSISTENT_PROPERTY_DIR  "/data/property"
 
diff --git a/init/signal_handler.c b/init/signal_handler.c
index 56352f1..b16eef1 100644
--- a/init/signal_handler.c
+++ b/init/signal_handler.c
@@ -26,6 +26,7 @@
 #include <sys/reboot.h>
 
 #include "init.h"
+#include "util.h"
 
 static int signal_fd = -1;
 static int signal_recv_fd = -1;
diff --git a/init/util.h b/init/util.h
new file mode 100644
index 0000000..4f473ec
--- /dev/null
+++ b/init/util.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _INIT_UTIL_H_
+#define _INIT_UTIL_H_
+
+int mtd_name_to_number(const char *name);
+int create_socket(const char *name, int type, mode_t perm,
+                  uid_t uid, gid_t gid);
+void *read_file(const char *fn, unsigned *_sz);
+time_t gettime(void);
+unsigned int decode_uid(const char *s);
+
+#endif