diff options
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/fe-text.c | 41 | ||||
-rw-r--r-- | src/fe-text/fe-text.vcxproj | 60 |
2 files changed, 25 insertions, 76 deletions
diff --git a/src/fe-text/fe-text.c b/src/fe-text/fe-text.c index c8b64ab0..209a3d03 100644 --- a/src/fe-text/fe-text.c +++ b/src/fe-text/fe-text.c @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -78,7 +80,6 @@ fe_new_window (struct session *sess, int focus) { char buf[512]; - sess->gui = malloc (4); current_sess = sess; if (!sess->server->front_session) @@ -92,13 +93,11 @@ fe_new_window (struct session *sess, int focus) return; done_intro = 1; - snprintf (buf, sizeof (buf), + g_snprintf (buf, sizeof (buf), "\n" " \017HexChat-Text \00310"PACKAGE_VERSION"\n" - " \017Running on \00310%s \017glib \00310%d.%d.%d\n" - " \017This binary compiled \00310"__DATE__"\017\n", - get_sys_str (1), - glib_major_version, glib_minor_version, glib_micro_version); + " \017Running on \00310%s\n", + get_sys_str (1)); fe_print_text (sess, buf, 0, FALSE); fe_print_text (sess, "\n\nCompiled in Features\0032:\017 " @@ -111,9 +110,6 @@ fe_new_window (struct session *sess, int focus) #ifdef USE_OPENSSL "OpenSSL " #endif -#ifdef USE_IPV6 - "IPv6" -#endif "\n\n", 0, FALSE); fflush (stdout); } @@ -140,7 +136,7 @@ timecat (char *buf, time_t stamp) /* Windows doesn't handle ANSI codes in cmd.exe, need to not display them */ #ifndef WIN32 -/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */ +/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */ static const short colconv[] = { 0, 7, 4, 2, 1, 3, 5, 11, 13, 12, 6, 16, 14, 15, 10, 7 }; void @@ -151,7 +147,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp, char num[8]; int reverse = 0, under = 0, bold = 0, comma, k, i = 0, j = 0, len = strlen (text); - unsigned char *newtext = malloc (len + 1024); + unsigned char *newtext = g_malloc (len + 1024); if (prefs.hex_stamp_text) { @@ -207,7 +203,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp, else col = 30; mirc = atoi (num); - mirc = colconv[mirc]; + mirc = colconv[mirc % G_N_ELEMENTS(colconv)]; if (mirc > 9) { mirc += 50; @@ -308,7 +304,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp, newtext[j] = 0; write (STDOUT_FILENO, newtext, j); - free (newtext); + g_free (newtext); } #else /* The win32 version for cmd.exe */ @@ -319,7 +315,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp, int dotime = FALSE; int comma, k, i = 0, j = 0, len = strlen (text); - unsigned char *newtext = malloc (len + 1024); + unsigned char *newtext = g_malloc (len + 1024); if (prefs.hex_stamp_text) { @@ -403,7 +399,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp, newtext[j] = 0; write (STDOUT_FILENO, newtext, j); - free (newtext); + g_free (newtext); } #endif @@ -508,14 +504,14 @@ fe_args (int argc, char *argv[]) { #ifdef WIN32 /* see the chdir() below */ - char *sl, *exe = strdup (argv[0]); + char *sl, *exe = g_strdup (argv[0]); sl = strrchr (exe, '\\'); if (sl) { *sl = 0; printf ("%s\\plugins\n", exe); } - free (exe); + g_free (exe); #else printf ("%s\n", HEXCHATLIBDIR); #endif @@ -530,8 +526,7 @@ fe_args (int argc, char *argv[]) if (arg_cfgdir) /* we want filesystem encoding */ { - if (xdir) - g_free (xdir); + g_free (xdir); xdir = strdup (arg_cfgdir); if (xdir[strlen (xdir) - 1] == '/') xdir[strlen (xdir) - 1] = 0; @@ -583,7 +578,6 @@ fe_exit (void) void fe_new_server (struct server *serv) { - serv->gui = malloc (4); } void @@ -682,7 +676,7 @@ fe_progressbar_end (struct server *serv) { } void -fe_userlist_insert (struct session *sess, struct User *newuser, int row, int sel) +fe_userlist_insert (struct session *sess, struct User *newuser, gboolean sel) { } int @@ -695,10 +689,6 @@ fe_userlist_rehash (struct session *sess, struct User *user) { } void -fe_userlist_move (struct session *sess, struct User *user, int new_row) -{ -} -void fe_userlist_numbers (struct session *sess) { } @@ -910,7 +900,6 @@ void fe_tray_set_flash (const char *filename1, const char *filename2, int timeou void fe_tray_set_file (const char *filename){} void fe_tray_set_icon (feicon icon){} void fe_tray_set_tooltip (const char *text){} -void fe_tray_set_balloon (const char *title, const char *text){} void fe_userlist_update (session *sess, struct User *user){} void fe_open_chan_list (server *serv, char *filter, int do_refresh) diff --git a/src/fe-text/fe-text.vcxproj b/src/fe-text/fe-text.vcxproj index c59c57bc..1da7e733 100644 --- a/src/fe-text/fe-text.vcxproj +++ b/src/fe-text/fe-text.vcxproj @@ -2,6 +2,7 @@ <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Label="Configuration"> <PlatformToolset>v120</PlatformToolset> + <ConfigurationType>Application</ConfigurationType> </PropertyGroup> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Release|Win32"> @@ -19,77 +20,38 @@ <RootNamespace>fetext</RootNamespace> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="..\..\win32\hexchat.props" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="..\..\win32\hexchat.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <TargetName>hexchat-text</TargetName> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <LinkIncremental>false</LinkIncremental> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\win32\hexchat.props" /> + <PropertyGroup> <TargetName>hexchat-text</TargetName> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> + <OutDir>$(HexChatRel)</OutDir> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MultiProcessorCompilation>true</MultiProcessorCompilation> + <AdditionalIncludeDirectories>$(HexChatLib);$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> - <AdditionalDependencies>$(DepLibs);"$(OutDir)\common.lib";%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>$(DepLibs);$(HexChatLib)common.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_CONSOLE;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MultiProcessorCompilation>true</MultiProcessorCompilation> + <AdditionalIncludeDirectories>$(HexChatLib);$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> - <AdditionalDependencies>$(DepLibs);"$(OutDir)\common.lib";%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>$(DepLibs);$(HexChatLib)common.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Link> </ItemDefinitionGroup> @@ -100,6 +62,4 @@ <ClCompile Include="fe-text.c" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file +</Project> |