1 /*
2  *   libcddb - CDDB Interface Library for xmcd/cda
3  *
4  *	This library implements an interface to access the "classic"
5  *	CDDB1 services.
6  *
7  *   Copyright (C) 1993-2004  Ti Kan
8  *   E-mail: xmcd@amb.org
9  *
10  *   This program is free software; you can redistribute it and/or modify
11  *   it under the terms of the GNU General Public License as published by
12  *   the Free Software Foundation; either version 2 of the License, or
13  *   (at your option) any later version.
14  *
15  *   This program is distributed in the hope that it will be useful,
16  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *   GNU General Public License for more details.
19  *
20  *   You should have received a copy of the GNU General Public License
21  *   along with this program; if not, write to the Free Software
22  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  *
24  */
25 #ifndef lint
26 static char     *_disc_c_ident_ = "@(#)disc.c	1.21 03/12/12";
27 #endif
28 
29 #include "fcddb.h"
30 
31 
32 /*
33  * CddbDisc_AddCredit
34  *	Add a credit to a disc object
35  */
36 /*ARGSUSED*/
37 CddbResult
CddbDisc_AddCredit(CddbDiscPtr discp,CddbConstStr id,CddbConstStr name,CddbCreditPtr * pval)38 CddbDisc_AddCredit(
39 	CddbDiscPtr	discp,
40 	CddbConstStr	id,
41 	CddbConstStr	name,
42 	CddbCreditPtr	*pval
43 )
44 {
45 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
46 	cddb_control_t	*cp;
47 	cddb_rolelist_t	*rlp;
48 	cddb_role_t	*rp;
49 	cddb_credit_t	*p;
50 
51 	if (pval == NULL)
52 		return Cddb_E_INVALIDARG;
53 
54 	if (discp == NULL || id == NULL || id[0] == '\0' ||
55 	    name == NULL || name[0] == '\0') {
56 		*pval = NULL;
57 		return Cddb_E_INVALIDARG;
58 	}
59 
60 	p = (cddb_credit_t *) MEM_ALLOC(
61 		"CddbCredit", sizeof(cddb_credit_t)
62 	);
63 	*pval = (CddbCreditPtr) p;
64 
65 	if (p == NULL)
66 		return CDDBTRNOutOfMemory;
67 
68 	(void) memset(p, 0, sizeof(cddb_credit_t));
69 	(void) strcpy(p->objtype, "CddbCredit");
70 
71 	cp = (cddb_control_t *) dp->control;
72 	p->role = NULL;
73 	for (rlp = cp->roletree.rolelists; rlp != NULL; rlp = rlp->next) {
74 		for (rp = rlp->subroles; rp != NULL; rp = rp->next) {
75 			if (strcmp(rp->id, id) == 0) {
76 				p->role = rp;
77 				break;
78 			}
79 		}
80 		if (p->role != NULL)
81 			break;
82 	}
83 	p->fullname.name = (CddbStr) fcddb_strdup((char *) name);
84 
85 	/* Add to list */
86 	p = dp->credits.credits;
87 	dp->credits.credits = p;
88 	dp->credits.count++;
89 
90 	return Cddb_OK;
91 }
92 
93 
94 /*
95  * CddbDisc_AddSegment
96  *	Add a segment to a disc object
97  */
98 /*ARGSUSED*/
99 CddbResult
CddbDisc_AddSegment(CddbDiscPtr discp,CddbConstStr name,CddbSegmentPtr * pval)100 CddbDisc_AddSegment(CddbDiscPtr discp, CddbConstStr name, CddbSegmentPtr *pval)
101 {
102 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
103 	cddb_segment_t	*p;
104 
105 	if (pval == NULL)
106 		return Cddb_E_INVALIDARG;
107 
108 	if (discp == NULL || name == NULL || name[0] == '\0') {
109 		*pval = NULL;
110 		return Cddb_E_INVALIDARG;
111 	}
112 
113 	p = (cddb_segment_t *) MEM_ALLOC(
114 		"CddbSegment", sizeof(cddb_segment_t)
115 	);
116 	*pval = (CddbSegmentPtr) p;
117 
118 	if (p == NULL)
119 		return CDDBTRNOutOfMemory;
120 
121 	(void) memset(p, 0, sizeof(cddb_segment_t));
122 	(void) strcpy(p->objtype, "CddbSegment");
123 
124 	p->name = (CddbStr) fcddb_strdup((char *) name);
125 
126 	/* Add to list */
127 	p = dp->segments.segments;
128 	dp->segments.segments = p;
129 	dp->segments.count++;
130 
131 	return Cddb_OK;
132 }
133 
134 
135 /*
136  * CddbDisc_GetArtist
137  *	Return disc artist
138  */
139 CddbResult
CddbDisc_GetArtist(CddbDiscPtr discp,CddbStr * pval)140 CddbDisc_GetArtist(CddbDiscPtr discp, CddbStr *pval)
141 {
142 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
143 
144 	*pval = (CddbStr) (dp->fullname.name == NULL ? "" : dp->fullname.name);
145 	return Cddb_OK;
146 }
147 
148 
149 /*
150  * CddbDisc_GetArtistFullName
151  *	Return disc artist full name object
152  */
153 CddbResult
CddbDisc_GetArtistFullName(CddbDiscPtr discp,CddbFullNamePtr * pval)154 CddbDisc_GetArtistFullName(CddbDiscPtr discp, CddbFullNamePtr *pval)
155 {
156 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
157 
158 	*pval = (CddbFullNamePtr) &dp->fullname;
159 	return Cddb_OK;
160 }
161 
162 
163 /*
164  * CddbDisc_GetCertifier
165  *	Return disc information certifier
166  */
167 /*ARGSUSED*/
168 CddbResult
CddbDisc_GetCertifier(CddbDiscPtr discp,CddbStr * pval)169 CddbDisc_GetCertifier(CddbDiscPtr discp, CddbStr *pval)
170 {
171 	*pval = "";			/* Not supported in CDDB1 */
172 	return Cddb_OK;
173 }
174 
175 
176 /*
177  * CddbDisc_GetCompilation
178  *	Return whether disc is a compilation
179  */
180 /*ARGSUSED*/
181 CddbResult
CddbDisc_GetCompilation(CddbDiscPtr discp,CddbBoolean * pval)182 CddbDisc_GetCompilation(CddbDiscPtr discp, CddbBoolean *pval)
183 {
184 	*pval = (CddbBoolean) 0;	/* Not supported in CDDB1 */
185 	return Cddb_OK;
186 }
187 
188 
189 /*
190  * CddbDisc_GetCredit
191  *	Return a disc credit
192  */
193 CddbResult
CddbDisc_GetCredit(CddbDiscPtr discp,long item,CddbCreditPtr * pval)194 CddbDisc_GetCredit(CddbDiscPtr discp, long item, CddbCreditPtr *pval)
195 {
196 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
197 	cddb_credit_t	*cp;
198 	long		i;
199 
200 	for (i = 1, cp = dp->credits.credits; cp != NULL; i++, cp = cp->next) {
201 		if (i < item)
202 			continue;
203 
204 		*pval = (CddbCreditPtr) cp;
205 		return Cddb_OK;
206 	}
207 
208 	*pval = NULL;
209 	return Cddb_E_INVALIDARG;
210 }
211 
212 
213 /*
214  * CddbDisc_GetGenreId
215  *	Return disc genre ID
216  */
217 CddbResult
CddbDisc_GetGenreId(CddbDiscPtr discp,CddbStr * pval)218 CddbDisc_GetGenreId(CddbDiscPtr discp, CddbStr *pval)
219 {
220 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
221 
222 	if (dp->genre != NULL)
223 		*pval = dp->genre->id;
224 	else
225 		*pval = "";	/* Shrug */
226 
227 	return Cddb_OK;
228 }
229 
230 
231 /*
232  * CddbDisc_GetLabel
233  *	Return disc recording label
234  */
235 /*ARGSUSED*/
236 CddbResult
CddbDisc_GetLabel(CddbDiscPtr discp,CddbStr * pval)237 CddbDisc_GetLabel(CddbDiscPtr discp, CddbStr *pval)
238 {
239 	*pval = "";			/* Not supported in CDDB1 */
240 	return Cddb_OK;
241 }
242 
243 
244 /*
245  * CddbDisc_GetLanguageId
246  *	Return disc primary language ID
247  */
248 /*ARGSUSED*/
249 CddbResult
CddbDisc_GetLanguageId(CddbDiscPtr discp,CddbStr * pval)250 CddbDisc_GetLanguageId(CddbDiscPtr discp, CddbStr *pval)
251 {
252 	*pval = "";			/* Not supported in CDDB1 */
253 	return Cddb_OK;
254 }
255 
256 
257 /*
258  * CddbDisc_GetLanguages
259  *	Return alternative disc languages
260  */
261 /*ARGSUSED*/
262 CddbResult
CddbDisc_GetLanguages(CddbDiscPtr discp,CddbLanguagesPtr * pval)263 CddbDisc_GetLanguages(CddbDiscPtr discp, CddbLanguagesPtr *pval)
264 {
265 	*pval = NULL;			/* Not supported in CDDB1 */
266 	return Cddb_OK;
267 }
268 
269 
270 /*
271  * CddbDisc_GetMediaId
272  *	Return disc media ID
273  */
274 /*ARGSUSED*/
275 CddbResult
CddbDisc_GetMediaId(CddbDiscPtr discp,CddbStr * pval)276 CddbDisc_GetMediaId(CddbDiscPtr discp, CddbStr *pval)
277 {
278 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
279 
280 	/* For CDDB1 we store the disc ID in the MediaId */
281 	if (dp->discid != NULL)
282 		*pval = (CddbStr) dp->discid;
283 	else
284 		*pval = "";	/* Shrug */
285 
286 	return Cddb_OK;
287 }
288 
289 
290 /*
291  * CddbDisc_GetMuiId
292  *	Return disc MUI ID
293  */
294 /*ARGSUSED*/
295 CddbResult
CddbDisc_GetMuiId(CddbDiscPtr discp,CddbStr * pval)296 CddbDisc_GetMuiId(CddbDiscPtr discp, CddbStr *pval)
297 {
298 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
299 
300 	/* For CDDB1 we store the category in the MuiId */
301 	if (dp->category != NULL)
302 		*pval = (CddbStr) dp->category;
303 	else
304 		*pval = "";	/* Shrug */
305 
306 	return Cddb_OK;
307 }
308 
309 
310 /*
311  * CddbDisc_GetNotes
312  *	Return disc notes
313  */
314 CddbResult
CddbDisc_GetNotes(CddbDiscPtr discp,CddbStr * pval)315 CddbDisc_GetNotes(CddbDiscPtr discp, CddbStr *pval)
316 {
317 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
318 
319 	*pval = (CddbStr) (dp->notes == NULL ? "" : dp->notes);
320 	return Cddb_OK;
321 }
322 
323 
324 /*
325  * CddbDisc_GetNumberInSet
326  *	Return disc number in set
327  */
328 /*ARGSUSED*/
329 CddbResult
CddbDisc_GetNumberInSet(CddbDiscPtr discp,CddbStr * pval)330 CddbDisc_GetNumberInSet(CddbDiscPtr discp, CddbStr *pval)
331 {
332 	*pval = "";			/* Not supported in CDDB1 */
333 	return Cddb_OK;
334 }
335 
336 
337 /*
338  * CddbDisc_GetNumCredits
339  *	Return number of credits
340  */
341 /*ARGSUSED*/
342 CddbResult
CddbDisc_GetNumCredits(CddbDiscPtr discp,long * pval)343 CddbDisc_GetNumCredits(CddbDiscPtr discp, long *pval)
344 {
345 	*pval = 0;
346 	return Cddb_OK;
347 }
348 
349 
350 /*
351  * CddbDisc_GetNumSegments
352  *	Return number of segments
353  */
354 /*ARGSUSED*/
355 CddbResult
CddbDisc_GetNumSegments(CddbDiscPtr discp,long * pval)356 CddbDisc_GetNumSegments(CddbDiscPtr discp, long *pval)
357 {
358 	*pval = 0;
359 	return Cddb_OK;
360 }
361 
362 
363 /*
364  * CddbDisc_GetNumTracks
365  *	Return number of tracks
366  */
367 CddbResult
CddbDisc_GetNumTracks(CddbDiscPtr discp,long * pval)368 CddbDisc_GetNumTracks(CddbDiscPtr discp, long *pval)
369 {
370 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
371 
372 	*pval = dp->tracks.count;
373 	return Cddb_OK;
374 }
375 
376 
377 /*
378  * CddbDisc_GetRegionId
379  *	Return disc region ID
380  */
381 /*ARGSUSED*/
382 CddbResult
CddbDisc_GetRegionId(CddbDiscPtr discp,CddbStr * pval)383 CddbDisc_GetRegionId(CddbDiscPtr discp, CddbStr *pval)
384 {
385 	*pval = "";			/* Not supported in CDDB1 */
386 	return Cddb_OK;
387 }
388 
389 
390 /*
391  * CddbDisc_GetRevision
392  *	Return disc info revision
393  */
394 CddbResult
CddbDisc_GetRevision(CddbDiscPtr discp,CddbStr * pval)395 CddbDisc_GetRevision(CddbDiscPtr discp, CddbStr *pval)
396 {
397 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
398 
399 	*pval = (CddbStr) (dp->revision == NULL ? "" : dp->revision);
400 	return Cddb_OK;
401 }
402 
403 
404 /*
405  * CddbDisc_GetRevisionTag
406  *	Return disc info revision tag
407  */
408 /*ARGSUSED*/
409 CddbResult
CddbDisc_GetRevisionTag(CddbDiscPtr discp,CddbStr * pval)410 CddbDisc_GetRevisionTag(CddbDiscPtr discp, CddbStr *pval)
411 {
412 	*pval = "";			/* Not supported in CDDB1 */
413 	return Cddb_OK;
414 }
415 
416 
417 /*
418  * CddbDisc_GetSecondaryGenreId
419  *	Return disc secondary genre ID
420  */
421 /*ARGSUSED*/
422 CddbResult
CddbDisc_GetSecondaryGenreId(CddbDiscPtr discp,CddbStr * pval)423 CddbDisc_GetSecondaryGenreId(CddbDiscPtr discp, CddbStr *pval)
424 {
425 	*pval = "";			/* Not supported in CDDB1 */
426 	return Cddb_OK;
427 }
428 
429 
430 /*
431  * CddbDisc_GetSegment
432  *	Return a disc segment
433  */
434 /*ARGSUSED*/
435 CddbResult
CddbDisc_GetSegment(CddbDiscPtr discp,long item,CddbSegmentPtr * pval)436 CddbDisc_GetSegment(CddbDiscPtr discp, long item, CddbSegmentPtr *pval)
437 {
438 	*pval = NULL;			/* Not supported in CDDB1 */
439 	return Cddb_OK;
440 }
441 
442 
443 /*
444  * CddbDisc_GetTitle
445  *	Return disc title
446  */
447 CddbResult
CddbDisc_GetTitle(CddbDiscPtr discp,CddbStr * pval)448 CddbDisc_GetTitle(CddbDiscPtr discp, CddbStr *pval)
449 {
450 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
451 
452 	*pval = (CddbStr) (dp->title == NULL ? "" : dp->title);
453 	return Cddb_OK;
454 }
455 
456 
457 /*
458  * CddbDisc_GetTitleSort
459  *	Return disc sort title
460  */
461 /*ARGSUSED*/
462 CddbResult
CddbDisc_GetTitleSort(CddbDiscPtr discp,CddbStr * pval)463 CddbDisc_GetTitleSort(CddbDiscPtr discp, CddbStr *pval)
464 {
465 	*pval = "";			/* Not supported in CDDB1 */
466 	return Cddb_OK;
467 }
468 
469 
470 /*
471  * CddbDisc_GetTitleThe
472  *	Return disc sort title "The" string
473  */
474 /*ARGSUSED*/
475 CddbResult
CddbDisc_GetTitleThe(CddbDiscPtr discp,CddbStr * pval)476 CddbDisc_GetTitleThe(CddbDiscPtr discp, CddbStr *pval)
477 {
478 	*pval = "";			/* Not supported in CDDB1 */
479 	return Cddb_OK;
480 }
481 
482 
483 /*
484  * CddbDisc_GetTitleUId
485  *	Return title unique ID
486  */
487 /*ARGSUSED*/
488 CddbResult
CddbDisc_GetTitleUId(CddbDiscPtr discp,CddbStr * pval)489 CddbDisc_GetTitleUId(CddbDiscPtr discp, CddbStr *pval)
490 {
491 	*pval = "";			/* Not supported in CDDB1 */
492 	return Cddb_OK;
493 }
494 
495 
496 /*
497  * CddbDisc_GetTotalInSet
498  *	Return total discs in set
499  */
500 /*ARGSUSED*/
501 CddbResult
CddbDisc_GetTotalInSet(CddbDiscPtr discp,CddbStr * pval)502 CddbDisc_GetTotalInSet(CddbDiscPtr discp, CddbStr *pval)
503 {
504 	*pval = "";			/* Not supported in CDDB1 */
505 	return Cddb_OK;
506 }
507 
508 
509 /*
510  * CddbDisc_GetTrack
511  *	Return a disc track object
512  */
513 CddbResult
CddbDisc_GetTrack(CddbDiscPtr discp,long item,CddbTrackPtr * pval)514 CddbDisc_GetTrack(CddbDiscPtr discp, long item, CddbTrackPtr *pval)
515 {
516 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
517 
518 	*pval = (CddbTrackPtr) &dp->tracks.track[(int) (item - 1)];
519 	return Cddb_OK;
520 }
521 
522 
523 /*
524  * CddbDisc_GetYear
525  *	Return year object
526  */
527 /*ARGSUSED*/
528 CddbResult
CddbDisc_GetYear(CddbDiscPtr discp,CddbStr * pval)529 CddbDisc_GetYear(CddbDiscPtr discp, CddbStr *pval)
530 {
531 	*pval = "";			/* Not supported in CDDB1 */
532 	return Cddb_OK;
533 }
534 
535 
536 /*
537  * CddbDisc_PutArtist
538  *	Set the disc artist name
539  */
540 CddbResult
CddbDisc_PutArtist(CddbDiscPtr discp,CddbConstStr newval)541 CddbDisc_PutArtist(CddbDiscPtr discp, CddbConstStr newval)
542 {
543 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
544 
545 	if (dp->fullname.name != NULL)
546 		MEM_FREE(dp->fullname.name);
547 
548 	if (newval == NULL || newval[0] == '\0')
549 		dp->fullname.name = NULL;
550 	else
551 		dp->fullname.name = (CddbStr) fcddb_strdup((char *) newval);
552 
553 	return Cddb_OK;
554 }
555 
556 
557 /*
558  * CddbDisc_PutArtistFullName
559  *	Set the disc artist full name information
560  */
561 CddbResult
CddbDisc_PutArtistFullName(CddbDiscPtr discp,const CddbFullNamePtr newval)562 CddbDisc_PutArtistFullName(CddbDiscPtr discp, const CddbFullNamePtr newval)
563 {
564 	cddb_disc_t		*dp = (cddb_disc_t *) discp;
565 	cddb_fullname_t	*fnp = (cddb_fullname_t *) newval;
566 
567 	if (newval == NULL)
568 		return Cddb_E_INVALIDARG;
569 
570 	if (dp->fullname.name != NULL)
571 		MEM_FREE(dp->fullname.name);
572 	if (dp->fullname.lastname != NULL)
573 		MEM_FREE(dp->fullname.lastname);
574 	if (dp->fullname.firstname != NULL)
575 		MEM_FREE(dp->fullname.firstname);
576 	if (dp->fullname.the != NULL)
577 		MEM_FREE(dp->fullname.the);
578 
579 	dp->fullname.name = (CddbStr) fcddb_strdup(fnp->name);
580 	dp->fullname.lastname = (CddbStr) fcddb_strdup(fnp->lastname);
581 	dp->fullname.firstname = (CddbStr) fcddb_strdup(fnp->firstname);
582 	dp->fullname.the = (CddbStr) fcddb_strdup(fnp->the);
583 
584 	return Cddb_OK;
585 }
586 
587 
588 /*
589  * CddbDisc_PutCompilation
590  *	Set the disc compilation flag
591  */
592 /*ARGSUSED*/
593 CddbResult
CddbDisc_PutCompilation(CddbDiscPtr discp,CddbBoolean newval)594 CddbDisc_PutCompilation(CddbDiscPtr discp, CddbBoolean newval)
595 {
596 	/* Not supported in CDDB1 */
597 	return Cddb_OK;
598 }
599 
600 
601 /*
602  * CddbDisc_PutGenreId
603  *	Set the disc genre ID
604  */
605 CddbResult
CddbDisc_PutGenreId(CddbDiscPtr discp,CddbConstStr newval)606 CddbDisc_PutGenreId(CddbDiscPtr discp, CddbConstStr newval)
607 {
608 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
609 
610 	dp->genre = fcddb_genre_id2gp((cddb_control_t *) dp->control,
611 				       (char *) newval);
612 	return Cddb_OK;
613 }
614 
615 
616 /*
617  * CddbDisc_PutLabel
618  *	Set the disc recording label
619  */
620 /*ARGSUSED*/
621 CddbResult
CddbDisc_PutLabel(CddbDiscPtr discp,CddbConstStr newval)622 CddbDisc_PutLabel(CddbDiscPtr discp, CddbConstStr newval)
623 {
624 	/* Not supported in CDDB1 */
625 	return Cddb_OK;
626 }
627 
628 
629 /*
630  * CddbDisc_PutLanguageId
631  *	Set the disc language ID
632  */
633 /*ARGSUSED*/
634 CddbResult
CddbDisc_PutLanguageId(CddbDiscPtr discp,CddbConstStr newval)635 CddbDisc_PutLanguageId(CddbDiscPtr discp, CddbConstStr newval)
636 {
637 	/* Not supported in CDDB1 */
638 	return Cddb_OK;
639 }
640 
641 
642 /*
643  * CddbDisc_PutNotes
644  *	Set the disc notes
645  */
646 CddbResult
CddbDisc_PutNotes(CddbDiscPtr discp,CddbConstStr newval)647 CddbDisc_PutNotes(CddbDiscPtr discp, CddbConstStr newval)
648 {
649 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
650 
651 	if (dp->notes != NULL)
652 		MEM_FREE(dp->notes);
653 
654 	if (newval == NULL || newval[0] == '\0')
655 		dp->notes = NULL;
656 	else
657 		dp->notes = (CddbStr) fcddb_strdup((char *) newval);
658 
659 	return Cddb_OK;
660 }
661 
662 
663 /*
664  * CddbDisc_PutNumberInSet
665  *	Set the disc number in set
666  */
667 /*ARGSUSED*/
668 CddbResult
CddbDisc_PutNumberInSet(CddbDiscPtr discp,CddbConstStr newval)669 CddbDisc_PutNumberInSet(CddbDiscPtr discp, CddbConstStr newval)
670 {
671 	/* Not supported in CDDB1 */
672 	return Cddb_OK;
673 }
674 
675 
676 /*
677  * CddbDisc_PutRegionId
678  *	Set the disc region ID
679  */
680 /*ARGSUSED*/
681 CddbResult
CddbDisc_PutRegionId(CddbDiscPtr discp,CddbConstStr newval)682 CddbDisc_PutRegionId(CddbDiscPtr discp, CddbConstStr newval)
683 {
684 	/* Not supported in CDDB1 */
685 	return Cddb_OK;
686 }
687 
688 
689 /*
690  * CddbDisc_PutRevision
691  *	Set the disc information revision number
692  */
693 CddbResult
CddbDisc_PutRevision(CddbDiscPtr discp,CddbConstStr newval)694 CddbDisc_PutRevision(CddbDiscPtr discp, CddbConstStr newval)
695 {
696 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
697 
698 	if (dp->revision != NULL)
699 		MEM_FREE(dp->revision);
700 
701 	if (newval == NULL || newval[0] == '\0')
702 		dp->revision = NULL;
703 	else
704 		dp->revision = fcddb_strdup((char *) newval);
705 
706 	return Cddb_OK;
707 }
708 
709 
710 /*
711  * CddbDisc_PutRevisionTag
712  *	Set the disc information revision tag
713  */
714 /*ARGSUSED*/
715 CddbResult
CddbDisc_PutRevisionTag(CddbDiscPtr discp,CddbConstStr newval)716 CddbDisc_PutRevisionTag(CddbDiscPtr discp, CddbConstStr newval)
717 {
718 	/* Not supported in CDDB1 */
719 	return Cddb_OK;
720 }
721 
722 
723 /*
724  * CddbDisc_PutSecondaryGenreId
725  *	Set the disc secondary genre ID
726  */
727 /*ARGSUSED*/
728 CddbResult
CddbDisc_PutSecondaryGenreId(CddbDiscPtr discp,CddbConstStr newval)729 CddbDisc_PutSecondaryGenreId(CddbDiscPtr discp, CddbConstStr newval)
730 {
731 	/* Not supported in CDDB1 */
732 	return Cddb_OK;
733 }
734 
735 
736 /*
737  * CddbDisc_PutTitle
738  *	Set the disc title
739  */
740 CddbResult
CddbDisc_PutTitle(CddbDiscPtr discp,CddbConstStr newval)741 CddbDisc_PutTitle(CddbDiscPtr discp, CddbConstStr newval)
742 {
743 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
744 
745 	if (dp->title != NULL)
746 		MEM_FREE(dp->title);
747 
748 	if (newval == NULL || newval[0] == '\0')
749 		dp->title = NULL;
750 	else
751 		dp->title = (CddbStr) fcddb_strdup((char *) newval);
752 
753 	return Cddb_OK;
754 }
755 
756 
757 /*
758  * CddbDisc_PutTitleSort
759  *	Set the disc sort title
760  */
761 /*ARGSUSED*/
762 CddbResult
CddbDisc_PutTitleSort(CddbDiscPtr discp,CddbConstStr newval)763 CddbDisc_PutTitleSort(CddbDiscPtr discp, CddbConstStr newval)
764 {
765 	/* Not supported in CDDB1 */
766 	return Cddb_OK;
767 }
768 
769 
770 /*
771  * CddbDisc_PutTitleThe
772  *	Set the disc sort title "The" string
773  */
774 /*ARGSUSED*/
775 CddbResult
CddbDisc_PutTitleThe(CddbDiscPtr discp,CddbConstStr newval)776 CddbDisc_PutTitleThe(CddbDiscPtr discp, CddbConstStr newval)
777 {
778 	/* Not supported in CDDB1 */
779 	return Cddb_OK;
780 }
781 
782 
783 /*
784  * CddbDisc_PutToc
785  *	Set the disc TOC
786  */
787 CddbResult
CddbDisc_PutToc(CddbDiscPtr discp,CddbConstStr newval)788 CddbDisc_PutToc(CddbDiscPtr discp, CddbConstStr newval)
789 {
790 	cddb_disc_t	*dp = (cddb_disc_t *) discp;
791 
792 	if (dp->toc != NULL)
793 		MEM_FREE(dp->toc);
794 
795 	if (newval == NULL || newval[0] == '\0')
796 		dp->toc = NULL;
797 	else
798 		dp->toc = (CddbStr) fcddb_strdup((char *) newval);
799 
800 	return Cddb_OK;
801 }
802 
803 
804 /*
805  * CddbDisc_PutTotalInSet
806  *	Set the total number of discs in set
807  */
808 /*ARGSUSED*/
809 CddbResult
CddbDisc_PutTotalInSet(CddbDiscPtr discp,CddbConstStr newval)810 CddbDisc_PutTotalInSet(CddbDiscPtr discp, CddbConstStr newval)
811 {
812 	/* Not supported in CDDB1 */
813 	return Cddb_OK;
814 }
815 
816 
817 /*
818  * CddbDisc_PutYear
819  *	Set the year
820  */
821 /*ARGSUSED*/
822 CddbResult
CddbDisc_PutYear(CddbDiscPtr discp,CddbConstStr newval)823 CddbDisc_PutYear(CddbDiscPtr discp, CddbConstStr newval)
824 {
825 	/* Not supported in CDDB1 */
826 	return Cddb_OK;
827 }
828 
829 
830