Skip to content

Commit

Permalink
gh-6: Compile with automake on Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
FauxFaux committed Mar 19, 2013
1 parent 7f2ed89 commit 44f2dc4
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 16 deletions.
14 changes: 12 additions & 2 deletions adb.c
Expand Up @@ -192,8 +192,18 @@ static const char *adb_init(void *frontend_handle, void **backend_handle,
}

/* send initial data to adb server */

sprintf_s(sendhost,512,"%04xhost:%s",strlen(host)+5,host);
#if _MSC_VER
sprintf_s
#else
snprintf
#endif
(sendhost, 512,
#if _MSC_VER
"%04xhost:%s"
#else
"%04zxhost:%s"
#endif
, strlen(host)+5, host);

sk_write(adb->s,sendhost,strlen(host)+9);
sk_flush(adb->s);
Expand Down
3 changes: 2 additions & 1 deletion cmdline.c
Expand Up @@ -221,7 +221,8 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf)
RETURN(1);
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
default_protocol = cfg->protocol = PROT_ADB;
default_protocol = PROT_ADB;
conf_set_int(conf, CONF_protocol, default_protocol);
}
if (!strcmp(p, "-serial")) {
RETURN(1);
Expand Down
4 changes: 2 additions & 2 deletions mkfiles.pl
Expand Up @@ -1004,8 +1004,6 @@ sub manpages {
"ULDFLAGS = \$(LDFLAGS)\n".
"ifeq (,\$(findstring NO_GSSAPI,\$(COMPAT)))\n".
"ifeq (,\$(findstring STATIC_GSSAPI,\$(COMPAT)))\n".
"XLDFLAGS+= -ldl\n".
"ULDFLAGS+= -ldl\n".
"else\n".
"CFLAGS+= -DNO_LIBDL \$(shell \$(KRB5CONFIG) --cflags gssapi)\n".
"XLDFLAGS+= \$(shell \$(KRB5CONFIG) --libs gssapi)\n".
Expand Down Expand Up @@ -1079,6 +1077,8 @@ sub manpages {
(join " ", map {"-I$dirpfx$_"} @srcdirs)).
" -D _FILE_OFFSET_BITS=64\n".
"ULDFLAGS = \$(LDFLAGS)\n".
"XLDFLAGS+= -ldl\n".
"ULDFLAGS+= -ldl\n".
"INSTALL=install\n".
"INSTALL_PROGRAM=\$(INSTALL)\n".
"INSTALL_DATA=\$(INSTALL)\n".
Expand Down
2 changes: 1 addition & 1 deletion unix/gtkdlg.c
Expand Up @@ -2854,7 +2854,7 @@ int do_config_box(const char *title, Conf *conf, int midsession,

ctrlbox = ctrl_new_box();
protocol = conf_get_int(conf, CONF_protocol);
setup_config_box(ctrlbox, midsession, protocol, protcfginfo);
setup_config_box(ctrlbox, midsession, protocol, protcfginfo, -1);
unix_setup_config_box(ctrlbox, midsession, protocol);
gtk_setup_config_box(ctrlbox, midsession, window);

Expand Down
4 changes: 2 additions & 2 deletions unix/gtkwin.c
Expand Up @@ -3411,7 +3411,7 @@ static void update_savedsess_menu(GtkMenuItem *menuitem, gpointer data)
gtk_container_foreach(GTK_CONTAINER(inst->sessionsmenu),
(GtkCallback)gtk_widget_destroy, NULL);

get_sesslist(&sesslist, TRUE);
get_sesslist(&sesslist, TRUE, -1);
/* skip sesslist.sessions[0] == Default Settings */
for (i = 1; i < sesslist.nsessions; i++) {
GtkWidget *menuitem =
Expand All @@ -3434,7 +3434,7 @@ static void update_savedsess_menu(GtkMenuItem *menuitem, gpointer data)
gtk_container_add(GTK_CONTAINER(inst->sessionsmenu), menuitem);
gtk_widget_show(menuitem);
}
get_sesslist(&sesslist, FALSE); /* free up */
get_sesslist(&sesslist, FALSE, -1); /* free up */
}

void set_window_icon(GtkWidget *window, const char *const *const *icon,
Expand Down
37 changes: 37 additions & 0 deletions unix/urlhack_unix.c
@@ -0,0 +1,37 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "urlhack.h"

void urlhack_launch_url(const char* app, const char *url)
{
const size_t max = 4000;
char buf[max];
const char *browser = NULL;

if (app)
browser = app;
if (NULL == browser || 0 == strlen(browser))
browser = "xdg-open";

snprintf(buf, max, "%s %s", browser, url);

if (!system(buf))
printf("couldn't run browser: %s", buf);
}

int urlhack_is_ctrl_pressed()
{
// TODO
return 1;
}


void rtfm(const char *error)
{
// TODO
}



5 changes: 4 additions & 1 deletion unix/uxstore.c
Expand Up @@ -448,7 +448,10 @@ void del_settings(const char *sessionname)
sfree(filename);
}

void *enum_settings_start(void)
void set_storagetype(int storagetype_IGNORED) {
}

void *enum_settings_start(int storagetype_IGNORED)
{
DIR *dp;
char *filename;
Expand Down
10 changes: 5 additions & 5 deletions windows/re_lib/regexp.c
Expand Up @@ -174,15 +174,15 @@ STATIC void regoptail( char* p, char* val);
STATIC int strcspn();
#endif

static void (*regerror_func)( char* s) = 0;
static void (*regerror_func)( const char* s) = 0;

void regerror( char* s)
void regerror( const char* s)
{
if( regerror_func)
(*regerror_func)( s);
}

void set_regerror_func( void (*func)( char*))
void set_regerror_func( void (*func)( const char*))
{
regerror_func = func;
}
Expand All @@ -208,7 +208,7 @@ regcomp( char* exp)
register regexp *r;
register char *scan;
register char *longest;
register int len;
register size_t len;
int flags;

if (exp == NULL)
Expand Down Expand Up @@ -294,7 +294,7 @@ reg( int paren, int* flagp) /* paren - Parenthesized? */
register char *ret;
register char *br;
register char *ender;
register int parno;
register int parno = 0;
int flags;

*flagp = HASWIDTH; /* Tentatively. */
Expand Down
4 changes: 2 additions & 2 deletions windows/re_lib/regexp.h
Expand Up @@ -11,12 +11,12 @@ typedef struct regexp {
char regstart; /* Internal use only. */
char reganch; /* Internal use only. */
char *regmust; /* Internal use only. */
int regmlen; /* Internal use only. */
size_t regmlen; /* Internal use only. */
char program[1]; /* Unwarranted chumminess with compiler. */
} regexp;

regexp *regcomp( char* re);
int regexec( regexp* r, char* str);
void regsub( regexp* r, char* str, char* substr);
void regerror( char* s); /* for internal use only */
void set_regerror_func( void (*func)( char*));
void set_regerror_func( void (*func)( const char*));
1 change: 1 addition & 0 deletions windows/urlhack.h
Expand Up @@ -21,6 +21,7 @@ void urlhack_add_link_region(int x0, int y0, int x1, int y1);
void urlhack_launch_url(const char* app, const char *url);
int urlhack_is_ctrl_pressed();
void urlhack_set_regular_expression(const char* expression);
void rtfm(const char *error);

void urlhack_init();
void urlhack_cleanup();
Expand Down

0 comments on commit 44f2dc4

Please sign in to comment.