annotate src/xs_title.c @ 324:dd201740a720

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