1 /***************************************************************************
2  *                                                                         *
3  *    LIBDSK: General floppy and diskimage access library                  *
4  *    Copyright (C) 2003  John Elliott <seasip.webmaster@gmail.com>            *
5  *                                                                         *
6  *    This library is free software; you can redistribute it and/or        *
7  *    modify it under the terms of the GNU Library General Public          *
8  *    License as published by the Free Software Foundation; either         *
9  *    version 2 of the License, or (at your option) any later version.     *
10  *                                                                         *
11  *    This library is distributed in the hope that it will be useful,      *
12  *    but WITHOUT ANY WARRANTY; without even the implied warranty of       *
13  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    *
14  *    Library General Public License for more details.                     *
15  *                                                                         *
16  *    You should have received a copy of the GNU Library General Public    *
17  *    License along with this library; if not, write to the Free           *
18  *    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,      *
19  *    MA 02111-1307, USA                                                   *
20  *                                                                         *
21  ***************************************************************************/
22 
23 #include "drvi.h"
24 
25 
dsk_set_comment(DSK_PDRIVER self,const char * comment)26 LDPUBLIC32 dsk_err_t  LDPUBLIC16 dsk_set_comment(DSK_PDRIVER self, const char *comment)
27 {
28 	if (!self || !comment) return DSK_ERR_BADPTR;
29 
30 	if (self->dr_comment) dsk_free(self->dr_comment);
31 	self->dr_comment = dsk_malloc(1 + strlen(comment));
32 	if (!self->dr_comment) return DSK_ERR_NOMEM;
33 	strcpy(self->dr_comment, comment);
34 	self->dr_dirty = 1;	/* Comment will want writing back */
35 	return DSK_ERR_OK;
36 
37 }
38 
39 
dsk_get_comment(DSK_PDRIVER self,char ** comment)40 LDPUBLIC32 dsk_err_t  LDPUBLIC16 dsk_get_comment(DSK_PDRIVER self, char **comment)
41 {
42 	if (!self || !comment) return DSK_ERR_BADPTR;
43 	*comment = self->dr_comment;
44 	return DSK_ERR_OK;
45 }
46 
47