annotate src/xs_title.c @ 217:c1a5b5cf2f28

Titlestring handling
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 15 Dec 2004 11:23:01 +0000
parents
children 608f31f6c095
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
217
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS)
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 Titlestring handling
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 Written by Matti "ccr" Hamalainen <ccr@tnsp.org>
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 This program is free software; you can redistribute it and/or modify
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 it under the terms of the GNU General Public License as published by
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 the Free Software Foundation; either version 2 of the License, or
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 (at your option) any later version.
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 This program is distributed in the hope that it will be useful,
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 GNU General Public License for more details.
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 along with this program; if not, write to the Free Software
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 #include "xs_title.h"
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 #include "xs_support.h"
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 #include "xs_config.h"
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 #include <xmms/titlestring.h>
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 /*
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 * Create a title string based on given information and settings.
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 #define VBUFSIZE (1024)
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 #define VPUTCH(MCH) \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 if (iIndex < VBUFSIZE) tmpBuf[iIndex++] = MCH;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 #define VPUTSTR(MSTR) { \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 if (MSTR) { \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 if ((iIndex + strlen(MSTR) + 1) < VBUFSIZE) { \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 strcpy(&tmpBuf[iIndex], MSTR); \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 iIndex += strlen(MSTR); \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 } else \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 iIndex = VBUFSIZE; \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 } \
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 }
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 gchar *xs_make_titlestring(gchar *pcFilename,
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 gint iSubTune,
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 gint iSidModel,
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 gchar *formatString, gchar *infoString0,
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 gchar *infoString1, gchar *infoString2)
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 {
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 gchar *tmpFilename, *tmpFilePath, *tmpFileExt, *pcStr, *pcResult,
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 tmpStr[VBUFSIZE], tmpBuf[VBUFSIZE];
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 gint iIndex;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 #ifdef HAVE_XMMSEXTRA
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 TitleInput *ptInput;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56 #endif
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 /* Split the filename into path */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 tmpFilePath = g_strdup(pcFilename);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 tmpFilename = xs_strrchr(tmpFilePath, '/');
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 if (tmpFilename)
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 tmpFilename[1] = 0;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 /* Filename */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 tmpFilename = xs_strrchr(pcFilename, '/');
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 if (tmpFilename)
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 tmpFilename = g_strdup(tmpFilename + 1);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 else
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 tmpFilename = g_strdup(pcFilename);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 tmpFileExt = xs_strrchr(tmpFilename, '.');
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 tmpFileExt[0] = 0;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 /* Extension */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 tmpFileExt = xs_strrchr(pcFilename, '.');
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 #ifdef HAVE_XMMSEXTRA
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 /* Check if the titles are overridden or not */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 if (!xs_cfg.titleOverride)
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 {
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 /* Use generic XMMS titles */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 /* XMMS_NEW_TITLEINPUT(ptInput);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 * We duplicate and add typecast to the code here due to XMMS's braindead headers
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 ptInput = (TitleInput *) g_malloc0(sizeof(TitleInput));
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 ptInput->__size = XMMS_TITLEINPUT_SIZE;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 ptInput->__version = XMMS_TITLEINPUT_VERSION;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 /* Create the input fields */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 ptInput->file_name = tmpFilename;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 ptInput->file_ext = tmpFileExt;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 ptInput->file_path = tmpFilePath;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95 ptInput->track_name = infoString0;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 ptInput->track_number = iSubTune;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 ptInput->album_name = NULL;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 ptInput->performer = infoString1;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 ptInput->date = g_strdup((iSidModel == XS_SIDMODEL_6581) ? "SID6581" : "SID8580");
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 ptInput->year = 0;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 ptInput->genre = g_strdup("SID-tune");
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 ptInput->comment = infoString2;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 /* Create the string */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106 pcResult = xmms_get_titlestring(xmms_get_gentitle_format(), ptInput);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108 /* Dispose all allocated memory */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109 g_free(ptInput->date);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110 g_free(ptInput->genre);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 g_free(ptInput);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 }
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 else
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 #endif
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 {
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116 /* Create the string */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 pcStr = xs_cfg.titleFormat;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118 iIndex = 0;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 while (*pcStr && (iIndex < VBUFSIZE))
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 {
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121 if (*pcStr == '%')
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 {
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123 pcStr++;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 switch (*pcStr) {
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 case '%': VPUTCH('%'); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126 case 'f': VPUTSTR(tmpFilename); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 case 'F': VPUTSTR(tmpFilePath); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 case 'e': VPUTSTR(tmpFileExt); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 case 'p': VPUTSTR(infoString1); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 case 't': VPUTSTR(infoString0); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 case 'c': VPUTSTR(infoString2); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 case 's': VPUTSTR(formatString); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133 case 'm':
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 switch (iSidModel) {
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 case XS_SIDMODEL_6581: VPUTSTR("SID6581"); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 case XS_SIDMODEL_8580: VPUTSTR("SID8580"); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137 default: VPUTSTR("Unknown SID"); break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 }
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139 break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 case 'n':
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141 snprintf(tmpStr, VBUFSIZE, "%i", iSubTune);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142 VPUTSTR(tmpStr);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 break;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 }
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145 } else {
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146 VPUTCH(*pcStr);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 }
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148 pcStr++;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
149 }
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 tmpBuf[iIndex] = 0;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153 /* Make resulting string */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154 pcResult = g_strdup(tmpBuf);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155 }
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157 /* Free temporary strings */
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158 g_free(tmpFilename);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159 g_free(tmpFilePath);
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 return pcResult;
c1a5b5cf2f28 Titlestring handling
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 }