forked from enlightenment/efl
Minor changes to ecore_config to make it compile on OS X.
SVN revision: 8236
This commit is contained in:
parent
385bdd4ee5
commit
dc2fa35658
|
@ -538,7 +538,6 @@ src/lib/ecore_con/Makefile
|
|||
src/lib/ecore_ipc/Makefile
|
||||
src/lib/ecore_txt/Makefile
|
||||
src/lib/ecore_config/Makefile
|
||||
src/lib/ecore_config/ipc/Makefile
|
||||
debian/Makefile
|
||||
], [
|
||||
chmod +x ecore-config
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <limits.h>
|
||||
|
||||
|
||||
#include "ipc.h"
|
||||
|
@ -54,9 +55,9 @@ static int print_data(char *d,size_t l) {
|
|||
l=(d[1]<<8)|d[2];
|
||||
if(*d=='s') {
|
||||
f=d+3;
|
||||
printf(" STR-%d: \"%s\"\n",l,f); }
|
||||
printf(" STR-%ld: \"%s\"\n",l,f); }
|
||||
else
|
||||
printf(" skipping chunk type '%c' {%d bytes}...\n",*d,l);
|
||||
printf(" skipping chunk type '%c' {%ld bytes}...\n",*d,l);
|
||||
d+=3+l; }
|
||||
return ECORE_CONFIG_ERR_SUCC; }
|
||||
|
||||
|
@ -104,7 +105,7 @@ int ex_ipc_init(ex_ipc_server_list **srv_list,char *pipe_name,connstate *cs) {
|
|||
sprintf(str,"%s/.ecore/%s/",p,pipe_name);
|
||||
snprintf(buf,PATH_MAX,str);
|
||||
|
||||
if(dir=opendir(buf)) {
|
||||
if((dir=opendir(buf))) {
|
||||
connected=0;
|
||||
while ((socket=readdir(dir))) {
|
||||
if (!strcmp(socket->d_name, ".") || !strcmp(socket->d_name, "..") ||
|
||||
|
|
|
@ -856,8 +856,8 @@ main(int argc, const char **argv)
|
|||
|
||||
#ifdef BUILD_ECORE_X
|
||||
/* setup to test ecore_x module things */
|
||||
/* if (!ecore_x_init(NULL)) return -1; */
|
||||
/* setup_ecore_x_test(); */
|
||||
if (!ecore_x_init(NULL)) return -1;
|
||||
setup_ecore_x_test();
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS
|
||||
|
|
|
@ -97,7 +97,7 @@ int ex_ipc_server_dis(void *data,int type,void *event) {
|
|||
|
||||
int ex_ipc_server_sent(void *data,int type,void *event) {
|
||||
Ewl_Widget *row, *cell[2], *text[2];
|
||||
char *label, *type, *start, *end;
|
||||
char *label, *typename, *start, *end;
|
||||
Ecore_Ipc_Event_Server_Data *e;
|
||||
|
||||
e=(Ecore_Ipc_Event_Server_Data *)event;
|
||||
|
@ -138,7 +138,7 @@ int ex_ipc_server_sent(void *data,int type,void *event) {
|
|||
start++;
|
||||
}
|
||||
start++;
|
||||
type = ++start;
|
||||
typename = ++start;
|
||||
while (*start) {
|
||||
if (*start == '\n') {
|
||||
*start = '\0';
|
||||
|
@ -147,18 +147,18 @@ int ex_ipc_server_sent(void *data,int type,void *event) {
|
|||
start++;
|
||||
}
|
||||
|
||||
if (*label && *type) {
|
||||
if (*label && *typename) {
|
||||
row = ewl_grid_new(2, 1);
|
||||
cell[0] = ewl_cell_new();
|
||||
cell[1] = ewl_cell_new();
|
||||
text[0] = ewl_text_new(label);
|
||||
|
||||
if (!strcmp(type, "string"))
|
||||
if (!strcmp(typename, "string"))
|
||||
text[1] = ewl_entry_new("<a string>");
|
||||
else if (!strcmp(type, "integer"))
|
||||
else if (!strcmp(typename, "integer"))
|
||||
text[1] = ewl_spinner_new();
|
||||
else
|
||||
text[1] = ewl_text_new(type);
|
||||
text[1] = ewl_text_new(typename);
|
||||
ewl_object_set_minimum_h(EWL_OBJECT(text[1]), 12);
|
||||
|
||||
ewl_container_append_child(EWL_CONTAINER(cell[0]), text[0]);
|
||||
|
@ -250,7 +250,7 @@ static int get_token(char **beg,char **end,int tol) {
|
|||
|
||||
|
||||
|
||||
static int handle_any(Ecore_Ipc_Server **server,call *cp,char *line) {
|
||||
static int handle_any(ex_ipc_server_list **server,call *cp,char *line) {
|
||||
long serial=-1;
|
||||
int ret,pars=0,l=0;
|
||||
char *b=line,*e,*file=NULL,*k=NULL,*v=NULL,*m=NULL;
|
||||
|
@ -360,12 +360,10 @@ void __destroy_main_window(Ewl_Widget *main_win, void *ex_data, void *user_data
|
|||
|
||||
|
||||
int main(int argc,char **argv) {
|
||||
Ecore_Ipc_Server *server=NULL;
|
||||
int ret=ECORE_CONFIG_ERR_SUCC,cc=0;
|
||||
connstate cs=OFFLINE;
|
||||
char *p,*f=NULL;
|
||||
char *pipe_name=NULL;
|
||||
char buf[MI];
|
||||
ex_ipc_server_list *server=NULL;
|
||||
int ret=ECORE_CONFIG_ERR_SUCC,cc=0;
|
||||
connstate cs=OFFLINE;
|
||||
char *pipe_name=NULL;
|
||||
|
||||
if (argc <= 1 || (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0)) {
|
||||
print_usage();
|
||||
|
|
|
@ -110,7 +110,7 @@ int debug=99;
|
|||
int ex_ipc_server_con(void *data,int type,void *event) {
|
||||
connstate *cs=(connstate *)data;
|
||||
*cs=ONLINE;
|
||||
E(1,"exsh: Connected .\n"); /*to %s.\n", pipe_name)); */
|
||||
E(1,"exsh: Connected .\n", NULL); /*to %s.\n", pipe_name)); */
|
||||
return 1; }
|
||||
|
||||
|
||||
|
@ -119,7 +119,7 @@ int ex_ipc_server_dis(void *data,int type,void *event) {
|
|||
connstate *cs=(connstate *)data;
|
||||
*cs=OFFLINE;
|
||||
ecore_main_loop_quit();
|
||||
E(1,"exsh: Disconnected.\n");
|
||||
E(1,"exsh: Disconnected.\n", NULL);
|
||||
return 1; }
|
||||
|
||||
|
||||
|
@ -268,7 +268,7 @@ static char *clean(char *c) {
|
|||
p++;
|
||||
} while(*p&&*p!='\"');
|
||||
if(!*p) {
|
||||
E(0,"unterminated string in input?\n");
|
||||
E(0,"unterminated string in input?\n", NULL);
|
||||
*c='\0';
|
||||
return c; }
|
||||
else
|
||||
|
@ -531,7 +531,7 @@ reconnect:
|
|||
printf(IN);
|
||||
if((f=p=fgets(buf,MI,stdin))) {
|
||||
#endif
|
||||
*q=strchr(p,'\n');
|
||||
q=strchr(p,'\n');
|
||||
if(q)
|
||||
*q='\0';
|
||||
if(!strcasecmp(p,"exit")||!strcasecmp(p,"quit")) {
|
||||
|
|
|
@ -731,7 +731,7 @@ _ecore_con_cl_handler(void *data, Ecore_Fd_Handler *fd_handler)
|
|||
if (svr->connecting)
|
||||
{
|
||||
int so_err;
|
||||
socklen_t size;
|
||||
int size;
|
||||
|
||||
svr->connecting = 0;
|
||||
so_err = 0;
|
||||
|
|
|
@ -38,10 +38,11 @@
|
|||
|
||||
#ifdef ECORE_CONFIG_DEBUG
|
||||
# define D(fmt,args...) do { if(DEBUG>=0) fprintf(stderr,fmt,## args); } while(0);
|
||||
# define E(lvl,args...) do { if(DEBUG>=(lvl)) fprintf(stderr,## args); } while(0)
|
||||
#else
|
||||
# define D(msg,args...)
|
||||
# define E(lvl,args...) do { } while(0)
|
||||
#endif
|
||||
#define E(lvl,fmt,args...) do { if(DEBUG>=(lvl)) fprintf(stderr,fmt,## args); } while(0)
|
||||
|
||||
|
||||
/* structures */
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = ipc
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir)/src/lib/ecore \
|
||||
-I$(top_srcdir)/src/lib/ecore_ipc
|
||||
|
@ -18,11 +16,12 @@ Ecore_Config.h
|
|||
libecore_config_la_SOURCES = \
|
||||
ecore_config.c \
|
||||
ipc_main.c \
|
||||
ipc_ecore.c \
|
||||
util.c \
|
||||
edb.c
|
||||
|
||||
libecore_config_la_LIBADD = \
|
||||
$(top_builddir)/src/lib/ecore/libecore.la
|
||||
$(top_builddir)/src/lib/ecore/libecore.la -ldl
|
||||
|
||||
libecore_config_la_DEPENDENCIES = \
|
||||
$(top_builddir)/src/lib/ecore/libecore.la
|
||||
|
@ -33,6 +32,7 @@ EXTRA_DIST = \
|
|||
Ecore_Config.h \
|
||||
ecore_config.c \
|
||||
ipc_main.c \
|
||||
ipc_ecore.c \
|
||||
ipc.h \
|
||||
util.c \
|
||||
util.h \
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int ecore_config_load(Ecore_Config_Bundle *b) {
|
||||
char* file = malloc(1024); /* ### fixme */
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
## Process this file with automake to produce Makefile.in
|
||||
AUTOMAKE_OPTIONS = 1.4 foreign
|
||||
|
||||
# A list of all the files in the current directory which can be regenerated
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
LDFLAGS = -module -avoid-version -rdynamic -shared
|
||||
INCLUDES = -I$(top_srcdir)/src\
|
||||
-I$(top_srcdir)/src/lib/ecore_ipc \
|
||||
-I../../ -I../ -I.
|
||||
|
||||
IPC_ECORE_L = ipc_ecore.la
|
||||
EVSH_L =
|
||||
|
||||
lib_LTLIBRARIES = ecore_config_ipc_ecore.la
|
||||
|
||||
ecore_config_ipc_ecore_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
ecore_config_ipc_ecore_la_SOURCES = ipc_ecore.c
|
||||
ecore_config_ipc_ecore_la_LIBADD = \
|
||||
$(top_builddir)/src/lib/ecore/libecore.la \
|
||||
$(top_builddir)/src/lib/ecore_ipc/libecore_ipc.la
|
||||
ecore_config_ipc_ecore_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -168,12 +169,12 @@ static int ipc_client_sent(void *data,int type,void *event) {
|
|||
|
||||
|
||||
|
||||
int ipc_init(char *pipe_name, void **data) {
|
||||
static int ipc_init(char *pipe_name, void **data) {
|
||||
Ecore_Ipc_Server **server=(Ecore_Ipc_Server **)data;
|
||||
struct stat st;
|
||||
char *p;
|
||||
int port=0;
|
||||
char *str;
|
||||
char *str = NULL;
|
||||
|
||||
if(!server)
|
||||
return ECORE_CONFIG_ERR_FAIL;
|
||||
|
@ -209,14 +210,16 @@ int ipc_init(char *pipe_name, void **data) {
|
|||
ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL, ipc_client_del, server);
|
||||
ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA,ipc_client_sent,server);
|
||||
|
||||
sprintf(str,"IPC/eCore: Server is listening on %s.\n", pipe_name);
|
||||
E(1,str);
|
||||
if(str) {
|
||||
sprintf(str,"IPC/eCore: Server is listening on %s.\n", pipe_name);
|
||||
E(1,str);
|
||||
}
|
||||
|
||||
return ECORE_CONFIG_ERR_SUCC; }
|
||||
|
||||
|
||||
|
||||
int ipc_exit(void **data) {
|
||||
static int ipc_exit(void **data) {
|
||||
int ret=ECORE_CONFIG_ERR_SUCC;
|
||||
Ecore_Ipc_Server **server=(Ecore_Ipc_Server **)data;
|
||||
|
|
@ -34,7 +34,7 @@ typedef struct _ipc {
|
|||
|
||||
|
||||
static ipc *ipc_modules=NULL;
|
||||
static ulong ipc_timer=0L;
|
||||
static unsigned long ipc_timer=0L;
|
||||
|
||||
|
||||
Ecore_Config_Server *srv2ecore_config_srv(void *srv) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/*#include <glib.h>*/
|
||||
|
||||
#include <sys/types.h>
|
||||
/*#include <sys/time.h>*/ /* gimetimeofday() */
|
||||
#include <sys/time.h> /* gimetimeofday() */
|
||||
#include <stdio.h> /* NULL */
|
||||
#include <stdlib.h> /* malloc(), free() */
|
||||
#include <string.h> /* str...() */
|
||||
|
@ -111,9 +111,9 @@ int dlmulti(char *name,char *file,int flag,void **libr,const char *fmt, ...) {
|
|||
|
||||
|
||||
|
||||
ulong now(long delay) {
|
||||
unsigned long now(long delay) {
|
||||
static struct timeval tv;
|
||||
ulong r;
|
||||
unsigned long r;
|
||||
gettimeofday(&tv,NULL);
|
||||
r=tv.tv_sec*1000+(((float)tv.tv_usec)/1000.0)+delay;
|
||||
return r; }
|
||||
|
@ -239,7 +239,7 @@ void qsrt(void *a[],void *data,int lo,int hi,int (*compare)(const void *,const v
|
|||
|
||||
|
||||
|
||||
ulong timeout_add(uint f,int(*fun)(void *),void *data) {
|
||||
unsigned long timeout_add(uint f,int(*fun)(void *),void *data) {
|
||||
#ifdef HAVE_GLIB2
|
||||
return g_timeout_add((guint)f,(GSourceFunc)fun,(gpointer)data);
|
||||
#endif
|
||||
|
@ -247,7 +247,7 @@ ulong timeout_add(uint f,int(*fun)(void *),void *data) {
|
|||
|
||||
|
||||
|
||||
int timeout_remove(ulong handle) {
|
||||
int timeout_remove(unsigned long handle) {
|
||||
#ifdef HAVE_GLIB2
|
||||
return g_source_remove(handle)?ECORE_CONFIG_ERR_SUCC:ECORE_CONFIG_ERR_FAIL;
|
||||
#endif
|
||||
|
|
|
@ -14,7 +14,7 @@ typedef struct _eslist {
|
|||
|
||||
int parse_line(char *,char **,char **,char **,char **);
|
||||
char *unit_size(char *size);
|
||||
/*ulong now(long delay);*/
|
||||
/*unsigned long now(long delay);*/
|
||||
void qsrt(void *a[],void *data,int lo,int hi,int (*compare)(const void *,const void *,const void *));
|
||||
int dlmulti(char *name,char *file,int flag,void **libr,const char *fmt, ...);
|
||||
|
||||
|
@ -53,6 +53,6 @@ int ecat(char **result, ...);
|
|||
|
||||
|
||||
|
||||
/*ulong timeout_add(uint f,int(*fun)(void *),void *data);*/
|
||||
/*int timeout_remove(ulong handle);*/
|
||||
unsigned long timeout_add(unsigned int f,int(*fun)(void *),void *data);
|
||||
int timeout_remove(unsigned long handle);
|
||||
|
||||
|
|
Loading…
Reference in New Issue