comparison libpurple/protocols/oscar/util.c @ 19642:c0f503c18f7e

A little function name shuffling.
author Mark Doliner <mark@kingant.net>
date Tue, 04 Sep 2007 08:09:55 +0000
parents c298830e237f
children 44b4e8bd759b
comparison
equal deleted inserted replaced
19641:eb0933e158a4 19642:c0f503c18f7e
169 * Check if the given screen name is a valid ICQ screen name. 169 * Check if the given screen name is a valid ICQ screen name.
170 * Example: 1234567 170 * Example: 1234567
171 * 171 *
172 * @return TRUE if the screen name is valid, FALSE if not. 172 * @return TRUE if the screen name is valid, FALSE if not.
173 */ 173 */
174 static gboolean 174 gboolean
175 aim_snvalid_icq(const char *sn) 175 aim_snvalid_icq(const char *sn)
176 { 176 {
177 int i; 177 int i;
178 178
179 for (i = 0; sn[i] != '\0'; i++) { 179 for (i = 0; sn[i] != '\0'; i++) {
188 * Check if the given screen name is a valid SMS screen name. 188 * Check if the given screen name is a valid SMS screen name.
189 * Example: +19195551234 189 * Example: +19195551234
190 * 190 *
191 * @return TRUE if the screen name is valid, FALSE if not. 191 * @return TRUE if the screen name is valid, FALSE if not.
192 */ 192 */
193 static gboolean 193 gboolean
194 aim_snvalid_sms(const char *sn) 194 aim_snvalid_sms(const char *sn)
195 { 195 {
196 int i; 196 int i;
197 197
198 if (sn[0] != '+') 198 if (sn[0] != '+')
216 { 216 {
217 if ((sn == NULL) || (*sn == '\0')) 217 if ((sn == NULL) || (*sn == '\0'))
218 return FALSE; 218 return FALSE;
219 219
220 return aim_snvalid_icq(sn) || aim_snvalid_sms(sn) || aim_snvalid_aim(sn); 220 return aim_snvalid_icq(sn) || aim_snvalid_sms(sn) || aim_snvalid_aim(sn);
221 }
222
223 /**
224 * Determine if a given screen name is an ICQ screen name
225 * (i.e. it is composed of only numbers).
226 *
227 * @param sn A valid AIM or ICQ screen name.
228 * @return TRUE if the screen name is an ICQ screen name. Otherwise
229 * FALSE is returned.
230 */
231 gboolean
232 aim_sn_is_icq(const char *sn)
233 {
234 return aim_snvalid_icq(sn);
235 }
236
237 /**
238 * Determine if a given screen name is an SMS number
239 * (i.e. it begins with a +).
240 *
241 * @param sn A valid AIM or ICQ screen name.
242 * @return TRUE if the screen name is an SMS number. Otherwise
243 * FALSE is returned.
244 */
245 gboolean
246 aim_sn_is_sms(const char *sn)
247 {
248 return (sn[0] == '+');
249 } 221 }
250 222
251 /** 223 /**
252 * This takes two screen names and compares them using the rules 224 * This takes two screen names and compares them using the rules
253 * on screen names for AIM/AOL. Mainly, this means case and space 225 * on screen names for AIM/AOL. Mainly, this means case and space