Rev 154 | Rev 162 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 154 | Rev 161 | ||
---|---|---|---|
Line 161... | Line 161... | ||
161 | WRITE_WIDESTRING (L"smilies", L"\"plz\"", L"please.txt"); |
161 | WRITE_WIDESTRING (L"smilies", L"\"plz\"", L"please.txt"); |
162 | WRITE_WIDESTRING (L"smilies", L"\":(\"", L"sad.txt"); |
162 | WRITE_WIDESTRING (L"smilies", L"\":(\"", L"sad.txt"); |
163 | WRITE_WIDESTRING (L"smilies", L"\":-(\"", L"sad.txt"); |
163 | WRITE_WIDESTRING (L"smilies", L"\":-(\"", L"sad.txt"); |
164 | WRITE_WIDESTRING (L"smilies", L"\":)\"", L"smile.txt"); |
164 | WRITE_WIDESTRING (L"smilies", L"\":)\"", L"smile.txt"); |
165 | WRITE_WIDESTRING (L"smilies", L"\":-)\"", L"smile.txt"); |
165 | WRITE_WIDESTRING (L"smilies", L"\":-)\"", L"smile.txt"); |
- | 166 | WRITE_WIDESTRING (L"smilies", L"\"=)\"", L"smile.txt"); |
|
166 | WRITE_WIDESTRING (L"smilies", L"\":s\"", L"sorry.txt"); |
167 | WRITE_WIDESTRING (L"smilies", L"\":s\"", L"sorry.txt"); |
167 | WRITE_WIDESTRING (L"smilies", L"\":-s\"", L"sorry.txt"); |
168 | WRITE_WIDESTRING (L"smilies", L"\":-s\"", L"sorry.txt"); |
168 | WRITE_WIDESTRING (L"smilies", L"\"b)\"", L"star.txt"); |
169 | WRITE_WIDESTRING (L"smilies", L"\"b)\"", L"star.txt"); |
169 | WRITE_WIDESTRING (L"smilies", L"\"b-)\"", L"star.txt"); |
170 | WRITE_WIDESTRING (L"smilies", L"\"b-)\"", L"star.txt"); |
170 | WRITE_WIDESTRING (L"smilies", L"\":p\"", L"tongue.txt"); |
171 | WRITE_WIDESTRING (L"smilies", L"\":p\"", L"tongue.txt"); |
Line 185... | Line 186... | ||
185 | // for each smiley we can read, reallocate smilies array to hold one smiley more |
186 | // for each smiley we can read, reallocate smilies array to hold one smiley more |
186 | smilies = (smiley_t *) SAFE_realloc (smilies, smiley_count, smiley_count + 1, sizeof (smiley_t), false); |
187 | smilies = (smiley_t *) SAFE_realloc (smilies, smiley_count, smiley_count + 1, sizeof (smiley_t), false); |
187 | 188 | ||
188 | smiley = &smilies[smiley_count]; // quick access to smiley |
189 | smiley = &smilies[smiley_count]; // quick access to smiley |
189 | 190 | ||
190 | // read the smiley name and |
191 | // read the smiley name and enclose it between a leading and trailing space |
191 |
|
192 | swprintf_s (smiley->name, WCHAR_SIZEOF (smiley->name), L" %s ", smiley_name); |
192 | smiley->name[0] = L' '; // convert leading quote to a space |
- | |
193 | smiley->name[wcslen (smiley->name) - 1] = L' '; // convert ending quote to a space |
- | |
194 | 193 | ||
195 | // now read the smiley's corresponding picture file |
194 | // now read the smiley's corresponding picture file |
196 | READ_WIDESTRING (smiley->filename, inifile, L"smilies", smiley_name, L"smile. |
195 | READ_WIDESTRING (smiley->filename, inifile, L"smilies", smiley_name, L"smile.txt"); |
197 | 196 | ||
198 | // is this filename the same as another smiley we know already ? |
197 | // is this filename the same as another smiley we know already ? |
199 | for (smiley_index = 0; smiley_index < smiley_count; smiley_index++) |
198 | for (smiley_index = 0; smiley_index < smiley_count; smiley_index++) |
200 | if (wcscmp (smilies[smiley_index].filename, smiley->filename) == 0) |
199 | if (wcscmp (smilies[smiley_index].filename, smiley->filename) == 0) |
201 | break; // break as soon as we find a match |
200 | break; // break as soon as we find a match |