mirror of
https://github.com/lakinduakash/linux-wifi-hotspot.git
synced 2024-11-21 19:40:11 +00:00
Add util.c
This commit is contained in:
parent
5d16c3b4c3
commit
e3e3418a11
@ -10,7 +10,7 @@ include_directories(${X11_INCLUDE_DIRS})
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set (CMAKE_CXX_STANDARD 11)
|
||||
|
||||
add_executable(wihotspot ui/main.c ui/h_prop.c ui/h_prop.h ui/ui.c ui/ui.h ui/read_config.cpp ui/read_config.h)
|
||||
add_executable(wihotspot ui/main.c ui/h_prop.c ui/h_prop.h ui/ui.c ui/ui.h ui/read_config.cpp ui/read_config.h ui/util.c ui/util.h)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ${GTK_LIBRARIES} ${X11_LIBRARIES} config)
|
||||
|
||||
|
@ -199,6 +199,10 @@
|
||||
<object class="GtkProgressBar" id="progress_bar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">10</property>
|
||||
<property name="margin_right">10</property>
|
||||
<property name="margin_top">1</property>
|
||||
<property name="margin_bottom">1</property>
|
||||
<property name="pulse_step">0.20000000000000001</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
14
src/ui/ui.c
14
src/ui/ui.c
@ -11,6 +11,7 @@
|
||||
#include "h_prop.h"
|
||||
#include "ui.h"
|
||||
#include "read_config.h"
|
||||
#include "util.h"
|
||||
|
||||
#define BUFSIZE 1024
|
||||
#define AP_ENABLED "AP-ENABLED"
|
||||
@ -282,19 +283,6 @@ void* init_running_info(){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int find_str(char *find, const char **array, int length) {
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < length; i++ ) {
|
||||
if (strcmp(array[i], find) == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
static void *run_create_hp_shell(void *cmd) {
|
||||
|
||||
|
@ -20,8 +20,6 @@ static void* run_create_hp_shell(void *cmd);
|
||||
|
||||
void init_interface_list();
|
||||
|
||||
static int find_str(char *find, const char **array, int length);
|
||||
|
||||
void* init_running_info();
|
||||
|
||||
static gboolean update_progress_in_timeout (gpointer pbar);
|
||||
|
20
src/ui/util.c
Normal file
20
src/ui/util.c
Normal file
@ -0,0 +1,20 @@
|
||||
//
|
||||
// Created by lakinduakash on 16/04/19.
|
||||
//
|
||||
|
||||
#include <string.h>
|
||||
#include "util.h"
|
||||
|
||||
int find_str(char *find, const char **array, int length) {
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < length; i++ ) {
|
||||
if (strcmp(array[i], find) == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
|
||||
}
|
10
src/ui/util.h
Normal file
10
src/ui/util.h
Normal file
@ -0,0 +1,10 @@
|
||||
//
|
||||
// Created by lakinduakash on 16/04/19.
|
||||
//
|
||||
|
||||
#ifndef WIHOTSPOT_UTIL_H
|
||||
#define WIHOTSPOT_UTIL_H
|
||||
|
||||
int find_str(char *find, const char **array, int length);
|
||||
|
||||
#endif //WIHOTSPOT_UTIL_H
|
Loading…
Reference in New Issue
Block a user